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
# coding: utf-8 from geventwebsocket.handler import WebSocketHandler from gevent import pywsgi, sleep import json import MySQLdb class JPC: # # 初期化 # def __init__(self, filepath_config): import hashlib # 設定ファイルをロード fp = open(filepath_config, 'r') config = json.load(fp) ...
ptr-yudai/JokenPC
server/JPC.py
Python
mit
11,068
from datetime import datetime import unittest from trac.util.datefmt import utc from trac.wiki.model import WikiPage from trac.wiki.tests import formatter # == [[Image]] IMAGE_MACRO_TEST_CASES = u""" ============================== source: Image, no other arguments [[Image(source:test.png)]] -------------------------...
zjj/trac_hack
trac/wiki/tests/macros.py
Python
bsd-3-clause
10,812
# Copyright 2021 Ecosoft Co., Ltd. (http://ecosoft.co.th) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from openupgradelib import openupgrade @openupgrade.migrate() def migrate(env, version): """ Column `purchase_id` of table `account_move_line` has been renamed to `purchase_order_id` b...
OCA/account-financial-tools
account_move_line_purchase_info/migrations/14.0.1.0.0/pre-migration.py
Python
agpl-3.0
842
import amo.tests from apps.access.acl import action_allowed_user from apps.users.models import UserProfile from zadmin.management.commands.addusertogroup import do_adduser from zadmin.management.commands.removeuserfromgroup import do_removeuser class TestCommand(amo.tests.TestCase): fixtures = ['zadmin/group_adm...
muffinresearch/olympia
apps/zadmin/tests/test_commands.py
Python
bsd-3-clause
658
from django.test import TestCase from ..models import release_meta class test_release_meta(TestCase): def setUp(self): self.subject = release_meta() def test__release_meta__instance(self): self.assertIsInstance(self.subject, release_meta) def test__release_meta__str(self): self.a...
marios-zindilis/musicbrainz-django-models
musicbrainz_django_models/tests/test_release_meta.py
Python
gpl-2.0
366
#! /usr/bin/env python import os, sys from twisted.internet import reactor, defer from twisted.python import log from twisted.application import service from foolscap.api import Tub, fireEventually MB = 1000000 class SpeedTest: DO_IMMUTABLE = True DO_MUTABLE_CREATE = True DO_MUTABLE = True def __ini...
drewp/tahoe-lafs
src/allmydata/test/check_speed.py
Python
gpl-2.0
9,161
# Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.minigame.TwoDTreasureMgr from panda3d.core import NodePath, Point3 from direct.directnotify import DirectNotifyGlobal from direct.showbase.DirectObject import DirectObject from toontown.minigame import ToonBlitzGlobals from toontown.minigame impor...
DedMemez/ODS-August-2017
minigame/TwoDTreasureMgr.py
Python
apache-2.0
2,737
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2011 Yesudeep Mangalapilly <yesudeep@gmail.com> # Copyright 2012 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 # # ...
devs1991/test_edx_docmode
venv/lib/python2.7/site-packages/watchdog/utils/bricks.py
Python
agpl-3.0
7,584
#! /usr/bin/env python # See README.txt for information and build instructions. import addressbook_pb2 import sys # This function fills in a Person message based on user input. def PromptForAddress(person): person.id = int(raw_input("Enter person ID number: ")) person.name = raw_input("Enter name: ") email = ...
gameduell/kythe
third_party/proto/examples/add_person.py
Python
apache-2.0
1,660
__author__ = 'ranveer' from django.conf.urls import patterns, include, url from authentication import views urlpatterns = patterns('', url(r'^$', views.home, name='home'), url(r'^register/', views.register, name='register'), #url(r'^login', views.authentication, name='login'), #url(r'^logout', views.lo...
asm-products/talenge
talenge-project/authentication/urls.py
Python
agpl-3.0
344
# -*- 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...
rajul/tvb-library
tvb/simulator/demos/pca_analyse_view_region.py
Python
gpl-2.0
2,978
############################################################################### ## ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: contact@vistrails.org ## ## This file is part of VisTrails. ## ## "Redistribution and use in source and binary forms, with or without ## modification, ...
CMUSV-VisTrails/WorkflowRecommendation
scripts/extract.py
Python
bsd-3-clause
2,527
from __future__ import print_function, division import numpy as np from astropy.table import Table, Column from ..grid.amr_grid import AMRGridView from ..util.functions import B_nu, random_id, FreezableClass, \ is_numpy_array, bool2str, str2bool, monotonically_increasing from ..util.integrate import integrate_lo...
astrofrog/hyperion
hyperion/sources/source.py
Python
bsd-2-clause
29,298
from django.db import models class UserOauthAssociation(models.Model): user = models.ForeignKey('auth.User') auth_type = models.CharField(max_length = 32, null=True) profile_id = models.CharField(max_length = 255, null=True) username = models.CharField(max_length = 255, null=True) access_token = mo...
lmorchard/badger
apps/socialconnect/models.py
Python
bsd-3-clause
581
""" Decorators to assist in the use of the JSON RPC interface """ import functools from . import errors def required_param(name): """ Adds a check for a required JSON RPC parameter. This works for keyword parameters only. """ def _decorator(func): @functools.wraps(func) async def...
durandj/mymcadmin
mymcadmin/rpc/decorators.py
Python
mit
633
""" ALCustoms NOSql Tests """ if __name__ == "__main__": ## TODO: This module is not a priority, but all these tests need to be fixed (eventually) import unittest import pathlib path = pathlib.Path.cwd() tests = unittest.TestLoader().discover(path) unittest.TextTestRunner().run(tests)
AdamantLife/alcustoms
alcustoms/NOSql/tests/__init__.py
Python
gpl-3.0
311
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ SOLARSYSTEM.JPL.SBDB -------------------- :author: Michael Mommert (mommermiscience@gmail.com) """ from ....jplsbdb import SBDB, SBDBClass from . import *
ceb8/astroquery
astroquery/solarsystem/jpl/sbdb/__init__.py
Python
bsd-3-clause
226
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, division import locale from petl.util.base import Table def fromxlsx(filename, sheet=None, range_string=None, row_offset=0, column_offset=0, **kwargs): """ Extract a table from a sheet in an Excel .xlsx file. ...
psnj/petl
petl/io/xlsx.py
Python
mit
2,553
# (c) Copyright IBM Corp. 2021 # (c) Copyright Instana Inc. 2021 from ..singletons import agent, tracer, async_tracer, tornado_tracer from ..log import logger def extract_custom_headers(tracing_scope, headers): try: for custom_header in agent.options.extra_http_headers: # Headers are in the f...
instana/python-sensor
instana/util/traceutils.py
Python
mit
1,100
"""Tests for plugin.py.""" import ckanext.localimp.plugin as plugin def test_plugin(): pass
ccca-dc/ckanext-filesystem
ckanext/localimp/tests/test_plugin.py
Python
agpl-3.0
97
from headers import * algos=[{"answer":"x R2 D2 R U R' D2 R U' R", "type":"1", "transitions":[ {"from":(2,0),"to":(2,2)}, {"from":(2,2),"to":(0,2)}, {"from":(0,2),"to":(2,0)} ]}, {"answer":"x Ri U Ri D2 R Ui Ri D2 R2", "type":"2", "tra...
underscoredam/rubiks-cube
algorithms/pll.py
Python
gpl-2.0
8,773
from .element import * from .mrow import * import math class MRoot(Element): def __init__(self, plotter, children): assert len(children) == 2 Element.__init__(self, plotter) for child in children: self.addChild(child) self.row_strategy = MRow.Strategy() def _layout(self, base, index=None): self.bas...
ahjulstad/mathdom-python3
mathml/pmathml/mroot.py
Python
mit
2,529
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from datetime import datetime from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT from odoo.addons.account.tests.account_test_classes import AccountingTestCase class TestPurchaseOrder(AccountingTestCase): def s...
chienlieu2017/it_management
odoo/addons/purchase/tests/test_purchase_order.py
Python
gpl-3.0
4,699
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import (absolute_import, division, print_function, unicode_literals) import numpy as np from numpy.testing import assert_array_equal from astropy.tests.helper import pytest from ..numpyutils import (create_slices...
MSeifert04/nddata
nddata/utils/tests/test_numpyutils.py
Python
bsd-3-clause
5,134
# Copyright 2016 Vauxoo # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import logging import os from odoo import _, api, models from odoo.exceptions import ValidationError _logger = logging.getLogger(__name__) class CompanyCountryConfigSettings(models.AbstractModel): _name = 'company.country.co...
Vauxoo/server-tools
company_country/models/res_config.py
Python
agpl-3.0
2,079
# -*- coding: utf-8 -*- from math import floor from typing import ( Tuple, Any ) from PyQt5.QtCore import ( QPointF, QRectF, Qt ) from PyQt5.QtGui import ( QBrush, QPen, QPainterPath, QPolygonF, QMouseEvent, QPainter ) from PyQt5.QtWidgets import ( qApp, QGraphicsIte...
scholer/cadnano2.5
cadnano/views/pathview/strand/endpointitem.py
Python
mit
22,478
from argparse import ArgumentParser from typing import Any, List from zerver.lib.actions import do_create_multiuse_invite_link, ensure_stream from zerver.lib.management import ZulipBaseCommand from zerver.models import PreregistrationUser, Stream class Command(ZulipBaseCommand): help = "Generates invite link tha...
brainwane/zulip
zerver/management/commands/generate_multiuse_invite_link.py
Python
apache-2.0
1,624
#-*- coding: utf-8 -*- from django.conf.urls.defaults import patterns, url from shop_simplevariations.views import SimplevariationCartDetails urlpatterns = patterns('', url(r'^delete/$', SimplevariationCartDetails.as_view(action='delete'), name='cart_delete'), url('^item/$', Simplevari...
hzlf/openbroadcast
website/shop/shop_simplevariations/urls.py
Python
gpl-3.0
697
# Main urlconf file of Transifex used in ROOT_URLCONF from common import urlpatterns from extra import urlpatterns as urlpatterns_extra urlpatterns += urlpatterns_extra
tymofij/adofex
transifex/urls/main.py
Python
gpl-3.0
169
############################################################################### # # The MIT License (MIT) # # Copyright (c) Crossbar.io Technologies GmbH # # 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 ...
crossbario/autobahn-python
autobahn/asyncio/wamp.py
Python
mit
11,018
""" Plugin for ResolveURL Copyright (C) 2020 gujal 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. ...
dknlght/dkodi
src/script.module.resolveurl/lib/resolveurl/plugins/cloud9.py
Python
gpl-2.0
1,781
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license import loggi...
mugurrus/superdesk-core
apps/publish/__init__.py
Python
agpl-3.0
3,089
""" Run this one time, to setup the automatic expiration of sessions """ from web.app.djrq.model.session import Session from pymongo import MongoClient collection = MongoClient().djrq2.sessions Session._expires.create_index(collection)
bmillham/djrq2
create_session_index.py
Python
mit
239
import base64 import hashlib import os import shutil import sys import tempfile as sys_tempfile import unittest from io import BytesIO, StringIO from urllib.parse import quote from django.core.files import temp as tempfile from django.core.files.uploadedfile import SimpleUploadedFile from django.http.multipartparser i...
nesdis/djongo
tests/django_tests/tests/v22/tests/file_uploads/tests.py
Python
agpl-3.0
24,624
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import json import unittest from telemetry.core.heap import chrome_js_heap_snapshot_parser class ChromeJsHeapSnapshotParserUnittest(unittest.TestCase): d...
mkaluza/external_chromium_org
tools/telemetry/telemetry/core/heap/chrome_js_heap_snapshot_parser_unittest.py
Python
bsd-3-clause
2,528
# coding:utf-8 import pandas as pd import numpy as np from sklearn.model_selection import train_test_split from sklearn.datasets import load_boston from sklearn.datasets import load_iris from heamy.feature import onehot_features, factorize, woe, mean_target def test_onehot(): data = load_boston() X, y = dat...
rushter/heamy
tests/test_feature.py
Python
mit
1,986
#!/usr/bin/env python # -*- coding: utf-8 -*- # # complexity documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 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 # ...
brisad/grec
docs/conf.py
Python
gpl-3.0
8,366
from base import * CONF = """ vserver!0440!nick = missing.host1 vserver!0440!document_root = /faked vserver!0440!user_dir = public_html vserver!0440!match = wildcard vserver!0440!match!domain!1 = missing.host1 vserver!0440!user_dir!rule!1!match = default vserver!0440!user_dir!rule!1!handler = common """ class Test ...
chetan/cherokee
qa/044-Home.py
Python
gpl-2.0
698
from documents import get_collection def notifications(request): """ Returns unread notification count """ if request.user.is_anonymous(): notification_count = 0 else: notification_count = get_collection("notifications").find({ "recipient": request.user.id, ...
fatiherikli/dbpatterns
web/dbpatterns/notifications/context_processors.py
Python
mit
426
import os from flask import Flask, jsonify, request, redirect, url_for, session, current_app from flask.ext.sqlalchemy import SQLAlchemy from exceptions import InvalidUsage app = Flask(__name__, static_url_path='', static_folder='static') app.secret_key = os.urandom(24) app.config.from_pyfile('../config/default.cfg')...
jbowens/taboo
word-manager/app/__init__.py
Python
mit
1,416
# -*- coding: utf-8 -*- # This file as well as the whole tsfresh package are licenced under the MIT licence (see the LICENCE.txt) # Maximilian Christ (maximilianchrist.com), Blue Yonder Gmbh, 2016 import os import subprocess import tempfile from unittest import TestCase import nbformat import pytest default_timeout ...
blue-yonder/tsfresh
tests/integrations/test_notebooks.py
Python
mit
4,662
""" automatically maintains the latest git tag + revision info in a python file """ import imp import subprocess def get_project_version(version_file): try: module = imp.load_source("verfile", version_file) file_ver = module.__version__ except: file_ver = None try: proc =...
ohmu/poni
version.py
Python
apache-2.0
1,002
# -*- coding: utf_8 -*- """ Shared Functions. Module providing the shared functions for static analysis of iOS and Android """ import hashlib import io import json import logging import os import platform import re import shutil import subprocess import zipfile from urllib.parse import urlparse from pathlib import Pat...
matandobr/Mobile-Security-Framework-MobSF
mobsf/StaticAnalyzer/views/shared_func.py
Python
gpl-3.0
14,909
import logging import optparse import signal import time import sys import resource import tornado.ioloop import tornado.httpserver import tornado.web from tornado.log import access_log from . import cache from . import config from . import handlers from . import spool try: from mutornadomon.config import initia...
jolynch/hacheck
hacheck/main.py
Python
mit
4,212
from datetime import datetime from itertools import chain from logging import getLogger from dcache.zmq import ENCODING from dcache.zmq import datetime_to_str from dcache.zmq import str_to_datetime _LOG = getLogger(__name__) class PublishServer: def update_nodes(self, nodes): """ :param nodes:...
merry-bits/DCache
server/src/dcache/protocols/publish.py
Python
gpl-2.0
3,192
#!/usr/bin/env python3 value = u'\u1234' * 10 print('{}'.format(value))
talapus/Ophidian
py3uni.py
Python
bsd-3-clause
74
#!/usr/bin/env python # -*- coding: utf-8 -*- from nose.tools import ok_ from nose.tools import raises from py_utilities.text.string_utilities import str_to_bool import unittest class TestStringUtilities(unittest.TestCase): def test_str_to_bool(self): ok_(str_to_bool("yes")) ok_(str_to_bool("y")...
ryankanno/py-utilities
tests/text/test_string_utilities.py
Python
mit
904
from doc.gallery import * def test_parse_docstring_info(): assert 'error' in parse_docstring_info("No Docstring") assert 'error' in parse_docstring_info("'''No Docstring Title'''") assert 'error' in parse_docstring_info("'''No Sentence\n======\nPeriods'''") assert 'error' in parse_docstring_info( ...
gonzafirewall/kivy
kivy/tests/test_doc_gallery.py
Python
mit
1,210
# -*- coding:utf-8 -*- ''' Test ''' import sys sys.path.append('.') from tornado.testing import AsyncHTTPSTestCase from application import APP class TestSomeHandler(AsyncHTTPSTestCase): ''' Test ''' def get_app(self): ''' Test ''' return APP def test_index(sel...
bukun/TorCMS
tester/test_handlers/test_index_handler.py
Python
mit
448
import os import re import testinfra.utils.ansible_runner testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') def test_hostname(host): assert re.search(r'instance-[12]-multi-node', host.system_info.hostname) def test_etc_molecule_director...
retr0h/maquina
test/scenarios/driver/vagrant/molecule/multi-node/tests/test_default.py
Python
mit
730
from functools import wraps from contextlib import contextmanager def proxy_factory(type, underlying_getter): """ Create a callable that creates proxies. This function (#1) will return another function (#2) that can be called with a name. The return value will be a proxy function (#3) that simply de...
andrew-d/Specter.py
specter/util.py
Python
mit
2,031
# -*- coding: utf-8 -*- # This file is part of beets. # Copyright 2016, Fabrice Laporte. # # 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 ...
mried/beets
test/test_lastgenre.py
Python
mit
8,248
# # Copyright (C) 2013 Stanislav Bohm # # This file is part of Kaira. # # Kaira 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, version 3 of the License, or # (at your option) any later versi...
MrPablozOne/kaira
ptp/base/analysis.py
Python
gpl-3.0
6,178
#! /usr/bin/python #coding:utf8 def main(): for i in range(0x400): print "cp ./a.out daemon_%04d" %(i) for i in range(0x400): print "./daemon_%04d %04d.log" %(i, i) if __name__ == '__main__': main()
matrix65537/xgo
src/c/daemon/proc.py
Python
mit
229
import setuptools setuptools.setup( name = "replicate-github", version = "1.0.0", description = "Tool for maintaining mirrors of GitHub repos", author = "Daniel Parks", author_email = "os-replicate-github@demonhorse.org", url = "http://github.com/danielparks/replicate-github", license = "B...
danielparks/replicate-github
setup.py
Python
bsd-2-clause
1,115
# @copyright # @license from __future__ import absolute_import import collections from . import trellis ############################################################################# ############################################################################# class Namable(collections.Hashable, trellis.Component):...
lisaglendenning/pypetri
source/pypetri/collections/namespace.py
Python
mit
3,901
# -*- coding: utf-8 -*- # Copyright 2015 Nate Bogdanowicz """ Package containing drivers for spectrometers. """ from .. import Instrument class Spectrometer(Instrument): pass
mabuchilab/Instrumental
instrumental/drivers/spectrometers/__init__.py
Python
gpl-3.0
181
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np from astropy.coordinates.baseframe import frame_transform_graph from astropy.coordinates.transformations import DynamicMatrixTransform from astropy.coordinates.matrix_utilities import matrix_product, matrix_tra...
pllim/astropy
astropy/coordinates/builtin_frames/fk4_fk5_transforms.py
Python
bsd-3-clause
2,700
from dnfpy.controller.runnable import Runnable class Model(Runnable): """Abstract class for all the model""" def __init__(self,**kwargs): self.mapDict = {} self.root = self.initMaps(**kwargs) #the root is the root map of the model self._addMapsToDict(self.root) #recursively add map to m...
bchappet/dnfpy
src/dnfpy/model/model.py
Python
gpl-2.0
1,314
class PatPho(object): def __init__(self): """ Python re-implementation of of PatPho -- a system for converting sequences of phonemes to vector representations that capture phonological similarity of words. The system is described in: Li, P., & MacWhinney, B. (2002). Pa...
RobGrimm/prediction_based
Phonology/PatPho/PatPho.py
Python
mit
5,229
#coding=utf-8 from django.test import TestCase # Create your tests here.
flysmoke/ijizhang
ijizhang_prj/jizhang/tests.py
Python
mit
74
# -*- coding: utf-8 import yaml import json import collections from etcd import EtcdKeyNotFound from .specs import render_app_spec, AppType from lain_sdk.yaml.parser import ProcType, LainConf from commons.settings import PRIVATE_REGISTRY from .utils import ( normalize_meta_version, search_images_from_registry,...
wchaoyi/console
apis/base_app.py
Python
mit
11,600
""" Tests and examples for correct "+/-" usage in error diffs. See https://github.com/pytest-dev/pytest/issues/3333 for details. """ import pytest from _pytest.pytester import Pytester TESTCASES = [ pytest.param( """ def test_this(): result = [1, 4, 3] expected = [1, 2,...
RonnyPfannschmidt/pytest
testing/test_error_diffs.py
Python
mit
7,942
#!/usr/bin/python # -*- coding: iso-8859-15 -*- # # extract.py # # Extracts a codestream from a bigger codestream, discarding a number # of temporal, resolution or/and quality. The number of temporal # resolution levels that is going to be discardes must be >= 0 (0 = no # discarding). Some thing similar happens with th...
vicente-gonzalez-ruiz/QSVC
trunk/src/old_py/transcode_COPIA_SIN_DEMUX.py
Python
gpl-2.0
18,231
# 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...
jhseu/tensorflow
tensorflow/python/keras/applications/xception.py
Python
apache-2.0
12,021
from django_webtest import WebTest from django.test.client import Client from django.test import TestCase from pombola.core import models class SmokeTests(WebTest): def testAllAppearances(self): person = models.Person( legal_name="Alfred Smith", slug='alfred-smith', ) ...
hzj123/56th
pombola/hansard/tests/smoke_tests.py
Python
agpl-3.0
406
# 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 use ...
Chasego/kafka
tests/kafkatest/sanity_checks/test_bounce.py
Python
apache-2.0
3,480
# Copyright (C) 2009-2010 Raul Jimenez # Released under GNU LGPL 2.1 # See LICENSE.txt for more information """ This module intends to implement the routing policy specified in NICE RTT 64: - - - - """ import random import core.ptime as time import heapq import logging import core.identifier as identifier import ...
egbertbouman/tribler-g
Tribler/Core/DecentralizedTracking/pymdht/plugins/routing_nice_rtt64.py
Python
lgpl-2.1
19,331
# # django-audiofield License # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Copyright (C) 2011-2014 Star2Billing S.L. # # The Initial Developer of the Original C...
AccuraGit/PodcastPlatform
build/lib/audiofield/models.py
Python
mit
2,333
from bitfinex.client import Client, TradeClient from trading_system import consts from trading_system.api.bitfinex import accounts, markets, orders from trading_system.api.interfaces import IClient class BitfinexClient(IClient): ENV_TYPE_TO_SERVER_MAP = { consts.Environment.PRODUCTION: 'https://api.bitfin...
vinicius-ronconi/bitcoin-trading-system
trading_system/api/bitfinex/clients.py
Python
gpl-3.0
1,262
from distutils.core import setup from src import __version__ setup( name="irma.common", version=__version__, author="Quarkslab", author_email="irma@quarkslab.com", description="The common component of the IRMA software", packages=["irma.common", "irma.common.base", "...
quarkslab/irma
common/setup.py
Python
apache-2.0
683
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class SnapBerkeley(MakefilePackage): """SNAP is a fast and accurate aligner for short DNA reads....
LLNL/spack
var/spack/repos/builtin/packages/snap-berkeley/package.py
Python
lgpl-2.1
1,346
"""Plugwise Binary Sensor component for Home Assistant.""" from __future__ import annotations from collections.abc import Mapping from dataclasses import dataclass from typing import Any from homeassistant.components.binary_sensor import ( BinarySensorEntity, BinarySensorEntityDescription, ) from homeassistan...
rohitranjan1991/home-assistant
homeassistant/components/plugwise/binary_sensor.py
Python
mit
5,152
#!/c/Python25 python ## Autor John Wesley Ribeiro import grass.script as grass from PIL import Image import wx import random import re import time import math from datetime import tzinfo, timedelta, datetime import win32gui from win32com.shell import shell, shellcon import os import unicodedata import numpy as np ...
LEEClab/LS_CORRIDORS
old_versions/before_v1_0_0/Ls_corridors_v08_2016_02_d03_grass7.py
Python
gpl-2.0
64,034
""" ####################################################################################### # # # This class is part of the KIRMES package. # # Copyright (C) 2008 - 2009 Sebastian J. Schulthe...
vipints/oqtans
oqtans_tools/KIRMES/0.8/src/Kmers.py
Python
bsd-3-clause
8,944
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # 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 ...
Nexenta/cinder
cinder/tests/unit/test_volume.py
Python
apache-2.0
311,279
# Flexlay - A Generic 2D Game Editor # Copyright (C) 2014 Ingo Ruhnke <grumbel@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 3 of the License, or # (at your option)...
SuperTux/flexlay
flexlay/gui/tile_selector.py
Python
gpl-3.0
3,858
# -*- coding: utf-8 -*- """ Tests for the user interface elements of Mu. """ from PyQt5.QtWidgets import QAction, QWidget, QFileDialog, QMessageBox, QMenu from PyQt5.QtCore import Qt, QSize from PyQt5.QtGui import QIcon, QKeySequence from unittest import mock import pytest from mu import __version__ from tests.test_app...
mu-editor/mu
tests/interface/test_main.py
Python
gpl-3.0
85,744
NAME = 'django-adminactions' VERSION = __version__ = (0, 4, 0, 'final', 0) __author__ = 'sax' import subprocess import datetime import os def get_version(version=None): """Derives a PEP386-compliant version number from VERSION.""" if version is None: version = VERSION assert len(version) == 5 ...
updatengine/updatengine-server
adminactions/__init__.py
Python
gpl-2.0
1,648
# $HeadURL: $ ''' Test_RSS_Policy_AlwaysActivePolicy ''' import unittest import DIRAC.ResourceStatusSystem.Policy.CEAvailabilityPolicy as moduleTested __RCSID__ = '$Id: $' ################################################################################ class CEAvailabilityPolicy_TestCase( unittest.TestCase ): ...
vmendez/DIRAC
ResourceStatusSystem/Policy/test/Test_RSS_Policy_CEAvailabilityPolicy.py
Python
gpl-3.0
2,328
class RedbotMotorActor(object): # TODO(asydorchuk): load constants from the config file. _MAXIMUM_FREQUENCY = 50 def __init__(self, gpio, power_pin, direction_pin_1, direction_pin_2): self.gpio = gpio self.power_pin = power_pin self.direction_pin_1 = direction_pin_1 sel...
asydorchuk/robotics
python/robotics/actors/redbot_motor_actor.py
Python
mit
1,628
# Copyright 2019 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
google/google-ctf
2019/quals/pwn-secureboot/healthcheck/healthcheck.py
Python
apache-2.0
2,006
import re import json import urlparse from holster.enum import Enum from unidecode import unidecode from disco.types.base import cached_property from disco.types.channel import ChannelType from disco.util.sanitize import S from disco.api.http import APIException from rowboat.redis import rdb from rowboat.util.stats i...
ThaTiemsz/jetski
rowboat/plugins/censor.py
Python
mit
9,546
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2011 Christopher Ormaza, Ecuadorenlinea.net # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pub...
cormaza/odoo-ecuador
l10n_ec_niif_minimal/objects/account_invoice_tax.py
Python
agpl-3.0
2,535
# -*- coding: utf-8 -*- # Generated by Django 1.11.4 on 2017-08-23 12:30 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): initial = True depe...
Viva-con-Agua/sluice
register/migrations/0001_initial.py
Python
gpl-3.0
1,120
from django.shortcuts import render import json from django.template import loader, RequestContext from django.http import (HttpResponse, HttpResponseRedirect, Http404, HttpResponseForbidden) from django.db.models.base import ModelBase from django.contrib.contenttypes.models import ContentType...
contactr2m/remote_repo
src/rating/views.py
Python
mit
3,568
# Copyright 2015 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
gooddata/openstack-nova
nova/objects/request_spec.py
Python
apache-2.0
37,886
# -*- coding: utf-8 -*- USERS_MAPPING = { 'users_get': { 'resource': 'users/{username}.json', 'docs': ('http://docs.discourse.org/#tag/' 'Users%2Fpaths%2F~1users~1%7Busername%7D.json%2Fget'), 'methods': ['GET'], }, 'users_avatar_update': { 'resource': 'users...
humrochagf/tapioca-discourse
tapioca_discourse/resource_mapping/users.py
Python
mit
2,591
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("delft3dworker", "0057_auto_20160829_1429"), ] operations = [ migrations.AddField( model_name="scene", ...
openearth/delft3d-gt-server
delft3dworker/migrations/0058_scene_phase.py
Python
gpl-3.0
780
# Copyright 2013 Huawei Technologies Co.,LTD. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unl...
redhat-cip/tempest
tempest/api/compute/admin/test_aggregates_negative.py
Python
apache-2.0
9,008
#!/usr/bin/env python3 # Used tips from https://realpython.com/pandas-dataframe/ import numpy as np import pandas as pd import sys """ Reads fies starting (nl added): 1 41 sites in domain 1 132 1 111 InpCoords: LatLong 2 1 Hours between outputs 3 n...
mifads/pyscripts
emxverify/read_emep_csvsites.py
Python
gpl-3.0
2,415
""" Builds out filesystem trees/data based on the object tree. This is the code behind 'cobbler sync'. Copyright 2006-2009, Red Hat, Inc and Others Michael DeHaan <michael.dehaan AT gmail> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as publ...
jmaas/cobbler
cobbler/yumgen.py
Python
gpl-2.0
3,119
import cv2 class Squares: #Initialize square with it's boundries def __init__(self, topLeft, bottomRight): self.topLeft = topLeft self.bottomRight = bottomRight #self.pieceType = 'e' #Checks to see if a given coordinate is within it's bounds def cropSquaresHelper(self, newImag...
ufieeehw/IEEE2015
ros/ieee2015_vision/src/chess_vision/Squares.py
Python
gpl-2.0
8,573
# -*- coding: utf-8 -*- from AccessControl import allow_module allow_module('imio.history.utils') def initialize(context): """Initializer called when used as a Zope 2 product."""
IMIO/imio.history
src/imio/history/__init__.py
Python
gpl-2.0
189
# -*- coding: utf-8 -*- import werkzeug from openerp.addons.web import http from openerp.addons.web.http import request class snippet_latest_posts_controller(http.Controller): # @http.route(['/snippet_latest_posts/fetch'], type='json', auth='public', website=True) # def fetch_latest_posts(self, fields, doma...
lem8r/website-themes
snippet_latest_posts/controllers/main.py
Python
lgpl-3.0
900
import numpy as np from fos.core.world import World from fos.core.fos_window import FosWindow from fos.core.camera import DefaultCamera from fos.actor.volslicer import ConnectedSlices from fos.actor.triangle import Triangle from fos.actor.network import AttributeNetwork w = World(0) cam = DefaultCamera() w.add(ca...
fos/fos-legacy
scratch/test.py
Python
bsd-3-clause
389
# /test/testutil.py # # Monkey-patch functions for tests to cache downloaded files. This helps # to speed up test execution. # # See /LICENCE.md for Copyright information """Monkey-patch functions for tests to cache downloaded files.""" import errno import hashlib import os import shutil import sys from contextli...
polysquare/polysquare-travis-container
test/testutil.py
Python
mit
2,003
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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 distrib...
DolphinDream/sverchok
old_nodes/bbox_mk2.py
Python
gpl-3.0
7,017
from __future__ import unicode_literals # Type Conversions. to_type. All must return PyJs subclass instance from simplex import * def to_primitive(self, hint=None): if is_primitive(self): return self if hint is None and (self.Class == 'Number' or self.Class == 'Boolean'): # favour number for C...
alfa-jor/addon
plugin.video.alfa/lib/js2py/internals/conversions.py
Python
gpl-3.0
4,451
from parser.Parser import Parser, ParserUtils from schema.PgConstraint import PgConstraint class AlterTableParser(object): @staticmethod def parse(database, statement): parser = Parser(statement) parser.expect("ALTER", "TABLE") parser.expectOptional("ONLY") tableName = parser...
Dancer3809/PgDumpLoader
PgDumpLoader/parser/AlterTableParser.py
Python
mit
6,462