repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
molobrakos/home-assistant | homeassistant/components/zwave/fan.py | 9 | 2651 | """Support for Z-Wave fans."""
import logging
import math
from homeassistant.core import callback
from homeassistant.components.fan import (
DOMAIN, FanEntity, SPEED_OFF, SPEED_LOW, SPEED_MEDIUM, SPEED_HIGH,
SUPPORT_SET_SPEED)
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from . import ... | apache-2.0 |
jackkiej/SickRage | lib/tornado/test/import_test.py | 15 | 1547 | # flake8: noqa
from __future__ import absolute_import, division, print_function, with_statement
from tornado.test.util import unittest
class ImportTest(unittest.TestCase):
def test_import_everything(self):
# Some of our modules are not otherwise tested. Import them
# all (unless they have externa... | gpl-3.0 |
acorg/dark-matter | bin/make-consensus.py | 1 | 10130 | #!/usr/bin/env python
import os
import sys
import argparse
from tempfile import mkdtemp
from os.path import join, basename
from dark.fasta import FastaReads
from dark.process import Executor
IVAR_FREQUENCY_THRESHOLD_DEFAULT = 0.6
IVAR_DOCS = (
'https://andersen-lab.github.io/ivar/html/manualpage.html#autotoc_md1... | mit |
paramite/glance | glance/artifacts/domain/__init__.py | 9 | 2753 | # Copyright (c) 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | apache-2.0 |
sekikn/incubator-airflow | airflow/migrations/versions/b0125267960b_merge_heads.py | 8 | 1232 | #
# 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... | apache-2.0 |
RoboticsURJC/JdeRobot | src/libs/comm_py/comm/ice/ptMotorsIceClient.py | 5 | 3897 | # -*- coding: utf-8 -*-
#
# Copyright (C) 1997-2016 JDE Developers Team
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ve... | gpl-3.0 |
Kilhog/odoo | addons/edi/__openerp__.py | 312 | 1911 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | agpl-3.0 |
karolhrdina/malamute | bindings/python/test_malamute.py | 11 | 1127 | from malamute import MalamuteClient
def test(addr):
service = MalamuteClient()
service.connect(addr, 100, b'service')
service.set_worker(b'service', b'derps')
writer = MalamuteClient()
print("writer.connect")
writer.connect(addr, 100, b'writer')
print("writer.set_producer")
writer.set_producer(b'writer')
re... | mpl-2.0 |
oasiswork/odoo | addons/base_report_designer/wizard/base_report_designer_modify.py | 314 | 6128 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
brijeshkesariya/odoo | addons/hr_holidays/wizard/hr_holidays_summary_employees.py | 337 | 2152 | # -*- 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 |
nvoron23/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Tools/scripts/linktree.py | 101 | 2425 | #! /usr/bin/env python
# linktree
#
# Make a copy of a directory tree with symbolic links to all files in the
# original tree.
# All symbolic links go to a special symbolic link at the top, so you
# can easily fix things if the original source tree moves.
# See also "mkreal".
#
# usage: mklinks oldtree newtree
import... | apache-2.0 |
amiguez/youtube-dl | youtube_dl/extractor/kanalplay.py | 113 | 3283 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
float_or_none,
srt_subtitles_timecode,
)
class KanalPlayIE(InfoExtractor):
IE_DESC = 'Kanal 5/9/11 Play'
_VALID_URL = r'https?://(?:www\.)?kanal(?P<channel_id... | unlicense |
shuggiefisher/django-on-google-app-engine-base | django/contrib/sitemaps/views.py | 232 | 2084 | from django.http import HttpResponse, Http404
from django.template import loader
from django.contrib.sites.models import get_current_site
from django.core import urlresolvers
from django.utils.encoding import smart_str
from django.core.paginator import EmptyPage, PageNotAnInteger
def index(request, sitemaps, template_... | bsd-3-clause |
jazcollins/models | object_detection/utils/label_map_util.py | 2 | 4740 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
mavenlin/tensorflow | tensorflow/contrib/bayesflow/python/ops/monte_carlo.py | 102 | 1304 | # 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 |
kailash-cd/CustomAdCreator | node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py | 2779 | 1665 | # Copyright (c) 2011 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.
"""gypsh output module
gypsh is a GYP shell. It's not really a generator per se. All it does is
fire up an interactive Python session with a few local variables... | gpl-3.0 |
laura-dietz/taia-stream-eval | code/utils.py | 1 | 1464 | epochsPerWeek = int(6.048E5)
epochsPerDay = 86400
epochsPerInterval = epochsPerWeek
# evalTR = 1325376000 # this is the old eval time range, Jan 1st
evalTR = 1326334731 # this is the new eval time range, J1
evalTRend = 1338508800
def epochsToDate(d):
return (d - evalTR) / epochsPerDay
weekStarts = range(evalTR, ... | apache-2.0 |
rrampage/rethinkdb | test/rql_test/connections/http_support/flask/testsuite/reqctx.py | 557 | 5960 | # -*- coding: utf-8 -*-
"""
flask.testsuite.reqctx
~~~~~~~~~~~~~~~~~~~~~~
Tests the request context.
:copyright: (c) 2012 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import flask
import unittest
try:
from greenlet import greenlet
except ImportError:
greenlet = None... | agpl-3.0 |
mSenyor/sl4a | python/src/Tools/scripts/nm2def.py | 94 | 2444 | #! /usr/bin/env python
"""nm2def.py
Helpers to extract symbols from Unix libs and auto-generate
Windows definition files from them. Depends on nm(1). Tested
on Linux and Solaris only (-p option to nm is for Solaris only).
By Marc-Andre Lemburg, Aug 1998.
Additional notes: the output of nm is supposed to look like th... | apache-2.0 |
lach76/scancode-toolkit | setup.py | 9 | 3246 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import absolute_import, print_function
import io
import os
import re
from glob import glob
from os.path import basename
from os.path import dirname
from os.path import join
from os.path import splitext
from setuptools import find_packages
from setuptools... | apache-2.0 |
pgmillon/ansible | test/units/module_utils/basic/test_heuristic_log_sanitize.py | 56 | 3727 | # -*- coding: utf-8 -*-
# (c) 2015, 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
# (a... | gpl-3.0 |
robhudson/kuma | vendor/packages/logilab/astng/exceptions.py | 27 | 1650 | # copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of logilab-astng.
#
# logilab-astng is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as publis... | mpl-2.0 |
LiveAsynchronousVisualizedArchitecture/lava | Visualizer/nanogui/docs/exhale.py | 3 | 136915 | # This file is part of exhale: https://github.com/svenevs/exhale
#
# This file was generated on/around (date -Ru):
#
# Fri, 20 Jan 2017 21:14:23 +0000
#
# Copyright (c) 2016, Stephen McDowell
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are pe... | apache-2.0 |
birryree/servo | tests/wpt/web-platform-tests/old-tests/webdriver/user_input/click_test.py | 141 | 10579 | import os
import sys
import unittest
sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
import base_test
repo_root = os.path.abspath(os.path.join(__file__, "../../.."))
sys.path.insert(1, os.path.join(repo_root, "tools", "webdriver"))
from webdriver import exceptions, wait
class ClickTest(base_tes... | mpl-2.0 |
tpaszkowski/quantum | quantum/plugins/ryu/ryu_quantum_plugin.py | 2 | 10994 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Isaku Yamahata <yamahata at private email ne jp>
# <yamahata at valinux co jp>
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with... | apache-2.0 |
chepazzo/trigger | trigger/contrib/commando/plugins/config_device.py | 6 | 5188 |
import os.path
import re
from socket import getfqdn, gethostbyname
from twisted.python import log
from trigger.contrib.commando import CommandoApplication
from trigger.conf import settings
from trigger.utils import xmltodict, strip_juniper_namespace
import xml.etree.ElementTree as ET
from xml.etree.cElementTree import... | bsd-3-clause |
l0b0/cds-invenio-vengmark | modules/websession/lib/webgroup_tests.py | 3 | 1876 | # -*- coding: utf-8 -*-
##
## This file is part of CDS Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN.
##
## CDS 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 versio... | gpl-2.0 |
varunkumta/azure-linux-extensions | Common/libpsutil/py2.6-glibc-2.12-pre/psutil/_psbsd.py | 36 | 13237 | #!/usr/bin/env python
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""FreeBSD platform implementation."""
import errno
import functools
import os
import sys
from collections import namedtuple
from ... | apache-2.0 |
truongdq/chainer | chainer/functions/connection/linear.py | 3 | 2243 | import numpy
from chainer import function
from chainer.utils import type_check
def _as_mat(x):
if x.ndim == 2:
return x
return x.reshape(len(x), -1)
class LinearFunction(function.Function):
def check_type_forward(self, in_types):
n_in = in_types.size()
type_check.expect(2 <= n_... | mit |
blackzw/openwrt_sdk_dev1 | staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/lib/python2.7/json/tests/test_recursion.py | 135 | 3374 | from json.tests import PyTest, CTest
class JSONTestObject:
pass
class TestRecursion(object):
def test_listrecursion(self):
x = []
x.append(x)
try:
self.dumps(x)
except ValueError:
pass
else:
self.fail("didn't raise ValueError on lis... | gpl-2.0 |
paaschpa/badcomputering | tastypie/utils/formatting.py | 47 | 1142 | from __future__ import unicode_literals
import email
import datetime
import time
from django.utils import dateformat
from tastypie.utils.timezone import make_aware, make_naive, aware_datetime
# Try to use dateutil for maximum date-parsing niceness. Fall back to
# hard-coded RFC2822 parsing if that's not possible.
try:... | bsd-3-clause |
Haynie-Research-and-Development/jarvis | deps/lib/python3.4/site-packages/pyasn1/type/char.py | 11 | 13153 | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com>
# License: http://pyasn1.sf.net/license.html
#
import sys
from pyasn1.type import univ, tag
from pyasn1 import error
__all__ = ['NumericString', 'PrintableString', 'TeletexString', 'T61String', 'VideotexString',
... | gpl-2.0 |
moijes12/oh-mainline | vendor/packages/ghettoq/ghettoq/backends/beanstalk.py | 17 | 2211 | from itertools import ifilter
from Queue import Empty
from beanstalkc import Connection
from ghettoq.backends.base import BaseBackend
DEFAULT_HOST = 'localhost'
DEFAULT_PORT = 11300
class BeanstalkBackend(BaseBackend):
def _parse_job(self, job):
item, dest = None, None
if job:
try:
... | agpl-3.0 |
nhomar/odoo | addons/base_import_module/models/ir_module.py | 238 | 4795 | import logging
import os
import sys
import zipfile
from os.path import join as opj
import openerp
from openerp.osv import osv
from openerp.tools import convert_file
from openerp.tools.translate import _
_logger = logging.getLogger(__name__)
MAX_FILE_SIZE = 100 * 1024 * 1024 # in megabytes
class view(osv.osv):
_... | agpl-3.0 |
6H057WH1P3/Asit | lib/requests/packages/urllib3/util/ssl_.py | 484 | 10037 | from binascii import hexlify, unhexlify
from hashlib import md5, sha1, sha256
from ..exceptions import SSLError, InsecurePlatformWarning
SSLContext = None
HAS_SNI = False
create_default_context = None
import errno
import warnings
try: # Test for SSL features
import ssl
from ssl import wrap_socket, CERT_NO... | mit |
ghchinoy/tensorflow | tensorflow/contrib/boosted_trees/lib/learner/batch/categorical_split_handler_test.py | 13 | 25928 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
tellesnobrega/sahara | sahara/tests/unit/utils/openstack/test_base.py | 3 | 10848 | # Copyright (c) 2014 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | apache-2.0 |
googlei18n/language-resources | bn/zero_width.py | 2 | 2661 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2015, 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... | apache-2.0 |
satish-avninetworks/murano | murano_tempest_tests/plugin.py | 3 | 1950 | # Copyright (c) 2015 Mirantis, 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 requir... | apache-2.0 |
sid88in/incubator-airflow | airflow/example_dags/docker_copy_data.py | 17 | 3569 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
LTommy/tommyslab | lib/banner.py | 1 | 1317 | # -*- coding:utf-8 -*-
def print_banner():
print('\n\n***************欢迎使用tommyslab, 请保持在网络畅通的环境下进行实验**************')
print('''
_ _ _
| |_ ___ _ __ ___ _ __ ___ _ _ ___| | __ _| |__
| __/ _ \| '_ ` _ \|... | apache-2.0 |
lhCheung1991/flappybird_cocos2dx_2 | cocos2d/plugin/tools/pluginx-bindings-generator/genbindings-lua.py | 130 | 7752 | #!/usr/bin/python
# This script is used to generate luabinding glue codes.
# Android ndk version must be ndk-r9b.
import sys
import os, os.path
import shutil
import ConfigParser
import subprocess
import re
from contextlib import contextmanager
import shutil
import yaml
import tempfile
def _check_ndk_root_env():
... | mit |
ByteInternet/python-social-auth | social/backends/uber.py | 33 | 1390 | """
Uber OAuth2 backend, docs at:
http://psa.matiasaguirre.net/docs/backends/uber.html
"""
from social.backends.oauth import BaseOAuth2
class UberOAuth2(BaseOAuth2):
name = 'uber'
ID_KEY='uuid'
SCOPE_SEPARATOR = ' '
AUTHORIZATION_URL = 'https://login.uber.com/oauth/authorize'
ACCESS_TOKEN_URL ... | bsd-3-clause |
atlassian/boto | tests/unit/glacier/test_concurrent.py | 88 | 7261 | #!/usr/bin/env python
# Copyright (c) 2012 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 ... | mit |
ojengwa/sympy | sympy/core/tests/test_evalf.py | 2 | 16286 | from sympy import (Add, ceiling, cos, E, Eq, exp, factorial, fibonacci, floor,
Function, GoldenRatio, I, log, Mul, oo, pi, Pow, Rational,
sin, sqrt, sstr, Sum, sympify, S, integrate, atan, product)
from sympy.core.evalf import complex_accuracy, PrecisionExhausted, scaled_zero
from ... | bsd-3-clause |
wnt-zhp/hufce | django/contrib/localflavor/cn/forms.py | 89 | 6503 | # -*- coding: utf-8 -*-
"""
Chinese-specific form helpers
"""
from __future__ import absolute_import
import re
from django.contrib.localflavor.cn.cn_provinces import CN_PROVINCE_CHOICES
from django.forms import ValidationError
from django.forms.fields import CharField, RegexField, Select
from django.utils.translatio... | gpl-3.0 |
AndroidOpenDevelopment/android_external_chromium_org | net/tools/tld_cleanup/PRESUBMIT.py | 75 | 1117 | # 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.
"""Chromium presubmit script for src/net/tools/tld_cleanup."""
def _RunMakeDafsaTests(input_api, output_api):
"""Runs unittest for make_dafsa if any rel... | bsd-3-clause |
maxalbert/bokeh | bokeh/server/views/autoload_js_handler.py | 2 | 1557 | ''' Provide a request handler that returns a page displaying a document.
'''
from __future__ import absolute_import, print_function
import logging
log = logging.getLogger(__name__)
from tornado.web import RequestHandler
from bokeh.templates import AUTOLOAD_JS
from bokeh.util.string import encode_utf8
class Autoloa... | bsd-3-clause |
andyxhadji/incubator-airflow | airflow/contrib/operators/gcs_to_s3.py | 3 | 5260 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
baberthal/CouchPotatoServer | couchpotato/core/notifications/growl.py | 65 | 3163 | import traceback
from couchpotato.core.event import fireEvent, addEvent
from couchpotato.core.logger import CPLog
from couchpotato.core.notifications.base import Notification
from couchpotato.environment import Env
from gntp import notifier
log = CPLog(__name__)
autoload = 'Growl'
class Growl(Notification):
... | gpl-3.0 |
zero-rp/miniblink49 | third_party/WebKit/Source/build/scripts/make_style_shorthands.py | 65 | 3163 | #!/usr/bin/env python
# Copyright (C) 2013 Intel Corporation. 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, thi... | apache-2.0 |
axilleas/ansible | lib/ansible/plugins/inventory/ini.py | 90 | 2220 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
enkiv2/popcorn_maker | vendor-local/lib/python/html5lib/tests/tokenizertotree.py | 72 | 1909 | import sys
import os
import json
import re
import html5lib
import support
import test_parser
import test_tokenizer
p = html5lib.HTMLParser()
unnamespaceExpected = re.compile(r"^(\|\s*)<html ([^>]+)>", re.M).sub
def main(out_path):
if not os.path.exists(out_path):
sys.stderr.write("Path %s does not exist... | bsd-3-clause |
hubert667/AIR | build/celery/celery/tests/contrib/test_rdb.py | 2 | 2943 | from __future__ import absolute_import
import errno
import socket
from celery.contrib.rdb import (
Rdb,
debugger,
set_trace,
)
from celery.tests.case import Case, Mock, WhateverIO, patch, skip_if_pypy
class SockErr(socket.error):
errno = None
class test_Rdb(Case):
@patch('celery.contrib.rdb.R... | gpl-3.0 |
hassoon3/odoo | addons/base_report_designer/plugin/openerp_report_designer/bin/script/ConvertBracesToField.py | 384 | 12556 | #########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gene... | agpl-3.0 |
eeshangarg/oh-mainline | vendor/packages/python-social-auth/social/backends/github.py | 17 | 3762 | """
Github OAuth2 backend, docs at:
http://psa.matiasaguirre.net/docs/backends/github.html
"""
from requests import HTTPError
from social.exceptions import AuthFailed
from social.backends.oauth import BaseOAuth2
class GithubOAuth2(BaseOAuth2):
"""Github OAuth authentication backend"""
name = 'github'
... | agpl-3.0 |
KyleJamesWalker/ansible | lib/ansible/modules/utilities/logic/include_vars.py | 50 | 3943 | # -*- mode: python -*-
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Publ... | gpl-3.0 |
openstack/nova | nova/tests/unit/test_block_device.py | 3 | 38315 | # Copyright 2011 Isaku Yamahata
# 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 |
cdegroc/scikit-learn | doc/sphinxext/numpy_ext/docscrape_sphinx.py | 52 | 8004 | import re
import inspect
import textwrap
import pydoc
import sphinx
from docscrape import NumpyDocString
from docscrape import FunctionDoc
from docscrape import ClassDoc
class SphinxDocString(NumpyDocString):
def __init__(self, docstring, config=None):
config = {} if config is None else config
sel... | bsd-3-clause |
bixbydev/Bixby | google/gdata-2.0.18/build/lib.linux-x86_64-2.7/gdata/tlslite/utils/codec.py | 361 | 2771 | """Classes for reading/writing binary data (such as TLS records)."""
from compat import *
class Writer:
def __init__(self, length=0):
#If length is zero, then this is just a "trial run" to determine length
self.index = 0
self.bytes = createByteArrayZeros(length)
def add(self, x, lengt... | gpl-3.0 |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/structured/labs/serving/application/lib/googleapiclient/http.py | 16 | 57329 | # Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | apache-2.0 |
cvegaj/ElectriCERT | venv3/lib/python3.6/site-packages/bitcoin/core/serialize.py | 2 | 10477 | # Copyright (C) 2012-2014 The python-bitcoinlib developers
#
# This file is part of python-bitcoinlib.
#
# It is subject to the license terms in the LICENSE file found in the top-level
# directory of this distribution.
#
# No part of python-bitcoinlib, including this file, may be copied, modified,
# propagated, or dist... | gpl-3.0 |
CforED/Machine-Learning | examples/cluster/plot_feature_agglomeration_vs_univariate_selection.py | 87 | 3903 | """
==============================================
Feature agglomeration vs. univariate selection
==============================================
This example compares 2 dimensionality reduction strategies:
- univariate feature selection with Anova
- feature agglomeration with Ward hierarchical clustering
Both metho... | bsd-3-clause |
xiaoyaozi5566/DiamondCache | tests/configs/realview-o3-checker.py | 14 | 3718 | # Copyright (c) 2011 ARM Limited
# All rights reserved
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality o... | bsd-3-clause |
bblacey/FreeCAD-MacOS-CI | src/Mod/Inspection/Init.py | 58 | 1873 | # FreeCAD init script of the Inspection module
# (c) 2001 Juergen Riegel
#***************************************************************************
#* (c) Juergen Riegel (juergen.riegel@web.de) 2002 *
#* *
#* Thi... | lgpl-2.1 |
christianurich/VIBe2UrbanSim | 3rdparty/opus/src/opus_gui/results_manager/run/indicator_framework/representations/computed_indicator.py | 2 | 3583 | # Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
from opus_core.variables.variable_name import VariableName
import os
from time import strftime, localtime, time
from opus_gui.results_manager.run.indicator_framework.utilities.indicator_data_m... | gpl-2.0 |
pixelgremlins/ztruck | dj/lib/python2.7/site-packages/django/utils/synch.py | 586 | 2558 | """
Synchronization primitives:
- reader-writer lock (preference to writers)
(Contributed to Django by eugene@lazutkin.com)
"""
import contextlib
import threading
class RWLock(object):
"""
Classic implementation of reader-writer lock with preference to writers.
Readers can access a resource simult... | apache-2.0 |
rovere/utilities | stringAtom.py | 1 | 3458 | # Simple patricia tree implementation for a ultra-fast strings.
# Maintains a patricia tree of strings; an individual string is
# just an index into this table.
class Node:
def __init__(self):
self.s = " "
self.maxbit = 0
self.bit = 0
self.kids = []
self.kids.append(0)
... | mit |
jimlawton/pyagc-googlecode | tools/pagecounter.py | 10 | 3378 | #!/usr/bin/env python
# Copyright 2010 Jim lawton <jim dot lawton at gmail dot com>
#
# This file is part of yaAGC.
#
# yaAGC 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, o... | gpl-2.0 |
Gabriel439/pip | pip/_vendor/cachecontrol/controller.py | 317 | 10124 | """
The httplib2 algorithms ported for use with requests.
"""
import re
import calendar
import time
from email.utils import parsedate_tz
from pip._vendor.requests.structures import CaseInsensitiveDict
from .cache import DictCache
from .serialize import Serializer
URI = re.compile(r"^(([^:/?#]+):)?(//([^/?#]*))?([^?... | mit |
miminus/youtube-dl | youtube_dl/extractor/everyonesmixtape.py | 128 | 2872 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_request,
)
from ..utils import (
ExtractorError,
)
class EveryonesMixtapeIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?everyonesmixtape\.com/#/mix/(?P<id>[0-9a-zA-Z]+)(?:/(?P<s... | unlicense |
x111ong/odoo | openerp/addons/base/tests/test_ir_filters.py | 285 | 11000 | # -*- coding: utf-8 -*-
import functools
from openerp import exceptions
from openerp.tests import common
def noid(d):
""" Removes values that are not relevant for the test comparisons """
d.pop('id', None)
d.pop('action_id', None)
return d
class FiltersCase(common.TransactionCase):
def build(self... | agpl-3.0 |
hitszxp/scikit-learn | sklearn/kernel_approximation.py | 12 | 16958 | """
The :mod:`sklearn.kernel_approximation` module implements several
approximate kernel feature maps base on Fourier transforms.
"""
# Author: Andreas Mueller <amueller@ais.uni-bonn.de>
#
# License: BSD 3 clause
import warnings
import numpy as np
import scipy.sparse as sp
from scipy.linalg import svd
from .base im... | bsd-3-clause |
freedomtan/workload-automation | wlauto/instrumentation/trace_cmd/__init__.py | 2 | 16185 | # Copyright 2013-2015 ARM Limited
#
# 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 w... | apache-2.0 |
jgmanzanas/CMNT_004_15 | project-addons/sale_customer_discount/__openerp__.py | 1 | 1743 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2004-2014 Pexego Sistemas Informáticos All Rights Reserved
# $Marta Vázquez Rodríguez$ <marta@pexego.es>
#
# This program is free software: you can redistribute it and/or modify
# it unde... | agpl-3.0 |
n0max/servo | tests/wpt/css-tests/tools/html5lib/html5lib/ihatexml.py | 1727 | 16581 | from __future__ import absolute_import, division, unicode_literals
import re
import warnings
from .constants import DataLossWarning
baseChar = """
[#x0041-#x005A] | [#x0061-#x007A] | [#x00C0-#x00D6] | [#x00D8-#x00F6] |
[#x00F8-#x00FF] | [#x0100-#x0131] | [#x0134-#x013E] | [#x0141-#x0148] |
[#x014A-#x017E] | [#x0180-... | mpl-2.0 |
sffjunkie/home-assistant | homeassistant/components/switch/mysensors.py | 2 | 3027 | """
Support for MySensors switches.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.mysensors/
"""
import logging
from homeassistant.components import mysensors
from homeassistant.components.switch import SwitchDevice
from homeassistant.const impo... | mit |
olasitarska/django | tests/generic_views/urls.py | 7 | 13621 | from django.conf.urls import url
from django.contrib.auth import views as auth_views
from django.views.decorators.cache import cache_page
from django.views.generic import TemplateView
from . import models
from . import views
urlpatterns = [
# TemplateView
url(r'^template/no_template/$',
TemplateView.... | bsd-3-clause |
HunterUSF/Quandles | cohomology_calculation/torsioncounter.py | 1 | 4826 | ##############################################################################
### This programs checks the row reduced
### cocycle matrix to see if there are any torsion elemenets.
###
### Version 2 uses update rowReduce function, where z does not need
### to be specified.
###
########################################... | gpl-3.0 |
rtindru/django | django/db/backends/postgresql_psycopg2/introspection.py | 326 | 10060 | from __future__ import unicode_literals
from collections import namedtuple
from django.db.backends.base.introspection import (
BaseDatabaseIntrospection, FieldInfo, TableInfo,
)
from django.utils.encoding import force_text
FieldInfo = namedtuple('FieldInfo', FieldInfo._fields + ('default',))
class DatabaseIntr... | bsd-3-clause |
auready/django | tests/flatpages_tests/test_forms.py | 4 | 4487 | from django.conf import settings
from django.contrib.flatpages.forms import FlatpageForm
from django.contrib.flatpages.models import FlatPage
from django.contrib.sites.models import Site
from django.test import TestCase, modify_settings, override_settings
from django.utils import translation
@modify_settings(INSTALLE... | bsd-3-clause |
joshuajan/odoo | openerp/tools/parse_version.py | 380 | 4462 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
albertomurillo/ansible | lib/ansible/modules/network/nxos/nxos_vtp_domain.py | 15 | 6126 | #!/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 distribut... | gpl-3.0 |
albertomurillo/ansible | lib/ansible/modules/network/avi/avi_httppolicyset.py | 28 | 5426 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses... | gpl-3.0 |
ChrisAntaki/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/user_unittest.py | 124 | 7300 | # Copyright (C) 2010 Research in Motion Ltd. 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 conditio... | bsd-3-clause |
camilonova/mopidy-grooveshark | setup.py | 1 | 1288 | from __future__ import unicode_literals
import re
from setuptools import setup, find_packages
def get_version(filename):
content = open(filename).read()
metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", content))
return metadata['version']
setup(
name='Mopidy-Grooveshark',
version=get_vers... | mit |
eflglobal/class-registry | test/entry_points_test.py | 1 | 3820 | # coding=utf-8
from __future__ import absolute_import, division, print_function, \
unicode_literals
from os.path import dirname
from unittest import TestCase
from pkg_resources import iter_entry_points, working_set
from class_registry import EntryPointClassRegistry, RegistryKeyError
from test import Bulbasaur, C... | mit |
onedata/helpers | test/integration/webdav_helper_test/webdav_helper_test.py | 1 | 7184 | """This module tests WebDAV helper."""
__author__ = "Bartek Kryza"
__copyright__ = """(C) 2018 ACK CYFRONET AGH,
This software is released under the MIT license cited in 'LICENSE.txt'."""
import os
import sys
import time
import subprocess
from os.path import expanduser
from urlparse import urlparse
import pytest
sc... | mit |
dushu1203/chromium.src | chrome/test/ispy/ispy_api_unittest.py | 100 | 2835 | #!/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 json
import unittest
from PIL import Image
import ispy_api
from common import cloud_bucket
from common import mock_cloud_buck... | bsd-3-clause |
ewindisch/nova | nova/tests/network/test_neutronv2.py | 1 | 98798 | # Copyright 2012 OpenStack Foundation
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | apache-2.0 |
Vixionar/django | tests/generic_relations/models.py | 188 | 4327 | """
Generic relations
Generic relations let an object have a foreign key to any object through a
content-type/object-id field. A ``GenericForeignKey`` field can point to any
object, be it animal, vegetable, or mineral.
The canonical example is tags (although this example implementation is *far*
from complete).
"""
f... | bsd-3-clause |
tylert/chirp.hg | chirp/drivers/kguv9dplus.py | 1 | 65862 | # Copyright 2018 Jim Lieb <lieb@sea-troll.net>
#
# Driver for Wouxon KG-UV9D Plus
#
# Borrowed from other chirp drivers, especially the KG-UV8D Plus
# by Krystian Struzik <toner_82@tlen.pl>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as... | gpl-3.0 |
stxnext-kindergarten/presence-analyzer-przemekmazurek | bootstrap.py | 299 | 5686 | ##############################################################################
#
# Copyright (c) 2006 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | mit |
feincms/feincms-links | feincms_links/models.py | 1 | 2131 | from django.db import models
from django.template.loader import render_to_string
from django.utils.translation import ugettext_lazy as _
from feincms.module.page.models import Page
from feincms.admin.item_editor import FeinCMSInline
class Category(models.Model):
name = models.CharField(_('name'), max_length=100)... | bsd-3-clause |
gchp/django | tests/delete/tests.py | 10 | 19299 | from __future__ import unicode_literals
from math import ceil
from django.db import IntegrityError, connection, models
from django.db.models.sql.constants import GET_ITERATOR_CHUNK_SIZE
from django.test import TestCase, skipIfDBFeature, skipUnlessDBFeature
from django.utils.six.moves import range
from .models import... | bsd-3-clause |
ArthurGarnier/SickRage | lib/feedparser/sgml.py | 21 | 2683 | from __future__ import absolute_import
import re
__all__ = [
'_SGML_AVAILABLE',
'sgmllib',
'charref',
'tagfind',
'attrfind',
'entityref',
'incomplete',
'interesting',
'shorttag',
'shorttagopen',
'starttagopen',
'endbracket',
]
# sgmllib is not available by default in P... | gpl-3.0 |
mszewczy/odoo | addons/account/project/project.py | 273 | 2423 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
WhySoGeeky/DroidPot | venv/lib/python2.7/site-packages/django/contrib/auth/urls.py | 568 | 1036 | # The views used below are normally mapped in django.contrib.admin.urls.py
# This URLs file is used to provide a reliable view deployment for test purposes.
# It is also provided as a convenience to those who want to deploy these URLs
# elsewhere.
from django.conf.urls import url
from django.contrib.auth import views
... | mit |
ESOedX/edx-platform | common/djangoapps/util/tests/test_organizations_helpers.py | 2 | 3116 | """
Tests for the organizations helpers library, which is the integration point for the edx-organizations API
"""
from __future__ import absolute_import
import six
from mock import patch
from util import organizations_helpers
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulest... | agpl-3.0 |
chiefspace/udemy-rest-api | udemy_rest_api_section4/env/lib/python3.4/site-packages/setuptools/dist.py | 148 | 32599 | __all__ = ['Distribution']
import re
import os
import sys
import warnings
import distutils.log
import distutils.core
import distutils.cmd
from distutils.core import Distribution as _Distribution
from distutils.errors import (DistutilsOptionError, DistutilsPlatformError,
DistutilsSetupError)
from setuptools.depend... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.