repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
olasitarska/django
tests/invalid_models_tests/test_backend_specific.py
71
1912
# -*- encoding: utf-8 -*- from __future__ import unicode_literals from types import MethodType from django.core.checks import Error from django.db import connection, models from .base import IsolatedModelsTestCase class BackendSpecificChecksTests(IsolatedModelsTestCase): def test_check_field(self): ""...
bsd-3-clause
asagage/holocron-api
holocron_api/api/migrations/0002_auto_20150716_1859.py
3
2936
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from api.models import Program, Campaign def initial_program(apps, schema_editor): first_program = Program.objects.create(program_name = "General Business", program_d...
apache-2.0
moijes12/oh-mainline
mysite/profile/migrations/0081_portfolioentry_is_archived.py
17
17752
# This file is part of OpenHatch. # Copyright (C) 2010 OpenHatch, Inc. # # 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 License, or # (at your option) any later v...
agpl-3.0
dsfsdgsbngfggb/odoo
addons/l10n_lu/__openerp__.py
197
2804
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2011 Thamini S.à.R.L (<http://www.thamini.com>) # Copyright (C) 2011 ADN Consultants S.à...
agpl-3.0
lmazuel/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/vpn_client_root_certificate.py
9
2180
# 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
tmm1/home-assistant
homeassistant/components/media_player/__init__.py
5
14917
""" homeassistant.components.media_player ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Component to interface with various media players. """ import logging from homeassistant.components import discovery from homeassistant.helpers.entity import Entity from homeassistant.helpers.entity_component import EntityComponent from h...
mit
mileistone/test
utils/test/datasets/coco.py
1
18590
# -------------------------------------------------------- # Fast/er R-CNN # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- from datasets.imdb import imdb import datasets.ds_utils as ds_utils from fast_rcnn.config i...
mit
Hellowlol/HTPC-Manager
modules/couchpotato.py
4
15926
#!/usr/bin/env python # -*- coding: utf-8 -*- import cherrypy import htpc import requests from cherrypy.lib.auth2 import require, member_of import logging import hashlib from htpc.helpers import fix_basepath, get_image, striphttp, comp_table import json import os import re class Couchpotato(object): def __init__...
mit
ville-k/tensorflow
tensorflow/contrib/labeled_tensor/python/ops/sugar.py
174
4821
# 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
sirinyal/qualitybots
src/client_setup/mylogger.py
26
1796
#!/usr/bin/python2.6 # # Copyright 2010 Google 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 # # Unless required...
apache-2.0
jpwarren/holideck
requests/packages/chardet/jisfreq.py
323
47307
######################## 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...
mit
rschnapka/odoo
addons/l10n_uy/__init__.py
438
1070
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2011 Openerp.uy <openerp.uy@lists.launchpad.net> # Proyecto de Localización de OperERP para Uruguay # $Id$ # # This program i...
agpl-3.0
praetorian-inc/pentestly
modules/reporting/xml.py
1
1655
from recon.core.module import BaseModule from dicttoxml import dicttoxml from xml.dom.minidom import parseString import codecs import os class Module(BaseModule): meta = { 'name': 'XML Report Generator', 'author': 'Eric Humphries (@e2fsck) and Tim Tomes (@LaNMaSteR53)', 'version': 'v0.0.2'...
gpl-3.0
savi-dev/nova
nova/api/openstack/compute/contrib/aggregates.py
6
7955
# Copyright (c) 2012 Citrix Systems, 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 # # Unless ...
apache-2.0
fritsvanveen/QGIS
python/ext-libs/owslib/tms.py
22
11849
# -*- coding: UTF-8 -*- # ============================================================================= # Copyright (C) 2013 Christian Ledermann <christian.ledermann@gmail.com> # # Based on wms.py, which has the following copyright statement: # Copyright (c) 2004, 2006 Sean C. Gillies # Copyright (c) 2005 Nuxeo SARL <h...
gpl-2.0
micahcochran/geopandas
geopandas/tools/tests/test_sjoin.py
1
10287
from __future__ import absolute_import from distutils.version import LooseVersion import numpy as np import pandas as pd from shapely.geometry import Point, Polygon import geopandas from geopandas import GeoDataFrame, GeoSeries, read_file, base from geopandas import sjoin import pytest from pandas.util.testing impo...
bsd-3-clause
crackcell/www-entity-mining
people/stars/ent.sina.com.cn/crawler.py
1
2883
#!/usr/bin/env python # -*- encoding: utf-8; indent-tabs-mode: nil -*- """ crawler ~~~~~~~ desc :copyright: (c) 2015 Menglong TAN. """ import os import sys import re import urllib2 import time import BeautifulSoup import logging logger = logging.getLogger(__file__) logger.setLevel(logging.DEBUG) ch ...
bsd-3-clause
piniGitHUB/volatility
volatility/plugins/registry/shellbags.py
44
44120
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # Copyright (c) 2012 Jamie Levy (Gleeda) <jamie.levy@gmail.com> # # This file is part of Volatility. # # Volatility 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 Softw...
gpl-2.0
TFMV/veloce
classifier.py
1
4504
import pyspark from pyspark.mllib.regression import LabeledPoint from pyspark.mllib.classification import LogisticRegressionWithSGD from pyspark.mllib.tree import DecisionTree from pyspark import SparkContext from pyspark.sql import SQLContext ##If running through pyspark, start pyspark as follows: pyspark --pa...
mit
calamityman/ansible-modules-extras
cloud/webfaction/webfaction_site.py
62
6939
#!/usr/bin/python # # Create Webfaction website using Ansible and the Webfaction API # # ------------------------------------------ # # (c) Quentin Stafford-Fraser 2015 # # 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 Lic...
gpl-3.0
r-mart/scikit-learn
sklearn/cluster/mean_shift_.py
96
15434
"""Mean shift clustering algorithm. Mean shift clustering aims to discover *blobs* in a smooth density of samples. It is a centroid based algorithm, which works by updating candidates for centroids to be the mean of the points within a given region. These candidates are then filtered in a post-processing stage to elim...
bsd-3-clause
thekingofkings/focusread
libs/dns/rdtypes/dnskeybase.py
18
4387
# Copyright (C) 2004-2007, 2009-2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED "...
mit
kingvuplus/EGAMI-D
lib/python/Plugins/Extensions/TuxboxPlugins/pluginrunner.py
88
1164
from enigma import eDBoxLCD, eRCInput, fbClass, eConsoleAppContainer from Screens.Screen import Screen from Screens.MessageBox import MessageBox class PluginRunner(Screen): skin = """ <screen position="1,1" size="1,1" title="Plugin" > </screen>""" def __init__(self, session, pluginname, args = None): sel...
gpl-2.0
felipebetancur/scipy
scipy/integrate/setup.py
90
3250
#!/usr/bin/env python from __future__ import division, print_function, absolute_import from os.path import join from scipy._build_utils import numpy_nodepr_api def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration from numpy.distutils.system_info import get_...
bsd-3-clause
SickGear/SickGear
lib/html5lib/treewalkers/__init__.py
54
5719
"""A collection of modules for iterating through different kinds of tree, generating tokens identical to those produced by the tokenizer module. To create a tree walker for a new type of tree, you need to implement a tree walker object (called TreeWalker by convention) that implements a 'serialize' method which takes ...
gpl-3.0
mgadi/naemonbox
sources/psdash/Jinja2-2.4/jinja2/debug.py
212
9931
# -*- coding: utf-8 -*- """ jinja2.debug ~~~~~~~~~~~~ Implements the debug interface for Jinja. This module does some pretty ugly stuff with the Python traceback system in order to achieve tracebacks with correct line numbers, locals and contents. :copyright: (c) 2010 by the Jinja Team. :...
gpl-2.0
astropy/photutils
photutils/segmentation/tests/test_catalog.py
2
16257
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Tests for the catalog module. """ from copy import deepcopy import astropy.units as u from astropy.modeling.models import Gaussian2D from astropy.table import QTable from numpy.testing import assert_allclose, assert_equal import numpy as np import py...
bsd-3-clause
x2nie/odoo
addons/board/controllers.py
348
1970
# -*- coding: utf-8 -*- from xml.etree import ElementTree from openerp.addons.web.controllers.main import load_actions_from_ir_values from openerp.http import Controller, route, request class Board(Controller): @route('/board/add_to_dashboard', type='json', auth='user') def add_to_dashboard(self, menu_id, act...
agpl-3.0
Slater-Victoroff/scrapy
scrapy/commands/parse.py
108
8286
from __future__ import print_function import logging from w3lib.url import is_url from scrapy.commands import ScrapyCommand from scrapy.http import Request from scrapy.item import BaseItem from scrapy.utils import display from scrapy.utils.conf import arglist_to_dict from scrapy.utils.spider import iterate_spider_out...
bsd-3-clause
GheRivero/ansible
lib/ansible/plugins/inventory/foreman.py
16
8530
# -*- coding: utf-8 -*- # Copyright (C) 2016 Guido Günther <agx@sigxcpu.org>, Daniel Lobato Garcia <dlobatog@redhat.com> # Copyright (c) 2018 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __...
gpl-3.0
acenario/Payable
lib/python2.7/site-packages/django/template/utils.py
308
4736
import os import warnings from collections import Counter, OrderedDict from django.apps import apps from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils import lru_cache from django.utils._os import upath from django.utils.deprecation import RemovedInDjango110Warni...
mit
williamshowalter/PCAPTotal
PCAPTotal/Plugin.py
2
1105
""" tcpextract - pcap file extractor Copyright (C) 2012 https://www.abnorm.org/contact/ 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 yo...
gpl-3.0
bl4ckic3/polygraph
experiments/single_noise/atphttpd/run.py
2
1142
#!/usr/bin/env python # Polygraph (release 0.1) # Signature generation algorithms for polymorphic worms # # Copyright (c) 2004-2005, Intel Corporation # All Rights Reserved # # This software is distributed under the terms of the Eclipse Public # License, Version 1.0 which can be found in the file ...
epl-1.0
Innovahn/cybex
addons/hr_timesheet/hr_timesheet.py
291
10253
# -*- 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
spiceqa/tp-spice
spice/ovirt/tests_4x/user_portal_login.py
2
2110
#!/usr/bin/env python # -*- coding: utf-8 -*- # 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. # # This program is distr...
gpl-2.0
Forage/Gramps
gramps/gui/plug/tool.py
1
11556
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2005-2007 Donald N. Allingham # Copyright (C) 2010 Jakim Friant # Copyright (C) 2011 Paul Franklin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published...
gpl-2.0
integricho/heroku-buildpack-python-ffmpeg-lame
vendor/pip-1.2.1/tests/test_requirements.py
9
4151
import os.path import textwrap from pip.backwardcompat import urllib from pip.req import Requirements from tests.test_pip import reset_env, run_pip, write_file, pyversion, here, path_to_url from tests.local_repos import local_checkout from tests.path import Path def test_requirements_file(): """ Test installi...
mit
priyaganti/rockstor-core
src/rockstor/storageadmin/auth.py
2
1131
""" Copyright (c) 2012-2013 RockStor, Inc. <http://rockstor.com> This file is part of RockStor. RockStor 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 la...
gpl-3.0
silentfuzzle/calibre
src/calibre/ebooks/conversion/plugins/pml_output.py
24
3047
# -*- coding: utf-8 -*- __license__ = 'GPL 3' __copyright__ = '2009, John Schember <john@nachtimwald.com>' __docformat__ = 'restructuredtext en' import os, cStringIO from calibre.customize.conversion import (OutputFormatPlugin, OptionRecommendation) from calibre.ptempfile import TemporaryDirectory class PML...
gpl-3.0
bgxavier/nova
nova/virt/xenapi/firewall.py
61
4655
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright (c) 2010 Citrix Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in complianc...
apache-2.0
Fedik/gramps
gramps/plugins/lib/libprogen.py
4
84334
# -*- coding: utf-8 -*- # # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2008-2011 Kees Bakker # Copyright (C) 2008 Brian G. Matherly # Copyright (C) 2013-2017 Alois Poettker # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Publi...
gpl-2.0
ztemt/A465_5.1_kernel
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
shaufi/odoo
addons/hr_payroll_account/wizard/hr_payroll_payslips_by_employees.py
337
1728
# -*- 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
HousekeepLtd/django
tests/template_tests/filter_tests/test_timeuntil.py
161
4470
from __future__ import unicode_literals from datetime import datetime, timedelta from django.template.defaultfilters import timeuntil_filter from django.test import SimpleTestCase from django.test.utils import requires_tz_support from ..utils import setup from .timezone_utils import TimezoneTestCase class Timeunti...
bsd-3-clause
dfdx2/django
tests/forms_tests/field_tests/test_filefield.py
24
3932
import pickle from django.core.files.uploadedfile import SimpleUploadedFile from django.forms import FileField, ValidationError from django.test import SimpleTestCase class FileFieldTest(SimpleTestCase): def test_filefield_1(self): f = FileField() with self.assertRaisesMessage(ValidationError, "...
bsd-3-clause
vitan/hue
apps/impala/src/impala/models.py
30
3060
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
apache-2.0
tensorflow/addons
tensorflow_addons/image/tests/transform_ops_test.py
1
16494
# Copyright 2019 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
louietsai/python-for-android
python3-alpha/extra_modules/gdata/tlslite/Session.py
48
4736
"""Class representing a TLS session.""" from .utils.compat import * from .mathtls import * from .constants import * class Session: """ This class represents a TLS session. TLS distinguishes between connections and sessions. A new handshake creates both a connection and a session. Data is transm...
apache-2.0
mantidproject/mantid
scripts/Muon/GUI/Common/dummy_label/dummy_label_widget.py
3
1440
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + from...
gpl-3.0
aurelijusb/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_anydbm.py
99
2215
#! /usr/bin/env python """Test script for the anydbm module based on testdumbdbm.py """ import os import unittest import anydbm import glob from test import test_support _fname = test_support.TESTFN def _delete_files(): # we don't know the precise name the underlying database uses # so we use glob to loca...
apache-2.0
zouyapeng/horizon
openstack_dashboard/dashboards/project/images/images/tabs.py
89
1576
# 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 # # Unless required by applicable law or agree...
apache-2.0
ScatterHQ/eliot
eliot/_util.py
2
1871
""" Utilities that don't go anywhere else. """ from __future__ import unicode_literals import sys from types import ModuleType from six import exec_, text_type as unicode, PY3 def safeunicode(o): """ Like C{unicode()}, but catches and swallows any raised exceptions. @param o: An object of some sort. ...
apache-2.0
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/urllib3/util/wait.py
63
5403
import errno from functools import partial import select import sys try: from time import monotonic except ImportError: from time import time as monotonic __all__ = ["NoWayToWaitForSocketError", "wait_for_read", "wait_for_write"] class NoWayToWaitForSocketError(Exception): pass # How should we wait on ...
gpl-3.0
marionleborgne/nupic
examples/prediction/category_prediction/clean.py
9
1148
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
onceuponatimeforever/oh-mainline
vendor/packages/twisted/twisted/pair/test/test_ethernet.py
35
6684
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. # from twisted.trial import unittest from twisted.internet import protocol, reactor, error from twisted.python import failure, components from twisted.pair import ethernet, raw from zope.interface import implements class MyProtocol: implemen...
agpl-3.0
brandond/ansible
lib/ansible/plugins/action/package.py
30
3209
# (c) 2015, Ansible 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 your option) any later version. # # Ansible is di...
gpl-3.0
zzzombat/lucid-python-django
django/conf/locale/fr/formats.py
232
1530
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j F Y' TIME_FORMAT = 'H:i:s' DATETIME_FORMAT = 'j F Y H:i:s' YEAR_MONTH_F...
bsd-3-clause
neilpelow/wmap-django
venv/lib/python3.5/site-packages/django/contrib/gis/db/backends/base/models.py
33
6879
import re from django.contrib.gis import gdal from django.utils import six from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class SpatialRefSysMixin(object): """ The SpatialRefSysMixin is a class used by the database-dependent SpatialRefSys objects to reduce redu...
gpl-3.0
mpvoss/RickAndMortyWeatherTweets
env/lib/python3.5/site-packages/PIL/XVThumbImagePlugin.py
17
1959
# # 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...
mit
christophlsa/odoo
addons/hr_expense/__openerp__.py
263
2817
# -*- 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
le9i0nx/ansible
lib/ansible/modules/system/ping.py
18
2130
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2016, Toshio Kuratomi <tkuratomi@ansible.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass_...
gpl-3.0
markelg/xray
xray/test/test_formatting.py
6
3865
import numpy as np import pandas as pd from xray.core import formatting from xray.core.pycompat import PY3 from . import TestCase class TestFormatting(TestCase): def test_get_indexer_at_least_n_items(self): cases = [ ((20,), (slice(10),)), ((3, 20,), (0, slice(10))), ...
apache-2.0
proxysh/Safejumper-for-Desktop
buildlinux/env32/lib/python2.7/site-packages/twisted/test/test_htb.py
13
3190
# -*- Python -*- __version__ = '$Revision: 1.3 $'[11:-2] from twisted.trial import unittest from twisted.protocols import htb from .test_pcp import DummyConsumer class DummyClock: time = 0 def set(self, when): self.time = when def __call__(self): return self.time class SomeBucket(htb....
gpl-2.0
ojengwa/oh-mainline
vendor/packages/requests/requests/packages/chardet/langhungarianmodel.py
2763
12536
######################## 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...
agpl-3.0
nathanielvarona/airflow
tests/providers/google/cloud/operators/test_dlp.py
8
27989
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
onshape-public/onshape-clients
python/onshape_client/oas/models/bt_body_type_filter112.py
1
7225
# coding: utf-8 """ Onshape REST API The Onshape REST API consumed by all clients. # noqa: E501 The version of the OpenAPI document: 1.113 Contact: api-support@onshape.zendesk.com Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import re # noqa: F401 im...
mit
bioinformatics-ua/montra
emif/utils/updateNumericFieldValues.py
2
3144
# -*- coding: utf-8 -*- # Copyright (C) 2014 Universidade de Aveiro, DETI/IEETA, Bioinformatics Group - http://bioinformatics.ua.pt/ # # 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 vers...
gpl-3.0
alex/django-old
django/contrib/auth/tests/auth_backends.py
1
9965
import warnings from django.conf import settings from django.contrib.auth.models import User, Group, Permission, AnonymousUser from django.contrib.contenttypes.models import ContentType from django.test import TestCase class BackendTest(TestCase): backend = 'django.contrib.auth.backends.ModelBackend' def s...
bsd-3-clause
AICP/external_chromium_org
build/android/PRESUBMIT.py
10
1910
# Copyright (c) 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. """Presubmit script for android buildbot. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for details on the presubmit API b...
bsd-3-clause
krikru/tensorflow-opencl
tensorflow/examples/learn/wide_n_deep_tutorial.py
24
8941
# 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
40223134/40223134w17
static/Brython3.1.1-20150328-091302/Lib/_socket.py
742
6431
"""Implementation module for socket operations. See the socket module for documentation.""" AF_APPLETALK = 16 AF_DECnet = 12 AF_INET = 2 AF_INET6 = 23 AF_IPX = 6 AF_IRDA = 26 AF_SNA = 11 AF_UNSPEC = 0 AI_ADDRCONFIG = 1024 AI_ALL = 256 AI_CANONNAME = 2 AI_NUMERICHOST = 4 AI_NUMERICSERV = 8 AI_PASSIVE = 1...
gpl-3.0
alexteodor/odoo
addons/auth_openid/controllers/__init__.py
443
1033
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public L...
agpl-3.0
tltuan/coala
tests/results/ResultFilterTest.py
11
30608
import os import unittest from os.path import abspath from coalib.results.Diff import Diff from coalib.results.Result import RESULT_SEVERITY, Result from coalib.results.ResultFilter import ( filter_results, remove_range, remove_result_ranges_diffs) from coalib.results.SourceRange import SourceRange class...
agpl-3.0
scripnichenko/glance
glance/db/sqlalchemy/migrate_repo/versions/004_add_checksum.py
19
2878
# Copyright 2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
gpitel/pyjs
examples/misc/gaedjangononrelpuremvcblog/media/view.py
6
7554
""" By Scott Scites <scott.scites@railcar88.com> Copyright(c) 2010 Scott Scites, Some rights reserved. """ from puremvc.patterns.mediator import Mediator import model import Blog class HomeMediator(Mediator): NAME = "HomeMediator" post_remote_proxy = None def __init__(self, viewComponent): super...
apache-2.0
cnbin/mkdocs
mkdocs/utils/ghp_import.py
23
4897
#! /usr/bin/env python # # This file is part of the ghp-import package released under # the Tumbolia Public License. # Tumbolia Public License # Copyright 2013, Paul Davis <paul.joseph.davis@gmail.com> # Copying and distribution of this file, with or without modification, are # permitted i...
bsd-2-clause
DazWorrall/ansible-modules-extras
packaging/os/pkgin.py
69
6737
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2013 Shaun Zinck <shaun.zinck at gmail.com> # Copyright (c) 2015 Lawrence Leonard Gilbert <larry@L2G.to> # # Written by Shaun Zinck # Based on pacman module written by Afterburn <http://github.com/afterburn> # that was based on apt module written by Matthew Wi...
gpl-3.0
terbolous/CouchPotatoServer
libs/guessit/transfo/guess_movie_title_from_position.py
94
6628
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2012 Nicolas Wack <wackou@gmail.com> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free ...
gpl-3.0
Titulacion-Sistemas/PythonTitulacion-EV
Lib/site-packages/pywin32-219-py2.7-win32.egg/win32com/test/testAXScript.py
17
1266
# Test AXScripting the best we can in an automated fashion... import win32api, os, sys import win32com.axscript import win32com.axscript.client import unittest import win32com.test.util verbose = "-v" in sys.argv class AXScript(win32com.test.util.TestCase): def setUp(self): file = win32api.GetFullPathNa...
mit
MartynShaw/audacity
lib-src/lv2/sratom/waflib/TaskGen.py
177
11938
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import copy,re,os from waflib import Task,Utils,Logs,Errors,ConfigSet,Node feats=Utils.defaultdict(set) class task_gen(object): mappings={} prec=Utils.defaultdict(list) def...
gpl-2.0
willthames/ansible
lib/ansible/modules/network/asa/asa_config.py
43
12077
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
gravyboat/streamlink
src/streamlink_cli/argparser.py
2
37633
import argparse import numbers import re from string import printable from textwrap import dedent from streamlink import __version__ as streamlink_version, logger from streamlink.utils.args import ( boolean, comma_list, comma_list_filter, filesize, keyvalue, num ) from streamlink.utils.times import hours_minutes_s...
bsd-2-clause
leo524/7mos-fourm
node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py
2698
3270
#!/usr/bin/env python # 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. """ Unit tests for the easy_xml.py file. """ import gyp.easy_xml as easy_xml import unittest import StringIO class TestSequenceFunctions(...
gpl-3.0
abimannans/scikit-learn
sklearn/decomposition/factor_analysis.py
206
11946
"""Factor Analysis. A latent linear variable model. FactorAnalysis is similar to probabilistic PCA implemented by PCA.score While PCA assumes Gaussian noise with the same variance for each feature, the FactorAnalysis model assumes different variances for each of them. This implementation is based on David Barber's B...
bsd-3-clause
Edraak/edx-platform
common/lib/xmodule/xmodule/tabs.py
2
18923
""" Implement CourseTab """ from abc import ABCMeta import logging from xblock.fields import List from openedx.core.lib.api.plugins import PluginError log = logging.getLogger("edx.courseware") # Make '_' a no-op so we can scrape strings. Using lambda instead of # `django.utils.translation.ugettext_noop` because Dja...
agpl-3.0
kadashu/satori
satori-rules/plugin/libs/pymysql/constants/ER.py
122
12223
ERROR_FIRST = 1000 HASHCHK = 1000 NISAMCHK = 1001 NO = 1002 YES = 1003 CANT_CREATE_FILE = 1004 CANT_CREATE_TABLE = 1005 CANT_CREATE_DB = 1006 DB_CREATE_EXISTS = 1007 DB_DROP_EXISTS = 1008 DB_DROP_DELETE = 1009 DB_DROP_RMDIR = 1010 CANT_DELETE_FILE = 1011 CANT_FIND_SYSTEM_REC = 1012 CANT_GET_STAT = 1013 CANT_GET_WD = 1...
apache-2.0
dkarakats/edx-platform
lms/djangoapps/courseware/migrations/0007_allow_null_version_in_history.py
114
7638
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'StudentModuleHistory.version' db.alter_column('courseware_studentmodulehistory', 'version...
agpl-3.0
cloudbase/nova
nova/filters.py
24
5666
# Copyright (c) 2011-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 # # Un...
apache-2.0
DolphinDream/sverchok
nodes/surface/min_surface_from_curve.py
2
5675
import numpy as np from math import pi import bpy from bpy.props import FloatProperty, EnumProperty, BoolProperty, IntProperty from mathutils import Matrix import sverchok from sverchok.node_tree import SverchCustomTreeNode from sverchok.data_structure import updateNode, zip_long_repeat, ensure_nesting_level, get_da...
gpl-3.0
APTrust/EarthDiver
dpnode/dpn/client/apiclient.py
1
2153
import json from os.path import normpath from http.client import HTTPSConnection, HTTPConnection from urllib.parse import urlencode, urlparse class APIException(Exception): pass class APIClient: """ A basic client to query the DPN REST API. """ def __init__(self, url, api_token): self.set...
apache-2.0
CERT-Solucom/certitude
helpers/helpers.py
2
1884
#!/usr/bin/env python # -*- coding: UTF-8 -*- ''' CERTitude: the seeker of IOC Copyright (c) 2016 CERT-W Contact: cert@wavestone.com Contributors: @iansus, @nervous, @fschwebel CERTitude is under licence GPL-2.0: This program is free software; you can redistribute it and/or modify ...
gpl-2.0
teosz/servo
tests/wpt/web-platform-tests/tools/manifest/item.py
45
5827
import os from six.moves.urllib.parse import urljoin from abc import ABCMeta, abstractmethod, abstractproperty from .utils import from_os_path, to_os_path item_types = ["testharness", "reftest", "manual", "stub", "wdspec"] def get_source_file(source_files, tests_root, manifest, path): def make_new(): fr...
mpl-2.0
hmendozap/auto-sklearn
test/util/test_common.py
1
1264
# -*- encoding: utf-8 -*- from __future__ import print_function from functools import partial import os import unittest from autosklearn.util import set_auto_seed, get_auto_seed, del_auto_seed, \ check_pid class TestUtilsCommon(unittest.TestCase): _multiprocess_can_split_ = True def setUp(self): ...
bsd-3-clause
sudar/openchronos-ng
tools/urwid/curses_display.py
8
22008
#!/usr/bin/python # # Urwid curses output wrapper.. the horror.. # Copyright (C) 2004-2007 Ian Ward # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 ...
gpl-3.0
donspaulding/adspygoogle
examples/adspygoogle/adwords/v201306/basic_operations/delete_ad_group.py
3
2108
#!/usr/bin/python # # Copyright 2012 Google 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 # # Unless required b...
apache-2.0
ChanduERP/odoo
addons/payment_adyen/tests/test_adyen.py
378
4314
# -*- coding: utf-8 -*- from lxml import objectify import urlparse from openerp.addons.payment.models.payment_acquirer import ValidationError from openerp.addons.payment.tests.common import PaymentAcquirerCommon from openerp.addons.payment_adyen.controllers.main import AdyenController from openerp.osv.orm import exce...
agpl-3.0
Inspq/ansible
lib/ansible/modules/identity/sx5/sx5_client.py
1
16092
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, INSPQ Team SX5 # # This file is not 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 y...
gpl-3.0
avanov/django
tests/gis_tests/layermap/tests.py
12
14637
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os import unittest from copy import copy from decimal import Decimal from unittest import skipUnless from django.conf import settings from django.contrib.gis.gdal import HAS_GDAL from django.contrib.gis.geos import HAS_GEOS from django.db import c...
bsd-3-clause
kovidgoyal/kitty
kitty/layout/grid.py
1
12595
#!/usr/bin/env python # vim:fileencoding=utf-8 # License: GPLv3 Copyright: 2020, Kovid Goyal <kovid at kovidgoyal.net> from functools import lru_cache from itertools import repeat from math import ceil, floor from typing import ( Any, Callable, Dict, Generator, List, Optional, Sequence, Set, Tuple ) from kitty.bo...
gpl-3.0
mrquim/mrquimrepo
repo/plugin.video.netflix/resources/lib/NetflixCommon.py
4
5072
import xbmc from xbmcaddon import Addon import xbmcvfs import json from resources.lib.storage import PersistentStorage class Signals(object): PLAYBACK_INITIATED = 'playback_initiated' class NetflixCommon(object): """ Stuff shared between / used from service and addon""" def __init__(self, plugin_h...
gpl-2.0