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
oliverlee/sympy
sympy/physics/quantum/tests/test_spin.py
80
320440
from __future__ import division from sympy import cos, exp, expand, I, Matrix, pi, S, sin, sqrt, Sum, symbols from sympy.abc import alpha, beta, gamma, j, m from sympy.physics.quantum import hbar, represent, Commutator, InnerProduct from sympy.physics.quantum.qapply import qapply from sympy.physics.quantum.tensorproduc...
bsd-3-clause
dkcoinus/dkcoin_src
qa/rpc-tests/bipdersig-p2p.py
69
6594
#!/usr/bin/env python2 # # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from test_framework.test_framework import ComparisonTestFramework from test_framework.util import * from test_framework.mininode import CTransaction, N...
mit
2014c2g4/c2g4
w2/static/Brython2.0.0-20140209-164925/Lib/unittest/test/test_case.py
738
51689
import difflib import pprint import pickle import re import sys import warnings import weakref import inspect from copy import deepcopy from test import support import unittest from .support import ( TestEquality, TestHashing, LoggingResult, ResultWithNoStartTestRunStopTestRun ) class Test(object): "Ke...
gpl-2.0
guettli/django
django/core/handlers/base.py
96
10769
from __future__ import unicode_literals import logging import sys import types import warnings from django.conf import settings from django.core import signals from django.core.exceptions import ImproperlyConfigured, MiddlewareNotUsed from django.db import connections, transaction from django.urls import get_resolver...
bsd-3-clause
skycucumber/restful
python/venv/lib/python2.7/site-packages/requests/packages/urllib3/fields.py
1007
5833
import email.utils import mimetypes from .packages import six def guess_content_type(filename, default='application/octet-stream'): """ Guess the "Content-Type" of a file. :param filename: The filename to guess the "Content-Type" of using :mod:`mimetypes`. :param default: If no "Cont...
gpl-2.0
MatthewWilkes/reportlab
tests/test_platypus_wrapping.py
1
3925
#Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details """Tests for context-dependent indentation """ __version__='''$Id: test_platypus_indents.py 3660 2010-02-08 18:17:33Z damian $''' from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, outputfile, printLocation setOutDir(__name_...
bsd-3-clause
datenbetrieb/odoo
addons/stock_dropshipping/__init__.py
223
1085
# -*- 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
urbansearchTUD/UrbanSearch
urbansearch/server/predict.py
1
1632
import config from flask import Blueprint, jsonify, request from urbansearch.server.decorators import is_json from urbansearch.clustering.classifytext import ClassifyText predict_api = Blueprint('predict_api', __name__) ct = ClassifyText() @predict_api.route('/', methods=['POST']) @predict_api.route('/predict', met...
gpl-3.0
encbladexp/ansible
test/support/integration/plugins/module_utils/database.py
54
5942
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
gpl-3.0
sidmitra/django_nonrel_testapp
django/dispatch/saferef.py
345
10495
""" "Safe weakrefs", originally from pyDispatcher. Provides a way to safely weakref any function, including bound methods (which aren't handled by the core weakref module). """ import weakref, traceback def safeRef(target, onDelete = None): """Return a *safe* weak reference to a callable target target -- th...
bsd-3-clause
sdgdsffdsfff/ngender
ngender/ngender.py
2
1973
#!/usr/bin/env python # -*- coding: utf-8 -*- import os __all__ = ['guess'] def py2compat(name): try: name = name.decode('utf-8') except: pass return name class Guesser(object): def __init__(self): self._load_model() def _load_model(self): self.male_total = 0 ...
mit
pombredanne/zero-install
zeroinstall/injector/requirements.py
1
1734
""" Holds information about what the user asked for (which program, version constraints, etc). """ # Copyright (C) 2011, Thomas Leonard # See the README file for details, or visit http://0install.net. from zeroinstall import _ class Requirements(object): """ Holds information about what the user asked for (which p...
lgpl-2.1
mollstam/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Twisted-15.2.1/twisted/python/monkey.py
62
2227
# -*- test-case-name: twisted.test.test_monkey -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. from __future__ import division, absolute_import class MonkeyPatcher(object): """ Cover up attributes with new objects. Neat for monkey-patching things for unit-testing purposes. ...
mit
mdesco/dipy
scratch/very_scratch/simulation_comparisons_modified.py
20
13117
import nibabel import os import numpy as np import dipy as dp import dipy.core.generalized_q_sampling as dgqs import dipy.io.pickles as pkl import scipy as sp from matplotlib.mlab import find import dipy.core.sphere_plots as splots import dipy.core.sphere_stats as sphats import dipy.core.geometry as geometry import get...
bsd-3-clause
edx/edx-enterprise
tests/test_enterprise/api_client/test_discovery.py
1
22331
# -*- coding: utf-8 -*- """ Tests for the `edx-enterprise` course catalogs api module. """ import json import logging import unittest import ddt import mock import responses from six.moves.urllib.parse import urljoin # pylint: disable=import-error from slumber.exceptions import HttpClientError from django.contrib i...
agpl-3.0
Eagles2F/sync-engine
tests/imap/network/test_send.py
6
1737
import json from datetime import datetime import pytest from tests.util.base import default_account from tests.util.crispin import crispin_client from tests.api.base import api_client __all__ = ['default_account', 'api_client'] @pytest.fixture def example_draft(db, default_account): return { 'subject':...
agpl-3.0
aduric/crossfit
nonrel/docs/_ext/applyxrefs.py
143
2148
"""Adds xref targets to the top of files.""" import sys import os testing = False DONT_TOUCH = ( './index.txt', ) def target_name(fn): if fn.endswith('.txt'): fn = fn[:-4] return '_' + fn.lstrip('./').replace('/', '-') def process_file(fn, lines): lines.insert(0, '\n') lines...
bsd-3-clause
ahnitz/pycbc
pycbc/strain/calibration.py
9
5785
# Copyright (C) 2018 Colm Talbot # # 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 version. # # This program is distributed in th...
gpl-3.0
CUCWD/edx-platform
cms/djangoapps/contentstore/views/user.py
21
7908
from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.core.exceptions import PermissionDenied from django.http import HttpResponseNotFound from django.utils.translation import ugettext as _ from django.views.decorators.csrf import ensure_csrf_cookie from djang...
agpl-3.0
marcinzaremba/libcloud
docs/conf.py
29
8465
# -*- coding: utf-8 -*- # # Apache Libcloud documentation build configuration file, created by # sphinx-quickstart on Wed Jul 31 12:16:27 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file....
apache-2.0
tedder/ansible
lib/ansible/modules/cloud/openstack/os_server.py
25
25051
#!/usr/bin/python # coding: utf-8 -*- # Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # Copyright (c) 2013, Benno Joy <benno@ansible.com> # Copyright (c) 2013, John Dewey <john@dewey.ws> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import ...
gpl-3.0
iliTheFallen/UHVision
SelfDrivingCar/sandbox/sandbox.py
1
7885
''' Copyright 2017-2022 Department of Electrical and Computer Engineering University of Houston, TX/USA This file is part of UHVision Libraries. UH Vision libraries are free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by...
gpl-3.0
VinGarcia/kivy
kivy/resources.py
46
1556
''' Resources management ==================== Resource management can be a pain if you have multiple paths and projects. Kivy offers 2 functions for searching for specific resources across a list of paths. ''' __all__ = ('resource_find', 'resource_add_path', 'resource_remove_path') from os.path import join, dirname,...
mit
Flexget/Flexget
flexget/components/sites/sites/site_rutracker.py
1
1776
# -*- coding: utf-8 -*- from urllib.parse import parse_qs, urlencode, urlparse from loguru import logger from requests.exceptions import RequestException from flexget import plugin from flexget.components.sites.urlrewriting import UrlRewritingError from flexget.event import event logger = logger.bind(name='rutracke...
mit
etos/django
tests/migrations/test_multidb.py
68
6865
import unittest from django.db import connection, migrations, models from django.db.migrations.state import ProjectState from django.test import override_settings from .test_operations import OperationTestBase try: import sqlparse except ImportError: sqlparse = None class AgnosticRouter: """ A rout...
bsd-3-clause
merll/server-tracking
server_tracking/google/client.py
2
15043
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging from . import (HIT_TYPE_TRANSACTION, HIT_TYPE_TRANSACTION_ITEM, HIT_TYPE_EVENT, HIT_TYPE_SCREENVIEW, HIT_TYPE_PAGEVIEW, HIT_TYPE_SOCIAL, HIT_TYPE_TIMING, HIT_TYPE_EXCEPTION) from .parameters import (GeneralParameters, PageVi...
mit
duanhjlt/gyp
test/mac/gyptest-app.py
43
3949
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies that app bundles are built correctly. """ import TestGyp import TestMac import os import plistlib import subprocess import sy...
bsd-3-clause
job/exscript
src/Exscriptd/DBObject.py
6
2180
# Copyright (C) 2007-2010 Samuel Abels. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2, as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANT...
gpl-2.0
akashsinghal/Speech-Memorization-App
Python_Backend/env/lib/python3.6/site-packages/pip/_vendor/lockfile/symlinklockfile.py
536
2616
from __future__ import absolute_import import os import time from . import (LockBase, NotLocked, NotMyLock, LockTimeout, AlreadyLocked) class SymlinkLockFile(LockBase): """Lock access to a file using symlink(2).""" def __init__(self, path, threaded=True, timeout=None): # super(Symlin...
apache-2.0
NB-Dev/django-shop
shop/views/product.py
11
1177
# -*- coding: utf-8 -*- from shop.models.productmodel import Product from shop.views import (ShopListView, ShopDetailView) class ProductListView(ShopListView): """ This view handles displaying the product catalogue to customers. It filters out inactive products and shows only those that are active. ""...
bsd-3-clause
pablo2000/picochess
web/websockets_test.py
4
1302
from flask import Flask app = Flask(__name__) @app.route('/') def index(): return """ <span id="now">loading<span> <script type="text/javascript"> window.WebSocket=window.WebSocket || window.MozWebSocket || false; if(!window.WebSocket){ alert("No WebSocket Support"); }else { var ws=new WebSocket("ws://"+l...
gpl-3.0
Chatmetaleux/MissionPlanner
Scripts/example4 wp.py
61
1193
import sys import math import clr import time import System from System import Byte clr.AddReference("MissionPlanner") import MissionPlanner clr.AddReference("MissionPlanner.Utilities") # includes the Utilities class from MissionPlanner.Utilities import Locationwp clr.AddReference("MAVLink") # includes the Utilities ...
gpl-3.0
coderbone/SickRage-alt
lib/unidecode/x000.py
17
3041
data = ( # Code points u+007f and below are equivalent to ASCII and are handled by a # special case in the code. Hence they are not present in this table. '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '...
gpl-3.0
paweljasinski/ironpython3
Src/StdLib/Lib/test/test_wait4.py
111
1140
"""This test checks for correct wait4() behavior. """ import os import time import sys from test.fork_wait import ForkWait from test.support import run_unittest, reap_children, get_attribute # If either of these do not exist, skip this test. get_attribute(os, 'fork') get_attribute(os, 'wait4') class Wait4Test(ForkW...
apache-2.0
freakboy3742/django
tests/many_to_one_null/tests.py
19
6085
from django.test import TestCase from .models import Article, Car, Driver, Reporter class ManyToOneNullTests(TestCase): @classmethod def setUpTestData(cls): # Create a Reporter. cls.r = Reporter(name='John Smith') cls.r.save() # Create an Article. cls.a = Article(headl...
bsd-3-clause
kkuunnddaannkk/vispy
examples/demo/gloo/game_of_life.py
18
5765
# -*- coding: utf-8 -*- # vispy: gallery 200 # ----------------------------------------------------------------------------- # Copyright (c) 2015, Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. # ----------------------------------------------------...
bsd-3-clause
zubair-arbi/edx-platform
lms/djangoapps/instructor/views/registration_codes.py
86
5504
""" E-commerce Tab Instructor Dashboard Query Registration Code Status. """ from django.core.urlresolvers import reverse from django.views.decorators.http import require_GET, require_POST from instructor.enrollment import get_email_params, send_mail_to_student from django.utils.translation import ugettext as _ from cou...
agpl-3.0
encukou/samba
source4/heimdal/lib/wind/UnicodeData.py
82
2167
#!/usr/local/bin/python # -*- coding: iso-8859-1 -*- # $Id$ # Copyright (c) 2004 Kungliga Tekniska Högskolan # (Royal Institute of Technology, Stockholm, Sweden). # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following...
gpl-3.0
codepantry/django
django/db/backends/oracle/introspection.py
517
11463
import cx_Oracle from django.db.backends.base.introspection import ( BaseDatabaseIntrospection, FieldInfo, TableInfo, ) from django.utils.encoding import force_text class DatabaseIntrospection(BaseDatabaseIntrospection): # Maps type objects to Django Field types. data_types_reverse = { cx_Oracle....
bsd-3-clause
KorlaMarch/Ant-bot
mapgen/amstan/cavemap.py
4
1869
#!/usr/bin/env python import random from symmetricmap import * class Cavemap(SymmetricMap): def __init__(self, **kwargs): kwargs["defaultterrain"]=WATER SymmetricMap.__init__(self, **kwargs) def add_water_randomly(self,percent=0.49): for point in self.size.upto(): self...
mit
fkorotkov/pants
contrib/android/src/python/pants/contrib/android/targets/android_target.py
14
2242
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os from pant...
apache-2.0
laperry1/android_external_chromium_org
third_party/libxml/src/check-relaxng-test-suite2.py
343
10578
#!/usr/bin/python import sys import time import os import string import StringIO sys.path.insert(0, "python") import libxml2 # Memory debug specific libxml2.debugMemory(1) debug = 0 quiet = 1 # # the testsuite description # CONF=os.path.join(os.path.dirname(__file__), "test/relaxng/testsuite.xml") LOG="check-relaxng-...
bsd-3-clause
proxysh/Safejumper-for-Mac
buildmac/Resources/env/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/contrib/appengine.py
360
7937
from __future__ import absolute_import import logging import os import warnings from ..exceptions import ( HTTPError, HTTPWarning, MaxRetryError, ProtocolError, TimeoutError, SSLError ) from ..packages.six import BytesIO from ..request import RequestMethods from ..response import HTTPResponse ...
gpl-2.0
NiclasEriksen/py-towerwars
src/numpy/lib/_datasource.py
148
21266
"""A file interface for handling local and remote data files. The goal of datasource is to abstract some of the file system operations when dealing with data files so the researcher doesn't have to know all the low-level details. Through datasource, a researcher can obtain and use a file with one function call, regar...
cc0-1.0
malaterre/ITK
Modules/ThirdParty/pygccxml/src/pygccxml/parser/project_reader.py
13
23391
# Copyright 2014-2017 Insight Software Consortium. # Copyright 2004-2009 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. # See http://www.boost.org/LICENSE_1_0.txt import os import timeit import pygccxml.declarations from . import source_reader from . import declarations_cache from . im...
apache-2.0
facebookresearch/ParlAI
parlai/chat_service/utils/misc.py
1
6342
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ Miscellaneous utils for chat services. """ import importlib import math import re from enum import Enum THREAD_MEDIU...
mit
ruyang/ironic
ironic/tests/unit/drivers/modules/drac/test_job.py
6
6492
# # 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
zwChan/VATEC
~/eb-virt/Lib/encodings/iso8859_11.py
93
12898
""" Python Character Mapping Codec iso8859_11 generated from 'MAPPINGS/ISO8859/8859-11.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self...
apache-2.0
rversteegen/commandergenius
project/jni/python/src/Lib/shelve.py
59
7866
"""Manage shelves of pickled objects. A "shelf" is a persistent, dictionary-like object. The difference with dbm databases is that the values (not the keys!) in a shelf can be essentially arbitrary Python objects -- anything that the "pickle" module can handle. This includes most class instances, recursive data type...
lgpl-2.1
MorganR/gaussian-processes
data/shapes.py
1
4350
import random from math import sin, cos, sqrt, inf, degrees, pi, isclose, atan from data.cartesian import Point, Vector from utils.nums import is_zero class Line: """Represents a straight line as distance 'd' from the origin and angle 'theta' from the x-axis""" def __init__(self, d=0, theta=0): ...
mit
robbles/turk
turk/drivers/tick.py
1
1612
#! /usr/bin/env python import gobject import dbus import dbus.service import dbus.mainloop.glib import turk DRIVER_ID = 2 """ Sends an update with the current date/time every one second. Useful for waking up web-based Tapps. """ class Tick(dbus.service.Object): def __init__(self, bus): dbus.service.Objec...
mit
hopeall/odoo
openerp/report/render/rml2pdf/customfonts.py
261
3493
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 P. Christeas, Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2013 OpenERP SA. (http://www.openerp.com) # # This program is free so...
agpl-3.0
caioserra/apiAdwords
examples/adspygoogle/dfp/v201208/get_all_line_items.py
4
1714
#!/usr/bin/python # # 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 required b...
apache-2.0
chainer/chainercv
chainercv/utils/testing/assertions/assert_is_instance_segmentation_link.py
3
2385
import numpy as np import six def assert_is_instance_segmentation_link(link, n_fg_class): """Checks if a link satisfies instance segmentation link APIs. This function checks if a given link satisfies instance segmentation link APIs or not. If the link does not satifiy the APIs, this function raises a...
mit
xuxiao19910803/edx-platform
openedx/core/djangoapps/user_api/accounts/tests/test_views.py
39
33313
# -*- coding: utf-8 -*- import datetime from copy import deepcopy import ddt import hashlib import json from mock import patch from pytz import UTC import unittest from django.conf import settings from django.core.urlresolvers import reverse from django.test.testcases import TransactionTestCase from django.test.utils ...
agpl-3.0
photoninger/ansible
lib/ansible/modules/windows/win_dns_client.py
47
2652
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Red Hat, Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your ...
gpl-3.0
erwilan/ansible
lib/ansible/plugins/filter/ipaddr.py
36
18970
# (c) 2014, Maciej Delmanowski <drybjed@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later ...
gpl-3.0
flashycud/timestack
django/contrib/gis/db/backends/mysql/operations.py
312
2418
from django.db.backends.mysql.base import DatabaseOperations from django.contrib.gis.db.backends.adapter import WKTAdapter from django.contrib.gis.db.backends.base import BaseSpatialOperations class MySQLOperations(DatabaseOperations, BaseSpatialOperations): compiler_module = 'django.contrib.gis.db.models.sql.co...
mit
googleapis/python-aiplatform
tests/unit/aiplatform/test_automl_tabular_training_jobs.py
1
24012
import importlib import pytest from unittest import mock from google.cloud import aiplatform from google.cloud.aiplatform import datasets from google.cloud.aiplatform import initializer from google.cloud.aiplatform import schema from google.cloud.aiplatform import training_jobs from google.cloud.aiplatform_v1.servic...
apache-2.0
40223136/2015w11
static/Brython3.1.1-20150328-091302/Lib/multiprocessing/process.py
694
2304
# # Module providing the `Process` class which emulates `threading.Thread` # # multiprocessing/process.py # # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # __all__ = ['Process', 'current_process', 'active_children'] # # Imports # import os import sys import signal import itert...
gpl-3.0
idjaw/keystone
keystone/contrib/revoke/routers.py
23
1110
# 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 t...
apache-2.0
mbernasocchi/QGIS
python/plugins/processing/algs/gdal/GridLinear.py
15
7462
# -*- coding: utf-8 -*- """ *************************************************************************** GridLinear.py --------------------- Date : September 2017 Copyright : (C) 2017 by Alexander Bruy Email : alexander dot bruy at gmail dot com ************...
gpl-2.0
ar7z1/ansible
lib/ansible/modules/monitoring/icinga2_host.py
35
9960
#!/usr/bin/python # -*- coding: utf-8 -*- # This module is proudly sponsored by CGI (www.cgi.com) and # KPN (www.kpn.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_METADA...
gpl-3.0
nugget/home-assistant
homeassistant/components/camera/proxy.py
2
9029
""" Proxy camera platform that enables image processing of camera data. For more details about this platform, please refer to the documentation https://www.home-assistant.io/components/camera.proxy/ """ import asyncio import logging from datetime import timedelta import voluptuous as vol from homeassistant.component...
apache-2.0
alfredfrancis/ai-chatbot-framework
app/nlu/entity_extractor.py
1
7280
# -*- coding: utf-8 -*- import pycrfsuite from flask import current_app as app from app.nlu import spacy_tokenizer class EntityExtractor: """ Performs NER training, prediction, model import/export """ def __init__(self, synonyms=[]): self.synonyms = synonyms def replace_synonyms(self, ...
mit
BIT-SYS/gem5-spm-module
src/arch/x86/isa/insts/simd128/floating_point/arithmetic/reciprocal_square_root.py
91
2162
# Copyright (c) 2007 The Hewlett-Packard Development Company # 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 implemen...
bsd-3-clause
dalf/searx
searx/engines/qwant.py
1
4616
# SPDX-License-Identifier: AGPL-3.0-or-later """ Qwant (Web, Images, News, Social) """ from datetime import datetime from json import loads from urllib.parse import urlencode from searx.utils import html_to_text, match_language from searx.exceptions import SearxEngineAPIException, SearxEngineCaptchaException from sea...
agpl-3.0
starwels/p2pool
p2pool/__init__.py
278
1595
import os import re import sys import traceback import subprocess def check_output(*popenargs, **kwargs): process = subprocess.Popen(stdout=subprocess.PIPE, *popenargs, **kwargs) output, unused_err = process.communicate() retcode = process.poll() if retcode: raise ValueError((retcode, output)) ...
gpl-3.0
UNR-AERIAL/scikit-learn
sklearn/neural_network/rbm.py
206
12292
"""Restricted Boltzmann Machine """ # Authors: Yann N. Dauphin <dauphiya@iro.umontreal.ca> # Vlad Niculae # Gabriel Synnaeve # Lars Buitinck # License: BSD 3 clause import time import numpy as np import scipy.sparse as sp from ..base import BaseEstimator from ..base import TransformerMixi...
bsd-3-clause
ddsc/ddsc-core
ddsc_core/management/commands/create_test_location.py
1
2966
from django.core.management.base import BaseCommand from ddsc_core.models import ( Location, Source, Parameter, Unit, Timeseries ) from lizard_security.models import DataSet from django.contrib.gis.geos import Point import pandas as pd import numpy as np import datetime import pytz TEST_LOCATION_NA...
mit
zanderle/django
django/core/mail/backends/base.py
577
1573
"""Base email backend class.""" class BaseEmailBackend(object): """ Base class for email backend implementations. Subclasses must at least overwrite send_messages(). open() and close() can be called indirectly by using a backend object as a context manager: with backend as connection: ...
bsd-3-clause
Tatsh-ansible/ansible
test/runner/lib/sanity.py
4
26772
"""Execute Ansible sanity tests.""" from __future__ import absolute_import, print_function import glob import json import os import re from xml.etree.ElementTree import ( fromstring, Element, ) from lib.util import ( ApplicationError, SubprocessError, display, run_command, deepest_path, ...
gpl-3.0
shitolepriya/Saloon_erp
erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py
60
3618
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ from erpnext.accounts.report.accounts_receivable.accounts_receivable import ReceivablePayableReport class A...
agpl-3.0
tinkerinestudio/Tinkerine-Suite
TinkerineSuite/python/Lib/OpenGL/GL/SGIX/resample.py
4
1244
'''OpenGL extension SGIX.resample This module customises the behaviour of the OpenGL.raw.GL.SGIX.resample to provide a more Python-friendly API Overview (from the spec) This extension enhances the unpacking resampling capabilities of the SGIX_subsample extension. When pixel data is received from the client a...
agpl-3.0
echoi/snac_bmi
StGermain/pyre/Debug.py
6
3662
#!/usr/bin/env python ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ## ## Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia. ## ## Authors: ## Stevan M. Quen...
gpl-2.0
OCForks/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/style/checkers/xml.py
187
2044
# Copyright (C) 2010 Apple 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: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
xcstacy/kernel-N8000
tools/perf/scripts/python/syscall-counts.py
11181
1522
# system call counts # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(os.envir...
gpl-2.0
lucasdavila/web2py-appreport
modules/plugin_appreport/libs/appreport/libs/pisa/libs/reportlab/src/reportlab/graphics/charts/legends.py
10
27172
#Copyright ReportLab Europe Ltd. 2000-2004 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/graphics/charts/legends.py __version__=''' $Id: legends.py 3723 2010-06-08 15:46:32Z juraj $ ''' __doc__="""This will be a collection of legends to be...
lgpl-3.0
rugebiker/Contrarreloj
src/ventanaregistro.py
1
7601
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'ventanaregistro.ui' # # Created: Fri Jan 14 19:31:48 2011 # by: PyQt4 UI code generator 4.8.2 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except...
gpl-3.0
adieu/python-openid
openid/test/test_extension.py
77
1293
from openid import extension from openid import message import unittest class DummyExtension(extension.Extension): ns_uri = 'http://an.extension/' ns_alias = 'dummy' def getExtensionArgs(self): return {} class ToMessageTest(unittest.TestCase): def test_OpenID1(self): oid1_msg = messa...
apache-2.0
adviti/melange
thirdparty/google_appengine/lib/django_1_2/tests/regressiontests/utils/dateformat.py
39
5828
from datetime import datetime, date import os import time import unittest from django.utils.dateformat import format from django.utils import dateformat, translation from django.utils.tzinfo import FixedOffset, LocalTimezone class DateFormatTests(unittest.TestCase): def setUp(self): self.old_TZ = os.envir...
apache-2.0
ProfessionalIT/professionalit-webiste
sdk/google_appengine/google/appengine/ext/datastore_admin/backup_pb2.py
6
17101
#!/usr/bin/env python # # 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 # # Unless required by applicable law o...
lgpl-3.0
hugovk/terroroftinytown
terroroftinytown/services/isgd.py
2
3885
# encoding=utf-8 from __future__ import unicode_literals import re import time from terroroftinytown.client import errors from terroroftinytown.client.errors import PleaseRetry from terroroftinytown.services.base import BaseService from terroroftinytown.services.rand import HashRandMixin from terroroftinytown.service...
mit
meierue/RNNLIB
utils/plot_errors.py
1
2250
#!/usr/bin/env python from matplotlib.pyplot import * import re from optparse import OptionParser usage = "usage: %prog log_file" parser = OptionParser(usage) parser.add_option("-v", "--verbose", dest="verbose", default=False, action="store_true", help="verbose plot (including error types with verboseChar)?") parser.a...
gpl-3.0
imminfo/ymir
inference.py
1
1968
import os import sys from pyymir import * DIRNAME = os.path.dirname(sys.argv[0]) DIRNAME = DIRNAME if DIRNAME else "./" if __name__ == "__main__": ap = default_ymir_ap() ap.add_argument("-a", "--algorithm", help = "name of the algorithm for the statistical inference (default is 'em'). For a list of availab...
apache-2.0
myles-archive/asgard-calendar
events/tests.py
2
1812
from django.test import Client from django.core.urlresolvers import reverse from events.models import Event from django.test import TestCase client = Client() class EventsTestCase(TestCase): fixtures = ['auth', 'events',] def setUp(self): self.event = Event.objects.get(pk=3) def testEventsIndex(self): re...
bsd-3-clause
nicholsn/ncanda-data-integration
scripts/reporting/xnat_extractor.py
2
12824
#!/usr/bin/env python ## ## See COPYING file distributed along with the ncanda-data-integration package ## for the copyright and license terms ## """ NCANDA XNAT Extractor Extract all experiment, scan, and reading data from NCANDA's XNAT server. """ __author__ = "Nolan Nichols <http://orcid.org/0000-0003-1099-3328>"...
bsd-3-clause
mbauskar/Das_Erpnext
erpnext/setup/doctype/backup_manager/backup_manager.py
23
3457
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt # For license information, please see license.txt from __future__ import unicode_literals from frappe.utils import get_site_path from frappe.utils.data import convert_utc_to_user_timezone imp...
agpl-3.0
pombredanne/ctypesgen
test/testsuite.py
12
9617
#!/usr/bin/env python # -*- coding: ascii -*- # vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab # """Simple test suite using unittest. By clach04 (Chris Clark). Calling: python test/testsuite.py or cd test ./testsuite.py Could use any unitest compatible test runner (nose, etc.) Aims to test for regres...
bsd-3-clause
keptenkurk/mxpgm
mxrestore.py
2
10303
# **************************************************************************** # * mxrestore.py # * Mobotix camera config restore utility # # This script restores configfiles to (multiple) mobotix camera's # through Mobotix API # See http://developer.mobotix.com/paks/help_cgi-remoteconfig.html for details # usage: # py...
mit
SimpleAOSP-Kernel/kernel_shamu
tools/perf/scripts/python/failed-syscalls-by-pid.py
11180
2058
# failed system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
gpl-2.0
jcbagneris/fms
fms/contrib/coleman/checksuccess.py
2
7398
#!/usr/bin/env python # -*- coding: utf8 -*- """ Checks the Success of Agent Behaviors """ __author__ = "Sami Nazif / Patrick Coleman" __license__ = "BSD" import sys import dumbstartfms def main(): """ Runs a head to head competition of agent behavior types. """ expnum = 0 agents = [] overall...
bsd-3-clause
turbokongen/home-assistant
tests/components/template/test_switch.py
14
23138
"""The tests for the Template switch platform.""" import pytest from homeassistant import setup from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN from homeassistant.const import ( ATTR_ENTITY_ID, SERVICE_TURN_OFF, SERVICE_TURN_ON, STATE_OFF, STATE_ON, STATE_UNAVAILABLE, ) fr...
apache-2.0
Action-Committee/unstakeable
share/qt/extract_strings_qt.py
2945
1844
#!/usr/bin/python ''' Extract _("...") strings for translation and convert to Qt4 stringdefs so that they can be picked up by Qt linguist. ''' from subprocess import Popen, PIPE import glob import operator OUT_CPP="src/qt/bitcoinstrings.cpp" EMPTY=['""'] def parse_po(text): """ Parse 'po' format produced by x...
mit
SiCKRAGETV/SickRage
sickrage/libs/adba/aniDBmaper.py
6
6268
#!/usr/bin/env python # coding=utf-8 # # This file is part of aDBa. # # aDBa 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. # # aDBa i...
gpl-3.0
Bezoar/surrender-rides
bp_includes/external/wtforms/fields/simple.py
85
1274
from .. import widgets from .core import StringField, BooleanField __all__ = ( 'BooleanField', 'TextAreaField', 'PasswordField', 'FileField', 'HiddenField', 'SubmitField', 'TextField' ) class TextField(StringField): """ Legacy alias for StringField """ class TextAreaField(TextField): """ ...
mit
jonparrott/google-cloud-python
automl/google/cloud/automl_v1beta1/proto/operations_pb2.py
3
8501
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/cloud/automl_v1beta1/proto/operations.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google...
apache-2.0
LobsterBandit/Movie_List
update_db.py
1
2861
import sqlite3 import datetime from config import DATABASE def upsert_db(movie_list, database=DATABASE): try: db = sqlite3.connect(database) cur = db.cursor() for movie in movie_list: cur.execute(""" insert or replace into Movie_List (id, Filename, Size, Path, Titl...
mit
seanmcerlean/personal-projects
robotframework-imagetools/ImageTools/ImageSize.py
1
2728
from PIL import Image class ImageSize(): """ Providses size information and crop / resize tools for images """ def __init__(self): pass def _open_image_file(function): """ Decorator to open image file """ def read_image(image_file, *args): try: ...
gpl-3.0
linaro-technologies/jobserv
jobserv/settings.py
1
2446
# Copyright (C) 2017 Linaro Limited # Author: Andy Doan <andy.doan@linaro.org> import os import hashlib DEBUG = 1 SQLALCHEMY_TRACK_MODIFICATIONS = False _fmt = os.environ.get('SQLALCHEMY_DATABASE_URI_FMT') if _fmt: SQLALCHEMY_DATABASE_URI = _fmt.format( db_user=os.environ['DB_USER'], db_pass=os.environ['...
agpl-3.0