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
adsorensen/girder
girder/api/v1/resource.py
1
18333
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright 2013 Kitware 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 cop...
apache-2.0
-4,673,234,978,141,301,000
46.618182
100
0.590193
false
4.50221
false
false
false
johndamen/pyeasyplot
easyplot/gui/plotsettings.py
1
4044
from PyQt4 import QtGui, QtCore from .settings import PlotSettings from . import basewidgets as bw from .. import datasets def _marker_field(**kwargs): return bw.Dropdown( ['.', ',', 'o', '*', '+', 'x', 'd', 'D', 'v', '^', '<', '>', 's', 'p', '|', '_'], **kwargs) def _label_f...
gpl-3.0
-7,314,996,505,525,338,000
24.601266
57
0.599159
false
3.462329
false
false
false
iut-ibk/P8-WSC-GUI
3dparty/Editra/src/extern/dexml/_util.py
1
4954
import copy class Error(Exception): """Base exception class for the dexml module.""" pass class ParseError(Error): """Exception raised when XML could not be parsed into objects.""" pass class RenderError(Error): """Exception raised when object could not be rendered into XML.""" pass class Xm...
gpl-2.0
4,871,161,818,355,427,000
36.530303
80
0.636455
false
4.439068
false
false
false
jameslovejoy/apportionment
scripts/apportion.py
1
1096
import math class Apportion: populations = {} seats = {} def __init__(self): f = open('../data/2010.csv', 'r') for line in f: state, pop = [s.strip() for s in line.split(',')] self.seats[state] = 1 self.populations[state] = int(pop.strip()) @classmethod def find_highest_priority(cls): highest = ...
mit
-1,152,712,967,480,970,600
22.340426
74
0.64781
false
2.938338
false
false
false
pasmod/simurg
simurg/scrapper/template.py
1
4965
from selector_finder import find_selector from dragnet import content_extractor from collections import OrderedDict from unidecode import unidecode from bs4 import BeautifulSoup from simurg.clients.fetcher import fetch from simurg.util import is_valid import logging import os.path import time import re def clean_soup...
mit
-8,685,732,525,461,948,000
30.424051
78
0.611682
false
4.110099
false
false
false
misterdanb/midi.py
midi.py
1
21677
import sys import os import struct import array from enum import Enum def bytes_to_uint16(byte_list): return struct.unpack('>H', byte_list[:4])[0] def uint16_to_bytes(value): return struct.pack('>H', value) def bytes_to_uint24(byte_list): return struct.unpack('>I', b'\x00' + byte_list[:3])[0] def uint2...
gpl-3.0
-7,045,622,822,486,815,000
39.068392
95
0.565069
false
3.743869
false
false
false
braams/shtoom
shtoom/ui/qtui/shtoommainwindow.py
1
7392
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'shtoommainwindow.ui' # # Created: Wed Jan 19 15:16:20 2005 # by: The PyQt User Interface Compiler (pyuic) 3.13 # # WARNING! All changes made in this file will be lost! from qt import * class ShtoomMainWindow(QMainWindow): def __i...
lgpl-2.1
666,659,779,956,600,600
43.263473
156
0.700352
false
3.733333
false
false
false
grzes/djangae
djangae/fields/charfields.py
2
1862
from django.core.exceptions import ImproperlyConfigured from django.db import models from djangae.core import validators from google.appengine.api.datastore_types import _MAX_STRING_LENGTH class CharOrNoneField(models.CharField): """ A field that stores only non-empty strings or None (it won't store empty strin...
bsd-3-clause
-2,620,553,355,130,936,300
41.318182
110
0.670784
false
4.074398
false
false
false
Donnerbart/hazelcast-simulator
dist/src/main/dist/bin/benchmark-report.py
1
32024
#!/usr/bin/env python # -*- coding: utf-8 -*- # todo: # - writing html # - pruning of dstats to match running time # - when comparing benchmarks; use 1 color for all plots from 1 benchmark # - if no latency info is found; print warning # - when not a lot of data points, them time issues in gnuplot (use WORKER_PERFORMA...
apache-2.0
4,435,826,421,564,153,300
39.0125
131
0.531147
false
4.008264
false
false
false
smsolivier/VEF
code/hlimit.py
1
2247
#!/usr/bin/env python3 import numpy as np import matplotlib.pyplot as plt import ld as LD import dd as DD from hidespines import * import sys ''' compares difference between Sn and moment equations as cell width --> 0 ''' if (len(sys.argv) > 1): outfile = sys.argv[1] else: outfile = None def getDiff(sol...
mit
-3,564,279,865,597,912,600
24.827586
85
0.653316
false
2.253761
false
false
false
instana/python-sensor
instana/instrumentation/urllib3.py
1
3690
# (c) Copyright IBM Corp. 2021 # (c) Copyright Instana Inc. 2017 from __future__ import absolute_import import opentracing import opentracing.ext.tags as ext import wrapt from ..log import logger from ..singletons import agent from ..util.traceutils import get_active_tracer from ..util.secrets import strip_secrets_f...
mit
-8,290,494,705,377,039,000
37.041237
128
0.557995
false
3.976293
false
false
false
thorwhalen/ut
pdict/special.py
1
5569
"""Special dicts""" __author__ = 'thor' from collections import defaultdict, UserDict from ut.pdict.get import set_value_in_nested_key_path val_unlikely_to_be_value_of_dict = (1987654321, 8239080923) class keydefaultdict(defaultdict): def __missing__(self, key): ret = self[key] = self.default_factory(ke...
mit
-1,439,519,557,595,874,300
34.929032
135
0.514455
false
3.531389
false
false
false
radicalbit/ambari
ambari-server/src/main/resources/common-services/STORM/1.0.1.3.0/package/scripts/nimbus.py
1
3638
#!/usr/bin/env python """ 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");...
apache-2.0
8,656,776,630,715,992,000
32.072727
106
0.765531
false
3.789583
false
false
false
z-plot/z-plot
examples/basics-svg/verticalbars.py
1
2343
#! /usr/bin/env python from zplot import * # populate zplot table from data file t = table('verticalbars.data') # create the postscript file we'll use as our canvas canvas = svg('verticalbars.svg') # on the x-axis, we want categories, not numbers. Thus, we # determine the number of categories by checking the max #...
bsd-3-clause
2,614,298,282,952,092,700
35.046154
76
0.703799
false
3.192098
false
false
false
cs-au-dk/Artemis
WebKit/Tools/Scripts/webkitpy/common/net/layouttestresults_unittest.py
1
7183
# Copyright (c) 2010, Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the...
gpl-3.0
-7,733,571,483,401,349,000
48.19863
219
0.747459
false
3.438487
true
false
false
Chitrank-Dixit/django-fcm
setup.py
1
1550
import os from setuptools import find_packages, setup with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='django-fcm', versio...
mit
-703,198,790,023,050,000
34.227273
103
0.61871
false
3.780488
false
true
false
BradAJ/zipflights
web_app/app/models.py
1
5577
from app import * def ita_search(faa_orig, faa_dest, start_date, end_date, duration = None, out_constraints = None, return_constraints = None, month_search = True): """ faa_orig, faa_dest: FAA airport code strs e.g. 'SFO' start_date, end_date: datetime objs e.g. datetime.date.today(), datetime.date(2015, 2...
mit
-2,482,724,947,257,887,000
43.261905
146
0.607674
false
3.221837
false
false
false
Jailander/COSMOS
kriging_exploration/scripts/explorator.py
1
34183
#!/usr/bin/env python import cv2 import sys import yaml import signal import numpy as np #import utm import matplotlib as mpl import matplotlib.cm as cm import rospy import argparse import actionlib from cosmos_msgs.msg import KrigInfo from cosmos_msgs.srv import CompareModels import kriging_exploration.map_c...
mit
-8,971,978,584,816,281,000
39.694048
455
0.537519
false
3.451782
false
false
false
rcatwood/Savu
savu/plugins/loaders/image_loader.py
1
3329
# Copyright 2014 Diamond Light Source Ltd. # # 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 t...
gpl-3.0
-5,461,242,725,985,273,000
33.319588
79
0.606789
false
3.826437
false
false
false
suyashphadtare/test
erpnext/hr/doctype/appraisal/appraisal.py
1
2344
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import flt, getdate from frappe import _ from frappe.model.mapper import get_mapped_doc from frappe.model.document ...
agpl-3.0
-7,190,961,120,013,383,000
30.253333
122
0.697099
false
3.020619
false
false
false
kryptxy/torrench
torrench/utilities/Config.py
1
4151
""" Config module.""" import logging import os from configparser import SafeConfigParser from torrench.utilities.Common import Common class Config(Common): r""" Config class. This class checks for config file's presence. Also, this class manages TPB/KAT proxies; That is, obtains TPB/KAT URL and ...
gpl-3.0
-2,175,531,742,058,077,200
38.160377
104
0.58781
false
3.854225
true
false
false
Tehsmash/ironic
ironic/tests/test_images.py
1
20411
# Vim: tabstop=4 shiftwidth=4 softtabstop=4 # coding=utf-8 # Copyright 2013 Hewlett-Packard Development Company, L.P. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the Lic...
apache-2.0
1,871,641,000,553,366,800
42.335456
79
0.589535
false
3.568981
true
false
false
mgpyh/django-fluent-comments
setup.py
1
2800
#!/usr/bin/env python from __future__ import print_function from setuptools import setup, find_packages from os import path import codecs import os import re import sys # When creating the sdist, make sure the django.mo file also exists: if 'sdist' in sys.argv or 'develop' in sys.argv: try: os.chdir('flue...
apache-2.0
-491,437,323,616,683,260
30.818182
102
0.633929
false
3.783784
false
false
false
peterbarkley/SurfGeckos
djangosite/snippets/migrations/0012_auto_20170917_2131.py
1
2390
# -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2017-09-18 07:31 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('snippets', '0011_auto_20170917_2103'), ] operations = [ migrations.AlterFie...
mit
5,916,513,155,612,824,000
33.142857
107
0.575732
false
4.134948
false
false
false
rsharris/jun2015lgl
create_script_insert_length_sparse.py
1
17318
#!/usr/bin/env python """ Create a cluster job file to create an average insert length sparsity discriminator track. """ from sys import argv,stdin,stdout,stderr,exit def usage(s=None): message = """ usage: create_script_insert_length_sparse [options] > insert_length_sparse.sh <sub>_<samp>_<type> (require...
gpl-3.0
-284,336,170,452,609,440
33.090551
101
0.636332
false
3.341953
false
false
false
vivisect/synapse
synapse/tools/pushfile.py
1
1334
import os import sys import argparse import synapse.telepath as s_telepath import synapse.lib.output as s_output def getArgParser(): p = argparse.ArgumentParser() p.add_argument('cortex', help='telepath URL for a target cortex') p.add_argument('filenames', nargs='+', help='files to upload') p.add_arg...
apache-2.0
1,528,828,532,409,268,200
24.653846
85
0.587706
false
3.30198
false
false
false
FedoraScientific/salome-paravis
src/PV_SWIG/paravis.py
1
3020
# Copyright (C) 2010-2014 CEA/DEN, EDF R&D # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library ...
lgpl-2.1
6,292,424,748,321,725,000
30.134021
98
0.765232
false
3.540445
false
false
false
viktorradnai/screenwarp
utils/create_chessboard.py
1
2170
#!/usr/bin/python import cv2 import wand.image import wand.color import wand.drawing import sys import logging import argparse logger = logging.getLogger(__name__) def parse_cmdline(): parser = argparse.ArgumentParser(description=''' TODO: insert description.''' ) parser.add_argument('-v', '--ver...
gpl-3.0
882,043,655,816,583,800
32.90625
140
0.632258
false
3.722127
false
false
false
Symphonia/Searcher
ImageView.py
1
4861
from PySide import QtGui, QtCore import sys, os class ImageView(QtGui.QWidget): def __init__(self,imagelist,parent = None): super(ImageView,self).__init__(parent) self.imagesize = None self.mode = '' self.imageList = imagelist[0] self.index = imagelist[1] self.title_label = QtGui.QLabel(self) self.image...
mit
5,924,794,669,647,383,000
32.763889
104
0.687513
false
2.984039
false
false
false
bwall/BAMF
IntegrationQueue/static/cifstrap.py
1
6896
import socket import time import struct import sys import threading import datetime def PrintLog(message): message = "[" + str(datetime.datetime.now()) + "] " + message print message f = open("hashlog.txt", "a") f.write(message + "\n") f.close() class Handler(threading.Thread): def __init__(...
mit
1,397,065,986,422,724,000
37.311111
127
0.518997
false
3.80364
false
false
false
heistermann/wradvis
wradvis/gui.py
1
3615
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2016, wradlib Development Team. All Rights Reserved. # Distributed under the MIT License. See LICENSE.txt for more info. # -----------------------------------------------------------------------------...
mit
-3,702,765,137,946,317,000
31.567568
98
0.604149
false
3.891281
false
false
false
rabernat/xrft
setup.py
1
1391
import os import versioneer from setuptools import setup, find_packages PACKAGES = find_packages() DISTNAME = 'xrft' LICENSE = 'MIT' AUTHOR = 'xrft Developers' AUTHOR_EMAIL = 'takaya@ldeo.columbia.edu' URL = 'https://github.com/xgcm/xrft' CLASSIFIERS = [ 'Development Status :: 4 - Beta', 'License :: OSI Approv...
mit
5,605,376,177,296,393,000
29.23913
65
0.670022
false
3.585052
false
false
false
klyone/PacketTesterXML
PTXML_server.py
1
1324
#! /usr/bin/python # ****************************************************************************** # @file PTXML_client.py # @brief Example using PTXMLServer # # Copyright (C) 2014 # # @author Miguel Jimenez Lopez <klyone@ugr.es> # # ****************************************************************************** ...
lgpl-3.0
-7,830,697,422,475,709,000
32.948718
81
0.592145
false
3.871345
false
false
false
fclesio/learning-space
Python/ims24/ims24/contrators/requester.py
1
3740
#!/usr/bin/env python3.6 # -*- coding: utf-8 -*- # # requester.py # @Author : Gustavo F (gustavo@gmf-tech.com) # @Link : https://github.com/sharkguto # @Date : 17/02/2019 11:06:12 import typing import requests from requests_futures.sessions import FuturesSession from ims24 import logger from ims24.configuration....
gpl-2.0
-6,365,144,988,948,067,000
33.62963
105
0.55
false
4.221219
false
false
false
iddqd1/django-cms
cms/tests/test_check.py
1
7102
# -*- coding: utf-8 -*- from copy import deepcopy import os from django.apps import apps from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.template import base from django.test import SimpleTestCase, TestCase from cms.api import add_plugin from cms.models.pluginmodel...
bsd-3-clause
-8,568,157,656,037,007,000
37.808743
120
0.661222
false
4.001127
true
false
false
enigmampc/catalyst
catalyst/data/continuous_future_reader.py
1
12198
import numpy as np import pandas as pd from catalyst.data.session_bars import SessionBarReader class ContinuousFutureSessionBarReader(SessionBarReader): def __init__(self, bar_reader, roll_finders): self._bar_reader = bar_reader self._roll_finders = roll_finders def load_raw_arrays(self, col...
apache-2.0
-5,301,456,748,954,233,000
32.977716
79
0.523856
false
4.440481
false
false
false
Awingu/open-ovf
py/ovf/env/PlatformSection.py
1
2180
# vi: ts=4 expandtab syntax=python ############################################################################## # Copyright (c) 2008 IBM Corporation # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distr...
epl-1.0
-395,953,434,265,755,460
30.142857
78
0.563303
false
4.72885
false
false
false
jeandet/meson
mesonbuild/mlog.py
1
5948
# Copyright 2013-2014 The Meson development team # 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
-5,709,928,738,078,606,000
28.59204
90
0.632313
false
3.572372
false
false
false
mariusor/tlcal
plusfw/scraper/html.py
1
5805
import plusfw from datetime import datetime from requests import get, post, codes, exceptions import json class Html: """ """ base_uris = { plusfw.LABEL_PFW: "https://www.plusforward.net", plusfw.LABEL_QLIVE: "https://www.plusforward.net", plusfw.LABEL_QIV: "https://www.plusforwa...
mit
-3,542,870,659,403,007,000
32.554913
113
0.566925
false
3.499096
false
false
false
paulhtremblay/boto_emr
boto_emr/get_s3_common_crawl_paths.py
1
1380
import boto3 import os def list_objects(bucket_name, prefix): final = [] session = boto3.Session() client = session.client('s3') next_token = 'init' kwargs = {} while next_token: if next_token != 'init': kwargs.update({'ContinuationToken': next_token}) response = cl...
mit
3,909,192,302,405,928,400
29.666667
83
0.604348
false
3.390663
false
false
false
DrKylstein/tiled-vorticons
keenlib/ted15.py
1
3290
''' Commander Keen 1-3 level loader/saver 2014 <dr.kylstein@gmail.com> ''' from __future__ import print_function import math import rlew import file_gen_util as util RLEW_FLAG = 0xFEFE HEADER_FIELDS = ('width', 'height', 'plane_count', 'unk1', 'unk2', 'unk3', 'unk4', 'plane_size', 'unk5', 'unk6', 'u...
mit
-5,003,504,926,450,260,000
25.111111
80
0.547416
false
3.579978
false
false
false
gabriel-samfira/jrunner
jrunner/jobqueue/workers/simple.py
1
1445
# Copyright 2013 Cloudbase Solutions Srl # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
apache-2.0
-6,615,291,938,239,006,000
26.264151
75
0.70519
false
3.873995
false
false
false
poppogbr/genropy
legacy_packages/dev/main.py
1
1554
#!/usr/bin/env python # encoding: utf-8 import sys import os class Package(object): def config_attributes(self): return dict(comment='dev package', name_short='dev', name_long='dev', name_full='dev') def config_db(self, pkg): #developer table t = pkg.table('de...
lgpl-2.1
-7,410,479,213,271,342,000
30.714286
72
0.530245
false
3.708831
false
false
false
DirkWilhelmi/mikro_tms
rpi_functions.py
1
1501
import ConfigParser from r515.basic_functions import BasicFunctions from r515.basic_settings import BasicSettings from r515.connection import Connection config = ConfigParser.ConfigParser() config.read(['r515.cfg']) conn = Connection(config.get('Connection', 'IP'), config.get('Connection', 'USR'), config.get('Connect...
gpl-2.0
8,981,977,570,421,429,000
14.02
115
0.67022
false
3.063265
true
false
false
cz-maria/Pawel_the_Mage
wrogowie.py
1
3434
import pygame import stale class Enemy(pygame.sprite.Sprite): walking_frames_l = [] walking_frames_r = [] def __init__(self): super().__init__() image = pygame.image.load("knight.png").convert() image.set_colorkey(stale.WHITE) self.walking_frames_l.append(image) ...
mit
7,943,579,829,183,453,000
32.666667
91
0.547175
false
3.599581
false
false
false
I-prefer-the-front-end/I-prefer-the-front-end
iptfe/blog/views.py
1
1283
from django.shortcuts import render from django.http import HttpResponse from blog.models import Post, Comment from django.http import HttpResponseRedirect, HttpResponse from django.core.urlresolvers import reverse def archive(request): all_posts = Post.objects.all(); context = {} context['posts'] = all_p...
mit
-7,611,802,143,038,839,000
28.837209
82
0.670304
false
3.852853
false
false
false
l0b0/tilde
.config/calibre/global.py
1
3641
# calibre wide preferences ### Begin group: DEFAULT # database path # Path to the database in which books are stored database_path = '/home/username/library1.db' # filename pattern # Pattern to guess metadata from filenames filename_pattern = u'(?P<title>.+) - (?P<author>[^_]+)' # isbndb com key # Access key for...
gpl-3.0
1,650,783,839,469,190,100
34.686275
411
0.765659
false
3.342516
false
false
false
TensorVision/MediSeg
eval.py
1
3028
"""Evaluation of the Model. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from datetime import datetime import math import time import tensorflow.python.platform from tensorflow.python.platform import gfile import numpy as np import tensorflow as tf...
mit
-7,461,508,753,181,198,000
25.561404
89
0.652906
false
3.747525
false
false
false
d2emon/generator-pack
src/genesys/generator/generator/name.py
1
2378
import random from fixtures import generator_data GENDER_NEUTRAL = 0 GENDER_MALE = 1 GENDER_FEMALE = 2 def random_generator(selector, generator_id=None, max_value=10): if generator_id is None: generator_id = random.randrange(max_value) return selector(generator_id) class Name: glue = "" d...
gpl-3.0
-4,013,448,233,439,665,000
22.78
89
0.619849
false
3.533432
false
false
false
umlaeute/tto-oracle
OracleClient.py
1
1756
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright © 2015, IOhannes m zmölnig, forum::für::umläute # 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 #...
gpl-2.0
-5,601,967,010,997,971,000
37.086957
126
0.648402
false
3.428571
false
false
false
erinspace/osf.io
api/wb/serializers.py
1
2711
from django.db import IntegrityError from rest_framework import serializers as ser from rest_framework import exceptions from website.files import exceptions as file_exceptions from api.base.serializers import IDField, ShowIfVersion class DestinationSerializer(ser.Serializer): parent = ser.CharField(write_only=...
apache-2.0
3,177,119,665,188,211,000
37.183099
112
0.695315
false
4.028232
false
false
false
JohnOmernik/pimeup
throne/throne.py
1
11168
#!/usr/bin/python #Gateway import time import random import sys import cwiid import json import gevent from collections import OrderedDict import cStringIO import alsaaudio import wave import requests import os import struct import math from dotstar import Adafruit_DotStar import socket WHATAMI = os.path.basename(__fi...
apache-2.0
-4,747,397,339,700,146,000
27.56266
182
0.588378
false
3.455446
false
false
false
KenkoGeek/2book
tobook/tobook/settings.py
1
3747
""" Django settings for tobook project. Generated by 'django-admin startproject' using Django 1.11.3. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ import os ...
mit
3,251,829,976,081,123,000
25.202797
91
0.681879
false
3.381769
false
false
false
ekasitk/sahara
sahara/conductor/api.py
1
17877
# Copyright (c) 2013 Mirantis 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 agreed to in writ...
apache-2.0
-5,505,272,707,848,714,000
36.399582
79
0.618001
false
4.168104
false
false
false
marcosfede/algorithms
adventofcode/2018/21/d21.py
1
2031
def addr(r, a, b): return r[a]+r[b] def addi(r, a, b): return r[a]+b def mulr(r, a, b): return r[a]*r[b] def muli(r, a, b): return r[a] * b def banr(r, a, b): return r[a] & r[b] def bani(r, a, b): return r[a] & b def borr(r, a, b): return r[a] | r[b] def bori(r, a, b): ret...
gpl-3.0
-1,701,008,128,301,558,000
17.981308
148
0.573117
false
2.6139
false
false
false
Phoenix1369/site
judge/models/interface.py
1
3940
import re from django.core.exceptions import ValidationError from django.core.urlresolvers import reverse from django.db import models from django.utils.translation import ugettext_lazy as _ from mptt.fields import TreeForeignKey from mptt.models import MPTTModel from judge.models.problem import Problem from judge.mo...
agpl-3.0
-7,833,119,848,122,889,000
34.818182
114
0.661421
false
4.057673
false
false
false
akretion/odoo
odoo/addons/base/models/ir_module.py
4
42225
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import base64 from collections import defaultdict from decorator import decorator from operator import attrgetter import importlib import io import logging import os import shutil import tempfile import zipfile import re...
agpl-3.0
-8,592,800,491,846,170,000
42.441358
184
0.58958
false
4.101506
false
false
false
sergg75/dataModels
Environment/AirQualityObserved/harvest/madrid_air_quality_harvest.py
1
10084
#!../bin/python # -*- coding: utf-8 -*- from __future__ import with_statement import csv import datetime import json import urllib2 import StringIO import logging import logging.handlers import re from pytz import timezone import contextlib import copy # Entity type AMBIENT_TYPE_NAME = 'AirQualityObserved' # List o...
mit
-1,189,698,492,716,572,200
26.327913
121
0.597679
false
3.347942
false
false
false
MichaelHills/seizure-detection
common/data.py
1
1254
import io import os import os.path def makedirs(dir): try: os.makedirs(dir) except: pass class jsdict(dict): def __init__(self, data): self.__dict__ = data class CachedDataLoader: def __init__(self, dir): self.dir = dir makedirs(dir) # try to load data ...
mit
8,616,434,518,350,097,000
24.08
77
0.541467
false
3.943396
false
false
false
Bauble/bauble.api
bauble/routes/auth.py
1
4072
""" All routes in Bauble use HTTP basic auth. """ from datetime import datetime, timedelta import os import smtplib import bottle from bottle import request import sqlalchemy as sa import bauble import bauble.config as config import bauble.db as db import bauble.email as email from bauble import app, API_ROOT from b...
bsd-3-clause
2,067,726,693,262,682,400
29.38806
122
0.631139
false
3.848771
false
false
false
magfest/mivs
mivs/models.py
1
16621
from mivs import * def href(url): return ('http://' + url) if url and not url.startswith('http') else url class ReviewMixin: @property def video_reviews(self): return [r for r in self.reviews if r.video_status != c.PENDING] @property def game_reviews(self): return [r for r in se...
agpl-3.0
-4,106,034,085,182,044,700
35.610132
190
0.64232
false
3.730864
false
false
false
theo-l/django
django/views/static.py
6
4553
""" Views and functions for serving static files. These are only to be used during development, and SHOULD NOT be used in a production setting. """ import mimetypes import posixpath import re from pathlib import Path from django.http import ( FileResponse, Http404, HttpResponse, HttpResponseNotModified, ) from dja...
bsd-3-clause
607,832,988,565,243,500
32.696296
112
0.626291
false
3.928325
false
false
false
pycrystem/pycrystem
pyxem/signals/tensor_field.py
1
3246
# -*- coding: utf-8 -*- # Copyright 2016-2020 The pyXem developers # # This file is part of pyXem. # # pyXem 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 optio...
gpl-3.0
-612,649,568,791,090,200
27.725664
77
0.637708
false
3.944107
false
false
false
rpm-software-management/librepo
examples/python/download_packages_with_fastestmirror.py
1
1645
#!/usr/bin/env python3 """ librepo - download packages """ import os import os.path import time import librepo CACHE = "fastestmirror.cache" LIBREPOPKG = "librepo-1.2.1-2.fc20.x86_64.rpm" LAMEPKG = "lame-3.99.5-2.fc19.x86_64.rpm" if __name__ == "__main__": # Setup logging def debug_function(msg, _): ...
lgpl-2.1
-5,597,930,237,731,403,000
26.416667
96
0.649848
false
3.11553
false
false
false
mizuy/mizwiki
mizwiki/utils/conv_pukiwiki.py
1
4421
# -*- coding: utf-8 -*- import codecs, os, cStringIO as StringIO, re, sys class IStreamBuffer: @staticmethod def _conv(v): return v.rstrip(u'\n\r') def __init__(self,inputfile): self.input = codecs.getreader('utf-8')(inputfile) self.stack = [] def __iter__(self): r...
mit
-3,868,430,965,057,557,000
25.793939
75
0.434291
false
3.600163
false
false
false
fabian4/trove
trove/guestagent/strategies/backup/experimental/mongo_impl.py
1
4132
# Copyright (c) 2014 eBay Software Foundation # Copyright 2015 Hewlett-Packard Development Company, L.P. and Tesora, 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 L...
apache-2.0
-8,938,092,058,526,218,000
37.259259
78
0.623427
false
3.916588
false
false
false
eciis/web
backend/handlers/resend_invite_handler.py
1
1157
# -*- coding: utf-8 -*- """Resend Invite Handler.""" import json from util import login_required from utils import json_response from utils import Utils from custom_exceptions import NotAuthorizedException from . import BaseHandler from google.appengine.ext import ndb __all__ = ['ResendInviteHandler'] class ResendIn...
gpl-3.0
8,617,821,435,491,337,000
31.138889
81
0.65255
false
4.222628
false
false
false
cossacklabs/acra
wrappers/python/acrawriter/django/__init__.py
1
3334
# Copyright 2016, Cossack Labs Limited # # 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 wri...
apache-2.0
-2,575,220,979,208,501,000
36.044444
95
0.658668
false
4.110974
false
false
false
yugangw-msft/azure-cli
src/azure-cli/azure/cli/command_modules/vm/manual/custom.py
1
1298
# -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incor...
mit
-2,428,169,802,671,132,700
40.870968
76
0.544684
false
4.570423
false
false
false
oskopek/devassistant
test/test_actions.py
1
9352
import os import subprocess import pytest from flexmock import flexmock from devassistant import actions, exceptions from devassistant.dapi import dapicli from test.logger import LoggingHandler class TestActions(object): def setup_class(self): self.ha = actions.HelpAction def test_get_help_contain...
gpl-2.0
671,938,580,066,341,000
35.108108
97
0.590997
false
3.77706
true
false
false
kooksee/TIOT
test/project/src/app/proto/protocol/XBeeProtocol.py
1
11235
# encoding=utf-8 import binascii import json from twisted.internet.protocol import Protocol from app.proto.controller.XbeeController import XBeeController class XBeeProtocol(Protocol): def __init__(self): self.ip = '' self.port = '' def connectionMade(self): #import soc...
gpl-2.0
519,063,358,341,324,000
58.951087
135
0.621846
false
2.654438
false
false
false
LeandroRoberto/sapl
sapl/relatorios/templates/pdf_pauta_sessao_preparar_pysc.py
1
9023
import os request=context.REQUEST response=request.RESPONSE session= request.SESSION if context.REQUEST['data']!='': dat_inicio_sessao = context.REQUEST['data'] pauta = [] # lista contendo a pauta da ordem do dia a ser impressa data = context.pysc.data_converter_pysc(dat_inicio_sessao) # converte data...
gpl-3.0
5,210,098,194,527,518,000
54.432099
211
0.611693
false
2.762227
false
false
false
icereval/osf.io
api/requests/serializers.py
1
3573
from django.db import IntegrityError from rest_framework import exceptions from rest_framework import serializers as ser from api.base.exceptions import Conflict from api.base.utils import absolute_reverse, get_user_auth from api.base.serializers import JSONAPISerializer, LinksField, VersionedDateTimeField, Relationsh...
apache-2.0
5,260,071,083,235,014,000
37.419355
167
0.65799
false
4.178947
false
false
false
thepaul/uftrace
tests/t217_no_libcall_dump.py
1
1525
#!/usr/bin/env python from runtest import TestBase import subprocess as sp TDIR='xxx' class TestCase(TestBase): def __init__(self): TestBase.__init__(self, 'signal', """ uftrace file header: magic = 4674726163652100 uftrace file header: version = 4 uftrace file header: header size = 40 uf...
gpl-2.0
5,009,807,141,104,488,000
35.309524
119
0.658361
false
2.747748
true
false
false
datakortet/django-cms
cms/plugins/teaser/models.py
1
1148
from django.core.cache import cache from django.db import models from django.utils.translation import ugettext_lazy as _ from cms.models import CMSPlugin, Page class Teaser(CMSPlugin): """ A Teaser """ title = models.CharField(_("title"), max_length=255) image = models.ImageField(_("image"), upload...
bsd-3-clause
-9,133,270,745,752,438,000
32.764706
128
0.625436
false
3.751634
false
false
false
aerval/blast_comparison
main.py
1
16353
#!/bin/env python ############################################## # CompareBLASTs # # A tool to compare the found hits from two # # BLAST searches with the same search query. # # # # by Philipp B. Rentzsch # # BCCDC Vancouver, ...
mit
8,680,908,391,460,306,000
41.365285
79
0.538494
false
4.151561
false
false
false
manumathewthomas/Chat-with-Joey
chatbot/chatbot.py
1
31681
# Copyright 2015 Conchylicultor. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
apache-2.0
-8,179,409,403,596,673,000
50.016103
402
0.631009
false
4.327414
true
false
false
codemeow5/PyPack
pypack/protocol.py
1
2657
""" Class and function related to protocol operation """ import datetime import struct MSG_TYPE_SEND = 0x1 MSG_TYPE_ACK = 0x2 MSG_TYPE_RECEIVED = 0x3 MSG_TYPE_RELEASE = 0x4 MSG_TYPE_COMPLETED = 0x5 QOS0 = 0 QOS1 = 1 QOS2 = 2 # MAX_DATETIME = int((datetime.datetime(2500, 1, 1) - datetime.datetime(1970, 1, 1)).total...
mit
-917,027,524,274,186,600
31.802469
101
0.601807
false
3.747532
false
false
false
ioanaantoche/muhaha
ioana/examples/feet.py
1
1624
import sys from naoqi import ALProxy import time def main(robotIP): PORT = 9559 try: motionProxy = ALProxy("ALMotion", robotIP, PORT) except Exception,e: print "Could not create proxy to ALMotion" print "Error was: ",e sys.exit(1) try: postureProxy = ALProxy("A...
gpl-2.0
-554,343,618,440,317,800
26.083333
90
0.649631
false
3.314286
false
false
false
BreakawayConsulting/pyxmlerrors
pyxmlerrors.py
1
3091
""" Copyright (c) 2013 Breakaway Consulting Pty. Ltd. 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, publ...
mit
8,063,784,138,228,915,000
34.528736
116
0.733096
false
4.137885
false
false
false
LaurentClaessens/phystricks
manual/phystricksIllusionNHwEtp.py
1
1130
# -*- coding: utf8 -*- from phystricks import * def IllusionNHwEtp(): pspict,fig = SinglePicture("IllusionNHwEtp") pspict.dilatation(0.7) perspective=ObliqueProjection(45,sqrt(2)/2) l=2 P=(0,0) cubesP=[] cubesL=[] cubesH=[] profondeur=7 longueur=4 hauteur=4 for i in ran...
gpl-3.0
8,753,371,527,975,603,000
25.209302
73
0.582076
false
2.549774
false
false
false
Baekalfen/Helmholtz-Coil-Simulator
main_grid_treaded.py
1
7586
# -*- coding: utf-8 -*- ##from multiprocessing import Process ##from multiprocessing import Pool from visual import * from math import * from sys import platform import time ####################################### # # # Author: Mads Ynddal # # All Rights Reserved ...
gpl-2.0
-6,585,143,545,779,053,000
24.27
165
0.513984
false
2.770468
false
false
false
karlbright/beets
beets/mediafile.py
1
36961
# This file is part of beets. # Copyright 2011, Adrian Sampson. # # 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, ...
mit
5,344,825,850,735,038,000
35.850449
79
0.501177
false
4.342223
false
false
false
anupam2221/isprime
isprime.py
1
1522
##written 9-6-2017 ##by Anupam KP (c) ##anupam2221@yahoo.in ## ## ##preprocessing time- O(n loglogn) ##Tells if a prime number in O(1) dexterprime=[0]*500 def akpprocess(n): n=int(n) global dexterprime dexterprime=[0]*(n+1) dexterprime[0]=dexterprime[1]=1 for i in range(2,n+...
mit
-8,640,602,507,160,039,000
21.382353
141
0.459921
false
3.359823
false
false
false
ninemoreminutes/lmiapi
lmiapi/central.py
1
7685
# Python import json import logging import re import urllib import urlparse import warnings import webbrowser # Requests import requests # BeautifulSoup4 from bs4 import BeautifulSoup __all__ = ['LogMeInCentralAPI'] logger = logging.getLogger('lmiapi.central') class LogMeInCentralAPI(object): # pragma: no cover ...
bsd-3-clause
6,598,586,298,707,615,000
42.664773
103
0.571893
false
3.965428
false
false
false
karolciba/playground
ds_algos/heap.py
1
3241
#!/usr/bin/env python def heapsort(ary, strategy = 'up'): swaps = 0 def swap(i,j): nonlocal swaps swaps += 1 ary[i], ary[j] = ary[j], ary[i] lst = len(ary) def siftup(pos): while pos: if ary[pos] < ary[pos//2]: swap(pos,pos//2) ...
unlicense
5,711,739,790,662,060,000
26.235294
118
0.453872
false
3.451544
false
false
false
3dfxsoftware/cbss-addons
npg_bank_account_reconciliation/npg_bank_account_reconciliation.py
1
21839
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 NovaPoint Group LLC (<http://www.novapointgroup.com>) # Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>) # # This program is f...
gpl-2.0
8,555,086,121,285,220,000
66.776398
221
0.593319
false
4.08441
false
false
false
usingnamespace/pyramid_authsanity
src/pyramid_authsanity/__init__.py
1
2689
from pyramid.settings import asbool, aslist from .interfaces import IAuthSourceService from .policy import AuthServicePolicy from .sources import ( CookieAuthSourceInitializer, HeaderAuthSourceInitializer, SessionAuthSourceInitializer, ) from .util import int_or_none, kw_from_settings default_settings = (...
isc
-1,802,695,428,920,953,300
27.305263
88
0.685757
false
3.971935
true
false
false
Rickyfox/MLMA2
core/DataHandler.py
1
1770
''' Created on Dec 17, 2014 @author: Dominik Lang ''' import csv import os.path from random import shuffle import collections import numpy from sklearn.preprocessing import Imputer class DataHandler(object): def __init__(self): pass ''' @summary: A method to handle reading the data in from...
gpl-2.0
-6,482,267,368,660,720,000
23.929577
93
0.535028
false
4.204276
false
false
false
Pikecillo/genna
external/4Suite-XML-1.0.2/test/Xml/XPath/Core/test_nodeset_expr.py
1
2062
#!/usr/bin/env python # # File Name: File Name # # Documentation: http://docs.fourthought.com/file/name.html # def Test(tester): tester.startGroup('Node-set Expressions') tester.startTest('Creating test environment') from Ft.Xml.XPath import ParsedExpr from Ft.Xml.XPath import ParsedPredi...
gpl-2.0
-2,225,689,376,492,209,700
32.258065
98
0.612027
false
3.682143
true
false
false
mlmurray/TensorFlow-Experimentation
examples/3 - Neural Networks/alexnet.py
1
5087
''' AlexNet implementation example using TensorFlow library. This example is using the MNIST database of handwritten digits (http://yann.lecun.com/exdb/mnist/) AlexNet Paper (http://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks.pdf) Author: Aymeric Damien Project: https://gi...
mit
1,420,682,160,482,361,900
37.24812
144
0.654806
false
2.964452
false
false
false
kuasha/cosmos
samples/barebone/views.py
1
3616
import logging import settings from tornado.httpclient import AsyncHTTPClient import cosmos from cosmos.service.auth import BasicLoginHandler __author__ = 'Maruf Maniruzzaman' import tornado from tornado import gen import json from cosmos.service.requesthandler import RequestHandler class IndexHandler(RequestHan...
mit
-672,142,409,614,838,400
38.736264
255
0.630808
false
3.656218
false
false
false
gurgeh/data-preppy
convert_coords.py
1
2602
import math # Code converted from JS: http://latlong.mellifica.se/ axis = 6378137.0 flattening = 1.0 / 298.257222101 central_meridian = 15.00 lat_of_origin = 0.0 scale = 0.9996 false_northing = 0.0 false_easting = 500000.0 def grid_to_geodetic(x, y): e2 = flattening * (2.0 - flattening) n = flattening / (2...
apache-2.0
-1,727,488,545,422,468,000
39.030769
90
0.529208
false
2.337826
false
false
false
hecchi777/S3-SlaacSecuritySolution
impacket-0.9.11/examples/lookupsid.py
1
5922
#!/usr/bin/python # Copyright (c) 2012-2014 CORE Security Technologies # # This software is provided under under a slightly modified version # of the Apache Software License. See the accompanying LICENSE file # for more information. # # $Id: lookupsid.py 1101 2014-01-14 22:15:30Z bethus@gmail.com $ # # DCE/RPC lookup s...
apache-2.0
-3,532,217,614,760,333,300
34.461078
178
0.600135
false
3.619804
false
false
false
emergebtc/muddery
evennia/evennia/utils/ansi.py
1
33100
""" ANSI - Gives colour to text. Use the codes defined in ANSIPARSER in your text to apply colour to text according to the ANSI standard. Examples: This is %crRed text%cn and this is normal again. This is {rRed text{n and this is normal again. Mostly you should not need to call parse_ansi() explicitly; it is run b...
bsd-3-clause
662,295,410,837,981,400
34.100742
105
0.569819
false
3.951295
false
false
false
botify-labs/simpleflow
simpleflow/swf/process/worker/base.py
1
13859
import json import multiprocessing import os import sys import traceback import uuid from base64 import b64decode import psutil import swf.actors import swf.exceptions from simpleflow import format, logger, settings from simpleflow.dispatch import dynamic_dispatcher from simpleflow.download import download_binaries f...
mit
-7,047,618,636,634,764,000
33.389578
105
0.579696
false
4.340432
false
false
false
zibneuro/brainvispy
generators/uniformpointcloud.py
1
2947
import vtk import math import numpy as np from core.settings import Settings class UPoint: def __init__(self, p, dist_to_closest_point): self.p = p self.dist_to_closest_point = dist_to_closest_point def compute_energy(self): diff = self.dist_to_closest_point - Settings.inter_neuron_distance if...
bsd-3-clause
-439,862,372,721,183,300
27.892157
87
0.660333
false
3.422764
false
false
false
openmicroscopy/omero-marshal
omero_marshal/decode/decoders/screen.py
1
1831
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2015 Glencoe Software, Inc. All rights reserved. # # This software is distributed under the terms described by the LICENCE file # you can find at the root of the distribution bundle. # If the file is missing please request a copy by contacting # jason@glen...
gpl-2.0
1,854,085,798,694,151,400
34.901961
76
0.665756
false
3.684105
false
false
false
ma1co/Sony-PMCA-RE
pmca/spk/__init__.py
1
2713
"""Methods for reading and writing spk files""" import sys try: from Cryptodome.Cipher import AES from Cryptodome.PublicKey import RSA from Cryptodome.Util.number import bytes_to_long, long_to_bytes except ImportError: from Crypto.Cipher import AES from Crypto.PublicKey import RSA from Crypto.Util.number import...
mit
-9,221,149,133,173,706,000
30.183908
135
0.75341
false
3.366005
false
false
false
TaskEvolution/Task-Coach-Evolution
taskcoach/taskcoachlib/thirdparty/timeline/timeline.py
1
16578
#! /usr/bin/env python import wx, wx.lib TimeLineSelectionEvent, EVT_TIMELINE_SELECTED = wx.lib.newevent.NewEvent() TimeLineActivationEvent, EVT_TIMELINE_ACTIVATED = wx.lib.newevent.NewEvent() class HotMap(object): ''' Keep track of which node is where. ''' def __init__(self, parent=None): self...
gpl-3.0
2,429,421,412,071,416,000
36.591837
113
0.583002
false
3.831292
false
false
false