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
hangzhang925/WhereHows
wherehows-etl/src/main/resources/jython/requests/packages/urllib3/poolmanager.py
154
9614
from __future__ import absolute_import import logging try: # Python 3 from urllib.parse import urljoin except ImportError: from urlparse import urljoin from ._collections import RecentlyUsedContainer from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool from .connectionpool import port_by_schem...
apache-2.0
duncan-r/SHIP
ship/tuflow/datafiles/datafileobject.py
1
19928
""" Summary: Used for accessing files that contain data and links to other files. contains a factory method that will select the correct concrete implementation of ADataFileObject for the user based on the contents of the DataFile variables given as a parameter. Contains the abstract ADataFileObj...
mit
b0ttl3z/SickRage
lib/oauthlib/oauth1/rfc5849/parameters.py
87
4949
# -*- coding: utf-8 -*- """ oauthlib.parameters ~~~~~~~~~~~~~~~~~~~ This module contains methods related to `section 3.5`_ of the OAuth 1.0a spec. .. _`section 3.5`: http://tools.ietf.org/html/rfc5849#section-3.5 """ from __future__ import absolute_import, unicode_literals try: from urlparse import urlparse, url...
gpl-3.0
yongshengwang/hue
desktop/core/ext-py/Pygments-1.3.1/pygments/__init__.py
56
2975
# -*- coding: utf-8 -*- """ Pygments ~~~~~~~~ Pygments is a syntax highlighting package written in Python. It is a generic syntax highlighter for general use in all kinds of software such as forum systems, wikis or other applications that need to prettify source code. Highlights are: * a ...
apache-2.0
primiano/blink-gitcs
Tools/Scripts/webkitpy/common/memoized_unittest.py
84
2595
# Copyright (c) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
Phasip/mc3p
test_plugins.py
2
9012
# This source file is part of mc3p, the Minecraft Protocol Parsing Proxy. # # Copyright (C) 2011 Matthew J. McGill # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License v2 as published by # the Free Software Foundation. # # This program is distrib...
gpl-2.0
rcharp/toyota-flask
numpy/numpy/distutils/command/config_compiler.py
250
4379
from __future__ import division, absolute_import, print_function from distutils.core import Command from numpy.distutils import log #XXX: Linker flags def show_fortran_compilers(_cache=[]): # Using cache to prevent infinite recursion if _cache: return _cache.append(1) from numpy.distutils.fcompiler i...
apache-2.0
djabber/Dashboard
bottle/dash/local/lib/pif-0.7/build/lib.linux-x86_64-2.7/pif/base.py
4
2602
__title__ = 'pif.base' __author__ = 'Artur Barseghyan' __copyright__ = 'Copyright (c) 2013 Artur Barseghyan' __license__ = 'GPL 2.0/LGPL 2.1' __all__ = ('BasePublicIPChecker', 'registry') import socket from pif.conf import get_setting from pif.exceptions import InvalidRegistryItemType class BasePublicIPChecker(objec...
mit
frouty/odoogoeen
addons/l10n_co/__openerp__.py
118
3032
# -*- encoding: utf-8 -*- ########################################################################### # Module Writen for OpenERP, Open Source Management Solution # All Rights Reserved ###############Credits###################################################### # Coded by: Alejandro Negrin anegrin@vauxoo.com, ...
agpl-3.0
AlbertoPeon/invenio
modules/bibupload/lib/batchuploader_regression_tests.py
6
12233
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2012 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) a...
gpl-2.0
colejohnson66/pyew
batch_example.py
19
4081
#!/usr/bin/python """ This is an example batch script for Pyew. It uses many APIs exported by Pyew like getBytes, getMnems, disasm, getBuffer or hexdump. """ import os import sys import time import hashlib from pyew_core import CPyew def printData(pyew, path, msg): buf = pyew.getBuffer() print "File :...
gpl-2.0
icomfort/anaconda
isys/isys.py
1
20114
# # isys.py - installer utility functions and glue for C module # # Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Red Hat, Inc. # 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 Soft...
gpl-2.0
Limags/MissionPlanner
Lib/Cookie.py
42
26675
#!/usr/bin/env python # #### # Copyright 2000 by Timothy O'Malley <timo@alum.mit.edu> # # All Rights Reserved # # Permission to use, copy, modify, and distribute this software # and its documentation for any purpose and without fee is hereby # granted, provided that the above copyright notice ...
gpl-3.0
ehashman/oh-mainline
vendor/packages/oauthlib/oauthlib/oauth2/rfc6749/clients/base.py
36
20354
# -*- coding: utf-8 -*- """ oauthlib.oauth2.rfc6749 ~~~~~~~~~~~~~~~~~~~~~~~ This module is an implementation of various logic needed for consuming OAuth 2.0 RFC6749. """ from __future__ import absolute_import, unicode_literals import time from oauthlib.common import generate_token from oauthlib.oauth2.rfc6749 import...
agpl-3.0
salguarnieri/intellij-community
python/lib/Lib/xml/etree/ElementPath.py
189
6066
# # ElementTree # $Id: ElementPath.py 1858 2004-06-17 21:31:41Z Fredrik $ # # limited xpath support for element trees # # history: # 2003-05-23 fl created # 2003-05-28 fl added support for // etc # 2003-08-27 fl fixed parsing of periods in element names # # Copyright (c) 2003-2004 by Fredrik Lundh. All rights re...
apache-2.0
divio/django-filer
tests/settings.py
2
1740
import os from tempfile import mkdtemp BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) HELPER_SETTINGS = { 'NOSE_ARGS': [ '-s', ], 'ROOT_URLCONF': 'tests.utils.urls', 'INSTALLED_APPS': [ 'easy_thumbnails', 'mptt', 'filer', 'tests.utils.te...
bsd-3-clause
Karuji/Renamer
osnav.py
1
1922
import os def dir(): """An attempted to replicate the command line dir function for navigation.""" print(os.getcwd()) print() dirList = os.listdir(os.getcwd()) for i in dirList: print(i) def cd(string): """An attempted to replicate the command line cd function for navigation.""" if...
mit
sivaprakashniet/push_pull
p2p/lib/python2.7/site-packages/django/contrib/gis/admin/options.py
42
5439
from django.contrib.admin import ModelAdmin from django.contrib.gis.admin.widgets import OpenLayersWidget from django.contrib.gis.db import models from django.contrib.gis.gdal import HAS_GDAL, OGRGeomType class GeoModelAdmin(ModelAdmin): """ The administration options class for Geographic models. Map settings...
bsd-3-clause
alexmorozov/django
django/utils/version.py
14
2448
from __future__ import unicode_literals import datetime import os import subprocess from django.utils.lru_cache import lru_cache def get_version(version=None): "Returns a PEP 440-compliant version number from VERSION." version = get_complete_version(version) # Now build the two parts of the version num...
bsd-3-clause
Yen-Chung-En/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/getopt.py
845
7488
"""Parser for command line options. This module helps scripts to parse the command line arguments in sys.argv. It supports the same conventions as the Unix getopt() function (including the special meanings of arguments of the form `-' and `--'). Long options similar to those supported by GNU software may be used as ...
gpl-3.0
Debian/dak
dak/make_changelog.py
1
14163
#! /usr/bin/env python3 """ Generate changelog entry between two suites @contact: Debian FTP Master <ftpmaster@debian.org> @copyright: 2010 Luca Falavigna <dktrkranz@debian.org> @license: GNU General Public License version 2 or later """ # This program is free software; you can redistribute it and/or modify # it und...
gpl-2.0
teltek/edx-platform
cms/djangoapps/contentstore/tests/test_signals.py
18
1542
import ddt from mock import patch, Mock from cms.djangoapps.contentstore.signals.handlers import ( GRADING_POLICY_COUNTDOWN_SECONDS, handle_grading_policy_changed ) from student.models import CourseEnrollment from student.tests.factories import UserFactory from xmodule.modulestore.tests.django_utils import Mod...
agpl-3.0
dandb/hacklog
hacklog/entities.py
1
3730
from sqlalchemy import * from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker from datetime import date, datetime from session import Session db = None Base = declarative_base() def enum(**enums): return type('Enum', (), enums) def create_db_engine(server): global ...
gpl-3.0
jsg7440/MainPage
node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py
2736
6387
# 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. """Visual Studio project reader/writer.""" import gyp.common import gyp.easy_xml as easy_xml #-------------------------------------------------------------------...
mit
vitan/hue
apps/pig/src/pig/urls.py
33
1400
#!/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
TheWardoctor/Wardoctors-repo
script.video.F4mProxy/lib/f4mUtils/asn1parser.py
206
1191
# Author: Trevor Perrin # Patch from Google adding getChildBytes() # # See the LICENSE file for legal information regarding use of this file. """Class for parsing ASN.1""" from .compat import * from .codec import * #Takes a byte array which has a DER TLV field at its head class ASN1Parser(object): def __init__(se...
apache-2.0
ted-gould/nova
nova/tests/unit/conductor/tasks/test_live_migrate.py
19
21605
# 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 # d...
apache-2.0
lino-framework/xl
lino_xl/lib/contacts/fixtures/demo.py
1
10251
# -*- coding: UTF-8 -*- # Copyright 2009-2020 Rumma & Ko Ltd # License: GNU Affero General Public License v3 (see file COPYING for details) from django.conf import settings from lino.utils.instantiator import Instantiator from lino.utils import Cycler from lino.api import dd, rt from lino.utils.demonames.bel import s...
bsd-2-clause
alxgu/ansible
lib/ansible/module_utils/network/ios/providers/providers.py
114
3943
# # (c) 2019, Ansible by Red Hat, inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # import json from threading import RLock from ansible.module_utils.six import itervalues from ansible.module_utils.network.common.utils import to_list from ansible.module_utils.network.c...
gpl-3.0
steynovich/ansible-modules-extras
network/citrix/netscaler.py
143
5056
#!/usr/bin/python # -*- coding: utf-8 -*- """ Ansible module to manage Citrix NetScaler entities (c) 2013, Nandor Sivok <nandor@gawker.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 Softwa...
gpl-3.0
Spiderlover/Toontown
toontown/building/DistributedToonInterior.py
3
8275
import cPickle import random import ToonInterior import ToonInteriorColors from direct.directnotify import DirectNotifyGlobal from direct.distributed import DistributedObject from direct.distributed.ClockDelta import * from direct.fsm import ClassicFSM, State from direct.fsm import State from direct.interval.IntervalG...
mit
arowla/csvkit
csvkit/grep.py
21
4418
#!/usr/bin/env python import six from csvkit.exceptions import ColumnIdentifierError class FilteringCSVReader(six.Iterator): """ Given any row iterator, only return rows which pass the filter. If 'header' is False, then all rows must pass the filter; by default, the first row will be passed through u...
mit
tysonclugg/django
tests/backends/oracle/test_creation.py
41
4192
import unittest from io import StringIO from unittest import mock from django.db import connection from django.db.backends.oracle.creation import DatabaseCreation from django.db.utils import DatabaseError from django.test import TestCase @unittest.skipUnless(connection.vendor == 'oracle', 'Oracle tests') @mock.patch...
bsd-3-clause
vlegoff/OpenWeatherMapPlugin
globalPlugins/OpenWeatherMap/fetcher.py
1
1051
# -*-coding:Utf-8 -* """Fetcher used to regularly retrieve information from the OWM API. @author: Vincent Le Goff <vincent.legoff.srs@gmail.com> @copyright: 2014 LE GOFF Vincent @license: GNU General Public License version 2.0 """ import threading import time from logHandler import log from tinyowm import Client ...
agpl-3.0
bpsinc-native/src_third_party_scons-2.0.1
engine/SCons/Tool/gfortran.py
61
2302
"""SCons.Tool.gfortran Tool-specific initialization for gfortran, the GNU Fortran 95/Fortran 2003 compiler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 200...
mit
horance-liu/tensorflow
tensorflow/contrib/linear_optimizer/python/ops/sdca_ops.py
2
20950
# 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
graemian/ami-mooc-pilot
models/counters.py
18
1912
# 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 by applicable law or ...
apache-2.0
drxaero/calibre
src/calibre/gui2/dialogs/match_books.py
13
8252
#!/usr/bin/env python2 # vim:fileencoding=utf-8 from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2013, Kovid Goyal kovid@kovidgoyal.net' __docformat__ = 'restructuredtext en' from PyQt5.Qt import (Qt, QDialog, QAbs...
gpl-3.0
sjsucohort6/openstack
python/venv/lib/python2.7/site-packages/neutronclient/v2_0/client.py
1
72005
# Copyright 2012 OpenStack Foundation. # Copyright 2015 Hewlett-Packard Development Company, L.P. # 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 # # ht...
mit
happyleavesaoc/home-assistant
homeassistant/components/switch/tellstick.py
9
2195
""" Support for Tellstick switches. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/switch.tellstick/ """ import voluptuous as vol from homeassistant.components.tellstick import (DEFAULT_SIGNAL_REPETITIONS, ...
apache-2.0
jdowner/qtile
libqtile/layout/columns.py
3
13782
# 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, distribute, sublicense, and/or sell # copi...
mit
DiptoDas8/Biponi
lib/python2.7/site-packages/django/contrib/admin/options.py
66
84355
import copy import operator import warnings from collections import OrderedDict from functools import partial, reduce, update_wrapper from django import forms from django.conf import settings from django.contrib import messages from django.contrib.admin import helpers, validation, widgets from django.contrib.admin.che...
mit
mF2C/COMPSs
compss/programming_model/bindings/python/src/pycompss/runtime/core_element.py
1
3065
#!/usr/bin/python # # Copyright 2002-2019 Barcelona Supercomputing Center (www.bsc.es) # # 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
Dandandan/wikiprogramming
jsrepl/build/extern/python/unclosured/lib/python2.7/xml/dom/minicompat.py
209
3330
"""Python version compatibility support for minidom.""" # This module should only be imported using "import *". # # The following names are defined: # # NodeList -- lightest possible NodeList implementation # # EmptyNodeList -- lightest possible NodeList that is guaranteed to # remain empty...
mit
piffey/ansible
lib/ansible/modules/cloud/amazon/aws_batch_compute_environment.py
76
16653
#!/usr/bin/python # Copyright (c) 2017 Jon Meran <jonathan.meran@sonos.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTAT...
gpl-3.0
mbauskar/internal-hr
erpnext/patches/repair_tools/fix_naming_series_records_lost_by_reload.py
36
8508
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe import json import re from frappe.model.naming import make_autoname from frappe.utils import cint from frappe.utils.email_lib import se...
agpl-3.0
Beauhurst/django
tests/check_framework/test_multi_db.py
71
1674
from unittest import mock from django.db import connections, models from django.test import TestCase from django.test.utils import isolate_apps, override_settings class TestRouter: """ Routes to the 'other' database if the model name starts with 'Other'. """ def allow_migrate(self, db, app_label, mod...
bsd-3-clause
baroquebobcat/pants
contrib/go/src/python/pants/contrib/go/subsystems/fetcher.py
14
5607
# coding=utf-8 # Copyright 2016 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import logging from ...
apache-2.0
rjfellman/molecule
molecule/cli.py
1
2670
# Copyright (c) 2015-2016 Cisco Systems # # 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, publ...
mit
EdLogan18/logan-repository
plugin.video.listamisterwil/keepalive.py
333
19919
# 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 of the License, or (at your option) any later version. # # This library is distributed in the hope that it w...
gpl-2.0
JuliBakagianni/META-SHARE
misc/tools/generateDS-2.7a/tests/simplecontent_restriction1_sub.py
7
6077
#!/usr/bin/env python # # Generated by generateDS.py. # import sys import simplecontent_restriction2_sup as supermod etree_ = None Verbose_import_ = False ( XMLParser_import_none, XMLParser_import_lxml, XMLParser_import_elementtree ) = range(3) XMLParser_import_library = None try: # lxml from lxm...
bsd-3-clause
apporc/neutron
neutron/tests/unit/extensions/test_address_scope.py
26
17910
# Copyright (c) 2015 Red Hat, 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 ...
apache-2.0
iglpdc/nipype
nipype/testing/decorators.py
10
2275
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """ Extend numpy's decorators to use nipype's gui and data labels. """ from numpy.testing.decorators import * from nibabel.data import DataError def make_label_dec(label, ds=None): """Factory functi...
bsd-3-clause
wpgallih/servo
python/mach/mach/base.py
22
3492
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from __future__ import unicode_literals class CommandContext(object): """Holds run-time state so it can easily be ...
mpl-2.0
tapomayukh/projects_in_python
classification/Classification_with_HMM/Single_Contact_Classification/Variable_Stiffness_Variable_Velocity/HMM/with 0.8s/hmm_crossvalidation_force_10_states.py
1
27332
# Hidden Markov Model Implementation import pylab as pyl import numpy as np import matplotlib.pyplot as pp #from enthought.mayavi import mlab import scipy as scp import scipy.ndimage as ni import roslib; roslib.load_manifest('sandbox_tapo_darpa_m3') import rospy #import hrl_lib.mayavi2_util as mu import hrl_lib.viz ...
mit
town-hall-pinball/project-alpha-mpf
scriptlets/kickback.py
2
1617
# Copyright (c) 2014 - 2015 townhallpinball.org # # 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, p...
mit
dulems/hue
desktop/core/ext-py/urllib2_kerberos-0.1.6/setup.py
41
1651
# Copyright 2008 Lime Nest LLC # Copyright 2008 Lime Spot 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...
apache-2.0
leechor/vnpy
vn.event/eventEngine.py
2
6654
# encoding: UTF-8 # 系统模块 from Queue import Queue, Empty from threading import Thread # 第三方模块 from PyQt4.QtCore import QTimer # 自己开发的模块 from eventType import * ######################################################################## class EventEngine: """ 事件驱动引擎 事件驱动引擎中所有的变量都设置为了私有,这是为了防止不小心 从外部修改了...
mit
postlund/home-assistant
tests/components/radarr/test_sensor.py
1
15349
"""The tests for the Radarr platform.""" import unittest import pytest import homeassistant.components.radarr.sensor as radarr from homeassistant.const import DATA_GIGABYTES from tests.common import get_test_home_assistant def mocked_exception(*args, **kwargs): """Mock exception thrown by requests.get.""" ...
apache-2.0
Russell-IO/ansible
hacking/return_skeleton_generator.py
118
3279
#!/usr/bin/env python # (c) 2017, Will Thames <will@thames.id.au> # # 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 op...
gpl-3.0
py4n6/aff4
scons-local-1.2.0/SCons/Tool/sgilink.py
12
2096
"""SCons.Tool.sgilink Tool-specific initialization for the SGI MIPSPro linker on SGI. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCon...
gpl-3.0
fabioticconi/scikit-learn
sklearn/manifold/isomap.py
50
7515
"""Isomap for manifold learning""" # Author: Jake Vanderplas -- <vanderplas@astro.washington.edu> # License: BSD 3 clause (C) 2011 import numpy as np from ..base import BaseEstimator, TransformerMixin from ..neighbors import NearestNeighbors, kneighbors_graph from ..utils import check_array from ..utils.graph import...
bsd-3-clause
CulturePlex/pybossa
test/test_admin.py
1
31501
# -*- coding: utf8 -*- # This file is part of PyBossa. # # Copyright (C) 2013 SF Isle of Man Limited # # PyBossa 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...
agpl-3.0
habanero-rice/cnc-framework
tools/cncframework/inverse.py
1
7183
from itertools import chain from sympy import Symbol, solve, Piecewise from sympy.core import sympify import cncframework.events.actions as actions def tag_expr(tag, out_var): """Return out_var = tag as a SymPy expression.""" # since sympify will automatically equate to zero, we convert it to: # tag_expr...
bsd-3-clause
ns950/calibre
src/calibre/gui2/tweak_book/editor/snippets.py
14
26439
#!/usr/bin/env python2 # vim:fileencoding=utf-8 from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>' import re, copy, weakref from collections import OrderedDict, namedtuple fro...
gpl-3.0
openstack/neutron
neutron/tests/fullstack/test_agent_bandwidth_report.py
2
9747
# Copyright 2018 Ericsson # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
apache-2.0
anthonyjpesce/django-calaccess-raw-data
setup.py
2
1355
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup setup( name='django-calaccess-raw-data', version='0.2.2', packages=( 'calaccess_raw', 'calaccess_raw.admin', 'calaccess_raw.management', 'calaccess_raw.management.commands', 'calaccess_raw.mo...
mit
TheMOOCAgency/edx-platform
common/djangoapps/terrain/stubs/http.py
4
8699
""" Stub implementation of an HTTP service. """ from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler from SocketServer import ThreadingMixIn import urllib import urlparse import threading import json from functools import wraps from lazy import lazy from logging import getLogger LOGGER = getLogger(__name__) ...
agpl-3.0
major91/HTC_X515E_major-kernel
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
cpcloud/PyTables
bench/deep-tree-h5py.py
1
3374
import os, subprocess, gc from time import time import random import numpy import h5py random.seed(2) def show_stats(explain, tref): "Show the used memory (only works for Linux 2.6.x)." # Build the command to obtain memory info cmd = "cat /proc/%s/status" % os.getpid() sout = subprocess.Popen(cmd, she...
bsd-3-clause
ChemSem/cclib
test/data/testCI.py
5
6228
# This file is part of cclib (http://cclib.github.io), a library for parsing # and interpreting the results of computational chemistry packages. # # Copyright (C) 2007,2008,2012,2014,2015, the cclib development team # # The library is free software, distributed under the terms of # the GNU Lesser General Public version...
lgpl-2.1
Jollytown/Garuda
server/garuda/lib/python2.7/site-packages/pip/_vendor/html5lib/filters/whitespace.py
1730
1142
from __future__ import absolute_import, division, unicode_literals import re from . import _base from ..constants import rcdataElements, spaceCharacters spaceCharacters = "".join(spaceCharacters) SPACES_REGEX = re.compile("[%s]+" % spaceCharacters) class Filter(_base.Filter): spacePreserveElements = frozenset...
mit
rsjohnco/rez
src/rezgui/objects/ProcessTrackerThread.py
3
3301
from rezgui.qt import QtCore from threading import Lock import time class ProcessTrackerThread(QtCore.QThread): instanceCountChanged = QtCore.Signal(int, str, int) def __init__(self, parent=None): super(ProcessTrackerThread, self).__init__(parent) self.processes = {} self.proc_list =...
gpl-3.0
nathanielvarona/airflow
airflow/migrations/versions/8504051e801b_xcom_dag_task_indices.py
10
1323
# # 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
smallyear/linuxLearn
salt/salt/utils/gzip_util.py
3
1745
# -*- coding: utf-8 -*- ''' salt.utils.gzip ~~~~~~~~~~~~~~~ Helper module for handling gzip consistently between 2.7+ and 2.6- ''' from __future__ import absolute_import # Import python libs import gzip # Import 3rd-party libs from salt.ext.six.moves import StringIO # pylint: disable=import-error clas...
apache-2.0
personalrobotics/prpy
src/prpy/simulation/__init__.py
3
1661
#!/usr/bin/env python # Copyright (c) 2013, Carnegie Mellon University # All rights reserved. # Authors: Michael Koval <mkoval@cs.cmu.edu> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # - Redistributions of sourc...
bsd-3-clause
BonexGu/Blik2D-SDK
Blik2D/addon/tensorflow-1.2.1_for_blik/tensorflow/contrib/framework/python/framework/experimental_test.py
112
2237
# 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
boberfly/gaffer
python/GafferImageTest/DeleteChannelsTest.py
8
7101
########################################################################## # # Copyright (c) 2013-2015, 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: # # * Redi...
bsd-3-clause
Argon-Zhou/django
tests/admin_utils/models.py
107
1712
from django.db import models from django.utils import six from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Site(models.Model): domain = models.CharField(max_length=100) def __str__(self): return self.domain class Article(models.Model): """ A s...
bsd-3-clause
lanfker/tdma_imac
.waf-1.6.7-0a94702c61504c487a251b8d0a04ca9a/waflib/Tools/errcheck.py
3
5335
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/svn/docs/wafbook/single.html#_obtaining_the_waf_file import sys if sys.hexversion < 0x020400f0: from sets import Set as set typos={'feature':'features','sources':'source','targets':'target','include':'includes','export_include':...
gpl-2.0
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/host/lib/python2.7/lib-tk/test/test_tkinter/test_geometry_managers.py
26
40501
import unittest import re import Tkinter as tkinter from Tkinter import TclError from test.test_support import requires, run_unittest from test_ttk.support import pixels_conv, tcl_version, requires_tcl from widget_tests import AbstractWidgetTest, int_round requires('gui') class PackTest(AbstractWidgetTest, unittest...
gpl-2.0
matus-stehlik/roots
schools/admin.py
3
1101
from django.contrib import admin import reversion from base.admin import PrettyFilterMixin from .models import Address, School class AddressAdmin(PrettyFilterMixin, reversion.VersionAdmin): list_display = ( 'street', 'city', 'region', ) list_filter = ( 'city', '...
mit
was4444/chromium.src
third_party/WebKit/Tools/Scripts/webkitpy/common/config/irc.py
69
1467
# Copyright (c) 2013 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
q1ang/scikit-learn
sklearn/feature_selection/variance_threshold.py
238
2594
# Author: Lars Buitinck <L.J.Buitinck@uva.nl> # License: 3-clause BSD import numpy as np from ..base import BaseEstimator from .base import SelectorMixin from ..utils import check_array from ..utils.sparsefuncs import mean_variance_axis from ..utils.validation import check_is_fitted class VarianceThreshold(BaseEstim...
bsd-3-clause
orlov-vo/mtasa
vendor/google-breakpad/src/third_party/protobuf/protobuf/gtest/test/gtest_nc_test.py
277
3758
#!/usr/bin/env python # # Copyright 2007, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
gpl-3.0
TathagataChakraborti/resource-conflicts
PLANROB-2015/py2.5/lib/python2.5/ftplib.py
91
27435
"""An FTP client class and some helper functions. Based on RFC 959: File Transfer Protocol (FTP), by J. Postel and J. Reynolds Example: >>> from ftplib import FTP >>> ftp = FTP('ftp.python.org') # connect to host, default port >>> ftp.login() # default, i.e.: user anonymous, passwd anonymous@ '230 Guest login ok, ac...
mit
Innovahn/odoo.old
addons/website/models/res_config.py
105
2526
from openerp.osv import fields, osv class website_config_settings(osv.osv_memory): _name = 'website.config.settings' _inherit = 'res.config.settings' _columns = { 'website_id': fields.many2one('website', string="website", required=True), 'language_ids': fields.related('website_id', 'lang...
agpl-3.0
DirtyPiece/dancestudio
Build/Tools/Python27/Lib/test/test_codeop.py
82
7648
""" Test cases for codeop.py Nick Mathewson """ import unittest from test.test_support import run_unittest, is_jython from codeop import compile_command, PyCF_DONT_IMPLY_DEDENT if is_jython: import sys import cStringIO def unify_callables(d): for n,v in d.items(): if callable(v)...
mit
postvakje/sympy
sympy/physics/vector/tests/test_point.py
40
3940
from sympy.physics.vector import dynamicsymbols, Point, ReferenceFrame from sympy.utilities.pytest import raises def test_point_v1pt_theorys(): q, q2 = dynamicsymbols('q q2') qd, q2d = dynamicsymbols('q q2', 1) qdd, q2dd = dynamicsymbols('q q2', 2) N = ReferenceFrame('N') B = ReferenceFrame('B') ...
bsd-3-clause
youprofit/shogun
tests/integration/python_modular/classifier.py
21
4912
""" Test Classifier """ from numpy import double from modshogun import BinaryLabels from modshogun import * from modshogun import * from modshogun import * import util def _get_machine (indata, prefix, feats): if indata[prefix+'type']=='kernel': pre='kernel_' kargs=util.get_args(indata, pre) kfun=eval(indata[...
gpl-3.0
emonty/ansible
test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/module_utils/network/vyos/facts/lag_interfaces/lag_interfaces.py
47
5251
# # -*- coding: utf-8 -*- # Copyright 2019 Red Hat # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) """ The vyos lag_interfaces fact class It is in this file the configuration is collected from the device for a given resource, parsed, and the facts tree is populated based o...
gpl-3.0
stopstalk/stopstalk-deployment
private/scripts/populate-atcoder-problems.py
1
1810
""" Copyright (c) 2015-2020 Raj Patel(raj454raj@gmail.com), StopStalk 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 ...
mit
dya2/python-for-android
python-modules/twisted/twisted/internet/test/test_posixbase.py
56
12464
# Copyright (c) 2009-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.internet.posixbase} and supporting code. """ from twisted.python.compat import set from twisted.trial.unittest import TestCase from twisted.internet.defer import Deferred from twisted.internet.posixbase import Po...
apache-2.0
XileForce/Vindicator
tools/perf/scripts/python/net_dropmonitor.py
2669
1738
# Monitor the system for dropped packets and proudce a report of drop locations and counts import os import sys sys.path.append(os.environ['PERF_EXEC_PATH'] + \ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') from perf_trace_context import * from Core import * from Util import * drop_log = {} kallsyms = [] def...
gpl-2.0
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/lib2to3/fixes/fix_renames.py
326
2218
"""Fix incompatible renames Fixes: * sys.maxint -> sys.maxsize """ # Author: Christian Heimes # based on Collin Winter's fix_import # Local imports from .. import fixer_base from ..fixer_util import Name, attr_chain MAPPING = {"sys": {"maxint" : "maxsize"}, } LOOKUP = {} def alternates(members): re...
gpl-3.0
IllusionRom-deprecated/android_platform_tools_idea
plugins/hg4idea/testData/bin/hgext/share.py
90
2341
# Copyright 2006, 2007 Matt Mackall <mpm@selenic.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. '''share a common history between several working directories''' from mercurial.i18n import _ from mercurial import hg, command...
apache-2.0
soldag/home-assistant
tests/components/openalpr_cloud/test_image_processing.py
13
6882
"""The tests for the openalpr cloud platform.""" import asyncio from homeassistant.components import camera, image_processing as ip from homeassistant.components.openalpr_cloud.image_processing import OPENALPR_API_URL from homeassistant.core import callback from homeassistant.setup import setup_component from tests.a...
apache-2.0
eggla/LA-glazed
sites/all/libraries/openlayers3/closure-library/closure/bin/build/jscompiler_test.py
43
3933
#!/usr/bin/env python # # Copyright 2013 The Closure Library 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 ...
gpl-2.0
donspaulding/adspygoogle
examples/adspygoogle/adwords/v201302/basic_operations/add_keywords.py
1
2787
#!/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
MIPS/external-chromium_org
chrome/test/nacl_test_injection/buildbot_chrome_nacl_stage.py
24
10036
#!/usr/bin/python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Do all the steps required to build and test against nacl.""" import optparse import os.path import re import shutil import subproc...
bsd-3-clause