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 |
|---|---|---|---|---|---|
ruebot/bagit-profiles-validator | setup.py | 1 | 1167 | from setuptools import setup
description = """
This module can be used to validate BagitProfiles.
"""
setup(
name="bagit_profile",
version="1.3.0",
url="https://github.com/bagit-profiles/bagit-profiles-validator",
install_requires=["bagit", "requests"],
author="Mark Jordan, Nick Ruest",
... | unlicense |
cruzegoodin/TSC-ShippingDetails | flask/lib/python2.7/site-packages/sqlalchemy/orm/collections.py | 21 | 53263 | # orm/collections.py
# Copyright (C) 2005-2015 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
"""Support for collections of mapped entities.
The collections package supplies ... | bsd-3-clause |
Nayaata/Web-Front-end-develeopment | AvalancheReport/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py | 2736 | 1804 | # 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.
"""Visual Studio project reader/writer."""
import gyp.common
import gyp.easy_xml as easy_xml
class Writer(object):
"""Visual Studio XML tool file writer."""
... | mit |
jaruba/chromium.src | tools/resources/list_resources_removed_by_repack.py | 95 | 3297 | #!/usr/bin/env python
# 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 os
import re
import sys
usage = """%s BUILDTYPE BUILDDIR
BUILDTYPE: either chromium or chrome.
BUILDDIR: The path to the outp... | bsd-3-clause |
riccardomc/moto | moto/datapipeline/models.py | 14 | 4716 | from __future__ import unicode_literals
import datetime
import boto.datapipeline
from moto.core import BaseBackend
from .utils import get_random_pipeline_id, remove_capitalization_of_dict_keys
class PipelineObject(object):
def __init__(self, object_id, name, fields):
self.object_id = object_id
se... | apache-2.0 |
Iconik/eve-suite | src/view/blueprintcalculator/ui_blueprint_calculator.py | 1 | 4383 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui_blueprint_calculator.ui'
#
# Created: Sat Mar 19 14:47:54 2011
# by: pyside-uic 0.2.7 running on PySide 1.0.0~rc1
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore, QtGui
class Ui_BlueprintCalculato... | gpl-3.0 |
bwsblake/lettercounter | django-norel-env/lib/python2.7/site-packages/django/contrib/auth/tests/signals.py | 227 | 3278 | from django.contrib.auth import signals
from django.contrib.auth.models import User
from django.contrib.auth.tests.utils import skipIfCustomUser
from django.test import TestCase
from django.test.client import RequestFactory
from django.test.utils import override_settings
@skipIfCustomUser
@override_settings(USE_TZ=Fa... | mit |
batermj/algorithm-challenger | code-analysis/programming_anguage/python/source_codes/Python3.5.9/Python-3.5.9/Lib/test/support/__init__.py | 1 | 86205 | """Supporting definitions for the Python regression tests."""
if __name__ != 'test.support':
raise ImportError('support must be imported from the test package')
import collections.abc
import contextlib
import errno
import faulthandler
import fnmatch
import functools
import gc
import importlib
import importlib.uti... | apache-2.0 |
smmoosavi/Theano-Tutorials | 5_convolutional_net.py | 1 | 3264 | import theano
from theano import tensor as T
from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams
import numpy as np
from theano.tensor.nnet.conv import conv2d
from theano.tensor.signal.downsample import max_pool_2d
from load import mnist, save_model
theano.config.floatX = 'float32'
srng = RandomStr... | mit |
mameneses/python-deployment | venv/lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/_base.py | 310 | 6919 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type, string_types
import gettext
_ = gettext.gettext
from xml.dom import Node
DOCUMENT = Node.DOCUMENT_NODE
DOCTYPE = Node.DOCUMENT_TYPE_NODE
TEXT = Node.TEXT_NODE
ELEMENT = Node.ELEMENT_NODE
COMMENT = Node.COMMENT_N... | mit |
Byron/bcore | src/python/bcmd/tests/doc/test_examples.py | 1 | 2687 | #-*-coding:utf-8-*-
"""
@package bapp.tests.doc.test_examples
@brief See bapp.tests.doc for more information
@author Sebastian Thiel
@copyright [GNU Lesser General Public License](https://www.gnu.org/licenses/lgpl.html)
"""
from __future__ import print_function
__all__ = []
import sys
import bapp
from butility.tests... | lgpl-3.0 |
mlperf/inference_results_v0.7 | closed/Nettrix/code/rnnt/tensorrt/preprocessing/parts/text/cleaners.py | 12 | 3466 | # Copyright (c) 2017 Keith Ito
# Copyright (c) 2020, NVIDIA CORPORATION. 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/LICE... | apache-2.0 |
648trindade/pygame-engine-gamejam | src/engine/System.py | 1 | 13260 | import pygame
import pygame.gfxdraw
import os
import sys
from engine.Point import Point
from engine.Scene import Scene
from engine.managers.Texture import Texture
from engine.managers.Font import Font
from engine.managers.TextureSpec import TextureSpec
# tamanho fake da tela. Todos os objetos pensam que a tela tem ess... | gpl-3.0 |
lamby/debian-devel-changes-bot | tests/test_utils_rewrite_topic.py | 1 | 1414 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Debian Changes Bot
# Copyright (C) 2008 Chris Lamb <chris@chris-lamb.co.uk>
#
# 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, e... | agpl-3.0 |
griest024/PokyrimTools | pyffi-develop/scripts/cgf/cgftoaster.py | 1 | 3462 | #!/usr/bin/python3
"""A script for casting spells on cgf files. This script is essentially
a cgf specific wrapper around L{pyffi.spells.toaster}."""
# --------------------------------------------------------------------------
# ***** BEGIN LICENSE BLOCK *****
#
# Copyright (c) 2007-2012, Python File Format Interface
... | mit |
kaichogami/sympy | sympy/geometry/tests/test_polygon.py | 6 | 13890 | from __future__ import division
import warnings
from sympy import Abs, Rational, Float, S, Symbol, cos, pi, sqrt, oo
from sympy.functions.elementary.trigonometric import tan
from sympy.geometry import (Circle, Ellipse, GeometryError, Point, Polygon, Ray, RegularPolygon, Segment, Triangle, are_similar,
... | bsd-3-clause |
klmitch/keystone | keystone/tests/unit/identity/test_core.py | 3 | 7470 | # 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 |
Kapim/ar-table-itable | art_instructions/src/art_instructions/gui/visual_inspection.py | 6 | 5819 | from art_instructions.gui import GuiInstruction
from art_projected_gui.items import ImageItem, DialogItem
import qimage2ndarray
from cv_bridge import CvBridge, CvBridgeError
import rospy
from sensor_msgs.msg import Image
from std_msgs.msg import Bool
from PyQt4 import QtCore
from art_utils import array_from_param
tran... | lgpl-2.1 |
davidmueller13/kernel_samsung_trelte | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
thehyve/variant | eggs/django-1.3.1-py2.7.egg/django/contrib/gis/utils/ogrinfo.py | 389 | 1973 | """
This module includes some utility functions for inspecting the layout
of a GDAL data source -- the functionality is analogous to the output
produced by the `ogrinfo` utility.
"""
from django.contrib.gis.gdal import DataSource
from django.contrib.gis.gdal.geometries import GEO_CLASSES
def ogrinfo(data_source, num_... | apache-2.0 |
SlimRemix/android_external_chromium_org | media/tools/layout_tests/test_expectations_unittest.py | 165 | 1697 | #!/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 unittest
from test_expectations import TestExpectations
class TestTestExpectations(unittest.TestCase):
def testParseLi... | bsd-3-clause |
hn8841182/20150623-test02 | static/Brython3.1.0-20150301-090019/Lib/fnmatch.py | 894 | 3163 | """Filename matching with shell patterns.
fnmatch(FILENAME, PATTERN) matches according to the local convention.
fnmatchcase(FILENAME, PATTERN) always takes case in account.
The functions operate by translating the pattern into a regular
expression. They cache the compiled regular expressions for speed.
The function... | gpl-3.0 |
charley-ye/SCFS-v1 | simplecfs/message/network_handler.py | 1 | 1608 | # -*- coding: utf-8 -*-
"""
handle network sending and receiving data
"""
import logging
from simplecfs.common.parameters import DATA_FRAME_SIZE
from simplecfs.message.packet import pack, unpack
def send_command(socket_fd, message):
"""
send command message packet over socket
@socket_fd(socket.makefile('... | apache-2.0 |
lduarte1991/edx-platform | common/test/acceptance/pages/lms/dashboard.py | 16 | 8658 | # -*- coding: utf-8 -*-
"""
Student dashboard page.
"""
from bok_choy.page_object import PageObject
from common.test.acceptance.pages.lms import BASE_URL
class DashboardPage(PageObject):
"""
Student dashboard, where the student can view
courses she/he has registered for.
"""
url = "{base}/dashboa... | agpl-3.0 |
oleksa-pavlenko/gae-django-project-template | django/utils/daemonize.py | 169 | 2046 | import os
import sys
from . import six
buffering = int(six.PY3) # No unbuffered text I/O on Python 3 (#20815).
if os.name == 'posix':
def become_daemon(our_home_dir='.', out_log='/dev/null',
err_log='/dev/null', umask=0o022):
"Robustly turn into a UNIX daemon, running in our_... | mit |
teamotrinidad/plugin.video.chicovara | servers/one80upload.py | 44 | 3770 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para 180upload
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from core imp... | gpl-2.0 |
adw0rd/lettuce | tests/integration/lib/Django-1.2.5/django/utils/safestring.py | 392 | 3812 | """
Functions for working with "safe strings": strings that can be displayed safely
without further escaping in HTML. Marking something as a "safe string" means
that the producer of the string has already turned characters that should not
be interpreted by the HTML engine (e.g. '<') into the appropriate entities.
"""
f... | gpl-3.0 |
lincolnloop/django-categories | doc_src/code_examples/custom_categories3.py | 13 | 1144 | class Category(CategoryBase):
thumbnail = models.FileField(
upload_to=THUMBNAIL_UPLOAD_PATH,
null=True, blank=True,
storage=STORAGE(),)
thumbnail_width = models.IntegerField(blank=True, null=True)
thumbnail_height = models.IntegerField(blank=True, null=True)
order = models.Integ... | apache-2.0 |
eeshangarg/oh-mainline | vendor/packages/mechanize/test-tools/linecache_copy.py | 22 | 3864 | """Cache lines from files.
This is intended to read lines from modules imported -- hence if a filename
is not found, it will look down the module search path for a file by
that name.
"""
import sys
import os
__all__ = ["getline", "clearcache", "checkcache"]
def getline(filename, lineno, module_globals=None):
li... | agpl-3.0 |
PabloTunnon/pykka-deb | tests/performance.py | 1 | 1351 | import time
from pykka.actor import ThreadingActor
from pykka.registry import ActorRegistry
def time_it(func):
start = time.time()
func()
print('%s took %.3fs' % (func.func_name, time.time() - start))
class SomeObject(object):
baz = 'bar.baz'
def func(self):
pass
class AnActor(Thread... | apache-2.0 |
menardorama/ReadyNAS-Add-ons | headphones-1.0.0/files/etc/apps/headphones/lib/cherrypy/lib/cpstats.py | 49 | 22770 | """CPStats, a package for collecting and reporting on program statistics.
Overview
========
Statistics about program operation are an invaluable monitoring and debugging
tool. Unfortunately, the gathering and reporting of these critical values is
usually ad-hoc. This package aims to add a centralized place for gather... | gpl-2.0 |
thenakliman/nirikshak | nirikshak/output/base.py | 1 | 1989 | # Copyright 2017 <thenakliman@gmail.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 applicable law or agreed to... | apache-2.0 |
wscullin/spack | var/spack/repos/builtin/packages/xauth/package.py | 3 | 1892 | ##############################################################################
# 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 |
pplu/botocore | tests/functional/test_s3_control.py | 2 | 2819 | # Copyright 2018 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | apache-2.0 |
adamtiger/tensorflow | tensorflow/python/ops/distributions/dirichlet.py | 60 | 10583 | # 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 |
gomiero/PTVS | Python/Tests/TestData/VirtualEnv/env/Lib/copy_reg.py | 50 | 7001 | """Helper to provide extensibility for pickle/cPickle.
This is only useful to add pickle support for extension types defined in
C, not for instances of user-defined classes.
"""
from types import ClassType as _ClassType
__all__ = ["pickle", "constructor",
"add_extension", "remove_extension", "cle... | apache-2.0 |
EvanzzzZ/mxnet | example/speech-demo/io_func/regr_feat_io.py | 15 | 1981 | import os
import sys
import random
import shlex
import time
import re
from utils.utils import to_bool
from feat_readers.common import *
from feat_readers import stats
from feat_io import DataReadStream
class RegrDataReadStream(object):
def __init__(self, dataset_args, n_ins):
dataset_args["has_labels"] =... | apache-2.0 |
westurner/pgs | setup.py | 1 | 1664 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import codecs
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with codecs.open('README.rst', encoding='UTF8') as readme_file:
readme = readme_file.read()
with codecs.open('HISTORY.rst', encoding='UTF8') as history_file... | mit |
BaptisteBriois/rapid_plan | node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/__init__.py | 1524 | 22178 | #!/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.
import copy
import gyp.input
import optparse
import os.path
import re
import shlex
import sys
import traceback
from gyp.common import GypErr... | gpl-2.0 |
DonLakeFlyer/ardupilot | Tools/scripts/make_intel_hex.py | 41 | 1315 | #!/usr/bin/env python
import sys, os, shutil, struct
import intelhex
# make two intel hex files, one including bootloader and one without
# for loading with DFU based tools
if len(sys.argv) != 4:
print("Usage: make_intel_hex.py BINFILE BOOTLOADER RESERVE_KB")
sys.exit(1)
scripts = os.path.dirname(__file__)
... | gpl-3.0 |
Bulochkin/tensorflow_pack | tensorflow/contrib/distributions/python/ops/operator_test_util.py | 79 | 6603 | # 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 |
adelton/django | tests/gis_tests/geoadmin/tests.py | 304 | 3157 | from __future__ import unicode_literals
from django.contrib.gis import admin
from django.contrib.gis.geos import Point
from django.test import TestCase, override_settings, skipUnlessDBFeature
from .admin import UnmodifiableAdmin
from .models import City, site
@skipUnlessDBFeature("gis_enabled")
@override_settings(R... | bsd-3-clause |
fabrickit/fabkit | core/agent/fabcontext.py | 1 | 1417 | # coding: utf-8
from oslo_context import context
from oslo_db.sqlalchemy import enginefacade
@enginefacade.transaction_context_provider
class RequestContext(context.RequestContext):
"""Security context and request information.
Represents the user taking a given action within the system.
"""
def __in... | mit |
babycaseny/poedit | deps/boost/tools/build/test/library_order.py | 44 | 2111 | #!/usr/bin/python
# Copyright 2004 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# Test that on compilers sensitive to library order on linker's command line,
# we generate the correct order.
import BoostBu... | mit |
dkubiak789/OpenUpgrade | addons/hw_proxy/__openerp__.py | 67 | 1617 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
wangjun/djangae | djangae/contrib/uniquetool/admin.py | 19 | 2536 | from django import forms
from django.db import models
from django.contrib import admin
from .models import UniqueAction, ActionLog, encode_model
def _show_model(m):
if m._meta.app_label == "uniquetool":
return False
if any([ x.unique for x in m._meta.fields ]):
return True
if x._meta.uni... | bsd-3-clause |
tmpvar/skia.cc | tools/skp/page_sets/skia_pokemonwiki_desktop.py | 32 | 1308 | # 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.
# pylint: disable=W0401,W0614
from telemetry import story
from telemetry.page import page as page_module
from telemetry.page import shared_page_state
clas... | apache-2.0 |
2014c2g1/c2g1 | exts/exts/sphinxcontrib/bibtex/__init__.py | 38 | 4471 | # -*- coding: utf-8 -*-
"""
Sphinx Interface
~~~~~~~~~~~~~~~~
.. autofunction:: setup
.. autofunction:: init_bibtex_cache
.. autofunction:: purge_bibtex_cache
.. autofunction:: process_citations
.. autofunction:: process_citation_references
.. autofunction:: check_duplicate_labels
"""
... | gpl-2.0 |
pgmillon/ansible | lib/ansible/modules/cloud/azure/azure_rm_cdnprofile.py | 27 | 9890 | #!/usr/bin/python
#
# Copyright (c) 2018 Hai Cao, <t-haicao@microsoft.com>, Yunge Zhu <yungez@microsoft.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 = {'metadat... | gpl-3.0 |
SerCeMan/intellij-community | python/lib/Lib/uuid.py | 170 | 20165 | r"""UUID objects (universally unique identifiers) according to RFC 4122.
This module provides immutable UUID objects (class UUID) and the functions
uuid1(), uuid3(), uuid4(), uuid5() for generating version 1, 3, 4, and 5
UUIDs as specified in RFC 4122.
If all you want is a unique ID, you should probably call uuid1() ... | apache-2.0 |
lorenamgUMU/sakai | reference/library/src/webapp/editor/FCKeditor/editor/filemanager/connectors/py/fckutil.py | 114 | 4490 | #!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2010 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http:... | apache-2.0 |
mylxiaoyi/wicd | tests/testwnettools.py | 4 | 2217 | import unittest
from wicd import wnettools
class TestWnettools(unittest.TestCase):
def setUp(self):
self.interface = wnettools.BaseInterface('eth0')
def test_find_wireless_interface(self):
interfaces = wnettools.GetWirelessInterfaces()
# wlan0 may change depending on your system
#self.assertTrue('wlan0' in... | gpl-2.0 |
jhjguxin/blogserver | lib/python2.7/site-packages/django/contrib/localflavor/fi/fi_municipalities.py | 394 | 10822 | # -*- coding: utf-8 -*-
"""
An alphabetical list of Finnish municipalities for use as `choices` in a
formfield.
This exists in this standalone file so that it's only imported into memory
when explicitly needed.
"""
MUNICIPALITY_CHOICES = (
('akaa', u"Akaa"),
('alajarvi', u"Alajärvi"),
('alavieska', u"Alav... | mit |
calebmadrigal/tracker-jacker | plugin_examples/plugin_template.py | 2 | 1426 | __author__ = 'Caleb Madrigal'
__email__ = 'caleb.madrigal@gmail.com'
__version__ = '0.0.2'
__apiversion__ = 1
__config__ = {'power': -100, 'log_level': 'ERROR', 'trigger_cooldown': 1}
class Trigger:
def __init__(self):
# dev_id -> [timestamp1, timestamp2, ...]
self.packets_seen = 0
self.un... | mit |
Ervii/garage-time | garage/src/python/pants/java/nailgun_executor.py | 1 | 12377 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
print_function, unicode_literals)
import hashlib
impor... | apache-2.0 |
jpaalasm/pyglet | contrib/layout/layout/css.py | 29 | 32122 | #!/usr/bin/env python
'''CSS 2.1 parsing and rule matching.
This module is distinct from the CSS 2.1 properties, which are contained
in properties.py; allowing users to use the CSS syntax and rule matching for
custom properties and applications if desired.
The Stylesheet class is the top-level interface to rules and... | bsd-3-clause |
sklnet/openatv-enigma2 | lib/python/Screens/VideoMode.py | 2 | 30865 | from os import path
from enigma import iPlayableService, iServiceInformation, eTimer, eServiceCenter, eServiceReference, eDVBDB
from Screens.Screen import Screen
from Screens.ChannelSelection import FLAG_IS_DEDICATED_3D
from Components.About import about
from Components.SystemInfo import SystemInfo
from Components.Co... | gpl-2.0 |
sander76/home-assistant | homeassistant/helpers/config_entry_flow.py | 3 | 6388 | """Helpers for data entry flows for config entries."""
from __future__ import annotations
from typing import Any, Awaitable, Callable, Union
from homeassistant import config_entries
from homeassistant.core import HomeAssistant
DiscoveryFunctionType = Callable[[], Union[Awaitable[bool], bool]]
class DiscoveryFlowHa... | apache-2.0 |
wateraccounting/wa | Collect/CFSR/DataAccess_CFSR.py | 1 | 8868 | # -*- coding: utf-8 -*-
"""
Authors: Tim Hessels
UNESCO-IHE 2016
Contact: t.hessels@unesco-ihe.org
Repository: https://github.com/wateraccounting/wa
Module: Collect/CFSR
"""
# General modules
import pandas as pd
import os
import numpy as np
from netCDF4 import Dataset
import re
from joblib import Parallel, del... | apache-2.0 |
sanabby/kubernetes | cluster/juju/charms/trusty/kubernetes-master/hooks/hooks.py | 101 | 11762 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... | apache-2.0 |
john-wang-metro/metro-openerp | metro_mrp_id_stock/mfg_id_stock.py | 2 | 12410 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
CoDEmanX/ArangoDB | 3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_extcall.py | 55 | 6263 | """Doctest for method/function calls.
We're going the use these types for extra testing
>>> from UserList import UserList
>>> from UserDict import UserDict
We're defining four helper functions
>>> def e(a,b):
... print a, b
>>> def f(*a, **k):
... print a, test_support.sortdict(k)
... | apache-2.0 |
sktjdgns1189/android_kernel_pantech_ef56s | tools/perf/util/setup.py | 4998 | 1330 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... | gpl-2.0 |
mandeepdhami/neutron | neutron/plugins/embrane/common/operation.py | 59 | 1466 | # Copyright 2013 Embrane, 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 |
tmimori/erpnext | erpnext/patches/v4_0/update_custom_print_formats_for_renamed_fields.py | 119 | 1265 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import re
def execute():
# NOTE: sequence is important
fields_list = (
("amount", "base_amount"),
("ref_rate", "price_list_rate"),
... | agpl-3.0 |
Faiz7412/or-tools | examples/python/nqueens.py | 34 | 2563 | # 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 applicable ... | apache-2.0 |
skuarch/namebench | nb_third_party/dns/rdtypes/ANY/LOC.py | 248 | 12571 | # Copyright (C) 2003-2007, 2009, 2010 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 ... | apache-2.0 |
vnsofthe/odoo-dev | addons/vnsoft020/vnsoft_sale.py | 1 | 5299 | # -*- coding: utf-8 -*-
from openerp import SUPERUSER_ID
from openerp.osv import fields, osv
from openerp.tools.translate import _
import openerp.addons.decimal_precision as dp
from openerp import tools, api
import datetime
import logging
_logger = logging.getLogger(__name__)
class vnsoft_sale_order(osv.osv):
_in... | agpl-3.0 |
vganapath/rally | rally/plugins/openstack/scenarios/neutron/utils.py | 1 | 27676 | # Copyright 2014: Intel 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 a... | apache-2.0 |
maxikov/attfocus | 2dbluetooths/reg_bayes/test.py | 1 | 1183 | #!/usr/bin/env python
import featurebuilder
import pickle
import numpy
def load_data(filename):
src = open(filename, "r")
X, Y = eval(src.readline())
src.close()
return X, Y
def main():
print "Loading data..."
X, Y = load_data("test_set.py")
f = open("rnode.p", "rb")
rnode = pickle.load(f)
f.close()
rno... | gpl-3.0 |
VladimirVystupkin/AMRParsing1.x | stanfordnlp/unidecode/x021.py | 72 | 3974 | data = (
'', # 0x00
'', # 0x01
'', # 0x02
'', # 0x03
'', # 0x04
'', # 0x05
'', # 0x06
'', # 0x07
'', # 0x08
'', # 0x09
'', # 0x0a
'', # 0x0b
'', # 0x0c
'', # 0x0d
'', # 0x0e
'', # 0x0f
'', # 0x10
'', # 0x11
'', # 0x12
'', # 0x13
'', # 0x14
'', # 0x15
'',... | gpl-2.0 |
jlmadurga/permabots | permabots/test/factories/messenger_lib.py | 2 | 1111 | # coding=utf-8
from factory import Factory, SubFactory
from factory.fuzzy import FuzzyText, FuzzyInteger
from django.utils import timezone
from permabots.views.hooks import messenger_hook
class MessengerTextMessageFactory(Factory):
class Meta:
model = messenger_hook.MessengerTextMessage
mid = FuzzyTex... | bsd-3-clause |
okin/doit | tests/test_runner.py | 1 | 24930 | import os
from multiprocessing import Queue
import pytest
from mock import Mock
from doit.dependency import Dependency
from doit.task import Task
from doit.control import TaskDispatcher, ExecNode
from doit import runner
# sample actions
def my_print(*args):
pass
def _fail():
return False
def _error():
r... | mit |
petebachant/scipy | benchmarks/benchmarks/linalg.py | 44 | 2636 | from __future__ import division, absolute_import, print_function
import numpy.linalg as nl
import numpy as np
from numpy.testing import assert_
from numpy.random import rand
try:
import scipy.linalg as sl
except ImportError:
pass
from .common import Benchmark
def random(size):
return rand(*size)
cla... | bsd-3-clause |
stewartpark/django | tests/transactions/tests.py | 88 | 19722 | from __future__ import unicode_literals
import sys
import threading
import time
from unittest import skipIf, skipUnless
from django.db import (
DatabaseError, Error, IntegrityError, OperationalError, connection,
transaction,
)
from django.test import (
TransactionTestCase, skipIfDBFeature, skipUnlessDBFea... | bsd-3-clause |
czgu/opendataexperience | env/lib/python2.7/site-packages/django/template/debug.py | 42 | 3778 | from django.template.base import Lexer, Parser, tag_re, NodeList, VariableNode, TemplateSyntaxError
from django.utils.encoding import force_text
from django.utils.html import conditional_escape
from django.utils.safestring import SafeData, EscapeData
from django.utils.formats import localize
from django.utils.timezone ... | apache-2.0 |
Qalthos/ansible | test/units/modules/network/f5/test_bigip_service_policy.py | 38 | 4128 | # -*- 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... | gpl-3.0 |
phihag/youtube-dl | youtube_dl/extractor/eagleplatform.py | 17 | 7755 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_HTTPError,
compat_str,
)
from ..utils import (
ExtractorError,
int_or_none,
unsmuggle_url,
)
class EaglePlatformIE(InfoExtractor):
_VALID_URL = r'''(?x)
... | unlicense |
abstract-open-solutions/OCB | addons/account/wizard/account_open_closed_fiscalyear.py | 237 | 2537 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
paulromano/openmc | tests/unit_tests/test_pin.py | 8 | 3545 | """
Tests for constructing Pin universes
"""
import numpy as np
import pytest
import openmc
from openmc.model import pin
def get_pin_radii(pin_univ):
"""Return a sorted list of all radii from pin"""
rads = set()
for cell in pin_univ.get_all_cells().values():
surfs = cell.region.get_surfaces().v... | mit |
metpy/SHARPpy | sharppy/sharptab/winds.py | 1 | 12346 | ''' Wind Manipulation Routines '''
import math
from sharppy.sharptab import interp, vector
from sharppy.sharptab.constants import *
__all__ = ['mean_wind', 'mean_wind_npw', 'sr_wind', 'sr_wind_npw',
'wind_shear', 'helicity', 'max_wind', 'corfidi_mcs_motion',
'non_parcel_bunkers_motion', 'mbe_vect... | bsd-3-clause |
ifduyue/sentry | src/sentry/utils/audit.py | 2 | 3240 | from __future__ import absolute_import
from sentry.models import (
ApiKey, AuditLogEntry, AuditLogEntryEvent, DeletedOrganization, DeletedProject, DeletedTeam, Organization, Project, Team
)
def create_audit_entry(request, transaction_id=None, logger=None, **kwargs):
user = request.user if request.user.is_auth... | bsd-3-clause |
jledet/linux-xlnx | 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 |
mktoni/anglerfish | anglerfish/set_single_instance.py | 2 | 1102 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Set process name and cpu priority,return socket.socket or None."""
import logging as log
import socket
import sys
def set_single_instance(name: str, port: int=8_888) -> socket.socket:
"""Set process name and cpu priority,return socket.socket or None."""
tr... | gpl-3.0 |
jchodera/assaytools | AssayTools/pymcmodels.py | 1 | 27554 | #!/usr/bin/env python
"""
A test of pymc for ITC.
"""
#=============================================================================================
# IMPORTS
#=============================================================================================
import numpy as np
import pymc
import pint
#=================... | lgpl-2.1 |
awainer/7539 | aplicaciones_informaticas/aplicaciones_informaticas/settings.py | 1 | 3741 | """
Django settings for aplicaciones_informaticas project.
Generated by 'django-admin startproject' using Django 1.10.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settin... | unlicense |
epage/DialCentral | dialcentral/util/overloading.py | 10 | 7887 | #!/usr/bin/env python
import new
# Make the environment more like Python 3.0
__metaclass__ = type
from itertools import izip as zip
import textwrap
import inspect
__all__ = [
"AnyType",
"overloaded"
]
AnyType = object
class overloaded:
"""
Dynamically overloaded functions.
This is an implementation of (dyn... | lgpl-2.1 |
biotrump/xbmc | lib/gtest/test/gtest_color_test.py | 3259 | 4911 | #!/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... | gpl-2.0 |
kevinpt/ripyl | ripyl/util/bitops.py | 1 | 1559 | #!/usr/bin/python
# -*- coding: utf-8 -*-
'''Bit-wise operations
'''
# Copyright © 2013 Kevin Thibedeau
# This file is part of Ripyl.
# Ripyl is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundati... | lgpl-3.0 |
onshape-public/onshape-clients | python/onshape_client/oas/models/bt_bill_of_materials_table1073_all_of.py | 1 | 5229 | # coding: utf-8
"""
Onshape REST API
The Onshape REST API consumed by all clients. # noqa: E501
The version of the OpenAPI document: 1.113
Contact: api-support@onshape.zendesk.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
im... | mit |
jscn/django | django/http/response.py | 15 | 18100 | from __future__ import unicode_literals
import datetime
import json
import re
import sys
import time
from email.header import Header
from django.conf import settings
from django.core import signals, signing
from django.core.exceptions import DisallowedRedirect
from django.core.serializers.json import DjangoJSONEncode... | bsd-3-clause |
Pillar1989/BBG_linux-3.8 | tools/perf/scripts/python/check-perf-trace.py | 1997 | 2539 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
ndtran/l10n-switzerland | l10n_ch_account_statement_base_import/parser/base_parser.py | 1 | 4932 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi
# Copyright 2015 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# publi... | agpl-3.0 |
technologiescollege/Blockly-rduino-communication | scripts_XP/Lib/site-packages/serial/serialwin32.py | 147 | 18260 | #! python
# Python Serial Port Extension for Win32, Linux, BSD, Jython
# serial driver for win32
# see __init__.py
#
# (C) 2001-2011 Chris Liechti <cliechti@gmx.net>
# this is distributed under a free software license, see license.txt
#
# Initial patch to use ctypes by Giovanni Bajo <rasky@develer.com>
import ctypes
f... | gpl-3.0 |
SickGear/SickGear | lib/hachoir_py2/parser/misc/androidxml.py | 2 | 8482 | """
AndroidManifest.xml parser
References:
- http://code.google.com/p/androguard/source/browse/core/bytecodes/apk.py
Author: Robert Xiao
Creation Date: May 29, 2011
"""
from hachoir_py2.parser import Parser
from hachoir_py2.field import (FieldSet, ParserError,
String, Enum, GenericVect... | gpl-3.0 |
zimmermegan/MARDA | nltk-3.0.3/nltk/test/unit/test_classify.py | 28 | 1370 | # -*- coding: utf-8 -*-
"""
Unit tests for nltk.classify. See also: nltk/test/classify.doctest
"""
from __future__ import absolute_import
from nose import SkipTest
from nltk import classify
TRAIN = [
(dict(a=1,b=1,c=1), 'y'),
(dict(a=1,b=1,c=1), 'x'),
(dict(a=1,b=1,c=0), 'y'),
(dict(a=0,b=1,c=1), '... | mit |
furrykef/lltvg | sf64-audio/sf64dec.py | 1 | 7342 | #!/usr/bin/env python
# By hcs with tweaks by Kef Schecter
# Requires Python 2.7 or greater
from __future__ import division
from contextlib import contextmanager
from struct import unpack, pack
import argparse
import sys
import wave
EN_SAMPLE_RATES = (
12000, # File 0
15000, # File 1
7000, # File 2
)
... | mit |
jaapz/werkzeug | tests/test_datastructures.py | 25 | 29192 | # -*- coding: utf-8 -*-
"""
tests.datastructures
~~~~~~~~~~~~~~~~~~~~
Tests the functionality of the provided Werkzeug
datastructures.
Classes prefixed with an underscore are mixins and are not discovered by
the test runner.
TODO:
- FileMultiDict
- Immutable types undertested... | bsd-3-clause |
trunca/enigma2 | lib/python/Screens/Screen.py | 10 | 4777 | from Tools.Profile import profile
profile("LOAD:GUISkin")
from Components.GUISkin import GUISkin
profile("LOAD:Source")
from Components.Sources.Source import Source
profile("LOAD:GUIComponent")
from Components.GUIComponent import GUIComponent
profile("LOAD:eRCInput")
from enigma import eRCInput
class Screen(dict, GUI... | gpl-2.0 |
NeuralEnsemble/python-neo | neo/io/blkio.py | 5 | 13527 | from .baseio import BaseIO
from neo.core import ImageSequence, Segment, Block
import numpy as np
import struct
import os
import math
import quantities as pq
class BlkIO(BaseIO):
"""
Neo IO module for optical imaging data stored as BLK file
*Usage*:
>>> from neo import io
>>> import quant... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.