repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
kcpawan/django
refs/heads/master
tests/timezones/urls.py
406
from django.conf.urls import url from . import admin as tz_admin # NOQA: register tz_admin urlpatterns = [ url(r'^admin/', tz_admin.site.urls), ]
otfbot/otfbot
refs/heads/master
otfbot/plugins/remoteCliServer/control.py
1
# This file is part of OtfBot. # # OtfBot is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # OtfBot is distributed in the hope that it...
trevornelson/squeeklights
refs/heads/master
simplejson/tests/test_item_sort_key.py
140
from unittest import TestCase import simplejson as json from operator import itemgetter class TestItemSortKey(TestCase): def test_simple_first(self): a = {'a': 1, 'c': 5, 'jack': 'jill', 'pick': 'axe', 'array': [1, 5, 6, 9], 'tuple': (83, 12, 3), 'crate': 'dog', 'zeak': 'oh'} self.assertEqual( ...
tscohen/chainer
refs/heads/master
tests/cupy_tests/math_tests/test_misc.py
4
import unittest import numpy from cupy import testing @testing.gpu class TestMisc(unittest.TestCase): _multiprocess_can_split_ = True @testing.for_all_dtypes() @testing.numpy_cupy_allclose(atol=1e-5) def check_unary(self, name, xp, dtype, no_bool=False): if no_bool and numpy.dtype(dtype).c...
lenarother/moderna
refs/heads/master
tests/test_analyze/test_chain_connectivity.py
1
from unittest import main, TestCase from Bio.PDB.PDBParser import PDBParser from moderna.analyze.ChainConnectivity import are_residues_connected, \ is_backbone_complete, is_backbone_intact, \ is_phosphate_intact, is_backbone_congested from moderna.ModernaStructure import ModernaStructure from moderna.RNAResidu...
michalfaber/CarND-Behavioral-Cloning
refs/heads/master
drive.py
1
import argparse import base64 import json import cv2 import numpy as np import socketio import eventlet import eventlet.wsgi import time from PIL import Image from PIL import ImageOps from flask import Flask, render_template from io import BytesIO from keras.models import model_from_json from keras.pr...
teamfx/openjfx-10-dev-rt
refs/heads/master
modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/port/image_diff_unittest.py
3
# Copyright (C) 2012 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
htwenhe/DJOA
refs/heads/master
env/Lib/site-packages/django/db/backends/base/validation.py
393
class BaseDatabaseValidation(object): """ This class encapsulates all backend-specific model validation. """ def __init__(self, connection): self.connection = connection def check_field(self, field, **kwargs): return []
vikas1885/test1
refs/heads/master
cms/djangoapps/contentstore/management/commands/clone_course.py
119
""" Script for cloning a course """ from django.core.management.base import BaseCommand, CommandError from xmodule.modulestore.django import modulestore from student.roles import CourseInstructorRole, CourseStaffRole from opaque_keys.edx.keys import CourseKey from opaque_keys import InvalidKeyError from opaque_keys.edx...
danieljaouen/ansible
refs/heads/devel
test/units/module_utils/basic/test_run_command.py
86
# -*- coding: utf-8 -*- # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division) __metaclass__ = type import errno from itertools import product from io import Byt...
TheTypoMaster/evennia
refs/heads/master
evennia/typeclasses/django_new_patch.py
6
""" This is a patch of django.db.models.base.py:__new__, to allow for the proxy system to allow multiple inheritance when both parents are of the same base model. This patch is implemented as per https://code.djangoproject.com/ticket/11560 and will hopefully be possibe to remove as it gets adde to django's main branch...
abgoyal/zen_u105_kernel
refs/heads/master
tools/perf/scripts/python/sctop.py
11180
# system call top # (c) 2010, Tom Zanussi <[email protected]> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
lehoanganh/kcsdb
refs/heads/master
chef-repo/.chef/murder-kcsd/dist/BitTornado/bencode.py
17
# Written by Petru Paler, Uoti Urpala, Ross Cohen and John Hoffman # see LICENSE.txt for license information from types import IntType, LongType, StringType, ListType, TupleType, DictType try: from types import BooleanType except ImportError: BooleanType = None try: from types import UnicodeType except Imp...
siosio/intellij-community
refs/heads/master
python/testData/inspections/PyRedundantParenthesesInspection/While.py
83
while <weak_warning descr="Remove redundant parentheses">(True)</weak_warning>: pass
sensukho/mgcommunity
refs/heads/master
vendor/doctrine/orm/docs/en/conf.py
2448
# -*- coding: utf-8 -*- # # Doctrine 2 ORM documentation build configuration file, created by # sphinx-quickstart on Fri Dec 3 18:10:24 2010. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. ...
Zhongqilong/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/logging/__init__.py
63
# Copyright 2001-2014 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
fubecka/f5-dashboard
refs/heads/master
flask/lib/python2.6/site-packages/migrate/tests/__init__.py
78
# make this package available during imports as long as we support <python2.5 import sys import os sys.path.append(os.path.dirname(os.path.abspath(__file__))) from unittest import TestCase import migrate import six class TestVersionDefined(TestCase): def test_version(self): """Test for migrate.__version...
Mariaanisimova/pythonintask
refs/heads/master
INBa/2015/Mitin_D_S/task_8_15.py
1
# Задача 8. Вариант 15. # Доработайте игру "Анаграммы" (см. М.Доусон Программируем на Python. Гл.4) так, чтобы к каждому слову полагалась подсказка. # Игрок должен получать право на подсказку в том случае, если у него нет никаких предположений. # Разработайте систему начисления очков, по которой бы игроки, отгадавшие...
jermainewang/mxnet
refs/heads/master
tools/pip_package/setup.py
45
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
EricssonResearch/scott-eu
refs/heads/master
simulation-ros/src/turtlebot2i/turtlebot2i_msdn/msdn/faster_rcnn/rpn_msr/generate_anchors.py
1
# -------------------------------------------------------- # Faster R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick and Sean Bell # -------------------------------------------------------- import numpy as np # Verify that we compute the same a...
arifsetiawan/edx-platform
refs/heads/master
lms/djangoapps/mailing/management/commands/mailchimp_id.py
155
""" mailchimp_id: Returns whether or not a given mailchimp key represents a valid list. """ import sys from optparse import make_option from django.core.management.base import BaseCommand, CommandError from mailsnake import MailSnake class Command(BaseCommand): """ Given a mailchimp key, validates that a li...
andrewsmedina/django
refs/heads/master
django/contrib/comments/models.py
125
from django.conf import settings from django.contrib.comments.managers import CommentManager from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType from django.contrib.sites.models import Site from django.core import urlresolvers from django.db import models from djan...
musicwarez/testproj
refs/heads/master
testproj/my_test/1.py
1
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys import login_form import login import untitled as main_window import main from Queue import Queue class FirstWindow(login.LoginWindow): def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.ui = login_form.Ui_L...
dkodnik/arp
refs/heads/master
addons/im_livechat/__init__.py
40
import im_livechat
mujiansu/pip
refs/heads/develop
pip/_vendor/html5lib/treewalkers/genshistream.py
1730
from __future__ import absolute_import, division, unicode_literals from genshi.core import QName from genshi.core import START, END, XML_NAMESPACE, DOCTYPE, TEXT from genshi.core import START_NS, END_NS, START_CDATA, END_CDATA, PI, COMMENT from . import _base from ..constants import voidElements, namespaces class ...
sauravpratihar/sugar
refs/heads/master
src/jarabe/view/customizebundle.py
10
# Copyright (C) 2011 Walter Bender # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in ...
jswanljung/iris
refs/heads/master
lib/iris/tests/experimental/__init__.py
17
# (C) British Crown Copyright 2010 - 2015, Met Office # # This file is part of Iris. # # Iris is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option) any l...
mcgill-robotics/Firmware
refs/heads/master
Tools/px4moduledoc/srcparser.py
2
import sys import re import math import textwrap class ModuleDocumentation(object): """ documentation for a single module """ valid_categories = ['driver', 'estimator', 'controller', 'system', 'communication', 'command', 'template'] max_line_length = 80 # wrap lines that a...
rafaeltomesouza/frontend-class1
refs/heads/master
aula2/a11/linkedin/client/.gradle/yarn/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py
1509
# Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Handle version information related to Visual Stuio.""" import errno import os import re import subprocess import sys import gyp import glob class VisualStudi...
andremiller/beets
refs/heads/master
test/test_lastgenre.py
1
# This file is part of beets. # Copyright 2015, Fabrice Laporte. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy,...
dob71/x2swn
refs/heads/master
printrun/gui/controls.py
1
# This file is part of the Printrun suite. # # Printrun is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Printrun is distributed in ...
zepto/clipspeak
refs/heads/master
clipspeak/speaker.py
1
#!/usr/bin/env python # vim: sw=4:ts=4:sts=4:fdm=indent:fdl=0: # -*- coding: UTF8 -*- # # An object for using espeak_text for 'playing' text. # Copyright (C) 2013 Josiah Gordon <[email protected]> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lic...
adambrenecki/django
refs/heads/master
django/core/cache/backends/filebased.py
114
"File-based cache backend" import hashlib import os import shutil import time try: from django.utils.six.moves import cPickle as pickle except ImportError: import pickle from django.core.cache.backends.base import BaseCache, DEFAULT_TIMEOUT from django.utils.encoding import force_bytes class FileBasedCache(...
svanschalkwyk/datafari
refs/heads/master
windows/python/Lib/test/test_threaded_import.py
137
# This is a variant of the very old (early 90's) file # Demo/threads/bug.py. It simply provokes a number of threads into # trying to import the same module "at the same time". # There are no pleasant failure modes -- most likely is that Python # complains several times about module random having no attribute # randran...
bgxavier/nova
refs/heads/master
nova/tests/unit/api/openstack/compute/test_server_metadata.py
33
# Copyright 2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
ForgottenKahz/CloudOPC
refs/heads/master
venv/Lib/site-packages/setuptools/command/egg_info.py
100
"""setuptools.command.egg_info Create a distribution's .egg-info directory and contents""" from distutils.filelist import FileList as _FileList from distutils.util import convert_path from distutils import log import distutils.errors import distutils.filelist import os import re import sys try: from setuptools_s...
jbedorf/tensorflow
refs/heads/master
tensorflow/contrib/model_pruning/python/strip_pruning_vars_test.py
25
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
mcsosa121/cafa
refs/heads/master
cafaenv/lib/python2.7/site-packages/psycopg2/tests/test_errcodes.py
7
#!/usr/bin/env python # test_errcodes.py - unit test for psycopg2.errcodes module # # Copyright (C) 2015 Daniele Varrazzo <[email protected]> # # psycopg2 is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published # by the Free Software ...
tunneln/CarnotKE
refs/heads/master
jyhton/Lib/test/test_bytes.py
9
"""Unit tests for the bytes and bytearray types. XXX This is a mess. Common tests should be moved to buffer_tests.py, which itself ought to be unified with string_tests.py (and the latter should be modernized). """ import os import re import sys import copy import functools import pickle import tempfile import unitt...
openhatch/new-mini-tasks
refs/heads/master
vendor/packages/Django/django/template/debug.py
110
from django.template.base import Lexer, Parser, tag_re, NodeList, VariableNode, TemplateSyntaxError from django.utils.encoding import force_text from django.utils.html import escape from django.utils.safestring import SafeData, EscapeData from django.utils.formats import localize from django.utils.timezone import templ...
youdonghai/intellij-community
refs/heads/master
python/testData/refactoring/introduceConstant/py1840EntireLine.py
83
<selection>exec(open("tmp.txt").read())</selection>
tmkasun/Knnect
refs/heads/master
server_core/repo/core/event_porcessor.py
1
class IEventProcessor(object): def __init__(self): pass def data_in(self, geojson): raise NotImplementedError("Subclass need to implement this method") def data_out(self, geojson): raise NotImplementedError("Subclass need to implement this method")
coillarach/PCWG
refs/heads/master
uncertainty.py
5
import pandas as pd import numpy as np import datetime import math import binning class Config: def __init__(self): self.inputTimeSeriesPath = "test.dat" self.timeStamp = "Date & Time Stamp" self.actualPower = "Power" self.inputHubWindSpeed = "WindSpeed" self.dateFormat = "%d/%m/%y %H:%M" self.heade...
bwrsandman/OpenUpgrade
refs/heads/8.0
addons/decimal_precision/decimal_precision.py
233
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the G...
flwh/KK_mt6589_iq451
refs/heads/master
prebuilts/python/linux-x86/2.7.5/lib/python2.7/mimetools.py
334
"""Various tools used by MIME-reading or MIME-writing programs.""" import os import sys import tempfile from warnings import filterwarnings, catch_warnings with catch_warnings(): if sys.py3kwarning: filterwarnings("ignore", ".*rfc822 has been removed", DeprecationWarning) import rfc822 from warnings ...
techvoltage/capstone
refs/heads/master
bindings/python/capstone/x86_const.py
33
# For Capstone Engine. AUTO-GENERATED FILE, DO NOT EDIT [x86_const.py] # X86 registers X86_REG_INVALID = 0 X86_REG_AH = 1 X86_REG_AL = 2 X86_REG_AX = 3 X86_REG_BH = 4 X86_REG_BL = 5 X86_REG_BP = 6 X86_REG_BPL = 7 X86_REG_BX = 8 X86_REG_CH = 9 X86_REG_CL = 10 X86_REG_CS = 11 X86_REG_CX = 12 X86_REG_DH = 13 X86_REG_DI ...
ibmsoe/ImpalaPPC
refs/heads/Impala2.6-main
tests/failure/test_failpoints.py
2
# Copyright (c) 2012 Cloudera, Inc. All rights reserved. # Injects failures at specific locations in each of the plan nodes. Currently supports # two types of failures - cancellation of the query and a failure test hook. # import os import pytest import re from copy import copy from collections import defaultdict from...
BT-astauder/odoo
refs/heads/8.0
openerp/addons/base/ir/ir_model.py
6
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2014 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
richardcs/ansible
refs/heads/devel
lib/ansible/module_utils/network/routeros/routeros.py
35
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
dmeulen/home-assistant
refs/heads/dev
homeassistant/components/lock/vera.py
18
""" Support for Vera locks. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/lock.vera/ """ import logging from homeassistant.components.lock import LockDevice from homeassistant.const import (STATE_LOCKED, STATE_UNLOCKED) from homeassistant.components.ve...
areski/django
refs/heads/master
tests/migrations/test_migrations_squashed_complex/3_squashed_5.py
770
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): replaces = [ ("migrations", "3_auto"), ("migrations", "4_auto"), ("migrations", "5_auto"), ] dependencies = [("migrations", "2_auto")] ope...
vane/django_tornado
refs/heads/master
push/context_processors.py
1
#!/usr/bin/python # -*- coding: utf-8 -*- __author__ = '[email protected]' import constraint def const(request): return { 'SITE_PROTOCOL': constraint.PROTOCOL, 'SITE_HOST': constraint.HOST, 'SITE_PORT': constraint.PORT, }
davie668/myQuiz
refs/heads/master
node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/gyptest.py
1752
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. __doc__ = """ gyptest.py -- test runner for GYP tests. """ import os import optparse import subprocess import sys class CommandRunner(obje...
reelai/packstack
refs/heads/master
packstack/installer/utils/__init__.py
6
# -*- coding: utf-8 -*- from .datastructures import SortedDict from .decorators import retry from .network import get_localhost_ip, host2ip, force_ip, device_from_ip from .shell import ScriptRunner, execute from .shortcuts import (host_iter, hosts, get_current_user, get_current_username, split_...
RockySteveJobs/python-for-android
refs/heads/master
python-modules/pybluez/examples/advanced/inquiry-with-rssi.py
47
# performs a simple device inquiry, followed by a remote name request of each # discovered device import os import sys import struct import bluetooth._bluetooth as bluez def printpacket(pkt): for c in pkt: sys.stdout.write("%02x " % struct.unpack("B",c)[0]) print def read_inquiry_mode(sock): ""...
NEERAJIITKGP/pybbm
refs/heads/master
pybb/profiles.py
11
# coding=utf-8 from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db import models from django.utils.translation import ugettext_lazy as _ from pybb import defaults, util from pybb.compat import get_image_field_class, get_username_field TZ_CHOICES = [(float(x[0]), x[1...
tktrungna/leetcode
refs/heads/master
Python/reverse-linked-list.py
1
""" QUESTION: Reverse a singly linked list. Hint: A linked list can be reversed either iteratively or recursively. Could you implement both? """ # Definition for singly-linked list. class ListNode: def __init__(self, x): self.val = x self.next = None class Solution: # @param {ListNode} head ...
arenadata/ambari
refs/heads/branch-adh-1.6
ambari-server/src/main/resources/stacks/ADH/1.5/services/KAFKA/package/scripts/service_check.py
1
#!/usr/bin/env python """ Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License");...
FNNDSC/openshiftmgr
refs/heads/master
openshiftmgr.py
1
""" OpenShift cluster manager module that provides functionality to schedule jobs as well as manage their state in the cluster. """ from argparse import ArgumentParser import yaml import json import configparser import os from kubernetes import client from openshift import client as o_client from openshift import conf...
codevlabs/grab
refs/heads/master
test/grab_get_request.py
11
# coding: utf-8 from test.util import build_grab from test.util import BaseGrabTestCase class GrabSimpleTestCase(BaseGrabTestCase): def setUp(self): self.server.reset() def test_get(self): self.server.response['get.data'] = 'Final Countdown' g = build_grab() g.go(self.server.g...
lyw07/kolibri
refs/heads/develop
kolibri/plugins/setup_wizard/kolibri_plugin.py
1
from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals from . import hooks from kolibri.core.device.hooks import SetupHook from kolibri.core.webpack import hooks as webpack_hooks from kolibri.plugins.base import KolibriPluginBase class SetupWizardPlugin(K...
prakashwaghwani/rails-vs-mean-stack
refs/heads/gh-pages
node_modules/node-gyp/gyp/pylib/gyp/common_test.py
2542
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Unit tests for the common.py file.""" import gyp.common import unittest import sys class TestTopologicallySorted(unittest.TestCase): ...
tomasjames/citsciportal
refs/heads/master
app/agentex/tests/factories.py
2
import factory import factory.django import agentex.models as models import datetime import random ''' This file contains all of the factories used to emulate/override the models found in models.py for testing purposes. ''' class EventFactory(factory.django.DjangoModelFactory): class Meta: model = model...
eadgarchen/tensorflow
refs/heads/master
tensorflow/python/training/server_lib_same_variables_clear_test.py
133
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
miguelparaiso/OdooAccessible
refs/heads/master
openerp/addons/test_exceptions/__openerp__.py
435
# -*- coding: utf-8 -*- { 'name': 'test-exceptions', 'version': '0.1', 'category': 'Tests', 'description': """A module to generate exceptions.""", 'author': 'OpenERP SA', 'maintainer': 'OpenERP SA', 'website': 'http://www.openerp.com', 'depends': ['base'], 'data': ['view.xml', 'ir.mo...
blindpenguin/blackboard
refs/heads/master
node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py
2710
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Visual Studio user preferences file writer.""" import os import re import socket # for gethostname import gyp.common import gyp.easy_xml as easy_xml #------...
jrichte43/ProjectEuler
refs/heads/develop
Problem-0440/solutions.py
1
__problem_title__ = "GCD and Tiling" __problem_url___ = "https://projecteuler.net/problem=440" __problem_description__ = "We want to tile a board of length and height 1 completely, with " \ "either 1 × 2 blocks or 1 × 1 blocks with a single decimal digit on " \ "top:...
rayrrr/luigi
refs/heads/master
test/contrib/gcs_test.py
9
# -*- coding: utf-8 -*- # # Copyright 2015 Twitter Inc # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
talhajaved/nyuadmarket
refs/heads/master
flask/lib/python2.7/site-packages/pip/utils/deprecation.py
122
""" A module that implments tooling to enable easy warnings about deprecations. """ from __future__ import absolute_import import logging import warnings class PipDeprecationWarning(Warning): pass class RemovedInPip7Warning(PipDeprecationWarning, DeprecationWarning): pass class RemovedInPip8Warning(PipDe...
chirilo/mozillians
refs/heads/master
vendor-local/lib/python/unidecode/x08e.py
252
data = ( 'Chu ', # 0x00 'Jing ', # 0x01 'Nie ', # 0x02 'Xiao ', # 0x03 'Bo ', # 0x04 'Chi ', # 0x05 'Qun ', # 0x06 'Mou ', # 0x07 'Shu ', # 0x08 'Lang ', # 0x09 'Yong ', # 0x0a 'Jiao ', # 0x0b 'Chou ', # 0x0c 'Qiao ', # 0x0d '[?] ', # 0x0e 'Ta ', # 0x0f 'Jian ', # 0x10...
jayceyxc/hue
refs/heads/master
desktop/core/ext-py/pycparser-2.14/examples/c-to-c.py
19
#------------------------------------------------------------------------------ # pycparser: c-to-c.py # # Example of using pycparser.c_generator, serving as a simplistic translator # from C to AST and back to C. # # Copyright (C) 2008-2015, Eli Bendersky # License: BSD #------------------------------------------------...
shuggiefisher/crowdstock
refs/heads/master
django/conf/app_template/views.py
6027
# Create your views here.
Sklearn-HMM/scikit-learn-HMM
refs/heads/master
sklean-hmm/svm/setup.py
8
from os.path import join import numpy import warnings def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration from numpy.distutils.system_info import get_info, BlasNotFoundError config = Configuration('svm', parent_package, top_path) config.add_subpa...
galtys/odoo
refs/heads/8.0
openerp/addons/base/ir/ir_model.py
30
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2014 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
davidgbe/scikit-learn
refs/heads/master
examples/cluster/plot_dbscan.py
346
# -*- coding: utf-8 -*- """ =================================== Demo of DBSCAN clustering algorithm =================================== Finds core samples of high density and expands clusters from them. """ print(__doc__) import numpy as np from sklearn.cluster import DBSCAN from sklearn import metrics from sklearn...
yuanyelele/solfege
refs/heads/master
solfege/exercises/idtone.py
2
# GNU Solfege - free ear training software # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2011 Tom Cato Amundsen # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either ...
Jgarcia-IAS/Fidelizacion_odoo
refs/heads/master
openerp/osv/expression.py
42
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
marcosbontempo/algar
refs/heads/master
pyprotosim-0.3.2/pyprotosim/example/dhcp_OK.py
3
#!/usr/bin/env python ################################################################## # Copyright (c) 2012, Sergej Srepfler <[email protected]> # February 2012 - September 2012 # Version 0.2.8, Last change on Sep 25, 2012 # This software is distributed under the terms of BSD license. ####################...
gmariotti/lassim
refs/heads/master
test/utilities/test_logger_setup.py
1
import logging import os from unittest import TestCase from utilities.logger_setup import LoggerSetup __author__ = "Guido Pio Mariotti" __copyright__ = "Copyright (C) 2016 Guido Pio Mariotti" __license__ = "GNU General Public License v3.0" __version__ = "0.1.0" class TestMySetup(TestCase): def setUp(self): ...
KDE/pykde4
refs/heads/master
examples/kdeuiExamples/kdatepicker.py
1
from PyQt4.QtCore import SIGNAL, Qt from PyQt4.QtGui import QLabel from PyKDE4.kdecore import i18n from PyKDE4.kdeui import KVBox, KHBox, KDatePicker, KDateWidget helpText = """Date selection widgets - KDatePicker and KDateWidget - provide widgets for calendar date input. KDatePicker emits two types of signals, eit...
boooka/GeoPowerOff
refs/heads/master
venv/lib/python2.7/site-packages/django/contrib/formtools/wizard/storage/__init__.py
95
from django.utils.module_loading import import_string from django.contrib.formtools.wizard.storage.base import BaseStorage from django.contrib.formtools.wizard.storage.exceptions import ( MissingStorage, NoFileStorageConfigured) __all__ = [ "BaseStorage", "MissingStorage", "NoFileStorageConfigured", "get_stor...
slevenhagen/odoo
refs/heads/8.0
addons/l10n_uy/__openerp__.py
260
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2011 Openerp.uy <[email protected]> # Proyecto de Localización de OperERP para Uruguay # $Id$ # # This program i...
Qalthos/ansible
refs/heads/devel
test/units/executor/test_task_result.py
113
# (c) 2016, James Cammarata <[email protected]> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version...
lonnen/socorro
refs/heads/master
webapp-django/crashstats/urls.py
1
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import os from django.conf import settings from django.conf.urls import include, url from django.contrib.staticfiles.ur...
vganapath/rally
refs/heads/master
rally/plugins/openstack/scenarios/neutron/utils.py
1
# Copyright 2014: Intel Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
Arcalder/dli3d
refs/heads/master
lib/slices.py
1
#------------------------------------------------------------------------------- # This file is part of 'DlI3D'. # # Copyright (C) 2012 by # Ariel Calderón, Cesar Campos, Eduardo Escobar, Alvaro Faundez, Alonso Gaete, # Felipe Gonzalez, Rodrigo Gonzalez, Roberto Riquelme, Tamara Rivera, # Leonardo Rojas, Maximilian ...
40223149/2015cd_midterm
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/pickle.py
1265
from json import *
koki-sato/capture-the-flag
refs/heads/master
write-ups/OverTheWire/Natas/solver/natas16.py
1
# -*- coding: utf-8 -*- import string import requests URL = 'http://natas16.natas.labs.overthewire.org/?needle=a&submit=Search' AUTH = ('natas16', 'WaIHEacj63wnNIBROHeqi3p9t0m5nhmh') def main(): password = '' while True: for c in string.printable: params = { 'needle': "$(grep -E ^" + pass...
dekkersarjan/netcoin-work
refs/heads/master
share/qt/extract_strings_qt.py
2945
#!/usr/bin/python ''' Extract _("...") strings for translation and convert to Qt4 stringdefs so that they can be picked up by Qt linguist. ''' from subprocess import Popen, PIPE import glob import operator OUT_CPP="src/qt/bitcoinstrings.cpp" EMPTY=['""'] def parse_po(text): """ Parse 'po' format produced by x...
alikins/ansible
refs/heads/devel
test/units/modules/network/nxos/test_nxos_vpc_interface.py
57
# (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is dis...
delletenebre/xbmc-addon-kilogramme
refs/heads/master
script.module.httplib2/lib/httplib2/test/test_no_socket.py
306
"""Tests for httplib2 when the socket module is missing. This helps ensure compatibility with environments such as AppEngine. """ import os import sys import unittest import httplib2 class MissingSocketTest(unittest.TestCase): def setUp(self): self._oldsocks = httplib2.socks httplib2.socks = None...
medallia/aurora
refs/heads/master
src/main/python/apache/aurora/common/auth/__init__.py
296
# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under ...
IndonesiaX/edx-platform
refs/heads/master
cms/djangoapps/models/settings/course_metadata.py
4
""" Django module for Course Metadata class -- manages advanced settings and related parameters """ from xblock.fields import Scope from xmodule.modulestore.django import modulestore from django.utils.translation import ugettext as _ from django.conf import settings class CourseMetadata(object): ''' For CRUD ...
shashisp/blumix-webpy
refs/heads/master
app/gluon/contrib/fpdf/html.py
41
# -*- coding: latin-1 -*- "HTML Renderer for FPDF.py" __author__ = "Mariano Reingart <[email protected]>" __copyright__ = "Copyright (C) 2010 Mariano Reingart" __license__ = "LGPL 3.0" # Inspired by tuto5.py and several examples from fpdf.org, html2fpdf, etc. from fpdf import FPDF from HTMLParser import HTMLParser...
popazerty/bnigma2
refs/heads/master
lib/python/Components/Converter/ValueBitTest.py
165
from Converter import Converter from Components.Element import cached class ValueBitTest(Converter, object): def __init__(self, arg): Converter.__init__(self, arg) self.value = int(arg) @cached def getBoolean(self): return self.source.value & self.value and True or False boolean = property(getBoolean)
alexbruy/QGIS
refs/heads/master
scripts/qgis_fixes/fix_print_with_import.py
77
from libfuturize.fixes.fix_print_with_import import FixPrintWithImport as FixPrintWithImportOrig from lib2to3.fixer_util import Node, Leaf, syms, find_indentation import re class FixPrintWithImport(FixPrintWithImportOrig): def transform(self, node, results): if "fix_print_with_import" in node.prefix: ...
matthewelse/micropython
refs/heads/emscripten
tests/micropython/viper_ptr8_store.py
93
# test ptr8 type @micropython.viper def set(dest:ptr8, val:int): dest[0] = val @micropython.viper def set1(dest:ptr8, val:int): dest[1] = val @micropython.viper def memset(dest:ptr8, val:int, n:int): for i in range(n): dest[i] = val @micropython.viper def memset2(dest_in, val:int): dest = pt...
zephyrplugins/zephyr
refs/heads/master
zephyr.plugin.jython/jython2.5.2rc3/Lib/test/test_cgi.py
24
from test.test_support import verify, verbose import cgi import os import sys import tempfile from StringIO import StringIO class HackedSysModule: # The regression test will have real values in sys.argv, which # will completely confuse the test of the cgi module argv = [] stdin = sys.stdin cgi.sys = H...
project-revolution/android_kernel_sony_msm8974
refs/heads/cm-10.2
tools/perf/util/setup.py
4998
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
dbmi-pitt/DIKB-Micropublication
refs/heads/master
scripts/mp-scripts/Bio/Mindy/XPath.py
1
import xml.sax, re from Bio import Std # To help parse XPath queries _name = "[a-zA-Z_:][-a-zA-Z0-9._:]*" _pat_tag_re = re.compile(r"""^//(%s)(\[@(%s)=("[^"]*"|'[^']*')\])?$""" % (_name, _name) ) #') # emacs cruft def parse_simple_xpath(s...