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
TeslaProject/external_chromium_org
tools/json_schema_compiler/cpp_util_test.py
96
2096
#!/usr/bin/env 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. import unittest from cpp_util import ( Classname, CloseNamespace, GenerateIfndefName, OpenNamespace) class CppUtilTest(unitte...
bsd-3-clause
tmhm/scikit-learn
sklearn/base.py
79
17441
"""Base classes for all estimators.""" # Author: Gael Varoquaux <gael.varoquaux@normalesup.org> # License: BSD 3 clause import copy import inspect import warnings import numpy as np from scipy import sparse from .externals import six class ChangedBehaviorWarning(UserWarning): pass ############################...
bsd-3-clause
jshufelt/privacyidea
privacyidea/api/machineresolver.py
3
4810
# -*- coding: utf-8 -*- # # http://www.privacyidea.org # (c) Cornelius Kölbel, privacyidea.org # # 2015-02-26 Cornelius Kölbel, <cornelius@privacyidea.org> # Initial writeup # # This code is free software; you can redistribute it and/or # modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE # L...
agpl-3.0
marwoodandrew/superdesk-core
superdesk/media/video.py
12
1271
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license from hachoir...
agpl-3.0
edunham/servo
tests/wpt/web-platform-tests/tools/pytest/_pytest/main.py
171
26357
""" core implementation of testing process: init, session, runtest loop. """ import imp import os import re import sys import _pytest import _pytest._code import py import pytest try: from collections import MutableMapping as MappingMixin except ImportError: from UserDict import DictMixin as MappingMixin from...
mpl-2.0
topicusonderwijs/zxing-ios
cpp/scons/scons-local-2.0.0.final.0/SCons/Tool/gnulink.py
34
2206
"""SCons.Tool.gnulink Tool-specific initialization for the gnu linker. 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, 2009, 2010 The SCons F...
apache-2.0
mlperf/training_results_v0.5
v0.5.0/google/cloud_v100x8/code/resnet/benchmarks/scripts/tf_cnn_benchmarks/flags.py
3
3679
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
devopservices/ansible
lib/ansible/runner/connection_plugins/fireball.py
110
4841
# (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 the License, or # (at your option) any lat...
gpl-3.0
open-homeautomation/home-assistant
homeassistant/components/sensor/zoneminder.py
18
3357
""" Support for ZoneMinder Sensors. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.zoneminder/ """ import logging import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import STATE_UNKNOWN ...
apache-2.0
HumanDynamics/openPDS
openpds/accesscontrol/models.py
3
2294
from django.conf import settings from django.db import models from django.utils.translation import gettext as _ from openpds.core.models import Profile class Context(models.Model): datastore_owner = models.ForeignKey(Profile, blank = False, null = False, related_name="datastore_owner_context") context_...
mit
j0gurt/ggrc-core
test/unit/ggrc/test_utils.py
7
3372
# Copyright (C) 2016 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> from ggrc import utils from unittest import TestCase class TestUtilsFunctions(TestCase): def test_mapping_rules(self): """ Test that all mappings go both ways """ mappings = utils.get_mapping_ru...
apache-2.0
steebchen/youtube-dl
youtube_dl/extractor/sixplay.py
4
4190
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_parse_qs, compat_str, compat_urllib_parse_urlparse, ) from ..utils import ( determine_ext, int_or_none, try_get, qualities, ) class SixPlayIE(InfoExtractor): ...
unlicense
zyq8709/DexHunter
art/tools/generate-operator-out.py
35
5576
#!/usr/bin/python # # Copyright (C) 2012 The Android Open Source Project # # 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 require...
apache-2.0
research-team/NEUCOGAR
NEST/appraisal/scripts/func.py
1
10467
import os import sys import time import logging import datetime import numpy as np from data import * from time import clock from parameters import * from collections import defaultdict spike_generators = {} # dict name_part : spikegenerator spike_detectors = {} # dict name_part : spikedetector multimeters = {} ...
gpl-2.0
lummyare/lummyare-lummy
py/test/selenium/test_i18n.py
28
1767
# DEPRECATED """ Copyright 2011 Software Freedom Conservancy. 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 ag...
apache-2.0
wakatime/sublime-wakatime
packages/wakatime/packages/py26/pygments/lexers/dsls.py
25
33336
# -*- coding: utf-8 -*- """ pygments.lexers.dsls ~~~~~~~~~~~~~~~~~~~~ Lexers for various domain-specific languages. :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import ExtendedRegexLexer, RegexLexer, ...
bsd-3-clause
CptLemming/paramiko
paramiko/dsskey.py
36
6757
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com> # # This file is part of paramiko. # # Paramiko 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 (a...
lgpl-2.1
gudcjfdldu/volatility
volatility/plugins/mac/dead_procs.py
58
1515
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # # 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 Software Foundation; either version 2 of the License, or # (at your o...
gpl-2.0
pwnall/ansible-modules-core
network/nxos/nxos_interface.py
9
22309
#!/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
jakevdp/scipy
scipy/odr/__init__.py
41
4303
""" ================================================= Orthogonal distance regression (:mod:`scipy.odr`) ================================================= .. currentmodule:: scipy.odr Package Content =============== .. autosummary:: :toctree: generated/ Data -- The data to fit. RealData -- Dat...
bsd-3-clause
jazzmes/ryu
ryu/tests/unit/app/test_ws_topology.py
43
1517
# Copyright (C) 2013 Stratosphere 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 ...
apache-2.0
overtherain/scriptfile
software/googleAppEngine/lib/jinja2/jinja2/testsuite/api.py
90
9803
# -*- coding: utf-8 -*- """ jinja2.testsuite.api ~~~~~~~~~~~~~~~~~~~~ Tests the public API and related stuff. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import unittest from jinja2.testsuite import JinjaTestCase from jinja2 import Environment, Undefi...
mit
tudyzhb/yichui
django/contrib/localflavor/us/forms.py
87
4651
""" USA-specific Form helpers """ from __future__ import absolute_import import re from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, RegexField, Select, CharField from django.utils.encoding import smart_unicode from django.utils.translatio...
bsd-3-clause
HKUST-SING/tensorflow
tensorflow/contrib/learn/python/learn/utils/gc_test.py
11
4567
# 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
axinging/chromium-crosswalk
tools/perf/page_sets/page_reload_cases.py
22
1393
# Copyright 2015 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 telemetry.page import shared_page_state from telemetry import story from page_sets import top_pages def _Reload(action_runner): # Numbers below are ...
bsd-3-clause
jeorryb/datarambler
plugins/creole_reader/creole_reader.py
71
2939
#-*- conding: utf-8 -*- ''' Creole Reader ------------- This plugins allows you to write your posts using the wikicreole syntax. Give to these files the creole extension. For the syntax, look at: http://www.wikicreole.org/ ''' from pelican import readers from pelican import signals from pelican import settings from...
mit
vFense/vFenseAgent-nix
agent/deps/mac/Python-2.7.5/lib/python2.7/uuid.py
187
21095
r"""UUID objects (universally unique identifiers) according to RFC 4122. This module provides immutable UUID objects (class UUID) and the functions uuid1(), uuid3(), uuid4(), uuid5() for generating version 1, 3, 4, and 5 UUIDs as specified in RFC 4122. If all you want is a unique ID, you should probably call uuid1() ...
lgpl-3.0
slivkamiro/sample_kafka_producer
src/sample_producer.py
1
2551
import sys from argparse import ArgumentParser from threading import Timer from time import time from confluent_kafka import avro from confluent_kafka.avro import AvroProducer from random import randint, random from sample_source_props import random_movie, random_series, random_user, random_tags, random_sentence clas...
apache-2.0
nurey/disclosed
app2/common/appenginepatch/ragendja/sites/dynamicsite.py
10
1805
from django.conf import settings from django.core.cache import cache from django.contrib.sites.models import Site from ragendja.dbutils import db_create from ragendja.pyutils import make_tls_property _default_site_id = getattr(settings, 'SITE_ID', None) SITE_ID = settings.__class__.SITE_ID = make_tls_property() class...
mit
huzq/scikit-learn
sklearn/neighbors/_nearest_centroid.py
4
7789
# -*- coding: utf-8 -*- """ Nearest Centroid Classification """ # Author: Robert Layton <robertlayton@gmail.com> # Olivier Grisel <olivier.grisel@ensta.org> # # License: BSD 3 clause import warnings import numpy as np from scipy import sparse as sp from ..base import BaseEstimator, ClassifierMixin from ..met...
bsd-3-clause
mancoast/CPythonPyc_test
cpython/212_test_traceback.py
5
1336
"""Test cases for traceback module""" import unittest from test_support import run_unittest import traceback class TracebackCases(unittest.TestCase): # For now, a very minimal set of tests. I want to be sure that # formatting of SyntaxErrors works based on changes for 2.1. def get_exception_format(self...
gpl-3.0
hitsl/bouser
bouser/utils.py
1
5738
# -*- coding: utf-8 -*- import datetime import json import functools from Queue import Queue import six from twisted.application.service import Service from twisted.internet import defer from bouser.excs import SerializableBaseException, ExceptionWrapper from twisted.web.http import Request from bouser.web.cors import...
isc
lindsayad/sympy
sympy/combinatorics/prufer.py
93
11915
from __future__ import print_function, division from sympy.core import Basic from sympy.core.compatibility import iterable, as_int, range from sympy.utilities.iterables import flatten from collections import defaultdict class Prufer(Basic): """ The Prufer correspondence is an algorithm that describes the ...
bsd-3-clause
scottdangelo/cinderclient-api-microversions
cinderclient/tests/unit/test_utils.py
2
6782
# 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
fcnmx/slapcomp
unittests.py
1
4049
""" Slapcomp Unit Tests ~~~~~~~~~~~~~~~~~~~~ Testing DAG functions. :Version 0.1 Written by Daniel Hayes (d@fcn.mx) June 2012 """ #import os import sys sys.path.append("/Users/d/Dropbox/work/") sys.path.append("/home/d/Dropbox/work/") import unittest from slapcomp.core.dag import Dag from slapcomp.no...
bsd-3-clause
openstack/tempest
tempest/api/volume/base.py
1
14970
# Copyright 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
tobikausk/nest-simulator
pynest/nest/tests/test_vogels_sprekeler_synapse.py
16
8546
# -*- coding: utf-8 -*- # # test_vogels_sprekeler_synapse.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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 ...
gpl-2.0
andmos/ansible
lib/ansible/plugins/terminal/edgeswitch.py
63
3190
# # (c) 2018 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is d...
gpl-3.0
azureplus/hue
desktop/core/ext-py/Django-1.6.10/django/contrib/comments/moderation.py
121
13553
""" A generic comment-moderation system which allows configuration of moderation options on a per-model basis. To use, do two things: 1. Create or import a subclass of ``CommentModerator`` defining the options you want. 2. Import ``moderator`` from this module and register one or more models, passing the model...
apache-2.0
ericd/redeem
redeem/gcodes/M562.py
2
1398
""" GCode M562 Example: M562 P0 Reset temperature fault Author: Elias Bakken License: CC BY-SA: http://creativecommons.org/licenses/by-sa/2.0/ """ from GCodeCommand import GCodeCommand import numpy as np import logging class M562(GCodeCommand): def execute(self, g): if g.has_letter("P"): ...
gpl-3.0
silenceli/nova
nova/tests/unit/api/openstack/compute/contrib/test_suspend_server.py
9
2838
# Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
apache-2.0
yqm/sl4a
python/src/Demo/pdist/cvslib.py
47
10175
"""Utilities for CVS administration.""" import string import os import time import md5 import fnmatch if not hasattr(time, 'timezone'): time.timezone = 0 class File: """Represent a file's status. Instance variables: file -- the filename (no slashes), None if uninitialized lseen -- true if the ...
apache-2.0
dmwelch/Py6S
Py6S/Params/ground_reflectance.py
2
17014
# This file is part of Py6S. # # Copyright 2012 Robin Wilson and contributors listed in the CONTRIBUTORS file. # # Py6S 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, o...
gpl-3.0
dchenbecker/kafka-sbt
system_test/replication_testsuite/replica_basic_test.py
3
25648
# 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 u...
apache-2.0
avidity/racconto
racconto/hooks/__init__.py
1
2994
from datetime import datetime as d from distutils.dir_util import copy_tree import os from racconto.generator import Generator from racconto.settings_manager import SettingsManager as SETTINGS def generate_archive(pages, posts): """ Generate archive from posts. Assumes posts have been generated (i.e directori...
mit
rvalyi/OpenUpgrade
addons/l10n_in_hr_payroll/l10n_in_hr_payroll.py
39
13980
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under th...
agpl-3.0
toontownfunserver/Panda3D-1.9.0
direct/controls/ControlManager.py
11
14176
from direct.showbase.InputStateGlobal import inputState #from DirectGui import * #from PythonUtil import * #from IntervalGlobal import * #from otp.avatar import Avatar from direct.directnotify import DirectNotifyGlobal #import GhostWalker #import GravityWalker #import NonPhysicsWalker #import PhysicsWalker #if __debu...
bsd-3-clause
Benniphx/server-tools
mass_editing/wizard/__init__.py
62
1052
# -*- coding: utf-8 -*- ############################################################################## # # This module uses OpenERP, Open Source Management Solution Framework. # Copyright (C): # 2012-Today Serpent Consulting Services (<http://www.serpentcs. # # This program is free software: you can red...
agpl-3.0
miquelo/caviar
setup.py
1
1856
# # This file is part of CAVIAR. # # CAVIAR 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. # # CAVIAR is distributed in the hope that ...
gpl-3.0
pquentin/libcloud
setup.py
3
5864
# 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 use ...
apache-2.0
bdh1011/cupeye
venv/lib/python2.7/site-packages/whoosh/codec/base.py
52
24009
# Copyright 2011 Matt Chaput. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the...
bsd-3-clause
zasdfgbnm/qutip
qutip/tests/test_basis_transformation.py
1
4351
# This file is part of QuTiP: Quantum Toolbox in Python. # # Copyright (c) 2011 and later, Paul D. Nation and Robert J. Johansson. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: ...
bsd-3-clause
theislab/dca
dca/utils.py
1
4911
import scanpy as sc import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns import scipy as sp import tensorflow as tf from tensorflow.contrib.opt import ScipyOptimizerInterface nb_zero = lambda t, mu: (t/(mu+t))**t zinb_zero = lambda t, mu, p: p + ((1.-p)*((t/(mu+t))**t)) sigmoid...
apache-2.0
rajanil/mkboost
src/generate_features.py
1
8882
import urllib import json import time import mismatch import csv import numpy as np import cPickle import os import pdb class Protein(): """ Class describing a protein in terms of its amino acid sequence Arguments name : string name of the protein """ def __init__(self,name): ...
mit
jakirkham/lazyflow
tests/test_blockwise_view.py
2
3090
import numpy import logging from lazyflow.utility import blockwise_view logger = logging.getLogger("tests.test_blockwise_view") def test_2d(): # Adapted from: # http://stackoverflow.com/a/8070716/162094 n=4 m=5 a = numpy.arange(1,n*m+1).reshape(n,m) logger.debug("original data:\n{}".format(a)...
lgpl-3.0
seem-sky/kbengine
kbe/res/scripts/common/Lib/test/test_sys_setprofile.py
177
11355
import gc import pprint import sys import unittest from test import support class TestGetProfile(unittest.TestCase): def setUp(self): sys.setprofile(None) def tearDown(self): sys.setprofile(None) def test_empty(self): self.assertIsNone(sys.getprofile()) def test_setget(self)...
lgpl-3.0
lesina/Hack70
env/lib/python3.5/site-packages/gunicorn/workers/geventlet.py
22
3796
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. from functools import partial import errno import sys try: import eventlet except ImportError: raise RuntimeError("You need eventlet installed to use this worker.") # validate the ev...
gpl-3.0
firebase/firebase-ios-sdk
Firestore/Protos/nanopb_cpp_generator.py
2
14326
#!/usr/bin/env python # Copyright 2018 Google # # 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 agr...
apache-2.0
clearlylin/folly
folly/build/generate_format_tables.py
61
2378
#!/usr/bin/env python # # Generate Format tables import os from optparse import OptionParser OUTPUT_FILE = "FormatTables.cpp" def generate_table(f, type_name, name, map): f.write("extern const {0} {1}[] = {{".format(type_name, name)) for i in range(0, 256): if i % 2 == 0: f.write("\n ")...
apache-2.0
kumarshivam675/Mobile10X-Hack
sidd/venv/lib/python2.7/site-packages/jinja2/parser.py
336
35442
# -*- coding: utf-8 -*- """ jinja2.parser ~~~~~~~~~~~~~ Implements the template parser. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ from jinja2 import nodes from jinja2.exceptions import TemplateSyntaxError, TemplateAssertionError from jinja2.lexer impo...
gpl-3.0
CTSRD-SOAAP/chromium-42.0.2311.135
tools/metrics/rappor/pretty_print.py
6
4494
#!/usr/bin/env python # Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import logging import sys import os # Import the metrics/common module for pretty print xml. sys.path.append(os.path.join(os.path.dirn...
bsd-3-clause
badock/nova
nova/virt/hyperv/utilsfactory.py
23
3635
# Copyright 2013 Cloudbase Solutions Srl # 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 r...
apache-2.0
joelstanner/python-social-auth
examples/django_me_example/example/app/views.py
111
2194
import json from django.conf import settings from django.http import HttpResponse, HttpResponseBadRequest from django.shortcuts import redirect from django.contrib.auth.decorators import login_required from django.contrib.auth import logout as auth_logout, login from social.backends.oauth import BaseOAuth1, BaseOAuth...
bsd-3-clause
edmundgentle/schoolscript
SchoolScript/bin/Debug/pythonlib/Lib/encodings/idna.py
3
8783
# This module implements the RFCs 3490 (IDNA) and 3491 (Nameprep) import stringprep, re, codecs from unicodedata import ucd_3_2_0 as unicodedata # IDNA section 3.1 dots = re.compile("[\u002E\u3002\uFF0E\uFF61]") # IDNA section 5 ace_prefix = b"xn--" sace_prefix = "xn--" # This assumes query strings, so ...
gpl-2.0
trondhindenes/ansible
lib/ansible/modules/cloud/scaleway/scaleway_security_group_facts.py
48
2816
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2018, Yanis Guenane <yanis+ansible@guenane.org> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type ANSIBLE_METADATA = {'metadata_version':...
gpl-3.0
fergalbyrne/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/pyparsing.py
72
143924
# module pyparsing.py # # Copyright (c) 2003-2008 Paul T. McGuire # # 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, cop...
agpl-3.0
matrix-org/sydent
sydent/db/hashing_metadata.py
1
5081
# Copyright 2019 The Matrix.org Foundation C.I.C. # # 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 a...
apache-2.0
zenoss/ZenPacks.zenoss.CloudStack
ZenPacks/zenoss/CloudStack/Cluster.py
1
1449
########################################################################### # # This program is part of Zenoss Core, an open source monitoring platform. # Copyright (C) 2011, Zenoss Inc. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License versi...
gpl-2.0
bazz-erp/erpnext
erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py
21
3899
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import flt, getdate, nowdate, fmt_money from frappe import msgprint, _ from frappe.model.document import Document form_...
gpl-3.0
paralect/robomongo
bin/set-mongo-warning-level-3.py
2
1283
import os from os.path import join ### def force_warning_level_3(file): with open(file, "r") as in_file: buf = in_file.readlines() push = '#pragma warning(push, 3)\n' pop = '#pragma warning(pop)\n' last_line_has_mongo = False with open(file, "w") as out_file: for line in buf: ...
gpl-3.0
ashray/VTK-EVM
ThirdParty/Twisted/twisted/internet/glib2reactor.py
64
1115
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ This module provides support for Twisted to interact with the glib mainloop. This is like gtk2, but slightly faster and does not require a working $DISPLAY. However, you cannot run GUIs under this reactor: for that you must use the gtk2reactor...
bsd-3-clause
MycroftAI/mycroft-core
mycroft/skills/fallback_skill.py
2
7989
# Copyright 2019 Mycroft AI 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 writin...
apache-2.0
juanriaza/django-rest-framework-msgpack
rest_framework_msgpack/renderers.py
1
1132
import msgpack import decimal import datetime from rest_framework.renderers import BaseRenderer class MessagePackEncoder(object): def encode(self, obj): if isinstance(obj, datetime.datetime): return {'__class__': 'datetime', 'as_str': obj.isoformat()} elif isinstance(obj, datetime.da...
bsd-3-clause
dlopes-samba/dlopes-maps-sambatech
django/db/backends/mysql/base.py
101
13899
""" MySQL database backend for Django. Requires MySQLdb: http://sourceforge.net/projects/mysql-python """ import re import sys try: import MySQLdb as Database except ImportError, e: from django.core.exceptions import ImproperlyConfigured raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e) ...
bsd-3-clause
Teamxrtc/webrtc-streaming-node
third_party/webrtc/src/chromium/src/tools/gyp/test/small/gyptest-small.py
29
1480
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Runs small tests. """ import imp import os import sys import unittest import TestGyp test = TestGyp.TestGyp() # Add pylib to the im...
mit
ycl2045/nova-master
nova/keymgr/not_implemented_key_mgr.py
112
1417
# Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory # 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
wuhengzhi/chromium-crosswalk
tools/site_compare/scrapers/chrome/chrome011010.py
189
1183
# Copyright (c) 2011 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. """Does scraping for versions of Chrome from 0.1.101.0 up.""" from drivers import windowing import chromebase # Default version version = "0.1.101.0" ...
bsd-3-clause
BNIA/tidyall
src/modules/tidydate.py
2
2523
#!/usr/bin/env python # -*- coding: utf-8 -*- """tidydate This file declares and implements the TidyDate class for TidyAll. TidyDate converts and formats valid date columns into ISO 8601 (yyyy-mm-dd). """ import sys from dateutil import parser as date_parser import numpy as np import pandas as pd from .settings im...
mit
Polarcraft/KbveBot
scripts/parselogs.py
1
4376
#!/usr/bin/env python3 # Copyright (C) 2013-2015 Samuel Damashek, Peter Foley, James Forcier, Srijay Kasturi, Reed Koser, Christopher Reffett, and Fox Wilson # # 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 Softwar...
gpl-2.0
sfu-natlang/glm-parser
scripts/train.py
1
2296
import sys sys.path.append("../src/") from backend import data_set, dependency_tree from feature import feature_set from learn import weight_learner from evaluate import evaluator import glm_parser def write_file(msg): f = open(output_file, "a+") f.write(msg) f.close() return if __name__ == "__main_...
mit
frohoff/Empire
lib/listeners/http_mapi.py
2
31659
import logging import base64 import random import os import ssl import time import copy from pydispatch import dispatcher from flask import Flask, request, make_response # Empire imports from lib.common import helpers from lib.common import agents from lib.common import encryption from lib.common import packets from l...
bsd-3-clause
poeschlr/kicad-3d-models-in-freecad
cadquery/FCAD_script_generator/GW_QFP_SOIC_SSOP_TSSOP_SOT/cq_parameters_sot.py
1
40529
# -*- coding: utf8 -*- #!/usr/bin/python # # This is derived from a cadquery script for generating QFP/GullWings models in X3D format. # # from https://bitbucket.org/hyOzd/freecad-macros # author hyOzd # # Dimensions are from Jedec MS-026D document. ## file of parametric definitions from Params import * class Series...
gpl-2.0
isc-projects/forge
tests/dhcpv6/kea_only/host_reservation/test_host_reservation_address_conflicts_mysql.py
1
22101
"""Host Reservation DHCPv6""" # pylint: disable=invalid-name,line-too-long import pytest import srv_msg import misc import srv_control @pytest.mark.v6 @pytest.mark.host_reservation @pytest.mark.kea_only def test_v6_host_reservation_mysql_duplicate_reservation_duid(): misc.test_setup() srv_control.config_sr...
isc
joelpinheiro/safebox-smartcard-auth
Server/veserver/lib/python2.7/site-packages/pip/util.py
343
24172
import sys import shutil import os import stat import re import posixpath import zipfile import tarfile import subprocess import textwrap from pip.exceptions import InstallationError, BadCommand, PipError from pip.backwardcompat import(WindowsError, string_types, raw_input, console_to_s...
gpl-2.0
ArnossArnossi/django
django/core/files/images.py
429
2428
""" Utility functions for handling images. Requires Pillow as you might imagine. """ import struct import zlib from django.core.files import File class ImageFile(File): """ A mixin for use alongside django.core.files.base.File, which provides additional features for dealing with images. """ def ...
bsd-3-clause
badlands-model/BayesLands
pyBadlands/surface/FVmethod.py
1
12118
##~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~## ## ## ## This file forms part of the Badlands surface processes modelling application. ## ## ...
gpl-3.0
jelly/calibre
src/calibre/ebooks/metadata/archive.py
2
5477
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import with_statement __license__ = 'GPL v3' __copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' import os from contextlib import closing from calibre.customize import FileTypePlug...
gpl-3.0
pxsdirac/vnpy
vn.demo/ltsdemo/demoApi.py
46
32062
# encoding: UTF-8 """ 该文件中包含的是交易平台的底层接口相关的部分, 主要对API进行了一定程度的简化封装,方便开发。 """ import os from vnltsmd import MdApi from vnltstd import * from vnltsl2 import * from eventEngine import * from lts_data_type import defineDict #---------------------------------------------------------------------- def print_dict(d): """...
mit
binary13/Python_Koans
python3/koans/about_scoring_project.py
107
2207
#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * # Greed is a dice game where you roll up to five dice to accumulate # points. The following "score" function will be used calculate the # score of a single roll of the dice. # # A greed roll is scored as follows: # # * A set of three ones is 100...
mit
GeriLife/wellbeing
test-automation/app/accessibility_tasks.py
2
2733
from aloe import world from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.select import Select from selenium.webdriver.support.wait import WebDriverWait # Do not remove this import. Without it the hook will not be ran from app.ho...
agpl-3.0
JeanKossaifi/scikit-learn
benchmarks/bench_plot_nmf.py
90
5742
""" Benchmarks of Non-Negative Matrix Factorization """ from __future__ import print_function from collections import defaultdict import gc from time import time import numpy as np from scipy.linalg import norm from sklearn.decomposition.nmf import NMF, _initialize_nmf from sklearn.datasets.samples_generator import...
bsd-3-clause
RPI-OPENEDX/edx-platform
lms/djangoapps/instructor/tests/test_enrollment_store_provider.py
136
2709
""" Exercises tests on the base_store_provider file """ from django.test import TestCase from instructor.enrollment_report import AbstractEnrollmentReportProvider from instructor.paidcourse_enrollment_report import PaidCourseEnrollmentReportProvider class BadImplementationAbstractEnrollmentReportProvider(AbstractEnr...
agpl-3.0
vietch2612/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/views/buildbot_results.py
120
8022
#!/usr/bin/env python # Copyright (C) 2012 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 ...
bsd-3-clause
kidibox/kidibox-py
kidibox/api/download.py
1
1238
import contextlib import logging import re import shutil import ssl import urllib logger = logging.getLogger(__name__) re_filename = re.compile(r"filename=(.+)") class DownloadApiMixin(object): def download(self, token, **kwargs): context = ssl.create_default_context() if not self.session.verify...
mit
queer1/bitcurator
externals/py3fpdf/tutorial/tuto6.py
8
2389
from fpdf import * import re class PDF(FPDF): def __init__(self, orientation='P',unit='mm',format='A4'): #Call parent constructor FPDF.__init__(self,orientation,unit,format) #Initialization self.b=0 self.i=0 self.u=0 self.href='' self.page_links={} def write_html(self, html): #HTML pars...
gpl-3.0
spektom/incubator-airflow
airflow/migrations/versions/2e82aab8ef20_rename_user_table.py
7
1174
# # 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
andreadelrio/bedrock
bedrock/mozorg/tests/test_decorators.py
45
1378
# 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/. import time from math import floor from django.test import RequestFactory from django.utils.http import parse_http_date...
mpl-2.0
noironetworks/networking-cisco
networking_cisco/tests/base.py
2
1196
# -*- coding: utf-8 -*- # Copyright 2010-2011 OpenStack Foundation # Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # htt...
apache-2.0
wxkdesky/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/style/optparser.py
175
19377
# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org) # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and...
bsd-3-clause
SimVascular/VTK
ThirdParty/Twisted/twisted/conch/test/test_insults.py
27
17887
# -*- test-case-name: twisted.conch.test.test_insults -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. from twisted.trial import unittest from twisted.test.proto_helpers import StringTransport from twisted.conch.insults.insults import ServerProtocol, ClientProtocol from twisted.conch.insult...
bsd-3-clause