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
epiqc/ScaffCC
scripts/simulation/assert_product.py
1
1892
#!/usr/bin/env python import sys, csv, warnings import numpy as np warnings.filterwarnings("ignore", message="numpy.dtype size changed") from scipy import stats # find the possible values of each register reg_vals = {} with open(sys.argv[1]) as csvfile: reader = csv.DictReader(csvfile) # establish the registe...
bsd-2-clause
7,009,961,849,868,818,000
26.823529
90
0.604651
false
3.279029
false
false
false
anki1909/peach
tutorial/optimization/linear-optimization.py
6
3054
################################################################################ # Peach - Computational Intelligence for Python # Jose Alexandre Nalon # # This file: linear-optmization.py # Simple optimization of one-variable functions ################################################################################ ...
lgpl-2.1
-4,212,129,536,454,146,000
28.085714
80
0.593975
false
3.044865
false
false
false
plotly/python-api
packages/python/plotly/plotly/validators/indicator/_delta.py
1
1527
import _plotly_utils.basevalidators class DeltaValidator(_plotly_utils.basevalidators.CompoundValidator): def __init__(self, plotly_name="delta", parent_name="indicator", **kwargs): super(DeltaValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
mit
-6,465,689,009,803,183,000
37.175
79
0.53831
false
5.039604
false
false
false
John443/Recommending-System
src/classify.py
1
3087
import numpy as np np.seterr(divide='ignore', invalid='ignore') def loadFile(filename): dataMat = [] fr = open(filename) for line in fr.readlines(): cur = line.strip().split('|') # res = cur[5:] res = cur[0:25] dataMat.append(res) return dataMat def distEclud(vecA, ve...
gpl-3.0
8,830,165,180,903,482,000
30.181818
115
0.529316
false
3.418605
false
false
false
redhat-openstack/neutron
neutron/plugins/mlnx/rpc_callbacks.py
8
4422
# Copyright 2013 Mellanox Technologies, Ltd # # 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 t...
apache-2.0
4,100,099,539,052,861,000
40.716981
78
0.575758
false
4.056881
false
false
false
trislett/TFCE_mediation
tfce_mediation/tools/tm_convert_surface.py
1
12359
#!/usr/bin/env python # convert-surface # Copyright (C) 2017 Tristram Lett # 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 opt...
gpl-3.0
4,057,700,760,930,264,600
51.147679
437
0.698034
false
2.925207
false
false
false
liampauling/flumine
tests/test_flumine.py
1
3889
import unittest from unittest import mock from flumine import Flumine, worker from flumine.events import events class FlumineTest(unittest.TestCase): def setUp(self): self.mock_trading = mock.Mock() self.flumine = Flumine(self.mock_trading) @mock.patch("flumine.flumine.Flumine._add_default_w...
mit
-1,266,402,373,416,248,600
38.683673
82
0.609668
false
3.56789
true
false
false
alfasin/st2
st2common/st2common/util/shell.py
3
3598
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
apache-2.0
-349,410,962,854,644,100
27.330709
99
0.672874
false
4.029115
false
false
false
superzazu/pylibui
pylibui/libui/entry.py
2
2671
""" Python wrapper for libui. """ import ctypes from . import clibui class uiEntry(ctypes.Structure): """Wrapper for the uiEntry C struct.""" pass def uiEntryPointer(obj): """ Casts an object to uiEntry pointer type. :param obj: a generic object :return: uiEntry """ return ctyp...
mit
-6,822,346,466,715,248,000
18.355072
85
0.657432
false
3.450904
false
false
false
tensorflow/lingvo
lingvo/core/routing_config_helper.py
1
6544
# Lint as: python3 # Copyright 2021 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 ...
apache-2.0
-2,983,489,481,028,742,000
42.919463
79
0.662592
false
3.992678
false
false
false
procangroup/edx-platform
openedx/core/djangoapps/content/course_structures/api/v0/serializers.py
96
2563
""" API Serializers """ from collections import defaultdict from rest_framework import serializers class GradingPolicySerializer(serializers.Serializer): """ Serializer for course grading policy. """ assignment_type = serializers.CharField(source='type') count = serializers.IntegerField(source='min_count...
agpl-3.0
-5,760,628,658,466,420,000
32.723684
84
0.667967
false
4.826742
false
false
false
henfredemars/python-personal-projects
PyHash/PyHash.py
1
1694
#!/usr/bin/python3 #Program to watch the contents of a directory for changes import hashlib import pickle import os rootPath = """C:\Program Files\WatchDirectory""" def hash_file(fname): fd = open(fname,'rb') md5 = hashlib.md5() while True: d = f.read(65536) if not d: break md5.upd...
mit
-213,189,725,425,553,760
22.911765
83
0.618064
false
3.492784
false
false
false
JamesMura/elections
apollo/participants/api.py
1
1565
from flask import current_app from flask.ext.restful import Resource, fields, marshal, marshal_with from flask.ext.security import login_required from mongoengine import Q from .. import services from ..api.common import parser PARTICIPANT_FIELD_MAPPER = { 'id': fields.String, 'name': fields.String, 'parti...
gpl-3.0
7,136,389,597,476,302,000
26.45614
69
0.605112
false
3.9125
false
false
false
SaintGimp/BeagleBoneHardware
gimpbbio/setup.py
1
1170
import distribute_setup distribute_setup.use_setuptools() from setuptools import setup, Extension, find_packages classifiers = ['Development Status :: 3 - Alpha', 'Operating System :: POSIX :: Linux', 'License :: OSI Approved :: MIT License', 'Intended Audience :: Developer...
mit
7,107,354,044,948,368,000
44
77
0.54359
false
4.163701
false
false
false
jeromecc/doctoctocbot
src/crowdfunding/admin.py
1
2884
from .models import ( Project, Campaign, ProjectInvestment, Tier, PaymentProcessorWebhook ) from django.urls import reverse from django.contrib import admin from django.utils.safestring import mark_safe class ProjectAdmin(admin.ModelAdmin): list_display = ( 'name', 'description...
mpl-2.0
8,344,756,924,640,674,000
23.432203
84
0.566967
false
3.738003
false
false
false
bbfamily/abu
abupy/SlippageBu/ABuSlippageSellBase.py
1
4515
# -*- encoding:utf-8 -*- """ 日内滑点卖出价格决策基础模块:暂时迁移简单实现方式,符合回测需求,如迁移实盘模块 需添加日内择时策略,通过日内分钟k线,实现日内分钟k线择时,更微观的 实现日内择时滑点功能,不考虑大资金的冲击成本及系统外的大幅滑点 """ from __future__ import division from __future__ import print_function from __future__ import absolute_import from abc import ABCMeta, abstractmethod import functools...
gpl-3.0
-5,691,842,789,304,183,000
30.519608
116
0.606532
false
1.692105
false
false
false
matllubos/django-is-core
is_core/forms/fieldset.py
1
2401
import itertools class Fieldsets: def __init__(self, *args): self.fieldsets = [] for fieldset in args: self.fieldsets.append(fieldset) def get_fieldsets(self, request, obj): return self.fieldsets def get_fields_names(self, request, obj): result = [] f...
bsd-3-clause
-8,906,402,200,046,757,000
24.273684
88
0.605581
false
4.001667
false
false
false
ff0000/red-fab-deploy
fab_deploy/base/git.py
1
1568
import os from fabric.api import run, sudo, env, put, execute from fabric.tasks import Task from fabric.context_managers import settings, hide from fab_deploy.functions import get_config_filepath DEFAULT_GIT_HOOK = 'git/post-receive' class Install(Task): """ Setup a remote git repo Installs git and cre...
mit
4,702,699,345,758,544,000
26.034483
71
0.611607
false
3.579909
false
false
false
MIT-Model-Open-Data-and-Identity-System/SensibleData-Apps-DataViewer
data_viewer/django_sensible/exporter.py
1
4177
import json import os import smtplib from urllib import urlencode import urllib2 import urlparse from celery.task import task import time from django.conf import settings from django.contrib.auth.models import User from ntlm.smtp import ntlm_authenticate from django_sensible import SECURE_CONFIG from django_sensible.id...
mit
-1,814,769,842,611,969,300
27.609589
187
0.719655
false
3.176426
false
false
false
xapi-project/sm
drivers/LVHDoHBASR.py
1
9417
#!/usr/bin/python # # Copyright (C) Citrix Systems Inc. # # 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; version 2.1 only. # # This program is distributed in the hope that it will be use...
lgpl-2.1
-2,925,876,967,456,635,400
37.125506
166
0.588723
false
3.554926
true
false
false
sql-machine-learning/sqlflow
python/runtime/verifier/verifier.py
1
3069
# Copyright 2020 The SQLFlow 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 law o...
apache-2.0
8,488,378,670,168,368,000
32
74
0.650375
false
4.136119
false
false
false
rsteed11/GAT
gat/core/gsa/tests/visualization_test.py
2
2269
import shapefile as shp import matplotlib.pyplot as plt import networkx as nx import itertools import pysal import numpy as np #import kartograph np.set_printoptions(threshold=np.inf) sf = shp.Reader("us_income/us48.shp") # need to figure out why there is a line in some spots. # get rid of different colors. ''' plt....
mit
5,024,629,495,578,588,000
28.868421
136
0.635963
false
2.507182
false
false
false
C0rvus/iAMA_Reddit_Bachelor
python/c_crawl_Author_Information.py
1
22559
# Sources used within this class: # 1. (09.06.2016 @ 18:20) - # http://alan-wright.com/programming/tutorial/python/2014/03/09/praw-tutorial/ # 2. (09.06.2016 @ 22:30) - # https://m.reddit.com/r/RequestABot/comments/42lmgv/need_a_bot_that_can_pull_all_users_and_account/ # 3. (09.06.2016 @ 22:42) - # https://github.com/a...
gpl-3.0
-7,100,283,844,524,955,000
41.969524
119
0.647059
false
4.388911
false
false
false
raoanirudh/oq-risklib
openquake/commonlib/hazard_writers.py
2
34293
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2014, GEM Foundation # OpenQuake is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the Licen...
agpl-3.0
-1,309,905,936,113,145,300
36.31556
79
0.580352
false
3.99406
false
false
false
securecurebt5/scapyprogs
Rogue_DHCP_Checker.py
1
2130
#!/usr/bin/env python # Author : KADDOUR BOUMEDIENE # NAME : Rogue_DHCP_Checker.py # Purpose : Check if a Rogue DHCP Server running on the network from scapy.all import * import threading from colorama import Back from sys import argv from time import sleep # set 'hack1' as the default interface #conf.iface = 'hack...
gpl-2.0
2,085,991,804,065,186,000
25.962025
93
0.688263
false
2.777053
false
false
false
tkphd/pycalphad
pycalphad/tests/test_energy.py
1
12188
""" The energy test module verifies that the Model class produces the correct abstract syntax tree for the energy. """ import nose.tools from pycalphad import Database, Model from pycalphad.core.utils import make_callable from pycalphad.tests.datasets import ALCRNI_TDB, FEMN_TDB import pycalphad.variables as v import ...
mit
7,152,029,720,769,408,000
45.166667
80
0.546767
false
2.800551
true
false
false
Udzu/pudzu
dataviz/eudecimal.py
1
1801
from pudzu.charts import * from pudzu.sandbox.bamboo import * # generate map df = pd.read_csv("datasets/eudecimal.csv").set_index("country") PALETTE = ['#a1dab4', '#41b6c4', '#225ea8'] PALETTE = [VegaPalette10.GREEN, VegaPalette10.BLUE, VegaPalette10.RED] FONT = sans def colorfn(c): if c in ['Sea', 'Borders']: re...
mit
1,884,024,554,525,784,600
39.931818
148
0.679622
false
2.800933
false
false
false
talha81/TACTIC-DEV
src/pyasm/search/upgrade/mysql/sql_convert.py
6
1985
########################################################### # # Copyright (c) 2011, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written permi...
epl-1.0
-136,455,965,318,777,400
25.824324
95
0.577834
false
3.915187
false
false
false
photofroggy/Reflex
setup.py
1
3166
''' Reflex setup. ''' from distutils.core import setup setup(name='Reflex-events', version='1.14', description='Event system for Python', author='photofroggy', author_email='froggywillneverdie@msn.com', url='http://photofroggy.github.com/Reflex/index.html', packages=[ 'reflex', ...
isc
8,467,793,427,300,065,000
30.979798
117
0.643083
false
4.133159
false
false
false
dparks1134/STAMP
stamp/metagenomics/stats/tests/Spearman.py
1
2666
#======================================================================= # Author: Donovan Parks # # Calculate Spearman's rank correlation coefficient. # # Copyright 2011 Donovan Parks # # This file is part of STAMP. # # STAMP is free software: you can redistribute it and/or modify # it under the terms of the GNU Gener...
gpl-3.0
-7,141,765,693,881,004,000
26.78125
90
0.570893
false
3.471354
false
false
false
m-ober/byceps
byceps/services/shop/order/transfer/models.py
1
1617
""" byceps.services.shop.order.transfer.models ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2020 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ from dataclasses import dataclass from datetime import datetime from decimal import Decimal from enum import Enum from typing import...
bsd-3-clause
6,403,180,798,774,772,000
18.481928
52
0.67718
false
3.633708
false
false
false
hqxu/deepnet
deepnet/layer.py
1
31515
"""Implements a layer of neurons.""" import cudamat as cm import deepnet_pb2 import logging import numpy as np import os.path import util import visualize import pdb #import lightspeed from cudamat_conv import cudamat_conv2 as cc class Layer(object): id_counter = 0 def __init__(self, proto, batchsize=0): sel...
bsd-3-clause
5,688,407,619,325,679,000
37.479853
105
0.649119
false
3.445392
false
false
false
MaximeLM/superlachaise_api
management/commands/dump_database.py
1
3238
# -*- coding: utf-8 -*- """ write_full_data.py superlachaise_api Created by Maxime Le Moine on 29/11/2015. Copyright (c) 2015 Maxime Le Moine. 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 ...
apache-2.0
-7,952,695,919,935,469,000
39.475
136
0.641754
false
3.836493
false
false
false
snsokolov/contests
codeforces/669C_matrix.py
1
3692
#!/usr/bin/env python3 # 669C_matrix.py - Codeforces.com/problemset/problem/669/C by Sergey 2016 import unittest import sys ############################################################################### # Matrix Class (Main Program) ############################################################################### cl...
unlicense
-6,805,509,245,827,088,000
29.01626
79
0.47454
false
3.688312
true
false
false
robmcmullen/peppy
tests/pyparse.py
1
3034
import os,sys,re from cStringIO import StringIO import wx.stc from mock_wx import * from peppy.stcbase import * from peppy.fundamental import * from peppy.plugins.python_mode import * from peppy.plugins.text_transforms import * from peppy.debug import * import peppy.lib.PyParse as PyParse from nose.tools import * ...
gpl-2.0
2,704,145,808,877,854,000
18.08805
80
0.552076
false
3.46347
true
false
false
imarin/Odoo-Mexico-localization
l10n_mx_facturae/wizard/wizard_invoice_facturae_xml_v6.py
1
3768
# -*- encoding: utf-8 -*- ########################################################################### # Module Writen to OpenERP, Open Source Management Solution # # Copyright (c) 2010 Vauxoo - http://www.vauxoo.com/ # All Rights Reserved. # info Vauxoo (info@vauxoo.com) ####################################...
agpl-3.0
1,160,288,902,723,618,300
40.406593
84
0.565287
false
3.752988
false
false
false
russellmayhew/satchmo
satchmo/apps/satchmo_store/contact/forms.py
2
22462
from django import forms from django.db.models import Q from django.forms.extras.widgets import SelectDateWidget from django.utils.translation import ugettext_lazy as _, ugettext from l10n.models import Country from livesettings import config_value from satchmo_store.contact.models import Contact, AddressBook, PhoneNum...
bsd-3-clause
8,740,742,462,070,614,000
43.656064
161
0.612902
false
4.207943
true
false
false
praekelt/mc2
mc2/forms.py
1
1161
from django import forms from django.contrib.auth.models import User as user_model from django.contrib.auth.forms import UserCreationForm from mc2.models import UserSettings class UserSettingsForm(forms.ModelForm): settings_level = forms.ChoiceField( choices=UserSettings.SETTINGS_LEVEL_CHOICES, ...
bsd-2-clause
6,284,547,160,537,299,000
29.552632
79
0.633075
false
4.644
false
false
false
kelvinguu/lang2program
strongsup/predicate.py
1
1835
"""Predicate: output token.""" from gtd.utils import ComparableMixin class Predicate(ComparableMixin): """Represents a step in the logical form (i.e., an output token).""" __slots__ = ['_name', '_original_string', '_types'] def __init__(self, name, original_string=None, types=None): """Create Pr...
apache-2.0
-9,003,192,928,516,718,000
23.144737
77
0.561853
false
4.55335
false
false
false
andymckay/zamboni
mkt/comm/tasks.py
1
2644
import logging from celeryutils import task import mkt.constants.comm as cmb from amo.decorators import write from mkt.comm.models import (CommunicationNote, CommunicationNoteRead, CommunicationThread) from mkt.comm.utils import filter_notes_by_read_status, save_from_email_reply from mkt.d...
bsd-3-clause
-5,627,056,294,838,702,000
31.641975
77
0.624433
false
4.176935
false
false
false
yezooz/fserver
writer/management/commands/alerts.py
1
2272
# The MIT License (MIT) # # Copyright (c) 2013 Marek Mikuliszyn # # 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
-2,923,521,061,477,131,300
41.867925
116
0.689701
false
4.028369
false
false
false
pingo-io/pingo-py
pingo/rpi/rpi.py
6
3871
import pingo GPIO = None class RaspberryPi(pingo.Board, pingo.PwmOutputCapable): # connector_p1_location: gpio_id PWM_PIN_MAP = { 3: 2, 5: 3, 7: 4, 8: 14, 10: 15, 11: 17, 12: 18, 13: 27, 15: 22, 16: 23, 18: 24, 1...
mit
1,964,476,901,891,189,000
25.881944
82
0.498838
false
2.932576
false
false
false
ubivar/ubivar-python
oriskami/api_requestor.py
1
8575
import calendar import datetime import platform import time import urllib from urllib import parse import oriskami from oriskami import error, http_client, version, util def _encode_datetime(dttime): if dttime.tzinfo and dttime.tzinfo.utcoffset(dttime) is not None: utc_timestamp = calendar.timegm(dttime....
mit
953,179,415,907,977,100
35.489362
81
0.542274
false
3.897727
false
false
false
inactivist/django-endless-pagination
endless_pagination/paginator.py
3
3565
from math import ceil from django.core.paginator import Paginator, Page, EmptyPage, PageNotAnInteger class CustomPage(Page): def start_index(self): # Special case, return zero if no items. if self.paginator.count == 0: return 0 elif self.number == 1: return 1 ...
mit
-9,198,428,883,197,786,000
37.333333
86
0.602805
false
3.926211
false
false
false
hmendozap/auto-sklearn
autosklearn/pipeline/components/classification/multinomial_nb.py
1
4395
import numpy as np from HPOlibConfigSpace.configuration_space import ConfigurationSpace from HPOlibConfigSpace.hyperparameters import UniformFloatHyperparameter, \ CategoricalHyperparameter from autosklearn.pipeline.components.base import AutoSklearnClassificationAlgorithm from autosklearn.pipeline.constants impo...
bsd-3-clause
-1,153,495,848,958,191,900
33.880952
83
0.557679
false
4.287805
true
false
false
churchlab/ulutil
bin/make_timeseries_figures.py
1
4170
#! /usr/bin/env python # Copyright 2014 Uri Laserson # # 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
4,358,520,378,341,490,700
33.46281
96
0.728537
false
3.156699
false
false
false
DolphinDream/sverchok
nodes/curve/length_parameter.py
2
4893
import numpy as np from mathutils import Matrix import bpy from bpy.props import FloatProperty, EnumProperty, BoolProperty, IntProperty from sverchok.node_tree import SverchCustomTreeNode from sverchok.data_structure import updateNode, zip_long_repeat, ensure_nesting_level, throttle_and_update_node from sverchok.util...
gpl-3.0
-3,541,297,297,859,919,400
32.979167
126
0.60699
false
3.704012
false
false
false
twoh/leevee
Leevee/settings.py
1
5247
""" Django settings for Leevee project. Generated by 'django-admin startproject' using Django 1.9.2. 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/ """ import os imp...
mit
8,390,813,922,263,823,000
24.852217
91
0.696398
false
3.029446
false
false
false
mathcamp/dql
dql/expressions/update.py
1
5093
""" Update expressions """ from __future__ import unicode_literals from .base import Expression, Field, Value from dql.util import resolve def field_or_value(clause): """ For a clause that could be a field or value, create the right one and return it """ if hasattr(clause, 'getName') and clause....
mit
7,291,259,607,607,441,000
26.235294
79
0.598861
false
4.026087
false
false
false
hbiyik/tribler
src/tribler-core/tribler_core/modules/tunnel/socks5/server.py
1
1347
import logging from asyncio import get_event_loop from tribler_core.modules.tunnel.socks5.connection import Socks5Connection class Socks5Server(object): """ This object represents a Socks5 server. """ def __init__(self, port, output_stream): self._logger = logging.getLogger(self.__class__.__...
lgpl-3.0
-5,301,341,001,470,704,000
28.933333
98
0.618411
false
4.081818
false
false
false
nuagenetworks/vspk-python
vspk/v5_0/nufirewallacl.py
1
11290
# -*- coding: utf-8 -*- # # Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia # 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 copyrigh...
bsd-3-clause
4,201,196,638,519,288,300
28.557592
175
0.583791
false
4.621367
false
false
false
closeio/nylas
inbox/contacts/search.py
3
9663
import re import json import boto3 from flanker.addresslib import address from inbox.config import config from inbox.models import Contact from inbox.models.session import session_scope from inbox.sqlalchemy_ext.util import safer_yield_per from sqlalchemy.orm import joinedload from nylas.logging import get_logger ...
agpl-3.0
5,918,032,281,970,817,000
36.599222
117
0.610887
false
4.085835
true
false
false
CryToCry96/android_kernel_mt6572
mediatek/build/android/tools/filter.py
16
3648
#!/proj/map/bin/python/bin/python import os filter = [ "external/besloudness", "external/fmtest", "external/libfm", "$(MTK_PATH_SOURCE)/external/camera", "$(MTK_PATH_SOURCE)/external/ccci_fsd", "$(MTK_PATH_SOURCE)/external/ccci_mdinit", "$(MTK_PATH_SOURCE)/external/mhal", "$(MTK_PATH_SOURCE)/externa...
gpl-2.0
-8,080,397,902,866,046,000
34.764706
66
0.701754
false
3.060403
false
false
false
AXAz0r/apex-sigma
sigma/plugins/moderation/permissions/unpermitrole.py
2
3448
import discord from sigma.core.permission import check_admin from .nodes.permission_data import get_all_perms, generate_cmd_data from sigma.core.rolecheck import matching_role async def unpermitrole(cmd, message, args): if args: if len(args) >= 2: if not check_admin(message.author, message.cha...
gpl-3.0
-2,530,013,205,280,988,000
51.769231
112
0.470845
false
4.466146
false
false
false
reiinakano/ensemble_helper
src/featureextractor.py
1
2409
# This module contains the FeatureExtractor class, which must contain information about how to extract the feature set # from any parent set. # As of now, the FeatureExtractor class is mainly used to choose particular features from a ParentSet e.g. Naive Bayes will # work better with a feature set with less correlated ...
mit
4,407,176,294,805,656,000
46.235294
123
0.71731
false
4.248677
false
false
false
odlgroup/odl
odl/contrib/datasets/ct/examples/mayo_reconstruct.py
2
1802
"""Reconstruct Mayo dataset using FBP and compare to reference recon. Note that this example requires that Mayo has been previously downloaded and is stored in the location indicated by "mayo_dir". In this example we only use a subset of the data for performance reasons, there are ~48 000 projections in the full data...
mpl-2.0
-3,763,735,738,749,904,000
37.340426
79
0.724195
false
2.988391
false
false
false
gilsondev/cajadoarquitetura
cajadoarquitetura/core/models.py
1
2910
# -*- coding: utf-8 -*- from django.db import models from modelcluster.fields import ParentalKey from wagtail.wagtailcore.fields import RichTextField from wagtail.wagtailcore.models import Page, Orderable from wagtail.wagtailadmin.edit_handlers import ( FieldPanel, InlinePanel, MultiFieldPanel, PageChooserPanel ...
mit
2,183,307,876,908,815,600
21.726563
68
0.646958
false
3.85298
false
false
false
txerpa/dj-txmoney
txmoney/rest/fields.py
1
3131
# coding=utf-8 from __future__ import absolute_import, unicode_literals from django.utils.translation import ugettext_lazy as _ from rest_framework.fields import Field from ..money.exceptions import IncorrectMoneyInputError from ..money.models import Money class MoneyField(Field): """ A field to handle TXMo...
mit
-5,431,068,641,465,852,000
35.835294
120
0.624082
false
4.174667
false
false
false
mit-crpg/openmc
openmc/plotter.py
6
38919
from itertools import chain from numbers import Integral, Real import string import numpy as np import openmc.checkvalue as cv import openmc.data # Supported keywords for continuous-energy cross section plotting PLOT_TYPES = ['total', 'scatter', 'elastic', 'inelastic', 'fission', 'absorption', 'capture...
mit
2,491,230,075,384,314,000
41.349293
79
0.562681
false
4.121029
false
false
false
Skylion007/popupcad
popupcad/filetypes/layerdef.py
1
1803
# -*- coding: utf-8 -*- """ Written by Daniel M. Aukes. Email: danaukes<at>seas.harvard.edu. Please see LICENSE.txt for full license. """ import popupcad class LayerDef(object): def __init__(self, *args): self.layers = list(args) self.refreshzvalues() def upgrade(self): layers...
mit
8,169,742,757,072,452,000
26.333333
103
0.565169
false
3.819915
false
false
false
jwvhewitt/dmeternal
old_game/narrator/dungeonbits.py
1
24111
from .plots import Plot,PlotError,PlotState from .. import context from .. import items from .. import maps from .. import waypoints from .. import monsters from .. import dialogue from .. import services from .. import teams from .. import characters import random from .. import randmaps # **************************...
gpl-2.0
-6,387,590,056,920,301,000
42.998175
213
0.615984
false
3.399746
false
false
false
b29308188/MMAI_final
src/camera.py
1
3583
import cv2 import datetime import time import sys import cPickle sys.path.append(".") import glob from utils import detect_faces from datasets import Photo, inv_label_maps import numpy as np import pandas as pd class Camera(): def __init__(self, model_path=None): print "USAGE : python camera.py model_path" self.m...
gpl-2.0
5,253,838,831,850,075,000
23.541096
76
0.593358
false
2.557459
false
false
false
sunqm/pyscf
pyscf/pbc/cc/ccsd.py
1
6728
#!/usr/bin/env python # Copyright 2014-2020 The PySCF Developers. 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 # # U...
apache-2.0
8,082,707,403,402,668,000
41.582278
79
0.609988
false
2.934147
false
false
false
amanand/vmx-docker-lwaftr
snmp/lw4over6.py
1
22413
# # 2016-09-28 # snmp script handler for lw4over6 application # # rnaren # # Copyright (c) 2004-2016, Juniper Networks, Inc. # All rights reserved. # from __future__ import print_function import jcs import sys import argparse from jnpr.junos import Device from lxml import etree from time import time import os import ...
apache-2.0
-52,815,757,007,431,960
37.312821
151
0.549056
false
3.485692
false
false
false
Azure/azure-sdk-for-python
sdk/network/azure-mgmt-network/azure/mgmt/network/v2021_02_01/aio/operations/_vpn_gateways_operations.py
1
48948
# 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 ...
mit
6,344,765,205,836,587,000
49.100307
211
0.64354
false
4.297454
true
false
false
AlexS12/PyFME
src/pyfme/simulator.py
2
6523
""" Python Flight Mechanics Engine (PyFME). Copyright (c) AeroPython Development Team. Distributed under the terms of the MIT License. Simulation class ---------------- Select the simulation configuration based on a system (and its dynamic model), environment and aircraft. """ import copy import operator import pand...
mit
553,818,015,490,016,900
29.768868
78
0.581481
false
4.089655
false
false
false
ActiveState/code
recipes/Python/577283_Decorator_expose_local_variables_functiafter/recipe-577283.py
1
3276
import new import byteplay as bp import inspect def persistent_locals(f): """Function decorator to expose local variables after execution. Modify the function such that, at the exit of the function (regular exit or exceptions), the local dictionary is copied to a read-only function property 'locals'. ...
mit
2,683,072,537,717,225,000
32.090909
77
0.568376
false
4.183908
false
false
false
IoT-Expedition/Edge-Analytics
virtual_sensor/archive/SensorTag.py
1
5958
import struct import math import sys,getopt import pexpect import time import struct import random import binascii import json import requests from calendar import timegm from time import gmtime, strftime sensorHandleList = ['0x24', # IR Temperature Sensor '0x2C', # Humidity Sensor '0x44', # Light Sensor ...
apache-2.0
-2,722,120,122,406,439,400
29.71134
107
0.720208
false
2.90918
false
false
false
pi-bot/pibot-pkg
setup.py
1
3940
"""The official PiBot python package library for the PiBot Educational Robot See: http://pibot.org """ # Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get th...
gpl-3.0
-3,588,184,049,814,849,500
34.178571
104
0.662183
false
4.01631
false
false
false
MorbZ/uasf-node-tracker
uasf.py
1
9267
#!/usr/bin/env python import urllib2 import json import re import sys import operator import rrdtool import os.path import time ### Config ### validSubvers = [ '0', '0.1.1', '0.2', '0.3', '1.0', ] validBips = [ 148, 149 ] # Munin colors colors = [ '00CC00', '0066B3', 'FF8000', 'FFCC00', '330099' ] reUas...
mit
5,458,113,453,402,055,000
23.132813
127
0.639797
false
2.671375
false
false
false
joshbohde/scikit-learn
benchmarks/bench_balltree.py
1
2229
""" This script compares the performance of the Ball Tree code with scipy.spatial.cKDTree. Then run the simple timings script: python bench_kdtree.py 1000 100 """ from sklearn.ball_tree import BallTree import numpy from time import time from scipy.spatial import cKDTree import sys def compare_nbrs(nbrs1, nbrs2): ...
bsd-3-clause
-8,962,240,086,627,515,000
27.576923
84
0.532526
false
3.126227
false
false
false
access-missouri/am-django-project
am/tags/management/commands/regex_tagger.py
1
1280
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Manual tagging utility to pair regexes with tags on a one-off run. """ from django.core.management.base import BaseCommand from legislative.models import Bill from general.models import Tag import re from tqdm import tqdm class Command(BaseCommand): """ Manual ...
bsd-2-clause
-808,211,525,683,563,300
28.090909
79
0.578906
false
3.764706
false
false
false
CiscoSystems/nova
nova/compute/power_state.py
47
2019
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Justin Santa Barbara # All Rights Reserved. # Copyright (c) 2010 Citrix Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # ...
apache-2.0
563,727,214,690,360,900
37.826923
78
0.743437
false
3.725092
false
false
false
kdeloach/nyc-trees
src/nyc_trees/apps/survey/migrations/0001_initial.py
4
3868
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.contrib.gis.db.models.fields import django.db.models.deletion from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(se...
agpl-3.0
-5,791,368,911,748,625,000
43.45977
169
0.558687
false
4.370621
false
false
false
nebw/keras
keras/utils/visualize_util.py
7
2402
try: # pydot-ng is a fork of pydot that is better maintained import pydot_ng as pydot except ImportError: # fall back on pydot if necessary import pydot if not pydot.find_graphviz(): raise RuntimeError('Failed to import pydot. You must install pydot' ' and graphviz for `pydotp...
mit
3,590,663,533,894,702,000
34.850746
92
0.559534
false
3.812698
false
false
false
bretttegart/treadmill
lib/python/treadmill/sproc/metrics.py
1
7233
"""Treadmill metrics collector. Collects Treadmill metrics and sends them to Graphite. """ from __future__ import division from __future__ import print_function from __future__ import unicode_literals from __future__ import absolute_import import glob import logging import os import socket import time import click ...
apache-2.0
-131,002,405,992,146,750
29.518987
79
0.567814
false
3.63833
false
false
false
reinbach/tutorus
tutorus/questions/migrations/0007_answer.py
1
6148
# -*- 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 'Question.answer' db.add_column('questions_question', 'answer', self.gf...
bsd-3-clause
8,055,509,318,515,078,000
68.089888
182
0.549447
false
3.757946
false
false
false
tianxiawuzhei/cocos-quick-cpp
publibs/cocos2dx/tools/cocos2d-console/plugins/plugin_generate/gen_simulator.py
1
18319
#!/usr/bin/python #-*- coding: UTF-8 -*- # ---------------------------------------------------------------------------- # Generate Cocos Simulator # # Copyright 2015 (C) zhangbin # # License: MIT # ---------------------------------------------------------------------------- import os import re import shutil import str...
mit
-7,807,623,451,717,094,000
42.205189
133
0.56455
false
3.572348
false
false
false
laxmandhulipala/PWSA-Star
test/grid/scripts/run_pbnf.py
1
4497
#!/usr/bin/python import os import sys import subprocess import tempfile i = sys.argv.index("-algo") algo = sys.argv[i+1] newargs = sys.argv[1:i] + sys.argv[(i+2):] i = newargs.index("-cost") cost = newargs[i+1] newargs = newargs[1:i] + newargs[(i+2):] def parseArgs(argdefaults): result = {} for name, default i...
apache-2.0
7,969,848,995,396,905,000
30.013793
118
0.513231
false
3.008027
false
false
false
mtakaki/cachet-url-monitor
tests/test_configuration.py
1
12632
#!/usr/bin/env python import mock import pytest import requests import requests_mock from yaml import load, SafeLoader import cachet_url_monitor.exceptions import cachet_url_monitor.status from cachet_url_monitor.webhook import Webhook from cachet_url_monitor.configuration import Configuration import os @pytest.fix...
mit
-6,764,653,057,404,951,000
37.163142
117
0.71121
false
3.769621
true
false
false
log2timeline/dfvfs
dfvfs/file_io/vhdi_file_io.py
2
4313
# -*- coding: utf-8 -*- """The Virtual Hard Disk image file-like object.""" import pyvhdi from dfvfs.file_io import file_object_io from dfvfs.lib import errors from dfvfs.path import factory as path_spec_factory from dfvfs.resolver import resolver class VHDIFile(file_object_io.FileObjectIO): """File input/output ...
apache-2.0
8,996,321,602,656,065,000
30.028777
81
0.686529
false
3.618289
false
false
false
rsb93/Capstone
TreeMaker.py
1
7762
################################ # #Treemaker converts a phylogenetic tree file into a tree data structure, #where each node in the tree contains: # data - used to store A T C or G, when a particular SNP is loaded # into the tree using entropy calculator # name - stores the species name or branch n...
gpl-2.0
4,483,519,012,271,234,600
34.769585
104
0.510307
false
4.903348
false
false
false
renyi533/tensorflow
tensorflow/python/ops/nn_xent_test.py
22
7562
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
85,309,964,513,394,770
40.322404
80
0.656837
false
3.429478
true
false
false
KineticCookie/mist
src/main/resources/mist/context_wrapper.py
1
2748
# coding=utf-8 from pyspark.conf import SparkConf from pyspark.context import SparkContext class ContextWrapper: _context = None _sql_context = None _hive_context = None _session = None _streaming_context = None def __init__(self): pass def set_context(self, java_gateway): ...
apache-2.0
3,595,224,671,911,754,000
35.157895
136
0.694687
false
4.09538
false
false
false
TheCrittaC/BigBen
modules/pubmsg/htmlconvert.py
1
1478
import irc class htmlconvert: def on_pubmsg(self, nick, connection, event): message = event.arguments[0] source = event.source.split('!')[0] if message.startswith(".convert"): try: color = message.split(' ')[1] if color.startswith("#"): ...
gpl-2.0
-5,717,665,656,209,145,000
45.1875
88
0.409337
false
4.359882
false
false
false
hirokiky/uiro
uiro/view.py
1
3453
import itertools from functools import reduce from uiro.template import get_app_template class ViewNotMatched(Exception): """ Called view was not apposite. This exception is to notify Controllers that called view was not apposite to the applied rquest. """ def get_base_wrappers(method='get', templa...
mit
7,056,522,870,655,882,000
30.678899
82
0.654214
false
4.478599
false
false
false
mattcaldwell/zipline
zipline/algorithm.py
1
38424
# # Copyright 2014 Quantopian, 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 wr...
apache-2.0
1,286,705,221,899,181,800
34.843284
108
0.579664
false
4.483024
false
false
false
greatmazinger/or-tools
examples/python/nontransitive_dice.py
32
5680
# Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.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 # # Unless required by applicable ...
apache-2.0
4,828,583,722,086,886,000
26.572816
80
0.615141
false
2.906858
false
false
false
MashSoftware/place-ui
mash_place_ui/models.py
1
2445
from mash_place_ui import cache, app import requests class Constituency(object): """Encapsulating class for Mash Place API access.""" def __init__(self): super(Constituency, self).__init__() self.base_url = app.config['PLACE_API_URL'] + "/constituencies" @cache.memoize(timeout=86400) ...
mit
-3,153,497,252,405,937,700
37.203125
85
0.584458
false
3.606195
false
false
false
stkeky/valar-morghulis
project/view/dashboard_tab.py
1
4614
# coding=utf-8 from PySide import QtGui, QtCore from project.model.ResultTableModel import * class DashboardTab(QtGui.QWidget): def __init__(self, neural_network, parent=None): super(DashboardTab, self).__init__(parent) self.neural_network = neural_network grid = QtGui.QGridLayout() ...
mit
7,451,268,454,139,799,000
44.693069
133
0.635891
false
3.38518
false
false
false
jhonatancasale/ML-T3
utils/dev/get.data.from.web/get.data.from.web.py
1
1849
#!env python3 # -*- coding: utf-8 -*- import logging import sys import requests import os.path logging.basicConfig(filename='history.log', level=logging.DEBUG, format='%(asctime)s:%(levelname)s:%(message)s' ) BASE_YEAR = 2016 def main(): '''Retrieve some data from http://w...
apache-2.0
4,224,737,487,171,838,500
32.618182
103
0.544619
false
3.75813
false
false
false
MD-Studio/MDStudio
mdstudio/mdstudio/cache/impl/redis_client_wrapper.py
1
1956
from typing import Any, Union, List, Tuple, Optional from mdstudio.cache.cache import ICache from mdstudio.deferred.make_deferred import make_deferred class RedisClientWrapper(ICache): def __init__(self, client): # type: (StrictRedisCluster) -> None # type: StrictRedisCluster self.clien...
apache-2.0
3,519,081,747,303,317,500
21.744186
68
0.525051
false
3.967546
false
false
false
astooke/synkhronos
synkhronos/synchronize.py
1
3105
import multiprocessing as mp import numpy as np import ctypes # import ipdb from .util import struct def np_mp_arr(t_or_tc, size_or_init): return np.ctypeslib.as_array(mp.RawArray(t_or_tc, size_or_init)) def build_syncs(n_parallel, max_n_var=100, max_dim=16): mgr = mp.Manager() dictionary = mgr.dict...
mit
1,925,053,570,687,865,900
29.742574
89
0.59839
false
2.891061
false
false
false
retroredge/python-asteroids
src/util/geometry.py
1
7164
# # Copyright (C) 2008 Nick Redshaw # # 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 progra...
gpl-3.0
8,057,322,497,636,420,000
36.507853
108
0.575377
false
3.662577
false
false
false
kubeflow/pipelines
sdk/python/kfp/cli/output.py
1
2088
# Copyright 2020 The Kubeflow 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 or agreed to in...
apache-2.0
7,159,126,470,095,450,000
35
107
0.681992
false
4.322981
false
false
false
gvlproject/cloudbridge
cloudbridge/providers/openstack/services.py
1
59980
""" Services implemented by the OpenStack provider. """ import logging from neutronclient.common.exceptions import NeutronClientException from neutronclient.common.exceptions import PortNotFoundClient from novaclient.exceptions import NotFound as NovaNotFound from openstack.exceptions import BadRequestException from...
mit
-5,052,380,615,757,136,000
40.652778
79
0.622491
false
4.329123
false
false
false
drunknbass/plexpy
plexpy/users.py
3
23842
# This file is part of PlexPy. # # PlexPy 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. # # PlexPy is distributed in the hope t...
gpl-3.0
3,346,464,943,053,453,300
44.239089
126
0.440101
false
4.814216
false
false
false
iesugrace/book-reader
lib/timeutils.py
1
1202
from time import * def isotime(second): """ return the iso time string from a second """ return strftime('%Y-%m-%d %H:%M:%S', localtime(second)) def stddate(second): """ return the date string of format '%Y-%m-%d' """ return strftime('%Y-%m-%d', localtime(second)) def isostrtosecond(t...
gpl-2.0
3,740,447,364,536,739,000
24.574468
75
0.563228
false
3.366947
false
false
false
dhalleine/tensorflow
fred/word_embeddings/main.py
1
1777
import tensorflow as tf import math EMBEDDING_SIZE = 100 BATCH_SIZE = 400 import input_corpus data = input_corpus.read_data_sets() batch_size = BATCH_SIZE embedding_size = EMBEDDING_SIZE skip_window = 1 # How many words to consider left and right. num_skips = 2 # How many times to reuse an input to generate a label....
apache-2.0
8,234,403,937,493,019,000
36.808511
150
0.675295
false
3.201802
false
false
false
004helix/bybankpy
mbank2/mbank2.py
1
6527
# -*- coding: utf-8 -*- # # ASB Belarusbank mbank client # from __future__ import print_function from .bits import parser, packint, packbytes, packdate from struct import pack, unpack from Crypto.Cipher import AES import random import socket import zlib import time class MBankException(Exception): pass class c...
gpl-3.0
-5,538,735,196,339,186,000
26.195833
75
0.499923
false
3.614064
false
false
false