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
temugen/pipil
pipil.py
1
10540
# Copyright (C) 2011 Brad Misik # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Software"), to deal in # the Software without restriction, including without limitation the rights to # use, copy, modify, merge, publish, distribu...
mit
3,926,265,778,472,804,400
28.441341
121
0.648197
false
3.335443
false
false
false
cmccomb/truss-me
tests/test_truss.py
1
4133
import numpy import unittest import os import filecmp from trussme import truss TEST_TRUSS_FILENAME = os.path.join(os.path.dirname(__file__), 'example.trs') class TestSequenceFunctions(unittest.TestCase): def test_build_methods(self): # Build truss from scratch t1 = truss.Truss() t1.add_...
mit
-7,155,019,656,853,716,000
34.025424
80
0.529881
false
2.726253
true
false
false
mapsme/subways
stop_areas/make_stop_areas.py
1
6820
#!/usr/bin/env python3 import json import codecs from lxml import etree import sys import kdtree import math import re import urllib.parse import urllib.request QUERY = """ [out:json][timeout:250][bbox:{{bbox}}]; ( relation["route"="subway"];<<; relation["route"="light_rail"];<<; relation["public_transport"="st...
apache-2.0
7,695,880,928,563,187,000
34.520833
100
0.541789
false
3.53918
false
false
false
Csega/PythonCAD3
Generic/Kernel/GeoEntity/style.py
1
3096
# # Copyright (c) 2010 Matteo Boscolo # # This file is part of PythonCAD. # # PythonCAD is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version....
gpl-2.0
2,169,389,506,850,630,700
34.586207
81
0.557171
false
4.546256
false
false
false
thomasw/querylist
querylist/list.py
1
6241
from querylist.dict import BetterDict from querylist.fieldlookup import field_lookup class QueryList(list): """A QueryList is an extension of Python's built in list data structure that adds easy filtering, excluding, and retrieval of member objects. >>> from querylist import QueryList >>> sites = Que...
mit
3,246,171,332,525,508,000
34.662857
78
0.608236
false
4.231186
false
false
false
achoi007/CloudComputing
Concepts/hmwk2.py
1
2048
from evttrkvecclock import EventTrackVectorClock from vectorclock import VectorClock from chandylamport import ChandyLamport def vecClockSetUp1(): vc = EventTrackVectorClock(4) vc.halfSend(0, "m1") vc.addStep(1, "p1_1") vc.halfRecv(2, "m1") vc.sendMesg(1, 0, "m3") vc.sendMesg(2, 1, "m2") vc...
mit
-8,621,093,794,000,095,000
26.675676
85
0.589355
false
2.595691
false
false
false
majeau-bettez/pySUT
pysut/pySUT.py
1
78418
# -*- coding: utf-8 -*- """ Class SupplyUseTable. Version 1.1. Last change: May 18th, 2015. Check https://github.com/stefanpauliuk/pySUT for latest version. Methods for efficient handling of supply and use tables (SUTs) Created on Mon Jun 30 17:21:28 2014 @author: stefan pauliuk, NTNU Trondheim, Norway Guillaume ...
bsd-3-clause
-5,921,122,808,017,112,000
37.859267
238
0.550244
false
3.8305
false
false
false
davies/xunlei-lixian
lixian_commands/login.py
1
1451
from lixian import XunleiClient from lixian_commands.util import * from lixian_cli_parser import * from lixian_config import get_config import lixian_help from getpass import getpass @command_line_parser(help=lixian_help.login) @with_parser(parse_login) @with_parser(parse_logging) def login(args): if args.cookies =...
mit
-3,615,740,378,685,837,300
35.275
148
0.716747
false
3.16122
false
false
false
virajmehta/backwards_dict
models/model.py
1
4401
import tensorflow as tf class Model(object): """Abstracts a Tensorflow graph for a learning task. We use various Model classes as usual abstractions to encapsulate tensorflow computational graphs. Each algorithm you will construct in this homework will inherit from a Model object. """ def add_...
mit
-3,232,005,218,510,104,000
35.675
99
0.630311
false
4.379104
false
false
false
brokendata/bigmler
bigmler/tests/dataset_advanced_steps.py
1
9697
# -*- coding: utf-8 -*- # # Copyright 2014-2015 BigML # # 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 ...
apache-2.0
4,220,419,156,929,002,000
36.296154
110
0.597814
false
3.90693
false
false
false
netsurferhi/public
ssllabs-scan/ssllabs-scan.py
1
135498
#!/usr/bin/env python import ast import base64 import calendar import copy import datetime import getpass import json import os import pickle import pprint import re import readline import socket import stat import string import sys import time from requests.exceptions import ConnectionError import argparse import is...
gpl-3.0
3,116,484,798,639,689,000
44.591521
147
0.497402
false
4.242001
false
false
false
cemarchi/biosphere
Src/BioDataImporter/Importers/MessengerRnaSampleImporter.py
1
3575
from Src.BioDataFileManagement.CrossCutting.Filters.FeListMessengerRnaSampleFile import FeListMessengerRnaSampleFile from Src.BioDataFileManagement.Managers.MessengerRnaSampleFileManager import MessengerRnaSampleFileManager from Src.BioDataImporter.Contracts.BioDataImporterBase import BioDataImporterBase from Src.BioDa...
bsd-3-clause
7,834,564,778,069,197,000
57.606557
140
0.588531
false
4.402709
false
false
false
chrisspen/asklet
asklet/management/commands/asklet_load_dbpedia_glosses.py
1
5887
#!/usr/bin/python from __future__ import print_function import random import re import datetime import os import sys import time from optparse import make_option import urllib2 import tarfile import traceback from multiprocessing import cpu_count from django.conf import settings from django.core.management.base import...
lgpl-3.0
-4,707,839,909,855,029,000
31.174863
83
0.532699
false
4.062802
false
false
false
dlsun/symbulate
symbulate/distributions.py
1
24598
import numbers import numpy as np import scipy.stats as stats import matplotlib.pyplot as plt from .probability_space import ProbabilitySpace from .plot import get_next_color from .result import Scalar, Vector, InfiniteVector class Distribution(ProbabilitySpace): def __init__(self, params, scipy, discrete=True): ...
mit
-8,620,826,031,273,724,000
28.041322
97
0.54724
false
4.184045
false
false
false
all-of-us/raw-data-repository
rdr_service/lib_fhir/fhirclient_3_0_0/client.py
1
8525
# -*- coding: utf-8 -*- import logging from .server import FHIRNotFoundException, FHIRServer, FHIRUnauthorizedException __version__ = '3.0.0' __author__ = 'SMART Platforms Team' __license__ = 'APACHE2' __copyright__ = "Copyright 2017 Boston Children's Hospital" scope_default = 'user/*.* patient/*.read openid profil...
bsd-3-clause
-797,955,341,246,471,800
36.227074
125
0.606217
false
4.071156
false
false
false
kgn/cssutils
src/cssutils/__init__.py
1
15188
#!/usr/bin/env python """cssutils - CSS Cascading Style Sheets library for Python Copyright (C) 2004-2010 Christof Hoeke cssutils is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either ver...
gpl-3.0
1,998,805,305,111,907,300
37.744898
91
0.609099
false
4.224757
false
false
false
tensorflow/datasets
tensorflow_datasets/core/decode/base.py
1
5296
# coding=utf-8 # Copyright 2021 The TensorFlow Datasets 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 appl...
apache-2.0
-2,919,518,857,113,865,000
27.782609
80
0.693353
false
4.083269
false
false
false
ShawnKimble/kcryptotools
kcryptotools/pushtx.py
1
1149
# This can be used to push raw transaction (in hex) to a crypto network # # USAGE: # python pushtx.py <crypto> <number of peers to send tx to> <transaction1 in hex> <transaction2 in hex> ... # import sys import socket import cryptoconfig import peersockets def pushtx(crypto,num_peers_to_send,tx_list): if crypto ...
mit
-94,505,564,040,079,420
27.725
121
0.641427
false
3.264205
false
false
false
milkpku/BetaElephant
export_net/model_eval.py
1
1981
#!/usr/bin/python3 #-*-coding:utf-8-*- #$File: model_eval.py #$Date: Sat Jun 4 09:59:32 2016 #$Author: Like Ma <milkpku[at]gmail[dot]com> import tensorflow as tf import numpy as np import sys import argparse class Evaluer(object): def __init__(self, model_folder, checkpoint_file): sys.path.append(model...
mit
-2,416,481,643,481,006,000
25.77027
79
0.590611
false
3.318258
false
false
false
mjwestcott/PyPokertools
tests/test_translation.py
1
1307
from examples.translation import to_cards, translate from pokertools import holecards def test_translation(): assert set(translate("66")) == { "6c 6d", "6c 6h", "6c 6s", "6d 6h", "6d 6s", "6h 6s" } assert set(translate("AKs")) == { "Ac Kc", "Ad Kd", "Ah Kh", "As Ks" } assert set(tr...
mit
-6,830,716,536,412,365,000
30.878049
69
0.472073
false
2.342294
false
false
false
mitsei/dlkit
dlkit/records/assessment/edx/multi_choice_records.py
1
5886
""" records.assessment.edx.multi_choice_records.py """ from random import shuffle from ..basic.base_records import ItemWithWrongAnswerLOsRecord from ..basic.simple_records import QuestionFilesRecord,\ QuestionTextAndFilesMixin from ..basic.multi_choice_records import MultiChoiceTextQuestionRecord,\ MultiChoice...
mit
-6,918,798,847,799,913,000
36.253165
112
0.619096
false
3.960969
false
false
false
dagwieers/ansible
lib/ansible/modules/cloud/google/gcp_compute_backend_bucket_facts.py
1
5621
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
gpl-3.0
2,433,449,305,687,807,000
29.884615
133
0.565736
false
4.391406
false
false
false
lizardsystem/lizard-efcis
lizard_efcis/migrations/0067_auto_20150827_1136.py
1
1389
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('lizard_efcis', '0066_auto_20150821_1131'), ] operations = [ migrations.AlterField( model_name='importmapping', ...
gpl-3.0
8,581,828,461,446,621,000
52.423077
565
0.607631
false
3.379562
false
false
false
deepmind/lab
python/tests/properties_test.py
1
7652
# Copyright 2018-2019 Google Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in t...
gpl-2.0
-4,652,281,905,512,592,000
35.265403
80
0.63173
false
3.712761
true
false
false
TeamAADGT/CMPUT404-project-socialdistribution
background_task/models_completed.py
1
4085
# -*- coding: utf-8 -*- import os from compat import python_2_unicode_compatible from compat.models import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils import timezone from background_task.models import Task class CompletedTaskQuerySet(...
apache-2.0
-4,154,069,192,117,295,600
32.760331
108
0.635251
false
3.989258
false
false
false
deepmind/graph_nets
setup.py
1
2287
# Copyright 2018 The GraphNets 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 applicabl...
apache-2.0
-3,532,060,924,510,923,000
35.301587
80
0.64801
false
4.389635
false
false
false
Micronaet/micronaet-mx
production_line/wizard/print_lavoration_week.py
1
5774
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP module # Copyright (C) 2010 Micronaet srl (<http://www.micronaet.it>) and the # Italian OpenERP Community (<http://www.openerp-italia.com>) # # ###############################################...
agpl-3.0
4,862,991,013,826,223,000
41.455882
86
0.560617
false
3.943989
false
false
false
orion/swift-config
swift/obj/diskfile.py
1
23741
# Copyright (c) 2010-2013 OpenStack, 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 agreed to ...
apache-2.0
-5,071,901,659,689,295,000
36.095313
79
0.567584
false
4.306367
false
false
false
googleapis/python-spanner
google/cloud/spanner_v1/types/keys.py
1
6810
# -*- 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
-3,136,265,659,849,813,500
32.712871
86
0.644787
false
4.109837
false
false
false
317070/ppbe-finance
finance/forms.py
1
5318
from django import forms import csv from finance.models import Pirate_Account, Banking_Account, Person, Transaction import re from datetime import datetime from email.utils import parseaddr class MemberTestForm(forms.Form): mail = forms.EmailField(required=False) firstname = forms.CharField(required=False) ...
unlicense
-6,668,921,249,481,876,000
38.984962
131
0.503573
false
4.636443
false
false
false
muromec/qtopia-ezx
src/3rdparty/libraries/helix/src/build/lib/thread.py
1
4169
# # ***** BEGIN LICENSE BLOCK ***** # # Source last modified: $Id: thread.py,v 1.3 2006/04/24 23:34:02 jfinnecy Exp $ # # Copyright Notices: # # Portions Copyright (c) 1995-2006 RealNetworks, Inc. All Rights Reserved. # # Patent Notices: This file may contain technology protected by one or # m...
gpl-2.0
513,101,680,069,834,430
35.252174
81
0.677141
false
3.551107
false
false
false
dials/dials
tests/algorithms/shoebox/test_partiality_calculator.py
1
2157
import math def test(dials_data): from dxtbx.model.experiment_list import ExperimentList, ExperimentListFactory exlist = ExperimentListFactory.from_json_file( dials_data("centroid_test_data").join("fake_long_experiments.json").strpath ) assert len(exlist) == 1 experiment = exlist[0] ...
bsd-3-clause
-5,152,502,040,778,207,000
30.720588
83
0.662494
false
3.349379
false
false
false
GuLinux/PySpectrum
pyui/spectrum_trim_dialog.py
1
2047
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'ui/spectrum_trim_dialog.ui' # # Created by: PyQt5 UI code generator 5.5.1 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_SpectrumTrimDialog(object): def setupUi(self, Spectr...
gpl-3.0
-1,498,589,827,199,417,900
48.926829
159
0.734734
false
3.990253
false
false
false
mishravikas/geonode-permissions
setup.py
1
5146
######################################################################### # # Copyright (C) 2012 OpenPlans # # 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 #...
gpl-3.0
-7,196,014,424,101,923,000
35.239437
104
0.609405
false
3.472335
false
false
false
alphagov/notifications-api
migrations/versions/0149_add_crown_to_services.py
1
1349
""" Revision ID: 0149_add_crown_to_services Revises: 0148_add_letters_as_pdf_svc_perm Create Date: 2017-12-04 12:13:35.268712 """ from alembic import op import sqlalchemy as sa revision = '0149_add_crown_to_services' down_revision = '0148_add_letters_as_pdf_svc_perm' def upgrade(): op.add_column('services', s...
mit
2,876,341,452,399,597,600
25.98
86
0.633062
false
3.597333
false
false
false
paci4416/keep
keep/utils.py
1
9756
"""Utility functions of the cli.""" import datetime import json import os import re import random import string import sys import time import click import requests import tabulate from keep import about # Directory for Keep files dir_path = os.path.join(os.path.expanduser('~'), '.keep') # URL for the API api_url = 'h...
mit
8,336,380,643,891,858,000
32.296928
92
0.578823
false
3.759538
false
false
false
lablup/backend.ai-manager
tests/test_registry.py
1
5843
from __future__ import annotations from decimal import Decimal from typing import ( Any, Mapping, ) from unittest.mock import MagicMock, AsyncMock import snappy from sqlalchemy.sql.dml import Insert, Update from ai.backend.manager.registry import AgentRegistry from ai.backend.manager.models import AgentStatu...
lgpl-3.0
7,782,149,705,618,968,000
36.216561
96
0.637173
false
3.325555
true
false
false
wkoder/mooi
src/Analyzer.py
1
11497
''' Created on Feb 21, 2012 @author: Moises Osorio [WCoder] ''' from MOSolution import MOSolution from Metrics import Metrics from MetricsCalc import MetricsCalc from ResultPlotter import ResultPlotter import Utils import dircache import os import types import sys class Analyzer: __PARETO__ = "pareto" __...
gpl-2.0
-1,423,563,511,604,196,900
41.117216
144
0.577368
false
4.254996
false
false
false
jajberni/pcse_web
main/pcse/crop/respiration.py
1
4251
# -*- coding: utf-8 -*- # Copyright (c) 2004-2014 Alterra, Wageningen-UR # Allard de Wit (allard.dewit@wur.nl), April 2014 from ..traitlets import Float, Int, Instance, Dict, AfgenTrait from ..decorators import prepare_rates, prepare_states from ..base_classes import ParamTemplate, SimulationObject class WOFOST...
apache-2.0
2,269,881,959,653,030,400
43.709677
92
0.491414
false
4.355533
false
false
false
amaxwell/datatank_py
datatank_py/DTTriangularGrid2D.py
1
3381
#!/usr/bin/env python # -*- coding: utf-8 -*- # This software is under a BSD license. See LICENSE.txt for details. from datatank_py.DTRegion2D import DTRegion2D import numpy as np class DTTriangularGrid2D(object): """2D triangular grid object. This is a collection of points interconnected to form triangles....
bsd-3-clause
-1,440,600,764,367,431,400
42.192308
145
0.509944
false
3.912892
false
false
false
unicefuganda/edtrac
edtrac_project/rapidsms_edtrac/education/scheduling.py
1
3695
from datetime import date, time, timedelta, datetime from django.conf import settings from script.models import Script, ScriptProgress from rapidsms.models import Connection from unregister.models import Blacklist roster = getattr(settings, 'POLL_DATES', {}) groups = getattr(settings, 'GROUPS', {}) def upcoming(dates...
bsd-3-clause
-7,403,872,067,131,868,000
36.704082
88
0.693369
false
3.732323
false
false
false
jtietz1/bioinf
auto_hmm.py
1
5136
#! /usr/bin/env python ''' auto_hmm.py takes an list of GI numbers, downloads them, aligns them using MUSCLE, then builds an HMM using HMMER and optionally presses the HMM contact: jonathan.tietz@gmail.com ''' # import modules import csv, re, os, math, argparse, subprocess from Bio import Entrez,...
gpl-3.0
4,861,428,278,747,571,000
32.483221
157
0.64778
false
3.317829
false
false
false
lablup/sorna-client
tests/conftest.py
1
1382
import os import pytest from ai.backend.client.config import APIConfig, set_config @pytest.fixture(autouse=True) def defconfig(): endpoint = os.environ.get('BACKEND_TEST_ENDPOINT', 'http://127.0.0.1:8081') access_key = os.environ.get('BACKEND_TEST_ADMIN_ACCESS_KEY', 'AKIAIOSF...
lgpl-3.0
6,706,883,162,263,031,000
30.409091
82
0.665702
false
3.221445
true
false
false
kartikp1995/gr-bokehgui
examples/time_sink_f_tags.py
1
5606
#!/usr/bin/env python2 # -*- coding: utf-8 -*- ################################################## # GNU Radio Python Flow Graph # Title: Top Block # Generated: Thu Mar 2 00:11:20 2017 ################################################## if __name__ == '__main__': import ctypes import sys if sys.platform.st...
gpl-3.0
7,078,780,971,031,911,000
39.042857
92
0.4538
false
3.998573
false
false
false
HtmlUnit/selenium
py/test/selenium/webdriver/common/children_finding_tests.py
1
7784
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
-1,911,665,030,896,605,000
43.227273
101
0.670349
false
3.602036
true
false
false
elamperti/bastardbot
webserver/template.py
1
1579
#!/usr/bin/python import os import datetime import cherrypy from jinja2 import Environment, FileSystemLoader, TemplateNotFound import arrow def arrow_humanize(value): obj = arrow.get(value) return obj.humanize() def template(filename=None): # , *args, **kwargs def wrap(f, *args, **kwargs): def ...
mit
-6,979,811,123,652,775,000
31.895833
90
0.555415
false
4.460452
false
false
false
kastnerkyle/pylearn2
pylearn2/packaged_dependencies/theano_linear/unshared_conv/gpu_unshared_conv.py
1
23087
""" WRITEME """ import inspect import os import StringIO import theano from theano.sandbox.cuda import CudaNdarrayType from theano.gof import local_optimizer from theano.sandbox.cuda.opt import register_opt from theano.sandbox.cuda import gpu_from_host, host_from_gpu from .unshared_conv import FilterActs from .unshar...
bsd-3-clause
-4,915,075,556,949,361,000
28.224051
85
0.452982
false
4.086195
false
false
false
eswartz/RenderPipeline
rpplugins/vxgi/vxgi_stage.py
1
4668
""" RenderPipeline Copyright (c) 2014-2016 tobspr <tobias.springer1@gmail.com> 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...
mit
4,381,636,252,458,494,500
43.884615
94
0.697729
false
3.455218
false
false
false
guoxiaoyong/simple-useful
cxx_learn/cronx/spider/produce_secondly_primary_instruments_night.py
2
3901
#!/usr/bin/python # -*- coding: utf-8 -*- import os; import sys; import datetime; import string; import shutil; EPSILON = 1e-10; Product_volume_dict = {}; START_TIME='20:55:00'; END_TIME='02:45:00'; if len(sys.argv) != 3: print 'Usage: ./cmd src_md_dir dest_dir'; quit(); src_md_path = sys.argv[1]; dest_dir =...
cc0-1.0
9,175,642,032,795,453,000
40.5
108
0.566778
false
3.163828
false
false
false
fogonwater/pystatsnz
pystatsnz.py
1
3198
import csv, json from requests import get # TODO: fix this shortcut to suppress insecure platform errors # see http://stackoverflow.com/questions/29099404/ssl-insecureplatform-error-when-using-requests-package import requests.packages.urllib3 requests.packages.urllib3.disable_warnings() class Api(): def __init__(...
mit
5,728,556,928,440,717,000
42.216216
105
0.61132
false
3.933579
false
false
false
Azure/azure-sdk-for-python
sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_images_operations.py
1
22101
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
1,627,655,324,539,426,600
49.343964
212
0.646622
false
4.250192
true
false
false
lferr/charm
charm/schemes/ibenc/ibenc_bf01.py
1
3654
''' Boneh-Franklin Identity Based Encryption | From: "D. Boneh, M. Franklin Identity-Based Encryption from the Weil Pairing", Section 4.2. | Published in: Crypto 2003 | Available from: http://.../bfibe.pdf | Notes: This is the IBE . * type: encryption (identity-based) * setting: bilinear groups (as...
lgpl-3.0
-5,178,874,266,902,869,000
31.052632
98
0.519978
false
3.216549
false
false
false
Dbz/Algorithms
algorithms/zero_matrix.py
1
2122
#!/usr/bin/env python3 """Python solution for CtCI 6th Edition Problem 1.8 Write an algorithm such that if an element in an MxN matrix is 0, its entire row and column are set to O. No element is 0 >>> zero_matrix([['q', 'w', 'e'], ['a', 's', 'd'], ['z', 'x', 'c']]) [['q', 'w', 'e'], ['a', 's', 'd'], ['z', 'x', 'c']] ...
mit
5,378,833,431,025,788,000
39.037736
105
0.497172
false
2.959554
false
false
false
AIFDR/inasafe-django
django_project/realtime/models/flood.py
2
10415
# coding=utf-8 """Model class for flood realtime.""" from builtins import object from django.contrib.gis.db import models from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ from realtime.models.mixins import BaseEventModel from realtime.models.report import BaseEventR...
bsd-2-clause
4,859,275,019,791,020,000
30.850153
79
0.606625
false
4.16267
false
false
false
williamspinelli/a-tiny-tractor
sounds/wav2c.py
1
1754
# !/usr/bin/env python # -*- coding: utf-8 -*- import os.path import sys import wave def wav_to_c(wav_filename, code_filename, array_name): with wave.open(wav_filename, 'r') as wav_file, \ open(code_filename, 'w') as code_file: length = wav_file.getnframes() if wav_file.getnchannels()...
gpl-3.0
-7,113,086,172,681,097,000
24.42029
76
0.531927
false
3.029361
false
false
false
Aracthor/super_zappy
AI/python/Class.py
1
1197
#!/usr/bin/python3 ## Class.py for super_zappy in /home/aracthor/programs/projects/hub/super_zappy/ia/python ## ## Made by aracthor ## Login <aracthor@epitech.net> ## ## Started on Wed Feb 25 09:13:41 2015 aracthor ## Last Update Wed Feb 25 09:20:14 2015 aracthor ## from Enums import EAction class Class: ...
gpl-2.0
7,092,985,649,185,338,000
26.837209
89
0.502089
false
3.343575
false
false
false
alexfalcucc/douglas_bot
external/quotes.py
1
3514
#!/usr/bin/env python # -*- coding: utf-8 -*- import urllib3 import webdriverplus as webdriver import os import pickledb import json # simulate GUI from pyvirtualdisplay import Display # need selenium webdriver to set the firefoxprofile from selenium import webdriver as old_webdriver # webdriverplus is a fork of seleni...
mit
-7,480,933,930,242,595,000
38.449438
145
0.641128
false
3.247919
false
false
false
p5a0u9l/clamm
clamm/lp2flac/z_streamr.py
1
2767
#!/usr/bin/env python import pyaudio import zmq import socket import sys import time import wave from subprocess import Popen, call from glob import glob from os.path import join import os # Record over network usage example # on remote machine #$ ./streamr.py callisto stream sound # on local machine #$ ./streamr.py ...
mit
665,339,603,792,546,600
20.617188
77
0.600289
false
3.19515
false
false
false
scharch/SONAR
annotate/1.0-preprocess.py
1
35368
#!/usr/bin/env python3 """ 1.0-preprocess.py This script preprocesses raw sequencing data in preparation for VDJ analysis. Paired end fastq files will be filtered and merged using vsearch, or single read fastq or fasta files can be specified. For fastq input, an optional QC analysis can be printed (from vsear...
gpl-3.0
-103,232,163,899,465,090
45.353866
333
0.630909
false
3.31099
false
false
false
quake0day/oj
twoSum.py
1
1136
class Solution: """ @param numbers : An array of Integer @param target : target = numbers[index1] + numbers[index2] @return : [index1 + 1, index2 + 1] (index1 < index2) """ def twoSum(self, numbers, target): # write your code here res = [None] * 2 if numbers == None or le...
mit
-6,051,487,077,569,303,000
26.707317
62
0.453345
false
3.331378
false
false
false
bmya/odoo-support
server_mode_mail/ir_mail_server.py
1
2283
# -*- coding: utf-8 -*- ############################################################################## # # BizzAppDev # Copyright (C) 2015-TODAY # bizzappdev(<http://www.bizzappdev.com>). # ADHOC SA(<http://www.adhoc.com.ar>). # # This program is free software: you can redistribute it and/or modify # ...
lgpl-3.0
8,088,813,055,704,178,000
40.509091
80
0.621113
false
4.106115
false
false
false
lmazuel/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/frontend_ip_configuration.py
1
4798
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
-3,780,247,768,488,350,000
46.50495
103
0.645894
false
3.91035
false
false
false
chinoio/chino-django
app/serializers.py
1
1131
from rest_framework import serializers class AuthUserSerializer(serializers.Serializer): id = serializers.IntegerField(read_only=True) # Therapist or patient.. type = serializers.IntegerField(read_only=True) username = serializers.CharField(read_only=True) first_name = serializers.CharField() ...
mit
5,708,241,747,229,410,000
30.416667
59
0.740053
false
4.267925
false
false
false
azariven/BioSig_SEAS
SEAS_Utils/common_utils/data_loader.py
1
14528
#!/usr/bin/env python # # Copyright (C) 2017 - Massachusetts Institute of Technology (MIT) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option...
gpl-3.0
-5,342,296,462,413,592,000
28.954639
160
0.517896
false
3.455756
false
false
false
toymachine/venster
test/test_bmp.py
1
2750
## Copyright (c) 2003 Henk Punt ## Permission is hereby granted, free of charge, to any person obtaining ## a copy of this software and associated documentation files (the ## "Software"), to deal in the Software without restriction, including ## without limitation the rights to use, copy, modify, merge, publish, #...
mit
9,174,892,814,886,544,000
36.162162
91
0.658545
false
4.020468
false
false
false
tomchristie/django-rest-framework
rest_framework/mixins.py
5
2937
""" Basic building blocks for generic class based views. We don't bind behaviour to http method handlers yet, which allows mixin classes to be composed in interesting ways. """ from rest_framework import status from rest_framework.response import Response from rest_framework.settings import api_settings class Create...
bsd-2-clause
-4,414,712,788,175,600,600
29.915789
89
0.655431
false
4.195714
false
false
false
DXCanas/kolibri
kolibri/core/content/utils/content_types_tools.py
1
1025
from django.db.models import Q from le_utils.constants import content_kinds from kolibri.core.content.hooks import ContentRendererHook from kolibri.core.content.models import ContentNode # Start with an empty queryset, as we'll be using OR to add conditions renderable_contentnodes_without_topics_q_filter = ContentNod...
mit
282,220,592,801,547,740
52.947368
122
0.767805
false
3.897338
false
false
false
delta2323/chainer
chainer/variable.py
1
34200
import collections import copy import heapq import traceback import warnings import weakref import numpy import chainer from chainer import cuda from chainer import initializers from chainer.initializers import constant from chainer import utils from chainer.utils import argument def _check_grad_type(func, x, gx): ...
mit
537,050,810,130,950,300
32.529412
79
0.579415
false
4.37564
false
false
false
barracudanetworks/constantsgen
constantsgen/pythonwriter.py
1
1079
class PythonWriter: def __init__(self, constants): self.constants = constants def write(self, out): out.write("# This file was generated by generate_constants.\n\n") out.write("from enum import Enum, unique\n\n") for name, enum in self.constants.enum_values.items(): ...
bsd-3-clause
-7,861,601,442,098,461,000
40.5
79
0.570899
false
4.281746
false
false
false
EmreAtes/spack
var/spack/repos/builtin/packages/openmc/package.py
1
3605
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
-758,988,000,441,825,400
38.615385
79
0.624133
false
3.965897
false
false
false
sheerfish999/torpedo
modules/frame.py
1
13386
# -*- coding: utf-8 -*- import sys,os import codecs import glob import time import datetime import traceback import keyboard # pip install keyboard 同时支持 windows linux if sys.version_info.major==2: #python2 import HTMLParser #pip install HTMLParser if sys.version_info.major==3: #python3 fr...
gpl-3.0
-925,380,651,203,970,800
17.897611
195
0.601218
false
2.19548
false
false
false
dougfelt/nototools
nototools/unicode_data.py
1
52933
#!/usr/bin/env python # -*- coding: utf-8 -*-# # Copyright 2014 Google 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/LICENSE...
apache-2.0
6,322,595,101,504,638,000
30.696407
101
0.670092
false
3.280429
false
false
false
googleapis/python-pubsublite
samples/snippets/update_lite_topic_example.py
1
3703
#!/usr/bin/env python # Copyright 2020 Google 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/LICENSE-2.0 # # Unless required...
apache-2.0
-1,172,727,149,755,602,000
37.978947
93
0.672968
false
3.939362
true
false
false
williamthegrey/swift
swift/proxy/controllers/base.py
1
72473
# Copyright (c) 2010-2016 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 agree...
apache-2.0
-1,988,472,253,918,378,500
39.968344
79
0.564803
false
4.407261
false
false
false
RedFantom/GSF-Parser
parsing/shipstats.py
1
11903
""" Author: RedFantom Contributors: Daethyra (Naiii) and Sprigellania (Zarainia) License: GNU GPLv3 as in LICENSE Copyright (C) 2016-2018 RedFantom """ # Standard Library import os import _pickle as pickle # Project Modules from data.components import COMPONENT_TYPES, COMP_TYPES_REVERSE, COMPONENTS from parsing.ships i...
gpl-3.0
3,987,662,688,580,680,000
41.359431
120
0.588507
false
3.848367
false
false
false
bluec0re/python-sftpsync
sftp_sync/sync.py
1
28706
# vim: set ts=8 sw=4 tw=0 fileencoding=utf-8 filetype=python expandtab: from __future__ import print_function, absolute_import, division, unicode_literals from datetime import timedelta import sys import os import stat import time try: from configparser import ConfigParser except ImportError: from ConfigParser...
mit
-6,991,470,628,088,589,000
36.183938
111
0.470111
false
4.42584
false
false
false
khchine5/atelier
atelier/sphinxconf/base.py
1
15268
# -*- coding: utf-8 -*- # Copyright 2011-2018 by Luc Saffre. # License: BSD, see LICENSE for more details. """ Basic extension Sphinx setup used to build the Lino documentation. .. rst:role:: blogref Inserts a reference to the blog entry of the specified date. Instead of writing ``:doc:`/blog/2011/0406``...
bsd-2-clause
7,581,732,448,865,845,000
32.480263
113
0.608567
false
3.614347
false
false
false
UNESCO-IHE/HILAB-HBV
Python/HBV96.py
1
17350
# -*- coding: utf-8 -*- """ ====== HBV-96 ====== Lumped hydrological model. This is the HBV-96 implementation by Juan Chacon at IHE-Delft, NL. This code implements the HBV-96 version, as described in Lindstrom et al (1997) https://doi.org/10.1016/S0022-1694(97)00041-3 @author: Juan Carlos Chacon-Hurtado (jc.chaconh@...
mit
-4,361,347,400,049,827,000
25.774691
92
0.552219
false
3.192272
false
false
false
zer0yu/ZEROScan
thirdparty/requests/structures.py
1
5669
# -*- coding: utf-8 -*- """ requests.structures ~~~~~~~~~~~~~~~~~~~ Data structures that power Requests. """ import collections import time from .compat import OrderedDict current_time = getattr(time, 'monotonic', time.time) class CaseInsensitiveDict(collections.MutableMapping): """A case-i...
mit
4,838,865,612,596,390,000
27.221649
80
0.561475
false
4.281722
false
false
false
mkouhei/swiftsc
swiftsc/utils.py
1
2016
# -*- coding: utf-8 -*- """swiftsc utility module.""" import sys from io import BytesIO import magic def check_mimetype(filepath): """Check mimetype of file. :rtype: str :return: mimetype :param str filepath: target filename path """ if hasattr(magic, 'open'): # for python-magic pack...
gpl-3.0
-2,589,625,613,675,024,000
27.394366
74
0.63244
false
3.768224
false
false
false
dotkrnl/gface
lib/util.py
1
2848
#!/usr/bin/env python2.7 # -*- coding: UTF-8 -*- # Copyright 2013 Jason Lau (刘家昌) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
apache-2.0
2,457,447,865,886,612,000
30.577778
74
0.590077
false
2.969697
false
false
false
reingart/gui2py
gui/timer.py
1
1653
#!/usr/bin/python # -*- coding: utf-8 -*- "Timer support " __author__ = "Mariano Reingart (reingart@gmail.com)" __copyright__ = "Copyright (C) 2016- Mariano Reingart" __license__ = "LGPL 3.0" import wx from .component import SubComponent, Spec from . import images from . import registry class Timer(SubComponent):...
lgpl-3.0
7,913,152,990,029,331,000
27.016949
71
0.621295
false
3.509554
false
false
false
ssls/beetle-agent
app/modules/pipelines/resources.py
1
2349
# encoding: utf-8 """ RESTful API pipelines resources -------------------------- """ import logging from flask_restplus import Resource, fields from app.extensions.api import Namespace, abort, http_exceptions from app.modules.common import * from app.modules.common.pipelines import PipelineNotFoundError log = loggin...
mit
8,117,546,758,154,962,000
28
114
0.67135
false
3.994898
false
false
false
buret/pylmflib
pylmflib/utils/uid/uid.py
1
2475
#/usr/bin/python # -*- coding: utf-8 -*- """! @package utils.uid """ # Get command line arguments from optparse import OptionParser parser = OptionParser() parser.add_option("-i", "--input", dest="input", action="store", help="input MDF file") parser.add_option("-o", "--output", dest="output", action="store", help="o...
gpl-2.0
-6,059,706,491,944,531,000
30.303797
131
0.514759
false
3.310576
false
false
false
hortonworks/hortonworks-sandbox
apps/pig/src/pig/urls.py
1
2137
# Licensed to Hortonworks, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Hortonworks, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this f...
apache-2.0
6,368,396,239,865,421,000
53.794872
102
0.665419
false
3.203898
false
false
false
UdS-TelecommunicationsLab/SDNalytics
sdnalyzer/analyzer/services.py
1
10706
# The MIT License (MIT) # # Copyright (c) 2015 Saarland University # # 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
8,786,393,600,759,972,000
43.6125
120
0.602092
false
3.966654
false
false
false
sseguku/simplecensusug
censusreporter/api/utils.py
1
3708
import requests import re from sqlalchemy import create_engine, MetaData, Table from sqlalchemy.orm import sessionmaker from .config import (DB_NAME, DB_USER, DB_PASSWORD, WARD_SEARCH_ENDPOINT) _engine = create_engine("postgresql://%s:%s@localhost/%s" % (DB_USER, DB_PASSWORD, DB_NAME)) _meta...
mit
-6,052,472,200,738,444,000
29.393443
78
0.578209
false
3.83454
false
false
false
mikalstill/nova
nova/virt/disk/api.py
1
23348
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # # Copyright 2011, Piston Cloud Computing, Inc. # # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in ...
apache-2.0
3,088,387,102,896,871,000
33.284875
79
0.613757
false
3.943919
false
false
false
simontegg/valuenetwork
valuenetwork/board/views.py
1
33830
import datetime from django.db.models import Q from django.http import HttpResponse, HttpResponseServerError, Http404, HttpResponseNotFound, HttpResponseRedirect from django.shortcuts import render_to_response, get_object_or_404 from django.core.urlresolvers import reverse from django.contrib.auth.models import User f...
agpl-3.0
4,503,531,930,108,472,300
48.100145
161
0.490748
false
4.696002
false
false
false
fvigo/minemeld-okta
mmokta/tests/test-conversion.py
1
2777
from __future__ import print_function import logging import os import sys import json TESTNAME='test_conversion' logging.basicConfig(filename='/tmp/mmokta.log',level=logging.DEBUG) LOG = logging.getLogger(__name__) # Workaround to allow testing from parent dir PACKAGE_PARENT = '..' SCRIPT_DIR = os.pat...
apache-2.0
866,576,325,552,718,600
32.7125
103
0.57004
false
4.089838
true
false
false
tettoon/vgmplayer-rpi-re
vgm/test_gd3.py
1
2742
# -*- coding: utf8 -*- from __future__ import division, print_function, unicode_literals from io import BytesIO from gd3 import Gd3, Gd3Error import unittest GD3_ENCODING = 'utf-16' class TestGd3(unittest.TestCase): def __write_int32(self, buffer, value): data = bytearray() data.append(value & 0...
apache-2.0
-1,713,584,877,067,592,200
34.184211
82
0.600598
false
3.225573
true
false
false
comoga/gooddata-python
tests/examples/department.py
1
4923
from gooddataclient.dataset import Dataset from gooddataclient import columns class Department(Dataset): department = columns.Attribute(title='Department', folder='Department') name = columns.Label(title='Name', reference='department', folder='Department') def data(self): #data from djan...
bsd-3-clause
4,359,924,595,504,488,400
40.808696
145
0.599025
false
3.760886
false
false
false
floemker/django-wiki
src/wiki/plugins/macros/mdx/macro.py
1
3175
import re import markdown from django.template.loader import render_to_string from django.utils.translation import gettext as _ from wiki.plugins.macros import settings # See: # http://stackoverflow.com/questions/430759/regex-for-managing-escaped-characters-for-items-like-string-literals re_sq_short = r"'([^'\\]*(?:\...
gpl-3.0
2,643,833,534,406,757,400
32.734043
112
0.566698
false
3.914815
false
false
false
huangshiyu13/funnyLittleProgram
huatian-funny/huatian/spider.py
1
3226
# -*- coding=utf8 -*- from urllib import urlencode from requests import Session from extension import mongo_collection import json session = Session() LOGIN_HEADERS = { 'Host': 'reg.163.com', 'Connection': 'keep-alive', 'Pragma': 'no-cache', 'Cache-Control': 'no-cache', 'Accept': 'text/html,applicat...
apache-2.0
-8,155,314,703,180,805,000
33.27957
121
0.548934
false
3.03619
false
false
false
opennode/nodeconductor
waldur_core/structure/serializers.py
1
68803
from __future__ import unicode_literals from collections import defaultdict import json import logging from django.conf import settings from django.contrib import auth from django.core import exceptions as django_exceptions from django.core.validators import RegexValidator, MaxLengthValidator from django.db import mo...
mit
-2,844,360,881,914,625,000
39.615702
120
0.619915
false
4.525918
false
false
false
tudarmstadt-lt/QASelection
src/main/resources/scripts/metrics.py
1
3452
from __future__ import division def mrr(out, th): """Computes MRR. Args: out: dict where each key maps to a ranked list of candidates. Each values is "true" or "false" indicating if the candidate is relevant or not. """ n = len(out) MRR = 0.0 for qid in out: candidates = out[qid]...
apache-2.0
1,401,795,551,204,877,600
24.351145
77
0.567207
false
3.132486
false
false
false
USGSDenverPychron/pychron
pychron/media_storage/smb_storage.py
1
3514
# =============================================================================== # Copyright 2016 ross # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICE...
apache-2.0
-5,191,323,895,816,873,000
31.537037
91
0.560046
false
4.213429
false
false
false
andrewjrobinson/FreeCAD_sf_master
src/Mod/Ship/tankCreateTank/TaskPanel.py
1
6518
#*************************************************************************** #* * #* Copyright (c) 2011, 2012 * #* Jose Luis Cercos Pita <jlcercos@gmail.com> * #* * #* This program is free software; you can redistribute it and/or modify * #* it un...
lgpl-2.1
3,961,647,875,080,523,300
35.034091
133
0.619975
false
3.653587
false
false
false
socialplanning/eyvind
eyvind/controllers/error.py
1
1345
import os.path import paste.fileapp from pylons.middleware import error_document_template, media_path from eyvind.lib.base import * class ErrorController(BaseController): """Generates error documents as and when they are required. The ErrorDocuments middleware forwards to ErrorController when error rela...
gpl-3.0
4,958,770,437,134,226,000
33.487179
72
0.655762
false
4.125767
false
false
false
endlessm/chromium-browser
third_party/angle/third_party/VK-GL-CTS/src/scripts/opengl/gen_es_static_library.py
7
1362
# -*- coding: utf-8 -*- #------------------------------------------------------------------------- # drawElements Quality Program utilities # -------------------------------------- # # Copyright 2015 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use t...
bsd-3-clause
-2,597,670,851,721,639,400
34.842105
78
0.612335
false
3.936416
false
false
false