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
chaen/DIRAC
TransformationSystem/Client/TaskManager.py
1
40997
""" TaskManager contains WorkflowTasks and RequestTasks modules, for managing jobs and requests tasks """ __RCSID__ = "$Id$" # pylint: disable=protected-access import time import StringIO import json import copy from DIRAC import S_OK, S_ERROR, gLogger from DIRAC.Core.Security.ProxyInfo import getProxyInfo from DI...
gpl-3.0
Joshndroid/android_kernel_google_msm
Documentation/target/tcm_mod_builder.py
4981
41422
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
jyby/PrefixFreeCodes
Experiments/measureStatisticsInFiles.py
1
3268
import doctest,os from collections import Counter from statisticsMeasure import statistics def countFrequenciesInFile(filename): """Given a file name, compute the frequencies of the words in the corresponding file. >>> f = countFrequenciesInFile("test1.txt") >>> print(sorted(f)) [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
gpl-3.0
piqueserver/piqueserver
piqueserver/console.py
1
3306
# Copyright (c) Mathias Kaerlev 2011-2012. # This file is part of pyspades. # pyspades 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...
gpl-3.0
mjg/PyX-svn
design/invalid4.py
2
1412
#!/usr/bin/env python import sys;sys.path.insert(0, "..") from math import * from pyx import * # File for invalid parametrisations of Bezier curves # Check a-posteriori the sign of Delta y for the square-root solution of Delta x def Dx_m(y): return (-1-2*y-sqrt((1+2*y)**2+3))/3.0 def Dx_p(y): return (-1-2*y+sq...
gpl-2.0
massmutual/scikit-learn
sklearn/ensemble/tests/test_weight_boosting.py
83
17276
"""Testing for the boost module (sklearn.ensemble.boost).""" import numpy as np from sklearn.utils.testing import assert_array_equal, assert_array_less from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal, assert_true from sklearn.utils.testing import assert_raises...
bsd-3-clause
tangyiyong/odoo
openerp/report/misc.py
458
1425
# -*- 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
terbolous/SickRage
lib/httplib2/socks.py
811
18459
"""SocksiPy - Python SOCKS module. Version 1.00 Copyright 2006 Dan-Haim. 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 notice, this ...
gpl-3.0
albert-chin/yowsup
setup.py
8
1512
#!/usr/bin/env python from __future__ import print_function from setuptools import setup, find_packages import yowsup import platform import sys deps = ['python-dateutil', 'argparse', 'python-axolotl>=0.1.35', 'six'] if sys.version_info < (2,7): deps += ['importlib'] if platform.system().lower() == "windows": ...
gpl-3.0
AcrDijon/henet
setup.py
1
1157
from setuptools import setup, find_packages from henet import __version__ install_requires = ['bottle', 'python-dateutil', 'beaker', 'konfig', 'docutils', 'rst2rst', 'python-Levenshtein', 'pelican', 'konfig', 'bson', 'waitress', 'multipro...
apache-2.0
WillisXChen/django-oscar
oscar/lib/python2.7/site-packages/werkzeug/testsuite/internal.py
146
2940
# -*- coding: utf-8 -*- """ werkzeug.testsuite.internal ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Internal tests. :copyright: (c) 2014 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import unittest from datetime import datetime from warnings import filterwarnings, resetwarnings from werkz...
bsd-3-clause
sauloal/pycluster
pypy-1.9_64/lib-python/2.7/distutils/tests/test_version.py
141
2625
"""Tests for distutils.version.""" import unittest from distutils.version import LooseVersion from distutils.version import StrictVersion from test.test_support import run_unittest class VersionTestCase(unittest.TestCase): def test_prerelease(self): version = StrictVersion('1.2.3a1') self.assertEq...
mit
Project-Platypus/Platypus
platypus/tests/test_algorithms.py
1
4454
# Copyright 2015-2018 David Hadka # # This file is part of Platypus, a Python module for designing and using # evolutionary algorithms (EAs) and multiobjective evolutionary algorithms # (MOEAs). # # Platypus is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License a...
gpl-3.0
benjaminbrinkman/open-ad-platform
.venv/lib/python3.4/site-packages/pip/_vendor/requests/models.py
410
29176
# -*- coding: utf-8 -*- """ requests.models ~~~~~~~~~~~~~~~ This module contains the primary objects that power Requests. """ import collections import datetime from io import BytesIO, UnsupportedOperation from .hooks import default_hooks from .structures import CaseInsensitiveDict from .auth import HTTPBasicAuth ...
mit
mcgachey/edx-platform
lms/djangoapps/instructor/offline_gradecalc.py
73
4371
""" ======== Offline calculation of grades ============================================================= Computing grades of a large number of students can take a long time. These routines allow grades to be computed offline, by a batch process (eg cronjob). The grades are stored in the OfflineComputedGrade table of...
agpl-3.0
arborh/tensorflow
tensorflow/python/training/saving/functional_saver_test.py
6
5842
# 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
mezz64/home-assistant
homeassistant/components/volumio/__init__.py
11
1653
"""The Volumio integration.""" import asyncio from pyvolumio import CannotConnectError, Volumio from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_HOST, CONF_PORT from homeassistant.core import HomeAssistant from homeassistant.exceptions import ConfigEntryNotReady from homeassis...
apache-2.0
citrix-openstack/horizon
tools/install_venv.py
2
4922
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2011 OpenStack, LLC # # Copyright 2011 Nebula, Inc. # # Licensed under the Apache License, Version 2....
apache-2.0
Carrotsmile/CS428
steerstats/tools/midaco/example_MINLPc.py
8
8338
import math ######################################################################## # # This is an Example Call of MIDACO 4.0 # ------------------------------------- # # MIDACO solves the general Mixed Integer Non-Linear Program (MINLP): # # # Minimize F(X) where X(1,...N-NI) is *CONTINUOUS* ...
gpl-3.0
sabi0/intellij-community
python/helpers/pycharm/__jb.for_twisted/twisted/plugins/teamcity_plugin.py
11
1180
import sys from teamcity.unittestpy import TeamcityTestResult from twisted.trial.reporter import Reporter from twisted.python.failure import Failure from twisted.plugins.twisted_trial import _Reporter class FailureWrapper(Failure): def __getitem__(self, key): return self.value[key] class TeamcityReport...
apache-2.0
scripteed/mtasa-blue
vendor/google-breakpad/src/tools/gyp/test/mac/gyptest-rebuild.py
299
1260
#!/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 rebuilt correctly. """ import TestGyp import sys if sys.platform == 'darwin': test = TestGyp.TestGyp(...
gpl-3.0
hulop/SfMLocalization
PyReconstructUtils/src/changeRootPathInOutputJson.py
1
3242
################################################################################ # Copyright (c) 2015 IBM Corporation # # 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, in...
mit
FrankBian/kuma
vendor/packages/translate-toolkit/translate/storage/test_poxliff.py
7
3619
#!/usr/bin/env python from translate.storage import poxliff from translate.storage import test_xliff from translate.misc.multistring import multistring class TestPOXLIFFUnit(test_xliff.TestXLIFFUnit): UnitClass = poxliff.PoXliffUnit def test_plurals(self): """Tests that plurals are handled correct...
mpl-2.0
macchina-io/macchina.io
platform/JS/V8/v8/gypfiles/vs_toolchain.py
7
13564
#!/usr/bin/env python # Copyright 2015 the V8 project authors. All rights reserved. # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import glob import json import os import pipes import shutil import subpr...
apache-2.0
bootandy/sqlalchemy
test/sql/test_case_statement.py
28
5930
from sqlalchemy.testing import assert_raises, eq_ from sqlalchemy.testing import fixtures, AssertsCompiledSQL from sqlalchemy import ( testing, exc, case, select, literal_column, text, and_, Integer, cast, String, Column, Table, MetaData) from sqlalchemy.sql import table, column info_table = None class CaseT...
mit
MaxMorais/frappe
frappe/model/db_query.py
3
13255
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals """build query for doclistview and return results""" import frappe, json import frappe.defaults import frappe.share import frappe.permissions from frappe.utils import flt, cint, ...
mit
JFriel/honours_project
venv/lib/python2.7/site-packages/numpy/lib/index_tricks.py
66
26204
from __future__ import division, absolute_import, print_function import sys import math import numpy.core.numeric as _nx from numpy.core.numeric import ( asarray, ScalarType, array, alltrue, cumprod, arange ) from numpy.core.numerictypes import find_common_type, issubdtype from . import function_base import ...
gpl-3.0
abhishekgahlot/scikit-learn
examples/classification/plot_classifier_comparison.py
181
4699
#!/usr/bin/python # -*- coding: utf-8 -*- """ ===================== Classifier comparison ===================== A comparison of a several classifiers in scikit-learn on synthetic datasets. The point of this example is to illustrate the nature of decision boundaries of different classifiers. This should be taken with ...
bsd-3-clause
petecummings/django
tests/urlpatterns_reverse/erroneous_urls.py
199
1350
import warnings from django.conf.urls import url from django.utils.deprecation import RemovedInDjango110Warning from . import views # Test deprecated behavior of passing strings as view to url(). # Some of these can be removed in Django 1.10 as they aren't convertable to # callables. with warnings.catch_warnings(): ...
bsd-3-clause
iDigBio/idb-backend
idigbio_ingestion/update_publisher_recordset.py
1
23525
# must set PYTHONPATH environment variable to the top level prior to running this script import logging import re import datetime import dateutil.parser import time import os import requests import feedparser assert feedparser.__version__ >= "5.2.0" from idb import config from idb.postgres_backend.db import PostgresD...
gpl-3.0
CyrilWaechter/pyRevitMEP
pyRevitMEP.tab/Samples.panel/Samples.pulldown/DataContextSample.pushbutton/script.py
1
1373
""" Copyright (c) 2017 Cyril Waechter Python scripts for Autodesk Revit This file is part of pypevitmep repository at https://github.com/CyrilWaechter/pypevitmep pypevitmep is an extension for pyRevit. It contain free set of scripts for Autodesk Revit: you can redistribute it and/or modify it under the terms of the G...
gpl-3.0
mozmark/tls-observatory
vendor/github.com/google/certificate-transparency/python/ct/client/state_test.py
29
1348
#!/usr/bin/env python import unittest import os import tempfile from ct.client import state from ct.proto import client_pb2 class StateKeeperTest(unittest.TestCase): _DEFAULT_STATE = client_pb2.MonitorState() # fill with some data _DEFAULT_STATE.verified_sth.timestamp = 1234 _DEFAULT_STATE.pending_s...
mpl-2.0
ArtsiomCh/tensorflow
tensorflow/contrib/eager/python/summary_writer.py
2
9307
# 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
ckan-fcd/pycsw-fcd
setup.py
3
5510
# -*- coding: iso-8859-15 -*- # ================================================================= # # Authors: Tom Kralidis <tomkralidis@gmail.com> # # Copyright (c) 2015 Tom Kralidis # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation # files...
mit
cogu/autosar
examples/autosar4/davinci/packages.py
1
1240
#!/usr/bin/env python3 dev_mode = False if dev_mode: import os, sys sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../../..'))) import autosar def create_packages(ws): ws.createPackage('DataTypes', role='DataType') ws.createPackage('Constants', role="Constant") ws.creat...
mit
simark/simulavr
regress/test_opcodes/test_CPI.py
3
3282
#! /usr/bin/env python ############################################################################### # # simulavr - A simulator for the Atmel AVR family of microcontrollers. # Copyright (C) 2001, 2002 Theodore A. Roth # # This program is free software; you can redistribute it and/or modify # it under the terms of th...
gpl-2.0
wfxiang08/django178
tests/conditional_processing/tests.py
5
5818
# -*- coding:utf-8 -*- from __future__ import unicode_literals from datetime import datetime from django.test import TestCase FULL_RESPONSE = 'Test conditional get response' LAST_MODIFIED = datetime(2007, 10, 21, 23, 21, 47) LAST_MODIFIED_STR = 'Sun, 21 Oct 2007 23:21:47 GMT' LAST_MODIFIED_NEWER_STR = 'Mon, 18 Oct ...
bsd-3-clause
philipan/paparazzi
sw/ground_segment/python/udp_link/datalink_to_w5100.py
89
1441
#!/usr/bin/python import os import sys import socket import struct from optparse import OptionParser sys.path.append(os.getenv("PAPARAZZI_HOME") + "/sw/lib/python") parser = OptionParser() parser.add_option("-d", "--destip", dest="dest_addr", help="Destination IP for messages picked up from local socket", default="1...
gpl-2.0
hackday-profilers/flocker
flocker/common/_ipc.py
15
6133
# Copyright Hybrid Logic Ltd. See LICENSE file for details. """ Inter-process communication for flocker. """ from subprocess import Popen, PIPE, check_output, CalledProcessError from contextlib import contextmanager from io import BytesIO from threading import current_thread from pipes import quote from zope.interf...
apache-2.0
mateuszdw/Arduino
arduino-core/src/processing/app/i18n/python/requests/packages/charade/sbcharsetprober.py
2927
4793
######################## 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...
lgpl-2.1
gfxmonk/gup
python/gup/gupfile.py
2
9524
from __future__ import print_function import os from os import path import re import itertools from .whichcraft import which from .log import getLogger from .error import SafeError from .var import INDENT, PY3 _log = getLogger(__name__) if PY3: xrange = range def _default_gup_files(filename): l = filename.split('....
lgpl-2.1
HunterBaines/sudb
sudb/controller.py
1
79027
# Author: Hunter Baines <0x68@protonmail.com> # Copyright: (C) 2017 Hunter Baines # License: GNU GPL version 3 """The module containing the SolverController class. """ import os import re import stat import textwrap import readline from collections import deque from functools import wraps from enum import IntEnum fr...
gpl-3.0
TheMOOCAgency/edx-platform
common/test/acceptance/pages/lms/library.py
56
1472
""" Library Content XBlock Wrapper """ from bok_choy.page_object import PageObject class LibraryContentXBlockWrapper(PageObject): """ A PageObject representing a wrapper around a LibraryContent block seen in the LMS """ url = None BODY_SELECTOR = '.xblock-student_view div' def __init__(self, ...
agpl-3.0
davidsminor/cortex
test/IECore/GradeTest.py
12
4135
########################################################################## # # Copyright (c) 2008, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistribu...
bsd-3-clause
styxit/CouchPotatoServer
libs/subliminal/cache.py
107
4619
# -*- coding: utf-8 -*- # Copyright 2012 Nicolas Wack <wackou@gmail.com> # # This file is part of subliminal. # # subliminal 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 Licen...
gpl-3.0
EvanK/ansible
lib/ansible/plugins/action/fetch.py
46
9995
# (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
markllama/openshift-ansible
roles/lib_utils/library/yedit.py
27
32528
#!/usr/bin/env python # pylint: disable=missing-docstring # ___ ___ _ _ ___ ___ _ _____ ___ ___ # / __| __| \| | __| _ \ /_\_ _| __| \ # | (_ | _|| .` | _|| / / _ \| | | _|| |) | # \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____ # | \ / _ \ | \| |/ _ \_ _| | __| \_ _|_ _| # | |) | (...
apache-2.0
tuhangdi/django
tests/admin_widgets/models.py
227
4760
from __future__ import unicode_literals from django.contrib.auth.models import User from django.db import models from django.utils.encoding import python_2_unicode_compatible class MyFileField(models.FileField): pass @python_2_unicode_compatible class Member(models.Model): name = models.CharField(max_lengt...
bsd-3-clause
stshine/servo
components/script/dom/bindings/codegen/parser/tests/test_overload.py
142
2624
import WebIDL def WebIDLTest(parser, harness): parser.parse(""" interface TestOverloads { void basic(); void basic(long arg1); boolean abitharder(TestOverloads foo); boolean abitharder(boolean foo); void abitharder(ArrayBuffer? foo); void withVari...
mpl-2.0
zhangg/trove
trove/common/strategies/cluster/experimental/redis/taskmanager.py
1
5872
# Copyright [2015] Hewlett-Packard Development Company, L.P. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
apache-2.0
IanMcT/tetrisics3u4u1617
tetris.py
1
3474
import random, os.path import pygame from pygame.locals import * """This is a Tetris style game that the ICS3U/4U 2016/2017 class in Huntsville High School is creating. Teacher: I. McTavish Date: Dec 1, 2016""" #Global Variables SCREENRECT = Rect((320,620),0,32) main_dir = os.path.split(os.path.abspath(__file__))...
gpl-3.0
mvaled/OpenUpgrade
openerp/workflow/__init__.py
378
3793
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2014 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
Jgarcia-IAS/localizacion
openerp/addons-extra/product_pack/pack.py
3
3916
# -*- encoding: latin-1 -*- from openerp import fields, models from openerp.osv import fields as old_fields import math class product_pack(models.Model): _name = 'product.pack.line' _rec_name = 'product_id' parent_product_id = fields.Many2one( 'product.product', 'Parent Product', ondelete...
agpl-3.0
gnumdk/lollypop
lollypop/widgets_album.py
1
14235
# Copyright (c) 2014-2017 Cedric Bellegarde <cedric.bellegarde@adishatz.org> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later vers...
gpl-3.0
battlecat/Spirit
spirit/category/views.py
11
1427
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.views.generic import ListView from django.shortcuts import render, get_object_or_404 from django.http import HttpResponsePermanentRedirect from djconfig import config from ..core.utils.paginator import yt_paginate from ..topic.models import...
mit
cawka/pybindgen
pybindgen/utils.py
6
8595
import sys PY3 = (sys.version_info[0] >= 3) if PY3: string_types = str, else: string_types = basestring, try: any = any except NameError: def any(iterable): for element in iterable: if element: return True return False from pybindgen.typehandlers.codesink...
lgpl-2.1
40223141/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/keyword.py
761
2049
#! /usr/bin/env python3 """Keywords (from "graminit.c") This file is automatically generated; please don't muck it up! To update the symbols in this file, 'cd' to the top directory of the python source tree after building the interpreter and run: ./python Lib/keyword.py """ __all__ = ["iskeyword", "kwlist"] k...
gpl-3.0
rlindner81/pyload
module/database/DatabaseBackend.py
41
11447
#!/usr/bin/env python """ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in th...
gpl-3.0
nathanaevitas/odoo
openerp/addons/l10n_be_coda/l10n_be_coda.py
340
1253
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. # # This program is free software: you can redistribute it and/or modify # it under ...
agpl-3.0
geminateCoder/Character-Archive-Website
Lib/site-packages/sqlalchemy/testing/util.py
55
7544
# testing/util.py # Copyright (C) 2005-2016 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 ..util import jython, pypy, defaultdict, decorator, py2k import decimal import ...
cc0-1.0
hgl888/chromium-crosswalk-efl
third_party/closure_linter/closure_linter/statetracker_test.py
109
3384
#!/usr/bin/env python # # Copyright 2012 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
petewarden/tensorflow
tensorflow/python/autograph/converters/lists.py
14
8438
# 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
andrewd18/eve-wspace
evewspace/Alerts/method_registry.py
15
2314
# Eve W-Space # Copyright (C) 2013 Andrew Austin and other contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option...
gpl-3.0
JJediny/python-social-auth
social/utils.py
47
7238
import re import sys import unicodedata import collections import functools import logging import six import requests import social from requests.adapters import HTTPAdapter from requests.packages.urllib3.poolmanager import PoolManager from social.exceptions import AuthCanceled, AuthUnreachableProvider from social.p...
bsd-3-clause
WendellDuncan/or-tools
examples/python/nonogram_table.py
5
9243
# Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com # # 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 ...
apache-2.0
mbauskar/helpdesk-frappe
frappe/modules/export_file.py
52
2423
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe, os, json import frappe.model from frappe.modules import scrub, get_module_path, lower_case_files_for, scrub_dt_dn def export_doc(doc): export_to_files([[doc.doct...
mit
ianyh/heroku-buildpack-python-opencv
vendor/.heroku/lib/python2.7/test/test_exception_variations.py
213
4041
from test.test_support import run_unittest import unittest class ExceptionTestCase(unittest.TestCase): def test_try_except_else_finally(self): hit_except = False hit_else = False hit_finally = False try: raise Exception, 'nyaa!' except: hit_except =...
mit
tongxindao/Flask-micblog
Flask-MicroBlog/web/micblog/tests.py
1
5603
# coding: utf-8 #!/usr/bin/env python import os import unittest from config import basedir from app import app, db from app.models import User from datetime import datetime, timedelta from app.models import User, Post from coverage import coverage cov = coverage(branch = True, omit = ['Flask-micblog/*', 'tests.py']) ...
apache-2.0
araines/moto
moto/datapipeline/responses.py
14
2699
from __future__ import unicode_literals import json from moto.core.responses import BaseResponse from .models import datapipeline_backends class DataPipelineResponse(BaseResponse): @property def parameters(self): # TODO this should really be moved to core/responses.py if self.body: ...
apache-2.0
ssanderson/numpy
numpy/lib/arraysetops.py
8
16818
""" Set operations for 1D numeric arrays based on sorting. :Contains: ediff1d, unique, intersect1d, setxor1d, in1d, union1d, setdiff1d :Notes: For floating point arrays, inaccurate results may appear due to usual round-off and floating point comparison issues. Speed could be gained in some operations ...
bsd-3-clause
CaptainThrowback/kernel_htc_m8gpe
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
jswope00/griffinx
common/lib/sandbox-packages/verifiers/tests_draganddrop.py
173
32788
import unittest import draganddrop from .draganddrop import PositionsCompare import json class Test_PositionsCompare(unittest.TestCase): """ describe""" def test_nested_list_and_list1(self): self.assertEqual(PositionsCompare([[1, 2], 40]), PositionsCompare([1, 3])) def test_nested_list_and_list...
agpl-3.0
mfriedenhagen/Diamond
src/diamond/collector.py
18
18637
# coding=utf-8 """ The Collector class is a base class for all metric collectors. """ import os import socket import platform import logging import configobj import time import re import subprocess from diamond.metric import Metric from diamond.utils.config import load_config from error import DiamondException # De...
mit
theo-l/django
tests/asgi/tests.py
5
8680
import asyncio import sys import threading from unittest import skipIf from asgiref.sync import SyncToAsync from asgiref.testing import ApplicationCommunicator from django.core.asgi import get_asgi_application from django.core.signals import request_finished, request_started from django.db import close_old_connection...
bsd-3-clause
totorigolo/WiiQuizz
helpers/WindowHelper.py
1
57378
# coding: utf8 import os import re from inspect import isfunction import pygame as pg from pygame.locals import * from ColorHelper import ColorHelper from Singleton import Singleton from tools import py_encode_font_txt, py_encode_title if not pg.font: print 'Warning, fonts disabled' if not pg.mixer: print 'Warning,...
gpl-2.0
LittleLama/Sick-Beard-BoxCar2
lib/pythontwitter/__init__.py
30
137661
#!/usr/bin/env python # # vim: sw=2 ts=2 sts=2 # # Copyright 2007 The Python-Twitter Developers # # 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....
gpl-3.0
dav1x/ansible
lib/ansible/module_utils/openstack.py
57
4600
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
gpl-3.0
CKehl/pylearn2
pylearn2/utils/exc.py
37
3029
"""Exceptions used by basic support utilities.""" __author__ = "Ian Goodfellow" import sys from pylearn2.utils.common_strings import environment_variable_essay from theano.compat import six class EnvironmentVariableError(Exception): """ An exception raised when a required environment variable is not defined ...
bsd-3-clause
deepsrijit1105/edx-platform
cms/djangoapps/course_creators/admin.py
232
4470
""" django admin page for the course creators table """ from course_creators.models import CourseCreator, update_creator_state, send_user_notification, send_admin_notification from course_creators.views import update_course_creator_group from ratelimitbackend import admin from django.conf import settings from django....
agpl-3.0
micolous/pylifx
examples/sunrise.py
2
1863
#!/usr/bin/python # -*- coding: utf-8 -*- """ @author: Deryck Arnold Copyright (c) 2014, Deryck Arnold 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 ...
bsd-2-clause
koobonil/Boss2D
Boss2D/addon/tensorflow-1.2.1_for_boss/tensorflow/contrib/distributions/python/kernel_tests/bijectors/affine_linear_operator_test.py
52
4007
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
mit
genenetwork/genenetwork2
wqflask/wqflask/update_search_results.py
3
6485
import json from flask import Flask, g from base.data_set import create_dataset from base.trait import GeneralTrait from db import webqtlDatabaseFunction from utility.benchmark import Bench from utility.logger import getLogger logger = getLogger(__name__) class GSearch: def __init__(self, kw): self.ty...
agpl-3.0
StevenVanAcker/mitmproxy
test/mitmproxy/tools/test_dump.py
3
1260
import pytest from unittest import mock from mitmproxy import log from mitmproxy import controller from mitmproxy import options from mitmproxy.tools import dump from .. import tservers class TestDumpMaster(tservers.MasterTest): def mkmaster(self, flt, **opts): o = options.Options(view_filter=flt, verbo...
mit
js0701/chromium-crosswalk
chrome/common/extensions/docs/server2/test_patcher.py
121
1055
# Copyright 2013 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. from future import Future from patcher import Patcher class TestPatcher(Patcher): def __init__(self, version, patched_files, patch_data): self._versio...
bsd-3-clause
bliz937/kivy
kivy/app.py
8
36246
''' Application =========== The :class:`App` class is the base for creating Kivy applications. Think of it as your main entry point into the Kivy run loop. In most cases, you subclass this class and make your own app. You create an instance of your specific app class and then, when you are ready to start the applicati...
mit
jrabbit/ubotu-fr
plugins/BadWords/config.py
8
5052
### # Copyright (c) 2005, Jeremiah Fincher # 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 conditi...
bsd-3-clause
popazerty/openblackhole-SH4
tools/create_picon_links.py
192
1273
# # create links for picon # usage: create_picon_links lamedb # run in picon directory. # It will read the servicenames from the lamedb and create symlinks # for the servicereference names. import os, sys f = open(sys.argv[1]).readlines() f = f[f.index("services\n")+1:-3] while len(f): ref = [int(x, 0x10) for x ...
gpl-2.0
v-iam/azure-sdk-for-python
azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_properties.py
4
3836
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
dogdirt2000/ATF
Test/FunctionalTests/CircuitEditorTestScripts/CutPaste.py
10
3291
import sys sys.path.append("./CommonTestScripts") import System import Test import CircuitEditorUtil CircuitEditorUtil.SetGlobals(schemaLoader, Schema) doc = atfDocService.OpenNewDocument(editor) #Verify no objects at the beginning Test.Equal(0, Test.GetEnumerableCount(editingContext.Items), "verify no pre-existing o...
apache-2.0
UOMx/edx-platform
lms/djangoapps/ccx/tests/utils.py
7
4160
""" Test utils for CCX """ import datetime import pytz from django.conf import settings from student.roles import ( CourseCcxCoachRole, CourseInstructorRole, CourseStaffRole ) from student.tests.factories import ( UserFactory ) from xmodule.modulestore.django import modulestore from xmodule.modulestor...
agpl-3.0
dandanvidi/capacity-usage
scripts/LTEE_to_cu.py
3
2658
# -*- coding: utf-8 -*- """ Created on Sun Jul 3 14:09:58 2016 @author: dan """ import re, csv import pandas as pd from collections import defaultdict from capacity_usage import CAPACITY_USAGE flux = pd.DataFrame.from_csv("../data/mmol_gCDW_h.csv") abundance = pd.DataFrame.from_csv("../data/g_gCDW.csv") cu = CAPAC...
mit
tanmaykm/edx-platform
common/lib/xmodule/xmodule/library_tools.py
154
7784
""" XBlock runtime services for LibraryContentModule """ from django.core.exceptions import PermissionDenied from opaque_keys.edx.locator import LibraryLocator, LibraryUsageLocator from search.search_engine_base import SearchEngine from xmodule.library_content_module import ANY_CAPA_TYPE_VALUE from xmodule.modulestore ...
agpl-3.0
pombredanne/dateparser-1
tests/test_jalali.py
1
10230
# -*- coding: utf-8 -*- from __future__ import unicode_literals from nose_parameterized import parameterized, param from unittest import TestCase from datetime import datetime from dateparser.calendars.jalali import JalaliParser from dateparser.calendars.jalali import validate_time from tests import BaseTestCase cl...
bsd-3-clause
wkschwartz/django
tests/model_formsets_regress/models.py
61
1342
from django.db import models class User(models.Model): username = models.CharField(max_length=12, unique=True) serial = models.IntegerField() class UserSite(models.Model): user = models.ForeignKey(User, models.CASCADE, to_field="username") data = models.IntegerField() class UserProfile(models.Mode...
bsd-3-clause
illoyd/algo
robinhood.py
1
16355
import os import re import requests import pandas as pd import datetime import dateutil import logging from collections import deque import simpleapi import resourceful import helper ## # Base class for exceptions in this module class Error(Exception): def __init__(self, original: Exception = None, *args: objec...
mit
BorgERP/borg-erp-6of3
addons/plugin_outlook/plugin_outlook.py
9
2103
# -*- 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
wasiqmukhtar/tcp-eval.wasiq
examples/wireless/mixed-wireless.py
59
17198
# /* # * This program is free software; you can redistribute it and/or modify # * it under the terms of the GNU General Public License version 2 as # * published by the Free Software Foundation; # * # * This program is distributed in the hope that it will be useful, # * but WITHOUT ANY WARRANTY; without even the ...
gpl-2.0
shujaatak/UAV_MissionPlanner
Lib/cookielib.py
80
64452
"""HTTP cookie handling for web clients. This module has (now fairly distant) origins in Gisle Aas' Perl module HTTP::Cookies, from the libwww-perl library. Docstrings, comments and debug strings in this code refer to the attributes of the HTTP cookie system as cookie-attributes, to distinguish them clearly from Pyth...
gpl-2.0
snnn/tensorflow
tensorflow/tools/compatibility/tf_upgrade_v2_test.py
5
3863
# 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
the-c0d3r/CapTipper
colorama/win32.py
446
5121
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. # from winbase.h STDOUT = -11 STDERR = -12 try: import ctypes from ctypes import LibraryLoader windll = LibraryLoader(ctypes.WinDLL) from ctypes import wintypes except (AttributeError, ImportError): windll = None SetCon...
gpl-3.0