repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringclasses
981 values
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
ironbox360/django
django/contrib/gis/db/backends/postgis/models.py
396
2158
""" The GeometryColumns and SpatialRefSys models for the PostGIS backend. """ from django.contrib.gis.db.backends.base.models import SpatialRefSysMixin from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class PostGISGeometryColumns(models.Model): ...
bsd-3-clause
ankur-gupta91/horizon-net-ip
openstack_dashboard/dashboards/project/access_and_security/keypairs/tests.py
7
10966
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the...
apache-2.0
ProfessionalIT/maxigenios-website
sdk/google_appengine/lib/PyAMF-0.6.1/pyamf/util/imports.py
45
3707
# Copyright (c) The PyAMF Project. # See LICENSE.txt for details. """ Tools for doing dynamic imports. @since: 0.3 """ import sys __all__ = ['when_imported'] def when_imported(name, *hooks): """ Call C{hook(module)} when module named C{name} is first imported. C{name} must be a fully qualified (i.e. ...
mit
Alwnikrotikz/chimerascan
chimerascan/deprecated/sam_v1.py
6
8725
''' Created on Jun 2, 2011 @author: mkiyer chimerascan: chimeric transcript discovery using RNA-seq Copyright (C) 2011 Matthew Iyer 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 3...
gpl-3.0
mrry/tensorflow
tensorflow/models/embedding/word2vec_optimized_test.py
31
2294
# Copyright 2015 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...
apache-2.0
jamilatta/scielo-manager
scielomanager/scielomanager/utils/modelmanagers/base.py
2
1789
# coding: utf-8 """ The UserObjectManager interface =============================== Each model object that aims to be contextualized by the current app user and the visibility rules defined, must provide a manager called ``userobjects`` following the context protocol: Custom instance of ``models.Manager`` -----------...
bsd-2-clause
tyndyll/py-morsecode
docs/source/conf.py
1
8359
# -*- coding: utf-8 -*- # # MorseCode documentation build configuration file, created by # sphinx-quickstart on Tue Nov 26 16:14:19 2013. # # 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. # #...
bsd-2-clause
praveenkumar/dorrie
dorrie/comps/models.py
1
1663
# Dorrie - Web interface for building Fedora Spins/Remixes. # Copyright (C) 2009 Red Hat Inc. # Author: Shreyank Gupta <sgupta@redhat.com> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation...
agpl-3.0
cad-lab/blog
pelicanconf.py
1
2136
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals AUTHOR = 'kmol' SITENAME = 'CADLab (虎尾科大MDE)' #SITEURL = 'http://cad-lab.github.io/blog/' # 不要用文章所在目錄作為類別 USE_FOLDER_AS_CATEGORY = False #PATH = 'content' #OUTPUT_PATH = 'output' TIMEZONE = 'Asia/Taipei' DEFAULT_LANG = 'en' #...
agpl-3.0
chongtianfeiyu/kbengine
kbe/src/lib/python/Lib/encodings/cp858.py
270
34015
""" Python Character Mapping Codec for CP858, modified from cp850. """ import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict'): return codecs.charmap_decod...
lgpl-3.0
OSSystems/lava-server
dashboard_app/migrations/0003_add_index_HardwareDevice_device_type.py
1
13377
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding index on 'HardwareDevice', fields ['device_type', 'id'] db.create_index('dashboard_app_hardwaredevice', ...
agpl-3.0
zvoase/twactor
twactor/cache.py
1
17379
# -*- coding:utf-8 -*- # twactor.cache - Cache framework for twactor. import operator import time try: import threading except: import dummy_threading as threading from twactor import connection, function_sync, propertyfix class CachedMetaclass(type): """Metaclass for subclasses of ``CachedObject``...
mit
jyotsna1820/django
tests/admin_widgets/widgetadmin.py
68
1222
from django.contrib import admin from . import models class WidgetAdmin(admin.AdminSite): pass class CarAdmin(admin.ModelAdmin): list_display = ['make', 'model', 'owner'] list_editable = ['owner'] class CarTireAdmin(admin.ModelAdmin): def formfield_for_foreignkey(self, db_field, request, **kwargs...
bsd-3-clause
tinloaf/home-assistant
homeassistant/components/xiaomi_aqara.py
3
10991
""" Support for Xiaomi Gateways. For more details about this component, please refer to the documentation at https://home-assistant.io/components/xiaomi_aqara/ """ import logging from datetime import timedelta import voluptuous as vol from homeassistant.components.discovery import SERVICE_XIAOMI_GW from homeassista...
apache-2.0
Omegaphora/external_chromium_org
mojo/python/tests/system_unittest.py
26
11412
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import random import sys import time import unittest # pylint: disable=F0401 import mojo.embedder from mojo import system DATA_SIZE = 1024 def _GetRandom...
bsd-3-clause
botswana-harvard/bhp065_project
bhp065/apps/hnscc_subject/admin/enrollment_admin.py
1
1104
from django.contrib import admin from edc.base.modeladmin.admin import BaseModelAdmin from ..forms import EnrollmentForm from ..models import Enrollment class EnrollmentAdmin(BaseModelAdmin): dashboard_type = 'subject' form = EnrollmentForm def __init__(self, *args, **kwargs): super(Enrollment...
gpl-2.0
iogf/vy
vyapp/plugins/ycmd/ycm_extra_conf.py
6
8197
# This file is NOT licensed under the GPLv3, which is the license for the rest # of YouCompleteMe. # # Here's the license text for this file: # # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or # distribute this software, either...
mit
Algomorph/gpxanalyzer
gpxanalyzer/filters/color_structure_pythonic.py
1
10874
''' Created on Apr 25, 2014 @author: Gregory Kramida @copyright: (c) Gregory Kramida 2014 @license: GNU v3 ''' import gpxanalyzer.gpxanalyzer_internals as gi import numpy as np import sys import math import timeit amplitude_thresholds = np.array([0.0, 0.000000000001, 0.037, 0.08, 0.195, 0.32],dtype=np.float64) n_ampl...
gpl-3.0
inwotep/lava-android-test
lava_android_test/test_definitions/install_prep_4bench.py
2
1731
# Copyright (c) 2012 Linaro # Author: Linaro Validation Team <linaro-dev@lists.linaro.org> # # This file is part of LAVA Android Test. # # # 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...
gpl-3.0
ravenland/ycmWinRepo
python/ycm/client/command_request.py
10
3213
#!/usr/bin/env python # # Copyright (C) 2013 Google Inc. # # This file is part of YouCompleteMe. # # YouCompleteMe 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 you...
gpl-3.0
dsb9938/Rezound-ICS-Kernel-Old
Documentation/networking/cxacru-cf.py
14668
1626
#!/usr/bin/env python # Copyright 2009 Simon Arlott # # 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 i...
gpl-2.0
bennojoy/ansible
test/units/errors/test_errors.py
170
3108
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # 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) an...
gpl-3.0
bpsinc-native/src_third_party_scons-2.0.1
engine/SCons/Scanner/Fortran.py
61
14347
"""SCons.Scanner.Fortran This module implements the dependency scanner for Fortran code. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentati...
mit
xcyan/models
domain_adaptation/pixel_domain_adaptation/baselines/baseline_train.py
10
5624
# Copyright 2017 Google 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 agreed to in writing, ...
apache-2.0
michaelBenin/django-oscar
oscar/apps/catalogue/migrations/0006_auto__add_field_product_is_discountable.py
18
12901
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Product.is_discountable' db.add_column('catalogue_product', 'is_discountable', self.gf('dj...
bsd-3-clause
ovnicraft/odoo
addons/crm/crm_phonecall.py
255
14844
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
AltSchool/django
django/conf/locale/en/formats.py
1007
1815
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'N j, Y' TIME_FORMAT = 'P' DATETIM...
bsd-3-clause
jszymon/pacal
pacal/vartransforms.py
1
10727
"""Variable transforms. Used for mapping to infinite intervals etc.""" from __future__ import print_function from numpy import Inf from numpy import hypot, sqrt, sign from numpy import array, asfarray, empty_like, isscalar, all, equal class VarTransform(object): """Base class for variable transforms.""" de...
gpl-3.0
cwtaylor/viper
viper/modules/pymacho/MachOEncryptionInfoCommand.py
6
1864
# encoding: utf-8 """ Copyright 2013 Jérémie BOUTOILLE 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 3 of the License, or (at your option) any later version. This program is distri...
bsd-3-clause
node-modules/emoji
bin/create_emoji_js.py
6
2090
#!/usr/bin/python # -*- coding: utf-8 -*- # install pyquery first: $ sudo easy_install pyquery import os from pyquery import PyQuery as pq project_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # d = pq(url='https://raw.github.com/iamcal/php-emoji/master/table.htm') d = pq(open(project_dir + '/li...
mit
5t111111/markdown-preview.vim
markdownpreview_lib/pygments/styles/bw.py
364
1355
# -*- coding: utf-8 -*- """ pygments.styles.bw ~~~~~~~~~~~~~~~~~~ Simple black/white only style. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import Keyword, Name, Comment, Strin...
lgpl-2.1
mhnatiuk/phd_sociology_of_religion
scrapper/lib/python2.7/site-packages/twisted/conch/insults/helper.py
30
14146
# -*- test-case-name: twisted.conch.test.test_helper -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Partial in-memory terminal emulator @author: Jp Calderone """ import re, string from zope.interface import implements from twisted.internet import defer, protocol, reactor from twist...
gpl-2.0
thiagopnts/servo
tests/wpt/web-platform-tests/webdriver/tests/actions/mouse.py
3
4720
import pytest from tests.actions.support.mouse import get_center from tests.actions.support.refine import get_events, filter_dict from tests.support.asserts import assert_move_to_coordinates from tests.support.inline import inline from tests.support.wait import wait def link_doc(dest): content = "<a href=\"{}\" ...
mpl-2.0
johnny-bui/pygments-sablecc
pygments/styles/borland.py
75
1562
# -*- coding: utf-8 -*- """ pygments.styles.borland ~~~~~~~~~~~~~~~~~~~~~~~ Style similar to the style used in the Borland IDEs. :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token impo...
bsd-2-clause
rahuldhote/odoo
addons/crm_partner_assign/report/crm_lead_report.py
309
5104
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
fedorpatlin/ansible
lib/ansible/modules/system/osx_defaults.py
66
14482
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, GeekChimp - Franck Nijhof <franck@geekchimp.com> # # 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 you...
gpl-3.0
codeworldprodigy/lab4
lib/jinja2/testsuite/filters.py
394
19169
# -*- coding: utf-8 -*- """ jinja2.testsuite.filters ~~~~~~~~~~~~~~~~~~~~~~~~ Tests for the jinja filters. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import unittest from jinja2.testsuite import JinjaTestCase from jinja2 import Markup, Environment fro...
apache-2.0
chriscrosscutler/scikit-image
skimage/data/tests/test_data.py
21
1824
import numpy as np import skimage.data as data from numpy.testing import assert_equal, assert_almost_equal def test_lena(): """ Test that "Lena" image can be loaded. """ lena = data.lena() assert_equal(lena.shape, (512, 512, 3)) def test_astronaut(): """ Test that "astronaut" image can be loaded. ""...
bsd-3-clause
rajul/mne-python
mne/time_frequency/stft.py
24
6497
from math import ceil import numpy as np from scipy.fftpack import fft, ifft, fftfreq from ..utils import logger, verbose @verbose def stft(x, wsize, tstep=None, verbose=None): """STFT Short-Term Fourier Transform using a sine window. The transformation is designed to be a tight frame that can be perfec...
bsd-3-clause
acosinwork/Arduino
arduino-core/src/processing/app/i18n/python/update.py
134
1464
#!/usr/bin/env python #vim:set fileencoding=utf-8 sw=2 expandtab def unquote(s): s = s.strip() if s[0] != '"' or s[-1] != '"': raise RuntimeError return s[1:-1] def read_po(fp): if isinstance(fp, str): fp = open(fp) d = {} st = 1 comment = key = rkey = rvalue = '' for line in fp: if line[...
lgpl-2.1
mrworf/multiremote
drivers/base.py
1
9963
# This file is part of multiRemote. # # multiRemote 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. # # multiRemote is distributed in t...
gpl-2.0
reinis-martinsons/gyb-frp
pyasn1/type/univ.py
86
44623
# ASN.1 "universal" data types import operator, sys, math from pyasn1.type import base, tag, constraint, namedtype, namedval, tagmap from pyasn1.codec.ber import eoo from pyasn1.compat import octets from pyasn1 import error # "Simple" ASN.1 types (yet incomplete) class Integer(base.AbstractSimpleAsn1Item): tagSet...
apache-2.0
datenbetrieb/odoo
openerp/addons/test_inherit/models.py
91
3456
# -*- coding: utf-8 -*- from openerp import models, fields, api, osv # We just create a new model class mother(models.Model): _name = 'test.inherit.mother' _columns = { # check interoperability of field inheritance with old-style fields 'name': osv.fields.char('Name'), 'state': osv.fie...
agpl-3.0
2014cdag4/2014cdag4
wsgi/static/Brython2.1.0-20140419-113919/Lib/multiprocessing/dummy/connection.py
707
3049
# # Analogue of `multiprocessing.connection` which uses queues instead of sockets # # multiprocessing/dummy/connection.py # # Copyright (c) 2006-2008, R Oudkerk # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditi...
gpl-2.0
popazerty/obh-gui
lib/python/Plugins/SystemPlugins/SoftwareManager/BackupRestore.py
17
12974
from Screens.Screen import Screen from Screens.MessageBox import MessageBox from Screens.Console import Console from Components.ActionMap import ActionMap, NumberActionMap from Components.Pixmap import Pixmap from Components.Label import Label from Components.Sources.StaticText import StaticText from Components.MenuLis...
gpl-2.0
mlperf/training_results_v0.5
v0.5.0/google/cloud_v2.512/resnet-tpuv2-512/code/resnet/model/models/official/mnist/dataset.py
7
4116
# 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 appl...
apache-2.0
chshu/openthread
tools/harness-automation/cases_R140/fed_9_2_13.py
18
1873
#!/usr/bin/env python # # Copyright (c) 2016, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # notic...
bsd-3-clause
educloudalliance/eca-auth-data
authdata/tests/test_datasources.py
1
21342
# -*- coding: utf-8 -*- # The MIT License (MIT) # # Copyright (c) 2014-2015 Haltu Oy, http://haltu.fi # # 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 withou...
mit
springmerchant/pybbm
pybb/admin.py
7
4809
# -*- coding: utf-8 from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ from django.contrib import admin from django.core.urlresolvers import reverse from pybb.models import Category, Forum, Topic, Post, Profile, Attachment, PollAnswer from pybb import compat, util username...
bsd-2-clause
sergeLabo/asyncio-osc
irc/schedule.py
22
3089
""" Classes for calling functions a schedule. """ import datetime import numbers class DelayedCommand(datetime.datetime): """ A command to be executed after some delay (seconds or timedelta). Clients may override .now() to have dates interpreted in a different manner, such as to use UTC or to have ti...
gpl-2.0
sunlianqiang/kbengine
kbe/src/lib/python/Lib/re.py
206
15262
# # Secret Labs' Regular Expression Engine # # re-compatible interface for the sre matching engine # # Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved. # # This version of the SRE library can be redistributed under CNRI's # Python 1.6 license. For any other use, please contact Secret Labs # AB (info@py...
lgpl-3.0
2013Commons/HUE-SHARK
desktop/core/ext-py/django_nose/build/lib.linux-i686-2.7/django_nose/nose_runner.py
4
2660
""" Django test runner that invokes nose. Usage: ./manage.py test DJANGO_ARGS -- NOSE_ARGS The 'test' argument, and any other args before '--', will not be passed to nose, allowing django args and nose args to coexist. You can use NOSE_ARGS = ['list', 'of', 'args'] in settings.py for arguments that you alw...
apache-2.0
kotton21/PotteryOnline
server.py
1
2940
#!/usr/bin/env python import SimpleHTTPServer import SocketServer import PotGenerator import os import logging import logging.handlers import sys import time import rotate3D2 from urlparse import urlparse, parse_qs try: os.chdir('/home/pi/PotteryOnline/') except: print 'executing from current direcory' PORT = 80...
mit
CloudWareChile/OpenChile
openerp/addons/l10n_fr/l10n_fr.py
9
1966
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
xiaojunwu/crosswalk-test-suite
webapi/tct-netinfo-w3c-tests/inst.apk.py
903
3180
#!/usr/bin/env python import os import shutil import glob import time import sys import subprocess from optparse import OptionParser, make_option SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) PARAMETERS = None ADB_CMD = "adb" def doCMD(cmd): # Do not need handle timeout in this short script, let tool...
bsd-3-clause
smishenk/blink-crosswalk
Tools/Scripts/webkitpy/formatter/main.py
48
4102
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import argparse import lib2to3.refactor from webkitpy.common.system.systemhost import SystemHost from webkitpy.thirdparty import autopep8 def parse_args(a...
bsd-3-clause
ericholscher/merchant
billing/tests/google_checkout_tests.py
2
27517
from xml.dom.minidom import Document, parseString from django.conf import settings from django.test import TestCase from django.template import Template, Context from billing import get_integration class GoogleCheckoutTestCase(TestCase): def setUp(self): self.gc = get_integration("google_checkout") ...
bsd-3-clause
yv84/pyph
src/tests/integrate_tests/tcp_echo.py
1
5366
#!/usr/bin/env python3 """TCP echo server example.""" import argparse import asyncio import sys import os try: import signal except ImportError: signal = None from msg_log import Message from game_log import log ARGS = argparse.ArgumentParser(description="PyPh test fixtures.") ARGS.add_argument( '--se...
mit
dims/glance
glance/api/v2/model/metadef_namespace.py
20
3021
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # # 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...
apache-2.0
sdphome/UHF_Reader
u-boot-2015.04/test/image/test-fit.py
3
12492
#!/usr/bin/python # # Copyright (c) 2013, Google Inc. # # Sanity check of the FIT handling in U-Boot # # SPDX-License-Identifier: GPL-2.0+ # # To run this: # # make O=sandbox sandbox_config # make O=sandbox # ./test/image/test-fit.py -u sandbox/u-boot import doctest from optparse import OptionParser import os import s...
gpl-3.0
mahak/nova
nova/conf/hyperv.py
4
10493
# Copyright (c) 2016 TUBITAK BILGEM # 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 requir...
apache-2.0
mjfarmer/scada_py
env/lib/python2.7/site-packages/zope/interface/tests/test_declarations.py
18
57969
############################################################################## # # Copyright (c) 2003 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
gpl-3.0
yeming233/rally
tests/unit/plugins/openstack/scenarios/ironic/test_utils.py
1
2990
# Copyright 2015: Mirantis 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 b...
apache-2.0
netgroup/dreamer-ryu
ryu/ofproto/ofproto_v1_0_parser.py
9
81719
# Copyright (C) 2011, 2012 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2011, 2012 Isaku Yamahata <yamahata at valinux co jp> # # 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 # ...
apache-2.0
c0hen/django-venv
lib/python3.4/site-packages/pip/utils/build.py
899
1312
from __future__ import absolute_import import os.path import tempfile from pip.utils import rmtree class BuildDirectory(object): def __init__(self, name=None, delete=None): # If we were not given an explicit directory, and we were not given an # explicit delete option, then we'll default to del...
gpl-3.0
wkentaro/docopt
examples/options_example.py
18
1597
"""Example of program with many options using docopt. Usage: options_example.py [-hvqrf NAME] [--exclude=PATTERNS] [--select=ERRORS | --ignore=ERRORS] [--show-source] [--statistics] [--count] [--benchmark] PATH... options_example.py (--doctest | --testsuite=DIR) options_...
mit
bingosummer/azure-linux-extensions
DSC/azure/__init__.py
46
33598
#------------------------------------------------------------------------- # Copyright (c) Microsoft. 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.apac...
apache-2.0
koobonil/Boss2D
Boss2D/addon/_old/webrtc-qt5.11.2_for_boss/tools_webrtc/cpu/cpu_mon.py
6
2057
#!/usr/bin/env python # # Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. # # Use of this source code is governed by a BSD-style license # that can be found in the LICENSE file in the root of the source # tree. An additional intellectual property rights grant can be found # in the file PATENTS. All...
mit
spark-test/spark
examples/src/main/python/mllib/kmeans.py
51
1552
# # 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 us...
apache-2.0
PriceChild/ansible
lib/ansible/modules/windows/win_user.py
56
4540
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Matt Martz <matt@sivel.net>, and others # # 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 t...
gpl-3.0
frdb194/django
tests/managers_regress/models.py
245
3566
""" Various edge-cases for model managers. """ from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.encoding import force_text, python_2_unicode_compatible class OnlyFred(mo...
bsd-3-clause
hkupty/python-mode
pymode/libs2/rope/contrib/finderrors.py
93
2948
"""Finding bad name and attribute accesses `find_errors` function can be used to find possible bad name and attribute accesses. As an example:: errors = find_errors(project, project.get_resource('mod.py')) for error in errors: print '%s: %s' % (error.lineno, error.error) prints possible errors for ``mod.p...
lgpl-3.0
c-goosen/ctpug_11_july
flask/__init__.py
1
4174
from flask import Flask from flask_bootstrap import Bootstrap from flask import render_template import bootstrap import xmlrpclib from io import BytesIO import base64 app = Flask(__name__) import xmlrpclib username = 'username' #the user pwd = 'password' #the password of the user dbname = 'ctpug' #the databa...
cc0-1.0
ahojjati/letsencrypt
letsencrypt/account.py
10
7268
"""Creates ACME accounts for server.""" import datetime import hashlib import logging import os import socket from cryptography.hazmat.primitives import serialization import pyrfc3339 import pytz import zope.component from acme import fields as acme_fields from acme import jose from acme import messages from letsenc...
apache-2.0
juharris/tensorflow
tensorflow/contrib/tensor_forest/python/ops/inference_ops.py
15
2143
# Copyright 2016 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...
apache-2.0
infrared5/massroute-pi
features/steps/bus_approaching_blink_steps.py
1
1614
from time import sleep from app.component.modifier.blinker import Blinker PINS = [0,1,2,3] DELAY = 0.2 @given('A new Blinker instance provided with a Shifter reference') def blinker_setup_with_shifter(context): shifter = context.shifter blinker = Blinker(shifter) blinker.set_pins(PINS) shifter.set_pins = Mag...
mit
gregdek/ansible
lib/ansible/modules/network/cloudengine/ce_snmp_target_host.py
25
32025
#!/usr/bin/python # # 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 distribut...
gpl-3.0
cosenal/osf.io
website/archiver/model.py
38
5944
import datetime from modularodm import fields from framework.mongo import ObjectId from framework.mongo import StoredObject from website.archiver import ( ARCHIVER_INITIATED, ARCHIVER_SUCCESS, ARCHIVER_FAILURE, ARCHIVER_FAILURE_STATUSES ) from website.addons.base import StorageAddonBase from website...
apache-2.0
benssson/flatbuffers
tests/py_test.py
16
49316
# coding=utf-8 # Copyright 2014 Google 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 appl...
apache-2.0
olivierkes/manuskript
manuskript/ui/views/outlineDelegates.py
2
13273
#!/usr/bin/env python # --!-- coding: utf8 --!-- from PyQt5.QtCore import Qt, QSize, QModelIndex from PyQt5.QtGui import QColor, QPalette, QIcon, QFont, QFontMetrics, QBrush from PyQt5.QtWidgets import QStyledItemDelegate, QStyleOptionViewItem, QStyle, QComboBox, QStyleOptionComboBox from PyQt5.QtWidgets import qApp f...
gpl-3.0
genome21/dcos-cli
dcos/cmds.py
5
1376
import collections from dcos.errors import DCOSException Command = collections.namedtuple( 'Command', ['hierarchy', 'arg_keys', 'function']) """Describe a CLI command. :param hierarchy: the noun and verbs that need to be set for the command to execute :type hierarchy: list of str :param arg...
apache-2.0
feroda/JAGOM
apps/basic_groups/tests/__init__.py
3
2761
from django.core.urlresolvers import reverse from django.test import TestCase from basic_groups.models import BasicGroup class BasicGroupsTest(TestCase): fixtures = ["basic_groups_auth.json"] urls = "basic_groups.tests.basic_groups_urls" def test_unauth_create_get(self): """ can an u...
agpl-3.0
ENCODE-DCC/encoded
src/encoded/tests/test_types_analysis.py
1
1533
import pytest def test_types_analysis_title( testapp, analysis_released, encode4_award, ENCODE3_award, encode_lab, file_bam_1_1, file_bam_2_1, analysis_step_run_chip_encode4, analysis_step_run_dnase_encode4, pipeline_dnase_encode4, pipeline_chip_encode4, ): testapp.pat...
mit
wkrzemien/DIRAC
Resources/MessageQueue/test/Test_MQConsumer.py
5
3828
"""Unit tests of MQConsumer interface in the DIRAC.Resources.MessageQueue.MQConsumer """ import unittest from DIRAC import S_OK, S_ERROR from DIRAC.Resources.MessageQueue.MQConsumer import MQConsumer from DIRAC.Resources.MessageQueue.MQConnectionManager import MQConnectionManager from DIRAC.Resources.MessageQueue.MQCo...
gpl-3.0
zackslash/scrapy
scrapy/extensions/httpcache.py
102
16232
from __future__ import print_function import os import gzip from six.moves import cPickle as pickle from importlib import import_module from time import time from weakref import WeakKeyDictionary from email.utils import mktime_tz, parsedate_tz from w3lib.http import headers_raw_to_dict, headers_dict_to_raw from scrapy....
bsd-3-clause
FedoraScientific/salome-hexablock
src/TEST_PY/test_unit/test_cuve.py
1
2161
# -*- coding: latin-1 -*- # Copyright (C) 2009-2014 CEA/DEN, EDF R&D # # This library 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 2.1 of the License, or (at your option) any later...
lgpl-2.1
ptdtan/Ragout
lib/networkx/algorithms/block.py
47
4055
# encoding: utf-8 """ Functions for creating network blockmodels from node partitions. Created by Drew Conway <drew.conway@nyu.edu> Copyright (c) 2010. All rights reserved. """ __author__ = """\n""".join(['Drew Conway <drew.conway@nyu.edu>', 'Aric Hagberg <hagberg@lanl.gov>']) __all__=['bl...
gpl-3.0
damdam-s/account-analytic
__unported__/analytic_secondaxis/wizard/__init__.py
11
1436
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com) # All Right Reserved # # Author : Joel Grand-guillaume (Camptocamp) # # WARNING: This program as such is intended to be used by professional # programme...
agpl-3.0
ColdHeat/binaryninja-python
Util.py
4
10622
# Copyright (c) 2011-2015 Rusty Wagner # # 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...
gpl-2.0
jmesteve/openerp
openerp/addons/stock_invoice_directly/wizard/stock_invoice.py
39
2344
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
ygol/odoo
addons/membership/__openerp__.py
197
2207
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
DPaaS-Raksha/horizon
horizon/exceptions.py
7
12145
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Nebula, 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 # # ...
apache-2.0
gooddata/openstack-nova
nova/db/sqlalchemy/api_migrations/migrate_repo/versions/018_instance_groups.py
14
2633
# 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 # d...
apache-2.0
Groupe24/CodeInSpace
tournoi/37/game_1.py
1
62455
# -*- coding: utf-8 -*- import random import shutil import time import socket def game_preparation(file): """ Prepare the data structures need to play the game based on a .mv file. Return ------ - field: list of lists containing the characters contained in each cases of the board (list). ...
mit
allen-fdes/python_demo
cookbook/settings.py
1
2691
""" Django settings for cookbook project. Generated by 'django-admin startproject' using Django 1.8.3. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build pat...
mit
bpgc-cte/python2017
Week 7/django/lib/python3.6/site-packages/pip/_vendor/cachecontrol/serialize.py
326
6536
import base64 import io import json import zlib from pip._vendor.requests.structures import CaseInsensitiveDict from .compat import HTTPResponse, pickle, text_type def _b64_encode_bytes(b): return base64.b64encode(b).decode("ascii") def _b64_encode_str(s): return _b64_encode_bytes(s.encode("utf8")) def ...
mit
abaditsegay/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/heapq.py
49
15994
# -*- coding: Latin-1 -*- """Heap queue algorithm (a.k.a. priority queue). Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for all k, counting elements from 0. For the sake of comparison, non-existing elements are considered to be infinite. The interesting property of a heap is that a[0] is always ...
apache-2.0
Aderemi/Artificial-Intelligence
search_algo.py
1
8943
from collections import deque from math import sqrt import sys import copy import bisect class Problem: def __init__(self, initial_board, goal_board): self.initial_board = Board(initial_board) self.goal_board = Board(goal_board) def actions(self, board): #UDLR possible_moves =...
mit
runarberg/servo
tests/wpt/harness/wptrunner/update/sync.py
116
6508
# 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 import shutil import sys import uuid from .. import testloader from base import Step, StepRunner from tree i...
mpl-2.0
rechner/Taxidi
dblib/postgres.py
1
40884
#!/usr/bin/env python #-*- coding:utf-8 -*- # dblib/postgres.py (spaces, not tabs) # PostgreSQL database driver for Taxídí. # Zac Sturgeon <admin@jkltech.net> # 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 Softwa...
gpl-3.0