repo_name
stringlengths
5
92
path
stringlengths
4
232
copies
stringclasses
19 values
size
stringlengths
4
7
content
stringlengths
721
1.04M
license
stringclasses
15 values
hash
int64
-9,223,277,421,539,062,000
9,223,102,107B
line_mean
float64
6.51
99.9
line_max
int64
15
997
alpha_frac
float64
0.25
0.97
autogenerated
bool
1 class
shruthiag96/ns3-dev-vns
src/lr-wpan/bindings/modulegen__gcc_LP64.py
1
418364
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-2.0
7,679,634,221,064,839,000
64.780503
448
0.616444
false
feist/pcs
pcs/lib/commands/test/test_resource_agent.py
1
15967
# coding=utf-8 import logging from unittest import mock, TestCase from lxml import etree from pcs.test.tools.assertions import ( assert_raise_library_error, start_tag_error_text, ) from pcs.test.tools.command_env import get_env_tools from pcs.test.tools.custom_mock import MockLibraryReportProcessor from pcs.c...
gpl-2.0
2,561,513,103,280,016,000
32.955319
83
0.479604
false
panholt/sparkpy
sparkpy/models/room.py
1
4745
from .base import SparkBase, SparkProperty from .time import SparkTime from .message import SparkMessage from .membership import SparkMembership from .container import SparkContainer class SparkRoom(SparkBase): # | Start of class attributes |-------------------------------------------| API_BASE = 'https://ap...
mit
6,291,617,384,162,153,000
33.136691
79
0.525395
false
prechelt/unread-decorator
setup.py
1
3307
# based on https://github.com/pypa/sampleproject/blob/master/setup.py # see http://packaging.python.org/en/latest/tutorial.html#creating-your-own-project from setuptools import setup, find_packages from setuptools.command.install import install as stdinstall import codecs import os import re import sys def find_v...
bsd-2-clause
5,754,088,370,807,579,000
32.755102
91
0.643786
false
fpliger/statz
setup.py
1
1151
from __future__ import print_function import sys import os.path from setuptools import setup, find_packages readme = os.path.join(os.path.dirname(__file__), 'README.rst') long_description = open(readme).read() setup( name='statz', version='0.0.1', author='Fabio Pliger', author_email='fabio.pliger@gma...
mit
5,771,319,466,270,742,000
25.181818
86
0.582103
false
askalbania/piernik
problems/mcrwind/piernik_problem.py
1
1992
#!/usr/bin/python import sys import numpy as np import matplotlib matplotlib.use('cairo') from yt.mods import load as yt_load from pylab import * THRESHOLD = 1e-9 FIELD = "cr1" def _myplot(diff, fname, ext, clbl): v = abs(diff).max() figure(1, (6, 8)) imshow(diff, vmin=-v, vmax=v, extent=ext, cmap='RdBu'...
gpl-3.0
-1,219,925,660,328,792,000
28.294118
103
0.566767
false
ccoakley/dbcbet
dbcbet/test/dbcbet_test.py
1
7562
"""Test dbcbet""" from dbcbet.dbcbet import pre, post, inv, throws, dbc, bet, finitize, finitize_method, ContractViolation, ThrowsViolation from dbcbet.helpers import state, argument_types # # These methods are the various preconditions, postconditions, and invariants used by tests # # a precondition def both_number...
mit
8,137,722,210,013,781,000
24.633898
121
0.644406
false
espdev/readthedocs.org
readthedocs/restapi/views/search_views.py
1
4951
import logging from rest_framework import decorators, permissions, status from rest_framework.renderers import JSONRenderer from rest_framework.response import Response from readthedocs.builds.constants import LATEST from readthedocs.builds.models import Version from readthedocs.projects.models import Project, Projec...
mit
4,044,174,051,605,192,000
33.381944
92
0.654211
false
zerothi/sids
sisl/utils/ranges.py
1
8369
import re from itertools import groupby from numpy import zeros, ones, cumsum, take, int32, int64 from numpy import asarray __all__ = ["strmap", "strseq", "lstranges", "erange", "list2str", "fileindex"] __all__ += ["array_arange"] # Function to change a string to a range of integers def strmap(func, s, start=None, ...
lgpl-3.0
-7,897,043,921,294,780,000
25.400631
83
0.50699
false
wowref/wowref.com
wowref/wotlk/dbc/lib/dbcfile.py
1
3843
#!/usr/bin/env python import os from struct import Struct from .dtypes import * UNICODE_BLANK = '' class DBCRecord(object): """A simple object to convert a dict to an object.""" def __init__(self, d=None): self.data = d def __repr__(self): return "<DBCRecord %r>" % self.data def _...
mit
2,913,251,282,306,833,000
30.243902
87
0.53604
false
socialwifi/jsonapi-requests
tests/test_auth.py
1
1174
from unittest import mock import pytest from flask import Flask from jsonapi_requests import configuration from jsonapi_requests import auth from jsonapi_requests import request_factory @pytest.fixture def api_configuration(): return configuration.Factory({'API_ROOT': 'http://testing', 'AUTH': auth.FlaskForwar...
bsd-3-clause
-3,956,231,088,293,769,000
26.952381
114
0.735945
false
OCA/event
event_project/tests/test_event_project.py
1
2779
# Copyright 2016 Pedro M. Baeza <pedro.baeza@tecnativa.com> # Copyright 2017 David Vidal <david.vidal@tecnativa.com> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import fields from odoo.tests import common from datetime import timedelta, date class TestEventProject(common.SavepointCase):...
agpl-3.0
5,265,019,467,606,680,000
40.477612
78
0.616409
false
wmayner/pyphi
test/test_labels.py
1
1069
import pytest from pyphi.labels import NodeLabels @pytest.fixture def nl(): return NodeLabels(("A", "B", "C"), (0, 1, 2)) def test_defaults(): nd = NodeLabels(None, (0, 1, 2)) assert nd.labels == ("n0", "n1", "n2") def test_labels2indices(nl): assert nl.labels2indices(("A", "B")) == (0, 1) as...
gpl-3.0
318,098,530,878,710,140
20.38
57
0.57811
false
keith-lewis100/pont-workbench
main/data_models.py
1
7503
#_*_ coding: UTF-8 _*_ import logging from google.appengine.api import users from google.appengine.ext import ndb import db import mailer import renderers import urls from role_types import RoleType logger = logging.getLogger('model') workbench = db.WorkBench.get_or_insert('main') committee_labels=[ ('AMB',...
mit
7,102,527,674,163,779,000
30.128631
95
0.603439
false
josdejong/mathjs
test/benchmark/matrix_operations_python.py
1
4102
# install numpy # # sudo apt install python-pip # pip install --user --upgrade pip # pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose # import sys import timeit import numpy as np print (sys.version_info) # fiedler matrix 25 x 25 A = [ [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,...
apache-2.0
-5,856,528,032,766,062,000
57.6
115
0.478303
false
bmng-dev/PyBitmessage
src/debug.py
1
2373
# -*- coding: utf-8 -*- ''' Levels: DEBUG Detailed information, typically of interest only when diagnosing problems. INFO Confirmation that things are working as expected. WARNING An indication that something unexpected happened, or indicative of some problem in the near fut...
mit
-3,289,994,757,642,380,300
34.893939
140
0.580414
false
Krissbro/LondonGaymers
cleverbot/cleverbot.py
1
2825
try: from cleverbot import Cleverbot as _Cleverbot if 'API_URL' in _Cleverbot.__dict__: _Cleverbot = False except: _Cleverbot = False from discord.ext import commands from cogs.utils import checks from .utils.dataIO import dataIO import os import discord import asyncio class Cleverbot(): """Cle...
gpl-3.0
1,294,411,271,893,057,800
33.036145
77
0.603894
false
Koodous/androguard-yara
download_androguard_report.py
1
2918
#!/usr/bin/python # -*- coding: utf-8 -*- """ Copyright (c) 2015. The Koodous 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-...
apache-2.0
-8,956,185,248,688,753,000
31.411111
88
0.63387
false
TUBvision/hrl
lib/graphics/graphics.py
1
12520
""" This is the HRL submodule for handling graphics devices and OpenGL. Graphics devices in HRL instantiate the 'Graphics' abstract class, which defines the common functions required for displaying greyscale images. Image presentation in HRL can be understood as a multi step process as follows: Bitmap (The image ...
lgpl-2.1
7,395,943,921,647,267,000
32.655914
106
0.640575
false
PeterDing/iScript
xiami.py
1
55901
#!/usr/bin/env python2 # -*- coding: utf-8 -*- import re import sys from getpass import getpass import os import copy import random import time import datetime import json import argparse import requests import urllib import hashlib import select from mutagen.id3 import ID3,TRCK,TIT2,TALB,TPE1,APIC,TDRC,COMM,TPOS,USLT...
mit
8,859,938,585,418,477,000
35.344532
177
0.472513
false
ctsit/redcap_deployment
utility_redcap.py
1
4631
from fabric.api import * from tempfile import mkstemp import os import utility try: import configparser except: from six.moves import configparser __all__ = [] def get_current_redcap_version(): """ gets the current redcap version from database """ with settings(user=env.deploy_user): ...
bsd-3-clause
-1,521,481,576,971,571,200
37.915966
121
0.616929
false
taxipp/ipp-macro-series-parser
ipp_macro_series_parser/denombrements_fiscaux/denombrements_parsers.py
1
29920
import logging import numpy import os import pandas import pkg_resources import re from ipp_macro_series_parser.config import Config config_parser = Config() xls_directory = config_parser.get('data', 'denombrements_fiscaux_xls') hdf_directory = config_parser.get('data', 'denombrements_fiscaux_hdf') log = loggi...
gpl-3.0
-7,274,436,793,316,057,000
33.142039
132
0.580588
false
johnnoone/zbx
zbx/io/defaults.py
1
3539
""" zbx.io.defaults ~~~~~~~~~~~~~~~ Defines all zabbix defaults """ __all__ = ['rules', 'RuleSet'] from abc import ABCMeta from itertools import chain from six import add_metaclass @add_metaclass(ABCMeta) class RuleSet(object): def __init__(self, path, rules): self.path = path self...
bsd-3-clause
6,384,678,967,305,997,000
19.107955
62
0.473298
false
th3sys/capsule
push_items.py
1
1667
from __future__ import print_function # Python 2/3 compatibility import boto3 import json import uuid import time import decimal dynamodb = boto3.resource('dynamodb', region_name='us-east-1') sec_table = dynamodb.Table('Securities') quotes_table = dynamodb.Table('Quotes.EOD') with open("quotes.json") as json_file: ...
mit
7,072,675,700,951,598,000
28.767857
68
0.577684
false
skosukhin/spack
var/spack/repos/builtin/packages/clamr/package.py
1
3013
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
4,936,657,519,546,583,000
37.628205
78
0.629605
false
gsnbng/erpnext
erpnext/hr/report/vehicle_expenses/vehicle_expenses.py
2
3137
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe import erpnext from frappe import _ from frappe.utils import flt,cstr from erpnext.accounts.report.financial_statements import get_period_list de...
agpl-3.0
-586,803,672,256,891,600
33.855556
120
0.671023
false
droundy/deft
papers/histogram/figs/plot-convergence.py
1
5111
#!/usr/bin/python2 import matplotlib, sys matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy matplotlib.rc('font', **{'family': 'serif', 'serif': ['Computer Modern']}) matplotlib.rc('text', usetex=True) import styles if len(sys.argv) != 7: print('useage: %s ww ff N min_T methods seed' % sys.argv[...
gpl-2.0
-6,103,449,264,001,766,000
32.847682
160
0.586774
false
eshijia/magnum
magnum/api/controllers/v1/baymodel.py
1
14815
# 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...
apache-2.0
-8,307,967,998,542,834,000
38.193122
79
0.60351
false
nitish-tripathi/Simplery
ANN/Odin_10/Network.py
1
12776
""" http://neuralnetworksanddeeplearning.com/chap1.html#implementing_our_network_to_classify_digits http://numericinsight.com/uploads/A_Gentle_Introduction_to_Backpropagation.pdf https://ayearofai.com/rohan-lenny-1-neural-networks-the-backpropagation-algorithm-explained-abf4609d4f9d """ #### Libraries # Standard libr...
mit
369,818,851,461,477,000
37.251497
124
0.560269
false
kevinjqiu/jirafs
jirafs/cmdline.py
1
4707
import argparse import codecs import logging import os import sys import time from blessings import Terminal import six from verlib import NormalizedVersion from . import utils from .exceptions import ( GitCommandError, JiraInteractionFailed, JirafsError, NotTicketFolderException ) # Write data to ...
mit
8,821,853,478,044,909,000
27.70122
77
0.5273
false
phamtrisi/metapp2
manage.py
1
2515
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import subprocess from flask.ext.script import Manager, Shell, Server from flask.ext.migrate import MigrateCommand from metapp2.app import create_app from metapp2.user.models import User from metapp2.meeting.models import Meeting from metapp2.meeting_...
bsd-3-clause
-5,898,075,227,168,820,000
37.106061
550
0.754672
false
mogillc/theo
software/TheoTest/motor.py
1
1505
import curses import mraa import time stdscr = curses.initscr() curses.noecho() curses.cbreak() stdscr.keypad(1) stdscr.addstr(0,0,"Press 'q' to quit\n") stdscr.refresh() def set_motor(chan,en,phase): if(chan == 0): gpio = mraa.Gpio(21) gpio.dir(mraa.DIR_OUT) gpio.write(phase) gpio = mraa.Gpio(0) gpio.di...
apache-2.0
-8,672,312,592,866,148,000
17.13253
46
0.642525
false
Affirm/cabot
cabot/metricsapp/models/grafana.py
1
5474
import logging import requests import urlparse from django.core.exceptions import ValidationError from django.db import models from cabot.metricsapp import defs from cabot.metricsapp.api import get_series_ids, get_panel_url logger = logging.getLogger(__name__) class GrafanaInstance(models.Model): class Meta: ...
mit
-6,052,379,822,475,333,000
35.493333
107
0.647059
false
qdzzyb2014/flask-weibo
app/forms.py
1
1550
from flask.ext.wtf import Form from wtforms import TextField, BooleanField, TextAreaField, PasswordField from wtforms.validators import Required, Length, Email class LoginForm(Form): user_name = TextField('user_name', validators = [Required()]) password = PasswordField('password', validators = [Required()]) ...
bsd-3-clause
-3,858,252,173,252,549,000
38.74359
102
0.652903
false
QEF/postqe
postqe/bands.py
1
4666
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Functions to calculate the electronic band structure. Note: no symmetry recognition is implemented yet. """ import numpy as np from math import fabs, sqrt from postqe.xmlfile import get_cell_data, get_calculation_data, get_band_strucure_data from postqe.constants im...
lgpl-2.1
3,263,816,706,830,989,300
39.224138
133
0.545649
false
tompecina/legal
legal/uds/views.py
1
11475
# -*- coding: utf-8 -*- # # uds/views.py # # Copyright (C) 2011-19 Tomáš Pecina <tomas@pecina.cz> # # This file is part of legal.pecina.cz, a web-based toolbox for lawyers. # # This application is free software: you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published ...
gpl-3.0
4,609,566,359,525,702,000
32.601173
118
0.575929
false
axiros/transcrypt
make.py
1
1049
#!/usr/bin/env python print ''' we require an index.html.tmpl next to us in this folder, into which we put the content of pandoc generated raw show.html, then write index.html with the result. ''' from time import sleep import os if __name__ == '__main__': oldstat = 0 print 'looping, checking changes of show...
apache-2.0
3,437,461,641,889,378,300
32.83871
87
0.561487
false
gibbon-joel/metahive
bin/import-to-hive.py
1
28520
#!/usr/bin/python import os, sys import hashlib import MySQLdb import MySQLdb.cursors from datetime import datetime import time import shutil import magic import argparse import re sys.path.append('%s/../lib' %(os.path.dirname(__file__))) import metahivesettings.settings #from metahive.scanners mport * import metahiv...
gpl-3.0
-1,959,386,333,837,326,000
41.127031
281
0.552735
false
TheProjecter/kassie
exemples/chat.py
1
3905
# -*-coding:Utf-8 -* # Copyright (c) 2010 LE GOFF Vincent # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # l...
bsd-3-clause
-4,216,159,609,555,280,000
38.242424
79
0.732304
false
vpp-dev/vpp-lua-plugin
samples/polua-classifier-test.py
1
16825
# do this in the shell # virtualenv/bin/pip install scapy # sudo LD_LIBRARY_PATH=$LD_LIBRARY_PATH virtualenv/bin/scapy # You also can do this from within scapy: # execfile("polua-classifier-test.py") # The rest is in the scapy CLI import vpp_papi v = vpp_papi v.connect("pytest") def cli(cmd): print("Running " + c...
apache-2.0
7,852,703,831,240,850,000
37.501144
249
0.676909
false
NoahDStein/NeuralNetSandbox
wavenet.py
1
16175
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy import tensorflow as tf import tensorflow.contrib.slim as slim import time from tfutil import restore_latest, modified_dynamic_shape, quantizer, dequantizer, crappy_plot, draw_on, \ queue_app...
apache-2.0
-6,833,931,838,539,768,000
48.616564
192
0.617743
false
IsCoolEntertainment/debpkg_python-boto
boto/route53/connection.py
1
16973
# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010, Eucalyptus Systems, Inc. # Copyright (c) 2011 Blue Pines Technologies LLC, Brad Carleton # www.bluepines.org # Copyright (c) 2012 42 Lines Inc., Jim Browne # # Permission is hereby granted, free of charge, to any person obtaining a # copy...
mit
573,871,493,404,455,400
38.38051
94
0.567548
false
CountZer0/PipelineConstructionSet
python/common/core/globalVariables.py
1
1227
''' Author: Jason Parks Created: Apr 22, 2012 Module: common.core.globalVariables Purpose: to import globalVariables ''' # Location of Toolset #toolsLocation = '/Users/jasonparks/Documents/workspace/PipelineConstructionSet' toolsLocation = 'C:/Users/jason/git/PipelineConstructionSet' # NOTE!: It is necessary to m...
bsd-3-clause
4,143,952,701,070,569,500
27.55814
80
0.764466
false
vienin/vlaunch
src/updater.py
1
9201
#!/usr/bin/python # -*- coding: utf-8 -*- # UFO-launcher - A multi-platform virtual machine launcher for the UFO OS # # Copyright (c) 2008-2009 Agorabox, Inc. # # 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 Foun...
gpl-2.0
-7,252,024,127,118,176,000
43.235577
145
0.536572
false
veter-team/mechspeak
src/imshow.py
1
1438
import os, sys import io import Tkinter import Image, ImageTk from time import sleep import cStringIO import paho.mqtt.client as mqtt host = "test.mosquitto.org" #host = "localhost" qos = 0 sensors_topic = "/rtmsg/d25638bb-17c2-46ac-b26e-ce1f67268088/sensors/" camera_topic = sensors_topic + "camera1" imgcnt = 0 def...
mit
-6,768,945,433,732,105,000
25.62963
77
0.666898
false
radarsat1/siconos
io/swig/io/vview.py
1
109726
#!/usr/bin/env @PYTHON_EXECUTABLE@ """ Description: Viewer and exporter for Siconos mechanics-IO HDF5 files based on VTK. """ # Lighter imports before command line parsing from __future__ import print_function import sys import os import json import getopt import math import traceback import vtk from vtk.util.vtkAlgor...
apache-2.0
-5,573,428,976,966,245,000
39.104532
158
0.544502
false
matus-stehlik/glowing-batman
roots/wsgi.py
1
1132
""" WSGI config for roots 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_APPLICATION`` se...
mit
8,697,966,878,818,311,000
39.428571
79
0.79947
false
hariseldon78/Teacup_gen3_customized
createTemperatureLookup.py
1
6248
#!/usr/bin/python # -*- coding: utf-8 -*- # # Creates a C code lookup table for doing ADC to temperature conversion # on a microcontroller # based on: http://hydraraptor.blogspot.com/2007/10/measuring-temperature-easy-way.html # Modified Thu 10 Feb 2011 02:02:28 PM MST jgilmore for 5D_on_arduino firmware # temps are no...
gpl-2.0
-2,905,846,211,853,608,000
39.044872
154
0.638547
false
jtraver/dev
python/graphics/circles8.py
1
24535
#!/usr/bin/python # http://mcsp.wartburg.edu/zelle/python/graphics.py # https://mcsp.wartburg.edu/zelle/python/graphics/graphics/index.html import math from graphics import * XSCALE = 2550 YSCALE = 1310 XCENTER = XSCALE / 2 YCENTER = YSCALE / 2 # https://en.wikipedia.org/wiki/Incircle_and_excircles_of_a_triangle#...
mit
1,088,411,825,872,629,100
30.33461
202
0.539352
false
ucloud/uai-sdk
uaitrain/operation/pack_docker_image/pytorch_pack_op.py
1
1534
# Copyright 2017 The UAI-SDK 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 applicable...
apache-2.0
1,090,517,671,928,776,800
50.133333
178
0.614081
false
Alex9029/awesomeTHz-Python-webapp
www/models.py
1
1470
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Models for user, blog and comment. ''' __author__ = 'Chalex' import time, uuid from transwarp.db import next_id from transwarp.orm import Model, StringField, BooleanField, FloatField, TextField class User(Model): __table__ = 'users' id = StringField(primary_key=...
gpl-2.0
-2,106,225,807,252,490,500
29.645833
81
0.710884
false
eubr-bigsea/tahiti
migrations/versions/c6x2kllv52os_sklearn_operations.py
1
5027
# -*- coding: utf-8 -*- """Adding Scikit-learn Operations Revision ID: c6x2kllv52os Revises: bca9291ljsj5 Create Date: 2018-06-14 10:42:09.555626 """ from alembic import context from alembic import op from sqlalchemy import String, Integer, Text from sqlalchemy.orm import sessionmaker from sqlalchemy.sql import tabl...
apache-2.0
-6,946,335,271,519,121,000
25.046632
64
0.527153
false
oVirt/imgbased
tests/testStorage.py
1
1632
#!/usr/bin/env python # vim: et ts=4 sw=4 sts=4 import unittest import logging import glob log = logging.info def dd(N, count=100): from sh import dd dd("if=/dev/zero", "of=/var/tmp/%s.bin" % N, "bs=1M", "count=%d" % count) def trial(num_bins=1, size_bin=500, after_rm=None, max_delta=0.05): fr...
gpl-2.0
6,680,292,225,265,847,000
22.652174
67
0.571691
false
shiroyuki/passerine
test/ft/db/test_uow_association_many_to_many.py
1
5858
from ft.db.dbtestcase import DbTestCase from passerine.db.session import Session from passerine.db.common import ProxyObject from passerine.db.uow import Record from passerine.db.entity import entity from passerine.db.manager import Manager from passerine.db.mapper import link, CascadingType, AssociationType from passe...
mit
-367,212,113,049,477,570
29.670157
123
0.573233
false
travcunn/sic_assembler
tests.py
1
8705
import unittest import sic_assembler.assembler as assembler import sic_assembler.instructions as instructions from sic_assembler.assembler import Assembler, SourceLine from sic_assembler.instructions import Format from sic_assembler.instructions import Format1, Format2, Format3, Format4 import sic_assembler.records a...
mit
2,111,154,333,369,349,000
31.360595
96
0.585411
false
MizzouCMMSGroup1/ChromosomeModel
src/conjugate_gradient_plot.py
1
4967
# some imports we use import numpy import random import math from scipy import optimize # matplot lib import matplotlib as mpl from mpl_toolkits.mplot3d import Axes3D import numpy as np import matplotlib.pyplot as plt # our data dimension (*xyz), we are using megabase resolution NUMBER_CONTACTS = 157 NUMBER_CONTACTS_...
gpl-2.0
1,627,960,150,278,846,200
25.280423
122
0.624723
false
wrgeorge1983/Pystol
_iactive.py
1
15584
#! /usr/bin/python """ Created on Mar 26, 2015 @author: William.George Credit to /r/Python for the non-wasteful and sensible handling of oldInit and newInit """ # Standard Library Imports import os import sys import json from pprint import pprint # Not used here, but we want it in interactive mode. import time f...
lgpl-2.1
5,891,277,525,246,864,000
29.920635
104
0.563976
false
springmerchant/pybbm
pybb/migrations/0003_auto_20150424_0918.py
1
1054
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from pybb.models import create_or_check_slug def fill_slugs(apps, schema_editor): Category = apps.get_model("pybb", "Category") Forum = apps.get_model("pybb", "Forum") Topic = apps.get_model("pybb", "...
bsd-2-clause
-3,424,356,357,889,820,000
29.114286
87
0.647059
false
Donkyhotay/MoonPy
zope/app/form/browser/tests/test_directives.py
1
11244
############################################################################# # # Copyright (c) 2001, 2002 Zope Corporation 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. # TH...
gpl-3.0
-4,779,756,308,137,482,000
34.695238
78
0.595607
false
pedrombmachado/summitxl
simple_follower/scripts/laserTracker.py
1
3097
#!/usr/bin/env python # test mail: chutter@uos.de import rospy import thread, threading import time import numpy as np from sensor_msgs.msg import Joy, LaserScan from geometry_msgs.msg import Twist, Vector3 from std_msgs.msg import String as StringMsg from simple_follower.msg import position as PositionMsg class la...
gpl-3.0
31,351,464,826,698,900
35.435294
112
0.723926
false
jmanday/Informatica
DAI/Practicas/resolucionPracticas_1_2/sesion02/ej_04.py
1
1510
#!/usr/bin/python # -*- coding: utf-8 -*- # Practicas de Desarrollo de Aplicaciones para Internet (DAI) # Copyright (C) 2013 - Zerjillo (zerjioi@ugr.es) # # 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 Softwar...
gpl-3.0
-1,203,772,582,571,132,200
32.466667
116
0.689701
false
rbarlow/pulp_docker
plugins/pulp_docker/plugins/distributors/publish_steps.py
1
8980
from gettext import gettext as _ import json import os from pulp.plugins.util import misc, publish_step from pulp_docker.common import constants from pulp_docker.plugins import models from pulp_docker.plugins.distributors import configuration, v1_publish_steps class WebPublisher(publish_step.PublishStep): """ ...
gpl-2.0
-9,088,429,965,034,889,000
39.45045
99
0.634633
false
andrellsantos/agentspeak-py
agentspeak-py/agent.py
1
13361
#!/usr/bin/python # -*- coding: utf-8 -*- import random import copy from agentspeak import * class Agent: def __init__(self, name, belief_base, initial_goals, plan_library): self.name = name self.__belief_base = belief_base # Conjunto de planos P self.__plan_library = plan_li...
gpl-3.0
7,225,907,124,630,131,000
43.016722
112
0.573708
false
openhealthcare/randomise.me
rm/trials/migrations/0020_auto__add_field_report_variable__chg_field_report_score.py
1
7439
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Report.variable' db.add_column(u'trials_report', 'variable', self.gf('...
agpl-3.0
-7,017,855,676,726,162,000
61.521008
137
0.54752
false
agconti/Ember-Demo
ember_demo/users/migrations/0002_set_site_domain_and_name.py
1
4352
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import DataMigration from django.conf import settings from django.db import models class Migration(DataMigration): def forwards(self, orm): """Set site domain and name.""" Site = orm['sites.Site'] site = Site.ob...
mit
6,375,379,218,639,753,000
58.630137
195
0.554917
false
trbs/django-constance-trbs
tests/storage.py
1
3502
# -*- encoding: utf-8 -*- import six from datetime import datetime, date, time from decimal import Decimal if six.PY3: long = int class StorageTestsMixin(object): def test_store(self): # read defaults import constance config = constance.load_config_class()() self.assertEqual(...
bsd-3-clause
2,237,975,639,157,402,600
40.642857
96
0.641224
false
kg-bot/SupyBot
plugins/MilleBornes/config.py
1
2718
### # Copyright (c) 2010, Valentin Lorentz # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of conditi...
gpl-3.0
5,178,330,492,657,698,000
45.067797
79
0.765636
false
tombstone/models
official/vision/detection/dataloader/factory.py
1
4932
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
-2,585,703,879,675,773,000
46.883495
80
0.70884
false
CivicKnowledge/metaeditor
compat/tests/helpers.py
1
1050
# -*- coding: utf-8 -*- import fudge local_cache = {} def patch_identifier_index(result): """ Patches ambry search identifier to return given result. """ from ambry.library.search import Search # convert each dict in the result to the hit expected by searcher. class MyDict(dict): pass ...
mit
-950,198,280,900,492,700
22.333333
70
0.598095
false
rastrexando-eu/rastrexando-eu
core/migrations/0060_auto_20180128_1205.py
1
1505
# Generated by Django 2.0.1 on 2018-01-28 11:05 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('core', '0059_config'), ] operations = [ migrations.AlterField( model_name='config', ...
gpl-3.0
-6,761,579,042,721,352,000
37.564103
183
0.621011
false
napalm-automation/napalm-yang
napalm_yang/models/openconfig/network_instances/network_instance/mpls/signaling_protocols/segment_routing/interfaces/interface/interface_ref/config/__init__.py
1
19329
# -*- coding: utf-8 -*- from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListTy...
apache-2.0
-7,710,712,199,952,492,000
39.437238
352
0.598686
false
FedoraScientific/salome-hexablock
doc/test_doc/make_transformation/make_scale.py
1
1308
# -*- coding: latin-1 -*- # Copyright (C) 2009-2014 CEA/DEN, EDF R&D # # 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 Foundation; either # version 2.1 of the License, or (at your option) any later ...
lgpl-2.1
-8,208,037,687,077,105,000
28.727273
81
0.692661
false
openstack/designate
designate/objects/zone_import.py
1
1570
# Copyright 2015 Rackspace Inc. # # Author: Tim Simmons <tim.simmons@rackspace.com> # # 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...
apache-2.0
-6,399,281,235,386,972,000
34.681818
75
0.689809
false
anish/buildbot
master/buildbot/status/buildrequest.py
1
4850
# This file is part of Buildbot. Buildbot 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 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
-6,598,749,122,687,935,000
30.699346
80
0.632165
false
rbmj/pyflightcontrol
pyflightcontrol/aircraft/mpl3115a2.py
1
3189
from smbus import SMBus from sys import exit import os import time class MPL3115A2(object): #I2C ADDRESS/BITS ADDRESS = (0x60) #REGISTERS REGISTER_STATUS = (0x00) REGISTER_STATUS_TDR = 0x02 REGISTER_STATUS_PDR = 0x04 REGISTER_STATUS_PTDR = 0x08 REGISTER_PRESSURE_MSB = (0x01) ...
apache-2.0
-4,089,819,986,893,017,600
26.973684
72
0.570398
false
uni-peter-zheng/tp-qemu
qemu/tests/flow_caches_stress_test.py
2
6329
import logging import time from autotest.client import utils from autotest.client.shared import error from virttest import utils_netperf, utils_net, env_process, utils_misc from virttest import data_dir, utils_test # This decorator makes the test function aware of context strings @error.context_aware def run(test, pa...
gpl-2.0
-550,993,333,842,579,100
45.19708
86
0.589825
false
dawn110110/xhj-renren
ntype.py
1
1193
#-*-coding:utf-8-*- """ Original Author: wong2 <wonderfuly@gmail.com> 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...
mit
6,446,602,852,576,925,000
34.909091
70
0.774684
false
aymara/knowledgesrl
src/errorslog.py
1
4172
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import random from collections import Counter errors = { "vn_parsing": [], "vn_missing": [], "frame_without_slot": [], "frame_with_slot": [], "impossible_role_matching": [], "ambiguous_role": [] } debug_data = [] def log_vn_missing(frame): ...
agpl-3.0
-1,891,198,027,836,748,300
33.196721
162
0.616731
false
ray-project/ray
rllib/examples/env/mbmpo_env.py
1
3338
from gym.envs.classic_control import PendulumEnv, CartPoleEnv import numpy as np # MuJoCo may not be installed. HalfCheetahEnv = HopperEnv = None try: from gym.envs.mujoco import HalfCheetahEnv, HopperEnv except Exception: pass class CartPoleWrapper(CartPoleEnv): """Wrapper for the Cartpole-v0 environme...
apache-2.0
4,605,161,927,756,585,500
31.72549
79
0.584182
false
EliAndrewC/ensconce
tests/unit/crypto/test_ephemeral.py
1
3398
import os import hashlib from ensconce.crypto import MasterKey, state, util as crypto_util from ensconce import exc from tests import BaseModelTest class EphemeralStateTest(BaseModelTest): def setUp(self): super(EphemeralStateTest, self).setUp() # We need to reset the state state.se...
bsd-3-clause
6,698,764,096,634,126,000
39.464286
106
0.628605
false
jkominek/scicasting
hurricanes/firststorm.py
1
2737
#!/usr/bin/python from datetime import datetime, date, timedelta from pymc import * import numpy as np dates = [ date(1992, 4, 21), date(1993, 5, 31), date(1994, 6, 30), date(1995, 6, 2), date(1996, 6, 17), date(1997, 6, 1), date(1998, 7, 27), date...
isc
4,998,649,028,677,647,000
28.117021
77
0.583851
false
yeming233/rally
rally/plugins/openstack/context/watcher/audit_templates.py
1
4458
# 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 #...
apache-2.0
-3,759,380,146,004,210,000
37.102564
78
0.528488
false
jacobian-archive/python-hdcloud
hdcloud/client.py
1
1893
import httplib2 import urlparse import urllib import hdcloud from . import exceptions try: import json except ImportError: import simplejson as json class HDCloudClient(httplib2.Http): USER_AGENT = 'python-hdcloud/%s' % hdcloud.__version__ BASE_URL = 'http://hdcloud.com/api/v1/' def _...
bsd-3-clause
-7,586,979,735,969,499,000
32.210526
85
0.595351
false
licko/vpp-1701-licko
test/test_gre.py
1
23296
#!/usr/bin/env python import unittest from logging import * from framework import VppTestCase, VppTestRunner from vpp_sub_interface import VppDot1QSubint from vpp_gre_interface import VppGreInterface from vpp_ip_route import IpRoute, RoutePath from vpp_papi_provider import L2_VTR_OP from scapy.packet import Raw from...
apache-2.0
656,361,454,378,659,000
33.666667
78
0.455915
false
vhernandez/jwsProcessor
src/jwsprocessor/pysmoothing.py
1
6326
#!/urs/bin/env python # -*- coding: UTF8 -*- """ PySMOOTHING Library v 0.11 * Copyright (C) 2005 Victor M. Hernandez Rocamora * Code for Savitsky-Golay filtering converted from MatLab code of 'sgolay' and 'sgolayfilt' functions from Octave software(http://www.octave.org/), which are Copyright (C) 2001 Paul Kien...
gpl-2.0
-3,851,358,189,755,600,400
31.27551
104
0.585994
false
dessn/sn-bhm
dessn/planck/planck.py
1
1173
import numpy as np import inspect import os def get_planck(restricted=True): """ Priors from COM_CosmoParams_fullGrid_R2.00\base_w\plikHM_TT_lowTEB\base_w_plikHM_TT_lowTEB""" file = os.path.abspath(inspect.stack()[0][1]) dir_name = os.path.dirname(file) results = np.load(dir_name + "/planck.npy") ...
mit
-8,789,032,739,981,367,000
32.514286
101
0.618926
false
houghb/ligpy
ligpy/ligpy_utils.py
1
18322
""" Misc utility functions required by several modules in the ligpy program. """ import os import numpy as np from constants import GAS_CONST, MW def set_paths(): """ Set the absolute path to required files on the current machine. Returns ------- reactionlist_path : str ...
bsd-2-clause
-1,464,800,841,360,162,300
34.439072
79
0.569643
false
simphony/simphony-mayavi
simphony_mayavi/cuds/tests/test_vtk_lattice.py
1
9617
import unittest from functools import partial from numpy.testing import assert_array_equal from hypothesis import given from hypothesis.strategies import sampled_from from tvtk.api import tvtk from simphony.core.cuba import CUBA from simphony.testing.abc_check_lattice import ( CheckLatticeNodeOperations, CheckLat...
bsd-2-clause
-8,452,465,650,325,802,000
37.468
76
0.580638
false
yulin724/rt-thread-comment
tools/building.py
1
10474
import os import sys import string from SCons.Script import * BuildOptions = {} Projects = [] Rtt_Root = '' Env = None def _get_filetype(fn): if fn.rfind('.c') != -1 or fn.rfind('.C') != -1 or fn.rfind('.cpp') != -1: return 1 # assimble file type if fn.rfind('.s') != -1 or fn.rfind...
gpl-2.0
4,825,416,945,449,508,000
27.01385
98
0.557953
false
whiskeylover/idreamoftoast
toast/app.py
1
6684
import datetime import json from urllib.parse import unquote from urllib.request import urlopen from flask import jsonify, Response from peewee import CharField, DateTimeField, IntegerField, Model import config #------------------------------------------------------------------------------- # Constants #------------...
apache-2.0
3,691,948,276,489,078,300
33.8125
159
0.529473
false
yochem/glutenfree
setup.py
1
1539
""" glutenfree """ from setuptools import find_packages, setup dependencies = ['click'] setup( name='glutenfree', version='0.1.0', url='https://github.com/yochem/glutenfree', license='MIT', author='Yochem van Rosmalen', author_email='yochem@icloud.com', description='glutenfree', long_d...
mit
3,209,343,961,780,569,000
31.0625
72
0.590643
false
gonicus/gosa
common/src/gosa/common/network.py
1
3494
# This file is part of the GOsa framework. # # http://gosa-project.org # # Copyright: # (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de # # See the LICENSE file in the project's top-level directory for details. import dbus from gosa.common.components.dbus_runner import DBusRunner from logging import getLogger ...
lgpl-2.1
-8,663,401,339,332,908,000
31.962264
139
0.603892
false
rdo-management/tuskar-ui
tuskar_ui/test/test_data/utils.py
1
2129
# # 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 # ...
apache-2.0
2,699,559,248,062,084,000
39.942308
78
0.678253
false
yephper/django
django/contrib/gis/geos/prototypes/predicates.py
1
1630
""" This module houses the GEOS ctypes prototype functions for the unary and binary predicate operations on geometries. """ from ctypes import c_char, c_char_p, c_double from django.contrib.gis.geos.libgeos import GEOM_PTR, GEOSFuncFactory from django.contrib.gis.geos.prototypes.errcheck import check_predicat...
bsd-3-clause
-4,548,278,871,508,046,000
35.906977
98
0.752761
false
DavidWhittingham/agsadmin
agsadmin/sharing_admin/community/groups/Group.py
1
1457
from __future__ import (absolute_import, division, print_function, unicode_literals) from builtins import (ascii, bytes, chr, dict, filter, hex, input, int, map, next, oct, open, pow, range, round, str, super, zip) from ...._utils import send_session_request from ..._PortalEndpointBase import Por...
bsd-3-clause
7,639,082,891,741,181,000
32.906977
117
0.643102
false
qubole/qds-sdk-py
qds_sdk/cluster.py
1
61544
""" The cluster module contains the definitions for retrieving and manipulating cluster information. """ from qds_sdk.qubole import Qubole from qds_sdk.resource import Resource from argparse import ArgumentParser from qds_sdk import util import logging import json log = logging.getLogger("qds_cluster") def str2boo...
apache-2.0
4,479,859,046,252,228,600
45.837139
159
0.539906
false
segfaulthunter/asynchia
benchmark/ee_parse.py
1
2223
# -*- coding: us-ascii -*- # asynchia - asynchronous networking library # Copyright (C) 2009 Florian Mayer <florian.mayer@bitsrc.org> # This program 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 Foundation, eit...
gpl-3.0
-3,150,133,316,793,390,600
26.7875
77
0.662618
false
mrosenstihl/PulsePrograms
autoPFGStimulatedEcho_const_T1/analyse.py
1
2319
import re, os,sys import numpy as N from tables import * import scipy.odr import pylab as P conv = 6.36e-5 gamma = 2.67522e8 start = 50 stop = 250 def diffusion(p,x): sig = N.exp(-p[0]*x)+p[1] return sig hdf = openFile(sys.argv[1]) temperature_runs = [run for run in hdf.root.data_pool if run._v_name.startswith(...
bsd-2-clause
-8,492,228,953,505,733,000
24.483516
88
0.626994
false
emrecimen/CIOL-ICF
ICF_Training_Test.py
1
8182
# This file is the implementation of the algorithm 1 and includes the main function # One can use this file if the training and test files are separated. # Inputs can be tuned in the corresponding area # The accuracy rates and all function parameters are printed to the console as output # Dataset can be in csv or arff...
mit
-6,865,739,474,599,376,000
26.641892
185
0.558788
false
jesseklein406/django-imager
imagersite/imager_images/migrations/0004_auto_20150728_1555.py
1
1063
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('imager_images', '0003_auto_20150726_1224'), ] operations = [ migrations.AlterField( model_name='album', ...
mit
-1,288,981,641,645,240,300
26.25641
63
0.543744
false