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
sunqm/pyscf
pyscf/eph/test/test_uhf.py
1
2089
#!/usr/bin/env python # Copyright 2014-2020 The PySCF Developers. 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 # # U...
apache-2.0
-3,297,742,572,155,970,000
36.981818
114
0.632839
false
noskill/virt-manager
virtManager/config.py
1
25087
# # Copyright (C) 2006, 2012-2014 Red Hat, Inc. # Copyright (C) 2006 Daniel P. Berrange <berrange@redhat.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, o...
gpl-2.0
-5,542,892,643,271,892,000
35.148415
79
0.604775
false
armsky/Algorithms
Data Structure/trie.py
1
1534
class TrieNode: # Initialize your data structure here. def __init__(self): self.children = {} self.is_word = False class Trie: def __init__(self): self.root = TrieNode() # @param {string} word # @return {void} # Inserts a word into the trie. def insert(self, word):...
apache-2.0
-8,049,908,019,752,421,000
25.448276
47
0.508475
false
onelogin/python3-saml
tests/src/OneLogin/saml2_tests/signed_response_test.py
1
2007
# -*- coding: utf-8 -*- # Copyright (c) 2010-2021 OneLogin, Inc. # MIT License import json from os.path import dirname, join, exists import unittest from onelogin.saml2.response import OneLogin_Saml2_Response from onelogin.saml2.settings import OneLogin_Saml2_Settings from onelogin.saml2.utils import OneLogin_Saml2_...
mit
-5,244,504,662,315,447,000
36.166667
97
0.658196
false
felixrieseberg/lets-encrypt-preview
letsencrypt/le_util.py
1
2392
"""Utilities for all Let's Encrypt.""" import collections import errno import os import stat from letsencrypt import errors Key = collections.namedtuple("Key", "file pem") # Note: form is the type of data, "pem" or "der" CSR = collections.namedtuple("CSR", "file data form") def make_or_verify_dir(directory, mode=0...
apache-2.0
6,374,653,857,685,918,000
27.47619
78
0.629599
false
salimfadhley/jenkinsapi
jenkinsapi/utils/manifest.py
3
3306
""" This module enables Manifest file parsing. Copied from https://chromium.googlesource.com/external/googleappengine/python/+/master /google/appengine/tools/jarfile.py """ import zipfile _MANIFEST_NAME = 'META-INF/MANIFEST.MF' class InvalidJarError(Exception): """ InvalidJar exception class """ pas...
mit
-2,833,017,234,510,234,000
33.082474
79
0.659407
false
rogerthat-platform/rogerthat-backend
src/rogerthat/templates/__init__.py
1
3596
# -*- coding: utf-8 -*- # Copyright 2017 GIG Technology NV # # 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,756,188,799,871,613,000
38.955556
113
0.666574
false
shub0/algorithm-data-structure
python/ugly_nums.py
1
1800
''' Write a program to check whether a given number is an ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 6, 8 are ugly while 14 is not ugly since it includes another prime factor 7. Note that 1 is typically treated as an ugly number. ''' class Solution(object): ...
bsd-3-clause
8,164,448,989,103,989,000
26.272727
165
0.436111
false
dabrahams/zeroinstall
zeroinstall/injector/config.py
1
4191
""" Holds user settings and various helper objects. """ # Copyright (C) 2011, Thomas Leonard # See the README file for details, or visit http://0install.net. from zeroinstall import _ import os from logging import info, warn import ConfigParser from zeroinstall import zerostore from zeroinstall.injector.model import...
lgpl-2.1
1,600,320,682,563,970,000
31.238462
117
0.715581
false
cjmathy/ode_model
ode_modeler/plot.py
1
3666
import os import numpy as np import matplotlib.pyplot as plt from matplotlib.backends.backend_pdf import PdfPages def plot_all_queries(species, queries, out_dir, out_format, plot_species, ttot, **kwargs): ''' Description: This method creates plots for each species, plotting timeco...
apache-2.0
3,636,057,399,998,828,000
30.333333
78
0.533824
false
josefson/CNPQ
lattes/search_data.py
1
3395
# search_data: The data to be used in a search POST. search_data = { 'metodo': 'buscar', 'acao': '', 'resumoFormacao': '', 'resumoAtividade': '', 'resumoAtuacao': '', 'resumoProducao': '', 'resumoPesquisador': '', 'resumoIdioma': '', 'resumoPresencaDGP': '', 'resumoModalidade': '...
mit
-2,093,086,758,916,944,100
35.117021
60
0.653608
false
Iwan-Zotow/runEGS
XcIO/names_helper.py
1
2104
# -*- coding: utf-8 -*- EGSPHAN_EXT = ".egsphant" EGSINP_EXT = ".egsinp" EGSPHSF_EXT = ".egsphsp1" def make_cup_prefix(radUnit, outerCup, innerCupSer, innerCupNum): """ Makes filename prefix given RU, OC, IC info Parameters ---------- radUnit: string radiation unit oute...
apache-2.0
574,515,979,374,324,900
21.147368
101
0.565589
false
mganeva/mantid
scripts/test/isis_powder/ISISPowderInstrumentSettingsTest.py
1
10800
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source # & Institut Laue - Langevin # SPDX - License - Identifier: GPL - 3.0 + from __future__ import (absolute_import, divi...
gpl-3.0
-2,600,867,022,597,814,000
49.232558
120
0.661019
false
openstack/manila
manila/db/migrations/alembic/versions/344c1ac4747f_add_share_instance_access_rules_status.py
1
4287
# 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 Li...
apache-2.0
2,971,264,081,608,974,300
31.477273
76
0.642641
false
michaelgichia/WeideShop
weideshop/products/views.py
1
3232
# -*- coding: utf-8 -*- # Third party stuff from django.shortcuts import render, get_object_or_404 from django.views.generic import ListView, DetailView from django.views.generic.base import TemplateView # Our stuff from .models import Product, Subcategory, Category class CategoryListView(ListView): """ Browse a...
bsd-2-clause
3,212,083,904,628,984,000
23.671756
108
0.716584
false
lcrees/knife
knife/_active.py
1
6481
# -*- coding: utf-8 -*- '''active knives''' from threading import local from collections import deque from contextlib import contextmanager from stuf.utils import clsname from knife._compat import loads, optimize class _ActiveMixin(local): '''active knife mixin''' def __init__(self, *things, **kw): ...
bsd-3-clause
-5,760,023,825,560,073,000
28.193694
72
0.569511
false
kain88-de/mdanalysis
testsuite/MDAnalysisTests/analysis/test_persistencelength.py
1
3982
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8 # # MDAnalysis --- http://www.mdanalysis.org # Copyright (c) 2006-2016 The MDAnalysis Development Team and contributors # (see the file AUTHORS for the full list of names) # ...
gpl-2.0
5,267,376,116,619,991,000
31.639344
79
0.630337
false
agingrasc/StrategyIA
ai/STA/Strategy/StrategyBook.py
1
1930
# Under MIT license, see LICENSE.txt """ Livre des stratégies. """ from .HumanControl import HumanControl from .SimpleDefense import SimpleDefense from .SimpleOffense import SimpleOffense from .DoNothing import DoNothing class StrategyBook(object): """ Cette classe est capable de récupérer les stratégies ...
mit
-4,660,321,697,038,851,000
33.321429
126
0.631634
false
s-macke/Kerasimo
models/snake.py
1
1336
from keras.models import Sequential, load_model from keras.layers import * from qlearning4k.games import Snake from keras.optimizers import * from qlearning4k import Agent from lib import kerasimo grid_size = 10 nb_frames = 4 nb_actions = 5 snake = Snake(grid_size) model = load_model('models/snake.hdf5') #model = Se...
mit
-1,961,486,161,902,618,600
28.688889
96
0.719311
false
tasleson/lsm-ci
testing/github_event_gen.py
1
2009
""" Used for testing the service locally """ import argparse import hashlib import hmac import os import requests import json GIT_SECRET = os.getenv("GIT_SECRET", "") PORT_NUM = os.getenv("PORT_NUM", "43301") IP_ADDRESS = os.getenv("IP_ADDRESS", "127.0.0.1") def gen_signature(data): """ Generate the signatu...
apache-2.0
-6,225,019,245,875,923,000
24.75641
80
0.599303
false
mfa/weight-app
weight/manage.py
1
1205
#!/usr/bin/env python """ Part of weight_app :copyright: (c) 2012 by Andreas Madsack. :license: BSD, see LICENSE for more details. """ from flask.ext.script import Manager from main import create_app, db from utils import new_pw, get_emailaddress # flask-Script manager = Manager(create_app) @manager.command...
bsd-3-clause
-5,661,920,201,830,214,000
23.591837
69
0.651452
false
jlgoldman/writetogov
database/db_models.py
1
4654
from geoalchemy2 import Geography from sqlalchemy.dialects import postgresql from database import db from util import fips from util import text SRID = 4326 # This table is auto-generated by shp2sql based on the TIGER shapefile # tl_2016_us_cd115.zip (https://www.census.gov/cgi-bin/geo/shapefiles/index.php?year=2016...
bsd-3-clause
6,247,504,885,244,312,000
37.783333
136
0.68049
false
zbraniecki/pyast
pyast/typedlist.py
1
4961
import sys import re # Temporary solution for string/unicode in py2 vs py3 if sys.version >= '3': basestring = str class TypedList(list): """Strongly typed list All elements of the list must be one of the given types. Attributes: init - initial values types - allowed types n...
bsd-3-clause
-4,534,332,588,961,025,000
33.93662
89
0.549083
false
chetan/cherokee
admin/PageNewConfig.py
1
5653
# -*- coding: utf-8 -*- # # Cherokee-admin # # Authors: # Alvaro Lopez Ortega <alvaro@alobbs.com> # Taher Shihadeh <taher@octality.com> # # Copyright (C) 2001-2010 Alvaro Lopez Ortega # # This program is free software; you can redistribute it and/or # modify it under the terms of version 2 of the GNU General ...
gpl-2.0
1,322,259,753,467,315,200
29.89071
150
0.587122
false
emedvedev/st2
st2actions/tests/unit/test_parallel_ssh.py
1
11187
# 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 use ...
apache-2.0
-4,133,305,447,443,318,000
43.569721
98
0.543309
false
CKehl/pylearn2
pylearn2/models/mlp.py
1
166462
""" Multilayer Perceptron """ __authors__ = "Ian Goodfellow" __copyright__ = "Copyright 2012-2013, Universite de Montreal" __credits__ = ["Ian Goodfellow", "David Warde-Farley"] __license__ = "3-clause BSD" __maintainer__ = "LISA Lab" import logging import math import operator import sys import warnings import numpy ...
bsd-3-clause
-8,657,553,449,295,059,000
33.730232
79
0.554054
false
mganeva/mantid
scripts/Muon/GUI/MuonAnalysis/load_widget/load_widget_model.py
1
1513
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source # & Institut Laue - Langevin # SPDX - License - Identifier: GPL - 3.0 + from __future__ import (absolute_import, divi...
gpl-3.0
1,026,091,008,242,188,000
32.622222
113
0.693985
false
maemre/rasim
sim.py
1
10863
#!/usr/bin/env python # Holy import! from __future__ import division from numpy import * from matplotlib import pyplot as P from agent import OptHighestSNR, RandomChannel, IndividualQ, FixChannel from channel.simple import SimpleChannel from traffic.simple import SimpleTraffic from environment import Environment impo...
apache-2.0
5,194,816,224,260,189,000
38.220217
137
0.58308
false
AyeJayTwo/DailyWunderlist
wunderlist.py
1
4315
import requests import json from datetime import date from datetime import datetime from datetime import timedelta #Application Details # with open('config.json') as json_file: # config_data = json.load(json_file) # client_id = config_data['client_id'] # redirect_uri = config_data['redirect_uri'] # client_secret = c...
mit
-7,650,789,133,617,430,000
31.208955
91
0.644496
false
alfa-jor/addon
plugin.video.alfa/channels/sxyprn.py
1
6787
# -*- coding: utf-8 -*- #------------------------------------------------------------ import urlparse,re from platformcode import config, logger from core import scrapertools from core.item import Item from core import servertools from core import httptools host = 'https://www.sxyprn.com' def mainlist(item): log...
gpl-3.0
4,249,873,821,578,241,500
55.082645
167
0.620395
false
cmin764/cloudbase-init
cloudbaseinit/metadata/services/osconfigdrive/windows.py
1
8485
# Copyright 2012 Cloudbase Solutions Srl # # 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
-5,127,092,252,806,962,000
37.568182
78
0.576429
false
Jinwithyoo/han
tests/lat.py
1
10678
# -*- coding: utf-8 -*- from tests import HangulizeTestCase from hangulize.langs.lat import Latin class LatinTestCase(HangulizeTestCase): lang = Latin() def test_people_roman(self): self.assert_examples({ 'Flavius Aëtius': '플라비우스 아에티우스', 'FLAVIVS AËTIVS': '플라비우스 아에티우스', ...
bsd-3-clause
8,601,629,544,688,862,000
39.020408
63
0.511346
false
WhatDo/FlowFairy
examples/sine_fix/gglu_nopool.py
1
3674
import tensorflow as tf import tensorflow.contrib.slim as slim from flowfairy.conf import settings from util import lrelu, conv2d, maxpool2d, embedding, avgpool2d, GLU, causal_GLU from functools import partial import ops discrete_class = settings.DISCRETE_CLASS batch_size = settings.BATCH_SIZE samplerate = sr = settin...
mit
6,973,295,967,363,852,000
31.803571
149
0.605335
false
fbradyirl/home-assistant
script/hassfest/ssdp.py
1
2564
"""Generate ssdp file.""" from collections import OrderedDict, defaultdict import json from typing import Dict from .model import Integration, Config BASE = """ \"\"\"Automatically generated by hassfest. To update, run python3 -m script.hassfest \"\"\" SSDP = {} """.strip() def sort_dict(value): """Sort a di...
apache-2.0
1,920,420,221,825,948,000
28.136364
87
0.578393
false
inguma/bokken
ui/graph.py
1
6901
# graph.py # # Copyright 2011 Hugo Teso <hugo.teso@gmail.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your...
gpl-2.0
5,638,959,716,393,014,000
37.769663
139
0.605564
false
maurodoglio/taarweb
taarweb/users/provider.py
1
1486
from allauth.socialaccount.app_settings import QUERY_EMAIL from allauth.socialaccount.providers.google.provider import (GoogleAccount, GoogleProvider, Scope) class TaarGoogleAccount(GoogleAccount)...
mpl-2.0
-2,247,812,986,946,630,000
34.380952
87
0.617766
false
dmanev/ArchExtractor
ArchExtractor/umlgen/Specific/STK/StkParser/StkJilFileCriteria/StkJilDataCriteria.py
1
2829
import re import PortInterface.ProvidedPort import PortInterface.RequiredPort import PortInterface.SenderReceiverInterface import Datatype.ArrayDataType import PortInterface.DataElement import StkParser.StkPortCriteria import Components.IComponent import Parser.IPortCriteria class StkJilDataCriteria(StkParser.StkPort...
gpl-3.0
6,982,030,154,229,971,000
47.775862
92
0.537292
false
andreweskeclarke/reinforcement_learning
src/agents.py
1
5084
import math import random class Agent: def __init__(self, actions, options={}): self.rgen = random.SystemRandom() # cryptographically secure, unlike random self.actions = actions self.last_action = None def __choose_exploitative_action__(self): raise Exception('Not implemented!...
mit
-68,055,493,988,964,190
35.84058
107
0.635917
false
escsun/radio-shop
catalog/views.py
1
1793
from django.shortcuts import render, get_object_or_404 from .models import Category, Product, Value from django.contrib import messages from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage from django.core.exceptions import ObjectDoesNotExist from cart.forms import CartAddProductForm def catalog_i...
gpl-3.0
3,052,322,435,605,630,000
34.36
81
0.664969
false
factorlibre/carrier-delivery
delivery_carrier_mrw/__openerp__.py
1
1595
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2015 FactorLibre (http://www.factorlibre.com) # Hugo Santos <hugo.santos@factorlibre.com> # # This program is free software: you can redistribute it and/o...
agpl-3.0
-2,021,363,104,424,025,300
35.25
78
0.576176
false
niacdoial/blemd
pseudobones.py
1
21031
from mathutils import Vector, Euler, Matrix import bpy import math import re from .common import dict_get_set from . import common from .Matrix44 import rotation_part # import weakref import logging log = logging.getLogger('bpy.ops.import_mesh.bmd.pseudobones') NtoB = Matrix([[1,0,0,0], [0,0...
gpl-3.0
5,015,250,740,609,675,000
39.481262
111
0.53735
false
CFIS-Octarine/octarine
validate/gui/views/errorhandling.py
1
5325
__author__ = "David Rusk <drusk@uvic.ca>" import wx class CertificateDialog(wx.Dialog): def __init__(self, parent, handler, error_message): super(CertificateDialog, self).__init__(parent, title="Certificate Error") self.handler = handler self.error_message = error_message self._...
gpl-3.0
-8,906,130,566,601,220,000
36.244755
95
0.604131
false
firebase/grpc-SwiftPM
src/python/grpcio_tests/tests_aio/unit/init_test.py
1
1698
# Copyright 2019 The gRPC 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 wri...
apache-2.0
-660,082,624,246,504,200
32.294118
102
0.717314
false
aggrent/cab
cab/migrations/0002_migrate_ratings.py
1
7081
# encoding: utf-8 from south.v2 import DataMigration from django.contrib.contenttypes.models import ContentType from django.db.models import signals from ratings.models import RatedItem, SimilarItem class Migration(DataMigration): def forwards(self, orm): signals.post_save.disconnect(sender=RatedItem, ...
bsd-3-clause
-4,519,894,992,598,839,300
63.963303
163
0.551758
false
integeruser/on-pwning
2017-csaw-quals/Zone/zone.py
1
3639
#!/usr/bin/env python2 # -*- coding: utf-8 -*- from pwn import * context(arch='amd64', os='linux', aslr=True, terminal=['tmux', 'neww']) if args['GDB']: elf, libc = ELF('./zone-amd64-2.23-0ubuntu9'), ELF('libs/amd64/2.23/0ubuntu9/libc-2.23.so') io = gdb.debug('./zone-amd64-2.23-0ubuntu9', gdbscript='''\ ...
mit
7,253,582,822,140,688,000
30.921053
108
0.663094
false
apbard/scipy
scipy/constants/tests/test_constants.py
2
3115
from __future__ import division, print_function, absolute_import from numpy.testing import assert_equal, assert_allclose from scipy._lib._numpy_compat import suppress_warnings import scipy.constants as sc def test_convert_temperature(): assert_equal(sc.convert_temperature(32, 'f', 'Celsius'), 0) assert_equal...
bsd-3-clause
973,531,989,903,674,900
38.43038
79
0.608026
false
longaccess/longaccess-client
lacli/upload.py
1
8840
from lacli.exceptions import PauseEvent from lacli.pool import MPUpload from lacli.source.chunked import ChunkedFile from lacore.storage.s3 import MPConnection from lacore.api import UploadState as BaseUploadState from contextlib import contextmanager from lacli.log import getLogger from lacli.progress import queueHand...
apache-2.0
7,196,664,246,178,638,000
33.131274
79
0.552262
false
MukunthanAlagarsamy/UCC_attempt1
app.py
1
1772
#!/usr/bin/env python import urllib import json import os from flask import Flask from flask import request from flask import make_response # Flask app should start in global layout app = Flask(__name__) @app.route('/webhook', methods=['POST']) def webhook(): req = request.get_json(silent=True, force=True) ...
apache-2.0
590,739,204,705,281,700
25.447761
116
0.597065
false
ProstoKSI/django-weed
djweed/db_fields.py
1
2767
from django.contrib.contenttypes.models import ContentType try: from django.core.urlresolvers import reverse except ImportError: # Django 2.0 from django.urls import reverse from django.db.models.fields.files import FieldFile, FileField from django.utils import six from .storage import WeedFSStorage class W...
mit
4,202,618,077,747,209,000
32.743902
92
0.641128
false
COCS4950G7/COSC4950
Resources/Tkinter Examples/Tkinter_example.py
1
1256
#import Tkinter #l = Tkinter.Label(text = "***************************See me?*************************") #l.pack() #l.mainloop() #print("Howdy") #omfg #print("dostuff") # http://www.ferg.org/thinking_in_tkinter/all_programs.html from Tkinter import * class MyApp: def __init__(self, parent): ...
gpl-3.0
5,148,761,549,873,680,000
19.95
88
0.57086
false
barthoekstra/Orographic-Landscape-Navigator
gisactions.py
1
1466
#!/usr/bin/python # This code is simply a wrapper for running gdal commands, without MATLAB # causing issues with dependencies, etc. import sys import os print(sys.argv[0]) action = sys.argv[1] targetfile = sys.argv[2] if action == "merge": print('Mergeing...') # gdalbuildvrt merged.vrt r14bn2.wgs84.tif r1...
gpl-3.0
-5,237,369,659,882,149,000
35.65
182
0.697817
false
MaxTyutyunnikov/lino
obsolete/src/lino/apps/pizzeria/services.py
1
2711
## Copyright 2003-2007 Luc Saffre ## This file is part of the Lino project. ## Lino 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-3.0
4,601,415,181,698,994,000
27.536842
80
0.694947
false
cwoebker/relo
relo/core/backend/redisdb.py
1
1633
#!/usr/bin/env python # encoding: utf-8 import sys import os import redis from relo.core.log import logger dirname = os.path.dirname(os.path.abspath(__file__)) up_dir = os.path.dirname(dirname) sys.path.append(up_dir) from relo.core.interfaces import Backend class REDISDB(Backend): name = "redis" expiretime...
bsd-3-clause
-2,834,990,471,099,505,700
32.346939
122
0.644213
false
KanoComputing/kano-video
kano_video/logic/player.py
1
4469
# player.py # # Copyright (C) 2014-2016 Kano Computing Ltd. # License: http://www.gnu.org/licenses/gpl-2.0.txt GNU GPL v2 # # Manages playing of videos import sys import os from kano.utils import is_installed, run_bg, get_volume, percent_to_millibel from kano.logging import logger from .youtube import get_video_file...
gpl-2.0
4,278,216,597,469,036,500
28.596026
96
0.590065
false
amenonsen/ansible
lib/ansible/modules/network/fortios/fortios_firewall_DoS_policy6.py
1
16272
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # 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 Lic...
gpl-3.0
4,463,918,872,802,416,600
33.621277
157
0.505101
false
ssmruthi/mycroft-core
mycroft/skills/stop/__init__.py
1
1465
# Copyright 2016 Mycroft AI, Inc. # # This file is part of Mycroft Core. # # Mycroft Core is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later versio...
gpl-3.0
6,920,087,115,239,575,000
29.520833
75
0.724232
false
fbcom/project-euler
072_counting_fractions.py
1
1188
#!/usr/bin/env python # -*- coding: utf-8 -*- # # A Solution to "Counting fractions" – Project Euler Problem No. 72 # by Florian Buetow # # Sourcecode: https://github.com/fbcom/project-euler # Problem statement: https://projecteuler.net/problem=72 def get_distinct_prime_factors(n): ret = [] if n > 1: ...
mit
-8,231,899,438,116,633,000
23.708333
81
0.572513
false
aolindahl/epicea
straighten_lines.py
1
4479
# -*- coding: utf-8 -*- """ Created on Wed Jul 29 15:34:36 2015 @author: antlin """ import numpy as np import matplotlib.pyplot as plt import lmfit import epicea import electron_calibration_data import plt_func line_model = epicea.electron_calibration_helper.n_line_fit_model line = 'voigt' data_list = electron_cal...
gpl-2.0
8,085,153,324,896,847,000
35.120968
78
0.553472
false
siberianisaev/NeutronBarrel
Neutrons preprocessing/neutron_preprocessing.py
1
5365
import pandas as pd import numpy as np class ExpProcessing: """ class for preprocessed neutrons experiment data """ def __init__(self, counts_measured): """ Input : counts_measured - list (or any numpy convertible type) Method creates a data frame with experimental...
mit
-5,235,752,218,111,256,000
38.954198
97
0.555266
false
Rafael-Cheng/MovieReviewCrawlers
broad crawler/MovieReview/MovieReview/spiders/MovieReviewSpider.py
1
4028
# -*- encoding:utf-8 -*- import sys import scrapy from MovieReview.items import MoviereviewItem from scrapy_redis.spiders import RedisSpider from scrapy.http import Request, HtmlResponse from scrapy.linkextractors import LinkExtractor from scrapy.selector import Selector from bs4 import BeautifulSoup from obtain_date i...
gpl-3.0
8,782,475,459,918,302,000
35.563636
91
0.55644
false
AdrianNunez/Fall-Detection-with-CNNs-and-Optical-Flow
temporalnet_combined.py
1
25869
from __future__ import print_function from numpy.random import seed seed(1) import numpy as np import matplotlib matplotlib.use('Agg') from matplotlib import pyplot as plt import os import h5py import scipy.io as sio import cv2 import glob import gc from keras.models import load_model, Model, Sequential from keras.lay...
mit
-6,793,754,311,319,093,000
37.325926
115
0.552205
false
ActiveState/code
recipes/Python/436834_Yet_another_Design_Contract_module/recipe-436834.py
1
16029
#!/usr/bin/env python # -*- coding: iso-8859-1 -*- ############################################################################### # # Yet another invariant/pre-/postcondition design-by-contract support module. # # Written by Dmitry Dvoinikov <dmitry@targeted.org> # Distributed under MIT license. # # The latest version...
mit
-315,259,735,851,058,900
43.401662
118
0.558924
false
meteorfox/PerfKitBenchmarker
perfkitbenchmarker/providers/kubernetes/provider_info.py
1
1386
# Copyright 2015 PerfKitBenchmarker 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 appli...
apache-2.0
4,174,904,977,737,770,500
33.65
74
0.7114
false
RobLoach/lutris
lutris/util/display.py
1
3005
import subprocess from lutris.util.log import logger def get_vidmodes(): xrandr_output = subprocess.Popen(["xrandr"], stdout=subprocess.PIPE).communicate()[0] return list([line for line in xrandr_output.decode().split("\n")]) def get_outputs(): """Return list of tup...
gpl-3.0
8,808,335,972,586,504,000
29.663265
77
0.575707
false
ctsit/redi-dropper-client
app/redidropper/database/crud_mixin.py
1
1438
""" Goal: simplify the code when interacting with entities Usage when declaring a model: import db class MyEntity(db.Model, CRUDMixin): id = db.Column('myID', db.Integer, primary_key=True) data = db.Column('myData', db.String(255)) MyTableEntity.create(data="abc") my = MyTableEntity(data="abc") db.session.s...
bsd-3-clause
-703,312,452,427,858,200
25.145455
59
0.616134
false
gogoair/foremast
src/foremast/utils/__init__.py
1
1409
# Foremast - Pipeline Tooling # # Copyright 2018 Gogo, 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
apache-2.0
-4,017,467,727,844,260,000
33.365854
76
0.751597
false
mesosphere/mesos-hydra
mrun.py
1
8006
#!/usr/bin/env python import mesos import mesos_pb2 import os import logging import re import sys import time import math import threading import socket import time import tempfile from optparse import OptionParser from subprocess import * def printOutput(p): for line in p.stdout: print line, def startMPIE...
apache-2.0
2,096,012,464,750,074,400
30.031008
149
0.624032
false
walshjon/openmc
openmc/material.py
1
35739
from collections import OrderedDict from copy import deepcopy from numbers import Real, Integral import warnings from xml.etree import ElementTree as ET import numpy as np import openmc import openmc.data import openmc.checkvalue as cv from openmc.clean_xml import clean_xml_indentation from .mixin import IDManagerMix...
mit
-6,152,514,071,550,136,000
33.867317
83
0.574303
false
Inspq/ansible
lib/ansible/plugins/connection/netconf.py
1
4517
# # (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is d...
gpl-3.0
-3,208,970,745,957,846,000
31.496403
100
0.640469
false
nathanaevitas/odoo
openerp/release.py
1
2634
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
-2,245,725,345,032,258,300
44.413793
117
0.643888
false
waynechu/PythonProject
dns/rdtypes/ANY/AVC.py
2
1027
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license # Copyright (C) 2016 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission ...
mit
-1,819,311,365,849,486,800
40.08
89
0.773126
false
kovidgoyal/kitty
kittens/tui/operations.py
1
11292
#!/usr/bin/env python3 # vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2018, Kovid Goyal <kovid at kovidgoyal.net> import sys from contextlib import contextmanager from functools import wraps from typing import ( IO, Any, Callable, Dict, Generator, Optional, Tuple, TypeVar, Union ) from kitty.rgb import Col...
gpl-3.0
-8,834,894,098,076,934,000
26.144231
133
0.590418
false
DYWCn/mxonline
MXOnline/apps/origanization/migrations/0001_initial.py
1
3648
# -*- coding: utf-8 -*- # Generated by Django 1.9.8 on 2017-03-24 08:13 from __future__ import unicode_literals import datetime from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ ...
mit
-4,469,214,834,793,879,000
52.647059
159
0.587171
false
rwatson/chromium-capsicum
o3d/tests/selenium/main.py
1
24571
#!/usr/bin/python2.4 # Copyright 2009, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of...
bsd-3-clause
-7,822,211,958,449,909,000
31.805073
83
0.651174
false
manassolanki/erpnext
erpnext/hr/doctype/payroll_entry/test_payroll_entry.py
1
7091
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import unittest import erpnext import frappe from dateutil.relativedelta import relativedelta from erpnext.accounts.utils import get_fiscal_year, getdate...
gpl-3.0
-6,668,528,203,621,711,000
36.125654
111
0.687491
false
priyaganti/rockstor-core
src/rockstor/storageadmin/urls/share.py
1
2128
""" Copyright (c) 2012-2013 RockStor, Inc. <http://rockstor.com> This file is part of RockStor. RockStor 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 la...
gpl-3.0
-8,414,302,478,397,085,000
39.150943
79
0.659774
false
globocom/database-as-a-service
dbaas/maintenance/migrations/0015_auto__add_maintenanceparameters.py
1
5853
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'MaintenanceParameters' db.create_table(u'maintenance_main...
bsd-3-clause
-3,582,005,703,774,428,700
68.678571
191
0.572185
false
ErinMorelli/em-media-handler
setup.py
1
2691
#!/usr/bin/env python # -*- coding: utf-8 -*- # EM MEDIA HANDLER # Copyright (c) 2014-2021 Erin Morelli # # 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 # wit...
mit
-3,059,469,731,831,596,000
26.181818
71
0.614641
false
PermutaTriangle/Permuta
permuta/perm_sets/permset.py
1
7411
import multiprocessing from itertools import islice from typing import ClassVar, Dict, Iterable, List, NamedTuple, Optional, Union from ..patterns import MeshPatt, Perm from ..permutils import is_finite, is_insertion_encodable, is_polynomial from .basis import Basis, MeshBasis class AvBase(NamedTuple): """A base...
bsd-3-clause
2,888,055,935,576,423,400
36.619289
84
0.575361
false
redhat-openstack/oslo.messaging
tests/test_opts.py
1
1718
# Copyright 2014 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
apache-2.0
-1,196,736,249,446,566,700
30.814815
78
0.652503
false
jensck/fluidity
fluidity/incubator/next_actions_view.py
1
4059
import gtk import pango class NextActionsView(gtk.VBox): """Simple class for display of Next Actions""" def __init__(self): super(NextActionsView, self).__init__() self._liststore = gtk.ListStore(bool, str, int, str) self._treeview = gtk.TreeView() self._treeview.g...
gpl-3.0
-4,824,018,486,579,330,000
40.845361
81
0.647204
false
joyhuang-web/flaskbb
flaskbb/configs/default.py
1
2497
# -*- coding: utf-8 -*- """ flaskbb.configs.default ~~~~~~~~~~~~~~~~~~~~~~~ This is the default configuration for FlaskBB that every site should have. You can override these configuration variables in another class. :copyright: (c) 2014 by the FlaskBB Team. :license: BSD, see LICENSE for more ...
bsd-3-clause
-3,027,264,106,101,590,500
26.43956
79
0.617942
false
goldengod/dep
plib.py
1
20556
#some import import numpy import itertools import random import math import os.path import urllib2 import sys #global variables n = None N = None Dk = None Du = None Dc = None e = None r = None x = None xa = None ASW = None EXC = None INS = None pASW = None pEXC = None pINS = None #help func...
gpl-2.0
-3,328,842,759,987,136,500
22.886199
158
0.570393
false
RobinQuetin/CAIRIS-web
cairis/cairis/WeaknessAnalysisPanel.py
1
1665
# 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...
apache-2.0
-8,500,019,050,988,761,000
38.642857
80
0.76036
false
datamade/django-councilmatic
tests/conftest.py
1
4072
import pytest from pytest_django.fixtures import db from uuid import uuid4 from django.core.management import call_command from django.db import connection from councilmatic_core.models import Bill, BillDocument, Event, EventDocument @pytest.fixture @pytest.mark.django_db def organizations(db): call_command('loa...
mit
-3,183,727,234,289,889,300
32.377049
643
0.649558
false
gizwits/gservice_sdk_py
gservice/api/client.py
1
1504
#coding:utf-8 ''' moduls::APIClient ~~~~~~~~~~~~~~~~~ request handler ''' import requests import json from ..calls.g_login import login as login_call class APIClient(object): def __init__(self): self.session = requests.Session() self.token = None self.uid = None self.expire_at =...
mit
4,340,423,305,111,544,300
26.345455
68
0.577128
false
hugoShaka/photo-mailer
mailerv2.py
1
5032
# -*- coding: utf-8 -*- import getpass import sys, os import smtplib from email.mime.multipart import MIMEMultipart from email.mime.image import MIMEImage from email.mime.text import MIMEText from email.mime.application import MIMEApplication from iptcinfo import IPTCInfo import logging logging.basicConfig(filenam...
apache-2.0
-2,709,665,014,651,973,000
30.248447
152
0.667661
false
akretion/connector-magento
magentoerpconnect_catalog/product.py
1
15502
# -*- coding: utf-8 -*- ############################################################################## # # Copyright 2013 # Author: Guewen Baconnier - Camptocamp SA # Augustin Cisterne-Kaasv - Elico-corp # David Béal - Akretion # Chafique Delli - Akretion # This program is free...
agpl-3.0
-2,681,854,512,350,137,300
39.685039
105
0.562802
false
CWBudde/Ink2SmartCanvas
Ink2SmartCanvas/svg/Text.py
1
1318
from ink2canvas.svg.AbstractShape import AbstractShape class Text(AbstractShape): def textHelper(self, tspan): val = "" if tspan.text: val += tspan.text for ts in tspan: val += self.textHelper(ts) if tspan.tail: val += tspan.tail return va...
gpl-2.0
-2,483,348,612,490,102,300
29.651163
78
0.552352
false
PisiLinux-PyQt5Port/package-manager
src/statemanager.py
1
10398
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2009-2010, TUBITAK/UEKAE # # 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 ...
gpl-2.0
1,623,643,069,164,010,200
40.592
160
0.6181
false
rrah/PyLiteCo
__main__.py
1
1670
"""Main launcher for pyliteco. Author: Robert Walker <rrah99@gmail.com> Copyright (C) 2015 Robert Walker 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; version 2. This program is ...
gpl-2.0
-2,271,374,031,831,028,500
35.326087
100
0.711976
false
KayJohnston/jackies-map
edi.py
1
4447
#!/usr/bin/env python from __future__ import print_function import sys import shlex import logging import time import cmd import argparse import traceback if __name__ == '__main__': print("Loading environment...") import env log = logging.getLogger("edi") # Now env is loaded, import the apps import ship import ed...
bsd-3-clause
-2,765,339,657,584,099,000
22.908602
161
0.641106
false
cokelaer/spectrum
test/test_correlog.py
1
1904
from spectrum import CORRELOGRAMPSD, CORRELATION, pcorrelogram, marple_data from spectrum import data_two_freqs from pylab import log10, plot, savefig, linspace from numpy.testing import assert_array_almost_equal, assert_almost_equal def test_correlog(): psd = CORRELOGRAMPSD(marple_data, marple_data, lag=15) ...
bsd-3-clause
-7,416,000,210,789,189,000
33.618182
93
0.697479
false
pklaus/PyOscilloskop
gui/rigolUi.py
1
3717
#!/usr/bin/python # -*- encoding: UTF8 -*- # pyOscilloskop # # Copyright (19.2.2011) Sascha Brinkmann # # 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...
gpl-3.0
-7,523,303,664,822,341,000
36.545455
120
0.658596
false
yvesalexandre/bandicoot
bandicoot/tests/test_parsers.py
1
5328
# The MIT License (MIT) # # Copyright (c) 2015-2016 Massachusetts Institute of Technology. # # 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 ...
mit
3,988,811,326,115,238,400
39.06015
80
0.579955
false
flavour/ifrc_qa
modules/s3db/supply.py
1
104079
# -*- coding: utf-8 -*- """ Sahana Eden Supply Model @copyright: 2009-2016 (c) Sahana Software Foundation @license: MIT 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 withou...
mit
6,612,580,975,636,968,000
38.39402
161
0.433469
false
alanjds/pyukpostcode
runtests.py
1
2422
#! /usr/bin/env python from __future__ import print_function import pytest import sys import os import subprocess PYTEST_ARGS = { 'default': ['tests', '--cov=ukpostcode'], 'fast': ['tests', '-q', '--cov=ukpostcode'], } FLAKE8_ARGS = ['ukpostcode', 'tests', '--ignore=E501', '--ignore=E262', '--max-line-lengt...
apache-2.0
-7,299,852,809,777,010,000
25.615385
96
0.592073
false
trenton3983/Artificial_Intelligence_for_Humans
vol3/vol3-python-examples/examples/example_mnist_conv.py
1
2549
#!/usr/bin/env python """ Artificial Intelligence for Humans Volume 3: Deep Learning and Neural Networks Python Version http://www.aifh.org http://www.jeffheaton.com Code repository: https://github.com/jeffheaton/aifh Copyright 2015 by Jeff Heaton Licensed under the Apache License, V...
apache-2.0
-293,695,254,517,834,240
28.988235
76
0.708513
false
demisto/content
Packs/Cylance_Protect/Integrations/Cylance_Protect_v2/Cylance_Protect_v2.py
1
50344
from CommonServerPython import * import jwt import uuid import requests import json import re import zipfile from StringIO import StringIO from datetime import datetime, timedelta # disable insecure warnings requests.packages.urllib3.disable_warnings() # CONSTANTS TOKEN_TIMEOUT = 300 # 5 minutes URI_AUTH = 'auth/v2/...
mit
6,929,150,291,079,900,000
33.364505
120
0.598184
false
chris4795/u-boot-novena
test/py/u_boot_console_base.py
2
16718
# Copyright (c) 2015 Stephen Warren # Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved. # # SPDX-License-Identifier: GPL-2.0 # Common logic to interact with U-Boot via the console. This class provides # the interface that tests use to execute U-Boot shell commands and wait for # their results. Sub-clas...
gpl-2.0
-670,844,553,990,822,100
35.662281
85
0.586374
false