repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
CityPulse/CP_Resourcemanagement
virtualisation/resourcemanagement/api.py
1
22496
import cherrypy import os.path import json from virtualisation.misc.jsonobject import JSONObject as JOb from virtualisation.misc.utils import formatSensorID, valueToBoolean from virtualisation.triplestore.threadedtriplestoreadapter import ThreadedTriplestoreAdapter __author__ = 'Marten Fischer (m.fischer@hs-osnabruec...
mit
hooklift/nomad
vendor/github.com/ugorji/go/codec/test.py
107
4029
#!/usr/bin/env python # This will create golden files in a directory passed to it. # A Test calls this internally to create the golden files # So it can process them (so we don't have to checkin the files). # Ensure msgpack-python and cbor are installed first, using: # sudo apt-get install python-dev # sudo apt-g...
mpl-2.0
haijieg/SFrame
oss_src/unity/python/sframe/meta/decompiler/tests/test_comprehensions.py
15
5000
''' Created on Nov 6, 2011 @author: sean ''' import unittest from ...decompiler.tests import Base class ListComprehension(Base): def test_comp1(self): stmnt = '[a for b in c]' self.statement(stmnt) def test_comp2(self): stmnt = '[a() +1 for b in c]' self.statement(stmnt) ...
bsd-3-clause
sampadsaha5/sympy
sympy/physics/quantum/density.py
82
9834
from __future__ import print_function, division from itertools import product from sympy import Tuple, Add, Mul, Matrix, log, expand, Rational from sympy.core.trace import Tr from sympy.printing.pretty.stringpict import prettyForm from sympy.physics.quantum.dagger import Dagger from sympy.physics.quantum.operator imp...
bsd-3-clause
ghedsouza/django
tests/template_tests/test_loaders.py
63
10115
import os.path import sys import tempfile import unittest from contextlib import contextmanager from django.template import TemplateDoesNotExist from django.template.engine import Engine from django.test import SimpleTestCase, override_settings from django.utils.functional import lazystr from .utils import TEMPLATE_D...
bsd-3-clause
wrouesnel/ansible
contrib/inventory/digital_ocean.py
23
21119
#!/usr/bin/env python """ DigitalOcean external inventory script ====================================== Generates Ansible inventory of DigitalOcean Droplets. In addition to the --list and --host options used by Ansible, there are options for generating JSON of other DigitalOcean data. This is useful when creating d...
gpl-3.0
sadaf2605/django
django/db/backends/oracle/operations.py
34
18801
from __future__ import unicode_literals import datetime import re import uuid from django.conf import settings from django.db.backends.base.operations import BaseDatabaseOperations from django.db.backends.utils import truncate_name from django.utils import six, timezone from django.utils.encoding import force_bytes, ...
bsd-3-clause
LoHChina/nova
nova/virt/libvirt/volume/volume.py
29
5066
# Copyright 2011 OpenStack Foundation # (c) Copyright 2013 Hewlett-Packard Development Company, L.P. # 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 # # ...
apache-2.0
pasqualguerrero/django
django/db/backends/oracle/schema.py
404
5313
import binascii import copy import datetime import re from django.db.backends.base.schema import BaseDatabaseSchemaEditor from django.db.utils import DatabaseError from django.utils import six from django.utils.text import force_text class DatabaseSchemaEditor(BaseDatabaseSchemaEditor): sql_create_column = "ALT...
bsd-3-clause
drmrd/ansible
lib/ansible/modules/cloud/openstack/os_networks_facts.py
20
4005
#!/usr/bin/python # Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
AkA84/edx-platform
common/djangoapps/student/migrations/0044_linkedin_add_company_identifier.py
102
14163
# -*- coding: 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 'LinkedInAddToProfileConfiguration.company_identifier' db.add_column('student_linkedinaddtopr...
agpl-3.0
trezorg/django
tests/regressiontests/utils/text.py
51
2200
import unittest from django.utils import text class TestUtilsText(unittest.TestCase): def test_truncate_words(self): self.assertEqual(u'The quick brown fox jumped over the lazy dog.', text.truncate_words(u'The quick brown fox jumped over the lazy dog.', 10)) self.assertEqual(u'The qui...
bsd-3-clause
DecipherOne/Troglodyte
Trog Build Dependencies/Python26/Lib/heapq.py
2
15995
# -*- 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 ...
mit
pitunti/alfaPitunti
mediaserver/platformcode/controllers/__init__.py
1
1180
# -*- coding: utf-8 -*- # ------------------------------------------------------------ # Módulo para acciones en el cliente HTML # ------------------------------------------------------------ import os from inspect import isclass from controller import Controller from platformcode import logger def load_controllers...
gpl-3.0
robin900/sqlalchemy
test/orm/test_compile.py
33
6835
from sqlalchemy import * from sqlalchemy import exc as sa_exc from sqlalchemy.orm import * from sqlalchemy.testing import assert_raises_message from sqlalchemy.testing import fixtures from sqlalchemy import testing class CompileTest(fixtures.ORMTest): """test various mapper compilation scenarios""" def teard...
mit
kingvuplus/boom2
lib/python/Components/SelectionList.py
2
2779
# Embedded file name: /usr/lib/enigma2/python/Components/SelectionList.py from MenuList import MenuList from Tools.Directories import resolveFilename, SCOPE_ACTIVE_SKIN from enigma import eListboxPythonMultiContent, gFont, RT_HALIGN_LEFT, RT_VALIGN_CENTER from Tools.LoadPixmap import LoadPixmap import skin select...
gpl-2.0
angad/libjingle-mac
scons-2.2.0/build/lib/SCons/Platform/aix.py
14
2552
"""engine.SCons.Platform.aix Platform-specific initialization for IBM AIX systems. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Platform.Platform() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 20...
bsd-3-clause
rochacbruno/flask-admin
flask_admin/contrib/peewee/ajax.py
44
2202
from flask_admin._compat import as_unicode, string_types from flask_admin.model.ajax import AjaxModelLoader, DEFAULT_PAGE_SIZE from .tools import get_primary_key class QueryAjaxModelLoader(AjaxModelLoader): def __init__(self, name, model, **options): """ Constructor. :param field...
bsd-3-clause
decvalts/iris
lib/iris/tests/unit/fileformats/grib/load_convert/test_reference_time_coord.py
3
2891
# (C) British Crown Copyright 2014 - 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...
gpl-3.0
2015fallproject/2015fallcase1
static/Brython3.2.2-20150927-180218/Lib/encodings/cp737.py
37
35379
""" Python Character Mapping Codec cp737 generated from 'VENDORS/MICSFT/PC/CP737.TXT' with gencodec.py. """#" 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,e...
agpl-3.0
touchpro/android_kernel_lge_msm8226_old
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py
12980
5411
# SchedGui.py - Python extension for perf script, basic GUI code for # traces drawing and overview. # # Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com> # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. ...
gpl-2.0
kshitizanand/authomatic
tests/functional_tests/expected_values/twitter.py
12
3146
import re import fixtures import constants from authomatic.providers import oauth1 conf = fixtures.get_configuration('twitter') CONFIG = { 'login_xpath': '//*[@id="username_or_email"]', 'password_xpath': '//*[@id="password"]', 'consent_xpaths': [], 'class_': oauth1.Twitter, 'user': { 'bir...
mit
cheaven/openwrt_AA_mirror
scripts/dl_cleanup.py
131
5871
#!/usr/bin/env python """ # OpenWRT download directory cleanup utility. # Delete all but the very last version of the program tarballs. # # Copyright (c) 2010 Michael Buesch <mb@bu3sch.de> """ import sys import os import re import getopt # Commandline options opt_dryrun = False def parseVer_1234(match, filepath): ...
gpl-2.0
eewiki/WeatherStation
XBee_BatteryCharger/main.py
1
4987
# Copyright (c) 2019 Robert Nelson <robert.nelson@digikey.com> # # 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, m...
mit
vinodkc/spark
python/pyspark/pandas/plot/plotly.py
14
7646
# # 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
sysadminmatmoz/OCB
openerp/addons/base/res/res_currency.py
6
14469
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import re import time import math from openerp import api, fields as fields2 from openerp import tools from openerp.osv import fields, osv from openerp.tools import float_round, float_is_zero, float_compare import json ...
agpl-3.0
0jpq0/kbengine
kbe/src/lib/python/Lib/test/test_ensurepip.py
75
11305
import unittest import unittest.mock import test.support import os import os.path import contextlib import sys import ensurepip import ensurepip._uninstall # pip currently requires ssl support, so we ensure we handle # it being missing (http://bugs.python.org/issue19744) ensurepip_no_ssl = test.support.import_fresh_m...
lgpl-3.0
ff94315/hiwifi-openwrt-HC5661-HC5761
staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/encodings/cp1257.py
593
13630
""" Python Character Mapping Codec cp1257 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1257.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,in...
gpl-2.0
Robpol86/sphinxcontrib-imgur
tests/test_sphinx_api/test_caching.py
1
6046
"""Test Imgur API data caching.""" import re import time import pytest def test_first_run(docs, httpretty_common_mock, tmpdir_module): """Run sphinx-build once. Persist output files in module-scoped tmpdir. :param docs: conftest fixture. :param httpretty_common_mock: conftest fixture. :param tmpdir...
mit
phenoxim/nova
nova/policies/hosts.py
6
1728
# Copyright 2016 Cloudbase Solutions Srl # 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 r...
apache-2.0
graingert/luigi
test/worker_task_test.py
37
1387
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
apache-2.0
overtherain/scriptfile
software/googleAppEngine/lib/grizzled/grizzled/db/__init__.py
19
6667
# $Id: fa873c96e7b5ed23437473a2b6d0b9a3871d4a18 $ """ Introduction ============ The ``db`` module is a DB API wrapper. It provides a DB API-compliant API that wraps real underlying DB API drivers, simplifying some non-portable operations like ``connect()`` and providing some new operations. Some drivers come bundled...
mit
torufuru/OFPatchPanel
ryu/tests/unit/ofproto/test_ofproto_v12.py
9
26176
# Copyright (C) 2012 Nippon Telegraph and Telephone Corporation. # # 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 appli...
apache-2.0
studio666/gnuradio
docs/doxygen/doxyxml/doxyindex.py
47
8818
# # Copyright 2010 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # any later version. # #...
gpl-3.0
ojengwa/sympy
sympy/combinatorics/graycode.py
2
11203
from __future__ import print_function, division from sympy.core import Basic from sympy.core.compatibility import xrange import random class GrayCode(Basic): """ A Gray code is essentially a Hamiltonian walk on a n-dimensional cube with edge length of one. The vertices of the cube are represented by...
bsd-3-clause
zhoulingjun/django
tests/admin_filters/tests.py
24
44130
from __future__ import unicode_literals import datetime from django.contrib.admin import ( AllValuesFieldListFilter, BooleanFieldListFilter, ModelAdmin, RelatedOnlyFieldListFilter, SimpleListFilter, site, ) from django.contrib.admin.views.main import ChangeList from django.contrib.auth.admin import UserAdmin ...
bsd-3-clause
graetzer/arangodb
3rdParty/boost/1.62.0/libs/python/pyste/src/Pyste/EnumExporter.py
54
2156
# Copyright Bruno da Silva de Oliveira 2003. Use, modification and # distribution is subject to the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) from Exporter import Exporter from settings import * import utils #====================...
apache-2.0
dokomo-sauce-matrix/dokomoforms
dokomoforms/models/__init__.py
3
2486
"""All the models used in Dokomo Forms.""" from dokomoforms.models.util import ( Base, create_engine, jsonify, get_model, ModelJSONEncoder, UUID_REGEX ) from dokomoforms.models.user import User, Administrator, Email, construct_user from dokomoforms.models.node import ( Node, Question, construct_node, NODE_T...
gpl-3.0
CODAIT/graph_def_editor
graph_def_editor/__init__.py
1
2042
# Copyright 2019 IBM. All Rights Reserved. # 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...
apache-2.0
wenhulove333/ScutServer
Sample/Koudai/Server/release/Script/PyScript/Action/action1611.py
2
6111
import clr, sys clr.AddReference('ZyGames.Framework.Common'); clr.AddReference('ZyGames.Framework'); clr.AddReference('ZyGames.Framework.Game'); clr.AddReference('ZyGames.Tianjiexing.Model'); clr.AddReference('ZyGames.Tianjiexing.BLL'); clr.AddReference('ZyGames.Tianjiexing.Lang'); clr.AddReference('ZyGames.Tia...
mit
RiccardoPecora/MP
Lib/pprint.py
57
12282
# Author: Fred L. Drake, Jr. # fdrake@acm.org # # This is a simple little module I wrote to make life easier. I didn't # see anything quite like it in the library, though I may have overlooked # something. I wrote this when I was trying to read some heavily nested # tuples with fairly no...
gpl-3.0
markgw/jazzparser
bin/analysis/chord_findsong.py
1
10905
#!/usr/bin/env ../jazzshell """ Like findsong, but searches by chord label sequence similarity. ============================== License ======================================== Copyright (C) 2008, 2010-12 University of Edinburgh, Mark Granroth-Wilding This file is part of The Jazz Parser. The Jazz Parser is free...
gpl-3.0
mindnervestech/mnrp
addons/purchase_double_validation/__openerp__.py
52
1972
# -*- 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
vrsys/avangong
avango-menu/python/avango/menu/layout/_SubMenuLayouter.py
6
4427
# -*- Mode:Python -*- ########################################################################## # # # This file is part of AVANGO. # # ...
lgpl-3.0
shuxin/androguard
androguard/core/bytecodes/axml.py
1
73316
from __future__ import division from __future__ import print_function from builtins import chr from builtins import range from builtins import object from androguard.core import bytecode from androguard.core.resources import public from struct import pack, unpack from xml.sax.saxutils import escape import collection...
apache-2.0
ashhher3/pattern
pattern/server/cherrypy/cherrypy/_cpwsgi_server.py
41
2804
"""WSGI server interface (see PEP 333). This adds some CP-specific bits to the framework-agnostic wsgiserver package. """ import sys import cherrypy from cherrypy import wsgiserver class CPWSGIServer(wsgiserver.CherryPyWSGIServer): """Wrapper for wsgiserver.CherryPyWSGIServer. wsgiserver has been designed t...
bsd-3-clause
pferreir/indico
indico/modules/events/editing/controllers/backend/editable_list.py
4
8336
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. import uuid from flask import jsonify, request, session from marshmallow import fields from sqlalchemy.or...
mit
cloudbase/neutron-virtualbox
neutron/plugins/vmware/dbexts/networkgw_db.py
1
22317
# Copyright 2013 VMware, 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...
apache-2.0
sigma-random/reverse
lib/colors.py
2
3069
#!/bin/python3 # # Reverse : Generate an indented asm code (pseudo-C) with colored syntax. # Copyright (C) 2015 Joel # # 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 ...
gpl-3.0
simone-campagna/invoice
tests/unittests/test_invoice_main.py
1
24435
# -*- coding: utf-8 -*- # # Copyright 2015 Simone Campagna # # 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
redhat-openstack/nova
nova/tests/objects/test_block_device.py
15
13683
# Copyright 2013 Red Hat 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 ag...
apache-2.0
chiamingyen/pygroup_sqlite
wsgi/static/Brython2.1.4-20140810-083054/Lib/warnings.py
752
13825
"""Python part of the warnings subsystem.""" # Note: function level imports should *not* be used # in this module as it may cause import lock deadlock. # See bug 683658. import linecache import sys __all__ = ["warn", "showwarning", "formatwarning", "filterwarnings", "resetwarnings", "catch_warnings"] def...
gpl-2.0
unicri/edx-platform
lms/djangoapps/shoppingcart/tests/test_microsites.py
101
7876
""" Tests for Microsite Dashboard with Shopping Cart History """ import mock from django.core.urlresolvers import reverse from mock import patch from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.factories import CourseFactory from shoppingcart.models import ( O...
agpl-3.0
dveeden/mysql-server
plugin/innodb_memcached/daemon_memcached/testsuite/breakdancer/breakdancer.py
201
3750
#!/usr/bin/env python import itertools class Condition(object): """Something asserted to be true during the test. A given condition may be used as a precondition or a postcondition.""" def __call__(self, k, state): """Called with a key and a state. True if the condition is met.""" r...
gpl-2.0
nigelb/SerialGrabber
example_config/SerialGrabber_Paths.py
7
1190
#!/usr/bin/env python # SerialGrabber reads data from a serial port and processes it with the # configured processor. # Copyright (C) 2012 NigelB # # 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 Foundatio...
gpl-2.0
xiaohan2012/capitalization-restoration-train
hmm.py
1
2186
""" This implementation is based on the HMM description in Chapter 8, Huang, Acero and Hon, Spoken Language Processing and includes an extension for training shallow HMM parsers or specialized HMMs as in Molina et. al, 2002. """ from nltk.tag.hmm import HiddenMarkovModelTagger from data import load_labeled_data from c...
mit
nakagami/reportlab
src/tools/pythonpoint/styles/modern.py
1
3798
#Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/tools/pythonpoint/styles/modern.py __version__=''' $Id: modern.py 3959 2012-09-27 14:39:39Z robin $ ''' # style_modern.py __doc__="""This is an example...
bsd-3-clause
GaZ3ll3/numpy
numpy/polynomial/tests/test_laguerre.py
123
16351
"""Tests for laguerre module. """ from __future__ import division, absolute_import, print_function import numpy as np import numpy.polynomial.laguerre as lag from numpy.polynomial.polynomial import polyval from numpy.testing import ( TestCase, assert_almost_equal, assert_raises, assert_equal, assert_, run_mod...
bsd-3-clause
Crespo911/pyspace
pySPACE/environments/backends/mpi_backend.py
1
15067
""" Distribute the processes on a High Performance Cluster Very simple Implementation. .. todo:: Documentation :Author: Yohannes Kassahun (kassahun@informatik.uni-bremen.de) :Created: 2011/01/11 """ import os import sys import logging import logging.handlers import cPickle import shutil import time import subproces...
gpl-3.0
jtl999/certbot
certbot-compatibility-test/certbot_compatibility_test/configurators/common.py
9
3452
"""Provides a common base for configurator proxies""" import logging import os import shutil import tempfile from certbot import constants from certbot_compatibility_test import errors from certbot_compatibility_test import util logger = logging.getLogger(__name__) class Proxy(object): # pylint: disable=too-ma...
apache-2.0
loggin/romcollectionbrowser
resources/lib/dialogeditscraper.py
11
11607
import xbmc, xbmcgui import os import util, config, dialogbase from util import * from configxmlwriter import * ACTION_CANCEL_DIALOG = (9,10,51,92,110) CONTROL_BUTTON_EXIT = 5101 CONTROL_BUTTON_SAVE = 6000 CONTROL_BUTTON_CANCEL = 6010 #Scrapers CONTROL_LIST_SCRAPERS = 5600 CONTROL_BUTTON_SCRAPERS...
gpl-2.0
danialbehzadi/Nokia-RM-1013-2.0.0.11
webkit/Tools/Scripts/webkitpy/common/system/deprecated_logging.py
15
3372
# Copyright (c) 2009, Google Inc. All rights reserved. # Copyright (c) 2009 Apple 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 ab...
gpl-3.0
respondcreate/django-versatileimagefield
versatileimagefield/settings.py
2
4749
"""versatileimagefield settings.""" from django.utils.module_loading import import_string from django.conf import settings from django.core.cache import ( caches, cache as default_cache, InvalidCacheBackendError ) from django.core.exceptions import ImproperlyConfigured # Defaults QUAL = 70 VERSATILEIMAGEF...
mit
Pluto-tv/chromium-crosswalk
tools/telemetry/third_party/gsutilz/gslib/tests/test_rsync.py
14
50819
# -*- 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 require...
bsd-3-clause
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/django/contrib/gis/db/models/functions.py
41
18437
from decimal import Decimal from django.contrib.gis.db.models.fields import GeometryField, RasterField from django.contrib.gis.db.models.sql import AreaField from django.contrib.gis.geometry.backend import Geometry from django.contrib.gis.measure import ( Area as AreaMeasure, Distance as DistanceMeasure, ) from dj...
gpl-3.0
abad623/verbalucce
verbalucce/nltk/corpus/reader/indian.py
17
3029
# Natural Language Toolkit: Indian Language POS-Tagged Corpus Reader # # Copyright (C) 2001-2012 NLTK Project # Author: Steven Bird <sb@ldc.upenn.edu> # Edward Loper <edloper@gradient.cis.upenn.edu> # URL: <http://www.nltk.org/> # For license information, see LICENSE.TXT """ Indian Language POS-Tagged Corpus C...
apache-2.0
DavidGregory084/ensime-sublime
rpc.py
2
18185
from __future__ import unicode_literals import inspect, functools from functools import partial as bind import sexp from sexp import key, sym # ############################# DATA STRUCTURES ############################## class ActiveRecord(object): @classmethod def parse_list(cls, raw): if not raw: re...
mit
frankk00/realtor
gdata/codesearch/service.py
161
4734
# -*- coding: utf-8 -*- # # Copyright (c) 2007 Benoit Chesneau <benoitc@metavers.net> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS...
bsd-3-clause
h3llrais3r/Auto-Subliminal
autosubliminal/core/item.py
1
9332
# coding=utf-8 import datetime import logging import re import autosubliminal from autosubliminal.util.common import get_today, to_list, to_obj, to_obj_or_list # Release group regex release_group_regex = re.compile(r'(.*)\[.*?\]') log = logging.getLogger(__name__) class _Item(object): """ Base item class. ...
gpl-3.0
UK992/servo
python/servo/devenv_commands.py
4
12132
# Copyright 2013 The Servo Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your #...
mpl-2.0
cdepman/falcon_api
site-packages/gunicorn/argparse_compat.py
490
87791
# Author: Steven J. Bethard <steven.bethard@gmail.com>. """Command-line parsing library This module is an optparse-inspired command-line parsing library that: - handles both optional and positional arguments - produces highly informative usage messages - supports parsers that dispatch to sub-parsers The...
mit
jianlirong/incubator-hawq
tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/tests/class.py
11
3104
import compiler import compiler as one import compiler.ast import compiler.ast as two from compiler import ast from compiler import ast as three from compiler.ast import Const from compiler.ast import Const as four func = lambda x: x class D: c...
apache-2.0
fly19890211/edx-platform
lms/djangoapps/courseware/migrations/0008_add_xmodule_storage.py
114
13726
# -*- coding: 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 model 'XModuleStudentInfoField' db.create_table('courseware_xmodulestudentinfofield', ( ...
agpl-3.0
tpisani/django-inspect
django_inspect/inspecting.py
1
3245
import inspect from django.db import models class Inspect(object): """ Provides inspection conveniences for django models. """ def __init__(self, model): if not inspect.isclass(model): model = model.__class__ if not issubclass(model, models.Model): raise TypeE...
bsd-3-clause
neilpelow/wmap-django
venv/lib/python3.5/site-packages/psycopg2/extras.py
8
42337
"""Miscellaneous goodies for psycopg2 This module is a generic place used to hold little helper functions and classes until a better place in the distribution is found. """ # psycopg/extras.py - miscellaneous extra goodies for psycopg # # Copyright (C) 2003-2010 Federico Di Gregorio <fog@debian.org> # # psycopg2 is f...
gpl-3.0
koobonil/Boss2D
Boss2D/addon/tensorflow-1.2.1_for_boss/tensorflow/contrib/tensor_forest/__init__.py
165
1052
# 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...
mit
codekaki/odoo
addons/purchase/report/__init__.py
68
1108
# -*- 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
40223203/2015cdb_g3_40223203_0622
static/Brython3.1.1-20150328-091302/Lib/multiprocessing/__init__.py
693
6866
# # Package analogous to 'threading.py' but using processes # # multiprocessing/__init__.py # # This package is intended to duplicate the functionality (and much of # the API) of threading.py but uses processes instead of threads. A # subpackage 'multiprocessing.dummy' has the same API but is a simple # wrapper for 't...
gpl-3.0
joerg84/arangodb
3rdParty/V8/v5.7.0.0/tools/gyp/test/library_dirs/gyptest-library-dirs.py
53
1421
#!/usr/bin/env python # 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. """ Verifies library_dirs (in link_settings) are properly found. """ import sys import TestGyp test = TestGyp.TestGyp() lib_dir = test.t...
apache-2.0
sunqm/pyscf
examples/scf/12-fast_newton.py
2
2306
#!/usr/bin/env python # # Author: Qiming Sun <osirpt.sun@gmail.com> # ''' scf.fast_newton is an entry for second order SCF method with optimized configures. It can perform 3 times faster than the default second order SCF settings in many systems. ''' from pyscf import gto, scf mol = gto.M(atom=''' N 5.254640 8.78799...
apache-2.0
rds0751/colinkers
env/Lib/site-packages/django/contrib/redirects/migrations/0001_initial.py
308
1561
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('sites', '0001_initial'), ] operations = [ migrations.CreateModel( name='Redirect', fields=[ ...
agpl-3.0
hovsepm/azure-libraries-for-net
tools/authgen.py
5
1530
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
mit
yangming85/lettuce
tests/integration/lib/Django-1.2.5/django/core/management/commands/flush.py
52
3433
from optparse import make_option from django.conf import settings from django.db import connections, router, transaction, models, DEFAULT_DB_ALIAS from django.core.management import call_command from django.core.management.base import NoArgsCommand, CommandError from django.core.management.color import no_style from d...
gpl-3.0
catapult-project/catapult
third_party/gsutil/gslib/tests/test_plurality_checkable_iterator.py
5
7717
# -*- coding: utf-8 -*- # Copyright 2012 Google Inc. All Rights Reserved. # # 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 u...
bsd-3-clause
h3biomed/ansible
lib/ansible/plugins/doc_fragments/alicloud.py
44
1982
# -*- coding: utf-8 -*- # Copyright: (c) 2017 Alibaba Group Holding Limited. He Guimin <heguimin36@163.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) class ModuleDocFragment(object): # Alicloud only documentation fragment DOCUMENTATION = r''' options: ali...
gpl-3.0
Flexget/Flexget
flexget/tests/test_backlog.py
3
1487
class TestBacklog: config = """ tasks: test: mock: - {title: 'Test.S01E01.hdtv-FlexGet', description: ''} set: description: '{{description}}I' laterfield: 'something' # Change the priority of set plugin so it runs on all...
mit
hotpxl/mxnet
example/gluon/dcgan.py
1
8007
import matplotlib as mpl mpl.use('Agg') from matplotlib import pyplot as plt import argparse import mxnet as mx from mxnet import gluon from mxnet.gluon import nn from mxnet import autograd import numpy as np import logging from datetime import datetime import os import time def fill_buf(buf, i, img, shape): n = ...
apache-2.0
muntasirsyed/intellij-community
python/helpers/pydev/pydevd_attach_to_process/winappdbg/win32/context_i386.py
102
16108
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2009-2014, Mario Vilas # 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...
apache-2.0
YetAnotherTomek/egfrd
samples/mapk/rebind_ratio/plot_hist.py
6
6368
#!/usr/bin/env python # D=1 # python plot_hist.py "." mapk3_1e-15_1_fixed_1e-1_normal_ALL_reactions.rebind mapk3_1e-15_1_fixed_1e-2_normal_ALL_reactions.rebind mapk3_1e-15_1_fixed_1e-3_normal_ALL_reactions.rebind mapk3_1e-15_1_fixed_1e-4_normal_ALL_reactions.rebind mapk3_1e-15_1_fixed_1e-5_normal_ALL_reactions.rebind...
gpl-2.0
pratapvardhan/scikit-learn
sklearn/neural_network/tests/test_mlp.py
46
18585
""" Testing for Multi-layer Perceptron module (sklearn.neural_network) """ # Author: Issam H. Laradji # Licence: BSD 3 clause import sys import warnings import numpy as np from numpy.testing import assert_almost_equal, assert_array_equal from sklearn.datasets import load_digits, load_boston from sklearn.datasets i...
bsd-3-clause
Soya93/Extract-Refactoring
python/helpers/pydev/pydevd_attach_to_process/winappdbg/__init__.py
102
7917
#!~/.wine/drive_c/Python25/python.exe # -*- coding: utf-8 -*- # Copyright (c) 2009-2014, Mario Vilas # 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 ...
apache-2.0
code-google-com/cortex-vfx
test/IECore/ImageSequenceCompositeOpTest.py
12
3495
########################################################################## # # Copyright (c) 2008-2009, Image Engine Design 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: # # * Redis...
bsd-3-clause
BradburyLab/show_tv
show_tv/dumb_tcp_server.py
1
5396
# coding: utf-8 from tornado import gen def try_read_bytes(stream, num_bytes, callback, streaming_callback=None): """ Прочитать num_bytes либо меньше, если поток закроется раньше """ def finish(is_ok, data): callback((is_ok, data)) def read_from_buffer(num_bytes): rest_cnt = stream._r...
gpl-3.0
sjshank/pollApplication
node_modules/node-gyp/gyp/pylib/gyp/common_test.py
2542
1970
#!/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): ...
isc
ifduyue/django
tests/reserved_names/tests.py
133
1737
import datetime from django.test import TestCase from .models import Thing class ReservedNameTests(TestCase): def generate(self): day1 = datetime.date(2005, 1, 1) Thing.objects.create( when='a', join='b', like='c', drop='d', alter='e', having='f', where=day1, has_hyphen='...
bsd-3-clause
losnikitos/googleads-python-lib
examples/dfp/v201502/creative_wrapper_service/get_all_creative_wrappers.py
4
2022
#!/usr/bin/python # # Copyright 2015 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 b...
apache-2.0
hn8841182/20150623-test02
static/Brython3.1.0-20150301-090019/Lib/getopt.py
845
7488
"""Parser for command line options. This module helps scripts to parse the command line arguments in sys.argv. It supports the same conventions as the Unix getopt() function (including the special meanings of arguments of the form `-' and `--'). Long options similar to those supported by GNU software may be used as ...
gpl-3.0
AlexCaranha/Wox
PythonHome/Lib/site-packages/pip/_vendor/requests/structures.py
279
3541
# -*- coding: utf-8 -*- """ requests.structures ~~~~~~~~~~~~~~~~~~~ Data structures that power Requests. """ import os import collections from itertools import islice class IteratorProxy(object): """docstring for IteratorProxy""" def __init__(self, i): self.i = i # self.i = chain.from_iter...
mit
MSOpenTech/edx-platform
lms/djangoapps/bulk_email/migrations/0008_add_course_authorizations.py
114
6426
# -*- coding: 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 model 'CourseAuthorization' db.create_table('bulk_email_courseauthorization', ( ('id', ...
agpl-3.0
labordoc/labordoc-next
modules/websubmit/lib/wsm_pdftk_plugin.py
35
7328
## This file is part of Invenio. ## Copyright (C) 2010, 2011 CERN. ## ## Invenio 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. ## ...
gpl-2.0