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 |
|---|---|---|---|---|---|
DistrictDataLabs/tribe | tests/admin_script_tests.py | 2 | 2070 | # tests.admin_script_tests
# Use the subprocess module to execute tribe-admin.py for testing.
#
# Author: Benjamin Bengfort <bbengfort@districtdatalabs.com>
# Created: Wed Jun 22 15:48:08 2016 -0400
#
# Copyright (C) 2016 District Data Labs
# For license information, see LICENSE.txt
#
# ID: admin_script_tests.py [6b... | mit |
abaditsegay/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_iterlen.py | 61 | 8146 | """ Test Iterator Length Transparency
Some functions or methods which accept general iterable arguments have
optional, more efficient code paths if they know how many items to expect.
For instance, map(func, iterable), will pre-allocate the exact amount of
space required whenever the iterable can report its length.
T... | apache-2.0 |
Simran-B/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Tools/scripts/classfix.py | 96 | 5953 | #! /usr/bin/env python
# This script is obsolete -- it is kept for historical purposes only.
#
# Fix Python source files to use the new class definition syntax, i.e.,
# the syntax used in Python versions before 0.9.8:
# class C() = base(), base(), ...: ...
# is changed to the current syntax:
# class C(base... | apache-2.0 |
rmboggs/django | tests/migrations/test_multidb.py | 366 | 6909 | import unittest
from django.db import connection, migrations, models
from django.db.migrations.state import ProjectState
from django.test import override_settings
from .test_operations import OperationTestBase
try:
import sqlparse
except ImportError:
sqlparse = None
class AgnosticRouter(object):
"""
... | bsd-3-clause |
Natgeoed/djorm-ext-pgarray | testing/pg_array_fields/models.py | 3 | 1845 | # -*- coding: utf-8 -*-
from django.db import models
from djorm_pgarray.fields import ArrayField
from djorm_pgarray.fields import TextArrayField
from djorm_pgarray.fields import FloatArrayField
from djorm_pgarray.fields import IntegerArrayField
from djorm_pgarray.fields import DateArrayField
from djorm_pgarray.fields ... | bsd-3-clause |
szibis/Diamond | src/diamond/handler/Handler.py | 31 | 4249 | # coding=utf-8
import logging
import threading
import traceback
from configobj import ConfigObj
import time
class Handler(object):
"""
Handlers process metrics that are collected by Collectors.
"""
def __init__(self, config=None, log=None):
"""
Create a new instance of the Handler cl... | mit |
nielsbuwen/ilastik | ilastik/applets/splitBodyCarving/opParseAnnotations.py | 4 | 8792 | ###############################################################################
# ilastik: interactive learning and segmentation toolkit
#
# Copyright (C) 2011-2014, the ilastik developers
# <team@ilastik.org>
#
# This program is free software; you can redistribute it and/or
# mod... | gpl-3.0 |
nysan/yocto-autobuilder | lib/python2.6/site-packages/Twisted-11.0.0-py2.6-linux-x86_64.egg/twisted/names/test/test_dns.py | 18 | 43605 | # test-case-name: twisted.names.test.test_dns
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for twisted.names.dns.
"""
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
import struct
from twisted.python.failure import Failure
from twist... | gpl-2.0 |
SunghanKim/numpy | numpy/f2py/use_rules.py | 188 | 3652 | #!/usr/bin/env python
"""
Build 'use others module data' mechanism for f2py2e.
Unfinished.
Copyright 2000 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.
NO WARRANTY IS EXPRESSED OR IMPLIED. USE... | bsd-3-clause |
tareqalayan/ansible | lib/ansible/modules/windows/win_certificate_store.py | 16 | 6975 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCU... | gpl-3.0 |
offbyone/Flexget | flexget/plugins/filter/seen_info_hash.py | 16 | 1975 | from __future__ import unicode_literals, division, absolute_import
from flexget import plugin
from flexget.event import event
from flexget.plugins.filter.seen import FilterSeen
class FilterSeenInfoHash(FilterSeen):
"""Prevents the same torrent from being downloaded twice by remembering the infohash of all downlo... | mit |
JakeBrand/CMPUT410-E6 | v1/lib/python2.7/site-packages/django/core/management/commands/testserver.py | 49 | 2035 | from django.core.management.base import BaseCommand
from optparse import make_option
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--noinput', action='store_false', dest='interactive', default=True,
help='Tells Django to NOT prompt the user for input of an... | apache-2.0 |
chongtianfeiyu/kbengine | kbe/res/scripts/common/Lib/tempfile.py | 74 | 21519 | """Temporary files.
This module provides generic, low- and high-level interfaces for
creating temporary files and directories. The interfaces listed
as "safe" just below can be used without fear of race conditions.
Those listed as "unsafe" cannot, and are provided for backward
compatibility only.
This module also pr... | lgpl-3.0 |
jrclaramunt/django-cms | cms/utils/copy_plugins.py | 3 | 1676 | # -*- coding: utf-8 -*-
def copy_plugins_to(plugin_list, to_placeholder, to_language=None, parent_plugin_id=None, no_signals=False):
"""
Copies a list of plugins to a placeholder to a language.
"""
old_parent_cache = {}
plugins_ziplist = []
first = True
for old_plugin in plugin_list:
... | bsd-3-clause |
gutomaia/gevent-socketio | examples/testapp/testapp/views.py | 12 | 4553 | from pyramid.view import view_config
import gevent
from socketio import socketio_manage
from socketio.namespace import BaseNamespace
from socketio.mixins import RoomsMixin, BroadcastMixin
from gevent import socket
def index(request):
""" Base view to load our template """
return {}
"""
ACK model:
The clien... | bsd-3-clause |
wangyum/tensorflow | tensorflow/contrib/keras/python/keras/layers/simplernn_test.py | 47 | 6799 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
vbannai/neutron | neutron/tests/unit/vmware/__init__.py | 29 | 2194 | # Copyright 2013 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 r... | apache-2.0 |
devinbalkind/eden | modules/ClimateDataPortal/import_tabbed_data.py | 56 | 11039 | #!/usr/bin/python
ClimateDataPortal = local_import("ClimateDataPortal")
InsertChunksWithoutCheckingForExistingReadings = local_import(
"ClimateDataPortal.InsertChunksWithoutCheckingForExistingReadings"
).InsertChunksWithoutCheckingForExistingReadings
def get_or_create(dict, key, creator):
try:
value =... | mit |
kkouer/PcGcs | Lib/site-packages/numpy/core/code_generators/ufunc_docstrings.py | 57 | 85797 | # Docstrings for generated ufuncs
docdict = {}
def get(name):
return docdict.get(name)
def add_newdoc(place, name, doc):
docdict['.'.join((place, name))] = doc
add_newdoc('numpy.core.umath', 'absolute',
"""
Calculate the absolute value element-wise.
Parameters
----------
x : array_like... | gpl-3.0 |
tmenjo/cinder-2015.1.1 | cinder/backup/drivers/nfs.py | 2 | 6196 | # Copyright (C) 2015 Tom Barron <tpb@dyncloud.net>
# 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
#
# ... | apache-2.0 |
bdestombe/flopy-1 | flopy/utils/mflistfile.py | 1 | 25207 | """
This is a set of classes for reading budget information out of MODFLOW-style
listing files. Cumulative and incremental budgets are returned as numpy
recarrays, which can then be easily plotted.
"""
import collections
import os
import re
import sys
from datetime import timedelta
import numpy as np
from ..utils.u... | bsd-3-clause |
thiagopnts/servo | components/script/dom/bindings/codegen/parser/tests/test_exposed_extended_attribute.py | 127 | 6466 | import WebIDL
def WebIDLTest(parser, harness):
parser.parse("""
[PrimaryGlobal] interface Foo {};
[Global=(Bar1,Bar2)] interface Bar {};
[Global=Baz2] interface Baz {};
[Exposed=(Foo,Bar1)]
interface Iface {
void method1();
[Exposed=Bar1]
readonly attribute a... | mpl-2.0 |
ericdill/travis-little-helper | template.py | 1 | 3049 | from argparse import ArgumentParser
import yaml
from jinja2 import Environment, FileSystemLoader
import os
TEMPLATE_DIR = os.path.join(os.path.dirname(__file__), 'travis-template')
def main():
p = ArgumentParser()
p.add_argument(
"-tc", "--travis-config",
help="The yaml file specifying the c... | gpl-3.0 |
renner/spacewalk | client/debian/packages-already-in-debian/rhn-client-tools/src/bin/rhn_check.py | 17 | 13876 | #!/usr/bin/python
#
# Python client for checking periodically for posted actions
# on the Red Hat Network servers.
#
# Copyright (c) 2000--2012 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, incl... | gpl-2.0 |
glaubitz/fs-uae-debian | launcher/amitools/fs/validate/DirScan.py | 1 | 6950 | from __future__ import absolute_import
from __future__ import print_function
from .BlockScan import BlockScan
from amitools.fs.FSString import FSString
from amitools.fs.FileName import FileName
from amitools.fs.validate.Log import Log
import amitools.fs.DosType as DosType
class DirChainEntry:
"""entry of the hash c... | gpl-2.0 |
zjurelinac/Linker | utils.py | 1 | 2492 | """Module containing utility functions"""
import base64
import hashlib
import random
import re
import string
from datetime import datetime
from math import *
def hashfunc( str ):
"""Returns a hash value of a given string
Takes a string and returns its SHA512 hash value, encoded in base64
"""
... | mit |
npotenza/Stino | stino/pyarduino/arduino_compiler.py | 8 | 22618 | #!/usr/bin/env python
#-*- coding: utf-8 -*-
# 1. Copyright
# 2. Lisence
# 3. Author
"""
Documents
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import os
import threading
import subprocess
import re
import ti... | mit |
thomashaw/SecGen | modules/utilities/unix/ctf/metactf/files/repository/src_angr/16_angr_arbitrary_write/generate.py | 2 | 1362 | #!/usr/bin/env python
import sys, random, os, tempfile
from templite import Templite
def generate(argv):
if len(argv) != 3:
print 'Usage: pypy generate.py [seed] [output_file]'
sys.exit()
seed = argv[1]
output_file = argv[2]
random.seed(seed)
rodata_tail_modifier = 0x2e
rodata_parts = ''.join([... | gpl-3.0 |
Crystalnix/BitPop | chrome/test/functional/autofill.py | 2 | 41065 | #!/usr/bin/env python
# Copyright (c) 2012 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 logging
import os
import pickle
import re
import simplejson
import autofill_dataset_converter
import autofill_dataset_gener... | bsd-3-clause |
atpohjal/or-tools | examples/python/data/nonogram_regular/nonogram_nonunique.py | 74 | 1268 | # Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
F5Networks/f5-ansible-modules | ansible_collections/f5networks/f5_modules/tests/unit/modules/network/f5/test_bigip_device_license.py | 2 | 7500 | # -*- 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
import os
import json
import pytest
import sys
if sys.version_info < (2... | mit |
hirokiky/django-webcommands | webcommands/forms.py | 1 | 1779 | from django import forms
from django.utils import six
from webcommands import utils as webcommands_utils
def field_for_option(option):
if option.type == 'string':
field = forms.CharField(label=str(option), max_length='255')
elif option.type == 'int':
field = forms.IntegerField(label=str(optio... | mit |
40223208/2015cdb_g4 | static/Brython3.1.1-20150328-091302/Lib/random.py | 518 | 26080 | """Random variable generators.
integers
--------
uniform within range
sequences
---------
pick random element
pick random sample
generate random permutation
distributions on the real line:
------------------------------
uniform
... | gpl-3.0 |
YuriIvanov/qBittorrent | src/searchengine/nova/engines/torrentz.py | 18 | 5585 | #VERSION: 2.16
#AUTHORS: Diego de las Heras (diegodelasheras@gmail.com)
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of ... | gpl-2.0 |
marco-mariotti/selenoprofiles | libraries/pygraph/algorithms/cycles.py | 11 | 3427 | # Copyright (c) 2008-2009 Pedro Matiello <pmatiello@gmail.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,... | gpl-2.0 |
mitchmahan/pyeapi | pyeapi/api/interfaces.py | 3 | 31397 | #
# Copyright (c) 2014, Arista Networks, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# Redistributions of source code must retain the above copyright notice,
# this list of condit... | bsd-3-clause |
mpapierski/protobuf | python/google/protobuf/internal/containers.py | 224 | 10004 | # 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 |
irwinlove/django | django/contrib/gis/gdal/raster/source.py | 297 | 13274 | import json
import os
from ctypes import addressof, byref, c_double, c_void_p
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.driver import Driver
from django.contrib.gis.gdal.error import GDALException
from django.contrib.gis.gdal.prototypes import raster as capi
from django.contrib.gis... | bsd-3-clause |
ksurct/MercuryRoboticsEmbedded2016 | ksurobot/hardware/_wiringpi.py | 1 | 1766 | from ctypes import cdll, c_int, CFUNCTYPE, POINTER, pointer, c_ubyte
from enum import Enum, IntEnum
from ..util import get_config
from .utils import Wrapper
libwiringpi = Wrapper('/usr/local/lib/libwiringPi.so.2.32')
wiringPiISR_cb = CFUNCTYPE(None)
wiringPiPiSPIDataRW_data = POINTER(c_ubyte)
class PinModes(IntE... | apache-2.0 |
RachaelT/UTDchess-RospyXbee | src/UTDchess_RospyXbee/src/scripts/xbee_coord.py | 2 | 4686 | #!/usr/bin/env python
import sys
import rospy
import serial
import struct
import binascii
import time
from std_msgs.msg import String
from chessbot.msg import BeeCommand
from xbee import ZigBee
xbee = None
XBEE_ADDR_LONG = '\x00\x00\x00\x00\x00\x00\xFF\xFF'
XBEE_ADDR_SHORT = '\xFF\xFE'
DEVICE = '/dev/ttyUSB0'
#Each b... | mit |
dmgawel/helios-server | helios/view_utils.py | 3 | 2349 | """
Utilities for all views
Ben Adida (12-30-2008)
"""
from django.template import Context, Template, loader
from django.http import HttpResponse, Http404
from django.shortcuts import render_to_response
import utils
from helios import datatypes
# nicely update the wrapper function
from functools import update_wrap... | apache-2.0 |
mancoast/CPythonPyc_test | fail/300_buffer_tests.py | 3 | 10506 | # Tests that work for both bytes and buffer objects.
# See PEP 3137.
import struct
import sys
class MixinBytesBufferCommonTests(object):
"""Tests that work for both bytes and buffer objects.
See PEP 3137.
"""
def marshal(self, x):
"""Convert x into the appropriate type for these tests."""
... | gpl-3.0 |
AZtheAsian/zulip | docs/conf.py | 8 | 9917 | # -*- coding: utf-8 -*-
#
# zulip-contributor-docs documentation build configuration file, created by
# sphinx-quickstart on Mon Aug 17 16:24:04 2015.
#
# 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
# autogenera... | apache-2.0 |
manics/openmicroscopy | components/tools/OmeroWeb/omeroweb/webadmin/views.py | 3 | 43081 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
#
#
# Copyright (c) 2008-2018 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 |
MER-GROUP/intellij-community | python/helpers/py2only/docutils/parsers/rst/languages/sv.py | 57 | 3988 | # $Id: sv.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: Adam Chodorowski <chodorowski@users.sourceforge.net>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files mu... | apache-2.0 |
vanzhiganov/jftpgw | support/cachepurgy.py | 1 | 2239 | #!/usr/bin/env python
#
# cachepurgy - script to reduce the size of a jftpgw cache
#
# (C) 2001 Julian Einwag <julian@brightstar.swin.de>
#
from sys import *
from os import *
from string import *
from stat import *
from time import *
maxsize = 40*1024*1024
cachedir = "/tmp/cache"
# This class stores the informati... | gpl-2.0 |
teeheee/RobocupSoccerSimulator | robotsimul.py | 1 | 5679 | #!/usr/bin/env python3
from game import *
from debugger import Debugger
from logSaver import Logger
from gameconfig import gc
from popup_menu import *
import sys
import time
#TODO more comments
#TODO clean up this mess
class App:
def __init__(self):
# flag for shutdown of the simulation
self._run... | gpl-3.0 |
theheros/kbengine | kbe/src/lib/python/Lib/test/test_pkg.py | 55 | 9399 | # Test packages (dotted-name import)
import sys
import os
import tempfile
import textwrap
import unittest
from test import support
# Helpers to create and destroy hierarchies.
def cleanout(root):
names = os.listdir(root)
for name in names:
fullname = os.path.join(root, name)
if os.path.isdir... | lgpl-3.0 |
maxming2333/v2ex | html5lib/treebuilders/__init__.py | 102 | 4478 | """A collection of modules for building different kinds of tree from
HTML documents.
To create a treebuilder for a new type of tree, you need to do
implement several things:
1) A set of classes for various types of elements: Document, Doctype,
Comment, Element. These must implement the interface of
_base.treebuilders... | bsd-3-clause |
ramcn/demo3 | venv/lib/python3.4/site-packages/setuptools/msvc9_support.py | 429 | 2187 | try:
import distutils.msvc9compiler
except ImportError:
pass
unpatched = dict()
def patch_for_specialized_compiler():
"""
Patch functions in distutils.msvc9compiler to use the standalone compiler
build for Python (Windows only). Fall back to original behavior when the
standalone compiler is no... | mit |
vermouthmjl/scikit-learn | examples/gaussian_process/plot_gpr_co2.py | 131 | 5705 | """
========================================================
Gaussian process regression (GPR) on Mauna Loa CO2 data.
========================================================
This example is based on Section 5.4.3 of "Gaussian Processes for Machine
Learning" [RW2006]. It illustrates an example of complex kernel engine... | bsd-3-clause |
soarpenguin/ansible | lib/ansible/modules/network/lenovo/cnos_template.py | 59 | 7077 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Lenovo, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# ... | gpl-3.0 |
mikkokeskinen/tunnistamo | oidc_apis/models.py | 1 | 6847 | from django.core.exceptions import ValidationError
from django.core.validators import RegexValidator
from django.db import models
from django.utils.crypto import get_random_string
from django.utils.translation import ugettext_lazy as _
from multiselectfield import MultiSelectField
from oidc_provider.models import Clien... | mit |
pombredanne/django-rest-framework-saasy | rest_framework_saasy/viewsets.py | 2 | 2408 | # -*- coding: utf-8 -*-
"""DRF SaaS ViewSetMixin"""
from functools import update_wrapper
from django.utils.decorators import classonlymethod
from django.views.decorators.csrf import csrf_exempt
from rest_framework import viewsets
from rest_framework_saasy.utils import get_cls
__all__ = ['ViewSetMixin', 'ViewSet', 'G... | mit |
UltrosBot/Ultros-repos | control/system/manager.py | 1 | 2416 | __author__ = 'Gareth'
import os
from twisted.internet import reactor
import yaml
# import control.system.servers as servers
import control.system.ssl as ssl
from control.utils.log import getLogger
from control.system.singleton import Singleton
CONF_DIR = "control/config/"
DATA_DIR = "control/data/"
LOGS_DIR = "con... | artistic-2.0 |
PeteE/roro | python/driver.py | 1 | 2957 | import time
import signal
import sys
import smbus
import robot_data_pb2
from oled_display import OledDisplay
class RobotDriver:
SERVO_STOP = 90
def __init__(self, i2c_address=0x04, i2c_bus=1, oled_display=None):
self.i2c_address = i2c_address
self.i2c_bus = smbus.SMBus(i2c_bus)
self.ol... | bsd-3-clause |
wong2/sentry | src/sentry/web/frontend/team_settings.py | 13 | 1958 | from __future__ import absolute_import
from django import forms
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.db.models import Q
from django.http import HttpResponseRedirect
from django.utils.translation import ugettext_lazy as _
from sentry.models import (
AuditLogE... | bsd-3-clause |
expyriment/expyriment | expyriment/io/_mouse.py | 1 | 25968 | """
Mouse input.
This module contains a class implementing pygame mouse input.
"""
__author__ = 'Florian Krause <florian@expyriment.org>, \
Oliver Lindemann <oliver@expyriment.org>'
__version__ = ''
__revision__ = ''
__date__ = ''
from types import FunctionType
import pygame
from . import defaults
from ..misc._t... | gpl-3.0 |
srene/ns-3-inrpp | src/buildings/bindings/modulegen__gcc_LP64.py | 38 | 297879 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | gpl-2.0 |
NavyaJayaram/MyRepository | SoundCloudUsingAJS/lib/python2.7/site-packages/pip/_vendor/requests/utils.py | 222 | 19653 | # -*- coding: utf-8 -*-
"""
requests.utils
~~~~~~~~~~~~~~
This module provides utility functions that are used within Requests
that are also useful for external consumption.
"""
import cgi
import codecs
import collections
import io
import os
import platform
import re
import sys
import socket
import struct
from . i... | mit |
mancoast/CPythonPyc_test | fail/331_test_runpy.py | 29 | 23795 | # Test the runpy module
import unittest
import os
import os.path
import sys
import re
import tempfile
import importlib
import py_compile
from test.support import (
forget, make_legacy_pyc, run_unittest, unload, verbose, no_tracing,
create_empty_file)
from test.script_helper import (
make_pkg, make_script, m... | gpl-3.0 |
AndrewGrossman/django | django/contrib/gis/geos/prototypes/io.py | 309 | 9480 | import threading
from ctypes import POINTER, Structure, byref, c_char, c_char_p, c_int, c_size_t
from django.contrib.gis.geos.base import GEOSBase
from django.contrib.gis.geos.libgeos import GEOM_PTR, GEOSFuncFactory
from django.contrib.gis.geos.prototypes.errcheck import (
check_geom, check_sized_string, check_st... | bsd-3-clause |
wengpingbo/linux | scripts/gdb/linux/symbols.py | 68 | 6310 | #
# gdb helper commands and functions for Linux kernel debugging
#
# load kernel and module symbols
#
# 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
import os
import re
from linux import module... | gpl-2.0 |
fubecka/f5-dashboard | flask/lib/python2.6/site-packages/jinja2/visitor.py | 1401 | 3316 | # -*- coding: utf-8 -*-
"""
jinja2.visitor
~~~~~~~~~~~~~~
This module implements a visitor for the nodes.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD.
"""
from jinja2.nodes import Node
class NodeVisitor(object):
"""Walks the abstract syntax tree and call visitor functions for every... | apache-2.0 |
ganshun666/micropython | tests/basics/gen_yield_from_ducktype.py | 107 | 1034 | class MyGen:
def __init__(self):
self.v = 0
def __iter__(self):
return self
def __next__(self):
self.v += 1
if self.v > 5:
raise StopIteration
return self.v
def gen():
yield from MyGen()
def gen2():
yield from gen()
print(list(gen()))
print(l... | mit |
srcLurker/home-assistant | homeassistant/components/sensor/homematic.py | 9 | 2567 | """
The homematic sensor platform.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.homematic/
Important: For this platform to work the homematic component has to be
properly configured.
"""
import logging
from homeassistant.const import STATE_UNK... | mit |
Factr/newspaper | tests/unit_tests.py | 1 | 24005 | # -*- coding: utf-8 -*-
"""
All unit tests for the newspaper library should be contained in this file.
"""
import sys
import os
import unittest
import time
import traceback
from collections import defaultdict, OrderedDict
import concurrent.futures
TEST_DIR = os.path.abspath(os.path.dirname(__file__))
PARENT_DIR = os.p... | mit |
andreparames/odoo | openerp/tools/amount_to_text_en.py | 441 | 5103 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
Southpaw-TACTIC/TACTIC | 3rd_party/python2/site-packages/dateutil/zoneinfo/__init__.py | 265 | 2575 | """
Copyright (c) 2003-2005 Gustavo Niemeyer <gustavo@niemeyer.net>
This module offers extensions to the standard python 2.3+
datetime module.
"""
from dateutil.tz import tzfile
from tarfile import TarFile
import os
__author__ = "Gustavo Niemeyer <gustavo@niemeyer.net>"
__license__ = "PSF License"
__all__ = ["setca... | epl-1.0 |
zhangxq5012/sky_engine | mojo/tools/mopy/mojo_python_tests_runner.py | 9 | 1578 | # 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 argparse
import os
import sys
import unittest
import mopy.paths
class MojoPythonTestRunner(object):
"""Helper class to run python tests on the bo... | bsd-3-clause |
apache/incubator-airflow | dev/provider_packages/refactor_provider_packages.py | 3 | 33388 | #!/usr/bin/env python3
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "L... | apache-2.0 |
dansbecker/what-celebrity | data_grabbers.py | 1 | 4607 | import concurrent.futures
import indicoio
import json
import os
import socket
import urllib.request
from os.path import join, exists
from PIL import Image, ImageDraw
class Grabber(object):
def __enter__(self):
try:
with open(self._captured_data_path, 'r') as f:
self.captured_da... | mit |
ashutosh-mishra/youtube-dl | youtube_dl/extractor/spiegel.py | 1 | 2462 | import re
import xml.etree.ElementTree
from .common import InfoExtractor
class SpiegelIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?spiegel\.de/video/[^/]*-(?P<videoID>[0-9]+)(?:\.html)?(?:#.*)?$'
_TESTS = [{
u'url': u'http://www.spiegel.de/video/vulkan-tungurahua-in-ecuador-ist-wieder-aktiv-v... | unlicense |
demonchild2112/travis-test | grr/core/grr_response_core/lib/parsers/abstract.py | 2 | 5155 | #!/usr/bin/env python
"""Registry for parsers and abstract classes for basic parser functionality."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import abc
from future.utils import with_metaclass
from typing import Optional
from typing import Text
... | apache-2.0 |
rhndg/openedx | lms/djangoapps/shoppingcart/tests/test_microsites.py | 101 | 7876 | """
Tests for Microsite Dashboard with Shopping Cart History
"""
import mock
from django.core.urlresolvers import reverse
from mock import patch
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
from shoppingcart.models import (
O... | agpl-3.0 |
manish211/mase | python101/code/flower.py | 14 | 1416 | """This module contains code from
Think Python by Allen B. Downey
http://thinkpython.com
Copyright 2012 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
try:
# see if Swampy is installed as a package
from swampy.TurtleWorld import *
except ImportError:
# otherwise see if the mo... | unlicense |
AltSchool/django | django/contrib/gis/db/backends/postgis/const.py | 528 | 1484 | """
PostGIS to GDAL conversion constant definitions
"""
# Lookup to convert pixel type values from GDAL to PostGIS
GDAL_TO_POSTGIS = [None, 4, 6, 5, 8, 7, 10, 11, None, None, None, None]
# Lookup to convert pixel type values from PostGIS to GDAL
POSTGIS_TO_GDAL = [1, 1, 1, 3, 1, 3, 2, 5, 4, None, 6, 7, None, None]
# ... | bsd-3-clause |
imsplitbit/nova | nova/cmd/api_metadata.py | 6 | 1345 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compli... | apache-2.0 |
wemanuel/smry | server-auth/ls/google-cloud-sdk/lib/googlecloudsdk/calliope/arg_parsers.py | 4 | 20238 | # Copyright 2013 Google Inc. All Rights Reserved.
"""A module that provides parsing utilities for argparse.
For details of how argparse argument pasers work, see:
http://docs.python.org/dev/library/argparse.html#type
Example usage:
import argparse
import arg_parsers
parser = argparse.ArgumentParser()
p... | apache-2.0 |
lattwood/phantomjs | src/breakpad/src/third_party/protobuf/protobuf/python/google/protobuf/descriptor.py | 260 | 22737 | # 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 |
dednal/chromium.src | third_party/tlslite/tlslite/utils/pycrypto_rsakey.py | 55 | 1338 | # Author: Trevor Perrin
# See the LICENSE file for legal information regarding use of this file.
"""PyCrypto RSA implementation."""
from .cryptomath import *
from .rsakey import *
from .python_rsakey import Python_RSAKey
if pycryptoLoaded:
from Crypto.PublicKey import RSA
class PyCrypto_RSAKey(RSAKey):
... | bsd-3-clause |
wanglongqi/sympy | sympy/simplify/radsimp.py | 46 | 35730 | from __future__ import print_function, division
from collections import defaultdict
from sympy import SYMPY_DEBUG
from sympy.core.evaluate import global_evaluate
from sympy.core.compatibility import iterable, ordered, as_int, default_sort_key
from sympy.core import expand_power_base, sympify, Add, S, Mul, Derivative... | bsd-3-clause |
abramhindle/UnnaturalCodeFork | python/testdata/launchpad/lib/lp/registry/tests/test_distroseriesparent.py | 1 | 9245 | # Copyright 2011 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Tests for DistroSeriesParent model class."""
__metaclass__ = type
from testtools.matchers import MatchesStructure
from zope.component import getUtility
from zope.interface.ver... | agpl-3.0 |
gregtampa/coreemu | daemon/core/emane/nodes.py | 7 | 12795 | #
# CORE
# Copyright (c)2010-2014 the Boeing Company.
# See the LICENSE file included in this distribution.
#
# author: Jeff Ahrenholz <jeffrey.m.ahrenholz@boeing.com>
#
'''
nodes.py: definition of an EmaneNode class for implementing configuration
control of an EMANE emulation. An EmaneNode has several attached NEMs th... | bsd-2-clause |
denisff/python-for-android | python-build/python-libs/gdata/build/lib/gdata/tlslite/X509CertChain.py | 238 | 6861 | """Class representing an X.509 certificate chain."""
from utils import cryptomath
class X509CertChain:
"""This class represents a chain of X.509 certificates.
@type x509List: list
@ivar x509List: A list of L{tlslite.X509.X509} instances,
starting with the end-entity certificate and with ever... | apache-2.0 |
charleswhchan/ansible | lib/ansible/plugins/lookup/inventory_hostnames.py | 117 | 1942 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2013, Steven Dossett <sdossett@panath.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 versio... | gpl-3.0 |
r0b0/virt-manager | src/virtManagerTui/createmeter.py | 3 | 1237 | # createmeter.py - Copyright (C) 2009 Red Hat, Inc.
# Written by Darryl L. Pierce <dpierce@redhat.com>
#
# 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; version 2 of the License.
#
# This progra... | gpl-2.0 |
HellerCommaA/flask-angular | lib/python2.7/site-packages/setuptools/command/test.py | 285 | 5932 | from setuptools import Command
from distutils.errors import DistutilsOptionError
import sys
from pkg_resources import *
from pkg_resources import _namespace_packages
from unittest import TestLoader, main
class ScanningLoader(TestLoader):
def loadTestsFromModule(self, module):
"""Return a suite of all test... | mit |
jsoref/django | tests/multiple_database/routers.py | 379 | 1927 | from __future__ import unicode_literals
from django.db import DEFAULT_DB_ALIAS
class TestRouter(object):
"""
Vaguely behave like primary/replica, but the databases aren't assumed to
propagate changes.
"""
def db_for_read(self, model, instance=None, **hints):
if instance:
retu... | bsd-3-clause |
ulope/django | django/contrib/sitemaps/tests/urls/http.py | 26 | 4318 | from datetime import date, datetime
from django.conf.urls import url
from django.conf.urls.i18n import i18n_patterns
from django.contrib.sitemaps import Sitemap, GenericSitemap, FlatPageSitemap, views
from django.http import HttpResponse
from django.utils import timezone
from django.views.decorators.cache import cache_... | bsd-3-clause |
jiangzhuo/kbengine | kbe/src/lib/python/Lib/idlelib/idle_test/test_idlehistory.py | 87 | 5465 | import unittest
from test.support import requires
import tkinter as tk
from tkinter import Text as tkText
from idlelib.idle_test.mock_tk import Text as mkText
from idlelib.IdleHistory import History
from idlelib.configHandler import idleConf
line1 = 'a = 7'
line2 = 'b = a'
class StoreTest(unittest.TestCase):
'''... | lgpl-3.0 |
AxelDelmas/ansible | lib/ansible/plugins/inventory/directory.py | 93 | 2024 | # (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 |
johnkeepmoving/oss-ftp | python27/win32/Lib/idlelib/ZoomHeight.py | 130 | 1300 | # Sample extension: zoom a window to maximum height
import re
import sys
from idlelib import macosxSupport
class ZoomHeight:
menudefs = [
('windows', [
('_Zoom Height', '<<zoom-height>>'),
])
]
def __init__(self, editwin):
self.editwin = editwin
def zoom_height... | mit |
hyperized/ansible | lib/ansible/modules/net_tools/basics/uri.py | 1 | 25199 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2013, Romeo Theriault <romeot () hawaii.edu>
# 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_ver... | gpl-3.0 |
memeticlabs/mongokit | listembed-test.py | 1 | 4479 | try:
import unittest2 as unittest
except ImportError:
import unittest
from mongokit import Document, Connection
class DescriptorsTestCase(unittest.TestCase):
def setUp(self):
self.connection = Connection()
self.col = self.connection['test']['mongokit']
def tearDown(self):
... | bsd-3-clause |
TheWardoctor/Wardoctors-repo | script.module.uncoded/lib/resources/lib/modules/sources.py | 1 | 56371 | # -*- coding: utf-8 -*-
'''
Covenant Add-on
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This prog... | apache-2.0 |
GhostshipSoftware/avaloria | contrib/extended_room.py | 2 | 17621 | """
Extended Room
Evennia Contribution - Griatch 2012
This is an extended Room typeclass for Evennia. It is supported
by an extended Look command and an extended @desc command, also
in this module.
Features:
1) Time-changing description slots
This allows to change the full description text the room shows
dependin... | bsd-3-clause |
piffey/ansible | lib/ansible/modules/cloud/cloudstack/cs_sshkeypair.py | 50 | 8797 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.net>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lice... | gpl-3.0 |
ojengwa/oh-mainline | vendor/packages/typecheck/tests/support.py | 16 | 8420 | import types
import unittest
import sys
import os.path
import time
from unittest import _strclass
def run_all_tests(test_mod=None, tests=None):
if tests is None:
tests = unittest.TestLoader().loadTestsFromModule(test_mod)
TodoTextRunner(verbosity=2).run(tests)
def adjust_path():
parent_dir = ... | agpl-3.0 |
zephyrplugins/zephyr | zephyr.plugin.jython/jython2.5.2rc3/Lib/modjy/modjy_publish.py | 109 | 6547 | ###
#
# Copyright Alan Kennedy.
#
# You may contact the copyright holder at this uri:
#
# http://www.xhaus.com/contact/modjy
#
# The licence under which this code is released is the Apache License v2.0.
#
# The terms and conditions of this license are listed in a file contained
# in the distribution that also cont... | epl-1.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.