text
stringlengths
6
947k
repo_name
stringlengths
5
100
path
stringlengths
4
231
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
6
947k
score
float64
0
0.34
#!/usr/bin/env python # -*- coding: utf-8 -*- import logging # from datetime import timedelta, datetime from yamo import ( Connection, EmbeddedDocument, Document, IDFormatter, Index, StringField, IntField, FloatField, BooleanField, ListField, EmbeddedField, DateTimeField, ) conn = ...
yxdong/ybk
zg/models.py
Python
mit
3,701
0.000277
from .core import ImageOptim, NoImagesOptimizedError
derrickorama/image_optim
image_optim/__init__.py
Python
mit
52
0.019231
import logging import datetime import pytz from django.conf import settings from django.contrib.auth.models import Group from django.http import (HttpResponse, HttpResponseRedirect, HttpResponseNotFound, HttpResponseBadRequest, HttpResponseForbidden, Http404) from django.utils.translation import ugettext as _ from ...
nanolearning/edx-platform
lms/djangoapps/shoppingcart/views.py
Python
agpl-3.0
9,715
0.0035
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2011 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
zen/openstack-dashboard
django-openstack/django_openstack/tests/view_tests/dash/container_tests.py
Python
apache-2.0
4,367
0.001145
import numpy as np import os import pickle import pytest import re import time import shutil from copy import deepcopy from numpy import allclose, isclose from flare import struc, env, gp from flare.parameters import Parameters from flare.mgp import MappedGaussianProcess from flare.lammps import lammps_calculator fro...
mir-group/flare
tests/test_mgp.py
Python
mit
12,643
0.000791
#!/usr/bin/env python # # 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 (th...
Kami/libcloud
contrib/generate_provider_logos_collage_image.py
Python
apache-2.0
4,224
0
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
Azure/azure-sdk-for-python
sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_scale_set_vms_operations.py
Python
mit
56,685
0.004869
import os import datetime import lib.maglib as MSG #这是一个对结果进行初步处理的库 #用来分离抓取结果,作者,发帖时间 #抓取结果应该储存在【用户端根目录】并以result命名 #在测试情况下,抓取结果文件为results.txt #重要全局变量 PATH_SUFFIX = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir)) print(PATH_SUFFIX) PATH_SUFFIX = PATH_SUFFIX[::-1] PATH_SUFFIX = PATH_SUFFIX[...
ankanch/tieba-zhuaqu
DSV-user-application-plugin-dev-kit/lib/result_functions_file.py
Python
gpl-3.0
3,240
0.01997
# Copyright 2017,2018 IBM Corp. # # 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 agr...
mfcloud/python-zvm-sdk
zvmsdk/tests/unit/sdkwsgi/handlers/test_version.py
Python
apache-2.0
1,674
0
#!/usr/bin/python import socket import sys HOST, PORT = "24.21.106.140", 8080 # Create a socket (SOCK_STREAM means a TCP socket) sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: # Connect to server and send data print "Connected to ", HOST, ":", PORT, "\n","Awaiting input\n" data = sys.stdi...
hillst/RnaMaker
bin/daemons/testclient.py
Python
mit
789
0.010139
from django.contrib import admin from survey.actions import make_published from survey.exporter.csv import Survey2Csv from survey.exporter.tex import Survey2Tex from survey.models import Answer, Category, Question, Response, Survey class QuestionInline(admin.StackedInline): model = Question ordering = ("orde...
Pierre-Sassoulas/django-survey
survey/admin.py
Python
agpl-3.0
1,693
0.001772
# -*- coding: utf-8 -*- from app import app import os if __name__ == "__main__": port = int(os.environ.get('PORT', 33507)) app.run(port=port, debug = True)
jorgegarciadev/estacaidooque
run.py
Python
mit
166
0.012048
import configparser from unittest import TestCase import os import subprocess import tempfile from test import subman_marker_functional, subman_marker_needs_envvars, subman_marker_zypper @subman_marker_functional @subman_marker_zypper @subman_marker_needs_envvars('RHSM_USER', 'RHSM_PASSWORD', 'RHSM_URL', 'RHSM_POOL'...
candlepin/subscription-manager
test/zypper_test/test_serviceplugin.py
Python
gpl-2.0
2,745
0.0051
from collections import deque, OrderedDict from django.conf import settings from elasticsearch_dsl import Document, Date, Integer, Keyword, Text, Search, Index, Boolean, Completion, \ SearchAsYouType, normalizer, analyzer from elasticsearch_dsl.connections import connections from tqdm import tqdm from elasticsearc...
kingsdigitallab/tvof-django
tvof/text_search/es_indexes.py
Python
mit
12,832
0.000935
import unittest from pyshould import * from pyshould.expect import expect, expect_all, expect_any, expect_none class ExpectTestCase(unittest.TestCase): """ Simple tests for the expect based api """ def test_expect(self): expect(1).to_equal(1) expect(1).to_not_equal(0) def test_expect_all...
drslump/pyshould
tests/expect.py
Python
mit
856
0
import os import sys import re def read_text_from_include(line): match = re.search("^#:include *(.*.kv)", line) filename = match.group(1) return open(filename, 'r').read() def main(combine): if combine: if not os.path.isfile('shugou_original.kv'): os.rename('shugou.kv', 'shugou_o...
IsabellKonrad/Shugou
combineFiles.py
Python
mit
1,675
0.001194
"""Tests of email marketing signal handlers.""" import logging import ddt from django.test import TestCase from django.test.utils import override_settings from mock import patch from util.json_request import JsonResponse from email_marketing.signals import handle_unenroll_done, \ email_marketing_register_user, \ ...
waheedahmed/edx-platform
lms/djangoapps/email_marketing/tests/test_signals.py
Python
agpl-3.0
8,373
0.001672
#!/usr/bin/env python ################################################## ## DEPENDENCIES import sys import os import os.path try: import builtins as builtin except ImportError: import __builtin__ as builtin from os.path import getmtime, exists import time import types from Cheetah.Version import MinCompatib...
pli3/e2-openwbif
plugin/controllers/views/web/getservices.py
Python
gpl-2.0
5,478
0.011683
# Copyright (c) 2011 Nokia # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribu...
skyostil/tracy
src/analyzer/Charting.py
Python
mit
2,058
0.014091
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 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 progra...
rhyolight/nupic.core
bindings/py/src/nupic/bindings/regions/TestNode.py
Python
agpl-3.0
10,011
0.005894
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "PolyTrend", cycle_length = 7, transform = "Logit", sigma = 0.0, exog_count = 20, ar_order = 12);
antoinecarme/pyaf
tests/artificial/transf_Logit/trend_PolyTrend/cycle_7/ar_12/test_artificial_1024_Logit_PolyTrend_7_12_20.py
Python
bsd-3-clause
262
0.087786
"""WebSocket-specific events.""" import mitmproxy.http import mitmproxy.websocket class Events: # Websocket lifecycle def websocket_handshake(self, flow: mitmproxy.http.HTTPFlow): """ Called when a client wants to establish a WebSocket connection. The WebSocket-specific headers...
vhaupert/mitmproxy
examples/addons/events-websocket-specific.py
Python
mit
1,300
0
__version__ = "master"
jvandijk/pla
pla/version.py
Python
mit
23
0
""" WSGI config for example_project project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLIC...
yetty/django-embed-video
example_project/example_project/wsgi.py
Python
mit
1,447
0.000691
# -*- coding: utf-8 -*- from collections.abc import MutableMapping import numpy as np import scipy.io as sio from ..structures import PLSResults _result_mapping = ( ('u', 'x_weights'), ('s', 'singvals'), ('v', 'y_weights'), ('usc', 'x_scores'), ('vsc', 'y_scores'), ('lvcorrs', 'y_loadings'),...
rmarkello/pyls
pyls/matlab/io.py
Python
gpl-2.0
6,754
0
# This file was automatically generated by SWIG (http://www.swig.org). # Version 1.3.36 # # Don't modify this file, modify the SWIG interface instead. # This file is compatible with both classic and new-style classes. import _AAPI import new new_instancemethod = new.instancemethod try: _swig_property = property ex...
jprk/sirid
aapi/AAPI.py
Python
gpl-3.0
131,251
0.012107
import os.path from django.conf import settings from django.test.utils import override_settings import mock from celery.result import AsyncResult from olympia import amo from olympia.amo.tests import TestCase, addon_factory, version_factory from olympia.devhub import tasks, utils from olympia.files.models import Fi...
lavish205/olympia
src/olympia/devhub/tests/test_utils.py
Python
bsd-3-clause
10,323
0
import os import logging from flask import Flask from flask_seasurf import SeaSurf from flask_mail import Mail from werkzeug.middleware.proxy_fix import ProxyFix from flask_session import Session from .lib import utils def create_app(config=None): from . import models, routes, services from .assets import as...
ngoduykhanh/PowerDNS-Admin
powerdnsadmin/__init__.py
Python
mit
4,275
0.000702
class OnboardingTutorial: """Constructs the onboarding message and stores the state of which tasks were completed.""" WELCOME_BLOCK = { "type": "section", "text": { "type": "mrkdwn", "text": ( "Welcome to Slack! :wave: We're so glad you're here. :blush:\n...
slackapi/python-slackclient
tutorial/PythOnBoardingBot/onboarding_tutorial.py
Python
mit
2,881
0.003124
# -*- coding: utf-8 -*- # Copyright (c) 2015 Dipl.Tzt. Enno Deimel <ennodotvetatgmxdotnet> # # This file is part of gnuvet, published under the GNU General Public License # version 3 or later (GPLv3+ in short). See the file LICENSE for information. # Initially created: Fri Apr 23 00:02:26 2010 by: PyQt4 UI code gene...
gnuvet/gnuvet
options_ui.py
Python
gpl-3.0
1,879
0.00958
"""An example of a python script which can be executed by the task queue """ import sys def execute(): """Simply write the python executable """ sys.stdout.write(sys.executable) if __name__ == '__main__': execute()
quantmind/pulsar-queue
tests/example/executable.py
Python
bsd-3-clause
235
0
#!/usr/bin/env python """Parse GCC-XML output files and produce a list of class names.""" # import system modules. import multiprocessing import xml.dom.minidom import sys import os # Import application modules. import mpipe import util # Configure and parse the command line. NAME = os.path.basename(sys.argv[0]) AR...
vmlaker/pythonwildmagic
tool/parse-xml.py
Python
mit
1,870
0.004278
# -*- coding: utf-8 -*- # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is not available, # everyone is granted a worldwide, perpetual, royalty-free, # non-exclusive license to e...
hclivess/Stallion
nuitka/Cryptodome/Util/__init__.py
Python
gpl-3.0
1,951
0.00205
''' A taylor series visualization graph. This example demonstrates the ability of Bokeh for inputted expressions to reflect on a chart. ''' import numpy as np import sympy as sy from bokeh.core.properties import value from bokeh.io import curdoc from bokeh.layouts import column from bokeh.models import (ColumnDataSou...
bokeh/bokeh
examples/app/taylor.py
Python
bsd-3-clause
2,238
0.003128
# coding=utf-8 from typing import List import networkx as nx import pyisemail from fuzzywuzzy import fuzz from recordclass import recordclass import pandas as pd import saapy.util as su from .lexeme import cleanup_proper_name def connect_actors(actor_frame, connectivity_sets, connectivity_column): """ :para...
ashapochka/saapy
saapy/analysis/actor.py
Python
apache-2.0
11,608
0.000258
""" Tests for the bulk_user_activate command. """ from django.contrib.auth.models import User from django.core.management import call_command from django.test import TestCase from openedx.stanford.djangoapps.student_utils.helpers import get_users_by_email class BulkUserActivateTests(TestCase): """ Test the ...
Stanford-Online/edx-platform
openedx/stanford/djangoapps/student_utils/tests/test_bulk_user_activate.py
Python
agpl-3.0
2,256
0.000887
""" Downloads the following: - Korean Wikipedia texts - Korean """ from sqlparse import parsestream from sqlparse.sql import Parenthesis for statement in parsestream(open('data/test.sql')): texts = [str(token.tokens[1].tokens[-1]).decode('string_escape') for token in statement.tokens if isinstance(token, Parent...
carpedm20/Bias
scripts/download.py
Python
bsd-3-clause
449
0.004454
# Copyright 2020 Makani Technologies 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
google/makani
config/base_station/sim/perch_sim.py
Python
apache-2.0
5,391
0.002968
#!/usr/bin/env python # Copyright (c) 2014, The MITRE Corporation. All rights reserved. # See LICENSE.txt for complete terms. import sys from stix.core import STIXPackage def parse_stix(pkg): print("== MALWARE ==") for fam in pkg.ttps: print("---") print("Title : " + fam.title) print(...
jburns12/stixproject.github.io
documentation/idioms/malware-hash/malware-indicator-for-file-hash_consumer.py
Python
bsd-3-clause
1,039
0.001925
import lxml.etree as ET from GEMEditor.model.classes.cobra import Model, Metabolite, Compartment from GEMEditor.rw import * from GEMEditor.rw.compartment import add_compartments, parse_compartments from GEMEditor.rw.test.ex_compartment import valid_compartment_list from lxml.etree import Element def test_parse_compar...
JuBra/GEMEditor
GEMEditor/rw/test/test_compartment_rw.py
Python
gpl-3.0
2,169
0
""" C/Cython ascii file parser tests """ from pandas.compat import StringIO, BytesIO, map from datetime import datetime from pandas import compat import csv import os import sys import re import nose from numpy import nan import numpy as np from pandas import DataFrame, Series, Index, isnull, MultiIndex import pand...
webmasterraj/FogOrNot
flask/lib/python2.7/site-packages/pandas/io/tests/test_cparser.py
Python
gpl-2.0
10,838
0.000185
# -*- coding: utf-8 -*- # ShuffleIR的设置文件 #=============================================== # ShuffleMove的安装路径 pathShuffleMove = '../../Shuffle-Move/' # 当前关卡在ShuffleMove中的关卡ID # 例如美梦天梯为 'SP_275', Mega超梦为'150' # 注意要有英文单引号! varStageID = 'SP_275' # 支援精灵列表 # 格式为 listSupport = ('口袋妖怪的NationDex #',...) # 注意要有英文单引号! # 特殊的条目包括...
coeusite/ShuffleIR
config.py
Python
gpl-2.0
1,373
0.017769
import unittest, random, sys, time, os, stat, pwd, grp sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i, h2o_exec as h2e FILENUM=100 def write_syn_dataset(csvPathname, rowCount, colCount, SEED, translateList): r1 = random.Random(SEED) dsf = open(csvPathname, "...
vbelakov/h2o
py/testdir_single_jvm/test_enum_multi_permission.py
Python
apache-2.0
6,221
0.009805
""" Tests for Serializer Fields """ from django.core.exceptions import ImproperlyConfigured from django.test import TestCase import pytest from rest_framework.serializers import ValidationError from courses.factories import EdxAuthorFactory, CourseFactory from courses.models import EdxAuthor from courses.serializers i...
mitodl/ccxcon
courses/fields_test.py
Python
agpl-3.0
3,535
0.001132
#! /usr/bin/python # https://github.com/jackchi/interview-prep import random # Bubble Sort # randomly generate 10 integers from (-100, 100) arr = [random.randrange(-100,100) for i in range(10)] print('original %s' % arr) def bubbleSort(array): n = len(array) # traverse thru all elements for i in range(n): s...
jackchi/interview-prep
sorting/bubbleSort.py
Python
mit
738
0.023035
from flask import Blueprint api = Blueprint('api', __name__, url_prefix='/rest/v1.0') from . import authentication, errors, views
pixmeter/enma
enma/rest/__init__.py
Python
bsd-3-clause
131
0.015267
import ast import logging import os.path import ConfigParser import StringIO class ConfigError(Exception): def __init__(self, msg): self.msg = msg def __str__(self): return self.msg class ConfigNoOptionError(ConfigError): def __init__(self, option, path): self.option = option ...
autotest/virt-test
virttest/utils_config.py
Python
gpl-2.0
13,647
0
""" Implementation of the trigsimp algorithm by Fu et al. The idea behind the ``fu`` algorithm is to use a sequence of rules, applied in what is heuristically known to be a smart order, to select a simpler expression that is equivalent to the input. There are transform rules in which a single rule is applied to the e...
alephu5/Soundbyte
environment/lib/python3.3/site-packages/sympy/simplify/fu.py
Python
gpl-3.0
63,469
0.000394
""" Graph isomorphism functions. """ import networkx as nx from networkx.exception import NetworkXError __author__ = """\n""".join(['Aric Hagberg (hagberg@lanl.gov)', 'Pieter Swart (swart@lanl.gov)', 'Christopher Ellison cellison@cse.ucdavis.edu)']) # Copyright...
sserrot/champion_relationships
venv/Lib/site-packages/networkx/algorithms/isomorphism/isomorph.py
Python
mit
6,757
0
#!/usr/bin/env python # # Use the raw transactions API to spend dass received on particular addresses, # and send any change back to that same address. # # Example usage: # spendfrom.py # Lists available funds # spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00 # # Assumes it will talk to a dasd or Das-Qt runn...
mainconceptx/DAS
contrib/spendfrom/spendfrom.py
Python
mit
9,887
0.005664
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2008-2015,2018 Contributor # # 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...
quattor/aquilon
lib/aquilon/worker/commands/show_resource.py
Python
apache-2.0
2,445
0
import subprocess import setup_util import os def start(args, logfile, errfile): setup_util.replace_text("hhvm/once.php.inc", "host=localhost;", "host=" + args.database_host + ";") setup_util.replace_text("hhvm/deploy/config.hdf", "SourceRoot = .*\/FrameworkBenchmarks/hhvm", "SourceRoot = " + args.troot) setup_...
denkab/FrameworkBenchmarks
frameworks/PHP/hhvm/setup.py
Python
bsd-3-clause
1,384
0.020954
__author__ = 'Sergey Tomin' from ocelot.rad import * from ocelot import * from ocelot.gui import * import numpy as np import time font = {'size' : 14} matplotlib.rc('font', **font) #from scipy.optimize import curve_fit from ocelot.demos.sr.k_analysis import * #from ocelot.lib.genera.src.python.radiation import gener...
sserkez/ocelot
demos/sr/k_diode.py
Python
gpl-3.0
2,071
0.011106
""" File: tree.py Author: Inokentiy Babushkin Email: inokentiy.babushkin@googlemail.com Github: ibabushkin Description: A tree used to store DFS-trees for the CFG-module. """ class Tree(object): """ The tree mentioned in the module-docstring. Probably a Gingko. """ def __init__(self, obj): ...
ibabushkin/Iridium
defines/util/tree.py
Python
gpl-3.0
1,538
0
from Centroid import Centroid from Vec2 import Vec2 from random import random from math import * from angle import angle from Seed import * Seed() class Swarm(list): def __init__(self, count): self.speed= 1.0/16.0 self.paused= False def __new__(cls, count): swarm= list.__new__(cls) for n in range(count):...
bobbysoon/Taxi3
Swarm.py
Python
unlicense
1,110
0.062162
#!/usr/bin/env python import os from setuptools import setup, find_packages CURRENT_DIR = os.path.dirname(__file__) setup(name='datapot', description='Library for automatic feature extraction from JSON-datasets', long_description=open(os.path.join(CURRENT_DIR, 'README.rst')).read(), version='0.1.3'...
bashalex/datapot
setup.py
Python
gpl-3.0
1,582
0.001896
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "PolyTrend", cycle_length = 5, transform = "Quantization", sigma = 0.0, exog_count = 100, ar_order = 12);
antoinecarme/pyaf
tests/artificial/transf_Quantization/trend_PolyTrend/cycle_5/ar_12/test_artificial_1024_Quantization_PolyTrend_5_12_100.py
Python
bsd-3-clause
270
0.085185
# -*- coding: utf-8 -*- # Copyright 2018 GIG Technology NV # # 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...
threefoldfoundation/app_backend
plugins/tff_backend/migrations/_009_change_token_value.py
Python
bsd-3-clause
1,840
0.002174
#!/usr/bin/env python ################################################## # Gnuradio Python Flow Graph # Title: USRP Feng Yun 1 HRPT Receiver # Author: POES Weather Ltd # Description: Feng Yun 1 HRPT Receiver # Generated: Fri Jan 7 15:21:35 2011 ################################################## from gnuradio import e...
mbsat/gr-poes-weather
apps/FY1/gui/usrp_rx_fy1_bb_hrpt.py
Python
gpl-3.0
19,883
0.024342
__version__ = (1, 0, 0, 'final', 0)
aek/pgbouncer-ng
pgbouncerlib/__init__.py
Python
bsd-3-clause
36
0
# -*- coding: utf-8 -*- ''' Covenant Add-on 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 prog...
RuiNascimento/krepo
script.module.lambdascrapers/lib/lambdascrapers/sources_incursion/en_incursion-1.20(final)/ymovies.py
Python
gpl-2.0
11,750
0.007064
from django.contrib import admin from blog.models import Blog_post admin.site.register(Blog_post) # Register your models here.
Extintor/DjangoBlog
blog/admin.py
Python
gpl-2.0
129
0
#!/usr/bin/python # -*- coding: latin-1 -*- usage = """\ usage: %prog [options] connection_string Unit tests for SQL Server. To use, pass a connection string as the parameter. The tests will create and drop tables t1 and t2 as necessary. These run using the version from the 'build' directory, not the version instal...
FlipperPA/pyodbc
tests2/sqlservertests.py
Python
mit
54,094
0.003605
#!/usr/bin/env python # Licensed under a 3-clause BSD style license - see LICENSE.rst import glob import os import sys import ah_bootstrap from setuptools import setup #A dirty hack to get around some early import/configurations ambiguities if sys.version_info[0] >= 3: import builtins else: import __builtin_...
utkbansal/tardis
setup.py
Python
bsd-3-clause
4,442
0.002701
np.identity(3)
jorisvandenbossche/DS-python-data-analysis
notebooks/python_recap/_solutions/05-numpy35.py
Python
bsd-3-clause
14
0.071429
import os import glob from pathlib import Path import flask import yaml class VersionManager(object): def __init__(self, versions=None): self._versions = versions @property def versions(self): if self._versions is None: version_paths = Path('versions').glob('**/*.yaml') ...
kylef/swiftenv-api
versions.py
Python
bsd-2-clause
4,108
0.001217
""" A library of useful helper classes to the saxlib classes, for the convenience of application and driver writers. $Id: saxutils.py,v 1.19 2001/03/20 07:19:46 loewis Exp $ """ import types, sys, urllib, urlparse, os, string import handler, _exceptions, xmlreader try: _StringTypes = [types.StringType, types.Uni...
Integral-Technology-Solutions/ConfigNOW
Lib/xml/sax/saxutils.py
Python
mit
20,106
0.006864
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*- # vi: set ft=python sts=4 ts=4 sw=4 noet : # This file is part of Fail2Ban. # # Fail2Ban 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;...
TonyThompson/fail2ban-patch
fail2ban/server/transmitter.py
Python
gpl-2.0
10,359
0.03147
class ResourceManager: def __init__(self): self.resourceList = {} def addResource(self, name, resource): print "adding Resource", name self.resourceList[name] = resource print "resources:", self.resourceList def getResource(self, name): if not self.hasResource(name): return None return self.resourc...
Taapat/enigma2-openpli-vuplus
lib/python/Components/ResourceManager.py
Python
gpl-2.0
529
0.032136
# Copyright (C) 2009, Benjamin Berg, Sebastian Berg # Copyright (C) 2010, Walter Bender # # 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 # ...
walterbender/turtle3D
plugins/audio_sensors/ringbuffer.py
Python
mit
4,149
0.000241
# # MLDB-2100_fetcher_timeout_test.py # Francois-Michel L'Heureux, 2016-11-20 # This file is part of MLDB. Copyright 2016 mldb.ai inc. All rights reserved. # import socket import threading import time class MyThread(threading.Thread): def run(self): try: threading.Thread.run(self) excep...
mldbai/mldb
testing/MLDB-2100_fetcher_timeout_test.py
Python
apache-2.0
1,628
0.003686
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
lmazuel/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture_result_paged.py
Python
mit
987
0.001013
# -*- coding: UTF-8 -*- from ..model.interfacebuilder import InterfaceBuilder from ..models import ITLog, ITStatement import interface_platform.settings as settings import logging.config import os from datetime import datetime # 运行接口 # 传入it_id和验证数据 class InterfaceRunner(object): def __init__(self, it_id): ...
longmazhanfeng/interface_web
interface_platform/management/interfacerunner.py
Python
mit
2,680
0.000856
# A file to contain exclusively dependencies of the NeuroML package. # See: # https://github.com/NeuralEnsemble/libNeuroML # http://neuroml.org from __future__ import print_function from collections import defaultdict try: from neuroml import Cell, Segment, SegmentParent, Morphology, \ NeuroMLD...
dwitvliet/CATMAID
django/applications/catmaid/control/exportneuroml.py
Python
gpl-3.0
3,874
0.003356
from __future__ import unicode_literals import copy import inspect import sys import warnings from django.apps import apps from django.apps.config import MODELS_MODULE_NAME from django.conf import settings from django.core import checks from django.core.exceptions import (ObjectDoesNotExist, MultipleObjectsReturn...
helenst/django
django/db/models/base.py
Python
bsd-3-clause
66,310
0.001508
""" Convenient way to expose filepaths to scripts. Also, important constants are centralized here to avoid multiple copies. """ import sys, os sys.path.append(os.path.join(os.path.dirname(__file__), '..')) sys.path.append(os.path.join(os.path.dirname(__file__))) sys.path.append(os.path.join(os.path.dirname(__file__), ...
nhejazi/project-gamma
code/project_config.py
Python
bsd-3-clause
562
0.007117
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import shutil from migrate import exceptions from migrate.versioning import version, repository from migrate.versioning.script import * from migrate.versioning.util import * from migrate.tests import fixture from migrate.tests.fixture.models import t...
razzius/sqlalchemy-migrate
migrate/tests/versioning/test_script.py
Python
mit
9,323
0.002789
import maya.cmds as cmds import pymel.all as pm import traceback controlCurve = pm.PyNode('control_curve') ## to make a numerical 'floating point' ## attribute, we use at='double', keyable=True controlCurve.addAttr( 'allCurl', at='double', keyable=True ) controlCurve.addAttr( 'pointerAllCurl', at='double', keyable...
joetainment/mmmmtools
MmmmToolsMod/script_file_runner_scripts/hand_auto_rigging.py
Python
gpl-3.0
5,762
0.020305
"""Define the InverseProblem class. Author: Ilias Bilionis Date: 1/14/2013 1/21/2013 """ __all__ = ['InverseProblem'] import numpy as np import itertools from ..random import StudentTLikelihoodFunction from ..random import RandomWalkProposal from ..random import SequentialMonteCarlo class InversePro...
ebilionis/py-best
best/inverse/_inverse_problem.py
Python
lgpl-3.0
4,531
0.002207
# Copyright (c) 2018 PaddlePaddle 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 app...
luotao1/Paddle
python/paddle/fluid/incubate/fleet/parameter_server/ir/ps_dispatcher.py
Python
apache-2.0
3,500
0.000286
# Generated by Django 1.11.15 on 2018-09-25 15:40 # 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/. from django.db import migrations class Migration(migrations.Migrati...
lonnen/socorro
webapp-django/crashstats/crashstats/migrations/0001_initial.py
Python
mpl-2.0
369
0
import argparse import xml.etree.cElementTree as ET import jobset argp = argparse.ArgumentParser(description='Run interop tests.') argp.add_argument('-l', '--language', default='c++') args = argp.parse_args() # build job build_job = jobset.JobSpec(cmdline=['tools/run_tests/run_interops_build.sh', '%...
crast/grpc
tools/run_tests/run_interops.py
Python
bsd-3-clause
1,163
0.009458
# Copyright 2021 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 writing, ...
datacommonsorg/data
scripts/ourworldindata/covid19/preprocess_csv_test.py
Python
apache-2.0
2,497
0
import unittest import os from xml.etree.ElementTree import ParseError from programy.parser.aiml_parser import AIMLParser from programy.parser.exceptions import ParserException from programy.parser.pattern.nodes.root import PatternRootNode from programy.parser.pattern.nodes.topic import PatternTopicNode from programy....
dkamotsky/program-y
src/test/parser/test_aiml_parser.py
Python
mit
30,276
0.000727
from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import logging import json import os import traceback import time import datetime from socket import AddressFamily try: import psutil except ImportError: print("The reporter requires ps...
ujvl/ray-ng
python/ray/reporter.py
Python
apache-2.0
6,847
0
def __bootstrap__(): global __bootstrap__, __loader__, __file__ import sys, pkg_resources, imp __file__ = pkg_resources.resource_filename(__name__,'_seqmapping.so') __loader__ = None; del __bootstrap__, __loader__ imp.load_dynamic(__name__,__file__) __bootstrap__()
mikel-egana-aranguren/SADI-Galaxy-Docker
galaxy-dist/eggs/bx_python-0.7.2-py2.7-linux-x86_64-ucs4.egg/bx/_seqmapping.py
Python
gpl-3.0
281
0.035587
#!/usr/bin/env python import sys import re import getopt from typing import List, Tuple from feed_maker_util import IO def main(): num_of_recent_feeds = 1000 optlist, _ = getopt.getopt(sys.argv[1:], "n:") for o, a in optlist: if o == '-n': num_of_recent_feeds = int(a) line_list ...
terzeron/FeedMakerApplications
study/_javabeat/capture_item_link_title.py
Python
gpl-2.0
791
0.001264
from django.conf import settings from django.contrib.auth.models import User from django.db import connection from django.test import TestCase from brabeion import badges from brabeion.base import Badge, BadgeAwarded from brabeion.tests.models import PlayerStat class PointsBadge(Badge): slug = "points" level...
kinsights/brabeion
brabeion/tests/tests.py
Python
bsd-3-clause
2,258
0.001329
# This file is part of wger Workout Manager. # # wger Workout Manager 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 License, or # (at your option) any later version. # # wger W...
petervanderdoes/wger
wger/core/tests/test_repetition_unit.py
Python
agpl-3.0
3,162
0.000316
# -*- coding: utf-8 -*- import simplejson from django.core.management.base import BaseCommand from django.contrib.gis.geos import MultiPolygon, Polygon from ...models import State class Command(BaseCommand): args = 'filename' help = 'Import states from a GeoJSON file' def handle(self, *args, **options...
ibamacsr/routes_registry_api
routes_registry_api/routes/management/commands/importstates.py
Python
agpl-3.0
1,055
0.002844
from multiprocessing import Pool import h5py as hdf import numpy as np from calc_cluster_props import * from data_handler import mkTruth, mkHalo import os import sys class AsyncFactory: def __init__(self, func, cb_func): self.func = func self.cb_func = cb_func self.pool = Pool() def ca...
boada/desCluster
mkTargeted/legacy/targetedRealistic_async.py
Python
mit
4,107
0.006331
from fontTools.misc.py23 import strjoin, tobytes, tostr from . import asciiTable class table_T_S_I_V_(asciiTable.asciiTable): def toXML(self, writer, ttFont): data = tostr(self.data) # removing null bytes. XXX needed?? data = data.split('\0') data = strjoin(data) writer.begintag("source") writer.newline(...
google/material-design-icons
update/venv/lib/python3.9/site-packages/fontTools/ttLib/tables/T_S_I_V_.py
Python
apache-2.0
572
0.026224
# 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...
dims/nova
nova/objects/request_spec.py
Python
apache-2.0
22,987
0.000131
from django.test import TestCase import time from .models import SimpleTree, MPTTTree, TBMP, TBNS def timeit(method): """ Measure time of method's execution. """ def timed(*args, **kw): ts = time.time() result = method(*args, **kw) te = time.time() print '\n%r: %2.2f sec'...
klen/simpletree
benchmark/main/tests.py
Python
bsd-3-clause
3,596
0.000278
#!/usr/bin/env python # Copyright 2014 the V8 project authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # This script retrieves the history of all V8 branches and trunk revisions and # their corresponding Chromium revisions. # Requires ...
hellotomfan/v8-coroutine
deps/v8/tools/push-to-trunk/releases.py
Python
gpl-2.0
18,090
0.007573
#!/usr/bin/env python # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # Michael A.G. Aivazis # California Institute of Technology # (C) 1998-2005 All Rights Reserved # # <LicenseText> # # ~~~~~~~~~~~~~~~~~~~~~~~~...
bmi-forum/bmi-pyre
pythia-0.8/examples/tabulator/tabulator/Quadratic.py
Python
gpl-2.0
1,399
0.005004
# -*- coding: utf-8 -*- ''' Module for Sending Messages via XMPP (a.k.a. Jabber) .. versionadded:: 2014.1.0 :depends: - sleekxmpp python module :configuration: This module can be used by either passing a jid and password directly to send_message, or by specifying the name of a configuration profile in the m...
rtx3/saltstack-deyunio
srv/salt/modules/xmpp.py
Python
apache-2.0
5,646
0
# RUN: python %s | llvm-mc -filetype=obj -triple i686-pc-win32 - | llvm-readobj -h | FileCheck %s from __future__ import print_function # This test checks that the COFF object emitter can produce objects with # more than 65279 sections. # While we only generate 65277 sections, an implicit .text, .data and .bss will ...
endlessm/chromium-browser
third_party/llvm/llvm/test/MC/COFF/bigobj.py
Python
bsd-3-clause
935
0.004278
import os # toolchains options ARCH = 'arm' CPU = 'cortex-m3' CROSS_TOOL = 'gcc' if os.getenv('RTT_CC'): CROSS_TOOL = os.getenv('RTT_CC') if CROSS_TOOL == 'gcc': PLATFORM = 'gcc' EXEC_PATH = 'C:\Program Files (x86)\CodeSourcery\Sourcery G++ Lite\bin' #EXEC_PATH = 'C:\Program Files ...
poranmeloge/test-github
stm32_rtt_wifi/bsp/efm32/rtconfig.py
Python
gpl-2.0
2,289
0.009611
# 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/. """ By default, this module uses the pre-built Ember model from https://pubdata.endgame.com/ember/ember_dataset.tar.bz2....
mitre/multiscanner
multiscanner/modules/MachineLearning/EndgameEmber.py
Python
mpl-2.0
2,656
0.001506