repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
lostemp/lsk-3.4-android-12.09 | 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 |
LaRiffle/axa_challenge | fonction_py/train.py | 1 | 12400 | from fonction_py.tools import *
from fonction_py.preprocess import *
from sklearn import linear_model
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn import cross_validation
from sklearn.linear_model import LogisticRegression
from sklearn import tree
from sklearn import svm
from skle... | mit |
pkats15/hdt_analyzer | django_test/django_venv/Lib/site-packages/setuptools/depends.py | 462 | 6370 | import sys
import imp
import marshal
from imp import PKG_DIRECTORY, PY_COMPILED, PY_SOURCE, PY_FROZEN
from distutils.version import StrictVersion
from setuptools import compat
__all__ = [
'Require', 'find_module', 'get_module_constant', 'extract_constant'
]
class Require:
"""A prerequisite to building or inst... | mit |
gautam1858/tensorflow | tensorflow/python/keras/layers/pooling_test.py | 10 | 7660 | # 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 |
superstack/nova | nova/tests/__init__.py | 2 | 2501 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | apache-2.0 |
adrienbrault/home-assistant | homeassistant/components/zwave_js/config_flow.py | 3 | 15849 | """Config flow for Z-Wave JS integration."""
from __future__ import annotations
import asyncio
import logging
from typing import Any, cast
import aiohttp
from async_timeout import timeout
import voluptuous as vol
from zwave_js_server.version import VersionInfo, get_server_version
from homeassistant import config_ent... | mit |
vnc-biz/pyzimbra | pyzimbra/soap_auth.py | 2 | 6473 | # -*- coding: utf-8 -*-
"""
################################################################################
# Copyright (c) 2010, Ilgar Mashayev
#
# E-mail: pyzimbra@lab.az
# Website: http://github.com/ilgarm/pyzimbra
################################################################################
# This file is part ... | lgpl-3.0 |
nonamenix/yandex-vesna-generator | yandex_vesna_generator/vesna.py | 1 | 2537 | # -*- coding: utf-8 -*-
from lxml import etree
from slugify import slugify
class Entry(object):
def __init__(self, title="", paragraphs=[], themes=[], **kwargs):
self.title = title
self.paragraphs = paragraphs
self.themes = themes
self.header_wrapper = kwargs.get("header_wrapper", ... | apache-2.0 |
raphael0202/spaCy | spacy/language.py | 2 | 15085 | # coding: utf8
from __future__ import absolute_import, unicode_literals
from contextlib import contextmanager
import shutil
from .tokenizer import Tokenizer
from .vocab import Vocab
from .tagger import Tagger
from .matcher import Matcher
from .lemmatizer import Lemmatizer
from .train import Trainer
from .syntax.parser... | mit |
sysalexis/kbengine | kbe/res/scripts/common/Lib/site-packages/pip/commands/freeze.py | 345 | 4664 | import re
import sys
import pip
from pip.req import InstallRequirement
from pip.log import logger
from pip.basecommand import Command
from pip.util import get_installed_distributions
from pip._vendor import pkg_resources
class FreezeCommand(Command):
"""Output installed packages in requirements format."""
na... | lgpl-3.0 |
SlimRoms/kernel_motorola_msm8960-common | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | 3246 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... | gpl-2.0 |
npe9/depot_tools | third_party/gsutil/gslib/commands/rm.py | 50 | 8989 | # Copyright 2011 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 a... | bsd-3-clause |
marcelovilaca/DIRAC | ConfigurationSystem/Client/CSAPI.py | 2 | 27658 | """ CSAPI exposes update functionalities to the Configuration.
Most of these functions can only be done by administrators
"""
__RCSID__ = "$Id$"
import types
from DIRAC import gLogger, gConfig, S_OK, S_ERROR
from DIRAC.Core.DISET.RPCClient import RPCClient
from DIRAC.Core.Utilities import List
from DIRAC.Core.S... | gpl-3.0 |
SoVictor/Lerna | core/urls.py | 3 | 1511 | from django.conf.urls import url
from .views import (
ContestIndexView, TrainingIndexView, TrainingView, ProblemView, AttemptsView,
AttemptDetailsView, SubmitView, StandingsView, UnfrozenStandingsView, XMLStandingsView,
UnfrozenXMLStandingsView, ClarificationsView,
)
def _url(regex, cls, name):
retur... | gpl-2.0 |
razorpay/razorpay-python | tests/test_client_utility.py | 1 | 1858 | import responses
from .helpers import mock_file, ClientTestCase
from razorpay.errors import SignatureVerificationError
class TestClientValidator(ClientTestCase):
def setUp(self):
super(TestClientValidator, self).setUp()
@responses.activate
def test_verify_payment_signature(self):
sig = ... | mit |
ridfrustum/lettuce | tests/integration/lib/Django-1.3/django/contrib/staticfiles/utils.py | 160 | 1802 | import os
import fnmatch
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
def is_ignored(path, ignore_patterns=[]):
"""
Return True or False depending on whether the ``path`` should be
ignored (if it matches any pattern in ``ignore_patterns``).
"""
for patter... | gpl-3.0 |
hsaputra/tensorflow | tensorflow/contrib/tensor_forest/python/tensor_forest_test.py | 32 | 5484 | # 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 |
wkubiak/grpc | src/python/src/grpc/framework/alpha/interfaces.py | 36 | 13412 | # Copyright 2015, 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 f... | bsd-3-clause |
nosuchtim/VizBench | src/PyLoopyCam/testit.py | 1 | 5268 | """
Copyright (c) 2015, Tim Thompson
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 followi... | mit |
courtarro/gnuradio | grc/gui/Block.py | 11 | 13166 | """
Copyright 2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion 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... | gpl-3.0 |
AutorestCI/azure-sdk-for-python | azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/storage_account.py | 2 | 1050 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
AnimeshSinha1309/WebsiteEdunet | WebsiteEdunet/env/Lib/site-packages/django/contrib/gis/gdal/base.py | 654 | 1179 | from ctypes import c_void_p
from django.contrib.gis.gdal.error import GDALException
from django.utils import six
class GDALBase(object):
"""
Base object for GDAL objects that has a pointer access property
that controls access to the underlying C pointer.
"""
# Initially the pointer is NULL.
_... | mit |
juntalis/aio-pika | docs/source/rabbitmq-tutorial/examples/3-publish-subscribe/receive_logs.py | 1 | 1064 | import asyncio
from aio_pika import connect, IncomingMessage, ExchangeType
loop = asyncio.get_event_loop()
def on_message(message: IncomingMessage):
with message.process():
print("[x] %r" % message.body)
async def main():
# Perform connection
connection = await connect("amqp://guest:guest@local... | apache-2.0 |
quantmind/pulsar-queue | pq/utils/version.py | 7 | 1595 | import datetime
import os
import subprocess
symbol = {'alpha': 'a', 'beta': 'b'}
def get_version(version, filename=None):
assert len(version) == 5
assert version[3] in ('alpha', 'beta', 'rc', 'final')
main = '.'.join(map(str, version[:3]))
sub = ''
if version[3] == 'alpha' and version[4] == 0:
... | bsd-3-clause |
cogmission/nupic | src/nupic/frameworks/opf/predictionmetricsmanager.py | 32 | 16625 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
saurabh3949/mxnet | tests/python/unittest/test_module.py | 3 | 29730 | # 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 |
salomon1184/bite-project | deps/gdata-python-client/samples/apps/marketplace_sample/gdata/tlslite/utils/Python_RSAKey.py | 239 | 7707 | """Pure-Python RSA implementation."""
from cryptomath import *
import xmltools
from ASN1Parser import ASN1Parser
from RSAKey import *
class Python_RSAKey(RSAKey):
def __init__(self, n=0, e=0, d=0, p=0, q=0, dP=0, dQ=0, qInv=0):
if (n and not e) or (e and not n):
raise AssertionError()
... | apache-2.0 |
solashirai/edx-platform | cms/djangoapps/contentstore/tests/test_contentstore.py | 15 | 93797 | # -*- coding: utf-8 -*-
import copy
import mock
from mock import patch
import shutil
import lxml.html
from lxml import etree
import ddt
from datetime import timedelta
from fs.osfs import OSFS
from json import loads
from path import Path as path
from textwrap import dedent
from uuid import uuid4
from functools import ... | agpl-3.0 |
marqueedev/django | tests/utils_tests/test_regex_helper.py | 448 | 1784 | from __future__ import unicode_literals
import unittest
from django.utils import regex_helper
class NormalizeTests(unittest.TestCase):
def test_empty(self):
pattern = r""
expected = [('', [])]
result = regex_helper.normalize(pattern)
self.assertEqual(result, expected)
def te... | bsd-3-clause |
scripni/rethinkdb | test/rql_test/connections/http_support/jinja2/testsuite/lexnparse.py | 402 | 22314 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.lexnparse
~~~~~~~~~~~~~~~~~~~~~~~~~~
All the unittests regarding lexing, parsing and syntax.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import unittest
from jinja2.testsuite import JinjaTestCase
from jinja... | agpl-3.0 |
valexandersaulys/airbnb_kaggle_contest | venv/lib/python3.4/site-packages/setuptools/msvc9_support.py | 429 | 2187 | try:
import distutils.msvc9compiler
except ImportError:
pass
unpatched = dict()
def patch_for_specialized_compiler():
"""
Patch functions in distutils.msvc9compiler to use the standalone compiler
build for Python (Windows only). Fall back to original behavior when the
standalone compiler is no... | gpl-2.0 |
Panos512/invenio | modules/miscutil/lib/sequtils_regression_tests.py | 16 | 7833 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 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 ... | gpl-2.0 |
spotify/cobbler | cobbler/modules/authn_configfile.py | 3 | 2386 | """
Authentication module that uses /etc/cobbler/auth.conf
Choice of authentication module is in /etc/cobbler/modules.conf
Copyright 2007-2009, Red Hat, Inc and Others
Michael DeHaan <michael.dehaan AT gmail>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Pu... | gpl-2.0 |
NuxiNL/linux | tools/perf/tests/attr.py | 1266 | 9424 | #! /usr/bin/python
import os
import sys
import glob
import optparse
import tempfile
import logging
import shutil
import ConfigParser
class Fail(Exception):
def __init__(self, test, msg):
self.msg = msg
self.test = test
def getMsg(self):
return '\'%s\' - %s' % (self.test.path, self.msg)... | gpl-2.0 |
aristeu/linux-2.6 | tools/testing/selftests/drivers/net/mlxsw/sharedbuffer_configuration.py | 119 | 12654 | #!/usr/bin/python
# SPDX-License-Identifier: GPL-2.0
import subprocess
import json as j
import random
class SkipTest(Exception):
pass
class RandomValuePicker:
"""
Class for storing shared buffer configuration. Can handle 3 different
objects, pool, tcbind and portpool. Provide an interface to get ra... | gpl-2.0 |
griddynamics/bunch | lettuce_bunch/dependencies.py | 1 | 2875 | # -*- coding: utf-8 -*-
# <Bunch - BDD test tool for Lettuce scenarios>
# Copyright (c) 2012 Grid Dynamics Consulting Services, Inc, All Rights Reserved
# http://www.griddynamics.com
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as ... | gpl-3.0 |
tonyshardlow/reg_sde | run_pf.py | 1 | 1560 | from __future__ import (absolute_import, division,
print_function, unicode_literals)
exec(open("ground.py").read())
# mine
import hamiltonian
import diffeo
import sde
from utility import *
#
#
# all data defined in utility (exp2,...)
#
def run(dict):
import os.path
if 'fnam... | mit |
austinharris/gem5-riscv | ext/ply/test/yacc_error3.py | 174 | 1485 | # -----------------------------------------------------------------------------
# yacc_error3.py
#
# Bad p_error() function
# -----------------------------------------------------------------------------
import sys
if ".." not in sys.path: sys.path.insert(0,"..")
import ply.yacc as yacc
from calclex import tokens
# ... | bsd-3-clause |
usakhelo/FreeCAD | src/Tools/MakeAppTools.py | 32 | 2611 | import os, sys, re,string,FCFileTools
verbose = 0
dcount = fcount = 0
def replaceTemplate(dirName, oldName, newName):
"""
modify contents from dirName and below, replace oldName by newName
"""
for file in os.listdir(dirName):
pathName = os.path.join(dirName, file)
if not os.path.isdir(pathName):
... | lgpl-2.1 |
fernandog/Medusa | ext/pbr/util.py | 9 | 23178 | # 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | gpl-3.0 |
ge0rgi/cinder | cinder/tests/unit/image/test_cache.py | 1 | 12125 | # Copyright (C) 2015 Pure Storage, 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 la... | apache-2.0 |
Maximilian-Reuter/SickRage-1 | lib/github/Notification.py | 74 | 5593 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2013 AKFish <akfish@gmail.com> #
# Copyright 2013 Peter Golm <golm.peter@gmail.com> ... | gpl-3.0 |
badpass/ansible-modules-core | cloud/amazon/_ec2_ami_search.py | 75 | 6407 | #!/usr/bin/python
#
# (c) 2013, Nimbis Services
#
# 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 ver... | gpl-3.0 |
SantosDevelopers/sborganicos | venv/lib/python3.5/site-packages/django/core/management/templates.py | 57 | 14053 | import cgi
import errno
import io
import mimetypes
import os
import posixpath
import re
import shutil
import stat
import sys
import tempfile
from os import path
import django
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.core.management.utils import hand... | mit |
xbed/Mixly_Arduino | mixly_arduino/mpBuild/ESP32_MixGo/lib/mixgo.py | 1 | 5214 | from machine import Pin
from machine import PWM
from machine import ADC
from machine import DAC
from machine import I2C
from machine import Timer
from machine import RTC
from machine import TouchPad
import time
from neopixel import NeoPixel
def get_brightness(pin = 39):
return ADCSensor(pin).read()
def get_soundl... | apache-2.0 |
sudkannan/xen-hv | dist/install/usr/lib64/python2.6/site-packages/xen/xend/server/vfbif.py | 43 | 3171 | from xen.xend.server.DevController import DevController
from xen.xend.XendLogging import log
from xen.xend.XendError import VmError
import xen.xend
import os
CONFIG_ENTRIES = ['type', 'vncdisplay', 'vnclisten', 'vncpasswd', 'vncunused',
'display', 'xauthority', 'keymap', 'vnc', 'sdl', 'uuid',
... | gpl-2.0 |
tomasdubec/openstack-cinder | cinder/tests/api/test_xmlutil.py | 4 | 25565 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/... | apache-2.0 |
sbalde/edxplatform | lms/djangoapps/open_ended_grading/utils.py | 63 | 7288 | import logging
from urllib import urlencode
from xmodule.modulestore import search
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.exceptions import ItemNotFoundError, NoPathToItem
from xmodule.open_ended_grading_classes.controller_query_service import ControllerQueryService
from xmodule.op... | agpl-3.0 |
ZeYt/mitmproxy | libmproxy/console/searchable.py | 29 | 2808 | import urwid
from . import signals
class Highlight(urwid.AttrMap):
def __init__(self, t):
urwid.AttrMap.__init__(
self,
urwid.Text(t.text),
"focusfield",
)
self.backup = t
class Searchable(urwid.ListBox):
def __init__(self, state, contents):
... | mit |
nopjmp/SickRage | lib/github/NotificationSubject.py | 74 | 3304 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2013 AKFish <akfish@gmail.com> #
# Copyright 2013 Vincent Jacques <vincent@vincent-ja... | gpl-3.0 |
xxd3vin/spp-sdk | opt/Python27/Lib/test/test_userdict.py | 118 | 10636 | # Check every path through every method of UserDict
from test import test_support, mapping_tests
import UserDict
d0 = {}
d1 = {"one": 1}
d2 = {"one": 1, "two": 2}
d3 = {"one": 1, "two": 3, "three": 5}
d4 = {"one": None, "two": None}
d5 = {"one": 1, "two": 1}
class UserDictTest(mapping_tests.TestHashMappingProtocol):... | mit |
sarnold/exaile | plugins/previewdevice/__init__.py | 2 | 12544 | # Copyright (C) 2012 Dustin Spicuzza
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the ho... | gpl-2.0 |
kawamon/hue | apps/sqoop/src/sqoop/api/autocomplete.py | 35 | 2241 | #!/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 |
tea321000/django-project | musicsite/music/migrations/0002_auto_20170305_2121.py | 1 | 1364 | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-03-05 13:21
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('music', '0001_initial'),
]
operations = [
mi... | mit |
m1ck/bookadoptions | django/contrib/contenttypes/management.py | 315 | 2458 | from django.contrib.contenttypes.models import ContentType
from django.db.models import get_apps, get_models, signals
from django.utils.encoding import smart_unicode
def update_contenttypes(app, created_models, verbosity=2, **kwargs):
"""
Creates content types for models in the given app, removing any model
... | bsd-3-clause |
errx/django | tests/distinct_on_fields/tests.py | 17 | 5611 | from __future__ import unicode_literals
from django.db.models import Max
from django.test import TestCase, skipUnlessDBFeature
from django.test.utils import str_prefix
from .models import Tag, Celebrity, Fan, Staff, StaffTag
@skipUnlessDBFeature('can_distinct_on_fields')
class DistinctOnTests(TestCase):
def set... | bsd-3-clause |
acq4/acq4 | acq4/modules/DataManager/FileInfoViewTemplate.py | 3 | 2242 | # -*- coding: utf-8 -*-
from __future__ import print_function
# Form implementation generated from reading ui file './acq4/modules/DataManager/FileInfoViewTemplate.ui'
#
# Created: Tue Dec 24 01:49:10 2013
# by: PyQt4 UI code generator 4.10
#
# WARNING! All changes made in this file will be lost!
from PyQt4 impo... | mit |
mustafat/odoo-1 | addons/stock/procurement.py | 227 | 22183 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
mdj2/django | django/conf/urls/__init__.py | 107 | 2601 | from django.core.urlresolvers import (RegexURLPattern,
RegexURLResolver, LocaleRegexURLResolver)
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
from django.utils import six
__all__ = ['handler400', 'handler403', 'handler404', 'handler500', 'include', 'patt... | bsd-3-clause |
mRokita/DPLib | dplib/server.py | 1 | 47676 | # DPLib - Asynchronous bot framework for Digital Paint: Paintball 2 servers
# Copyright (C) 2017 Michał Rokita
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the L... | agpl-3.0 |
4shadoww/hakkuframework | core/lib/requests/packages/urllib3/packages/backports/makefile.py | 339 | 1461 | # -*- coding: utf-8 -*-
"""
backports.makefile
~~~~~~~~~~~~~~~~~~
Backports the Python 3 ``socket.makefile`` method for use with anything that
wants to create a "fake" socket object.
"""
import io
from socket import SocketIO
def backport_makefile(self, mode="r", buffering=None, encoding=None,
... | mit |
0k/odoo | addons/event/wizard/__init__.py | 435 | 1067 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
FlukeNetworks/snackers-kernel | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
dbckz/ansible | lib/ansible/utils/module_docs_fragments/dellos6.py | 303 | 2451 | #
# (c) 2015, Peter Sprygada <psprygada@ansible.com>
#
# Copyright (c) 2016 Dell 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 Licens... | gpl-3.0 |
django-notifications/django-notifications | notifications/tests/urls.py | 2 | 1821 | ''' Django notification urls for tests '''
# -*- coding: utf-8 -*-
from distutils.version import StrictVersion # pylint: disable=no-name-in-module,import-error
from django import get_version
from django.contrib import admin
from notifications.tests.views import (live_tester, # pylint: disable=no-name-in-module,impor... | bsd-3-clause |
mgeorgehansen/FIFE_Technomage | engine/python/fife/extensions/fife_settings.py | 1 | 15915 | # -*- coding: utf-8 -*-
# ####################################################################
# Copyright (C) 2005-2010 by the FIFE team
# http://www.fifengine.net
# This file is part of FIFE.
#
# FIFE is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#... | lgpl-2.1 |
lmazuel/ansible | lib/ansible/utils/encrypt.py | 37 | 6565 | # (c) 2012-2014, 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) an... | gpl-3.0 |
tiagofrepereira2012/tensorflow | tensorflow/contrib/tpu/python/tpu/tpu_optimizer.py | 13 | 3848 | # 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 |
rrrene/django | tests/utils_tests/test_ipv6.py | 332 | 2831 | from __future__ import unicode_literals
import unittest
from django.utils.ipv6 import clean_ipv6_address, is_valid_ipv6_address
class TestUtilsIPv6(unittest.TestCase):
def test_validates_correct_plain_address(self):
self.assertTrue(is_valid_ipv6_address('fe80::223:6cff:fe8a:2e8a'))
self.assertT... | bsd-3-clause |
simplyguru-dot/ansible | lib/ansible/plugins/lookup/pipe.py | 184 | 1866 | # (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.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 |
wkritzinger/asuswrt-merlin | release/src/router/samba3/source/stf/strings.py | 55 | 5889 | #! /usr/bin/python
# Comfychair test cases for Samba string functions.
# Copyright (C) 2003 by Martin Pool <mbp@samba.org>
#
# 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 versio... | gpl-2.0 |
quait/madcow | madcow/include/simplejson/decoder.py | 296 | 15152 | """Implementation of JSONDecoder
"""
import re
import sys
import struct
from simplejson.scanner import make_scanner
def _import_c_scanstring():
try:
from simplejson._speedups import scanstring
return scanstring
except ImportError:
return None
c_scanstring = _import_c_scanstring()
__all... | gpl-3.0 |
takeshineshiro/heat | heat/common/messaging.py | 13 | 4273 | # -*- coding: utf-8 -*-
# Copyright 2013 eNovance <licensing@enovance.com>
#
# 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 requi... | apache-2.0 |
georgewhewell/CouchPotatoServer | couchpotato/core/notifications/pushbullet/main.py | 4 | 2483 | from couchpotato.core.helpers.encoding import toUnicode
from couchpotato.core.helpers.variable import tryInt
from couchpotato.core.logger import CPLog
from couchpotato.core.notifications.base import Notification
import base64
import json
log = CPLog(__name__)
class Pushbullet(Notification):
url = 'https://api.p... | gpl-3.0 |
EDUlib/edx-ora2 | test/acceptance/auto_auth.py | 7 | 2426 | """
Auto-auth page (used to automatically log in during testing).
"""
import re
import urllib
from bok_choy.page_object import PageObject
import os
BASE_URL = os.environ.get('BASE_URL')
class AutoAuthPage(PageObject):
"""
The automatic authorization page.
When allowed via the django settings file, visit... | agpl-3.0 |
kevinlondon/sentry | src/sentry/migrations/0009_auto__add_field_message_message_id.py | 36 | 4502 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Message.message_id'
db.add_column('sentry_message', 'message_id', self.gf('django.db.models.fields... | bsd-3-clause |
hojel/calibre | src/calibre/gui2/metadata/single_download.py | 11 | 42340 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
DEBUG_DIALOG ... | gpl-3.0 |
aenon/OnlineJudge | leetcode/5.BitManipulation/477.TotalHammingDistance.py | 1 | 1100 | # 477. Total Hamming Distance
# The Hamming distance between two integers is the number of positions at which the corresponding bits are different.
# Now your job is to find the total Hamming distance between all pairs of the given numbers.
# Example:
# Input: 4, 14, 2
# Output: 6
# Explanation: In binary represe... | mit |
M4sse/chromium.src | tools/memory_inspector/memory_inspector/data/file_storage_unittest.py | 89 | 5331 | # 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.
"""This unittest covers both file_storage and serialization modules."""
import os
import tempfile
import time
import unittest
from memory_inspector.core im... | bsd-3-clause |
yongshengwang/builthue | desktop/core/ext-py/tablib-develop/tablib/packages/xlwt3/Worksheet.py | 46 | 43958 | '''
BOF
UNCALCED
INDEX
Calculation Settings Block
PRINTHEADERS
PRINTGRIDLINES
GRIDSET
GUTS
DEFAULTROWHEIGHT
WSBOOL
Page Settings Block
Worksheet Protection Block
... | apache-2.0 |
f-prettyland/angr | angr/engines/vex/statements/loadg.py | 1 | 2392 | from .... import sim_options as o
from ....state_plugins.sim_action_object import SimActionObject
from ....state_plugins.sim_action import SimActionData
from . import SimIRStmt, SimStatementError
class SimIRStmt_LoadG(SimIRStmt):
def _execute(self):
addr = self._translate_expr(self.stmt.addr)
alt ... | bsd-2-clause |
camradal/ansible-modules-extras | packaging/language/bower.py | 75 | 7251 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Michael Warkentin <mwarkentin@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of ... | gpl-3.0 |
fcheslack/libZotero | lib/py/test/test_library.py | 2 | 2406 | import sys
sys.path.append('../')
import unittest
from libZotero import zotero
class TestApiUrlBuilding(unittest.TestCase):
def test_apiurls(self):
config = {'target': 'collections', 'libraryType': 'user', 'libraryID': 1, 'content': 'json', 'limit': '100'}
self.assertEqual(zotero.apiRequestUrl(co... | agpl-3.0 |
gnowxilef/youtube-dl | youtube_dl/extractor/playvid.py | 64 | 3299 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse_unquote,
compat_urllib_parse_unquote_plus,
)
from ..utils import (
clean_html,
ExtractorError,
)
class PlayvidIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?playvi... | unlicense |
cvium/Flexget | tests/test_delay.py | 22 | 1040 | from __future__ import unicode_literals, division, absolute_import
from datetime import timedelta
from tests import FlexGetBase
from flexget.manager import Session
from flexget.plugins.filter.delay import DelayedEntry
class TestDelay(FlexGetBase):
__yaml__ = """
tasks:
test:
mock:
... | mit |
karek314/bitcoin | contrib/testgen/base58.py | 2139 | 2818 | '''
Bitcoin base58 encoding and decoding.
Based on https://bitcointalk.org/index.php?topic=1026.0 (public domain)
'''
import hashlib
# for compatibility with following code...
class SHA256:
new = hashlib.sha256
if str != bytes:
# Python 3.x
def ord(c):
return c
def chr(n):
return byte... | mit |
PriceChild/ansible | lib/ansible/modules/web_infrastructure/ansible_tower/tower_credential.py | 33 | 9476 | #!/usr/bin/python
#coding: utf-8 -*-
# (c) 2017, Wayne Witzel III <wayne@riotousliving.com>
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your optio... | gpl-3.0 |
tkurnosova/selenium | py/selenium/webdriver/remote/command.py | 64 | 5715 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
mtlchun/edx | cms/djangoapps/contentstore/management/commands/tests/test_create_course.py | 137 | 2495 | """
Unittests for creating a course in an chosen modulestore
"""
import unittest
import ddt
from django.core.management import CommandError, call_command
from contentstore.management.commands.create_course import Command
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.django_utils import... | agpl-3.0 |
Dhivyap/ansible | lib/ansible/modules/storage/purestorage/purefa_pg.py | 21 | 17987 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Simon Dodsley (simon@purestorage.com)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_versi... | gpl-3.0 |
Pennebaker/wagtail | wagtail/wagtailadmin/views/userbar.py | 19 | 2436 | import warnings
from django.shortcuts import render
from django.contrib.auth.decorators import permission_required
from wagtail.wagtailadmin.userbar import EditPageItem, AddPageItem, ApproveModerationEditPageItem, RejectModerationEditPageItem
from wagtail.wagtailcore import hooks
from wagtail.wagtailcore.models impor... | bsd-3-clause |
tellesnobrega/sahara | sahara/service/validation.py | 3 | 6298 | # Copyright (c) 2013 Mirantis 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 writ... | apache-2.0 |
moozilla/dvcticker | dvcticker/main.py | 1 | 12328 | #todo: raise exceptions, then catch them to generate error images
import webapp2
from google.appengine.api import urlfetch
import json
from PIL import Image, ImageDraw, ImageFont
from google.appengine.api import memcache
import StringIO
import jinja2
import os
from decimal import * #used fixed point math for better ac... | mit |
m45t3r/i3pystatus | i3pystatus/scores/nhl.py | 4 | 14628 | from i3pystatus.core.util import internet, require
from i3pystatus.scores import ScoresBackend
import copy
import json
import pytz
import re
import time
from datetime import datetime
from urllib.request import urlopen
LIVE_URL = 'https://www.nhl.com/gamecenter/%s'
SCOREBOARD_URL = 'https://www.nhl.com/scores'
API_URL... | mit |
seanjtaylor/out-for-justice | scripts/test_optimize.py | 1 | 1921 |
import random
import pickle
import numpy as np
import networkx as nx
from app.optim import slow_compute_loss, step
def main(input_file, num_police, num_steps, prob_step):
"""
Parameters
----------
num_police : the number of police to use
num_steps : the number of steps to take
prob_step : th... | mit |
dothiko/mypaint | lib/layer/test.py | 1 | 1433 | # This file is part of MyPaint.
# Copyright (C) 2011-2015 by Andrew Chadwick <a.t.chadwick@gmail.com>
# Copyright (C) 2007-2012 by Martin Renold <martinxyz@gmx.ch>
#
# 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 S... | gpl-2.0 |
gamedev2/cocos2d-x-2.2 | tools/bindings-generator/generator.py | 3 | 34140 | #!/usr/bin/env python
# generator.py
# simple C++ generator, originally targetted for Spidermonkey bindings
#
# Copyright (c) 2011 - Zynga Inc.
from clang import cindex
import sys
import pdb
import ConfigParser
import yaml
import re
import os
import inspect
from Cheetah.Template import Template
type_map = {
cinde... | mit |
probablytom/tomwallis.net | venv/lib/python2.7/site-packages/pip/_vendor/html5lib/trie/datrie.py | 1301 | 1178 | from __future__ import absolute_import, division, unicode_literals
from datrie import Trie as DATrie
from pip._vendor.six import text_type
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
def __init__(self, data):
chars = set()
for key in data.keys():
if not isinstance(key, te... | artistic-2.0 |
delimitry/ascii_clock | asciicanvas.py | 1 | 6119 | #-*- coding: utf-8 -*-
#-----------------------------------------------------------------------
# Author: delimitry
#-----------------------------------------------------------------------
class AsciiCanvas(object):
"""
ASCII canvas for drawing in console using ASCII chars
"""
def __init__(self, cols... | mit |
dhhjx880713/GPy | GPy/plotting/matplot_dep/variational_plots.py | 6 | 4094 | from matplotlib import pyplot as pb, numpy as np
def plot(parameterized, fignum=None, ax=None, colors=None, figsize=(12, 6)):
"""
Plot latent space X in 1D:
- if fig is given, create input_dim subplots in fig and plot in these
- if ax is given plot input_dim 1D latent space plots of X into eac... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.