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 |
|---|---|---|---|---|---|
nugget/home-assistant | homeassistant/components/modbus/climate.py | 2 | 5083 | """Support for Generic Modbus Thermostats."""
import logging
import struct
import voluptuous as vol
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateDevice
from homeassistant.components.climate.const import SUPPORT_TARGET_TEMPERATURE
from homeassistant.components.modbus import (
CONF_HUB, DEFA... | apache-2.0 |
balazssimon/ml-playground | udemy/lazyprogrammer/deep-reinforcement-learning-python/mountaincar/q_learning.py | 1 | 6102 | # This takes 4min 30s to run in Python 2.7
# But only 1min 30s to run in Python 3.5!
#
# Note: gym changed from version 0.7.3 to 0.8.0
# MountainCar episode length is capped at 200 in later versions.
# This means your agent can't learn as much in the earlier episodes
# since they are no longer as long.
import gym
impo... | apache-2.0 |
dlcwshi/p2pool-feathercoin | nattraverso/utils.py | 288 | 1563 | """
Various utility functions used in the nattraverso package.
@author: Raphael Slinckx
@copyright: Copyright 2005
@license: LGPL
@contact: U{raphael@slinckx.net<mailto:raphael@slinckx.net>}
@version: 0.1.0
"""
__revision__ = "$id"
def is_rfc1918_ip(ip):
"""
Checks if the given ip address is a rfc1918 one.
... | gpl-3.0 |
dimas-lex/osbb | osb/osb/billing/testing/AccountsServiceTest.py | 1 | 2043 | # -*- coding: utf-8 -*-
from django.test import TestCase
from osb.billing.models import Accounts, Services
# from osb.billing.Services.AccountsService import AccountsService
from osb.billing.Services.AccountsService import AccountsService
from osb.billing.Services.ServiceService import *
class AccountsServiceTest(Tes... | gpl-2.0 |
citrix-openstack-build/python-keystoneclient | keystoneclient/openstack/common/py3kcompat/urlutils.py | 11 | 1352 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 Canonical Ltd.
# 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... | apache-2.0 |
jmollan/support-tools | googlecode-issues-exporter/issues.py | 18 | 32921 | # 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 a... | apache-2.0 |
onesafe/multivimdriver-vmware-vio | vio/vio/swagger/views/swagger_json.py | 2 | 4037 | # Copyright (c) 2017 VMware, 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 wr... | apache-2.0 |
marcoantoniooliveira/labweb | oscar/lib/python2.7/site-packages/IPython/nbconvert/transformers/base.py | 2 | 3787 | """
Module that re-groups transformer that would be applied to ipynb files
before going through the templating machinery.
It exposes a convenient class to inherit from to access configurability.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013, the IPython Develop... | bsd-3-clause |
FAForever/faftools | parseudp/FAPacket.py | 1 | 10060 | #!/usr/bin/env python
import sys
import struct
import binascii
import string
import argparse
import zlib
from curses import ascii
# expects tshark on stdin as in:
# tshark -r game.pcap -R 'ip.addr==192.168.0.101' -T fields -d udp.port==6112,echo -e ip.src -e udp.srcport -e ip.dst -e udp.dstport -e frame.time_relative... | gpl-3.0 |
mpercich/Calendarize | ios/dateparser/lib/python2.7/site-packages/ruamel/yaml/loader.py | 1 | 2063 | # coding: utf-8
from __future__ import absolute_import
from ruamel.yaml.reader import Reader
from ruamel.yaml.scanner import Scanner, RoundTripScanner
from ruamel.yaml.parser import Parser, RoundTripParser
from ruamel.yaml.composer import Composer
from ruamel.yaml.constructor import BaseConstructor, SafeConstructor, ... | mit |
darktears/chromium-crosswalk | build/android/devil/android/tools/screenshot.py | 10 | 1852 | #!/usr/bin/env python
# Copyright 2015 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.
"""Takes a screenshot from an Android device."""
import argparse
import logging
import os
import sys
if __name__ == '__main__':
sys... | bsd-3-clause |
isotoma/django-cms | cms/tests/navextender.py | 2 | 3596 | # -*- coding: utf-8 -*-
from __future__ import with_statement
from cms.models import Page
from cms.test_utils.fixtures.navextenders import NavextendersFixture
from cms.test_utils.testcases import SettingsOverrideTestCase
from cms.test_utils.util.menu_extender import TestMenu
from django.conf import settings
from django... | bsd-3-clause |
metabrainz/listenbrainz-server | messybrainz/webserver/views/api.py | 3 | 1712 | import ujson
from flask import Blueprint, request, Response
from messybrainz.webserver.decorators import crossdomain, ip_filter
from werkzeug.exceptions import BadRequest, NotFound
import messybrainz
import messybrainz.db.exceptions
import ujson
api_bp = Blueprint('api', __name__)
def ujsonify(*args, **kwargs):
... | gpl-2.0 |
benghaem/py-senmolib | senmolib/pipeline/processor.py | 2 | 5495 | import subprocess
import zmq as zmq
import time
class Processor(object):
"""Processor launches real processes and configures data flow between processing and fusion components.
Processor is useful when one would like to use a mix of senmo components that may be implemented across languages. If one is using componen... | mit |
uraxy/qiidly | qiidly/command_line.py | 1 | 2094 | # -*- coding: utf-8 -*-
"""dummy docstring."""
import argparse
from qiidly import __version__, __description__
from qiidly.main import Qiidly
def _arg_parser():
parser = argparse.ArgumentParser(
prog='qiidly',
description=__description__)
parser.add_argument('-V', '--version',
... | mit |
oneklc/dimod | dimod/views/bqm.py | 1 | 6577 | # Copyright 2018 D-Wave Systems 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... | apache-2.0 |
gorjuce/odoo | addons/base_report_designer/plugin/openerp_report_designer/bin/script/SendToServer.py | 293 | 10562 | #########################################################################
#
# 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 |
handroissuazo/tensorflow | venv/lib/python2.7/site-packages/pip/_vendor/html5lib/treeadapters/sax.py | 1835 | 1661 | from __future__ import absolute_import, division, unicode_literals
from xml.sax.xmlreader import AttributesNSImpl
from ..constants import adjustForeignAttributes, unadjustForeignAttributes
prefix_mapping = {}
for prefix, localName, namespace in adjustForeignAttributes.values():
if prefix is not None:
pre... | apache-2.0 |
CVML/pybrain | pybrain/supervised/knn/lsh/nearoptimal.py | 25 | 6466 |
"""This module provides functionality for locality sensitive hashing in high
dimensional euclidean spaces.
It is based on the work of Andoni and Indyk, 'Near-Optimal Hashing Algorithms
for Approximate Nearest Neighbor in High Dimensions'."""
__author__ = 'Justin Bayer, bayer.justin@googlemail.com'
import logging... | bsd-3-clause |
midonet/python-neutron-plugin-midonet | midonet/neutron/extensions/port.py | 3 | 6430 | # Copyright (C) 2014 Midokura SARL
# 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... | apache-2.0 |
shubhamgupta123/erpnext | erpnext/manufacturing/doctype/blanket_order/test_blanket_order.py | 13 | 2528 | # -*- coding: utf-8 -*-
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from frappe.utils import add_months, today
from erpnext import get_company_currency
from .blanket_order import make_sales_order, make_purc... | gpl-3.0 |
51reboot/actual_09_homework | 08/zhaoyong/cmdb/userdb.py | 1 | 5201 | #encoding: utf-8
import json
import gconf
import MySQLdb
from dbutils import execute_fetch_sql
from dbutils import execute_commit_sql
'''
获取用户信息
'''
def get_users():
_columns = ('id','username','password','age')
_sql = 'select * from user'
_count,_rt_list = execute_fetch_sql(_sql)
_rt = []
for _l... | mit |
annoviko/pyclustering | pyclustering/core/tests/ut_package.py | 1 | 4514 | """!
@brief Unit-tests for pyclustering package that is used for exchange between ccore library and python code.
@authors Andrei Novikov (pyclustering@yandex.ru)
@date 2014-2020
@copyright BSD-3-Clause
"""
import unittest
import numpy
from pyclustering.core.pyclustering_package import package_builder, package_ex... | gpl-3.0 |
derdewey/mongrel2 | examples/bbs/client.py | 96 | 1033 | #!/usr/bin/env python
import sys
import socket
import json
from base64 import b64decode
try:
import json
except:
import simplejson as json
import getpass
host = sys.argv[1]
port = int(sys.argv[2])
def read_msg():
reply = ""
ch = CONN.recv(1)
while ch != '\0':
repl... | bsd-3-clause |
annarev/tensorflow | tensorflow/python/framework/versions_test.py | 14 | 2056 | # Copyright 2015 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 |
boudewijnrempt/kura | doc/script5.py | 1 | 3804 | import os.path, sys, string, codecs
from kuralib import kuraapp
from kuragui.guiconfig import guiConf
from kuragui import guiconfig
False = 0
True = 1
def splitCSVLine(line):
"""Splits a CSV-formatted line into a list.
See: http://www.colorstudy.com/software/webware/
"""
list = []
position = 0
... | bsd-2-clause |
elric/virtaal-debian | virtaal/plugins/spellchecker.py | 1 | 13888 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2010-2011 Zuza Software Foundation
#
# This file is part of Virtaal.
#
# 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 ... | gpl-2.0 |
endlessm/chromium-browser | third_party/catapult/dashboard/dashboard/common/request_handler.py | 1 | 4410 | # Copyright 2015 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.
"""Simple Request handler using Jinja2 templates."""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_im... | bsd-3-clause |
ikben/troposphere | troposphere/cloudtrail.py | 4 | 1110 | from . import AWSObject, Tags, AWSProperty
from .validators import boolean
class DataResource(AWSProperty):
props = {
'Type': (basestring, True),
'Values': ([basestring], False),
}
class EventSelector(AWSProperty):
props = {
'DataResources': ([DataResource], False),
'Incl... | bsd-2-clause |
simbs/edx-platform | common/djangoapps/util/views.py | 1 | 13657 | import json
import logging
import sys
from functools import wraps
from django.conf import settings
from django.core.cache import caches
from django.core.validators import ValidationError, validate_email
from django.views.decorators.csrf import requires_csrf_token
from django.views.defaults import server_error
from dja... | agpl-3.0 |
mmrose/pygal | pygal/test/test_colors.py | 6 | 22024 | # -*- coding: utf-8 -*-
# This file is part of pygal
#
# A python svg graph plotting library
# Copyright © 2012-2015 Kozea
#
# This library is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation, either version... | lgpl-3.0 |
EnviroCentre/jython-upgrade | jython/lib/site-packages/pkg_resources/_vendor/packaging/_structures.py | 906 | 1809 | # Copyright 2014 Donald Stufft
#
# 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, so... | mit |
solashirai/edx-platform | lms/djangoapps/course_blocks/transformers/user_partitions.py | 13 | 10294 | """
User Partitions Transformer
"""
from openedx.core.lib.block_structure.transformer import BlockStructureTransformer
from .split_test import SplitTestTransformer
from .utils import get_field_on_block
class UserPartitionTransformer(BlockStructureTransformer):
"""
A transformer that enforces the group access... | agpl-3.0 |
DepthDeluxe/ansible | test/integration/targets/module_utils/library/test.py | 91 | 2819 | #!/usr/bin/python
results = {}
# Test import with no from
import ansible.module_utils.foo0
results['foo0'] = ansible.module_utils.foo0.data
# Test depthful import with no from
import ansible.module_utils.bar0.foo
results['bar0'] = ansible.module_utils.bar0.foo.data
# Test import of module_utils/foo1.py
from ansible... | gpl-3.0 |
duguhaotian/superscp | src/superscp_tool.py | 1 | 2572 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import os
import sys
import subprocess
from pathmanager import node
from pathmanager import link
from pathmanager import paths
from pathmanager import tool
def superscp(argv):
if len(argv) != 5:
usage()
return
src = argv[2]
tip = argv[3]
td... | apache-2.0 |
Workday/OpenFrame | tools/telemetry/third_party/gsutilz/gslib/addlhelp/anon.py | 28 | 1856 | # -*- coding: utf-8 -*-
# Copyright 2012 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 require... | bsd-3-clause |
appsembler/edx-platform | openedx/core/djangoapps/appsembler/sites/api.py | 1 | 10738 | import logging
import requests
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from rest_framework import generics, views, viewsets
from rest_framework import status
from rest_framework.generics import CreateAPIView
from rest_framework.parsers i... | agpl-3.0 |
nebril/fuel-web | fuel_upgrade_system/fuel_upgrade/fuel_upgrade/pre_upgrade_hooks/from_5_0_1_to_any_fix_host_system_repo.py | 7 | 2392 | # -*- coding: utf-8 -*-
# Copyright 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 requi... | apache-2.0 |
benspaulding/django | tests/regressiontests/urlpatterns_reverse/namespace_urls.py | 42 | 2458 | from __future__ import absolute_import
from django.conf.urls import patterns, url, include
from .views import view_class_instance
class URLObject(object):
def __init__(self, app_name, namespace):
self.app_name = app_name
self.namespace = namespace
def urls(self):
return patterns('',... | bsd-3-clause |
birocorneliu/conference | lib/to_delete.py | 1 | 2829 | from datetime import datetime
import endpoints
from google.appengine.ext import ndb
from google.appengine.api import taskqueue, memcache
from lib.db import Profile, Conference
from lib.models import ConflictException, ProfileForm, BooleanMessage, ConferenceForm, TeeShirtSize
MEMCACHE_ANNOUNCEMENTS_KEY = "RECENT_ANN... | apache-2.0 |
idea4bsd/idea4bsd | python/testData/inspections/GoogleDocstringParametersInspection/test.py | 40 | 1256 | """ test docstring inspection"""
def foo1(a, b):
"""
Parameters:
a: foo
b: bar
"""
pass
def foo(a, <weak_warning descr="Missing parameter b in docstring">b</weak_warning>, <weak_warning descr="Missing parameter n in docstring">n</weak_warning>):
"""
Parameters:
a: foo
"""
pass
def foo():... | apache-2.0 |
alexanderturner/ansible | lib/ansible/modules/cloud/azure/azure_rm_networkinterface.py | 9 | 25157 | #!/usr/bin/python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.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 Soft... | gpl-3.0 |
saurabhjn76/sympy | sympy/polys/tests/test_polyclasses.py | 93 | 12631 | """Tests for OO layer of several polynomial representations. """
from sympy.polys.polyclasses import DMP, DMF, ANP
from sympy.polys.domains import ZZ, QQ
from sympy.polys.specialpolys import f_polys
from sympy.polys.polyerrors import ExactQuotientFailed
from sympy.core.compatibility import long
from sympy.utilities... | bsd-3-clause |
aWhereAPI/API-Code-Samples | python/header.py | 1 | 7933 | from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from builtins import str
from builtins import bytes
from future import standard_library
standard_library.install_aliases()
from builtins import object
import requests as r... | mit |
RusDavies/ansible-modules-core | cloud/amazon/ec2_vpc_net.py | 88 | 9882 | #!/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 |
bmya/tkobr-addons | tko_l10n_br_point_of_sale_print_cupom_fiscal/account_journal.py | 1 | 1240 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# Thinkopen Brasil
# Copyright (C) Thinkopen Solutions Brasil (<http://www.tkobr.com>).
#
# This ... | agpl-3.0 |
eerwitt/tensorflow | tensorflow/python/framework/gen_docs_combined.py | 17 | 13830 | # Copyright 2015 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 |
xiaolonw/fast-rcnn_flow2 | tools/compress_net.py | 30 | 3804 | #!/usr/bin/env python
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Compress a Fast R-CNN network using truncated... | mit |
TeslaProject/external_chromium_org | chrome/app/PRESUBMIT.py | 80 | 1770 | # Copyright 2013 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.
"""Presubmit script for changes affecting chrome/app/
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the... | bsd-3-clause |
meego-tablet-ux/meego-app-browser | third_party/mesa/MesaLib/src/gallium/tests/graw/fragment-shader/fragment-shader.py | 32 | 7321 | #!/usr/bin/env python
##########################################################################
#
# Copyright 2009 VMware, Inc.
# 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 ... | bsd-3-clause |
Thhhza/XlsxWriter | xlsxwriter/test/comparison/test_repeat04.py | 8 | 1357 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | bsd-2-clause |
dongjoon-hyun/spark | examples/src/main/python/mllib/word2vec.py | 27 | 1789 | #
# 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 |
strazzere/pfp | pfp/native/compat_math.py | 3 | 2377 | #!/usr/bin/env python
# encoding: utf-8
"""
This module of native functions is implemented for
compatability with 010 editor functions. Some of these functions
are nops, some are fully implemented.
"""
import sys
from pfp.native import native
import pfp.fields
# http://www.sweetscape.com/010editor/manual/FuncMath.h... | mit |
clucas111/delineating-linear-elements | Code/clf_preprocessing.py | 1 | 1569 | # -*- coding: utf-8 -*-
"""
@author: Chris Lucas
"""
import numpy as np
import pandas as pd
def merge_dataframes(dfs, key_field_name):
"""
Merges dataframes containing data of one class into one dataframe with
the class in a column.
Parameters
----------
dfs : dict of DataFrames
Dic... | apache-2.0 |
etuna-SBF-kog/Stadsparken | env/lib/python2.7/site-packages/django/contrib/localflavor/pl/pl_administrativeunits.py | 433 | 13194 | # -*- coding: utf-8 -*-
"""
Polish administrative units as in http://pl.wikipedia.org/wiki/Podzia%C5%82_administracyjny_Polski
"""
ADMINISTRATIVE_UNIT_CHOICES = (
('wroclaw', u'Wrocław'),
('jeleniagora', u'Jelenia Góra'),
('legnica', u'Legnica'),
('boleslawiecki', u'bolesławiecki'),
('dzierzoniows... | gpl-3.0 |
praekelt/rapidpro | temba/schedules/migrations/0001_initial.py | 7 | 2320 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.Create... | agpl-3.0 |
petemounce/ansible | lib/ansible/modules/source_control/gitlab_project.py | 38 | 15438 | #!/usr/bin/python
# (c) 2015, Werner Dijkerman (ikben@werner-dijkerman.nl)
#
# 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... | gpl-3.0 |
tmhm/scikit-learn | sklearn/cluster/setup.py | 263 | 1449 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# License: BSD 3 clause
import os
from os.path import join
import numpy
from sklearn._build_utils import get_blas_info
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
cblas_libs, blas_info = ... | bsd-3-clause |
jeffery-do/Vizdoombot | examples/python/scenarios.py | 1 | 2862 | #!/usr/bin/env python
#####################################################################
# This script presents how to run some scenarios.
# Configuration is loaded from "../../examples/config/<SCENARIO_NAME>.cfg" file.
# <episodes> number of episodes are played.
# Random combination of buttons is chosen for every... | mit |
BeATz-UnKNoWN/python-for-android | python3-alpha/python3-src/Lib/pdb.py | 47 | 56534 | #! /usr/bin/env python3
"""
The Python Debugger Pdb
=======================
To use the debugger in its simplest form:
>>> import pdb
>>> pdb.run('<a statement>')
The debugger's prompt is '(Pdb) '. This will stop in the first
function call in <a statement>.
Alternatively, if a statement terminated ... | apache-2.0 |
dannyperry571/theapprentice | script.module.nanscrapers/lib/nanscrapers/scraperplugins/sezonlukdizi.py | 1 | 4411 | import json
import re
import urlparse
import requests
from BeautifulSoup import BeautifulSoup
from nanscrapers.common import random_agent, replaceHTMLCodes
from ..scraper import Scraper
import xbmc
class Sezonluldizi(Scraper):
domains = ['sezonlukdizi.com']
name = "sezonlukdizi"
def __init__(self):
... | gpl-2.0 |
koomik/CouchPotatoServer | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/playvid.py | 19 | 2554 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
compat_urllib_parse,
)
class PlayvidIE(InfoExtractor):
_VALID_URL = r'^https?://www\.playvid\.com/watch(\?v=|/)(?P<id>.+?)(?:#|$)'
_TEST = {
'url': 'http://www.playvid.com/watch/agbDDi7WZTV'... | gpl-3.0 |
hortonworks/hortonworks-sandbox | desktop/core/ext-py/Twisted/doc/web/howto/listings/PicturePile/picturepile.py | 1 | 1917 | """Run this with twistd -y."""
import os
from twisted.application import service, internet
from twisted.web.woven import page
from twisted.web import server, static
rootDirectory = os.path.expanduser("~/Pictures")
class DirectoryListing(page.Page):
templateFile = "directory-listing.html"
templateDirectory ... | apache-2.0 |
kernc/networkx | networkx/algorithms/connectivity/kcomponents.py | 30 | 8208 | # -*- coding: utf-8 -*-
"""
Moody and White algorithm for k-components
"""
from collections import defaultdict
from itertools import combinations
from operator import itemgetter
import networkx as nx
from networkx.utils import not_implemented_for
# Define the default maximum flow function.
from networkx.algorithms.flo... | bsd-3-clause |
HyperBaton/ansible | lib/ansible/modules/cloud/azure/azure_rm_iotdevicemodule.py | 18 | 13431 | #!/usr/bin/python
#
# Copyright (c) 2019 Yuwei Zhou, <yuwzho@microsoft.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
nickpack/django-oscar | src/oscar/apps/analytics/receivers.py | 33 | 3932 | import logging
from django.db.models import F
from django.dispatch import receiver
from django.db import IntegrityError
from oscar.core.loading import get_class, get_classes
from oscar.apps.search.signals import user_search
UserSearch, UserRecord, ProductRecord, UserProductView = get_classes(
'analytics.models',... | bsd-3-clause |
idem2lyon/persomov | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/azubu.py | 143 | 3350 | from __future__ import unicode_literals
import json
from .common import InfoExtractor
from ..utils import float_or_none
class AzubuIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?azubu\.tv/[^/]+#!/play/(?P<id>\d+)'
_TESTS = [
{
'url': 'http://www.azubu.tv/GSL#!/play/15575/2014-hot6-... | gpl-3.0 |
jspargo/AneMo | thermo/flask/lib/python2.7/site-packages/flask/logging.py | 838 | 1398 | # -*- coding: utf-8 -*-
"""
flask.logging
~~~~~~~~~~~~~
Implements the logging support for Flask.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from logging import getLogger, StreamHandler, Formatter, getLoggerClas... | gpl-2.0 |
varunchitre15/thunderzap_tomato | tools/perf/scripts/python/sctop.py | 11180 | 1924 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
abhijeet9920/python_project | develop/lib/python3.4/site-packages/pkg_resources/_vendor/six.py | 2715 | 30098 | """Utilities for writing code that runs on Python 2 and 3"""
# Copyright (c) 2010-2015 Benjamin Peterson
#
# 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 with... | mit |
davidwilson-85/easymap | graphic_output/Pillow-4.2.1/Tests/test_file_icns.py | 1 | 2781 | from helper import unittest, PillowTestCase
from PIL import Image
import sys
# sample icon file
TEST_FILE = "Tests/images/pillow.icns"
enable_jpeg2k = hasattr(Image.core, 'jp2klib_version')
class TestFileIcns(PillowTestCase):
def test_sanity(self):
# Loading this icon by default should result in the ... | gpl-3.0 |
JulienMcJay/eclock | windows/Python27/Lib/site-packages/pip/_vendor/html5lib/treewalkers/_base.py | 169 | 6718 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
import gettext
_ = gettext.gettext
from ..constants import voidElements, spaceCharacters
spaceCharacters = "".join(spaceCharacters)
class TreeWalker(object):
def __init__(self, tree):
self.tree = tre... | gpl-2.0 |
DinoCow/airflow | airflow/providers/amazon/aws/sensors/step_function_execution.py | 5 | 3125 | # 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... | apache-2.0 |
kmad1729/website | django/contrib/sessions/middleware.py | 323 | 1888 | import time
from django.conf import settings
from django.utils.cache import patch_vary_headers
from django.utils.http import cookie_date
from django.utils.importlib import import_module
class SessionMiddleware(object):
def process_request(self, request):
engine = import_module(settings.SESSION_ENGINE)
... | bsd-3-clause |
40223236/40223236-50 | static/Brython3.1.1-20150328-091302/Lib/long_int1/__init__.py | 503 | 3858 | from browser import html, document, window
import javascript
#memorize/cache?
def _get_value(other):
if isinstance(other, LongInt):
return other.value
return other
class BigInt:
def __init__(self):
pass
def __abs__(self):
return LongInt(self.value.abs())
def __add__(self, other):
... | gpl-3.0 |
edry/edx-platform | common/djangoapps/student/cookies.py | 116 | 5305 | """
Utility functions for setting "logged in" cookies used by subdomains.
"""
import time
import json
from django.utils.http import cookie_date
from django.conf import settings
from django.core.urlresolvers import reverse, NoReverseMatch
def set_logged_in_cookies(request, response, user):
"""
Set cookies in... | agpl-3.0 |
felixfontein/ansible | lib/ansible/modules/package.py | 15 | 2823 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Ansible Project
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
module: package
version_added: 2.0
author... | gpl-3.0 |
vighneshbirodkar/scikit-image | skimage/setup.py | 44 | 1484 | import os
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('skimage', parent_package, top_path)
config.add_subpackage('_shared')
config.add_subpackage('color')
config.add_subpackage('data')
config.add_subpackage('... | bsd-3-clause |
duducosmos/pgs4a | python-install/lib/python2.7/ftplib.py | 75 | 35728 | """An FTP client class and some helper functions.
Based on RFC 959: File Transfer Protocol (FTP), by J. Postel and J. Reynolds
Example:
>>> from ftplib import FTP
>>> ftp = FTP('ftp.python.org') # connect to host, default port
>>> ftp.login() # default, i.e.: user anonymous, passwd anonymous@
'230 Guest login ok, ac... | lgpl-2.1 |
xiahei/Daily_scripts | Baidu/baidu_count_login.py | 2 | 4106 | #!/usr/bin/env python
# coding:utf-8
try:
import cookielib
except:
import http.cookiejar as cookielib
import re
import requests
from prettytable import PrettyTable
from bs4 import BeautifulSoup
def get_cookies():
"""获取百度 cookies, 并写入文件."""
headers = {
"User-Agent": (
"Mozilla/5.0 ... | mit |
aljscott/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/thirdparty/ordered_dict.py | 131 | 2984 | # Copyright (c) 2009 Raymond Hettinger.
#
# 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, modify, merge, publish, ... | bsd-3-clause |
richardcs/ansible | lib/ansible/modules/network/avi/avi_systemconfiguration.py | 31 | 6594 | #!/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 |
jmankoff/data | Assignments/jmankoff-mobile/lib/flask/config.py | 781 | 6234 | # -*- coding: utf-8 -*-
"""
flask.config
~~~~~~~~~~~~
Implements the configuration related objects.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import imp
import os
import errno
from werkzeug.utils import import_string
from ._compat import string_type... | gpl-3.0 |
MeteorKepler/RICGA | ricga/ops/image_processing.py | 1 | 8197 | # 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 |
fracting/depot_tools | recipes/naclports.py | 25 | 1198 | # 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 sys
import recipe_util # pylint: disable=F0401
# This class doesn't need an __init__ method, so we disable the warning
# pylint: disable=W0232
cla... | bsd-3-clause |
sparkslabs/kamaelia | Code/Python/Kamaelia/Kamaelia/Apps/SpeakNWrite/Gestures/PreProcessing.py | 3 | 6871 | # -*- 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, Version 2.0 (the "Lic... | apache-2.0 |
NMGRL/pychron | pychron/managers/motion_controller_managers/motion_controller_manager.py | 2 | 7513 | # ===============================================================================
# Copyright 2011 Jake Ross
#
# 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/licens... | apache-2.0 |
arnavd96/Cinemiezer | myvenv/lib/python3.4/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py | 34 | 14419 | from __future__ import unicode_literals
import os
from collections import OrderedDict
from django.apps import apps
from django.contrib.staticfiles.finders import get_finders
from django.contrib.staticfiles.storage import staticfiles_storage
from django.core.files.storage import FileSystemStorage
from django.core.mana... | mit |
MikeLing/shogun | examples/undocumented/python/preprocessor_prunevarsubmean.py | 5 | 1052 | #!/usr/bin/env python
from tools.load import LoadMatrix
lm=LoadMatrix()
traindat = lm.load_numbers('../data/fm_train_real.dat')
testdat = lm.load_numbers('../data/fm_test_real.dat')
parameter_list = [[traindat,testdat,1.5,10],[traindat,testdat,1.5,10]]
def preprocessor_prunevarsubmean (fm_train_real=traindat,fm_test... | gpl-3.0 |
ajnirp/servo | tests/wpt/css-tests/tools/six/documentation/conf.py | 420 | 7015 | # -*- coding: utf-8 -*-
#
# six documentation build configuration file
import os
import sys
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like ... | mpl-2.0 |
MSusik/invenio | invenio/legacy/bibauthorid/general_utils.py | 3 | 18048 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2011 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) a... | gpl-2.0 |
manisandro/QGIS | python/plugins/MetaSearch/link_types.py | 55 | 1923 | # -*- coding: utf-8 -*-
###############################################################################
#
# MetaSearch Catalog Client
#
# Copyright (C) 2014 Tom Kralidis (tomkralidis@gmail.com)
#
# This source is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License... | gpl-2.0 |
loop1024/pymo-global | android/pgs4a-0.9.6/python-install/lib/python2.7/ctypes/test/test_memfunctions.py | 79 | 3251 | import sys
import unittest
from ctypes import *
class MemFunctionsTest(unittest.TestCase):
## def test_overflow(self):
## # string_at and wstring_at must use the Python calling
## # convention (which acquires the GIL and checks the Python
## # error flag). Provoke an error and catch it; see al... | mit |
dparnell/rethinkdb | test/rql_test/connections/http_support/werkzeug/wrappers.py | 146 | 76379 | # -*- coding: utf-8 -*-
"""
werkzeug.wrappers
~~~~~~~~~~~~~~~~~
The wrappers are simple request and response objects which you can
subclass to do whatever you want them to do. The request object contains
the information transmitted by the client (webbrowser) and the response
object contains al... | agpl-3.0 |
Nico60/external_chromium | chrome/common/extensions/docs/examples/apps/hello-python/httplib2/iri2uri.py | 885 | 3850 | """
iri2uri
Converts an IRI to a URI.
"""
__author__ = "Joe Gregorio (joe@bitworking.org)"
__copyright__ = "Copyright 2006, Joe Gregorio"
__contributors__ = []
__version__ = "1.0.0"
__license__ = "MIT"
__history__ = """
"""
import urlparse
# Convert an IRI to a URI following the rules in RFC 3987
#
# The characte... | bsd-3-clause |
tedi3231/openerp | build/lib/openerp/addons/base/ir/workflow/print_instance.py | 27 | 8703 | # -*- 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 |
Kongsea/tensorflow | tensorflow/contrib/seq2seq/python/ops/beam_search_decoder.py | 13 | 31886 | # 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 |
alisonjo2786/old-python-lessons-fork | section_02_(strings)/string_replace.py | 7 | 2273 | # String methods: string.replace()
# string.replace() is similar to the find -> replace feature in Word, Excel, or other office-y type programs
song = "eat, eat, eat, apples and bananas"
# Let's start here:
print "I like to ... {0}".format(song)
# string.replace() lets us replace all instances of one string with a... | mit |
naresh21/synergetics-edx-platform | lms/djangoapps/ccx/tests/test_tasks.py | 59 | 4579 | """
Tests for celery tasks defined in tasks module
"""
from mock_django import mock_signal_receiver
from lms.djangoapps.ccx.tests.factories import CcxFactory
from student.roles import CourseCcxCoachRole
from student.tests.factories import (
AdminFactory,
)
from xmodule.modulestore.django import SignalHandler
from... | agpl-3.0 |
ChiKaLiO/lge-kernel-gproj | arch/ia64/scripts/unwcheck.py | 13143 | 1714 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.