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
fedora-infra/packagedb
pkgdb/lib/validators.py
2
10016
# -*- coding: utf-8 -*- # # Copyright © 2008, 2010 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, modify, # copy, or redistribute it subject to the terms and conditions of the GNU # General Public License v.2, or (at your option) any later version. This # program is distribute...
gpl-2.0
ekg/multichoose
multipermute.py
6
2680
#!/usr/bin/python # -*- coding: utf-8 -*- # multipermute.py - permutations of a multiset # Erik Garrison <erik.garrison@bc.edu> 2010 """ This module encodes functions to generate the permutations of a multiset following this algorithm: Algorithm 1 Visits the permutations of multiset E. The permutations are stored in...
mit
eltonsantos/django
django/core/management/validation.py
107
23840
import collections import sys from django.conf import settings from django.core.management.color import color_style from django.utils.encoding import force_str from django.utils.itercompat import is_iterable from django.utils import six class ModelErrorCollection: def __init__(self, outfile=sys.stdout): ...
bsd-3-clause
pombredanne/teamwork
exts/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
vedujoshi/tempest
tempest/lib/services/network/ports_client.py
2
3105
# 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
xbezdick/tempest
tempest/services/compute/json/floating_ip_pools_client.py
6
1314
# Copyright 2012 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...
apache-2.0
tudorian/eden
tests/unit_tests/modules/s3/s3gis/YahooLayer.py
43
1342
s3gis_tests = load_module("tests.unit_tests.modules.s3.s3gis") test_utils = local_import("test_utils") yahoo_layer = dict( name = "Test Yahoo Layer", description = "Test Yahoo", enabled = True, created_on = datetime.datetime.now(), modified_on = datetime.datetime.now(), satellite_enabled = Tru...
mit
qedsoftware/commcare-hq
corehq/apps/reports/standard/__init__.py
1
8604
from datetime import datetime import dateutil from django.core.cache import cache from django.core.urlresolvers import reverse from corehq.apps.casegroups.models import CommCareCaseGroup from corehq.apps.groups.models import Group from corehq.apps.reports import util from corehq.apps.reports.dispatcher import ProjectRe...
bsd-3-clause
yanchen036/tensorflow
tensorflow/contrib/distributions/python/ops/bijectors/matrix_inverse_tril.py
3
5272
# 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...
apache-2.0
webgeodatavore/django
django/templatetags/static.py
197
4052
from django import template from django.utils.encoding import iri_to_uri from django.utils.six.moves.urllib.parse import urljoin register = template.Library() class PrefixNode(template.Node): def __repr__(self): return "<PrefixNode for %r>" % self.name def __init__(self, varname=None, name=None): ...
bsd-3-clause
sammyshj/gci
modules/s3db/fire.py
4
21906
# -*- coding: utf-8 -*- """ Sahana Eden Fire Models @copyright: 2009-2013 (c) Sahana Software Foundation @license: MIT 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...
mit
thilaire/CodingGameServer
games/Networks/server/AliceRandomPlayer.py
1
4279
""" * --------------------- * | | | Coding Game Server | | | * --------------------- * Authors: M. Pecheux (based on T. Hilaire and J. Brajard template file) Licence: GPL File: aliceRandomPlayer.py Contains the class aliceRandomPlayer -> defines a dummy Alice player t...
gpl-3.0
bguillot/OpenUpgrade
openerp/tools/amount_to_text_en.py
441
5103
# -*- 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...
agpl-3.0
mmnelemane/nova
nova/api/openstack/compute/legacy_v2/contrib/agents.py
7
7919
# Copyright 2012 IBM Corp. # # 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 t...
apache-2.0
SerCeMan/intellij-community
python/lib/Lib/encodings/euc_jis_2004.py
816
1051
# # euc_jis_2004.py: Python Unicode Codec for EUC_JIS_2004 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_jp, codecs import _multibytecodec as mbc codec = _codecs_jp.getcodec('euc_jis_2004') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(m...
apache-2.0
pyhmsa/pyhmsa
pyhmsa/fileformat/xmlhandler/condition/region.py
1
1491
""" XML handler for region condition """ # Standard library modules. # Third party modules. # Local modules. from pyhmsa.spec.condition.region import RegionOfInterest from pyhmsa.fileformat.xmlhandler.condition.condition import _ConditionXMLHandler # Globals and constants variables. class RegionOfInterestXMLHandle...
mit
CXQERP/ODOOERP
addons/mail/tests/test_mail_features.py
76
59326
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
jbaiter/plugin.video.brmediathek
resources/lib/xbmcswift2/__init__.py
2
2442
''' xbmcswift2 ---------- A micro framework to enable rapid development of XBMC plugins. :copyright: (c) 2012 by Jonathan Beluch :license: GPLv3, see LICENSE for more details. ''' from types import ModuleType class module(ModuleType): '''A wrapper class for a module used to override __getatt...
gpl-3.0
jsirois/commons
src/python/twitter/checkstyle/plugins/missing_contextmanager.py
14
1726
# ================================================================================================== # Copyright 2014 Twitter, Inc. # -------------------------------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
apache-2.0
eandersson/amqp-storm
amqpstorm/exception.py
2
4462
"""AMQPStorm Exception.""" AMQP_ERROR_MAPPING = { 311: ('CONTENT-TOO-LARGE', 'The client attempted to transfer content larger than the ' 'server could accept at the present time. The client may ' 'retry at a later time.'), 312: ('NO-ROUTE', 'Undocumented AMQP Soft Error'), 31...
mit
kawalpemilu/kawalpemilu2014
internal-backend/http-server/gyp/test/mac/gyptest-app.py
75
4193
#!/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. """ Verifies that app bundles are built correctly. """ import TestGyp import os import plistlib import subprocess import sys def GetStdou...
agpl-3.0
hyperNURb/ggrc-core
src/ggrc_workflows/services/workflow_cycle_calculator/annually_cycle_calculator.py
5
2706
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: urban@reciprocitylabs.com # Maintained By: urban@reciprocitylabs.com import datetime from dateutil import relativedelta from cycle_calculator impo...
apache-2.0
MoKee/android_kernel_amazon_otter-common
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
goodwinnk/intellij-community
python/helpers/python-skeletons/nose/tools/__init__.py
80
5457
"""Skeleton for 'nose.tools' module. Project: nose 1.3 <https://nose.readthedocs.org/> Skeleton by: Andrey Vlasovskikh <andrey.vlasovskikh@jetbrains.com> """ import sys def assert_equal(first, second, msg=None): """Fail if the two objects are unequal as determined by the '==' operator. """ pass def a...
apache-2.0
Jason-Lam/linux-am335x
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
1935
# Util.py - Python extension for perf script, miscellaneous utility code # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. import errno, os FUTEX_WAIT = 0...
gpl-2.0
rabipanda/tensorflow
tensorflow/python/training/training_ops.py
131
1046
# 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
tacrow/tacrow
node_modules/node-gyp/gyp/pylib/gyp/generator/android.py
960
45344
# 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. # Notes: # # This generates makefiles suitable for inclusion into the Android build system # via an Android.mk file. It is based on make.py, the standard makefile ...
mit
fxfitz/ansible
lib/ansible/modules/cloud/google/gcp_compute_backend_service.py
14
36795
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
gpl-3.0
ring00/bbl-ucore
related_info/ostep/ostep10-lottery.py
54
3990
#! /usr/bin/env python import sys from optparse import OptionParser import random parser = OptionParser() parser.add_option('-s', '--seed', default=0, help='the random seed', action='store', type='int', dest='seed') parser.add_option('-j', '--jobs', default=3, help='number of jobs in the system', action=...
gpl-2.0
colinligertwood/odoo
openerp/report/render/rml2txt/__init__.py
381
1351
# -*- 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...
agpl-3.0
orangeduck/PyAutoC
Python27/Lib/ctypes/test/test_array_in_pointer.py
117
1729
import unittest from ctypes import * from binascii import hexlify import re def dump(obj): # helper function to dump memory contents in hex, with a hyphen # between the bytes. h = hexlify(memoryview(obj)) return re.sub(r"(..)", r"\1-", h)[:-1] class Value(Structure): _fields_ = [("val", c_byte)] ...
bsd-2-clause
riteshshrv/django
django/contrib/gis/geos/prototypes/geom.py
288
4069
from ctypes import POINTER, c_char_p, c_int, c_size_t, c_ubyte from django.contrib.gis.geos.libgeos import CS_PTR, GEOM_PTR, GEOSFuncFactory from django.contrib.gis.geos.prototypes.errcheck import ( check_geom, check_minus_one, check_sized_string, check_string, check_zero, ) # This is the return type used by bina...
bsd-3-clause
sbalde/edxplatform
openedx/core/djangoapps/content/course_overviews/migrations/0006_add_version_and_timestamp.py
56
4600
# -*- coding: utf-8 -*- from south.utils import datetime_utils as 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 'CourseOverview.created' db.add_column('course_overviews_c...
agpl-3.0
dd00/commandergenius
project/jni/python/src/Lib/test/test_uu.py
61
5316
""" Tests for uu module. Nick Mathewson """ import unittest from test import test_support import sys, os, uu, cStringIO import uu plaintext = "The smooth-scaled python crept over the sleeping dog\n" encodedtext = """\ M5&AE('-M;V]T:\"US8V%L960@<'ET:&]N(&-R97!T(&]V97(@=&AE('-L965P (:6YG(&1O9PH """ encodedtextwrappe...
lgpl-2.1
abtink/openthread
tests/toranj/test-034-poor-link-parent-child-attach.py
9
3302
#!/usr/bin/env python3 # # Copyright (c) 2019, 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 # ...
bsd-3-clause
jotes/ansible
lib/ansible/runner/return_data.py
133
2102
# (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
brototyp/CouchPotato
library/sqlalchemy/dialects/mssql/mxodbc.py
18
3274
""" Support for MS-SQL via mxODBC. mxODBC is available at: http://www.egenix.com/ This was tested with mxODBC 3.1.2 and the SQL Server Native Client connected to MSSQL 2005 and 2008 Express Editions. Connecting ~~~~~~~~~~ Connection is via DSN:: mssql+mxodbc://<username>:<password>@<dsnname> Executio...
gpl-3.0
jsirois/pex
pex/vendor/_vendored/pip/pip/_vendor/chardet/universaldetector.py
244
12485
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
apache-2.0
erkanay/django
tests/null_fk_ordering/tests.py
44
2014
from __future__ import unicode_literals from django.test import TestCase from .models import Author, Article, SystemInfo, Forum, Post, Comment class NullFkOrderingTests(TestCase): def test_ordering_across_null_fk(self): """ Regression test for #7512 ordering across nullable Foreign Key...
bsd-3-clause
radhika-raghavendran/mbed-os5.1-onsemi
tools/host_tests/wait_us_auto.py
122
2871
""" mbed SDK Copyright (c) 2011-2013 ARM Limited 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 wr...
apache-2.0
xdevelsistemas/taiga-back-community
taiga/base/api/utils/formatting.py
2
4697
# -*- coding: utf-8 -*- # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz> # Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net> # This program is free software: you can r...
agpl-3.0
wangyou/XX-Net
code/default/gae_proxy/server/lib/google/appengine/api/backendinfo.py
14
6551
#!/usr/bin/env python # # Copyright 2007 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 o...
bsd-2-clause
nttks/edx-platform
common/lib/capa/capa/tests/test_correctmap.py
107
7116
""" Tests to verify that CorrectMap behaves correctly """ import unittest from capa.correctmap import CorrectMap import datetime class CorrectMapTest(unittest.TestCase): """ Tests to verify that CorrectMap behaves correctly """ def setUp(self): super(CorrectMapTest, self).setUp() sel...
agpl-3.0
fichter/grpc
src/python/grpcio_test/grpc_test/framework/interfaces/face/_blocking_invocation_inline_service.py
3
10601
# Copyright 2015, 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...
bsd-3-clause
mfazliazran/raft
analysis/resultsclasses/AnalysisResults.py
11
6849
# # Author: Justin Engler # # Copyright (c) 2011 RAFT Team # # This file is part of RAFT. # # RAFT 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 lat...
gpl-3.0
dennybaa/st2
st2common/st2common/models/system/actionchain.py
8
5983
# Licensed to the StackStorm, Inc ('StackStorm') 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 use th...
apache-2.0
peter-jang/ansible-modules-core
network/junos/junos_facts.py
19
4038
#!/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
381426068/MissionPlanner
Lib/encodings/unicode_internal.py
103
1241
""" Python 'unicode-internal' Codec Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """ import codecs ### Codec APIs class Codec(codecs.Codec): # Note: Binding these as C functions will result in the class not # converting them to meth...
gpl-3.0
lnielsen/invenio
invenio/legacy/bibformat/templates.py
3
75703
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2014 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 ...
gpl-2.0
claudio-idra/subterfuge
dbconfigure.py
22
1470
##################################################################### #This file is for use to fully reset the Subterfuge Database #It should only be necessary due to significant develompent changes #Usage MUST be as follows: #rm db && rm base_db #./manage.py syncdb #python dbconfigure.py #This will rebuild the Databas...
gpl-3.0
emrecamasuvi/appengineTmp
lib/flask/wrappers.py
773
6709
# -*- coding: utf-8 -*- """ flask.wrappers ~~~~~~~~~~~~~~ Implements the WSGI wrappers (request and response). :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from werkzeug.wrappers import Request as RequestBase, Response as ResponseBase from werkzeug.exce...
apache-2.0
execunix/vinos
external/bsd/wpa/dist/wpa_supplicant/examples/p2p/p2p_find.py
29
4714
#!/usr/bin/python # Tests p2p_find # Will list all devices found/lost within a time frame (timeout) # Then Program will exit ######### MAY NEED TO RUN AS SUDO ############# import dbus import sys, os import time import gobject import threading import getopt from dbus.mainloop.glib import DBusGMainLoop def usage(): p...
apache-2.0
moandcompany/luigi
examples/terasort.py
59
3445
# -*- 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
intgr/django-cms
cms/migrations/0045_auto__add_field_page_application_urls.py
15
16500
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models try: from django.contrib.auth import get_user_model except ImportError: # django < 1.5 from django.contrib.auth.models import User else: User = get_user_model() user_orm_label...
bsd-3-clause
izak/xhtml2pdf
demo/tgpisa/tgpisa/commands.py
155
1630
# -*- coding: utf-8 -*- """This module contains functions called from console script entry points.""" import os import sys from os.path import dirname, exists, join import pkg_resources pkg_resources.require("TurboGears") import turbogears import cherrypy cherrypy.lowercase_api = True class ConfigurationError(Exc...
apache-2.0
anksp21/Community-Zenpacks
ZenPacks.community.zenAppProfiler/ZenPacks/community/zenAppProfiler/__init__.py
2
5384
import Globals import os.path skinsDir = os.path.join(os.path.dirname(__file__), 'skins') from Products.CMFCore.DirectoryView import registerDirectory if os.path.isdir(skinsDir): registerDirectory(skinsDir, globals()) import transaction from Products.ZenModel.ZenossInfo import ZenossInfo from Products.ZenModel.Ze...
gpl-2.0
eduNEXT/edx-platform
lms/djangoapps/certificates/generation.py
2
6695
""" Course certificate generation These methods generate course certificates (they create a new course certificate if it does not yet exist, or update the existing cert if it does already exist). For now, these methods deal primarily with allowlist certificates, and are part of the V2 certificates revamp. These meth...
agpl-3.0
ar7z1/ansible
lib/ansible/modules/identity/opendj/opendj_backendprop.py
77
6939
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2016, Werner Dijkerman (ikben@werner-dijkerman.nl) # Copyright: (c) 2017, Ansible Project # 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_...
gpl-3.0
koushikcgit/xen
tools/python/xen/xm/opts.py
43
17981
#============================================================================ # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distributed in the hope th...
gpl-2.0
kimegitee/python-koans
python2/libs/colorama/ansitowin32.py
287
6621
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. import re import sys from .ansi import AnsiFore, AnsiBack, AnsiStyle, Style from .winterm import WinTerm, WinColor, WinStyle from .win32 import windll if windll is not None: winterm = WinTerm() def is_a_tty(stream): return hasattr(s...
mit
ltilve/chromium
gin/fingerprint/fingerprint_v8_snapshot.py
64
2442
#!/usr/bin/env python # # Copyright 2015 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. """Fingerprints the V8 snapshot blob files. Constructs a SHA256 fingerprint of the V8 natives and snapshot blob files and creates a ...
bsd-3-clause
shiblon/pytour
static/js/pypyjs/pypy-nojit.js-0.3.1/lib/modules/test/test_coding.py
121
1212
import test.test_support, unittest import os class CodingTest(unittest.TestCase): def test_bad_coding(self): module_name = 'bad_coding' self.verify_bad_module(module_name) def test_bad_coding2(self): module_name = 'bad_coding2' self.verify_bad_module(module_name) def veri...
apache-2.0
cetic/ansible
lib/ansible/modules/network/cloudengine/ce_snmp_location.py
39
6774
#!/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
Tatsh/Clementine
dist/codesign.py
10
1320
#!/usr/bin/python2 # Emulates the behaviour of codesign --deep which is missing on OS X < 10.9 import os import re import subprocess import sys def SignPath(path, developer_id, deep=True): args = [ 'codesign', '--preserve-metadata=identifier,entitlements,resource-rules,requirements', '-s', developer_id,...
gpl-3.0
aozima/rt-thread
bsp/taihu/rtconfig.py
52
1285
import os # toolchains options ARCH='ppc' CPU='ppc405' CROSS_TOOL='gcc' TextBase = '0x00000000' PLATFORM = 'gcc' EXEC_PATH = 'C:/Program Files/CodeSourcery/Sourcery G++ Lite/bin' BUILD = 'debug' if os.getenv('RTT_EXEC_PATH'): EXEC_PATH = os.getenv('RTT_EXEC_PATH') if PLATFORM == 'gcc': # toolchains PREFIX...
gpl-2.0
blefaudeux/Pinta
pinta/model/model_rnn.py
1
2323
import logging from typing import List import numpy as np import torch import torch.nn as nn from pinta.model.model_base import NN LOG = logging.getLogger("ConvRNN") class ConvRNN(NN): """ Combination of a convolutional front end and an RNN (GRU) layer below >> see https://gist.github.com/spro/c87cc706...
gpl-3.0
mmalyska/eve-wspace
evewspace/SiteTracker/migrations/0003_auto__add_systemweight.py
17
15303
# -*- 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 'SystemWeight' db.create_table('SiteTracker_systemweight', ( ('system', self.gf('...
gpl-3.0
tealover/nova
nova/network/api.py
17
23539
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc. # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2013 IBM Corp. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you...
apache-2.0
crakensio/django_training
lib/python2.7/site-packages/django/contrib/sessions/models.py
173
1997
from django.db import models from django.utils.translation import ugettext_lazy as _ class SessionManager(models.Manager): def encode(self, session_dict): """ Returns the given session dictionary serialized and encoded as a string. """ return SessionStore().encode(session_dict) ...
cc0-1.0
ArneBab/pypyjs
website/demo/home/rfk/repos/pypy/lib-python/2.7/plat-mac/lib-scriptpackages/StdSuites/__init__.py
73
12854
""" Package generated from /Volumes/Sap/System Folder/Extensions/AppleScript Resource aeut resid 0 Standard Event Suites for English """ from warnings import warnpy3k warnpy3k("In 3.x, the StdSuites package is removed.", stacklevel=2) import aetools Error = aetools.Error import Text_Suite import AppleScript_Suite imp...
mit
nirmeshk/oh-mainline
vendor/packages/gdata/src/gdata/tlslite/HandshakeSettings.py
359
6364
"""Class for setting handshake parameters.""" from constants import CertificateType from utils import cryptomath from utils import cipherfactory class HandshakeSettings: """This class encapsulates various parameters that can be used with a TLS handshake. @sort: minKeySize, maxKeySize, cipherNames, certifi...
agpl-3.0
nyasara/azuremono-docker
IronPython-2.7.4/Lib/ctypes/_endian.py
51
2101
###################################################################### # This file should be kept compatible with Python 2.3, see PEP 291. # ###################################################################### import sys from ctypes import * _array_type = type(c_int * 3) def _other_endian(typ): """Ret...
mit
duramato/SickRage
tornado/template.py
142
31156
#!/usr/bin/env python # # Copyright 2009 Facebook # # 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 a...
gpl-3.0
SDSG-Invenio/invenio
invenio/modules/formatter/format_elements/bfe_arxiv_link.py
13
1776
# This file is part of Invenio. # Copyright (C) 2014 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. # # Invenio is d...
gpl-2.0
jgraham/servo
tests/wpt/web-platform-tests/tools/pywebsocket/src/mod_pywebsocket/handshake/__init__.py
658
4406
# Copyright 2011, 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...
mpl-2.0
alexandrul-ci/robotframework
src/robot/running/namespace.py
2
18101
# Copyright 2008-2015 Nokia Networks # Copyright 2016- Robot Framework Foundation # # 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
zero323/spark
python/pyspark/sql/tests/test_serde.py
23
6188
# # 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/cloud/amazon/ec2_vpc_vgw.py
69
20312
#!/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 distributed...
gpl-3.0
alisidd/tensorflow
tensorflow/compiler/tests/adam_test.py
79
7193
# 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...
apache-2.0
moto-timo/ironpython3
Src/StdLib/Lib/test/test_pep277.py
10
7007
# Test the Unicode versions of normal file functions # open, os.open, os.stat. os.listdir, os.rename, os.remove, os.mkdir, os.chdir, os.rmdir import os import sys import unittest import warnings from unicodedata import normalize from test import support filenames = [ '1_abc', '2_ascii', '3_Gr\xfc\xdf-Gott'...
apache-2.0
bzennn/blog_flask
python/lib/python3.5/site-packages/wheel/metadata.py
62
11561
""" Tools for converting old- to new-style metadata. """ import email.parser import os.path import re import textwrap from collections import namedtuple, OrderedDict import pkg_resources from . import __version__ as wheel_version from .pkginfo import read_pkg_info from .util import OrderedDefaultDict METADATA_VERSI...
gpl-3.0
kezabelle/django-rest-framework
rest_framework/utils/humanize_datetime.py
144
1285
""" Helper functions that convert strftime formats into more readable representations. """ from rest_framework import ISO_8601 def datetime_formats(formats): format = ', '.join(formats).replace( ISO_8601, 'YYYY-MM-DDThh:mm[:ss[.uuuuuu]][+HH:MM|-HH:MM|Z]' ) return humanize_strptime(format) ...
bsd-2-clause
antsant/namebench
nb_third_party/dns/rdata.py
215
14860
# Copyright (C) 2001-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation 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 PROVIDED ...
apache-2.0
nguyentran/openviber
tools/scons-local/scons-local-2.0.1/SCons/Environment.py
61
91318
"""SCons.Environment Base class for construction Environments. These are the primary objects used to communicate dependency and construction information to the build engine. Keyword arguments supplied when the construction Environment is created are construction variables used to initialize the Environment """ # # ...
mit
joymarquis/mscc
general/lib/python/pexpect-4.0.1/pexpect/pxssh.py
12
18725
'''This class extends pexpect.spawn to specialize setting up SSH connections. This adds methods for login, logout, and expecting the shell prompt. PEXPECT LICENSE This license is approved by the OSI and FSF as GPL-compatible. http://opensource.org/licenses/isc-license.txt Copyright (c) 2012, Noah Spu...
gpl-3.0
huonw/servo
tests/wpt/css-tests/css-fonts-3_dev/xhtml1/reference/support/fonts/makegsubfonts.py
820
14309
import os import textwrap from xml.etree import ElementTree from fontTools.ttLib import TTFont, newTable from fontTools.misc.psCharStrings import T2CharString from fontTools.ttLib.tables.otTables import GSUB,\ ScriptList, ScriptRecord, Script, DefaultLangSys,\ FeatureList, FeatureRecord, Feature,\ LookupLi...
mpl-2.0
Zkin/pf-kernel-updates
tools/perf/scripts/python/check-perf-trace.py
1997
2539
# perf script event handlers, generated by perf script -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. ...
gpl-2.0
APM602/APM602
mk/PX4/Tools/genmsg/src/genmsg/template_tools.py
215
9443
# Software License Agreement (BSD License) # # Copyright (c) 2011, Willow Garage, 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...
gpl-3.0
ville-k/tensorflow
tensorflow/python/kernel_tests/string_join_op_test.py
134
1896
# 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
brandonium21/snowflake
snowflakeEnv/lib/python2.7/site-packages/pip/vcs/bazaar.py
280
4427
from __future__ import absolute_import import logging import os import tempfile import re # TODO: Get this into six.moves.urllib.parse try: from urllib import parse as urllib_parse except ImportError: import urlparse as urllib_parse from pip.utils import rmtree, display_path from pip.vcs import vcs, VersionC...
bsd-2-clause
etuna-SBF-kog/Stadsparken
env/lib/python2.7/site-packages/django/contrib/auth/hashers.py
2
15500
import functools import hashlib from django.conf import settings from django.utils import importlib from django.utils.datastructures import SortedDict from django.utils.encoding import smart_str from django.core.exceptions import ImproperlyConfigured from django.utils.crypto import ( pbkdf2, constant_time_compare,...
gpl-3.0
srajag/contrail-controller
src/config/common/svc_info.py
9
2236
# # Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # _MGMT_STR = "management" _LEFT_STR = "left" _RIGHT_STR = "right" _SVC_VN_MGMT = "svc-vn-mgmt" _SVC_VN_LEFT = "svc-vn-left" _SVC_VN_RIGHT = "svc-vn-right" _VN_MGMT_SUBNET_CIDR = '10.250.1.0/24' _VN_LEFT_SUBNET_CIDR = '10.250.2.0/24' _VN_RIGHT_SUBNET_...
apache-2.0
google/starthinker
dags/sheets_copy_dag.py
1
4462
########################################################################### # # Copyright 2020 Google LLC # # 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 # # https://www.apache.org/l...
apache-2.0
jtattermusch/grpc
src/python/grpcio/grpc/experimental/session_cache.py
27
1533
# Copyright 2018 gRPC authors. # # 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
jstoja/TsinghuaMailSystem
src/com/mailsystem/__main__.py
1
1654
#!/usr/bin/env python # coding: utf-8 import sys import json import argparse from bottle import run import src.com.mailsystem.api.routes as api import src.com.mailsystem.codes as codes from src.com.mailsystem.orm.Database import Database from src.com.mailsystem.populate import populate_db def read_config(setup_fil...
mit
openstack/keystone
keystone/common/sql/expand_repo/versions/066_expand_add_role_and_project_option_tables.py
2
1880
# 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 t...
apache-2.0
SecurityFTW/cs-suite
tools/Scout2/AWSScout2/services/cloudformation.py
3
1472
# -*- coding: utf-8 -*- import json from AWSScout2.configs.regions import RegionalServiceConfig, RegionConfig, api_clients ######################################## # CloudFormationRegionConfig ######################################## class CloudFormationRegionConfig(RegionConfig): """ CloudFormation confi...
gpl-3.0
liorvh/Harness
harness/modules/payloads/x64/dll/ReflectiveHarness_x64.py
2
241621
''' Harness Toolset Copyright (c) 2015 Rich Kelley, RK5DEVMAIL[A T]gmail[D O T]com ''' from harness.core import module class Module(module.ModuleFrame): about = { 'name': 'HarnessEXE_x64', 'info': 'Generate Reflective Payload (x64)', 'author': 'Rich', 'contac...
mit
xuweiliang/Codelibrary
openstack_dashboard/api/authcode_back.py
1
2953
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import time import base64 import hashlib class AuthCode(object): @classmethod def code_init(cls, cipher): try: encrypted_data = getattr(cipher, 'encrypted_license') encrypted_str = encrypted_data.strip() decr...
apache-2.0
ashhher3/cvxpy
cvxpy/atoms/elementwise/elementwise.py
10
1354
""" Copyright 2013 Steven Diamond This file is part of CVXPY. CVXPY 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. CVXPY is distributed i...
gpl-3.0