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 |
|---|---|---|---|---|---|
julien78910/CouchPotatoServer | libs/requests/packages/charade/constants.py | 3008 | 1335 | ######################## 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 |
bbbenja/SickRage | lib/sqlalchemy/ext/declarative/base.py | 77 | 20180 | # ext/declarative/base.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Internal implementation for declarative."""
from ...schema import Table, Co... | gpl-3.0 |
kasioumis/invenio | invenio/legacy/bibcheck/plugins/files.py | 13 | 2221 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2013 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later... | gpl-2.0 |
MartinThoma/algorithms | ML/gtsrb/densenet.py | 1 | 7475 | import keras.backend as K
from keras.layers import Input, merge
from keras.layers.convolutional import Convolution2D
from keras.layers.core import Activation, Dense, Dropout
from keras.layers.normalization import BatchNormalization
from keras.layers.pooling import AveragePooling2D, GlobalAveragePooling2D
from keras.mod... | mit |
omega-roms/I9300_Stock_Kernel_JB_4.3 | tools/perf/scripts/python/sctop.py | 11180 | 1924 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
COCS4950G7/COSC4950 | Source/Brute_Force/manager_server.py | 1 | 4627 | from multiprocessing.managers import SyncManager
import time
import Queue
import Dictionary
IP = "10.121.0.158"
PORTNUM = 22536
AUTHKEY = "Popcorn is awesome!!!"
dictionary = Dictionary.Dictionary()
def runserver():
try: #runserver definition try block
# Start a shared manager server and access its que... | gpl-3.0 |
acshi/osf.io | scripts/migration/migrate_registration_extra_drafts.py | 24 | 3179 | """
Changes existing question.extra on a draft to a list
required for multiple files attached to a question
"""
import sys
import logging
from modularodm import Q
from website.app import init_app
from website.files.models import FileNode, TrashedFileNode
from scripts import utils as scripts_utils
from website.models i... | apache-2.0 |
johnmcdowall/procedural_city_generation | procedural_city_generation/additional_stuff/jsontools.py | 3 | 2246 | def save_vertexlist(vertex_list, name="output",savefig=0):
print "Output is being saved."
import json
import procedural_city_generation
import os
path=os.getcwd()+"/procedural_city_generation"
Vertexwb={}
for i in range(len(vertex_list)):
neighboursindizes=[vertex_list.index(x) for x in vertex_list[i].nei... | mpl-2.0 |
seaotterman/tensorflow | tensorflow/python/kernel_tests/spacetodepth_op_test.py | 90 | 8391 | # 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 |
jamesbulpin/xcp-xen-4.1 | tools/xm-test/tests/network/13_network_domU_udp_pos.py | 38 | 2376 | #!/usr/bin/python
# Copyright (C) International Business Machines Corp., 2006
# Copyright (C) flonatel GmbH & Co. KG, 2009
# Authors: <dykman@us.ibm.com>
# Andreas Florath <xen@flonatel.org>
# UDP tests to domU interface
# - creates two guest domains
# - sets up a single NIC on each on same subnet
# - ... | gpl-2.0 |
DerekRies/generator-angular-sublime | generator-angular.py | 1 | 5121 | import sublime
import sublime_plugin
import subprocess
import os
import errno
import threading
# from Queue import Queue, Empty
def mkdir_p(path):
try:
os.makedirs(path)
except OSError as exc:
if exc.errno == errno.EEXIST and os.path.isdir(path):
pass
else:
rai... | mit |
kostyll/django-websocket-request-example | ws.py | 2 | 1154 | import os
import logging
from tornado import web, ioloop
from sockjs.tornado import SockJSRouter, SockJSConnection
# Set Django Environment
os.environ['DJANGO_SETTINGS_MODULE'] = 'wsrequest_example.settings'
from wsrequest import WebSocketRequest
logging.getLogger().setLevel(logging.INFO)
class IndexHandler(web.... | mit |
mark-ignacio/phantomjs | src/qt/qtwebkit/Source/ThirdParty/gtest/test/gtest_throw_on_failure_test.py | 2917 | 5766 | #!/usr/bin/env python
#
# Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | bsd-3-clause |
cgar/servo | python/servo/package_commands.py | 15 | 16950 | # Copyright 2013 The Servo Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
#... | mpl-2.0 |
rudametw/rudametw.github.io | src/teaching/ima2a4/print_markdown_code.py | 2 | 1309 | #!/usr/bin/env python
# -*-coding:utf-8 -*
"""
Generate output for markdown needed for website file links.
"""
import glob, os
from os import listdir
from os.path import isfile, join
onlyfiles = [f for f in listdir(".") if isfile(join(".", f))]
print (onlyfiles)
os.chdir(".")
for file in glob.glob("*.pdf"):
prin... | gpl-3.0 |
mattnenterprise/servo | tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/wptmanifest/tests/test_serializer.py | 12 | 4579 | import sys
import unittest
from cStringIO import StringIO
import pytest
from .. import parser, serializer
class TokenizerTest(unittest.TestCase):
def setUp(self):
self.serializer = serializer.ManifestSerializer()
self.parser = parser.Parser()
def serialize(self, input_str):
return ... | mpl-2.0 |
KNMI/VERCE | verce-hpc-pe/src/networkx/algorithms/tests/test_swap.py | 32 | 1260 | #!/usr/bin/env python
from nose.tools import *
from networkx import *
def test_double_edge_swap():
graph = barabasi_albert_graph(200,1)
degrees = sorted(graph.degree().values())
G = double_edge_swap(graph, 40)
assert_equal(degrees, sorted(graph.degree().values()))
def test_connected_double_edge_swap()... | mit |
yitian134/chromium | third_party/tlslite/tlslite/utils/compat.py | 361 | 4060 | """Miscellaneous functions to mask Python version differences."""
import sys
import os
if sys.version_info < (2,2):
raise AssertionError("Python 2.2 or later required")
if sys.version_info < (2,3):
def enumerate(collection):
return zip(range(len(collection)), collection)
class Set:
def ... | bsd-3-clause |
curaloucura/money-forecast | moneyforecast/tests/records/fixtures.py | 1 | 5073 | import pytest
from datetime import date, datetime
from dateutil.relativedelta import relativedelta
from django.contrib.auth.models import User
from records.models import (
Category, Record, Budget, OUTCOME, INCOME, SAVINGS, tmz)
from records.month_control import MonthControl, MonthControlWithBudget
@pytest.fixt... | unlicense |
ozburo/youtube-dl | youtube_dl/extractor/springboardplatform.py | 28 | 4242 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
xpath_attr,
xpath_text,
xpath_element,
unescapeHTML,
unified_timestamp,
)
class SpringboardPlatformIE(InfoExtractor):
_VALID_URL = r'... | unlicense |
PmagPy/PmagPy | programs/grab_magic_key.py | 2 | 1162 | #!/usr/bin/env python
import sys
import pmagpy.pmag as pmag
def main():
"""
NAME
grab_magic_key.py
DESCRIPTION
picks out key and saves to file
SYNTAX
grab_magic_key.py [command line optins]
OPTIONS
-h prints help message and quits
-f FILE: specify input m... | bsd-3-clause |
HewlettPackard/oneview-ansible | test/test_image_streamer_deployment_plan.py | 1 | 5438 | #!/usr/bin/python
# -*- coding: utf-8 -*-
###
# Copyright (2016-2020) Hewlett Packard Enterprise Development LP
#
# 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/licen... | apache-2.0 |
strongme/shadowsocks-manyuser | shadowsocks/encrypt.py | 31 | 7691 | #!/usr/bin/env python
# Copyright (c) 2014 clowwindy
#
# 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, me... | mit |
CoherentLabs/depot_tools | recipes/nacl.py | 3 | 1505 | # 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 sys
import recipe_util # pylint: disable=F0401
# This class doesn't need an __init__ method, so we disable the warning
# pylint: disable=W0232
cla... | bsd-3-clause |
bsipocz/scikit-image | setup.py | 11 | 4995 | #! /usr/bin/env python
descr = """Image Processing SciKit
Image processing algorithms for SciPy, including IO, morphology, filtering,
warping, color manipulation, object detection, etc.
Please refer to the online documentation at
http://scikit-image.org/
"""
DISTNAME = 'scikit-image'
DESCRIPTION = 'Image processing... | bsd-3-clause |
tyagiarpit/servo | tests/wpt/harness/wptrunner/reduce.py | 156 | 6086 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import sys
import tempfile
from cStringIO import StringIO
from collections import defaultdict
import wptrunner
import w... | mpl-2.0 |
DarioGT/OMS-PluginXML | org.modelsphere.sms/lib/jython-2.2.1/Lib/encodings/charmap.py | 1 | 1309 | """ Generic Python Character Mapping Codec.
Use this codec directly rather than through the automatic
conversion mechanisms supplied by unicode() and .encode().
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""#"
import codecs
###... | gpl-3.0 |
Jeff-Tian/mybnb | Python27/Lib/multiprocessing/dummy/__init__.py | 4 | 4634 | #
# Support for the API of the multiprocessing package using threads
#
# multiprocessing/dummy/__init__.py
#
# Copyright (c) 2006-2008, R Oudkerk
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
#... | apache-2.0 |
imapp-pl/golem | tests/golem/rpc/test_service.py | 1 | 1244 | import unittest
from golem.rpc.service import ServiceHelper, ServiceMethods
class MockService(object):
def method_1(self):
return 1
def method_2(self, arg):
return str(arg)
class TestService(unittest.TestCase):
def test_helper(self):
service = MockService()
methods = ... | gpl-3.0 |
houchj/selenium | py/test/selenium/webdriver/common/webserver.py | 60 | 4623 | # 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 |
natea/django-lfc | lfc/models.py | 1 | 38119 | # python imports
import datetime
import re
import random
# django imports
from django import forms
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.core.cache import cache
... | bsd-3-clause |
with-git/tensorflow | tensorflow/python/framework/versions.py | 127 | 1607 | # 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 |
kaiweifan/vse-lbaas-plugin-poc | quantum/plugins/metaplugin/meta_db_v2.py | 8 | 1680 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012, Nachi Ueno, NTT MCL, 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://ww... | apache-2.0 |
gtko/CouchPotatoServer | libs/pyutil/iputil.py | 92 | 9752 | # from the Python Standard Library
import os, re, socket, sys, subprocess
# from Twisted
from twisted.internet import defer, threads, reactor
from twisted.internet.protocol import DatagramProtocol
from twisted.python.procutils import which
from twisted.python import log
try:
import resource
def increase_rlimi... | gpl-3.0 |
synweap15/pyload | module/plugins/accounts/RehostTo.py | 6 | 1796 | # -*- coding: utf-8 -*-
from module.plugins.internal.Account import Account
class RehostTo(Account):
__name__ = "RehostTo"
__type__ = "account"
__version__ = "0.19"
__status__ = "testing"
__description__ = """Rehost.to account plugin"""
__license__ = "GPLv3"
__authors__ = ... | gpl-3.0 |
redhat-openstack/glance_store | glance_store/_drivers/vmware_datastore.py | 2 | 28716 | # Copyright 2014 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/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 |
tempbottle/kbengine | kbe/res/scripts/common/Lib/test/test_smtpd.py | 118 | 22585 | import unittest
from test import support, mock_socket
import socket
import io
import smtpd
import asyncore
class DummyServer(smtpd.SMTPServer):
def __init__(self, localaddr, remoteaddr):
smtpd.SMTPServer.__init__(self, localaddr, remoteaddr)
self.messages = []
def process_message(self, peer, ... | lgpl-3.0 |
aringh/odl | odl/tomo/geometry/spect.py | 3 | 8247 | # Copyright 2014-2017 The ODL contributors
#
# This file is part of ODL.
#
# 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 https://mozilla.org/MPL/2.0/.
"""Single-photon emission computed tomograph... | mpl-2.0 |
kstaniek/has | examples/hc2_demo.py | 1 | 10440 | #!/usr/bin/env python3
# Copyright (c) Klaudisz Staniek.
# See LICENSE for details.
"""
This is an example application demonstrating the event driven driver capabilities and API usage
"""
from has.manager.manager import Manager
from has.utils.notification import Notification
from threading import Lock, RLock, Condi... | mit |
mquandalle/rethinkdb | external/v8_3.30.33.16/testing/gmock/gtest/scripts/pump.py | 2471 | 23673 | #!/usr/bin/env python
#
# Copyright 2008, 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... | agpl-3.0 |
open-synergy/account-payment | account_payment_return_import/wizard/payment_return_import.py | 2 | 11987 | # -*- coding: utf-8 -*-
# © 2016 Carlos Dauden <carlos.dauden@tecnativa.com>
# © 2016 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import base64
from StringIO import StringIO
from zipfile import ZipFile, BadZipfile # BadZipFile in Python >= 3.2
from opene... | agpl-3.0 |
WhireCrow/openwrt-mt7620 | staging_dir/host/lib/python2.7/bsddb/test/test_dbtables.py | 74 | 15366 | #!/usr/bin/env python
#
#-----------------------------------------------------------------------
# A test suite for the table interface built on bsddb.db
#-----------------------------------------------------------------------
#
# Copyright (C) 2000, 2001 by Autonomous Zone Industries
# Copyright (C) 2002 Gregory P. Sm... | gpl-2.0 |
eBay/cronus-agent | agent/agent/lib/monitors/system_monitor.py | 1 | 2306 | #pylint: disable=E1101,W0105
'''
Copyright 2014 eBay Software 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 applicabl... | apache-2.0 |
FlintHill/SUAS-Competition | env/lib/python3.7/site-packages/setuptools/command/alias.py | 455 | 2426 | from distutils.errors import DistutilsOptionError
from setuptools.extern.six.moves import map
from setuptools.command.setopt import edit_config, option_base, config_file
def shquote(arg):
"""Quote an argument for later parsing by shlex.split()"""
for c in '"', "'", "\\", "#":
if c in arg:
... | mit |
xZise/pywikibot-core | pywikibot/i18n.py | 1 | 21406 | # -*- coding: utf-8 -*-
"""
Various i18n functions.
Helper functions for both the internal translation system
and for TranslateWiki-based translations.
By default messages are assumed to reside in a package called
'scripts.i18n'. In pywikibot 2.0, that package is not packaged
with pywikibot, and pywikibot 2.0 does ... | mit |
auerj/flask-oauthlib | docs/conf.py | 18 | 8262 | # -*- coding: utf-8 -*-
#
# Flask-OAuthlib documentation build configuration file, created by
# sphinx-quickstart on Fri May 17 21:54:48 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
... | bsd-3-clause |
cockpituous/cockpit | test/selenium/selenium-base.py | 1 | 8170 | #!/usr/bin/python3
# we need to be able to find and import seleniumlib, so add this directory
from testlib_avocado.seleniumlib import SeleniumTest, user, clickable, passwd, visible
import os
import sys
machine_test_dir = os.path.dirname(os.path.abspath(__file__))
if machine_test_dir not in sys.path:
sys.path.inser... | lgpl-2.1 |
rendermotion/RMMel | creators/connect.py | 2 | 11473 | from RMPY.core import dataValidators
import pymel.core as pm
from RMPY.creators import creatorsBase
class Connect(creatorsBase.CreatorsBase):
def __init__(self, *args, **kwargs):
super(Connect, self).__init__(*args, **kwargs)
@staticmethod
def _validate_connection(attribute, input_attribute):
... | lgpl-3.0 |
RickMohr/nyc-trees | src/nyc_trees/apps/survey/models.py | 1 | 8446 | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from django.contrib.gis.db import models
from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse
from django.utils.timezone import now
from apps... | apache-2.0 |
paolodedios/tensorflow | tensorflow/lite/experimental/mlir/testing/op_tests/tensor_list_length.py | 6 | 2271 | # Copyright 2019 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 |
pchauncey/ansible | lib/ansible/modules/system/interfaces_file.py | 7 | 13752 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2016, Roman Belyakovsky <ihryamzik () gmail.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_version':... | gpl-3.0 |
benjaoming/kolibri | kolibri/plugins/learn/templatetags/learn_tags.py | 12 | 1182 | """
Learn template tags
===================
Tags for including learn app javascript assets ina template. To use:
.. code-block:: html
{% load learn_tags %}
<!-- Render inclusion tag for frontend JS elements -->
{% learn_assets %}
"""
from __future__ import absolute_import, print_function, unicode_liter... | mit |
CoderBotOrg/coderbotsrv | server/lib/wtforms/ext/dateutil/fields.py | 20 | 2605 | """
A DateTimeField and DateField that use the `dateutil` package for parsing.
"""
from dateutil import parser
from wtforms.fields import Field
from wtforms.validators import ValidationError
from wtforms.widgets import TextInput
__all__ = (
'DateTimeField', 'DateField',
)
class DateTimeField(Field):
"""
... | gpl-3.0 |
studioml/studio | examples/keras/train_mnist_keras_mutligpu.py | 1 | 1623 | import sys
from keras.layers import Input, Dense
from keras.models import Model
from keras.datasets import mnist
from keras.utils import to_categorical
from keras.callbacks import ModelCheckpoint, TensorBoard
from studio import fs_tracker
from studio import multi_gpu
# this placeholder will contain our input digits, ... | apache-2.0 |
lovexiaov/SandwichApp | venv/lib/python2.7/site.py | 784 | 27543 | """Append module search paths for third-party packages to sys.path.
****************************************************************
* This module is automatically imported during initialization. *
****************************************************************
In earlier versions of Python (up to 1.5a3), scripts or... | apache-2.0 |
rob356/SickRage | tornado/test/websocket_test.py | 19 | 14504 | from __future__ import absolute_import, division, print_function, with_statement
import traceback
from tornado.concurrent import Future
from tornado import gen
from tornado.httpclient import HTTPError, HTTPRequest
from tornado.log import gen_log, app_log
from tornado.testing import AsyncHTTPTestCase, gen_test, bind_u... | gpl-3.0 |
Godiyos/python-for-android | python3-alpha/python3-src/Lib/importlib/test/util.py | 46 | 3919 | from contextlib import contextmanager
import imp
import os.path
from test import support
import unittest
import sys
CASE_INSENSITIVE_FS = True
# Windows is the only OS that is *always* case-insensitive
# (OS X *can* be case-sensitive).
if sys.platform not in ('win32', 'cygwin'):
changed_name = __file__.upper()
... | apache-2.0 |
looopTools/sw9-source | .waf-1.9.8-6657823688b736c1d1a4e2c4e8e198b4/waflib/extras/wurf/configuration.py | 1 | 1593 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
import os
from.error import Error
class Configuration(object):
RESOLVE='resolve'
LOAD='load'
HELP='help'
RESOLVE_AND_LOCK='resolve_and_lock'
RESOLVE_FROM_LOCK='resolve_from_lock'
LOCK_FILE='loc... | mit |
keeprocking/pygelf | tests/helper.py | 1 | 1566 | import uuid
import time
import logging
import pytest
import requests
@pytest.yield_fixture
def logger(handler):
logger = logging.getLogger('test')
logger.addHandler(handler)
yield logger
logger.removeHandler(handler)
def log_warning(logger, message, args=None, fields=None):
args = args if args e... | mit |
GoogleCloudPlatform/professional-services-data-validator | third_party/ibis/ibis_DB2/tests/test_functions.py | 1 | 26547 | # Copyright 2020 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, soft... | apache-2.0 |
mozvip/Sick-Beard | sickbeard/notifiers/__init__.py | 1 | 2463 | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 t... | gpl-3.0 |
FelixMDenis/doxygen | src/version.py | 6 | 1733 | #
# script to read the version information from `../configure`
# relevant lines are starting with:
# `doxygen_version_major`
# `doxygen_version_minor`
# `doxygen_version_revision`
# `doxygen_version_mmn`
# the collected information is written to: `../VERSION` and `../src/version.cpp`
#
import sys
import os
#
... | gpl-2.0 |
INNUENDOCON/INNUca | src/SPAdes-3.11.0-Linux/share/spades/pyyaml2/loader.py | 671 | 1132 |
__all__ = ['BaseLoader', 'SafeLoader', 'Loader']
from reader import *
from scanner import *
from parser import *
from composer import *
from constructor import *
from resolver import *
class BaseLoader(Reader, Scanner, Parser, Composer, BaseConstructor, BaseResolver):
def __init__(self, stream):
Reader.... | gpl-3.0 |
CubicERP/geraldo | site/newsite/django_1_0/django/db/models/related.py | 49 | 6008 | class BoundRelatedObject(object):
def __init__(self, related_object, field_mapping, original):
self.relation = related_object
self.field_mappings = field_mapping[related_object.name]
def template_name(self):
raise NotImplementedError
def __repr__(self):
return repr(self.__d... | lgpl-3.0 |
bev-a-tron/pledge_service | backend/handlers.py | 3 | 37417 | """Handlers for MayOne.US."""
from collections import namedtuple, defaultdict
import datetime
import json
import logging
import cgi
import base64
import urllib
import datetime
from google.appengine.api import mail
from google.appengine.ext import db
from google.appengine.ext import deferred
from google.appengine.api ... | apache-2.0 |
Mixser/django | tests/auth_tests/models/custom_permissions.py | 295 | 1433 | """
The CustomPermissionsUser users email as the identifier, but uses the normal
Django permissions model. This allows us to check that the PermissionsMixin
includes everything that is needed to interact with the ModelBackend.
"""
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
from django.con... | bsd-3-clause |
mach0/QGIS | tests/src/python/test_qgscodeeditorcolorscheme.py | 25 | 3207 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsCodeEditorColorScheme
.. note:: 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 versio... | gpl-2.0 |
veger/ansible | lib/ansible/modules/network/f5/bigip_monitor_tcp_half_open.py | 3 | 20328 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
openstack/sahara | sahara/utils/proxy.py | 1 | 11491 | # Copyright (c) 2014 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | apache-2.0 |
williamfeng323/py-web | flask/lib/python3.6/site-packages/pip/req/req_install.py | 335 | 46487 | from __future__ import absolute_import
import logging
import os
import re
import shutil
import sys
import tempfile
import traceback
import warnings
import zipfile
from distutils import sysconfig
from distutils.util import change_root
from email.parser import FeedParser
from pip._vendor import pkg_resources, six
from... | mit |
andela-ifageyinbo/django | tests/auth_tests/test_context_processors.py | 269 | 6773 | import datetime
from django.contrib.auth import authenticate
from django.contrib.auth.context_processors import PermLookupDict, PermWrapper
from django.contrib.auth.models import Permission, User
from django.contrib.contenttypes.models import ContentType
from django.db.models import Q
from django.test import SimpleTes... | bsd-3-clause |
chintak/scikit-image | skimage/color/colorconv.py | 2 | 36639 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Functions for converting between color spaces.
The "central" color space in this module is RGB, more specifically the linear
sRGB color space using D65 as a white-point [1]_. This represents a
standard monitor (w/o gamma correction). For a good FAQ on color spaces see... | bsd-3-clause |
wuhengzhi/chromium-crosswalk | tools/metrics/histograms/extract_histograms.py | 40 | 16108 | # 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.
"""Extract histogram names from the description XML file.
For more information on the format of the XML file, which is self-documenting,
see histograms.xml;... | bsd-3-clause |
MontpellierRessourcesImagerie/openmicroscopy | components/tools/OmeroWeb/omeroweb/webclient/controller/__init__.py | 15 | 2099 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
#
#
# Copyright (c) 2008-2011 University of Dundee.
#
# 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
# License, or... | gpl-2.0 |
aes/unleash-client-python | unleash_client/features.py | 1 | 1103 | import logging
log = logging.getLogger(__name__)
def feature_gates(strategies, feature):
tests = []
for args in feature['strategies']:
name, parameters = args['name'], args['parameters']
strategy = strategies.get(name)
if strategy:
test = strategy(**parameters)
... | apache-2.0 |
hadronproject/lpms | lpms/operations/sync.py | 1 | 2054 | # Copyright 2009 - 2011 Burak Sezer <purak@hadronproject.org>
#
# This file is part of lpms
#
# lpms 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 |
galeone/dynamic-training-bench | dytb/trainer/utils/flow.py | 1 | 2027 | #Copyright (C) 2017 Paolo Galeone <nessuno@nerdz.eu>
#
#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/.
#Exhibit B is not attached; this software is compatible with the
#lic... | mpl-2.0 |
mojeto/django | tests/gis_tests/tests.py | 22 | 4106 | import unittest
from django.core.exceptions import ImproperlyConfigured
from django.db import ProgrammingError
try:
from django.contrib.gis.db.backends.postgis.operations import PostGISOperations
HAS_POSTGRES = True
except ImportError:
HAS_POSTGRES = False
except ImproperlyConfigured as e:
# If psycop... | bsd-3-clause |
nseifert/oddities | chemistry/harmonic_state_counter.py | 1 | 7688 | """
HARMONIC (VIBRATIONAL) STATE COUNTER
FOR POLYATOMIC MOLECULES.
Implements the state counting algorithm
from:
M. J. H. Kemper, J. M. F. van Dijk, H. M. Buck,
Chem. Phys. Lett., 53 (1), 121.
Note:
State counter doesn't count for ground state,
so calculations of the partition function require
the a... | mit |
openstack/nova | nova/tests/functional/regressions/test_bug_1620248.py | 2 | 1916 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | apache-2.0 |
formiano/enigma2-4.4 | lib/python/Components/Converter/ServiceInfo.py | 8 | 8587 | from Components.Converter.Converter import Converter
from enigma import iServiceInformation, iPlayableService
from Components.Element import cached
from os import path
WIDESCREEN = [3, 4, 7, 8, 0xB, 0xC, 0xF, 0x10]
class ServiceInfo(Converter, object):
HAS_TELETEXT = 1
IS_MULTICHANNEL = 2
AUDIO_STEREO = 3
IS_CRY... | gpl-2.0 |
p4datasystems/CarnotKE | jyhton/lib-python/2.7/lib-tk/FixTk.py | 96 | 2938 | import sys, os
# Delay import _tkinter until we have set TCL_LIBRARY,
# so that Tcl_FindExecutable has a chance to locate its
# encoding directory.
# Unfortunately, we cannot know the TCL_LIBRARY directory
# if we don't know the tcl version, which we cannot find out
# without import Tcl. Fortunately, Tcl will itself ... | apache-2.0 |
hyperized/ansible | lib/ansible/modules/monitoring/grafana_plugin.py | 20 | 8684 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Thierry Sallé (@seuf)
# 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
ANSIBLE_METADATA = {
'status': ['preview'],
'supported_by': 'com... | gpl-3.0 |
chenkianwee/pyliburo | py4design/py2radiance/write_rad.py | 2 | 6667 | # ==================================================================================================
#
# Copyright (c) 2016, Chen Kian Wee (chenkianwee@gmail.com)
#
# This file is part of py4design
#
# py4design is free software: you can redistribute it and/or modify
# it under the terms of the GNU General ... | gpl-3.0 |
chai2010/webp | internal/libwebp-0.5.0/swig/libwebp.py | 107 | 6605 | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.4
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import ... | bsd-3-clause |
haroldl/homeworklog | django/contrib/gis/gdal/feature.py | 321 | 3998 | # The GDAL C library, OGR exception, and the Field object
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.error import OGRException, OGRIndexError
from django.contrib.gis.gdal.field import Field
from django.contrib.gis.gdal.geometries import OGRGeometry, OGRGeomType
from django.contrib.gi... | bsd-3-clause |
xrmx/django | tests/get_or_create/models.py | 90 | 1324 | from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Person(models.Model):
first_name = models.CharField(max_length=100)
last_name = models.CharField(max_length=100)
birthday = models.DateFiel... | bsd-3-clause |
rdelval/aurora | src/test/python/apache/aurora/client/cli/test_inspect.py | 5 | 6730 | #
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under ... | apache-2.0 |
pwillworth/galaxyharvester | html/markUnavailable.py | 1 | 4274 | #!/usr/bin/env python3
"""
Copyright 2020 Paul Willworth <ioscode@gmail.com>
This file is part of Galaxy Harvester.
Galaxy Harvester 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 ... | gpl-3.0 |
micfan/dinner | src/apps/oauth2/views.py | 1 | 20543 | #coding=utf-8
__author__ = 'laonan, http://laonan.net'
'''
调用weibo api例子, 将API的“/”变为“__”,并传入关键字参数,但不包括source和access_token参数:
client.get.statuses__user_timeline()
client.post.statuses__update(status=u'测试OAuth 2.0发微博')
f = open('/Users/Alan/Workspace/dongting/static/images/player_bg.png')
client.upload.statuses__uploa... | mit |
j4/horizon | horizon/views.py | 67 | 3855 | # 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 |
RoboCupULaval/UI-Debug | Model/DataObject/DrawingData/DrawMultipleLinesDataIn.py | 1 | 2189 | # Under MIT License, see LICENSE.txt
from Model.DataObject.BaseDataObject import catch_format_error
from Model.DataObject.DrawingData.BaseDataDraw import BaseDataDraw
__author__ = 'RoboCupULaval'
class DrawMultipleLinesDataIn(BaseDataDraw):
def __init__(self, data_in):
super().__init__(data_in)
... | mit |
nex3/pygments | pygments/lexers/parsers.py | 72 | 23197 | # -*- coding: utf-8 -*-
"""
pygments.lexers.parsers
~~~~~~~~~~~~~~~~~~~~~~~
Lexers for parser generators.
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, DelegatingLexer, \
include... | bsd-2-clause |
florianholzapfel/home-assistant | homeassistant/components/media_player/yamaha.py | 6 | 9875 | """
Support for Yamaha Receivers.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.yamaha/
"""
import logging
import voluptuous as vol
from homeassistant.components.media_player import (
SUPPORT_TURN_OFF, SUPPORT_TURN_ON, SUPPORT_VOLUME_... | mit |
edwardsamuel/py-mysql2pgsql | mysql2pgsql/lib/postgres_db_writer.py | 1 | 7769 | from __future__ import with_statement, absolute_import
import time
from contextlib import closing
import psycopg2
from . import print_row_progress, status_logger
from .postgres_writer import PostgresWriter
class PostgresDbWriter(PostgresWriter):
"""Class used to stream DDL and/or data
from a MySQL server t... | mit |
nomnombtc/bitcoin | qa/rpc-tests/pruning.py | 4 | 15031 | #!/usr/bin/env python3
# Copyright (c) 2014-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.
#
# Test pruning code
# ********
# WARNING:
# This test uses 4GB of disk space.
# This test takes 30 mins... | mit |
walkon302/CDIPS_Recommender | lib/vgg16.py | 4 | 7225 | # -*- coding: utf-8 -*-
'''VGG16 model for Keras.
# Reference:
- [Very Deep Convolutional Networks for Large-Scale Image Recognition](https://arxiv.org/abs/1409.1556)
'''
from __future__ import print_function
import numpy as np
import warnings
from keras.models import Model
from keras.layers import Flatten, Dense,... | apache-2.0 |
vismartltd/edx-platform | common/lib/xmodule/xmodule/modulestore/tests/django_utils.py | 4 | 16715 | # encoding: utf-8
"""
Modulestore configuration for test cases.
"""
import datetime
import pytz
from tempfile import mkdtemp
from uuid import uuid4
from mock import patch
from django.conf import settings
from django.contrib.auth.models import User
from django.test import TestCase
from django.test.utils import overrid... | agpl-3.0 |
nlholdem/icodoom | .venv/lib/python2.7/site-packages/tensorflow/contrib/distributions/python/ops/multinomial.py | 11 | 10471 | # 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... | gpl-3.0 |
zenoss/Community-Zenpacks | ZenPacks.community.HPMon/ZenPacks/community/HPMon/modeler/plugins/community/snmp/HPIdeControllerMap.py | 2 | 2298 | ################################################################################
#
# This program is part of the HPMon Zenpack for Zenoss.
# Copyright (C) 2008 Egor Puzanov.
#
# This program can be used under the GNU General Public License version 2
# You can find full information here: http://www.zenoss.com/oss
#
####... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.