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
ramineni/myironic
ironic/common/image_service.py
1
2467
# Copyright 2010 OpenStack Foundation # Copyright 2013 Hewlett-Packard Development Company, L.P. # 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 # # ht...
apache-2.0
-1,234,819,432,871,128,000
36.378788
78
0.633158
false
gic888/MIEN
optimizers/randsearch.py
1
1656
#!/usr/bin/env python # encoding: utf-8 #Created by Graham Cummins on 2007-08-23. # Copyright (C) 2007 Graham I Cummins # 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 L...
gpl-2.0
4,406,141,510,409,554,000
32.14
164
0.724638
false
nuanri/hiblog
src/app/blog/console_views.py
1
17946
# coding: utf-8 import json import requests from hanlder import RequestHandler as BaseRequestHandler import tornado.web from tornado.web import authenticated from ..utils import deal_errors, get_local_time, get_local_time_string from .forms import BlogWriterForm, BlogCatalogWriterForm class RequestHandler(BaseRequ...
mit
4,445,130,281,428,235,300
25.143275
116
0.546919
false
saisankargochhayat/algo_quest
leetcode/430.FlatternADoubleLinkedList/soln.py
1
1710
""" # Definition for a Node. class Node: def __init__(self, val, prev, next, child): self.val = val self.prev = prev self.next = next self.child = child """ class Solution: def flatten(self, head: 'Node') -> 'Node': start = head head = head while head != ...
apache-2.0
319,589,736,364,629,700
32.529412
106
0.533918
false
AdiPersonalWorks/ATOS_GOM_SystemPrototyping
pico/auth.py
1
1890
import pico from pico import PicoError class NotAuthorizedError(PicoError): def __init__(self, message=''): PicoError.__init__(self, message) self.response.status = "401 Not Authorized" self.response.set_header("WWW-Authenticate", "Basic") class InvalidSessionError(PicoError): def _...
mit
5,647,580,370,093,337,000
32.75
72
0.589947
false
tedunderwood/horizon
chapter3/code/reproduce_fictional_prestige.py
1
7078
#!/usr/bin/env python3 # reproduce_fictional_prestige.py # Scripts to reproduce models # used in Chapter Three, # The Directions of Literary Change. import csv, os, sys, pickle, math # we add a path to be searched so that we can import # versatiletrainer, which will do most of the work # Versatiletrainer, and the m...
mit
5,076,962,015,525,809,000
38.541899
275
0.658519
false
dwalton76/ev3dev-lang-python
tests/motor/motor_motion_unittest.py
1
5822
#!/usr/bin/env python3 # Based on the parameterized test case technique described here: # # http://eli.thegreenplace.net/2011/08/02/python-unit-testing-parametrized-test-cases import unittest import time import ev3dev.ev3 as ev3 import parameterizedtestcase as ptc from motor_info import motor_info class TestMoto...
mit
3,945,988,021,767,374,300
38.337838
115
0.583305
false
defstryker/Hex-Omega
users/Xav/views.py
1
2547
from users.views import * from .add_leader_form import * from django.db.utils import IntegrityError def create_leader_user(request, username): form = LeaderForm() if request.method == 'POST': form = LeaderForm(request.POST) if form.is_valid(): username = request.POST.get('usernam...
mit
4,510,525,064,045,254,000
41.45
116
0.599136
false
jal-stats/django
jal_stats/jal_stats/urls.py
1
1604
"""jal_stats URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-b...
mit
5,263,043,419,280,896,000
33.869565
77
0.650873
false
3L3N4/Egress-Assess
common/orchestra.py
1
1550
''' This is the conductor which controls everything ''' import glob import imp from protocols.servers import * from protocols.clients import * from datatypes import * class Conductor: def __init__(self): # Create dictionaries of supported modules # empty until stuff loaded into them se...
gpl-3.0
3,691,353,084,157,195,300
35.046512
97
0.610968
false
deanet/gheimdall
gheimdall/responsecreator/__init__.py
1
5051
#!/usr/bin/python # -*- coding: utf-8 -*- # # GHeimdall - A small web application for Google Apps SSO service. # Copyright (C) 2007 SIOS Technology, 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 S...
gpl-2.0
-5,745,384,431,272,258,000
35.868613
102
0.67848
false
smallyear/linuxLearn
salt/salt/utils/process.py
1
11798
# -*- coding: utf-8 -*- # Import python libs from __future__ import absolute_import import os import sys import time import types import signal import subprocess import logging import multiprocessing import threading # Import salt libs import salt.defaults.exitcodes import salt.utils # Import 3rd-party libs import ...
apache-2.0
-4,748,247,303,098,665,000
31.955307
99
0.544075
false
grueni75/GeoDiscoverer
Source/Platform/Target/Android/core/src/main/jni/gdal-3.2.1/swig/python/scripts/gdal2tiles.py
1
134939
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # ****************************************************************************** # $Id: gdal2tiles.py d712a530aa1b0dabf9717dd935996dd7b9fd8ced 2020-11-15 15:12:13 +0100 Even Rouault $ # # Project: Google Summer of Code 2007, 2008 (http://code.google.com/soc/) # Support: ...
gpl-3.0
3,414,157,871,314,064,000
40.622147
407
0.542697
false
mespinozas/si
t3/t3loader.py
1
1118
import threading import logging import time import os logging.basicConfig( level=logging.DEBUG, format='[%(levelname)s] - %(threadName)-10s : %(message)s') def worker(x): logging.debug('Lanzado') importer = 'bin/mallet import-svmlight --input archivoEntrenamiento%s.txt --output training%s.mallet' % (x,x) ...
gpl-2.0
-8,920,960,298,645,710,000
30.942857
168
0.669946
false
paddycarey/stretch
tests/stretch/test_application.py
1
2711
# third-party imports import pytest # local imports from stretch import application from stretch.triggers import results from tests.utils import fixture_loader @pytest.fixture def configured_app(): app_json = fixture_loader.json_fixture("web-service-configured") return application.Application(app_json) @py...
mit
-9,053,456,474,729,907,000
31.662651
104
0.672814
false
alvestrand/old-compare-codecs
lib/mpeg_settings.py
1
3650
#!/usr/bin/python # Copyright 2014 Google. # # 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
737,835,373,393,000,600
40.954023
74
0.526301
false
infobloxopen/infoblox-netmri
infoblox_netmri/easy/netmri_easy.py
1
10624
########################################################################### # Export of Script Module: netmri_easy # Language: Python # Category: Internal # Description: Object oriented library for Python scripting support ########################################################################### import datetime impor...
apache-2.0
1,485,694,990,432,806,000
33.493506
105
0.538592
false
apollux/whose_turn_is_it_anyway
whose_turn_is_it_anyway/app.py
1
2193
# -*- coding: utf-8 -*- """The app module, containing the app factory function.""" from flask import Flask, render_template from whose_turn_is_it_anyway.settings import ProdConfig from whose_turn_is_it_anyway.assets import assets from whose_turn_is_it_anyway.extensions import ( bcrypt, cache, db, login...
bsd-3-clause
-2,446,497,246,849,966,000
29.887324
89
0.708618
false
doriancoins/doriancoin
test/functional/test_runner.py
1
23307
#!/usr/bin/env python3 # Copyright (c) 2014-2017 The Doriancoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Run regression test suite. This module calls down into individual test cases via subprocess. It wil...
mit
5,020,215,571,676,961,000
39.523478
195
0.615639
false
AndrewGoldstein/grasshopper
grasshopper/public/views.py
1
2732
# -*- coding: utf-8 -*- """Public section, including homepage and signup.""" from flask import Blueprint, flash, redirect, render_template, request, url_for, g from flask_login import login_required, login_user, logout_user from grasshopper.extensions import login_manager from grasshopper.public.forms import LoginForm...
bsd-3-clause
-4,215,876,279,390,760,000
30.77907
113
0.635798
false
nikhila05/MicroSite
micro_blog/migrations/0001_initial.py
1
4172
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import datetime from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ m...
gpl-2.0
-10,623,089,563,571,604
39.901961
142
0.529003
false
alphagov/notifications-api
migrations/versions/0083_add_perm_types_and_svc_perm.py
1
2344
"""empty message Revision ID: 0083_add_perm_types_and_svc_perm Revises: 0082_add_go_live_template Create Date: 2017-05-12 11:29:32.664811 """ # revision identifiers, used by Alembic. revision = '0083_add_perm_types_and_svc_perm' down_revision = '0082_add_go_live_template' from alembic import op import sqlalchemy as...
mit
-4,852,084,235,956,907,000
43.226415
115
0.579352
false
jonasfj/dxr
tests/test_functions.py
1
2593
"""Tests for searches about functions""" from dxr.testing import SingleFileTestCase, MINIMAL_MAIN class ReferenceTests(SingleFileTestCase): """Tests for finding out where functions are referenced or declared""" source = r""" #include <stdio.h> const char* getHello() { return "He...
mit
3,067,298,335,636,265,000
31.012346
81
0.570382
false
lidaobing/itcc
itcc/ccs2/solvent_caflisch.py
1
3718
import pkg_resources import math from itcc import tools ff_cache = {} caflisch_dat = None r_probe = 1.4 pij_bonded = 0.8875 pij_nonbonded = 0.3516 class Caflisch(object): def __init__(self, data): self.data = data assert len(self.data) == 5 def _r_min(self): return self.data[1] ...
gpl-3.0
-5,666,795,548,658,434,000
26.746269
80
0.537924
false
anaoaktree/vcgen
vcgen/test.py
1
1786
# Copyright (c) 2011, Jay Conrod. # 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 and ...
mit
-2,567,668,676,885,615,600
54.8125
83
0.758679
false
Yubico/yubiadmin-dpkg
yubiadmin/config.py
1
2301
# Copyright (c) 2013 Yubico AB # 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 conditi...
bsd-2-clause
-259,948,468,104,190,900
32.838235
71
0.720991
false
mompiou/misorientation
misorientation.py
1
48149
#!/usr/bin/python from __future__ import division import numpy as np from Tkinter import * from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg from matplotlib.figure import Figure from matplotlib import pyplot as plt from PIL import Image from PIL import PngImagePlugin impo...
gpl-2.0
980,697,101,634,222,300
33.094023
147
0.579285
false
jdelgad/IRefuse
irefuse/irefuse.py
1
6388
# -*- encoding: UTF-8 -*- """ 'I Refuse' web application. Copyright (C) 2017 Jacob Delgado This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option...
agpl-3.0
-3,449,111,402,710,158,300
35.090395
77
0.588134
false
flyingSprite/spinelle
task_inventory/order_1_to_30/order_16_use_faker.py
1
2553
""" Order 16: Use faker in python. Generate lots of kinds data with Faker * User information """ from faker import Faker, Factory class FakerGenerator(object): """Generate different data by this class.""" fake = None def __init__(self, language=None): if language: self.fake = Factor...
mit
3,729,536,303,053,445,000
27.685393
99
0.596553
false
Victory/realpython-tdd
contacts/user_contacts/views.py
1
1864
from django.shortcuts import ( render, render_to_response) from django.template import RequestContext from django.http import HttpResponseRedirect, HttpResponse from django.views.generic import DetailView from django.core.exceptions import ValidationError from django.views.decorators.http import require_http_me...
mit
4,318,323,745,429,808,600
24.534247
65
0.670601
false
bjarnagin/manyquery
manyquery/cli.py
1
1598
import click import csv from manyquery.connection import Connection, MultiConnection @click.command() @click.option('--host', '-h', default=['ict.croptrak.com'], multiple=True, help='Hostname. Repeatable.') @click.option('--user', '-u', help='MySQL username') @click.option('--password', '-p', prompt=...
mit
-4,797,792,615,372,584,000
34.533333
82
0.610138
false
conchyliculture/wikipoff-tools
tests/units.py
1
18483
#!/usr/bin/python # encoding: utf-8 from __future__ import unicode_literals import os.path import sys sys.path.append(os.path.join(os.path.dirname(__file__), u'..')) sys.path.append( os.path.join( os.path.dirname(__file__), u'..', u'lib', u'python{0:d}.{1:d}'.format( sys.version_info.m...
gpl-3.0
-8,170,664,019,109,375,000
43.095823
383
0.554243
false
tensorflow/probability
tensorflow_probability/python/distributions/blockwise.py
1
15570
# Copyright 2018 The TensorFlow Probability 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 o...
apache-2.0
4,754,112,428,471,258,000
36.071429
104
0.648105
false
AlanD88/website
seadssite/urls.py
1
1364
from django.conf.urls import include, url from django.contrib import admin from django.contrib.auth.views import login, logout, password_reset, password_reset_done, password_reset_confirm,\ password_reset_complete from django.conf import settings from django.conf.urls.static import static from seadssite import view...
mit
-1,528,178,105,431,894,800
49.518519
114
0.58651
false
Oppium/BTCeGUI
BTCeGUI.py
1
21599
#! python3 import tkinter import tkinter.ttk as ttk import threading import operator import time import copy import os.path import datetime import queue import BTCe api = BTCe.API('BTCe.ini') console = None def format_float(value): return ('{:0.8f}'.format(float(value)).rstrip('0').rstrip('.')) def validate_float(v...
mit
-531,146,083,927,897,600
31.53012
153
0.678504
false
swharden/SWHLab
doc/uses/EPSCs-and-IPSCs/smooth histogram method/05.py
1
1812
""" MOST OF THIS CODE IS NOT USED ITS COPY/PASTED AND LEFT HERE FOR CONVENIENCE """ import os import sys # in case our module isn't installed (running from this folder) if not os.path.abspath('../../../') in sys.path: sys.path.append('../../../') # helps spyder get docs import swhlab import swhlab.common as cm i...
mit
-1,441,784,876,486,513,400
28.225806
79
0.683223
false
enalisnick/stick-breaking_dgms
models/variational_coders/decoders.py
1
3064
import numpy as np import theano import theano.tensor as T ### Regular Decoder class Decoder(object): def __init__(self, rng, input, latent_size, out_size, activation, W_z = None, b = None): self.input = input self.activation = activation # setup the params ...
mit
8,828,024,413,954,331,000
49.229508
181
0.520235
false
IBMPredictiveAnalytics/SPSSINC_RECODEEX
src/SPSSINC_RECODEEX.py
1
20980
#/*********************************************************************** # * Licensed Materials - Property of IBM # * # * IBM SPSS Products: Statistics Common # * # * (C) Copyright IBM Corp. 1989, 2020 # * # * US Government Users Restricted Rights - Use, duplication or disclosure # * restricted by GSA ADP Schedule C...
apache-2.0
8,460,138,943,254,883,000
37.214936
129
0.614585
false
Fireforge/AcronatorServer
acronization.py
1
5783
import json import argparse import random import sys import requests BIGHUGELABS_API_KEY = 'f79909b74265ba8593daf87741f3c874' buzzWords = ['alignment','bot', 'collusion', 'derivative', 'engagement', 'focus', 'gathering' ,'housing','liability','management','nomenclature','operation','procedure','reduction','strategic...
mit
8,642,745,247,605,629,000
38.882759
402
0.582743
false
vlegoff/tsunami
src/primaires/salle/commandes/etendue/creer.py
1
2733
# -*-coding:Utf-8 -* # Copyright (c) 2010-2017 LE GOFF Vincent # 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 ...
bsd-3-clause
6,137,721,465,769,932,000
43.327869
79
0.698225
false
overdev/easygl-0.1.0-alpha1
easygl/display/window.py
1
11847
# !/usr/bin/python # -*- coding: utf-8 -*- # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # # The MIT License (MIT) # # Copyright (c) 2017 Jorge A. Gomes (jorgegomes83 at hotmail dot com) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this softwar...
mit
6,686,868,297,029,935,000
34.364179
115
0.543682
false
testalt/electrum-ppc-server
src/utils.py
1
6099
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2011 thomasv@gitorious # # 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...
agpl-3.0
-1,488,351,987,294,061,300
23.396
107
0.610756
false
rmit-ir/SummaryRank
summaryrank/svmlight_tools.py
1
11505
""" SVMLight tools """ import sys import argparse import gzip import math import numpy as np import random import re PROG = 'python svmlight_format.py' ID_NAME_PATTERN = re.compile(r'^#\s*(\d+)\s*:\s*(\S+.*)\s*$') class AutoHelpArgumentParser(argparse.ArgumentParser): """ """ def error(self, message): ...
mit
-3,312,483,875,548,357,000
31.226891
93
0.567492
false
BladeSun/NliWithKnowledge
session2/dam_bk_1.py
1
59183
''' Build a neural machine translation model with soft attention ''' import theano import theano.tensor as tensor from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams import cPickle as pkl import ipdb import numpy import copy import os import warnings import sys import time import logging from colle...
bsd-3-clause
2,461,992,773,011,421,700
36.937821
252
0.529831
false
spesmilo/electrum
electrum/gui/qt/amountedit.py
1
4862
# -*- coding: utf-8 -*- from decimal import Decimal from typing import Union from PyQt5.QtCore import pyqtSignal, Qt, QSize from PyQt5.QtGui import QPalette, QPainter from PyQt5.QtWidgets import (QLineEdit, QStyle, QStyleOptionFrame, QSizePolicy) from .util import char_width_in_lineedit, ColorScheme from electrum.u...
mit
-6,846,242,850,368,492,000
32.531034
95
0.613122
false
gjwajda/Computational-Tools-For-Big-Data
Exercise11/exercise11_2.py
1
3455
#!C:/Users/Greg/Anaconda/Python import json from time import time from os import listdir import re import numpy as np from random import shuffle from pprint import pprint #Folder with json files path = "./json/" # Function to load all json files into python def merge_json(path): merged_json = [] for filename in lis...
mit
-7,924,714,258,189,322,000
26.204724
98
0.665702
false
tboyce1/home-assistant
homeassistant/components/climate/econet.py
1
7250
""" Support for Rheem EcoNet water heaters. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/climate.econet/ """ import datetime import logging import voluptuous as vol from homeassistant.components.climate import ( DOMAIN, PLATFORM_SCHEMA, STATE_ECO...
apache-2.0
5,136,632,818,618,651,000
31.657658
78
0.638897
false
KirillShaman/escalate_gspread
app/channels/models.py
1
5656
# The MIT License (MIT) # Escalate Copyright (c) [2014] [Chris Smith] # 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, c...
mit
1,731,833,847,790,810,600
34.572327
138
0.637553
false
jgasteiz/fuzzingtheweb
settings.py
1
3336
# -*- coding: utf-8 -*- DEBUG = False TEMPLATE_DEBUG = DEBUG ADMINS = ( ('Javi Manzano', 'javi.manzano.oller@gmail.com'), ) MANAGERS = ADMINS ALLOWED_HOSTS = ['176.58.120.22', 'fuzzingtheweb.com'] TIME_ZONE = 'Europe/London' USE_TZ = True LANGUAGE_CODE = 'en-gb' SITE_ID = 1 USE_I18N = True USE_L10N = True MEDIA...
mit
-5,936,774,613,336,678,000
22.492958
77
0.57554
false
Paczesiowa/youtube-dl
youtube_dl/extractor/dailymotion.py
1
10862
# coding: utf-8 from __future__ import unicode_literals import re import json import itertools from .common import InfoExtractor from ..compat import ( compat_str, compat_urllib_request, ) from ..utils import ( ExtractorError, int_or_none, orderedSet, str_to_int, unescapeHTML, ) class D...
unlicense
-8,050,191,618,828,455,000
35.816949
167
0.532179
false
joegomes/deepchem
deepchem/models/autoencoder_models/test_tensorflowEncoders.py
1
1452
from unittest import TestCase from nose.tools import assert_equals from rdkit import Chem import deepchem as dc from deepchem.data import DiskDataset from deepchem.feat.one_hot import zinc_charset from deepchem.models.autoencoder_models.autoencoder import TensorflowMoleculeEncoder, TensorflowMoleculeDecoder class T...
mit
627,227,895,701,837,200
38.243243
111
0.664601
false
limodou/uliweb
uliweb/utils/setup.py
1
5756
from setuptools import setup from setuptools.command import build_py as b import os,sys import glob #remove build and dist directory import shutil #if os.path.exists('build'): # shutil.rmtree('build') #if os.path.exists('dist'): # shutil.rmtree('dist') def copy_dir(self, package, src, dst): self.mkpath(dst)...
bsd-2-clause
7,548,749,908,409,896,000
31.519774
113
0.539611
false
ayushagrawal288/zamboni
mkt/extensions/tests/test_models.py
1
3724
# -*- coding: utf-8 -*- import mock from nose.tools import eq_, ok_ from django.forms import ValidationError from mkt.extensions.models import Extension from mkt.files.tests.test_models import UploadCreationMixin, UploadTest from mkt.site.storage_utils import private_storage from mkt.site.tests import TestCase clas...
bsd-3-clause
-2,164,110,055,124,655,900
37.75
76
0.64543
false
henryroe/Py2MASS
py2mass/__main__.py
1
2088
from __future__ import absolute_import import pickle import sys from .py2mass import set_2mass_path, fetch_2mass_xsc_box, fetch_2mass_psc_box, __version__ def main(): show_help = False if len(sys.argv) == 1 or "help" in sys.argv: show_help = True else: if sys.argv[1] == 'psc': ...
mit
-1,982,956,073,703,998,700
39.173077
90
0.527299
false
graphql-python/graphql-core
tests/validation/test_unique_directive_names.py
1
2732
from functools import partial from graphql.utilities import build_schema from graphql.validation.rules.unique_directive_names import UniqueDirectiveNamesRule from .harness import assert_sdl_validation_errors assert_errors = partial(assert_sdl_validation_errors, UniqueDirectiveNamesRule) assert_valid = partial(asser...
mit
1,620,604,357,516,946,200
26.049505
84
0.503294
false
valohai/valohai-cli
valohai_cli/git.py
1
2207
import os import subprocess from typing import Sequence from valohai_cli.exceptions import NoCommit, NoGitRepo def check_git_output(args: Sequence[str], directory: str) -> bytes: try: return subprocess.check_output( args=args, cwd=directory, shell=False, st...
mit
-3,123,302,948,295,166,000
31.455882
118
0.63208
false
maartenbreddels/ipyvolume
ipyvolume/utils.py
1
9843
from __future__ import print_function import os import io import time import functools import collections import collections.abc import numpy as np import requests import IPython import zmq # https://stackoverflow.com/questions/14267555/find-the-smallest-power-of-2-greater-than-n-in-python def next_power_of_2(x): ...
mit
-3,361,862,247,141,486,600
32.253378
120
0.574215
false
thom-at-redhat/cfme_tests
scripts/template_upload_rhevm.py
1
16744
#!/usr/bin/env python2 """This script takes various parameters specified in cfme_data['template_upload']['template_upload_rhevm'] and/or by command-line arguments. Parameters specified by command-line have higher priority, and override data in cfme_data. This script is designed to run either as a standalone rhevm tem...
gpl-2.0
5,226,702,199,609,717,000
35.242424
96
0.643992
false
TheCamusean/DLRCev3
scripts/Computer_vision_files/pose_estimation.py
1
2128
import numpy as np import cv2 import glob import math as m import time import timeout_decorator as tm def draw(img, corners, imgpts): corner = tuple(corners[0].ravel()) img = cv2.line(img, corner, tuple(imgpts[0].ravel()), (255,0,0), 5) img = cv2.line(img, corner, tuple(imgpts[1].ravel()), (0,255,0), 5) ...
mit
-4,619,761,552,942,554,000
29.4
86
0.629229
false
pauliacomi/pyGAPS
tests/characterisation/test_t_plot.py
1
2958
""" This test module has tests relating to t-plots All functions in /calculations/tplot.py are tested here. The purposes are: - testing the user-facing API function (tplot) - testing individual low level functions against known results. Functions are tested against pre-calculated values on real isotherms. Al...
mit
8,951,880,220,444,265,000
31.505495
76
0.620352
false
Xiol/CVEChecker
old/rhsa.py
1
5144
#!/usr/bin/env python -OO # 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/. # # CVE -> RHSA Report Generator # # Requires Beautiful Soup: http://www.crummy.com/software/Be...
mpl-2.0
-8,972,298,139,212,128,000
40.483871
197
0.648523
false
jszymon/pacal
pacal/examples/central_limit_demo.py
1
2068
#!=============================== #! Demo of central limit theorem #!=============================== from __future__ import print_function import sys from pylab import * from pacal import * from pacal import params import time params.general.warn_on_dependent = False if __name__ == "__main__": colors = "kbgrcmy...
gpl-3.0
-3,555,198,765,811,452,400
26.210526
84
0.436654
false
educloudalliance/eca-auth-data
authdata/tests/test_forms.py
1
2524
# -*- coding: utf-8 -*- # The MIT License (MIT) # # Copyright (c) 2014-2015 Haltu Oy, http://haltu.fi # # 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 withou...
mit
-6,247,756,150,725,642,000
37.242424
94
0.742472
false
anacode/anacode-toolkit
anacode/api/writers.py
1
20217
# -*- coding: utf-8 -*- import os import csv import datetime import pandas as pd from itertools import chain from functools import partial from anacode import codes def backup(root, files): """Backs up `files` from `root` directory and return list of backed up file names. Backed up files will have datetime s...
bsd-3-clause
-7,003,819,235,267,185,000
37.729885
84
0.598012
false
sony/nnabla
python/src/nnabla/backward_function/dropout.py
1
1383
# Copyright 2019,2020,2021 Sony Corporation. # Copyright 2021 Sony Group Corporation. # # 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 # # Un...
apache-2.0
1,812,822,212,141,513,200
32.731707
86
0.702097
false
mosra/m.css
documentation/test_doxygen/test_doxyfile.py
1
6508
# # This file is part of m.css. # # Copyright © 2017, 2018, 2019, 2020 Vladimír Vondruš <mosra@centrum.cz> # # 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, inc...
mit
1,598,037,354,109,257,000
42.34
88
0.627903
false
tBaxter/activity-monitor
activity_monitor/models.py
1
4354
from django.conf import settings from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.functional import cached_property from .managers import ActivityItemManager class Activity(models.Model): """...
mit
5,448,646,263,097,085,000
32.236641
98
0.616904
false
DistributedSystemsGroup/zoe
zoe_master/scheduler/elastic_scheduler.py
1
14941
# Copyright (c) 2017, Daniele Venzano # # 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
-5,541,096,387,478,391,000
41.810888
148
0.581554
false
jonathanslenders/pymux
pymux/pipes/win32_client.py
1
1071
from __future__ import unicode_literals from .win32 import read_message_from_pipe, write_message_to_pipe, connect_to_pipe from ctypes import windll from prompt_toolkit.eventloop import From, Return import six __all__ = [ 'PipeClient', ] class PipeClient(object): r""" Windows pipe client. :param pipe...
bsd-3-clause
-6,415,395,963,983,889,000
25.121951
81
0.615313
false
praba230890/PYPOWER
pypower/t/t_scale_load.py
2
21996
# Copyright (c) 1996-2015 PSERC. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. """Tests for code in C{scale_load}. """ from os.path import dirname, join from numpy import array, zeros, in1d, vstack, flatnonzero as find from pypower.loadcas...
bsd-3-clause
6,540,660,341,247,444,000
55.544987
161
0.496636
false
MangoMangoDevelopment/neptune
lib/ros_comm-1.12.0/tools/rosgraph/test/test_rosenv.py
1
2781
# Software License Agreement (BSD License) # # Copyright (c) 2011, Willow Garage, 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...
bsd-3-clause
-1,259,702,739,431,144,000
35.116883
98
0.705142
false
possnfiffer/py-emde
py-emde-wind-direction.py
1
5361
ndata = [] with open('data/winddir_20160202.dat') as f: for line in f: ndata.append(line.split(" ")) flist = [] for l in ndata: if l[4].endswith('00') or l[4].endswith('15') or l[4].endswith('30') or l[4].endswith('45'): if float(l[-1].strip()) == 0 or float(l[-1].strip()) == 360: f...
bsd-2-clause
7,669,188,134,167,574,000
68.428571
205
0.378601
false
eLvErDe/methlab
pymethlab/updatehelper.py
1
1970
# methlab - A music library application # Copyright (C) 2007 Ingmar K. Steen (iksteen@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...
gpl-2.0
-6,294,964,913,357,571,000
30.774194
82
0.682741
false
sugarsweetrobotics/wasanbon
wasanbon/core/plugins/admin/wsconverter_plugin/host/outport_converter.py
1
2057
import os, sys from common_converter import * _template = """ import yaml, traceback import RTC import OpenRTM_aist _data = $CONSTRUCTOR _port = OpenRTM_aist.OutPort("$NAME", _data) def convert(data, d_list): it = iter(d_list) $CODE print 'converted:', data return data def _sendData(d_list): convert(_dat...
gpl-3.0
-3,378,357,359,583,994,400
26.065789
97
0.628099
false
spmjc/plugin.video.freplay
resources/lib/channels/rmcd.py
1
1233
#-*- coding: utf-8 -*- import urllib2 import re import CommonFunctions common = CommonFunctions from resources.lib import utils from resources.lib import globalvar import json title=['RMC Decouverte'] img=['rmcd'] readyForUse=True url_video_json='https://edge.api.brightcove.com/playback/v1/accounts/%s/vi...
gpl-2.0
8,747,088,300,629,931,000
32.324324
161
0.664234
false
jplana/python-etcd
setup.py
1
1239
from setuptools import setup, find_packages import sys, os here = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(here, 'README.rst')).read() NEWS = open(os.path.join(here, 'NEWS.txt')).read() version = '0.4.5' install_requires = [ 'urllib3>=1.7.1', 'dnspython>=1.13.0' ] test_requires...
mit
6,686,755,014,281,602,000
25.361702
54
0.619048
false
GreenGear5/planet-wars
bots/ml-rfc/ml-rfc.py
1
4276
#!/usr/bin/env python """ Uses the Random Forest classifier """ from api import State, util import random, os from sklearn.externals import joblib DEFAULT_MODEL = os.path.dirname(os.path.realpath(__file__)) + '/model.pkl' class Bot: __max_depth = -1 __randomize = True __model = None def __init__...
mit
-1,888,951,242,847,442,400
27.697987
110
0.58232
false
Flavsditz/projects
eyeTracking/pupil/pupil_src/capture/recorder.py
1
4963
import os, sys import cv2 import atb import numpy as np from plugin import Plugin from time import strftime,localtime,time,gmtime from ctypes import create_string_buffer from git_version import get_tag_commit class Recorder(Plugin): """Capture Recorder""" def __init__(self, session_str, fps, img_shape, shared_...
gpl-2.0
-8,185,987,220,556,389,000
39.024194
137
0.576667
false
li282886931/apistore
server/controllers/novelhandler.py
1
8379
# -*- coding: utf-8 -*- import json import datetime import urllib import hashlib import tornado.gen import tornado.web import tornado.httpclient from controllers.basehandler import BaseHandler from models.novelmodel import NovelModel import utils from utils import json_success, json_failed, cache_error import const ...
gpl-2.0
-1,168,748,543,770,488,600
33.103734
125
0.528045
false
goblinhack/MundusMeus
python/things/rock.py
1
1729
import tp import mm def thing_init(t): return def rock_init(name, short_name, tiles=[]): x = tp.Tp(name) x.set_is_shadow_caster_soft(True) x.set_is_shadow_caster(True) x.set_short_name(short_name) x.set_is_movement_blocking(True) x.set_is_rock(True) x.set_z_depth(mm.Z_DEPTH_ROCK) ...
lgpl-3.0
-4,111,445,784,893,475,000
24.057971
43
0.338924
false
jeremi/couchdbkit
couchdbkit/ext/django/loading.py
1
5298
# -*- coding: utf-8 -*- # # Copyright (c) 2008-2009 Benoit Chesneau <benoitc@e-engura.com> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTW...
isc
7,504,999,183,328,596,000
39.442748
99
0.601737
false
insilichem/ommprotocol
ommprotocol/md.py
1
30554
#!/usr/bin/env python # -*- coding: utf-8 -*- # ommprotocol: A command line application to launch # MD protocols with OpenMM # By Jaime RGP <@jaimergp> """ ommprotocol.md -------------- All the logic that governs the simulation of a MD protocol, stage by stage. A protocol is a chained list of stages, w...
lgpl-3.0
-3,036,808,844,007,292,000
40.233468
114
0.600445
false
tgibson37/tiny-c
cairopy.py
1
2552
import sys import os import cairo import shlex def comment(cmt): cmt = cmt[:-1] #print "in comment: ", cmt def draw(x): global ctx ''' hard way: very long list of if-elif's if x[0] == "moveto": ctx.move_to( int(x[1]), int(x[2]) ) elif x[0] == "lineto": ctx.line_to( int(x[1]), int(x[2]) ) ctx.stroke(...
gpl-3.0
6,053,136,622,952,715,000
20.266667
64
0.574843
false
glenngillen/dotfiles
.vscode/extensions/ms-python.python-2021.5.842923320/pythonFiles/lib/python/debugpy/server/cli.py
1
14441
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See LICENSE in the project root # for license information. from __future__ import absolute_import, division, print_function, unicode_literals import json import os import re import runpy import sys # debugpy.__m...
mit
5,915,127,247,936,287,000
30.234375
89
0.57226
false
nettrom/importance
python/wikiproject/confusion-matrix.py
1
8866
#!/usr/env/python # -*- coding: utf-8 -*- ''' Script to predict articles for an entire WikiProject using its trained model and the entire snapshot dataset. Copyright (c) 2017 Morten Wang Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (t...
mit
8,025,864,012,591,268,000
37.051502
128
0.615385
false
MarkusHackspacher/unknown-horizons
horizons/gui/tabs/residentialtabs.py
1
5161
# ################################################### # Copyright (C) 2008-2017 The Unknown Horizons Team # team@unknown-horizons.org # This file is part of Unknown Horizons. # # Unknown Horizons is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published ...
gpl-2.0
-4,440,255,941,613,164,500
42.737288
100
0.708584
false
davidsminor/gaffer
python/GafferRenderManTest/RenderManShaderTest.py
1
61179
########################################################################## # # Copyright (c) 2013, Image Engine Design 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: # # * Red...
bsd-3-clause
-2,309,061,230,335,838,000
38.419459
166
0.686167
false
iocube/Gimme-JSON-backend
app/fields.py
1
1417
import re import json from marshmallow import fields, ValidationError from bson.objectid import ObjectId class JSONStringField(fields.Field): def _serialize(self, value, attr, obj): return value def _deserialize(self, value, attr, data): try: json.loads(value) return ...
mit
-4,832,808,094,186,189,000
27.918367
89
0.633028
false
hiseh/yinanan
tps/converter/formats.py
1
2208
#!/usr/bin/env python class BaseFormat(object): """ Base format class. Supported formats are: ogg, avi, mkv, webm, flv, mov, mp4, mpeg """ format_name = None ffmpeg_format_name = None def parse_options(self, opt): if 'format' not in opt or opt.get('format') != self.format_name: ...
mit
4,400,064,395,914,517,500
19.635514
72
0.625906
false
JazzeYoung/VeryDeepAutoEncoder
theano/gpuarray/tests/test_basic_ops.py
1
17095
from __future__ import absolute_import, print_function, division import unittest from theano.compat import izip from six import iteritems import numpy import theano import theano.tensor as T from theano.tensor import TensorType from theano.tensor.basic import alloc # Don't import test classes otherwise they get test...
bsd-3-clause
-3,566,938,448,693,773,300
37.243848
89
0.563849
false
draklaw/lair
src/sys_sdl2/sys_sdl2.py
1
2854
#!/usr/bin/env python3 ## ## Copyright (C) 2015 Simon Boyé ## ## This file is part of lair. ## ## lair 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 o...
lgpl-3.0
5,791,961,998,432,265,000
33.792683
95
0.676481
false
muatik/dahi
dahi/document.py
1
1446
from bson import ObjectId from dahi.statement import Statement class InvalidDocument(Exception): pass class Document(object): def __init__(self, docID=None, botSay=None, humanSay=None, onMatch=None): super(Document, self).__init__() self.botSay = botSay self.humanSay = humanSay ...
mit
1,258,744,973,872,936,000
27.352941
77
0.564315
false
saeidadli/Python-ArcGIS-Convertor
arcgdfconvertor/convertor.py
1
3491
import os import sys import tempfile from pathlib import Path import arcpy import pandas as pd import numpy as np import geopandas as gpd #constants #WGS_1984 coordinate system WGS_1984 = \ "GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984', "+\ "SPHEROID['WGS_1984',6378137.0,298.257223563]], "+\ "PRIMEM['Greenwi...
mit
6,099,987,639,100,289,000
25.648855
93
0.613005
false
AravindK95/ee106b
project3/src/lab3/src/extra/grasp_ctrl.py
1
5226
#!/usr/bin/env python import sys import rospkg import rospy import tf import numpy as np from std_msgs.msg import String, Bool from geometry_msgs.msg import Transform, Pose, Vector3, Quaternion, Point from lab3.msg import FrameCall PROJECT_PATH = rospkg.RosPack().get_path('lab3') sys.path.append(PROJECT_PATH+'/src/lab...
mit
895,466,151,847,824,100
31.259259
91
0.539801
false
googleads/google-ads-python
google/ads/googleads/v7/services/services/mobile_device_constant_service/transports/grpc.py
1
10591
# -*- 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
1,221,377,875,632,550,100
40.69685
107
0.608441
false
dcrosta/nymwit
nymwit/game/management/commands/advancegamestate.py
1
2917
# Copyright (c) 2011, Daniel Crosta # 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 and the...
bsd-2-clause
-979,874,457,618,385,700
47.616667
117
0.685293
false
pmleveque/cross-site-navigation
authentification.py
1
1642
from cefbase import * from google.appengine.api import users # Permet de savoir si c'est le bon utilisateur qui cherche a avoir acces aux donnees # Si l'utlisateur a aucun droit, il n'a acces a rien # Si le contributeur est un admin de diocese, il n'a acees qu'a ses barres propres, ses menus propres et les menus pu...
mit
1,967,716,344,745,664,500
42.378378
128
0.588916
false
landlab/drivers
scripts/ecohydrology_flat_surface/run_driver.py
1
4929
""" Created on Wed Jul 20 2016 This tutorial is on: landlab/tutorials/ecohydrology/cellular_automaton_vegetation_flat_surface.ipynb Creating a (.py) version of the same. @author: Sai Nudurupati & Erkan Istanbulluoglu """ import os import time import numpy as np from landlab import RasterModelGrid, load_params fro...
mit
-338,219,367,900,883,300
33.957447
84
0.646379
false
danielnyga/dnutils
src/dnutils/tools.py
1
10478
''' Created on May 22, 2017 @author: nyga ''' import re def ifnone(if_, else_, transform=None): '''Returns the condition ``if_`` iff it is not ``None``, or if a transformation is specified, ``transform(if_)``. Returns ``else_`` if the condition is ``None``. ``transform`` can be any callable, which will b...
mit
-7,107,193,630,464,736,000
29.637427
113
0.550678
false
intellisense/django-loginas
loginas/tests/tests.py
1
11032
# -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function, absolute_import try: from urllib.parse import urlsplit except ImportError: from urlparse import urlsplit from datetime import timedelta from django.conf import settings as django_settings from django.test import Client from djang...
bsd-3-clause
6,606,978,489,041,057,000
39.098182
94
0.659926
false