repo_name
stringlengths
6
61
path
stringlengths
4
230
copies
stringlengths
1
3
size
stringlengths
4
6
text
stringlengths
1.01k
850k
license
stringclasses
15 values
hash
int64
-9,220,477,234,079,998,000
9,219,060,020B
line_mean
float64
11.6
96.6
line_max
int64
32
939
alpha_frac
float64
0.26
0.9
autogenerated
bool
1 class
ratio
float64
1.62
6.1
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
Ultimaker/Uranium
UM/TaskManagement/HttpRequestManager.py
1
24890
# Copyright (c) 2020 Ultimaker B.V. # Uranium is released under the terms of the LGPLv3 or higher. import json import time import uuid from collections import deque from threading import RLock from typing import Callable, cast, Dict, Set, Union, Optional, Any from PyQt5.QtCore import QObject, QUrl, Qt, pyqtSignal, pyq...
lgpl-3.0
-6,409,155,076,828,808,000
52.991323
135
0.641583
false
4.630698
false
false
false
vongrippen/mempy-celery
main2.py
1
1433
from flask import Flask, request, render_template, redirect from flask import send_from_directory from mongoengine import Document, StringField, DateTimeField, connect import os import datetime import tasks app = Flask(__name__) app.debug = True class Entry(Document): name = StringField() zip = StringField...
mit
4,270,123,599,678,727,000
23.706897
69
0.624564
false
3.852151
false
false
false
bsmedberg/socorro
socorro/lib/transform_rules.py
1
13761
# 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 re import configman import collections import inspect #---------------------------------------------------------...
mpl-2.0
-822,367,451,318,281,900
42.273585
79
0.51864
false
5.228343
true
false
false
jstarc/deep_reasoning
old_experiments.py
1
6927
# -*- coding: utf-8 -*- """ Created on Mon Sep 28 13:43:55 2015 @author: Janez """ import sys sys.path.append('../keras') import load_data import models import misc import paraphrase import numpy as np import itertools import os if __name__ == "__main__": train, dev, test = load_data.load_all_snli_datasets...
mit
-9,217,211,386,601,654,000
32.955882
134
0.623647
false
3.013049
true
false
false
bcgov/gwells
app/backend/aquifers/migrations/0030_vertical_aquifer_extents.py
1
2338
# Generated by Django 2.2.10 on 2020-02-13 22:29 from decimal import Decimal import django.contrib.gis.db.models.fields import django.core.validators from django.db import migrations, models import django.db.models.deletion import django.utils.timezone import gwells.db_comments.model_mixins class Migration(migration...
apache-2.0
8,714,971,717,302,226,000
56.02439
239
0.655689
false
3.664577
false
false
false
ElbaKramer/gpss-research
experiments/2014-02-18-GPSS-add-pl2.py
4
1774
Experiment(description='PL2 empiricism', data_dir='../data/tsdlr-renamed/', max_depth=10, random_order=False, k=1, debug=False, local_computation=False, n_rand=9, sd=2, jitter_sd=0.1, max_jobs=400, ...
mit
7,466,689,904,000,813,000
44.512821
98
0.390643
false
3.598377
false
true
false
PPKE-Bioinf/consensx.itk.ppke.hu
consensx/graph/correl_graph.py
1
1656
import numpy as np import matplotlib.pyplot as plt plt.switch_backend('Agg') def correl_graph(my_path, calced, experimental, graph_name): """X axis -> experimental values, Y axis -> calculated values "calced" is a dict containing values for residues (as keys) "experimental" is a list containing STR...
mit
-5,308,761,669,135,066,000
28.052632
76
0.608696
false
3.196911
false
false
false
rustychris/stompy
stompy/spatial/algorithms.py
1
1107
import shapely.ops from shapely import geometry def cut_polygon(poly,line): # slice the exterior separately from interior, then recombine ext_sliced=poly.exterior.union( line ) ext_poly=geometry.Polygon(poly.exterior) int_sliced=[ p.union(line) for p in poly.interiors ] ext_parts,...
mit
-3,559,079,356,101,786,600
37.172414
83
0.635953
false
3.459375
false
false
false
LPgenerator/django-robokassa
robokassa/migrations/0001_initial.py
1
1475
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='SuccessNotification', fields=[ ('id', models.Au...
mit
6,957,487,516,605,604,000
53.62963
273
0.656949
false
2.676951
false
false
false
leejz/meta-omics-scripts
query_ko_from_rast_annotations.py
1
12027
#!/usr/bin/env python """ -------------------------------------------------------------------------------- Created: Jackson Lee 9/27/14 This script reads in a tab delimited file of annotations and querys the KEGG REST API to parse back the original KO ortholog of the entry. If the line contains an EC reference, th...
mit
3,400,266,808,481,066,000
47.301205
199
0.55126
false
3.42552
false
false
false
BrainTech/openbci
obci/utils/test_robot.py
1
1110
#!/usr/bin/python # -*- coding: utf-8 -*- import argparse import urllib class TestRobot(object): def __init__(self, robot_ip): self.robot_ip = robot_ip def head_up(self): # http://192.168.10.18/rev.cgi?Cmd=nav&action=18&drive=13&speed=5 params = urllib.urlencode({'Cmd': 'nav', ...
gpl-3.0
8,965,823,590,068,635,000
29.833333
107
0.525225
false
3.627451
false
false
false
webpartners/maildump
maildump/__init__.py
2
1225
import asyncore import gevent from gevent.event import Event from logbook import Logger from socketio.server import SocketIOServer from maildump.db import connect, disconnect, create_tables from maildump.smtp import smtp_handler, SMTPServer from maildump.web import app from maildump.web_realtime import broadcast lo...
mit
-6,663,160,390,148,330,000
25.630435
84
0.673469
false
3.656716
false
false
false
iocast/libwebsocket
libwebsocket/websocket/broadcast.py
1
2293
import struct import logging from threading import Thread from time import sleep from base import BaseHandler # WebSocket implementation class BroadcastHandler(BaseHandler, Thread): @property def server(self): return self._server @property def tick_time(self): return self._tick_...
mit
842,796,525,149,692,300
22.397959
65
0.501526
false
4.549603
false
false
false
prppedro/mercurium
plugins/aulete.py
1
3498
from api import send_message, send_photo import requests import bs4 def on_msg_received(msg, matches): url = "http://aulete.com.br/wap/resultado.php" headers = {'User-Agent': 'Nokia6630/1.0 (2.3.129) SymbianOS/8.0 Series60/2.6 Profile/MIDP-2.0 Configuration/CLDC-1.1'} data = { 'busca' : str(matches.group(1...
mit
2,658,021,087,867,210,000
38.965517
122
0.516825
false
3.258669
false
false
false
botswana-harvard/edc-locator
edc_locator/model_mixins/subject_contact_fields_mixin.py
1
2191
from django.db import models from django.utils.safestring import mark_safe from django_crypto_fields.fields import EncryptedCharField, EncryptedTextField from edc_base.model_validators import CellNumber, TelephoneNumber from edc_constants.choices import YES_NO class SubjectContactFieldsMixin(models.Model): may_c...
gpl-2.0
6,615,224,671,100,447,000
29.430556
83
0.628937
false
4.141777
false
false
false
Yubico/yubioath-desktop-dpkg
yubioath/gui/messages.py
1
5776
# Copyright (c) 2014 Yubico AB # All rights reserved. # # 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 program...
gpl-3.0
6,331,565,622,873,595,000
39.391608
79
0.723857
false
3.429929
false
false
false
kivy/plyer
plyer/platforms/win/cpu.py
1
6646
''' Module of Windows API for plyer.cpu. ''' from ctypes import ( c_ulonglong, c_ulong, byref, Structure, POINTER, Union, windll, create_string_buffer, sizeof, cast, c_void_p, c_uint32 ) from ctypes.wintypes import ( BYTE, DWORD, WORD ) from plyer.facades import CPU KERNEL = windll.kernel32 ERROR_IN...
mit
-8,452,032,269,745,349,000
25.373016
75
0.578694
false
3.671823
true
false
false
sonicyang/chiphub
digikey/migrations/0007_auto_20151121_0832.py
1
1294
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('digikey', '0006_auto_20151028_0846'), ] operations = [ migrations.CreateModel( name='Order_Details', ...
mit
6,385,116,923,972,012,000
28.409091
114
0.541731
false
4.524476
false
false
false
CERNDocumentServer/invenio
modules/miscutil/lib/pid_store.py
1
14826
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2015 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) a...
gpl-2.0
7,298,396,814,584,288,000
33.319444
79
0.595103
false
4.403326
false
false
false
XeryusTC/lanciesite
pointofsale/views.py
1
6459
import datetime from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse, reverse_lazy from django.http import HttpResponseRedirect from django.shortcuts import render from django.utils.decorators import method_decorator from django.views.generic.base import TemplateView, R...
gpl-2.0
1,818,184,969,982,068,200
38.145455
130
0.629354
false
4.009311
false
false
false
geocryology/GeoCryoLabPy
equipment/thermistorCalibrate.py
1
7565
import datetime import math import sys import time from Keysight34972A import Keysight34972A from Fluke7341 import Fluke7341 from Fluke1502A import Fluke1502A NUM_PROBES = 2 PROBE_LIST = [1, 2] SAMPLE_INTERVAL = 5 BUFFER_SIZE = 5000 STD_HOLD_COUNT = 5000 TEMP_INCREMENT = 0.0 """ QUICK VALUES FOR TES...
gpl-3.0
186,292,659,177,525,600
31.891304
111
0.506411
false
3.732116
false
false
false
LosFuzzys/CTFd
tests/teams/test_auth.py
2
3278
#!/usr/bin/env python # -*- coding: utf-8 -*- from CTFd.models import Users, db from tests.helpers import ( create_ctfd, destroy_ctfd, gen_team, gen_user, login_as_user, register_user, ) def test_banned_team(): app = create_ctfd(user_mode="teams") with app.app_context(): regis...
apache-2.0
-1,840,673,921,199,951,600
29.924528
74
0.526541
false
3.626106
true
false
false
prisae/blog-notebooks
travelmaps.py
1
7492
# coding: utf-8 # # `travelmaps`: Functions and settings to create beautiful global and local travel maps # # [Blog](http://werthmuller.org/blog) # [Repo](http://github.com/prisae/blog-notebooks) # # See the blog post [Travel Maps](http://werthmuller.org/blog/2015/travelmap) for more explanations and some examples....
cc0-1.0
6,862,216,792,494,137,000
32.747748
119
0.569407
false
3.589842
false
false
false
OpenMined/PySyft
packages/syft/examples/hyperledger-aries/src/AriesDuetTokenExchanger.py
1
11076
# stdlib import asyncio import json import time from typing import Dict as TypeDict from typing import Optional # third party from aries_cloudcontroller import AriesAgentController # syft absolute from syft.grid.duet.exchange_ids import DuetCredentialExchanger class AriesDuetTokenExchanger(DuetCredentialExchanger):...
apache-2.0
-5,194,744,145,813,313,000
38.798561
105
0.564895
false
4.44159
false
false
false
openSUSE/python-suseapi
suseapi/test_userinfo.py
2
2759
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2015 Michal Čihař <mcihar@suse.cz> # # This file is part of python-suseapi # <https://github.com/openSUSE/python-suseapi> # # 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 F...
gpl-3.0
8,879,091,268,890,904,000
27.412371
71
0.542816
false
3.965468
true
false
false
artefactual/archivematica-history
src/MCPClient/lib/clientScripts/getContentdmCollectionList.py
1
1665
#!/usr/bin/python -OO # This file is part of Archivematica. # # Copyright 2010-2012 Artefactual Systems Inc. <http://artefactual.com> # # Archivematica 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, e...
agpl-3.0
8,629,844,122,104,608,000
35.195652
102
0.756156
false
3.741573
false
false
false
jbtule/keyczar
python/tests/keyczar_tests/keyczart_test.py
9
4366
#!/usr/bin/python # # Copyright 2008 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
3,661,573,578,239,872,500
32.328244
78
0.703848
false
3.495596
true
false
false
jonnybot0/emoji4unicode
src/update_e4u_from_nameslist.py
6
3270
#!/usr/bin/python2.4 # # Copyright 2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
apache-2.0
-7,178,315,848,665,647,000
36.586207
75
0.68318
false
3.699095
false
false
false
korealerts1/sentry
src/sentry/api/serializers/models/project.py
10
1618
from __future__ import absolute_import from sentry.api.serializers import Serializer, register from sentry.models import OrganizationMemberType, Project, Team @register(Project) class ProjectSerializer(Serializer): def get_attrs(self, item_list, user): organization = item_list[0].team.organization ...
bsd-3-clause
-8,629,694,404,805,901,000
28.962963
78
0.537701
false
4.420765
false
false
false
honnibal/spaCy
spacy/lang/el/get_pos_from_wiktionary.py
1
2143
# coding: utf8 from __future__ import unicode_literals def get_pos_from_wiktionary(): import re from gensim.corpora.wikicorpus import extract_pages regex = re.compile(r"==={{(\w+)\|el}}===") regex2 = re.compile(r"==={{(\w+ \w+)\|el}}===") # get words based on the Wiktionary dump # check only...
mit
4,177,426,554,848,515,600
29.343284
87
0.515494
false
3.002954
false
false
false
projectbuendia/server-status
lcd/report_lines_and_battery.py
1
1426
#!/usr/bin/env python import Adafruit_Nokia_LCD as LCD import Adafruit_GPIO.SPI as SPI from PIL import Image from PIL import ImageFont from PIL import ImageDraw import sys from re import sub import os os.chdir('/home/root/gpio') # Edison software SPI config: SCLK = 35 # 10 DIN = 26 # 11 DC = 25 # 32 RST = 45 # 4...
apache-2.0
5,995,362,404,635,405,000
23.169492
107
0.657083
false
2.376667
false
false
false
wayn3/finite_size_correction
cube.py
1
3476
#!/usr/bin/env python '''planar-average of a cube file wei.chen@epfl.ch''' import numpy as np import sys class Readcube: def __init__(self, filename, zdef=0): try: f = open(filename) except IOError: sys.exit('File not found.') [f.readline() for i in xrange(2)] ...
gpl-2.0
7,067,332,705,653,154,000
25.333333
70
0.481876
false
3.09528
false
false
false
googleapis/python-aiplatform
samples/snippets/export_model_sample_test.py
1
1390
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
-1,274,198,760,584,094,200
28.574468
84
0.722302
false
3.457711
false
false
false
uni-peter-zheng/virt-test
virttest/utils_misc_unittest.py
14
7598
#!/usr/bin/python import os import tempfile import unittest import common from autotest.client import utils from autotest.client.shared.test_utils import mock import utils_misc import cartesian_config import build_helper class TestUtilsMisc(unittest.TestCase): def test_cpu_vendor_intel(self): cpu_info ...
gpl-2.0
-8,474,073,198,443,555,000
33.536364
78
0.562122
false
3.263746
true
false
false
Pikecillo/genna
external/4Suite-XML-1.0.2/Ft/Lib/Random.py
1
11290
######################################################################## # $Header: /var/local/cvsroot/4Suite/Ft/Lib/Random.py,v 1.8 2006/01/13 06:12:55 mbrown Exp $ """ Thread-safe random number generation Random number generation capabilities, speed, and thread safety in stdlib vary from version to version of Python...
gpl-2.0
5,651,266,429,356,690,000
37.141892
92
0.601683
false
3.89579
false
false
false
gnowledge/ncert_nroer
gstudio/gnowql.py
3
2589
# Copyright (c) 2011, 2012 Free Software Foundation # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later vers...
agpl-3.0
-4,225,464,799,175,490,600
29.458824
90
0.634608
false
3.875749
false
false
false
westernx/sgpublish
sgpublish/mayatools/publish_scene.py
1
5484
from __future__ import absolute_import import traceback import time import sys import subprocess import platform import tempfile import os import re import glob import functools import datetime import itertools from concurrent.futures import ThreadPoolExecutor from PyQt4 import QtCore, QtGui Qt = QtCore.Qt from may...
bsd-3-clause
-3,621,045,263,396,236,000
28.643243
136
0.610321
false
4.18626
false
false
false
telamonian/saga-python
src/saga/adaptors/cpi/advert/entry.py
10
1833
__author__ = "Andre Merzky" __copyright__ = "Copyright 2012-2013, The SAGA Project" __license__ = "MIT" import saga.adaptors.cpi.decorators as cpi_dec import saga.adaptors.cpi.namespace as cpi_ns import saga.adaptors.cpi.attributes as cpi_att SYNC = cpi_dec.CPI_SYNC_CALL ASYNC = cpi_dec.CPI_ASYNC_CALL # ke...
mit
-25,864,402,350,303,360
26.772727
75
0.469722
false
3.834728
false
false
false
praba230890/PYPOWER
pypower/case30.py
3
7349
# Copyright (c) 1996-2015 PSERC. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. """Power flow data for 30 bus, 6 generator case. """ from numpy import array def case30(): """Power flow data for 30 bus, 6 generator case. Please see L{...
bsd-3-clause
-7,030,047,634,823,100,000
46.720779
85
0.443053
false
2.102718
false
false
false
jhamilius/chain
scripts/json2csv.py
1
1104
#!/usr/bin/env python #Convert json array file in csv file #import import ijson import csv import time import sys import os import datetime os.chdir('/home/julien_ha/data') #Start timer start_time = time.time() input_file = sys.argv[1] output_file = input_file.replace('.json','.csv') #Parse json file f1 = open(in...
mit
-1,198,574,196,205,953,800
22.020833
130
0.54529
false
3.538462
false
false
false
jnsebgosselin/WHAT
gwhat/meteo/weather_station_finder.py
1
8241
# -*- coding: utf-8 -*- # Copyright © 2014-2018 GWHAT Project Contributors # https://github.com/jnsebgosselin/gwhat # # This file is part of GWHAT (Ground-Water Hydrograph Analysis Toolbox). # Licensed under the terms of the GNU General Public License. # ---- Imports: standard libraries from urllib.request import ur...
gpl-3.0
-8,988,214,428,498,387,000
34.364807
78
0.51784
false
3.929423
false
false
false
shawncaojob/LC
PY/259_3sum_smaller.py
1
1215
# 259. 3Sum Smaller Add to List # DescriptionHintsSubmissionsSolutions # Total Accepted: 23955 Total Submissions: 58266 Difficulty: Medium Contributor: LeetCode # Given an array of n integers nums and a target, find the number of index triplets i, j, k with 0 <= i < j < k < n that satisfy the condition nums[i] + nums[j...
gpl-3.0
8,614,901,401,143,436,000
28.634146
180
0.499588
false
3.412921
false
false
false
mpasternak/django-flexible-reports
flexible_reports/admin/table.py
1
3373
# -*- encoding: utf-8 -*- from django import forms from django.contrib import admin from django.utils.text import format_lazy from django.utils.translation import ugettext_lazy as _ from flexible_reports.models.table import AllSortOptions, SortInGroup from ..models import Column, ColumnOrder, Table from .helpers impor...
mit
4,332,384,536,891,170,000
29.944954
100
0.576342
false
4.195274
false
false
false
blzq/infer
infer/lib/python/inferlib/capture/buck.py
2
10991
# Copyright (c) 2015 - present Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. from __future__ import ...
bsd-3-clause
-5,515,190,734,831,969,000
40.011194
79
0.587026
false
3.975045
true
false
false
Snuggle/hypixel.py
leveling.py
1
1255
# This is an external library for calculating levels. # It's basically a copy of https://github.com/Plancke/hypixel-php/blob/master/src/util/Leveling.php # But written in Python. from math import sqrt, floor EXP_FIELD = 0 LVL_FIELD = 0 BASE = 10000 GROWTH = 2500 HALF_GROWTH = 0.5 * GROWTH REVERSE_PQ_PREFIX = -(BAS...
mit
8,737,754,293,849,364,000
25.723404
99
0.698805
false
2.740175
false
false
false
McLive/DjangoPowerDNS
dpdns/api_permissions.py
1
1283
# -- # DjangoPowerDNS - A PowerDNS web interface # Copyright (C) 2017 McLive # -- # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU AFFERO General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
agpl-3.0
-7,618,735,445,866,765,000
35.685714
77
0.717849
false
3.911585
false
false
false
kustodian/ansible
lib/ansible/modules/network/f5/bigip_profile_http.py
23
61362
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2018, F5 Networks Inc. # 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', ...
gpl-3.0
-2,387,226,522,644,654,000
33.924303
138
0.611176
false
4.352224
false
false
false
guoruibiao/crosswall
crowall.py
1
1462
# coding:utf-8 import sys reload(sys) sys.setdefaultencoding('utf8') # __author__ = '郭 璞' # __date__ = '2016/10/24' # __Desc__ = 翻墙助手, 默认会先备份一下当前的hosts文件,防止出现意外,另外可以跨平台使用 import platform import os import urllib2 def downloadHosts(url): file = open('./hosts.txt', 'wb') data = urllib2.urlopen(url).rea...
mit
-272,186,543,264,640,670
28.531915
114
0.617435
false
3.140271
false
false
false
ashishbaghudana/relna
relna/preprocessing/edges.py
1
3319
import abc from nala.structures.data import Edge from nltk.stem import PorterStemmer class EdgeGenerator: """ Abstract class for generating edges between two entities. Each edge represents a possible relationship between the two entities Subclasses that inherit this class should: * Be named [Name]E...
mit
1,887,039,554,789,854,200
38.047059
128
0.614944
false
4.260591
false
false
false
webmasterraj/gitrecommender
old_code/mysql.py
1
2335
import MySQLdb import os import sys import urlparse def get_db_variables(): urlparse.uses_netloc.append("mysql") try: # Check to make sure DATABASES is set in settings.py file. # If not default to {} if 'DATABASES' not in locals(): DATABASES = {} if 'CLEARDB_DATA...
mit
9,130,741,594,736,428,000
25.534091
75
0.554176
false
4.284404
false
false
false
duplicati/usage-reporter
dbmodel.py
1
1392
from google.appengine.ext import db class ReportSet(db.Model): setid = db.StringProperty(required=False) uid = db.StringProperty(required=False) ostype = db.StringProperty(required=False) osversion = db.StringProperty(required=False) clrversion = db.StringProperty(required=False) appname = db....
mit
7,266,576,911,102,321,000
32.142857
52
0.73204
false
3.824176
false
false
false
mapillary/OpenSfM
opensfm/actions/export_bundler.py
1
4106
import os import numpy as np from opensfm import io from opensfm.dataset import DataSet def run_dataset(data: DataSet, list_path, bundle_path, undistorted): """Export reconstruction to bundler format. Args: list_path: txt list of images to export bundle_path : output path undistorted...
bsd-2-clause
-2,234,257,134,891,496,000
35.336283
85
0.544325
false
3.662801
false
false
false
przemyslawjanpietrzak/pyMonet
testers/applicative_law_tester.py
1
1646
from pymonet.utils import identity class ApplicativeLawTester: def __init__(self, applicative, value, mapper1, mapper2, get_fn=identity): self.applicative = applicative self.value = value self.mapper1 = mapper1 self.mapper2 = mapper2 self.get_fn = get_fn def _assert(s...
mit
2,922,775,157,642,970,000
29.481481
78
0.59356
false
3.472574
true
false
false
bretttegart/treadmill
integration_tests/test_cell_cli.py
1
5535
""" Integration test for EC2 cell setup. """ import ast import unittest import importlib import click import click.testing from botocore.exceptions import ClientError import time from treadmill.infra import vpc class CellCLITest(unittest.TestCase): """Tests EC2 cell setup.""" def setUp(self): self...
apache-2.0
5,092,826,934,716,075,000
29.245902
75
0.486179
false
3.956397
true
false
false
tkf/factlog
factlog/accessinfo.py
1
2423
# Copyright (c) 2013- Takafumi Arakaki # 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, either version 3 of the # License. # This program is distributed in the hope that it will be usefu...
lgpl-3.0
-1,573,684,291,286,381,800
33.614286
78
0.613289
false
3.889246
false
false
false
chadgates/thetravelling2
wedding/models.py
1
5554
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django.db import models from django.conf import settings from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ from django.core.urlresolvers import reverse import uuid f...
mit
-6,112,628,031,234,148,000
38.956835
115
0.67987
false
3.742588
false
false
false
googleapis/python-recommendations-ai
google/cloud/recommendationengine_v1beta1/services/catalog_service/transports/grpc_asyncio.py
1
18907
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
-2,706,880,795,725,761,000
42.867749
95
0.627545
false
4.688073
false
false
false
uber/pyro
tests/distributions/test_pickle.py
1
3192
# Copyright (c) 2017-2019 Uber Technologies, Inc. # SPDX-License-Identifier: Apache-2.0 import inspect import io import pytest import pickle import torch import pyro.distributions as dist from pyro.distributions.torch_distribution import TorchDistributionMixin from tests.common import xfail_param # Collect distribu...
apache-2.0
-1,041,571,236,107,058,800
37
96
0.657268
false
3.237323
false
false
false
mganeva/mantid
qt/python/mantidqt/widgets/fitpropertybrowser/fitpropertybrowser.py
1
13747
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2017 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source # & Institut Laue - Langevin # SPDX - License - Identifier: GPL - 3.0 + # This file is part of the mantidqt package ...
gpl-3.0
-147,117,974,511,443,840
34.986911
118
0.588419
false
3.874577
false
false
false
abutcher/Taboot
taboot/output.py
1
13108
# -*- coding: utf-8 -*- # Taboot - Client utility for performing deployments with Func. # Copyright © 2009,2011, Red Hat, Inc. # # 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 ...
gpl-3.0
3,304,960,080,265,519,600
29.131034
76
0.547265
false
4.119107
false
false
false
NASLab/GroundROS
src/experimental_results/path_planning_analysis_cost_function.py
1
2102
# python experimental tests for Husky import numpy as np from numpy import sin, cos, pi, zeros # import matplotlib.pyplot as plt def calibration_cost_function(parameters): # print parameters yaw_bounde = 1 * pi / 180 matrix_limits = 20 matrix_resolution = .005 number_of_rows = matrix_limits / ma...
mit
7,422,599,541,884,601,000
40.215686
157
0.528069
false
3.142003
false
false
false
HydrelioxGitHub/home-assistant
homeassistant/components/ring/__init__.py
2
1581
"""Support for Ring Doorbell/Chimes.""" import logging from requests.exceptions import ConnectTimeout, HTTPError import voluptuous as vol from homeassistant.const import CONF_PASSWORD, CONF_USERNAME import homeassistant.helpers.config_validation as cv REQUIREMENTS = ['ring_doorbell==0.2.2'] _LOGGER = logging.getLog...
apache-2.0
-4,661,935,200,043,395,000
27.745455
75
0.665402
false
3.77327
false
false
false
Stemby/ermeSms
ermesms/plugins/uis/GraphicalUI.py
1
2233
# -*- coding: utf-8 -*- import sys import traceback from ermesms.plugins.Sender import Sender from ermesms.PreferenceManager import PreferenceManager from ermesms.plugins.UI import UI class GraphicalUI(UI): """Interfaccia grafica in PyQt.""" MainFrame = None def isAvailable(self): """Ritorna tr...
gpl-2.0
-702,704,519,027,997,300
36.762712
76
0.618492
false
3.694859
false
false
false
eharney/cinder
cinder/tests/unit/keymgr/test_init.py
1
1611
# Copyright (c) 2016 The Johns Hopkins University/Applied Physics Laboratory # 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/...
apache-2.0
-4,147,801,743,415,233,500
36.465116
78
0.673495
false
3.808511
true
false
false
SysCompass/compass-core
compass/hdsdiscovery/hdmanager.py
2
3298
"""Manage hdsdiscovery functionalities""" import os import re import logging from compass.hdsdiscovery import utils class HDManager: """Process a request.""" def __init__(self): base_dir = os.path.dirname(os.path.realpath(__file__)) self.vendors_dir = os.path.join(base_dir, 'vendors') ...
apache-2.0
5,828,995,181,071,411,000
36.908046
78
0.605215
false
4.041667
false
false
false
cuauv/software
vision/framework/bcf/llc.py
1
1364
import numpy as np from scipy.spatial.distance import cdist # ======================================================================== # USAGE: [Coeff]=LLC_coding_appr(B,X,knn,lambda) # Approximated Locality-constraint Linear Coding # # Inputs # B -M x d codebook, M entries in a d-dim space # X ...
bsd-3-clause
9,001,279,566,035,701,000
35.864865
79
0.478006
false
3.085973
false
false
false
bit-bots/bitbots_misc
bitbots_live_tool_rqt/scripts/information_tab.py
1
8120
import sys #from PyQt4 import QtGui, QtCore from status_msg import StatusMsg from single_field import SingleField class InformationTab : def __init__(self, tab_no, field, rolelabel, penaltylabel, hardwarelabel, actionlabel, hideallcheck, targetcheck, \ ballcheck, teammatecheck, opponentcheck, un...
mit
-3,320,580,296,835,911,700
36.767442
131
0.641626
false
4.041812
false
false
false
tgsmith61591/skutil
skutil/h2o/util.py
1
13251
from __future__ import print_function, division, absolute_import import numpy as np import h2o import pandas as pd import warnings from collections import Counter from pkg_resources import parse_version from ..utils import (validate_is_pd, human_bytes, corr_plot, load_breast_cancer_df, load_iris_d...
bsd-3-clause
3,142,361,123,218,995,700
26.838235
89
0.609011
false
3.619503
false
false
false
DavidNorman/tensorflow
tensorflow/python/training/tracking/layer_utils.py
9
11165
# Copyright 2018 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
7,913,808,457,325,581,000
35.486928
80
0.699239
false
4.195791
false
false
false
DouglasLeeTucker/DECam_PGCM
bin/rawdata_clean_relevant_gaiadr2_data.py
1
8174
#!/usr/bin/env python """ rawdata_clean_relevant_gaiadr2_data.py Example: rawdata_clean_relevant_gaiadr2_data.py --help rawdata_clean_relevant_gaiadr2_data.py --inputFile gaiadr2_new_rawdata_rawdata.csv --outputFile gaiadr2_new_y2a1_rawdata.u.csv.tmp --verbose 2 """ ########################...
gpl-3.0
-8,855,762,044,883,070,000
31.436508
146
0.535111
false
2.708416
false
false
false
dlf412/mysql-cdc-redis
cdc_config.py
1
1258
#!/usr/bin/env python # encoding: utf-8 # redis for saving binlog file and position # please reverse the db + 1 for saving mysql changed data redis_url = "redis://127.0.0.1/0" cache_url = "redis://127.0.0.1/1" # mysql server id server_id = 1 # mysql connection setting mysql_settings = {'host': '192.168.1.34', ...
mit
-1,052,136,330,095,489,400
25.208333
69
0.664547
false
3.372654
false
false
false
dimara/synnefo
snf-pithos-backend/pithos/backends/lib/sqlite/permissions.py
10
8486
# Copyright (C) 2010-2014 GRNET S.A. # # 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 program is distributed i...
gpl-3.0
8,818,997,615,140,552,000
34.655462
79
0.56057
false
4.223992
false
false
false
OmnesRes/pan_cancer
paper/cox_regression/KIRC/patient_info.py
1
6241
## A script for extracting info about the patients used in the analysis ## Load necessary modules from rpy2 import robjects as ro import numpy as np import os ro.r('library(survival)') ##This call will only work if you are running python from the command line. ##If you are not running from the command line manually...
mit
3,009,862,005,212,880,400
28.300469
132
0.645089
false
2.936941
false
false
false
timstaley/voeventdb
voeventdb/server/restapi/v1/filters.py
1
9800
from __future__ import absolute_import, unicode_literals from voeventdb.server.database.models import Voevent, Cite, Coord from voeventdb.server.database.query import coord_cone_search_clause import voeventdb.server.restapi.v1.apierror as apierror from voeventdb.server.restapi.v1.filter_base import ( add_to_filter_...
gpl-2.0
-4,847,031,049,909,061,000
28.429429
99
0.579388
false
3.804348
false
false
false
spyoungtech/behave-webdriver
behave_webdriver/fixtures.py
1
6881
""" Provides fixtures to initialize the web driver. """ from behave import fixture, use_fixture from behave_webdriver.utils import _from_string, _from_env from behave_webdriver.driver import BehaveDriverMixin from functools import partial from behave_webdriver import transformers import six _env_webdriver_name = 'env'...
mit
-6,543,961,173,381,331,000
39.476471
216
0.697428
false
4.34681
false
false
false
wenrr89/airtest
airtest/__init__.py
1
3805
#!/usr/bin/env python # -*- coding: utf-8 -*- #coding: utf-8 # #__all__=['devsuit', 'android', 'image', 'base', 'patch', 'ios', 'device'] __version__ = '0.7.2' ANDROID = 'android' IOS = 'ios' WINDOWS='windows' EV_DOWN = 'down' EV_UP = 'up' EV_DOWN_AND_UP = 'down_and_up' import os import json import subprocess impo...
bsd-3-clause
2,023,906,217,956,071,700
28.045802
105
0.600263
false
3.474886
true
false
false
adamreeve/Mendeley-FileSync
mendeleyfilesync.py
1
12774
#!/usr/bin/env python """ Synchronise the location of files in the Mendeley database using a relative base path by storing the locations in a text database that can by synchronised. Currently ignores files outside of the base path. It will also only add new files, it won't clean deleted files. Designed to be used wit...
gpl-3.0
2,736,401,674,511,344,000
30.855362
79
0.584155
false
4.034744
false
false
false
jwlawson/tensorflow
tensorflow/contrib/py2tf/pyct/templates_test.py
3
2534
# Copyright 2017 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
1,456,622,272,616,422,400
31.909091
80
0.619574
false
3.898462
true
false
false
APSL/Impostor
setup.py
1
3564
""" Shamelessly copied from django's setup.py and edited to fit """ from distutils.core import setup from distutils.command.install_data import install_data from distutils.command.install import INSTALL_SCHEMES import os import sys class OsxInstallData(install_data): # On MacOS, the platform-specific lib dir is ...
mit
5,156,180,230,204,205,000
35
104
0.659371
false
3.735849
false
false
false
pysmt/pysmt
pysmt/cmd/check_version.py
1
2366
# Copyright 2014 Andrea Micheli and Marco Gario # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
apache-2.0
-106,857,827,986,260,180
28.949367
79
0.559172
false
3.828479
false
false
false
manannayak/asynq
asynq/scheduler.py
1
10768
# Copyright 2016 Quora, 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 writing, so...
apache-2.0
5,553,038,434,739,204,000
35.255892
118
0.571787
false
4.29004
false
false
false
joaormatos/anaconda
mmfparser/player/shaders/monochrome.py
1
1427
# Copyright (c) Mathias Kaerlev 2012. # This file is part of Anaconda. # Anaconda 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. # ...
gpl-3.0
113,449,716,348,568,350
33
71
0.631395
false
3.735602
false
false
false
jeffmurphy/cif-db
src/cif-registry.py
1
2615
#!/usr/bin/python import sys import zmq import random import time import os import datetime import json import getopt import socket import happybase import hashlib import struct import traceback import re # adjust to match your $PREFIX if you specified one # default PREFIX = /usr/local sys.path.append('/usr/local/li...
bsd-3-clause
-672,101,877,896,776,800
21.543103
103
0.540344
false
3.374194
false
false
false
cfrs7xx/OLD
check.py
1
3089
__author__ = 'tschlein' #Checks for existence of dependencies (executable files, Python modules). #Returns True if all dependencies are present; otherwise, returns False and prints missing files. #TODO add Python modules import sys from os import path import platform #https://docs.python.org/2/library/platform.ht...
bsd-3-clause
-415,552,071,004,011,800
31.526316
135
0.57462
false
4.248968
true
false
false
bertrik/panopt
panopt.py
1
4862
#!/usr/bin/env python # Shows several JPG camera snapshots tiled into a bigger image. # # requires python2, ppython-sdl2 ! # import os import time import sys import ctypes import urllib2 import json from sdl2 import * from sdl2.sdlimage import * from sdl2.sdlttf import * class Camera(object): def __init__(self, ...
mit
-8,617,533,765,445,592,000
29.3875
95
0.602633
false
3.285135
false
false
false
rdevon/cortex
cortex/_lib/utils.py
1
2635
'''Utility methods ''' import logging import os import numpy as np import torch __author__ = 'R Devon Hjelm' __author_email__ = 'erroneus@gmail.com' logger = logging.getLogger('cortex.util') try: _, _columns = os.popen('stty size', 'r').read().split() _columns = int(_columns) except ValueError: _colum...
bsd-3-clause
-2,803,318,686,245,266,000
24.095238
72
0.494118
false
3.32702
false
false
false
xapple/plumbing
plumbing/scraping/__init__.py
1
5761
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Written by Lucas Sinclair. MIT Licensed. Contact at www.sinclair.bio """ # Built-in modules # import os # Internal modules # from plumbing.scraping.headers import make_headers # First party modules # import autopaths from autopaths import Path # Third party module...
mit
-4,436,883,466,183,395,300
34.561728
84
0.541399
false
4.354497
false
false
false
bharathramh92/shop
seller/ranking.py
1
1698
from django.db.models import Q, Sum, Count from store_db.models import SellerFeedback, Inventory, SellerRating def rank_seller_from_inventory(inventory): # call this method if inventory is added/updated or new feedback is received # based on seller_points, return_accepted, local_pickup, free_domestic_shippi...
mit
-2,449,228,980,046,992,000
41.45
129
0.684923
false
3.552301
false
false
false
ipapusha/amnet
tests/test_util.py
1
5635
import numpy as np import amnet import amnet.util import z3 import sys import unittest class TestUtil(unittest.TestCase): @classmethod def setUpClass(cls): pass def test_maxN_z3(self): x = z3.Real('x') y = z3.Real('y') z = z3.Real('z') w1 = amnet.util.maxN_z3([x]...
bsd-3-clause
3,380,758,134,173,479,400
27.459596
79
0.488199
false
2.711742
true
false
false
quatanium/WebSocket-for-Python
example/droid_sensor_cherrypy_server.py
8
2948
# -*- coding: utf-8 -*- import os.path import cherrypy from ws4py.server.cherrypyserver import WebSocketPlugin, WebSocketTool from ws4py.websocket import WebSocket class BroadcastWebSocketHandler(WebSocket): def received_message(self, m): cherrypy.engine.publish('websocket-broadcast', str(m)) cla...
bsd-3-clause
-6,804,676,188,090,151,000
30.361702
131
0.582768
false
3.760204
false
false
false
ZhangXiaoyu-Chief/sandwich
api/views/datacenter.py
1
3535
from api.libs.base import CoreView from cmdb.models import DataCenter from django.contrib.auth.models import User from account.models import UserProfile from django.db.utils import IntegrityError class DataCenterView(CoreView): """ 数据中心视图类 """ login_required_action = ["get_list", "post_create", "post_...
apache-2.0
2,748,276,854,288,054,000
39.011364
125
0.587617
false
4.237064
false
false
false
weegreenblobbie/pith-tool
setup.py
1
1380
""" pith tool A simple command-line tool to execute Python while taking care of the PYTHONPATH. See https://github.com/weegreenblobbie/pith-tool """ from setuptools import setup, Extension # pypi.rst processing with open("pypi.rst") as fd: readme_rst = fd.read() keywords = ''' development command-line...
mit
3,382,690,777,753,286,700
24.109091
81
0.618116
false
3.887324
false
false
false
googleapis/gapic-generator-python
tests/system/test_grpc_lro.py
1
1662
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
-8,864,799,227,039,772,000
34.361702
87
0.685921
false
3.966587
false
false
false
iamahuman/angr
angr/project.py
1
33203
import logging import os import types from io import BytesIO, IOBase import pickle import string from collections import defaultdict import archinfo from archinfo.arch_soot import SootAddressDescriptor, ArchSoot import cle from .misc.ux import deprecated l = logging.getLogger(name=__name__) def load_shellcode(shell...
bsd-2-clause
5,732,707,143,433,387,000
44.17415
141
0.604524
false
4.32838
false
false
false
fnp/wolnelektury
src/dictionary/tests.py
1
1782
# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # from django.core.files.base import ContentFile from catalogue.test_utils import * from catalogue.models import Book class DictionaryTests(WLTestCase): def se...
agpl-3.0
2,932,056,536,525,392,400
34.62
85
0.574958
false
3.431599
false
false
false
adrianpaesani/odoo-argentina
l10n_ar_invoice/models/account_chart_wizard.py
2
5026
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from openerp import models, api import logging _lo...
agpl-3.0
2,503,026,838,618,074,000
37.96124
81
0.524672
false
4.004781
false
false
false
sebastic/QGIS
python/plugins/processing/algs/otb/maintenance/OTBHelper.py
4
29175
# -*- coding: utf-8 -*- """ *************************************************************************** OTBHelper.py --------------------- Copyright : (C) 2013 by CS Systemes d'information (CS SI) Email : otb at c-s dot fr (CS SI) Contributors : Julien Malik (CS SI...
gpl-2.0
5,006,955,171,365,531,000
39.464632
323
0.602639
false
4.028027
false
false
false
WaveBlocks/WaveBlocksND
WaveBlocksND/LimitedHyperbolicCutShape.py
1
10861
"""The WaveBlocks Project This file contains the class for representing the hyperbolic cut basis shape which is a special type of sparse basis set. @author: R. Bourquin @copyright: Copyright (C) 2012, 2013, 2014 R. Bourquin @license: Modified BSD License """ from numpy import eye, vstack, integer from WaveBlocksND....
bsd-3-clause
337,433,239,254,320,450
33.154088
151
0.54286
false
3.940856
false
false
false
davidbgk/udata
udata/mail.py
2
2032
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging from contextlib import contextmanager from blinker import signal from flask import current_app from flask_mail import Mail, Message from udata import theme, i18n log = logging.getLogger(__name__) mail = Mail() mail_sent = signal('mai...
agpl-3.0
5,569,342,784,436,271,000
28.449275
79
0.621555
false
4.189691
false
false
false
vbrown608/csa-match
src/load_data.py
1
1782
import csv import logging import os from models import * import config from google.appengine.ext import ndb from google.appengine.api import search def clearAllData(sample_data=True): """ Clear all CSAs and Sites from the datastore. Clear all documents from the search index. """ logging.info('Clearing data...
gpl-2.0
-3,003,912,828,793,456,600
28.7
124
0.654882
false
3.426923
false
false
false