code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
# This file is part of beets.
# Copyright 2013, Adrian Sampson.
#
# 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, ... | dpendl00/headphones | lib/beetsplug/fetchart.py | Python | gpl-3.0 | 11,700 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
PyLMS: Python Wrapper for Logitech Media Server CLI
(Telnet) Interface
Copyright (C) 2013 Tang <tanguy [dot] bonneau [at] gmail [dot] com>
LMSServer class is based on JingleManSweep <jinglemansweep [at] gmail [dot] com>
This program is free software; you can ... | JoakimLindbom/agocontrol | devices/squeezebox/pylmsserver.py | Python | gpl-3.0 | 14,264 |
#
# Newfies-Dialer License
# http://www.newfies-dialer.org
#
# 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/.
#
# Copyright (C) 2011-2015 Star2Billing S.L.
#
# The primar... | romonzaman/newfies-dialer | newfies/dnc/constants.py | Python | mpl-2.0 | 748 |
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2017, Anders Innovations. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
from django.core.exceptions import ObjectDoesNotExist
from shuup.core.... | shoopio/shoop | shuup/core/utils/line_unit_mixin.py | Python | agpl-3.0 | 921 |
#!/home/tom/ab/android/python-for-android/build/python-install/bin/python2.7
"""An RFC 2821 smtp proxy.
Usage: %(program)s [options] [localhost:localport [remotehost:remoteport]]
Options:
--nosetuid
-n
This program generally tries to setuid `nobody', unless this flag is
set. The setuid call ... | duducosmos/pgs4a | python-install/bin/smtpd.py | Python | lgpl-2.1 | 18,597 |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Bird(AutotoolsPackage):
"""The BIRD project aims to develop a dynamic IP routing daemon wi... | LLNL/spack | var/spack/repos/builtin/packages/bird/package.py | Python | lgpl-2.1 | 1,198 |
"""Auto-generated file, do not edit by hand. TT metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_TT = PhoneMetadata(id='TT', country_code=1, international_prefix='011',
general_desc=PhoneNumberDesc(national_number_pattern='[589]\\d{9}', possible_number_pattern='\\... | dongguangming/python-phonenumbers | python/phonenumbers/data/region_TT.py | Python | apache-2.0 | 1,892 |
import os
import sys
def usage():
print('%s all -- build all bsp' % os.path.basename(sys.argv[0]))
print('%s clean -- clean all bsp' % os.path.basename(sys.argv[0]))
print('%s project -- update all prject files' % os.path.basename(sys.argv[0]))
BSP_ROOT = os.path.join("..", "bsp")
if len(sys.argv) ... | armink/rt-thread | tools/buildbot.py | Python | apache-2.0 | 1,963 |
# 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 th... | CiscoSystems/avos | openstack_dashboard/dashboards/project/stacks/forms.py | Python | apache-2.0 | 15,580 |
#!/usr/bin/env python
# Copyright (c) PLUMgrid, Inc.
# Licensed under the Apache License, Version 2.0 (the "License")
from bcc import BPF
from ctypes import c_int, c_ulonglong
import random
import time
from unittest import main, TestCase
class TestHistogram(TestCase):
def test_simple(self):
b = BPF(text="... | romain-intel/bcc | tests/python/test_histogram.py | Python | apache-2.0 | 2,254 |
"""Support for BMW car locks with BMW ConnectedDrive."""
import logging
from typing import Any
from bimmer_connected.vehicle import ConnectedDriveVehicle
from bimmer_connected.vehicle_status import LockState
from homeassistant.components.lock import LockEntity
from homeassistant.config_entries import ConfigEntry
from... | jawilson/home-assistant | homeassistant/components/bmw_connected_drive/lock.py | Python | apache-2.0 | 3,416 |
# Copyright 2018 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... | hfp/tensorflow-xsmm | tensorflow/contrib/gan/python/features/python/spectral_normalization_impl.py | Python | apache-2.0 | 12,318 |
# Copyright 2015 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 a... | tombstone/models | research/neural_gpu/wmt_utils.py | Python | apache-2.0 | 16,455 |
#!/usr/bin/env python
##########################################################################
# run/ec2-setup/spot.py
#
# Part of Project Thrill - http://project-thrill.org
#
# Copyright (C) 2015 Matthias Stumpp <mstumpp@gmail.com>
#
# All rights reserved. Published under the BSD-2 license in the LICENSE file.
#####... | manpen/thrill | run/ec2-setup/spot.py | Python | bsd-2-clause | 3,829 |
"""
=============================
XDAWN Decoding From EEG data
=============================
ERP decoding with Xdawn. For each event type, a set of spatial Xdawn filters
are trained and applied on the signal. Channels are concatenated and rescaled
to create features vectors that will be fed into a Logistic Regression... | wronk/mne-python | examples/decoding/plot_decoding_xdawn_eeg.py | Python | bsd-3-clause | 3,406 |
from __future__ import absolute_import
from sfepy.base.base import assert_
from sfepy.base.testing import TestCommon
##
# 28.08.2007, c
class Test( TestCommon ):
##
# 28.08.2007, c
def from_conf( conf, options ):
return Test( conf = conf, options = options )
from_conf = staticmethod( from_conf... | vlukes/sfepy | tests/test_base.py | Python | bsd-3-clause | 4,617 |
from __future__ import absolute_import, division, unicode_literals
try:
chr = unichr # flake8: noqa
except NameError:
pass
from collections import deque
from .constants import spaceCharacters
from .constants import entities
from .constants import asciiLetters, asciiUpper2Lower
from .constants import digits, ... | hoosteeno/fjord | vendor/src/html5lib-python/html5lib/tokenizer.py | Python | bsd-3-clause | 76,929 |
from playerGst import *
| JeffHoogland/qAndora | playerGst/__init__.py | Python | bsd-3-clause | 24 |
## @file
# This file is used to define common parsing related functions used in parsing
# Inf/Dsc/Makefile process
#
# Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD Li... | intel/ipmctl | BaseTools/Source/Python/Eot/Parser.py | Python | bsd-3-clause | 33,751 |
import os
from bcbio.utils import file_exists
import bcbio.pipeline.datadict as dd
from bcbio.ngsalign.postalign import dedup_bam
from bcbio.distributed.transaction import file_transaction
from bcbio import broad, bam
def rnaseq_gatk_variant_calling(data):
data = dd.set_deduped_bam(data, dedup_bam(dd.get_work_bam... | hjanime/bcbio-nextgen | bcbio/rnaseq/variation.py | Python | mit | 3,793 |
from __future__ import unicode_literals, division, absolute_import
import logging
import sys
import os
from flexget import plugin
from flexget.event import event
log = logging.getLogger('change')
found_deprecated = False
class ChangeWarn(object):
"""
Gives warning if user has deprecated / changed config... | voriux/Flexget | flexget/plugins/plugin_change_warn.py | Python | mit | 3,389 |
#!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Exercise the wallet keypool, and interaction with wallet encryption/locking
# Add python-bitcoinrpc to... | ArcticCore/arcticcoin | qa/rpc-tests/keypool-hd.py | Python | mit | 4,165 |
# -*- 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 field 'Version.privacy_level'
db.add_column('builds_version', 'privacy_level',
... | d0ugal/readthedocs.org | readthedocs/builds/migrations/0015_add_privacy.py | Python | mit | 11,730 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright (c) 2006-2015 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import logging
import os
import re
import shlex
import sqlite3
import sys
import tempfile
import time
import urllib2
from lib.core.common import dataT... | krintoxi/NoobSec-Toolkit | NoobSecToolkit /tools/inject/lib/utils/api.py | Python | gpl-2.0 | 26,576 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The migrate command-line tool."""
import sys
import inspect
import logging
from optparse import OptionParser, BadOptionError
from migrate.versioning import api, exceptions
from migrate.versioning.config import *
from migrate.versioning.util import asbool
alias = dic... | evensonbryan/yocto-autobuilder | lib/python2.7/site-packages/sqlalchemy_migrate-0.6-py2.6.egg/migrate/versioning/shell.py | Python | gpl-2.0 | 6,390 |
# 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
# "License"); you may not u... | ikoula/cloudstack | scripts/vm/network/vnet/cloudstack_pluginlib.py | Python | gpl-2.0 | 17,502 |
import sys
import math
from pimath import *
from PyQt4 import QtCore, QtGui, QtOpenGL
from camera import Camera
import grind
#-----------------------------------------------------------------------------
from rodin import logging
log = logging.get_logger('grind.mangle.gl_widget')
try:
from OpenGL.GL import *
... | mstreatfield/anim-studio-tools | grind/python/util/glWidget.py | Python | gpl-3.0 | 11,356 |
# -*- coding: utf-8 -*-
"""
Tests of neo.io.exampleio
"""
# needed for python 3 compatibility
from __future__ import absolute_import, division
import warnings
try:
import unittest2 as unittest
except ImportError:
import unittest
import quantities as pq
import numpy as np
from neo.io.nestio import ColumnIO
f... | CINPLA/expipe-dev | python-neo/neo/test/iotest/test_nestio.py | Python | gpl-3.0 | 34,432 |
# encoding: utf-8
#
#
# 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/.
#
# Contact: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import, divis... | klahnakoski/SpotManager | vendor/mo_math/hashes.py | Python | mpl-2.0 | 593 |
"""
PLN representation of the "smokes" sample from Tuffy Markov Logic Networks
More details on this sample are available here:
https://github.com/opencog/opencog/tree/master/opencog/python/pln_old/examples/tuffy/smokes
https://github.com/cosmoharrigan/tuffy/tree/master/samples/smoke
http://hazy.cs.wisc.edu/hazy/tuffy/... | ruiting/opencog | opencog/python/pln_old/examples/tuffy/smokes/smokes_agent.py | Python | agpl-3.0 | 5,370 |
class QueryResult(object):
"""
A common class for representing query result in a variety of formats, namely:
xml : as an XML string using the XML result format of the query language
python: as Python objects
json : as JSON
"""
def __init__(self,pythonResult):
self.rt = pythonResu... | ferranti/watchdog | vendor/rdflib-2.4.0/rdflib/QueryResult.py | Python | agpl-3.0 | 374 |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RRots(RPackage):
"""Reproducibility-Optimized Test Statistic
Calculates the Reprod... | LLNL/spack | var/spack/repos/builtin/packages/r-rots/package.py | Python | lgpl-2.1 | 1,117 |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
compat_str,
float_or_none,
int_or_none,
smuggle_url,
str_or_none,
try_get,
)
class STVPlayerIE(InfoExtractor):
IE_NAME = 'stv:player'
_VALID_URL = r'https?://play... | rg3/youtube-dl | youtube_dl/extractor/stv.py | Python | unlicense | 3,447 |
"""Support for information from HP iLO sensors."""
from datetime import timedelta
import logging
import hpilo
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
CONF_HOST,
CONF_MONITORED_VARIABLES,
CONF_NAME,
CONF_PASSWORD,
CONF_P... | leppa/home-assistant | homeassistant/components/hp_ilo/sensor.py | Python | apache-2.0 | 6,330 |
#
# 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 ... | shahankhatch/aurora | src/main/python/apache/aurora/executor/common/announcer.py | Python | apache-2.0 | 8,388 |
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Licen... | StefanoRaggi/Lean | Algorithm.Python/BrokerageModelAlgorithm.py | Python | apache-2.0 | 3,724 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# 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.apach... | Juniper/neutron | neutron/db/loadbalancer/loadbalancer_db.py | Python | apache-2.0 | 34,064 |
"""Test Customize config panel."""
import asyncio
import json
from unittest.mock import patch
from homeassistant.bootstrap import async_setup_component
from homeassistant.components import config
from homeassistant.config import DATA_CUSTOMIZE
@asyncio.coroutine
def test_get_entity(hass, aiohttp_client):
"""Test... | persandstrom/home-assistant | tests/components/config/test_customize.py | Python | apache-2.0 | 3,519 |
"""
Test lldb-vscode setBreakpoints request
"""
from __future__ import print_function
import unittest2
import vscode
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
import lldbvscode_testcase
class TestVSCode_setExceptionBreakpoints(
lldbvsco... | apple/swift-lldb | packages/Python/lldbsuite/test/tools/lldb-vscode/breakpoint/TestVSCode_setExceptionBreakpoints.py | Python | apache-2.0 | 2,075 |
# 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
# "License"); you may not u... | beobal/cassandra | pylib/cqlshlib/test/run_cqlsh.py | Python | apache-2.0 | 12,091 |
from __future__ import unicode_literals
from uuid import uuid4
from django import forms
from django.template.loader import render_to_string
from django.utils.translation import ugettext as _
from .. import PaymentError
from ..forms import CreditCardPaymentFormWithName
class FingerprintWidget(forms.HiddenInput):
... | imakin/pysar-payments | pysar_payments/cybersource/forms.py | Python | bsd-3-clause | 2,581 |
#!/usr/bin/env python
"""
cpuinfo
Copyright 2002 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@cens.ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy (BSD style) license. See LICENSE.txt that came with
this distribution for specifics.
NO WARRANTY IS EXP... | MSeifert04/numpy | numpy/distutils/cpuinfo.py | Python | bsd-3-clause | 23,013 |
##########################################################################
#
# Copyright (c) 2013, Image Engine Design 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:
#
# * Redistrib... | hradec/gaffer | python/GafferImageTest/FormatDataTest.py | Python | bsd-3-clause | 3,696 |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/iam/v1/policy.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflect... | michaelbausor/api-client-staging | generated/python/grpc-google-iam-v1/google/iam/v1/policy_pb2.py | Python | bsd-3-clause | 4,654 |
import hashlib
import random
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.core.urlresolvers import reverse
from oscar.core.compat import AUTH_USER_MODEL
class AbstractWishList(models.Model):
"""
Represents a user's wish lists of products.
A user can h... | Giftingnation/GN-Oscar-Custom | oscar/apps/wishlists/abstract_models.py | Python | bsd-3-clause | 4,545 |
# Copyright 2015 gRPC authors.
#
# 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... | endlessm/chromium-browser | third_party/grpc/src/src/python/grpcio_tests/tests/unit/test_common.py | Python | bsd-3-clause | 4,042 |
from django import template
from oscar.core.compat import assignment_tag
from oscar.core.loading import get_class, get_model
AddToBasketForm = get_class('basket.forms', 'AddToBasketForm')
SimpleAddToBasketForm = get_class('basket.forms', 'SimpleAddToBasketForm')
Product = get_model('catalogue', 'product')
register =... | vicky2135/lucious | src/oscar/templatetags/basket_tags.py | Python | bsd-3-clause | 829 |
from __future__ import division, print_function, absolute_import
import numpy as np
import warnings
from scipy._lib._util import check_random_state
def rvs_ratio_uniforms(pdf, umax, vmin, vmax, size=1, c=0, random_state=None):
"""
Generate random samples from a probability density function using the
rati... | lhilt/scipy | scipy/stats/_rvs_sampling.py | Python | bsd-3-clause | 6,992 |
from django.contrib import admin
from treebeard.admin import TreeAdmin
from treebeard.forms import movenodeform_factory
from oscar.core.loading import get_model
AttributeOption = get_model('catalogue', 'AttributeOption')
AttributeOptionGroup = get_model('catalogue', 'AttributeOptionGroup')
Category = get_model('catal... | itbabu/django-oscar | src/oscar/apps/catalogue/admin.py | Python | bsd-3-clause | 3,190 |
import pytest
import decimal
import numpy as np
import pandas as pd
from pandas import to_numeric, _np_version_under1p9
from pandas.util import testing as tm
from numpy import iinfo
class TestToNumeric(object):
def test_empty(self):
# see gh-16302
s = pd.Series([], dtype=object)
res = ... | mbayon/TFG-MachineLearning | venv/lib/python3.6/site-packages/pandas/tests/tools/test_numeric.py | Python | mit | 14,437 |
#!/usr/bin/env python3
# Copyright (c) 2017-2021 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the RPC call related to the uptime command.
Test corresponds to code in rpc/server.cpp.
"""
impo... | tecnovert/particl-core | test/functional/rpc_uptime.py | Python | mit | 1,033 |
#!/usr/bin/python
# Copyright (c) Steven Watanabe 2018.
# Distributed under the Boost Software License, Version 1.0. (See
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
# Tests that a single main target can be used for
# implicit dependencies of multiple different types.
impor... | nawawi/poedit | deps/boost/tools/build/test/feature_implicit_dependency.py | Python | mit | 2,966 |
class AbstractProvider(object):
"""Delegate class to provide requirement interface for the resolver."""
def identify(self, requirement_or_candidate):
"""Given a requirement or candidate, return an identifier for it.
This is used in many places to identify a requirement or candidate,
e.... | foobarbazblarg/stayclean | stayclean-2020-december/venv/lib/python3.8/site-packages/pip/_vendor/resolvelib/providers.py | Python | mit | 5,091 |
# -*- coding: utf8 -*-
# Copyright (C) 2013 - Oscar Campos <oscar.campos@member.fsf.org>
# This program is Free Software see LICENSE file for details
import os
import pep8
from linting import linter
class Pep8Error(linter.LintError):
"""PEP-8 linting error class
"""
def __init__(self, filename, loc, o... | alexfalcucc/anaconda | anaconda_lib/linting/anaconda_pep8.py | Python | gpl-3.0 | 4,416 |
#!/usr/bin/env python
#
# Copyright 2006,2010,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 ... | iohannez/gnuradio | gr-blocks/python/blocks/qa_unpack_k_bits.py | Python | gpl-3.0 | 1,845 |
"""tests for passlib.util"""
#=============================================================================
# imports
#=============================================================================
from __future__ import with_statement
# core
from binascii import hexlify, unhexlify
import sys
import random
import warnin... | cgstudiomap/cgstudiomap | main/eggs/passlib-1.6.5-py2.7.egg/passlib/tests/test_utils.py | Python | agpl-3.0 | 35,168 |
# Copyright 2015, Province of British Columbia
# License: https://github.com/bcgov/ckanext-bcgov/blob/master/license
import json
import urllib2
import urllib
import pprint
from base import (site_url, api_key)
org_filename = './data/orgs_list.json'
data_string = json.dumps({'all_fields' : True})
org_list = [... | gjlawran/ckanext-bcgov | ckanext/bcgov/scripts/save_orgs.py | Python | agpl-3.0 | 1,656 |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyDeeptools(PythonPackage):
"""deepTools addresses the challenge of handling the large amo... | LLNL/spack | var/spack/repos/builtin/packages/py-deeptools/package.py | Python | lgpl-2.1 | 1,792 |
"""SCons.Tool.aixc++
Tool-specific initialization for IBM xlC / Visual Age C++ compiler.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001 - 2015 The SCons Foundation
#
# Permission is h... | pnorman/mapnik | scons/scons-local-2.4.1/SCons/Tool/aixc++.py | Python | lgpl-2.1 | 2,413 |
'''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.WGL import _types as _cs
# End users want this...
from OpenGL.raw.WGL._types import *
from OpenGL.raw.WGL import _errors
from OpenGL.constant import Constant as _C
import ctype... | stack-of-tasks/rbdlpy | tutorial/lib/python2.7/site-packages/OpenGL/raw/WGL/EXT/pbuffer.py | Python | lgpl-3.0 | 1,629 |
import warnings
from pprint import pprint
import datajoint as dj
import pandas as pd
from djaddon import hdf5
try:
from pupil_tracking import PupilTracker
except ImportError:
warnings.warn("Failed to import pupil_tacking library. You won't be able to populate trk.EyeFrame")
schema = dj.schema('pipeline_pupi... | fabiansinz/pipeline | python/pipeline/legacy/trk.py | Python | lgpl-3.0 | 20,366 |
'''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GLX import _types as _cs
# End users want this...
from OpenGL.raw.GLX._types import *
from OpenGL.raw.GLX import _errors
from OpenGL.constant import Constant as _C
import ctype... | stack-of-tasks/rbdlpy | tutorial/lib/python2.7/site-packages/OpenGL/raw/GLX/NV/video_capture.py | Python | lgpl-3.0 | 1,452 |
# -:- encoding: utf-8 -:-
# This file is part of the MapProxy project.
# Copyright (C) 2013 Omniscale <http://omniscale.de>
#
# 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.a... | camptocamp/mapproxy | mapproxy/test/unit/test_util_conf_utils.py | Python | apache-2.0 | 2,557 |
"""Test the solarlog config flow."""
import pytest
from homeassistant import config_entries, data_entry_flow, setup
from homeassistant.components.solarlog import config_flow
from homeassistant.components.solarlog.const import DEFAULT_HOST, DOMAIN
from homeassistant.const import CONF_HOST, CONF_NAME
from tests.async_m... | nkgilley/home-assistant | tests/components/solarlog/test_config_flow.py | Python | apache-2.0 | 4,886 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""Test for HEXDEV-612."""
from tests import pyunit_utils
import h2o
import numpy as np
def test_hd612():
"""Test whether explicitly providing ``column_names`` to ``H2OFrame.from_python()`` produces an extra row."""
data = np.array([i for i in range(40)]).reshape... | h2oai/h2o-dev | h2o-py/tests/testdir_jira/pyunit_hexdev_612.py | Python | apache-2.0 | 744 |
from hamcrest.library.text.substringmatcher import SubstringMatcher
from hamcrest.core.helpers.hasmethod import hasmethod
__author__ = "Jon Reid"
__copyright__ = "Copyright 2011 hamcrest.org"
__license__ = "BSD, see License.txt"
class StringContains(SubstringMatcher):
def __init__(self, substring):
supe... | msabramo/PyHamcrest | src/hamcrest/library/text/stringcontains.py | Python | bsd-3-clause | 953 |
from django import forms
from django.utils.translation import ugettext as _, ungettext as ngettext
import mkt
from mkt.access import acl
from mkt.site.utils import slugify
from mkt.tags.models import Tag
def clean_tags(request, tags, max_tags=None):
"""
Blocked tags are not allowed.
Restricted tags can ... | mozilla/zamboni | mkt/tags/utils.py | Python | bsd-3-clause | 2,555 |
import sys
sys.path.append("../")
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn import decomposition
import jieba
import time
import glob
import sys
import os
import random
if len(sys.argv)<2:
print "usage: extract_topic.py di... | beni55/jieba | test/extract_topic.py | Python | mit | 1,456 |
# -*- coding: ibm850 -*-
template_typed = """
#ifdef TYPED_METHOD_BIND
template<class T $ifret ,class R$ $ifargs ,$ $arg, class P@$>
class MethodBind$argc$$ifret R$$ifconst C$ : public MethodBind {
public:
$ifret R$ $ifnoret void$ (T::*method)($arg, P@$) $ifconst const$;
#ifdef DEBUG_METHODS_ENABLED
virtual Variant... | Paulloz/godot | core/make_binders.py | Python | mit | 12,675 |
#!/usr/bin/python
###########################################################
#
# Copyright (c) 2008, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way wi... | rvanlaar/tactic-client | test/pipeline_test.py | Python | epl-1.0 | 3,879 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Universal Resource Locator (URL).
"""
__license__ = """
GoLismero 2.0 - The web knife - Copyright (C) 2011-2014
Golismero project site: https://github.com/golismero
Golismero project mail: contact@golismero-project.com
This program is free software; you can redistri... | golismero/golismero | golismero/api/data/resource/url.py | Python | gpl-2.0 | 15,148 |
# 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, erpnext
from frappe.utils import cint, formatdate, flt, getdate
from frappe import _, throw
import frappe.defaults
from erpnext.controll... | emakis/erpnext | erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py | Python | gpl-3.0 | 26,853 |
#!/usr/bin/env python
import traceback
import os
import re
import sys
if __name__ != "__main__": # we're imported as a module
_registered = []
_tests = 0
_fails = 0
def wvtest(func):
""" Use this decorator (@wvtest) in front of any function you want to run
as part of the unit tes... | Zearin/git-bup | wvtest.py | Python | lgpl-2.1 | 5,331 |
#
# 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 "License"); you may not us... | lukecwik/incubator-beam | sdks/python/apache_beam/utils/annotations.py | Python | apache-2.0 | 5,756 |
from django.conf.urls import url
from django.views import defaults
from openstack_dashboard.urls import urlpatterns # noqa
urlpatterns.append(url(r'^500/$', defaults.server_error))
| bigswitch/horizon | openstack_dashboard/test/error_pages_urls.py | Python | apache-2.0 | 184 |
#
# Autogenerated by Thrift Compiler (0.7.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
from thrift.Thrift import *
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol, TProtocol
try:
from thrift.protocol import fastbinary
except:
fastbinary = None
cla... | greeenSY/Tstream | tstream-client/src/main/py/storm/ttypes.py | Python | apache-2.0 | 148,568 |
"""Support for Transport NSW (AU) to query next leave event."""
from datetime import timedelta
from TransportNSW import TransportNSW
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
from homeassistant.const import (
ATTR_ATTRIBUTION,
ATTR_MODE,
CONF_API_KE... | lukas-hetzenecker/home-assistant | homeassistant/components/transport_nsw/sensor.py | Python | apache-2.0 | 4,474 |
#=========================================================================
# visitors.py
#=========================================================================
from __future__ import print_function
import ast, _ast
import re
import warnings
from ..ast_helpers import get_closure_dict, print_simple_ast
fro... | Abhinav117/pymtl | pymtl/tools/translation/visitors.py | Python | bsd-3-clause | 29,868 |
##########################################################################
#
# Copyright (c) 2010-2013, Image Engine Design 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:
#
# * Redis... | lento/cortex | test/IECoreRI/DspyTest.py | Python | bsd-3-clause | 4,126 |
#!/usr/bin/env python
# This file provided by Facebook is for non-commercial testing and evaluation
# purposes only. Facebook reserves all rights not expressly granted.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL... | kaoree/fresco | run_comparison.py | Python | bsd-3-clause | 7,775 |
# -*- coding: utf-8 -*-
"""
jinja.tests
~~~~~~~~~~~
Jinja test functions. Used with the "is" operator.
:copyright: 2007 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import re
number_re = re.compile(r'^-?\d+(\.\d+)?$')
regex_type = type(number_re)
def test_odd():
"""
... | pambot/SMSBeds | lib/jinja/tests.py | Python | gpl-2.0 | 3,403 |
# -*- coding: utf-8 -*-
# Copyright (c) 2018, Frappe and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
from frappe.model.document import Document
class QualityMeeting(Document):
pass | Zlash65/erpnext | erpnext/quality_management/doctype/quality_meeting/quality_meeting.py | Python | gpl-3.0 | 242 |
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_urllib_parse
from ..utils import (
int_or_none,
qualities,
)
class NprIE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?npr\.org/player/v2/mediaPlayer\.html\?.*\bid=(?P<id>\d+)'
_TESTS = [{
... | atomic83/youtube-dl | youtube_dl/extractor/npr.py | Python | unlicense | 2,966 |
from __future__ import absolute_import
from __future__ import print_function
from typing import Any, Dict, Optional
if False:
import zerver.tornado.event_queue
descriptors_by_handler_id = {} # type: Dict[int, zerver.tornado.event_queue.ClientDescriptor]
def get_descriptor_by_handler_id(handler_id):
# type:... | christi3k/zulip | zerver/tornado/descriptors.py | Python | apache-2.0 | 821 |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | laserson/luigi | examples/foo.py | Python | apache-2.0 | 1,653 |
#!/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 pyauto_functional
import pyauto
import webrtc_test_base
class MediaStreamInfobarTest(webrtc_test_base.WebrtcTestBase):
"... | plxaye/chromium | src/chrome/test/functional/media_stream_infobar.py | Python | apache-2.0 | 3,390 |
# 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... | kobejean/tensorflow | tensorflow/python/training/checkpoint_utils.py | Python | apache-2.0 | 15,013 |
"""
==============================================================
Compute seed-based time-frequency connectivity in sensor space
==============================================================
Computes the connectivity between a seed-gradiometer close to the visual cortex
and all other gradiometers. The connectivity i... | teonlamont/mne-python | examples/connectivity/plot_cwt_sensor_connectivity.py | Python | bsd-3-clause | 2,921 |
# coding: utf-8
"""
1. Bare-bones model
This is a basic model with only two non-primary-key fields.
"""
# Python 2.3 doesn't have set as a builtin
try:
set
except NameError:
from sets import Set as set
# Python 2.3 doesn't have sorted()
try:
sorted
except NameError:
from django.utils.itercompat import... | chuck211991/django-pyodbc | tests/basic/models.py | Python | bsd-3-clause | 15,295 |
# Copyright (c) 2016 Ben Noordhuis <info@bnoordhuis.nl>. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import gyp.common
import gyp.xcode_emulation
import json
import os
generator_additional_non_configuration_keys = []
generator_additional_p... | arvenil/resume | node_modules/node-gyp/gyp/pylib/gyp/generator/compile_commands_json.py | Python | mit | 4,591 |
import re
import pytest, py
from _pytest import python as funcargs
class TestMetafunc:
def Metafunc(self, func):
# the unit tests of this class check if things work correctly
# on the funcarg level, so we don't need a full blown
# initiliazation
class FixtureInfo:
name2... | mhils/pytest | testing/python/metafunc.py | Python | mit | 36,868 |
# test that socket.connect() has correct polling behaviour before, during and after
try:
import usocket as socket, uselect as select
except:
import socket, select
def test(peer_addr):
s = socket.socket()
poller = select.poll()
poller.register(s)
# test poll before connect
# note: CPython... | infinnovation/micropython | tests/net_hosted/connect_poll.py | Python | mit | 748 |
###########################################################################################
# $HeadURL$
###########################################################################################
"""Collection of DIRAC useful list related modules.
By default on Error they return None.
"""
__RCSID__ = "$Id$"
from t... | calancha/DIRAC | Core/Utilities/List.py | Python | gpl-3.0 | 3,974 |
# -*- coding: utf-8 -*-
from __future__ import (unicode_literals, division, absolute_import, print_function)
__license__ = 'GPL 3'
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
import re
from PyQt4.Qt import (QDialog, QDialogButtonBox)
from calibre.gui2.store.st... | Eksmo/calibre | src/calibre/gui2/store/stores/mobileread/adv_search_builder.py | Python | gpl-3.0 | 3,934 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import test_access_rights
from . import test_automatic_leave_dates
from . import test_allocation_access_rights
from . import test_holidays_flow
from . import test_hr_leave_type
from . import test_accrual_allocatio... | ygol/odoo | addons/hr_holidays/tests/__init__.py | Python | agpl-3.0 | 460 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Guewen Baconnier
# Copyright 2013 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
# pu... | StefanRijnhart/stock-logistics-warehouse | stock_reserve/model/stock_reserve.py | Python | agpl-3.0 | 6,546 |
# -*- coding: utf-8 -*-
"""
Acceptance tests for CMS Video Editor.
"""
from nose.plugins.attrib import attr
from .test_studio_video_module import CMSVideoBaseTest
@attr('shard_2')
class VideoEditorTest(CMSVideoBaseTest):
"""
CMS Video Editor Test Class
"""
def setUp(self):
super(VideoEditorT... | eestay/edx-platform | common/test/acceptance/tests/video/test_studio_video_editor.py | Python | agpl-3.0 | 22,804 |
"""
Simple iOS WebView tests.
"""
import unittest
import os
from random import randint
from appium import webdriver
from time import sleep
from selenium.webdriver.common.keys import Keys
class WebViewIOSTests(unittest.TestCase):
def setUp(self):
# set up appium
app = os.path.join(os.path.dirname(... | mindnuts/proventeq-test-repo | src/python/ios_webview.py | Python | apache-2.0 | 1,607 |
"""
Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved.
This program and the accompanying materials are made available under
the terms of the 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
... | rvs/gpdb | src/test/tinc/tincrepo/mpp/gpdb/tests/storage/vacuum/mpp24011/test_mpp24011.py | Python | apache-2.0 | 2,465 |
# Copyright 2018 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... | dongjoon-hyun/tensorflow | tensorflow/python/autograph/core/errors_test.py | Python | apache-2.0 | 3,793 |