repo_name
stringlengths
6
90
path
stringlengths
4
230
copies
stringlengths
1
4
size
stringlengths
4
7
content
stringlengths
734
985k
license
stringclasses
15 values
hash
int64
-9,223,303,126,770,100,000
9,223,233,360B
line_mean
float64
3.79
99.6
line_max
int64
19
999
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
8.06
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
dfdx2/ancfinder
scripts/update_terms.py
1
1156
import csv history = csv.reader(open('data/historical-commissioners.csv', 'r'), delimiter=',', quoting=csv.QUOTE_MINIMAL) contestation = csv.reader(open('data/anc-candidates-2012.csv', 'r'), delimiter=',') h_output = csv.writer(open('data/anc-terms.csv', 'w'), delimiter=',', quotechar='/') c_output = csv.writer(open(...
cc0-1.0
-4,036,009,401,817,404,000
29.447368
110
0.628893
false
2.752381
false
false
false
zerothi/sisl
sisl/physics/__init__.py
1
2713
# 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 https://mozilla.org/MPL/2.0/. """ Physical objects ================ Implementations of various DFT and tight-binding related quantities are defined. ...
lgpl-3.0
5,101,146,321,850,576,000
23.223214
97
0.742352
false
3.762829
false
false
false
xbmc-danish-addons/plugin.video.dr.dk.bonanza
resources/lib/addon.py
1
10604
# # Copyright (C) 2014 Tommy Winther, termehansen # # https://github.com/xbmc-danish-addons/plugin.video.drnu# # # 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, or (a...
gpl-2.0
2,753,406,951,597,270,500
35.315068
110
0.55894
false
3.797994
false
false
false
okadate/romspy
romspy/make/boundary/bry_zeta_avg.py
1
2354
# coding: utf-8 # (c) 2015-11-19 Teruhisa Okada """ 沼島・海南の平均,および高砂・江井の平均値に変更 """ import numpy as np import pandas as pd def ramp(zeta): for i in xrange(744): zeta[i] = zeta[i] * i / 744.0 + 150.0 * (1.0 - i / 744.0) return zeta def bry_zeta_avg(dims, zetafile): print 'bry_zet...
mit
-2,942,075,617,038,173,700
26.825
65
0.525152
false
2.559378
false
false
false
ifiddes/pycbio
pycbio/bio/transcripts.py
1
43633
""" Convenience library for sequence information, including BED/genePred files and fasta files Needs the python library pyfasta installed. Original Author: Dent Earl Modified by Ian Fiddes """ import math import re from itertools import izip from pycbio.sys.fileOps import iterRows from pycbio.bio.bio import convert_st...
bsd-3-clause
-8,558,821,040,288,992,000
42.852261
122
0.597323
false
3.842624
false
false
false
pedgeon/chemu
examples/chemu-gui/emulator.py
2
16342
from PyQt4 import QtCore, QtGui import PyChemu from display import ChipDisplay, ChipDisplayWidget from worker import EmulatorWorker from ctypes import pointer, c_char_p from enum import Enum # displays the state of the chip keyboard class ChipInputWidget(QtGui.QWidget): class InputButton(QtGui.QFrame): ...
mit
3,528,653,262,385,433,600
34.837719
113
0.572145
false
3.362551
true
false
false
igorcoding/asynctnt
tests/test_op_call.py
1
7209
import asyncio from asynctnt import Response from asynctnt.exceptions import TarantoolDatabaseError, ErrorCode from tests.util import get_complex_param from tests import BaseTarantoolTestCase class CallTestCase(BaseTarantoolTestCase): def has_new_call(self): return self.conn.version >= (1, 7) async ...
apache-2.0
-3,151,755,826,119,182,000
35.593909
73
0.624497
false
3.69882
true
false
false
shendurelab/cfDNA
extractReadStartsFromBAM2Wig.py
1
7546
#!/usr/bin/env python """ :Author: Martin Kircher :Contact: mkircher@uw.edu :Date: *02.03.2015 """ import sys, os from optparse import OptionParser from collections import defaultdict import pysam import gzip from bx.intervals.intersection import Intersecter, Interval import random def isSoftClipped(cigar): #Op...
mit
4,275,324,883,964,812,300
41.632768
166
0.668434
false
3.223409
false
false
false
osroom/osroom
apps/modules/user/apis/role.py
1
1772
#!/usr/bin/env python # -*-coding:utf-8-*- # @Time : 2017/11/1 ~ 2019/9/1 # @Author : Allen Woo from flask import request from apps.core.flask.login_manager import osr_login_required from apps.configs.sys_config import METHOD_WARNING from apps.core.blueprint import api from apps.core.flask.permission import permission_...
bsd-2-clause
-8,276,662,831,743,971,000
24.3125
88
0.587654
false
2.797927
false
false
false
jennywoites/MUSSA
MUSSA_Flask/tests/TestAPIServicios/DAOMock/CarreraDAOMock.py
1
5219
from app import db from app.models.carreras_models import Carrera, Creditos, Orientacion ########################################################## ## Nombres de los parametros de los datos de prueba ## ########################################################## P_ID = "id" P_CODIGO = "codigo" P_NOMBRE = "nombre" ...
gpl-3.0
-2,234,629,480,080,327,000
33.078431
86
0.608362
false
2.515195
false
false
false
bengosney/romrescue.org
romrescue/settings.py
1
6804
"""Django settings for romrescue project. Generated by 'django-admin startproject' using Django 1.9.7. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ # Standard...
gpl-3.0
-2,235,892,692,539,647,000
27.830508
118
0.690182
false
3.319024
false
false
false
ateoto/django-words
words/models.py
1
1283
from django.db import models from django.conf import settings from django.template.defaultfilters import slugify from django.utils.encoding import python_2_unicode_compatible from django.core.urlresolvers import reverse from taggit.managers import TaggableManager @python_2_unicode_compatible class Entry(models.Model...
mit
9,188,547,956,438,191,000
31.075
76
0.674981
false
3.887879
false
false
false
BackupTheBerlios/cuon-svn
cuon_server/src/cuon/gridxml.py
3
3190
from xml.dom import minidom from xml.dom.minidom import parse, parseString class gridxml: def __init__(self): pass def createDoc(self, sDTD='super_special.dtd',sDTD2='super_special2.dtd', encoding = 'utf-8', sRoot='test' ): impl = minidom.getDOMImplementation() #dt = impl.cre...
gpl-3.0
2,031,611,230,665,887,200
31.886598
117
0.558934
false
4.164491
false
false
false
zrong/wpcmd
wpcmd/new.py
1
3111
######################################## # new.py # # Author zrong(zengrong.net) # Creation 2014-12-01 # Modification 2015-10-18 ######################################## import shutil import datetime from collections import OrderedDict from rookout import slog from rookout.base import (write_file) from wpcmd.base impo...
bsd-3-clause
4,931,354,208,580,483,000
29.80198
81
0.547412
false
3.475978
false
false
false
bit0001/chumme
controller/friend_info/friend_general_info.py
1
2505
import webbrowser from kivy.properties import StringProperty from kivy.uix.button import Button from controller.popup.getter import get_delete_friend_confirmation_popup from controller.util import get_image_from_blob from database_manager.util import ChumMeDBManager from .friend_carousel import FriendInfo class Fri...
apache-2.0
8,240,314,274,415,197,000
33.791667
85
0.664671
false
3.853846
false
false
false
sergecodd/FireFox-OS
B2G/gecko/testing/mozbase/mozdevice/mozdevice/devicemanagerADB.py
2
37007
# 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/. import subprocess from devicemanager import DeviceManager, DMError, _pop_last_line import re import os import tempfile i...
apache-2.0
9,120,475,668,459,107,000
38.243902
195
0.558003
false
4.295647
true
false
false
thehub/hubspace
hubspace/tests/populate.py
1
14474
import turbogears import hubspace.model from hubspace.model import * from datetime import datetime class Population (object): pass def populate (): objs = Population() # #Currencies # objs.eur = Currency(name='eur', # longname='continental Euro', # exchangerate=1) # ...
gpl-2.0
-3,644,771,020,631,622,000
35.366834
113
0.465732
false
4.017208
true
false
false
MarionPiEnsg/RaspiModel
Application/Raspberry_Pi/scripts_python/raspistillRetourVideo.py
1
1346
#! /usr/bin/python # -*- coding:utf-8 -*- import time import Image from os import popen #Initialisation de la varriable binaire "arret" arret = False time.sleep(5) # on attend 5 secondes avant de commencer le script i = 1 # boucle tant que la le fichier texte "arret.txt" n'est pas trouvé dans le dossier de travail de...
gpl-3.0
-1,637,407,357,329,996,500
36.138889
113
0.649215
false
2.881466
false
false
false
viur-framework/server
bones/dateBone.py
1
11098
# -*- coding: utf-8 -*- from server.bones import baseBone from server import request from time import time, mktime from datetime import time, datetime, timedelta import logging try: import pytz except: pytz = None ## Workaround for Python Bug #7980 - time.strptime not thread safe datetime.now().strptime("2010%02d%0...
lgpl-3.0
-1,110,284,442,458,873,200
38.494662
180
0.66967
false
3.240292
false
false
false
Boerworz/mejsel
preamble_commands.py
1
7907
#!/usr/bin/python import lldb import fblldbbase as fb import re def lldbcommands(): return [ PrintPreambleSelf(), PrintPreambleArgument(), PrintPreambleSelector() ] class PrintPreambleSelf(fb.FBCommand): def name(self): return "pself" def description(self): re...
mit
2,918,223,933,204,074,000
38.143564
212
0.622486
false
4.280996
false
false
false
iLoop2/ResInsight
ThirdParty/Ert/devel/python/python/ert/ecl/ecl_file.py
1
28755
# Copyright (C) 2011 Statoil ASA, Norway. # # The file 'ecl_file.py' is part of ERT - Ensemble based Reservoir Tool. # # ERT 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 ...
gpl-3.0
5,145,514,073,032,332,000
35.960154
144
0.587933
false
4.037489
false
false
false
NMGRL/pychron
pychron/options/views/views.py
1
3239
# =============================================================================== # Copyright 2015 Jake Ross # # 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...
apache-2.0
-1,110,515,296,182,996,000
42.186667
81
0.503859
false
5.133122
false
false
false
schleichdi2/OpenNfr_E2_Gui-6.0
lib/python/Screens/Ci.py
5
27345
from Screen import Screen from Screens.MessageBox import MessageBox from Components.ConfigList import ConfigListScreen from Components.ActionMap import ActionMap from Components.ActionMap import NumberActionMap from Components.Label import Label from Components.Pixmap import Pixmap from Components.Console import Consol...
gpl-2.0
5,037,448,555,613,915,000
31.360947
217
0.667691
false
2.994415
true
false
false
mvaled/sentry
src/sentry/south_migrations/0247_migrate_file_blobs.py
1
73506
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import DataMigration from django.db import IntegrityError, models, transaction class Migration(DataMigration): def forwards(self, orm): from sentry.utils.query import RangeQuerySetWrapper ...
bsd-3-clause
8,528,226,259,672,415,000
35.533797
94
0.393696
false
4.731638
false
false
false
vdrhtc/InLaTeXbot
src/InlineQueryResponseDispatcher.py
1
5981
from multiprocessing import Process, Lock, Event from threading import Thread import re from telegram import InlineQueryResultArticle, InputTextMessageContent, \ InlineQueryResultCachedPhoto, TelegramError, ParseMode from src.LoggingServer import LoggingServer class InlineQueryResponseDispatcher(): logger =...
gpl-3.0
2,853,568,264,281,831,000
45.726563
135
0.615449
false
4.476796
false
false
false
isandlaTech/cohorte-demos
led/dump/led-demo-raspberry/cohorte/dist/cohorte-1.0.0-20141216.234517-57-python-distribution/repo/cohorte/shell/composer_node.py
4
4511
#!/usr/bin/env python # -- Content-Encoding: UTF-8 -- """ Shell commands to control the node composer :author: Thomas Calmant :license: Apache Software License 2.0 :version: 3.0.0 .. Copyright 2014 isandlaTech Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file exce...
apache-2.0
2,256,494,283,194,895,000
28.677632
80
0.584571
false
4.142332
false
false
false
Opentrons/labware
robot-server/robot_server/service/protocol/manager.py
2
2723
import typing import logging from pathlib import Path from fastapi import UploadFile from robot_server.service.protocol.protocol import UploadedProtocol from robot_server.service.protocol import errors from robot_server.settings import get_settings log = logging.getLogger(__name__) class ProtocolManager: MAX_C...
apache-2.0
816,631,182,441,447,700
34.363636
79
0.600808
false
4.591906
false
false
false
weinbe58/QuSpin
quspin/basis/basis_general/base_general.py
1
38981
import numpy as _np import scipy.sparse as _sp import os,numexpr from ._basis_general_core.general_basis_utils import basis_int_to_python_int,_get_basis_index from ._basis_general_core import basis_zeros from ..lattice import lattice_basis import warnings class GeneralBasisWarning(Warning): pass def process_map(map,...
bsd-3-clause
8,966,298,602,396,134,000
31.702181
289
0.671532
false
2.970207
false
false
false
Kloudless/kloudless-python
tests/integration/management_api/test_application.py
1
1969
import unittest import os import base64 # Add parent dir to path to import utils import sys sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) from test_cases import utils import sdk class Application(unittest.TestCase): def setUp(self): name = base64.b64encode...
mit
5,744,464,219,058,150,000
31.278689
80
0.62062
false
3.694184
true
false
false
kayelsvk/rpsfw
main.py
1
2796
from matplotlib import pyplot from strategy import RandomStrategy, AscendingStrategy, CopyingStrategy, ConstantStrategy from simulation import Simulation # Top-level code, handling creation of Strategy objects, # carrying out the simulation and creating & saving statistics. # Creates stats of strategies' probability o...
gpl-3.0
5,376,625,029,620,358,000
39.521739
142
0.71495
false
3.127517
false
false
false
nysan/yocto-autobuilder
lib/python2.6/site-packages/buildbot-0.8.4p1-py2.6.egg/buildbot/test/unit/test_status_buildstep.py
4
2469
# 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,865,947,172,953,276,000
38.190476
80
0.673147
false
3.769466
true
false
false
annikaliebgott/ImFEATbox
features_python/ImFEATbox/GlobalFeatures/Transformation/GaborFilterF.py
1
4314
import numpy as np def GaborFilterF(I,typeflag,gradtype,scale,orientation,plotflag): """ Input: - I: A 2D image - typeflag: Struct of logicals to permit extracting features based on desired characteristics: + typeflag.global: all features ...
apache-2.0
3,261,640,521,712,935,000
46.933333
98
0.595735
false
4.28827
false
false
false
anhdiepmmk/yowsup
yowsup/layers/protocol_iq/layer.py
43
3799
import time import logging from threading import Thread, Lock from yowsup.layers import YowProtocolLayer, YowLayerEvent from yowsup.common import YowConstants from yowsup.layers.network import YowNetworkLayer from yowsup.layers.auth import YowAuthenticationProtocolLayer from .protocolentities import * class YowIqProt...
gpl-3.0
-2,621,622,519,248,776,000
37.373737
122
0.604896
false
3.944964
false
false
false
althonos/fs.archive
fs/archive/isofs/__init__.py
1
10326
# coding: utf-8 """ISO Disk Image filesystems. """ from __future__ import absolute_import from __future__ import unicode_literals import io import os import re import operator import weakref import six import pycdlib from ... import errors from ...mode import Mode from ...info import Info from ...path import recurse...
mit
5,162,336,040,017,291,000
31.780952
99
0.536994
false
3.929224
false
false
false
cscott/wikiserver
mwlib/treecleanerhelper.py
2
3039
#! /usr/bin/env python #! -*- coding:utf-8 -*- # Copyright (c) 2007, PediaPress GmbH # See README.txt for additional licensing information. import math from advtree import Cell, ImageLink, Link, Math, NamedURL, Reference, Text, URL def getNodeHeight(node, params): lineHeight = params['lineHeight'] charsPerL...
gpl-2.0
-397,025,027,698,806,800
34.752941
145
0.574531
false
4.168724
false
false
false
davy39/eric
Plugins/VcsPlugins/vcsSubversion/SvnLogBrowserDialog.py
1
24694
# -*- coding: utf-8 -*- # Copyright (c) 2007 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> # """ Module implementing a dialog to browse the log history. """ from __future__ import unicode_literals try: str = unicode except NameError: pass import os from PyQt5.QtCore import QTimer, QDate, QProcess, QRe...
gpl-3.0
837,212,953,922,139,600
33.927864
79
0.548716
false
4.344476
false
false
false
rubyAce71697/locallibrary
catalog/models.py
1
4558
from __future__ import unicode_literals from django.urls import reverse from django.db import models import uuid from datetime import date from django.contrib.auth.models import User # Create your models here. class Genere(models.Model): name = models.CharField(max_length=200, help_text="Enter a book genere") ...
gpl-3.0
4,136,155,146,687,032,300
32.028986
153
0.640412
false
3.606013
false
false
false
davidr/tensorflow-playground
projects/tfrecords/record_writer.py
1
3142
#!/usr/bin/env python2.7 import numpy as np import sklearn.datasets as datasets import tensorflow as tf import argparse def _float64_feature(feature): return tf.train.Feature(float_list=tf.train.FloatList(value=[feature])) def _feature_dict_from_row(row): """Take row of length n+1 from 2-D ndarray and conver...
mit
-7,203,874,554,380,905,000
40.893333
97
0.54965
false
4.043758
false
false
false
Stratoscale/osmosis
tests/fakeservers.py
1
6999
import os import io import ctypes import struct import socket import logging import binascii import threading DOES_EXIST_RESPONSE_YES = 1 DOES_EXIST_RESPONSE_NO = 2 OPCODE_GET = 1 OPCODE_DOES_EXIST = 3 OPCODE_GET_LABEL = 12 OPCODE_LIST_LABELS = 13 OPCODE_ACK = 0xAC HASH_ALGORITHM_SHA1 = 2 class FakeServer(threading...
apache-2.0
-4,097,749,199,220,613,000
28.407563
96
0.59037
false
3.828775
false
false
false
qedsoftware/commcare-hq
corehq/apps/sms/migration_status.py
1
3759
from corehq.apps.sms.models import MigrationStatus from django.conf import settings from django.template import Context, Template import os EXCEPTION_MESSAGE = Template(""" *** Halting migrate command because one or more messaging postgres migrations have not yet completed. In order to continue, switch into your co...
bsd-3-clause
-57,864,814,985,166,490
35.144231
108
0.680766
false
4.291096
false
false
false
yeyanchao/calibre
src/calibre/ebooks/djvu/djvu.py
5
5361
#! /usr/bin/env python # coding: utf-8 from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2011, Anthon van der Neut <A.van.der.Neut@ruamel.eu>' # this code is based on: # Lizardtech DjVu Reference # DjVu v3 # November ...
gpl-3.0
-4,424,252,041,228,794,400
35.719178
98
0.519679
false
3.564495
false
false
false
subodhchhabra/airflow
airflow/utils/asciiart.py
9
2545
# -*- coding: utf-8 -*- # # 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 #...
apache-2.0
6,170,971,361,618,402,000
41.416667
79
0.259725
false
3.370861
false
false
false
ASMlover/study
compiler/eLisp2/eLisp/reader.py
1
4350
#!/usr/bin/env python # -*- encoding: utf-8 -*- # # Copyright (c) 2015 ASMlover. 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 copyrig...
bsd-2-clause
7,335,636,641,109,926,000
30.521739
79
0.576552
false
4.470709
false
false
false
martndj/DaleyMenard1993
DM93/DM93Lib.py
1
8784
#-------------------------- LICENCE BEGIN --------------------------- # This file is part of DaleyMenard93. # # DaleyMenard93 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...
gpl-3.0
9,188,258,236,325,311,000
34.707317
75
0.579804
false
3.637267
false
false
false
Connor-R/NSBL
ad_hoc/NSBL_old_rosters.py
1
8656
import xlrd from py_db import db import argparse import NSBL_helpers as helper import datetime db = db('NSBL') def process(): for szn, deets in {2008: [5, 'xls', 0, 1] , 2009: [5, 'xls', 0, 1] , 2010: [4, 'xls', 0, 1] , 2011: [4, 'xls', 0, 1] , 2012: [4, 'xls', 0, 1] , 20...
mit
-8,501,690,876,106,844,000
39.830189
320
0.519871
false
3.149927
false
false
false
pbrod/scipy
scipy/io/netcdf.py
15
37687
""" NetCDF reader/writer module. This module is used to read and create NetCDF files. NetCDF files are accessed through the `netcdf_file` object. Data written to and from NetCDF files are contained in `netcdf_variable` objects. Attributes are given as member variables of the `netcdf_file` and `netcdf_variable` objects...
bsd-3-clause
3,944,973,118,587,882,000
34.926597
103
0.571125
false
4.16155
false
false
false
shivamT95/rollcall
rollcall/gui/rollcallGUIClass.py
3
1182
#!/usr/bin/env python2 """ Contains the main GUI Class """ import os import gtk def find_file(dire, fName): """ Generates the complete path of a file returns the complete path """ path = os.path.join(os.path.dirname(dire), fName) return path def load_interface(dire, fName): """ Loa...
mit
-6,320,145,038,126,952,000
17.184615
74
0.563452
false
3.812903
false
false
false
dpazel/music_rep
melody/constraints/pitch_step_constraint.py
1
5324
""" File: pitch_step_constraint.py Purpose: Constraint that compute a second pitch from the first based on a number of diatonic steps. """ from melody.constraints.abstract_constraint import AbstractConstraint from tonalmodel.pitch_scale import PitchScale from structure.note import Note class PitchStepConstraint(Ab...
mit
5,634,867,613,389,272,000
37.861314
113
0.632983
false
3.819225
false
false
false
kidscancode/gamedev
tutorials/examples/steering/part03.py
1
3071
# Steering Behavior Examples # Flee # KidsCanCode 2016 import pygame as pg from random import randint, uniform vec = pg.math.Vector2 WIDTH = 800 HEIGHT = 600 FPS = 60 WHITE = (255, 255, 255) BLACK = (0, 0, 0) RED = (255, 0, 0) GREEN = (0, 255, 0) BLUE = (0, 0, 255) YELLOW = (255, 255, 0) DARKGRAY = (40, 40, 40) # Mob...
mit
-640,475,544,105,434,500
27.435185
81
0.558776
false
3.185685
false
false
false
jumpstarter-io/horizon
openstack_dashboard/dashboards/project/instances/tables.py
1
31477
# Copyright 2012 Nebula, 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 agree...
apache-2.0
7,819,112,349,158,489,000
35.347575
79
0.593894
false
4.066796
false
false
false
cordoval/myhdl-python
myhdl/_Cosimulation.py
2
6242
# This file is part of the myhdl library, a Python package for using # Python as a Hardware Description Language. # # Copyright (C) 2003-2008 Jan Decaluwe # # The myhdl 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 t...
lgpl-2.1
6,397,450,821,585,618,000
35.080925
80
0.508971
false
4.027097
false
false
false
jmuhlich/bayessb
examples/robertson/run.py
1
3943
import bayessb from pysb.examples.robertson import model from pysb.integrate import odesolve import numpy import matplotlib.pyplot as plt import sys scenario = 2 if len(sys.argv) > 1: scenario = int(sys.argv[1]) seed = 2 random = numpy.random.RandomState(seed) sigma = 0.1; ntimes = 20; tspan = numpy.linspace(0, 4...
bsd-2-clause
-7,116,626,439,698,953,000
30.544
109
0.610703
false
2.851048
false
false
false
anurag03/integration_tests
cfme/cloud/host_aggregates.py
1
1678
import attr from navmazing import NavigateToAttribute from widgetastic.widget import Text, View from widgetastic_patternfly import Dropdown from widgetastic_manageiq import Search, ItemsToolBarViewSelector from cfme.base.login import BaseLoggedInPage from cfme.modeling.base import BaseCollection, BaseEntity from cfme...
gpl-2.0
5,908,498,851,036,282,000
27.931034
95
0.738379
false
3.902326
false
false
false
vamin/MESS.DB
mess/db.py
1
5924
# -*- coding: utf-8 -*- """MESS.DB database module This module contains the MessDB class, which MESS.DB uses to connect to and interact with the 'mess.db' sqlite3 database in the 'db' directory. """ from __future__ import print_function from __future__ import unicode_literals import codecs import os import sqlite3 im...
agpl-3.0
-3,923,614,589,341,641,700
35.567901
79
0.559757
false
4.444111
false
false
false
xuender/locales
message/models.py
1
1957
# -*- coding: utf-8 -*- from django.db import models class App(models.Model): '应用' code = models.CharField( unique=True, max_length=10, help_text='最大10个字母', verbose_name='代码', ) name = models.CharField( max_length=30, help_...
mit
-380,395,726,938,162,300
25.217391
47
0.472084
false
3.432638
false
false
false
tellapart/commandr
setup.py
1
1037
# Copyright 2013 TellApart, 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 agreed to in writi...
apache-2.0
4,288,175,042,686,401,500
33.566667
83
0.67406
false
4.131474
false
false
false
SergKitler/python_training
test/test_del_user_from_group.py
1
1267
__author__ = 'sergei' from model.group import Group from model.user import User import random def test_del_user_from_group(app, orm): if len(orm.get_contact_list()) == 0: app.user.add(User(firstname="Jeck", lastname="Antonio")) if len(orm.get_group_list()) == 0: app.group.create(Group(name="T...
apache-2.0
936,905,218,582,549,600
39.870968
99
0.640095
false
2.853604
false
false
false
axeltidemann/self_dot
sai.py
1
7993
# Copyright 2013 The CARFAC Authors. All Rights Reserved. # # This file is part of an implementation of Lyon's cochlear model: # "Cascade of Asymmetric Resonators with Fast-Acting Compression" # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the L...
gpl-3.0
8,164,005,368,862,843,000
38.766169
80
0.66846
false
3.962816
false
false
false
evangelistalab/forte
tests/pytest/symmetry/test_symmetry.py
1
1097
import pytest from forte import Symmetry def test_symmetry(): """Test the Symmetry class""" sym = Symmetry('D2H') assert sym.point_group_label() == 'D2H' assert sym.irrep_labels() == ['Ag', 'B1g', 'B2g', 'B3g', 'Au', 'B1u', 'B2u', 'B3u'] # test in and out of bounds assert sym.irrep_label(4)...
lgpl-3.0
-1,242,962,602,108,612,900
24.511628
87
0.605287
false
3.17971
true
false
false
indie-dev/Clarissa
bot.py
1
2985
import os import sys as sys os.system("python bot/bot.py engage") import bot_response as bot import bot_learn as learner def hasUserSwore(message): if "fuck" in message: return True elif "bitch" in message: return True elif "Fuck" in message: re...
apache-2.0
-5,650,025,393,488,146,000
30.09375
103
0.528643
false
3.964143
false
false
false
popazerty/test
lib/python/Components/opkg.py
5
1544
import os def enumFeeds(): for fn in os.listdir('/etc/opkg'): if fn.endswith('-feed.conf'): try: for feed in open(os.path.join('/etc/opkg', fn)): yield feed.split()[1] except IndexError: pass except IOError: pass def enumPlugins(filter_start=''): for feed in enumFeeds(): package = None...
gpl-2.0
-822,071,615,905,738,600
29.88
244
0.617228
false
3.371179
false
false
false
EspecNorthAmerica/ChamberConnectLibrary
bin/example.py
1
2037
''' examples of using the chamberconnectlibrary ''' import pprint import time from chamberconnectlibrary.watlowf4t import WatlowF4T from chamberconnectlibrary.watlowf4 import WatlowF4 from chamberconnectlibrary.espec import Espec LOOP_NAMES = ['Temperature', 'Humidity'] CONTROLLER = Espec( interface='Serial', ...
mit
-6,387,453,440,399,877,000
28.1
140
0.64703
false
2.794239
false
false
false
petteyg/intellij-community
python/testData/inspections/PyNumpyType/Empty.py
69
1456
def empty(shape, dtype=None, order='C'): # real signature unknown; restored from __doc__ """ empty(shape, dtype=float, order='C') Return a new array of given shape and type, without initializing entries. Parameters ---------- shape : int or tuple of int Shape of the...
apache-2.0
4,702,268,851,468,564,000
30.673913
88
0.529533
false
4.195965
false
false
false
our-city-app/oca-backend
src/solutions/common/integrations/jcc/jcc_appointments.py
1
15996
# -*- coding: utf-8 -*- # Copyright 2020 Green Valley Belgium 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 appl...
apache-2.0
-5,333,254,731,862,101,000
41.884718
121
0.684921
false
3.679779
false
false
false
ioos/pyoos
pyoos/parsers/ioos/one/timeseries.py
1
8721
from __future__ import absolute_import, division, print_function from copy import copy from dateutil import parser from owslib.crs import Crs from owslib.namespaces import Namespaces from owslib.swe.common import ( AbstractSimpleComponent, DataChoice, DataRecord, Time, ) from owslib.util import nspath...
lgpl-3.0
5,314,796,909,807,706,000
33.884
114
0.485265
false
4.693757
false
false
false
UCSUR-Pitt/wprdc-etl
pipeline/loaders.py
1
9225
import requests import json import datetime from pipeline.exceptions import CKANException class Loader(object): def __init__(self, *args, **kwargs): pass def load(self, data): '''Main load method for Loaders to implement Raises: NotImplementedError ''' rai...
mit
7,227,534,650,702,039,000
32.0681
112
0.552195
false
4.535398
false
false
false
supriyasingh01/github_basics
Internetworking Distributed Project/Lab 9/The_Avengers_lab9/of_tutorial.py
1
5253
# Copyright 2012 James McCauley # # This file is part of POX. # # POX 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. # # POX ...
cc0-1.0
-5,049,225,767,119,341,000
31.246835
86
0.648582
false
3.573469
false
false
false
PaddlePaddle/models
PaddleCV/face_detection/utility.py
1
2449
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve. # #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
8,088,783,831,452,054,000
33.027778
119
0.611678
false
4.136824
false
false
false
diegocrzt/pmspy
pms/modelo/proyectoControlador.py
1
5046
''' Created on 14/04/2013 @author: mpoletti @author: synchro, Natalia Valdez @author: mpoletti ''' from entidad import Proyecto, Usuario from initdb import db_session, init_db, shutdown_session import faseControlador import miembroControlador from sqlalchemy import or_ from pms.modelo import controllerHelper from date...
lgpl-2.1
2,013,451,544,482,984,000
26.281081
194
0.621086
false
2.964747
false
false
false
ioam/lancet
lancet/filetypes.py
2
12615
import os, tempfile, json, pickle import param from lancet.core import PrettyPrinted try: import numpy except: pass try: import Image except: pass class FileType(PrettyPrinted, param.Parameterized): """ The base class for all supported file types in Lancet. This class is designed to be simple and e...
bsd-3-clause
-7,310,083,349,679,187,000
33.848066
89
0.610543
false
4.123897
false
false
false
bestK1ngArthur/IU5
Term 5/Development of Internet applications/Lab4/ex_6.py
1
1707
#!/usr/bin/env python3 import json import sys from librip.ctxmngrs import timer from librip.decorators import print_result from librip.gens import field, gen_random from librip.iterators import Unique # encoding=utf8 path = "/Users/bestK1ng/Code/Web/IU5/5 семестр/Разработка интернет-приложений/Lab4/data_light.json" ...
mit
772,640,194,536,378,400
21.564516
99
0.699786
false
2.072593
false
false
false
tima/ansible
lib/ansible/modules/cloud/profitbricks/profitbricks_nic.py
27
8530
#!/usr/bin/python # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
-9,221,773,324,404,116,000
28.212329
123
0.605979
false
4.067716
false
false
false
stevenengler/dicomtools
dicomtools/series.py
1
2448
import numpy as np import dicom import os import warnings # class DicomSeries(object): r''' A class for storing and processing DICOM series. Instances are verified to all have consistent ``SeriesInstanceUID`` attributes. ''' # def __init__(self, dicom_list): r''' ''' # if len(dicom_list) == 0: raise...
mit
-6,521,843,408,633,531,000
29.6
108
0.701797
false
3.183355
false
false
false
cstan11/Sick-Beard
lib/subliminal/converters/addic7ed.py
32
1771
# -*- coding: utf-8 -*- from __future__ import unicode_literals from babelfish import LanguageReverseConverter, language_converters class Addic7edConverter(LanguageReverseConverter): def __init__(self): self.name_converter = language_converters['name'] self.from_addic7ed = {'Català': ('cat',), 'Ch...
gpl-3.0
4,373,436,243,471,483,400
56.064516
118
0.554551
false
3.312734
false
false
false
rr-/szurubooru
server/szurubooru/migrations/versions/5f00af3004a4_add_default_tag_category.py
1
1655
""" Add default tag category Revision ID: 5f00af3004a4 Created at: 2017-02-02 20:06:13.336380 """ import sqlalchemy as sa import sqlalchemy.ext.declarative import sqlalchemy.orm.session from alembic import op revision = "5f00af3004a4" down_revision = "9837fc981ec7" branch_labels = None depends_on = None Base = sa....
gpl-3.0
7,602,688,805,182,867,000
25.693548
67
0.650755
false
3.462343
false
false
false
Alignak-monitoring/alignak
tests/test_eventhandler.py
1
21515
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2015-2018: Alignak team, see AUTHORS.txt file for contributors # # This file is part of Alignak. # # Alignak 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 So...
agpl-3.0
-142,045,582,515,690,270
39.980952
114
0.602138
false
3.361719
true
false
false
davidecaminati/Domotics-Raspberry
Hardware/Socket_to_MCP27013_con_i2c/utility/i2c_inputs_address_24.py
1
1049
import smbus import time #bus = smbus.SMBus(0) # Rev 1 Pi uses 0 bus = smbus.SMBus(1) # Rev 2 Pi uses 1 DEVICE = 0x24 # Device address (A0-A2) IODIRA = 0x00 # Pin direction register IODIRB = 0x01 # Pin direction register OLATA = 0x14 # Register for outputs OLATB = 0x15 # Register for outputs GPIOA = 0x12 # Regist...
lgpl-3.0
2,571,518,470,000,461,000
24.585366
45
0.691134
false
2.689744
false
false
false
GO-HACKATHON/QuantumSigmoid
How_to_build_model/engine.py
1
4039
import os import tensorflow as tf import tensorflow.python.platform from tensorflow.python.platform import gfile import numpy as np import glob classes = np.array(['ayam_bakar', 'ayam_crispy', 'bakso', 'gado2', 'ikan_bakar', 'mie_goreng', 'nasi_goreng', 'pecel_lele', 'pizza', 'rendang', 'sate', 'soto', 'sushi']) num_c...
mit
-3,376,876,240,282,327,600
34.429825
169
0.600396
false
3.568021
false
false
false
twitter/pants
tests/python/pants_test/backend/jvm/tasks/jvm_compile/java/test_java_compile_integration.py
1
10123
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, division, print_function, unicode_literals import os from builtins import open from pants.fs.archive import archiver_for_path from ...
apache-2.0
1,101,959,902,600,183,400
40.830579
122
0.655043
false
3.670413
true
false
false
zcbenz/cefode-chromium
chrome/test/functional/nacl_sdk.py
66
28639
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import copy import ctypes from distutils import version import fnmatch import glob import hashlib import logging import os import p...
bsd-3-clause
6,624,516,580,850,885,000
34.978643
79
0.642795
false
3.801805
true
false
false
marclaporte/syncthing-gui
syncthing_gtk/statusicon.py
1
2128
#!/usr/bin/env python2 """ Syncthing-GTK - StatusIcon """ from __future__ import unicode_literals from gi.repository import Gtk, GObject import os, sys # Why the hell does ubuntu use own notifications system? THE_HELL, HAS_INDICATOR = False, False if "XDG_CURRENT_DESKTOP" in os.environ and os.environ["XDG_CURRENT_DE...
gpl-2.0
-5,827,814,525,857,383,000
25.936709
88
0.666823
false
2.875676
false
false
false
daniaki/Enrich2
enrich2/libraries/barcodemap.py
1
4884
# Copyright 2016-2017 Alan F Rubin, Daniel C Esposito # # This file is part of Enrich2. # # Enrich2 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) ...
gpl-3.0
3,617,410,839,876,631,600
35.177778
79
0.572891
false
4.484848
false
false
false
tensorflow/federated
tensorflow_federated/python/simulation/datasets/emnist_test.py
1
2396
# Copyright 2019, The TensorFlow Federated Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
apache-2.0
8,514,975,181,261,454,000
35.861538
79
0.713272
false
3.554896
true
false
false
sallai/mbuild
mbuild/tests/test_coordinate_transform.py
1
4808
import numpy as np import pytest from mbuild.coordinate_transform import (Translation, CoordinateTransform, RotationAroundZ, RotationAroundY, RotationAroundX, Rotation, ChangeOfBasis, AxisTransfor...
mit
700,634,682,133,602,000
41.928571
116
0.569884
false
3.169413
true
false
false
wolsen/cmadison
setup.py
1
1351
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from setuptools import setup, find_packages from subprocess import check_output def get_dependencies(): """Reads the dependencies from the requirements file.""" with open('requirements.txt', 'r') as d: dependencies = d.read() return dependencies d...
lgpl-3.0
4,954,740,418,162,887,000
26.571429
74
0.627683
false
3.816384
false
false
false
google-research/albert
create_pretraining_data.py
1
23242
# coding=utf-8 # Copyright 2018 The Google AI Team Authors. # # 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 applicabl...
apache-2.0
-4,492,252,992,085,639,000
34.422256
80
0.644145
false
3.569432
false
false
false
SAS-GreenLeaf/Domoleaf
domoslave/usr/lib/domoleaf/UpnpAudio.py
2
5823
## @package domolib # Library for domomaster and domoslave. # # Developed by GreenLeaf. import re; from Upnp import *; UPNP_IP_ADDR = '192.168.1.69'; UPNP_PORT = 1400; ## Class inherited by 'Upnp' to communicate with audio devices running Upnp. class UpnpAudio(Upnp): ## The constructor. # # @param ip_ad...
gpl-3.0
2,530,893,338,142,276,000
36.811688
113
0.602782
false
3.612283
false
false
false
KDE/kcmgrub2
pbkdf2.py
1
1794
#!/usr/bin/env python # -*- coding: utf-8 -*- # Python pbkdf2 generator # # Copyright 2011 Alberto Mattea <alberto@mattea.info> # # 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 ...
gpl-3.0
-3,399,768,702,636,468,000
31.618182
81
0.662765
false
3.384906
false
false
false
glennmatthews/cot
COT/disks/iso.py
1
5574
# October 2016, Glenn F. Matthews # Copyright (c) 2013-2016, 2019 the COT project developers. # See the COPYRIGHT.txt file at the top-level directory of this distribution # and at https://github.com/glennmatthews/cot/blob/master/COPYRIGHT.txt. # # This file is part of the Common OVF Tool (COT) project. # It is subject ...
mit
1,918,910,389,805,524,700
35.431373
79
0.564227
false
4.24524
false
false
false
SmartInfrastructures/fuel-web-dev
nailgun/nailgun/api/v1/handlers/orchestrator.py
1
12504
# -*- coding: utf-8 -*- # Copyright 2013 Mirantis, 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 requi...
apache-2.0
5,071,680,808,363,774,000
33.351648
79
0.652991
false
4.168
false
false
false
waylonwang/biz-server
api_control.py
1
2175
from functools import wraps from flask import request from flask_restful import Api from werkzeug.exceptions import HTTPException _api = None def init(app): global _api _api = Api(app) return _api def set_api(api): global _api _api = api def get_api(): global _api return _api def g...
gpl-3.0
-3,571,299,497,838,356,000
19.019231
73
0.559827
false
3.638112
false
false
false
commaai/openpilot
selfdrive/car/fingerprints.py
1
2305
import os from common.basedir import BASEDIR def get_attr_from_cars(attr, result=dict, combine_brands=True): # read all the folders in selfdrive/car and return a dict where: # - keys are all the car models # - values are attr values from all car folders result = result() for car_folder in [x[0] for x in os...
mit
-6,201,795,289,806,880,000
27.8125
90
0.653362
false
3.535276
false
false
false
technoboy10/WatchCraft
pebble.py
1
1814
""" This file contains the backend code for the Pebble-WebSockets interface to Minecraft. It should be run in parallel with leapmotion.py. """ import tornado.httpserver import tornado.websocket import tornado.ioloop import tornado.web import socket from pymouse import PyMouse from pykeyboard import PyKeyboard k = PyKe...
mit
-5,683,369,151,498,976,000
28.737705
134
0.614664
false
4.058166
false
false
false
picklepete/pyicloud
pyicloud/base.py
1
21706
"""Library base file.""" from six import PY2, string_types from uuid import uuid1 import inspect import json import logging from requests import Session from tempfile import gettempdir from os import path, mkdir from re import match import http.cookiejar as cookielib import getpass from pyicloud.exceptions import ( ...
mit
6,555,492,455,500,857,000
34.818482
106
0.58265
false
4.187114
false
false
false
sgenoud/scikit-learn
sklearn/feature_selection/rfe.py
1
12391
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Vincent Michel <vincent.michel@inria.fr> # Gilles Louppe <g.louppe@gmail.com> # # License: BSD Style. """Recursive feature elimination for feature ranking""" import numpy as np from ..base import BaseEstimator from ..base import MetaEstim...
bsd-3-clause
9,083,485,903,887,772,000
34.201705
79
0.591881
false
4.155265
true
false
false
RedHatInsights/insights-core
insights/parsers/tests/test_vgs.py
1
4743
from insights.parsers.lvm import Vgs, VgsHeadings from insights.tests import context_wrap FD_LEAK_HEADER = "File descriptor 5 (/dev/null) leaked on invocation. Parent PID 99999: timeout\n" VGS_INFO = """ LVM2_VG_FMT='lvm2'|LVM2_VG_UUID='YCpusB-LEly-THGL-YXhC-t3q6-mUQV-wyFZrx'|LVM2_VG_NAME='rhel'|LVM2_VG_ATTR='wz--n-'...
apache-2.0
-1,927,668,868,255,985,000
46.43
748
0.587814
false
2.248933
false
false
false
fras2560/graph-helper
algorithms/__init__.py
1
2857
""" ------------------------------------------------------- algorithms a package to hold common algorithms used to find interesting facts about a graph and its coloring ------------------------------------------------------- Author: Dallas Fraser ID: 110242560 Email: fras2560@mylaurier.ca Version: 2014-09-17 --...
apache-2.0
-231,174,372,299,218,780
27.868687
68
0.584879
false
4.007013
false
false
false
cgwire/zou
zou/migrations/versions/a65bdadbae2f_.py
1
1966
"""empty message Revision ID: a65bdadbae2f Revises: e1ef93f40d3d Create Date: 2019-01-15 12:19:59.813805 """ from alembic import op import sqlalchemy as sa import sqlalchemy_utils from sqlalchemy.dialects import postgresql import sqlalchemy_utils import uuid # revision identifiers, used by Alembic. revision = 'a65bd...
agpl-3.0
-2,266,426,835,595,489,000
40.829787
117
0.712106
false
3.401384
false
false
false
stuartsale/pyBHC
pyBHC/rbhc.py
1
22382
from __future__ import print_function, division import math import numpy as np from bhc import bhc class rbhc(object): """ An instance of Randomized Bayesian hierarchical clustering CRP mixture model. Attributes ---------- Notes ----- The cost of rBHC scales as O(nlogn) and so should...
bsd-3-clause
3,763,676,100,495,110,700
38.335677
78
0.48405
false
4.286097
false
false
false
StephenChusang/py-faster-rcnn-tracker
lib/rpn/proposal_layer.py
6
6803
# -------------------------------------------------------- # Faster R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick and Sean Bell # -------------------------------------------------------- import caffe import numpy as np import yaml from fast_r...
mit
3,227,345,890,393,008,600
37.653409
80
0.573423
false
3.573004
false
false
false