code
stringlengths
3
1.05M
repo_name
stringlengths
5
104
path
stringlengths
4
251
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
3
1.05M
from apps.plus_groups.models import TgGroup from django.contrib.auth.models import User from apps.plus_lib.parse_json import json_view def reply(f) : def g(*argv, **kwargs) : try : f(*argv,**kwargs) return {'ok':True} except Exception, e: return {'ok':False,'ms...
thehub/hubplus
apps/synced/views.py
Python
gpl-3.0
2,220
from footsteps import create_app app = create_app()
insynchq/footsteps
wsgi.py
Python
mit
53
# #!/usr/bin/env python # # """ # @package ion.agents.platform.test.test_platform_agent # @file ion/agents/platform/test/test_platform_agent.py # @author Carlos Rueda # @brief Unit test cases for R2 platform agent. # """ # # __author__ = 'Carlos Rueda' # __license__ = 'Apache 2.0' # # # import unittest # from nos...
janeen666/mi-instrument
mi/platform/test/test_platform_agent.py
Python
bsd-2-clause
682
from sympy import cos, exp, expand, I, Matrix, pi, S, sin, sqrt, Sum, symbols, Rational 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.tensorproduct import TensorProduct...
kaushik94/sympy
sympy/physics/quantum/tests/test_spin.py
Python
bsd-3-clause
343,976
""" Rate Service Module =================== This package contains classes to request pre-ship rating information and to determine estimated or courtesy billing quotes. Time in Transit can be returned with the rates if it is specified in the request. """ from datetime import datetime from .. base_service import FedexBa...
shivam1111/python-fedex
fedex/services/rate_service.py
Python
bsd-3-clause
5,261
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2015-2020 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
The-Compiler/qutebrowser
qutebrowser/misc/msgbox.py
Python
gpl-3.0
2,527
import functools import threading from concurrent.futures import ThreadPoolExecutor import traceback NUMBER_OF_THREADS = 100 def unique_step(parallel, numer_of_threads=NUMBER_OF_THREADS): """Shorten the call for calling a function after the other is completed. @serial_step def get(self, url):...
niccokunzmann/first_timer_scraper
first_timer_scraper/concurrency.py
Python
agpl-3.0
1,783
class freetype(Wig): tarball_uri = 'http://download.savannah.gnu.org/releases/freetype/freetype-{RELEASE_VERSION}.tar.gz' last_release_version = '2.4.0'
vadimkantorov/wigwam
wigs/freetype.py
Python
mit
155
''' This package wraps client to server communication managed by a Django instance. '''
exratione/thywill-python
thywill_server/src/thywill_server/client_interface/django/__init__.py
Python
mit
87
""" REST server API. .. moduleauthor:: Martijn Vermaat <martijn@vermaat.name> .. Licensed under the MIT license, see the LICENSE file. """ from .views import api
sndrtj/varda
varda/api/__init__.py
Python
mit
166
# Author: Philippe Katz <philippe.katz@gmail.com>, # Sylvain Takerkart <Sylvain.Takerkart@univ-amu.fr> # License: BSD Style. # Trial-level directories oitrials_analysis = ( 'conditions',SetType( 'Trials+conditions list' ), # Conditions file : contains informations about datas 'physio_params',SetType( '...
SylvainTakerkart/vobi_one
brainvisa/toolboxes/vobi_one/hierarchies/brainvisa-3.1.0/oitrials_analysis.py
Python
gpl-3.0
1,680
import pytest from ledger.compact_merkle_tree import CompactMerkleTree from ledger.hash_stores.memory_hash_store import MemoryHashStore from ledger.test.test_file_hash_store import nodesLeaves from ledger.ledger import Ledger from plenum.common.constants import HS_LEVELDB, HS_ROCKSDB, HS_MEMORY from plenum.persistence...
evernym/plenum
plenum/test/storage/test_hash_stores.py
Python
apache-2.0
2,091
#!/usr/bin/env python # vim: ts=4:sw=4:expandtab # BleachBit # Copyright (C) 2008-2020 Andrew Ziem # https://www.bleachbit.org # # 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...
tstenner/bleachbit
bleachbit/CLI.py
Python
gpl-3.0
9,877
# -*- coding: utf-8 -*- # File: __init__.py # https://github.com/celery/kombu/blob/7d13f9b95d0b50c94393b962e6def928511bfda6/kombu/__init__.py#L34-L36 STATICA_HACK = True globals()['kcah_acitats'[::-1].upper()] = False if STATICA_HACK: from .bsds500 import * from .cifar import * from .ilsvrc import * ...
google-research/ssl_detection
third_party/tensorpack/tensorpack/dataflow/dataset/__init__.py
Python
apache-2.0
1,073
import sys import re tag_re = re.compile("<.*?>") def write(text): pass def writebr(text): pass data = "" def write_web(text): global data from __pyjamas__ import JS data += text JS(" $m.element.innerHTML = $m.data; ") def writebr_web(text): write(text + "<br />\n") def init_web(): ...
minghuascode/pyj
pyjs/src/pyjs/lib/test/write.py
Python
apache-2.0
777
# 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. from telemetry.core.platform.profiler import profiler_finder class ProfilingControllerBackend(object): def __init__(self, platform_backend, browser_backen...
CTSRD-SOAAP/chromium-42.0.2311.135
tools/telemetry/telemetry/core/platform/profiling_controller_backend.py
Python
bsd-3-clause
1,761
## ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013-2015, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This ...
ThomasMiconi/nupic.research
projects/sequence_prediction/continuous_sequence/run_tm_model_compare_sdr_cla_classifier.py
Python
agpl-3.0
18,807
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: pogoprotos/enums/camera_target.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protob...
bellowsj/aiopogo
aiopogo/pogoprotos/enums/camera_target_pb2.py
Python
mit
4,527
# -*- coding: utf-8 -*- # Copyright© 2016 ICTSTUDIO <http://www.ictstudio.eu> # Copyright 2016 ACSONE SA/NV (<http://acsone.eu>) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { 'name': "MIS Builder Cost Center Filter", 'version': '8.0.1.0.0', 'category': 'Reporting', 'summary': "...
ICTSTUDIO/accounting-addons
mis_builder_cost_center_filter/__openerp__.py
Python
agpl-3.0
793
import warnings import numpy as np from sets.core import Step class WordDistance(Step): def __init__(self, *tags, depth=2): self._tags = tags self._depth = depth def __call__(self, dataset, column): # pylint: disable=arguments-differ dataset = dataset.copy() if 'word_...
danijar/sets
sets/process/word_distance.py
Python
mit
1,277
# -*- coding: utf-8 -*- ############################################################################### # # Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License a...
Micronaet/micronaet-addons-private
intervent_valorization/__openerp__.py
Python
agpl-3.0
1,567
# election/views_admin.py # Brought to you by We Vote. Be good. # -*- coding: UTF-8 -*- from .controllers import election_remote_retrieve, elections_import_from_master_server from .models import Election from admin_tools.views import redirect_to_sign_in_page from analytics.models import AnalyticsManager from ballot.co...
jainanisha90/WeVoteServer
election/views_admin.py
Python
mit
120,263
# Copyright (C) 2015 ycmd contributors # # This file is part of ycmd. # # ycmd 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. # # ycmd...
snakeleon/YouCompleteMe-x86
third_party/ycmd/ycmd/tests/python/subcommands_test.py
Python
gpl-3.0
6,804
# coding=utf-8 from __future__ import absolute_import import time from yaya import config from yaya.collection.dict import CoreDict from yaya.const import logger from yaya.utility.singleton import singleton __author__ = 'tony' class BiGramTable: def __init__(self): self.start = [] self.pair = [...
Tony-Wang/YaYaNLP
yaya/collection/bigram.py
Python
apache-2.0
3,957
# -*- coding:utf-8 -*- import unittest import mock from ..forms import PraxisForm class FirstPraxisFormTestCase(unittest.TestCase): @mock.patch('employer.forms.UserInitializationFormMixin.save') def test_should_save_business_and_return_instance(self, save): # setup form = PraxisForm() ...
hellhovnd/dentexchange
dentexchange/apps/employer/tests/test_praxis_form.py
Python
bsd-3-clause
700
# -*- coding: utf-8 -*- """This module includes helper classes, mixins, and objects for database functionality with SQLAlchemy.""" # Third-Party modules from sqlalchemy.inspection import inspect # Project specific modules from api.compat import basestring from api.extensions import db class ModelSerializer(objec...
jaredmichaelsmith/grove
api/database.py
Python
mit
2,761
#!/usr/bin/env python from __future__ import absolute_import, division, print_function, with_statement from tornado import netutil from tornado.escape import json_decode, json_encode, utf8, _unicode, recursive_unicode, native_str from tornado import gen from tornado.http1connection import HTTP1Connection from tornado...
mr-ping/tornado
tornado/test/httpserver_test.py
Python
apache-2.0
41,934
""" Collection of python utility-methodes commonly used by other bibliograph packages. From http://pypi.python.org/pypi/bibliograph.core/ from Tom Gross <itconsense@gmail.com> Adapted for calibre use Zope Public License (ZPL) Version 2.1 A copyright notice accompanies this license document th...
jelly/calibre
src/calibre/utils/bibtex.py
Python
gpl-3.0
91,137
"""Tests for Grow locales.""" import unittest from grow.testing import testing from grow.translations import locales class LocalesTest(unittest.TestCase): def test_eq(self): locale = locales.Locale('en_US') self.assertEqual(locale, 'en_US') self.assertEqual(locale, 'en_us') self....
grow/pygrow
grow/translations/locales_test.py
Python
mit
1,390
import unittest import utils # O(nlog(n)) time. O(n) space. Sorting, hash table. class Solution: def longestWord(self, words): """ :type words: List[str] :rtype: str """ result = '' words.sort() visited = set() for word in words: if len(...
chrisxue815/leetcode_python
problems/test_0720_hashtable.py
Python
unlicense
841
from urllib.parse import unquote from scrapy.core.downloader.handlers.http import HTTPDownloadHandler from scrapy.exceptions import NotConfigured from scrapy.utils.boto import is_botocore from scrapy.utils.httpobj import urlparse_cached from scrapy.utils.misc import create_instance def _get_boto_connection(): fr...
eLRuLL/scrapy
scrapy/core/downloader/handlers/s3.py
Python
bsd-3-clause
4,259
#!/usr/bin/env python # -*- coding:utf-8 -*- import csv from db import Species from db import create_session def import_species_csv(csv_file, col_index=0, delimiter=',', quote_char='"'): session = create_session() species_name_list = [] with open(csv_file, 'rb') as csv_file: data_list = csv.read...
howl-anderson/SDMdata
sdmdata/sdmdata/import_species_csv.py
Python
agpl-3.0
1,112
from ..base import BaseTest from ...models.User import UserModel class Test(BaseTest): def test_get_key_validation(self): user = self.session.query(UserModel).filter_by( key='key_validation').first() self.assertIsInstance(user.value, bytes) def test_repr(self): user = sel...
gabfl/vault
src/unittest/models/test_User.py
Python
mit
442
# Copyright (c) 2008, 2010 Aldo Cortesi # Copyright (c) 2011 Florian Mounier # Copyright (c) 2011 Anshuman Bhaduri # # 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, inclu...
de-vri-es/qtile
test/test_utils.py
Python
mit
3,005
#--- API LICENSE CONFIGURATION ----------------------------------------------------------------------- # Default license keys used by pattern.web.SearchEngine to contact different API's. # Google and Yahoo are paid services for which you need a personal license + payment method. # The default Google license is for test...
krishna11888/ai
third_party/pattern/pattern/web/api.py
Python
gpl-2.0
1,205
# 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 agreed to in writing, software #...
varunarya10/rally
tests/unit/benchmark/scenarios/ec2/test_utils.py
Python
apache-2.0
3,016
#!/usr/bin/python # # Developer: Grigori Fursin, Grigori.Fursin@cTuning.org, http://fursin.net # import os import sys import json ############################################################################## # customize installation def setup(i): """ Input: { cfg - meta of this ...
ctuning/ck-env
package/compiler-llvm-7.0.1-universal/custom.py
Python
bsd-3-clause
5,311
# Copyright 2018 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...
hfp/tensorflow-xsmm
tensorflow/contrib/distributions/python/ops/bijectors/batch_normalization.py
Python
apache-2.0
11,155
# -*- 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 ...
ctmil/meli_oerp
models/product.py
Python
agpl-3.0
179,498
from datetime import datetime from django.views.generic import DetailView, ListView from django.db.models import Count from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from uk_political_parties.models import Party from leaflets.models import Leaflet class PartyList(ListView): def get_quer...
JustinWingChungHui/electionleaflets
electionleaflets/apps/parties/views.py
Python
mit
1,853
# -*- coding: utf-8 -*- """ plugins/cache.py - handles global database of cache details. Copyright (C) 2009-2011 Petr Morávek This file is part of Pyggs. Pyggs 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 ...
xificurk/pyggs
plugins/cache.py
Python
gpl-2.0
11,661
# This is the hardware file from my shack, which controls various hardware. # The files to control my 2010 transceiver and for the improved version HiQSDR # are in the package directory HiQSDR. from hiqsdr.quisk_hardware import Hardware as BaseHw from n2adr import station_hardware class Hardware(BaseHw): def __init...
n1ywb/quisk
n2adr/quisk_hardware.py
Python
gpl-2.0
2,195
# proxy module from pyface.qt.QtScript import *
enthought/etsproxy
enthought/qt/QtScript.py
Python
bsd-3-clause
48
# # Copyright (c) 2015-2018 Canonical, Ltd. # # This file is part of Talisker # (see http://github.com/canonical-ols/talisker). # # 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 # regardin...
bloodearnest/talisker
scripts/build_setup.py
Python
gpl-3.0
3,172
import _plotly_utils.basevalidators class BgcolorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__( self, plotly_name="bgcolor", parent_name="layout.annotation", **kwargs ): super(BgcolorValidator, self).__init__( plotly_name=plotly_name, parent_name=...
plotly/plotly.py
packages/python/plotly/plotly/validators/layout/annotation/_bgcolor.py
Python
mit
424
"""empty message Revision ID: 633c71628a85 Revises: 6ef86889eac2 Create Date: 2016-03-28 23:36:48.733473 """ # revision identifiers, used by Alembic. revision = '633c71628a85' down_revision = '6ef86889eac2' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic - ...
joeflack4/vanillerp
migrations/versions/633c71628a85_.py
Python
mit
715
import distribute_setup distribute_setup.use_setuptools() from setuptools import setup, find_packages,Extension # setup package name etc as a default pkgname = 'pyburmish' pkg_dir = {'':'.'} pkg_location = '.' setup( name=pkgname, version='0.1', packages=find_packages(pkg_location), pa...
LinguList/burmish
setup.py
Python
gpl-2.0
551
############################################################################## # # Copyright (c) 2009 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
ankur22/Butler
topia/termextract/interfaces.py
Python
mit
1,701
# Copyright 2019 Microsoft Corp # Copyright The Cloud Custodian Authors. # SPDX-License-Identifier: Apache-2.0 from .common import BaseTest from c7n.lookup import Lookup class LookupTest(BaseTest): def test_lookup_type(self): number_schema = {'type': 'number'} lookup_default_number = Lookup.loo...
alfredgamulo/cloud-custodian
tests/test_lookup.py
Python
apache-2.0
2,809
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- VERSION =...
Azure/azure-sdk-for-python
sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_version.py
Python
mit
330
#!/usr/bin/env python # Copyright (c) 2012 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. '''Unit test for lazy_re. ''' import os import sys if __name__ == '__main__': sys.path.append(os.path.join(os.path.dirname(sys.a...
JoKaWare/WTL-DUI
tools/grit/grit/lazy_re_unittest.py
Python
bsd-3-clause
934
#!/usr/bin/env python3 # THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE. # Copyright (C) NIWA & British Crown (Met Office) & Contributors. # # 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, eithe...
oliver-sanders/cylc
cylc/flow/scripts/pause.py
Python
gpl-3.0
2,206
import random import string from django import forms from django.conf import settings from django.contrib.auth import forms as auth_forms from django.contrib.auth.forms import AuthenticationForm from django.contrib.sites.shortcuts import get_current_site from django.core.exceptions import ValidationError from django.u...
vicky2135/lucious
src/oscar/apps/customer/forms.py
Python
bsd-3-clause
15,625
# Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2009 Douglas S. Blank <doug.blank@gmail.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 of the L...
arunkgupta/gramps
gramps/webapp/grampsdb/view/tag.py
Python
gpl-2.0
3,383
# coding: utf-8 from ctypes import * import sys import getopt ########################################### class VSC_level_desc(Structure): _fields_ = [ ("verbosity", c_uint), # unsigned verbosity; ("label", c_char_p), # const char *label; /* label */ ("sdesc", c_char_p), # const char ...
bearstech/varnishstatd
varnishapi.py
Python
bsd-2-clause
20,063
# -*- coding: utf-8 -*- from __future__ import unicode_literals import inspect import six import warnings from flask.views import http_method_funcs from .errors import abort from .marshalling import marshal, marshal_with from .model import Model from .reqparse import RequestParser from .utils import merge class Na...
awiddersheim/flask-restplus
flask_restplus/namespace.py
Python
mit
10,735
# 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...
TakayukiSakai/tensorflow
tensorflow/python/kernel_tests/partitioned_variables_test.py
Python
apache-2.0
16,388
from pywatson.util.dictable import Dictable class WatsonQuestion(Dictable): """A question to ask Watson""" def __init__(self, question_text, answer_assertion=None, category=None, context=None, evidence_request=None, ...
sherlocke/pywatson
pywatson/question/watson_question.py
Python
mit
1,985
""" Regression tests for rescinding outstanding subscription requests. """ from twisted.words.protocols.jabber.client import IQ from servicetest import (EventPattern, wrap_channel, assertLength, assertEquals, call_async, sync_dbus) from hazetest import exec_test import constants as cs import ns jid = 'marco@...
fcrozat/telepathy-haze
tests/twisted/roster/removed-from-rp-subscribe.py
Python
gpl-2.0
6,175
# BASEGAME CHAT SERVER # created by Jacob Mealey import sys import socket import select import json import random import os HOST = '' SOCKET_LIST = [] RECV_BUFFER = 4096 PORT = 9009 inventoryItems = [] os.system('clear') class bcolors: #text colors HEADER = '\033[0m' OKBLUE = '\033[94m' OKGREEN ...
jakeydoodle123/basegame
basegame/basegameCL.py
Python
gpl-3.0
5,543
""" S3 Image Optimizer optimizes all images found in an Amazon S3 bucket. """ from setuptools import find_packages, setup dependencies = [ 'click==5.1', 'boto==2.38.0', ] setup( name='s3-image-optimizer', version='0.1.0', url='https://github.com/svengt/s3-image-optimizer', download_url='https:...
svengt/s3-image-optimizer
setup.py
Python
bsd-3-clause
1,804
# -*- coding: utf-8 -*- """ /*************************************************************************** ApiCompat A QGIS plugin QGis class compatibility layer ------------------- begin : 2015-03-12 copyright : (C...
manisandro/qgis-cloud-plugin
qgiscloud/apicompat/sipv1/qgisapi.py
Python
gpl-2.0
1,820
from hello.bar import \ foo from hello._bar import \ hello
esc/Bento
examples/simples/single_extension_waf/hello/__init__.py
Python
bsd-3-clause
75
# -*- coding: utf-8 -*- # © 2015 Eficent Business and IT Consulting Services S.L. - # Jordi Ballester Alomar # © 2015 Serpent Consulting Services Pvt. Ltd. - Sudhir Arya # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from . import project_task
sysadminmatmoz/pmis
project_wbs_task/model/__init__.py
Python
agpl-3.0
270
''' UrlRequest ========== .. versionadded:: 1.0.8 You can use the :class:`UrlRequest` to make asynchronous requests on the web and get the result when the request is completed. The spirit is the same as the XHR object in Javascript. The content is also decoded if the Content-Type is application/json and the result a...
Cheaterman/kivy
kivy/network/urlrequest.py
Python
mit
20,534
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 OpenStack LLC. # 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/LICEN...
pvo/keystone
keystone/contrib/extensions/admin/osksadm/extension_handler.py
Python
apache-2.0
3,575
__author__ = 'Ara Sadoyan' import glob, os, sys import ConfigParser import logging import threading sys.path.append(os.path.dirname(os.path.realpath("__file__"))+'/checks_enabled') config = ConfigParser.RawConfigParser() config.read(os.getcwd()+'/conf/config.ini') cron_interval = int(config.get('SelfConfig', 'check_...
net-angels/puypuy
one_shot.py
Python
apache-2.0
942
# -*- coding: utf-8 -*- """ PyConES 2016 Almería """ import mysql.connector from mysql.connector import errorcode import rspace from rspace.lib.auth import decode_pass from rspace.common.exceptions import DBError USER = 'pycones' HOST = 'pymysql' SECRET = '{0}/secret/pass.ssl'.format(rspace.__ppath__) PRIV = '{0}/s...
klashxx/PyConES
rspace/rspace/db/mysqlm.py
Python
mit
1,339
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst # # Astropy documentation build configuration file. # # 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 file. # # All configurati...
keflavich/gaussfitter
docs/conf.py
Python
bsd-3-clause
5,992
import unittest from iepy.data.models import TextSegment, EntityOccurrence from iepy.preprocess.segmenter import RawSegment, SyntacticSegmenterRunner from .factories import IEDocFactory, EntityFactory, EntityOccurrenceFactory, TextSegmentFactory from .manager_case import ManagerTestCase def RSF(offset=0, offset_end...
machinalis/iepy
tests/test_segments.py
Python
bsd-3-clause
10,069
from dusty.systems.docker.testing_image import ImageCreationError from ..fixtures import fixture_with_commands, specs_fixture_with_depends from ..testcases import DustyIntegrationTestCase class TestCommandFile(DustyIntegrationTestCase): def setUp(self): super(TestCommandFile, self).setUp() fixture...
gamechanger/dusty
tests/integration/command_file_test.py
Python
mit
3,987
from HTMLComponent import HTMLComponent from GUIComponent import GUIComponent from enigma import eEPGCache, eListbox, eListboxPythonMultiContent, gFont, \ RT_HALIGN_LEFT, RT_HALIGN_RIGHT, RT_HALIGN_CENTER, RT_VALIGN_CENTER from Tools.Alternatives import CompareWithAlternatives from Tools.LoadPixmap import LoadPixmap...
Taapat/enigma2-openpli-fulan
lib/python/Components/EpgList.py
Python
gpl-2.0
16,648
import re import json from tastypie.authorization import Authorization class GenericAuthorization(Authorization): def create_list(self, object_list, bundle): raise Unauthorized("Sorry, no create list.") def delete_list(self, object_list, bundle): raise Unauthorized("Sorry, no deletes.") ...
taikoa/wevolver-server
wevolve/libs/authorization.py
Python
agpl-3.0
418
DEPLOY_MODE = "proddev" COMPRESS_ENABLED = True USE_CELERY = True DISABLE_REPORTING_DB = True HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.BaseSignalProcessor' BASE_ABS_URL = "https://coursys-demo.cs.sfu.ca"
sfu-fas/coursys
machines/chef/cookbooks/coursys_demo/files/default/localsettings.py
Python
gpl-3.0
209
################################################################################ # Peach - Computational Intelligence for Python # Jose Alexandre Nalon # # This file: tutorial/linear-prediction.py # Using neural networks to predict number sequences #######################################################################...
anki1909/peach
tutorial/neural-networks/interpolation.py
Python
lgpl-2.1
4,041
import warnings import cupy from cupyx.scipy import sparse from cupyx.scipy.sparse import _util class LinearOperator(object): """LinearOperator(shape, matvec, rmatvec=None, matmat=None, dtype=None, \ rmatmat=None) Common interface for performing matrix vector products To construct a concrete LinearOpe...
cupy/cupy
cupyx/scipy/sparse/linalg/_interface.py
Python
mit
17,234
import subprocess import shlex import sys import logging import os import datetime import math import glob import pipes from dateutil import relativedelta ################################## # Generate tooltip thumbnail images & corresponding WebVTT file for a video (e.g MP4). # Final product is one *_sprite.jpg file an...
vlanard/videoscripts
sprites/makesprites.py
Python
mit
13,056
"""Support for UPnP/IGD Sensors.""" from __future__ import annotations from datetime import timedelta from typing import Any, Mapping from homeassistant.components.sensor import SensorEntity from homeassistant.config_entries import ConfigEntry from homeassistant.const import DATA_BYTES, DATA_RATE_KIBIBYTES_PER_SECOND...
w1ll1am23/home-assistant
homeassistant/components/upnp/sensor.py
Python
apache-2.0
8,396
# 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...
wangsheng1001/incubator-singa
python/singa/metric.py
Python
apache-2.0
2,924
from setuptools import setup setup(name='peergrader', version='0.1', description='Peer grading project', url='https://github.com/chrisgtech/peergrader', author='Chris Graham', author_email='chrisgraham@example.com', license='GPLv3', packages=[''], zip_safe=False)
chrisgtech/peergrader
setup.py
Python
gpl-3.0
312
# coding: utf-8 """ Talon.One API The Talon.One API is used to manage applications and campaigns, as well as to integrate with your application. The operations in the _Integration API_ section are used to integrate with our platform, while the other operations are used to manage applications and campaigns. #...
talon-one/talon_one.py
test/test_loyalty_sub_ledger.py
Python
mit
6,685
#!/usr/bin/env python import syslog from user_data import get_user_data import tempfile from subprocess import call import os import stat # Pull the init script out of user data if it exists user_data = get_user_data() if not user_data.get('init'): syslog.syslog(syslog.LOG_WARNING, 'Skipping init script (non-given)...
hayesgm/cerberus
scripts/cerberus_user_init.py
Python
mit
1,114
#!/usr/bin/python3.4 # -*- coding: utf-8 -*- from forbiddenfruit import curse controlcodes = {'bold': '\x02', 'underlined': '\x1F', 'italic': '\x1D', 'reset': '\x0F', 'reverse': '\x16'} colorlist = {'white': '00', ...
suut/psychic-happiness
format.py
Python
unlicense
2,158
#!/usr/bin/env python # # Using a microcontroller with the serial_bridge firmware installed, # this sends several controller bus writes with different content. # It reads back the controller-generated CRCs for each packet, storing # the packet and CRC as test vectors for our reverse engineered CRC # algorithm. # # The ...
MathewWi/cube64-dx
notes/get_crc_test_vectors.py
Python
gpl-2.0
1,848
""" Tests Feed mapping objects """ import json import pytest from anchore_engine.services.policy_engine.engine.feeds.mappers import ( GemMetadata, GemPackageDataMapper, NpmMetadata, NpmPackageDataMapper, Vulnerability, VulnerabilityFeedDataMapper, ) test_cve = { "Vulnerability": { ...
anchore/anchore-engine
tests/integration/services/policy_engine/feeds/test_mapping.py
Python
apache-2.0
8,285
# -*- coding: utf-8 -*- # Copyright(C) 2010-2012 Romain Bignon, Florent Fourcot # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the Licen...
blckshrk/Weboob
modules/sachsen/browser.py
Python
agpl-3.0
1,646
# This file is part of waymarkedtrails.org # Copyright (C) 2016 Sarah Hoffmann # # This 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 any later version. # # This program...
jschleic/waymarked-trails-site
frontend/compatibility.py
Python
gpl-3.0
2,950
from __future__ import unicode_literals import httplib import logging from django.core.exceptions import ValidationError from django.db import IntegrityError from django.db import connection from django.db import transaction from flask import request from framework.auth import Auth from framework.sessions import ge...
mattclark/osf.io
addons/osfstorage/views.py
Python
apache-2.0
17,023
#!/usr/bin/python3 from gi.repository import GLib from gi.repository import OpenDCS import sys class DcsExample(object): def __init__(self): self.dcsobject = OpenDCS.Object() self.dcsobject.set_property('id', 'test') print("Object hash: ", self.dcsobject.get_property('hash')) if __name__...
geoffjay/opendcs-core
examples/minimal.py
Python
lgpl-3.0
353
# 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 appl...
tongwang01/tensorflow
tensorflow/examples/learn/text_classification_builtin_rnn_model.py
Python
apache-2.0
3,171
# The contents of this file are subject to the BitTorrent Open Source License # Version 1.1 (the License). You may not copy or use this file, in either # source code or executable form, except in compliance with the License. You # may obtain a copy of the License at http://www.bittorrent.com/license/. # # Software di...
rays/ipodderx-core
BitTorrent/obsoletepythonsupport.py
Python
mit
1,006
# coding: utf-8 from __future__ import print_function import logging import math import numpy as np def generate_points(n, min_x=-5, min_y=-5, max_x=5, max_y=5): return [(np.random.uniform(min_x, max_x), np.random.uniform(min_y, max_y)) for x in range(n)] def dist(a, b): """ euclidean distance...
GianlucaBortoli/enhanced-clustering
src/kmeans.py
Python
bsd-3-clause
2,388
from collections import deque from itertools import takewhile, imap from operator import itemgetter from util import primes print deque( imap(itemgetter(1), takewhile(lambda (i, v): i < 10001, enumerate(primes()))), maxlen=1).pop()
jcdenton/project-euler
python/problem007.py
Python
mit
252
#!/usr/bin/python2.4 # vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab # # $Id$ # # Copyright (C) 1999-2006 Keith Dart <keith@kdart.com> # # 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...
xiangke/pycopia
experimental/pycopia/seriallib.py
Python
lgpl-2.1
2,245
'''Parses configuration file and sets project wide constants. This file has intrinsic naming difficulties because it is trying to be platform agnostic but naming variables is inherently platform specific (i.e directory vs folder) ''' __author__ = 'foxcarlos-TeamCreed', 'Tobin Harding' import os from random import shuf...
cpacia/OpenBazaar-Server
config.py
Python
mit
9,140
""" The MIT License Copyright (c) 2007 Leah Culver 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, publis...
pydotorg/pypi
oauth.py
Python
bsd-3-clause
23,584
from IECore import * class cobReader( Op ) : def __init__( self ) : Op.__init__( self, "Op that reads a COB from disk.", ObjectParameter( name = "result", description = "The Cortex Object read from disk.", defaultValue = NullObject(), type = TypeId.Object ) ) self.parameters().addPar...
code-google-com/cortex-vfx
test/IECoreHoudini/ops/cobReader/cobReader-1.py
Python
bsd-3-clause
609
# -*- coding: utf-8 -*- from __future__ import unicode_literals import unittest class SimplesTests(unittest.TestCase): def setUp(self): print('foo') def test_soma(self): resultado = 1 + 2 self.assertEqual(3, resultado) def test_foo(self): pass # self.fail('Falhou...
renzon/gae-t01
backend/test/simples_tests.py
Python
mit
419
from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse_lazy from django.http import HttpResponseRedirect from django.utils.decorators import method_decorator from django.views.generic import CreateView, DeleteView, DetailView, UpdateView from .forms import ProfileForm fro...
josefmonje/Django_demo
main/views.py
Python
mit
2,800
# # 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...
axbaretto/beam
sdks/python/apache_beam/io/bigquery_test.py
Python
apache-2.0
33,843