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
dekomote/mezzanine-modeltranslation-backport
mezzanine/generic/fields.py
7
12048
from __future__ import division, unicode_literals from future.builtins import str from copy import copy from django.conf import settings from django.contrib.contenttypes.generic import GenericRelation from django.core.exceptions import ImproperlyConfigured from django.db.models import IntegerField, CharField, FloatFi...
bsd-2-clause
sebalix/OpenUpgrade
openerp/addons/base/ir/osv_memory_autovacuum.py
447
1450
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the G...
agpl-3.0
watonyweng/nova
nova/compute/stats.py
63
5204
# Copyright (c) 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 ...
apache-2.0
a-sevin/freeopcua
tests/gmock/gtest/test/gtest_break_on_failure_unittest.py
9
7342
#!/usr/bin/env python # # Copyright 2006, 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...
lgpl-3.0
agoose77/hivesystem
manual/movingpanda/panda-10.py
1
3997
import dragonfly import dragonfly.pandahive import bee from bee import connect import math, functools from panda3d.core import NodePath import dragonfly.scene.unbound import dragonfly.std import dragonfly.io import dragonfly.canvas import Spyder # ## random matrix generator from random import random def random_m...
bsd-2-clause
City-of-Helsinki/smbackend
services/models/service_node.py
1
1694
from django.db import models from mptt.managers import TreeManager from mptt.models import MPTTModel, TreeForeignKey from services.utils import get_translated from .hierarchy import CustomTreeManager from .keyword import Keyword from .service import Service from .unit import Unit class ServiceNode(MPTTModel): i...
agpl-3.0
lumig242/Hue-Integration-with-CDAP
apps/beeswax/src/beeswax/migrations/0014_auto__add_field_queryhistory_is_cleared.py
11
8533
# -*- 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 'QueryHistory.is_cleared' db.add_column(u'beeswax_queryhis...
apache-2.0
zaitcev/swift-lfs
test/unit/common/test_daemon.py
4
3478
# Copyright (c) 2010-2012 OpenStack, 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
apache-2.0
chrismeyersfsu/ansible
lib/ansible/modules/cloud/cloudstack/cs_portforward.py
17
12968
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, René Moser <mail@renemoser.net> # # 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 Lice...
gpl-3.0
qateam123/eq
tests/integration/create_token.py
1
1203
from app.views.dev_mode import generate_token, create_payload PAYLOAD = { 'user': "mci-integration-test", "period_str": "April 2016", "period_id": "201604", "collection_exercise_sid": "789", "ru_ref": "123456789012A", "ru_name": "MCI Integration Testing", "ref_p_start_date": "2016-04-01", ...
mit
evilpie/servo
components/script/dom/bindings/codegen/parser/tests/test_typedef.py
106
1874
def WebIDLTest(parser, harness): parser.parse(""" typedef long mylong; typedef long? mynullablelong; interface Foo { const mylong X = 5; const mynullablelong Y = 7; const mynullablelong Z = null; void foo(mylong arg); }; """) results = parser.finish()...
mpl-2.0
chdecultot/erpnext
erpnext/patches/v10_0/migrate_daily_work_summary_settings_to_daily_work_summary_group.py
4
1708
# Copyright (c) 2018, Frappe and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe def execute(): frappe.reload_doc("hr", "doctype", "daily_work_summary_group") frappe.reload_doc("hr", "doctype", "daily_work_summary_group_user") # check i...
gpl-3.0
thequbit/iddt
iddt/worker.py
1
4573
import sys import time from iddt.utils import check_match from iddt.utils import type_document from iddt.utils import get_page_urls from iddt.daemon import Daemon from iddt.mongo import Mongo import logging logging.basicConfig(level=logging.INFO) logger = logging.getLogger("iddt.worker") class Worker(Daemon): ...
gpl-3.0
shenzebang/scikit-learn
sklearn/cluster/birch.py
207
22706
# Authors: Manoj Kumar <manojkumarsivaraj334@gmail.com> # Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Joel Nothman <joel.nothman@gmail.com> # License: BSD 3 clause from __future__ import division import warnings import numpy as np from scipy import sparse from math import sqrt fro...
bsd-3-clause
smartsheet-platform/smartsheet-python-sdk
smartsheet/models/sheet_filter_details.py
1
2075
# pylint: disable=C0111,R0902,R0904,R0912,R0913,R0915,E1101 # Smartsheet Python SDK. # # Copyright 2017 Smartsheet.com, 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-2.0
wwj718/edx-video
common/djangoapps/student/tests/test_auto_auth.py
11
4597
from django.test import TestCase from django.test.client import Client from django.contrib.auth.models import User from util.testing import UrlResetMixin from mock import patch from django.core.urlresolvers import reverse, NoReverseMatch class AutoAuthEnabledTestCase(UrlResetMixin, TestCase): """ Tests for th...
agpl-3.0
munhanha/mtg-random
django/contrib/gis/tests/geo3d/tests.py
155
11305
import os import re from django.utils.unittest import TestCase from django.contrib.gis.db.models import Union, Extent3D from django.contrib.gis.geos import GEOSGeometry, Point, Polygon from django.contrib.gis.utils import LayerMapping, LayerMapError from models import City3D, Interstate2D, Interstate3D, \ Intersta...
bsd-3-clause
redhatrises/freeipa
ipatests/test_webui/test_hbac.py
5
5252
# Authors: # Petr Vobornik <pvoborni@redhat.com> # # Copyright (C) 2013 Red Hat # see file 'COPYING' for use and warranty information # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either ...
gpl-3.0
nburn42/tensorflow
tensorflow/contrib/solvers/python/kernel_tests/linear_equations_test.py
18
4675
# 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
viruxel/ansible-modules-extras
cloud/cloudstack/cs_instancegroup.py
33
5962
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, René Moser <mail@renemoser.net> # # 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 Lice...
gpl-3.0
tashaxe/Red-DiscordBot
lib/PIL/XVThumbImagePlugin.py
21
1926
# # The Python Imaging Library. # $Id$ # # XV Thumbnail file handler by Charles E. "Gene" Cash # (gcash@magicnet.net) # # see xvcolor.c and xvbrowse.c in the sources to John Bradley's XV, # available from ftp://ftp.cis.upenn.edu/pub/xv/ # # history: # 98-08-15 cec created (b/w only) # 98-12-09 cec added color palette...
gpl-3.0
doge-search/webdoge
xiaoqiqi/Rutgers/scrap_professors.py
1
1724
#!/usr/bin/python2 #coding=utf-8 import urllib2 import HTMLParser import sys import xml.dom.minidom as minidom from htmlentitydefs import entitydefs import glob class MyParser(HTMLParser.HTMLParser): def __init__(self): HTMLParser.HTMLParser.__init__(self) self.hasname = False self.namelis...
unlicense
infobloxopen/infoblox-netmri
infoblox_netmri/api/broker/v3_3_0/if_vlan_broker.py
16
62205
from ..broker import Broker class IfVlanBroker(Broker): controller = "if_vlans" def show(self, **kwargs): """Shows the details for the specified if vlan. **Inputs** | ``api version min:`` None | ``api version max:`` None | ``required:`` True ...
apache-2.0
nharraud/b2share
invenio/modules/submit/models.py
5
17359
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 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 your option) any...
gpl-2.0
Intel-Corporation/tensorflow
tensorflow/contrib/resampler/xla/resampler_ops_xla_test.py
11
10446
# 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
pekeler/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/idlelib/configDialog.py
49
53371
"""IDLE Configuration Dialog: support user customization of IDLE by GUI Customize font faces, sizes, and colorization attributes. Set indentation defaults. Customize keybindings. Colorization and keybindings can be saved as user defined sets. Select startup options including shell/editor and default window size. ...
apache-2.0
blackbliss/callme
flask/lib/python2.7/site-packages/sqlalchemy/util/langhelpers.py
75
37513
# util/langhelpers.py # Copyright (C) 2005-2014 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 """Routines to help with the creation, loading and introspection of modules, class...
mit
luwanjia/sdl_implementation_reference
tools/InterfaceGenerator/generator/parsers/JSONRPC.py
14
2763
"""JSON RPC parser. Contains parser for JSON RPC XML format. """ from generator.parsers import RPCBase class Parser(RPCBase.Parser): """JSON RPC parser.""" def __init__(self): """Constructor.""" super(Parser, self).__init__() self._interface_name = None def _parse_root(self, ...
bsd-3-clause
Eficent/account-invoice-reporting
base_comment_template/comment.py
9
1660
# -*- coding: utf-8 -*- # # # Author: Nicolas Bessi # Copyright 2013-2014 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # Licen...
agpl-3.0
mszewczy/odoo
addons/product/tests/test_pricelist.py
280
6748
from openerp.tests.common import TransactionCase class TestPricelist(TransactionCase): """Tests for unit of measure conversion""" def setUp(self): super(TestPricelist, self).setUp() cr, uid, context = self.cr, self.uid, {} self.ir_model_data = self.registry('ir.model.data') sel...
agpl-3.0
cemarchi/biosphere
Src/BioAnalyzer/CrossCutting/Contracts/GenePriotization/GlobalDifferentialMicroRnaSampleRepositoryBase.py
1
1493
from abc import ABCMeta, abstractmethod from typing import Dict from Src.BioAnalyzer.CrossCutting.DTOs.GenePrioritization.GlobalDifferentialSampleDto import GlobalDifferentialSampleDto from Src.BioAnalyzer.CrossCutting.Filters.GenePrioritization.FeSingleGlobalDifferentialSample import \ FeSingleGlobalDifferentialS...
bsd-3-clause
3dfxsoftware/cbss-addons
pos_delivery_restaurant/wizard/__init__.py
11
1352
#!/usr/bin/python # -*- encoding: utf-8 -*- ############################################################################### # Module Writen to OpenERP, Open Source Management Solution # Copyright (C) OpenERP Venezuela (<http://www.vauxoo.com>). # All Rights Reserved ############# Credits ######################...
gpl-2.0
jmcarp/django
tests/admin_views/custom_has_permission_admin.py
380
1089
""" A custom AdminSite for AdminViewPermissionsTest.test_login_has_permission(). """ from __future__ import unicode_literals from django.contrib import admin from django.contrib.auth import get_permission_codename from django.contrib.auth.forms import AuthenticationForm from . import admin as base_admin, models PERM...
bsd-3-clause
AnishShah/tensorflow
tensorflow/python/data/__init__.py
3
1309
# 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
trentm/node-gyp
gyp/tools/pretty_sln.py
806
5092
#!/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. """Prints the information in a sln file in a diffable way. It first outputs each projects in alphabetical order with their dependenci...
mit
electrolinux/pootle
pootle/core/search/broker.py
6
2440
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) Pootle contributors. # # This file is a part of the Pootle project. It is distributed under the GPL3 # or later license. See the LICENSE file for a copy of the license and the # AUTHORS file for copyright and authorship information. from . import SearchBa...
gpl-3.0
lcharlick/ArtistAlbumArt.bundle
Contents/Libraries/Shared/mutagen/id3.py
1
32095
# id3 support for mutagen # Copyright (C) 2005 Michael Urman # 2006 Lukas Lalinsky # 2013 Christoph Reiter # # This program is free software; you can redistribute it and/or modify # it under the terms of version 2 of the GNU General Public License as # published by the Free Software Found...
mit
maxive/erp
odoo/addons/base/tests/test_func.py
6
2284
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import functools import unittest from odoo.tests.common import tagged from odoo.tools import frozendict, pycompat from odoo.tools.func import compose @tagged('standard', 'at_install') class TestCompose(unittest.TestCa...
agpl-3.0
geerlingguy/ansible
hacking/shippable/run.py
40
3857
#!/usr/bin/env python # PYTHON_ARGCOMPLETE_OK # (c) 2016 Red Hat, Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at yo...
gpl-3.0
jerbob92/CouchPotatoServer
couchpotato/core/_base/clientscript/main.py
4
7155
from couchpotato.core.event import addEvent from couchpotato.core.helpers.encoding import ss from couchpotato.core.helpers.variable import tryInt from couchpotato.core.logger import CPLog from couchpotato.core.plugins.base import Plugin from couchpotato.environment import Env from minify.cssmin import cssmin from minif...
gpl-3.0
d10genes/nyt-nlp
nyt-nlp.py
1
14910
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <markdowncell> # {"Title": "Modeling 20 years of scandals with python", # "Date": "2013-7-4", # "Category": "ipython", # "Tags": "nlp, ipython, gensim, pandas", # "slug": "scandal-modeling-with-python", # "Author": "Chris" # } # <markdowncell> # #Topic detection ...
bsd-3-clause
huanchenz/STX-h-store
third_party/cpp/protobuf/python/google/protobuf/internal/descriptor_test.py
295
10605
#! /usr/bin/python # # Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # ...
gpl-3.0
lambdamusic/xtm-hacking
extras/gendocs/gendocs.py
1
3481
#!/usr/bin/env python """ usage python gendocs.py # generated an index.html file """ from parse import parse_extempore_src, _dirname import os, sys, webbrowser from pygments.formatters import HtmlFormatter # django loading requires different steps based on version # https://docs.djangoproject.com/en/dev/...
apache-2.0
justin-ho/passwd-mng
pycrypto-2.6.1/lib/Crypto/Cipher/ARC4.py
123
4266
# -*- coding: utf-8 -*- # # Cipher/ARC4.py : ARC4 # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is not available, # everyone is granted a worldwide, perpetual, royalty-free, #...
gpl-3.0
ebberly/johnny-five-tutorial
node_modules/johnny-five/junk/firmata-latest/node_modules/serialport/node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/SCons.py
42
5836
# Copyright (c) 2011 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. """ SCons generator. This contains class definitions and supporting functions for generating pieces of SCons files for the different types of GYP targets. """ im...
mit
charlesvdv/servo
tests/wpt/web-platform-tests/tools/py/py/__init__.py
171
5872
""" py.test and pylib: rapid testing and development utils this module uses apipkg.py for lazy-loading sub modules and classes. The initpkg-dictionary below specifies name->value mappings where value can be another namespace dictionary or an import path. (c) Holger Krekel and others, 2004-2014 """ __version__ = '1....
mpl-2.0
NL66278/OCB
addons/hr_gamification/models/gamification.py
388
4836
# -*- 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
ya790206/temp_hg
mercurial/hbisect.py
1
9280
# changelog bisection for mercurial # # Copyright 2007 Matt Mackall # Copyright 2005, 2006 Benoit Boissinot <benoit.boissinot@ens-lyon.org> # # Inspired by git bisect, extension skeleton taken from mq.py. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 ...
gpl-2.0
redhat-openstack/nova
nova/tests/integrated/v3/test_extended_volumes.py
8
6631
# Copyright 2012 Nebula, Inc. # Copyright 2013 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...
apache-2.0
trondhindenes/ansible
packaging/release/tests/version_helper_test.py
125
2174
from __future__ import absolute_import, division, print_function __metaclass__ = type import pytest from packaging.version import InvalidVersion from versionhelper.version_helper import AnsibleVersionMunger @pytest.mark.parametrize('version,revision,codename,output_propname,expected', [ ('2.5.0.dev1', None, Non...
gpl-3.0
Forage/Gramps
gramps/plugins/lib/libsubstkeyword.py
1
48355
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2010 Craig J. Anderson # # 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 ...
gpl-2.0
googleapis/googleapis-gen
google/cloud/videointelligence/v1beta2/videointelligence-v1beta2-py/google/cloud/videointelligence_v1beta2/__init__.py
1
2697
# -*- coding: utf-8 -*- # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
biziwalker/mtasa
vendor/google-breakpad/src/tools/gyp/test/msvs/missing_sources/gyptest-missing.py
315
1413
#!/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 missing 'sources' files are treated as fatal errors when the the generator flag 'msvs_error_on_missing_sources' is set. ""...
gpl-3.0
arlewis/galaxy_cutouts
versions/extract_stamp_good_wt_rrhr_ims.py
2
22185
import astropy.io.fits as pyfits import astropy.wcs as pywcs import os import numpy as np import montage_wrapper as montage import shutil import sys import glob import time from matplotlib.path import Path from scipy.ndimage import zoom from pdb import set_trace _TOP_DIR = '/data/tycho/0/leroy.42/allsky/' _INDEX_DIR ...
mit
cloudbase/nova-virtualbox
nova/tests/unit/test_policy.py
34
8846
# Copyright 2011 Piston Cloud Computing, 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 # # Unle...
apache-2.0
akira-baruah/bazel
tools/build_defs/pkg/archive.py
4
16071
# Lint as: python2, python3 # Copyright 2015 The Bazel 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 # # Unle...
apache-2.0
pseudonym117/Riot-Watcher
tests/integration/league_of_legends/test_SpectatorApiV4.py
1
1073
import pytest @pytest.mark.lol @pytest.mark.integration @pytest.mark.parametrize( "region", [ "br1", "eun1", "euw1", "jp1", "kr", "la1", "la2", "na", "na1", "oc1", "tr1", "ru", "pbe1", ], ) class TestSp...
mit
patrick-winter-knime/deep-learning-on-molecules
smiles-vhts/predict_rf.py
1
1028
import argparse from util import random_forest import h5py from data_structures import reference_data_set def get_arguments(): parser = argparse.ArgumentParser(description='Predict with a random forest') parser.add_argument('data', type=str, help='The source data file') parser.add_argument('features', typ...
gpl-3.0
sahilshekhawat/sympy
sympy/plotting/pygletplot/managed_window.py
120
3178
from __future__ import print_function, division from pyglet.gl import * from pyglet.window import Window from pyglet.clock import Clock from threading import Thread, Lock gl_lock = Lock() class ManagedWindow(Window): """ A pyglet window with an event loop which executes automatically in a separate thre...
bsd-3-clause
homologus/Pandoras-Toolbox-for-Bioinformatics
src/SPAdes/ext/src/python_libs/joblib3/memory.py
10
22999
""" A context object for caching a function's return value each time it is called with the same input arguments. """ # Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org> # Copyright (c) 2009 Gael Varoquaux # License: BSD Style, 3 clauses. from __future__ import with_statement import os import shutil ...
gpl-3.0
AnCh7/sweetshot
python3-src/graphenebase/account.py
1
12310
import ecdsa import hashlib from binascii import hexlify, unhexlify import sys import re import os from .base58 import ripemd160, Base58 from .dictionary import words as BrainKeyDictionary """ This class and the methods require python3 """ assert sys.version_info[0] == 3, "graphenelib requires python3" class Passwo...
unlicense
openprocurement/openprocurement.tender.belowthreshold
openprocurement/tender/belowthreshold/views/complaint_document.py
1
4860
# -*- coding: utf-8 -*- from openprocurement.api.utils import ( get_file, upload_file, update_file_content_type, json_view, context_unpack, APIResource, ) from openprocurement.api.validation import ( validate_file_update, validate_file_upload, validate_patch_document_data, ) from op...
apache-2.0
rlugojr/django
tests/utils_tests/test_functional.py
69
3422
import unittest from django.utils.functional import cached_property, lazy class FunctionalTestCase(unittest.TestCase): def test_lazy(self): t = lazy(lambda: tuple(range(3)), list, tuple) for a, b in zip(t(), range(3)): self.assertEqual(a, b) def test_lazy_base_class(self): ...
bsd-3-clause
meh/servo
tests/wpt/css-tests/tools/pywebsocket/src/test/test_util.py
449
7538
#!/usr/bin/env python # # 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...
mpl-2.0
Changaco/oh-mainline
vendor/packages/Django/django/contrib/formtools/wizard/storage/cookie.py
125
1027
import json from django.core.exceptions import SuspiciousOperation from django.core.signing import BadSignature from django.contrib.formtools.wizard import storage class CookieStorage(storage.BaseStorage): encoder = json.JSONEncoder(separators=(',', ':')) def __init__(self, *args, **kwargs): super(...
agpl-3.0
epitron/youtube-dl
youtube_dl/extractor/douyutv.py
51
6878
# coding: utf-8 from __future__ import unicode_literals import time import hashlib import re from .common import InfoExtractor from ..utils import ( ExtractorError, unescapeHTML, unified_strdate, urljoin, ) class DouyuTVIE(InfoExtractor): IE_DESC = '斗鱼' _VALID_URL = r'https?://(?:www\.)?douy...
unlicense
ckaestne/CIDE
CIDE_Language_Python-test/testfiles/test_pprint.py
10
3455
import pprint import unittest import test_support try: uni = unicode except NameError: def uni(x):return x class QueryTestCase(unittest.TestCase): def setUp(self): self.a = range(100) self.b = range(200) self.a[-12] = self.b def test_basic(self): """Verify .isrecurs...
gpl-3.0
joker946/nova
nova/tests/functional/v3/test_quota_classes.py
33
2212
# Copyright 2012 Nebula, Inc. # Copyright 2013 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...
apache-2.0
adesor/zenn-la
zennla/exceptions.py
1
1483
""" Custom exceptions for Zenn-La """ from zennla import http class APIException(Exception): """ Base class for Zenn-La exceptions. Subclasses should provide `.status_code` and `.default_detail` properties. """ status_code = http.HTTP_500_INTERNAL_SERVER_ERROR default_detail = {'detail': "A se...
gpl-2.0
dmorlitz/pygooglevoice
setup.py
39
1037
from distutils.core import setup README = """Python Google Voice ==================== Joe McCall & Justin Quick Exposing the Google Voice "API" to the Python language ------------------------------------------------------- Google Voice for Python Allows you to place calls, send sms, download voicemail, and check t...
bsd-3-clause
smunaut/gnuradio
gr-digital/python/digital/qa_crc32.py
57
1724
#!/usr/bin/env python # # Copyright 2011 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) ...
gpl-3.0
Immortalin/python-for-android
python3-alpha/python3-src/Lib/ctypes/test/test_errno.py
151
2302
import unittest, os, errno from ctypes import * from ctypes.util import find_library try: import threading except ImportError: threading = None class Test(unittest.TestCase): def test_open(self): libc_name = find_library("c") if libc_name is None: raise unittest.SkipTest("Unable...
apache-2.0
unaizalakain/django
tests/test_client/urls.py
211
2159
from django.conf.urls import url from django.contrib.auth import views as auth_views from django.views.generic import RedirectView from . import views urlpatterns = [ url(r'^get_view/$', views.get_view, name='get_view'), url(r'^post_view/$', views.post_view), url(r'^trace_view/$', views.trace_view), u...
bsd-3-clause
tesidroni/mp
Lib/encodings/ptcp154.py
647
8950
""" Python Character Mapping Codec generated from 'PTCP154.txt' with gencodec.py. Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. (c) Copyright 2000 Guido van Rossum. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,err...
gpl-3.0
kzcashteam/kzcash
qa/rpc-tests/test_framework/netutil.py
45
5014
#!/usr/bin/env python2 # Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Linux network utilities import sys import socket import fcntl import struct import array import os fro...
mit
TomAugspurger/pandas
pandas/tests/config/test_localization.py
4
2861
import codecs import locale import os import pytest from pandas._config.localization import can_set_locale, get_locales, set_locale from pandas.compat import is_platform_windows import pandas as pd _all_locales = get_locales() or [] _current_locale = locale.getlocale() # Don't run any of these tests if we are on ...
bsd-3-clause
deandunbar/html2bwml
venv/lib/python2.7/site-packages/cryptography/hazmat/bindings/openssl/evp.py
6
10320
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function INCLUDES = """ #include <openssl/evp.h> """ TYPES = """ typedef ... EVP_...
mit
rmodrak/seisflows
seisflows/plugins/solver/specfem2d.py
2
3551
# # This is Seisflows # # See LICENCE file # # ############################################################################### # Import system modules import sys # Local imports from seisflows.tools import array, unix from seisflows.tools.tools import exists, findpath from seisflows.tools.seismic import getpar, setpa...
bsd-2-clause
jacobbieker/Insights
insights/google/Gmail2SQLite.py
1
1987
''' Copyright (C) 2015 Jacob Bieker, jacob@bieker.us, www.jacobbieker.com 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. Thi...
gpl-2.0
wasade/networkx
networkx/classes/ordered.py
48
1041
""" OrderedDict variants of the default base classes. """ from collections import OrderedDict from .graph import Graph from .multigraph import MultiGraph from .digraph import DiGraph from .multidigraph import MultiDiGraph __all__ = [] __all__.extend([ 'OrderedGraph', 'OrderedDiGraph', 'OrderedMultiGraph...
bsd-3-clause
jjhuff/fcc-comments
lib/nltk/corpus/reader/toolbox.py
5
2078
# Natural Language Toolkit: Toolbox Reader # # Copyright (C) 2001-2012 NLTK Project # Author: Greg Aumann <greg_aumann@sil.org> # Stuart Robinson <Stuart.Robinson@mpi.nl> # Steven Bird <sb@csse.unimelb.edu.au> # URL: <http://www.nltk.org/> # For license information, see LICENSE.TXT """ Module for readi...
apache-2.0
alorence/django-modern-rpc
modernrpc/apps.py
1
3198
# coding: utf-8 import inspect import warnings from importlib import import_module import django.core.checks import django.utils.version from django.apps import AppConfig from modernrpc.conf import settings from modernrpc.core import registry from modernrpc.utils import get_modernrpc_logger, clean_old_cache_content ...
mit
mahendra-r/edx-platform
cms/djangoapps/contentstore/tests/test_export_git.py
189
5143
""" Test the ability to export courses to xml from studio """ import copy import os import shutil import subprocess from uuid import uuid4 from django.conf import settings from django.test.utils import override_settings from .utils import CourseTestCase import contentstore.git_export_utils as git_export_utils from x...
agpl-3.0
ei-grad/yandex-tank
tests/TankTests.py
3
1214
import logging import sys import tempfile import unittest from yandextank.plugins.Aggregator import SecondAggregateData, \ SecondAggregateDataTotalItem from yandextank.core import TankCore class TankTestCase(unittest.TestCase): formatter = logging.Formatter("%(asctime)s [%(levelname)s] %(name)s\t%(message)s"...
lgpl-2.1
openlabs/nereid-webshop
web/application.py
4
1255
#!/usr/bin/env python import os from nereid import Nereid from werkzeug.contrib.sessions import FilesystemSessionStore from nereid.contrib.locale import Babel from nereid.sessions import Session from trytond.config import config config.update_etc() CWD = os.path.abspath(os.path.dirname(__file__)) CONFIG = dict( ...
bsd-3-clause
thelonious/g2x
app/Camera/camera_controller.py
2
2609
from picamera import PiCamera import time class CameraController: def __init__(self, resolution=(1296, 972), framerate=24): self.camera = None self.resolution = resolution self.framerate = framerate self.preview = False self.record = False def __enter__(self): ...
mit
msmolens/VTK
Charts/Core/Testing/Python/TestScatterPlotColors.py
26
3217
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import vtk import vtk.test.Testing import math class TestScatterPlotColors(vtk.test.Testing.vtkTest): def testLinePlot(self): "Test if colored scatter plots can be built with python" # Set up a 2D scene, add an XY chart to it view = ...
bsd-3-clause
alexryndin/ambari
ambari-server/src/main/resources/stacks/ADH/1.0/services/HIVE/package/scripts/hive_metastore.py
1
9637
#!/usr/bin/env python """ Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License");...
apache-2.0
simonmikkelsen/roughcut
lib/infomerger.py
1
1243
#! /usr/bin/python import sys import os.path import json class InfoReader: def __init__(self, filename): self.filename = filename fp = open(self.filename, "r") self.info = json.load(fp) fp.close() def getInfo(self): return self.info def getMerger(self): info = self.getInfo() retu...
gpl-2.0
cce/kombu
docs/conf.py
17
2127
# -*- coding: utf-8 -*- import sys import os # If your extensions are in another directory, add it here. If the directory # is relative to the documentation root, use os.path.abspath to make it # absolute, like shown here. sys.path.append(os.path.join(os.pardir, "tests")) import kombu from django.conf import setting...
bsd-3-clause
neumerance/deploy
.venv/lib/python2.7/site-packages/setuptools/command/install_scripts.py
285
2068
from distutils.command.install_scripts import install_scripts \ as _install_scripts from pkg_resources import Distribution, PathMetadata, ensure_directory import os from distutils import log class install_scripts(_install_scripts): """Do normal script install, plus any egg_info wrapper scripts""" def ini...
apache-2.0
sudipm-mukherjee/parport
tools/perf/scripts/python/failed-syscalls-by-pid.py
1996
2233
# failed system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
gpl-2.0
javierlgroba/Eventer-gapp
django_mongodb_engine/base.py
4
9664
import copy import datetime import decimal import sys import warnings from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db.backends.signals import connection_created from django.db.utils import DatabaseError from pymongo import ReadPreference from pymongo.collection ...
lgpl-3.0
dmsimard/ansible
test/support/integration/plugins/modules/aws_s3.py
50
38589
#!/usr/bin/python # This file is part of Ansible # 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', 'status': ['stableint...
gpl-3.0
Ecpy/ecpy_pulses
docs/source/api_builder.py
1
17031
# -*- coding: utf-8 -*- """ exopy.api_builder ~~~~~~~~~~~~~~~~ This is derived from the sphinx-apidoc but modified to allow generation of hierarchically organized .rst for the api docs. Parses a directory tree looking for Python modules and packages and creates ReST files appropriately to crea...
bsd-3-clause
saisai/httpie
tests/test_uploads.py
47
2820
import os import pytest from httpie.input import ParseError from utils import TestEnvironment, http, HTTP_OK from fixtures import FILE_PATH_ARG, FILE_PATH, FILE_CONTENT class TestMultipartFormDataFileUpload: def test_non_existent_file_raises_parse_error(self, httpbin): with pytest.raises(ParseError): ...
bsd-3-clause
Microvellum/Fluid-Designer
win64-vc/2.78/python/lib/json/tool.py
17
1645
r"""Command-line tool to validate and pretty-print JSON Usage:: $ echo '{"json":"obj"}' | python -m json.tool { "json": "obj" } $ echo '{ 1.2:3.4}' | python -m json.tool Expecting property name enclosed in double quotes: line 1 column 3 (char 2) """ import argparse import collections impo...
gpl-3.0
aaronmckinstry706/twitter-crime-prediction
src/jobs/crime_prediction/twokenize.py
1
12044
# -*- coding: utf-8 -*- # All code in this cell taken from the link below. # https://github.com/myleott/ark-twokenize-py/blob/master/twokenize.py from __future__ import print_function import operator import re import HTMLParser def regex_or(*items): return '(?:' + '|'.join(items) + ')' Contractions = re.compil...
gpl-3.0
WilJoey/tn_ckan
ckan/new_tests/plugins/__init__.py
1
1139
'''The plugin interfaces in :mod:`ckan.plugins.interfaces` are not directly testable because they don't contain any code, *but*: * Each plugin interface should have an example plugin in :mod:`ckan.ckanext` and the example plugin should have its own functional tests. * The tests for the code that calls the plugin in...
mit
AndrewGrossman/django
django/db/migrations/state.py
138
24339
from __future__ import unicode_literals import copy from collections import OrderedDict from contextlib import contextmanager from django.apps import AppConfig from django.apps.registry import Apps, apps as global_apps from django.conf import settings from django.db import models from django.db.models.fields.proxy im...
bsd-3-clause