repo_name
stringlengths
6
61
path
stringlengths
4
230
copies
stringlengths
1
3
size
stringlengths
4
6
text
stringlengths
1.01k
850k
license
stringclasses
15 values
hash
int64
-9,220,477,234,079,998,000
9,219,060,020B
line_mean
float64
11.6
96.6
line_max
int64
32
939
alpha_frac
float64
0.26
0.9
autogenerated
bool
1 class
ratio
float64
1.62
6.1
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
Akrog/cinder
cinder/tests/scheduler/test_host_filters.py
4
38357
# Copyright 2011 OpenStack Foundation # 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 req...
apache-2.0
-3,520,615,006,342,418,400
41.058114
78
0.507574
false
4.371168
true
false
false
rexzhang/rpress
rpress/views/auth.py
1
1484
#!/usr/bin/env python # coding=utf-8 import flask from flask import request, redirect, url_for, flash, abort from flask_login import login_required from rpress.runtimes.template import render_template from rpress.runtimes.auth import user_login, user_logout from rpress.forms import LoginForm auth = flask.Blueprint(...
gpl-3.0
3,280,459,609,077,871,600
30.574468
80
0.669137
false
3.834625
false
false
false
proximate/proximate
sendfile.py
1
8344
# # Proximate - Peer-to-peer social networking # # Copyright (c) 2008-2011 Nokia Corporation # # All rights reserved. # # This software is licensed under The Clear BSD license. # See the LICENSE file for more details. # import os from bencode import fmt_bdecode, bencode from ioutils import get_flen, TCP_Queue, TCPQ_ER...
bsd-3-clause
5,660,686,219,359,146,000
28.69395
120
0.566994
false
3.550638
false
false
false
wizardofozzie/pybitcointools
bitcoin/file_insert.py
1
4125
import io, struct, os, sys, math from binascii import crc32, unhexlify, hexlify from bitcoin.main import * from bitcoin.bci import * from bitcoin.transaction import * #from bitcoin.pyspecials import hexify, unhexify, by def _mk_multisig_scriptpubkey(fo): # make a single output's redeemScript data = fo.read(65...
mit
1,319,070,831,841,523,500
34.25641
110
0.635879
false
3.315916
false
false
false
OpenAddressesUK/common-ETL
bulkinsert.py
1
2134
# # Open addresses ETL Common Library # # Bulk Insert Class # # Version 1.0 (Python) in progress # Author John Murray # Licence MIT # # Purpose Bulk insert items into a MySQl or MariaDB table # # Arguments: database cursor, table name, list of fields, max = maximum buffer (2000), ignore = ...
mit
-4,134,537,101,536,599,600
30.382353
129
0.481256
false
3.817531
false
false
false
garnaat/petard
petard/resource.py
1
1941
# Copyright (c) 2015 Mitch Garnaat. All Rights Reserved # # 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,...
apache-2.0
-7,147,697,005,222,159,000
42.133333
78
0.63627
false
4.513953
false
false
false
hagifoo/gae-pomodoro
app/src/application/handler/__init__.py
1
2303
# coding: utf-8 import json import logging import webapp2 from webapp2_extras import sessions from google.appengine.api.taskqueue import TombstonedTaskError, TaskAlreadyExistsError, DuplicateTaskNameError from domain.entity import User import error class BaseHandler(webapp2.RequestHandler): def dispatch(self): ...
mit
-780,267,513,866,127,100
27.432099
110
0.635258
false
4.15704
false
false
false
imAArtist/simIr
Pipline/moss.py
1
3399
import string import re import os def read_from_dir(path='../Data/singleFile/'): pool = [] dirs = [i for i in os.listdir(path) if i.find('cpp') != -1] for d in dirs: with open(os.path.join(path, d)) as f: pool.append(''.join(f.readlines())) return pool def clearFile(f, pattern=No...
artistic-2.0
-3,107,151,619,041,312,000
27.563025
112
0.50103
false
3.155989
false
false
false
KlemenKobau/pycheckio
Home exercises/min_and_max.py
1
1097
# very ugly solution def min(*args,**kwargs): key = kwargs.get("key",None) if hasattr(args[0],'__iter__') and not isinstance(args[0],str): # is some sort of an iterable object that is not a string args = sorted(args,key=key) if len(args) == 1: args = args[0] args = sorted(args,key=key) return args[0...
mit
3,003,928,824,370,789,400
21.875
64
0.645397
false
2.67561
false
false
false
jbrendel/RESTx
src/python/restx/core/parameter.py
1
10895
""" RESTx: Sane, simple and effective data publishing and integration. Copyright (C) 2010 MuleSoft Inc. http://www.mulesoft.com This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version...
gpl-3.0
7,665,217,387,583,133,000
36.311644
176
0.582744
false
4.09125
false
false
false
qtile/qtile
libqtile/hook.py
2
10136
# Copyright (c) 2009-2010 Aldo Cortesi # Copyright (c) 2010 Lee McCuller # Copyright (c) 2010 matt # Copyright (c) 2010, 2014 dequis # Copyright (c) 2010, 2012, 2014 roger # Copyright (c) 2011 Florian Mounier # Copyright (c) 2011 Kenji_Takahashi # Copyright (c) 2011 Paul Colomiets # Copyright (c) 2011 Tzbob # Copyright...
mit
7,779,694,990,883,977,000
25.534031
86
0.588792
false
4.424269
false
false
false
Ircam-Web/mezzanine-organization
organization/pages/migrations/0014_auto_20161028_1516.py
1
1131
# -*- coding: utf-8 -*- # Generated by Django 1.9.10 on 2016-10-28 13:16 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('pages', '0005_auto_20160923_1219'), ('organization-...
agpl-3.0
5,761,957,583,470,936,000
34.34375
184
0.594164
false
3.996466
false
false
false
omiddavoodi/StellarisInGameLedger
server/ledger.py
1
14030
import zipfile import sys import paradoxparser import datetime TECH_SCORE_MULTIPLIER = 10 ACCUMULATED_ENERGY_MULTIPLIER = 0.1 ACCUMULATED_MINERALS_MULTIPLIER = 0.05 ACCUMULATED_INFLUENCE_MULTIPLIER = 0.05 ENERGY_PRODUCTION_MULTIPLIER = 2 MINERAL_PRODUCTION_MULTIPLIER = 1.5 INFLUENCE_PRODUCTION_MULTIPLIER = 1 NUM_SUBJE...
mit
7,446,365,831,525,162,000
41.644377
129
0.548753
false
3.853337
false
false
false
Fendoe/open-hackathon-o
open-hackathon-server/src/hackathon/config_sample.py
1
4189
# -*- coding: utf-8 -*- # # ----------------------------------------------------------------------------------- # Copyright (c) Microsoft Open Technologies (Shanghai) Co. Ltd. All rights reserved. # # The MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this softw...
mit
1,975,551,654,810,841,000
37.787037
120
0.591549
false
3.378226
false
false
false
853612777/pythontestbrain
test.py
1
1282
#!/usr/bin/python #-*-coding:utf8-*- import pygame from pygame.locals import * from gameobjects.vector2 import Vector2 from sys import exit from random import randint def main(): background_image_path=r'./picture/sushiplate.jpg' sprite_image_path='./picture/fugu.png' SCREEN_SIZE=(640,480) clock=pygame.time.Clock...
gpl-3.0
-4,383,065,302,121,159,000
21.508772
62
0.723869
false
2.880899
false
false
false
theiviaxx/frog-angular
frog/admin.py
1
1945
################################################################################################## # Copyright (c) 2012 Brett Dixon # # 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 ...
mit
765,541,564,951,422,300
39.541667
98
0.675578
false
4.380631
false
false
false
assisi/assisipy-lib
assisipy_utils/examples/arena/show_arena_in_mpl.py
2
1302
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' A simple example of assisilib usage, with arenas shown in a matplotlib visualisation (for testing of shapes, figures that are not from screenshots, etc) ''' from math import pi from assisipy_utils import arena import matplotlib.pyplot as plt from assisipy_utils.are...
lgpl-3.0
7,424,228,556,685,868,000
25.571429
81
0.608295
false
2.812095
false
false
false
brendanzhao/GoogleCodeJam2014
src/1a/full_binary_tree.py
1
1633
import sys FILEPATH = 'B-large-practice' sys.stdin = open(FILEPATH + '.in', 'r') sys.stdout = open(FILEPATH + '.out', 'w') def get_line(): return raw_input() def get_int(): return int(get_line()) def get_ints(): return [int(x) for x in get_line().split()] def max_two_numbers(numbers): largest = 0 second_largest...
mit
-8,946,798,903,781,333,000
23.373134
76
0.644213
false
3.140385
false
false
false
gviejo/ThalamusPhysio
python/main_make_SWS_norm_product.py
1
10943
#!/usr/bin/env python ''' File name: main_ripp_mod.py Author: Guillaume Viejo Date created: 16/08/2017 Python Version: 3.5.2 ''' import sys import numpy as np import pandas as pd import scipy.io from functions import * # from pylab import * from multiprocessing import Pool import os import neurose...
gpl-3.0
-5,185,810,242,031,926,000
32.567485
162
0.606689
false
2.658003
false
false
false
dmargala/tpcorr
examples/plugmap.py
1
12679
#!/usr/bin/env python import matplotlib.pyplot as plt import numpy as np import sys,os import string import math import argparse def read_plugmap(filename): debug=False file=open(filename,"r") doc={} intypedef=False indices={} indices["HOLETYPE"]=8 indices["OBJECT"]=21 indices["ra"]=9...
mit
8,056,772,923,345,085,000
34.024862
259
0.568736
false
2.906028
false
false
false
dustin/couchapp
couchapp/localdoc.py
1
16619
# -*- coding: utf-8 -*- # # This file is part of couchapp released under the Apache 2 license. # See the NOTICE for more information. from __future__ import with_statement import base64 import logging import mimetypes import os import os.path import re import urlparse import webbrowser try: import desktopcouch ...
apache-2.0
-4,242,378,768,020,816,400
37.738928
86
0.482761
false
4.511129
false
false
false
honnibal/spaCy
spacy/tests/vocab_vectors/test_lookups.py
1
4956
# coding: utf-8 from __future__ import unicode_literals import pytest from spacy.lookups import Lookups, Table from spacy.strings import get_string_id from spacy.vocab import Vocab from ..util import make_tempdir def test_lookups_api(): table_name = "test" data = {"foo": "bar", "hello": "world"} lookups...
mit
1,471,401,789,147,549,000
32.04
73
0.628531
false
3.243455
true
false
false
peterfpeterson/mantid
scripts/Muon/GUI/Common/home_tab/home_tab_presenter.py
3
3408
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + from...
gpl-3.0
5,089,843,358,528,657,000
31.457143
120
0.597124
false
4.346939
false
false
false
dankolbman/travel_blahg
blog/models.py
1
3108
import hashlib, random from datetime import datetime from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.login import UserMixin, AnonymousUserMixin from werkzeug.security import generate_password_hash, check_password_hash from geoalchemy2 import Geometry db = SQLAlchemy() class User(db.Model, UserMixin): __...
mit
5,491,943,983,080,167,000
30.08
92
0.686615
false
3.407895
false
false
false
hideshis/scripts_for_research
bug_report_parser/bug_report_activity_parser.py
1
4453
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This script identifies when the bug is fixed, i.e., when the state of the bug becomes "RESOLVED", "VERIFIED", or "CLOSED". At first, this script extracts info. about transitions of the state of the bug. This is done by parsing the history of the bug. After that...
mit
-7,574,184,957,669,207,000
44.385417
144
0.522569
false
3.394055
false
false
false
aistis-/checksum-compare
compare_files.py
1
1084
from os import listdir, rename, walk from os.path import isfile, join, basename, abspath, dirname import sys import hashlib def sha1OfFile(filepath): filepath = abspath(filepath) with open(filepath, 'rb') as f: return hashlib.sha1(f.read()).hexdigest() if sys.argv[1][len(sys.argv[1]) - 1] == '/': sys.argv[1] = ...
mit
-5,876,263,636,446,501,000
23.636364
72
0.647601
false
2.669951
false
false
false
ezietsman/msc-thesis
images/august_phot/trailed_phot_FT.py
1
2444
# script to calculate trailed FT of the lightcurve import astronomy as ast import pylab as pl import scipy.stats as sci #X2 = pl.load('run2_flat.dat') #X = pl.load('ec2117ans_2_cc.dat') X = pl.load('S7651_FF.dat') x = X[:,0] y = X[:,1] z = X[:,2] # original lightcurve #z = X2[:,2] + X2[:,1] N = len(x) fitlength = 1...
mit
6,382,390,253,382,159,000
22.960784
128
0.580196
false
2.424603
false
false
false
kxepal/replipy
replipy/storage.py
1
7359
# -*- coding: utf-8 -*- # # Copyright (C) 2013 Alexander Shorin # All rights reserved. # # This software is licensed as described in the file LICENSE, which # you should have received as part of this distribution. # import base64 import hashlib import pickle import time import uuid from abc import ABCMeta, abstractmet...
mit
2,523,412,038,708,018,700
28.793522
81
0.533361
false
4.202741
false
false
false
pidydx/artifacts
artifacts/source_type.py
1
14168
# -*- coding: utf-8 -*- r"""The source type objects. The source type objects define the source of the artifact data. In earlier versions of the artifact definitions collector definitions had a similar purpose as the source type. Currently the following source types are defined: * artifact; the source is one or more ar...
apache-2.0
3,287,414,802,204,713,500
28.827368
79
0.683724
false
4.215412
false
false
false
mikey1234/script.module.urlresolver
lib/urlresolver/plugins/hostingcup.py
3
3185
''' dailymotion urlresolver plugin Copyright (C) 2011 cyrus007 This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is...
gpl-2.0
-7,937,407,514,562,584,000
36.034884
152
0.603454
false
3.78266
false
false
false
mdprewitt/sigmund_droid
color.py
1
2645
#!/usr/bin/env python3 from ev3dev.ev3 import * from navigation import speak, abort_on_button, sleep from setup_sample_data import people import ev3dev.ev3 as ev3 from PIL import Image import logging import requests import json LOGGER = logging.getLogger(__name__) def setup_color_sensor(mode='COL-REFLECT'): #...
mit
6,551,336,016,505,546,000
28.388889
91
0.587146
false
4.013657
false
false
false
tasleson/lvm-dubstep
lvmdbus/utils.py
1
12198
# Copyright (C) 2015-2016 Red Hat, Inc. All rights reserved. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions # of the GNU General Public License v.2. # # You should have received a copy of the GNU General Public License # a...
gpl-2.0
4,448,699,849,522,849,000
24.202479
74
0.651254
false
2.801562
false
false
false
NanoSmasher/cfvg-discordbot
interpret.py
2
4329
# Parses arithmetic operations with modificaitons: # +,-,*,/,(,) work as they should # & is the AND probability (right associativity) # | is the OR probability (right associativity) # ^ is the XOR probability (right associativity) # sorting: mine. returns list containing level n brackets and indexs # infix2rpn: infix ...
mit
640,299,169,862,140,300
25.89441
190
0.63271
false
2.68882
false
false
false
sheagcraig/python-jss
jss/distribution_point.py
1
47421
#!/usr/bin/env python # Copyright (C) 2014-2018 Shea G Craig, 2018 Mosen # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later versio...
gpl-3.0
7,082,928,960,910,337,000
34.388806
115
0.575125
false
4.254531
false
false
false
csirtgadgets/bearded-avenger
cif/hunter/spamhaus_fqdn.py
1
3154
import logging from csirtg_indicator import Indicator from pprint import pprint from cif.utils import resolve_ns import arrow CONFIDENCE = 9 PROVIDER = 'spamhaus.org' CODES = { '127.0.1.2': { 'tags': 'suspicious', 'description': 'spammed domain', }, '127.0.1.3': { 'tags': 'suspici...
mpl-2.0
-6,501,710,877,080,091,000
27.93578
102
0.484147
false
3.642032
false
false
false
Koheron/zynq-sdk
make.py
2
7794
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import json import jinja2 import yaml import server def append_path(filename, file_path): ''' If a filename starts with './' then it is relative to the config.yml path. ''' if filename.startswith('./'): filename = os.path.join(file...
mit
-384,442,412,388,430,460
32.599138
116
0.594303
false
3.776163
true
false
false
spapageo0x01/dioskrS
dioskr.py
1
1583
#!/usr/bin/python #TODO: create a torrent file for reconstruction purposes! import sys import argparse import os import hashlib from layer_block import BlockStore output_dir = "/mnt/shared_volume/dskrs_field" def input_check(arg): #check if file exists if os.path.isfile(arg) is False: raise argparse...
gpl-3.0
-8,450,636,455,122,632,000
26.77193
116
0.657612
false
3.698598
false
false
false
kracekumar/twython
twython3k/twython.py
1
21271
#! /usr/bin/python """ Twython is a library for Python that wraps the Twitter API. It aims to abstract away all the API endpoints, so that additions to the \ library and/or the Twitter API won't cause any overall problems. Questions, comments? ryan@venodesigns.net """ __author__ = "Ryan McGrath <ryan...
mit
-3,541,911,071,432,089,000
41.457086
80
0.546237
false
4.501799
false
false
false
gdos/serge
serialize.py
2
4746
"""The serialization logic""" import cPickle import copy class InvalidFile(Exception): """The file used to thaw an item was not a valid serialized file""" class Bag(object): """Bag to hold properties""" def __init__(self, **kw): """Initialise the bag""" for name, value in kw.iteritems(): ...
lgpl-3.0
3,953,179,096,236,491,000
25.813559
97
0.576485
false
4.20372
false
false
false
rcbops/quantum-buildpackage
quantum/plugins/openvswitch/ovs_db.py
4
1694
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 Nicira Networks, 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.apach...
apache-2.0
-2,876,906,124,706,180,000
28.206897
78
0.677096
false
3.619658
false
false
false
bijandhakal/pattern
examples/01-web/15-sort.py
21
1208
import os, sys; sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "..")) from pattern.web import GOOGLE, YAHOO, BING, sort # The pattern.web module includes an interesting sort() algorithm. # Ir classifies search terms according to a search engine's total results count. # When a context is defined, it ...
bsd-3-clause
4,632,375,123,827,753,000
40.689655
94
0.627483
false
3.461318
false
false
false
iuga/kronos
kronos/preprocessing/image.py
1
5407
from PIL import Image import numpy as np class Images(object): RESIZE_METHODS = { 'bilinear': Image.BILINEAR, 'nearest': Image.NEAREST, 'lanczos': Image.LANCZOS, 'bicubic': Image.BICUBIC } NORMALIZATION_ZERO_ONE = 'zero_one' NORMALIZATION_MINUS_PLUS_ONE = 'minus_plus_...
mit
3,594,548,231,729,691,000
33.006289
120
0.560015
false
3.946715
false
false
false
lvdongbing/bilean
bilean/engine/policy.py
1
4369
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
apache-2.0
-2,198,763,193,367,899,400
33.952
78
0.563516
false
4.083178
false
false
false
google-research/google-research
eim/models/lars.py
1
5992
# 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
-7,277,091,270,182,323,000
36.685535
92
0.609312
false
3.17037
false
false
false
rrader/sens-o-matic
sensomatic/ui/server.py
1
1143
import asyncio import logging from aiohttp import web from sensomatic.sources import defaults from sensomatic.ui.data_stream import DataStreamHandler from sensomatic.ui.static_utils import static_handler class Server: def __init__(self): self.app = self.create_app() self.handler = self.app.make_h...
mit
-3,038,707,784,990,555,600
31.657143
82
0.64392
false
3.617089
false
false
false
pdasigi/onto-lstm
encoders.py
1
7096
import sys import numpy from overrides import overrides from keras.layers import Embedding, Dropout, LSTM, Bidirectional from onto_attention import OntoAttentionLSTM from embedding import OntoAwareEmbedding class Encoder(object): ''' Encoder is an abstract class that defines a get_encoded_phrase method. ...
apache-2.0
-5,314,260,022,083,649,000
47.272109
108
0.592024
false
4.499683
false
false
false
bgris/ODL_bgris
lib/python3.5/site-packages/spyder/plugins/maininterpreter.py
1
11069
# -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License # (see spyder/__init__.py for details) """Shortcut management""" # Standard library imports from __future__ import print_function import os import os.path as osp import sys # Third party ...
gpl-3.0
-9,007,455,793,979,388,000
46.973451
81
0.541652
false
4.491883
true
false
false
amschaal/bioshare
bioshareX/utils.py
1
14503
from django.shortcuts import redirect, render from django.core.urlresolvers import reverse import os import json from functools import wraps from django.http.response import JsonResponse from django.conf import settings from django.template import Context, Template from rest_framework import status from django.db.mode...
mit
-4,075,465,211,365,027,300
40.201705
255
0.60884
false
3.866436
false
false
false
aio-libs/aiodocker
tests/conftest.py
1
5056
import asyncio import os import sys import traceback import uuid from distutils.version import StrictVersion from typing import Any, Dict import pytest from aiodocker.docker import Docker from aiodocker.exceptions import DockerError API_VERSIONS = { "17.06": "v1.30", "17.09": "v1.32", "17.12": "v1.35", ...
apache-2.0
9,078,576,240,145,594,000
26.037433
87
0.620649
false
3.877301
true
false
false
FermiDirak/RandomForest
main.py
1
2875
import math import numpy as np import matplotlib.pyplot as plt from RandomForest import RandomForest from DecisionTree import Tree from NN import NN number_of_points = 100 #number of data points per class number_of_classes = 3 #number of classes in dataset #data generation: creates spiral dataset with 4 classes and...
mit
-7,192,878,935,116,275,000
30.944444
142
0.653913
false
3.18031
false
false
false
AFFogarty/SEP-Bot
public/sep_search/scraper/article_list_scraper.py
1
1699
from lxml import html import re import requests SEP_URL = "http://plato.stanford.edu/" class ArticleListScraper(): query = None results = None def __init__(self, query): self.set_query(query) def set_query(self, query): # query_no_accents = remove_accents(query) query_no_pose...
mit
-4,051,904,433,752,750,600
30.462963
83
0.532078
false
3.685466
false
false
false
ominux/personfinder
tools/validate_merge.py
16
2793
#!/usr/bin/python2.7 # Copyright 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
apache-2.0
6,933,954,318,731,710,000
37.791667
107
0.637666
false
4.125554
false
false
false
simontakite/sysadmin
pythonscripts/pythonnetworkingcoookbook/chapter5/5_6_send_email_from_gmail.py
2
1870
#!/usr/bin/env python # Python Network Programming Cookbook -- Chapter - 5 # This program requires Python 2.7 or any later version import argparse import os import getpass import re import sys import smtplib from email.mime.image import MIMEImage from email.mime.multipart import MIMEMultipart from email.mime.text im...
gpl-2.0
-5,088,516,377,796,062,000
30.694915
78
0.671658
false
3.762575
false
false
false
Inboxen/Inboxen
inboxen/cms/admin_urls.py
1
1698
## # Copyright (C) 2017 Jessica Tallon & Matt Molyneaux # # This file is part of Inboxen. # # Inboxen 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 #...
agpl-3.0
63,411,465,265,730,070
47.514286
115
0.676678
false
3.240458
false
false
false
michealcarrerweb/LHVent_app
operation_finance/migrations/0033_auto_20170720_2348.py
1
1814
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-07-20 23:48 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('operation_finance', '0032_auto_20170720_1815'), ] op...
mit
1,598,525,994,893,387,000
36.791667
138
0.583793
false
4.392252
false
false
false
ifduyue/sentry
tests/sentry/api/serializers/test_group.py
2
10647
# -*- coding: utf-8 -*- from __future__ import absolute_import import mock import six from datetime import timedelta from django.utils import timezone from mock import patch from sentry.api.serializers import serialize from sentry.api.serializers.models.group import StreamGroupSerializer from sentry.models import ...
bsd-3-clause
-2,061,487,176,131,183,900
33.456311
102
0.58655
false
4.277622
true
false
false
mambocab/cassandra-dtest
snitch_test.py
1
4269
import os import socket from dtest import Tester, debug from tools import since @since('2.2.5') class TestGossipingPropertyFileSnitch(Tester): # Throws connection refused if cannot connect def _test_connect(self, address, port): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.settime...
apache-2.0
3,012,660,398,633,485,300
46.966292
149
0.62989
false
3.575377
true
false
false
rapidpro/ureport-web-participation
features/environment.py
1
1127
import time import uuid as uuid from splinter.browser import Browser from django.contrib.auth.models import User from webparticipation.apps.ureporter.models import Ureporter from webparticipation.apps.ureport_auth.models import PasswordReset def before_all(context): context.browser = Browser('chrome') time.sle...
agpl-3.0
1,241,663,468,293,540,000
31.228571
112
0.703638
false
3.707237
false
false
false
kennedyshead/home-assistant
tests/components/sun/test_trigger.py
2
5420
"""The tests for the sun automation.""" from datetime import datetime from unittest.mock import patch import pytest from homeassistant.components import sun import homeassistant.components.automation as automation from homeassistant.const import ( ATTR_ENTITY_ID, ENTITY_MATCH_ALL, SERVICE_TURN_OFF, SE...
apache-2.0
166,584,854,498,084,400
30.882353
86
0.55369
false
3.888092
true
false
false
SVoxel/R7800
git_home/samba.git/python/samba/ndr.py
9
4875
# -*- coding: utf-8 -*- # Unix SMB/CIFS implementation. # Copyright © Jelmer Vernooij <jelmer@samba.org> 2008 # # 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, ...
gpl-2.0
9,124,250,025,311,887,000
35.646617
86
0.681165
false
3.361379
false
false
false
llasram/puzzles
shipz/transforms.py
1
3773
#! /usr/bin/python import sys import math from math import sin, cos import cPickle as pickle import struct import numpy from numpy import matrix, array from itertools import izip from support import * BITSET_TEMPLATE = \ " %s = (%s & ~(1L << %d)) | (((%s >> %d) & 1L) << %d);" def build_transform_func(i, cube,...
gpl-3.0
-6,583,522,729,625,080,000
31.247863
78
0.482905
false
3.252586
false
false
false
Avira/pootle
pootle/apps/reports/migrations/0001_initial.py
1
1272
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): # Django uses this attribute to recognize squashed migrations, but we are # abusing it to tell Django that this migration replaces a migration # already run and...
gpl-3.0
-2,941,673,925,234,581,500
38.75
195
0.599843
false
4.386207
false
false
false
endlos99/xdt99
test/utils.py
1
21693
import sys import os import re from subprocess import call from config import xdm_py, xhm_py, xvm_py, xas_py, xda_py, xga_py, xdg_py, xbas_py # Utility functions def ordw(word): """word ord""" return (word[0] << 8) | word[1] def chrw(word): """word chr""" return bytes((word >> 8, word & 0xff)) d...
gpl-2.0
-7,286,043,714,069,134,000
34.504092
116
0.528558
false
3.423229
false
false
false
luisfcorreia/rtd2660
programmer/serial1.py
1
1109
# Serial1 Class from threading import Thread class Serial1(Thread): def __init__(self, serialPort, serialBaud): Thread.__init__(self) self.daemon = True self.running = True self.name = 'Serial Thread' self.start() def kill(self): self.running = False def wr...
gpl-2.0
-4,518,309,322,066,550,000
21.18
87
0.450857
false
4.436
false
false
false
KonradBreitsprecher/espresso
src/python/espressomd/io/writer/h5md.py
1
3069
"""Interface module for the H5md core implementation.""" import sys from six import iteritems from ...script_interface import PScriptInterface # pylint: disable=import class H5md(object): """H5md file object. Used for accessing the H5MD core implementation via the PScriptInterface. .. note:: ...
gpl-3.0
8,727,909,045,723,869,000
34.275862
89
0.539264
false
4.353191
false
false
false
jrsix/py-dc
src/platform/org/db.py
12
2046
# -*- coding:utf-8 -*- import MySQLdb import conf class newdb(object): '''数据操作''' def __init__(self,returnDict=False): '返回游标为字典的数据访问对象' self.conn=MySQLdb.connect( host=conf.db_host, user=conf.db_user, ...
apache-2.0
-2,662,783,012,128,413,700
28.144928
82
0.458209
false
4.276596
false
false
false
obrbot/bot-clean
plugins/ignore.py
1
3045
import asyncio from fnmatch import fnmatch import logging from obrbot import hook from obrbot.plugin import HookType plugin_info = { "plugin_category": "core", "command_category_name": "Administration" } logger = logging.getLogger("obrbot") @asyncio.coroutine @hook.sieve() def ignore_sieve(event, hook_even...
gpl-3.0
8,997,325,847,389,618,000
29.757576
113
0.644007
false
3.811014
false
false
false
SEL-Columbia/commcare-hq
corehq/apps/domainsync/management/commands/copy_domain.py
1
10743
from multiprocessing import Process, Queue import sys import os from django.conf import settings from django.core.management.base import BaseCommand, CommandError from casexml.apps.stock.models import StockTransaction, StockReport, DocDomainMapping from corehq.apps.domain.models import Domain from dimagi.utils.couch.da...
bsd-3-clause
-8,145,945,174,143,193,000
41.462451
111
0.544634
false
4.256339
false
false
false
softdev-projects/mta-smart-alerts
login.py
1
3018
"""Module used for dealing with database stuff""" from pymongo import Connection """Json Object Values""" nameKey = 'name' passwordKey = 'password' authenticatedKey = 'authenticated' phoneKey = 'phone' def login(name, password, dbname="users", dbCollectionName="people"): """string name, string password, string ...
isc
-7,034,176,726,047,326,000
26.944444
80
0.662691
false
4.471111
false
false
false
pachyderm/pfs
examples/ml/iris/python/iris-train-python-lda/pytrain.py
2
1093
import pandas as pd from sklearn.discriminant_analysis import LinearDiscriminantAnalysis from sklearn.externals import joblib import argparse import os # command line arguments parser = argparse.ArgumentParser(description='Train a model for iris classification.') parser.add_argument('indir', type=str, help='Input dire...
apache-2.0
-8,617,461,932,297,405,000
25.658537
90
0.722781
false
3.195906
false
false
false
bmazin/ARCONS-pipeline
cosmic/CosmicRun.py
1
5451
import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np from util.ObsFile import ObsFile from util.FileName import FileName from util import utils from util import hgPlot from cosmic.Cosmic import Cosmic import tables from scipy.optimize import curve_fit from hotpix import hotPixels...
gpl-2.0
-4,076,501,517,738,674,700
39.377778
133
0.490185
false
3.95
false
false
false
vipul-tm/DAG
dags-ttpl/subdags/service.py
1
6081
from airflow.models import DAG from airflow.operators.dummy_operator import DummyOperator from datetime import datetime, timedelta from airflow.operators import PythonOperator from airflow.hooks import RedisHook from airflow.models import Variable import logging import itertools import traceback import socket from etl...
bsd-3-clause
-1,639,601,173,176,181,000
36.537037
138
0.621608
false
3.269355
false
false
false
FrankGrimm/text-insights
web/ti/management/commands/fbutils.py
1
12885
from django.core.management.base import BaseCommand, CommandError from django.core.exceptions import * from ti import models import facebook import logging from dateutil import parser import urllib import urlparse import cgi import subprocess import warnings import time import random import string import datetime # ...
mit
-4,785,154,007,406,689,000
35.19382
270
0.557548
false
4.017774
false
false
false
aemerick/galaxy_analysis
analysis/spatial_acf.py
1
2265
import yt import numpy as np from galaxy_analysis import Galaxy from galaxy_analysis.utilities import utilities from astroML.time_series import ACF_EK from astroML.time_series import ACF_scargle from matplotlib import rc fsize = 17 rc('text', usetex=False) rc('font', size=fsize)#, ftype=42) line_width = 3 point_siz...
mit
-1,958,499,865,761,079,600
24.738636
102
0.550552
false
2.775735
false
false
false
t8m8/SwitchSettings
switch_settings_core.py
1
2779
import sublime, sublime_plugin class SettingsWrapper(): SETTINGS_FILE_NAME = 'SwitchSettings.sublime-settings' SS_CURRENT_SETTINGS_NAME = 'current_settings_name' SS_SETTINGS_NAMES = 'settings_names' SS_SETTINGS_CONTENTS = 'settings_contents' def __init__(self): self._buf = None self.settings = sublime.loa...
mit
2,663,929,249,421,894,700
25.730769
95
0.731918
false
3.201613
false
false
false
Casmo888/NTHUOJ_web
install.py
1
1598
''' The MIT License (MIT) Copyright (c) 2014 NTHUOJ team 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, ...
mit
-5,447,285,099,431,688,000
34.511111
78
0.759074
false
3.733645
false
false
false
optimuspaul/pyorient
pyorient/messages/cluster.py
2
9843
# -*- coding: utf-8 -*- __author__ = 'Ostico <ostico@gmail.com>' from pyorient.exceptions import PyOrientBadMethodCallException from ..constants import CLUSTER_TYPE_PHYSICAL, DATA_CLUSTER_ADD_OP, \ DATA_CLUSTER_COUNT_OP, FIELD_BOOLEAN, FIELD_BYTE, FIELD_LONG, FIELD_SHORT, \ FIELD_STRING, DATA_CLUSTER_DATA_RAN...
apache-2.0
-5,414,585,741,678,273,000
30.649518
90
0.596972
false
3.870625
false
false
false
NiclasEriksen/rpg_procgen
utils/scene.py
2
4722
""" A simple scene system. This implements a simple scene system, which combines different scenes or screens and allows you to switch between them. """ from .events import EventHandler __all__ = ["Scene", "SceneManager", "SCENE_ENDED", "SCENE_RUNNING", "SCENE_PAUSED" ] SCENE_ENDED = 0 SCENE_RU...
cc0-1.0
-704,396,925,945,017,200
30.065789
79
0.602711
false
4.223614
false
false
false
stupidamigo/lice-python
lice/tests.py
1
2521
from core import * import os import unittest class TestPaths(unittest.TestCase): def test_paths(self): self.assertEqual(clean_path("."), os.getcwd()) self.assertEqual(clean_path("$HOME"), os.environ["HOME"]) self.assertEqual(clean_path("~"), os.environ["HOME"]) class TestTemplates(unitt...
bsd-3-clause
9,002,063,106,927,393,000
30.911392
90
0.564459
false
4.302048
true
false
false
DerekSelander/LLDB
lldb_commands/pmodule.py
1
11903
# MIT License # # Copyright (c) 2017 Derek Selander # # 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, merg...
gpl-2.0
6,983,881,270,709,104,000
41.20922
193
0.610182
false
3.784738
false
false
false
sebdelsol/pyload
module/plugins/hoster/EuroshareEu.py
1
2455
# -*- coding: utf-8 -*- import re from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class EuroshareEu(SimpleHoster): __name__ = "EuroshareEu" __type__ = "hoster" __version__ = "0.26" __pattern__ = r'http://(?:www\.)?euroshare\.(eu|sk|cz|hu|pl)/file/.*' __descr...
gpl-3.0
-2,460,588,444,662,003,700
35.597015
117
0.586052
false
3.084277
false
false
false
tjhunter/phd-thesis-tjhunter
python/build.py
1
1509
# The definitions of the input and output directories to control where the images are being written. # Defines some imports for matplotlib as well. import os import logging logging.getLogger().setLevel(logging.INFO) if "SAVE_DIR" in os.environ: __path_savefig = os.environ['SAVE_DIR'] logging.info("Saving path: " + _...
apache-2.0
163,665,351,717,856,420
31.106383
100
0.685222
false
3.170168
false
false
false
essepuntato/opencitations
script/dataset_handler.py
1
9362
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2016, Silvio Peroni <essepuntato@gmail.com> # # Permission to use, copy, modify, and/or distribute this software for any purpose # with or without fee is hereby granted, provided that the above copyright notice # and this permission notice appear in all copies. ...
isc
-1,750,072,562,376,391,200
41.554545
102
0.616535
false
3.599385
false
false
false
NickRuiz/wikitrans-pootle
local_apps/wt_articles/management/commands/fetch_translations.py
1
3090
from django.core.management.base import NoArgsCommand, CommandError from django.conf import settings #from wt_articles.models import ArticleOfInterest, SourceArticle, TranslationRequest from wt_translation.models import ServerlandHost from wt_translation.models import UnsupportedLanguagePair, UndefinedTranslator,...
gpl-2.0
2,376,098,625,678,812,700
38.684211
122
0.612945
false
4.098143
false
false
false
zepto/webbrowser
webbrowser/functions.py
1
3120
# This file is part of browser, and contains miscellaneous functions. # # Copyright (C) 2009-2010 Josiah Gordon <josiahg@gmail.com> # # browser is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3...
gpl-3.0
1,126,589,959,228,223,400
31.842105
159
0.622436
false
3.727599
false
false
false
68foxboris/enigma2-openpli-vuplus
lib/python/Screens/ParentalControlSetup.py
7
8615
from Screen import Screen from Components.ConfigList import ConfigListScreen from Components.ActionMap import NumberActionMap from Components.config import config, getConfigListEntry, ConfigNothing, NoSave, configfile from Components.Sources.StaticText import StaticText from Screens.MessageBox import MessageBox from S...
gpl-2.0
-2,981,760,938,787,400,000
45.069519
299
0.758561
false
3.579144
true
false
false
anubia/py_pg_tools
dropper.py
2
6431
#!/usr/bin/env python3 # -*- encoding: utf-8 -*- from casting.casting import Casting from const.const import Messenger as Msg from const.const import Queries from date_tools.date_tools import DateTools from logger.logger import Logger class Dropper: # An object with connection parameters to connect to PostgreS...
agpl-3.0
8,947,907,664,450,909,000
37.73494
79
0.493624
false
4.672965
false
false
false
ReactiveX/RxPY
rx/core/observable/defer.py
1
1155
from typing import Callable, Union from asyncio import Future from rx import throw, from_future from rx.core import Observable from rx.core.typing import Scheduler from rx.internal.utils import is_future def _defer(factory: Callable[[Scheduler], Union[Observable, Future]] ) -> Observable: """Returns a...
mit
7,338,568,146,305,625,000
32
72
0.697835
false
4.547244
false
false
false
lakehanne/ensenso
ensenso_detect/manikin/ununsed/unused_funcs.py
1
5244
# May 18, 2017:: 9:59am # This was the lone regressor extracted from the original classifier in # the regressor code. We have phased this in to the trainClassifierRegressor # code in /manikin/main.py def trainRegressor(args, resnet, bbox_loader): r""" Following the interpretable learning from self-driving examp...
mit
-8,447,022,509,786,860,000
32.832258
105
0.602021
false
3.438689
false
false
false
Flexget/Flexget
flexget/components/backlog/backlog.py
3
4349
from datetime import datetime from loguru import logger from flexget import plugin from flexget.components.backlog.db import BacklogEntry, clear_entries, get_entries from flexget.event import event from flexget.manager import Session from flexget.utils.database import with_session from flexget.utils.serialization imp...
mit
-8,171,266,410,993,751,000
36.817391
115
0.627501
false
4.301682
false
false
false
michaelsmit/openparliament
parliament/imports/parl_cmte.py
1
11228
import datetime import logging import re import time import urllib2 from django.db import transaction from BeautifulSoup import BeautifulSoup import lxml.html from parliament.committees.models import (Committee, CommitteeMeeting, CommitteeActivity, CommitteeActivityInSession, CommitteeReport, CommitteeInSess...
agpl-3.0
-7,497,008,543,799,382,000
42.188462
171
0.62736
false
3.562183
false
false
false
rcanepa/cs-fundamentals
python/interview_questions/longest_palindromic_substring.py
1
3402
"""Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example: Input: "babad" Output: "bab" Note: "aba" is also a valid answer. Example: Input: "cbbd" Output: "bb" """ def is_palindrome(string, low, high): i = low j = high ...
mit
843,714,206,536,434,300
26
95
0.5194
false
2.940363
false
false
false
hellonts/iwork
Iwork/models.py
1
5558
#coding=utf-8 from django.db import models # Create your models here. # create protocol_type class Ssh_protocol(models.Model): ssh_protocol_type = models.CharField(max_length=10) def __unicode__(self): return self.ssh_protocol_type # create Ip class Ip(models.Model): ip_address = models.IPAddress...
gpl-3.0
8,693,521,421,438,800,000
32.281437
65
0.699712
false
3.370528
false
false
false
CodyKochmann/generators
examples/tail.py
1
2187
# -*- coding: utf-8 -*- # @Author: Cody Kochmann # @Date: 2019-05-01 07:54:28 # @Last Modified by: Cody Kochmann # @Last Modified time: 2019-05-02 13:24:38 """ This demonstrates how you can use generator pipelines to implement tail in pure python. """ import os from typing import Iterable # this example does...
mit
6,455,776,862,744,148,000
34.852459
93
0.620027
false
3.70678
false
false
false
mmm444/eie-pro-linux
exp/ana.py
1
1287
import sys from xml.sax.handler import ContentHandler import xml.sax import xml.parsers.expat import ConfigParser import xml.sax from collections import defaultdict class Exact(xml.sax.handler.ContentHandler): def __init__(self): self.state = 0 self.lens = [] def startElement(self, name, attrs): if ...
gpl-2.0
5,238,775,657,370,010,000
27.6
98
0.582751
false
3.31701
false
false
false
sileht/check_mk
web/htdocs/main.py
2
2473
#!/usr/bin/python # -*- encoding: utf-8; py-indent-offset: 4 -*- # +------------------------------------------------------------------+ # | ____ _ _ __ __ _ __ | # | / ___| |__ ___ ___| | __ | \/ | |/ / | # | | | | '_ \ / _ \/ __| |/ /...
gpl-2.0
1,284,514,131,423,132,400
43.963636
101
0.536595
false
3.429958
true
false
false
izzyalonso/tndata_backend
tndata_backend/goals/migrations/0140_auto_20160426_1805.py
2
1387
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import datetime from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('goals', '0139_reset_montly_frequencies'), ] operations = [ migrations....
mit
-5,244,381,456,912,752,000
33.675
125
0.596251
false
3.974212
false
false
false
antoinecarme/pyaf
tests/pickling/test_ozone_pickle.py
1
1484
from __future__ import absolute_import import pandas as pd import numpy as np import pyaf.ForecastEngine as autof import pyaf.Bench.TS_datasets as tsds def pickleModel(iModel): import pickle output = pickle.dumps(iModel) lReloadedObject = pickle.loads(output) output2 = pickle.dumps(lReloadedObject...
bsd-3-clause
3,360,944,208,366,305,300
22.555556
83
0.72035
false
2.640569
false
false
false
cedricbonhomme/shelter-database
shelter/web/views/admin.py
1
2341
#! /usr/bin/env python # -*- coding: utf-8 -*- # ***** BEGIN LICENSE BLOCK ***** # This file is part of Shelter Database. # Copyright (c) 2016 Luxembourg Institute of Science and Technology. # All rights reserved. # # # # ***** END LICENSE BLOCK ***** __author__ = "Cedric Bonhomme" __version__ = "$Revision: 0.2 $" __...
mit
-4,430,197,794,344,298,500
28.2625
85
0.709099
false
3.437592
false
false
false
dubzzz/py-cpp-dependencies
dependencies.py
1
5097
from os import listdir, path import json import re class Logger: def info(self, msg): print(msg) def scan_directory(scan_path, allowed_extensions): r""" scan_path path to scan allowed_extensions extensions to consider """ files = list() for f ...
mit
253,529,975,884,525,700
36.908397
123
0.546792
false
4.058121
false
false
false