repo_name
stringlengths
5
92
path
stringlengths
4
232
copies
stringclasses
19 values
size
stringlengths
4
7
content
stringlengths
721
1.04M
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
15
997
alpha_frac
float64
0.25
0.97
autogenerated
bool
1 class
RENCI/xDCIShare
hs_geo_raster_resource/migrations/0001_initial.py
1
7533
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings import hs_core.models class Migration(migrations.Migration): dependencies = [ ('auth', '0001_initial'), ('pages', '__first__'), migrations.swappable_d...
bsd-3-clause
-2,520,419,331,241,645,000
60.745902
250
0.609584
false
jhavstad/model_runner
src/Dnd.py
1
31407
"""Drag-and-drop support for Tkinter. This is very preliminary. I currently only support dnd *within* one application, between different windows (or within the same window). I an trying to make this as generic as possible -- not dependent on the use of a particular widget or icon type, etc. I also hope that this wi...
gpl-2.0
8,886,849,832,114,287,000
34.731513
144
0.614258
false
STIXProject/python-stix
stix/ttp/behavior.py
1
2251
# Copyright (c) 2017, The MITRE Corporation. All rights reserved. # See LICENSE.txt for complete terms. # mixbox from mixbox import fields # stix import stix import stix.bindings.ttp as ttp_binding from .malware_instance import MalwareInstance, MalwareInstanceFactory from .exploit import Exploit from .attack_pattern...
bsd-3-clause
6,403,979,115,881,606,000
34.730159
154
0.727677
false
balopat/pyquil
pyquil/quilbase.py
1
22078
#!/usr/bin/python ############################################################################## # Copyright 2016-2017 Rigetti Computing # # 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 ...
apache-2.0
1,625,788,238,896,269,800
27.897906
100
0.579264
false
stackimpact/stackimpact-python
stackimpact/reporters/profile_reporter.py
1
5286
from __future__ import division import os import sys import time import threading import re import random from ..runtime import min_version, runtime_info from ..utils import timestamp from ..metric import Metric from ..metric import Breakdown from ..frame import Frame class ProfilerConfig(object): def __init__...
bsd-3-clause
5,937,886,945,018,756,000
27.26738
123
0.599886
false
mcflugen/dakota-experiments
dakota_utils/convert.py
1
1595
#! /usr/bin/env python # # Dakota utility programs for converting output. # # Mark Piper (mark.piper@colorado.edu) import shutil from subprocess import check_call, CalledProcessError from .read import get_names def has_interface_column(tab_file): ''' Returns True if the tabular output file has the v6.1 'inte...
mit
5,199,411,763,182,056,000
26.033898
76
0.618182
false
mdales/django-oauth
views.py
1
7170
from __future__ import absolute_import import cgi import logging import urllib import urlparse from django.conf import settings from django.http import (HttpResponse, HttpResponseRedirect, HttpResponseNotAllowed, HttpResponseBadRequest) from django.utils.translation import ugettext as _ from...
bsd-3-clause
5,926,247,509,342,452,000
36.936508
114
0.628591
false
DayGitH/Python-Challenges
DailyProgrammer/DP20170612A.py
1
1420
""" [2017-06-12] Challenge #319 [Easy] Condensing Sentences https://www.reddit.com/r/dailyprogrammer/comments/6grwny/20170612_challenge_319_easy_condensing_sentences/ # Description Compression makes use of the fact that repeated structures are redundant, and it's more efficient to represent the pattern and the count ...
mit
3,155,732,654,619,010,000
40.764706
116
0.762676
false
thunderhoser/GewitterGefahr
gewittergefahr/deep_learning/data_augmentation.py
1
10404
"""Augments image dataset by shifting, rotating, or adding Gaussian noise.""" import numpy from scipy.ndimage.interpolation import rotate as scipy_rotate from gewittergefahr.gg_utils import error_checking from gewittergefahr.deep_learning import deep_learning_utils as dl_utils PADDING_VALUE = 0. MIN_ABSOLUTE_ROTATION...
mit
-2,660,933,531,477,397,000
36.695652
80
0.688774
false
NeCTAR-RC/swift
test/unit/common/middleware/test_account_quotas.py
1
18390
# 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 # distributed under the...
apache-2.0
5,786,382,722,435,728,000
43.313253
79
0.530234
false
sssilver/angler
rod/rod/model/lesson.py
1
1292
import sqlalchemy.types import sqlalchemy.schema import sqlalchemy.orm import rod.model class Lesson(rod.model.db.Model, rod.model.PersistentMixin): __tablename__ = 'lesson' id = sqlalchemy.schema.Column(sqlalchemy.types.Integer, primary_key=True) time = sqlalchemy.schema.Column(sqlalchemy.types.DateTim...
bsd-3-clause
8,059,350,905,018,114,000
33
77
0.51548
false
aarora79/sb_study
common/utils.py
1
12780
# -*- coding: utf-8 -*- import os import string import json import pandas as pd import numpy as np from scipy.stats.stats import pearsonr from dateutil.parser import parse from common import globals as glob SPECIAL_CHARS = string.punctuation.replace("_", "") SPECIAL_CHARS = string.punctuation.replace("-", "") SPECIAL_...
mit
3,349,361,493,153,902,600
41.73913
129
0.582799
false
serge-sans-paille/pythran
pythran/tests/cases/sobelfilter.py
1
2118
#skip.runas import Image; im = Image.open("Scribus.gif"); image_list = list(im.getdata()); cols, rows = im.size; res = range(len(image_list)); sobelFilter(image_list, res, cols, rows) #runas cols = 100; rows = 100 ;image_list=[x%10+y%20 for x in range(cols) for y in range(rows)]; sobelFilter(image_list, cols, rows) #be...
bsd-3-clause
6,285,914,057,603,005,000
49.428571
183
0.520774
false
chuckinator0/Projects
scripts/singleNumber.py
1
1163
''' Given a non-empty array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implement it without using extra memory? Example 1: Input: [2,2,1] Output: 1 Example 2: Input: [4,1,2,1,2] Output: 4 ''' def singleNumb...
gpl-3.0
7,711,206,163,601,824,000
22.734694
106
0.72227
false
stuartsale/BibShorts
bibshorts/__init__.py
1
3454
from __future__ import print_function import requests # for working with remote resources import re # regular expresions import os class bib_entry: def __init__(self, bibtex_in): """ Initialise the object with its arxiv reference number """ self.bibtex = b...
bsd-3-clause
-3,439,400,351,898,363,400
29.034783
83
0.458888
false
deweysasser/SimpleS3Backup
setup.py
1
1066
import os from setuptools import setup setup( name = "SimpleS3Backup", version = "0.2", author = "Dewey Sasser", author_email = "dewey@sasser.com", description = ("A simple backup script that saves artbitrary command output to s3 in a rotating series of files"), license = "Artistic License", ...
artistic-2.0
-5,598,649,035,324,486,000
35.758621
118
0.674484
false
davidsminor/gaffer
python/GafferUITest/WidgetTest.py
1
12624
########################################################################## # # Copyright (c) 2011-2012, John Haddon. All rights reserved. # Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted ...
bsd-3-clause
-3,350,717,458,281,964,500
28.290023
150
0.668805
false
Mhynlo/SickRage
sickbeard/providers/cpasbien.py
1
4616
# coding=utf-8 # Author: Guillaume Serre <guillaume.serre@gmail.com> # # URL: https://sickrage.github.io # # This file is part of SickRage. # # SickRage 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 v...
gpl-3.0
-5,184,486,897,737,168,000
42.140187
150
0.543761
false
ProfHoekstra/bluesky
plugins/example.py
1
3455
""" BlueSky plugin template. The text you put here will be visible in BlueSky as the description of your plugin. """ from random import randint import numpy as np # Import the global bluesky objects. Uncomment the ones you need from bluesky import core, stack, traf #, settings, navdb, sim, scr, tools ### Initiali...
gpl-3.0
8,750,351,373,721,328,000
46.328767
112
0.684515
false
bdcht/amoco
amoco/arch/x86/utils.py
1
4777
# -*- coding: utf-8 -*- # This code is part of Amoco # Copyright (C) 2014 Axel Tillequin (bdcht3@gmail.com) # published under GPLv2 license # spec_xxx files are providers for instruction objects. from amoco.arch.x86 import env from amoco.arch.core import * # for ia32 arch we want some specialized 'modrm' format # ...
gpl-2.0
6,701,555,174,954,964,000
26.454023
78
0.494871
false
davy39/eric
E5Network/E5NetworkMonitor.py
1
13678
# -*- coding: utf-8 -*- # Copyright (c) 2009 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> # """ Module implementing a network monitor dialog. """ from __future__ import unicode_literals from PyQt5.QtCore import Qt, QAbstractTableModel, QModelIndex, QUrl, \ QSortFilterProxyModel from PyQt5.QtGui import QSt...
gpl-3.0
7,615,740,484,586,443,000
34.343669
79
0.588609
false
pettai/capirca
tests/packetfilter_test.py
1
22997
# Copyright 2013 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # unless required by applicable law or a...
apache-2.0
-5,017,035,875,669,173,000
31.435825
83
0.643649
false
zijistark/zckTools
src/zck/token_codegen.py
1
1078
#!/usr/bin/python3 import sys from pathlib import Path list_scope_path = Path("./list_scope_tokens.txt") keyword_bit = 13 list_scope_bit = 14 def main(): if len(sys.argv) < 2: print("Error: Must specify an argument of either 'tokens' or 'emitters'!", file=sys.stderr) return 1 list_scopes = set() with list_s...
lgpl-3.0
-3,612,522,775,626,830,300
23.5
99
0.602968
false
nontas/digitrecognition
digitrecognition/data_converter.py
1
12537
import os import urllib import gzip import numpy as np import tensorflow as tf from menpo.image import Image from menpo.visualize import print_dynamic from digitrecognition.base import src_dir_path # MNIST url SOURCE_URL = 'http://yann.lecun.com/exdb/mnist/' # MNIST filenames TRAIN_IMAGES = 'train-images-idx3-ubyt...
bsd-3-clause
-206,103,622,137,575,780
31.228792
111
0.618649
false
scientia-jp/db_file_storage
db_file_storage/model_utils.py
1
1700
# project from db_file_storage.storage import DatabaseFileStorage def delete_file_if_needed(instance, filefield_name): """ When editing and the filefield is a new file, delete the previous file (if any) from the database. Call this function immediately BEFORE saving the instance. """...
gpl-3.0
-4,666,363,623,960,723,000
36.777778
77
0.604706
false
mikewied/perfrunner
perfrunner/helpers/remote.py
1
30033
import time from decorator import decorator from fabric import state from fabric.api import execute, get, put, run, parallel, settings from fabric.exceptions import CommandTimeout from logger import logger from perfrunner.helpers.misc import uhex @decorator def all_hosts(task, *args, **kargs): self = args[0] ...
apache-2.0
-4,513,793,339,710,990,000
35.895577
148
0.561116
false
Merinorus/adaisawesome
Homework/02 - Data from the Web/Question 2.py
1
14839
# coding: utf-8 # Obtain all the data for the Master students, starting from 2007. Compute how many months it took each master student to complete their master, for those that completed it. Partition the data between male and female students, and compute the average -- is the difference in average statistically signi...
gpl-3.0
7,325,369,395,381,894,000
38.147757
850
0.737009
false
amitjamadagni/sympy
sympy/plotting/experimental_lambdify.py
1
23947
""" rewrite of lambdify - This stuff is not stable at all. It is for internal use in the new plotting module. It may (will! see the Q'n'A in the source) be rewritten. It's completely self contained. Especially it does not use lambdarepr. It does not aim to replace the current lambdify. Most importantly it will never...
bsd-3-clause
-8,688,089,668,296,977,000
37.132166
91
0.555602
false
laslabs/odoo-project_jira
models/res_company.py
1
1123
# -*- coding: utf-8 -*- ############################################################################## # # Author: Dave Lasley <dave@laslabs.com> # Copyright: 2015 LasLabs, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public Lic...
agpl-3.0
2,600,987,763,477,031,000
42.192308
78
0.614426
false
chirilo/kuma
kuma/wiki/views/create.py
1
5526
# -*- coding: utf-8 -*- import newrelic.agent from django.core.exceptions import PermissionDenied from django.http import HttpResponseRedirect from django.shortcuts import render from constance import config from kuma.attachments.forms import AttachmentRevisionForm from kuma.attachments.models import Attachment from...
mpl-2.0
-7,831,619,616,727,707,000
32.289157
82
0.608035
false
sch3m4/intelmq
intelmq/bots/parsers/dragonresearchgroup/parser_ssh.py
1
1540
# -*- coding: utf-8 -*- from __future__ import unicode_literals import sys from intelmq.lib import utils from intelmq.lib.bot import Bot from intelmq.lib.message import Event class DragonResearchGroupSSHParserBot(Bot): def process(self): report = self.receive_message() if report is None or not ...
agpl-3.0
7,095,525,332,861,788,000
26.5
61
0.543506
false
jendap/tensorflow
tensorflow/python/keras/callbacks_v1.py
1
17877
# Copyright 2015 The TensorFlow 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 applica...
apache-2.0
-9,018,497,592,439,042,000
41.162736
102
0.644068
false
LettError/filibuster
Lib/filibuster/content/music.py
1
9619
# -*- coding: UTF-8 -*- """ history Music genres, performers, recordings, venues -------------------------------------------------------------------- 3.0.0 - split all the content into babycontents evb - note: only one dictionary named 'content' allowed per module this limitation is to spe...
mit
9,120,599,643,572,176,000
47.807107
191
0.443994
false
barentsen/reproject
reproject/mosaicking/background.py
1
4696
# Licensed under a 3-clause BSD style license - see LICENSE.rst from math import exp import numpy as np __all__ = ['solve_corrections_sgd', 'determine_offset_matrix'] def determine_offset_matrix(arrays): """ Given a list of ReprojectedArraySubset, determine the offset matrix between all arrays. """...
bsd-3-clause
1,066,453,239,772,210,600
34.847328
79
0.635009
false
ploneintranet/ploneintranet.workspace
src/ploneintranet/workspace/tests/test_viewlets.py
1
3061
from collective.workspace.interfaces import IWorkspace from plone import api from ploneintranet.workspace.browser.viewlets import JoinViewlet from ploneintranet.workspace.tests.base import BaseTestCase from ploneintranet.workspace.browser.viewlets import SharingViewlet from ploneintranet.workspace.policies import PART...
gpl-2.0
5,816,379,395,865,682,000
35.440476
74
0.642274
false
cseed/hail
batch/batch/worker/flock.py
1
1551
import fcntl import os import argparse import subprocess as sp from pathlib import Path from hailtop.utils import blocking_to_async class Flock: def __init__(self, path, pool=None, nonblock=False): self.path = Path(path).resolve() self.lock_path = self.path.parent self.pool = pool ...
mit
8,024,200,573,664,678,000
29.411765
91
0.615087
false
broadinstitute/toothpick
toothpick/errors.py
1
2792
import inflection class Errors(object): ''' The `Errors` object is a container of validation errors stored on an instance of a :class:`Base` subclass. An object's validation state (and the response to :meth:`Base.valid()`) is governed by the number of errors collected: 0 means valid, and more mean...
bsd-3-clause
3,059,718,520,421,041,700
27.489796
82
0.55659
false
deapplegate/wtgpipeline
cal_extinctions.save.py
1
3796
import threading def ebv_list(list_submit,list_dict,i,ppid): import os lineindex = 0 timehold = time.time() list_out = [] out = open('/tmp/tmpf_' + str(i) + '_' + str(ppid),'w') for line in list_submit: tt = re.split('\s+',line) ra = float(tt[0]) dec = float(tt[1]) EB...
mit
-1,447,512,690,213,546,200
24.47651
159
0.608799
false
ismtabo/file-mixer
file_mixer/main_view/model.py
1
5227
import os import stat from .errors import NoneCurrentProblem, UnsavedModifiedProblem from .models import FolderTreeElement, Problem, NumberedProblem class MainViewModel: def __init__(self): self._path = None self._pathtree = None self._is_modified = False self._problem = None ...
mit
-5,864,439,062,170,376,000
29.213873
99
0.626172
false
Ferroman/configuration.py
configuration_py/parser_lookup.py
1
1521
import inspect import os import pkgutil import sys from configuration_py.parsers.base_parser import BaseConfigParser PARSERS_DIR_NAME = 'parsers' def get_supported_extensions(): available_parsers = _lookup_for_available_parsers() for parser_class in available_parsers: for extension in parser_class....
mit
4,643,955,388,156,396,000
30.6875
110
0.69691
false
plamut/superdesk-core
superdesk/ws.py
1
4280
#!/usr/bin/env python # -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014, 2015 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/sup...
agpl-3.0
-7,511,321,612,840,697,000
27.533333
111
0.662383
false
uclouvain/osis_louvain
base/business/education_group.py
1
17182
############################################################################## # # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core ...
agpl-3.0
-4,671,695,049,412,746,000
41.422222
120
0.693964
false
AXAz0r/apex-sigma-core
sigma/core/mechanics/event.py
1
2405
import discord from sigma.core.mechanics.logger import create_logger class SigmaEvent(object): def __init__(self, bot, event, plugin_info, event_info): self.bot = bot self.db = self.bot.db self.event = event self.plugin_info = plugin_info self.event_info = event_info ...
gpl-3.0
834,906,843,449,019,000
34.895522
78
0.569231
false
openwfm/wrfxweb
src/utils.py
1
4271
from __future__ import absolute_import import fcntl, errno, logging, json, os, sys import os.path as osp class Dict(dict): """ A dictionary that allows member access to its keys. A convenience class. """ def __init__(self, d): """ Updates itself with d. """ self.upd...
mit
-2,771,383,232,434,513,400
34.890756
124
0.59307
false
nsmoooose/csp
csp/data/ui/tutorials/takeoff/takeoff.py
1
2115
#!/usr/bin/python # Combat Simulator Project # Copyright (C) 2002-2009 The Combat Simulator Project # http://csp.sourceforge.net # # 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-2.0
5,528,677,412,418,689,000
34.25
109
0.689835
false
TomasTomecek/compose
compose/project.py
1
13569
from __future__ import absolute_import from __future__ import unicode_literals import logging from functools import reduce from docker.errors import APIError from docker.errors import NotFound from . import parallel from .config import ConfigurationError from .config.sort_services import get_service_name_from_net fr...
apache-2.0
-7,479,709,630,229,278,000
34.802111
103
0.588253
false
honza/heroku-sprunge
sprunge/app.py
1
1970
import os import pygments.lexers from pygments import highlight from pygments.formatters import HtmlFormatter from flask import Flask, request, make_response from db import insert, find from bson.errors import InvalidId from settings import * app = Flask(__name__) HOME = """ <style> a { text-decoration: none } </s...
bsd-2-clause
5,201,614,514,209,401,000
21.906977
126
0.599492
false
nilsFK/py-privatekonomi
py_privatekonomi/core/apps/example2.py
1
6699
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals from py_privatekonomi.core.mappers.economy_mapper import EconomyMapper from py_privatekonomi.utilities import helper from py_privatekonomi.utilities.common ...
mit
271,856,470,520,782,340
30.842857
155
0.542545
false
UTSA-ICS/keystone-kerberos
keystone/tests/unit/test_sql_upgrade.py
1
71681
# Copyright 2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
apache-2.0
-1,600,424,370,265,515,800
39.589468
79
0.541134
false
michal-ruzicka/archivematica
src/MCPClient/lib/clientScripts/moveDspaceMetsFilesToDSpaceMETS.py
1
2718
#!/usr/bin/python -OO # This file is part of Archivematica. # # Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com> # # Archivematica 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, e...
agpl-3.0
-4,781,895,504,976,434,000
35.24
146
0.729581
false
stevearc/pyramid_duh
pyramid_duh/view.py
1
5396
""" Utilities for view configuration """ import fnmatch import re import functools import inspect import six from pyramid.httpexceptions import HTTPFound from .params import is_request def match(pattern, path, flags): """ Check if a pattern matches a path Parameters ---------- pattern : str ...
mit
1,096,755,703,211,089,400
27.251309
87
0.532061
false
diegojromerolopez/djanban
src/djanban/apps/repositories/migrations/0003_auto_20160921_1748.py
1
1075
# -*- coding: utf-8 -*- # Generated by Django 1.10 on 2016-09-21 15:48 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('repositories', '0002_auto_20160911_1601'), ] operations = [ migrations.AddFie...
mit
-2,720,929,637,803,019,000
32.59375
171
0.610233
false
FrodeSolheim/fs-uae-launcher
launcher/ui/imports/ImportTask.py
1
3835
import os import shutil import threading import traceback import fsui from fsbc.path import is_same_file from fsgamesys.amiga.rommanager import ROMManager from fsgamesys.filedatabase import FileDatabase from fsgamesys.FSGSDirectories import FSGSDirectories from ...i18n import gettext from ...launcher_signal import La...
gpl-2.0
5,107,383,758,132,274,000
30.694215
79
0.557497
false
smallyear/linuxLearn
salt/salt/modules/groupadd.py
1
6379
# -*- coding: utf-8 -*- ''' Manage groups on Linux, OpenBSD and NetBSD ''' # Import python libs from __future__ import absolute_import import logging try: import grp except ImportError: pass log = logging.getLogger(__name__) # Define the module's virtual name __virtualname__ = 'group' def __virtual__(): ...
apache-2.0
-5,202,034,855,072,395,000
24.930894
101
0.525474
false
phtagn/sickbeard_mp4_automator
readSettings.py
1
33044
import os import sys import locale try: import configparser except ImportError: import ConfigParser as configparser import logging from extensions import * from babelfish import Language import languagecode class ReadSettings: def __init__(self, directory, filename, logger=None): # Setup loggin...
mit
4,854,968,743,351,780,000
45.022284
286
0.526419
false
likeucode/PythonLearning
basicLearning/basicClass.py
1
1090
#! /usr/bin/env python #this code is a demo of oop of python class Filter: def init(self): self.blocked=[] def filter(self,sequence): return [x for x in sequence if x not in self.blocked] class SPAMFilter(Filter): num=0 def init(self): SPAMFilter.num+=1 print SPAMFilter.num self.blocked=['SPAM'] class...
bsd-3-clause
-1,111,955,918,422,303,900
16.868852
55
0.685321
false
Suninus/NewsBlur
apps/reader/views.py
1
95311
import datetime import time import boto import redis import requests import random import zlib from django.shortcuts import get_object_or_404 from django.shortcuts import render from django.contrib.auth.decorators import login_required from django.template.loader import render_to_string from django.db import IntegrityE...
mit
7,578,381,407,372,846,000
42.010379
137
0.597549
false
jvasile/withsqlite
withsqlite.py
1
6379
#!/usr/bin/env python """ withsqlite - uses an sqlite db as a back end for a dict-like object, kind of like shelve but with json and sqlite3. Copyright 2011-2013 James Vasile Released under the GNU General Public License, version 3 or later. See https://www.gnu.org/licenses/gpl-3.0.html for terms. Repo is at <http:/...
gpl-3.0
8,648,903,622,903,924,000
30.423645
79
0.56639
false
hrahadiant/mini_py_project
minitodolist.py
1
2576
import os # initialize a list task = [] # check current python file path currentpath = os.path.dirname(os.path.realpath(__file__)) # set name of the file filename = "my_todo.txt" # set directory to save the file filepath = os.path.join(currentpath, filename) # function for check the file is exist and is empty or not...
apache-2.0
7,352,208,570,656,500,000
21.206897
78
0.651009
false
SkRobo/Eurobot-2017
NewCommunication/Sucker/driver.py
1
3816
from multiprocessing import Process, Queue from multiprocessing.queues import Queue as QueueType import serial from serial.tools import list_ports from cmd_list import CMD_LIST import time from packets import encode_packet, decode_packet import logging #<<<<<<< HEAD #PORT_VID = 1155 #PORT_PID = 22336 #PORT_SNR = '367...
mit
2,843,826,998,180,754,400
31.615385
125
0.57521
false
hernan-erasmo/project-euler
soluciones/problema13.py
1
5374
string_grande = """37107287533902102798797998220837590246510135740250 46376937677490009712648124896970078050417018260538 74324986199524741059474233309513058123726617309629 91942213363574161572522430563301811072406154908250 23067588207539346171171980310421047513778063246676 8926167069662363382013637841838368417873436172...
unlicense
-4,593,026,946,803,485,700
46.982143
72
0.960551
false
ChameleonCloud/horizon
openstack_auth/urls.py
1
1556
# 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 # distributed under the...
apache-2.0
-2,301,209,320,913,302,500
33.577778
76
0.666452
false
ADozois/ML_Challenge
logreg/models/learning/learning_optimization.py
1
2144
import numpy as np from logreg.models.feature_computers.prediction_computer import ProbabilityComputerFactory from logreg.models.cost_computers.cost_computer import CostComputerFactory class OptimizationType(object): GRADIENT = "gradient" class GradientDescent(object): @classmethod def compute_gradient(...
mit
949,555,902,816,901,500
42.755102
112
0.672575
false
bospetersen/h2o-3
h2o-py/tests/testdir_algos/deeplearning/pyunit_cv_cars_mediumDeepLearning.py
1
5439
import sys sys.path.insert(1, "../../../") import h2o, tests import random def cv_carsDL(ip,port): # read in the dataset and construct training set (and validation set) cars = h2o.import_file(path=h2o.locate("smalldata/junit/cars_20mpg.csv")) # choose the type model-building exercise (multinomial classi...
apache-2.0
6,783,123,054,350,010,000
47.5625
122
0.650303
false
psykzz/flask-admin
flask_admin/tests/sqlamodel/test_basic.py
1
24553
from nose.tools import eq_, ok_, raises from wtforms import fields from flask.ext.admin import form from flask.ext.admin._compat import as_unicode from flask.ext.admin._compat import iteritems from flask.ext.admin.contrib.sqla import ModelView from . import setup class CustomModelView(ModelView): def __init__(...
bsd-3-clause
-4,268,105,280,054,733,300
26.464206
108
0.577608
false
awerner/pymime
integration/django_attachmentstore/settings.py
1
5078
# Django settings for django_attachmentstore project. import os ROOT = lambda * x: os.path.normpath(os.path.join(os.path.abspath(os.path.dirname(__file__)), *x)) DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS SERVER_EMAIL = "root@localhost" EMAIL_S...
gpl-3.0
-4,900,078,274,259,793,000
32.853333
122
0.699882
false
dpm76/Bot1
easy-tracker/playground/Tracking.py
1
2100
import numpy as np import cv2 cap = cv2.VideoCapture(0) startTracking = True while startTracking: startTracking = False # take first frame of the video _,frame = cap.read() frame = cv2.flip(frame, 1) frame = cv2.GaussianBlur(frame, (5, 5), 5) # setup initial location of window r...
mit
8,676,742,072,440,708,000
29
84
0.542857
false
eqrx/mauzr
mauzr/gui/__init__.py
1
4741
""" Montoring and control GUI. """ import enum import pygame # pylint: disable=import-error __author__ = "Alexander Sowitzki" class BaseElement: """ An visible element inside a GUI. :param location: Center of the element. :type location: mauzr.gui.Vector :param size: Size of the element. :type...
agpl-3.0
-8,324,247,963,371,238,000
26.247126
75
0.591858
false
AppEnlight/demo-application
src/appenlight_demo/views/default.py
1
5010
import random import decimal import time import requests import logging from pyramid.view import view_config from pyramid.httpexceptions import HTTPFound from datetime import datetime from ..models import ( User, Address ) log = logging.getLogger(__name__) custom_log = logging.getLogger('other.namespace.logg...
bsd-3-clause
5,970,967,025,054,382,000
35.838235
80
0.627745
false
Alex2114/Deb-3df
redeem/gcodes/T0_T1.py
1
1483
""" GCode T0 and T1 Select currently used extruder tool Author: Mathieu Monney email: zittix(at)xwaves(dot)net Website: http://www.xwaves.net License: CC BY-SA: http://creativecommons.org/licenses/by-sa/2.0/ """ from GCodeCommand import GCodeCommand import logging class ToolChange(GCodeCommand): def execute(self...
gpl-3.0
7,099,931,974,142,642,000
25.482143
104
0.616318
false
mahabs/nitro
nssrc/com/citrix/netscaler/nitro/resource/config/vpn/vpnurl.py
1
10823
# # Copyright (c) 2008-2015 Citrix Systems, 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 l...
apache-2.0
-4,927,869,333,246,552,000
29.834758
315
0.681881
false
FedoraScientific/salome-kernel
src/Container/SALOME_ComponentPy.py
1
11883
#! /usr/bin/env python # -*- coding: iso-8859-1 -*- # Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS # # This library is free software; you can redistribute it and/or # modify it under the...
lgpl-2.1
-5,998,506,831,639,814,000
35.675926
219
0.473702
false
suninsky/ReceiptOCR
Python/server/bin/painter.py
1
2146
#!/home/haop/code/ReceiptOCR/Python/server/bin/python2.7 # # The Python Imaging Library # $Id$ # # this demo script illustrates pasting into an already displayed # photoimage. note that the current version of Tk updates the whole # image every time we paste, so to get decent performance, we split # the image into a se...
mit
-8,268,578,540,794,225,000
25.170732
80
0.576421
false
cszc/meethalfway
djangohalfway/halfwayapp/views.py
1
2943
from django.shortcuts import render #import googlemaps import csv import time import json import requests from django.http import HttpResponse from django import forms from . import models class EnterIDForm(forms.Form): meeting_id = forms.CharField() def validate_trip_id(self): if Meeting.objects.filter(trip_id= ...
apache-2.0
-7,919,855,661,507,081,000
23.322314
78
0.691131
false
pacogomez/pyvcloud
tests/vcd_ext.py
1
1299
# VMware vCloud Director Python SDK # Copyright (c) 2017 VMware, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 #...
apache-2.0
-2,136,174,322,080,307,700
34.108108
74
0.724403
false
alirizakeles/tendenci
tendenci/apps/profiles/management/commands/delete_non_contributors.py
1
3096
from optparse import make_option from django.core.management.base import BaseCommand from django.core.exceptions import ObjectDoesNotExist class Command(BaseCommand): """ Get/Delete list of contributors, non-contributors and total users """ option_list = BaseCommand.option_list + ( make_option...
gpl-3.0
589,413,971,126,053,200
31.946809
89
0.578165
false
victorywang80/Maintenance
saltstack/src/tests/integration/states/ssh.py
1
6090
''' Test the ssh_known_hosts state ''' # Import python libs import os import shutil # Import Salt Testing libs from salttesting import skipIf from salttesting.helpers import ( destructiveTest, ensure_in_syspath, with_system_account ) ensure_in_syspath('../../') # Import salt libs import integration KNOW...
apache-2.0
-317,516,152,801,650,940
31.393617
78
0.569458
false
davibe/cerbero
cerbero/bootstrap/linux.py
1
5412
# cerbero - a multi-platform build system for Open Source software # Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; eit...
lgpl-2.1
1,586,423,981,772,867,800
46.473684
81
0.633038
false
hail-is/hail
hail/python/test/hail/matrixtable/test_matrix_table.py
1
69087
import math import operator import random import pytest import hail as hl import hail.expr.aggregators as agg from hail.utils.java import Env from hail.utils.misc import new_temp_file from ..helpers import * setUpModule = startTestHailContext tearDownModule = stopTestHailContext class Tests(unittest.TestCase): ...
mit
8,413,379,200,223,143,000
42.698292
127
0.546869
false
PaulSD/tendenci_autox
tendenci_autox/models.py
1
70574
from datetime import datetime, date, timedelta import re from django.db import models, transaction, IntegrityError from django.db.models import Q from django.contrib.auth.models import User from django.conf import settings from django.forms import ValidationError from django.core.exceptions import PermissionDenied fr...
gpl-3.0
-6,137,469,636,408,634,000
58.405724
254
0.651118
false
mikhaildubov/Rhinoceros-Python-Scripts
code/curves/isometricflow.py
1
2639
# Edge flow # Mikhail Dubov # 2015-11-24 from math import radians, pi, sin, tan import rhinoscriptsyntax as rs # Some shortcuts for vector operations to improve code readability unit = rs.VectorUnitize subtract = rs.VectorSubtract scale = rs.VectorScale rev = rs.VectorReverse length = rs.VectorLength r...
mit
-6,460,669,401,087,479,000
29.047059
126
0.595301
false
DataPilot/notebook-miner
freq_itemsets/frequent_itemsets.py
1
7264
import pyfpgrowth from apyori import apriori import time from nbminer.freq_itemsets.buckets.buckets import Bucket from nbminer.freq_itemsets.buckets.buckets import Patterns class FrequentItemsetsBase: def __init__(self, threshold=10, itemset_min=1): self.threshold = threshold self.itemset_min = it...
apache-2.0
1,007,300,429,106,448,000
35.502513
136
0.578331
false
shoopio/shoop
shuup_tests/admin/test_chart.py
2
4360
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2019, Shoop Commerce Ltd. All rights reserved. # # This source code is licensed under the OSL-3.0 license found in the # LICENSE file in the root directory of this source tree. from collections import OrderedDict import pytest from babel.numb...
agpl-3.0
-6,993,107,601,462,338,000
40.923077
119
0.637615
false
sadig/foreman-api
foreman/api/resources.py
1
1767
# -*- coding: utf-8 -*- ############################################################################### # # foreman-api - python foreman api wrapper # Copyright (C) 2010, 2011, 2012, 2013 Stephan Adig <sh@sourcecode.de> # This program is free software; you can redistribute it and/or modify # it under the t...
lgpl-2.1
-2,692,801,138,572,101,000
40.093023
126
0.617997
false
andela-wcyn/bucketlist
manage.py
1
1374
import os from flask_migrate import Migrate, MigrateCommand from flask_script import Manager, prompt_bool from flask_script import Server from api import create_app, db from api.models import User, Bucketlist, BucketlistItem app = create_app(os.getenv('BUCKETLIST_ENV') or 'dev') manager = Manager(app) migrate = Migr...
mit
3,664,571,395,458,831,400
27.040816
78
0.678311
false
WikiWatershed/gwlf-e
gwlfe/Input/WaterBudget/InitSnow.py
1
1041
from numpy import zeros from gwlfe.Memoization import memoize try: from InitSnow_f_inner_compiled import InitSnow_f_inner except ImportError: print("Unable to import compiled InitSnow_inner, using slower version") from gwlfe.Input.WaterBudget.InitSnow_inner import InitSnow_f_inner def InitSnow(NYrs, Day...
apache-2.0
-6,762,851,379,802,523,000
32.580645
82
0.576369
false
abawchen/leetcode
tests/088.py
1
2297
import unittest import sys sys.path.append('./') solutions = __import__('solutions.088_merge_sorted_array', fromlist='*') class Test088(unittest.TestCase): def test_merge(self): s = solutions.Solution() nums1 = [] nums2 = [] self.assertEqual(s.merge(nums1, len(nums1), nums2, len(...
mit
2,570,857,993,665,662,500
31.352113
90
0.448846
false
HybridF5/jacket
jacket/worker/api.py
1
13188
# 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 or agreed to in...
apache-2.0
3,362,914,868,334,997,000
41.541935
82
0.573324
false
lenoch/tagsetbench
tagsetbench.py
1
5829
from contextlib import contextmanager from copy import deepcopy from pathlib import PosixPath from log import log # WISH: zahodit (z annotate, bootstrap, create_model, majka, makefile, split_corpus a test_configure) ShellPath = PosixPath class ExpandableList(list): def __init__(self, iterable): super()....
mit
-836,647,996,692,605,200
32.643275
101
0.605076
false
Cito/DBUtils
dbutils/steady_pg.py
1
11312
"""SteadyPg - hardened classic PyGreSQL connections. Implements steady connections to a PostgreSQL database using the classic (not DB-API 2 compliant) PyGreSQL API. The connections are transparently reopened when they are closed or the database connection has been lost or when they are used more often than an optiona...
mit
3,576,289,393,901,881,000
33.487805
79
0.606082
false
prophile/jacquard
jacquard/storage/utils.py
1
3766
"""General storage engine utilities.""" import json import logging import functools import collections.abc from jacquard.plugin import plug from jacquard.storage.exceptions import Retry def retrying(fn): """Decorator: reissues the function if it raises Retry.""" logger = logging.getLogger("jacquard.storage....
mit
1,159,509,810,565,048,000
28.193798
79
0.594796
false
pyfa-org/eos
tests/integration/calculator/mod_operator/mixed/test_all_in.py
1
7011
# ============================================================================== # Copyright (C) 2011 Diego Duclos # Copyright (C) 2011-2018 Anton Vorobyov # # This file is part of Eos. # # Eos is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as publi...
lgpl-3.0
-828,864,303,853,738,000
42.546584
80
0.61432
false
OpenMined/PySyft
packages/grid/apps/domain/src/__main__.py
1
1688
""" Note: This file should be used only for development purposes. Use the Flask built-in web server isn't suitable for production. For production, we need to put it behind real web server able to communicate with Flask through a WSGI protocol. A common choice for that is Gunicorn. """ # stdlib import argparse import ...
apache-2.0
-5,058,307,953,008,342,000
25.793651
114
0.675948
false
manglakaran/TrafficKarmaSent
src/traffickarmasent/test.py
1
2759
import tweepy import json,re,sys # Authentication details. To obtain these visit dev.twitter.com consumer_key = 'ufulV3imKoYNzdh58LotTC1YD' consumer_secret = '2A781ma736HTenAXXYn9tRIelQYJkbCqY0GLi7W71ZwwDmNU59' access_token = '2564905075-MY9osfHabaRnonQVHHhHeA1vCLSOhuHWjBNBiIY' access_token_secret = 'JsD8Woc7i...
mit
-482,987,571,816,521,100
26.868687
185
0.654223
false
scionrep/scioncc
src/ion/util/test/test_parse_utils.py
1
11720
#!/usr/bin/env python __author__ = 'Michael Meisinger' from nose.plugins.attrib import attr from pyon.public import BadRequest from pyon.util.unit_test import UnitTestCase from ion.util.parse_utils import get_typed_value @attr('UNIT') class TestParseUtils(UnitTestCase): def test_get_typed_value(self): ...
bsd-2-clause
-1,885,126,484,622,097,700
48.87234
96
0.626621
false
haiyangd/cockpit_view
test/testinfra.py
1
9279
import argparse import errno import httplib import json import urllib import os import shutil import subprocess import sys import tarfile import tempfile import urlparse TOKEN = "~/.config/github-token" WHITELIST = "~/.config/github-whitelist" OS = os.environ.get("TEST_OS", "fedora-22") ARCH = os.environ.get("TEST_A...
lgpl-2.1
2,327,842,785,275,821,000
32.021352
111
0.55243
false
martinp/jarvis2
jarvis/jobs/imap.py
1
1559
# -*- coding: utf-8 -*- import imaplib import re try: # urlparse was moved to urllib.parse in Python 3 from urllib.parse import urlparse except ImportError: from urlparse import urlparse from jobs import AbstractJob class IMAP(AbstractJob): def __init__(self, conf): self.interval = conf['in...
mit
-1,302,837,366,633,347,300
28.980769
75
0.584349
false
Unofficial-Extend-Project-Mirror/openfoam-extend-Breeder-other-scripting-PyFoam
PyFoam/Infrastructure/Logging.py
1
1801
# ICE Revision: $Id$ """Writes Logfiles""" from PyFoam.ThirdParty.six import print_ try: import logging hasLogging=True except ImportError: # For Python-versions < 2.3 print_("Warning: old python-version. No logging-support") hasLogging=False from PyFoam.Infrastructure.Hardcoded import assertDir...
gpl-2.0
4,549,308,299,438,506,500
25.115942
156
0.660744
false
mlundblad/telepathy-gabble
tests/twisted/caps/hashed-caps.py
1
11926
# coding=utf-8 """ Test the verification string introduced in version 1.5 of XEP-0115 This test changes the caps several times: - Initial presence to be online - Change presence to handle audio calls, using XEP-0115-v1.3. Check that 'CapabilitiesChanged' *is* fired - Change presence *not* to handle audio calls, usin...
lgpl-2.1
8,532,957,967,630,063,000
34.269231
108
0.64357
false
edx/ecommerce
ecommerce/extensions/refund/tests/test_signals.py
1
4852
from mock import patch from ecommerce.core.constants import SEAT_PRODUCT_CLASS_NAME from ecommerce.core.models import SegmentClient from ecommerce.extensions.analytics.utils import ECOM_TRACKING_ID_FMT from ecommerce.extensions.refund.api import create_refunds from ecommerce.extensions.refund.tests.mixins import Ref...
agpl-3.0
-6,382,021,938,198,452,000
43.513761
115
0.655812
false