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 |
|---|---|---|---|---|---|
googledatalab/pydatalab | solutionbox/image_classification/mltoolbox/image/classification/_trainer.py | 6 | 10247 | # Copyright 2017 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... | apache-2.0 |
hazrpg/calibre | src/chardet/euctwfreq.py | 323 | 34864 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | gpl-3.0 |
dpazel/music_rep | tests/transformation_tests/functions_tests/tonalfunctions_tests/test_tonality_permutation.py | 1 | 1747 | import logging
import sys
import unittest
from tonalmodel.diatonic_tone import DiatonicTone
from tonalmodel.diatonic_tone_cache import DiatonicToneCache
from tonalmodel.modality import ModalityType
from tonalmodel.tonality import Tonality
from transformation.functions.tonalfunctions.tonality_permutation import Tonalit... | mit |
pschella/scipy | scipy/signal/tests/test_fir_filter_design.py | 16 | 23142 | from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
from numpy.testing import TestCase, run_module_suite, assert_raises, \
assert_almost_equal, assert_array_almost_equal, assert_equal, \
assert_, assert_allclose, assert_warns
from scipy.special import si... | bsd-3-clause |
vashzsun/fund_analysis | fund_data/dataProcess.py | 1 | 2664 | __author__ = 'Seven1'
import json
import os,sys
sys.path.insert(0,os.path.dirname(sys.path[0]))#外部设置项目目录为搜索路径, 确保正确的包引用
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "fund_analysis.settings") #导入django设置, 才能正常运行
from fund_data.models import FundInfo
from datetime import datetime
class FundProcess:
fund_count = ... | apache-2.0 |
crosick/zhishu | ENV/lib/python2.7/encodings/ptcp154.py | 647 | 8950 | """ Python Character Mapping Codec generated from 'PTCP154.txt' with gencodec.py.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
(c) Copyright 2000 Guido van Rossum.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,err... | mit |
lxieyang/simple-amt | simpleamt.py | 1 | 2914 | import argparse, json
from boto.mturk.connection import MTurkConnection
from boto.mturk.qualification import *
from jinja2 import Environment, FileSystemLoader
"""
A bunch of free functions that we use in all scripts.
"""
def get_jinja_env(config):
"""
Get a jinja2 Environment object that we can use to find te... | mit |
mitodl/bootcamp-ecommerce | main/context_processors_test.py | 1 | 3354 | """Context processors tests"""
import json
import pytest
from django.contrib.auth.models import AnonymousUser
from django.test import RequestFactory
from main.context_processors import configuration_context, js_settings
from profiles.factories import UserFactory
# pylint: disable=redefined-outer-name
@pytest.fixture... | bsd-3-clause |
tanglei528/horizon | openstack_dashboard/dashboards/project/containers/forms.py | 7 | 10136 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | apache-2.0 |
TenchiMasaki/android-tegra-nv-3.1.10-rel-15r7 | tools/perf/scripts/python/netdev-times.py | 11271 | 15048 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... | gpl-2.0 |
837468220/python-for-android | python3-alpha/python3-src/Lib/test/test_isinstance.py | 59 | 10173 | # Tests some corner cases with isinstance() and issubclass(). While these
# tests use new style classes and properties, they actually do whitebox
# testing of error conditions uncovered when using extension types.
import unittest
from test import support
import sys
class TestIsInstanceExceptions(unittest.TestCase... | apache-2.0 |
xuewei4d/scikit-learn | sklearn/preprocessing/_discretization.py | 5 | 13176 | # -*- coding: utf-8 -*-
# Author: Henry Lin <hlin117@gmail.com>
# Tom Dupré la Tour
# License: BSD
import numbers
import numpy as np
import warnings
from . import OneHotEncoder
from ..base import BaseEstimator, TransformerMixin
from ..utils.validation import check_array
from ..utils.validation import chec... | bsd-3-clause |
emijrp/youtube-dl | youtube_dl/extractor/arte.py | 77 | 9526 | # encoding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
find_xpath_attr,
unified_strdate,
get_element_by_attribute,
int_or_none,
qualities,
)
# There are different sources of video in arte.tv, the extraction process
# is differen... | unlicense |
jaruba/chromium.src | components/policy/tools/make_policy_zip.py | 159 | 2874 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Creates a zip archive with policy template files. The list of input files is
extracted from a grd file with grit. This is to kee... | bsd-3-clause |
repotvsupertuga/repo | plugin.video.specto/resources/lib/sources/directdl_tv.py | 20 | 4246 | # -*- coding: utf-8 -*-
'''
Specto Add-on
Copyright (C) 2015 lambda
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 l... | gpl-2.0 |
Dik1s/volatility | contrib/plugins/pagecheck.py | 55 | 1739 | # Volatility
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Volatility is dist... | gpl-2.0 |
jonathonwalz/ansible | lib/ansible/modules/cloud/google/gcpubsub_facts.py | 70 | 4771 | #!/usr/bin/python
# Copyright 2016 Google 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
# (at your option) any later vers... | gpl-3.0 |
dtaht/Gnugol | src/prototypes/wikipedia.py | 1 | 1543 | """ajaxgoogle.py - Simple bindings to the AJAX Google Search API
(Just the JSON-over-HTTP bit of it, nothing to do with AJAX per se)
http://code.google.com/apis/ajaxsearch/documentation/reference.html#_intro_fonje
brendan o'connor - gist.github.com/28405 - anyall.org"""
try:
import json
except ImportError:
import s... | agpl-3.0 |
dvliman/jaikuengine | .google_appengine/lib/django-0.96/django/conf/__init__.py | 33 | 5865 | """
Settings and configuration for Django.
Values will be read from the module specified by the DJANGO_SETTINGS_MODULE environment
variable, and then from django.conf.global_settings; see the global settings file for
a list of all possible variables.
"""
import os
import time # Needed for Windows
from django.conf... | apache-2.0 |
ludmilamarian/invenio | invenio/modules/upgrader/operations.py | 20 | 2662 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2012, 2013 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any... | gpl-2.0 |
rruebner/odoo | addons/website_certification/__openerp__.py | 64 | 1502 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | agpl-3.0 |
krafczyk/spack | var/spack/repos/builtin/packages/r-topgo/package.py | 2 | 2371 | ##############################################################################
# Copyright (c) 2013-2018, 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 |
xsm110/Apache-Beam | sdks/python/apache_beam/io/filesystems_util.py | 3 | 1283 | #
# 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... | apache-2.0 |
ryancoleman/autodock-vina | boost_1_54_0/libs/python/test/test_pointer_adoption.py | 46 | 1708 | # Copyright David Abrahams 2004. 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)
"""
>>> from test_pointer_adoption_ext import *
>>> num_a_instances()
0
>>> a = create('dynamically allocated')
>>> num_a_instances()
... | apache-2.0 |
abgworrall/kubernetes | vendor/github.com/ugorji/go/codec/test.py | 1516 | 4019 | #!/usr/bin/env python
# This will create golden files in a directory passed to it.
# A Test calls this internally to create the golden files
# So it can process them (so we don't have to checkin the files).
# Ensure msgpack-python and cbor are installed first, using:
# sudo apt-get install python-dev
# sudo apt-g... | apache-2.0 |
ninjin/nerv | src/nerv/dag.py | 2 | 3353 | # vim:set ft=python ts=4 sw=4 sts=4 autoindent:
'''
A Directed Multigraph with some caching of attributes for better run-time
performance.
Author: Pontus Stenetorp <pontus stenetorp se>
Version: 2014-03-12
'''
# TODO: Implement remove_edge?
# TODO: Could use more clever caching rather than full invalidatio... | isc |
six8/polydatum | tests/test_deferred_attr_requests.py | 1 | 3758 | from polydatum.middleware import DalCommand, PathSegment
def test_deferred_attribute_access(path_segment_factory):
"""
Verify that we can access non-existent attributes on this class and
that we can access arbitrarily deep non-existent attributes.
"""
dc = DalCommand(lambda: None, path_segment_fac... | mit |
flwh/shadowsocks | shadowsocks/daemon.py | 694 | 5602 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2014-2015 clowwindy
#
# 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 requi... | apache-2.0 |
johnardavies/scrapy | scrapy/downloadermiddlewares/cookies.py | 128 | 3330 | import os
import six
import logging
from collections import defaultdict
from scrapy.exceptions import NotConfigured
from scrapy.http import Response
from scrapy.http.cookies import CookieJar
from scrapy.utils.python import to_native_str
logger = logging.getLogger(__name__)
class CookiesMiddleware(object):
"""Th... | bsd-3-clause |
40323144/2015cdb_g7 | static/Brython3.1.1-20150328-091302/Lib/fractions.py | 722 | 23203 | # Originally contributed by Sjoerd Mullender.
# Significantly modified by Jeffrey Yasskin <jyasskin at gmail.com>.
"""Fraction, infinite-precision, real numbers."""
from decimal import Decimal
import math
import numbers
import operator
import re
import sys
__all__ = ['Fraction', 'gcd']
def gcd(a, b):
"""Calcu... | gpl-3.0 |
ngcurrier/ProteusCFD | GUI/dakotaHistogram.py | 1 | 1543 | #!/usr/bin/python
import numpy as np
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
#reads a space delimited file with a header and returns a dictionary
#attempts to cast dictionary entries into floats, if it fails, leaves as is
def readSpaceDelimitedFile(filename):
f = open(filename, 'r')
hea... | gpl-3.0 |
yawnosnorous/python-for-android | python-modules/twisted/twisted/python/test/test_inotify.py | 56 | 3188 | # Copyright (c) 2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.python._inotify}.
"""
from twisted.trial.unittest import TestCase
from twisted.python.runtime import platform
if platform.supportsINotify():
from ctypes import c_int, c_char_p
from twisted.python import _inot... | apache-2.0 |
FireWRT/OpenWrt-Firefly-Libraries | staging_dir/host/lib/python2.7/encodings/zlib_codec.py | 533 | 3015 | """ Python 'zlib_codec' Codec - zlib compression encoding
Unlike most of the other codecs which target Unicode, this codec
will return Python string objects for both encode and decode.
Written by Marc-Andre Lemburg (mal@lemburg.com).
"""
import codecs
import zlib # this codec needs the optional zlib modu... | gpl-2.0 |
telefonicaid/iotqatools | iotqatools/tests/test_cb_utils.py | 2 | 10950 | # -*- coding: utf-8 -*-
"""
Copyright 2015 Telefonica Investigación y Desarrollo, S.A.U
This file is part of telefonica-iotqatools
iotqatools 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... | agpl-3.0 |
peter-jang/ansible | lib/ansible/compat/tests/unittest.py | 375 | 1147 | # (c) 2014, Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later... | gpl-3.0 |
karan1276/servo | tests/wpt/css-tests/tools/py/setup.py | 161 | 1425 | import os, sys
from setuptools import setup
def main():
setup(
name='py',
description='library with cross-python path, ini-parsing, io, code, log facilities',
long_description = open('README.txt').read(),
version='1.4.31',
url='http://pylib.readthedocs.org/',
licens... | mpl-2.0 |
jmschrei/scikit-learn | examples/gaussian_process/plot_gpr_co2.py | 9 | 5718 | """
========================================================
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 |
auduny/home-assistant | homeassistant/components/uk_transport/sensor.py | 15 | 9530 | """Support for UK public transport data provided by transportapi.com.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.uk_transport/
"""
import logging
import re
from datetime import datetime, timedelta
import requests
import voluptuous as vol
imp... | apache-2.0 |
dietrichc/streamline-ppc-reports | examples/dfp/v201408/inventory_service/update_ad_units.py | 4 | 2877 | #!/usr/bin/python
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 |
ngageoint/voxel-globe | voxel_globe/tools/enu.py | 2 | 3907 | from numpy import sin, cos, pi, arctan, arctan2
def llh2enu_au(llh_origin, llh):
''' someone else's code'''
a = 6378137.0
b = 6356752.3142
e2 = 1 - (b/a)**2
phi = llh_origin[0]*pi/180.0
lam = llh_origin[1]*pi/180.0
h = llh_origin[2]
dphi = llh[0]*pi/180.0 - phi
dlam = llh[1]*pi/180.0 - lam
... | mit |
CedarLogic/ansible | lib/ansible/utils/unicode.py | 80 | 11275 | # (c) 2012-2014, Toshio Kuraotmi <a.badger@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | gpl-3.0 |
Dee-UK/RK3188_tablet_kernel_sources | Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# This program i... | gpl-2.0 |
peterbe/moztrap | tests/model/library/test_importer.py | 5 | 28211 | """Tests for suite/case importer."""
from tests import case
from mock import patch
from moztrap.model.library.importer import ImportResult, SuiteImporter
class ImporterTestBase(object):
"""Common base class for importer tests."""
def setUp(self):
"""Setup for importer tests; create a product versio... | bsd-2-clause |
tmerrick1/spack | var/spack/repos/builtin/packages/perl-module-build/package.py | 5 | 1940 | ##############################################################################
# Copyright (c) 2013-2018, 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 |
bryx-inc/boto | tests/integration/ec2containerservice/test_ec2containerservice.py | 99 | 1749 | # Copyright (c) 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 ... | mit |
Stillbot/stillbot-master | stillbot_master/brew_master/migrations/0001_initial.py | 1 | 5383 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Wash'
db.create_table(u'brew_master_wash', (
... | mit |
feardax/namebench | nb_third_party/jinja2/compiler.py | 199 | 61044 | # -*- coding: utf-8 -*-
"""
jinja2.compiler
~~~~~~~~~~~~~~~
Compiles nodes into python code.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from cStringIO import StringIO
from itertools import chain
from copy import deepcopy
from jinja2 import nodes
from j... | apache-2.0 |
smARTLab-liv/smartlabatwork-release | slaw_navigation/nodes/OdomScanMovePidMonitor.py | 1 | 9756 | #!/usr/bin/env python
import rospy
import actionlib
from sensor_msgs.msg import LaserScan
from geometry_msgs.msg import Twist, Pose2D, PoseStamped
from nav_msgs.msg import Odometry
from math import pi
from slaw_actions.msg import *
from slaw_srvs.srv import *
import sys, select
import tf
odom = "/odom"
base_frame ... | mit |
lord63/a_bunch_of_code | v2ex/setup.py | 1 | 1231 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
import v2ex_daily_mission
try:
import pypandoc
long_description = pypandoc.convert('README.md', 'rst')
except (IOError, ImportError):
with open('README.md') as f:
long_description = f.read()
setup(
name='v2ex_daily_mi... | mit |
ltilve/ChromiumGStreamerBackend | content/test/gpu/gpu_tests/screenshot_sync.py | 6 | 2440 | # 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 random
import gpu_test_base
import screenshot_sync_expectations as expectations
from telemetry import benchmark
from telemetry.core import ... | bsd-3-clause |
40223245/40223245W11 | wsgi.py | 5 | 7752 | # coding=utf-8
# 上面的程式內容編碼必須在程式的第一或者第二行才會有作用
################# (1) 模組導入區
# 導入 cherrypy 模組, 為了在 OpenShift 平台上使用 cherrypy 模組, 必須透過 setup.py 安裝
import cherrypy
# 導入 Python 內建的 os 模組, 因為 os 模組為 Python 內建, 所以無需透過 setup.py 安裝
import os
# 導入 random 模組
import random
################# (2) 廣域變數設定區
# 確定程式檔案所在目錄, 在 Windows 下有... | gpl-3.0 |
maurofaccenda/ansible | test/runner/test.py | 2 | 20662 | #!/usr/bin/env python
# PYTHON_ARGCOMPLETE_OK
"""Test runner for all Ansible tests."""
from __future__ import absolute_import, print_function
import errno
import os
import sys
from lib.util import (
ApplicationError,
display,
raw_command,
)
from lib.delegation import (
delegate,
)
from lib.executor... | gpl-3.0 |
digital-abyss/ansible-modules-core | cloud/amazon/ec2_lc.py | 47 | 12492 | #!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | gpl-3.0 |
ecell/ecell3 | ecell/frontend/session-monitor/ecell/ui/osogo/PluginInstanceSelection.py | 1 | 4155 | #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
#
# This file is part of the E-Cell System
#
# Copyright (C) 1996-2016 Keio University
# Copyright (C) 2008-2016 RIKEN
# Copyright (C) 2005-2009 The Molecular Sciences Institute
#
#:::::::::::::::::::::::::::::::::::::::... | lgpl-3.0 |
EDUlib/edx-platform | lms/djangoapps/lti_provider/tasks.py | 5 | 3591 | """
Asynchronous tasks for the LTI provider app.
"""
import logging
from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user
from opaque_keys.edx.keys import CourseKey
import lms.djangoapps.lti_provider.outcomes as outcomes
from lms import CELERY_APP
from lms.djangoapps.grades... | agpl-3.0 |
jturner77/notepad-plus-plus | scintilla/test/ScintillaCallable.py | 56 | 5129 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import ctypes, os, sys
from ctypes import c_int, c_ulong, c_char_p, c_wchar_p, c_ushort, c_uint, c_long
class TEXTRANGE(ctypes.Structure):
_fields_= (\
('cpMin', c_long),
('cpMax', c_long),
('lpstrText', ctypes.POINTER(ctypes.c_char)... | gpl-2.0 |
LukeM12/samba | lib/dnspython/tests/bugs.py | 56 | 1782 | # Copyright (C) 2006, 2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | gpl-3.0 |
tinloaf/home-assistant | tests/components/image_processing/test_init.py | 6 | 10498 | """The tests for the image_processing component."""
from unittest.mock import patch, PropertyMock
from homeassistant.core import callback
from homeassistant.const import ATTR_ENTITY_PICTURE
from homeassistant.setup import setup_component
from homeassistant.exceptions import HomeAssistantError
import homeassistant.comp... | apache-2.0 |
Diyago/Machine-Learning-scripts | DEEP LEARNING/segmentation/Severstal-Steel-Defect-Detection-master/common_blocks/new_metrics.py | 1 | 15642 | from functools import partial
import numpy as np
import torch
from catalyst.dl import Callback, RunnerState, MetricCallback, CallbackOrder
from pytorch_toolbelt.utils.catalyst.visualization import get_tensorboard_logger
from pytorch_toolbelt.utils.torch_utils import to_numpy
from pytorch_toolbelt.utils.visualization i... | apache-2.0 |
iconmix/skins-addons | script.iconmixtools/resources/lib/unidecode/x6d.py | 252 | 4651 | data = (
'Zhou ', # 0x00
'Ji ', # 0x01
'Yi ', # 0x02
'Hui ', # 0x03
'Hui ', # 0x04
'Zui ', # 0x05
'Cheng ', # 0x06
'Yin ', # 0x07
'Wei ', # 0x08
'Hou ', # 0x09
'Jian ', # 0x0a
'Yang ', # 0x0b
'Lie ', # 0x0c
'Si ', # 0x0d
'Ji ', # 0x0e
'Er ', # 0x0f
'Xing ', # 0x10
'Fu ... | gpl-3.0 |
patrikpettersson/rest-engine | lib/aniso8601/tests/test_interval.py | 3 | 6080 | # -*- coding: utf-8 -*-
# Copyright (c) 2014, Brandon Nielsen
# All rights reserved.
#
# This software may be modified and distributed under the terms
# of the BSD license. See the LICENSE file for details.
import unittest
import datetime
from aniso8601.interval import parse_interval, parse_repeating_interval
clas... | mit |
justinlulejian/fah-gae | lib/google/api/monitoring_pb2.py | 17 | 4886 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/api/monitoring.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 reflec... | mit |
UdeM-LBIT/GAPol | lib/ga/evolve/Statistics.py | 1 | 3790 | """
:mod:`Statistics` -- statistical structure module
==========================================================================
This module have the class which is reponsible to keep statistics of each
generation. This class is used by the adapters and other statistics dump objects.
"""
class Statistics(object):
... | gpl-3.0 |
RPI-OPENEDX/edx-platform | cms/djangoapps/course_creators/tests/test_admin.py | 61 | 8201 | """
Tests course_creators.admin.py.
"""
from django.test import TestCase
from django.contrib.auth.models import User
from django.contrib.admin.sites import AdminSite
from django.http import HttpRequest
import mock
from course_creators.admin import CourseCreatorAdmin
from course_creators.models import CourseCreator
fr... | agpl-3.0 |
hakonsbm/nest-simulator | topology/pynest/tests/test_connection_with_elliptical_mask.py | 5 | 13035 | # -*- coding: utf-8 -*-
#
# test_connection_with_elliptical_mask.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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 ver... | gpl-2.0 |
sv-dev1/odoo | addons/mrp/wizard/mrp_price.py | 381 | 2132 | # -*- 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 |
dmitriy0611/django | tests/utils_tests/test_decorators.py | 11 | 3968 | from django.http import HttpResponse
from django.template import engines
from django.template.response import TemplateResponse
from django.test import RequestFactory, SimpleTestCase
from django.utils.decorators import decorator_from_middleware
class ProcessViewMiddleware(object):
def process_view(self, request, v... | bsd-3-clause |
OpenLD/enigma2-wetek | lib/python/Components/Label.py | 2 | 2938 | from HTMLComponent import HTMLComponent
from GUIComponent import GUIComponent
from VariableText import VariableText
from skin import parseColor
from ConditionalWidget import ConditionalWidget, BlinkingWidget, BlinkingWidgetConditional
from enigma import eLabel
class Label(VariableText, HTMLComponent, GUIComponent):
... | gpl-2.0 |
mwmuni/LIGGGHTS_GUI | networkx/algorithms/approximation/connectivity.py | 31 | 13106 | """ Fast approximation for node connectivity
"""
# Copyright (C) 2015 by
# Jordi Torrents <jtorrents@milnou.net>
# All rights reserved.
# BSD license.
import itertools
from operator import itemgetter
import networkx as nx
__author__ = """\n""".join(['Jordi Torrents <jtorrents@milnou.net>'])
__all__ = ['... | gpl-3.0 |
liosha2007/temporary-groupdocs-python-sdk | groupdocs/models/GetJobDocumentsResponse.py | 1 | 1163 | #!/usr/bin/env python
"""
Copyright 2012 GroupDocs.
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 |
hckiang/DBLite | boost_1_54_0/tools/build/v2/tools/types/lib.py | 71 | 2703 | # Status: ported
# Base revision: 64456.
# Copyright David Abrahams 2004.
# Copyright Vladimir Prus 2010.
# 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)
import b2.build.type as type
# The following naming scheme ... | gpl-3.0 |
wjsl/jaredcumulo | test/system/auto/simple/bulkFile.py | 2 | 1090 | # 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 use ... | apache-2.0 |
Tejeshwarabm/Westwood | src/netanim/bindings/modulegen__gcc_LP64.py | 354 | 264513 | 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 |
willemneal/Docky | lib/pygments/lexers/foxpro.py | 134 | 26236 | # -*- coding: utf-8 -*-
"""
pygments.lexers.foxpro
~~~~~~~~~~~~~~~~~~~~~~
Simple lexer for Microsoft Visual FoxPro source code.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer
from pygm... | mit |
destinmoulton/squabble | pythonclient/venv/lib/python2.7/site-packages/setuptools/command/easy_install.py | 109 | 74243 | #!/usr/bin/env python
"""
Easy Install
------------
A tool for doing automatic download/extract/build of distutils-based Python
packages. For detailed documentation, see the accompanying EasyInstall.txt
file, or visit the `EasyInstall home page`__.
__ https://pythonhosted.org/setuptools/easy_install.html
"""
impo... | mit |
coffenbacher/askbot-devel | askbot/conf/login_providers.py | 1 | 4822 | """
External service key settings
"""
from askbot.conf.settings_wrapper import settings
from askbot.conf.super_groups import LOGIN_USERS_COMMUNICATION
from askbot.deps import livesettings
from django.utils.translation import ugettext_lazy as _
from django.conf import settings as django_settings
from askbot.skins import... | gpl-3.0 |
nirmeshk/oh-mainline | vendor/packages/Pygments/pygments/styles/borland.py | 364 | 1562 | # -*- coding: utf-8 -*-
"""
pygments.styles.borland
~~~~~~~~~~~~~~~~~~~~~~~
Style similar to the style used in the Borland IDEs.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token impo... | agpl-3.0 |
themissingcow/inTheHood | python/InTheHood/Store.py | 2 | 3622 | # Copyright (c) 2011, Tom Cowland. 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 c... | bsd-3-clause |
michalliu/OpenWrt-Firefly-Libraries | staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python2.7/test/test_textwrap.py | 84 | 25554 | #
# Test suite for the textwrap module.
#
# Original tests written by Greg Ward <gward@python.net>.
# Converted to PyUnit by Peter Hansen <peter@engcorp.com>.
# Currently maintained by Greg Ward.
#
# $Id$
#
import unittest
from test import test_support
from textwrap import TextWrapper, wrap, fill, dedent
class Base... | gpl-2.0 |
kimimj/scrapy | scrapy/spidermiddlewares/depth.py | 88 | 2051 | """
Depth Spider Middleware
See documentation in docs/topics/spider-middleware.rst
"""
import logging
from scrapy.http import Request
logger = logging.getLogger(__name__)
class DepthMiddleware(object):
def __init__(self, maxdepth, stats=None, verbose_stats=False, prio=1):
self.maxdepth = maxdepth
... | bsd-3-clause |
srvelivela/ansibledoc | lib/ansible/module_utils/ec2.py | 12 | 9146 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
tuxfux-hlp-notes/python-batches | archieves/batch-62/modules/mysheets/lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/__init__.py | 1229 | 2323 | """A collection of modules for iterating through different kinds of
tree, generating tokens identical to those produced by the tokenizer
module.
To create a tree walker for a new type of tree, you need to do
implement a tree walker object (called TreeWalker by convention) that
implements a 'serialize' method taking a ... | gpl-3.0 |
pzankov/hydroctrl | water_tank.py | 1 | 3485 | #!/usr/bin/env python3
from adc import ADS1115, ADCFilter
from settings import UR, SUPPLY_TANK_CONFIG
class LinearInterpolation:
"""
Interpolate a 1-D function.
`x` and `y` are arrays of values used to approximate some function f: ``y = f(x)``.
"""
def __init__(self, x, y):
if len(x) !=... | mit |
bchareyre/ratchet | examples/test/paraview-spheres-solid-section/pv_section.py | 6 | 31536 | try: paraview.simple
except: from paraview.simple import *
paraview.simple._DisableFirstRenderCameraReset()
RenderView1 = CreateRenderView()
RenderView1.LightSpecularColor = [1.0, 1.0, 1.0]
RenderView1.KeyLightAzimuth = 10.0
RenderView1.UseTexturedBackground = 0
RenderView1.UseLight = 1
RenderView1.CameraPosition = [-... | gpl-2.0 |
rschnapka/odoo | openerp/tests/addons/test_limits/models.py | 435 | 1034 | # -*- coding: utf-8 -*-
import time
import openerp
class m(openerp.osv.osv.Model):
""" This model exposes a few methods that will consume between 'almost no
resource' and 'a lot of resource'.
"""
_name = 'test.limits.model'
def consume_nothing(self, cr, uid, context=None):
return True... | agpl-3.0 |
nklulupeterpan/Comedy | node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py | 2736 | 6387 | # 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
#-------------------------------------------------------------------... | mit |
vansjyo/Hacktoberfest-2k17 | GUI_Calculator/shareWithMeCalc/calculator.py | 2 | 7666 | from Tkinter import *
import math
class Calc():
def __init__(self):
self.total = 0
self.current= ""
self.new_num = True
self.op_pending = False
self.op = ""
self.eq_flag = False
def num_press(self,num):
temp = text_box.get()
self.eq_flag = False
temp2 = str(num)
if self.new_num == True:
sel... | mit |
bbc/kamaelia | Sketches/MH/RTP/RTPMux.py | 3 | 5090 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, ... | apache-2.0 |
christophlsa/odoo | addons/product/product.py | 21 | 68721 | # -*- 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 |
Keeper-Security/Commander | keepercommander/commands/folder.py | 1 | 27728 | #_ __
# | |/ /___ ___ _ __ ___ _ _ ®
# | ' </ -_) -_) '_ \/ -_) '_|
# |_|\_\___\___| .__/\___|_|
# |_|
#
# Keeper Commander
# Copyright 2018 Keeper Security Inc.
# Contact: ops@keepersecurity.com
#
import argparse
import collections
import re
import fnmatch
import shutil
import functools
import os
impor... | mit |
tkaitchuck/nupic | examples/opf/experiments/anomaly/spatial/2field_few_6040/description.py | 10 | 15991 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditions apply:
#
# This pro... | gpl-3.0 |
HidinMTA/mtasa-blue | vendor/google-breakpad/src/tools/gyp/test/actions/gyptest-generated-header.py | 187 | 1124 | #!/usr/bin/env python
# Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that dependencies on generated headers work, even if the header has
a mixed-case file name.
"""
import TestGyp
test = TestGyp... | gpl-3.0 |
SpheMakh/Stimela | stimela/utils/logger.py | 1 | 9243 | import os
import sys
import json
import yaml
import time
import subprocess
from io import StringIO
import codecs
from datetime import datetime
import logging
class StimelaLogger(object):
def __init__(self, lfile, jtype="docker"):
self.lfile = lfile
# Create file if it does not exist
if no... | gpl-2.0 |
UnrememberMe/pants | src/python/pants/backend/graph_info/tasks/list_owners.py | 15 | 1960 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import json
from pa... | apache-2.0 |
olapaola/olapaola-android-scripting | python/src/Lib/test/test_urllib2_localnet.py | 48 | 16942 | #!/usr/bin/env python
import mimetools
import threading
import urlparse
import urllib2
import BaseHTTPServer
import unittest
import hashlib
from test import test_support
# Loopback http server infrastructure
class LoopbackHttpServer(BaseHTTPServer.HTTPServer):
"""HTTP server w/ a few modifications that make it u... | apache-2.0 |
haeusser/tensorflow | tensorflow/contrib/distributions/python/ops/bijectors/affine_linear_operator.py | 25 | 8719 | # 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 |
Changaco/oh-mainline | vendor/packages/Django/tests/regressiontests/comment_tests/tests/feed_tests.py | 47 | 1915 | from __future__ import absolute_import
from xml.etree import ElementTree as ET
from django.conf import settings
from django.contrib.comments.models import Comment
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from . import CommentTestCase
from ..models import... | agpl-3.0 |
40223108/w18 | static/Brython3.1.3-20150514-095342/Lib/unittest/test/test_runner.py | 785 | 10718 | import io
import os
import sys
import pickle
import subprocess
import unittest
from .support import LoggingResult, ResultWithNoStartTestRunStopTestRun
class TestCleanUp(unittest.TestCase):
def testCleanUp(self):
class TestableTest(unittest.TestCase):
def testNothing(self):
p... | gpl-3.0 |
betatim/BlackBox | skopt/benchmarks.py | 2 | 2905 | # -*- coding: utf-8 -*-
"""A collection of benchmark problems."""
import numpy as np
def bench1(x):
"""A benchmark function for test purposes.
f(x) = x ** 2
It has a single minima with f(x*) = 0 at x* = 0.
"""
return x[0] ** 2
def bench1_with_time(x):
"""Same as bench1 but returns the... | bsd-3-clause |
primiano/udoo_kernel_imx | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | 2058 | # failed 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 failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.