repo_name
stringlengths
6
61
path
stringlengths
4
230
copies
stringlengths
1
3
size
stringlengths
4
6
text
stringlengths
1.01k
850k
license
stringclasses
15 values
hash
int64
-9,220,477,234,079,998,000
9,219,060,020B
line_mean
float64
11.6
96.6
line_max
int64
32
939
alpha_frac
float64
0.26
0.9
autogenerated
bool
1 class
ratio
float64
1.62
6.1
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
zonk1024/moto
moto/iam/models.py
3
15061
from __future__ import unicode_literals from moto.core import BaseBackend from .exceptions import IAMNotFoundException, IAMConflictException, IAMReportNotPresentException from .utils import random_access_key, random_alphanumeric, random_resource_id from datetime import datetime import base64 class Role(object): ...
apache-2.0
1,491,481,025,047,319,300
34.107226
300
0.614036
false
3.735367
false
false
false
ulikoehler/Translatron
download-assets.py
1
3048
#!/usr/bin/env python3 """ Downloads assets to the static directory. This is used to allow easier updating without having to clog the git repository with frequently updated minified JS/CSS """ import urllib.request import os import sys from ansicolor import black, red from collections import namedtuple Asset = namedtu...
apache-2.0
5,452,720,826,959,025,000
49.816667
146
0.712598
false
3.424719
false
false
false
vmr2117/nnet
src/neural_network/perf_graph.py
1
1173
import argparse from database import DatabaseAccessor from data_structures import Perf from pylab import * def graph(db_file, filename, ttl): db = DatabaseAccessor(Perf, db_file) perf_data = db.read() save_fig(perf_data, filename, ttl) def save_fig(perf_data, filename, ttl): iters = range(len(perf_d...
gpl-2.0
-2,220,344,147,401,889,300
33.5
80
0.649616
false
3.631579
false
false
false
vk-brain/sketal
plugins/miscellaneous/misc_show_time.py
2
1267
from handler.base_plugin import CommandPlugin import datetime class TimePlugin(CommandPlugin): __slots__ = ("delta", "message", "days") def __init__(self, *commands, prefixes=None, strict=False, offseth=3, offsetm=0, message=None): """Answers with current date and time.""" if not commands: ...
mit
4,185,489,166,678,610,000
36.966667
99
0.605795
false
2.77129
false
false
false
leapp-to/prototype
leapp/utils/output.py
1
6732
from __future__ import print_function import hashlib import json import os import sys from contextlib import contextmanager from leapp.exceptions import LeappRuntimeError from leapp.models import ErrorModel from leapp.utils.audit import get_audit_entry def _is_verbose(): """Redefinition of is_verbose from leapp...
lgpl-2.1
1,843,277,105,756,116,700
39.8
108
0.624183
false
3.84466
false
false
false
hedgehogarray/shared_playlist
pygrooveshark/build/lib.linux-i686-2.7/grooveshark/classes/song.py
4
8810
# -*- coding:utf-8 -*- # # Copyright (C) 2012, Maximilian Köhl <linuxmaxi@googlemail.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 3 of the License, or # (at your option)...
mit
-6,117,511,673,177,319,000
37.977876
176
0.537405
false
4.453488
false
false
false
NewBeeStudio/xichao-new
xichao/packages/route/special.py
1
17428
# -*- coding: utf-8 -*- from imports import * ################################## 专栏页面 ################################## # 专栏列表页 @app.route('/special_all', methods=['GET']) def special_all(): try: view = request.args.get('view') sort = request.args.get('sort') page_id = int(request.args.g...
apache-2.0
-2,346,905,578,882,769,400
39.595238
246
0.548446
false
3.837497
false
false
false
Roger/defuse
examples/evalfs.py
1
2562
import sys import traceback from stat import S_IRUSR, S_IXUSR, S_IWUSR, S_IRGRP, S_IXGRP, S_IXOTH, S_IROTH from errno import ENOENT import fuse from fs import FS, BaseMetadata fs = FS.get() class Out(object): def __init__(self): self.out = '' def write(self, data): self.out += data de...
bsd-3-clause
-7,717,536,393,655,769,000
25.142857
78
0.567916
false
3.353403
false
false
false
matus-stehlik/glowing-batman
competitions/models.py
1
5313
from django.contrib.auth.models import Group from django.core.exceptions import ValidationError from django.db import models from django.utils.timezone import now from base.util import with_timestamp, with_author, remove_accents # Competition-related models @with_author @with_timestamp class Competition(models.Model...
mit
4,559,148,231,431,446,000
30.625
80
0.632788
false
4.344235
false
false
false
Thierry46/CalcAl
model/TotalLine.py
1
6973
# -*- coding: utf-8 -*- """ ************************************************************************************ Class : TotalLine Author : Thierry Maillard (TMD) Date : 28/10/2016 - 18/11/2016 Role : Define a TotalLine for food table. Licence : GPLv3 Copyright (c) 2016 - Thierry Maillard This file is part of CalcA...
gpl-3.0
-885,870,072,206,995,200
47.423611
100
0.588986
false
4.624005
true
false
false
relic7/prodimages
python/magicColorspaceModAspctLoadFaster.py
1
21256
#!/usr/bin/env python # -*- coding: utf-8 -*- import os, sys, re, csv def copy_to_imagedrop_upload(src_filepath, destdir=None): import pycurl, os, shutil, re regex_colorstyle = re.compile(r'^.*?/[0-9]{9}[_altm0-6]{,6}?\.[jpngJPNG]{3}$') if not regex_colorstyle.findall(src_filepath): print src_file...
mit
-7,046,910,155,890,371,000
32.057543
207
0.514443
false
3.549173
true
false
false
LordHighfixxer/lrdhifxr-cogs
saltcon2/saltcon2.py
1
7427
import os import discord from discord.ext import commands from .utils.dataIO import dataIO class STREAMCON: """Server STREAMCON Levels""" def __init__(self, bot): self.bot = bot self.settings_path = "data/STREAMCON/settings.json" self.settings = dataIO.load_json(self.set...
gpl-3.0
-8,147,972,054,725,798,000
42.208333
96
0.578699
false
3.96318
false
false
false
debugger06/MiroX
lib/frontends/cli/application.py
3
3485
# 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
3,708,730,158,224,506,000
40
78
0.725681
false
3.743287
false
false
false
luisjuansp/NaoWatsonTutor
watson_tutor.py
1
1771
from watson_speech2text import Watson_Speech2Text from watson_conversation import Watson_Conversation from naoproxy import NaoProxy class Tutor(): def __init__(self): # broker = ALBroker("myBroker", "0.0.0.0", 0, IP, 9559) IP = "192.168.0.100" global nao nao = NaoProxy(IP, "nao") ...
gpl-3.0
-4,397,682,161,948,073,500
30.642857
131
0.597403
false
3.1625
false
false
false
albireox/marvin
python/marvin/tools/query.py
1
52484
#!/usr/bin/env python # encoding: utf-8 # Licensed under a 3-clause BSD license. # Revision History: # Initial Version: 2016-02-17 14:13:28 by Brett Andrews # 2016-02-23 - Modified to test a programmatic query using a test sample form - B. Cherinka # 2016-03-02 - Generalized to many parameters and many fo...
bsd-3-clause
-8,159,977,522,495,439,000
38.402402
184
0.582997
false
4.218971
false
false
false
jose-caballero/cvmfsreplica
cvmfsreplica/plugins/repository/acceptance/Diskspace.py
1
3196
#!/usr/bin/env python import logging import os from cvmfsreplica.cvmfsreplicaex import PluginConfigurationFailure, AcceptancePluginFailed from cvmfsreplica.interfaces import RepositoryPluginAcceptanceInterface from cvmfsreplica.utils import check_disk_space import cvmfsreplica.pluginsmanagement as pm class Diskspac...
gpl-3.0
-788,731,355,503,030,800
34.910112
130
0.576033
false
4.46993
false
false
false
DirectXMan12/should_be
should_be/extensions/set.py
1
1342
from should_be.core import BaseMixin, ObjectMixin try: from collections.abc import Set except ImportError: # python < 3.3 from collections import Set class SetMixin(BaseMixin): target_class = Set def should_be(self, target): msg_smaller = ('{txt} should have been {val}, but did not have '...
isc
2,964,873,579,717,726,000
34.315789
79
0.464978
false
4.017964
false
false
false
grapesmoker/regulations-parser
regparser/notice/diff.py
3
26343
# vim: set encoding=utf-8 from itertools import takewhile import re from copy import copy from lxml import etree from regparser.grammar import amdpar, tokens from regparser.tree.struct import Node from regparser.tree.xml_parser.reg_text import build_from_section from regparser.tree.xml_parser.tree_utils import get_no...
cc0-1.0
1,316,664,245,820,526,000
37.28343
79
0.605642
false
3.93707
false
false
false
oso/pymcda
apps/display-confusion-table.py
1
6419
#!/usr/bin/env python import os, sys sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)) + "/../") import bz2 from xml.etree import ElementTree from pymcda.electre_tri import MRSort from pymcda.uta import AVFSort from pymcda.types import PerformanceTable from pymcda.types import AlternativesAssignments from...
gpl-3.0
691,970,308,955,988,100
36.538012
122
0.606481
false
2.947199
true
false
false
google-research/robel
robel/dkitty/utils/manual_reset.py
1
3903
# Copyright 2019 The ROBEL 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 wr...
apache-2.0
7,082,934,502,937,618,000
37.643564
79
0.643351
false
4.082636
false
false
false
Heufneutje/PyMoronBot
Commands/Sub.py
1
7071
# -*- coding: utf-8 -*- """ Created on Feb 28, 2015 @author: Tyranic-Moron """ import re from IRCMessage import IRCMessage from IRCResponse import IRCResponse, ResponseType from CommandInterface import CommandInterface from twisted.words.protocols.irc import assembleFormattedText, attributes as A class UnbalancedB...
mit
-4,750,790,059,631,187,000
39.872832
117
0.583652
false
4.441583
false
false
false
genialis/resolwe-bio-py
tests/unit/test_users.py
1
1420
""" Unit tests for resdk/resources/user.py file. """ import unittest from mock import MagicMock from resdk.resources.user import Group, User class TestGroup(unittest.TestCase): def setUp(self): self.resolwe = MagicMock() self.user = User(resolwe=self.resolwe, id=42) self.group = Group(...
apache-2.0
5,720,585,394,346,826,000
26.843137
86
0.630986
false
3.364929
true
false
false
palaniyappanBala/androguard
androguard/core/analysis/analysis.py
10
70640
# This file is part of Androguard. # # Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr> # 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...
apache-2.0
-7,692,190,307,748,464,000
33.142098
169
0.524759
false
3.785638
false
false
false
sbird/fake_spectra
fake_spectra/ratenetworkspectra.py
1
6626
"""Modified versions of gas properties and spectra that use the rate network.""" import numpy as np from ._spectra_priv import _interpolate_2d from . import gas_properties from . import spectra from .rate_network import RateNetwork class RateNetworkGas(gas_properties.GasProperties): """Replace the get_reproc_HI f...
mit
-4,436,049,052,491,339,000
49.969231
187
0.623453
false
3.270484
false
false
false
drewandersonnz/openshift-tools
ansible/roles/lib_git/library/git_checkout.py
12
13883
#!/usr/bin/env python # ___ ___ _ _ ___ ___ _ _____ ___ ___ # / __| __| \| | __| _ \ /_\_ _| __| \ # | (_ | _|| .` | _|| / / _ \| | | _|| |) | # \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____ # | \ / _ \ | \| |/ _ \_ _| | __| \_ _|_ _| # | |) | (_) | | .` | (_) || | | _|| |) | | ...
apache-2.0
8,853,674,202,672,386,000
30.058166
120
0.526759
false
4.072455
false
false
false
DeStars/omniture_python
omniture_python/report_definition.py
1
2519
from datetime import datetime __author__ = 'DeStars' class ReportBuilder: def __init__(self): self.data = {} @classmethod def _elements(cls): return ("_suite_id", "_start_date", "_end_date", "_date_granularity", "_metrics_id", "_elements") @staticmethod def _conv...
mit
6,300,023,046,565,561,000
29.719512
83
0.543867
false
3.765321
false
false
false
Karunesh/google_python_exercises
copyspecial/copyspecial.py
1
1730
#!/usr/bin/python # 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/ import sys import re import os import shutil import commands """Copy Special exercise """ d...
apache-2.0
-6,789,120,600,701,348,000
23.027778
67
0.645665
false
3.295238
false
false
false
deepcharles/ruptures
src/ruptures/costs/costml.py
1
1843
r"""Change detection with a Mahalanobis-type metric""" import numpy as np from numpy.linalg import inv from ruptures.base import BaseCost from ruptures.exceptions import NotEnoughPoints class CostMl(BaseCost): r"""Mahalanobis-type cost function.""" model = "mahalanobis" def __init__(self, metric=None)...
bsd-2-clause
-1,146,421,115,365,335,800
27.353846
176
0.582203
false
3.768916
false
false
false
Wireless-Innovation-Forum/Spectrum-Access-System
src/harness/reference_models/propagation/wf_itm.py
1
9864
# Copyright 2017 SAS Project 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 requ...
apache-2.0
3,250,323,010,851,435,000
37.834646
95
0.643654
false
3.486744
false
false
false
emdodds/DictLearner
scripts/tsn_script.py
1
2336
# -*- coding: utf-8 -*- """ Created on Thu Jul 28 12:11:07 2016 @author: Eric """ import argparse import pickle import TopoSparsenet import numpy as np import scipy.io as io parser = argparse.ArgumentParser(description="Learn dictionaries for Topographic Sparsenet with given parameters.") parser.add_ar...
mit
878,909,952,578,454,500
30.444444
115
0.623716
false
3.131367
false
false
false
DormyMo/SpiderKeeper
SpiderKeeper/app/spider/controller.py
1
23859
import datetime import os import tempfile import flask_restful import requests from flask import Blueprint, request from flask import abort from flask import flash from flask import redirect from flask import render_template from flask import session from flask_restful_swagger import swagger from werkzeug.utils import...
mit
-8,691,276,491,781,630,000
34.824324
153
0.568171
false
3.770982
false
false
false
FCDM/py-dml
dml/maths/geometry.py
1
3226
import math class Vector2D(object): """ A vector in 2-dimensional space. """ def __init__(self, x, y=None): if y is None: x, y = x self.x = x self.y = y @classmethod def fromAngle(cls, angle, radians=True): """Return the unit vector in the given direction.""" if not radians: angle = math.radian...
mit
1,201,121,418,191,547,100
22.215827
71
0.652511
false
2.882931
false
false
false
danny200309/anaconda
anaconda_lib/linting/anaconda_mccabe.py
9
1577
# -*- coding: utf8 -*- # Copyright (C) 2013 - Oscar Campos <oscar.campos@member.fsf.org> # This program is Free Software see LICENSE file for details """ Anaconda McCabe """ import ast from .mccabe import McCabeChecker class AnacondaMcCabe(object): """Wrapper object around McCabe python script """ ch...
gpl-3.0
8,689,864,748,901,092,000
24.852459
75
0.574509
false
4.022959
false
false
false
googleapis/python-recommendations-ai
google/cloud/recommendationengine_v1beta1/services/prediction_api_key_registry/client.py
1
28310
# -*- coding: utf-8 -*- # Copyright 2020 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
4,932,179,393,963,767,000
42.486943
201
0.63165
false
4.619778
false
false
false
MediaKraken/MediaKraken_Deployment
source/common/common_internationalization.py
1
1325
""" Copyright (C) 2017 Quinn D Granfor <spootdev@gmail.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but ...
gpl-3.0
-7,388,436,541,744,186,000
32.974359
69
0.743396
false
3.955224
false
false
false
AbhiAgarwal/prep
python/avl_rotation.py
1
12791
class AVLNode(object): def __init__(self, key): self.key=key self.right_child=None self.left_child=None self.parent=None self.height=0 self.balance=0 def update_height(self, upwards=True): #If upwards we go up the tree correcting heights and balances, ...
mit
4,788,308,656,106,740,000
32.574803
80
0.506215
false
4.273638
false
false
false
knowsis/django
django/utils/timezone.py
90
9180
""" Timezone-related classes and functions. This module uses pytz when it's available and fallbacks when it isn't. """ from datetime import datetime, timedelta, tzinfo from threading import local import sys import time as _time try: import pytz except ImportError: pytz = None from django.conf import setting...
bsd-3-clause
-2,760,937,381,903,464,000
27.958991
81
0.644444
false
4.05477
false
false
false
Distrotech/bzr
tools/win32/build_release.py
2
6135
#!/cygdrive/C/Python25/python """A script to help automate the build process.""" # When preparing a new release, make sure to set all of these to the latest # values. VERSIONS = { 'bzr': '1.17', 'qbzr': '0.12', 'bzrtools': '1.17.0', 'bzr-svn': '0.6.3', 'bzr-rewrite': '0.5.2', 'subver...
gpl-2.0
5,361,686,361,667,223,000
27.781553
79
0.579136
false
3.336052
false
false
false
unclechu/avto-lux161
avto-lux/app/adm/routes/actions.py
1
14649
# -*- coding: utf-8 -*- import json from warnings import warn from tornado.web import RedirectHandler, URLSpec from .helpers import query_except_handler, require_auth from app.mixins.routes import JsonResponseMixin from app.models.dbconnect import Session, db_inspector from app.models.usermodels import User from ap...
agpl-3.0
-7,366,104,114,542,085,000
21.360305
76
0.617506
false
3.034811
false
false
false
etingof/pyasn1-modules
tests/test_rfc6187.py
2
2505
# # This file is part of pyasn1-modules software. # # Copyright (c) 2019, Vigil Security, LLC # License: http://snmplabs.com/pyasn1/license.html # import sys import unittest from pyasn1.codec.der.decoder import decode as der_decoder from pyasn1.codec.der.encoder import encode as der_encoder from pyasn1_modules import...
bsd-2-clause
7,143,709,270,943,653,000
34.785714
76
0.766866
false
2.328067
true
false
false
Gloorf/ryzom_inventory
inventory.py
1
4621
#!/usr/bin/python3 import json from flask import Blueprint, render_template import flask_babel from lib import load_data, Translator, required_roles, data_need_reload from inventory_filters import dummy_filter, filter_3, filter_4, filter_6 # Gettext hack _ = lambda x: x class Manager: def __init__(self, sort_i...
agpl-3.0
2,356,548,154,263,878,700
29.006494
97
0.565462
false
3.676213
false
false
false
SeanCline/PyExt
test/scripts/object_details.py
1
1578
import win32debug, sys, os class D(object): """dict""" def __init__(self, d1, d2): self.d1 = d1 self.d2 = d2 def f(self): self.d_uninitialized = 1 class S(object): """slots""" __slots__ = 'slot1', 'slot2', 'slot_uninitialized' def __init__(self, s1, s2): sel...
mit
-1,804,687,212,342,609,000
18.725
65
0.515843
false
2.60396
false
false
false
dlancer/django-pages-cms
pages/migrations/0001_initial.py
1
14896
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import markitup.fields import mptt.fields import django.utils.timezone from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('sites', '0001_initial'), ('au...
bsd-3-clause
-6,709,578,750,606,742,000
59.064516
146
0.578075
false
4.355556
false
false
false
michaelhogg/sublime-character-info
character_info.py
1
3320
import sublime, sublime_plugin, unicodedata # Needed because unicodedata.name() doesn't return names of control characters # See stackoverflow.com/questions/24552786/why-doesnt-unicodedata-recognise-certain-characters UNNAMED_CONTROL_CHARS = { 0x00: 'NULL', 0x01: 'START OF HEADING', 0x02: 'START OF TEXT', ...
mit
709,713,128,041,639,400
34.319149
100
0.65512
false
3.105706
false
false
false
bulik/mtpred
mtpred.py
1
6089
#!/usr/bin/env python ''' (c) 2015-Present Brendan Bulik-Sullivan Multi-trait genetic prediction. ''' from __future__ import division import argparse import time from core import bayes from core import ld import traceback import sys import pandas as pd try: x = pd.DataFrame({'A': [1, 2, 3]}) x.drop_duplicat...
gpl-3.0
5,219,009,283,091,956,000
34.608187
78
0.549844
false
3.590212
false
false
false
damonkelley/django-name
name/validators.py
1
2762
from django.core.exceptions import ValidationError def follow_merged_with(name): """A generator to get the merged_with relationship of a Name object. This will return a Name object until it reaches a Name that does not have a merged_with relationship. """ while name: merged_into = nam...
bsd-3-clause
8,021,655,770,274,407,000
37.361111
73
0.674873
false
4.476499
false
false
false
batearedcollie/seisTK
stk/hyperCubeUtility.py
1
3401
# Copyright 2017 Bateared Collie # # 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 conditions and the following disclaimer. ...
bsd-3-clause
5,139,039,446,379,599,000
36.384615
95
0.670391
false
4.235367
false
false
false
changbiao/pyExifToolGUI
scripts/ui/ui_export_metadata.py
1
11160
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'export_metadata.ui' # # Created: Sun Dec 8 11:53:10 2013 # by: pyside-uic 0.2.14 running on PySide 1.1.2 # # WARNING! All changes made in this file will be lost! from PySide import QtCore, QtGui class Ui_Dialog_export_metadata(object...
gpl-3.0
-1,964,207,848,574,446,800
87.571429
212
0.751703
false
3.48859
false
false
false
benvermaercke/pyqtgraph
examples/GLScatterPlotItem.py
28
2864
# -*- coding: utf-8 -*- """ Demonstrates use of GLScatterPlotItem with rapidly-updating plots. """ ## Add path to library (just for examples; you do not need this) import initExample from pyqtgraph.Qt import QtCore, QtGui import pyqtgraph.opengl as gl import numpy as np app = QtGui.QApplication([]) w = gl.GLViewWid...
mit
5,845,931,509,583,227,000
24.345133
91
0.603701
false
2.433305
false
false
false
ibarbech/learnbot
learnbot_dsl/guis/help.py
1
3411
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file '/home/ivan/robocomp/components/learnbot/learnbot_dsl/guis/help.ui', # licensing of '/home/ivan/robocomp/components/learnbot/learnbot_dsl/guis/help.ui' applies. # # Created: Thu Mar 7 12:39:25 2019 # by: pyside2-uic running on PySide2 ...
gpl-3.0
1,551,152,030,710,378,800
53.142857
121
0.742011
false
4.301387
false
false
false
nocarryr/blender-scripts
multicam_tools/utils.py
1
2424
import bpy def get_full_data_path(bpy_obj): return repr(bpy_obj) def get_bpy_obj_from_data_path(data_path): ## TODO: this is hackish and insecure return eval(data_path) def get_active_strip(context=None): if context is None: context = bpy.context return context.scene.sequence_edit...
gpl-2.0
-932,779,351,380,638,100
27.517647
67
0.60066
false
3.591111
false
false
false
Runbook/runbook
src/monitors/checks/cpu-idle/__init__.py
2
1522
from fabric.api import hide, run, env import time import json def run_cmd(cmd): with hide('output', 'running', 'warnings'): return run(cmd, timeout=1200) def check(**kwargs): ''' Login over SSH and execute shell command ''' jdata = kwargs['jdata'] logger = kwargs['logger'] env.gateway = j...
apache-2.0
4,752,785,440,156,244,000
29.44
80
0.54205
false
3.872774
false
false
false
warner/magic-wormhole
src/wormhole/test/dilate/test_parse.py
1
2402
from __future__ import print_function, unicode_literals import mock from twisted.trial import unittest from ..._dilation.connection import (parse_record, encode_record, KCM, Ping, Pong, Open, Data, Close, Ack) class Parse(unittest.TestCase): def test_parse(self): self....
mit
7,898,744,829,652,153,000
53.590909
85
0.579517
false
3.095361
false
false
false
rcabralc/pyssword
src/pyssword.py
1
12069
#!/usr/bin/env python # vim: fdm=marker """ pyssword - Password generator Generates a random password with a specified entropy within specified character sets. Uses /dev/urandom for random info by default. Usage: pyssword [--lower --upper --numbers --symbols --entropy=bits --no-info] pyssword --read [--lower...
mit
-8,042,619,878,728,763,000
29.946154
108
0.607755
false
3.824144
false
false
false
uclouvain/OSIS-Louvain
base/models/abstracts/abstract_education_group_achievement.py
2
2574
############################################################################## # # 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
-3,911,626,178,749,473,000
42.610169
102
0.692577
false
3.989147
false
false
false
Planet-Nine/cs207project
go_server_SAX.py
1
8656
#!/usr/bin/env python3 from tsdb import TSDBServer from tsdb.persistentdb import PersistentDB import timeseries as ts import tkinter as tk identity = lambda x: x schema = { 'pk': {'convert': identity, 'index': None,'type':str}, #will be indexed anyways 'ts': {'convert': identity, 'index': None}, 'order': {'c...
mit
-355,031,898,191,861,250
44.563158
340
0.547135
false
3.853963
false
false
false
mikehulluk/morphforge
src/morphforge/simulation/base/synaptictriggers/__init__.py
1
2980
#!/usr/bin/python # -*- coding: utf-8 -*- # --------------------------------------------------------------------- # Copyright (c) 2012 Michael Hull. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are...
bsd-2-clause
-2,459,074,456,524,546,600
36.721519
114
0.692617
false
4.238976
false
false
false
mpi-array/mpi_array
mpi_array/locale.py
1
30917
""" ================================== The :mod:`mpi_array.locale` Module ================================== Defines :obj:`LndarrayProxy` class and factory functions for creating multi-dimensional arrays where memory is allocated using :meth:`mpi4py.MPI.Win.Allocate_shared` or :meth:`mpi4py.MPI.Win.Allocate`. Classes...
mit
-2,072,150,402,537,923,600
31.78579
99
0.564608
false
3.942489
false
false
false
nisanick/Prisma_Machina
cogs/bgs.py
1
29859
from datetime import datetime import discord from discord.ext import commands import asyncio import checks import database from dateutil.parser import isoparse from config import BGS_CHANNEL from data.faction import Faction from web import Web class BGS(commands.Cog): def __init__(self, bot: commands.Bot): ...
mit
-6,322,656,993,902,909,000
51.201049
237
0.510901
false
4.355163
false
false
false
munin/munin
munin/mod/xp.py
1
4204
""" Loadable.Loadable subclass """ # This file is part of Munin. # Munin 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. # Munin is ...
gpl-2.0
178,729,172,943,288,640
33.178862
112
0.545671
false
3.454396
false
false
false
eliasdesousa/indico
indico/modules/events/timetable/legacy.py
2
16500
# This file is part of Indico. # Copyright (C) 2002 - 2017 European Organization for Nuclear Research (CERN). # # Indico 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 (a...
gpl-3.0
9,132,719,580,124,701,000
46.413793
117
0.593636
false
4.128096
false
false
false
adason/graph_algo
graph_algo/graph_algo.py
1
1876
# -*- coding: utf-8 -*- """Main program for Command Line interface Usage: graph_algo -h graph_algo --version graph_algo p1hw4 [-v] -i <file> graph_algo p2hw4 [--argo <argo>] [-v] -i <file>... graph_algo p2hw6 [-v] -i <file>... Options: -h --help show this help message and exit ...
mit
-7,334,569,178,823,456,000
26.588235
60
0.498934
false
3.474074
false
false
false
thecount12/madblog
pvgmail.py
1
1101
#!/usr/bin/python # mail form program using gmail import base64 import smtplib from email.mime.text import MIMEText # change smtpuser, zap # recipients I use similar to carbon copy # REPLY_TO_ADDRESS is the user filling out the form def gmail(REPLY_TO_ADDRESS,data,subject): smtpserver = 'smtp.gmail.com' # g...
gpl-2.0
7,159,319,071,805,507,000
27.230769
64
0.641235
false
3.484177
false
false
false
snapcore/snapcraft
snapcraft/internal/project_loader/_extensions/ros2_foxy.py
2
2886
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2020 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in the h...
gpl-3.0
-9,029,293,964,805,424,000
32.952941
119
0.578309
false
3.767624
false
false
false
Andrew-McNab-UK/DIRAC
Core/Utilities/TimeLeft/TimeLeft.py
2
9585
""" The TimeLeft utility allows to calculate the amount of CPU time left for a given batch system slot. This is essential for the 'Filling Mode' where several VO jobs may be executed in the same allocated slot. The prerequisites for the utility to run are: - Plugin for extracting information from lo...
gpl-3.0
-4,320,293,889,383,008,000
40.855895
134
0.629734
false
4.037489
false
false
false
Veil-Framework/Veil
tools/ordnance/payloads/x86/bind_tcp.py
1
5084
""" Bind TCP Payload Completely ported from Metasploit Framework: https://github.com/rapid7/metasploit-framework/blob/master/modules/payloads/stagers/windows/bind_tcp.rb """ import codecs from lib.common import helpers class ShellcodeModule: def __init__(self, cli_arguments): self.name = "Bind TCP S...
gpl-3.0
-1,086,560,340,512,147,300
47.884615
140
0.584579
false
2.50814
false
false
false
OpenTreeOfLife/reference-taxonomy
util/get_forwards.py
1
1148
import csv, sys forwards = {} # Load legacy forwards def load_forwards(filename): infile = open(filename, 'r') load_forwards_from_stream(infile) infile.close() def load_forwards_from_stream(infile): reader = csv.reader(infile, delimiter='\t') idcolumn = 0 repcolumn = 1 for row in reader:...
bsd-2-clause
5,068,023,480,321,642,000
23.425532
52
0.597561
false
3.679487
false
false
false
adjih/openlab
appli/iotlab_examples/smart_tiles/plot_sensors.py
4
4668
#!/usr/bin/python # -*- coding: utf-8 -*- """ plot_sensors.py <filename> <node_id> ... plot sensors values from <node_id> printed by smart_tiles firmware saved in filename (by serial_aggregator) Example of use : After firmware deployement on m3-29 to m3-32 mypc> aggr.sh 29 30 31 32 > data.txt mypc> python myplot.p...
gpl-3.0
3,069,637,162,765,641,700
26.139535
87
0.550985
false
3.447563
false
false
false
salceson/kompilatory
lab1/zad1.py
1
4434
__author__ = 'Piotr Moczurad and Michal Ciolczyk' import os import sys import re import codecs re_flags = re.MULTILINE | re.U author_pattern = re.compile(r'<META NAME="AUTOR" CONTENT="(.+)">', re_flags) dept_pattern = re.compile(r'<META NAME="DZIAL" CONTENT="(.+)">', re_flags) key_pattern = re.compile(r'<META NAME="...
mit
-8,817,545,450,034,686,000
31.851852
120
0.566306
false
2.687273
false
false
false
andrewyoung1991/abjad
abjad/tools/schemetools/Scheme.py
1
10687
# -*- encoding: utf-8 -*- from abjad.tools import stringtools from abjad.tools.abctools import AbjadValueObject class Scheme(AbjadValueObject): r'''Abjad model of Scheme code. .. container:: example **Example 1.** A Scheme boolean value: :: >>> scheme = schemetools.Scheme(True...
gpl-3.0
7,986,514,970,599,183,000
29.27762
128
0.536353
false
4.353157
false
false
false
manikTharaka/al-go-rithms
greedy/kruskal's_algorithm/python/ArthurFortes/algorithmKruskal.py
4
1445
""" Computer Science Department (SCC) Mathematics and Computer Science Institute (ICMC) University of Sao Paulo (USP) Algorithms Projects Teacher: Gustavo Batista Author: Arthur Fortes da Costa Method Kruskal """ from vertexFunctions import * from readFile import readFile from unionFind import unionFind from operat...
mit
5,727,848,772,294,627,000
21.578125
100
0.59654
false
2.773512
false
false
false
Laendasill/diango_tutorial_test
mysite/settings.py
1
2686
""" Django settings for mysite project. Generated by 'django-admin startproject' using Django 1.8.1. 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/settings/ """ # Build paths...
mit
700,184,355,062,771,800
25.07767
71
0.689501
false
3.439181
false
false
false
mkessy/playlister-project
playlister/playlists/migrations/0004_auto__add_field_group_slug__add_field_playlist_slug__add_field_categor.py
1
5260
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Group.slug' db.add_column(u'playlists_group', 'slug', self.gf('django....
mit
6,291,368,834,679,632,000
60.894118
161
0.558935
false
3.730496
false
false
false
ekcs/congress
congress/tests/datasources/vCenter_fakes.py
1
1093
# Copyright (c) 2014 Marist SDN Innovation lab Joint with Plexxi 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/license...
apache-2.0
-7,512,709,806,719,100,000
29.361111
78
0.68161
false
3.795139
false
false
false
MilyangParkJaeHoon/deeplearning
lab5/logistic_regression_diabetes.py
1
1731
# Lab 5 Logistic Regression Classifier import tensorflow as tf import numpy as np tf.set_random_seed(777) # for reproducibility xy = np.loadtxt('data-03-diabetes.csv', delimiter=',', dtype=np.float32) x_data = xy[:, 0:-1] y_data = xy[:, [-1]] print(x_data.shape, y_data.shape) # placeholders for a tensor that will b...
mit
-621,509,392,199,968,800
25.630769
79
0.641248
false
2.78744
false
false
false
simonwsw/deep-soli
pre/op.py
1
3786
import os, subprocess import numpy as np import h5py import json from image import image class Operation: def __init__(self): pass # generate image for each sequence def generate_image(self, source, target, num_channel, origin_size=32, out_size=32, bound=15.0, bin_image='image/bin/ima...
mit
-8,486,536,525,631,522,000
35.403846
73
0.53196
false
3.640385
false
false
false
bigr/map1
read-wiki/readwiki.py
1
11143
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import re import xml.etree.cElementTree as xml import codecs from string import replace def parseGeoLocation(geo_cz,geo_dms,geo,coord): try: toNumber = lambda s:float(replace(s,u",",u".")) if geo_cz: x = geo_cz.split('|') return (toNumber(x[0]) + to...
agpl-3.0
8,709,117,120,043,532,000
30.204482
275
0.591741
false
2.559155
false
false
false
sunoru/pokemon_only
msite/settings_default.py
1
3588
""" Django settings for Pokemon Only project. Generated by 'django-admin startproject' using Django 1.8. 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/settings/ """ # Build p...
gpl-2.0
441,406,430,976,898,240
24.090909
71
0.67029
false
3.241192
false
false
false
tensorflow/models
official/vision/image_classification/callbacks.py
1
9323
# Copyright 2021 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
-1,199,922,158,997,506,300
35.276265
104
0.664486
false
3.958811
false
false
false
ninjahoahong/django-yaas
YAAS/settings.py
1
5428
# Django settings for YAAS project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( ('admin', 'admin@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'YAASd...
mit
1,969,944,859,881,598,000
33.246753
108
0.660464
false
3.690007
false
false
false
jhcepas/npr
nprlib/task/raxml.py
1
8790
import os import sys import logging import re import shutil from glob import glob log = logging.getLogger("main") from nprlib.master_task import TreeTask from nprlib.master_job import Job from nprlib.utils import (basename, Tree, OrderedDict, GLOBALS, RAXML_CITE, pjoin, DATATYPES, md5) from ...
gpl-3.0
-4,085,692,445,470,686,700
37.384279
102
0.502958
false
3.632231
false
false
false
JoeJasinski/WindyTransit
mobiletrans/mtlocation/migrations/0002_auto__chg_field_location_uuid__chg_field_transitroute_uuid__chg_field_.py
1
9992
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Location.uuid' db.alter_column(u'mtlocation_location', 'uuid', self.gf('django.db.models...
mit
6,730,425,070,483,890,000
74.12782
177
0.560348
false
3.520789
false
false
false
jeppe-style/code-quality-and-popularity
static_code_metrics.py
1
4112
import json import os import subprocess import git import pandas import shutil from git import Repo from shared_constants import data_dir, repo_candidates_filename temp_repo_dir = "temp-repo" code_metrics_file = "code-metrics.csv" code_metrics_folder = "code-metrics" def read_json(filename): print("reading res...
mit
-8,530,514,884,157,262,000
31.634921
110
0.621109
false
3.648625
false
false
false
cligu/gitdox
modules/validation/ether_validator.py
1
13538
from validator import Validator from collections import defaultdict import re class EtherValidator(Validator): def __init__(self, rule): self.corpus = rule[0] self.doc = rule[1] self.domain = rule[2] self.name = rule[3] self.operator = rule[4] self.argument = rule[5...
apache-2.0
6,834,000,973,809,227,000
40.783951
117
0.503989
false
4.205654
false
false
false
oj-development/oj-web
oj_core/migrations/0009_auto_20150902_0258.py
1
1147
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('oj_core', '0008_userstatus_solved_problems'), ] operations = [ migrations.AlterField( ...
mit
-4,211,019,953,965,281,000
27.675
118
0.569311
false
4.551587
false
false
false
arlolra/exitaddr
server.py
1
2010
#!/usr/bin/env python import json from twisted.web import server, resource from twisted.internet import reactor from common import Exitaddr, options DEFAULT_PORT = 8080 exitaddr_results = None def addHeader(request): h = request.responseHeaders h.addRawHeader(b"content-type", b"application/json") class...
mit
-9,052,537,412,710,313,000
22.647059
69
0.604478
false
3.764045
false
false
false
macressler/vsc-tools-lib
lib/vsc/pbs/option_parser.py
1
9482
#!/usr/bin/env python '''class for parsing PBS options''' from argparse import ArgumentParser import os, re, validate_email from vsc.event_logger import EventLogger from vsc.utils import walltime2seconds, size2bytes from vsc.utils import InvalidWalltimeError class PbsOptionParser(EventLogger): '''Parser for PBS...
lgpl-3.0
2,629,034,364,437,918,000
38.840336
76
0.531955
false
3.902058
false
false
false
macalik/TITDev
views/navigation.py
2
7793
import json from hashlib import sha1 from flask_nav import Nav from flask_nav.elements import Navbar, View, Subgroup, Link, Text from flask_bootstrap.nav import BootstrapRenderer from flask import session, url_for from dominate import tags class LinkTab(Link): def __init__(self, *args, **kwargs): super()...
mit
-4,933,823,219,203,500,000
41.584699
115
0.519954
false
4.207883
false
false
false
Fat-Zer/FreeCAD_sf_master
src/Mod/Draft/draftguitools/gui_split.py
3
4997
# *************************************************************************** # * (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> * # * (c) 2009, 2010 Ken Cline <cline@frii.com> * # * (c) 2020 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> * # * ...
lgpl-2.1
2,060,247,133,012,958,500
42.833333
273
0.528117
false
4.27094
false
false
false
Tooskich/python_core
rankings/management/commands/updateraces.py
1
1785
#-*- coding: utf-8 -*- import os import shutil from django.core.management.base import BaseCommand, CommandError # CURRENT_DIR = os.path.abspath(os.path.dirname(os.path.realpath(__file__))) # BACKEND_DIR = os.path.abspath(os.path.join(CURRENT_DIR, os.pardir)) # APP_DIR = os.path.abspath(os.path.join(BACKEND_DIR, os.p...
apache-2.0
1,120,057,887,100,004,500
40.511628
91
0.658263
false
3.010118
false
false
false
smysnk/sikuli-framework
src/robotframework/common/Selenium2Server.py
2
2234
""" Copyright (c) 2013, SMART Technologies ULC All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions an...
bsd-3-clause
-7,281,574,944,637,975,000
36.551724
140
0.740376
false
4.329457
false
false
false
maferelo/saleor
saleor/webhook/migrations/0001_initial.py
2
2186
# Generated by Django 2.2.4 on 2019-09-26 05:47 import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [("account", "0033_serviceaccount")] operations = [ migrations.CreateModel( name="Webhook",...
bsd-3-clause
366,458,658,504,562,050
31.147059
88
0.390668
false
5.619537
false
false
false
superberny70/pelisalacarta
python/main-classic/servers/debriders/alldebrid.py
2
1902
# -*- coding: utf-8 -*- # ------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Conector para AllDebrid # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ # ------------------------------------------------------------ from core import jsontools from core import logger from ...
gpl-3.0
-320,637,137,450,492,500
37.04
101
0.557308
false
3.729412
false
false
false
wavesaudio/instl
pyinstl/installItemGraph.py
1
1347
#!/usr/bin/env python3.9 import utils from configVar import config_vars try: import networkx as nx except ImportError as IE: raise IE def create_dependencies_graph(items_table): retVal = nx.DiGraph() for iid in items_table.get_all_iids(): for dependant in items_table.get_resolved_details_for...
bsd-3-clause
366,352,157,756,994,600
25.94
82
0.6585
false
3.544737
false
false
false
MartinThoma/algorithms
wiki-images-catpage/wikicommons.py
1
8526
#!/usr/bin/env python """Get all images of a wikipedia commons category.""" import json import logging import os import sys import urllib # images import urllib2 # text import xmltodict logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s', level=logging.DEBUG, ...
mit
1,034,184,928,926,527,400
29.55914
78
0.574478
false
3.943571
false
false
false
hmc-cs-rkretsch/Secondary-Protein-Structure
Program/lit_analysis.py
1
11131
# -*- coding: utf-8 -*- """ Author: Rachael Kretsch Big Data Final Project Secondary Protein Structure analyse the literature data!! """ import pickle import numpy as np import matplotlib.pyplot as plt from sklearn import linear_model #============================================================================== # ...
mit
8,593,575,227,235,875,000
31.931953
113
0.465008
false
3.00027
false
false
false
LambolAlee/LAminec
cli_module/Kaminec/jsontools/promotions/GamePromotions.py
1
1431
from string import Template from collections import namedtuple from ..LibItem import make_comp_items from ..system import Rule, getStartCodeTemplate, NATIVEKEY ORDLIBFORM = "{0}/{1}/{2}/{1}-{2}.jar" NATIVELIBFORM = "{0}/{1}/{2}/{1}-{2}-{3}.jar" class MCPromotNormal: '''promotion to minecraft 1.12.2 and earlier.''...
gpl-3.0
5,770,173,840,983,619,000
30.130435
87
0.649196
false
3.533333
false
false
false
easmetz/inasafe
safe/impact_functions/ash/ash_raster_places/impact_function.py
1
9377
# coding=utf-8 """InaSAFE Disaster risk tool by Australian Aid - Tsunami Raster Impact on Buildings Contact : ole.moller.nielsen@gmail.com .. note:: 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 Fou...
gpl-3.0
-7,679,573,764,815,955,000
36.658635
78
0.569798
false
4.059307
false
false
false
FreedomCoop/valuenetwork
multicurrency/utils.py
1
11766
import requests import time import hashlib import hmac import logging import json from random import randint from base64 import b64decode from django.conf import settings from django.forms import ValidationError class ChipChapAuthError(Exception): def __init__(self, message, errors): super(ChipChapAuthEr...
agpl-3.0
-2,161,126,652,751,138,000
41.785455
166
0.561023
false
4.064249
false
false
false
UK-MAC/mega-stream
scripts/heatmap.py
1
2288
# # # Copyright 2016 Tom Deakin, University of Bristol # # This file is part of mega-stream. # # mega-stream 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...
gpl-3.0
1,387,855,735,382,224,000
33.149254
85
0.666958
false
2.591166
false
false
false