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 |
|---|---|---|---|---|---|
ChinaMassClouds/copenstack-server | openstack/src/nova-2014.2/nova/availability_zones.py | 23 | 7091 | # Copyright (c) 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 ... | gpl-2.0 |
quentinhardy/odat | ExternalTable.py | 1 | 7140 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from DirectoryManagement import DirectoryManagement
import logging, random, string
from Utils import checkOptionsGivenByTheUser
from Constants import *
class ExternalTable (DirectoryManagement):
'''
Allow the user to read file thanks to external tables
'''
def __init__(... | lgpl-3.0 |
Azure/azure-sdk-for-python | sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_deleted_web_apps_operations.py | 1 | 11568 | # 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 may ... | mit |
werehuman/cocaine-tools | cocaine/tools/actions/crashlog.py | 1 | 7060 | #
# Copyright (c) 2013+ Anton Tyurin <noxiouz@yandex.ru>
# Copyright (c) 2013+ Evgeny Safronov <division494@gmail.com>
# Copyright (c) 2011-2014 Other contributors as noted in the AUTHORS file.
#
# This file is part of Cocaine-tools.
#
# Cocaine is free software; you can redistribute it and/or modify
# it under the ter... | lgpl-3.0 |
veridiam/Madcow-Waaltz | madcow/tasks/tweets.py | 7 | 1771 | """Prints tweets to the channel."""
import time
import twitter
from madcow.conf import settings
from madcow.util import strip_html, Task
class Main(Task):
def init(self):
self.frequency = settings.TWITTER_UPDATE_FREQ
self.output = settings.TWITTER_CHANNELS
self.api = twitter.Api(username=... | gpl-3.0 |
kemalakyol48/python-for-android | python3-alpha/python3-src/setup.py | 43 | 84771 | # Autodetecting setup.py script for building the Python extensions
#
__version__ = "$Revision$"
import sys, os, imp, re, optparse
from glob import glob
import sysconfig
from distutils import log
from distutils import text_file
from distutils.errors import *
from distutils.core import Extension, setup
from distutils.... | apache-2.0 |
2014c2g4/2015cda0623 | static/Brython3.1.0-20150301-090019/Lib/unittest/test/test_result.py | 788 | 19069 | import io
import sys
import textwrap
from test import support
import traceback
import unittest
class Test_TestResult(unittest.TestCase):
# Note: there are not separate tests for TestResult.wasSuccessful(),
# TestResult.errors, TestResult.failures, TestResult.testsRun or
# TestResult.shouldStop because t... | gpl-3.0 |
singleyoungtao/myblog-flask | migrations/versions/d66f086b258_user_information.py | 127 | 1101 | """user information
Revision ID: d66f086b258
Revises: 56ed7d33de8d
Create Date: 2013-12-29 23:50:49.566954
"""
# revision identifiers, used by Alembic.
revision = 'd66f086b258'
down_revision = '56ed7d33de8d'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic -... | mit |
akurtakov/Pydev | plugins/org.python.pydev.jython/Lib/json/tests/test_scanstring.py | 97 | 3784 | import sys
from json.tests import PyTest, CTest
class TestScanstring(object):
def test_scanstring(self):
scanstring = self.json.decoder.scanstring
self.assertEqual(
scanstring('"z\\ud834\\udd20x"', 1, None, True),
(u'z\U0001d120x', 16))
if sys.maxunicode == 65535:
... | epl-1.0 |
yeti-platform/yeti | core/web/api/export.py | 1 | 3616 | from __future__ import unicode_literals
import os
from flask import send_from_directory, make_response
from flask_classy import route
from mongoengine.errors import DoesNotExist
from core.web.api.crud import CrudApi
from core import exports
from core.web.api.api import render
from core.helpers import string_to_timed... | apache-2.0 |
AnishShah/tensorflow | tensorflow/python/training/checkpoint_management.py | 9 | 29040 | # 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 |
selfcommit/gaedav | pyxml/dom/html/HTMLAreaElement.py | 4 | 2963 | ########################################################################
#
# File Name: HTMLAreaElement
#
#
### This file is automatically generated by GenerateHtml.py.
### DO NOT EDIT!
"""
WWW: http://4suite.com/4DOM e-mail: support@4suite.com
Copyright (c) 2000 Fourthought Inc, USA. All Rights... | lgpl-2.1 |
akarki15/mozillians | vendor-local/lib/python/tablib/packages/odf/dc.py | 100 | 2223 | # -*- coding: utf-8 -*-
# Copyright (C) 2006-2007 Søren Roug, European Environment Agency
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at you... | bsd-3-clause |
igemsoftware2017/USTC-Software-2017 | tests/notices/test_send.py | 1 | 1024 | from rest_framework.test import APITestCase
from biohub.notices import tool
from biohub.accounts.models import User
class Test(APITestCase):
def setUp(self):
self.me = User.objects.create_test_user('me')
self.you = User.objects.create_test_user('you')
self.dispatcher = tool.Dispatcher('t... | gpl-3.0 |
eerwitt/tensorflow | tensorflow/contrib/ndlstm/python/lstm2d.py | 69 | 6062 | # 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 applicable ... | apache-2.0 |
strahlex/machinekit | share/gscreen/skins/industrial/industrial_handler.py | 20 | 17237 | import hal
import gtk
import gladevcp.makepins # needed for the dialog's calulator widget
import pango
_MAN = 0;_MDI = 1;_AUTO = 2;_LOCKTOGGLE = 1
# This is a handler file for using Gscreen's infrastructure
# to load a completely custom glade screen
# The only things that really matters is that it's saved as a GTK bu... | lgpl-2.1 |
Universal-Model-Converter/UMC3.0a | data/Python/x86/Lib/site-packages/PyQt4/uic/port_v3/proxy_base.py | 4 | 1499 | #############################################################################
##
## Copyright (c) 2013 Riverbank Computing Limited <info@riverbankcomputing.com>
##
## This file is part of PyQt.
##
## This file may be used under the terms of the GNU General Public
## License versions 2.0 or 3.0 as published by the Fre... | mit |
was4444/chromium.src | third_party/typ/typ/fakes/tests/test_result_server_fake_test.py | 81 | 1298 | # Copyright 2014 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 ag... | bsd-3-clause |
GoogleCloudPlatform/python-compat-runtime | appengine-compat/exported_appengine_sdk/google/appengine/tools/devappserver2/url_handler_test.py | 8 | 12827 | #!/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... | apache-2.0 |
Joni-Aaltonen/pebble-owner-info | .waf-1.7.0-9334f7e963bee5410f4fa28728feffdd/waflib/Tools/c_tests.py | 1 | 4186 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
from waflib import Task
from waflib.Configure import conf
from waflib.TaskGen import feature,before_method,after_method
import sys
LIB_CODE='''
#ifdef _MSC_VER
#define testEXP... | gpl-2.0 |
be-cloud-be/horizon-addons | server-tools/base_export_manager/tests/test_ir_exports.py | 13 | 1833 | # -*- coding: utf-8 -*-
# © 2015 Antiun Ingeniería S.L. - Jairo Llopis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp.exceptions import ValidationError
from openerp.tests.common import TransactionCase
class TestIrExportsCase(TransactionCase):
def test_create_with_basic_data(sel... | agpl-3.0 |
jaimeantena4040/MiSitioWeb | meta/lib/oe/tests/test_license.py | 12 | 2047 | import unittest
import oe.license
class SeenVisitor(oe.license.LicenseVisitor):
def __init__(self):
self.seen = []
oe.license.LicenseVisitor.__init__(self)
def visit_Str(self, node):
self.seen.append(node.s)
class TestSingleLicense(unittest.TestCase):
licenses = [
"GPLv2",... | gpl-2.0 |
homologus/Pandoras-Toolbox-for-Bioinformatics | src/SPAdes/ext/src/python_libs/pyyaml2/cyaml.py | 537 | 3290 |
__all__ = ['CBaseLoader', 'CSafeLoader', 'CLoader',
'CBaseDumper', 'CSafeDumper', 'CDumper']
from _yaml import CParser, CEmitter
from constructor import *
from serializer import *
from representer import *
from resolver import *
class CBaseLoader(CParser, BaseConstructor, BaseResolver):
def __init__(... | gpl-3.0 |
switchboardOp/ansible | lib/ansible/modules/network/panos/panos_check.py | 78 | 4114 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage PaloAltoNetworks Firewall
# (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish... | gpl-3.0 |
purcoin/PurpleCoin | 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 |
Alexoner/mooc | coursera/nlpintro-001/Assignment2/solutionsA.py | 1 | 9462 | import math
import nltk
import time
import sys
# Constants to be used by you when you fill the functions
START_SYMBOL = '*'
STOP_SYMBOL = 'STOP'
MINUS_INFINITY_SENTENCE_LOG_PROB = -1000
log2 = lambda x: math.log(x, 2)
# TODO: IMPLEMENT THIS FUNCTION
# Calculates unigram, bigram, and trigram probabilities given a tra... | apache-2.0 |
dbckz/ansible | test/units/playbook/test_base.py | 34 | 23930 | # (c) 2016, Adrian Likins <alikins@redhat.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 later vers... | gpl-3.0 |
alex/tablib | tablib/packages/yaml/events.py | 985 | 2445 |
# Abstract classes.
class Event(object):
def __init__(self, start_mark=None, end_mark=None):
self.start_mark = start_mark
self.end_mark = end_mark
def __repr__(self):
attributes = [key for key in ['anchor', 'tag', 'implicit', 'value']
if hasattr(self, key)]
argu... | mit |
pschmitt/home-assistant | tests/components/mqtt/test_cover.py | 5 | 62666 | """The tests for the MQTT cover platform."""
import pytest
from homeassistant.components import cover
from homeassistant.components.cover import (
ATTR_CURRENT_POSITION,
ATTR_CURRENT_TILT_POSITION,
ATTR_POSITION,
ATTR_TILT_POSITION,
)
from homeassistant.components.mqtt.cover import MqttCover
from homea... | apache-2.0 |
ishay2b/tensorflow | tensorflow/python/training/learning_rate_decay.py | 22 | 16419 | # 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 |
amousset/ansible | lib/ansible/plugins/connections/local.py | 58 | 5547 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2015 Toshio Kuratomi <tkuratomi@ansible.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 vers... | gpl-3.0 |
mozilla/kitsune | kitsune/questions/tests/test_api.py | 1 | 28190 | import json
from datetime import datetime, timedelta
from unittest import mock
import actstream.actions
from actstream.models import Follow
from nose.tools import eq_, ok_, raises
from rest_framework.test import APIClient
from rest_framework.exceptions import APIException
from taggit.models import Tag
from kitsune.su... | bsd-3-clause |
soumyanishan/azure-linux-extensions | VMAccess/vmaccess.py | 1 | 18922 | #!/usr/bin/env python
#
# VMAccess extension
#
# Copyright 2014 Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... | apache-2.0 |
seet61/one | v2/requests/packages/chardet/latin1prober.py | 950 | 5241 | ######################## 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... | bsd-2-clause |
sql-analytics/openvstorage | ovs/extensions/snmp/ovssnmpserver.py | 2 | 26954 | # Copyright 2014 CloudFounders NV
#
# 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 |
p0psicles/SickRage | lib/requests/packages/chardet/mbcssm.py | 1783 | 19590 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org 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 Reserved.
#
# Con... | gpl-3.0 |
firebase/firebase-admin-python | setup.py | 1 | 2584 | # Copyright 2017 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 or agreed to in writing, ... | apache-2.0 |
pasiegel/SickGear | lib/rtorrent/compat.py | 180 | 1258 | # Copyright (c) 2013 Chris Lucas, <chris@chrisjlucas.com>
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, ... | gpl-3.0 |
d-mittal/pystruct | examples/plot_exact_learning.py | 5 | 1333 | """
=========================================
Efficient exact learning of 1-slack SSVMs
=========================================
This example illustrates the role of approximate inference and caching
in exact learning of a 1-slack SSVM.
Please see plot_objetive_curve.py for an interpretation of the curves.
We start... | bsd-2-clause |
hoytak/lazyrunner | lazyrunner/manager.py | 1 | 4915 | """
A class that manages a batch of sessions.
"""
import time, logging, sys
from os import makedirs, remove
from os.path import join, expanduser, exists, split, abspath, normpath
from treedict import TreeDict
from pnstructures import PNodeCommon, PNode
import parameters as parameter_module
import pmodule
import loa... | bsd-3-clause |
otherness-space/myProject003 | my_project_003/lib/python2.7/site-packages/pip/_vendor/requests/status_codes.py | 926 | 3200 | # -*- coding: utf-8 -*-
from .structures import LookupDict
_codes = {
# Informational.
100: ('continue',),
101: ('switching_protocols',),
102: ('processing',),
103: ('checkpoint',),
122: ('uri_too_long', 'request_uri_too_long'),
200: ('ok', 'okay', 'all_ok', 'all_okay', 'all_good', '\\o/'... | mit |
popazerty/SDG-e2 | lib/python/Screens/Satconfig.py | 5 | 36689 | from enigma import eDVBDB
from Screen import Screen
from Components.SystemInfo import SystemInfo
from Components.ActionMap import ActionMap
from Components.ConfigList import ConfigListScreen
from Components.MenuList import MenuList
from Components.NimManager import nimmanager
from Components.Button import Button
from C... | gpl-2.0 |
allanlei/django-backup | example/settings.py | 1 | 5087 | # Django settings for example project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle... | bsd-3-clause |
Versatilus/dragonfly | dragonfly/actions/action_waitwindow.py | 2 | 4043 | #
# This file is part of Dragonfly.
# (c) Copyright 2007, 2008 by Christo Butcher
# Licensed under the LGPL.
#
# Dragonfly 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 L... | lgpl-3.0 |
k8s-bot/kubernetes | cluster/juju/charms/trusty/kubernetes-master/hooks/hooks.py | 202 | 8337 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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
#
# Unle... | apache-2.0 |
axbaretto/beam | sdks/python/.tox/lint/lib/python2.7/site-packages/yaml/representer.py | 64 | 17711 |
__all__ = ['BaseRepresenter', 'SafeRepresenter', 'Representer',
'RepresenterError']
from error import *
from nodes import *
import datetime
import sys, copy_reg, types
class RepresenterError(YAMLError):
pass
class BaseRepresenter(object):
yaml_representers = {}
yaml_multi_representers = {}
d... | apache-2.0 |
knehez/edx-platform | openedx/core/djangoapps/credit/tests/test_tasks.py | 19 | 4845 | """
Tests for credit course tasks.
"""
import mock
from datetime import datetime
from openedx.core.djangoapps.credit.api import get_credit_requirements
from openedx.core.djangoapps.credit.exceptions import InvalidCreditRequirements
from openedx.core.djangoapps.credit.models import CreditCourse
from openedx.core.djang... | agpl-3.0 |
jotes/ansible-modules-core | cloud/openstack/quantum_router.py | 99 | 6996 | #!/usr/bin/python
#coding: utf-8 -*-
# (c) 2013, Benno Joy <benno@ansible.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 option) any later ... | gpl-3.0 |
grlee77/numpy | numpy/f2py/tests/test_parameter.py | 17 | 3910 | import os
import pytest
import numpy as np
from numpy.testing import assert_raises, assert_equal
from . import util
def _path(*a):
return os.path.join(*((os.path.dirname(__file__),) + a))
class TestParameters(util.F2PyTest):
# Check that intent(in out) translates as intent(inout)
sources = [_path('src... | bsd-3-clause |
iot-factory/synapse | synapse/storage/transactions.py | 1 | 10722 | # -*- coding: utf-8 -*-
# Copyright 2014, 2015 OpenMarket Ltd
#
# 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 |
aselle/tensorflow | tensorflow/contrib/estimator/python/estimator/hooks_test.py | 4 | 11763 | # 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 |
kanagasabapathi/python-for-android | python3-alpha/python3-src/Lib/multiprocessing/__init__.py | 45 | 7743 | #
# Package analogous to 'threading.py' but using processes
#
# multiprocessing/__init__.py
#
# This package is intended to duplicate the functionality (and much of
# the API) of threading.py but uses processes instead of threads. A
# subpackage 'multiprocessing.dummy' has the same API but is a simple
# wrapper for 't... | apache-2.0 |
drexly/openhgsenti | lib/django/views/defaults.py | 339 | 3567 | from django import http
from django.template import Context, Engine, TemplateDoesNotExist, loader
from django.utils import six
from django.utils.encoding import force_text
from django.views.decorators.csrf import requires_csrf_token
# This can be called when CsrfViewMiddleware.process_view has not run,
# therefore ne... | apache-2.0 |
candy7393/VTK | ThirdParty/Twisted/twisted/persisted/crefutil.py | 45 | 4496 | # -*- test-case-name: twisted.test.test_persisted -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Utility classes for dealing with circular references.
"""
import types
from twisted.python import log, reflect
class NotKnown:
def __init__(self):
self.dependants = []
... | bsd-3-clause |
esa/SpaceAMPL | interplanetary/impulsive/single_phase/include/writeequations.py | 1 | 13720 | import sys;
file = open("equations.inc","w")
file2 = open("writeinitialguess.inc","w")
file3 = open("writesolution.inc","w")
file4 = open("guesstangential.inc","w")
n=int(sys.argv[1]);
file.write("#------------------------------------------------------------------------\n")
file.write("#Optimisation Variables\n\n")
... | gpl-2.0 |
prakxys/flask | Work/TriviaMVA/TriviaMVA/env/Lib/site-packages/flask/json.py | 428 | 8113 | # -*- coding: utf-8 -*-
"""
flask.jsonimpl
~~~~~~~~~~~~~~
Implementation helpers for the JSON support in Flask.
:copyright: (c) 2012 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import io
import uuid
from datetime import datetime
from .globals import current_app, request
fro... | apache-2.0 |
tuxfux-hlp-notes/python-batches | batch-67/12-modules/myenv/lib/python2.7/site-packages/setuptools/command/rotate.py | 389 | 2164 | from distutils.util import convert_path
from distutils import log
from distutils.errors import DistutilsOptionError
import os
import shutil
from setuptools.extern import six
from setuptools import Command
class rotate(Command):
"""Delete older distributions"""
description = "delete older distributions, kee... | gpl-3.0 |
KarolBedkowski/webmon | webmon/main.py | 1 | 16243 | #!/usr/bin/python3
"""
Main functions.
Copyright (c) Karol Będkowski, 2016-2018
This file is part of webmon.
Licence: GPLv2+
"""
import argparse
from concurrent import futures
import datetime
import imp
import locale
import logging
import os.path
import pprint
import time
import typing as ty
# import typecheck as t... | gpl-2.0 |
Gillu13/scipy | scipy/optimize/_lsq/least_squares.py | 3 | 36471 | """Generic interface for least-square minimization."""
from warnings import warn
import numpy as np
from numpy.linalg import norm
from scipy.sparse import issparse, csr_matrix
from scipy.sparse.linalg import LinearOperator
from scipy.optimize import _minpack, OptimizeResult
from scipy.optimize._numdiff import approx... | bsd-3-clause |
fangxingli/hue | desktop/core/ext-py/pysaml2-2.4.0/src/saml2/extension/mdrpi.py | 36 | 10117 | #!/usr/bin/env python
#
# Generated Mon Jun 27 09:54:22 2011 by parse_xsd.py version 0.4.
#
import saml2
from saml2 import SamlBase
from saml2 import md
NAMESPACE = 'urn:oasis:names:tc:SAML:metadata:rpi'
class RegistrationPolicy(md.LocalizedURIType_):
"""The urn:oasis:names:tc:SAML:metadata:rpi:RegistrationPo... | apache-2.0 |
plxaye/chromium | src/third_party/protobuf/python/ez_setup.py | 454 | 10334 | #!python
# This file was obtained from:
# http://peak.telecommunity.com/dist/ez_setup.py
# on 2011/1/21.
"""Bootstrap setuptools installation
If you want to use setuptools in your package's setup.py, just include this
file in the same directory with it, and add this to the top of your setup.py::
from ez_setup... | apache-2.0 |
nzavagli/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/SQLAlchemy-1.0.6/examples/association/dict_of_sets_with_default.py | 30 | 2794 | """dict_of_sets_with_default.py
an advanced association proxy example which
illustrates nesting of association proxies to produce multi-level Python
collections, in this case a dictionary with string keys and sets of integers
as values, which conceal the underlying mapped classes.
This is a three table model which re... | mit |
kenshay/ImageScripter | Script_Runner/PYTHON/Lib/site-packages/pyasn1/type/univ.py | 5 | 100158 | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2018, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
import math
import sys
from pyasn1 import error
from pyasn1.codec.ber import eoo
from pyasn1.compat import binary
from pyasn1.compat import integer
from pyasn1.co... | gpl-3.0 |
grepman/detective.io | app/detective/migrations/0047_auto__add_field_topicskeleton_order.py | 3 | 13355 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as 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 'TopicSkeleton.order'
db.add_column(u'detective_topicskele... | lgpl-3.0 |
unix1986/universe | script/template.py | 2 | 1383 | #!/home/search/ttool/py27/bin/python
# func:
__author__ = "unix1986@qq.com"
import sys
import platform
# check python version
if sys.version_info < (2, 7, 0):
print ("Current python version %s, "
"but require version %s or above") % \
(platform.python_version(), "2.7.0")
sys.exit(1)
import o... | bsd-2-clause |
djw8605/condor | src/condor_contrib/mgmt/qmf/test/job_server-perf.py | 9 | 2502 | #!/usr/bin/env python
#
# Copyright 2009-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 License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | apache-2.0 |
sky15179/Debug | TestTabelController/my-python/relaceGuideImages.py | 1 | 3738 | #!/usr/bin/python
# coding:utf-8
import os
import re
import fnmatch
import zipfile
import shutil
import getpass
import glob
PATH = "/Users/"+ getpass.getuser() + "/Downloads"
ProtectImagePath = "/Users/wzg/Downloads/testimage/help_images"
prefix = "FS_HelpGuide_"
#获取替换文件的路径
def realProtectImagePath():
global Pro... | apache-2.0 |
biodrone/plex-desk | desk/flask/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/mbcsgroupprober.py | 2769 | 1967 | ######################## 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... | mit |
pcarrier-packaging/deb-phantomjs | src/breakpad/src/third_party/protobuf/protobuf/python/google/protobuf/internal/cpp_message.py | 259 | 21288 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... | bsd-3-clause |
wbc2010/django1.2.5 | django/contrib/gis/sitemaps/kml.py | 482 | 2481 | from django.core import urlresolvers
from django.contrib.sitemaps import Sitemap
from django.contrib.gis.db.models.fields import GeometryField
from django.db import models
class KMLSitemap(Sitemap):
"""
A minimal hook to produce KML sitemaps.
"""
geo_format = 'kml'
def __init__(self, locations=Non... | bsd-3-clause |
jmartinezchaine/OpenERP | openerp/addons/l10n_fr/wizard/fr_report_compute_resultant.py | 7 | 2284 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
#... | agpl-3.0 |
supercheetah/diceroller | pyinstaller/buildtests/libraries/test_wx_pubsub_kwargs.py | 2 | 1062 | #
# Copyright (C) 2012, Daniel Hyams
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed i... | artistic-2.0 |
vlegoff/tsunami | src/secondaires/peche/editeurs/__init__.py | 5 | 1621 | # -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# 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
... | bsd-3-clause |
mengxn/tensorflow | tensorflow/examples/tutorials/word2vec/word2vec_basic.py | 28 | 9485 | # 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 |
a7xtony1/plugin.video.ELECTROMERIDAtv | resources/tools/resolvers.py | 26 | 52080 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# BassFox - Kodi Add-on
# Plugin multimedia para el add-on
#------------------------------------------------------------
# License: GPL (http://www.gnu.org/licenses/gpl-3.0.html)
# Gracias a las librerías de Jesús (www.mimediacenter.... | gpl-2.0 |
piquadrat/django | tests/many_to_one/models.py | 63 | 2926 | """
Many-to-one relationships
To define a many-to-one relationship, use ``ForeignKey()``.
"""
from django.db import models
class Reporter(models.Model):
first_name = models.CharField(max_length=30)
last_name = models.CharField(max_length=30)
email = models.EmailField()
def __str__(self):
ret... | bsd-3-clause |
yahman72/robotframework | atest/testdata/standard_libraries/remote/arguments.py | 25 | 2920 | import sys
from xmlrpclib import Binary
from remoteserver import RemoteServer
class Arguments(object):
def argument_should_be(self, argument, expected, binary=False):
if binary:
argument = self._handle_binary(argument)
expected = eval(expected)
assert argument == expected, '%... | apache-2.0 |
mxcube/mxcube | mxcubeqt/utils/widget_utils.py | 1 | 9801 | #
# Project: MXCuBE
# https://github.com/mxcube
#
# This file is part of MXCuBE software.
#
# MXCuBE 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, or
# (at your... | lgpl-3.0 |
2013Commons/HUE-SHARK | desktop/core/ext-py/python-ldap-2.3.13/build/lib.linux-i686-2.7/ldap/dn.py | 45 | 2793 | """
dn.py - misc stuff for handling distinguished names (see RFC 4514)
See http://www.python-ldap.org/ for details.
\$Id: dn.py,v 1.11 2010/06/03 12:26:39 stroeder Exp $
Compability:
- Tested with Python 2.0+
"""
from ldap import __version__
import _ldap
import ldap.functions
def escape_dn_chars(s):
"""
Es... | apache-2.0 |
eHealthAfrica/rapidpro | temba/flows/migrations/0099_populate_recent_message.py | 3 | 2250 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-05-26 08:33
from __future__ import unicode_literals
from django.db import migrations
def get_recent_messages_for_segment(FlowPathRecentStep, from_uuid, to_uuid):
recent_steps = FlowPathRecentStep.objects.filter(from_uuid=from_uuid, to_uuid=to_uuid)
... | agpl-3.0 |
huguesv/PTVS | Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/win32/Demos/winprocess.py | 6 | 7326 | """
Windows Process Control
winprocess.run launches a child process and returns the exit code.
Optionally, it can:
redirect stdin, stdout & stderr to files
run the command as another user
limit the process's running time
control the process window (location, size, window state, desktop)
Works on Windows NT, 20... | apache-2.0 |
mozilla/make.mozilla.org | vendor-local/lib/python/amqplib/client_0_8/abstract_channel.py | 22 | 3464 | """
Code common to Connection and Channel objects.
"""
# Copyright (C) 2007-2008 Barry Pederson <bp@barryp.org>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of ... | bsd-3-clause |
cnbin/linux | scripts/gdb/linux/cpus.py | 997 | 3560 | #
# gdb helper commands and functions for Linux kernel debugging
#
# per-cpu tools
#
# Copyright (c) Siemens AG, 2011-2013
#
# Authors:
# Jan Kiszka <jan.kiszka@siemens.com>
#
# This work is licensed under the terms of the GNU GPL version 2.
#
import gdb
from linux import tasks, utils
MAX_CPUS = 4096
def get_cu... | gpl-2.0 |
rue89-tech/edx-platform | common/test/acceptance/tests/studio/test_studio_bad_data.py | 173 | 3970 | from base_studio_test import ContainerBase
from ...fixtures.course import XBlockFixtureDesc
from ...pages.studio.utils import verify_ordering
class BadComponentTest(ContainerBase):
"""
Tests that components with bad content do not break the Unit page.
"""
__test__ = False
def get_bad_html_content... | agpl-3.0 |
ivanhorvath/openshift-tools | openshift/installer/vendored/openshift-ansible-3.6.173.0.59/roles/lib_openshift/src/ansible/oc_secret.py | 10 | 1157 | # pylint: skip-file
# flake8: noqa
def main():
'''
ansible oc module for managing OpenShift Secrets
'''
module = AnsibleModule(
argument_spec=dict(
kubeconfig=dict(default='/etc/origin/master/admin.kubeconfig', type='str'),
state=dict(default='present', type='str',
... | apache-2.0 |
azureplus/hue | desktop/core/ext-py/Paste-2.0.1/tests/test_request_form.py | 47 | 1183 | import six
from paste.request import *
from paste.util.multidict import MultiDict
def test_parse_querystring():
e = {'QUERY_STRING': 'a=1&b=2&c=3&b=4'}
d = parse_querystring(e)
assert d == [('a', '1'), ('b', '2'), ('c', '3'), ('b', '4')]
assert e['paste.parsed_querystring'] == (
(d, e['QUERY_S... | apache-2.0 |
tangyiyong/odoo | addons/account_payment/wizard/account_payment_order.py | 338 | 5906 | # -*- 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 |
open-homeautomation/home-assistant | homeassistant/components/switch/hikvisioncam.py | 23 | 3253 | """
Support turning on/off motion detection on Hikvision cameras.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.hikvision/
"""
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistan... | apache-2.0 |
sogelink/ansible | test/units/modules/network/ios/test_ios_banner.py | 62 | 2314 | # 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 distributed in the hope that ... | gpl-3.0 |
google/tink | python/tink/jwt/_jwt_key_templates.py | 1 | 4813 | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
xujun10110/w3a_Scan_Console | plugin/NmapModule.py | 2 | 1554 | #!/usr/bin/python
#-*- encoding: utf-8 -*-
###########################################
#
# Nmap 扫描类(生成扫描结果)
#
###########################################
import nmap
import time
import sys
class Web_Scan_Frame:
def setScan_Main(self, scan_main):
self.scan_main=scan_main
def start(self,target,temple):
# 在这... | gpl-2.0 |
abhinavp13/IITBX-edx-platform-dev | common/lib/xmodule/xmodule/modulestore/tests/django_utils.py | 2 | 5804 |
import copy
from uuid import uuid4
from django.test import TestCase
from django.conf import settings
import xmodule.modulestore.django
from xmodule.templates import update_templates
def mongo_store_config(data_dir):
"""
Defines default module store using MongoModuleStore.
Use of this config requires mo... | agpl-3.0 |
ramrom/haus | gmail.py | 1 | 2126 | #!/usr/local/bin/python
import httplib2
import os, pdb
from apiclient import discovery
from oauth2client import client
from oauth2client import tools
from oauth2client.file import Storage
try:
import argparse
flags = argparse.ArgumentParser(parents=[tools.argparser]).parse_args()
except ImportError:
flags... | mit |
Charlotte-Morgan/inasafe | safe_extras/raven/utils/compat.py | 12 | 5676 | """
raven.utils.compat
~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2016 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
Utilities for writing code that runs on Python 2 and 3
"""
# flake8: noqa
# Copyright (c) 2010-2013 Benjamin Peterson
#
# Permission is hereby granted, fr... | gpl-3.0 |
jandecaluwe/myhdl | example/arith_lib/test_LeadZeroDet.py | 4 | 1809 | import unittest
from unittest import TestCase
import myhdl
from myhdl import *
from arith_utils import BEHAVIOR, STRUCTURE
from arith_utils import SLOW, FAST
from LeadZeroDet import LeadZeroDet
import random
random.seed = 1
from random import random
class LeadZeroDetTest(TestCase):
""" Leading zeroes detector ... | lgpl-2.1 |
jgeskens/django | tests/model_fields/models.py | 6 | 7517 | import os
import tempfile
from django.core.exceptions import ImproperlyConfigured
try:
from django.utils.image import Image
except ImproperlyConfigured:
Image = None
from django.core.files.storage import FileSystemStorage
from django.db import models
from django.db.models.fields.files import ImageFieldFile, ... | bsd-3-clause |
reyoung/Paddle | python/paddle/fluid/tests/unittests/test_beam_search_decode_op.py | 5 | 3938 | # Copyright (c) 2018 PaddlePaddle 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 app... | apache-2.0 |
efortuna/AndroidSDKClone | ndk_experimental/prebuilt/linux-x86_64/lib/python2.7/test/test_pdb.py | 71 | 11225 | # A test suite for pdb; at the moment, this only validates skipping of
# specified test modules (RFE #5142).
import imp
import sys
import os
import unittest
import subprocess
import textwrap
from test import test_support
# This little helper class is essential for testing pdb under doctest.
from test_doctest import _... | apache-2.0 |
Moriadry/tensorflow | tensorflow/python/kernel_tests/functional_ops_test.py | 78 | 18206 | # 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 |
ESOedX/edx-platform | common/test/acceptance/tests/lms/test_problem_types.py | 1 | 72649 | """
Bok choy acceptance and a11y tests for problem types in the LMS
"""
from __future__ import absolute_import
import random
import textwrap
from abc import ABCMeta, abstractmethod
import ddt
import pytest
import six
from bok_choy.promise import BrokenPromise
from selenium.webdriver import ActionChains
from six.moves... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.