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 |
|---|---|---|---|---|---|
ZerpaTechnology/AsenZor | static/js/brython/Lib/importlib/_bootstrap.py | 2 | 65506 | """Core implementation of import.
This module is NOT meant to be directly imported! It has been designed such
that it can be bootstrapped into Python as the implementation of import. As
such it requires the injection of specific modules and attributes in order to
work. One should use importlib as the public-facin... | lgpl-3.0 |
nikolas/lettuce | tests/integration/lib/Django-1.3/tests/regressiontests/forms/localflavor/fr.py | 89 | 5951 | from django.contrib.localflavor.fr.forms import (FRZipCodeField,
FRPhoneNumberField, FRDepartmentSelect)
from utils import LocalFlavorTestCase
class FRLocalFlavorTests(LocalFlavorTestCase):
def test_FRZipCodeField(self):
error_format = [u'Enter a zip code in the format XXXXX.']
valid = {
... | gpl-3.0 |
beatmasta/counter-strike-rcon | CstrikeRCON/CstrikeRCON.py | 1 | 5530 | #!/usr/bin/python
""" CstrikeRCON: An HLDS1-based Cstrike servers RCON querying library """
""" fully tested with Counter-Strike 1.6 (unit test included [test.py]) """
__author__ = "Alex Vanyan"
__copyright__ = "Copyright 2013 alex-v.net"
__version__ = "1.0.1"
__status__ = "First Release"
# exceptions...
#... | mit |
boblannon/randrctl | randrctl/exception.py | 1 | 1097 | __author__ = 'edio'
class RandrCtlException(Exception):
"""
Is thrown whenever expected exception occurs inside the app
"""
class ValidationException(RandrCtlException):
"""
Is thrown when some validation error occurs
"""
class InvalidProfileException(RandrCtlException):
"""
Is thr... | gpl-3.0 |
repotvsupertuga/repo | plugin.video.pancas/resources/lib/resolvers/vodlocker.py | 23 | 1216 | # -*- coding: utf-8 -*-
'''
Specto Add-on
Copyright (C) 2015 lambda
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any l... | gpl-2.0 |
owtf/owtf | owtf/proxy/cache_handler.py | 1 | 8186 | """
owtf.proxy.cache_handler
~~~~~~~~~~~~~~~~~~~~~~~~
Inbound Proxy Module developed by Bharadwaj Machiraju (blog.tunnelshade.in) as a part of Google Summer of Code 2013
"""
import base64
import datetime
import hashlib
import json
import logging
import os
import re
import traceback
import tornado.httputil
from owtf.... | bsd-3-clause |
BiaDarkia/scikit-learn | examples/svm/plot_svm_regression.py | 37 | 1505 | """
===================================================================
Support Vector Regression (SVR) using linear and non-linear kernels
===================================================================
Toy example of 1D regression using linear, polynomial and RBF kernels.
"""
print(__doc__)
import numpy as np
... | bsd-3-clause |
georgemarshall/bigcouch | couchjs/scons/scons-local-2.0.1/SCons/Tool/Subversion.py | 61 | 2710 | """SCons.Tool.Subversion.py
Tool-specific initialization for Subversion.
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 |
masayuko/beaker | tests/test_domain_setting.py | 1 | 2431 | import re
import os
from beaker.middleware import SessionMiddleware
from nose import SkipTest
try:
from webtest import TestApp
except ImportError:
raise SkipTest("webtest not installed")
def teardown():
import shutil
shutil.rmtree('./cache', True)
def simple_app(environ, start_response):
session ... | bsd-3-clause |
southpawtech/TACTIC-DEV | src/contrib/widget/nuke_popup_wdg/tactic_nuke_server.py | 8 | 1761 | # Copyright (c) 2009 The Foundry Visionmongers Ltd. All Rights Reserved.
import socket, threading
import nuke
from nukescripts import utils
HOST='localhost'
PORT=50007
class server():
"""
Example of running a IPV6 socket server on a separate thread inside Nuke
The default command is to create the named node
... | epl-1.0 |
jeansch/octopasty-og | tests/Asterisk/CLI.py | 4 | 3843 | #!/usr/bin/env python
'''
Asterisk/CLI.py: Command-line wrapper around the Asterisk Manager API.
'''
__author__ = 'David M. Wilson <dw@autosols.com>'
__id__ = '$Id$'
import sys, os, inspect
from Asterisk import Manager, BaseException, Config
import Asterisk.Util
class ArgumentsError(BaseException):
_prefix =... | gpl-3.0 |
angelapper/edx-platform | common/djangoapps/track/event_transaction_utils.py | 8 | 1189 | """
Helper functions to access and update the id and type
used in event tracking.
"""
from uuid import UUID, uuid4
from request_cache import get_cache
def get_event_transaction_id():
"""
Retrieves the current event transaction id from the request
cache.
"""
return get_cache('event_transaction').g... | agpl-3.0 |
jdugge/QGIS | python/plugins/processing/algs/qgis/BoxPlot.py | 30 | 5083 | # -*- coding: utf-8 -*-
"""
***************************************************************************
BarPlot.py
---------------------
Date : March 2015
Copyright : (C) 2017 by Matteo Ghetta
Email : matteo dot ghetta at gmail dot com
*********************... | gpl-2.0 |
jrrembert/django | django/utils/version.py | 344 | 2445 | 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 386-compliant version number from VERSION."
version = get_complete_version(version)
# Now build the two parts of the version num... | bsd-3-clause |
cstan11/Sick-Beard | lib/requests/packages/chardet/mbcsgroupprober.py | 236 | 1889 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | gpl-3.0 |
popazerty/EG-2 | lib/python/Components/PluginComponent.py | 15 | 4778 | import os
from shutil import rmtree
from bisect import insort
from Tools.Directories import fileExists, resolveFilename, SCOPE_PLUGINS
from Tools.Import import my_import
from Tools.Profile import profile
from Plugins.Plugin import PluginDescriptor
import keymapparser
class PluginComponent:
firstRun = True
restartReq... | gpl-2.0 |
printedheart/h2o-3 | py2/testdir_rapids/test_rapids_funs_noinc.py | 21 | 3268 | import unittest, random, sys, time, re
sys.path.extend(['.','..','../..','py'])
import h2o2 as h2o
import h2o_browse as h2b, h2o_exec as h2e, h2o_import as h2i, h2o_cmd
from h2o_test import dump_json, verboseprint
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@clas... | apache-2.0 |
michael-dev2rights/ansible | lib/ansible/module_utils/connection.py | 27 | 5361 | #
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete ... | gpl-3.0 |
patmcb/odoo | addons/crm/validate_email.py | 462 | 5978 | # RFC 2822 - style email validation for Python
# (c) 2012 Syrus Akbary <me@syrusakbary.com>
# Extended from (c) 2011 Noel Bush <noel@aitools.org>
# for support of mx and user check
# This code is made available to you under the GNU LGPL v3.
#
# This module provides a single method, valid_email_address(),
# which return... | agpl-3.0 |
mttr/django | tests/utils_tests/test_lazyobject.py | 268 | 8629 | from __future__ import unicode_literals
import copy
import pickle
import sys
from unittest import TestCase
from django.utils import six
from django.utils.functional import LazyObject, SimpleLazyObject, empty
class Foo(object):
"""
A simple class with just one attribute.
"""
foo = 'bar'
def __eq... | bsd-3-clause |
anhuiwj/weixin | src/main/webapp/static/global/plugins/jquery-file-upload/server/gae-python/main.py | 245 | 5845 | # -*- coding: utf-8 -*-
#
# jQuery File Upload Plugin GAE Python Example 2.2.0
# https://github.com/blueimp/jQuery-File-Upload
#
# Copyright 2011, Sebastian Tschan
# https://blueimp.net
#
# Licensed under the MIT license:
# http://www.opensource.org/licenses/MIT
#
from __future__ import with_statement
from google.appe... | apache-2.0 |
kerneltask/micropython | ports/esp8266/makeimg.py | 14 | 1783 | import sys
import struct
import hashlib
# This region at the start of flash contains a small header and then segments
# containing .text, .data and .rodata, and so must be large enough to hold all
# of this. This data is loaded to the appropriate places in RAM by the ROM
# bootloader at boot. After this in flash com... | mit |
abhitopia/tensorflow | tensorflow/python/kernel_tests/cwise_ops_test.py | 33 | 76618 | # Copyright 2015 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 |
redhat-openstack/horizon | horizon/utils/memoized.py | 66 | 4270 | # 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 |
Domatix/account-financial-tools | account_move_locking/account.py | 27 | 2000 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author Vincent Renaville.
# Copyright 2015 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# p... | agpl-3.0 |
CamelBackNotation/CarnotKE | jyhton/lib-python/2.7/test/test_zipfile64.py | 158 | 4421 | # Tests of the full ZIP64 functionality of zipfile
# The test_support.requires call is the only reason for keeping this separate
# from test_zipfile
from test import test_support
# XXX(nnorwitz): disable this test by looking for extra largfile resource
# which doesn't exist. This test takes over 30 minutes to run in ... | apache-2.0 |
antb/TPT----My-old-mod | src/python/stdlib/hmac.py | 253 | 4531 | """HMAC (Keyed-Hashing for Message Authentication) Python module.
Implements the HMAC algorithm as described by RFC 2104.
"""
import warnings as _warnings
trans_5C = "".join ([chr (x ^ 0x5C) for x in xrange(256)])
trans_36 = "".join ([chr (x ^ 0x36) for x in xrange(256)])
# The size of the digests returned by HMAC ... | gpl-2.0 |
percy-g2/Novathor_xperia_u8500 | 6.1.1.B.1.54/external/webkit/Tools/Scripts/webkitpy/thirdparty/mock.py | 148 | 9681 | # mock.py
# Test tools for mocking and patching.
# Copyright (C) 2007-2009 Michael Foord
# E-mail: fuzzyman AT voidspace DOT org DOT uk
# mock 0.6.0
# http://www.voidspace.org.uk/python/mock/
# Released subject to the BSD License
# Please see http://www.voidspace.org.uk/python/license.shtml
# 2009-11-25: Licence dow... | gpl-2.0 |
polyval/CNC | flask/Lib/site-packages/pip/_vendor/requests/packages/urllib3/request.py | 853 | 5751 | try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode
from .filepost import encode_multipart_formdata
__all__ = ['RequestMethods']
class RequestMethods(object):
"""
Convenience mixin for classes who implement a :meth:`urlopen` method, such
as :class:`~urllib3.... | apache-2.0 |
dlundquist/ursula | plugins/filters/ursula_filters.py | 17 | 1147 | import os
def ursula_controller_ips(hostvars, groups, controller_name='controller'):
controller_ips = set()
for host in groups[controller_name]:
controller_primary_interface = hostvars[host]['primary_interface']
ip = hostvars[host][controller_primary_interface]['ipv4']['address']
contr... | mit |
gymnasium/edx-platform | openedx/core/djangoapps/schedules/tests/factories.py | 18 | 1232 | import factory
import pytz
from openedx.core.djangoapps.schedules import models
from student.tests.factories import CourseEnrollmentFactory
from openedx.core.djangoapps.site_configuration.tests.factories import SiteFactory
class ScheduleExperienceFactory(factory.DjangoModelFactory):
class Meta(object):
m... | agpl-3.0 |
skluth/sjmanalysis | dataExtractor.py | 1 | 1204 | #!/usr/bin/env python
from ROOT import *
from array import array
import pickle as pkl
gROOT.LoadMacro( "libNtupleReaderDict.so" )
def writeData( filename="da91_96_200.root", outfilename="da91_96.pkl", maxevt=100 ):
outData= {}
ntr= LEP1NtupleReader( filename )
ievent= 1
while ntr.GetEvent( ievent ... | gpl-2.0 |
SaschaMester/delicium | tools/telemetry/telemetry/web_perf/metrics/mainthread_jank_stats_unittest.py | 23 | 5195 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from telemetry.timeline import async_slice
from telemetry.timeline import model as model_module
from telemetry.web_perf.metrics import maint... | bsd-3-clause |
Flumotion/flumotion | flumotion/component/common/fgdp/fgdp.py | 3 | 10973 | # -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L.
# Copyright (C) 2010,2011 Flumotion Services, S.A.
# All rights reserved.
#
# This file may be distributed and/or modified under the terms of
# the GNU Lesser General Pub... | lgpl-2.1 |
souravsingh/sympy | sympy/polys/domains/pythonintegerring.py | 117 | 2650 | """Implementaton of :class:`PythonIntegerRing` class. """
from __future__ import print_function, division
from sympy.polys.domains.integerring import IntegerRing
from sympy.polys.domains.groundtypes import (
PythonInteger, SymPyInteger, python_sqrt,
python_factorial, python_gcdex, python_gcd, python_lcm,
)
f... | bsd-3-clause |
Akson/RemoteConsolePlus3 | RemoteConsolePlus3/MoveMe/Canvas/Canvas.py | 2 | 12497 | #Created by Dmytro Konobrytskyi, 2013 (github.com/Akson/MoveMe)
import wx
from MoveMe.Canvas.Factories.DefaultNodesFactory import DefaultNodesFactory
from MoveMe.Canvas.Factories.DefaultConnectionsFactory import DefaultConnectionsFactory
import json
import logging
# Define Text Drop Target class
class TextDropTarget(w... | lgpl-3.0 |
michaelBenin/geonode | geonode/catalogue/backends/pycsw_local.py | 8 | 5656 | #########################################################################
#
# Copyright (C) 2012 OpenPlans
#
# 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
#... | gpl-3.0 |
zenx/xhtml2pdf | demo/djangoproject/views.py | 142 | 2085 | #! /usr/bin/python
# -*- encoding: utf-8 -*-
from django import http
from django.shortcuts import render_to_response
from django.template.loader import get_template
from django.template import Context
import xhtml2pdf.pisa as pisa
import cStringIO as StringIO
import cgi
def index(request):
return http.HttpRespons... | apache-2.0 |
jianlirong/incubator-hawq | tools/bin/pythonSrc/unittest2-0.5.1/unittest2/loader.py | 139 | 13421 | """Loading unittests."""
import os
import re
import sys
import traceback
import types
import unittest
from fnmatch import fnmatch
from unittest2 import case, suite
try:
from os.path import relpath
except ImportError:
from unittest2.compatibility import relpath
__unittest = True
def _CmpToKey(mycmp):
... | apache-2.0 |
manazhao/tf_recsys | tensorflow/contrib/tensor_forest/python/kernel_tests/update_fertile_slots_op_test.py | 80 | 4201 | # 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 |
Lekensteyn/buildbot | master/buildbot/test/fake/latent.py | 10 | 3944 | # This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
victorpantoja/scraper | scraper/repository/mongodb/orm.py | 1 | 2030 | # coding: utf-8
class PropertyDict(dict):
def __getattr__(self, name):
if name.startswith("_") and not name == '_id':
return dict.__getattr__(self, name)
return self[name]
class Property(object):
def __init__(self, type=None, doc=None, default=None):
... | mit |
villip/moon-safari | node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py | 1382 | 30567 | # Copyright (c) 2014 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.
"""
This script is intended for use as a GYP_GENERATOR. It takes as input (by way of
the generator flag config_path) the path of a json file that dictates the file... | mit |
tensorflow/benchmarks | scripts/tf_cnn_benchmarks/benchmark_cnn_distributed_test_runner.py | 1 | 4571 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
achang97/YouTunes | lib/python2.7/site-packages/youtube_dl/extractor/commonmistakes.py | 44 | 1591 | from __future__ import unicode_literals
import sys
from .common import InfoExtractor
from ..utils import ExtractorError
class CommonMistakesIE(InfoExtractor):
IE_DESC = False # Do not list
_VALID_URL = r'''(?x)
(?:url|URL)$
'''
_TESTS = [{
'url': 'url',
'only_matching': Tru... | mit |
qianwenming/mapnik | scons/scons-local-2.3.1/SCons/compat/_scons_subprocess.py | 183 | 44500 | # subprocess - Subprocesses with accessible I/O streams
#
# For more information about this module, see PEP 324.
#
# This module should remain compatible with Python 2.2, see PEP 291.
#
# Copyright (c) 2003-2005 by Peter Astrand <astrand@lysator.liu.se>
#
# Licensed to PSF under a Contributor Agreement.
# See http://ww... | lgpl-2.1 |
ntonjeta/iidea-Docker | examples/sobel/src/boost_1_63_0/tools/build/src/tools/notfile.py | 71 | 1728 | # Status: ported.
# Base revision: 64429.
#
# Copyright (c) 2005-2010 Vladimir Prus.
#
# Use, modification and distribution is subject to the Boost Software
# License Version 1.0. (See accompanying file LICENSE_1_0.txt or
# http://www.boost.org/LICENSE_1_0.txt)
import b2.build.type as type
import b2.build.generat... | agpl-3.0 |
srikantbmandal/ansible | lib/ansible/modules/clustering/consul_kv.py | 69 | 9795 | #!/usr/bin/python
#
# (c) 2015, Steve Gargan <steve.gargan@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... | gpl-3.0 |
mclaughlin6464/pylearn2 | pylearn2/scripts/icml_2013_wrepl/multimodal/extract_kmeans_features.py | 42 | 2332 | from __future__ import print_function
import numpy as np
import os
import sys
from pylearn2.utils import serial
from pylearn2.utils.string_utils import preprocess
def usage():
print("""
Run
python extract_kmeans_features.py public_test
to extract features for the ICML 2013 multimodal learning contest's public te... | bsd-3-clause |
Alonzo-Coeus/bitcoin | qa/rpc-tests/maxuploadtarget.py | 7 | 10801 | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.mininode import *
from test_framework.test_framework import BitcoinTestFramework
from... | mit |
ltilve/chromium | tools/telemetry/telemetry/core/platform/cros_platform_backend.py | 8 | 4896 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.core.forwarders import cros_forwarder
from telemetry.core import platform
from telemetry.core.platform import cros_device
from telemetry.core.... | bsd-3-clause |
noironetworks/aci-integration-module | aim/db/migration/alembic_migrations/versions/0836fabb11ff_tenant_description.py | 1 | 1051 | # Copyright (c) 2017 Cisco Systems
# 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 require... | apache-2.0 |
fritzo/distributions | distributions/__init__.py | 1 | 1783 | # Copyright (c) 2014, Salesforce.com, 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... | bsd-3-clause |
thuydang/ocrfeeder | src/ocrfeeder/studio/pagesiconview.py | 1 | 6262 | # -*- coding: utf-8 -*-
###########################################################################
# OCRFeeder - The complete OCR suite
# Copyright (C) 2009-2013 Joaquim Rocha <me@joaquimrocha.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gen... | gpl-3.0 |
pim89/youtube-dl | youtube_dl/extractor/cliphunter.py | 16 | 2832 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import int_or_none
_translation_table = {
'a': 'h', 'd': 'e', 'e': 'v', 'f': 'o', 'g': 'f', 'i': 'd', 'l': 'n',
'm': 'a', 'n': 'm', 'p': 'u', 'q': 't', 'r': 's', 'v': 'p', 'x': 'r',
'y': 'l', 'z': 'i',
'$': ':', '&... | unlicense |
madecoste/swarming | appengine/components/PRESUBMIT.py | 2 | 2576 | # Copyright 2013 The Swarming Authors. All rights reserved.
# Use of this source code is governed by the Apache v2.0 license that can be
# found in the LICENSE file.
"""Top-level presubmit script for appengine/components/.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
details on the ... | apache-2.0 |
throwable-one/lettuce | tests/integration/lib/Django-1.3/django/db/models/sql/query.py | 22 | 81267 | """
Create SQL statements for QuerySets.
The code in here encapsulates all of the SQL construction so that QuerySets
themselves do not have to (and could be backed by things other than SQL
databases). The abstraction barrier only works one way: this module has to know
all about the internals of models in order to get ... | gpl-3.0 |
Mirantis/tempest | tempest/api/network/test_ports.py | 2 | 11841 | # Copyright 2014 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 |
CYBAI/servo | tests/wpt/web-platform-tests/tools/third_party/aioquic/examples/doq_server.py | 15 | 4816 | import argparse
import asyncio
import json
import logging
from typing import Dict, Optional
from dnslib.dns import DNSRecord
from aioquic.asyncio import QuicConnectionProtocol, serve
from aioquic.quic.configuration import QuicConfiguration
from aioquic.quic.connection import QuicConnection
from aioquic.quic.events im... | mpl-2.0 |
s-leroux/sql-moins | sqlm/console.py | 1 | 4149 | import os
import sys
import atexit
import readline
import traceback
#
# from https://docs.python.org/3/library/readline.html#example
#
histfile = os.path.join(os.path.expanduser("~"), ".sqlmoins_history")
try:
readline.read_history_file(histfile)
except FileNotFoundError:
pass
atexit.register(readline.write_h... | apache-2.0 |
AdrianGaudebert/socorro | e2e-tests/pages/crash_stats_per_day.py | 4 | 1587 | #!/usr/bin/env python
# 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 selenium.webdriver.common.by import By
from selenium.webdriver.support.select import Select... | mpl-2.0 |
horizon-institute/chariot | src/app/deployments/migrations/0005_deploymentthermostatsetting.py | 1 | 1068 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-10-16 12:28
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('deployments', '0004_deployment_prediction')... | mit |
YelaSeamless/mysql-connector-python | tests/test_pep249.py | 13 | 19815 | # MySQL Connector/Python - MySQL driver written in Python.
# Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
# MySQL Connector/Python is licensed under the terms of the GPLv2
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
# MySQL Connectors. There are special exceptio... | gpl-2.0 |
caioserra/apiAdwords | examples/adspygoogle/dfp/v201311/suggested_ad_unit_service/get_suggested_ad_units_by_statement.py | 2 | 2109 | #!/usr/bin/python
#
# Copyright 2013 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 |
abougouffa/alfanous | src/alfanous/Support/whoosh/writing.py | 6 | 8337 | #===============================================================================
# Copyright 2007 Matt Chaput
#
# 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/li... | agpl-3.0 |
openjck/kuma | kuma/core/tasks.py | 25 | 1707 | from celery.task import task
from django.db import connection
from django.contrib.sessions.models import Session
from django.utils import timezone
from constance import config
from .cache import memcache
from .models import IPBan
LOCK_ID = 'clean-sessions-lock'
LOCK_EXPIRE = 60 * 5
def get_expired_sessions(now):... | mpl-2.0 |
ccn-2m/django | tests/regressiontests/forms/tests/widgets.py | 20 | 70193 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import copy
import datetime
from django.contrib.admin.tests import AdminSeleniumWebDriverTestCase
from django.core.files.uploadedfile import SimpleUploadedFile
from django.core.urlresolvers import reverse
from django.forms import *
from django.forms.widg... | bsd-3-clause |
GheRivero/ansible | test/sanity/code-smell/no-smart-quotes.py | 23 | 1133 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
import sys
def main():
skip = set([
'test/sanity/code-smell/%s' % os.path.basename(__file__),
'docs/docsite/rst/dev_guide/testing/sanity/no-smart-quotes.rst',
'test/integration/targets/unicode/unicode.yml',
'test/in... | gpl-3.0 |
ProfessionalIT/professionalit-webiste | sdk/google_appengine/google/appengine/tools/devappserver2/java_application.py | 4 | 1715 | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | lgpl-3.0 |
Karaage-Cluster/karaage-debian | karaage/legacy/applications/south_migrations/0016_move_applications.py | 3 | 21043 | # -*- coding: utf-8 -*-
from south.db import db
from south.v2 import DataMigration
class Migration(DataMigration):
depends_on = (
('projects', '0007_migrate_groups'),
('people', '0016_auto__add_field_person_legacy_ldap_password'),
)
def forwards(self, orm):
""" Move UserApplicati... | gpl-3.0 |
perzizzle/ansible-modules-extras | cloud/cloudstack/cs_securitygroup_rule.py | 3 | 14744 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.net>
#
# 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 Lice... | gpl-3.0 |
MechanicsMingYan/MProtect | capstone/bindings/python/capstone/systemz.py | 20 | 1064 | # Capstone Python bindings, by Nguyen Anh Quynnh <aquynh@gmail.com>
import ctypes
from . import copy_ctypes_list
from .sysz_const import *
# define the API
class SyszOpMem(ctypes.Structure):
_fields_ = (
('base', ctypes.c_uint8),
('index', ctypes.c_uint8),
('length', ctypes.c_uint64),
... | mit |
atmark-techno/atmark-dist | user/python/Lib/dos-8x3/cookie.py | 8 | 24706 | #!/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 appear i... | gpl-2.0 |
mgagne/nova | nova/api/openstack/compute/contrib/rescue.py | 7 | 4012 | # Copyright 2011 OpenStack Foundation
#
# 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 |
mvanderkroon/cobr | common/objects.py | 2 | 8810 | from sqlalchemy import Column, Integer, String, Float, DateTime
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import event
import datetime, math
import numpy as np
Base = declarative_base()
multistring_separator = '|' # used to combine multi column keys in fields
def typestring(value):
... | apache-2.0 |
opendatadurban/scoda | scoda/templates/static/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(... | apache-2.0 |
Changaco/oh-mainline | vendor/packages/requests/requests/packages/chardet/jisfreq.py | 3131 | 47315 | ######################## 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 |
mensler/ansible | lib/ansible/modules/storage/netapp/sf_snapshot_schedule_manager.py | 42 | 13318 | #!/usr/bin/python
# (c) 2017, NetApp, 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.
... | gpl-3.0 |
maciejkula/scipy | scipy/special/__init__.py | 10 | 21535 | """
========================================
Special functions (:mod:`scipy.special`)
========================================
.. module:: scipy.special
Nearly all of the functions below are universal functions and follow
broadcasting and automatic array-looping rules. Exceptions are noted.
Error handling
==========... | bsd-3-clause |
sserrot/champion_relationships | venv/Lib/site-packages/cassiopeia/datastores/kernel/status.py | 3 | 2818 | from typing import Type, TypeVar, MutableMapping, Any, Iterable, Generator
from datapipelines import DataSource, PipelineContext, Query, NotFoundError, validate_query
from .common import KernelSource, APINotFoundError
from ...data import Platform, Region
from ...dto.staticdata.version import VersionListDto
from ...dto... | mit |
Yuudachimoe/HikariChun-RedBot | lib/youtube_dl/extractor/vodplatform.py | 62 | 1424 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import unescapeHTML
class VODPlatformIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?vod-platform\.net/[eE]mbed/(?P<id>[^/?#]+)'
_TEST = {
# from http://www.lbcgroup.tv/watch/chapter/29143/5284... | gpl-3.0 |
akintoey/django | django/contrib/gis/geos/libgeos.py | 345 | 6218 | """
This module houses the ctypes initialization procedures, as well
as the notice and error handler function callbacks (get called
when an error occurs in GEOS).
This module also houses GEOS Pointer utilities, including
get_pointer_arr(), and GEOM_PTR.
"""
import logging
import os
import re
from ctypes import CD... | bsd-3-clause |
ysung-pivotal/incubator-hawq | tools/sbin/gpsegtoprimaryormirror.py | 30 | 6753 | #!/usr/bin/env python
#
# Copyright (c) Greenplum Inc 2008. All Rights Reserved.
#
#
# Internal Use Function.
#
#
# THIS IMPORT MUST COME FIRST
#
# import mainUtils FIRST to get python version check
from gppylib.mainUtils import *
import os, sys
import pickle, base64
from optparse import Option, OptionGroup, OptionP... | apache-2.0 |
orozcoadrian/xpython | octal/octal_test.py | 10 | 1338 | """Tests for the octal exercise
Implementation note:
If the string supplied to parse_octal cannot be parsed as an octal number
your program should raise a ValueError with a meaningful error message.
"""
import unittest
from octal import parse_octal
class OctalTest(unittest.TestCase):
def test_octal_1_is_decimal... | mit |
alazaro/tennis_tournament | django/utils/simplejson/__init__.py | 324 | 14306 | r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
:mod:`simplejson` exposes an API familiar to users of the standard library
:mod:`marshal` and :mod:`pickle` modules. It is the externally maintained
version of ... | gpl-3.0 |
skilledindia/autokey | src/lib/gtkui/configwindow.py | 46 | 66920 | # -*- coding: utf-8 -*-
# Copyright (C) 2011 Chris Dekter
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This pr... | gpl-3.0 |
gandelman-a/neutron-lbaas | neutron_lbaas/tests/tempest/lib/test.py | 1 | 34144 | # 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 |
isandlaTech/cohorte-demos | led/dump/led-demo-raspberry/cohorte/demos/led2/led-raspberry/repo/serial/serialjava.py | 151 | 9284 | #!jython
#
# Python Serial Port Extension for Win32, Linux, BSD, Jython
# module for serial IO for Jython and JavaComm
# see __init__.py
#
# (C) 2002-2008 Chris Liechti <cliechti@gmx.net>
# this is distributed under a free software license, see license.txt
from serial.serialutil import *
def my_import(name):
mod ... | apache-2.0 |
Nick-OpusVL/odoo | addons/l10n_fr_hr_payroll/l10n_fr_hr_payroll.py | 340 | 2012 | #-*- 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 |
pombredanne/voc | voc/java/klass.py | 7 | 23605 | import struct
from .attributes import Attribute
from .constants import Classref, ConstantPool
from .fields import Field
from .methods import Method
# From: http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html
##########################################################################
# Chapter 4: The class ... | bsd-3-clause |
CloudBoltSoftware/cloudbolt-forge | ui_extensions/solar_winds/forms.py | 1 | 3322 | from django import forms
from django.utils.translation import ugettext as _, ugettext_lazy as _lazy
from utilities.forms import ConnectionInfoForm
from utilities.models import ConnectionInfo
from xui.solar_winds.solar_winds_helper import SolarWindsManager
from xui.solar_winds import views
class SolarWindsConectionFor... | apache-2.0 |
2uller/LotF | App/Lib/site-packages/numpy/distutils/exec_command.py | 4 | 19236 | #!/usr/bin/env python
"""
exec_command
Implements exec_command function that is (almost) equivalent to
commands.getstatusoutput function but on NT, DOS systems the
returned status is actually correct (though, the returned status
values may be different by a factor). In addition, exec_command
takes keyword arguments fo... | gpl-2.0 |
mattrobenolt/warehouse | tests/test_http.py | 3 | 1301 | # Copyright 2013 Donald Stufft
#
# 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, so... | apache-2.0 |
dmach/dnf | tests/test_cli_format.py | 5 | 2277 | # -*- coding: utf-8 -*-
# Copyright (C) 2012-2018 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed ... | gpl-2.0 |
harshadjs/wget-xia | testenv/Test-cookie-expires.py | 13 | 2125 | #!/usr/bin/env python3
from sys import exit
from test.http_test import HTTPTest
from misc.wget_file import WgetFile
"""
This test ensures that Wget handles Cookie expiry dates correctly.
Simultaneuously, we also check if multiple cookies to the same domain
are handled correctly
"""
TEST_NAME = "Cookie Expi... | gpl-3.0 |
ee08b397/panda3d | contrib/src/sceneeditor/seSession.py | 8 | 35894 | #################################################################
# seSession.py
# Originally from DirectSession.py
# Altered by Yi-Hong Lin, yihhongl@andrew.cmu.edu, 2004
#
# We took out a lot of stuff we don't need in the sceneeditor.
# This is also the main reason we didn't just inherite the original directSession.
... | bsd-3-clause |
BigDataforYou/movie_recommendation_workshop_1 | big_data_4_you_demo_1/venv/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.py | 1724 | 14031 | """Module for supporting the lxml.etree library. The idea here is to use as much
of the native library as possible, without using fragile hacks like custom element
names that break between releases. The downside of this is that we cannot represent
all possible trees; specifically the following are known to cause proble... | mit |
frootloops/swift | test/Driver/Dependencies/Inputs/fake-build-for-bitcode.py | 72 | 1277 | #!/usr/bin/env python
# fake-build-for-bitcode.py - Fake build with -embed-bitcode -*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://s... | apache-2.0 |
zhhf/charging | charging/openstack/common/rpc/common.py | 1 | 18424 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright 2011 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the ... | apache-2.0 |
Dhivyap/ansible | test/units/modules/network/fortios/test_fortios_switch_controller_switch_group.py | 21 | 8079 | # Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.