repo_name
stringlengths
6
90
path
stringlengths
4
230
copies
stringlengths
1
4
size
stringlengths
4
7
content
stringlengths
734
985k
license
stringclasses
15 values
hash
int64
-9,223,303,126,770,100,000
9,223,233,360B
line_mean
float64
3.79
99.6
line_max
int64
19
999
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
8.06
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
geoenvo/opendims
opendims/common/admin.py
1
5545
from django.contrib import admin from django.db import models from django import forms from django.contrib.flatpages.admin import FlatPageAdmin as FlatPageAdminOld from django.contrib.flatpages.admin import FlatpageForm as FlatpageFormOld from django.contrib.flatpages.models import FlatPage from django.core.exceptions ...
gpl-3.0
-4,071,029,070,522,339,300
32.005952
94
0.636429
false
4.252301
false
false
false
awesomethomas/gemrb
gemrb/GUIScripts/iwd/PartyFormation.py
4
6096
# -*-python-*- # GemRB - Infinity Engine Emulator # Copyright (C) 2003-2005 The GemRB Project # # 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 opt...
gpl-2.0
-438,471,939,995,735,800
29.178218
80
0.765748
false
3.075681
false
false
false
Ruide/angr-dev
monkeyhex/monkeyhex.py
1
2758
def maybe_hex(item, list_depth=0): if isinstance(item, bool): return repr(item) if isinstance(item, (int, long)): return hex(item) elif isinstance(item, (list,)): return '[%s]' % joinlist(item, list_depth + 1) elif isinstance(item, (set,)): return '{%s}' % joinlist(item, ...
bsd-2-clause
5,344,668,637,149,909,000
28.655914
82
0.612763
false
3.322892
false
false
false
0ps/wfuzz
src/wfuzz/ui/gui/controller.py
1
2232
import wx from .ui.console.clparser import CLParser from .ui.gui.model import GUIModel from .facade import Facade if "2.8" in wx.version(): import wx.lib.pubsub.setupkwargs from wx.lib.pubsub import pub else: from wx.lib.pubsub import pub class WfuzzInterpreter: def __init__(self, model): se...
gpl-2.0
-5,615,316,498,250,954,000
24.953488
95
0.534498
false
3.659016
false
false
false
jmuhlich/pysb
pysb/examples/bngwiki_simple.py
5
1221
"""Translation of the BioNetGen example "Simple" from the BNG wiki. http://bionetgen.org/index.php/Simple """ from __future__ import print_function from pysb import * Model() # Physical and geometric constants Parameter('NA', 6.0e23) # Avogadro's num Parameter('f', 0.01) # scaling factor Expression('V...
bsd-2-clause
4,316,022,388,966,434,000
24.4375
83
0.617527
false
2.603412
false
true
false
cwelton/incubator-hawq
tools/bin/gppylib/operations/test/unit/test_unit_utils.py
12
4470
#!/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 # "Li...
apache-2.0
2,388,815,598,398,317,600
47.064516
230
0.681432
false
4.434524
true
false
false
Eigenlabs/EigenD
app_commander/commander_cli.py
1
11251
# # Copyright 2009 Eigenlabs Ltd. http://www.eigenlabs.com # # This file is part of EigenD. # # EigenD 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) a...
gpl-3.0
4,094,080,411,976,226,000
34.269592
183
0.622967
false
3.233046
false
false
false
cginternals/glhimmel
tool/replace.py
1
2680
import sys enc='iso-8859-15' with open(sys.argv[1], 'r', encoding=enc) as f: content = f.read() replacements = [ ('osg::Vec3f', 'glm::vec3'), ('osg::Vec4f', 'glm::vec4'), ('osgHimmel', 'glHimmel'), ('"declspec.h"', '<glhimmel-computed/glhimmel-computed_api.h>'), ('t_julia...
mit
6,243,820,557,826,868,000
33.805195
72
0.472015
false
3.476005
false
false
false
bing-ads-sdk/BingAds-Python-SDK
examples/v12/customermanagement_example_helper.py
1
30650
def output_accountinfo(data_object): if data_object is None: return output_status_message("* * * Begin output_accountinfo * * *") output_status_message("Id: {0}".format(data_object.Id)) output_status_message("Name: {0}".format(data_object.Name)) output_status_message("Number: {0}".format(dat...
mit
3,264,606,715,981,465,600
43.744526
105
0.703132
false
3.514908
false
false
false
kwilliams-mo/iris
lib/iris/fileformats/manager.py
2
13183
# (C) British Crown Copyright 2010 - 2013, Met Office # # This file is part of Iris. # # Iris 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 3 of the License, or # (at your option) any l...
gpl-3.0
5,462,876,436,042,922,000
42.222951
114
0.597209
false
4.467299
false
false
false
peeyush-tm/check_mk
web/plugins/icons/builtin.py
2
30297
#!/usr/bin/python # -*- encoding: utf-8; py-indent-offset: 4 -*- # +------------------------------------------------------------------+ # | ____ _ _ __ __ _ __ | # | / ___| |__ ___ ___| | __ | \/ | |/ / | # | | | | '_ \ / _ \/ __| |/ /...
gpl-2.0
-9,096,860,701,265,604,000
46.938291
154
0.350728
false
3.565611
false
false
false
trquinn/ICgen
backup02/calc_velocity.py
2
3959
# -*- coding: utf-8 -*- """ Created on Wed Apr 9 15:39:28 2014 @author: ibackus """ import numpy as np import pynbody SimArray = pynbody.array.SimArray import matplotlib.pyplot as plt import scipy.interpolate as interp import isaac import subprocess import os import glob import time def v_xy(snapshot, param, cha...
mit
6,011,058,552,193,205,000
27.695652
73
0.55317
false
3.304674
false
false
false
FlintHill/SUAS-Competition
UpdatedSyntheticDataset/SyntheticDataset2/ElementsCreator/triangle.py
1
1338
from PIL import ImageDraw, Image from SyntheticDataset2.ElementsCreator import Shape class Triangle(Shape): def __init__(self, base, height, color, rotation): """ Initialize a Triangle shape :param base: base in pixels :type base: int :param height: height in pixels ...
mit
2,684,245,517,127,121,000
29.409091
89
0.601644
false
3.923754
false
false
false
toolforger/sympy
sympy/printing/python.py
118
3256
# -*- coding: utf-8 -*- from __future__ import print_function, division import keyword as kw import sympy from .repr import ReprPrinter from .str import StrPrinter # A list of classes that should be printed using StrPrinter STRPRINT = ("Add", "Infinity", "Integer", "Mul", "NegativeInfinity", "Pow", "Zero...
bsd-3-clause
-2,091,131,825,038,743,600
34.391304
80
0.609951
false
4.429932
false
false
false
yffq/mecanum
arm/scripts/common.py
2
3693
import os, sys, inspect import subprocess import fileinput from xml.etree import ElementTree # http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder/6098238#6098238 # Returns the directory of common.py, not the script def getScriptDir(): path = os.path.split(inspect.getfile(inspect.currentfra...
gpl-2.0
8,043,086,283,361,335,000
34.509615
96
0.688329
false
3.225328
false
false
false
lich-uct/molpher-lib
src/python/molpher/algorithms/bidirectional/pathfinder.py
1
6290
from molpher.algorithms.functions import find_path, timeit from molpher.algorithms.operations import FindClosest from molpher.core.ExplorationTree import ExplorationTree as ETree from molpher.core.operations import * class BidirectionalPathFinder: """ :param settings: search settings :type settings: `Setti...
gpl-3.0
8,541,079,875,659,279,000
45.257353
134
0.612083
false
4.349931
false
false
false
neishm/EC-CAS-diags
eccas_diags/diagnostics/shortexper_diffcheck.py
1
5308
############################################################################### # Copyright 2016 - Climate Research Division # Environment and Climate Change Canada # # This file is part of the "EC-CAS diags" package. # # "EC-CAS diags" is free software: you can redistribute it and/or modify # it under...
lgpl-3.0
-118,380,342,532,266,560
38.029412
120
0.660701
false
3.021059
false
false
false
CiscoDevNet/coding-skills-sample-code
coding201-parsing-xml/get-tenants-xml-1.py
1
1402
import requests import xml.dom.minidom # We need to import the JSON library just to handle our request to the APIC for login import json # We need to log in to the APIC and gather a token, before we can access any data # Let's construct a request with a body # We'll need to disable certificate warnings requests.pack...
apache-2.0
-7,813,436,161,223,908,000
40.264706
149
0.703281
false
3.883657
false
false
false
pkuhad/dashfb
apps/fbschema/views.py
1
11215
import logging from django.conf import settings from django.contrib import messages from django.http import Http404, HttpResponse, HttpResponseRedirect from django.shortcuts import render_to_response from django.template.context import RequestContext from django.utils.translation import ugettext as _ from django.views...
mit
6,614,565,543,035,314,000
43.328063
506
0.69951
false
3.779912
false
false
false
icgood/pymap
pymap/parsing/__init__.py
1
8198
"""Package defining all the IMAP parsing and response classes.""" from __future__ import annotations from abc import abstractmethod, ABCMeta from collections.abc import Sequence from typing import Any, TypeVar, Generic from .exceptions import NotParseable, UnexpectedType from .state import ParsingState from ..bytes ...
mit
554,001,770,585,245,900
32.190283
79
0.605148
false
4.14459
false
false
false
nicko96/Chrome-Infra
appengine/chrome_infra_packages/cipd/reader.py
1
3419
# 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. """Defines PackageReader class that knows how to read package file.""" import collections import logging import zipfile # For cas.NotFoundError. import cas...
bsd-3-clause
-7,962,900,550,908,431,000
27.256198
79
0.652237
false
3.925373
false
false
false
VadimLopatkin/AtlasSnnController
lib/ReservoirNetworkController.py
1
5495
# 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 not u...
apache-2.0
-5,905,810,702,718,488,000
40.323308
78
0.617834
false
3.74574
false
false
false
MadeInHaus/django-template
backend/apps/utils/admin.py
1
3870
from django.http.response import HttpResponseRedirect from django.shortcuts import redirect from django.core.urlresolvers import reverse from django.contrib import admin from django.conf import settings def admin_url(model, url, object_id=None): """ Returns the URL for the given model and admin url name. ...
mit
-3,783,484,061,664,361,500
34.513761
94
0.6323
false
4.252747
false
false
false
declarativitydotnet/p2
tests/unitTests/scripts/mathProduction.py
1
4336
# # * This file is distributed under the terms in the attached LICENSE file. # * If you do not find this file, copies can be found by writing to: # * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, # * Berkeley, CA, 94704. Attention: Intel License Inquiry. # * Or # * UC Berkeley EECS Computer Science Divis...
bsd-3-clause
-6,938,632,912,633,999,000
28.496599
100
0.53667
false
3.3875
false
false
false
turbinesFoam/turbinesFoam
tests/test_al.py
1
5912
#!/usr/bin/env python """Tests for `actuatorLineSource`.""" from __future__ import division, print_function import subprocess import pandas as pd import os import numpy as np from nose.tools import timed alpha_deg = 10.0 output_fpath = "postProcessing/actuatorLines/0/foil.csv" element_dir = "postProcessing/actuatorL...
gpl-3.0
1,638,961,092,177,935,600
33.573099
80
0.634641
false
3.538001
true
false
false
amaas/stanford-ctc
ctc_fast/param_spam.py
2
3754
import argparse from os.path import join as pjoin from run_cfg import CTC_DIR, TRAIN_DATA_DIR, RUN_DIR from run_utils import TimeString PARAM_SETTING_LIST = [ #{'layerSize': 1824, 'inputDim': 21*15, 'run_desc': 'fbank_context'}, #{'layerSize': 1824, 'inputDim': 31*15, 'run_desc': 'fbank_context'}, #{'laye...
apache-2.0
-4,928,066,835,110,838,000
55.029851
153
0.602291
false
2.778682
false
false
false
charliequinn/python-litmos-api
src/litmos/api.py
1
6221
import html import json import time import requests class API(object): ROOT_URL = 'https://api.litmos.com/v1.svc' PAGINATION_OFFSET = 200 api_key = None app_name = None @classmethod def _base_url(cls, resource, **kwargs): return cls.ROOT_URL + "/" + \ resource + \ ...
bsd-2-clause
8,132,535,744,514,262,000
28.34434
121
0.550072
false
4.220488
false
false
false
ucloud/uai-sdk
uaitrain/api/base_op.py
1
4006
# Copyright 2017 The UAI-SDK Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
apache-2.0
4,362,181,692,131,991,600
38.27451
108
0.569396
false
4.050556
false
false
false
hodgestar/laghuis
laghuis/mic.py
1
1174
""" A box of elements for getting input from a microphone. """ from .box import Box class Mic(Box): SRC_TEMPLATE = None def __init__(self, pipeline, name, device): super(Mic, self).__init__(name, pipeline) self.add_sequence([ self.SRC_TEMPLATE % { "name": "src", ...
mit
8,387,268,822,328,807,000
22.959184
61
0.567291
false
3.680251
false
false
false
kms70847/Falling-Block-Game
stage.py
1
2118
from Tkinter import Frame from collections import defaultdict class Stage(Frame): """Abstract base class for all the things that happen on the screen.""" def __init__(self, parent): """ parent should be a Tkinter widget capable of containing objects. Ex. a Tk() instance or Frame. ""...
mit
-7,451,077,189,710,158,000
32.109375
106
0.574127
false
4.477801
false
false
false
MiteshNinja/logninja
logninja.py
1
1558
import click import sqlite3 import datetime TABLES = [ 'movies', ] @click.group() def logninja(): pass def connect_db(): ''' Connects to temp.db and returns its cursor ''' conn = sqlite3.connect('temp.db', detect_types=sqlite3.PARSE_DECLTYPES) curs = conn.cursor() return conn, curs @click.comman...
gpl-2.0
-5,788,448,434,697,299,000
24.966667
103
0.598845
false
3.477679
false
false
false
andreashorn/lead_dbs
ext_libs/OSS-DBS/OSS_platform/Sim_state.py
1
7025
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: Butenko K. Function check_state(inp_dict) will shift the simulation flow to the last stage marked by the user in the input dictionary It will also manage the output folders accordingly using manage_folders(inp_dict) """ #import numpy as np import os imp...
gpl-3.0
653,285,674,863,342,100
41.575758
131
0.618505
false
3.158723
false
false
false
vsl-tech/home-automation
ultrasonic.py
1
1079
import RPi.GPIO as GPIO import time,os GPIO.setmode(GPIO.BCM) TRIG = 23 ECHO = 24 print "Distance measurement in progress" GPIO.setup(TRIG,GPIO.OUT) GPIO.setup(ECHO,GPIO.IN) ...
gpl-3.0
-1,865,132,677,680,091,400
27.972222
43
0.455051
false
3.937956
false
false
false
lamby/musicdb
musicdb/settings/defaults/__init__.py
1
4506
import djcelery from os.path import abspath, dirname, join from apps import * from setup_warnings import * djcelery.setup_loader() BASE_DIR = '/usr/share/python/musicdb' # Fallback to relative location if not __file__.startswith(BASE_DIR): BASE_DIR = dirname(dirname(dirname(dirname(abspath(__file__))))) DEBUG...
bsd-3-clause
2,770,878,892,921,555,500
27.700637
85
0.694186
false
3.431835
false
false
false
Khanguy/ygo-ftk
script/c92353449.py
1
1128
"""Red-Eyes Insight""" from script.card import Card class c92353449(Card): def canActivate(self,game): return (not game.hasActivated(self) and len(list(filter(self.redeyesM, game.deck + game.hand))) > 0 and len(list(filter(self.redeyesST,game.deck))) > 0) def activate(se...
agpl-3.0
3,192,589,922,874,607,000
39.285714
121
0.625887
false
3.232092
false
false
false
OzFlux/PyFluxPro
scripts/pfp_batch.py
1
24653
# standard modules import datetime import logging import ntpath import os import sys import traceback # PFP modules from scripts import pfp_cfg from scripts import pfp_clim from scripts import pfp_compliance from scripts import pfp_cpd_barr from scripts import pfp_cpd_mchugh from scripts import pfp_cpd_mcnew from scrip...
bsd-3-clause
-7,606,089,713,213,508,000
42.09965
98
0.537906
false
3.46737
false
false
false
demisto/content
Packs/IronDefense/Integrations/IronDefense/IronDefense_test.py
1
87425
# type: ignore import json import unittest import demistomock as demisto import IronDefense as irondefense_module from IronDefense import IronDefense, LOG_PREFIX from unittest import TestCase, mock from unittest.mock import Mock, call import requests from typing import Dict from http.client import HTTPException reques...
mit
-5,037,262,243,210,740,000
46.643052
127
0.521293
false
4.192241
true
false
false
bk1285/rpi_wordclock
wordclock_tools/wiring.py
1
11096
import ast import logging class wiring: """ A class, holding all information of the wordclock's layout to map given timestamps, 2d-coordinates to the corresponding LEDs (corresponding to the individual wiring/layout of any wordclock). If a different wordclock wiring/layout is chosen, this class nee...
gpl-3.0
8,951,731,823,982,177,000
34.450479
113
0.597422
false
3.408909
true
false
false
mattrid93/ProjectEuler
probs/prob35.py
1
1045
"""Problem 35: Circular primes.""" import unittest from utils.primes import seive_of_erat def rotations(n): """Returns rotations of digits of n""" if n < 10: return [n] digits = [d for d in str(n)] rotations = [] for i in range(len(digits)): rotated = digits[i:] + digits[:i] ...
mit
2,646,344,256,328,718,000
26.5
57
0.595215
false
3.381877
true
false
false
mathiasertl/django-xmpp-server-test
xmpp_server_test/server_test/xmpp/clients.py
1
15044
# -*- coding: utf-8 -*- # # This file is part of django-xmpp-server-test # (https://github.com/mathiasertl/django-xmpp-server-test). # # django-xmpp-server-test 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, ei...
gpl-3.0
4,310,790,747,939,157,500
40.32967
98
0.600838
false
3.944415
true
false
false
gwforg/gwf
src/gwf/backends/sge.py
2
4185
import logging import re from xml.etree import ElementTree from ..utils import ensure_trailing_newline, retry from .base import PbsLikeBackendBase, Status from .exceptions import BackendError from .utils import call logger = logging.getLogger(__name__) class SGEBackend(PbsLikeBackendBase): """Backend for Sun Gr...
gpl-3.0
4,703,267,259,216,061,000
32.48
87
0.578017
false
3.756732
false
false
false
calaldees/KaraKara
website/tests/data/tracks_random.py
1
3734
import pytest import random from sqlalchemy.orm import aliased, joinedload #from ..model import DBSession, commit from calaldees.string_tools import random_string from karakara.model.actions import get_tag from karakara.model.model_tracks import Track, Tag, Attachment #from karakara.model.model_queue import QueueIt...
gpl-3.0
4,469,836,535,467,004,000
36.717172
123
0.576326
false
3.951323
false
false
false
Qwaz/solved-hacking-problem
DEFCON/2019 Quals/mamatrace/pitas.py
2
7580
import claripy import angr import sys import os PROJECTS = { } TRACES = { } BINPATH = os.path.join(os.path.dirname(__file__), "bins") def one_menu(items, done=True, default=None): choices = [ None ] for item in items: if type(item) in (str, bytes): print(item) else: print("%d <- %s" % (len(choices), item[...
gpl-2.0
8,624,562,437,482,994,000
30.715481
146
0.624274
false
2.884323
false
false
false
chfw/pyexcel
pyexcel/plugins/sources/http.py
2
1953
""" pyexcel.plugins.sources.http ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of http sources :copyright: (c) 2015-2020 by Onni Software Ltd. :license: New BSD License """ from pyexcel import constants as constants from pyexcel.source import AbstractSource from pyexcel._compact import PY2, reques...
bsd-3-clause
-2,258,054,670,687,246,600
27.720588
74
0.63236
false
3.590074
false
false
false
PWr-Projects-For-Courses/SystemyWizyjne
toolbox/lib/Entry.py
1
4292
# -*- coding: utf-8 -*- #!/usr/bin/env python import os.path thisrep = os.path.dirname(__file__) from pygame import * font.init() from subprocess import Popen,PIPE from sys import stdout from form import Form from textwrap import wrap import sys import pickle import re regex0 = re.compile('<([+-])([biu])>|<(#)([0-...
gpl-2.0
2,070,781,654,304,482,800
31.515152
213
0.55219
false
3.49227
false
false
false
AerisCloud/AerisCloud
aeriscloud/cli/cloud/inventory.py
1
4639
#!/usr/bin/env python import click import os import shlex import shutil import sys from sh import git, ErrorReturnCode from aeriscloud.cli.helpers import Command, info, fatal, success, warning, \ move_shell_to from aeriscloud.ansible import inventory_path, get_inventory_list @click.group() def cli(): """ ...
mit
1,801,170,501,033,934,800
25.97093
79
0.62147
false
3.765422
false
false
false
Jhoonny/curs_python_osnov
week 1/lesson_1.4.8.py
1
1281
def create(namespace, parent): global space if namespace not in space: space[namespace] = {} space[namespace]['parent'] = parent space[namespace]['name'] = namespace space[namespace]['var'] = [] else: space[namespace]['parent'] = parent def add(namespace, var): global space if namespac...
gpl-3.0
83,339,242,529,844,660
20.35
53
0.587041
false
3.509589
false
false
false
denz/swarm-crawler
swarm_crawler/main.py
1
4005
import logging import sys import os import string from argparse import Action from datrie import Trie from cliff.app import App from cliff.commandmanager import CommandManager from werkzeug.utils import import_string DEFAULT_INSTANCE_PATH = './.swarm' OPT_MODULES = { 'cookies':'swarm.ext.http.signal.cookies',...
bsd-3-clause
-5,331,139,769,202,898,000
27.411348
86
0.581523
false
4.078411
true
false
false
oxfordyang2016/learnfluentpython
19-dyn-attr-prop/oscon/test_schedule2.py
6
1753
import shelve import pytest import schedule2 as schedule @pytest.yield_fixture def db(): with shelve.open(schedule.DB_NAME) as the_db: if schedule.CONFERENCE not in the_db: schedule.load_db(the_db) yield the_db def test_record_attr_access(): rec = schedule.Record(spam=99, eggs=1...
mit
-8,648,438,914,153,304,000
23.347222
60
0.666286
false
3.091711
true
false
false
julfla/plugin.video.freplay
resources/lib/channels/allocine.py
1
4886
#-*- coding: utf-8 -*- import urllib2 import re import CommonFunctions common = CommonFunctions from resources.lib import utils from resources.lib import globalvar title=['Allocine'] img=['allocine'] readyForUse=True def list_shows(channel,folder): shows=[] if folder=='none' : ...
gpl-2.0
8,424,279,415,885,020,000
48.363636
143
0.543594
false
3.24867
false
false
false
jonnatas/codeschool
vendor/github.com/fabiommendes/django-viewpack/src/viewpack/packs/crud.py
2
4891
from django import forms from django.core.exceptions import ImproperlyConfigured from viewpack.packs import ( ViewPack, SingleObjectPackMixin, TemplateResponsePackMixin ) from viewpack.views import ( View, DetailView, CreateView, ListView, DeleteView, UpdateView, TemplateView ) from viewpack.views.mixins impor...
gpl-3.0
-129,607,377,342,666,400
34.194245
80
0.616029
false
4.507834
false
false
false
open-contracting/ocdata-categorize
ocdata_categorize/samples.py
2
2075
import csv import os import requests def get_resource_path(name, url, cache=True): """ Returns a path to a cached file based on a name and a url. If cache=False or file is not available, then goes and gets the file and adds it to the cache and then returns the path. """ path = '.cache/%s.csv' ...
gpl-2.0
-7,528,131,833,913,145,000
28.225352
73
0.56
false
3.83549
false
false
false
hajicj/safire
scenarios/mm_tfidf_vs_plain.py
1
7452
#!/usr/bin/env python """ ``tfidf_vs_plain.py`` is a scenario that shows the difference between text documents with tf-idf and without and draws the associated image as well. Two ways of invoking the scenario are available: with pre-built corpora, or from source data. Using pre-built corpora is good when you have alre...
gpl-3.0
-1,692,958,761,236,246,800
40.631285
81
0.607085
false
4.17479
false
false
false
cwvh/maidfs
maidsim/selectionalgorithm.py
1
1591
from __future__ import division class SelectionAlgorithm: ''' Implements a selective compression algorithm. This algorithm determines whether a given file should be compressed or not. This class is designed as a base class; actual selection algorithms should be implemented as child classes. ...
bsd-2-clause
6,102,317,379,407,468,000
29.596154
79
0.710874
false
4.895385
false
false
false
30loops/nova
nova/image/glance.py
1
14306
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 OpenStack LLC. # 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/...
apache-2.0
2,050,002,155,412,432,100
32.820331
78
0.622256
false
4.05844
false
false
false
obestwalter/obestwalter.github.io
lebut/livereloader.py
1
1176
import logging import subprocess import time from lebut.config import PATH log = logging.getLogger(__name__) class LiveReloader: cmd = "livereload" def start_with_keep_alive(self, **_): self.start() while self._is_alive: log.info("livereload is active") time.sleep(10...
mit
-506,219,041,210,250,500
25.133333
80
0.555272
false
3.652174
false
false
false
nmGit/MView
MNodeEditor/MPipe.py
1
2637
# Copyright (C) 2016 Noah Meltzer # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # # This program is distributed in t...
gpl-3.0
-2,083,457,096,879,743,500
31.9625
86
0.649602
false
4.113885
false
false
false
pybursa/homeworks
m_zhelyaskoff/hw1/L01_task07.py
1
1141
# -*- coding: cp1251 -*- # Çàäàíèå 7: óíèêàëüíûé íàáîð. # ÓÑËÎÂÈÅ: # Ðåàëèçîâàòü ôóíêöèþ, êîòîðàÿ ïðèíèìàåò ñïèñîê åëåìåíòîâ è óáèðàåò # èç íåãî âñå äóáëèêàòû (ôîðìèðóåò ñïèñîê óíèêàëüíûõ ýëåìåíòîâ). # Ñäåëàòü âàðèàíò ñ ñîõðàíåíèåì ïîðÿäêà ñëåäîâàíèÿ ýëåìåíòîâ # è âàðèàíò, â êîò. ñîðòèðîâêà ýëåìåíòîâ íå ïðèíöèï...
gpl-2.0
6,892,050,804,728,032,000
18.745455
85
0.501315
false
1.734043
false
false
false
appium/appium-for-mac
examples/others/calculatorSaved.py
2
7573
#coding=utf-8 from selenium import webdriver from selenium.webdriver import ActionChains from random import randint import utilities useNativeEvents = 1 windowPath = "/AXApplication[@AXTitle='Calculator']/AXWindow[0]" resultGroupPath = windowPath + "/AXGroup[0]" basicGroupPath = windowPath + "/AXGroup[1]" scientific...
apache-2.0
-7,621,860,932,900,210,000
37.247475
186
0.688367
false
3.679786
false
false
false
YutingZhang/lmdis-rep
net_modules/nconv.py
1
2396
from net_modules.ndeconv import * from net_modules.ndeconv import _deconv_mask from prettytensor import parameters from prettytensor.pretty_tensor_image_methods import conv2d as pt_conv2d import zutils.tf_math_funcs as tmf from net_modules.deconv import _kernel from net_modules.deconv import _stride class _conv2d(pr...
apache-2.0
-6,673,742,188,714,496,000
26.860465
89
0.575543
false
3.767296
false
false
false
Anaconda-Server/chalmers
chalmers/service/upstart_service.py
1
3024
""" Install upstart init services definition with initctl command http://upstart.ubuntu.com/ """ import logging from os import path import os from subprocess import check_call, check_output, CalledProcessError, PIPE import sys from chalmers.service.cron_service import CronService import platform python_exe = sys....
mit
3,972,421,578,241,904,600
27.261682
82
0.581349
false
3.837563
false
false
false
JustinSGray/Kona
src/kona/examples/laplace2d.py
1
11068
import numpy as np import scipy.sparse as sp import numbers import matplotlib matplotlib.use('TkAgg') from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm from matplotlib.ticker import LinearLocator, FormatStrFormatter import matplotlib.pyplot as plt class Laplace2D(object): """ Implicit Finite D...
lgpl-3.0
4,516,034,905,217,472,000
33.372671
80
0.532074
false
3.59234
false
false
false
bsipocz/scikit-image
skimage/util/noise.py
32
7628
import numpy as np from .dtype import img_as_float __all__ = ['random_noise'] def random_noise(image, mode='gaussian', seed=None, clip=True, **kwargs): """ Function to add random noise of various types to a floating-point image. Parameters ---------- image : ndarray Input image data. Wi...
bsd-3-clause
6,247,046,072,516,242,000
37.918367
78
0.601993
false
3.98954
false
false
false
ecreall/lagendacommun
lac/views/organization_management/creat_organizations.py
1
1906
# Copyright (c) 2014 by Ecreall under licence AGPL terms # available on http://www.gnu.org/licenses/agpl.html # licence: AGPL # author: Amen Souissi import colander from pyramid.view import view_config from dace.processinstance.core import DEFAULTMAPPING_ACTIONS_VIEWS from pontus.form import FormView from pontus.s...
agpl-3.0
-756,707,813,384,111,600
30.245902
69
0.659496
false
4.107759
false
false
false
gregreen/bayestar
scripts/plot_priors.py
1
11496
#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- # # plot_priors.py # # Copyright 2011 Gregory <greg@greg-G53JW> # # 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...
gpl-2.0
-8,769,396,067,352,769,000
35.96463
137
0.592554
false
2.599729
false
false
false
neuhofmo/RecBlast
part_three.py
1
20090
#! /usr/bin/env python2 from sys import exit import pickle from difflib import SequenceMatcher from itertools import islice from RecBlastUtils import * all_genes_dict = {} # find similarity between sequences def similar(a, b): """ Evaluates similarity ratio between a and b. :param a: st...
mit
7,213,778,597,581,076,000
49.512821
120
0.572573
false
4.022022
false
false
false
osh/gnuradio
grc/python/convert_hier.py
11
4797
""" Copyright 2008-2011 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion 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 l...
gpl-3.0
8,443,686,559,023,384,000
40.362069
104
0.628726
false
3.303719
false
false
false
abbotao/harmonious
harmonious/core.py
1
13841
""" Core harmonious classes This module provides core data types for harmonious test plans. """ from collections import defaultdict from selenium import webdriver from harmonious.registries import DIRECTIVE_REGISTRY, TASK_REGISTRY, CALLBACK_REGISTRY from harmonious.utils import unquote_variable, is_substitution fro...
mit
-3,384,151,043,833,136,600
36.410811
135
0.60198
false
4.652437
true
false
false
adsabs/adsabs-vagrant
dockerfiles/adsws/adsws.local_config.py
1
1383
import os import logging LOG_LEVEL=logging.DEBUG LOG_FILE='logs/adsws.log' #Relative to here #Set DEBUG=True to log to stderr, which is useful for development only. #Note that this will also print the traceback in the response to the client, which is not desirable in production. DEBUG=True # Automatically generated ...
bsd-3-clause
-5,677,149,283,683,752,000
33.575
114
0.71222
false
2.955128
false
false
false
3drobotics/3drtx
Opentx_r2923_3DR/util/img2lbm.py
1
3559
#!/usr/bin/env python import sys from PyQt4 import Qt, QtGui image = QtGui.QImage(sys.argv[1]) width, height = image.size().width(), image.size().height() f = open(sys.argv[2], "w") if len(sys.argv) > 3: what = sys.argv[3] else: for s in ("03x05", "04x06", "05x07", "08x10", "10x14"): if s in sys.arg...
gpl-2.0
800,871,549,375,466,600
31.063063
78
0.421467
false
3.160746
false
false
false
eight-pack-abdominals/andbug
lib/andbug/cmd/dump.py
6
1900
## Copyright 2011, IOActive, Inc. All rights reserved. ## ## AndBug is free software: you can redistribute it and/or modify it under ## the terms of version 3 of the GNU Lesser General Public License as ## published by the Free Software Foundation. ## ## AndBug is distributed in the hope that it will be useful, but W...
gpl-3.0
2,789,725,630,586,126,300
38.604167
84
0.674211
false
3.92562
false
false
false
klen/bottle-peewee
setup.py
1
1572
#!/usr/bin/env python import re from os import path as op from setuptools import setup def _read(fname): try: return open(op.join(op.dirname(__file__), fname)).read() except IOError: return '' _meta = _read('bottle_peewee.py') _license = re.search(r'^__license__\s*=\s*"(.*)"', _meta, re.M).g...
mit
-7,707,670,445,005,820,000
29.230769
72
0.596056
false
3.655814
false
false
false
arruda/amao
AMAO/apps/Corretor/migrations/0003_auto__chg_field_retornocorrecao_msg.py
1
1123
# -*- coding: utf-8 -*- import 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 'RetornoCorrecao.msg' db.alter_column('Corretor_retornocorrecao', 'msg', self.gf('django.d...
mit
7,575,399,450,166,706,000
36.466667
131
0.612645
false
3.372372
false
false
false
yiannist/ganeti
test/py/ganeti.backend_unittest.py
1
83356
#!/usr/bin/python # # Copyright (C) 2010, 2013 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: # # 1. Redistributions of source code must retain the above copyright notice, # this l...
bsd-2-clause
7,333,027,189,310,811,000
38.523945
80
0.623854
false
3.767673
true
false
false
marcosgabarda/django-belt
tests/app/models.py
1
1645
from django.db import models from django.utils import timezone from belt.models import LogicDeleteMixin, StatusMixin from tests.app.constants import AUTO, DRAFT, DUMMY, PUBLISHED, STATUS_OPTIONS from tests.app.managers import BlogQuerySet, CategoryQuerySet, PostQuerySet class Blog(models.Model): objects = BlogQu...
mit
-2,839,814,040,069,953,000
26.416667
83
0.67234
false
3.615385
false
false
false
mikeireland/chronostar
projects/membership_with_missing_RV/overlaps.py
1
2189
""" Author: Marusa Zerjal, 2019 - 07 - 15 Take Sco-Cen components fitted to 6D data and make overlaps (using covariance matrix) with stars missing radial velocities in order to find more Sco-Cen candidates. """ import numpy as np import sys sys.path.insert(0, '../../') from chronostar.component import SphereComponen...
mit
4,771,714,124,018,352,000
32.676923
97
0.629511
false
3.735495
false
false
false
mganeva/mantid
qt/python/mantidqt/widgets/instrumentview/test/test_instrumentview_view.py
1
1614
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2019 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source # & Institut Laue - Langevin # SPDX - License - Identifier: GPL - 3.0 + # This file is part of the mantid workbench....
gpl-3.0
-1,885,103,751,415,022,300
34.866667
77
0.723668
false
3.718894
true
false
false
RoasterBot/roasterbot-analytics
python/curses_app.py
1
2516
#!/usr/bin/env python from os import system import curses import time def get_param2(prompt_string): screen.clear() screen.border(0) screen.addstr(2, 2, prompt_string) screen.refresh() #"which coffee are you roasting?" input = screen.getstr(2, 36, 24) return input def get_param(prompt_string): screen.clear...
cc0-1.0
-1,647,319,736,873,461,500
21.265487
102
0.624404
false
2.725894
false
false
false
saikat/SCAuthExample
user/views.py
1
1289
################################################## # user/views.py # SCAuthExample # # Created by Saikat Chakrabarti on April 7, 2010. # # See LICENSE file for license information. ################################################## from django.http import HttpResponseNotAllowed, HttpResponseBadRequest, HttpResponseNot...
mit
-6,476,586,326,806,262,000
36.911765
129
0.656323
false
4.522807
false
false
false
TaskEvolution/Task-Coach-Evolution
taskcoach/taskcoachlib/persistence/todotxt/writer.py
1
3188
''' Task Coach - Your friendly task manager Copyright (C) 2004-2013 Task Coach developers <developers@taskcoach.org> Task Coach is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or ...
gpl-3.0
-7,811,745,590,005,570,000
38.358025
112
0.627666
false
4.34925
false
false
false
sikevux/FTPSync
Sync.py
1
3223
#!/usr/bin/env python2 # -*- encoding: utf-8 -*- import sqlite3 import getpass import time from ftplib import FTP_TLS import sys, getopt def getfilelist(server, port, user, password, db): sqliteconnection = sqlite3.connect(db) sqlitecursor = sqliteconnection.cursor() sqlitecursor.execute('''CREATE TABLE IF NOT EX...
mit
4,985,535,574,168,961,000
27.026087
166
0.683525
false
3.232698
true
false
false
anduintransaction/Dockerfiles
sentry/config/sentry.conf.py
1
3960
# This file is just Python, with a touch of Django which means # you can inherit and tweak settings to your hearts content. from sentry.conf.server import * import os.path CONF_ROOT = os.path.dirname(__file__) DATABASES = { 'default': { 'ENGINE': 'sentry.db.postgres', 'NAME': '${SENTRY_DB_NAME}',...
mit
-8,472,308,251,941,531,000
27.285714
80
0.67601
false
3.384615
false
false
false
miaecle/deepchem
deepchem/metrics/__init__.py
1
31505
"""Evaluation metrics.""" import numpy as np import warnings import sklearn.metrics import logging from sklearn.metrics import matthews_corrcoef from sklearn.metrics import recall_score from sklearn.metrics import cohen_kappa_score from sklearn.metrics import r2_score from sklearn.metrics import mean_squared_error fro...
mit
-5,967,156,481,479,734,000
35.296083
264
0.634534
false
3.662095
false
false
false
tejasckulkarni/hydrology
weather/et_monthly.py
2
2937
__author__ = 'kiruba' import numpy as np import matplotlib.pyplot as plt import pandas as pd import itertools import checkdam.checkdam as cd date_format = '%Y-%m-%d %H:%M:%S' daily_format = '%Y-%m-%d' # Weather file weather_file = '/media/kiruba/New Volume/ACCUWA_Data/weather_station/smgollahalli/ksndmc_weather.csv' ...
gpl-3.0
5,281,503,252,974,552,000
35.725
126
0.642152
false
2.807839
false
false
false
ScreamingUdder/mantid
scripts/Muon/MaxentTools/chosol.py
1
2236
import numpy as np import math """ a,b: arrays n : size (to use) returns x (array) (was parameter by reference, modified in place) """ def CHOSOL_old(a, b, n): assert(n == 3) assert(a.shape == (3, 3)) assert(b.shape == (3,)) L = np.zeros([n, n]) L[0, 0] = math.sqrt(a[0, 0]) for i in...
gpl-3.0
6,478,863,342,114,896,000
28.038961
79
0.420394
false
2.665077
false
false
false
mdboom/asv
asv/environment.py
1
18230
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Manages an environment -- a combination of a version of Python and set of dependencies. """ from __future__ import (absolute_import, division, print_function, unicode_literals) import hashlib import os...
bsd-3-clause
-8,597,710,641,270,669,000
28.168
102
0.568568
false
4.532571
false
false
false
arihantsethia/So.Bookr
main.py
1
6040
#!/usr/bin/env python # # Copyright 2007 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 o...
gpl-3.0
2,374,985,404,639,032,000
38.220779
322
0.637252
false
3.094262
false
false
false
razorpay/razorpay-python
razorpay/client.py
1
6039
import os import json import requests import pkg_resources from pkg_resources import DistributionNotFound from types import ModuleType from .constants import HTTP_STATUS_CODE, ERROR_CODE, URL from . import resources, utility from .errors import (BadRequestError, GatewayError, ServerError) def...
mit
6,496,292,552,829,221,000
30.952381
79
0.566319
false
4.208362
false
false
false
brkrishna/freelance
univs/current/flc.py
1
3567
# -- coding: utf-8 -- #------------------------------------------------------------------------------- # Name: flc # Purpose: Fort Lewis College # # Author: Ramakrishna # # Dated: 22/Apr/2016 # Copyright: (c) Ramakrishna 2016 # Licence: <your licence> #---------------------------------...
gpl-2.0
-308,438,364,452,774,660
30.566372
333
0.667227
false
2.513742
false
false
false
AustereCuriosity/astropy
astropy/visualization/wcsaxes/coordinate_helpers.py
1
30590
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import print_function, division, absolute_import """ This file defines the classes used to represent a 'coordinate', which includes axes, ticks, tick labels, and grid lines. """ import numpy as np from matplotlib.ticker import Formatter...
bsd-3-clause
3,941,533,491,540,736,500
38.167734
155
0.565381
false
4.355068
false
false
false
inclement/noGo
noGo/ext/gomill/handicap_layout.py
3
1667
"""Standard layout of fixed handicap stones. This follows the rules from the GTP spec. """ def max_free_handicap_for_board_size(board_size): """Return the maximum number of stones for place_free_handicap command.""" return board_size * board_size - 1 def max_fixed_handicap_for_board_size(board_size): ""...
gpl-3.0
4,703,056,788,764,721,000
29.87037
78
0.564487
false
3.121723
false
false
false
crista/exercises-in-programming-style
37-bow-tie/tf-37.py
2
2406
from keras.models import Sequential from keras.layers import Dense import numpy as np import sys, os, string characters = string.printable char_indices = dict((c, i) for i, c in enumerate(characters)) indices_char = dict((i, c) for i, c in enumerate(characters)) INPUT_VOCAB_SIZE = len(characters) def encode_one_hot(...
mit
-8,007,825,400,734,044,000
27.317647
88
0.613051
false
3.018821
false
false
false
olivergs/pyevo
pyevo/apps.py
2
4489
# -*- coding: utf-8 -*- """ Application base classes for generic application types =============================================== .. module:: pyevo.app :platform: Unix, Windows :synopsis: Application base classes for generic application types .. moduleauthor:: (C) 2014 Oliver Gutiérrez """ import sys, os, ti...
mit
-9,213,514,336,680,239,000
26.206061
91
0.499109
false
4.167131
false
false
false
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/win_unicode_console/__init__.py
2
1042
from . import streams, console, readline_hook from .info import WINDOWS, PY2 if PY2: from . import raw_input if PY2 and WINDOWS: from . import unicode_argv # PY3 # def enable(*, def enable( stdin = Ellipsis, stdout = Ellipsis, stderr = Ellipsis, use_readline_hook = True, use_pyreadline = True, ...
gpl-3.0
-6,409,038,549,587,957,000
18.296296
73
0.693858
false
2.878453
false
false
false
maartenq/ansible
test/units/modules/network/cnos/test_cnos_vlag.py
7
2317
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import json import os from ansible.compat.tests.mock import patch from ansible.modules.network.cnos import cnos_vlag from units.modules.utils import set_module_args from .cnos_module import TestCnosModule, load_fixture class Test...
gpl-3.0
-1,933,172,515,743,074,600
42.716981
103
0.624946
false
3.515933
true
false
false
MSeifert04/iteration_utilities
setup.py
1
1726
from setuptools import setup, Extension, find_packages from glob import glob from os import path import sys def version(): with open('src/iteration_utilities/__init__.py') as f: for line in f: if line.startswith('__version__'): return line.split(r"'")[1] files = [ 'accu...
apache-2.0
-5,346,206,646,155,180,000
20.04878
109
0.572422
false
3.121157
false
false
false
hasteur/g13bot_tools_new
scripts/checkimages.py
1
77406
#!/usr/bin/python # -*- coding: utf-8 -*- """ Script to check recently uploaded files. This script checks if a file description is present and if there are other problems in the image's description. This script will have to be configured for each language. Please submit translations as addition to the Pywikibot frame...
mit
8,342,519,615,506,457,000
41.528058
99
0.541638
false
3.726642
false
false
false
Bleyddyn/malpi
dk/scripts/collect_meta.py
1
4455
""" Drive a donkey 3 car to collect data along with meta information. Requires the drive function of manage.py to return a vehicle object. Usage: collect_meta.py [--location=<loc>] [--task=<task>] [--driver=<driver>] [<cfg>...] [--model=<model>] [--type=(linear|categorical|rnn|imu|behavior|3d|localizer|latent)] ...
mit
-3,698,319,006,786,287,600
37.405172
170
0.611897
false
3.491379
false
false
false
Reinaesaya/OUIRL-ChatBot
chatterbot/utils.py
1
3826
""" ChatterBot utility functions """ def import_module(dotted_path): """ Imports the specified module based on the dot notated import path for the module. """ import importlib module_parts = dotted_path.split('.') module_path = '.'.join(module_parts[:-1]) module = importlib.import_mod...
bsd-3-clause
1,402,528,183,047,091,000
26.328571
82
0.639049
false
4.236988
false
false
false
matbra/bokeh
bokeh/compat/mplexporter/renderers/base.py
44
14355
import warnings import itertools from contextlib import contextmanager import numpy as np from matplotlib import transforms from .. import utils from .. import _py3k_compat as py3k class Renderer(object): @staticmethod def ax_zoomable(ax): return bool(ax and ax.get_navigate()) @staticmethod ...
bsd-3-clause
-3,442,271,441,581,052,000
36.480418
78
0.5814
false
4.739188
false
false
false