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
pombredanne/django-avocado
avocado/modeltree.py
1
22222
import inspect from django.db import models from django.db.models import Q from django.core.exceptions import ImproperlyConfigured from avocado.conf import settings __all__ = ('ModelTree',) DEFAULT_MODELTREE_ALIAS = 'default' class ModelTreeNode(object): def __init__(self, model, parent=None, rel_type=None, re...
bsd-3-clause
-7,547,567,735,134,848,000
36.160535
106
0.563451
false
chemiron/aiopool
aiopool/fork.py
1
6082
import asyncio import logging import os import signal from struct import Struct import time from .base import (WorkerProcess, ChildProcess, IDLE_CHECK, IDLE_TIME) MSG_HEAD = 0x0 MSG_PING = 0x1 MSG_PONG = 0x2 MSG_CLOSE = 0x3 PACK_MSG = Struct('!BB').pack UNPACK_MSG = Struct('!BB').unpack logger =...
mit
982,928,408,585,555,200
24.447699
77
0.57366
false
hypebeast/etapi
etapi/utils.py
1
1765
# -*- coding: utf-8 -*- '''Helper utilities and decorators.''' import time from flask import flash def flash_errors(form, category="warning"): '''Flash all errors for a form.''' for field, errors in form.errors.items(): for error in errors: flash("{0} - {1}" .format(get...
bsd-3-clause
-7,001,446,943,259,879,000
24.955882
78
0.549575
false
DBeath/flask-feedrsub
tests/period_test.py
1
1488
from datetime import datetime from dateutil.relativedelta import relativedelta from feedrsub.database import db from feedrsub.models.period import PERIOD, Period from feedrsub.models.populate_db import populate_periods def test_populate_periods(session): populate_periods() daily = Period.query.filter_by(na...
mit
7,589,990,972,609,637,000
27.615385
69
0.715054
false
nigelb/Static-UPnP
examples/Chromecast/StaticUPnP_StaticServices.py
1
3345
# static_upnp responds to upnp search requests with statically configures responses. # Copyright (C) 2016 NigelB # # 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 Licens...
gpl-2.0
871,185,580,901,961,200
31.794118
161
0.676233
false
ponty/MyElectronicProjects
pavement.py
1
1718
from easyprocess import Proc from paver.easy import * import paver.doctools import paver.virtual import paver.misctasks from paved import * from paved.dist import * from paved.util import * from paved.docs import * from paved.pycheck import * from paved.pkg import * options( sphinx=Bunch( docroot='docs', ...
bsd-2-clause
2,015,404,359,761,255,000
25.430769
65
0.360885
false
GoogleCloudPlatform/python-docs-samples
appengine/standard/endpoints-frameworks-v2/quickstart/main_test.py
1
1894
# Copyright 2016 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
-4,486,417,427,585,140,700
34.074074
74
0.712777
false
OSU-CS-325/Project_Two_Coin_Change
run-files/analysisQ7.py
1
2957
import sys import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import random import datetime # Import the three change making algorithms sys.path.insert(0, "../divide-conquer/") sys.path.insert(0, "../dynamic-programming") sys.path.insert(0, "../greedy") from changeslow import changeslow from chan...
mit
992,061,664,401,384,600
26.37963
89
0.631721
false
looker/sentry
tests/sentry/integrations/github/test_issues.py
1
6535
from __future__ import absolute_import import responses from mock import patch from exam import fixture from django.test import RequestFactory from sentry.integrations.github.integration import GitHubIntegration from sentry.models import Integration, ExternalIssue from sentry.testutils import TestCase from sentry.ut...
bsd-3-clause
-1,895,879,553,764,790,500
35.305556
97
0.59847
false
mikedh/trimesh
trimesh/creation.py
1
40606
""" creation.py -------------- Create meshes from primitives, or with operations. """ from .base import Trimesh from .constants import log, tol from .geometry import faces_to_edges, align_vectors, plane_transform from . import util from . import grouping from . import triangles from . import transformations as tf i...
mit
7,771,530,752,950,177,000
30.973228
86
0.580727
false
stormvirux/vturra-cli
vturra/asys.py
1
1936
#!/usr/bin/env python # -*- coding: utf-8 -*- import pandas as pd import numpy as np import matplotlib.pyplot as plt # from scipy import stats # import statsmodels.api as sm # from numpy.random import randn import matplotlib as mpl # import seaborn as sns # sns.set_color_palette("deep", desat=.6) mpl.rc("figure", fig...
mit
5,560,022,484,515,166,000
29.730159
131
0.66064
false
hall1467/wikidata_usage_tracking
wbc_usage/utilities/determine_wikis.py
1
2123
""" Prints all wikis to stdout. Usage: determine_wikis (-h|--help) determine_wikis [--debug] [--verbose] Options: -h, --help This help message is printed --debug Print debug logging to stderr --verbose Print dots ...
mit
7,319,689,185,539,322,000
25.5375
121
0.563354
false
simod/geonode
geonode/layers/views.py
1
58343
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # 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 ...
gpl-3.0
7,374,107,946,159,023,000
37.921281
116
0.550383
false
nboley/grit
grit/simulator/reads_simulator.py
1
21238
""" Copyright (c) 2011-2015 Nathan Boley This file is part of GRIT. GRIT 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. GRIT is distribut...
gpl-3.0
-4,307,114,510,354,580,500
37.33574
88
0.584377
false
Netflix-Skunkworks/iep-apps
atlas-slotting/src/scripts/lift-data.py
1
4221
#!/usr/bin/env python3 # Copyright 2014-2019 Netflix, 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 applicabl...
apache-2.0
-9,102,378,163,587,709,000
34.175
106
0.637764
false
nemonik/CoCreateLite
ccl-cookbook/files/default/cocreatelite/cocreate/views/playgrounds.py
1
5229
from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render, get_object_or_404 from django.core.urlresolvers import reverse from ..models import VMPlayground from ..forms import VMPlaygroundForm, VMPlaygroundDescriptionForm, VMPlaygroundUserAccessForm, VMPlaygroundGroupAccessForm fr...
bsd-3-clause
5,452,664,651,074,782,000
32.954545
199
0.643526
false
roscopecoltran/scraper
.staging/meta-engines/xlinkBook/update/spider.py
1
7851
#!/usr/bin/env python #author: wowdd1 #mail: developergf@gmail.com #data: 2014.12.09 import requests import json from bs4 import BeautifulSoup; import os,sys import time import re from all_subject import subject_dict, need_update_subject_list reload(sys) sys.setdefaultencoding("utf-8") sys.path.append("....
mit
-5,365,539,054,781,821,000
34.524887
162
0.515858
false
MuckRock/muckrock
muckrock/organization/tests/test_models.py
1
8505
""" Tests the models of the organization application """ # Django from django.test import TestCase # Standard Library from datetime import date # Third Party from nose.tools import assert_false, assert_raises, assert_true, eq_ # MuckRock from muckrock.core.factories import UserFactory from muckrock.foia.exceptions ...
agpl-3.0
-5,786,665,629,773,698,000
31.965116
75
0.554968
false
Grokzen/redisco
redisco/containers.py
1
34087
# -*- coding: utf-8 -*- # doctest: +ELLIPSIS import collections from . import default_expire_time def _parse_values(values): (_values,) = values if len(values) == 1 else (None,) if _values and type(_values) == type([]): return _values return values class Container(object): """ Base clas...
mit
7,334,591,816,882,946,000
25.160399
117
0.503476
false
FirmlyReality/docklet
web/webViews/cluster.py
2
15450
from flask import session, redirect, request from webViews.view import normalView from webViews.dockletrequest import dockletRequest from webViews.dashboard import * from webViews.checkname import checkname import time, re class addClusterView(normalView): template_path = "addCluster.html" @classmethod de...
bsd-3-clause
-8,347,585,795,301,260,000
32.660131
229
0.57288
false
codeforamerica/westsac-urban-land-locator
farmsList/public/views.py
1
5434
# -*- coding: utf-8 -*- '''Public section, including homepage and signup.''' from flask import (Blueprint, request, render_template, flash, url_for, redirect, session) from flask_mail import Message from flask.ext.login import login_user, login_required, logout_user from farmsList.extensions import...
bsd-3-clause
-4,999,825,131,017,609,000
42.822581
169
0.573979
false
basicthinker/Sexain-MemController
gem5-stable/src/mem/SimpleMemory.py
1
3222
# Copyright (c) 2012-2013 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functiona...
apache-2.0
5,142,405,133,285,989,000
50.967742
78
0.753569
false
ubc/compair
alembic/versions/316f3b73962c_modified_criteria_tables.py
1
2136
"""modified criteria tables Revision ID: 316f3b73962c Revises: 2fe3d8183c34 Create Date: 2014-09-10 15:42:55.963855 """ # revision identifiers, used by Alembic. revision = '316f3b73962c' down_revision = '2fe3d8183c34' import logging from alembic import op import sqlalchemy as sa from sqlalchemy import UniqueConstra...
gpl-3.0
-3,058,094,704,712,623,600
40.882353
113
0.684925
false
BT-jmichaud/l10n-switzerland
l10n_ch_payment_slip/tests/test_payment_slip.py
1
9506
# -*- coding: utf-8 -*- # © 2014-2016 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import time import re import odoo.tests.common as test_common from odoo.report import render_report class TestPaymentSlip(test_common.TransactionCase): _compile_get_ref = re.compile(r'[^0-9]') ...
agpl-3.0
7,121,606,143,357,714,000
35.417625
79
0.523935
false
ncphillips/django_rpg
rpg_base/models/encounter.py
1
1907
from django.db import models class EncounterManager(models.Manager): def enemy_npcs(self): pass def friendly_npcs(self): pass def players(self): return super(EncounterManager, self).get_queryset().filter(character__player_owned=True) class Encounter(models.Model): name = mo...
mit
-1,455,354,487,229,714,200
27.477612
96
0.598846
false
dbbhattacharya/kitsune
kitsune/search/tests/test_json.py
1
2106
from nose.tools import eq_ from kitsune.search.tests.test_es import ElasticTestCase from kitsune.sumo.urlresolvers import reverse from kitsune.sumo.tests import LocalizingClient class JSONTest(ElasticTestCase): client_class = LocalizingClient def test_json_format(self): """JSON without callback shou...
bsd-3-clause
2,101,940,854,229,355,800
32.428571
69
0.501899
false
SymbiFlow/edalize
edalize/trellis.py
1
3499
# Copyright edalize contributors # Licensed under the 2-Clause BSD License, see LICENSE for details. # SPDX-License-Identifier: BSD-2-Clause import os.path from edalize.edatool import Edatool from edalize.yosys import Yosys from importlib import import_module class Trellis(Edatool): argtypes = ['vlogdefine', 'v...
bsd-2-clause
4,870,784,944,533,456,000
40.164706
168
0.497285
false
markiskander/biomaj
biomaj/user.py
1
7346
from builtins import str from builtins import object import bcrypt import logging from biomaj.mongo_connector import MongoConnector from biomaj.config import BiomajConfig class BmajUser(object): ''' Biomaj User ''' def __init__(self, user): if MongoConnector.db is None: MongoConn...
agpl-3.0
3,449,686,806,786,648,600
39.142077
191
0.498366
false
dietrichc/streamline-ppc-reports
examples/dfp/v201405/creative_service/get_creatives_by_statement.py
1
2307
#!/usr/bin/python # # Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
apache-2.0
8,719,420,815,159,008,000
31.041667
77
0.691374
false
sssundar/Drone
rotation/viz.py
1
5332
# Python script to visualize rotation about a non-body axis. # Let the lab frame be the inertial frame S. # Let the origin of the rigid body be O, in the inertial frame S'. # Let r_ss' be the vector from S to S'. # Let the body frame relative to O be S''. # Consider a fixed point on the body, r_s' in S', and r_s'' in...
gpl-3.0
8,605,246,386,922,294,000
29.295455
126
0.597524
false
mozilla/normandy
normandy/recipes/tests/test_checks.py
1
4355
from datetime import timedelta from django.db.utils import ProgrammingError import pytest import requests.exceptions from normandy.recipes import checks, signing from normandy.recipes.tests import ActionFactory, RecipeFactory, SignatureFactory, UserFactory @pytest.mark.django_db class TestSignaturesUseGoodCertific...
mpl-2.0
-1,509,006,960,226,237,200
44.842105
94
0.7031
false
Dwii/Master-Thesis
implementation/Palabos/cavity_benchmark/plot_benchmark.py
1
1854
# Display a list of *.dat files in a bar chart. # Based on an example from https://chrisalbon.com/python/matplotlib_grouped_bar_plot.html import sys import os import matplotlib.pyplot as plt import numpy as np if len(sys.argv) > 3 and (len(sys.argv)-3) % 2 : print("usage: python3 {0} <benchmark> <image path> (<da...
mit
-7,959,568,732,201,215,000
26.279412
156
0.641855
false
AxelTLarsson/robot-localisation
robot_localisation/main.py
1
6009
""" This module contains the logic to run the simulation. """ import sys import os import argparse import numpy as np sys.path.append(os.path.join(os.path.dirname(__file__), '..')) from robot_localisation.grid import Grid, build_transition_matrix from robot_localisation.robot import Robot, Sensor from robot_localisatio...
mit
1,122,709,431,503,210,400
33.337143
82
0.564487
false
confpack/confpacker
libconfpacker/packagers/base/__init__.py
1
4696
from __future__ import absolute_import from datetime import datetime import logging import os import os.path import subprocess import yaml from cpcommon import cd from .task import Task class Package(object): def src_path(self, *path): return os.path.join(self.src_directory, *path) def __init__(self, nam...
apache-2.0
-5,239,246,716,933,589,000
30.945578
120
0.672487
false
nonbeing/simplemonitor
Alerters/slack.py
1
5883
try: import requests requests_available = True except: requests_available = False from alerter import Alerter from pytz import timezone import pytz class SlackAlerter(Alerter): """Send alerts to a Slack webhook.""" def __init__(self, config_options): if not requests_available: ...
bsd-3-clause
622,996,994,956,758,800
35.76875
253
0.496345
false
chromium/chromium
third_party/android_deps/libs/com_google_errorprone_error_prone_annotation/3pp/fetch.py
5
1396
#!/usr/bin/env python # Copyright 2021 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # This is generated, do not edit. Update BuildConfigGenerator.groovy and # 3ppFetch.template instead. from __future__ import print_fun...
bsd-3-clause
6,280,813,716,697,671,000
23.928571
134
0.648997
false
TheCoSMoCompany/biopredyn
Prototype/src/libsbml-5.10.0/src/bindings/python/test/sbml/TestSBMLDocument.py
1
6600
# # @file TestSBMLDocument.py # @brief SBMLDocument unit tests # # @author Akiya Jouraku (Python conversion) # @author Ben Bornstein # # ====== WARNING ===== WARNING ===== WARNING ===== WARNING ===== WARNING ====== # # DO NOT EDIT THIS FILE. # # This file was generated automatically by converting the file loca...
bsd-3-clause
4,618,646,915,356,372,000
34.106383
79
0.630909
false
mclaughlin6464/pearce
bin/optimization/sloppy_joes_optimization_indiv_bins.py
1
1573
from pearce.emulator import OriginalRecipe, ExtraCrispy, SpicyBuffalo, LemonPepperWet from pearce.mocks import cat_dict import numpy as np from os import path from SloppyJoes import lazy_wrapper training_file = '/scratch/users/swmclau2/xi_zheng07_cosmo_lowmsat/PearceRedMagicXiCosmoFixedNd.hdf5' em_method = 'gp' fixed_...
mit
905,506,763,249,726,100
33.195652
100
0.664336
false
Alexanderkorn/Automatisation
oude scripts/Self/IFScraper.py
1
2199
__author__ = 'alexander' import urllib2 import os from lib import pyperclip def PageScrape(pageurl): hdr= {'Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.3...
gpl-3.0
-8,366,557,063,171,999,000
36.271186
135
0.554343
false
appleseedhq/gaffer
python/GafferSceneUI/__init__.py
1
4899
########################################################################## # # Copyright (c) 2012, John Haddon. All rights reserved. # Copyright (c) 2012-2016, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided ...
bsd-3-clause
-1,929,994,207,123,996,000
28.871951
91
0.812207
false
jdumas/autobib
pdftitle.py
1
14035
#!/usr/bin/env python2.7 # https://gist.github.com/nevesnunes/84b2eb7a2cf63cdecd170c139327f0d6 """ Extract title from PDF file. Dependencies: pip install --user unidecode pyPDF PDFMiner Usage: find . -name "*.pdf" | xargs -I{} pdftitle -d tmp --rename {} Limitations: - No processing of CID keyed fonts. ...
gpl-3.0
4,369,930,326,702,331,000
34.441919
231
0.591307
false
yaybu/touchdown
touchdown/provisioner/fuselage.py
1
4827
# Copyright 2015 Isotoma Limited # # 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...
apache-2.0
-1,469,942,013,499,236,900
30.966887
83
0.645743
false
yukisakurai/hhana
mva/plotting/utils.py
1
4190
import ROOT from itertools import izip from matplotlib import cm from rootpy.plotting.style.atlas.labels import ATLAS_label from rootpy.memory.keepalive import keepalive from .. import ATLAS_LABEL def set_colors(hists, colors='jet'): if isinstance(colors, basestring): colors = cm.get_cmap(colors, len(hist...
gpl-3.0
7,927,911,205,312,527,000
30.742424
74
0.548449
false
O-T-L/PyOptimization
parameters/optimizer/epsilon_moea.py
1
4120
""" Copyright (C) 2014, 申瑞珉 (Ruimin Shen) This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed i...
lgpl-3.0
-8,347,849,438,186,841,000
29.932331
76
0.495139
false
tulsawebdevs/django-multi-gtfs
multigtfs/models/trip.py
1
4025
# # Copyright 2012-2014 John Whitlock # # 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 writ...
apache-2.0
-85,679,634,461,076,020
36.268519
74
0.623354
false
napalm-automation/napalm-yang
napalm_yang/models/openconfig/system/ntp/ntp_keys/ntp_key/state/__init__.py
1
14103
# -*- coding: utf-8 -*- from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListTy...
apache-2.0
1,886,888,537,890,216,700
38.615169
621
0.546054
false
taotaocoule/stock
spider/data/bond.py
1
1159
# 国债指数:id=0000121;http://pdfm2.eastmoney.com/EM_UBG_PDTI_Fast/api/js?id=0000121&TYPE=k&js=(x)&rtntype=5&isCR=false&fsData1518154947301=fsData1518154947301 # 沪市企业: id=0000131;http://pdfm2.eastmoney.com/EM_UBG_PDTI_Fast/api/js?id=0000131&TYPE=k&js=(x)&rtntype=5&isCR=false&fsData1518156740923=fsData1518156740923 # 深圳企业:...
mit
-7,352,327,051,511,593,000
46.5
155
0.707981
false
googleapis/googleapis-gen
grafeas/v1/grafeas-v1-py/tests/unit/gapic/grafeas_v1/test_grafeas.py
1
180629
# -*- 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
-8,733,633,512,157,647,000
35.468605
214
0.640257
false
skatsuta/aerospike-training
book/exercise/Key-valueOperations/Python/Program.py
1
8944
#!/usr/bin/env python # # * Copyright 2012-2014 by Aerospike. # * # * 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...
mit
-1,456,257,365,734,570,800
42.629268
172
0.55814
false
xianian/qt-creator
share/qtcreator/debugger/gdbbridge.py
1
64687
try: import __builtin__ except: import builtins try: import gdb except: pass import os import os.path import sys import struct import types def warn(message): print("XXX: %s\n" % message.encode("latin1")) from dumper import * ####################################################################...
lgpl-2.1
4,238,433,531,481,384,400
34.328782
105
0.519471
false
ClearCorp/server-tools
external_file_location/models/task.py
1
8567
# coding: utf-8 # @ 2015 Valentin CHEMIERE @ Akretion # © @author Mourad EL HADJ MIMOUNE <mourad.elhadj.mimoune@akretion.com> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import models, fields, api import openerp from openerp import tools from base64 import b64encode import os imp...
agpl-3.0
3,746,848,047,542,242,000
39.40566
79
0.494747
false
maruina/kanedias
aws/load_config.py
1
2747
import os import sys from boto.pyami.config import Config from fabric.colors import red # Load the configuration file if os.path.exists('config.ini'): boto_config = Config() boto_config.load_credential_file('config.ini') if boto_config.items('Credentials'): AWS_ID = boto_config.get('Credentials', '...
mit
-3,950,142,547,903,683,600
30.215909
92
0.552967
false
chrisxue815/leetcode_python
problems/test_0407.py
1
2180
import heapq import unittest class Solution: def trapRainWater(self, heightMap): """ :type heightMap: List[List[int]] :rtype: int """ if not heightMap: return 0 res = 0 height = len(heightMap) width = len(heightMap[0]) visited = ...
unlicense
5,613,371,172,959,575,000
27.684211
84
0.441743
false
eldstal/cardcinogen
card.py
1
2572
#!/bin/env python3 import unittest import os import sys import util import log from PIL import Image from layout import SimpleLayout, ComplexLayout class CardTemplate: """ Parsed version of a JSON card template """ def __init__(self, json, rootdir="."): self.front_name = util.get_default(json, "front-im...
mit
445,096,269,937,110,460
26.073684
91
0.630638
false
dpaiton/OpenPV
pv-core/python/pvtools/writepvpfile.py
1
10534
import numpy as np import scipy.sparse as sp import pdb from readpvpheader import headerPattern, extendedHeaderPattern def checkData(data): #Check if dictionary if not isinstance(data, dict): raise ValueError("Input data structure must be a dictionary with the keys \"values\" and \"time\"") #Check...
epl-1.0
6,473,318,771,748,574,000
43.447257
150
0.57566
false
thinkAmi-sandbox/Bottle-sample
e.g._bbs_app/bbs.py
1
1890
import datetime import pickle from pathlib import Path from bottle import Bottle, run, get, post, redirect, request, response, jinja2_template class Message(object): def __init__(self, title, handle, message): self.title = title self.handle = handle self.message = message self.crea...
unlicense
-4,043,259,285,766,576,000
27.8
87
0.653735
false
capitalone/cloud-custodian
tools/c7n_azure/c7n_azure/provisioning/deployment_unit.py
1
1645
import logging from abc import ABCMeta, abstractmethod from c7n.utils import local_session from c7n_azure.session import Session class DeploymentUnit(metaclass=ABCMeta): log = logging.getLogger('custodian.azure.deployment_unit.DeploymentUnit') def __init__(self, client): self.type = "" ...
apache-2.0
-3,710,982,216,230,997,000
30.254902
89
0.579331
false
iYgnohZ/crack-geetest
geetest/geetest.py
1
4035
# -*- coding: utf-8 -*- import time import uuid import StringIO from PIL import Image from selenium.webdriver.common.action_chains import ActionChains class BaseGeetestCrack(object): """验证码破解基础类""" def __init__(self, driver): self.driver = driver self.driver.maximize_window() def inpu...
mit
1,481,177,789,686,042,400
25.435714
105
0.543367
false
j5shi/Thruster
pylibs/idlelib/IdleHistory.py
1
4239
"Implement Idle Shell history mechanism with History class" from idlelib.configHandler import idleConf class History: ''' Implement Idle Shell history mechanism. store - Store source statement (called from PyShell.resetoutput). fetch - Fetch stored statement matching prefix already entered. ...
gpl-2.0
6,686,773,657,945,853,000
37.990566
80
0.548714
false
Youwotma/splash
splash/kernel/kernel.py
1
9476
# -*- coding: utf-8 -*- from __future__ import absolute_import import os import six import sys import lupa from ipykernel.kernelapp import IPKernelApp from ipykernel.eventloops import loop_qt5 from jupyter_client.kernelspec import install_kernel_spec from twisted.internet import defer import splash from splash.lua im...
bsd-3-clause
2,472,990,847,262,979,600
32.249123
109
0.577353
false
cmclaughlin/cabot
setup.py
1
1818
#!/usr/bin/env python from setuptools import setup, find_packages from os import environ as env # pull in active plugins plugins = env['CABOT_PLUGINS_ENABLED'].split(',') if 'CABOT_PLUGINS_ENABLED' in env else ["cabot_alert_hipchat", "cabot_alert_twilio", "cabot_alert_email"] setup( name='cabot', version='0.0...
mit
-5,933,584,139,439,844,000
28.803279
155
0.528603
false
smARTLab-liv/smartlabatwork-release
slaw_smach/src/slaw_smach/slaw_smach.py
1
11996
#!/usr/bin/env python import rospy from ArmStates import * from MoveStates import * from ObjectDetectState import * from DecisionStates import * from std_srvs.srv import Empty, EmptyResponse from std_msgs.msg import Bool ## TODO after Eindhoven: Add failsafe if hole not detected ## add states if object too far or too...
mit
-3,893,603,533,906,580,000
68.744186
321
0.635128
false
mtrdesign/pylogwatch
pylogwatch/logwlib.py
1
5917
# Python 2.5 compatibility from __future__ import with_statement # Python version import sys if sys.version_info < (2, 5): raise "Required python 2.5 or greater" import os, sqlite3, itertools, time from datetime import datetime PROJECT_DIR = os.path.abspath(os.path.dirname(__file__)) proj_path = lambda x: os.pat...
gpl-3.0
-7,848,765,276,239,736,000
36.449367
132
0.564982
false
googlemaps/google-maps-services-python
googlemaps/convert.py
1
10197
# # Copyright 2014 Google Inc. All rights reserved. # # # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy of # the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
apache-2.0
7,628,449,255,522,140,000
25.417098
109
0.5939
false
mo-ki/pypgpwords
pypgpwords.py
1
13257
#!/usr/bin/python3 """Define a PGPWords object inherited from bytearray. Adding initialization via hex-, or pgp-word-string, adding .hex() method and overriding __str__ Mainline code: Convert pgp words to hex strings and vice versa. Example: $ pypgpwords.py DEAD 1337 tactics perceptive Aztec consensus or $ ...
mit
-7,093,815,584,150,289,000
19.746479
78
0.45063
false
petezybrick/iote2e
iote2e-pyclient/src/iote2epyclient/test/testhatsensors.py
1
3137
# Copyright 2016, 2017 Peter Zybrick and others. # # 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 ag...
apache-2.0
3,881,030,705,390,971,000
27.008929
101
0.620019
false
tensorflow/ngraph-bridge
test/python/test_fusedConv2D.py
1
5531
# ============================================================================== # Copyright 2018-2020 Intel 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://ww...
apache-2.0
-2,680,302,436,829,461,500
36.371622
80
0.540047
false
Goyatuzo/Challenges
HackerRank/Algorithms/Sorting/Insertion Sort Part 1/insertion_sort_p1.py
1
1113
def insertion_sort(lst): """Instead of just inserting the value where it should be at, it shifts the entire array until the location is found. It prints out all the intermediate steps, but the final step is actually just returned, so the output must be manually printed. :param lst: The list of value...
mit
3,846,452,538,363,552,000
29.916667
71
0.562444
false
Loisel/tmr3
tmr.py
1
15096
#!/usr/bin/python """ A module to calculate the current, the conductance and the TMR from a set of rate arrays. The rate arrays are supposed to be stored in a h5 file in the job directory. The result is stored in a h5 file. The name of the dataset contains all parameters. They are also stored as attributes in the datas...
gpl-3.0
38,346,425,765,791,370
32.105263
402
0.610029
false
ict-felix/stack
vt_manager_kvm/src/python/vt_manager_kvm/controller/dispatchers/ui/GUIdispatcher.py
1
17272
from django.core.urlresolvers import reverse from django.forms.models import modelformset_factory from django.shortcuts import get_object_or_404 from django.http import HttpResponseRedirect, HttpResponse from django.views.generic import simple from django.views.generic import list_detail, simple from django.views.gener...
apache-2.0
-5,939,845,024,590,403,000
29.898032
189
0.721688
false
edx-solutions/discussion-edx-platform-extensions
social_engagement/engagement.py
1
14753
""" Business logic tier regarding social engagement scores """ import logging import sys from collections import defaultdict from datetime import datetime import pytz from django.conf import settings from django.db.models.signals import post_save, pre_save from django.dispatch import receiver from django.http import ...
agpl-3.0
-3,449,035,946,806,721,000
35.790524
122
0.638582
false
egnyte/gitlabform
gitlabform/gitlabform/test/test_group_shared_with.py
1
5232
import pytest from gitlabform.gitlabform.test import ( run_gitlabform, ) @pytest.fixture(scope="function") def one_owner(gitlab, group, groups, users): gitlab.add_member_to_group(group, users[0], 50) gitlab.remove_member_from_group(group, "root") yield group # we are running tests with root's ...
mit
-4,561,875,075,274,683,400
30.518072
81
0.546445
false
arkanister/minitickets
lib/utils/html/templatetags/icons.py
1
2009
# -*- coding: utf-8 -*- from django import template from django.template import TemplateSyntaxError, Node from ..icons.base import Icon from ..tags import token_kwargs, resolve_kwargs register = template.Library() class IconNode(Node): def __init__(self, _icon, kwargs=None): super(IconNode, self).__in...
apache-2.0
8,514,085,994,507,164,000
29.923077
110
0.610254
false
isaacbernat/awis
setup.py
1
1887
from setuptools import setup, find_packages # from codecs import open # from os import path # here = path.abspath(path.dirname(__file__)) # # Get the long description from the README file # with open(path.join(here, 'README.rst'), encoding='utf-8') as f: # long_description = f.read() setup( # Application nam...
gpl-3.0
-1,147,754,553,041,353,200
27.590909
77
0.608903
false
BeeeOn/server
t/gws/t1006-sensor-data-export.py
1
4343
#! /usr/bin/env python3 import config config.import_libs() import unittest import websocket import json import time import uuid from gws import assureIsClosed, assureNotClosed, registerGateway, ZMQConnection class TestSensorData(unittest.TestCase): def setUp(self): self.zmq = ZMQConnection(config.gws_zmq_endpoin...
bsd-3-clause
-1,322,154,437,284,042,500
22.603261
79
0.596822
false
google-research/google-research
kws_streaming/models/lstm.py
1
3941
# coding=utf-8 # Copyright 2021 The Google Research 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 applicab...
apache-2.0
9,010,055,643,208,554,000
30.031496
78
0.678508
false
Hybrid-Cloud/conveyor
conveyor/tests/unit/clone/drivers/openstack/test_driver.py
1
5751
# Copyright 2016 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 a...
apache-2.0
7,160,822,864,810,321,000
43.929688
78
0.657799
false
fake-name/ReadableWebProxy
WebMirror/management/GravityTalesManage.py
1
1202
import calendar import datetime import json import os import os.path import shutil import traceback from concurrent.futures import ThreadPoolExecutor import urllib.error import urllib.parse from sqlalchemy import and_ from sqlalchemy import or_ import sqlalchemy.exc from sqlalchemy_continuum_vendored.utils import ve...
bsd-3-clause
2,929,935,509,704,662,000
21.259259
82
0.75624
false
McIntyre-Lab/papers
newman_t1d_cases_2017/scripts/bwa_sam_parse.py
1
2304
#!/usr/bin/env python import argparse ## This script parses a sam file from BWA-MEM and outputs a log of alignment counts and percentages. # Parse command line arguments parser = argparse.ArgumentParser(description='Parse sam file to get alignment counts.') parser.add_argument('-sam','--sam_file',dest='sam', action='...
lgpl-3.0
-7,280,314,419,809,801,000
52.581395
338
0.680122
false
Alignak-monitoring-contrib/alignak-app
test/test_panel_widget.py
1
9176
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015-2018: # Matthieu Estrada, ttamalfor@gmail.com # # This file is part of (AlignakApp). # # (AlignakApp) 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 Sof...
agpl-3.0
-1,336,474,038,663,556,400
35.125984
96
0.612249
false
golharam/rgtools
scripts/galaxy/api/addFilesToLibrary.py
1
4458
#!/usr/bin/env python """ Author: Ryan Golhar <ryan.golhar@bms.com> Date: 06/24/15 This script adds readme.txt, *.fastq.gz to a Galaxy Library Usage: addFilesToLibrary [-h] [--api-key <API_KEY>] [--api-url <API_URL>] <path of directory to scan> <library_name> """ import ConfigParser import os import argparse import s...
lgpl-3.0
-6,479,788,889,856,856,000
38.451327
174
0.61799
false
sbg/sevenbridges-python
sevenbridges/meta/collection.py
1
4097
from sevenbridges.errors import PaginationError, SbgError from sevenbridges.models.compound.volumes.volume_object import VolumeObject from sevenbridges.models.compound.volumes.volume_prefix import VolumePrefix from sevenbridges.models.link import Link, VolumeLink class Collection(list): """ Wrapper for SevenB...
apache-2.0
-4,023,204,058,258,332,700
30.037879
77
0.547962
false
RNAcentral/rnacentral-webcode
rnacentral/portal/management/commands/update_example_locations.py
1
4551
""" Copyright [2009-2017] EMBL-European Bioinformatics Institute Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
apache-2.0
-2,314,792,031,606,948,400
27.622642
105
0.5735
false
mikelum/pyspeckit
pyspeckit/spectrum/readers/read_class.py
1
67070
""" ------------------------ GILDAS CLASS file reader ------------------------ Read a CLASS file into an :class:`pyspeckit.spectrum.ObsBlock` """ from __future__ import print_function from astropy.extern.six.moves import xrange from astropy.extern.six import iteritems try: import astropy.io.fits as pyfits except I...
mit
-4,625,620,523,675,145,000
41.584127
220
0.516267
false
xbuf/blender_io_xbuf
protocol.py
1
4603
# This file is part of blender_io_xbuf. blender_io_xbuf 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 distributed in the hope that it will be useful, but WITHOUT # ANY WARRANT...
gpl-3.0
-6,606,697,315,505,430,000
30.101351
120
0.669781
false
ModulousSmash/Modulous
KerbalStuff/blueprints/mods.py
1
19423
from flask import Blueprint, render_template, request, g, Response, redirect, session, abort, send_file, make_response, url_for from flask.ext.login import current_user from sqlalchemy import desc from KerbalStuff.objects import User, Mod, ModVersion, DownloadEvent, FollowEvent, ReferralEvent, Featured, Media, GameVers...
mit
-6,892,305,928,326,822,000
35.855787
155
0.615713
false
samstern/Greengraph
Greengraph/tests/test_maps.py
1
2937
from ..greengraph import Greengraph from ..map import Map import geopy from nose.tools import assert_equal, assert_almost_equal import numpy.testing as np_test from mock import Mock, patch import requests from matplotlib import image import yaml import os import numpy as np #@patch.object(Greengraph, 'location_sequen...
mit
2,774,564,202,367,730,000
43.515152
106
0.58461
false
ratschlab/RNA-geeq
SAFT/find_optimal_param_set.py
1
11493
""" This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. Written (W) 2095-2010 Andre Kahles Copyright (C) 2009-2010 by...
mit
5,016,354,970,529,404,000
37.69697
225
0.560515
false
intel-ctrlsys/actsys
datastore/datastore/database_schema/schema_migration/versions/d43655797899_changing_table_name_from_group_to_.py
1
2060
"""Changing table name from 'group' to 'device_group' Revision ID: d43655797899 Revises: 38f3c80e9932 Create Date: 2017-08-24 15:17:10.671537 """ import textwrap from alembic import op # revision identifiers, used by Alembic. revision = 'd43655797899' down_revision = '38f3c80e9932' branch_labels = None depends_on =...
apache-2.0
-1,239,599,158,944,896,800
33.333333
123
0.571845
false
NYU-DevOps-S17/Orders
tests/test_server.py
1
6572
# Test cases can be run with either of the following: # python -m unittest discover # nosetests -v --rednose --nologcapture import unittest import logging import json from app import server # Status Codes HTTP_200_OK = 200 HTTP_201_CREATED = 201 HTTP_204_NO_CONTENT = 204 HTTP_400_BAD_REQUEST = 400 HTTP_404_NOT_FOUND ...
apache-2.0
801,794,700,130,095,400
39.319018
84
0.585514
false
jorik041/stackprinter
app/lib/deliciousapi.py
2
50450
""" Unofficial Python API for retrieving data from Delicious.com. This module provides the following features plus some more: * retrieving a URL's full public bookmarking history including * users who bookmarked the URL including tags used for such bookmarks and the creation time of the ...
bsd-3-clause
3,970,781,760,770,663,400
39.263368
225
0.565451
false
hugobranquinho/ines
ines/__init__.py
1
1198
# -*- coding: utf-8 -*- import datetime import errno from os import getpid, linesep, uname from os.path import join as os_join import sys from tempfile import gettempdir from time import time as _now_time APPLICATIONS = {} CAMELCASE_UPPER_WORDS = {'CSV'} MARKER = object() API_CONFIGURATION_EXTENSIONS = {} DEFAULT_R...
mit
6,989,389,053,462,082,000
23.958333
75
0.69616
false
Dwolla/arbalest
examples/s3_json_object_to_redshift.py
1
2379
#!/usr/bin/env python import psycopg2 from arbalest.configuration import env from arbalest.redshift import S3CopyPipeline from arbalest.redshift.schema import JsonObject, Property """ **Example: Bulk copy JSON objects from S3 bucket to Redshift table** Arbalest orchestrates data loading using pipelines. Each `Pipelin...
mit
2,963,051,004,563,553,000
38.65
82
0.599412
false
hlmnrmr/superdesk-core
superdesk/tests/steps.py
1
91099
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license import os i...
agpl-3.0
-117,397,680,062,153,810
38.317652
120
0.64768
false
ESS-LLP/erpnext-healthcare
erpnext/hr/doctype/payroll_entry/payroll_entry.py
1
20575
# -*- coding: utf-8 -*- # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document from dateutil.relativedelta import relativedelta from frappe.utils import cint,...
gpl-3.0
4,264,990,217,364,493,000
35.675579
154
0.693026
false
alvin777/excelsior
sort/benchmark.py
1
2909
#!/usr/bin/python import time from simple_sorts import * from shell_sort import * from quick_sort import * from external_merge_sort import * from radix_sort import * from merge_sort import * from heap_sort import * from intro_sort import * from timsort import * from list_generators import * result = {} def run_un...
gpl-2.0
-2,014,888,064,060,402,700
34.487805
111
0.584393
false
amitdhiman000/MyOffers
myadmin/views.py
1
7396
from myadmin.backenddb import (insert_default_areas, insert_custom_areas, insert_default_categories) from offer.models import CategoryModel from locus.models import (CountryModel ,StateModel, CityModel, AreaModel) from mail.models import (PublicMessageModel) from myadmin.preload_data import (gCountries, gCategories) f...
apache-2.0
-4,578,698,669,415,442,000
32.165919
111
0.636966
false
uqyge/combustionML
FPV_ANN_pureResNet/data_reader_2.py
1
5981
import numpy as np import pandas as pd from sklearn.preprocessing import MinMaxScaler, StandardScaler class data_scaler(object): def __init__(self): self.norm = None self.norm_1 = None self.std = None self.case = None self.scale = 1 self.bias = 1e-20 # ...
mit
5,411,136,813,735,696,000
33.578035
75
0.546397
false
BaluDontu/docker-volume-vsphere
esx_service/vsan_policy_test.py
1
2572
# Copyright 2016 VMware, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
6,275,258,985,350,038,000
33.756757
78
0.661353
false
informatik-mannheim/Moduro-CC3D
Simulation/Logger/ArrangementFitnessSteppable.py
1
5298
# Copyright 2016 the original author or authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
apache-2.0
-6,240,534,123,263,231,000
45.473684
134
0.503398
false