repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
michaelmdresser/obama-memegenerator | requests/packages/urllib3/connectionpool.py | 64 | 33934 | from __future__ import absolute_import
import errno
import logging
import sys
import warnings
from socket import error as SocketError, timeout as SocketTimeout
import socket
from .exceptions import (
ClosedPoolError,
ProtocolError,
EmptyPoolError,
HeaderParsingError,
HostChangedError,
Locatio... | mit |
vuchau/ansible | lib/ansible/parsing/utils/jsonify.py | 203 | 1451 | # (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 |
miurahr/drizzle | tests/lib/test_mode.py | 1 | 3068 | #! /usr/bin/env python
# -*- mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
# vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
#
# Copyright (C) 2010 Patrick Crews
#
# 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 ... | gpl-2.0 |
kurkop/server-tools | __unported__/email_template_template/model/email_template.py | 6 | 2706 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2013 Therp BV (<http://therp.nl>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
ecolitan/fatics | venv/lib/python2.7/site-packages/pycparser/ply/yacc.py | 465 | 128492 | # -----------------------------------------------------------------------------
# ply: yacc.py
#
# Copyright (C) 2001-2011,
# David M. Beazley (Dabeaz LLC)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions a... | agpl-3.0 |
imtapps/django-attachment | attachments/models.py | 1 | 5464 | from StringIO import StringIO
import re
from PIL import Image
from django.conf import settings
from django.db import models
from django.core.urlresolvers import reverse
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from south.modelsinspector import add_intr... | bsd-2-clause |
MariaSolovyeva/inasafe | safe/impact_functions/inundation/flood_raster_road/parameter_definitions.py | 8 | 1841 | # coding=utf-8
from safe.impact_functions.unit_definitions import parameter_unit_metres
__author__ = 'lucernae'
__date__ = '11/04/15'
import sys
from safe_extras.parameters.float_parameter import FloatParameter
from safe_extras.parameters.string_parameter import StringParameter
from safe.utilities.i18n import tr
d... | gpl-3.0 |
saurabh6790/alert-med-app | support/doctype/maintenance_schedule/maintenance_schedule.py | 29 | 11570 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes.utils import add_days, cstr, getdate
from webnotes.model.doc import addchild
from webnotes.model.bean import getlist
f... | agpl-3.0 |
goshow-jp/Kraken | Python/kraken/ui/HAppkit_Editors/editor_widgets/line_editor.py | 1 | 2204 | from PySide import QtGui, QtCore
from ..fe import FE
from ..widget_factory import EditorFactory
from ..base_editor import BaseValueEditor
class LineEditEditor(QtGui.QLineEdit):
def __init__(self, valueController, parent=None):
super(LineEditEditor, self).__init__(parent)
self._valueController = v... | bsd-3-clause |
hgdeoro/pilas | pilasengine/interprete/lanas_ui.py | 2 | 2136 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'pilasengine/interprete/lanas.ui'
#
# by: PyQt4 UI code generator 4.10.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
d... | lgpl-3.0 |
jonathonthill/ZeMo | TouchScreen.py | 1 | 86092 | #!/usr/bin/python3.4
import os
import sys
import pygame as pg
import pygame.gfxdraw
import serial # Required for communication with boards
import time # Used for timestamps, delays
import Sensors
from Sensors import *
import Emailer
from Emailer import *
import RPi.GPIO as GPIO
from datetime import datetime
import log... | gpl-3.0 |
ArcherSys/ArcherSys | Lib/test/test_wait3.py | 2 | 3611 | <<<<<<< HEAD
<<<<<<< HEAD
"""This test checks for correct wait3() behavior.
"""
import os
import time
import unittest
from test.fork_wait import ForkWait
from test.support import run_unittest, reap_children
if not hasattr(os, 'fork'):
raise unittest.SkipTest("os.fork not defined")
if not hasattr(os, 'wait3'):
... | mit |
sileht/pifpaf | pifpaf/drivers/postgresql.py | 1 | 2135 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | apache-2.0 |
jonathanmorgan/django_reference_data | migrations/0004_auto__add_postal_code.py | 1 | 6695 | # -*- coding: 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 model 'Postal_Code'
db.create_table(u'django_reference_data_postal_code', (
(u'id', sel... | gpl-3.0 |
Ms2ger/servo | tests/wpt/web-platform-tests/tools/pytest/doc/en/example/nonpython/conftest.py | 202 | 1337 | # content of conftest.py
import pytest
def pytest_collect_file(parent, path):
if path.ext == ".yml" and path.basename.startswith("test"):
return YamlFile(path, parent)
class YamlFile(pytest.File):
def collect(self):
import yaml # we need a yaml parser, e.g. PyYAML
raw = yaml.safe_load... | mpl-2.0 |
WillisXChen/django-oscar | oscar/lib/python2.7/site-packages/phonenumbers/data/region_TR.py | 11 | 2452 | """Auto-generated file, do not edit by hand. TR metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_TR = PhoneMetadata(id='TR', country_code=90, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[2-589]\\d{9}|444\\d{4}', possible_number... | bsd-3-clause |
abhi931375/requests-oauthlib | requests_oauthlib/oauth2_session.py | 26 | 15093 | from __future__ import unicode_literals
import logging
from oauthlib.common import generate_token, urldecode
from oauthlib.oauth2 import WebApplicationClient, InsecureTransportError
from oauthlib.oauth2 import TokenExpiredError, is_secure_transport
import requests
log = logging.getLogger(__name__)
class TokenUpdat... | isc |
ros2/rttest | rttest/scripts/analyze.py | 2 | 1414 | #!/usr/bin/env python3
# Copyright 2015 Open Source Robotics Foundation, 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 req... | apache-2.0 |
KenKundert/ec0 | runtests.py | 1 | 11626 | # Utility for Recursively Running Self Tests
# TODO {{{1
# Support for coverage is weak because the coverage tool needs to be run
# hiearchically from the current working directory whereas this tool walks the
# hierarchy running tests. Probably need a different tool for coverage.
# Consider adding support for f... | gpl-3.0 |
catalpainternational/OIPA | OIPA/api/v3/resources/helper_resources.py | 1 | 4030 | from builtins import object
# Tastypie specific
from tastypie import fields
from tastypie.resources import ModelResource
from tastypie.constants import ALL, ALL_WITH_RELATIONS
from iati.models import *
class LanguageResource(ModelResource):
class Meta:
queryset = Language.objects.all()
include_res... | agpl-3.0 |
hoffmabc/OpenBazaar-Server | log.py | 7 | 1713 | """
Copyright (c) 2014 Brian Muller
"""
import sys
from twisted.python import log
INFO = 5
DEBUG = 4
WARNING = 3
ERROR = 2
CRITICAL = 1
class FileLogObserver(log.FileLogObserver):
def __init__(self, f=None, level=WARNING, default=DEBUG):
log.FileLogObserver.__init__(self, f or sys.stdout)
self.l... | mit |
mm112287/2015cda_g8_0421 | static/Brython3.1.0-20150301-090019/Lib/pydoc.py | 637 | 102017 | #!/usr/bin/env python3
"""Generate Python documentation in HTML or text for interactive use.
In the Python interpreter, do "from pydoc import help" to provide
help. Calling help(thing) on a Python object documents the object.
Or, at the shell command line outside of Python:
Run "pydoc <name>" to show documentation ... | gpl-3.0 |
operasoftware/presto-testo | wpt/websockets/autobahn/oberstet-Autobahn-643d2ee/lib/python/autobahn/case/case1_2_7.py | 14 | 1342 | ###############################################################################
##
## Copyright 2011 Tavendo GmbH
##
## 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
##
## ht... | bsd-3-clause |
Limags/MissionPlanner | Lib/encodings/iso8859_3.py | 93 | 13652 | """ Python Character Mapping Codec iso8859_3 generated from 'MAPPINGS/ISO8859/8859-3.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,i... | gpl-3.0 |
ubic135/odoo-design | addons/hr_holidays/tests/__init__.py | 121 | 1159 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | agpl-3.0 |
Brett824/RebirthItemTracker | pygame2exe.py | 3 | 6608 | # This is a pygame2exe script I found on the internet
# This will create a dist directory containing the executable file, all the data
# directories. All Libraries will be bundled in executable file.
#
# Run the build process by entering 'pygame2exe.py' or
# 'python pygame2exe.py' in a console prompt.
#
# To build exe... | bsd-2-clause |
yanggg1133/amdeb-amazon | amdeb_amazon/models_access/odoo_product_access.py | 2 | 4623 | # -*- coding: utf-8 -*-
from ..model_names.shared_names import(
SHARED_NAME_FIELD, MODEL_NAME_FIELD,
RECORD_ID_FIELD, PRODUCT_SKU_FIELD,
)
from ..model_names.product_attribute import PRODUCT_ATTRIBUTE_ID_FIELD
from ..model_names.product_product import(
PRODUCT_ATTRIBUTE_VALUE_IDS_FIELD,
AMAZON_SYNC_ACT... | gpl-3.0 |
jnewland/home-assistant | homeassistant/components/lw12wifi/light.py | 7 | 4835 | """Support for Lagute LW-12 WiFi LED Controller."""
import logging
import voluptuous as vol
from homeassistant.components.light import (
ATTR_BRIGHTNESS, ATTR_EFFECT, ATTR_HS_COLOR, ATTR_TRANSITION,
Light, PLATFORM_SCHEMA, SUPPORT_BRIGHTNESS, SUPPORT_EFFECT,
SUPPORT_COLOR, SUPPORT_TRANSITION
)
from homea... | apache-2.0 |
thespecialbro/Shoot-em-up | test.py | 1 | 2933 | #! python
'''
Verifies that everything is working
with the file system and python modules
'''
def main():
print('Importing modules:')
pygame_e = False
config_e = False
shmup_e = False
pygbutton_e = False
import time
import random
import os
import sys
print('\ttime\n\trandom\n\to... | gpl-2.0 |
murphy666/sun4i-kernel | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py | 183 | 5410 | # SchedGui.py - Python extension for perf trace, 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 |
MichaelDrogalis/ansible | v1/ansible/module_utils/database.py | 401 | 5839 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
Qalthos/ansible | lib/ansible/modules/cloud/azure/azure_rm_virtualmachinescalesetextension.py | 20 | 10667 | #!/usr/bin/python
#
# Copyright (c) 2019 Zim Kalinowski (@zikalino)
#
# 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 |
africallshop/africallshop-iphone | submodules/externals/libxml2/python/tests/reader5.py | 87 | 1252 | #!/usr/bin/python -u
#
# this tests the Expand() API of the xmlTextReader interface
# this extract the Dragon bibliography entries from the XML specification
#
import libxml2
import StringIO
import sys
# Memory debug specific
libxml2.debugMemory(1)
expect="""<bibl id="Aho" key="Aho/Ullman">Aho, Alfred V.,
Ravi Sethi... | gpl-2.0 |
akosyakov/intellij-community | python/lib/Lib/site-packages/django/utils/log.py | 71 | 3241 | import logging
import sys
from django.core import mail
# Make sure a NullHandler is available
# This was added in Python 2.7/3.2
try:
from logging import NullHandler
except ImportError:
class NullHandler(logging.Handler):
def emit(self, record):
pass
# Make sure that dictConfig is availabl... | apache-2.0 |
araseyuta/Newsstand-analytics | gdata/contacts/client.py | 50 | 22392 | #!/usr/bin/env python
#
# Copyright (C) 2009 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 ... | apache-2.0 |
thensgens/vvs | src/flask/testsuite/subclassing.py | 57 | 1201 | # -*- coding: utf-8 -*-
"""
flask.testsuite.subclassing
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Test that certain behavior of flask can be customized by
subclasses.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import flask
import unittest
from StringIO import St... | mit |
sazlin/reTOracle | push_db.py | 1 | 8343 | #!/usr/bin/python
from filters_json import filter_list as filters
import time, datetime
import json
import sys
import os
import sql_queries as sql_q
from filters_json import filter_list
from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
from tweepy import Stream
from logger import make_logger
... | mit |
Pluto-tv/chromium-crosswalk | tools/deep_memory_profiler/lib/sorter.py | 100 | 14314 | # 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.
import cStringIO
import json
import logging
import os
import re
from lib.ordered_dict import OrderedDict
LOGGER = logging.getLogger('dmprof')
BASE_PATH =... | bsd-3-clause |
lgarren/spack | lib/spack/spack/test/llnl/util/file_list.py | 1 | 9530 | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
OSSESAC/odoopubarquiluz | addons/point_of_sale/account_bank_statement.py | 51 | 2158 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 PC Solutions (<http://pcsol.be>). All Rights Reserved
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free... | agpl-3.0 |
JuliBakagianni/CEF-ELRC | lib/python2.7/site-packages/django/core/cache/backends/dummy.py | 234 | 1218 | "Dummy cache backend"
from django.core.cache.backends.base import BaseCache
class DummyCache(BaseCache):
def __init__(self, host, *args, **kwargs):
BaseCache.__init__(self, *args, **kwargs)
def add(self, key, value, timeout=None, version=None):
key = self.make_key(key, version=version)
... | bsd-3-clause |
MoellerSebs/NS_Bot | NS/NS_00.py | 1 | 4664 | # -*- coding: utf-8 -*-
"""
Created on Sun Sep 18 20:57:47 2016
@author: Sebastien, Oriol Forrest, and Hans
NS Tweeter
"""
# To instal a module run the following command from Command Prompt:
# python -m pip install PACKAGE
import util
#%% NS API Information
username = 'sebastienmoeller@gmail.com'
password = 'rleYtKM... | mit |
mshahbaz/exabgp | lib/exabgp/bgp/message/update/attribute/communities.py | 2 | 9600 | # encoding: utf-8
"""
community.py
Created by Thomas Mangin on 2009-11-05.
Copyright (c) 2009-2013 Exa Networks. All rights reserved.
"""
from struct import pack,unpack
from exabgp.bgp.message.update.attribute.id import AttributeID
from exabgp.bgp.message.update.attribute import Flag,Attribute
# ===================... | bsd-3-clause |
AZtheAsian/zulip | zerver/management/commands/process_queue.py | 32 | 3101 | from __future__ import absolute_import
from types import FrameType
from typing import Any
from argparse import ArgumentParser
from django.core.management.base import BaseCommand
from django.core.management import CommandError
from django.conf import settings
from django.utils import autoreload
from zerver.worker.queu... | apache-2.0 |
HammerDuJour/blepisensor | blepiTemp.py | 1 | 3492 | import pexpect
import sys
import time
import datetime
import sqlite3
from SensorTag import *
from SensorCalcs import *
csvfile = r'testfile.csv'
#set this empty to turn off logging:
logfile = r'pexpect.log'
def usage():
print 'blepiTemp.py Usage:'
print ' blepiTemp.py'
print ''
print ' SensorTag ad... | mit |
moijes12/oh-mainline | mysite/search/migrations/0053_make_project_name_really_unique.py | 15 | 14637 | # This file is part of OpenHatch.
# Copyright (C) 2010 OpenHatch, Inc.
#
# 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
# (at your option) any later v... | agpl-3.0 |
kerneltask/micropython | tests/extmod/vfs_blockdev.py | 15 | 1595 | # Test for behaviour of combined standard and extended block device
try:
import uos
uos.VfsFat
uos.VfsLfs2
except (ImportError, AttributeError):
print("SKIP")
raise SystemExit
class RAMBlockDevice:
ERASE_BLOCK_SIZE = 512
def __init__(self, blocks):
self.data = bytearray(blocks *... | mit |
svanschalkwyk/datafari | windows/python/Lib/sunaudio.py | 286 | 1399 | """Interpret sun audio headers."""
from warnings import warnpy3k
warnpy3k("the sunaudio module has been removed in Python 3.0; "
"use the sunau module instead", stacklevel=2)
del warnpy3k
MAGIC = '.snd'
class error(Exception):
pass
def get_long_be(s):
"""Convert a 4-char value to integer."""
r... | apache-2.0 |
spokendotcpp/L3info_workspace | Maths/viewProofsAndModels/reduce.py | 2 | 2304 | #!/usr/bin/python
from xml.dom.minidom import *
import sys
from optparse import OptionParser
def extract_textlist(elements):
"Given list of elements e, return as list the text enclosed by each."
resultfragments = []
for element in elements:
textfragment = []
for child in element.childNodes:
if chi... | gpl-3.0 |
donkirkby/django | django/db/backends/postgresql/version.py | 632 | 1517 | """
Extracts the version of the PostgreSQL server.
"""
import re
# This reg-exp is intentionally fairly flexible here.
# Needs to be able to handle stuff like:
# PostgreSQL #.#.#
# EnterpriseDB #.#
# PostgreSQL #.# beta#
# PostgreSQL #.#beta#
VERSION_RE = re.compile(r'\S+ (\d+)\.(\d+)\.?(\d+)?')
def _parse_... | bsd-3-clause |
matrixorz/pynsq | nsq/client.py | 4 | 1847 | import time
import logging
import tornado.ioloop
class Client(object):
def __init__(self):
tornado.ioloop.PeriodicCallback(self._check_last_recv_timestamps, 60 * 1000).start()
def _on_connection_identify(self, conn, data, **kwargs):
logging.info('[%s:%s] IDENTIFY sent %r' % (conn.id, self.na... | mit |
philippeback/volatility | volatility/plugins/gui/userhandles.py | 58 | 3646 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
# Copyright (C) 2010,2011,2012 Michael Hale Ligh <michael.ligh@mnin.org>
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the ... | gpl-2.0 |
vicky2135/lucious | oscar/lib/python2.7/site-packages/py/_xmlgen.py | 5 | 8619 | """
module for generating and serializing xml and html structures
by using simple python objects.
(c) holger krekel, holger at merlinux eu. 2009
"""
import sys, re
if sys.version_info >= (3,0):
def u(s):
return s
def unicode(x, errors=None):
if hasattr(x, '__unicode__'):
... | bsd-3-clause |
Kriechi/mitmproxy | mitmproxy/proxy/layers/http/__init__.py | 1 | 31527 | import collections
import enum
import time
from dataclasses import dataclass
from typing import DefaultDict, Dict, List, Optional, Tuple, Union
from mitmproxy import flow, http
from mitmproxy.connection import Connection, Server
from mitmproxy.net import server_spec
from mitmproxy.net.http import status_codes, url
fro... | mit |
bottompawn/kbengine | kbe/src/lib/python/Lib/genericpath.py | 106 | 3882 | """
Path operations common to more than one OS
Do not use directly. The OS specific modules import the appropriate
functions from this module themselves.
"""
import os
import stat
__all__ = ['commonprefix', 'exists', 'getatime', 'getctime', 'getmtime',
'getsize', 'isdir', 'isfile', 'samefile', 'sameopenfil... | lgpl-3.0 |
mluke93/osf.io | admin_tests/common_auth/test_views.py | 16 | 1728 | from nose import tools as nt
import mock
from django.test import RequestFactory
from django.http import Http404
from tests.base import AdminTestCase
from tests.factories import AuthUserFactory
from admin_tests.utilities import setup_form_view
from admin.common_auth.models import MyUser
from admin.common_auth.views i... | apache-2.0 |
svn2github/kgyp | test/generator-output/gyptest-rules.py | 198 | 1768 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies --generator-output= behavior when using rules.
"""
import TestGyp
# Android doesn't support --generator-output.
test = TestGy... | bsd-3-clause |
Arcanemagus/plexpy | lib/dns/rrset.py | 8 | 5896 | # Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... | gpl-3.0 |
shaggyz/obmenu-qt | ob_menu_qt/ui/obmenuwidget.py | 1 | 25539 | from PyQt5 import QtGui, QtCore, QtWidgets
from ob_menu_qt.ui.obmenu import Ui_frmObmenu
from ob_menu_qt.lib.obmenuxml import ObMenuXml
import os, shutil
def unicode(s):
return s
class ObMenuWidget(Ui_frmObmenu, QtWidgets.QWidget):
"""
Main widget container designed to deal with
the obmenuxml module, ... | gpl-2.0 |
shashwatsehgal/ToLop | lib/urllib3/contrib/_securetransport/bindings.py | 162 | 17560 | """
This module uses ctypes to bind a whole bunch of functions and constants from
SecureTransport. The goal here is to provide the low-level API to
SecureTransport. These are essentially the C-level functions and constants, and
they're pretty gross to work with.
This code is a bastardised version of the code found in ... | apache-2.0 |
2014c2g12/c2g12 | wsgi/static/Brython2.1.0-20140419-113919/Lib/multiprocessing/pool.py | 694 | 23263 | #
# Module providing the `Pool` class for managing a process pool
#
# multiprocessing/pool.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
__all__ = ['Pool']
#
# Imports
#
import threading
import queue
import itertools
import collections
import time
from multiprocessing ... | gpl-2.0 |
Maximilian-Reuter/SickRage | lib/adba/aniDBresponses.py | 69 | 53726 | #!/usr/bin/env python
#
# This file is part of aDBa.
#
# aDBa 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.
#
# aDBa is distributed i... | gpl-3.0 |
agry/NGECore2 | scripts/roadmap/trader_0c.py | 8 | 2130 | import sys
def getLuck():
return 90
def getPrecision():
return 140
def getStrength():
return 140
def getConstitution():
return 0
def getStamina():
return 50
def getAgility():
return 140
def getHealth():
return 100
def getAction():
return 75
def getRewards(name):
if name == 'item_npe_gen_craft_tool_tra... | lgpl-3.0 |
hungtt57/matchmaker | lib/python2.7/site-packages/requests/packages/urllib3/response.py | 152 | 18542 | from __future__ import absolute_import
from contextlib import contextmanager
import zlib
import io
from socket import timeout as SocketTimeout
from socket import error as SocketError
from ._collections import HTTPHeaderDict
from .exceptions import (
ProtocolError, DecodeError, ReadTimeoutError, ResponseNotChunked
... | mit |
nickhand/pypm | pmesh/domain.py | 1 | 17306 | """
Domain Decomposition in Gaepsi
currently we have a GridND decomposition algorithm.
A few concepts:
- `local` and `ghost`. A data entry is local if
it is stored on the current rank. A data entry is ghost
if it is stored on another rank.
- `primary` and `padding`. A spatial positi... | gpl-3.0 |
SLAC-Lab/net-config | lib/netconfig/backup/storage.py | 3 | 15744 | import logging
import types
import os
import errno
import datetime
from netconfig.backup.configuration import DeviceConfigurations
from netconfig.util import getUsername
#######################################################################
# storage exceptions
######################################################... | gpl-2.0 |
mohammed-alfatih/servo | python/mach/mach/mixin/process.py | 124 | 6762 | # 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/.
# This module provides mixins to perform process execution.
from __future__ import absolute_import, unicode_literals
i... | mpl-2.0 |
amonmoce/corba_examples | omniORBpy-4.2.1/python3/omniORB/Compression.py | 2 | 1193 | # -*- Mode: Python; -*-
# Package : omniORBpy
# Compression.py Created on: 2013/05/28
# Author : Duncan Grisby (dgrisby)
#
# Copyright (C) 2013 Apasphere Ltd
#
# This file is part of the omniORBpy library
#
# The omniORBpy library is free s... | mit |
mKeRix/home-assistant | tests/components/soma/test_config_flow.py | 13 | 3007 | """Tests for the Soma config flow."""
from api.soma_api import SomaApi
from requests import RequestException
from homeassistant import data_entry_flow
from homeassistant.components.soma import DOMAIN, config_flow
from tests.async_mock import patch
from tests.common import MockConfigEntry
MOCK_HOST = "123.45.67.89"
M... | mit |
xifle/home-assistant | homeassistant/components/sensor/deutsche_bahn.py | 10 | 3386 | """
Support for information about the German train system.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.deutsche_bahn/
"""
import logging
from datetime import timedelta
import voluptuous as vol
from homeassistant.components.sensor import PLATF... | mit |
eblossom/gnuradio | gr-blocks/python/blocks/qa_conjugate.py | 57 | 1660 | #!/usr/bin/env python
#
# Copyright 2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your optio... | gpl-3.0 |
DinoV/PTVS | Python/Product/PythonTools/ptvsd/setup.py | 2 | 1377 | #!/usr/bin/env python
#-------------------------------------------------------------------------
# Copyright (c) Microsoft. 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... | apache-2.0 |
waytai/django | django/contrib/gis/gdal/prototypes/errcheck.py | 586 | 4229 | """
This module houses the error-checking routines used by the GDAL
ctypes prototypes.
"""
from ctypes import c_void_p, string_at
from django.contrib.gis.gdal.error import (
GDALException, SRSException, check_err,
)
from django.contrib.gis.gdal.libgdal import lgdal
from django.utils import six
# Helper routine... | bsd-3-clause |
dschien/energy-aggregator | ep_rayleigh_importer/data_tests.py | 1 | 4662 | __author__ = 'mitchell'
device_id = "123@rayleigh"
devices_data_resp = [
{
"bts": [
-2.6026,
51.4546,
1106
],
"tzo": 2,
"vsn": "CHANGE_ME",
"payment_to": 123,
"model": "GSM Control Expert",
"last_call": 123,
"name": "CHANGE_ME",
"id": device_id,
"privilege":... | mit |
rayluo/boto | tests/integration/sqs/__init__.py | 761 | 1104 | # Copyright (c) 2006-2011 Mitch Garnaat http://garnaat.org/
#
# 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, modi... | mit |
JioCloud/glance | glance/tests/functional/test_sqlite.py | 8 | 1350 | # Copyright 2012 Red Hat, 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 ... | apache-2.0 |
mancoast/CPythonPyc_test | cpython/251_test_cfgparser.py | 34 | 16341 | import ConfigParser
import StringIO
import unittest
from test import test_support
class TestCaseBase(unittest.TestCase):
def newconfig(self, defaults=None):
if defaults is None:
self.cf = self.config_class()
else:
self.cf = self.config_class(defaults)
return self.c... | gpl-3.0 |
KaranToor/MA450 | google-cloud-sdk/.install/.backup/lib/surface/deployment_manager/deployments/create.py | 2 | 6862 | # 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... | apache-2.0 |
stackforge/compute-hyperv | compute_hyperv/nova/utils/placement.py | 2 | 5548 | # Copyright 2018 Cloudbase Solutions Srl
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | apache-2.0 |
thaim/ansible | lib/ansible/module_utils/facts/hardware/openbsd.py | 194 | 6435 | # 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 ... | mit |
jnerin/ansible | lib/ansible/utils/vars.py | 40 | 5761 | # (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 |
cervinko/calibre-web | vendor/sqlalchemy/testing/exclusions.py | 12 | 9086 | from __future__ import with_statement
import operator
from nose import SkipTest
from ..util import decorator
from . import config
from .. import util
import contextlib
class skip_if(object):
def __init__(self, predicate, reason=None):
self.predicate = _as_predicate(predicate)
self.reason = reason... | gpl-3.0 |
andim/scipy | scipy/spatial/tests/test_distance.py | 34 | 57149 | #! /usr/bin/env python
#
# Author: Damian Eads
# Date: April 17, 2008
#
# Copyright (C) 2008 Damian Eads
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copy... | bsd-3-clause |
Cryptophobia/ansible | lib/ansible/template/safe_eval.py | 27 | 4578 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | gpl-3.0 |
musicEnfanthen/Knora | upgrade/graphdb-se/old/1263-knora-admin/update-knora-admin.py | 1 | 14837 | #!/usr/bin/env python3
# Copyright @ 2015-2019 the contributors (see Contributors.md).
#
# This file is part of Knora.
#
# Knora 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 ... | agpl-3.0 |
Denisolt/IEEE-NYIT-MA | local/lib/python2.7/site-packages/PIL/ImagePalette.py | 17 | 6321 | #
# The Python Imaging Library.
# $Id$
#
# image palette object
#
# History:
# 1996-03-11 fl Rewritten.
# 1997-01-03 fl Up and running.
# 1997-08-23 fl Added load hack
# 2001-04-16 fl Fixed randint shadow bug in random()
#
# Copyright (c) 1997-2001 by Secret Labs AB
# Copyright (c) 1996-1997 by Fredrik Lundh
#
... | gpl-3.0 |
alrusdi/lettuce | tests/integration/lib/Django-1.2.5/django/contrib/localflavor/is_/forms.py | 309 | 2706 | """
Iceland specific form helpers.
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import RegexField
from django.forms.widgets import Select
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_unicode
cla... | gpl-3.0 |
yamins81/simffa | simffa/early_stopping.py | 1 | 3486 | """
An early-stopping heuristic
"""
import copy
import numpy as np
class EarlyStopping(object):
def __init__(self, warmup, improvement_thresh=0.2, patience=2.0,
max_iters=None):
self.warmup = warmup
self.improvement_thresh = improvement_thresh
self.patience = patience
s... | mit |
andrewpaulreeves/soapy | soapy/pyqtgraph/graphicsItems/ErrorBarItem.py | 45 | 4991 | from ..Qt import QtGui, QtCore
from .GraphicsObject import GraphicsObject
from .. import getConfigOption
from .. import functions as fn
__all__ = ['ErrorBarItem']
class ErrorBarItem(GraphicsObject):
def __init__(self, **opts):
"""
All keyword arguments are passed to setData().
"""
... | gpl-3.0 |
pbuehler/AliPhysics | PWGJE/EMCALJetTasks/Tracks/analysis/correction/TriggeredSpectrumScaler.py | 41 | 2483 | #**************************************************************************
#* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
#* *
#* Author: The ALICE Off-line Project. *
#* Contributors ... | bsd-3-clause |
Pakoach/Sick-Beard-Animes | cherrypy/lib/jsontools.py | 80 | 1574 | import sys
import cherrypy
if sys.version_info >= (2, 6):
# Python 2.6: simplejson is part of the standard library
import json
else:
try:
import simplejson as json
except ImportError:
json = None
if json is None:
def json_decode(s):
raise ValueError('No JSON library is avai... | gpl-3.0 |
takis/django | django/db/backends/base/creation.py | 12 | 10087 | import sys
import time
from django.apps import apps
from django.conf import settings
from django.core import serializers
from django.db import router
from django.utils.six import StringIO
from django.utils.six.moves import input
# The prefix to put on the default database name when creating
# the test database.
TEST_... | bsd-3-clause |
vks/servo | tests/wpt/web-platform-tests/tools/wptserve/tests/functional/test_stash.py | 299 | 1231 | import os
import unittest
import urllib2
import json
import uuid
import wptserve
from wptserve.router import any_method
from base import TestUsingServer, doc_root
class TestResponseSetCookie(TestUsingServer):
def test_put_take(self):
@wptserve.handlers.handler
def handler(request, response):
... | mpl-2.0 |
bokeh/bokeh | bokeh/plotting/_legends.py | 1 | 5768 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2021, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | bsd-3-clause |
stadelmanma/netl-AP_MAP_FLOW | apmapflow/data_processing/histogram_logscale.py | 2 | 2486 | """
================================================================================
Logscaled Histogram
================================================================================
| Calculates a logarithmically spaced histogram for a data map.
| Written By: Matthew Stadelman
| Date Written: 2016/03/07
| Last Mod... | gpl-3.0 |
benmoran56/esper | examples/headless_example.py | 1 | 1669 | import time
from dataclasses import dataclass as component
from esper import Processor, World
##################################
# Define some Components:
##################################
@component
class Velocity:
x: float = 0.0
y: float = 0.0
@component
class Position:
x: int = 0
y: int = 0
... | mit |
ravindrapanda/tensorflow | tensorflow/python/data/kernel_tests/concatenate_dataset_op_test.py | 42 | 5552 | # 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 |
waseem18/oh-mainline | vendor/packages/twisted/twisted/internet/epollreactor.py | 18 | 8111 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
An epoll() based implementation of the twisted main loop.
To install the event loop (and you should do this before any connections,
listeners or connectors are added)::
from twisted.internet import epollreactor
epollreactor.install()... | agpl-3.0 |
tomchristie/django | django/forms/fields.py | 7 | 44053 | """
Field classes.
"""
import copy
import datetime
import itertools
import math
import os
import re
import uuid
from decimal import Decimal, DecimalException
from io import BytesIO
from urllib.parse import urlsplit, urlunsplit
from django.core import validators
from django.core.exceptions import ValidationError
# Pro... | bsd-3-clause |
orokusaki/django-jsonrpc-2-0 | jsonrpc/jsontype.py | 1 | 1729 | class JSONType(object):
"""
A representation of a JSON type, providing comparison functionality.
>>> x = 1
>>> JSONType('num') == type(x)
"""
json_types = {
'bit': (bool,),
'num': (float, int),
'str': (basestring, str, unicode),
'arr': (list,),
... | bsd-2-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.