repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
rhyolight/nupic.son
app/soc/modules/gsoc/views/helper/request_data.py
1
19008
# Copyright 2011 the Melange 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 wr...
apache-2.0
Maspear/odoo
addons/survey/__openerp__.py
261
2391
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms...
agpl-3.0
vmax-feihu/hue
desktop/core/ext-py/boto-2.38.0/boto/swf/layer1_decisions.py
153
11938
""" Helper class for creating decision responses. """ class Layer1Decisions(object): """ Use this object to build a list of decisions for a decision response. Each method call will add append a new decision. Retrieve the list of decisions from the _data attribute. """ def __init__(self): ...
apache-2.0
wolfgar/xbmc
lib/gtest/test/gtest_shuffle_test.py
184
12608
#!/usr/bin/env python # # Copyright 2009 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...
gpl-2.0
cherry-wb/pyew
vtrace/platforms/win32.py
16
69932
""" Win32 Platform Module """ # Copyright (C) 2007 Invisigoth - See LICENSE file for details import os import sys import struct import traceback import platform import PE import vstruct import vstruct.builder as vs_builder import vstruct.defs.win32 as vs_win32 import vstruct.defs.windows as vs_windows import vtrace ...
gpl-2.0
camptocamp/ngo-addons-backport
addons/marketing_campaign/__openerp__.py
18
3285
# -*- 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
keithroe/vtkoptix
ThirdParty/ZopeInterface/zope/interface/registry.py
40
18877
############################################################################## # # Copyright (c) 2006 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...
bsd-3-clause
fwaggle/NBT
nbt/region.py
3
30674
""" Handle a region file, containing 32x32 chunks. For more info of the region file format look: http://www.minecraftwiki.net/wiki/Region_file_format """ from .nbt import NBTFile, MalformedFileError from struct import pack, unpack from gzip import GzipFile from collections import Mapping import zlib import gzip from i...
mit
mastizada/kuma
vendor/packages/Babel/babel/messages/catalog.py
9
28083
# -*- coding: utf-8 -*- # # Copyright (C) 2007 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://babel.edgewall.org/wiki/License. # # This software consists of v...
mpl-2.0
vbannai/neutron
neutron/db/migration/alembic_migrations/versions/2528ceb28230_nec_pf_netid_fix.py
20
1924
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2013 OpenStack 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...
apache-2.0
west2554/fofix
src/tests/DialogTest.py
5
2280
##################################################################### # -*- coding: iso-8859-1 -*- # # # # FoFiX # # Copyright (C) 2009 Team FoFiX ...
gpl-2.0
Alidron/demo-nao
alidron-env/lib/python2.7/site-packages/pebble/thread/decorators.py
2
3390
# This file is part of Pebble. # Pebble 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 later version. # Pebble is distributed in the hope th...
mpl-2.0
otherness-space/myProject
my_project_001/lib/python2.7/site-packages/pip/_vendor/requests/status_codes.py
926
3200
# -*- coding: utf-8 -*- from .structures import LookupDict _codes = { # Informational. 100: ('continue',), 101: ('switching_protocols',), 102: ('processing',), 103: ('checkpoint',), 122: ('uri_too_long', 'request_uri_too_long'), 200: ('ok', 'okay', 'all_ok', 'all_okay', 'all_good', '\\o/'...
mit
Infernion/django-wiki
wiki/plugins/attachments/views.py
6
16558
# -*- coding: utf-8 -*- from __future__ import unicode_literals from __future__ import absolute_import from django.contrib import messages from django.db.models import Q from django.http import Http404, HttpResponseRedirect from django.shortcuts import redirect, get_object_or_404 from django.utils.decorators import met...
gpl-3.0
sgoldenb/siemafilter
src/yaml/resolver.py
474
8972
__all__ = ['BaseResolver', 'Resolver'] from error import * from nodes import * import re class ResolverError(YAMLError): pass class BaseResolver(object): DEFAULT_SCALAR_TAG = u'tag:yaml.org,2002:str' DEFAULT_SEQUENCE_TAG = u'tag:yaml.org,2002:seq' DEFAULT_MAPPING_TAG = u'tag:yaml.org,2002:map' ...
mit
sdminonne/kubernetes
hack/verify-flags-underscore.py
75
4645
#!/usr/bin/env python # Copyright 2015 The Kubernetes 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 appli...
apache-2.0
taknevski/tensorflow-xsmm
tensorflow/python/kernel_tests/save_restore_ops_test.py
77
1477
# 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
supersven/intellij-community
python/lib/Lib/site-packages/django/contrib/auth/tests/decorators.py
94
1559
from django.conf import settings from django.contrib.auth.decorators import login_required from django.contrib.auth.tests.views import AuthViewsTestCase class LoginRequiredTestCase(AuthViewsTestCase): """ Tests the login_required decorators """ urls = 'django.contrib.auth.tests.urls' def testCalla...
apache-2.0
Hoekz/hackness-monster
venv/lib/python2.7/site-packages/werkzeug/_internal.py
254
13709
# -*- coding: utf-8 -*- """ werkzeug._internal ~~~~~~~~~~~~~~~~~~ This module provides internally used helpers and constants. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import re import string import inspect from weakre...
mit
toolforger/sympy
sympy/polys/orderings.py
123
8498
"""Definitions of monomial orderings. """ from __future__ import print_function, division __all__ = ["lex", "grlex", "grevlex", "ilex", "igrlex", "igrevlex"] from sympy.core import Symbol from sympy.core.compatibility import iterable class MonomialOrder(object): """Base class for monomial orderings. """ al...
bsd-3-clause
ArcherSys/ArcherSys
eclipse/plugins/org.python.pydev_4.5.5.201603221110/pysrc/_pydevd_bundle/pydevd_dont_trace_files.py
13
4054
# Important: Autogenerated file. # DO NOT edit manually! # DO NOT edit manually! from _pydevd_bundle.pydevd_constants import IS_PY3K LIB_FILE = 1 PYDEV_FILE = 2 DONT_TRACE = { # commonly used things from the stdlib that we don't want to trace 'Queue.py':LIB_FILE, 'queue.py':LIB_FILE, 'socket.py':LIB...
mit
dgladkov/django
tests/check_framework/tests_1_8_compatibility.py
138
1113
from django.core.checks.compatibility.django_1_8_0 import \ check_duplicate_template_settings from django.test import SimpleTestCase from django.test.utils import override_settings class CheckDuplicateTemplateSettingsTest(SimpleTestCase): def test_not_raised_if_no_templates_setting(self): self.assert...
bsd-3-clause
learningequality/kolibri
kolibri/core/device/models.py
1
6722
import platform import time from uuid import uuid4 from django.conf import settings from django.db import models from morango.models import UUIDField from .utils import LANDING_PAGE_LEARN from .utils import LANDING_PAGE_SIGN_IN from kolibri.core.auth.models import Facility from kolibri.core.auth.models import Facilit...
mit
PLyczkowski/Sticky-Keymap
2.74/scripts/addons/io_import_dxf/dxfgrabber/drawing.py
2
2452
# Purpose: handle drawing data of DXF files # Created: 21.07.12 # Copyright (C) 2012, Manfred Moitzi # License: MIT License __author__ = "mozman <mozman@gmx.at>" from .tags import TagIterator from .sections import Sections DEFAULT_OPTIONS = { "grab_blocks": True, # import block definitions True=yes, False=No ...
gpl-2.0
40423135/2016fallcadp_hw
plugin/liquid_tags/test_generation.py
306
3919
# -*- coding: utf-8 -*- from __future__ import print_function import filecmp import os import unittest from shutil import rmtree from tempfile import mkdtemp import pytest from pelican import Pelican from pelican.settings import read_settings from .notebook import IPYTHON_VERSION PLUGIN_DIR = os.path.dirname(__file...
gpl-3.0
grupoprog3/proyecto_final
Entrega Final/flask/Lib/site-packages/sqlparse/engine/statement_splitter.py
20
3648
# -*- coding: utf-8 -*- # # Copyright (C) 2016 Andi Albrecht, albrecht.andi@gmail.com # # This module is part of python-sqlparse and is released under # the BSD License: https://opensource.org/licenses/BSD-3-Clause from sqlparse import sql, tokens as T class StatementSplitter(object): """Filter that split stream...
apache-2.0
skoppisetty/hackathon
lib/sqlalchemy/util/__init__.py
17
1742
# util/__init__.py # Copyright (C) 2005-2012 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from compat import callable, cmp, reduce, defaultdict, py25_dict, \ threading, py...
gpl-3.0
Perferom/android_external_chromium_org
ppapi/generators/idl_gen_pnacl.py
52
9608
#!/usr/bin/env python # Copyright (c) 2012 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. """Generator for Pnacl Shim functions that bridges the calling conventions between GCC and PNaCl. """ from datetime import dateti...
bsd-3-clause
jgrocha/QGIS
scripts/qstringfixup.py
25
7772
#!/usr/bin/env python ########################################################################### # qstringfixup.py # --------------- # Date : October 2020 # Copyright : (C) 2020 by Even Rouault # Email : even.rouault@spatialys.com ###############################...
gpl-2.0
inspirehep/inspire-next
inspirehep/modules/forms/bundles.py
6
1950
# -*- coding: utf-8 -*- # # This file is part of INSPIRE. # Copyright (C) 2014-2017 CERN. # # INSPIRE 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 ...
gpl-3.0
westurner/dotfiles
scripts/setup_scipy_deb.py
1
2526
#!/usr/bin/env python # encoding: utf-8 from __future__ import print_function """ deb_scipy : symlink numpy and scipy in from debian packages """ import os import sys import logging def apt_install_numpy_scipy(): cmd = ('sudo','apt-get','install', 'python-numpy', 'python-scipy', ...
bsd-3-clause
HaebinShin/tensorflow
tensorflow/python/framework/random_seed.py
4
5356
# 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
joansmith/bioformats
components/xsd-fu/python/generateDS/Demos/Outline/outline_extended.py
33
2224
#!/usr/bin/env python # # Generated Mon Aug 18 17:12:21 2003 by generateDS.py. # import sys from xml.dom import minidom import outline as supermod # # Support/utility functions. # def showIndent(outfile, level): for idx in range(level): outfile.write(' ') class outlineSub(supermod.outline): de...
gpl-2.0
kswiat/django
tests/update_only_fields/tests.py
40
9787
from __future__ import unicode_literals from django.db.models.signals import pre_save, post_save from django.test import TestCase from .models import Person, Employee, ProxyEmployee, Profile, Account class UpdateOnlyFieldsTests(TestCase): def test_update_fields_basic(self): s = Person.objects.create(nam...
bsd-3-clause
dakerfp/AutobahnPython
examples/asyncio/wamp/basic/rpc/slowsquare/backend.py
6
1239
############################################################################### ## ## Copyright (C) 2014 Tavendo GmbH ## ## 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:/...
apache-2.0
SurfasJones/djcmsrc3
venv/lib/python2.7/site-packages/south/tests/db_firebird.py
93
1143
from django.db import models from south.db import db from south.tests import unittest, skipUnless class FirebirdTests(unittest.TestCase): """ Tests firebird related issues """ def setUp(self): print('=' * 80) print('Begin Firebird test') def tearDown(self): print('End F...
mit
vietch2612/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py
121
13989
# Copyright (C) 2009 Google Inc. All rights reserved. # Copyright (C) 2012 Intel Corporation. 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 th...
bsd-3-clause
stutivarshney/Bal-Aveksha
WebServer/BalAvekshaEnv/lib/python3.5/site-packages/django/contrib/gis/gdal/geometries.py
33
24111
""" The OGRGeometry is a wrapper for using the OGR Geometry class (see http://www.gdal.org/classOGRGeometry.html). OGRGeometry may be instantiated when reading geometries from OGR Data Sources (e.g. SHP files), or when given OGC WKT (a string). While the 'full' API is not present yet, the API is "pythonic" unlik...
gpl-3.0
pingyi/I9100
arch/ia64/scripts/unwcheck.py
13143
1714
#!/usr/bin/python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthew Ch...
gpl-2.0
sorce/Potcoin
contrib/testgen/base58.py
2139
2818
''' Bitcoin base58 encoding and decoding. Based on https://bitcointalk.org/index.php?topic=1026.0 (public domain) ''' import hashlib # for compatibility with following code... class SHA256: new = hashlib.sha256 if str != bytes: # Python 3.x def ord(c): return c def chr(n): return byte...
mit
dstufft/cryptography
tests/hazmat/primitives/test_blowfish.py
2
2920
# 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 the...
apache-2.0
Leemoonsoo/zeppelin
scripts/mahout/add_mahout_interpreters.py
72
12747
# /** # * 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 # * "...
apache-2.0
ubic135/odoo-design
addons/hr_gamification/wizard/grant_badge.py
180
2524
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013 OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the ...
agpl-3.0
dparlevliet/zelenka-report-storage
server-local/twisted/web/wsgi.py
50
14142
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ An implementation of U{Web Resource Gateway Interface<http://www.python.org/dev/peps/pep-0333/>}. """ __metaclass__ = type from sys import exc_info from zope.interface import implements from twisted.python.log import msg, err from twisted....
lgpl-3.0
jaggu303619/asylum
openerp/addons/base/ir/workflow/__init__.py
79
1093
# -*- 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
MikimotoH/DLink_Harvester
dlink_csv_to_postgres.py
1
1307
import csv import psycopg2 from datetime import datetime def main(): try: db2 = psycopg2.connect(database='firmware',user='firmadyne',password='firmadyne',host='127.0.0.1') cur = db2.cursor() cur.execute('SELECT id,filename FROM image WHERE id>814 ORDER BY id') rows = cur.fetchall(...
gpl-3.0
Scalr/scalr-ctl
scalrctl/click/testing.py
68
11004
import os import sys import shutil import tempfile import contextlib from ._compat import iteritems, PY2 # If someone wants to vendor click, we want to ensure the # correct package is discovered. Ideally we could use a # relative import here but unfortunately Python does not # support that. clickpkg = sys.modules[_...
apache-2.0
flavour/Turkey
modules/s3db/climate.py
3
27377
# -*- coding: utf-8 -*- """ Sahana Eden Climate Model @copyright: 2011-2015 (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 witho...
mit
tunneln/CarnotKE
jyhton/lib-python/2.7/multifile.py
313
4820
"""A readline()-style interface to the parts of a multipart message. The MultiFile class makes each part of a multipart message "feel" like an ordinary file, as long as you use fp.readline(). Allows recursive use, for nested multipart messages. Probably best used together with module mimetools. Suggested use: real...
apache-2.0
fldc/CouchPotatoServer
libs/html5lib/treebuilders/_base.py
715
13699
from __future__ import absolute_import, division, unicode_literals from six import text_type from ..constants import scopingElements, tableInsertModeElements, namespaces # The scope markers are inserted when entering object elements, # marquees, table cells, and table captions, and are used to prevent formatting # fr...
gpl-3.0
ethantang95/DIGITS-GAN
digits/standard-networks/tensorflow/vgg16.py
2
1913
class UserModel(Tower): @model_property def inference(self): x = tf.reshape(self.x, shape=[-1, self.input_shape[0], self.input_shape[1], self.input_shape[2]]) with slim.arg_scope([slim.conv2d, slim.fully_connected], weights_initializer=tf.contrib.layers.xavier_initi...
bsd-3-clause
M3nin0/supreme-broccoli
Web/Flask/site_/lib/python3.5/site-packages/pkg_resources/_vendor/six.py
2715
30098
"""Utilities for writing code that runs on Python 2 and 3""" # Copyright (c) 2010-2015 Benjamin Peterson # # 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 with...
apache-2.0
akshaykr/oracle_cb
semibandits/remote_job.py
1
1200
import sys, argparse, os sys.path.append('../') import settings if __name__=='__main__': parser = argparse.ArgumentParser() parser.add_argument('--T', action='store', default=1000, help='number of rounds') parser.add_argument('--dataset', action='store', choi...
mit
geopython/QGIS
tests/src/python/test_provider_mssql.py
8
21994
# -*- coding: utf-8 -*- """QGIS Unit tests for the MS SQL provider. .. note:: 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. "...
gpl-2.0
DiamondLightSource/diffcalc
model/vrml_animator.py
1
4240
### # Copyright 2008-2011 Diamond Light Source Ltd. # This file is part of Diffcalc. # # Diffcalc 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 late...
gpl-3.0
MypaceEngine/ifttt-line
libs/requests/packages/chardet/compat.py
2943
1157
######################## BEGIN LICENSE BLOCK ######################## # Contributor(s): # Ian Cordasco - port to Python # # 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 # versio...
apache-2.0
obimod/taiga-back
taiga/export_import/service.py
3
17645
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014 David Barragán <bameda@dbarragan.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 F...
agpl-3.0
TheAspiringHacker/Asparserations
bootstrap/parser_gen.py
1
13102
#!/usr/bin/python3 import argparse import collections import json import string import sys header_template = """ #ifndef ASPARSERATIONS_GENERATED_${class_name}_H_ #define ASPARSERATIONS_GENERATED_${class_name}_H_ #include <array> #include <map> #include <memory> #include <set> #include <utility> #include <vector> $h...
mit
Allow2CEO/browser-ios
brave/node_modules/ad-block/node_modules/bloom-filter-cpp/vendor/depot_tools/third_party/logilab/common/modutils.py
64
23589
# -*- coding: utf-8 -*- # copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of logilab-common. # # logilab-common is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser Genera...
mpl-2.0
sclausen/robomongo
src/third-party/mongodb/src/mongo/base/generate_error_codes.py
19
8736
#!/usr/bin/python # Copyright 2012 10gen 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 applicab...
gpl-3.0
SimonGreenhill/NexusMaker
nexusmaker/maker.py
1
9337
import re from collections import defaultdict from functools import lru_cache from nexus import NexusWriter from .CognateParser import CognateParser from .tools import slugify, parse_word class Record(object): def __init__(self, **kwargs): defaults = ['ID', 'LID', 'Language', 'WID', 'Word', 'Item', 'Loa...
bsd-3-clause
Timurdov/bionic
bionic/Lib/encodings/aliases.py
418
14848
""" Encoding Aliases Support This module is used by the encodings package search function to map encodings names to module names. Note that the search function normalizes the encoding names before doing the lookup, so the mapping will have to map normalized encoding names to module names. Con...
apache-2.0
pkuyym/Paddle
python/paddle/fluid/tests/unittests/test_gru_op.py
4
6150
# Copyright (c) 2018 PaddlePaddle 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 app...
apache-2.0
wnt-zhp/hufce
django/db/backends/mysql/introspection.py
82
4898
from django.db.backends import BaseDatabaseIntrospection from MySQLdb import ProgrammingError, OperationalError from MySQLdb.constants import FIELD_TYPE import re foreign_key_re = re.compile(r"\sCONSTRAINT `[^`]*` FOREIGN KEY \(`([^`]*)`\) REFERENCES `([^`]*)` \(`([^`]*)`\)") class DatabaseIntrospection(BaseDatabaseI...
gpl-3.0
duqiao/django
tests/queries/models.py
91
17678
""" Various complex queries that have been problematic in the past. """ from __future__ import unicode_literals import threading from django.db import models from django.utils import six from django.utils.encoding import python_2_unicode_compatible class DumbCategory(models.Model): pass class ProxyCategory(Du...
bsd-3-clause
AnotherIvan/calibre
src/calibre/utils/pyconsole/controller.py
14
4004
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai __license__ = 'GPL v3' __copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' import os, cPickle, signal, time from Queue import Queue, Empty from multiprocessing.connection import Listener, arbitrary...
gpl-3.0
qmarlats/pyquizz
env-3/lib/python3.5/site-packages/setuptools/command/upload_docs.py
80
6815
# -*- coding: utf-8 -*- """upload_docs Implements a Distutils 'upload_docs' subcommand (upload documentation to PyPI's pythonhosted.org). """ from base64 import standard_b64encode from distutils import log from distutils.errors import DistutilsOptionError import os import socket import zipfile import tempfile import ...
gpl-3.0
pierrelb/RMG-Py
external/cclib/bridge/cclib2openbabel.py
24
1213
""" cclib (http://cclib.sf.net) is (c) 2006, the cclib development team and licensed under the LGPL (http://www.gnu.org/copyleft/lgpl.html). """ __revision__ = "$Revision: 867 $" import openbabel as ob def makeopenbabel(atomcoords, atomnos, charge=0, mult=1): """Create an Open Babel molecule. >>> import num...
mit
ibushong/test-repo
flask_admin/actions.py
7
3435
from flask import request, redirect from flask.ext.admin import tools from flask.ext.admin._compat import text_type def action(name, text, confirmation=None): """ Use this decorator to expose actions that span more than one entity (model, file, etc) :param name: Action name ...
bsd-3-clause
NicolasDichtel/linux
Documentation/sphinx/load_config.py
456
1333
# -*- coding: utf-8; mode: python -*- # pylint: disable=R0903, C0330, R0914, R0912, E0401 import os import sys from sphinx.util.pycompat import execfile_ # ------------------------------------------------------------------------------ def loadConfig(namespace): # ------------------------------------------------------...
gpl-2.0
doheekim/chuizonetest
lib/PIL/IptcImagePlugin.py
42
7706
# # The Python Imaging Library. # $Id$ # # IPTC/NAA file handling # # history: # 1995-10-01 fl Created # 1998-03-09 fl Cleaned up and added to PIL # 2002-06-18 fl Added getiptcinfo helper # # Copyright (c) Secret Labs AB 1997-2002. # Copyright (c) Fredrik Lundh 1995. # # See the README file for information on usa...
apache-2.0
coolbombom/CouchPotato
library/hachoir_parser/file_system/linux_swap.py
95
3777
""" Linux swap file. Documentation: Linux kernel source code, files: - mm/swapfile.c - include/linux/swap.h Author: Victor Stinner Creation date: 25 december 2006 (christmas ;-)) """ from hachoir_parser import Parser from hachoir_core.field import (ParserError, GenericVector, UInt32, String, Bytes, NullByt...
gpl-3.0
datakortet/django-cms
cms/migrations/0019_public_table_renames.py
385
19523
# -*- 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): # Dummy migration pass def backwards(self, orm): # Dummy migration pass models = { ...
bsd-3-clause
foss-transportationmodeling/rettina-server
.env/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/vcs/mercurial.py
93
5817
import os import tempfile import re import sys from pip import call_subprocess from pip.util import display_path, rmtree from pip.log import logger from pip.vcs import vcs, VersionControl from pip.download import path_to_url2 from pip.backwardcompat import ConfigParser class Mercurial(VersionControl): name = 'hg'...
apache-2.0
hexinatgithub/CLRS
Chapter15/matrixChainMultiplication.py
1
1160
import sys def matrixChainOrder(p): n = len(p)-1 m = {} s = {} for i in xrange(1, n+1): m[(i, i)] = 0 for l in range(2, n+1): for i in range(1, n-l+2): j = i+l-1 m[(i, j)] = sys.maxint for k in range(i, j): q = m[i, k] + m[k+1, j] + p[i-1]*p[k]*p[j] if q < m[(i, j)]: m[(i, j)] = q s...
mit
peritus/robotframework-selenium2library
test/lib/mockito/invocation.py
69
5084
#!/usr/bin/env python # coding: utf-8 import matchers __copyright__ = "Copyright 2008-2010, Mockito Contributors" __license__ = "MIT" __maintainer__ = "Mockito Maintainers" __email__ = "mockito-python@googlegroups.com" class InvocationError(AssertionError): pass class Invocation(object): def __init__(self, mo...
apache-2.0
gratipay/gratipay.com
tests/py/test_db_checks.py
1
1072
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals from gratipay import models from gratipay.testing import Harness class Tests(Harness): # cb - _check_balances - calls assert so we don't need asserts here def test_cb_is_fine_with_empty_database(self)...
mit
timdiels/chicken_turtle_util
pytil/tests/test_configuration.py
1
7472
# Copyright (C) 2016 VIB/BEG/UGent - Tim Diels <timdiels.m@gmail.com> # # This file is part of pytil. # # pytil 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 ...
lgpl-3.0
kohoumas/ns-3-click-mac-dev
bindings/python/apidefs/gcc-ILP32/ns3_module_point_to_point.py
6
27128
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers def register_types(module): root_module = module.get_root() ## point-to-point-helper.h: ns3::PointToPointHelper [class] module.add_class('PointToPointHelper', parent=[root_module['ns3::PcapHelperForDevice'], root_module[...
gpl-2.0
aponom84/MetrizedSmallWorld
hist.py
1
1556
# -*- coding: utf-8 -*- import csv import matplotlib.mlab as mlab import matplotlib.pyplot as plt import numpy as np #fldName = 'greedyWalkPathLenght' #inFileName = 'commonFeatures_erdesh.csv' inFileName = 'commonFeatures_sp_erdesh.csv' fldName = 'sp' outFileName = fldName + "_distr.csv" numbers=[] #with open('commo...
lgpl-3.0
chokribr/invenio
invenio/modules/upgrader/upgrades/invenio_release_1_1_0.py
15
29896
#-*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2008, 2009, 2010, 2011, 2012 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...
gpl-2.0
Nibsalot/AK-Mako
tools/perf/scripts/python/sctop.py
11180
1924
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
gpl-2.0
sonaht/ansible
lib/ansible/modules/network/cloudengine/ce_snmp_user.py
39
39301
#!/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
memo/tensorflow
tensorflow/contrib/integrate/python/ops/odes_test.py
60
9254
# 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
nhicher/ansible
lib/ansible/modules/cloud/vmware/vmware_vm_vss_dvs_migrate.py
56
5254
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2015, Joseph Callen <jcallen () csc.com> # 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'...
gpl-3.0
slohse/ansible
lib/ansible/modules/notification/mqtt.py
42
6079
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, 2014, Jan-Piet Mens <jpmens () gmail.com> # 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': '...
gpl-3.0
OpenPymeMx/OCB
openerp/addons/base/__openerp__.py
61
4030
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you ca...
agpl-3.0
zenodo/invenio
invenio/modules/search/template_context_functions/tfn_summarize_records.py
13
1141
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2013 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...
gpl-2.0
imito/odin
tests/test_negative_binomial_disp.py
1
2797
from __future__ import absolute_import, division, print_function import os import numpy as np import tensorflow as tf import torch from odin.bay.distributions import NegativeBinomialDisp, ZeroInflated from odin.stats import describe from scvi.models.log_likelihood import log_nb_positive, log_zinb_positive os.enviro...
mit
johnttaylor/Outcast
bin/scm/none/archive.py
1
2004
""" Script that creates an archive file form the current SCM snapshot =============================================================================== usage: evie [common-opts] archive [options] <pkgname> <tarname> evie [common-opts] archive --list Arguments: <pkgname> Name of the package ...
bsd-3-clause
jmgaya/pyNES
pynes/tests/__init__.py
27
8519
# -*- coding: utf-8 -*- from unittest import TestCase from pynes.composer import compose from pynes.compiler import compile from pynes import sprite import os from pynes.compiler import lexical, syntax, semantic class MetaInstructionCase(type): def __new__(cls, name, bases, args): def gen_lex(): ...
bsd-3-clause
huntcsg/slackly
src/slackly/api/endpoints/team.py
1
16406
from ._base import BaseAPIDispatch, BaseAPIEndpoint class Team(BaseAPIDispatch): pass @Team.register('profile') class Profile(BaseAPIDispatch): pass @Team.register('accessLogs') class TeamAccessLogs(BaseAPIEndpoint): """This method is used to get the access logs for users on a team. The response ...
mit
lluxury/P_U_S_A
9_package_management/code/liten-bootstrap.py
2
35958
#!/usr/bin/env python ## WARNING: This file is generated #!/usr/bin/env python """Create a "virtual" Python installation """ import sys import os import optparse import shutil import logging import distutils.sysconfig try: import subprocess except ImportError, e: if sys.version_info <= (2, 3): print 'E...
mit
kevin-coder/tensorflow-fork
tensorflow/contrib/deprecated/summaries_test.py
24
2246
# 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
incaser/odoo-odoo
addons/product_visible_discount/product_visible_discount.py
165
5466
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0
hayesdaniel/dccui
dccui/MainWindow.py
1
4528
''' DCCUI - MainWindow --------------- The main window provides a nodegraph, framebuffer and parameter window. It centralizes menu items and keyboard shortcuts. ''' from PySide import QtGui, QtCore from dccui_qtd import * from MainWindowMenus import * from stylesheet import * from stylesheet_rc import * from NodeG...
bsd-3-clause
qpxu007/Flask-AppBuilder
examples/quickcharts2/app/views.py
3
5053
import random import logging import datetime import calendar from flask.ext.appbuilder.models.datamodel import SQLAModel from flask.ext.appbuilder.views import ModelView from flask_appbuilder.charts.views import DirectChartView, DirectByChartView, GroupByChartView from models import CountryStats, Country, PoliticalType...
bsd-3-clause
patrickm/chromium.src
third_party/closure_linter/closure_linter/full_test.py
135
3464
#!/usr/bin/env python # # Copyright 2007 The Closure Linter 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 #...
bsd-3-clause
tigawa/proofreadingchecker
vendor/bundle/ruby/1.9.1/gems/libv8-3.16.14.3/vendor/gyp/test/include_dirs/gyptest-all.py
102
1082
#!/usr/bin/env python # Copyright (c) 2009 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 use of include_dirs when using an explicit build target of 'all'. """ import TestGyp test = TestGyp.TestGyp() if test.format...
apache-2.0
cboulay/PSMoveService
misc/python/pypsmove/transformations.py
6
66033
# -*- coding: utf-8 -*- # transformations.py # Copyright (c) 2006-2015, Christoph Gohlke # Copyright (c) 2006-2015, The Regents of the University of California # Produced at the Laboratory for Fluorescence Dynamics # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modifica...
apache-2.0