repo_name
stringlengths
5
92
path
stringlengths
4
221
copies
stringclasses
19 values
size
stringlengths
4
6
content
stringlengths
766
896k
license
stringclasses
15 values
hash
int64
-9,223,277,421,539,062,000
9,223,102,107B
line_mean
float64
6.51
99.9
line_max
int64
32
997
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
13.6
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
yuliang419/TransitInject
SelectStars.py
1
1372
import numpy as np import pandas as pd import glob varcat = pd.read_table('varcat.txt', comment='#', header=0, skip_blank_lines=True, usecols=[0,1,2], dtype={'ID': np.str, 'Campaign': np.str}) all_bad = varcat[(varcat.Class != 'Noise ') & (varcat.Class != 'OTHPER')].ID.values print 'No. of variables & EBs:', len(all_b...
mit
8,945,025,214,746,022,000
39.352941
141
0.68586
false
2.377816
false
false
false
elianerpereira/gtg
GTG/core/tag.py
1
8870
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Getting Things GNOME! - a personal organizer for the GNOME desktop # Copyright (c) 2008-2013 - Lionel Dricot & Bertrand Rousseau # # This program is free software: you can redistribute it and/or modify it under # t...
gpl-3.0
-7,226,432,368,514,454,000
34.198413
79
0.585231
false
3.977578
false
false
false
si618/pi-time
node_modules/grunt-pylint/tasks/lib/pylint/setup.py
1
8012
#!/usr/bin/env python # -*- coding: utf-8 -*- # pylint: disable=W0404,W0622,W0704,W0613 # copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of pylint. # # pylint is free software: you can redistribute it and/or modi...
gpl-3.0
-3,351,072,913,567,827,000
36.971564
81
0.60971
false
4.056709
true
false
false
stverhae/incubator-airflow
airflow/models.py
1
154176
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
-5,065,803,871,369,609,000
34.598245
95
0.56824
false
4.192413
false
false
false
juanjetomas/ProyectoIV
tango_with_django_project/settings.py
1
5074
# -*- coding: utf-8 -*- """ Django settings for tango_with_django_project project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project...
gpl-3.0
-5,689,279,764,999,846,000
31.922078
131
0.678107
false
3.344327
false
false
false
wltribble/frost
frost/jobs/models.py
1
5322
import datetime from django.db import models # Create your models here. class Job(models.Model): jmojobid = models.CharField(db_column='jmoJobID', max_length=20) jmojobassemblyid = models.IntegerField(db_column='jmoJobAssemblyID') jmojoboperationid = models.IntegerField(db_column='jmoJobOperationID') ...
mit
3,704,742,120,640,019,000
37.846715
100
0.561819
false
4.177394
false
false
false
mrtukkin/svm-street-detector
devkit_kitti/simpleExample_transformTestResults2BEV.py
1
2738
#!/usr/bin/env python # # THE KITTI VISION BENCHMARK SUITE: ROAD BENCHMARK # # File: simpleExample_transformTestResults2BEV.py # # Copyright (C) 2013 # Honda Research Institute Europe GmbH # Carl-Legien-Str. 30 # 63073 Offenbach/Main # Germany # # UNPUBLISHED PROPRIETARY MATERIAL. # ALL RIGHTS RESERVED. # # A...
gpl-3.0
-198,113,818,153,973,820
37.56338
150
0.668006
false
3.388614
true
false
false
AsgerPetersen/QGIS
tests/src/python/qgis_wrapped_server.py
1
1882
# -*- coding: utf-8 -*- """ QGIS Server HTTP wrapper This script launches a QGIS Server listening on port 8081 or on the port specified on the environment variable QGIS_SERVER_DEFAULT_PORT .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public Licen...
gpl-2.0
3,059,784,378,658,157,000
31.448276
78
0.662593
false
3.668616
false
false
false
bowenli86/flink
flink-python/pyflink/table/tests/test_pandas_udf.py
1
17797
################################################################################ # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this...
apache-2.0
-214,300,501,997,718,600
43.101737
99
0.569516
false
3.770259
true
false
false
ainestal/awsCostMonitor
server.py
1
10086
#! /usr/bin/env python ################################################# # Tool used for the inventory of ec2 instances # # Author: Alejandro Inestal Garcia ################################################# import sys from datetime import datetime, timedelta, date from boto import boto from boto import ec2 from boto.e...
apache-2.0
-7,839,840,175,918,273,000
35.543478
77
0.543228
false
3.635905
false
false
false
klmitch/vobj
tests/unit/test_version.py
1
3750
# Copyright 2013, 2014 Rackspace # 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 ...
apache-2.0
504,722,415,539,578,240
31.894737
78
0.640267
false
3.694581
true
false
false
pratikmallya/heat
heat/engine/parameters.py
1
21211
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
apache-2.0
-2,833,028,733,621,270,000
35.011885
79
0.567206
false
4.546838
false
false
false
athoik/e2openplugin-OpenWebif
plugin/controllers/BouquetEditor.py
1
25943
# -*- coding: utf-8 -*- #LICENCE # # This File is part of the Webbouqueteditor plugin # and licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported # License if not stated otherwise in a files head. To view a copy of this license, visit # http://creativecommons.org/licenses/by-nc-sa/3.0...
gpl-2.0
1,912,465,130,760,779,300
36.328058
147
0.701307
false
2.998151
false
false
false
luckydonald/teleflask
tests/mixins/test_updates_mixin.py
1
19817
# -*- coding: utf-8 -*- import os import unittest from flask import Flask from luckydonaldUtils.logger import logging from pytgbot.api_types.receivable.updates import Update from teleflask.server.mixins import UpdatesMixin __author__ = 'luckydonald' logger = logging.getLogger(__name__) class Foo(UpdatesMixin): ...
gpl-3.0
-8,611,967,173,884,914,000
42.080435
131
0.619418
false
4.240745
true
false
false
aristanetworks/arista-ovs-nova
nova/image/glance.py
1
16542
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 OpenStack LLC. # 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,677,576,449,627,352,000
34.650862
78
0.612441
false
4.036603
false
false
false
telefonicaid/perseo-fe
test/acceptance/integration/steps_lib/notifications.py
1
5708
# -*- coding: utf-8 -*- # # Copyright 2015 Telefonica Investigación y Desarrollo, S.A.U # # This file is part of perseo-fe # # perseo-fe 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 ...
agpl-3.0
2,059,744,871,296,528,400
52.830189
323
0.705346
false
3.768164
false
false
false
JohnDMcMaster/uvscada
hdd/execute.py
1
2449
''' This file is part of uvscada Licensed under 2 clause BSD license, see COPYING for details ''' import os from temp_file import ManagedTempFile from util import print_debug class Execute: @staticmethod def simple(cmd, working_dir = None): '''Returns rc of process, no output''' print_debug('cmd in: %s' % cm...
bsd-2-clause
-4,866,875,285,770,621,000
25.053191
109
0.622703
false
2.847674
false
false
false
nickbattam/picamon
ui/python/picamon.py
1
2132
import sys import wx import epics.wx prefix = "D100X" def onCameraSelection(event): widget = event.GetEventObject() camera = widget.GetStringSelection() monitor = widget.GetName() epics.caput("%s:%s:CAMERA" % (prefix, monitor),"%s" % camera) app = wx.App() bigfont = wx.Font(24, wx.DECORATIVE, wx.NOR...
apache-2.0
4,449,662,055,564,321,300
27.44
95
0.678236
false
2.705584
false
false
false
betatim/toys
torch.py
1
1045
"""Experiments to get the route of the olympic torch around the UK in 2012""" import json import pprint import urllib import urllib2 events_url = "http://mappingdata.london2012.com/torchevents/byarea" params = {'datasetId': 'TorchRoute-59da3655-1856-4244-b225-38b8420421db', 'top': '61.53228', 'le...
gpl-2.0
-5,435,948,623,251,129,000
26.5
77
0.613397
false
3.082596
false
true
false
apple/swift-lldb
packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCNSError.py
1
1103
# encoding: utf-8 """ Test lldb data formatter subsystem. """ from __future__ import print_function import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil from ObjCDataFormatterTestCase import ObjCDataFormatterTestCase class ObjCDataFormatterNS...
apache-2.0
7,177,021,953,292,547,000
28.810811
79
0.660018
false
3.569579
true
false
false
09zwcbupt/ryu
ryu/app/client.py
1
8456
# Copyright (C) 2011 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2011, 2012 Isaku Yamahata <yamahata at valinux co jp> # # 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 # # h...
apache-2.0
1,208,183,347,595,269,400
33.234818
79
0.619324
false
3.394621
false
false
false
david-zwicker/cv-mouse-burrows
mouse_burrows/hpc/project.py
1
12548
''' Created on Sep 18, 2014 @author: David Zwicker <dzwicker@seas.harvard.edu> ''' from __future__ import division import glob import logging import itertools import os import pprint import time import numpy as np from ..algorithm.parameters import PARAMETERS_DEFAULT from ..simple import load_result_file import vi...
bsd-3-clause
-6,463,845,909,206,971,000
40.140984
95
0.580252
false
4.592972
false
false
false
gpmidi/PyManageMC
manageMC/extern/validators.py
1
1365
#=============================================================================== # This file is part of PyManageMC. # # PyManageMC 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...
gpl-2.0
2,217,896,954,848,864,300
39.363636
94
0.616117
false
3.945087
false
false
false
googleads/google-ads-python
google/ads/googleads/v6/services/services/video_service/client.py
1
17250
# -*- 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 o...
apache-2.0
7,296,838,576,664,361,000
39.116279
106
0.616232
false
4.5647
false
false
false
traai/async-deep-rl
algorithms/policy_based_actor_learner.py
1
6600
# A3C -- unfinished! from actor_learner import * from policy_v_network import * import time class A3CLearner(ActorLearner): def __init__(self, args): super(A3CLearner, self).__init__(args) # Shared mem vars self.learning_vars = args.learning_vars conf_learning...
apache-2.0
8,639,405,443,708,844,000
36.714286
155
0.499697
false
4.130163
false
false
false
crookedreyes/py4e-specialization
course-4/chapter-16/goedata/geoload.py
1
2161
import urllib.request, urllib.parse, urllib.error import http import sqlite3 import json import time import ssl import sys api_key = False #If you have a Google Places API Key, enter it here #api_key = 'AIzaSyASe4zvVBxnhZz6JA5xaBo9odbvTw4s0ro' if api_key is False: serviceurl = "http://py4e-data.dr-chuck.net/geojs...
lgpl-2.1
-9,117,199,243,245,162,000
26.0125
93
0.639519
false
3.430159
false
false
false
bodacea/datasciencefordevelopment
Code_examples/python/twitter_search.py
1
2805
#!/usr/bin/env python """ Simple Twitter tools Expects to find a file, ../../../secrets.txt, with a row containing twitter,overcognition,keys where keys is from Twitter: consumer_key,consumer_secret,oauth_token,oauth_token_secret Lots learnt from http://nbviewer.ipython.org/github/chdoig/Mining-the-Social-Web-2nd-E...
cc0-1.0
-5,945,641,927,377,258,000
30.875
164
0.74902
false
2.9341
false
false
false
brad-h/expy
ExPy/ExPy/module36.py
1
2003
""" Computing Statistic """ from math import sqrt def mean(numbers): """Find the mean using an iterable of numbers Return None if the iterable is empty """ if not numbers: return None total = 0 count = 0 for number in numbers: total += number count += 1 return t...
mit
-7,986,951,487,296,799,000
27.211268
77
0.609586
false
4.289079
false
false
false
leandroloi/bovespa-eod
scrappers/parsers/bovespa_parser.py
1
8300
# -*- coding: utf-8 -*- from decimal import Decimal from datetime import datetime as dt from bs4 import BeautifulSoup as Bs from config import LoggerLoader __author__ = 'leandroloi' __license__ = "GPL" __version__ = "0.0.1" __maintainer__ = "Leandro Loi" __email__ = "leandroloi at gmail dot com" logger = LoggerLoader...
apache-2.0
6,955,723,709,060,317,000
33.635983
113
0.600628
false
2.978769
false
false
false
atiro/nikola
nikola/plugins/template/jinja.py
1
5301
# -*- coding: utf-8 -*- # Copyright © 2012-2016 Roberto Alsina and others. # 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 t...
mit
8,427,954,715,750,795,000
38.552239
84
0.637358
false
4.435146
false
false
false
tipsi/tipsi_tools
django_tests/sampleapp/views.py
1
1401
from tipsi_tools.drf.filters import EnumFilter from tipsi_tools.drf.serializers import EnumSerializer import django_filters from django_filters.rest_framework import DjangoFilterBackend from rest_framework import serializers, viewsets from sampleapp.models import Article, ArticleType, Review class ArticleSerializer(...
mit
868,180,879,155,816,100
25.433962
70
0.723769
false
4.324074
false
false
false
chongyangma/python-scripts
scripts/resize_images.py
1
2138
import os import argparse from PIL import Image def is_image(file_name): if ".png" in file_name or ".jpg" in file_name: return True else: return False def resize_image(input_path, output_path, wd=0, ht=0): img = Image.open(input_path) # Resize the image sz = img.size if wd == 0...
unlicense
8,034,413,576,866,275,000
29.542857
82
0.577643
false
3.162722
false
false
false
Fokko/incubator-airflow
airflow/contrib/operators/discord_webhook_operator.py
1
3763
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
apache-2.0
195,789,183,154,046,400
37.397959
87
0.644433
false
4.453254
false
false
false
googleapis/python-dialogflow
google/cloud/dialogflow_v2beta1/services/versions/transports/base.py
1
8850
# -*- 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
9,023,683,164,300,835,000
36.5
108
0.637966
false
4.151032
false
false
false
marcomanzoni/Matasano-Crypto-Challenges
Set_1/4-detect_single_byte_xor.py
1
1119
def str_xor(s1, s2): # XOR between two strings return "".join([chr(ord(c1) ^ ord(c2)) for (c1,c2) in zip(s1,s2)]) def check_string(string): """ This is a raw function that check if the string is in english I'm too lazy to implement a real string analysis """ letters = "qwertyuiopasdfghjklzxcvbnm,.'?! " ...
mit
6,572,116,880,633,855,000
30.083333
77
0.662198
false
3.152113
false
false
false
chethana-tly/web.py-IIITMKWebportal
model.py
1
1344
import web, datetime,sys try: db=web.database(dbn="sqlite",db="IIITMK.db") except: print "Could not connect to database" sys.exit() def getUsers(): return db.select('IIITMKLogin', order='id DESC') def get_posts(): return db.select('OpinionPoll', order='id DESC') def get_post(id): try: return d...
gpl-2.0
-6,503,835,316,433,896,000
18.2
93
0.684524
false
3.040724
false
false
false
cmkaul/pycles
setup.py
1
10478
from distutils.core import setup from Cython.Build import cythonize from distutils.extension import Extension import numpy as np import mpi4py as mpi4py import sys import platform # Now get include paths from relevant python modules include_path = [mpi4py.get_include()] include_path += [np.get_include()] include_path...
gpl-3.0
8,970,137,964,607,719,000
48.192488
103
0.686581
false
3.759598
false
false
false
slezica/python-log
log.py
1
1337
import logging, sys, blessings from logging import DEBUG, INFO, WARNING, ERROR, CRITICAL colors = True format = '{levelname: <8} {msg}' term = blessings.Terminal() logging.basicConfig() class Logger(logging.Logger): def __init__(self, name, level = DEBUG): super(Logger, self).__init__(name, level) ...
apache-2.0
-2,124,030,761,194,443,500
26.306122
64
0.62528
false
3.724234
false
false
false
dropbox/changes
changes/models/task.py
1
3785
from __future__ import absolute_import import uuid from datetime import datetime from sqlalchemy import Column, DateTime, String, Integer from sqlalchemy.schema import Index, UniqueConstraint from changes.config import db from changes.constants import Result, Status from changes.db.types.enum import Enum from change...
apache-2.0
8,989,402,632,514,417,000
40.141304
87
0.6679
false
3.938606
false
false
false
hzlf/openbroadcast
website/djangorestframework/serializer.py
1
9411
""" Customizable serialization. """ from django.db import models from django.db.models.query import QuerySet from django.db.models.fields.related import RelatedField from django.utils.encoding import smart_unicode, is_protected_type, smart_str import decimal import inspect import types # We register serializer class...
gpl-3.0
109,906,307,048,276,620
29.26045
84
0.597492
false
4.483564
false
false
false
agustinhenze/python-livereload.debian
livereload/watcher.py
1
4921
# -*- coding: utf-8 -*- """ livereload.watcher ~~~~~~~~~~~~~~~~~~ A file watch management for LiveReload Server. :copyright: (c) 2013 - 2015 by Hsiaoming Yang """ import os import glob import time try: import pyinotify except ImportError: pyinotify = None class Watcher(object): """A fil...
bsd-3-clause
-6,375,893,400,489,120,000
27.947059
78
0.545621
false
4.191652
false
false
false
tensorflow/estimator
tensorflow_estimator/python/estimator/canned/timeseries/saved_model_utils.py
1
14941
# 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
-1,760,900,218,535,193,300
48.9699
97
0.698481
false
4.21943
false
false
false
joshlemon/ir-toolkit
time_helper.py
1
2388
#!/usr/bin/env python from __future__ import print_function from datetime import datetime, timedelta import optparse, time __description__ = "Displays current, timeshifted and converts time commonly used by Incident Responders" __author__ = 'Josh Lemon' __version__ = '0.0.1' __date__ = '2017/11/13' """ Source code p...
gpl-3.0
4,893,281,354,453,545,000
30.434211
134
0.670854
false
3.607251
false
false
false
olivierdalang/stdm
data/importexport/__init__.py
1
1051
""" STDM Import/Export module """ __author__ = 'John Gitau' __license__ = 'GNU Lesser General Public License (LGPL)' __url__ = 'http://www.unhabitat.org' from stdm.settings import QGISRegistryConfig from .exceptions import TranslatorException from .reader import OGRReader from .writer import OGRWriter from ...
gpl-2.0
3,011,271,408,934,436,000
23.071429
67
0.67079
false
3.767025
false
false
false
ageis/securedrop
testinfra/app/test_network.py
1
1769
import os import difflib import pytest from jinja2 import Template securedrop_test_vars = pytest.securedrop_test_vars def test_app_iptables_rules(SystemInfo, Command, Sudo): # Build a dict of variables to pass to jinja for iptables comparison kwargs = dict( mon_ip=securedrop_test_vars.mon_ip, ...
agpl-3.0
-3,106,001,536,231,080,000
41.119048
90
0.616167
false
3.948661
true
false
false
rafael-radkowski/ME325
ME325Common/InputHelpers.py
1
2465
import platform import matplotlib if platform.system() == 'Darwin': matplotlib.use("TkAgg") from matplotlib import pyplot as plt from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg from matplotlib.patches import Circle, Arc # tkinter for the display from tkinter import * from tkinter import Canvas fro...
mit
388,792,089,320,666,500
25.223404
122
0.590264
false
3.839564
false
false
false
c-matthews/usample
doublewell_mpi.py
1
2586
# # Samples a 2d double-well distribution using Umbrella sampling in the temperature (parallel version) # # Usage: # > mpirun -np N python gaussian.py # where "N" is the number of cores to run on, e.g. 4 # import usample.usample import numpy as np import emcee # # Sample a 2D Gaussian # # Define the log probability ...
gpl-3.0
-157,891,249,452,561,300
27.417582
134
0.66976
false
2.902357
false
false
false
rockychen-dpaw/gokart
gokart/settings.py
1
4831
import os import dotenv import bottle import re import pytz import subprocess import hashlib import base64 import json import osgeo import datetime import logging import logging.config logging.config.dictConfig({ "version":1, "disable_existing_loggers":False, "handlers":{ "default":{ "c...
apache-2.0
-4,441,077,460,345,735,700
30.993377
190
0.640033
false
3.233601
false
false
false
dtkav/naclports
build_tools/update_mirror.py
1
2740
#!/usr/bin/env python # Copyright (c) 2011 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Script to synchronise the naclports mirror of upstream archives. This script verifies that the URL for every package is mi...
bsd-3-clause
-1,911,032,501,664,631,800
28.462366
80
0.685766
false
3.600526
false
false
false
noslenfa/tdjangorest
uw/lib/python2.7/site-packages/IPython/utils/io.py
1
9432
# encoding: utf-8 """ IO related utilities. """ #----------------------------------------------------------------------------- # Copyright (C) 2008-2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as part of this software....
apache-2.0
6,904,904,059,064,328,000
29.327974
80
0.570293
false
4.338546
false
false
false
tensorflow/gan
tensorflow_gan/examples/cyclegan/train.py
1
2670
# coding=utf-8 # Copyright 2020 The TensorFlow GAN Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
apache-2.0
-3,210,494,446,350,277,000
38.264706
78
0.697378
false
3.734266
false
false
false
simlay/djangocassandra
djangocassandra/db/backends/cassandra/utils.py
1
7045
import sys from functools import ( cmp_to_key, wraps ) from django.db.utils import DatabaseError from django.db.models.sql.where import ( WhereNode, AND, OR ) def safe_call(func): @wraps(func) def _func(*args, **kwargs): try: return func(*args, **kwargs) exce...
bsd-3-clause
4,500,175,885,635,032,000
27.18
92
0.56494
false
3.870879
false
false
false
kyuupichan/electrumx
electrumx/server/storage.py
1
4979
# Copyright (c) 2016-2017, the ElectrumX authors # # All rights reserved. # # See the file "LICENCE" for information about the copyright # and warranty status of this software. '''Backend database abstraction.''' import os from functools import partial import electrumx.lib.util as util def db_class(name): '''R...
mit
6,445,479,968,695,918,000
27.451429
76
0.584856
false
4.097942
false
false
false
home-assistant/home-assistant
homeassistant/components/climacell/__init__.py
1
12204
"""The ClimaCell integration.""" from __future__ import annotations from datetime import timedelta import logging from math import ceil from typing import Any from pyclimacell import ClimaCellV3, ClimaCellV4 from pyclimacell.const import CURRENT, DAILY, FORECASTS, HOURLY, NOWCAST from pyclimacell.exceptions import ( ...
apache-2.0
6,926,616,141,516,376,000
31.983784
92
0.547362
false
3.919075
true
false
false
sunchuanleihit/vimrc
sources_non_forked/YouCompleteMe/python/ycm/tests/youcompleteme_test.py
1
19119
# Copyright (C) 2016-2017 YouCompleteMe contributors # # This file is part of YouCompleteMe. # # YouCompleteMe 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...
mit
-1,801,019,579,403,737,600
34.274908
80
0.624248
false
3.539245
true
false
false
arunkgupta/gramps
gramps/gen/lib/name.py
1
17188
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2007 Donald N. Allingham # Copyright (C) 2010 Michiel D. Nauta # Copyright (C) 2011 Tim G L Lyons # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as publi...
gpl-2.0
4,194,887,345,256,668,700
33.583501
80
0.574471
false
4.247097
false
false
false
s0lst1c3/eaphammer
local/hostapd-eaphammer/tests/hwsim/remotehost.py
1
3339
# Host class # Copyright (c) 2016, Qualcomm Atheros, Inc. # # This software may be distributed under the terms of the BSD license. # See README for more details. import logging import subprocess import threading logger = logging.getLogger() def remote_compatible(func): func.remote_compatible = True return fu...
gpl-3.0
-4,659,982,545,662,266,000
29.916667
101
0.563043
false
3.790011
false
false
false
oche-jay/vEQ-benchmark
videoInput/genericPlayback.py
1
6041
''' Created on 28 Aug 2015 @author: oche ''' import shlex import subprocess import os import sys import time import traceback from subprocess import PIPE import psutil import logging import database.vEQ_database as DB from psutil import NoSuchProcess class GenericPlayback(object): ''' ''' def __init__...
gpl-2.0
-7,559,719,382,388,129,000
33.52
137
0.536004
false
4.079001
false
false
false
LabKey/labkey-api-python
labkey/api_wrapper.py
1
1256
from .container import ContainerWrapper from .domain import DomainWrapper from .experiment import ExperimentWrapper from .query import QueryWrapper from .security import SecurityWrapper from .server_context import ServerContext class APIWrapper: """ Wrapper for all of the supported API methods in the Python C...
apache-2.0
1,752,551,167,606,577,000
32.052632
97
0.657643
false
4.422535
false
false
false
kyleaclark/fantasy-football-stats
src/summary_stats.py
1
3615
from __future__ import division class SummaryStats(): def __init__(self, players_stats, cost_baseline, sample_size, sample_trim): self.players_stats = players_stats self.cost_baseline = cost_baseline self.sample_size = sample_size self.sample_trim = sample_trim self.sample_...
mit
4,851,050,022,715,396,000
47.2
96
0.609959
false
3.227679
false
false
false
bryant/pytoml
tests/test_samples.py
1
1140
from datetime import datetime as dt from nose.tools import raises, assert_equal from pyparsing import ParseException import os import pytoml TOMLS = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'tomlfiles') def test_toml_files(): for filename in os.listdir(TOMLS): abs = os.path.join(TOMLS, fil...
mit
-2,537,635,056,877,533,700
26.804878
78
0.551754
false
3.812709
false
false
false
CodeHuntersLab/RaspberryPi
WEB/Raspberry/Raspberry/settings.py
1
3799
""" Django settings for Raspberry project. Generated by 'django-admin startproject' using Django 1.10.5. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import ...
gpl-3.0
-3,167,125,342,339,473,400
26.338129
91
0.680969
false
3.4287
false
false
false
iakinsey/websvc
websvc/http.py
1
4103
from cgi import FieldStorage from functools import wraps from gevent.wsgi import WSGIServer from inspect import getargspec from json import dumps, loads from json.decoder import JSONDecodeError from os import mkdir, listdir from sys import argv from traceback import print_exc from websvc.error import ServiceError from ...
mit
6,394,400,059,318,066,000
28.307143
77
0.580307
false
4.165482
false
false
false
facemelters/data-science
Atlas/PyTagPredict.py
1
7282
import numpy as np import pandas as pd import urllib2 from sklearn import linear_model from sklearn import metrics from sklearn import cross_validation from bs4 import BeautifulSoup def get_tag_name(tag_url): """Takes a Atlas Obscura db dump and turns the tag_url into bare tags.""" return tag_url.split('/')[2...
gpl-2.0
-7,126,805,089,603,168,000
43.133333
159
0.687037
false
3.881663
false
false
false
bureaucratic-labs/yargy
yargy/tokenizer.py
1
3249
import re from .record import Record from .check import assert_type from .span import Span from .token import Token class TokenRule(Record): __attributes__ = ['type', 'pattern'] def __init__(self, type, pattern): self.type = type self.pattern = pattern RUSSIAN = 'RU' LATIN = 'LATIN' INT =...
mit
-6,850,845,037,825,914,000
24.571429
67
0.532278
false
3.349272
false
false
false
RDelg/OF-BW-Control
tests/rest/rest.py
1
4539
import json import logging from webob import Response from ryu.app.simple_switch_13 import SimpleSwitch13 from ryu.controller import ofp_event from ryu.controller.handler import MAIN_DISPATCHER, CONFIG_DISPATCHER, DEAD_DISPATCHER from ryu.controller.handler import set_ev_cls from ryu.app.wsgi import ControllerBase, WS...
apache-2.0
-1,512,734,908,499,737,000
37.151261
108
0.635162
false
3.279624
false
false
false
rustychris/stompy
stompy/plot/stream_quiver.py
1
14879
""" A quiver plot for flow defined an unstructured grid. Each arrow follows the local streamlines, and the spacing between arrows is maintained to avoid overlap. It's slow. """ import matplotlib.pyplot as plt from matplotlib import collections import numpy as np from shapely import geometry from .. import utils from...
mit
-1,626,022,497,427,312,000
35.114078
116
0.536461
false
3.811219
false
false
false
ziirish/burp-ui
burpui/plugins.py
1
2642
# -*- coding: utf8 -*- """ .. module:: burpui.plugins :platform: Unix :synopsis: Burp-UI plugins module. .. moduleauthor:: Ziirish <hi+burpui@ziirish.me> """ from pluginbase import PluginBase class PluginManager(object): """The :class:`burpui.plugins.PluginManager` class is a plugin manager. :param...
bsd-3-clause
2,919,954,743,151,574,000
32.025
88
0.517033
false
4.275081
false
false
false
demisto/content
Packs/RubrikPolaris/Scripts/RubrikSonarOpenAccessFiles/RubrikSonarOpenAccessFiles.py
1
1093
import demistomock as demisto # noqa: F401 from CommonServerPython import * def main() -> None: ORANGE_HTML_STYLE = "color:#FF9000;font-size:250%;>" GREEN_HTML_STYLE = "color:#00CD33;font-size:275%;>" RED_HTML_STYLE = "color:#FF1744;font-size:275%;>" DIV_HTML_STYLE = "display:block;text-align:center...
mit
-2,968,843,634,906,038,300
33.15625
119
0.616651
false
3.140805
false
false
false
jmlopez-rod/excentury
excentury/core/dump_text.py
1
3301
"""Dump Text Interface designed to dump text files. """ import ctypes from six.moves import cStringIO as StringIO from excentury.core import XCStruct, XC_TYPES, CTYPES from excentury.core import Communicator, data, xc_type, c_type CHAR_MAP = { 'C': '%c', 'I': '%d', 'N': '%d', 'R': '%f' } class Tex...
bsd-2-clause
5,742,389,008,093,965,000
28.212389
70
0.503787
false
3.671858
false
false
false
BamaComputationalBiology/DecisionTree
blobology_and_kraken/mate_rebuild.py
1
1250
import sys # for mate-pair FASTQ files: @N_NNN...._1/2 # python mate_rebuild.py original.fq tokeep.readids new.fq def main(fastq, idlist, fqout): ids = [] with open(idlist) as idl: for line in idl: ids.append(line.strip()) ids = set(ids) with open(fastq) as fq: with open(fq...
gpl-3.0
1,826,321,311,681,850,600
32.810811
58
0.4376
false
4.019293
false
false
false
googleapis/googleapis-gen
google/ads/googleads/v6/googleads-py/google/ads/googleads/v6/services/services/user_data_service/transports/grpc.py
1
10092
# -*- 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,421,154,759,062,385,700
43.069869
112
0.606322
false
4.755891
false
false
false
AASHE/hub
hub/apps/content/management/commands/import_green_funds.py
1
4694
import os.path import sys import csv from datetime import datetime from django.contrib.auth import get_user_model from django.core.management.base import BaseCommand from django.utils import timezone from hub.apps.content.types.green_funds import GreenFund from hub.apps.content.models import Website from hub.apps.met...
mit
2,540,050,499,238,742,000
34.293233
111
0.455901
false
4.675299
false
false
false
pkittenis/parallel-ssh
pssh/clients/base/single.py
1
24554
# This file is part of parallel-ssh. # # Copyright (C) 2014-2020 Panos Kittenis. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation, version 2.1. # # This library is distributed in the hope...
lgpl-2.1
-6,584,277,884,791,919,000
35.002933
98
0.583367
false
4.296413
false
false
false
pLeBlanc93/ArcREST
ArcGIS Desktop Installer/Install_ArcRest/Tools/Scripts/install_arcrest.py
1
8662
from __future__ import print_function import os import sys import arcpy import glob import shutil import zipfile import inspect def zipws(path, zip, keep): path = os.path.normpath(path) # os.walk visits every subdirectory, returning a 3-tuple # of directory name, subdirectories in it, and file names #...
apache-2.0
3,637,562,357,802,253,300
41.669951
110
0.567421
false
3.687527
false
false
false
UTSA-ICS/python-keystoneclient-SID
keystoneclient/v3/projects.py
1
3582
# Copyright 2011 OpenStack Foundation # Copyright 2011 Nebula, Inc. # 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/...
apache-2.0
4,274,267,540,103,671,300
33.442308
78
0.636237
false
4.326087
false
false
false
stephanh42/rpigl
rpigl/glesutils.py
1
33137
""" Utility functions that lightly wrap some GL functionality. Also interaction with pygame. """ from . import gles2 from .rpi_egl import create_opengl_window import ctypes import pygame import numpy import re from operator import attrgetter from functools import partial from .lazycall import LazyAttr import contextli...
mit
-7,421,236,503,554,549,000
33.021561
148
0.613996
false
3.647842
false
false
false
gsobczyk/hamster
src/hamster-cli.py
1
19134
#!/usr/bin/env python3 # - coding: utf-8 - # Copyright (C) 2010 Matías Ribecky <matias at mribecky.com.ar> # Copyright (C) 2010-2012 Toms Bauģis <toms.baugis@gmail.com> # Copyright (C) 2012 Ted Smith <tedks at cs.umd.edu> # This file is part of Project Hamster. # Project Hamster is free software: you can redistribut...
gpl-3.0
-2,095,729,125,164,108,800
35.651341
117
0.596174
false
3.955344
false
false
false
kinow-io/kinow-python-sdk
kinow_client/models/director_1.py
1
8069
# coding: utf-8 """ Server API Reference for Server API (REST/Json) OpenAPI spec version: 1.4.41 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re class Director1(object): """ NOTE: This class is auto g...
apache-2.0
-6,733,202,937,109,218,000
26.077181
168
0.559797
false
4.342842
false
false
false
awagner83/datatype
datatype/validation.py
1
2957
"""Datatype validation.""" __all__ = ['failures', 'is_valid'] from collections import defaultdict from datatype.tools import Choice, Literal, walk def is_valid(datatype, value): """Return boolean representing validity of `value` against `datatype`.""" return not failures(datatype, value) def failures(dat...
bsd-3-clause
7,327,919,305,759,069,000
28.868687
78
0.563409
false
4.02861
false
false
false
emreg00/biana
biana/BianaDB/BianaDatabase.py
2
72369
from database import Database,TableDB,FieldDB import biana.BianaObjects class BianaDatabase(Database): externalEntityID_col = "externalEntityID" external_entity_relation_id_col = "externalEntityRelationID" externalEntityID_col_type = "integer(4) unsigned" externalDatabaseID_col = "externalDatabaseID...
gpl-3.0
-7,779,038,974,572,250,000
78.091803
448
0.356534
false
6.536808
false
false
false
Emory-LCS/Alma-Public
URL_Checker/checkurl.py
1
10304
#!/usr/bin/env python # -*- coding: utf-8 -*- """ checkurl.py reads from standard input a text file that contains URLs; it performs an HTTP GET to test the URL and it writes the result to standard output. input line format: URL_|_record_id_|_resource_type output line format: HTTP/1.1_|_return_code_|_respons...
gpl-3.0
-8,854,454,301,588,113,000
39.793651
115
0.583755
false
3.674053
false
false
false
tejasgodambe/knowledge-distillation
average_DNN_predictions.py
1
3162
#!/usr/bin/python3 #import tensorflow as tf #gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction=0.3) ## Configure the fraction here #sess = tf.Session(config=tf.ConfigProto(gpu_options=gpu_options)) import keras import keras.backend as K #K.set_session(sess) import numpy as np from subprocess import Popen, ...
gpl-3.0
-8,414,017,721,316,522,000
32.284211
114
0.634092
false
3.011429
false
false
false
collab-project/django-require-i18n
setup.py
1
1766
# Copyright Collab 2015-2019 # See LICENSE for details. from setuptools import setup from require_i18n import version test_deps = [ "tox", "coverage", "flake8", "translate-toolkit" ] setup( name="django-require-i18n", version=version, license="MIT", description="Django management com...
mit
4,994,351,886,444,305,000
27.483871
73
0.582106
false
3.90708
false
false
false
Azure/azure-sdk-for-python
sdk/tables/azure-data-tables/samples/async_samples/sample_authentication_async.py
1
4299
# 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. # --------------------------------------------------------------------...
mit
-1,081,276,698,443,802,200
41.99
132
0.681786
false
4.368902
false
false
false
ZhuangER/robot_path_planning
scripts/genetic_algorithm.py
1
7646
# genetic algorithm from collision_detect import collision_detect import random from math import sqrt from random import randint import os from xmlreader import XMLReader import numpy as np from numpy import array, cos, dot, fabs, lexsort, pi, sin, sqrt, vstack def individual (length, start, goal, range_min = None, ra...
mit
-6,721,060,067,018,179,000
32.539474
158
0.599268
false
3.772077
false
false
false
havatv/QGIS
python/plugins/processing/algs/qgis/Relief.py
1
7676
# -*- coding: utf-8 -*- """ *************************************************************************** Relief.py --------------------- Date : December 2016 Copyright : (C) 2016 by Alexander Bruy Email : alexander dot bruy at gmail dot com *****************...
gpl-2.0
-1,714,714,753,598,306,800
42.862857
117
0.521105
false
5.197021
false
false
false
deepmind/chex
chex/_src/fake_test.py
1
10882
# Copyright 2020 DeepMind Technologies Limited. 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 ...
apache-2.0
-4,382,896,258,296,995,300
33.656051
99
0.636372
false
3.278698
true
false
false
pkom/gesiesweb
gesiesweb/partes/migrations/0001_initial.py
1
2174
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.utils.timezone import model_utils.fields class Migration(migrations.Migration): dependencies = [ ('profesores', '0001_initial'), ('alumnos', '0001_initial'), ] operatio...
gpl-3.0
5,695,987,629,069,871,000
42.48
147
0.580497
false
4.27112
false
false
false
suizokukan/gmastix
gmastix/gmastix.py
1
360067
#!/usr/bin/python3 # -*- coding: utf-8 -*- ################################################################################ # Gmastix Copyright (C) 2016 Suizokukan # Contact: suizokukan _A.T._ orange dot fr # # This file is part of Gmastix. # Gmastix is free software: you can redistribute it and/or modify #...
gpl-3.0
4,985,335,392,615,813,000
38.912897
100
0.382059
false
4.713468
false
false
false
xiaom-GitHub/openthread
tests/scripts/thread-cert/node.py
1
9201
#!/usr/bin/env python # # Copyright (c) 2016, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # ...
bsd-3-clause
5,362,835,983,402,423,000
33.720755
114
0.684926
false
3.798927
false
false
false
uw-it-aca/myuw
myuw/test/views/test_link.py
1
2004
# Copyright 2021 UW-IT, University of Washington # SPDX-License-Identifier: Apache-2.0 from unittest import skipIf from django.urls import reverse from django.test import Client from django.test.utils import override_settings from myuw.models import VisitedLinkNew from myuw.views.link import outbound_link from myuw.te...
apache-2.0
5,223,492,878,582,563,000
40.75
78
0.62475
false
3.408163
true
false
false
jrxFive/python-nomad
nomad/api/deployment.py
1
6500
import nomad.api.exceptions from nomad.api.base import Requester class Deployment(Requester): """ The /deployment endpoints are used to query for and interact with deployments. https://www.nomadproject.io/docs/http/deployments.html """ ENDPOINT = "deployment" def __init__(self, **kwargs): ...
mit
-2,383,278,774,705,577,000
38.393939
119
0.609846
false
4.526462
false
false
false
justincely/cos_monitoring
cosmo/sms/ingest_sms.py
1
11809
import os import datetime import glob import re import pandas as pd from typing import Union from itertools import repeat from peewee import chunked, OperationalError, EXCLUDED from .sms_db import SMSFileStats, SMSTable, DB from .. import SETTINGS SMS_FILE_LOC = SETTINGS['sms']['source'] class SMSFile: """Clas...
bsd-3-clause
-922,822,275,241,079,000
38.232558
119
0.571005
false
3.586092
false
false
false
tuliren/telomere_fusion_analyzer
fusion/2013-03-08 filter.py
1
1305
#!/usr/local/bin/python import re import sys import os # Parameter 1: target, either "all" or in the form of "BRCA00XX" # Parameter 2: option, either "stat" or "fastq" # E.g. python filter.py BRCA0001 stat # python filter.py BRCA0001 fastq # python filter.py all stat # python filter.py all fastq def Fi...
mit
-6,047,840,180,482,315,000
30.071429
87
0.577778
false
3.175182
false
false
false
cjparsons74/kupfer
kupfer/plugin/locate.py
1
2380
__kupfer_name__ = _("Locate Files") __kupfer_actions__ = ( "Locate", ) __description__ = _("Search filesystem using locate") __version__ = "" __author__ = "Ulrik Sverdrup <ulrik.sverdrup@gmail.com>" import os import subprocess from kupfer.objects import Action, Source, Leaf from kupfer.objects import TextLeaf, Fil...
gpl-3.0
8,679,003,665,828,420,000
28.75
77
0.689496
false
3.024142
false
false
false
fabioz/PyDev.Debugger
_pydevd_bundle/pydevd_comm.py
1
73085
''' pydevd - a debugging daemon This is the daemon you launch for python remote debugging. Protocol: each command has a format: id\tsequence-num\ttext id: protocol command number sequence-num: each request has a sequence number. Sequence numbers originating at the debugger are odd, sequence numbers ori...
epl-1.0
7,786,833,665,012,992,000
39.715877
162
0.582431
false
4.04903
false
false
false
mikesun/xen-cow-checkpointing
tools/python/xen/xend/XendAPIConstants.py
1
1739
#============================================================================ # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distributed in the hope th...
gpl-2.0
-2,570,926,505,962,664,400
30.053571
77
0.59747
false
3.409804
false
false
false
prasanna08/oppia
core/storage/email/gae_models.py
1
21259
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
apache-2.0
51,719,486,313,912,840
37.582577
80
0.632485
false
4.073386
false
false
false
omaciel/robottelo
robottelo/cli/subscription.py
1
2306
# -*- encoding: utf-8 -*- """ Usage:: hammer sunscription [OPTIONS] SUBCOMMAND [ARG] ... Parameters:: SUBCOMMAND subcommand [ARG] ... subcommand arguments Subcommands:: delete-manifest Delete manifest from Red Hat provider list ...
gpl-3.0
-6,429,293,332,148,503,000
30.162162
75
0.591067
false
4.696538
false
false
false