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
infosec-216/alice
vk_filter.py
1
12539
import logging import time import cStringIO from PIL import Image from libmproxy.protocol.http import decoded import re import urllib # Russian messages support from sets import Set logging.basicConfig(filename="/root/mitm.log",level=logging.DEBUG) class VK_user: def __init__(self): self.id = "" ...
mit
-4,966,170,004,822,145,000
34.622159
157
0.490709
false
3.240052
false
false
false
sjsucohort6/openstack
python/venv/lib/python2.7/site-packages/openstackclient/common/quota.py
1
7859
# Copyright 2012 OpenStack Foundation # # 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 ...
mit
-5,707,946,925,653,465,000
33.169565
77
0.56254
false
4.236658
false
false
false
marcosxddh/aula_script
backend/appengine/routes/books/rest.py
1
1044
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from gaebusiness.business import CommandExecutionException from tekton.gae.middleware.json_middleware import JsonResponse from book_app import facade def index(): cmd = facade.list_books_cmd() book_list = cmd() short_form=fac...
mit
2,769,724,432,939,574,300
27.216216
67
0.704981
false
3.356913
false
false
false
abhishek-ram/pyas2
pyas2/management/commands/cleanas2server.py
1
3094
from django.core.management.base import BaseCommand from django.utils.translation import ugettext as _ from datetime import timedelta from django.utils import timezone from pyas2 import models from pyas2 import pyas2init import os import glob class Command(BaseCommand): help = _(u'Automatic maintenance for the AS...
gpl-2.0
1,272,911,551,532,576,500
42.577465
79
0.555268
false
4.273481
false
false
false
tuskar/tuskar-ui
openstack_dashboard/test/test_data/nova_data.py
1
22432
# Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
apache-2.0
3,151,234,665,979,034,000
37.476844
79
0.471113
false
3.967457
true
false
false
andela-ggikera/photo-editing-app
editor/photo_effects.py
1
3217
"""Define imports.""" from PIL import ImageFilter, ImageOps, ImageEnhance def grayscale(image, name, temp_url): """Return an image with a contrast of grey.""" image.seek(0) photo = ImageOps.grayscale(image) photo.save(temp_url + "GRAYSCALE" + name) return temp_url + "GRAYSCALE" + name def smooth...
mit
837,746,076,482,372,200
27.981982
74
0.646254
false
3.081418
false
false
false
ramineni/myironic
ironic/common/image_service.py
1
2467
# Copyright 2010 OpenStack Foundation # Copyright 2013 Hewlett-Packard Development Company, L.P. # 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 # # ht...
apache-2.0
-1,234,819,432,871,128,000
36.378788
78
0.633158
false
4.32049
false
false
false
nuanri/hiblog
src/app/blog/console_views.py
1
17946
# coding: utf-8 import json import requests from hanlder import RequestHandler as BaseRequestHandler import tornado.web from tornado.web import authenticated from ..utils import deal_errors, get_local_time, get_local_time_string from .forms import BlogWriterForm, BlogCatalogWriterForm class RequestHandler(BaseRequ...
mit
4,445,130,281,428,235,300
25.143275
116
0.546919
false
3.626445
false
false
false
saisankargochhayat/algo_quest
leetcode/430.FlatternADoubleLinkedList/soln.py
1
1710
""" # Definition for a Node. class Node: def __init__(self, val, prev, next, child): self.val = val self.prev = prev self.next = next self.child = child """ class Solution: def flatten(self, head: 'Node') -> 'Node': start = head head = head while head != ...
apache-2.0
319,589,736,364,629,700
32.529412
106
0.533918
false
4.407216
false
false
false
AdiPersonalWorks/ATOS_GOM_SystemPrototyping
pico/auth.py
1
1890
import pico from pico import PicoError class NotAuthorizedError(PicoError): def __init__(self, message=''): PicoError.__init__(self, message) self.response.status = "401 Not Authorized" self.response.set_header("WWW-Authenticate", "Basic") class InvalidSessionError(PicoError): def _...
mit
5,647,580,370,093,337,000
32.75
72
0.589947
false
3.970588
false
false
false
tedunderwood/horizon
chapter3/code/reproduce_fictional_prestige.py
1
7078
#!/usr/bin/env python3 # reproduce_fictional_prestige.py # Scripts to reproduce models # used in Chapter Three, # The Directions of Literary Change. import csv, os, sys, pickle, math # we add a path to be searched so that we can import # versatiletrainer, which will do most of the work # Versatiletrainer, and the m...
mit
5,076,962,015,525,809,000
38.541899
275
0.658519
false
3.556784
false
false
false
defstryker/Hex-Omega
users/Xav/views.py
1
2547
from users.views import * from .add_leader_form import * from django.db.utils import IntegrityError def create_leader_user(request, username): form = LeaderForm() if request.method == 'POST': form = LeaderForm(request.POST) if form.is_valid(): username = request.POST.get('usernam...
mit
4,510,525,064,045,254,000
41.45
116
0.599136
false
3.918462
false
false
false
jal-stats/django
jal_stats/jal_stats/urls.py
1
1604
"""jal_stats URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-b...
mit
5,263,043,419,280,896,000
33.869565
77
0.650873
false
3.893204
false
false
false
3L3N4/Egress-Assess
common/orchestra.py
1
1550
''' This is the conductor which controls everything ''' import glob import imp from protocols.servers import * from protocols.clients import * from datatypes import * class Conductor: def __init__(self): # Create dictionaries of supported modules # empty until stuff loaded into them se...
gpl-3.0
3,691,353,084,157,195,300
35.046512
97
0.610968
false
4.015544
false
false
false
smallyear/linuxLearn
salt/salt/utils/process.py
1
11798
# -*- coding: utf-8 -*- # Import python libs from __future__ import absolute_import import os import sys import time import types import signal import subprocess import logging import multiprocessing import threading # Import salt libs import salt.defaults.exitcodes import salt.utils # Import 3rd-party libs import ...
apache-2.0
-4,748,247,303,098,665,000
31.955307
99
0.544075
false
4.348691
false
false
false
grueni75/GeoDiscoverer
Source/Platform/Target/Android/core/src/main/jni/gdal-3.2.1/swig/python/scripts/gdal2tiles.py
1
134939
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # ****************************************************************************** # $Id: gdal2tiles.py d712a530aa1b0dabf9717dd935996dd7b9fd8ced 2020-11-15 15:12:13 +0100 Even Rouault $ # # Project: Google Summer of Code 2007, 2008 (http://code.google.com/soc/) # Support: ...
gpl-3.0
3,414,157,871,314,064,000
40.622147
407
0.542697
false
3.807212
false
false
false
mespinozas/si
t3/t3loader.py
1
1118
import threading import logging import time import os logging.basicConfig( level=logging.DEBUG, format='[%(levelname)s] - %(threadName)-10s : %(message)s') def worker(x): logging.debug('Lanzado') importer = 'bin/mallet import-svmlight --input archivoEntrenamiento%s.txt --output training%s.mallet' % (x,x) ...
gpl-2.0
-8,920,960,298,645,710,000
30.942857
168
0.669946
false
3.259475
false
false
false
AndrewGoldstein/grasshopper
grasshopper/public/views.py
1
2732
# -*- coding: utf-8 -*- """Public section, including homepage and signup.""" from flask import Blueprint, flash, redirect, render_template, request, url_for, g from flask_login import login_required, login_user, logout_user from grasshopper.extensions import login_manager from grasshopper.public.forms import LoginForm...
bsd-3-clause
-4,215,876,279,390,760,000
30.77907
113
0.635798
false
3.571242
false
false
false
nikhila05/MicroSite
micro_blog/migrations/0001_initial.py
1
4172
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import datetime from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ m...
gpl-2.0
-10,623,089,563,571,604
39.901961
142
0.529003
false
4.386961
false
false
false
alphagov/notifications-api
migrations/versions/0083_add_perm_types_and_svc_perm.py
1
2344
"""empty message Revision ID: 0083_add_perm_types_and_svc_perm Revises: 0082_add_go_live_template Create Date: 2017-05-12 11:29:32.664811 """ # revision identifiers, used by Alembic. revision = '0083_add_perm_types_and_svc_perm' down_revision = '0082_add_go_live_template' from alembic import op import sqlalchemy as...
mit
-4,852,084,235,956,907,000
43.226415
115
0.579352
false
4.193202
false
false
false
lidaobing/itcc
itcc/ccs2/solvent_caflisch.py
1
3718
import pkg_resources import math from itcc import tools ff_cache = {} caflisch_dat = None r_probe = 1.4 pij_bonded = 0.8875 pij_nonbonded = 0.3516 class Caflisch(object): def __init__(self, data): self.data = data assert len(self.data) == 5 def _r_min(self): return self.data[1] ...
gpl-3.0
-5,666,795,548,658,434,000
26.746269
80
0.537924
false
3.191416
false
false
false
anaoaktree/vcgen
vcgen/test.py
1
1786
# Copyright (c) 2011, Jay Conrod. # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and ...
mit
-2,567,668,676,885,615,600
54.8125
83
0.758679
false
4.544529
true
false
false
Yubico/yubiadmin-dpkg
yubiadmin/config.py
1
2301
# Copyright (c) 2013 Yubico AB # 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 # notice, this list of conditi...
bsd-2-clause
-259,948,468,104,190,900
32.838235
71
0.720991
false
4.065371
false
false
false
jdelgad/IRefuse
irefuse/irefuse.py
1
6388
# -*- encoding: UTF-8 -*- """ 'I Refuse' web application. Copyright (C) 2017 Jacob Delgado 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...
agpl-3.0
-3,449,111,402,710,158,300
35.090395
77
0.588134
false
4.150747
false
false
false
flyingSprite/spinelle
task_inventory/order_1_to_30/order_16_use_faker.py
1
2553
""" Order 16: Use faker in python. Generate lots of kinds data with Faker * User information """ from faker import Faker, Factory class FakerGenerator(object): """Generate different data by this class.""" fake = None def __init__(self, language=None): if language: self.fake = Factor...
mit
3,729,536,303,053,445,000
27.685393
99
0.596553
false
3.62642
false
false
false
Victory/realpython-tdd
contacts/user_contacts/views.py
1
1864
from django.shortcuts import ( render, render_to_response) from django.template import RequestContext from django.http import HttpResponseRedirect, HttpResponse from django.views.generic import DetailView from django.core.exceptions import ValidationError from django.views.decorators.http import require_http_me...
mit
4,318,323,745,429,808,600
24.534247
65
0.670601
false
3.899582
false
false
false
bjarnagin/manyquery
manyquery/cli.py
1
1598
import click import csv from manyquery.connection import Connection, MultiConnection @click.command() @click.option('--host', '-h', default=['ict.croptrak.com'], multiple=True, help='Hostname. Repeatable.') @click.option('--user', '-u', help='MySQL username') @click.option('--password', '-p', prompt=...
mit
-4,797,792,615,372,584,000
34.533333
82
0.610138
false
3.850602
false
false
false
tensorflow/probability
tensorflow_probability/python/distributions/blockwise.py
1
15570
# Copyright 2018 The TensorFlow Probability Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
apache-2.0
4,754,112,428,471,258,000
36.071429
104
0.648105
false
3.80964
false
false
false
swharden/SWHLab
doc/uses/EPSCs-and-IPSCs/smooth histogram method/05.py
1
1812
""" MOST OF THIS CODE IS NOT USED ITS COPY/PASTED AND LEFT HERE FOR CONVENIENCE """ import os import sys # in case our module isn't installed (running from this folder) if not os.path.abspath('../../../') in sys.path: sys.path.append('../../../') # helps spyder get docs import swhlab import swhlab.common as cm i...
mit
-1,441,784,876,486,513,400
28.225806
79
0.683223
false
2.936791
false
false
false
enalisnick/stick-breaking_dgms
models/variational_coders/decoders.py
1
3064
import numpy as np import theano import theano.tensor as T ### Regular Decoder class Decoder(object): def __init__(self, rng, input, latent_size, out_size, activation, W_z = None, b = None): self.input = input self.activation = activation # setup the params ...
mit
8,828,024,413,954,331,000
49.229508
181
0.520235
false
3.718447
false
false
false
IBMPredictiveAnalytics/SPSSINC_RECODEEX
src/SPSSINC_RECODEEX.py
1
20980
#/*********************************************************************** # * Licensed Materials - Property of IBM # * # * IBM SPSS Products: Statistics Common # * # * (C) Copyright IBM Corp. 1989, 2020 # * # * US Government Users Restricted Rights - Use, duplication or disclosure # * restricted by GSA ADP Schedule C...
apache-2.0
8,460,138,943,254,883,000
37.214936
129
0.614585
false
3.744423
false
false
false
Fireforge/AcronatorServer
acronization.py
1
5783
import json import argparse import random import sys import requests BIGHUGELABS_API_KEY = 'f79909b74265ba8593daf87741f3c874' buzzWords = ['alignment','bot', 'collusion', 'derivative', 'engagement', 'focus', 'gathering' ,'housing','liability','management','nomenclature','operation','procedure','reduction','strategic...
mit
8,642,745,247,605,629,000
38.882759
402
0.582743
false
3.876005
false
false
false
overdev/easygl-0.1.0-alpha1
easygl/display/window.py
1
11847
# !/usr/bin/python # -*- coding: utf-8 -*- # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # # The MIT License (MIT) # # Copyright (c) 2017 Jorge A. Gomes (jorgegomes83 at hotmail dot com) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this softwar...
mit
6,686,868,297,029,935,000
34.364179
115
0.543682
false
3.857701
false
false
false
testalt/electrum-ppc-server
src/utils.py
1
6099
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2011 thomasv@gitorious # # 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...
agpl-3.0
-1,488,351,987,294,061,300
23.396
107
0.610756
false
3.181534
false
false
false
BladeSun/NliWithKnowledge
session2/dam_bk_1.py
1
59183
''' Build a neural machine translation model with soft attention ''' import theano import theano.tensor as tensor from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams import cPickle as pkl import ipdb import numpy import copy import os import warnings import sys import time import logging from colle...
bsd-3-clause
2,461,992,773,011,421,700
36.937821
252
0.529831
false
3.385561
false
false
false
spesmilo/electrum
electrum/gui/qt/amountedit.py
1
4862
# -*- coding: utf-8 -*- from decimal import Decimal from typing import Union from PyQt5.QtCore import pyqtSignal, Qt, QSize from PyQt5.QtGui import QPalette, QPainter from PyQt5.QtWidgets import (QLineEdit, QStyle, QStyleOptionFrame, QSizePolicy) from .util import char_width_in_lineedit, ColorScheme from electrum.u...
mit
-6,846,242,850,368,492,000
32.531034
95
0.613122
false
3.700152
false
false
false
gjwajda/Computational-Tools-For-Big-Data
Exercise11/exercise11_2.py
1
3455
#!C:/Users/Greg/Anaconda/Python import json from time import time from os import listdir import re import numpy as np from random import shuffle from pprint import pprint #Folder with json files path = "./json/" # Function to load all json files into python def merge_json(path): merged_json = [] for filename in lis...
mit
-7,924,714,258,189,322,000
26.204724
98
0.665702
false
3.1814
false
false
false
tboyce1/home-assistant
homeassistant/components/climate/econet.py
1
7250
""" Support for Rheem EcoNet water heaters. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/climate.econet/ """ import datetime import logging import voluptuous as vol from homeassistant.components.climate import ( DOMAIN, PLATFORM_SCHEMA, STATE_ECO...
apache-2.0
5,136,632,818,618,651,000
31.657658
78
0.638897
false
3.519417
false
false
false
KirillShaman/escalate_gspread
app/channels/models.py
1
5656
# The MIT License (MIT) # Escalate Copyright (c) [2014] [Chris Smith] # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, c...
mit
1,731,833,847,790,810,600
34.572327
138
0.637553
false
3.593393
false
false
false
jgasteiz/fuzzingtheweb
settings.py
1
3336
# -*- coding: utf-8 -*- DEBUG = False TEMPLATE_DEBUG = DEBUG ADMINS = ( ('Javi Manzano', 'javi.manzano.oller@gmail.com'), ) MANAGERS = ADMINS ALLOWED_HOSTS = ['176.58.120.22', 'fuzzingtheweb.com'] TIME_ZONE = 'Europe/London' USE_TZ = True LANGUAGE_CODE = 'en-gb' SITE_ID = 1 USE_I18N = True USE_L10N = True MEDIA...
mit
-5,936,774,613,336,678,000
22.492958
77
0.57554
false
3.336
false
false
false
Paczesiowa/youtube-dl
youtube_dl/extractor/dailymotion.py
1
10862
# coding: utf-8 from __future__ import unicode_literals import re import json import itertools from .common import InfoExtractor from ..compat import ( compat_str, compat_urllib_request, ) from ..utils import ( ExtractorError, int_or_none, orderedSet, str_to_int, unescapeHTML, ) class D...
unlicense
-8,050,191,618,828,455,000
35.816949
167
0.532179
false
3.482206
false
false
false
joegomes/deepchem
deepchem/models/autoencoder_models/test_tensorflowEncoders.py
1
1452
from unittest import TestCase from nose.tools import assert_equals from rdkit import Chem import deepchem as dc from deepchem.data import DiskDataset from deepchem.feat.one_hot import zinc_charset from deepchem.models.autoencoder_models.autoencoder import TensorflowMoleculeEncoder, TensorflowMoleculeDecoder class T...
mit
627,227,895,701,837,200
38.243243
111
0.664601
false
2.206687
false
false
false
limodou/uliweb
uliweb/utils/setup.py
1
5756
from setuptools import setup from setuptools.command import build_py as b import os,sys import glob #remove build and dist directory import shutil #if os.path.exists('build'): # shutil.rmtree('build') #if os.path.exists('dist'): # shutil.rmtree('dist') def copy_dir(self, package, src, dst): self.mkpath(dst)...
bsd-2-clause
7,548,749,908,409,896,000
31.519774
113
0.539611
false
3.857909
false
false
false
henryroe/Py2MASS
py2mass/__main__.py
1
2088
from __future__ import absolute_import import pickle import sys from .py2mass import set_2mass_path, fetch_2mass_xsc_box, fetch_2mass_psc_box, __version__ def main(): show_help = False if len(sys.argv) == 1 or "help" in sys.argv: show_help = True else: if sys.argv[1] == 'psc': ...
mit
-1,982,956,073,703,998,700
39.173077
90
0.527299
false
3.47421
false
false
false
graphql-python/graphql-core
tests/validation/test_unique_directive_names.py
1
2732
from functools import partial from graphql.utilities import build_schema from graphql.validation.rules.unique_directive_names import UniqueDirectiveNamesRule from .harness import assert_sdl_validation_errors assert_errors = partial(assert_sdl_validation_errors, UniqueDirectiveNamesRule) assert_valid = partial(asser...
mit
1,620,604,357,516,946,200
26.049505
84
0.503294
false
4.759582
false
false
false
valohai/valohai-cli
valohai_cli/git.py
1
2207
import os import subprocess from typing import Sequence from valohai_cli.exceptions import NoCommit, NoGitRepo def check_git_output(args: Sequence[str], directory: str) -> bytes: try: return subprocess.check_output( args=args, cwd=directory, shell=False, st...
mit
-3,123,302,948,295,166,000
31.455882
118
0.63208
false
3.998188
false
false
false
maartenbreddels/ipyvolume
ipyvolume/utils.py
1
9843
from __future__ import print_function import os import io import time import functools import collections import collections.abc import numpy as np import requests import IPython import zmq # https://stackoverflow.com/questions/14267555/find-the-smallest-power-of-2-greater-than-n-in-python def next_power_of_2(x): ...
mit
-3,361,862,247,141,486,600
32.253378
120
0.574215
false
3.645556
false
false
false
thom-at-redhat/cfme_tests
scripts/template_upload_rhevm.py
1
16744
#!/usr/bin/env python2 """This script takes various parameters specified in cfme_data['template_upload']['template_upload_rhevm'] and/or by command-line arguments. Parameters specified by command-line have higher priority, and override data in cfme_data. This script is designed to run either as a standalone rhevm tem...
gpl-2.0
5,226,702,199,609,717,000
35.242424
96
0.643992
false
3.719236
false
false
false
TheCamusean/DLRCev3
scripts/Computer_vision_files/pose_estimation.py
1
2128
import numpy as np import cv2 import glob import math as m import time import timeout_decorator as tm def draw(img, corners, imgpts): corner = tuple(corners[0].ravel()) img = cv2.line(img, corner, tuple(imgpts[0].ravel()), (255,0,0), 5) img = cv2.line(img, corner, tuple(imgpts[1].ravel()), (0,255,0), 5) ...
mit
-4,619,761,552,942,554,000
29.4
86
0.629229
false
2.66
false
false
false
Xiol/CVEChecker
old/rhsa.py
1
5144
#!/usr/bin/env python -OO # 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/. # # CVE -> RHSA Report Generator # # Requires Beautiful Soup: http://www.crummy.com/software/Be...
mpl-2.0
-8,972,298,139,212,128,000
40.483871
197
0.648523
false
3.32945
false
false
false
jszymon/pacal
pacal/examples/central_limit_demo.py
1
2068
#!=============================== #! Demo of central limit theorem #!=============================== from __future__ import print_function import sys from pylab import * from pacal import * from pacal import params import time params.general.warn_on_dependent = False if __name__ == "__main__": colors = "kbgrcmy...
gpl-3.0
-3,555,198,765,811,452,400
26.210526
84
0.436654
false
3.418182
false
false
false
anacode/anacode-toolkit
anacode/api/writers.py
1
20217
# -*- coding: utf-8 -*- import os import csv import datetime import pandas as pd from itertools import chain from functools import partial from anacode import codes def backup(root, files): """Backs up `files` from `root` directory and return list of backed up file names. Backed up files will have datetime s...
bsd-3-clause
-7,003,819,235,267,185,000
37.729885
84
0.598012
false
3.896877
false
false
false
sony/nnabla
python/src/nnabla/backward_function/dropout.py
1
1383
# Copyright 2019,2020,2021 Sony Corporation. # Copyright 2021 Sony Group Corporation. # # 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 # # Un...
apache-2.0
1,812,822,212,141,513,200
32.731707
86
0.702097
false
3.778689
false
false
false
mosra/m.css
documentation/test_doxygen/test_doxyfile.py
1
6508
# # This file is part of m.css. # # Copyright © 2017, 2018, 2019, 2020 Vladimír Vondruš <mosra@centrum.cz> # # 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, inc...
mit
1,598,037,354,109,257,000
42.34
88
0.627903
false
3.571978
true
false
false
tBaxter/activity-monitor
activity_monitor/models.py
1
4354
from django.conf import settings from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.functional import cached_property from .managers import ActivityItemManager class Activity(models.Model): """...
mit
5,448,646,263,097,085,000
32.236641
98
0.616904
false
4.451943
false
false
false
DistributedSystemsGroup/zoe
zoe_master/scheduler/elastic_scheduler.py
1
14941
# Copyright (c) 2017, Daniele Venzano # # 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 w...
apache-2.0
-5,541,096,387,478,391,000
41.810888
148
0.581554
false
4.55102
false
false
false
praba230890/PYPOWER
pypower/t/t_scale_load.py
2
21996
# 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. """Tests for code in C{scale_load}. """ from os.path import dirname, join from numpy import array, zeros, in1d, vstack, flatnonzero as find from pypower.loadcas...
bsd-3-clause
6,540,660,341,247,444,000
55.544987
161
0.496636
false
2.550261
false
false
false
MangoMangoDevelopment/neptune
lib/ros_comm-1.12.0/tools/rosgraph/test/test_rosenv.py
1
2781
# Software License Agreement (BSD License) # # Copyright (c) 2011, Willow Garage, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above...
bsd-3-clause
-1,259,702,739,431,144,000
35.116883
98
0.705142
false
3.884078
false
false
false
possnfiffer/py-emde
py-emde-wind-direction.py
1
5361
ndata = [] with open('data/winddir_20160202.dat') as f: for line in f: ndata.append(line.split(" ")) flist = [] for l in ndata: if l[4].endswith('00') or l[4].endswith('15') or l[4].endswith('30') or l[4].endswith('45'): if float(l[-1].strip()) == 0 or float(l[-1].strip()) == 360: f...
bsd-2-clause
7,669,188,134,167,574,000
68.428571
205
0.378601
false
2.17671
false
false
false
eLvErDe/methlab
pymethlab/updatehelper.py
1
1970
# methlab - A music library application # Copyright (C) 2007 Ingmar K. Steen (iksteen@gmail.com) # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at...
gpl-2.0
-6,294,964,913,357,571,000
30.774194
82
0.682741
false
3.682243
false
false
false
sugarsweetrobotics/wasanbon
wasanbon/core/plugins/admin/wsconverter_plugin/host/outport_converter.py
1
2057
import os, sys from common_converter import * _template = """ import yaml, traceback import RTC import OpenRTM_aist _data = $CONSTRUCTOR _port = OpenRTM_aist.OutPort("$NAME", _data) def convert(data, d_list): it = iter(d_list) $CODE print 'converted:', data return data def _sendData(d_list): convert(_dat...
gpl-3.0
-3,378,357,359,583,994,400
26.065789
97
0.628099
false
3.366612
false
false
false
spmjc/plugin.video.freplay
resources/lib/channels/rmcd.py
1
1233
#-*- coding: utf-8 -*- import urllib2 import re import CommonFunctions common = CommonFunctions from resources.lib import utils from resources.lib import globalvar import json title=['RMC Decouverte'] img=['rmcd'] readyForUse=True url_video_json='https://edge.api.brightcove.com/playback/v1/accounts/%s/vi...
gpl-2.0
8,747,088,300,629,931,000
32.324324
161
0.664234
false
3.05198
false
false
false
jplana/python-etcd
setup.py
1
1239
from setuptools import setup, find_packages import sys, os here = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(here, 'README.rst')).read() NEWS = open(os.path.join(here, 'NEWS.txt')).read() version = '0.4.5' install_requires = [ 'urllib3>=1.7.1', 'dnspython>=1.13.0' ] test_requires...
mit
6,686,755,014,281,602,000
25.361702
54
0.619048
false
3.385246
false
false
false
GreenGear5/planet-wars
bots/ml-rfc/ml-rfc.py
1
4276
#!/usr/bin/env python """ Uses the Random Forest classifier """ from api import State, util import random, os from sklearn.externals import joblib DEFAULT_MODEL = os.path.dirname(os.path.realpath(__file__)) + '/model.pkl' class Bot: __max_depth = -1 __randomize = True __model = None def __init__...
mit
-1,888,951,242,847,442,400
27.697987
110
0.58232
false
3.731239
false
false
false
Flavsditz/projects
eyeTracking/pupil/pupil_src/capture/recorder.py
1
4963
import os, sys import cv2 import atb import numpy as np from plugin import Plugin from time import strftime,localtime,time,gmtime from ctypes import create_string_buffer from git_version import get_tag_commit class Recorder(Plugin): """Capture Recorder""" def __init__(self, session_str, fps, img_shape, shared_...
gpl-2.0
-8,185,987,220,556,389,000
39.024194
137
0.576667
false
3.598985
false
false
false
li282886931/apistore
server/controllers/novelhandler.py
1
8379
# -*- coding: utf-8 -*- import json import datetime import urllib import hashlib import tornado.gen import tornado.web import tornado.httpclient from controllers.basehandler import BaseHandler from models.novelmodel import NovelModel import utils from utils import json_success, json_failed, cache_error import const ...
gpl-2.0
-1,168,748,543,770,488,600
33.103734
125
0.528045
false
3.595363
false
false
false
goblinhack/MundusMeus
python/things/rock.py
1
1729
import tp import mm def thing_init(t): return def rock_init(name, short_name, tiles=[]): x = tp.Tp(name) x.set_is_shadow_caster_soft(True) x.set_is_shadow_caster(True) x.set_short_name(short_name) x.set_is_movement_blocking(True) x.set_is_rock(True) x.set_z_depth(mm.Z_DEPTH_ROCK) ...
lgpl-3.0
-4,111,445,784,893,475,000
24.057971
43
0.338924
false
3.816777
false
false
false
jeremi/couchdbkit
couchdbkit/ext/django/loading.py
1
5298
# -*- coding: utf-8 -*- # # Copyright (c) 2008-2009 Benoit Chesneau <benoitc@e-engura.com> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTW...
isc
7,504,999,183,328,596,000
39.442748
99
0.601737
false
4.218153
false
false
false
insilichem/ommprotocol
ommprotocol/md.py
1
30554
#!/usr/bin/env python # -*- coding: utf-8 -*- # ommprotocol: A command line application to launch # MD protocols with OpenMM # By Jaime RGP <@jaimergp> """ ommprotocol.md -------------- All the logic that governs the simulation of a MD protocol, stage by stage. A protocol is a chained list of stages, w...
lgpl-3.0
-3,036,808,844,007,292,000
40.233468
114
0.600445
false
4.377364
false
false
false
tgibson37/tiny-c
cairopy.py
1
2552
import sys import os import cairo import shlex def comment(cmt): cmt = cmt[:-1] #print "in comment: ", cmt def draw(x): global ctx ''' hard way: very long list of if-elif's if x[0] == "moveto": ctx.move_to( int(x[1]), int(x[2]) ) elif x[0] == "lineto": ctx.line_to( int(x[1]), int(x[2]) ) ctx.stroke(...
gpl-3.0
6,053,136,622,952,715,000
20.266667
64
0.574843
false
2.19244
false
false
false
MarkusHackspacher/unknown-horizons
horizons/gui/tabs/residentialtabs.py
1
5161
# ################################################### # Copyright (C) 2008-2017 The Unknown Horizons Team # team@unknown-horizons.org # This file is part of Unknown Horizons. # # Unknown Horizons is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published ...
gpl-2.0
-4,440,255,941,613,164,500
42.737288
100
0.708584
false
3.422414
false
false
false
davidsminor/gaffer
python/GafferRenderManTest/RenderManShaderTest.py
1
61179
########################################################################## # # Copyright (c) 2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Red...
bsd-3-clause
-2,309,061,230,335,838,000
38.419459
166
0.686167
false
3.317733
true
false
false
hiseh/yinanan
tps/converter/formats.py
1
2208
#!/usr/bin/env python class BaseFormat(object): """ Base format class. Supported formats are: ogg, avi, mkv, webm, flv, mov, mp4, mpeg """ format_name = None ffmpeg_format_name = None def parse_options(self, opt): if 'format' not in opt or opt.get('format') != self.format_name: ...
mit
4,400,064,395,914,517,500
19.635514
72
0.625906
false
3.280832
false
false
false
draklaw/lair
src/sys_sdl2/sys_sdl2.py
1
2854
#!/usr/bin/env python3 ## ## Copyright (C) 2015 Simon Boyé ## ## This file is part of lair. ## ## lair 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 o...
lgpl-3.0
5,791,961,998,432,265,000
33.792683
95
0.676481
false
2.956477
false
false
false
muatik/dahi
dahi/document.py
1
1446
from bson import ObjectId from dahi.statement import Statement class InvalidDocument(Exception): pass class Document(object): def __init__(self, docID=None, botSay=None, humanSay=None, onMatch=None): super(Document, self).__init__() self.botSay = botSay self.humanSay = humanSay ...
mit
1,258,744,973,872,936,000
27.352941
77
0.564315
false
3.509709
false
false
false
saeidadli/Python-ArcGIS-Convertor
arcgdfconvertor/convertor.py
1
3491
import os import sys import tempfile from pathlib import Path import arcpy import pandas as pd import numpy as np import geopandas as gpd #constants #WGS_1984 coordinate system WGS_1984 = \ "GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984', "+\ "SPHEROID['WGS_1984',6378137.0,298.257223563]], "+\ "PRIMEM['Greenwi...
mit
6,099,987,639,100,289,000
25.648855
93
0.613005
false
3.179417
false
false
false
AravindK95/ee106b
project3/src/lab3/src/extra/grasp_ctrl.py
1
5226
#!/usr/bin/env python import sys import rospkg import rospy import tf import numpy as np from std_msgs.msg import String, Bool from geometry_msgs.msg import Transform, Pose, Vector3, Quaternion, Point from lab3.msg import FrameCall PROJECT_PATH = rospkg.RosPack().get_path('lab3') sys.path.append(PROJECT_PATH+'/src/lab...
mit
895,466,151,847,824,100
31.259259
91
0.539801
false
3.444957
false
false
false
googleads/google-ads-python
google/ads/googleads/v7/services/services/mobile_device_constant_service/transports/grpc.py
1
10591
# -*- 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
1,221,377,875,632,550,100
40.69685
107
0.608441
false
4.78365
false
false
false
dcrosta/nymwit
nymwit/game/management/commands/advancegamestate.py
1
2917
# Copyright (c) 2011, Daniel Crosta # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of conditions and the...
bsd-2-clause
-979,874,457,618,385,700
47.616667
117
0.685293
false
4.30236
false
false
false
pmleveque/cross-site-navigation
authentification.py
1
1642
from cefbase import * from google.appengine.api import users # Permet de savoir si c'est le bon utilisateur qui cherche a avoir acces aux donnees # Si l'utlisateur a aucun droit, il n'a acces a rien # Si le contributeur est un admin de diocese, il n'a acees qu'a ses barres propres, ses menus propres et les menus pu...
mit
1,967,716,344,745,664,500
42.378378
128
0.588916
false
3.827506
false
false
false
landlab/drivers
scripts/ecohydrology_flat_surface/run_driver.py
1
4929
""" Created on Wed Jul 20 2016 This tutorial is on: landlab/tutorials/ecohydrology/cellular_automaton_vegetation_flat_surface.ipynb Creating a (.py) version of the same. @author: Sai Nudurupati & Erkan Istanbulluoglu """ import os import time import numpy as np from landlab import RasterModelGrid, load_params fro...
mit
-338,219,367,900,883,300
33.957447
84
0.646379
false
3.078701
false
false
false
danielnyga/dnutils
src/dnutils/tools.py
1
10478
''' Created on May 22, 2017 @author: nyga ''' import re def ifnone(if_, else_, transform=None): '''Returns the condition ``if_`` iff it is not ``None``, or if a transformation is specified, ``transform(if_)``. Returns ``else_`` if the condition is ``None``. ``transform`` can be any callable, which will b...
mit
-7,107,193,630,464,736,000
29.637427
113
0.550678
false
3.792255
false
false
false
aringh/odl
examples/tomo/backends/astra_performance_cuda_parallel_2d_cg.py
1
2880
"""Performance example of running native ASTRA vs using ODL for reconstruction. In this example, a 512x512 image is reconstructed using the Conjugate Gradient Least Squares method on the GPU. In general, ASTRA is faster than ODL since it does not need to perform any copies and all arithmetic is performed on the GPU. ...
mpl-2.0
-7,807,791,797,508,731,000
28.090909
79
0.711111
false
3.034773
false
false
false
lalpert/gradsearch-scala
scrapers/gradsearch/spiders/princetonee_spider.py
1
1145
import scrapy import urlparse from gradsearch.items import Professor class PrincetonEESpider(scrapy.Spider): name = "princeton_ee" allowed_domains = ["princeton.edu"] start_urls = ["http://ee.princeton.edu/people/faculty"] def cleanup(self, sel): return sel.xpath('normalize-space(text())').extract() def parse...
mit
-9,096,574,537,370,510,000
32.676471
115
0.676856
false
3.171745
false
false
false
alexbruy/QGIS
python/plugins/processing/gui/GetScriptsAndModels.py
1
14193
# -*- coding: utf-8 -*- """ *************************************************************************** GetScriptsAndModels.py --------------------- Date : June 2014 Copyright : (C) 2014 by Victor Olaya Email : volayaf at gmail dot com *********************...
gpl-2.0
-6,995,422,623,564,464,000
40.258721
150
0.593462
false
4.137901
false
false
false
snap-stanford/ogb
examples/lsc/mag240m/label_prop.py
1
2884
# NOTE: More than 256GB CPU memory required to run this script. # Use `--low-memory` to reduce memory consumption by using half-precision import os.path as osp import time import argparse import torch import torch.nn.functional as F from torch_sparse import SparseTensor from torch_geometric.nn import LabelPropa...
mit
2,963,788,015,815,800,000
34.170732
79
0.626907
false
3.077908
false
true
false
kmuehlbauer/wradlib
wradlib/qual.py
1
8000
#!/usr/bin/env python # Copyright (c) 2011-2018, wradlib developers. # Distributed under the MIT License. See LICENSE.txt for more info. """ Data Quality ^^^^^^^^^^^^ This module will serve two purposes: #. provide routines to create simple radar data quality related fields. #. provide routines to decide ...
mit
8,926,593,673,090,248,000
29.128405
79
0.6045
false
3.59874
false
false
false
dstaple/z3test
scripts/mk_copyright.py
3
1766
# Copyright (c) 2015 Microsoft Corporation import os import re cr = re.compile("Copyright") aut = re.compile("Automatically generated") aut2 = re.compile("auto-generated") cr_notice = """ /*++ Copyright (c) 2015 Microsoft Corporation --*/ """ smt2_cr_notice = """ ; Copyright (c) 2015 Microsoft Corporation """ py...
mit
3,061,600,513,663,548,000
21.641026
139
0.543601
false
3.3258
false
false
false
sburnett/seattle
autograder/emulab/sample_client.py
1
2122
#from remote_emulab import * import remote_emulab # This is a very rough sample of what a client # to the remote_emulab.py library will look like # # Everything below is hardcoded and is not intended # to be executed (it will fail because it assumes a # new and unique exp name). It is just an exmaple # senerio. # ...
mit
8,734,794,021,364,859,000
25.525
63
0.719604
false
3.279753
false
false
false
AlexanderSavelyev/rdkit
Contrib/mmpa/indexing.py
1
21045
# Copyright (c) 2012, GlaxoSmithKline Research & Development Ltd. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # ...
bsd-3-clause
3,132,523,979,875,397,600
39.627413
163
0.5665
false
3.614116
false
false
false
rahul-ramadas/BagOfTricks
InsertMarkdownLink.py
1
1987
import sublime import sublime_plugin MARKDOWN_LINK_SNIPPET = "[${{1:{}}}](${{2:{}}})" class InsertMarkdownLinkCommand(sublime_plugin.TextCommand): def decode_page(self, page_bytes, potential_encoding=None): if potential_encoding: try: text = page_bytes.decode(pot...
unlicense
-25,537,689,219,243,780
32.859649
107
0.535984
false
4.319565
false
false
false
djaodjin/djaodjin-signup
signup/serializers.py
1
13054
# Copyright (c) 2021, DjaoDjin inc. # 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 notice, # this list of conditions and t...
bsd-2-clause
8,961,634,846,136,696,000
36.085227
80
0.673816
false
4.444671
false
false
false
mariocannistra/radio-astronomy
findsessionrange.py
1
1973
#!/usr/bin/python # this source is part of my Hackster.io project: https://www.hackster.io/mariocannistra/radio-astronomy-with-rtl-sdr-raspberrypi-and-amazon-aws-iot-45b617 # this program will determine the overall range of signal strengths received during the whole session. # this program can be run standalone bu...
mit
-5,841,826,111,265,500,000
28.893939
155
0.729346
false
3.126783
false
false
false
rwaldron/Espruino
boards/STM32F429IDISCOVERY.py
1
5051
#!/bin/false # This file is part of Espruino, a JavaScript interpreter for Microcontrollers # # Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk> # # 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 h...
mpl-2.0
6,059,209,135,743,455,000
27.061111
104
0.402891
false
2.607641
false
false
false
TAMU-CPT/galaxy-tools
tools/genome_viz/brigaid.py
1
36126
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ AUTHOR Pedro Cerqueira github: @pedrorvc DESCRIPTION This script serves to create xml files contaning the information necessary for the execution of BRIG (Blast Ring Image Generator), reducing the time performing the tedious task of setting u...
gpl-3.0
5,687,784,411,646,860,000
40.8125
151
0.560455
false
4.529338
false
false
false
GaneshPandey/alex-scraper
alexscrapper/spiders/luckyshops_spider.py
1
3002
# -*- coding: utf-8 -*- import scrapy from scrapy.http import Request, FormRequest from scrapy.spiders import CrawlSpider from alexscrapper.items import * from datetime import datetime from scrapy.conf import settings import urllib import csv import json import re from datetime import datetime, timedelta from dateutil...
gpl-3.0
8,431,650,365,857,330,000
33.125
146
0.570286
false
3.474537
false
false
false
jrsmith3/gits
test/test_fs_utils.py
1
6045
# -*- coding: utf-8 -*- import os import shutil import unittest from gits import fs_utils test_dir_root = os.path.dirname(os.path.realpath(__file__)) class MethodsInput(unittest.TestCase): """ Tests behavior of methods which take input arguments. """ scratch_dir = os.path.join(test_dir_root, "scratch"...
mit
2,823,540,586,295,067,600
30.815789
102
0.599504
false
3.432709
true
false
false
luca-morreale/reinforcement-gym
generalizer/state_generalizer.py
1
1668
# -*- coding: utf-8 -*- import numpy as np from state_action import StateAction class StateGeneralizer: """ Creates the Generalizer. Args: updater: object in charge of update the value of actions """ def __init__(self, m): self.Q = {} self.m = m def getRepresentation(s...
gpl-3.0
-5,542,995,542,859,738,000
25.903226
74
0.585731
false
4.212121
false
false
false
asoplata/dynasim-benchmark-brette-2007
Brian2/brian2_benchmark_COBAHH_nosyn_compiled_500.py
1
3481
""" # Notes: - This simulation seeks to emulate the COBAHH benchmark simulations of (Brette et al. 2007) using the Brian2 simulator for speed benchmark comparison to DynaSim. However, this simulation does NOT include synapses, for better comparison to Figure 5 of (Goodman and Brette, 2008) - although it uses the...
gpl-3.0
3,238,071,321,243,270,700
31.212963
110
0.641851
false
2.387783
false
false
false
LilithWittmann/bootev-tickets
tickets/conference/migrations/0001_initial.py
1
1388
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.Create...
gpl-2.0
476,390,771,540,662,000
38.657143
114
0.564121
false
4.491909
false
false
false