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
Shade5/coala
coalib/bearlib/abstractions/SectionCreatable.py
35
2611
from coalib.settings.FunctionMetadata import FunctionMetadata class SectionCreatable: """ A SectionCreatable is an object that is creatable out of a section object. Thus this is the class for many helper objects provided by the bearlib. If you want to use an object that inherits from this class the f...
agpl-3.0
bitcity/django
tests/inspectdb/tests.py
108
12989
# -*- encoding: utf-8 -*- from __future__ import unicode_literals import re from unittest import skipUnless from django.core.management import call_command from django.db import connection from django.test import TestCase, skipUnlessDBFeature from django.utils.six import PY3, StringIO from .models import ColumnTypes...
bsd-3-clause
JioEducation/edx-platform
cms/djangoapps/contentstore/management/commands/tests/test_git_export.py
66
7362
""" Unittests for exporting to git via management command. """ import copy import os import shutil import StringIO import subprocess import unittest from uuid import uuid4 from django.conf import settings from django.core.management import call_command from django.core.management.base import CommandError from django....
agpl-3.0
mlperf/training_results_v0.5
v0.5.0/google/cloud_v3.8/resnet-tpuv3-8/code/resnet/model/tpu/models/experimental/show_and_tell/inputs.py
5
8012
# 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
fresskarma/tinyos-1.x
contrib/ucb/apps/Monstro/lib/Robot/PickleSocket.py
2
2252
import socket, cPickle, select, threading class Error( Exception ) : pass class Timeout( Error ) : pass class Destroyed( Error ) : pass class PickleSocket( object ) : def __init__( self , socketObject ) : self.__conn = socketObject self.__fd = self.__conn.makefile() ...
bsd-3-clause
RedHatEMEA/demobuilder
layers/rhel-server-7:gui:ose-3.1:offline/@target/registry.access.redhat.com/rhscl/python-27-rhel7/connectionpool.py
16
27175
# urllib3/connectionpool.py # Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import sys import errno import logging from socket import error as SocketError, timeout...
gpl-3.0
CCOSTAN/home-assistant
homeassistant/components/light/hue.py
3
6676
""" homeassistant.components.light.hue ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Support for Hue lights. """ import logging import socket from datetime import timedelta from urllib.parse import urlparse from homeassistant.loader import get_component import homeassistant.util as util from homeassistant.const import CONF_HOST,...
mit
clairetang6/bokeh
bokeh/charts/builders/bar_builder.py
5
12416
"""This is the Bokeh charts interface. It gives you a high level API to build complex plot is a simple way. This is the Bar class which lets you build your Bar charts just passing the arguments to the Chart class and calling the proper functions. It also add a new chained stacked method. """ # ------------------------...
bsd-3-clause
EoD/apitrace
specs/wglapi.py
7
27338
########################################################################## # # Copyright 2008-2010 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 the Software withou...
mit
Balandat/cont_no_regret
old_code/testing.py
1
3136
''' Created on Feb 24, 2015 @author: balandat ''' import numpy as np from scipy.integrate import quad import matplotlib.pyplot as plt from ContNoRegret.Domains import S from ContNoRegret.Distributions import Uniform from ContNoRegret.utils import create_random_Sigmas from ContNoRegret.LossFunctions import GaussianLos...
mit
johnobrien/PyPractice
pipeg/texteditor/Editor.py
8
3736
#!/usr/bin/env python3 # Copyright © 2012-13 Qtrac Ltd. All rights reserved. # This program or module 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 ...
mit
tesidroni/mp
Lib/xmlrpclib.py
76
51242
# # XML-RPC CLIENT LIBRARY # $Id$ # # an XML-RPC client interface for Python. # # the marshalling and response parser code can also be used to # implement XML-RPC servers. # # Notes: # this version is designed to work with Python 2.1 or newer. # # History: # 1999-01-14 fl Created # 1999-01-15 fl Changed dateTime to u...
gpl-3.0
sovietspy2/uzletiProject
python/Lib/threading.py
3
32349
"""Thread module emulating a subset of Java's threading model.""" import sys as _sys try: import thread except ImportError: del _sys.modules[__name__] raise import warnings from functools import wraps from time import time as _time, sleep as _sleep from traceback import format_exc as _form...
gpl-3.0
mjudsp/Tsallis
examples/preprocessing/plot_robust_scaling.py
85
2698
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Robust Scaling on Toy Data ========================================================= Making sure that each Feature has approximately the same scale can be a crucial preprocessing step. However, when data contains o...
bsd-3-clause
abdoosh00/edx-rtl-final
common/djangoapps/student/migrations/0013_auto__chg_field_userprofile_meta.py
188
10346
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'UserProfile.meta' db.alter_column('auth_userprofile', 'meta', self.gf('django.db.models.f...
agpl-3.0
ThinkingBridge/platform_external_chromium_org
third_party/tlslite/tlslite/utils/Cryptlib_AES.py
359
1364
"""Cryptlib AES implementation.""" from cryptomath import * from AES import * if cryptlibpyLoaded: def new(key, mode, IV): return Cryptlib_AES(key, mode, IV) class Cryptlib_AES(AES): def __init__(self, key, mode, IV): AES.__init__(self, key, mode, IV, "cryptlib") sel...
bsd-3-clause
rajive/mongrel2
examples/python/mongrel2/config/model.py
92
7490
from storm.locals import * database = None store = None TABLES = ["server", "host", "route", "proxy", "directory", "handler", "setting"] def load_db(spec): global database global store if not store: database = create_database(spec) store = Store(database) return st...
bsd-3-clause
maxprais/psoriassist
psoriassist/models.py
1
4403
from __future__ import unicode_literals from django.db import models from django.contrib.auth.models import User from datetime import datetime class AppUser(models.Model): user = models.OneToOneField(User) age = models.IntegerField(null=True) birthday = models.DateField(null=True) profile_pi...
mit
jamespcole/home-assistant
tests/auth/mfa_modules/test_insecure_example.py
15
4914
"""Test the example module auth module.""" from homeassistant import auth, data_entry_flow from homeassistant.auth.mfa_modules import auth_mfa_module_from_config from homeassistant.auth.models import Credentials from tests.common import MockUser async def test_validate(hass): """Test validating pin.""" auth_m...
apache-2.0
travisdoor/ArgosRts
engine/thirdparty/yaml-cpp/test/gmock-1.7.0/scripts/generator/cpp/keywords.py
1157
2004
#!/usr/bin/env python # # Copyright 2007 Neal Norwitz # Portions Copyright 2007 Google 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...
mit
ianstalk/Flexget
flexget/plugins/clients/rtorrent.py
1
25708
import os import re import socket from io import BytesIO from time import sleep from urllib.parse import urljoin, urlparse, urlsplit from xmlrpc import client as xmlrpc_client from loguru import logger from requests.auth import HTTPBasicAuth, HTTPDigestAuth from flexget import plugin from flexget.config_schema import...
mit
kissmetrics/spark
python/pyspark/broadcast.py
24
4706
# # 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
ZhangXinNan/tensorflow
tensorflow/python/ops/math_ops_test.py
1
18593
# 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
sankroh/satchmo
satchmo/payment/config.py
2
5009
from django.conf import settings from django.utils.translation import ugettext_lazy, ugettext from satchmo.configuration import * from satchmo.shop import get_satchmo_setting from satchmo.utils import is_string_like, load_module import logging import signals _ = ugettext_lazy log = logging.getLogger('payment.config')...
bsd-3-clause
ShyamSS-95/Bolt
example_problems/nonrelativistic_boltzmann/instabilities/KH/hydrodynamic/lecoanet_paper_setup/initialize.py
2
1045
""" Functions which are used in assigning the I.C's to the system. """ import arrayfire as af import numpy as np def initialize_f(q1, q2, p1, p2, p3, params): m = params.mass_particle k = params.boltzmann_constant q2_minus = 0.5 q2_plus = 1.5 regulator = 20 # larger value makes the transition...
gpl-3.0
oswalpalash/remoteusermgmt
RUM/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.py
1724
14031
"""Module for supporting the lxml.etree library. The idea here is to use as much of the native library as possible, without using fragile hacks like custom element names that break between releases. The downside of this is that we cannot represent all possible trees; specifically the following are known to cause proble...
mit
ncliam/serverpos
openerp/addons/l10n_cl/__init__.py
2120
1456
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2011 Cubic ERP - Teradata SAC. (http://cubicerp.com). # # WARNING: This program as such is intended to be used by professional # programmers who take t...
agpl-3.0
saketkc/statsmodels
statsmodels/examples/ex_sandwich3.py
34
1967
# -*- coding: utf-8 -*- """Cluster Robust Standard Errors with Two Clusters Created on Sat Dec 17 08:39:16 2011 Author: Josef Perktold """ from statsmodels.compat.python import urlretrieve import numpy as np from numpy.testing import assert_almost_equal import statsmodels.api as sm import statsmodels.stats.sandwich...
bsd-3-clause
Kongsea/tensorflow
tensorflow/python/data/kernel_tests/dataset_from_generator_op_test.py
22
11513
# 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
luis-rr/saga-python
tests/heisenbug.py
5
5831
import os import sys import time import logging import uuid import saga import pilot import traceback #------------------------------------------------------------------------------ # Redis password and eThread secret key details aquired from the environment COORD = os.environ.get('COORDINATION_URL') ACCESS_KEY_ID =...
mit
mmalecki/node-gyp
gyp/test/lib/TestCommon.py
307
21397
""" TestCommon.py: a testing framework for commands and scripts with commonly useful error handling The TestCommon module provides a simple, high-level interface for writing tests of executable commands and scripts, especially commands and scripts that interact with the file system. All methods throw...
mit
fuchsia-mirror/third_party-xi-editor
rust/unicode/tools/mk_tables.py
2
12878
#!/usr/bin/env python # Copyright 2016 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 ...
apache-2.0
rec/grit
grit/command/Version.py
1
1631
from __future__ import absolute_import, division, print_function, unicode_literals import os import re import semver VERSION = re.compile(r'\d+\.\d+\.\d+(?:-\w\d*)') from grit.Args import ARGS from grit import ChangeLog from grit import CommandList from grit import File from grit import Git from grit import GitRoot ...
artistic-2.0
encbladexp/ansible
test/sanity/code-smell/rstcheck.py
18
1623
#!/usr/bin/env python """Sanity test using rstcheck and sphinx.""" from __future__ import (absolute_import, division, print_function) __metaclass__ = type import re import subprocess import sys def main(): paths = sys.argv[1:] or sys.stdin.read().splitlines() encoding = 'utf-8' ignore_substitutions = (...
gpl-3.0
shusenl/scikit-learn
benchmarks/bench_plot_parallel_pairwise.py
297
1247
# Author: Mathieu Blondel <mathieu@mblondel.org> # License: BSD 3 clause import time import pylab as pl from sklearn.utils import check_random_state from sklearn.metrics.pairwise import pairwise_distances from sklearn.metrics.pairwise import pairwise_kernels def plot(func): random_state = check_random_state(0) ...
bsd-3-clause
lepistone/odoo
addons/crm_partner_assign/wizard/__init__.py
389
1038
# -*- 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
m11s/MissionPlanner
Lib/site-packages/scipy/linalg/tests/test_special_matrices.py
55
8317
"""Tests for functions in special_matrices.py.""" from numpy import arange, add, array, eye, copy from numpy.testing import TestCase, run_module_suite, assert_raises, \ assert_equal, assert_array_equal from scipy.linalg import toeplitz, hankel, circulant, hadamard, leslie, \ companion,...
gpl-3.0
lukedeo/cross-domain
data_analysis.py
1
7237
""" Functions to get insight into the data """ import sys import pickle # # Categories anaylisis of all the amazon data # # Number of products: 2498330 # Multilabel elements: 888864 # Percentage of products with a given category # ============================================ # Collectibles: 0.000273 # Music: 0.024316...
gpl-2.0
CookiesandCake/namebench
nb_third_party/dns/edns.py
248
4312
# Copyright (C) 2009 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 "AS IS" AND NOMIN...
apache-2.0
garbled1/ansible
lib/ansible/modules/database/mysql/mysql_user.py
25
23795
#!/usr/bin/python # (c) 2012, Mark Theunissen <mark.theunissen@gmail.com> # Sponsored by Four Kitchens http://fourkitchens.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_M...
gpl-3.0
industryjhr/sift_app
sift/concerts/utils.py
2
2417
""" concerts/utils.py Misc. utility functions for the concerts app: * get_spotify_id * make_artist_regex """ import logging, os from .scrapers import ( emptybottle, bottomlounge, subterranean, doubledoor, houseofblues, thaliahall, metro, lincolnhall, schubas, ) logger = logging....
mit
e-democracy/edemsignups
lib/atom/__init__.py
112
49318
#!/usr/bin/python # # Copyright (C) 2006 Google 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 ...
gpl-3.0
torufuru/oolhackathon
ryu/contrib/ncclient/capabilities.py
65
2355
# Copyright 2009 Shikhar Bhushan # # 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
3dfxsoftware/cbss-addons
account_anglo_saxon/stock.py
6
3785
# -*- encoding: 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 t...
gpl-2.0
badreddinetahir/pwn_plug_sources
src/voiper/sulley/nix_process_monitor.py
8
9347
import os import sys import getopt import signal import time import threading from sulley import pedrpc ''' By nnp http://www.unprotectedhex.com This intended as a basic replacement for Sulley's process_monitor.py on *nix. The below options are accepted. Crash details are limited to the signal that caused the death ...
gpl-3.0
amondot/QGIS
python/plugins/processing/gui/ConfigDialog.py
1
10291
# -*- coding: utf-8 -*- """ *************************************************************************** ConfigDialog.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com **************************...
gpl-2.0
rhndg/openedx
cms/djangoapps/contentstore/tests/test_course_create_rerun.py
126
2423
""" Test view handler for rerun (and eventually create) """ from django.test.client import RequestFactory from opaque_keys.edx.keys import CourseKey from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.factories import CourseFactory from student.roles import CourseInstr...
agpl-3.0
TRESCLOUD/odoo
addons/lunch/wizard/lunch_validation.py
440
1296
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2012 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the G...
agpl-3.0
mrquim/repository.mrquim
plugin.video.castaway/resources/lib/modules/decryptionUtils.py
12
7690
# -*- coding: utf-8 -*- import pyDes import urllib import re from regexUtils import parseTextToGroups from javascriptUtils import JsFunctions, JsUnpacker, JsUnpackerV2, JsUnpacker95High, JsUnwiser, JsUnIonCube, JsUnFunc, JsUnPP, JsUnPush def encryptDES_ECB(data, key): data = data.encode() k = pyDes.des(key, py...
gpl-2.0
masterdon/Veil-Evasion
modules/payloads/python/meterpreter/rev_tcp.py
12
6607
""" Custom-written pure python meterpreter/reverse_tcp stager. By @harmj0y """ from modules.common import helpers from modules.common import encryption from datetime import date from datetime import timedelta from modules.common.pythonpayload import PythonPayload class Payload(PythonPayload): def __init__(sel...
gpl-3.0
r-mibu/ceilometer
ceilometer/storage/sqlalchemy/migrate_repo/versions/041_expand_event_traits.py
3
4634
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under...
apache-2.0
AkizukiRyoko/mtasa-blue
vendor/google-breakpad/src/testing/scripts/upload_gmock.py
770
2833
#!/usr/bin/env python # # Copyright 2009, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
gpl-3.0
criteo/biggraphite
biggraphite/drivers/_delayed_writer.py
3
5350
#!/usr/bin/env python # Copyright 2016 Criteo # # 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 agree...
apache-2.0
Mistobaan/tensorflow
tensorflow/contrib/lookup/__init__.py
78
1628
# 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
one-2-z/a830s_kernel
tools/perf/python/twatch.py
3213
1338
#! /usr/bin/python # -*- python -*- # -*- coding: utf-8 -*- # twatch - Experimental use of the perf python interface # Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com> # # This application is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License...
gpl-2.0
adrienbrault/home-assistant
homeassistant/components/huawei_lte/binary_sensor.py
3
7706
"""Support for Huawei LTE binary sensors.""" from __future__ import annotations import logging from typing import Any, Callable import attr from huawei_lte_api.enums.cradle import ConnectionStatusEnum from homeassistant.components.binary_sensor import ( DOMAIN as BINARY_SENSOR_DOMAIN, BinarySensorEntity, ) f...
mit
fitzgen/servo
tests/wpt/css-tests/tools/pywebsocket/src/test/testdata/handlers/sub/exception_in_transfer_wsh.py
499
1816
# Copyright 2009, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
mpl-2.0
p12tic/libdesktop-agnostic
tests/python/test-vfs-file.py
2
2508
#!/usr/bin/env python # vim: set ts=4 sts=4 sw=4 et : # # Copyright (c) 2009 Mark Lee <libdesktop-agnostic@lazymalevolence.com> # # 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...
lgpl-2.1
sygi/deep_q_rl
deep_q_rl/ale_data_set.py
1
9952
"""This class stores all of the samples for training. It is able to construct randomly selected batches of phi's from the stored history. """ import numpy as np import time import theano floatX = theano.config.floatX class DataSet(object): """A replay memory consisting of circular buffers for observed images, a...
bsd-3-clause
kbdick/RecycleTracker
recyclecollector/scrap/gdata-2.0.18/samples/analytics/mgmt_feed_demo.py
39
8348
#!/usr/bin/python # # Copyright 2010 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...
gpl-3.0
2014c2g18/c2g18
wsgi/static/Brython2.1.0-20140419-113919/Lib/imp.py
53
9783
"""This module provides the components needed to build your own __import__ function. Undocumented functions are obsolete. In most cases it is preferred you consider using the importlib module's functionality over this module. """ # (Probably) need to stay in _imp from _imp import (lock_held, acquire_lock, release_lo...
gpl-2.0
adeboisanger/thumbor
vows/translate_coordinates_vows.py
7
1507
#!/usr/bin/python # -*- coding: utf-8 -*- # thumbor imaging service # https://github.com/thumbor/thumbor/wiki # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 globo.com timehome@corp.globo.com from pyvows import Vows, expect from thumbor.handlers import BaseHan...
mit
ntamas/python-selecta
selecta/renderers.py
1
2075
"""Renderers convert model objects into a visual representation that can be shown on the UI.""" class Renderer(object): def attach_to_terminal(self, terminal): """Attaches the renderer to the given terminal.""" pass def render(self, obj, selected=False): """Renders the given object in...
mit
krishauser/Klampt
Python/klampt/control/blocks/trajectory_tracking.py
1
2744
from ..controller import ControllerBlock,RobotControllerIO from klampt.model import trajectory class TrajectoryPositionController(ControllerBlock): """A (robot) controller that takes in a trajectory and outputs the position along the trajectory. If type is a 2-tuple, this will also output the derivative ...
bsd-3-clause
tchellomello/home-assistant
homeassistant/components/tuya/scene.py
3
1829
"""Support for the Tuya scenes.""" from typing import Any from homeassistant.components.scene import DOMAIN as SENSOR_DOMAIN, Scene from homeassistant.const import CONF_PLATFORM from homeassistant.helpers.dispatcher import async_dispatcher_connect from . import TuyaDevice from .const import DOMAIN, TUYA_DATA, TUYA_DI...
apache-2.0
sinbazhou/odoo
addons/sales_team/__openerp__.py
261
1801
# -*- 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
Austin503/pyglet
tests/window/WINDOW_FIXED_SET_SIZE.py
30
1407
#!/usr/bin/env python '''Test that a non-resizable window's size can be set. Expected behaviour: One window will be opened. The window's dimensions will be printed to the terminal. - press "x" to increase the width - press "X" to decrease the width - press "y" to increase the height - ...
bsd-3-clause
ColmFitz369/docker-repo
python-flask/my_application/app.py
1
1686
from flask import Flask from flask import request import os, sys app = Flask(__name__) @app.route('/') def index(): return 'Index Page' @app.route('/hello') def hello(): <<<<<<< HEAD return 'Hello World' @app.route('/user/<username>') def show_user_profile(username): # show the user profile for that user return 'User %...
mit
epssy/hue
desktop/core/ext-py/thrift-0.9.1/src/transport/TTransport.py
105
8385
# # 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
Zerknechterer/pyload
module/plugins/internal/XFSAccount.py
1
5969
# -*- coding: utf-8 -*- import re import time import urlparse from module.plugins.internal.Account import Account from module.plugins.internal.SimpleHoster import parseHtmlForm, set_cookies class XFSAccount(Account): __name__ = "XFSAccount" __type__ = "account" __version__ = "0.38" __descript...
gpl-3.0
simleo/openmicroscopy
components/tools/OmeroPy/test/unit/test_config.py
9
11508
#!/usr/bin/env python # -*- coding: utf-8 -*- """ /* * $Id$ * * Copyright 2008-2014 Glencoe Software, Inc. All rights reserved. * Use is subject to license terms supplied in LICENSE.txt */ """ import os import errno import pytest from omero.config import ConfigXml, xml from omero.util.temp_files import crea...
gpl-2.0
andrewfu0325/gem5-aladdin
configs/ruby/MESI_Three_Level.py
13
10337
# Copyright (c) 2006-2007 The Regents of The University of Michigan # Copyright (c) 2009 Advanced Micro Devices, Inc. # Copyright (c) 2013 Mark D. Hill and David A. Wood # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the followin...
bsd-3-clause
jkugler/ansible
lib/ansible/constants.py
8
17328
# (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
arizvisa/syringe
template/local/pif.py
1
13321
""" Ripped from https://www.smsoft.ru/en/pifdoc.htm """ import ptypes from ptypes import * class Heading(pstruct.type): def __Next_section_offset(self): return dyn.pointer(Section, pint.uint16_t) def __Section_data_offset(self): def _object_(_, self=self): length = self['Length']....
bsd-2-clause
mne-tools/mne-tools.github.io
0.19/_downloads/33b5e3cff5c172d72c79c6eec192b031/plot_label_from_stc.py
20
4093
""" ================================================= Generate a functional label from source estimates ================================================= Threshold source estimates and produce a functional label. The label is typically the region of interest that contains high values. Here we compare the average time ...
bsd-3-clause
edwardbadboy/vdsm-ubuntu
tests/mountTests.py
2
2240
# # Copyright 2012 Red Hat, Inc. # # 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 is distributed in th...
gpl-2.0
CarbonTEAM/android_kernel_htc_msm8960
tools/perf/python/twatch.py
7370
1334
#! /usr/bin/python # -*- python -*- # -*- coding: utf-8 -*- # twatch - Experimental use of the perf python interface # Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com> # # This application is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License...
gpl-2.0
Microvellum/Fluid-Designer
win64-vc/2.78/python/lib/test/test_importlib/import_/test_api.py
8
2946
from .. import util from importlib import machinery import sys import types import unittest PKG_NAME = 'fine' SUBMOD_NAME = 'fine.bogus' class BadSpecFinderLoader: @classmethod def find_spec(cls, fullname, path=None, target=None): if fullname == SUBMOD_NAME: spec = machinery.ModuleSpec(f...
gpl-3.0
citrix-openstack-build/ryu
ryu/tests/unit/packet/test_icmp.py
4
10087
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
apache-2.0
picoCTF/picoCTF
picoCTF-web/api/user.py
2
21598
"""User management and registration module.""" import json import re import urllib.parse import urllib.request from functools import wraps import bcrypt import flask from flask import current_app, request, session from pymongo.collation import Collation, CollationStrength import api from api import cache, log_action...
mit
musicbrainz/picard
picard/ui/tagsfromfilenames.py
1
6502
# -*- coding: utf-8 -*- # # Picard, the next-generation MusicBrainz tagger # # Copyright (C) 2006-2007 Lukáš Lalinský # Copyright (C) 2009, 2014, 2019-2020 Philipp Wolfer # Copyright (C) 2012-2013 Michael Wiencek # Copyright (C) 2014, 2017 Sophist-UK # Copyright (C) 2016-2017 Sambhav Kothari # Copyright (C) 2017 Ville ...
gpl-2.0
gbirke/scrapy
tests/test_downloadermiddleware_stats.py
15
1367
from unittest import TestCase from scrapy.contrib.downloadermiddleware.stats import DownloaderStats from scrapy.http import Request, Response from scrapy.spider import Spider from scrapy.utils.test import get_crawler class TestDownloaderStats(TestCase): def setUp(self): self.crawler = get_crawler(Spider...
bsd-3-clause
alishakiba/kaggle-ndsb
configurations/featharalick_bagged_convroll4_doublescale_fs5.py
6
2527
import numpy as np import theano import theano.tensor as T import lasagne as nn import data import load import nn_plankton import dihedral import tmp_dnn import tta features = [ # "hu", # "tutorial", "haralick", # "aaronmoments", # "lbp", # "pftas", # "zernike_moments", # "image_siz...
mit
hfut721/RPN
tools/demo.py
10
5028
#!/usr/bin/env python # -------------------------------------------------------- # Faster R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- """ Demo script showing detections in sample i...
mit
salsita/shishito
shishito/runtime/platform/node_webkit/control_test.py
1
2103
""" @summary: Common configuration functions supporting test execution. Various startup and termination procedures, helper functions etc. Not to be used for directly testing the system under test (must not contain Asserts etc.) """ import os import re from shishito.runtime.platform.shishito_control_test import Shishi...
mit
AthinaB/synnefo
snf-cyclades-app/synnefo/db/migrations/0116_auto__add_image__add_unique_image_uuid_version.py
10
26029
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Image' db.create_table('db_image', ( ('id', self.gf('django.db.models.fields.Aut...
gpl-3.0
Juniper/neutron
neutron/tests/unit/dummy_plugin.py
18
4694
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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.apac...
apache-2.0
tensorflow/tensorflow
tensorflow/python/eager/graph_only_ops.py
18
2146
# 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
zmallen/pupy
client/sources/mktab.py
34
3973
# A script to generate helper files for dynamic linking to the Python dll # decls = ''' void, Py_Initialize, (void) int, PyRun_SimpleString, (char *) void, Py_Finalize, (void) char *, Py_GetPath, (void) void, Py_SetPythonHome, (char *) void, Py_SetProgramName, (char *) PyObject *, PyMarshal_ReadObjectFromString, (char ...
bsd-3-clause
jcoady9/python-for-android
python3-alpha/python3-src/Doc/tools/sphinxext/pyspecific.py
45
9791
# -*- coding: utf-8 -*- """ pyspecific.py ~~~~~~~~~~~~~ Sphinx extension with Python doc-specific markup. :copyright: 2008, 2009, 2010 by Georg Brandl. :license: Python license. """ ISSUE_URI = 'http://bugs.python.org/issue%s' SOURCE_URI = 'http://hg.python.org/cpython/file/3.2/%s' from docutils...
apache-2.0
pombredanne/srvup-rest-framework
src/billing/views.py
6
6024
from django.conf import settings from django.contrib import messages from django.contrib.auth.decorators import login_required from django.shortcuts import render, redirect, Http404 from django.utils import timezone # Create your views here. from .models import Membership, Transaction, UserMerchantId from .signals i...
apache-2.0
anthgur/servo
tests/wpt/web-platform-tests/tools/pywebsocket/test/test_handshake_hybi.py
31
21624
#!/usr/bin/env python # # Copyright 2011, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
mpl-2.0
merc-devel/merc
merc/features/rfc1459/privmsg.py
1
2517
from merc import channel from merc import errors from merc import feature from merc import message from merc import mode class PrivmsgFeature(feature.Feature): NAME = __name__ install = PrivmsgFeature.install MAX_TARGETS = 4 class _Privmsg(message.Command): MIN_ARITY = 2 FORCE_TRAILING = True def __ini...
mit
alibarkatali/module_web
venv/lib/python2.7/site-packages/pip/commands/install.py
323
17412
from __future__ import absolute_import import logging import operator import os import tempfile import shutil import warnings try: import wheel except ImportError: wheel = None from pip.req import RequirementSet from pip.basecommand import RequirementCommand from pip.locations import virtualenv_no_global, dis...
mit
zerkrx/zerkbox
lib/pip/_vendor/requests/api.py
362
5794
# -*- coding: utf-8 -*- """ requests.api ~~~~~~~~~~~~ This module implements the Requests API. :copyright: (c) 2012 by Kenneth Reitz. :license: Apache2, see LICENSE for more details. """ from . import sessions def request(method, url, **kwargs): """Constructs and sends a :class:`Request <Request>`. :para...
gpl-3.0
obulpathi/spark
python/io/hbase_outputformat.py
3
2843
# # 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
awkspace/ansible
lib/ansible/modules/cloud/amazon/ec2_vpc_egress_igw.py
39
6539
#!/usr/bin/python # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module...
gpl-3.0
ryanpitts/source
vendor-local/lib/python/dateutil/rrule.py
214
41036
""" Copyright (c) 2003-2010 Gustavo Niemeyer <gustavo@niemeyer.net> This module offers extensions to the standard Python datetime module. """ __license__ = "Simplified BSD" import itertools import datetime import calendar try: import _thread except ImportError: import thread as _thread import sys from six i...
bsd-3-clause
avistous/QSTK
qstkutil/bollinger.py
2
1494
''' (c) 2011, 2012 Georgia Tech Research Corporation This source code is released under the New BSD license. Please see http://wiki.quantsoftware.org/index.php?title=QSTK_License for license details. Created on Jan 1, 2011 @author:Drew Bratcher @contact: dbratcher@gatech.edu @summary: Contains tutorial for backteste...
bsd-3-clause
rajul/tvb-library
tvb/datatypes/volumes_data.py
2
2799
# -*- coding: utf-8 -*- # # # TheVirtualBrain-Scientific Package. This package holds all simulators, and # analysers necessary to run brain-simulations. You can use it stand alone or # in conjunction with TheVirtualBrain-Framework Package. See content of the # documentation-folder for more details. See also http://ww...
gpl-2.0