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
yuikns/pattern-counter
data/dataset/ER_middle/generate_graph.py
1
1801
import random as ran import networkx as nx import Queue import matplotlib.pyplot as plt n=150 # number of nodes p=0.1 # edge selection probability G=nx.erdos_renyi_graph(n,p) print "#nodes = ", G.number_of_nodes() print "#edges = ", G.number_of_edges() L=1000 # number of logs influence_probability = 0.35 # act...
mit
-1,865,508,281,380,050,700
25.101449
82
0.609661
false
astropy/photutils
photutils/detection/peakfinder.py
1
7745
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module provides tools for finding local peaks in an astronomical image. """ import warnings from astropy.table import Table import numpy as np from ..utils.exceptions import NoDetectionsWarning __all__ = ['find_peaks'] def find_peaks(data, t...
bsd-3-clause
3,252,517,488,236,389,400
38.116162
77
0.634732
false
ericpre/hyperspy
hyperspy/io_plugins/hspy.py
1
31796
# -*- coding: utf-8 -*- # Copyright 2007-2021 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy 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...
gpl-3.0
-2,065,360,871,214,329,600
38.645885
82
0.541169
false
tristanfisher/flask
flask/testing.py
1
6608
# -*- coding: utf-8 -*- """ flask.testing ~~~~~~~~~~~~~ Implements test support helpers. This module is lazily imported and usually not used in production environments. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import werkzeug from contextlib im...
bsd-3-clause
-7,685,442,334,930,626,000
36.76
78
0.611834
false
StartTheShift/thunderdome-logging
setup.py
1
1329
import sys from setuptools import setup, find_packages #next time: #python setup.py register #python setup.py sdist upload version = open('thunderdome_logging/VERSION', 'r').readline().strip() long_desc = """ Extension for thunderdome which allows error logging in the graph. """ setup( name='thunderdome-logging...
mit
7,834,285,208,966,804,000
33.076923
141
0.669676
false
cubicdaiya/python-q4m
python_q4m/__init__.py
1
1380
# -*- coding: utf-8 -*- import python_q4m __author__ = "Tatsuhiko Kubo (cubicdaiya@gmail.com)" __version__ = "0.0.6" __license__ = "GPL2" __doc__ = """ This module is simple Q4M operation wrapper developed by pixiv Inc. for asynchronous upload system Simple example of usage is followings >>> from python_q4m....
gpl-2.0
372,192,313,206,318,800
30.363636
98
0.465942
false
gthank/pytips
alembic/env.py
1
2550
from __future__ import with_statement from alembic import context from sqlalchemy import engine_from_config, pool from logging.config import fileConfig # this is the Alembic Config object, which provides # access to the values within the .ini file in use. config = context.config # Interpret the config file for Python...
isc
-8,752,441,984,729,038,000
30.097561
79
0.698824
false
semeniuta/FlexVi
flexvi/daq/aravisgrabber.py
1
1399
from enum import Enum from gi.repository import Aravis as ar import aravis as pyar class AravisEnv: def __init__(self): ''' Get device IDs and initialize Camera objects ''' ar.update_device_list() self.device_ids = pyar.get_device_ids() self.cameras = {i: pyar.Camera(i) for i in sel...
gpl-2.0
-4,096,126,815,948,293,000
35.815789
89
0.643317
false
eliostvs/tomate-exec-plugin
setup.py
1
1335
#!/bin/env python import os from setuptools import setup def find_xdg_data_files(syspath, relativepath, pkgname, data_files=[]): for (dirname, _, filenames) in os.walk(relativepath): if filenames: syspath = syspath.format(pkgname=pkgname) subpath = dirname.split(relativepath)[1] ...
gpl-3.0
-5,612,258,948,244,956,000
26.244898
94
0.64794
false
larsbutler/swift
test/unit/obj/test_expirer.py
1
28044
# Copyright (c) 2011 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 ...
apache-2.0
5,540,752,920,553,979,000
34.861893
78
0.54525
false
apache/incubator-superset
tests/charts/api_tests.py
1
62443
# 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
4,903,939,264,980,543,000
36.844242
105
0.577983
false
TheLady/Lexos
processors/prepare/cutter.py
1
14378
import re from Queue import Queue from math import ceil from types import * WHITESPACE = ['\n', '\t', ' ', '', u'\u3000'] # from helpers.constants import WHITESPACE def splitKeepWhitespace(string): """ Splits the string on whitespace, while keeping the tokens on which the string was split. Args: ...
mit
5,435,624,853,086,091,000
31.90389
146
0.648839
false
drabastomek/practicalDataAnalysisCookbook
Codes/Chapter06/regression_randomForest.py
1
2303
# this is needed to load helper from the parent folder import sys sys.path.append('..') # the rest of the imports import helper as hlp import pandas as pd import numpy as np import sklearn.ensemble as en import sklearn.cross_validation as cv @hlp.timeit def regression_rf(x,y): ''' Estimate a random forest...
gpl-2.0
5,688,512,074,880,824,000
24.318681
62
0.671298
false
airekans/Snippet
python/numpy_scipy_learning/spline.py
1
1310
import numpy as np import scipy as sp from scipy.interpolate import UnivariateSpline import matplotlib.pyplot as plt x = [1, 2, 3, 4, 5, 6, 7] y = [1, 4, 9, 16, 26, 30, 51] # Test Spline trajectory = np.array([x, y], dtype=float) print trajectory plt.plot(trajectory[0], trajectory[1]) plt.show() s = sp.interpolate.U...
unlicense
-259,108,058,511,957,630
21.20339
70
0.726718
false
arky/pootle-dev
pootle/apps/pootle_misc/siteconfig.py
1
1832
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2004-2013 Zuza Software Foundation # # This file is part of Pootle. # # Pootle 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 th...
gpl-2.0
-3,864,998,015,168,332,000
33.566038
79
0.696507
false
uw-it-aca/uw-restclients
restclients/test/bridge/models.py
1
5687
from datetime import datetime from django.test import TestCase from django.utils.dateparse import parse_datetime from restclients.exceptions import DataFailureException from restclients.models.bridge import BridgeUser, BridgeCustomField,\ BridgeUserRole from restclients.test import fdao_pws_override class TestBri...
apache-2.0
7,133,562,859,963,257,000
37.167785
73
0.472305
false
kenshinx/rps
test/http_client.py
1
4579
#! /usr/bin/env python import re import socket import optparse HTTP_PROXY_HOST = "dev1" HTTP_PROXY_PORT = 8889 HTTP_PROXY_HOST = "localhost" HTTP_PROXY_PORT = 9891 HTTP_PROXY_UNAME = "rps" HTTP_PROXY_PASSWD = "secret" class HTTPTunnelPorxy(object): pattern = re.compile("^HTTP\/1\.\d ([0-9]{3}) .*") def __...
mit
-7,370,360,084,969,663,000
24.581006
74
0.505569
false
calee0219/Course
SDN/Lab1/FatTreeTopoHardCode.py
1
4467
#!/usr/bin/env python from mininet.topo import Topo from mininet import net from mininet.net import Mininet POD_NUM = 4 class FatTreeTopoHardCode(Topo): """ A Simple FatTree Topo """ def __init__(self): # Initialize topology Topo.__init__(self) # Create pod and core #...
mit
-4,874,537,547,002,850,000
30.457746
52
0.544437
false
living180/vex
vex/make.py
1
2367
import os import sys import distutils.spawn from vex.run import run from vex import exceptions PYDOC_SCRIPT = """#!/usr/bin/env python from pydoc import cli cli() """.encode('ascii') PYDOC_BATCH = """ @python -m pydoc %* """.encode('ascii') def handle_make(environ, options, make_path): if os.path.exists(make_...
mit
-1,349,267,931,707,901,400
32.814286
72
0.600338
false
census-instrumentation/opencensus-python
context/opencensus-context/opencensus/common/runtime_context/__init__.py
1
5207
# Copyright 2019, OpenCensus Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
apache-2.0
6,168,054,212,656,618,000
28.418079
78
0.580757
false
google-research/tensor2robot
preprocessors/distortion.py
1
4670
# coding=utf-8 # Copyright 2021 The Tensor2Robot Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
apache-2.0
1,685,826,182,705,913,300
36.96748
80
0.66788
false
huangminghuang/ansible-docker-connection
connection_plugins/docker.py
1
3787
# Connection plugin for configuring docker containers # Author: Lorin Hochstein # # Based on the chroot connection plugin by Maykel Moya import os import subprocess import time from ansible import errors from ansible.callbacks import vvv class Connection(object): def __init__(self, runner, host, port, *args, **k...
gpl-3.0
7,907,822,090,526,358,000
37.642857
79
0.567468
false
JeroenBosmans/nabu
nabu/processing/text_reader.py
1
3606
'''@file textreader.py contains the Textreader class''' import os import numpy as np class TextReader(object): '''reads text from disk''' def __init__(self, textfile, max_length, coder, base_pos=0, end_pos=None): '''TextReader constructor Args: textfile: the path...
mit
-8,119,472,119,550,117,000
27.619048
79
0.567388
false
zenieldanaku/pygpj
main.py
1
1847
import func.core.config as c import func.core.intro as intro from func.core.lang import t from func.core.viz import subselector from func.core.prsnj import Pj from func.core.export import imprimir_clases import os def cargar_archivo(prompt, carpeta): from func.data.setup import data as s ars, nom = [...
mit
-6,750,891,117,660,819,000
32.166667
95
0.532249
false
fzimmermann89/pyload
module/plugins/hoster/LoadTo.py
1
2129
# -*- coding: utf-8 -*- # # Test links: # http://www.load.to/JWydcofUY6/random.bin # http://www.load.to/oeSmrfkXE/random100.bin import re from module.plugins.captcha.SolveMedia import SolveMedia from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class LoadTo(SimpleHoster): __name__ ...
gpl-3.0
2,512,844,144,708,544,500
29.855072
85
0.542508
false
SUNET/eduid-webapp
src/eduid_webapp/idp/tou_action.py
1
2992
# # Copyright (c) 2015 NORDUnet A/S # 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 list of ...
bsd-3-clause
7,871,357,113,988,800,000
41.742857
119
0.739973
false
robin-lai/DensityPeakCluster
plot.py
1
1965
#!/usr/bin/env python # -*- coding: UTF-8 -*- import logging import numpy as np from cluster import * from sklearn import manifold from plot_utils import * def plot_rho_delta(rho, delta): ''' Plot scatter diagram for rho-delta points Args: rho : rho list delta : delta list ''' logger.info("PLOT: rho-delta...
mit
-2,970,879,158,770,166,000
34.107143
110
0.679389
false
samantp/gensimPy3
gensim/models/lsi_worker.py
1
3221
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ USAGE: %(program)s Worker ("slave") process used in computing distributed LSI. Run this script \ on every node in your cluster....
gpl-3.0
-6,709,509,564,474,837,000
29.971154
123
0.656007
false
gilliM/MFQ
ModisFromQgis/mypymodis/convertmodis.py
1
9852
#!/usr/bin/env python # class to convert/process modis data # # (c) Copyright Luca Delucchi 2010 # Authors: Luca Delucchi # Email: luca dot delucchi at iasma dot it # ################################################################## # # This MODIS Python class is licensed under the terms of GNU GPL 2. # This pro...
gpl-2.0
3,430,796,322,326,660,000
41.649351
103
0.593991
false
ratoaq2/deluge
deluge/core/rpcserver.py
1
21636
# -*- coding: utf-8 -*- # # Copyright (C) 2008,2009 Andrew Resch <andrewresch@gmail.com> # # This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with # the additional special exception to link portions of this program with the OpenSSL library. # See LICENSE for more details. # "...
gpl-3.0
-4,821,459,966,041,163,000
35.180602
120
0.594888
false
MetricsGrimoire/sortinghat
tests/test_matcher.py
1
11000
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2014-2017 Bitergia # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any la...
gpl-3.0
5,165,033,627,049,388,000
38.282143
95
0.582508
false
dataflow/DataStage
test/FileShare/tests/TestFileUserAPublic.py
1
11291
# --------------------------------------------------------------------- # # Copyright (c) 2012 University of Oxford # # 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, incl...
mit
4,551,241,056,492,288,500
33.741538
143
0.604818
false
lexman/tuttle
tuttle/process.py
1
4297
# -*- coding: utf8 -*- from time import time class Process: """ Class wrapping a process. A process has some input resources, some output resources, some code that produces outputs from inputs, a processor that handle the language specificities """ def __init__(self, processor, filename, line_num):...
mit
1,463,314,768,997,302,000
27.091503
118
0.593903
false
mate-desktop/pluma
plugins/pythonconsole/pythonconsole/__init__.py
1
2589
# -*- coding: utf-8 -*- # __init__.py -- plugin object # # Copyright (C) 2006 - Steve Frécinaux # Copyright (C) 2012-2021 MATE Developers # # 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; eithe...
gpl-2.0
8,445,804,338,091,260,000
38.19697
91
0.669115
false
gimler/guzzle-docs
conf.py
1
7580
# -*- coding: utf-8 -*- # # Guzzle documentation build configuration file, created by # sphinx-quickstart on Tue Mar 1 22:54:52 2011. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All ...
mit
6,383,357,341,490,664,000
31.532189
80
0.710158
false
dikien/Machine-Learning-Newspaper
nytimes/step4_knn.py
1
1812
# -*- coding: UTF-8 -*- from time import time from step3_feature_engineering import preprocess_2 from sklearn.neighbors import KNeighborsClassifier from sklearn.cross_validation import KFold from sklearn import grid_search features, labels, vectorizer, selector, le = preprocess_2("pkl/article_2_people.pkl", "pkl/labl...
bsd-3-clause
6,622,033,397,770,966,000
52.323529
738
0.672737
false
hinesmr/libvirt-python
setup.py
1
10005
#!/usr/bin/python from distutils.core import setup, Extension, Command from distutils.command.build import build from distutils.command.clean import clean from distutils.command.sdist import sdist from distutils.dir_util import remove_tree from distutils.util import get_platform from distutils.spawn import spawn from ...
gpl-2.0
-9,192,808,951,975,738,000
28.513274
127
0.545527
false
mennanov/django-blueprint
project_name/dashboard.py
1
3076
""" This file was generated with the customdashboard management command and contains the class for the main dashboard. To activate your index dashboard add the following to your settings.py:: GRAPPELLI_INDEX_DASHBOARD = '{{ project_name }}.dashboard.CustomIndexDashboard' """ from django.utils.translation import u...
gpl-2.0
3,621,246,021,172,486,700
30.71134
83
0.479844
false
hivebio/ministat-1
scripts/avg.py
1
1025
#!/usr/bin/env python # license removed for brevity import rospy from std_msgs.msg import Float32, Int32 sumdata = 0.0 count = 0 def callback(data): global count, sumdata sumdata += data.data count += 1 def listener(): global count, sumdata pub = rospy.Publisher('avg', Float32, queue_size=10)...
bsd-2-clause
-5,575,920,084,302,954,000
25.973684
72
0.642927
false
abeing/droog
droog/world.py
1
26187
# -*- coding: UTF-8 -*- # Droog # Copyright (C) 2015 Adam Miezianko # # 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. ...
gpl-2.0
4,446,171,767,116,297,000
39.041284
79
0.543743
false
QuintilianoB/Violent-Python-examples
Chapter 2/5.debianSshWeakPK.py
1
3380
# SSH brute force with pxssh class and keyfile, based on chapter 2 # Python 3.4 """ Another example of this script: https://www.exploit-db.com/exploits/5720/ The 32768 keys can be found here: https://github.com/g0tmi1k/debian-ssh The exploit CVE: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-0166 For th...
gpl-2.0
-930,355,457,819,945,000
30.598131
110
0.633728
false
Fxrh/tispa-wm
libqtile/command.py
1
12105
# Copyright (c) 2008, Aldo Cortesi. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify,...
gpl-3.0
-735,328,225,687,440,100
29.11194
79
0.581
false
PaesslerAG/PythonMiniProbe
miniprobe/miniprobe.py
1
7571
#!/usr/bin/env python # Copyright (c) 2014, Paessler AG <support@paessler.com> # 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 not...
bsd-3-clause
-7,684,119,281,292,025,000
37.431472
119
0.59226
false
napalm-automation/napalm-yang
napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/as_external_lsa/state/__init__.py
1
49119
# -*- coding: utf-8 -*- from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListTy...
apache-2.0
-8,142,410,994,552,868,000
42.85625
643
0.561575
false
sillygod/my-travel-in-learning-python
databaseProject/DataBase.py
1
2520
''' FUNC: read a xml file(database) and transfer it to a list of dictionary type note: no case sensitive I will make a rule about the database in xml form ex. ____________________________ Student |name | ID | score | and ID is a key |aa | 1 | 10 | |bb | 2 | 20 | in XML file, I will use som...
gpl-2.0
2,119,482,450,881,611,800
23.950495
102
0.658333
false
DarkDruiD/Machinery
Python/Machinery/example.py
1
1470
import time import random from datapath import Datapath from controller import Delta from controller import State from controller import FSMD def locked_on_enter(): print "Entered locked state" time.sleep(3) def locked_on_leave(): pass locked = State("locked") locked.on_enter = locked_on_enter locke...
mit
-3,953,514,065,446,916,000
12.125
50
0.669388
false
anushbmx/kitsune
kitsune/users/urls.py
1
4192
from django.conf import settings from django.conf.urls import include, url from django.views.decorators.cache import never_cache from mozilla_django_oidc.views import OIDCAuthenticationCallbackView import kitsune.flagit.views from kitsune.sumo.views import redirect_to from kitsune.users import api, views from kitsune...
bsd-3-clause
7,517,170,160,506,751,000
40.098039
86
0.649332
false
bniemczyk/symbolic
tests/graph.py
1
1719
import symath from symath.graph.algorithms import * import symath.graph.generation as graphgen import unittest class TestDirectedGraph(unittest.TestCase): def setUp(self): self.x, self.y, self.z, self.w, self.e1, self.e2 = symath.symbols('x y z w e1 e2') self.g = symath.graph.directed.DirectedGra...
bsd-2-clause
6,984,097,929,951,748,000
31.705882
86
0.655614
false
jelly/calibre
src/calibre/ebooks/pdf/pdftohtml.py
1
6990
# -*- coding: utf-8 -*- __license__ = 'GPL 3' __copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>, ' \ '2009, John Schember <john@nachtimwald.com>' __docformat__ = 'restructuredtext en' import errno, os, sys, subprocess, shutil, re from functools import partial from calibre.ebooks import Con...
gpl-3.0
4,022,858,997,273,561,000
37.406593
121
0.558798
false
chaen/DIRAC
ResourceStatusSystem/Client/ResourceStatusClient.py
1
14924
''' ResourceStatusClient Client to interact with the ResourceStatusDB. ''' # pylint: disable=unused-argument __RCSID__ = '$Id$' from DIRAC import S_OK from DIRAC.Core.Base.Client import Client from DIRAC.ConfigurationSystem.Client.Helpers.Operations import Operations from DIRAC.FrameworkSystem.Client.Notificatio...
gpl-3.0
-4,775,719,922,118,156,000
38.170604
94
0.607679
false
cstipkovic/spidermonkey-research
testing/talos/talos/ffsetup.py
1
6208
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. """ Set up a browser environment before running a test. """ import os import re import tempfile import mozfile from moz...
mpl-2.0
83,377,925,997,244,750
34.678161
79
0.597777
false
navcoindev/navcoin-core
qa/rpc-tests/dao/003-proposal-accepted.py
1
1541
#!/usr/bin/env python3 # Copyright (c) 2019 The Navcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. import sys, os #include the parent folder so the test_framework is available sys.path.insert(1, os.path.abspat...
mit
-1,843,502,945,225,359,600
32.521739
112
0.709929
false
jasonfleming/asgs
output/paraviewBathyWSE.py
1
7106
#!/usr/bin/env python #---------------------------------------------------------------------- # paraviewBathyWSE.py : Visualize bathy and wse simultaneously in # Paraview. #---------------------------------------------------------------------- # Copyright(C) 2016 Jason Fleming # # This file is part of the ADCIRC Surge...
gpl-3.0
-6,397,047,685,143,120,000
53.661538
802
0.698987
false
Pantynopants/DBMS_BANK
app/admin/views.py
1
6292
# -*- coding=utf-8 -*- from flask import render_template, flash, redirect, url_for, request, make_response, current_app from flask_login import login_required, current_user, login_user, logout_user from forms import * from ..models import * from .. import db from ..utils import db_utils from . import admin ...
gpl-3.0
-3,674,240,570,483,265,000
33.609195
102
0.591026
false
prcutler/nflpool
nflpool/viewmodels/playerpicks_viewmodel.py
1
4310
from nflpool.viewmodels.viewmodelbase import ViewModelBase class PlayerPicksViewModel(ViewModelBase): def __init__(self): self.afc_east_winner_pick = None self.afc_east_second = None self.afc_east_last = None self.afc_north_winner_pick = None self.afc_north_second = None ...
mit
2,485,024,036,205,383,700
47.426966
75
0.623666
false
702nADOS/sumo
tools/contributed/sumopy/agilepy/lib_base/logger.py
1
1227
import types class Logger: def __init__(self, filepath=None, is_stdout=True): self._filepath = filepath self._logfile = None self._callbacks = {} self._is_stdout = is_stdout def start(self, text=''): if self._filepath != None: self._logfile = open(self._fi...
gpl-3.0
895,495,032,246,819,500
26.266667
54
0.519152
false
ayepezv/GAD_ERP
addons/hr_expense/__openerp__.py
2
1889
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Expense Tracker', 'version': '2.0', 'category': 'Human Resources', 'sequence': 95, 'summary': 'Expenses Validation, Invoicing', 'description': """ Manage expenses by Employees ========...
gpl-3.0
-3,994,445,756,238,314,000
38.3125
244
0.661897
false
meatballhat/ansible-inventory-hacks
ansible_inventory_hacks/etcd/touch.py
1
2242
#!/usr/bin/env python # vim:fileencoding=utf-8 import argparse import datetime import os import socket import subprocess import sys import etcd from . import DEFAULT_PREFIX ETCD_KEY_TMPL = '{prefix}/{hostname}/{key}' USAGE = """%(prog)s [options] Splat some metadata into etcd! """ def main(sysargs=sys.argv[:]):...
mit
-579,326,199,278,497,900
27.74359
79
0.630687
false
datapythonista/pandas
pandas/core/groupby/generic.py
1
63278
""" Define the SeriesGroupBy and DataFrameGroupBy classes that hold the groupby interfaces (and some implementations). These are user facing as the result of the ``df.groupby(...)`` operations, which here returns a DataFrameGroupBy object. """ from __future__ import annotations from collections import ( abc, ...
bsd-3-clause
-8,992,444,320,100,172,000
32.947425
88
0.548184
false
Pulgama/supriya
tests/test_patterns_Pgpar_Pfx_Pgroup.py
1
11524
import pytest import uqbar.strings import supriya.assets.synthdefs import supriya.nonrealtime import supriya.patterns import supriya.synthdefs import supriya.ugens with supriya.synthdefs.SynthDefBuilder(in_=0, out=0) as builder: source = supriya.ugens.In.ar(bus=builder["in_"]) source = supriya.ugens.Limiter.a...
mit
-7,873,358,582,196,026,000
31.645892
95
0.342676
false
tgbugs/pyontutils
test/test_oboio.py
1
6002
import os import shutil import unittest import pytest from pyontutils import obo_io as oio from .common import temp_path obo_test_string = """format-version: 1.2 ontology: uberon/core subsetdef: cumbo "CUMBO" treat-xrefs-as-has-subclass: EV import: http://purl.obolibrary.org/obo/uberon/chebi_import.owl treat-xrefs-as-...
mit
-6,232,890,414,575,821,000
34.72619
201
0.598967
false
imito/odin
odin/networks/mixture_density_network.py
1
10035
from __future__ import absolute_import, division, print_function import collections import numpy as np import tensorflow as tf from sklearn.mixture import GaussianMixture from tensorflow.python import keras from tensorflow.python.framework import tensor_shape from tensorflow.python.keras.layers import Dense from tens...
mit
-7,376,699,029,470,903,000
39.959184
80
0.621325
false
tensorflow/model-analysis
tensorflow_model_analysis/eval_saved_model/example_trainers/control_dependency_estimator.py
1
6700
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
-6,121,643,079,959,225,000
38.64497
80
0.673134
false
pedro2d10/SickRage-FR
sickbeard/notifiers/emby.py
1
4193
# coding=utf-8 # Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # 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 version 3...
gpl-3.0
-1,720,672,605,901,913,900
33.652893
178
0.576198
false
CyberTaoFlow/scirius
scirius/settings.py
1
4444
""" Django settings for scirius project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) fr...
gpl-3.0
-3,509,663,828,025,243,000
24.988304
98
0.726373
false
bt3gl/Neat-Problems-in-Python-and-Flask
USEFUL/snippets_and_examples_Flask/example_password_reset/app/auth/views.py
1
4889
from flask import render_template, redirect, request, url_for, flash from flask.ext.login import login_user, logout_user, login_required, \ current_user from . import auth from .. import db from ..models import User from ..email import send_email from .forms import LoginForm, RegistrationForm, ChangePasswordForm,\ ...
mit
-1,030,766,068,768,395,900
35.485075
78
0.644713
false
meahmadi/nsun
server.py
1
2333
import web import traceback import webbrowser from web.contrib import template import os import json from datetime import datetime #from ir.idehgostar.modir.assistant.mind import Mind from ir.ac.iust.me_ahmadi.multiProcessMind.mind import Mind render = template.render_genshi(['./templates/']) urls = ( '/(.*)', ...
gpl-2.0
-8,180,544,014,247,534,000
24.086022
109
0.672953
false
guh/guh-cli
nymea/notifications.py
1
3045
# -*- coding: UTF-8 -*- # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Copyright (C) 2015 - 2018 Simon Stuerz <simon.stuerz@guh.io> # # ...
gpl-2.0
2,748,701,511,971,271,000
37.544304
92
0.469951
false
maurozucchelli/dipy
dipy/tests/test_scripts.py
1
5495
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """ Test scripts If we appear to be running from the development directory, use the scripts in the top-level folder ``scripts``. Otherwise try and get the scripts from the path """ from __future__ import ...
bsd-3-clause
-1,704,001,170,354,622,000
35.390728
84
0.648408
false
MJ-meo-dmt/Ecliptic
src/player.py
1
10301
#!/usr/bin/python # System imports import sys, math, os # Panda imports from panda3d.core import * from pandac.PandaModules import * from direct.actor.Actor import Actor from direct.interval.IntervalGlobal import * from direct.task import Task from direct.showbase.DirectObject import DirectObject from panda3d.core im...
bsd-3-clause
5,954,991,454,922,168,000
31.701587
101
0.558878
false
yamins81/tabular
tabular/spreadsheet.py
1
57202
""" Spreadsheet-style functions for NumPy ndarray with structured dtype or recarray objects: aggregate, aggregate_in, pivot, addrecords, addcols, deletecols, renamecol, replace, colstack, rowstack, nullvalue Note that these functions are also wrapped as methods of the tabular tabarray object, which is a subclass of...
mit
-489,199,996,321,512,960
34.931533
92
0.546152
false
KiMiralles/Python-Learning
Computational Physics Newman/Book Resources/bulirsch.py
1
1824
from math import sin,pi from numpy import empty,array,arange from pylab import plot,show g = 9.81 l = 0.1 theta0 = 179*pi/180 a = 0.0 b = 10.0 N = 100 # Number of "big steps" H = (b-a)/N # Size of "big steps" delta = 1e-8 # Required position accuracy per unit time def f(r): theta = r[0] ome...
gpl-3.0
7,120,225,636,442,674,000
23.648649
62
0.565241
false
ESSS/pytest-regressions
src/pytest_regressions/data_regression.py
1
3451
from functools import partial import yaml from pytest_regressions.common import Path, check_text_files, perform_regression_check class DataRegressionFixture: """ Implementation of `data_regression` fixture. """ def __init__(self, datadir, original_datadir, request): """ :type datadi...
mit
7,882,442,899,186,516,000
33.858586
110
0.622718
false
Skynet2-0/Skynet2.0
agent/Wallet.py
1
4754
""" Created on Apr 26, 2016 @author: niels """ from subprocess import PIPE, STDOUT from BogusFormBuilder import BogusFormBuilder import subprocess import re import os import time import sys import pexpect class Wallet(object): """ This class will manage the bitcoins going in and out off the agent. """ def __init...
gpl-3.0
8,826,590,145,078,224,000
30.071895
126
0.689314
false
rabbitvcs/rabbitvcs
setup.py
1
5870
from __future__ import absolute_import from __future__ import print_function #!/usr/bin/env python # If you didn't know already, this is a Python distutils setup script. It borrows # heavily from Phatch's (see: http://photobatch.stani.be/). # # There's a lot of comments here (on purpose) so people can actually learn f...
gpl-2.0
-7,958,066,994,226,009,000
33.127907
158
0.584838
false
hkkwok/MachOTool
utils/progress_indicator.py
1
1267
import sys import datetime class ProgressIndicator(object): ENABLED = True RECORDS = list() def __init__(self, prompt, frequency): self._display(prompt) self._record(prompt + 'start') self.prompt = prompt self.frequency = frequency self.count = 0 def click(sel...
apache-2.0
1,150,852,479,338,861,800
23.365385
68
0.539069
false
minzhangcheng/MPL
MPL/Network/Download.py
1
3810
# ############################################################################ # # Copyright (C) 2015 Minzhang Cheng # Contact: minzhangcheng@gmail.com # # This file is part of the Minzhang's Python Library, a Python library with many utils by Minzhang Cheng. # # GNU Lesser General Public License Usage # This file may ...
lgpl-3.0
6,221,154,197,156,404,000
30.237705
105
0.505512
false
denim2x/python-chess
release.py
1
5726
#!/usr/bin/python3 # Helper script to create and publish a new python-chess release. import os import chess import sys import zipfile import textwrap import configparser import requests import bs4 def system(command): if 0 != os.system(command): sys.exit(1) def check_git(): print("--- CHECK GIT ---...
gpl-3.0
6,621,367,582,515,650,000
30.461538
103
0.520608
false
debugger06/MiroX
linux/plat/options.py
1
3688
# Miro - an RSS based video player application # Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 # Participatory Culture Foundation # # 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; eithe...
gpl-2.0
1,548,895,991,307,455,500
33.46729
79
0.714208
false
mahmoudhossam/Google-Python-Exercises
basic/list1.py
1
3144
#!/usr/bin/python2 -tt # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ # Basic list exercises # Fill in the code for the functions below. main() is already set...
apache-2.0
2,616,948,283,795,058,700
30.44
79
0.604326
false
lingmann/dcos
dcos_installer/test_backend.py
1
12788
import json import os import subprocess import uuid import passlib.hash import pytest import gen import gen.build_deploy.aws import release from dcos_installer import backend from dcos_installer.config import Config, make_default_config_if_needed, to_config os.environ["BOOTSTRAP_ID"] = "12345" @pytest.fixture(scop...
apache-2.0
-2,982,937,157,660,341,000
33.562162
115
0.665077
false
Dioptas/Dioptas
dioptas/model/__init__.py
1
1265
# -*- coding: utf-8 -*- # Dioptas - GUI program for fast processing of 2D X-ray diffraction data # Principal author: Clemens Prescher (clemens.prescher@gmail.com) # Copyright (C) 2014-2019 GSECARS, University of Chicago, USA # Copyright (C) 2015-2018 Institute for Geology and Mineralogy, University of Cologne, Germany ...
gpl-3.0
8,280,915,587,935,117,000
45.851852
94
0.781818
false
adrianbeloqui/Python
nested_lists.py
1
1675
"""Given the names and grades for each student in a Physics class of N students, store them in a nested list and print the name(s) of any student(s) having the second lowest grade. Note: If there are multiple students with the same grade, order their names alphabetically and print each name on a new line. Input For...
mit
-7,068,788,371,389,833,000
29.472727
80
0.666269
false
duncan-r/SHIP
tests/test_riverunit.py
1
13279
from __future__ import unicode_literals import unittest from ship.fmp.datunits import riverunit from ship.fmp.datunits import ROW_DATA_TYPES as rdt from ship.datastructures.rowdatacollection import RowDataCollection from ship.datastructures import dataobject as do from ship.fmp.fmpunitfactory import FmpUnitFactory ...
mit
-1,056,165,014,091,718,900
63.461165
144
0.498607
false
Matt-Deacalion/Pomodoro-Calculator
pomodoro_calculator/__init__.py
1
6013
""" A pretty command line tool to calculate the number of Pomodori available between two points in time. """ __author__ = 'Matt Deacalion Stevens' __version__ = '1.0.2' import datetime from itertools import cycle class PomodoroCalculator: """ Calculates the number of Pomodori available in an amount of time. ...
mit
6,045,448,055,413,695,000
30.317708
90
0.557126
false
Yukarumya/Yukarum-Redfoxes
taskcluster/taskgraph/task/checksums_signing.py
1
1076
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from __future__ import absolute_import, print_function, unicode_literals from . import transform class ChecksumsSigni...
mpl-2.0
-1,961,531,478,082,989,000
38.851852
85
0.667286
false
colour-science/colour-branding
utilities/colour.py
1
1033
import maya.cmds as cmds import numpy as np spectrum = np.load( r"D:\Documents\Personal\Graphics\Colour\spectrum.npy")[:, 35:325, :] materials = [u'mia_material_x01', u'mia_material_x02', u'mia_material_x03', u'mia_material_x04', u'mia_material_x05', u'mia_material_x06', u'mia_mate...
bsd-3-clause
428,703,372,718,615,200
37.730769
77
0.549855
false
alainrinder/quoridor.py
src/GridCoordinates.py
1
2281
# # GridCoordinates.py # # @author Alain Rinder # @date 2017.06.02 # @version 0.1 # class GridCoordinates: """ Coordinates on square grid """ def __init__(self, col, row): self.col = col self.row = row def left(self): """ Return ...
mit
4,232,492,451,206,281,700
26.873418
113
0.562034
false
inspirehep/inspire-next
tests/unit/records/test_records_wrappers.py
1
6282
# -*- coding: utf-8 -*- # # This file is part of INSPIRE. # Copyright (C) 2014-2017 CERN. # # INSPIRE is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any ...
gpl-3.0
8,572,558,101,036,677,000
27.816514
90
0.498408
false
brunofin/coinvalue
backend/backend/settings.py
1
2626
# -*- coding: utf-8 -*- """ Django settings for backend project. Generated by 'django-admin startproject' using Django 1.8.2. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/se...
gpl-3.0
-8,834,992,552,321,021,000
24.504854
71
0.686976
false
Coriolan8/python_traning
fixture/session.py
1
1518
__author__ = "yulya" class SessionHelper: def __init__(self, app): self.app = app def Login(self, username, password): wd = self.app.wd self.app.open_home_page() wd.find_element_by_name("user").click() wd.find_element_by_name("user").clear() wd.find_element_by...
apache-2.0
7,454,230,980,946,180,000
28.211538
78
0.54809
false
grmToolbox/grmpy
promotion/grmpy_tutorial/create_slides.py
1
1443
#!/usr/bin/env python """This module compiles the lecture notes.""" import argparse import glob import os import shutil import subprocess def compile_single(is_update): """Compile a single lecture.""" for task in ["pdflatex", "bibtex", "pdflatex", "pdflatex"]: cmd = [task, "main"] subprocess.c...
mit
3,772,548,930,021,324,300
27.294118
87
0.57727
false
qstokkink/py-ipv8
ipv8/attestation/wallet/pengbaorange/boudot.py
1
4606
""" Implementation of proofs for checking commitment equality and if a commitment is a square ("Efficient Proofs that a Committed NumberLies in an Interval" by F. Boudot). Modified for use with range proofs ("An efficient range proof scheme." by K. Peng and F. Bao). """ from binascii import hexlify from math import ce...
lgpl-3.0
3,775,615,382,115,306,500
31.43662
115
0.558402
false
lamter/slaveo
loadhistory/futures.py
1
4133
# coding: utf-8 import pymongo import pandas as pd import datetime try: from .newbar import NewMinuteBar, NewDayBar except SystemError: pass class LoadBase(object): """ 导入期货历史数据 """ def __init__(self, path, symbol): """ :param path: 数据路径 :param contract: 合约名 ...
gpl-3.0
-6,288,002,198,736,356,000
23.324841
103
0.515318
false
PuercoPop/FaceRec
apps/WebUi/testhaar.py
1
1298
import cv import os from os.path import join from django.conf import settings def find_faces( img_url ): cascade = cv.Load( join(settings.ROOT_DIR,'apps/WebUi/haarcascade_frontalface_alt.xml') ) directory= join(settings.MEDIA_ROOT , 'Uploads/') target_directory = join( directory, 'Portraits/') portrait...
bsd-2-clause
2,583,801,675,626,725,000
30.658537
97
0.656394
false
noironetworks/heat
heat/tests/openstack/keystone/test_endpoint.py
1
15826
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
apache-2.0
-3,277,745,730,369,007,000
38.368159
78
0.593896
false
jessada/pyCMM
pycmm/cmmlib/intervarlib.py
1
2195
import re RAW_INTERVAR_CLASS_BENIGN = "Benign" RAW_INTERVAR_CLASS_LIKELY_BENIGN = "Likelybenign" RAW_INTERVAR_CLASS_UNCERTAIN_SIGNIFICANCE = "UncertainSignificance" RAW_INTERVAR_CLASS_LIKELY_PATHOGENIC = "Likelypathogenic" RAW_INTERVAR_CLASS_PATHOGENIC = "Pathogenic" INTERVAR_CLASS_BENIGN = "Benign" INTERVAR_CLASS_LI...
gpl-2.0
5,027,679,920,982,609,000
41.211538
101
0.676538
false
jamalmoir/ml_demo
libs/garden/xpopup/xbase.py
1
4736
""" XBase class ============ Subclass of :class:`xpopup.XPopup`. Base class for all popup extensions. Don't use this class directly. Examples -------- How to create your own class based on :class:`XBase`? It's easy! The content of the popup should be implemented in the :meth:`XBase._get_body`:: class MyPopup(X...
gpl-3.0
3,830,199,417,355,320,300
28.786164
79
0.641047
false
DolphinDream/sverchok
nodes/scene/objects_mk3.py
1
12461
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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 distrib...
gpl-3.0
-1,058,146,421,217,799,300
33.233516
143
0.595137
false
ohsu-qin/qidicom
test/unit/test_meta.py
1
2275
import os import glob import shutil from nose.tools import (assert_equal, assert_true) from qidicom import (reader, writer, meta) from .. import ROOT from ..helpers.logging import logger FIXTURE = os.path.join(ROOT, 'fixtures', 'dicom') """The test fixture.""" RESULTS = os.path.join(ROOT, 'results', 'dicom') """The t...
bsd-2-clause
-3,745,693,098,825,385,000
31.971014
79
0.568352
false