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
fabaff/ansible
lib/ansible/plugins/action/__init__.py
1
27431
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible 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) an...
gpl-3.0
2,382,552,310,436,922,000
43.968852
159
0.59914
false
4.302902
false
false
false
YcheLanguageStudio/PythonStudy
study/language_core_and_lib/data_structure/basic_structure/dict_study.py
1
1151
class LetterIndexBimap: def __init__(self): self.char2index_dict = dict() self.index2char_dict = dict() for i in range(0, 25): self.char2index_dict[chr(ord('a') + i)] = i self.index2char_dict[i] = chr(ord('a') + i) def char2index(self, ch): return self.ch...
mit
6,631,630,926,153,669,000
25.159091
92
0.567333
false
2.766827
false
false
false
yolcu/regex
stats.py
1
1474
#!/usr/bin/env python from __future__ import print_function from sys import stdin from signal import signal, SIGPIPE, SIG_DFL def main(): signal(SIGPIPE, SIG_DFL) char_stats = [float('Inf'), -float('Inf'), 0, 0] # Min, Max, Avg, N word_stats = [float('Inf'), -float('Inf'), 0, 0] # Min, Max, Avg, N ...
mit
-7,938,802,534,698,860,000
29.708333
84
0.533243
false
3.16309
false
false
false
ejherran/acaest
Listas/DoubleLoopList.py
1
4771
# - Class to create a double-linked circular list. from DoubleNode import DoubleNode class DoubleLoopList(): def __init__(self): self.head = None # Master reference to the first item in the list self.tail = None # Master reference...
gpl-3.0
-1,631,237,601,568,324,900
29.780645
112
0.390275
false
5.384876
false
false
false
karel-brinda/rnftools
rnftools/mishmash/MasonIllumina.py
1
5762
import rnftools from .Source import Source import snakemake import os class MasonIllumina(Source): """Class for the Mason - Illumina mode (https://www.seqan.de/projects/mason/). Single-end reads and pair-end reads simulations are supported. For pair-end simulations, lengths of both ends must be equal. Args...
mit
-9,209,962,143,865,474,000
35.700637
164
0.537313
false
3.766013
false
false
false
bhairavmehta95/flashcard-helper-alexa-skill
lambda_function.py
1
24184
""" Bhairav Mehta - Alexa Hack the Dorm Competition Decemeber 2016 / January 2017 Alexa Abstractions based off a library developed by Anjishu Kumar """ from ask import alexa import quizlet import json from random import randint ###### HANDLERS ###### # Lambda Handler function def lambda_handler(request_obj, contex...
mit
-3,983,422,360,200,674,300
39.577181
244
0.716465
false
3.396152
false
false
false
s20121035/rk3288_android5.1_repo
external/lldb/scripts/verify_api.py
2
3969
#!/usr/bin/env python import commands import optparse import os import os.path import re import sys def extract_exe_symbol_names (arch, exe_path, match_str): command = 'dsymutil --arch %s -s "%s" | grep "%s" | colrm 1 69' % (arch, exe_path, match_str) (command_exit_status, command_output) = commands.getstatus...
gpl-3.0
8,913,025,677,703,340,000
46.261905
207
0.596372
false
4.074949
false
false
false
yaoyi92/qbox_libxc
util/qbox_dos.py
1
2774
#!/usr/bin/python # qbox_dos.py: extract electronic DOS from Qbox output # generate DOS plot in gnuplot format # use: qbox_dos.py [-last] emin emax width file.r # emin, emax: bounds of plot in [eV] # width: gaussian broadening in [eV] # the DOS is accumulated separately for each spin # With the -last option, only the l...
gpl-2.0
-3,526,923,138,324,216,000
26.465347
76
0.607787
false
2.944798
false
false
false
googleapis/python-bigtable
google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/grpc.py
1
40655
# -*- 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
5,847,444,254,912,788,000
42.998918
104
0.628976
false
4.698371
false
false
false
googleapis/proto-breaking-change-detector
test/comparator/wrappers/test_service.py
1
3415
# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed unde...
apache-2.0
-3,387,512,627,948,391,400
33.494949
82
0.59795
false
4.08982
true
false
false
pczerkas/tempest
tempest/cmd/javelin.py
1
40208
#!/usr/bin/env python # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softwa...
apache-2.0
-8,450,923,955,698,417,000
34.9
79
0.57889
false
4.177455
false
false
false
Weertik/weertik
auth_users/views.py
1
7698
# -*- coding: utf-8 -*- from django.shortcuts import render from django.template import RequestContext, loader from django.contrib import auth from django.contrib.auth.models import User from django.shortcuts import render_to_response from django.http import HttpResponseRedirect from django.core.urlresolvers import rev...
gpl-3.0
5,643,385,532,282,984,000
36.178744
79
0.529236
false
4.641737
false
false
false
weaverba137/rv
setup.py
1
4541
#!/usr/bin/env python # Licensed under a 3-clause BSD style license - see LICENSE.rst import glob import os import sys import ah_bootstrap from setuptools import setup #A dirty hack to get around some early import/configurations ambiguities if sys.version_info[0] >= 3: import builtins else: import __builtin_...
bsd-3-clause
-2,002,494,423,995,351,600
33.664122
79
0.697864
false
3.76534
false
false
false
endlessm/chromium-browser
third_party/catapult/telemetry/telemetry/timeline/chrome_trace_category_filter.py
1
7821
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import re def CreateLowOverheadFilter(): """Returns a filter with the least overhead possible. This contains no sub-traces of thread tasks, so it's on...
bsd-3-clause
8,379,687,264,017,720,000
33.606195
79
0.703746
false
4.062857
false
false
false
dawnpower/nova
nova/network/manager.py
1
96390
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc. # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you...
apache-2.0
375,943,698,876,767,740
43.378453
89
0.55347
false
4.519623
false
false
false
Ruide/angr-dev
angrop/angrop/rop.py
1
16690
from angr.errors import SimEngineError, SimMemoryError from angr.analyses.bindiff import differing_constants from angr import Analysis, register_analysis import chain_builder import gadget_analyzer import common import pickle import inspect import logging import progressbar from errors import RopException from .rop_...
bsd-2-clause
-8,112,325,111,332,007,000
39.809291
118
0.573397
false
4.037252
false
false
false
letops/django-sendgrid-parse
django_sendgrid_parse/migrations/0001_initial.py
1
1575
# -*- coding: utf-8 -*- # Generated by Django 1.9.8 on 2016-07-28 05:54 from __future__ import unicode_literals from django.db import migrations, models import jsonfield.fields class Migration(migrations.Migration): initial = True dependencies = [ ('contenttypes', '0001_initial'), ] operat...
mit
-5,382,535,184,245,046,000
34.795455
117
0.530794
false
4.673591
false
false
false
tolysz/tcldis
tcldis.py
2
42652
from __future__ import print_function import struct import itertools from collections import namedtuple, OrderedDict import _tcldis printbc = _tcldis.printbc def getbc(*args, **kwargs): """ Accepts a keyword argument of: - `tcl_code` - a string of valid Tcl to compile - `tclobj_ptr` - a raw memory a...
bsd-3-clause
-78,312,617,112,609,150
38.23827
164
0.550314
false
3.464263
false
false
false
rchristie/mapclientplugins.simplevizstep
mapclientplugins/simplevizstep/model/simplevizmodel.py
1
10659
''' Created on Aug 12, 2015 @author: Richard Christie ''' import os, sys from opencmiss.zinc.context import Context from opencmiss.zinc.scenecoordinatesystem import SCENECOORDINATESYSTEM_NORMALISED_WINDOW_FIT_LEFT from opencmiss.zinc.status import OK as ZINC_OK from mapclientplugins.simplevizstep.utils import zinc a...
apache-2.0
4,297,409,633,384,326,700
38.332103
105
0.677831
false
4.176724
false
false
false
RPGOne/Skynet
pytorch-master/torch/legacy/nn/SpatialSubtractiveNormalization.py
1
4655
import math import torch from .Module import Module from .Sequential import Sequential from .SpatialZeroPadding import SpatialZeroPadding from .SpatialConvolution import SpatialConvolution from .SpatialConvolutionMap import SpatialConvolutionMap from .Replicate import Replicate from .CSubTable import CSubTable from .CD...
bsd-3-clause
-6,849,874,772,937,031,000
38.117647
117
0.627068
false
3.824979
false
false
false
schenc3/InteractiveROSETTA
InteractiveROSETTA/scripts/protocols_truncated.py
1
26633
import wx import os import os.path import platform import subprocess import multiprocessing import psutil from daemon import daemonLoop from tools import resizeTextControlForUNIX from tools import logInfo from tools import icon from selection import SelectPanel from superimposition import SuperimpositionPanel from mini...
gpl-2.0
-8,787,999,662,965,035,000
50.120921
240
0.564037
false
4.15686
false
false
false
guillempalou/scikit-cv
skcv/multiview/two_views/tests/test_triangulation.py
1
1727
import numpy as np import pickle import os from numpy.testing import assert_array_almost_equal from skcv import data_dir from skcv.multiview.two_views.fundamental_matrix import * from skcv.multiview.util.points_functions import * from skcv.multiview.util.camera import * from skcv.multiview.two_views import triangulat...
bsd-3-clause
-2,687,161,321,226,213,000
25.984375
99
0.676896
false
2.499276
false
false
false
kyper-data/python-highcharts
highcharts/highstock/highstock_types.py
1
19610
# -*- coding: UTF-8 -*- from past.builtins import basestring import json, datetime from .common import Formatter, Events, Position, ContextButton, Options3d, ResetZoomButton, DataGrouping, \ Labels, Marker, Point, PlotBands, States, Tooltip, Title, Zones, Levels, Shadow, \ JSfunction, ColorObject, CSSObject, S...
mit
-7,985,119,377,433,008,000
34.080501
135
0.54615
false
3.975269
false
false
false
qunying/gps
share/support/core/console_utils.py
1
1813
""" This plugin provides highlighting of text in Messages View matched by user defined regular expressions. """ import GPS from gps_utils import hook # number of regexps cu_count = 5 # Initialize preference for regexp with number num def cu_create_preference(num): cu_regexp = GPS.Preference( "Messages:...
gpl-3.0
-6,870,264,987,213,448,000
23.5
72
0.583012
false
3.832981
false
false
false
aritter/twitter_nlp
python/ner/Features.py
1
7652
import sys import re import os import string import subprocess #BASE_DIR = '/home/aritter/twitter_nlp' #BASE_DIR = os.environ['HOME'] + '/twitter_nlp' #BASE_DIR = '/homes/gws/aritter/twitter_nlp' BASE_DIR = 'twitter_nlp.jar' if os.environ.has_key('TWITTER_NLP'): BASE_DIR = os.environ['TWITTER_NLP'] #sys.path.app...
gpl-3.0
5,359,250,534,318,683,000
38.040816
134
0.531887
false
3.258944
false
false
false
aholkner/PoliticalRPG
odsimport.py
1
1309
from odf.opendocument import load from odf.table import Table, TableRow, TableCell from odf.namespaces import TABLENS from odf.text import P def import_ods(path): doc = load(path) db = {} tables = doc.spreadsheet.getElementsByType(Table) for table in tables: db_table = [] db[table.ge...
bsd-2-clause
4,306,628,085,065,820,700
31.75
89
0.509549
false
4.195513
false
false
false
digitalocean/netbox
netbox/dcim/migrations/0093_device_component_ordering.py
1
5321
from django.db import migrations import utilities.fields import utilities.ordering def _update_model_names(model): # Update each unique field value in bulk for name in model.objects.values_list('name', flat=True).order_by('name').distinct(): model.objects.filter(name=name).update(_name=utilities.order...
apache-2.0
7,556,244,809,131,868,000
35.197279
143
0.614922
false
4.150546
false
false
false
Kamalheib/senty
senty/modules/rdma_dev.py
1
1174
#!/usr/bin/env python """ Senty Project Copyright(c) 2017 Senty. This program is free software; you can redistribute it and/or modify it under the terms and conditions of the GNU General Public License, version 2, as published by the Free Software Foundation. This program is distributed in the hope it will be useful...
gpl-2.0
8,281,828,205,370,899,000
25.681818
73
0.706985
false
3.836601
false
false
false
fabioz/Pydev
plugins/org.python.pydev.core/pysrc/tests_python/test_suspended_frames_manager.py
2
6407
import sys from _pydevd_bundle.pydevd_constants import int_types, GENERATED_LEN_ATTR_NAME from _pydevd_bundle.pydevd_resolver import MAX_ITEMS_TO_HANDLE, TOO_LARGE_ATTR from _pydevd_bundle import pydevd_frame_utils def get_frame(): var1 = 1 var2 = [var1] var3 = {33: [var1]} return sys._getframe() de...
epl-1.0
-1,478,246,996,531,170,300
44.119718
206
0.616513
false
3.442773
false
false
false
CuriouslyCurious/shatterednippon
scripts/province_generator.py
1
2478
#!/usr/bin/python # -*- coding: utf-8 -*- from PIL import Image import os import codecs if ("scripts" in os.getcwd()): cwd = os.getcwd().replace("\\scripts", "") else: cwd = os.getcwd() print(cwd) prov_dir = cwd+"\\shatterednippon\\history\\provinces\\" local_dir = cwd+"\\shatterednippon\\localisation\\"...
mit
-6,176,161,133,252,635,000
22.6
135
0.541566
false
2.854839
false
false
false
google-research/google-research
smurf/data/generic_flow_dataset.py
1
4197
# coding=utf-8 # Copyright 2021 The Google Research 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 applicab...
apache-2.0
-4,638,955,777,177,349,000
35.495652
79
0.674529
false
3.659111
false
false
false
henrikalmer/genre-recognition
plot_mix_responses.py
1
1252
import sys import json import pylab as pl import numpy as np from data import load_responses songs, responses = load_responses() # group responses on genre fo = open('data/mix.genres.json', 'r') genres = json.loads(fo.read()) cmap = {'pop': 0, 'rock': 1, 'reggae': 2, 'jazz': 3, 'classical': 4} genre_responses = dict(...
gpl-2.0
-2,135,098,435,710,583,600
28.809524
82
0.648562
false
2.576132
false
false
false
blueskycoco/rtt
bsp/stm32f0x/rtconfig.py
1
3479
import os # toolchains options ARCH='arm' CPU='cortex-m0' CROSS_TOOL='gcc' if os.getenv('RTT_CC'): CROSS_TOOL = os.getenv('RTT_CC') CROSS_TOOL = 'gcc' # cross_tool provides the cross compiler # EXEC_PATH is the compiler execute path, for example, CodeSourcery, Keil MDK, IAR if CROSS_TOOL == 'gcc': PLATFORM = 'gcc...
gpl-2.0
-7,060,390,628,054,017,000
26.393701
130
0.543834
false
2.870462
false
false
false
GregorCH/ipet
test/DiffAndEqualTest.py
1
1841
''' Created on 05.02.2018 @author: gregor ''' import unittest import pandas as pd import numpy as np from ipet.evaluation import IPETFilter Var = "Var" Val = "Val" one_equal = "one_equal" one_diff = "one_diff" all_equal = "all_equal" all_diff = "all_diff" class DiffAndEqualTest(unittest.TestCase): """Test list o...
mit
-6,031,705,541,871,043,000
30.20339
130
0.531233
false
3.513359
true
false
false
CloverHealth/pycon2017
etl_nested/app/models.py
1
4280
import sqlalchemy as sa import sqlalchemy.dialects.postgresql as sa_pg from sqlalchemy.ext import declarative import sqlalchemy.orm as sa_orm from app import constants from app.util.timestamps import utc_now __all__ = [ 'init_database' 'Form' ] SCHEMAS = { 'app': 'clover_app', 'dwh': 'clover_dwh' } ...
bsd-3-clause
-5,249,740,182,038,666,000
28.93007
108
0.659813
false
3.560732
false
false
false
lmazuel/azure-sdk-for-python
azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_os_disk_py3.py
1
3487
# 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
1,544,975,557,484,405,800
48.112676
131
0.649555
false
4.031214
false
false
false
gem/oq-engine
openquake/hazardlib/gsim/lanzano_2019.py
1
24743
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2014-2021 GEM Foundation # # OpenQuake is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of th...
agpl-3.0
-4,709,211,860,352,065,000
76.799363
206
0.746029
false
2.166068
false
false
false
vishakh/metamkt
metamkt/metamkt/views.py
1
10905
from cornice import Service import datetime import hashlib import transaction import convert from models import Action, DBSession, Entity, EntityType, Event, Group, Order, PriceChange, Shares, Transaction, User, \ UserData, ValueChange # ********** Cornice Services ********** # root = Service(name='index', path=...
lgpl-3.0
-3,825,956,341,952,392,700
31.362018
120
0.67602
false
3.530269
false
false
false
CENDARI/editorsnotes
editorsnotes/example-settings_local.py
1
5075
###################### # Required variables # ###################### SECRET_KEY = '' POSTGRES_DB = { 'NAME': '', 'USER': '', 'PASSWORD': '', 'HOST': '', 'PORT': '' } NERD_SERVICE_SERVER = 'http://traces1.saclay.inria.fr/nerd/service/processNERDText' SEMANTIC_STORE = 'Sleepycat' #SEMANTIC_PATH = o...
agpl-3.0
3,544,613,883,434,611,700
24.375
95
0.606502
false
3.278424
false
false
false
ldkge/visfx
spark/recommendations/points.py
1
4041
from pyspark import SparkContext, SparkConf, StorageLevel from pyspark.mllib.linalg import Vectors import numpy as np import json from numpy.linalg import svd from elasticsearch_interface \ import get_es_rdd, save_es_rdd, get_currency_pair_dict from utils import parse_range, parse_dates, modify_record def create_p...
mit
1,229,958,409,515,253,800
33.836207
81
0.497402
false
3.006696
false
false
false
spencerkclark/aospy-obj-lib
aospy_user/calcs/interpolation.py
1
3800
"""Interpolation and zero finding routines. These are all dimension agnostic. """ import xray import numpy as np from scipy.interpolate import interp1d from collections import OrderedDict def sorted_coords(da): """Returns a list of coordinate names based on axis order.""" order = {coord: da.res...
gpl-3.0
-477,074,915,362,125,060
27.787879
69
0.596579
false
4.180418
false
false
false
ooovector/qtlab_replacement
qubit_calibrations/calibrated_readout.py
1
14122
from .readout_pulse import * from .. import readout_classifier from . import excitation_pulse from .. import single_shot_readout import numpy as np import traceback def get_confusion_matrix(device, qubit_ids, pause_length=0, recalibrate=True, force_recalibration=False): qubit_readout_pulse, readout_device = get_...
gpl-3.0
-5,617,561,086,539,546,000
52.090226
142
0.585682
false
3.943591
false
false
false
ktsamis/repose
repose/target/__init__.py
1
4025
from logging import getLogger from qamlib.utils import timestamp from ..connection import Connection, CommandTimeout from .parsers.product import parse_system from .parsers.repository import parse_repositories from ..messages import ConnectingTargetFailedMessage from ..types.repositories import Repositories logger ...
gpl-3.0
8,814,799,234,254,061,000
31.991803
89
0.570435
false
4.427943
false
false
false
kwTheLinuxGuy/frostbyte
DecFunction.py
1
4634
# # === F R O S T B Y T E === ====Decryption Alpha Module==== # By Keith Meifert (2017) # Licensed under the Creative Commons Attribution 4.0 # If you make a fair amount of money using my code commercially, please consider donating. # import random def frostbyteDec(key,...
mit
-8,311,332,502,046,905,000
34.203125
339
0.408934
false
3.372635
false
false
false
mcs07/ChemDataExtractor
chemdataextractor/scrape/csstranslator.py
1
4911
# -*- coding: utf-8 -*- """ chemdataextractor.scrape.csstranslator ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Extend cssselect to improve handling of pseudo-elements. This is derived from csstranslator.py in the Scrapy project. The original file is available at: https://github.com/scrapy/scrapy/blob/master/scrapy/selecto...
mit
-7,836,038,709,914,762,000
38.926829
112
0.687233
false
4.400538
false
false
false
CommonsDev/dataserver
projects/migrations/0001_initial.py
1
2013
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Project' db.create_table(u'projects_project', ( ...
agpl-3.0
6,827,235,984,690,537,000
46.952381
147
0.58768
false
3.666667
false
false
false
att-comdev/drydock
drydock_provisioner/ingester/plugins/yaml.py
1
24311
# Copyright 2017 AT&T Intellectual Property. All other 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
6,543,234,833,431,814,000
35.890744
106
0.561556
false
4.206055
false
false
false
morucci/repoxplorer
repoxplorer/controllers/users.py
1
6635
# Copyright 2016-2017, Fabien Boucher # Copyright 2016-2017, Red Hat # # 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 require...
apache-2.0
4,234,832,941,563,420,700
34.864865
76
0.567596
false
3.947055
false
false
false
picklecai/OMOOC2py
_src/om2pyItem/scaffold/main.py
1
11733
# _*_ coding:utf-8 _*_ #qpy:webapp:babyrecord #qpy:fullscreen #qpy://localhost:8800 """ Babyrecordapp @Author Picklecai """ import os from os.path import exists from bottle import Bottle, ServerAdapter, request, template import sqlite3 import time import datetime from email.header import Header ROOT = os.path.dirnam...
mit
-2,399,050,248,471,428,600
35.950166
131
0.633216
false
2.960863
false
false
false
pi-one/amunweb
amunweb/amun/models.py
1
2030
from django.db import models class initial_connection(models.Model): attacker_ip = models.IPAddressField() attacker_port = models.PositiveIntegerField() victim_ip = models.IPAddressField() victim_port = models.PositiveIntegerField() count = models.PositiveIntegerField(default=1) first_seen = models.DateTimeField...
gpl-2.0
860,344,446,100,767,600
39.6
82
0.738424
false
3.099237
false
false
false
Atrox/haikunatorpy
setup.py
1
1025
#! /usr/bin/env python from setuptools import setup CLASSIFIERS = [ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Pytho...
bsd-3-clause
5,656,050,360,466,256,000
32.064516
67
0.635122
false
3.897338
false
false
false
mstritt/orbit-image-analysis
src/main/python/deeplearn/preprocess_data.py
1
2511
import glob from PIL import Image import numpy as np import os import tqdm import multiprocessing import threading # used instead of proprocess_data.ipynb -> adjust dirs and path separator, here \\ for windows, replace by / for linux # multithreading dies not work -> replaced by for loop dest_dir = 'C:\git\python\glo...
gpl-3.0
1,342,795,322,420,620,800
28.197674
118
0.630426
false
2.892857
false
false
false
stonescar/multi-user-blog
blogmods/handlers/welcome.py
1
1529
from google.appengine.ext import db from .. import utils from main_handler import Handler class Welcome(Handler): """Handler for welcome page""" def count(self): # Collecting statistics for user # Count blog posts by user p = db.GqlQuery("""SELECT * FROM Posts W...
mit
3,792,237,561,269,462,500
32.977778
72
0.509483
false
4.235457
false
false
false
quantumlib/OpenFermion-Cirq
openfermioncirq/experiments/hfvqe/molecular_data/hydrogen_chains/make_rhf_simulations.py
1
3495
# coverage: ignore """ Implement the H2-experiment with OpenFermion and OpenFermion-Cirq """ # Numerical Imports import numpy import scipy import os from openfermion.ops import general_basis_change from openfermioncirq.experiments.hfvqe.molecular_data.molecular_data_construction import (h6_linear_molecule, ...
apache-2.0
3,456,418,451,376,939,000
38.715909
110
0.538484
false
3.849119
false
false
false
tdanford/datacleaning
utils.py
1
5342
import string import re import sys from pprint import pprint """ utils.py is a library of methods for dealing with streams (or lists) of tuples and objects as generated by some of the other libraries for data cleaning, here. """ def query( stream ): """ Takes a generator and returns a list. The terminal operator i...
apache-2.0
2,779,504,615,477,332,000
28.351648
114
0.59079
false
2.776507
false
false
false
lmjohns3/cube-experiment
plots/stable-postures-foot-speed.py
1
3698
import climate import collections import lmj.cubes import lmj.plot import matplotlib.colors import numpy as np import pandas as pd COLORS = { 'marker00-r-head-back': '#9467bd', 'marker01-r-head-front': '#9467bd', 'marker02-l-head-front': '#9467bd', 'marker03-l-head-back': '#9467bd', 'marker07-r-sh...
mit
6,808,240,918,538,263,000
29.816667
86
0.522445
false
2.440924
false
false
false
moopie/botologist
plugins/redditeu.py
1
6865
import logging log = logging.getLogger(__name__) import random import re import botologist.plugin class Bitcoin: currencies = ( 'Razielcoins', 'bitcoins', 'cmd.exe resizes', 'scotweb extortions', 'warp-in staplers', 'dead Palestinian children', 'typematrix keyboards', 'marble eggs in a shitty condom', 'clean...
mit
1,645,002,937,080,925,200
31.206573
89
0.678571
false
2.636434
false
false
false
djstein/messages-grailed
project/api/migrations/0001_initial.py
1
1569
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-03-10 21:26 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migratio...
mit
-5,269,600,860,185,608,000
34.659091
135
0.574888
false
4.382682
false
false
false
lightrabbit/PyBitmessage
src/addresses.py
1
10807
import hashlib from struct import * from pyelliptic import arithmetic #There is another copy of this function in Bitmessagemain.py def convertIntToString(n): a = __builtins__.hex(n) if a[-1:] == 'L': a = a[:-1] if (len(a) % 2) == 0: return a[2:].decode('hex') else: return ('0'...
mit
8,261,789,843,015,548,000
37.459075
255
0.656519
false
3.818728
false
false
false
chrissly31415/amimanera
competition_scripts/crawldata.py
1
5442
#!/usr/bin/env python # -*- coding: utf-8 -*- """ crawl data """ import pandas as pd import re import math def crawlHTML(lXall): """ crawling raw data """ print("Crawling html data...") basedir='../stumbled_upon/raw_content/' #phtml = re.compile("</[^>]*?>") phtml = re.comp...
lgpl-3.0
596,703,456,825,445,100
29.926136
155
0.599412
false
2.970524
false
false
false
adarnimrod/template
setup.py
1
2042
#!/usr/bin/env python # pylint: disable=missing-docstring from setuptools import setup, find_packages from template import __doc__ as description extras_require = { "dev": ["pipenv"], "jmespath": ["jmespath"], "netaddr": ["netaddr"], "toml": ["toml"], "yaml": ["PyYAML"], } # Flatten the list and a...
agpl-3.0
2,910,190,702,474,790,000
33.610169
137
0.609696
false
3.874763
false
false
false
lovelysystems/pyjamas
library/pyjamas/ui/StackPanel.py
1
5218
# Copyright 2006 James Tauber and contributors # # 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 agre...
apache-2.0
-5,082,998,882,754,425,000
29.694118
82
0.602913
false
3.850923
false
false
false
abstrakraft/rug
rug/repo.py
1
2341
import project class Repo_Rev(project.Revset): @staticmethod def find_repo(repo_finder): return repo_finder.project.manifest_repo class Repo(object): valid_repo = project.Project.valid_project rev_class = Repo_Rev def __init__(self, repo_dir, output_buffer=None): from project import Project self.project =...
gpl-3.0
-4,722,654,965,405,647,000
29.802632
126
0.703973
false
2.974587
false
false
false
ryepdx/account_payment_ccapi_authdotnet
sale_order.py
1
4286
from openerp.osv import osv, fields class sale_order(osv.osv): _inherit = "sale.order" def _get_prod_acc(self, product_id, journal_obj, context=False): if product_id and product_id.property_account_income: return product_id.property_account_income.id elif product_id and product_id....
agpl-3.0
1,730,736,720,920,891,000
51.268293
210
0.585861
false
3.487388
false
false
false
z-Wind/Python_Challenge
Level16_gif palette.py
1
1534
# http://www.pythonchallenge.com/pc/return/mozart.html __author__ = 'chihchieh.sun' from PIL import Image import urllib.request from io import BytesIO def getImg(url): # User Name & Password password_mgr = urllib.request.HTTPPasswordMgrWithDefaultRealm() top_level_url = 'http://www.pythonchall...
mit
-3,434,674,608,681,263,600
26.407407
79
0.626467
false
3.327549
false
false
false
bodacea/opendatatools
bigdatatoolkit/settings.py
1
5895
# -*- coding: utf-8 -*- import os gettext = lambda s: s PROJECT_PATH = os.path.abspath(os.path.dirname(__file__)) # Django settings for bdt project. DEBUG = True TEMPLATE_DEBUG = DEBUG SERVER_EMAIL = 'sara.farmer@btinternet.com' ADMINS = ( ('Sara', 'sara@changeassembly.com'), ('Saratoo', 'sara.farmer@btintern...
gpl-3.0
1,394,567,147,018,662,400
29.544041
79
0.636132
false
3.632163
false
false
false
FreeOpcUa/opcua-modeler
uamodeler/uamodeler_ui.py
1
12811
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'uamodeler/uamodeler_ui.ui' # # Created by: PyQt5 UI code generator 5.11.2 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_UaModeler(object): def setupUi(self, UaModeler): ...
gpl-3.0
-2,622,760,638,634,183,700
57.231818
118
0.722738
false
3.816205
false
false
false
jahanzebk/python-text-classifier
FileHandler.py
1
1037
import os import Document as Doc class FileHandler(): def makeLog(self, myFile, msg): logDir = "logs/" os.chdir(logDir) fo = open(myFile, 'a') fo.write(msg + "\n") fo.close() def loadDirs(self, myDir, labelled = False): docs = [] basepat...
mit
5,380,007,130,982,352,000
27.054054
89
0.43973
false
4.650224
false
false
false
magaum/python_dos_irmao
python para zumbis - lista 4.py
1
3133
#exercício 1 import random vetor = [] contador = 0 num_maior = 0 num_menor = 100 while contador <= 9: #biblioteca para gerar números aleatórios c = random.randint(0,100) #adicionando valor a lista 'vetor' vetor.append(c) c = vetor [contador] contador = contador + 1 if c >= num_maior: num_maior = c if c <= num...
gpl-3.0
6,929,219,987,105,890,000
33.175824
134
0.727331
false
2.65812
false
false
false
basecrm/basecrm-python
basecrm/test/testutils.py
1
10199
import unittest import os import random import munch import basecrm def rand(): return str(random.randint(1, 1000000000)) def lazyproperty(function): attribute = '__lazy__' + function.__name__ @property def __lazyproperty(self): if not hasattr(self.__class__, attribute): setattr(s...
mit
-4,958,831,288,083,135,000
27.096419
107
0.547505
false
3.953101
true
false
false
baloo/shinken
shinken/modules/dummy_scheduler.py
1
2365
#!/usr/bin/python #Copyright (C) 2009 Gabes Jean, naparuba@gmail.com # #This file is part of Shinken. # #Shinken 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 yo...
agpl-3.0
7,313,433,403,838,823,000
30.959459
76
0.693869
false
3.808374
false
false
false
UKTradeInvestment/export-wins-data
wins/management/commands/generate_customer_emailses.py
1
3735
from django.conf import settings from django.core.mail import send_mail from django.core.management.base import BaseCommand from ...models import Win, Notification from ...notifications import generate_customer_email, generate_officer_email class Command(BaseCommand): def add_arguments(self, parser): pa...
gpl-3.0
-8,274,257,299,536,668,000
35.262136
83
0.533869
false
4.104396
false
false
false
RedhawkSDR/integration-gnuhawk
qa/tests/qa_boolean_operators.py
1
13128
#!/usr/bin/env python # # Copyright 2004,2007,2008,2010 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at ...
gpl-3.0
-8,088,243,925,242,206,000
40.413249
73
0.490402
false
2.719138
true
false
false
glujan/lapka
lapka/models.py
1
2407
"""Łapka's persistence layer. Represent and operate on data stored in a persistence storage (like a database). """ import pickle _pickle_path = 'fetched_data.pickle' class AnimalBase: """Base class for Animals persistence.""" def __init__(self, **kwargs): """Create an animal instance.""" ...
mit
5,686,128,399,900,805,000
26.033708
80
0.551953
false
4.250883
false
false
false
thatch45/console
curse.py
1
1193
''' The Salt Console, this system is used to display a curses console that posts event and job data as it happens from within Salt ''' # Import python libs import curses # Import salt libs import salt.utils.event class SaltConsole(object): ''' ''' def __init__(self, opts): self.opts = opts ...
apache-2.0
1,075,680,271,039,162,400
19.220339
76
0.506287
false
3.763407
false
false
false
ActiveState/code
recipes/Python/280653_Efficient_database_trees/recipe-280653.py
1
6437
#!/usr/bin/python import MySQLdb class Tree(object): class Anon: pass def __init__(self, conn): self.conn = conn def insert_siblings(self, names, siblingname): self.conn.begin() sibling = self.retrieve(siblingname) cur = self.conn.cursor() cur.execute("UPD...
mit
-1,672,295,614,083,886,300
37.54491
117
0.56284
false
3.486999
false
false
false
auduny/chains
lib/chains/services/integra/__init__.py
1
3831
#!/usr/bin/python2 import sys import time from chains.service import Service from chains.common import log import serial from . import iscp class IntegraService(Service): def onInit(self): log('IntegraService init.') self.model = self.config.get('model') self.ser_dev = self.config.get('...
gpl-2.0
-4,593,960,065,196,200,400
36.558824
108
0.497259
false
4.141622
false
false
false
andrewraharjo/SDCND_Behavioral_Cloning
drive.py
1
2467
import argparse import base64 import json import numpy as np import socketio import eventlet import eventlet.wsgi import time from PIL import Image from PIL import ImageOps from flask import Flask, render_template from io import BytesIO from keras.models import model_from_json from keras.preprocessing.image import Im...
mit
-1,027,597,746,887,725,800
30.240506
112
0.685853
false
3.60146
false
false
false
mvidner/cnetworkmanager
networkmanager/applet/service/connection.py
1
1949
import dbus import os from networkmanager.base import Bus from networkmanager.applet.settings import Settings # server analog of cConnection class Connection(dbus.service.Object): def __init__(self, opath, conmap): assert isinstance(conmap, dict) bus = Bus() dbus.service.Object.__init__(sel...
gpl-2.0
258,665,625,584,957,630
40.468085
100
0.63725
false
3.953347
false
false
false
sapcc/monasca-persister
monasca_persister/repositories/influxdb/abstract_repository.py
1
1908
# (C) Copyright 2016 Hewlett Packard Enterprise Development Company LP # # 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 ap...
apache-2.0
8,951,167,555,298,036,000
36.411765
90
0.718029
false
3.793241
false
false
false
gouravshenoy/airavata
sandbox/simstream/example/openmm_example/openmm_streamer.py
4
4719
# # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may n...
apache-2.0
-140,607,918,609,995,520
30.46
115
0.562195
false
4.414406
false
false
false
HackBulgaria/Odin
students/south_migrations/0013_auto__chg_field_user_avatar__add_unique_user_email__add_field_courseas.py
1
7890
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'User.avatar' db.alter_column(u'students_user', 'avatar...
agpl-3.0
-788,657,566,017,647,900
70.09009
195
0.566413
false
3.651087
false
false
false
dan-cristian/haiot
main/logger_helper.py
1
4021
import socket import logging import inspect import threading from datetime import datetime __author__ = 'Dan Cristian <dan.cristian@gmail.com>' class L: def __init__(self): pass l = None # KEY setting, this filters out message priority from being logged LOGGING_LEVEL = logging.INFO LOG_F...
gpl-2.0
1,799,262,671,442,808,000
40.885417
120
0.626212
false
4.045272
false
false
false
lucaswiman/parsimonious
parsimonious/grammar.py
1
19426
"""A convenience which constructs expression trees from an easy-to-read syntax Use this unless you have a compelling reason not to; it performs some optimizations that would be tedious to do when constructing an expression tree by hand. """ from collections import OrderedDict from inspect import isfunction, ismethod ...
mit
2,163,358,077,710,063,600
38.564155
84
0.621435
false
4.244265
false
false
false
Cloudzero/cloudzero-reactor-aws
test/unit/aws/test_unit_cloudtrail.py
1
4413
# -*- coding: utf-8 -*- # Copyright (c) 2016-present, CloudZero, Inc. All rights reserved. # Licensed under the BSD-style license. See LICENSE file in the project root for full license information. import pytest from reactor.aws.cloudtrail import traverse_map, CloudTrailEvent def test_traverse_map(): d = {'x': ...
bsd-3-clause
2,382,189,271,826,306,000
35.471074
112
0.554725
false
3.37902
false
false
false
douglaswei/stock
script/stockit/function.py
1
5830
#! /usr/bin/python # -*- coding:utf-8 -*- import sys import numpy as np import random import logging __all__ = [ 'TransFeatFromFloats', 'Mean', 'Gradient', 'GradientAngle', 'ConNum', 'ContinousIncrease', 'PairsIncrease', 'CoutNonNeg', 'GradientsBySample', 'ConinousPotiveCount'...
gpl-2.0
7,780,616,057,856,976,000
22.85124
101
0.577616
false
3.237241
false
false
false
EMS-TU-Ilmenau/fastmat
fastmat/inspect/common.py
1
35900
# -*- coding: utf-8 -*- # Copyright 2018 Sebastian Semper, Christoph Wagner # https://www.tu-ilmenau.de/it-ems/ # # 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....
apache-2.0
8,123,056,730,716,135,000
29.868444
80
0.560808
false
4.532256
false
false
false
ankittare/NLP_QuestionGeneration
src/util/RDR_POS/SCRDRlearner/Node.py
1
4600
def tabStr(length): s = "" for i in xrange(length): s += "\t" return s class Node: """ Class representing a node of SCRDR tree """ def __init__(self, condition, conclusion, father = None, exceptChild = None, elseChild = None, cornerstoneCases = [], depth = 0): """ r...
mit
642,892,481,107,128,700
35.8
133
0.58
false
4.323308
false
false
false
willu47/pyrate
docs/conf.py
1
8874
# -*- coding: utf-8 -*- # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import sys # ...
mit
-4,127,852,748,272,299,500
33.395349
85
0.690219
false
3.685216
false
false
false
cblop/tropic
instal-linux/instal/factparser/FactParser.py
1
2172
import os from io import StringIO # noinspection PyUnresolvedReferences from instal.clingo import parse_term from instal.instaljsonhelpers import dict_funs_to_list, trace_dicts_from_file from instal.instalexceptions import InstalCompileError class FactParser(object): """ FactParser See __init__.p...
epl-1.0
4,603,804,719,699,574,300
31.909091
92
0.541436
false
3.941924
false
false
false
poppogbr/genropy
gnrpy/gnr/xtnd/sync4Dapp_new.py
1
16906
# -*- coding: UTF-8 -*- # Genro # Copyright (c) 2004 Softwell sas - Milano see LICENSE for details # Author Giovanni Porcari, Francesco Cavazzana, Saverio Porcari, Francesco Porcari import os import time, datetime from logging.handlers import TimedRotatingFileHandler from logging import Formatter import logging gnrl...
lgpl-2.1
441,285,359,815,141,440
38.410256
112
0.524488
false
3.853659
true
false
false
KaydenIvanov/random-meme-bot
RandomMeme.py
1
14387
#Made by Andre Augusto Leite de Almeida import os import random import collections from PIL import Image, ImageDraw from numpy import array from skimage import img_as_float from skimage.measure import compare_ssim #Fast, but supports only one image on template class Basic_Meme: def __init__(self,folder): ...
mit
-374,368,781,760,749,100
30.61978
107
0.500938
false
3.724308
false
false
false
mgerstner/backintime
common/askpass.py
1
1662
# Copyright (C) 2012-2017 Germar Reitze # # 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 pro...
gpl-2.0
3,322,878,482,488,838,000
28.678571
76
0.663057
false
3.718121
false
false
false
skosukhin/spack
lib/spack/spack/cmd/load.py
1
1770
############################################################################## # Copyright (c) 2013-2017, 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
-8,432,269,622,799,385,000
40.162791
78
0.676271
false
4.23445
false
false
false
openprocurement/openprocurement.tender.openua
openprocurement/tender/openua/views/award_document.py
1
2070
# -*- coding: utf-8 -*- from openprocurement.api.utils import raise_operation_error, error_handler from openprocurement.tender.belowthreshold.views.award_document import TenderAwardDocumentResource from openprocurement.tender.core.utils import optendersresource @optendersresource(name='aboveThresholdUA:Tender Award D...
apache-2.0
-913,681,379,639,213,000
70.37931
171
0.694686
false
4.107143
false
false
false
david-jarman/CookieRower
websocket_server.py
1
1483
import pyrow import json import asyncio from autobahn.asyncio.websocket import WebSocketServerProtocol from autobahn.asyncio.websocket import WebSocketServerFactory class MyServerProtocol(WebSocketServerProtocol): def __init__(self): self.is_open = False def onOpen(self): try: sel...
bsd-2-clause
-8,962,818,085,957,830,000
24.135593
62
0.610249
false
3.986559
false
false
false
jericks/geoscript-py
geoscript/render/mapwindow.py
1
2620
from java import awt from java.awt import image from javax import swing from geoscript import geom, proj, style from org.geotools.geometry.jts import ReferencedEnvelope from org.geotools.map import DefaultMapContext, DefaultMapLayer from org.geotools.renderer.lite import StreamingRenderer from org.geotools.swing impor...
mit
-5,584,584,365,890,114,000
27.478261
89
0.688168
false
3.295597
false
false
false
ContinuumIO/xdata-feat
feat/pumps.py
1
15715
# # Copyright 2015, Jack Poulson # All rights reserved. # # This file is part of Pumps, which was produced as part of the DARPA XDATA # project, and is under the BSD 2-Clause License, which can be found at # http://opensource.org/licenses/BSD-2-Clause # import bz2, gzip, os, pandas, time # import utils home_dir ...
mit
-1,317,769,979,153,420,300
39.294872
412
0.651098
false
3.13986
false
false
false
amol9/wallp
wallp/server/protocol/wp_change_message.py
1
1346
from time import time from mayloop.imported.twisted.internet_protocol import Protocol from ..wallpaper_image import WPImageError from ...util.logger import log class WPState(): NONE = 0 READY = 1 CHANGING = 2 ERROR = 3 def __init__(self): self.state = self.NONE class WPChangeMessage(Protocol, object): def...
mit
7,965,046,102,829,231,000
22.206897
78
0.687221
false
3.024719
false
false
false
caspartse/QQ-Groups-Spider
vendor/pyexcel/plugins/sources/file_output.py
1
1308
""" pyexcel.plugins.sources.file_output ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of output file sources :copyright: (c) 2015-2017 by Onni Software Ltd. :license: New BSD License """ from pyexcel.internal import RENDERER from pyexcel.source import AbstractSource from pyexcel.plugins import...
mit
5,851,435,033,963,996,000
33.421053
76
0.620031
false
3.916168
false
false
false