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
neerajvashistha/pa-dude
lib/python2.7/site-packages/django/utils/lru_cache.py
335
7647
try: from functools import lru_cache except ImportError: # backport of Python's 3.3 lru_cache, written by Raymond Hettinger and # licensed under MIT license, from: # <http://code.activestate.com/recipes/578078-py26-and-py30-backport-of-python-33s-lru-cache/> # Should be removed when Django only sup...
mit
tendant/ansible-modules-core
cloud/openstack/os_security_group.py
109
4265
#!/usr/bin/python # Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # Copyright (c) 2013, Benno Joy <benno@ansible.com> # # This module 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 vers...
gpl-3.0
fallen/milkymist-mmu
cores/softusb/navre_regress/test_opcodes/test_CP.py
5
3325
#! /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...
lgpl-3.0
maellak/invenio
modules/miscutil/lib/logicutils.py
36
26292
# -*- coding: utf-8 -*- # logicutils.py was originally distributed as part of the aima-python project, at # http://code.google.com/p/aima-python/ # At the time it was integrated into Invenio (2010 May 20), aima-python # had a notice on its website declaring the code to be under the "MIT license" # and linking to http:/...
gpl-2.0
sheshkovsky/jaryan
flags/views.py
1
4191
from django.http import HttpResponseRedirect, HttpResponseBadRequest from django.views.generic.base import View from django.shortcuts import render, redirect, get_object_or_404 from flags.models import Report, REASON_CHOICES from flags.forms import ReportForm from links.models import UserProfile from django.utils impor...
apache-2.0
roopali8/keystone
doc/source/conf.py
11
8456
# 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
cliffano/swaggy-jenkins
clients/python/generated/swaggyjenkins/models/queue_blocked_item.py
1
10453
# coding: utf-8 """ Swaggy Jenkins Jenkins API clients generated from Swagger / Open API specification # noqa: E501 OpenAPI spec version: 1.1.1 Contact: blah@cliffano.com Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import six class QueueBlockedItem...
mit
noelevans/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers
Chapter3_MCMC/github_pull.py
95
2327
#github data scrapper """ variables of interest: indp. variables - language, given as a binary variable. Need 4 positions for 5 langagues - #number of days created ago, 1 position - has wiki? Boolean, 1 position - followers, 1 position - following, 1 position - constant dep. variab...
mit
rwl/PyCIM
CIM14/IEC61970/Dynamics/SlotInput.py
1
3420
# Copyright (C) 2010-2011 Richard Lincoln # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish...
mit
lhl/pensieve
js/node_modules/prosemirror/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py
1361
45045
# 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. r"""Code to validate and convert settings of the Microsoft build tools. This file contains code to validate and convert settings of the Microsoft build tools. Th...
gpl-3.0
epage/telepathy-python
examples/message.py
3
3220
import dbus.glib import gobject import logging import sys from time import sleep from account import connection_from_file from telepathy.client.channel import Channel from telepathy.constants import ( CONNECTION_HANDLE_TYPE_CONTACT, CONNECTION_STATUS_CONNECTED, CHANNEL_TEXT_MESSAGE_TYPE_NORMAL) from telepath...
lgpl-2.1
jdobes/spacewalk
client/rhel/yum-rhn-plugin/actions/errata.py
7
2441
#!/usr/bin/python # Client code for Update Agent # Copyright (c) 1999--2015 Red Hat, Inc. Distributed under GPLv2. # # Author: Adrian Likins <alikins@redhat.com # from up2date_client import rhnserver from up2date_client import up2dateAuth from up2date_client import pkgUtils from rhn.actions import packages __rhnexp...
gpl-2.0
mozillazg/bustard
tests/test_template.py
1
3612
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals import collections import os import pytest from bustard.template import Template current_dir = os.path.dirname(os.path.abspath(__file__)) template_dir = os.path.join(current_dir, 'templates') def ...
mit
2014c2g3/w16b_test
static/Brython3.1.3-20150514-095342/Lib/collections/__init__.py
625
25849
#__all__ = ['deque', 'defaultdict', 'Counter'] from _collections import deque, defaultdict #from itertools import repeat as _repeat, chain as _chain, starmap as _starmap __all__ = ['deque', 'defaultdict', 'namedtuple', 'UserDict', 'UserList', 'UserString', 'Counter', 'OrderedDict'] # For bootstrapping re...
agpl-3.0
otherness-space/myProject002
my_project_002/lib/python2.7/site-packages/django/templatetags/i18n.py
107
16719
from __future__ import unicode_literals import re from django.template import (Node, Variable, TemplateSyntaxError, TokenParser, Library, TOKEN_TEXT, TOKEN_VAR) from django.template.base import _render_value_in_context from django.template.defaulttags import token_kwargs from django.utils import six from django.ut...
mit
ubc/edx-platform
cms/djangoapps/course_creators/models.py
183
4070
""" Table for storing information about whether or not Studio users have course creation privileges. """ from django.db import models from django.db.models.signals import post_init, post_save from django.dispatch import receiver, Signal from django.contrib.auth.models import User from django.utils import timezone from...
agpl-3.0
dkerwin/ansible-modules-core
system/setup.py
2
5299
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, 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...
gpl-3.0
yufengg/tensorflow
tensorflow/contrib/opt/python/training/lazy_adam_optimizer_test.py
104
6037
# 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
erikriver/eduIntelligent-cynin
src/eduintelligent.courses/eduintelligent/courses/browser/course.py
1
5353
#!-*- coding: utf-8 -*- """Define a browser view for the Course content type. In the FTI configured in profiles/default/types/*.xml, this is being set as the default view of that content type. """ from Acquisition import aq_inner from DateTime import DateTime from zope.component import getMultiAdapter from Products....
gpl-3.0
endlessm/chromium-browser
third_party/catapult/third_party/google-endpoints/apitools/base/py/util_test.py
24
6905
# # Copyright 2015 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
bsd-3-clause
novapost/django-ticketoffice
django_ticketoffice/tests.py
1
21230
# -*- coding: utf-8 -*- """Tests.""" from datetime import timedelta import uuid import unittest try: from unittest import mock except ImportError: # Python 2 fallback. import mock import django.test from django.conf import settings from django.contrib.auth import hashers from django.core.management import cal...
bsd-3-clause
mangadul/WhatsAppy
yowsup/layers/protocol_profiles/protocolentities/iq_privacy_result.py
29
1719
from yowsup.structs import ProtocolTreeNode from yowsup.layers.protocol_iq.protocolentities import ResultIqProtocolEntity ''' <iq type="result" from="{{JID}}@s.whatsapp.net" id="{{IQ:ID}}"> <privacy> <category name="last" value="all"> </category> <category name="status" value="all"> </category> <category name="profile...
gpl-3.0
like9729/interactive-tutorials
suds/mx/encoded.py
211
4651
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) 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. # # This program is distributed in the hope that it will ...
apache-2.0
timhuanggithub/pox_load_balancing
pox/lib/packet/packet_utils.py
27
2860
# Copyright 2011,2012 James McCauley # Copyright 2008 (C) Nicira, Inc. # # This file is part of POX. # # POX 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 optio...
gpl-3.0
Yuskey1989/Nexus_5
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py
12980
5411
# SchedGui.py - Python extension for perf script, basic GUI code for # traces drawing and overview. # # Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com> # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. ...
gpl-2.0
mSenyor/kivy
examples/frameworks/twisted/twistd_app.py
77
1632
from kivy.support import install_twisted_reactor install_twisted_reactor() import os import sys from kivy.app import App from kivy.uix.gridlayout import GridLayout from kivy.properties import BooleanProperty from kivy.lang import Builder from twisted.scripts._twistd_unix import UnixApplicationRunner, ServerOptions f...
mit
laiqiqi886/kbengine
kbe/src/lib/python/Lib/codecs.py
84
35956
""" codecs -- Python Codec Registry, API and helpers. Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """#" import builtins, sys ### Registry and builtin stateless codec functions try: from _codecs import * except ImportError as why: raise SystemErro...
lgpl-3.0
codekidX/android_kernel_frost_i9082
tools/perf/scripts/python/syscall-counts.py
11181
1522
# system call counts # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(os.envir...
gpl-2.0
Lkhagvadelger/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/file_lock_integrationtest.py
124
2450
# Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged # # 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 co...
bsd-3-clause
quadflor/Quadflor
Code/lucid_ml/classifying/rocchioclassifier.py
1
5727
# Author: Robert Layton <robertlayton@gmail.com> # Olivier Grisel <olivier.grisel@ensta.org> # # License: BSD 3 clause from sklearn.base import BaseEstimator from scipy.sparse.csr import csr_matrix from sklearn.neighbors import NearestCentroid, nearest_centroid from sklearn.metrics.pairwise import pairwise_dis...
bsd-3-clause
male-puppies/linux-3.18.pps
tools/perf/tests/attr.py
3174
9441
#! /usr/bin/python import os import sys import glob import optparse import tempfile import logging import shutil import ConfigParser class Fail(Exception): def __init__(self, test, msg): self.msg = msg self.test = test def getMsg(self): return '\'%s\' - %s' % (self.test.path, self.msg)...
gpl-2.0
google/apitools
samples/bigquery_sample/bigquery_v2/bigquery_v2_client.py
1
26430
"""Generated client library for bigquery version v2.""" # NOTE: This file is autogenerated and should not be edited by hand. from __future__ import absolute_import from apitools.base.py import base_api from samples.bigquery_sample.bigquery_v2 import bigquery_v2_messages as messages class BigqueryV2(base_api.BaseApi...
apache-2.0
willingc/oh-mainline
vendor/packages/Pygments/pygments/styles/vim.py
364
1976
# -*- coding: utf-8 -*- """ pygments.styles.vim ~~~~~~~~~~~~~~~~~~~ A highlighting style for Pygments, inspired by vim. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import Keywor...
agpl-3.0
stfc/ceph-InfluxDB-metricsCollector
plugins/ceph_osd_plugin.py
2
7630
import base class CephPluginOSDStates(base.Base): def __init__(self,cluster,cache,timestamp,c,k): #initialise base.Base.__init__(self,cluster,cache,timestamp,c,k) def gather_metrics(self): ''' Subclassed method of base.py which is called by loader.py Returns array of points collected by the plugin ''' ...
gpl-2.0
SteveHNH/ansible
lib/ansible/modules/system/open_iscsi.py
26
11418
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Serge van Ginderachter <serge@vanginderachter.be> # 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_ver...
gpl-3.0
fusionbox/mezzanine
mezzanine/generic/migrations/south/0012_auto__add_field_rating_rating_date.py
8
8725
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models try: from django.contrib.auth import get_user_model except ImportError: # django < 1.5 from django.contrib.auth.models import User else: User = get_user_model() user_orm_labe...
bsd-2-clause
0k/OpenUpgrade
addons/board/board.py
70
6623
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2013 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you ca...
agpl-3.0
chokribr/inveniotest
modules/webaccess/lib/external_authentication.py
28
4468
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version ...
gpl-2.0
FlintHill/SUAS-Competition
env/lib/python2.7/site-packages/pip/_vendor/colorama/win32.py
40
5426
# 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...
mit
jvrsantacruz/XlsxWriter
examples/pandas_chart_line.py
9
1739
############################################################################## # # An example of converting a Pandas dataframe to an xlsx file with a line # chart using Pandas and XlsxWriter. # # Copyright 2013-2015, John McNamara, jmcnamara@cpan.org # import pandas as pd import random # Create some sample data to pl...
bsd-2-clause
yecin/pfe
vendor/doctrine/orm/docs/en/_exts/configurationblock.py
2577
3506
#Copyright (c) 2010 Fabien Potencier # #Permission is hereby granted, free of charge, to any person obtaining a copy #of this software and associated documentation files (the "Software"), to deal #in the Software without restriction, including without limitation the rights #to use, copy, modify, merge, publish, distrib...
mit
KAsante95/osf.io
scripts/migration/migrate_tags.py
31
1452
"""Add `lower` field to all tags so that Tags can be queried efficiently""" import sys import logging from website.models import Tag from website.app import init_app from scripts import utils as script_utils from framework.transactions.context import TokuTransaction logger = logging.getLogger(__name__) def do_migra...
apache-2.0
SnappleCap/oh-mainline
vendor/packages/requests/requests/auth.py
413
6794
# -*- coding: utf-8 -*- """ requests.auth ~~~~~~~~~~~~~ This module contains the authentication handlers for Requests. """ import os import re import time import hashlib from base64 import b64encode from .compat import urlparse, str from .cookies import extract_cookies_to_jar from .utils import parse_dict_header, ...
agpl-3.0
diamond-org/flask-diamond
flask_diamond/facets/rest.py
1
1260
# -*- coding: utf-8 -*- # Flask-Diamond (c) Ian Dennis Miller from flask_restful import Api rest_api = Api() def init_rest(self, api_map=None): """ Initialize REST API. :returns: None By default, this function does nothing. Your application needs to overload this function in order to implemen...
mit
ProfessionalIT/maxigenios-website
sdk/google_appengine/lib/distutils/distutils/cygwinccompiler.py
63
17732
"""distutils.cygwinccompiler Provides the CygwinCCompiler class, a subclass of UnixCCompiler that handles the Cygwin port of the GNU C compiler to Windows. It also contains the Mingw32CCompiler class which handles the mingw32 port of GCC (same as cygwin in no-cygwin mode). """ # problems: # # * if you use a msvc com...
mit
bnoordhuis/suv
deps/gyp/test/hello/gyptest-regyp-output.py
202
1077
#!/usr/bin/env python # Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies that Makefiles get rebuilt when a source gyp file changes and --generator-output is used. """ import TestGyp # Regenerating b...
isc
simplegeo/sqlalchemy
lib/sqlalchemy/processors.py
18
3573
# processors.py # Copyright (C) 2010 Gaetan de Menten gdementen@gmail.com # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """defines generic type conversion functions, as used in bind and result processors. They all share one common ch...
mit
ismailsunni/inasafe
safe_extras/raven/contrib/django/utils.py
11
3176
""" raven.contrib.django.utils ~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import os from django.conf import settings def linebreak_iter(template_source): yield 0 ...
gpl-3.0
CiscoUcs/Ironic
ironic/drivers/modules/virtualbox.py
4
15349
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
apache-2.0
yashtrivedi96/coala-bears
tests/general/IndentationBearTest.py
9
9933
import unittest from queue import Queue from bears.general.IndentationBear import IndentationBear from bears.general.AnnotationBear import AnnotationBear from coalib.settings.Section import Section from coalib.settings.Setting import Setting from coalib.bearlib.languages import Language @Language class TestLanguage...
agpl-3.0
BlackPole/bp-enigma2
lib/python/Plugins/SystemPlugins/Videomode/plugin.py
2
9077
from Screens.Screen import Screen from Plugins.Plugin import PluginDescriptor from Components.SystemInfo import SystemInfo from Components.ConfigList import ConfigListScreen from Components.config import getConfigListEntry, config, ConfigBoolean, ConfigNothing, ConfigSlider from Components.Label import Label from Compo...
gpl-2.0
tiagocardosos/stoq
stoqlib/gui/wizards/stocktransferwizard.py
2
9677
# -*- coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 ## ## Copyright (C) 2007-2009 Async Open Source <http://www.async.com.br> ## All rights reserved ## ## This program 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 Softw...
gpl-2.0
Gwildor/Pyromancer
pyromancer/objects.py
1
14296
import datetime import importlib import io import re import select import socket import ssl import time from pyromancer import utils class Pyromancer(object): def __init__(self, settings_path): self.settings = Settings(settings_path) self.setup_database() self.find_commands() sel...
mit
datenbetrieb/odoo
addons/account_check_writing/account.py
379
2032
# -*- 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
jkettleb/iris
lib/iris/tests/unit/plot/test_pcolor.py
5
1533
# (C) British Crown Copyright 2014 - 2015, Met Office # # This file is part of Iris. # # Iris is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option) any l...
lgpl-3.0
plumgrid/plumgrid-nova
nova/tests/virt/libvirt/test_libvirt_blockinfo.py
1
21699
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2010 OpenStack Foundation # Copyright 2012 University Of Minho # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # ...
apache-2.0
eleftherioszisis/NeuroM
neurom/fst/tests/test_bifurcationfunc.py
2
3889
# Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project # All rights reserved. # # This file is part of NeuroM <https://github.com/BlueBrain/NeuroM> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are ...
bsd-3-clause
lindsayad/sympy
sympy/physics/optics/__init__.py
41
1239
__all__ = [] # The following pattern is used below for importing sub-modules: # # 1. "from foo import *". This imports all the names from foo.__all__ into # this module. But, this does not put those names into the __all__ of # this module. This enables "from sympy.physics.optics import TWave" to # work. # 2....
bsd-3-clause
josephsuh/extra-specs
nova/tests/api/openstack/test_xmlutil.py
14
25717
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack LLC. # 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/...
apache-2.0
gauribhoite/personfinder
env/google_appengine/lib/django-0.96/django/utils/simplejson/decoder.py
39
8853
""" Implementation of JSONDecoder """ import re from django.utils.simplejson.scanner import Scanner, pattern FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL def _floatconstants(): import struct import sys _BYTES = '7FF80000000000007FF0000000000000'.decode('hex') if sys.byteorder != 'big': _BYTE...
apache-2.0
PetrDlouhy/django
tests/utils_tests/test_datastructures.py
24
3999
""" Tests for stuff in django.utils.datastructures. """ import copy from django.test import SimpleTestCase from django.utils import six from django.utils.datastructures import ( DictWrapper, ImmutableList, MultiValueDict, MultiValueDictKeyError, OrderedSet, ) class OrderedSetTests(SimpleTestCase): def ...
bsd-3-clause
karlnapf/kameleon-mcmc
kameleon_mcmc/experiments/scripts/flower/flower.py
1
3224
""" 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. Written (W) 2013 Heiko Strathmann Written (W) 2013 Dino Sejdinovic """ fro...
bsd-2-clause
delta2323/chainer
tests/chainer_tests/serializers_tests/test_hdf5.py
3
14188
import os import sys import tempfile import unittest import mock import numpy from chainer import cuda from chainer import link from chainer import links from chainer import optimizers from chainer.serializers import hdf5 from chainer import testing from chainer.testing import attr if hdf5._available: import h5...
mit
pambot/SMSBeds
lib/flask/config.py
781
6234
# -*- coding: utf-8 -*- """ flask.config ~~~~~~~~~~~~ Implements the configuration related objects. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import imp import os import errno from werkzeug.utils import import_string from ._compat import string_type...
gpl-2.0
githubashto/userinfuser
serverside/testing/test.py
12
22252
# Copyright (C) 2011, CloudCaptive # # 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 i...
gpl-3.0
mccheung/kbengine
kbe/src/lib/python/Lib/test/test_email/test_inversion.py
120
1353
"""Test the parser and generator are inverses. Note that this is only strictly true if we are parsing RFC valid messages and producing RFC valid messages. """ import io import unittest from email import policy, message_from_bytes from email.generator import BytesGenerator from test.test_email import TestEmailBase, pa...
lgpl-3.0
M4rtinK/anaconda
tests/glade/check_invisible_char.py
6
1947
# # Copyright (C) 2015 Red Hat, Inc. # # This program 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 2.1 of the License, or # (at your option) any later version. # # This program is dis...
gpl-2.0
tylertian/Openstack
openstack F/horizon/horizon/tests/utils_tests.py
4
8380
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Nebula, 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 # # ...
apache-2.0
dhermes/google-cloud-python
core/google/cloud/_http.py
2
10621
# Copyright 2014 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 agreed to in writing, s...
apache-2.0
takaaptech/sky_engine
build/android/pylib/instrumentation/test_result.py
87
1102
# 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. from pylib.base import base_test_result class InstrumentationTestResult(base_test_result.BaseTestResult): """Result information for a single instrume...
bsd-3-clause
krzyzacy/test-infra
scenarios/kubernetes_bazel.py
1
9865
#!/usr/bin/env python # Copyright 2017 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
pagea/unstyle
resources_rc.py
1
81078
# -*- coding: utf-8 -*- # Resource object code # # Created: Sun Mar 29 15:48:06 2015 # by: The Resource Compiler for PyQt (Qt v5.3.0) # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore qt_resource_data = b"\ \x00\x00\x14\xc4\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\...
mit
Dandandan/wikiprogramming
jsrepl/build/extern/python/unclosured/lib/python2.7/fractions.py
252
22390
# Originally contributed by Sjoerd Mullender. # Significantly modified by Jeffrey Yasskin <jyasskin at gmail.com>. """Rational, infinite-precision, real numbers.""" from __future__ import division from decimal import Decimal import math import numbers import operator import re __all__ = ['Fraction', 'gcd'] Rational...
mit
tomaslaz/Analysis-Toolkit
thirdparty/JPype-0.5.4.2/src/python/jpype/reflect.py
8
2181
#***************************************************************************** # Copyright 2004-2008 Steve Menard # # 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...
gpl-3.0
vmturbo/nova
nova/tests/unit/consoleauth/test_consoleauth.py
2
10048
# Copyright 2012 OpenStack Foundation # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # #...
apache-2.0
dgellis90/nipype
nipype/interfaces/mrtrix/tests/test_auto_Tensor2ApparentDiffusion.py
12
1234
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from ....testing import assert_equal from ..preprocess import Tensor2ApparentDiffusion def test_Tensor2ApparentDiffusion_inputs(): input_map = dict(args=dict(argstr='%s', ), debug=dict(argstr='-debug', position=1, ), environ=dict(nohash=Tru...
bsd-3-clause
dot-cat/shp_platform
dpl/libs/shift_reg_gpio.py
2
6787
import logging import time from collections import namedtuple from dpl.libs.gpio_chooser import GPIO as GPIO from dpl.libs.abs_shift_reg import AbsShiftRegister logger = logging.getLogger(__name__) DELAY = 0.0 def pulse(pin): """ Дергаем пин: подаем сначала ноль, потом - единицу, потом опять ноль :par...
mit
ovilab/atomify-lammps
libs/lammps/tools/i-pi/ipi/tests/common.py
41
2834
"""Common helper functions for running the tests. Copyright (C) 2013, Joshua More and Michele Ceriotti 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 op...
gpl-3.0
microsoft/EconML
econml/tests/test_automated_ml.py
1
8600
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import unittest import pytest from sklearn.linear_model import LinearRegression, Lasso, \ LogisticRegression from sklearn.pipeline import Pipeline from sklearn.preprocessing import OneHotEncoder, FunctionTransformer, \ ...
mit
Open511/open511
open511/converter/o5json.py
1
5730
from open511.utils.serialization import NS_GML, NS_PROTECTED, NSMAP def _maybe_intify(t): return int(t) if hasattr(t, 'isdigit') and t.isdigit() else t def pluralize(s): return s[:-1] + 'ies' if s.endswith('phy') else s + 's' def xml_to_json(root): """Convert an Open511 XML document or document fragment ...
mit
openshift/openshift-tools
openshift_tools/cloud/gcp/pd_util.py
13
7367
#!/usr/bin/env python # vim: expandtab:tabstop=4:shiftwidth=4 """ This is a library that can identify OpenShift EBS volume types and return them. Usage: # Create Snapshots regions = gcp_snapshotter.PDSnapshotter.get_supported_regions(project, creds_path) for region in regions: # This example ...
apache-2.0
Federrico/pepe
bob/bio/spear/test/test_preprocessors.py
1
3098
#!/usr/bin/env python # vim: set fileencoding=utf-8 : # @author: Elie Khoury <Elie.Khoury@idiap.ch> # @date: Tue 9 Jun 23:10:43 CEST 2015 # # Copyright (C) 2011-2012 Idiap Research Institute, Martigny, Switzerland # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU ...
gpl-3.0
cooperlees/peerme
peerme/__init__.py
1
1746
#!/usr/bin/env python3 # # Made for the RIPE IXP Tools Hackathon # # BSD 2-Clause License # # Copyright (c) 2016, Cooper Lees # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributio...
bsd-2-clause
matthewlent/ng-boilerplate-flask
venv/lib/python2.7/site-packages/pip/commands/completion.py
538
1838
import sys from pip.basecommand import Command BASE_COMPLETION = """ # pip %(shell)s completion start%(script)s# pip %(shell)s completion end """ COMPLETION_SCRIPTS = { 'bash': """ _pip_completion() { COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \\ COMP_CWORD=$COMP_CWORD \\ ...
mit
Kazade/NeHe-Website
google_appengine/lib/django-1.2/django/db/backends/oracle/compiler.py
65
2732
from django.db.models.sql import compiler class SQLCompiler(compiler.SQLCompiler): def resolve_columns(self, row, fields=()): # If this query has limit/offset information, then we expect the # first column to be an extra "_RN" column that we need to throw # away. if self.query.high...
bsd-3-clause
pkappesser/youtube-dl
youtube_dl/extractor/khanacademy.py
128
2740
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( unified_strdate, ) class KhanAcademyIE(InfoExtractor): _VALID_URL = r'^https?://(?:(?:www|api)\.)?khanacademy\.org/(?P<key>[^/]+)/(?:[^/]+/){,2}(?P<id>[^?#/]+)(?:$|[?#])' IE_NAME = 'KhanAcademy' ...
unlicense
Savaged-Zen/Savaged-Zen-Speedy
tools/perf/scripts/python/sched-migration.py
185
11668
#!/usr/bin/python # # Cpu task migration overview toy # # Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com> # # perf trace event handlers have been generated by perf trace -g python # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free ...
gpl-2.0
bzennn/blog_flask
python/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/chardistribution.py
2755
9226
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
gpl-3.0
pafiedor/ruby_rhino
networkx/algorithms/link_analysis/tests/test_hits.py
79
2544
#!/usr/bin/env python from nose.tools import * from nose import SkipTest from nose.plugins.attrib import attr import networkx # Example from # A. Langville and C. Meyer, "A survey of eigenvector methods of web # information retrieval." http://citeseer.ist.psu.edu/713792.html class TestHITS: def setUp(self): ...
gpl-3.0
fmv1992/python-mode
pymode/libs/logilab-common-1.4.1/logilab/common/decorators.py
93
8868
# 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 General Public License as publ...
lgpl-3.0
russellhadley/coreclr
src/ToolBox/SOS/tests/testutils.py
43
5438
from __future__ import print_function import lldb import re import inspect import sys import os import importlib summary_file = '' fail_flag = '' failed = False def assertCommon(passed, fatal): global failed with open(summary_file, 'a+') as summary: print(bool(passed), file=summary) if (not ...
mit
alanquillin/myhvac_service
myhvac_service/cfg.py
2
1127
# Copyright (C) 2014 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2014 YAMAMOTO Takashi <yamamoto at valinux co jp> # # 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
FAForever/legacy-updater
updater/updateServer.py
1
1768
import logging from PySide.QtCore import SIGNAL, SLOT from PySide import QtNetwork from . import updateServerThread from . import createPatch class updateServer(QtNetwork.QTcpServer): # pragma: no cover def __init__(self, parent=None): super(updateServer, self).__init__(parent) self.logger = lo...
gpl-3.0
totolef/Sick-beard
lib/requests/packages/chardet2/euckrprober.py
63
1676
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
gpl-3.0
dannykopping/mysql-utilities
mysql-test/suite/experimental/t/t1.py
1
1858
# # Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. # # 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; version 2 of the License. # # This program is distributed in th...
gpl-2.0
andrewebdev/django-ostinato
ostinato/middleware.py
1
3686
# Orignal version taken from http://www.djangosnippets.org/snippets/186/ # Original author: udfalkso # Modified by: Shwagroo Team and Gun.io import sys import os import re import hotshot, hotshot.stats import tempfile import StringIO from django.conf import settings # Now for some debugging tools words_re = re.comp...
mit
Bachaco-ve/odoo
addons/account/wizard/account_reconcile_partner_process.py
385
5775
# -*- 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
rutsky/aiohttp
tests/test_classbasedview.py
3
1279
from unittest import mock import pytest from aiohttp import web from aiohttp.web_urldispatcher import View def test_ctor(): request = mock.Mock() view = View(request) assert view.request is request async def test_render_ok(): resp = web.Response(text='OK') class MyView(View): async de...
apache-2.0
topogram/topogram-miner
analyze_meme.py
2
17911
#!/usr/bin/env python # -*- coding: utf-8 -*- import os, csv, json from time import time import datetime from collections import Counter import networkx as nx import community import locale import lib.tweetminer as minetweet from lib.users import UserAPI from lib.nlp import NLPMiner from lib.mongo import MongoDB t0...
mit
s40523242/2016fallcp_hw
course/2016springgrouping.py
19
6663
# 這個分組程式由 Flask 網際程式修改而來 import math # 從 browser 導入 document 與 window # 主要是將特定字串送到新開的 window 內容中 from browser import document, window def optionaction(): # 最後傳回的字串為 out_string out_string = '''<!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html;charset=utf-8"> <title>分組程式</title> </...
agpl-3.0