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
Nefry/taurus
tests/mocks.py
1
5148
""" test """ import logging import os import tempfile import sys import random from bzt.engine import Engine, Configuration, FileLister from bzt.utils import load_class from bzt.engine import Provisioning, ScenarioExecutor, Reporter, AggregatorListener from bzt.modules.aggregator import ResultsReader from tests import...
apache-2.0
3,385,400,502,487,022,600
25.536082
104
0.566822
false
pklaus/python-inwx-xmlrpc
example.dyndns.py
1
2738
#!/usr/bin/env python2.7 # -*- encoding: UTF8 -*- # author: Philipp Klaus, philipp.klaus →AT→ gmail.com # author: Markus Roth, mail →AT→ rothmark.us # This file is part of python-inwx-xmlrpc. # # python-inwx-xmlrpc is free software: you can redistribute it and/or modify # it under the terms of the GNU General Publi...
gpl-3.0
1,844,439,016,193,785,900
39.147059
120
0.660073
false
rosenvladimirov/addons
account_asset_management_bg_v3/models/account_asset.py
1
51255
# -*- coding: utf-8 -*- # Copyright 2009-2017 Noviat # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import calendar from datetime import datetime from dateutil.relativedelta import relativedelta import logging from sys import exc_info from traceback import format_exception from openerp import api, fi...
agpl-3.0
-6,084,505,130,521,618,000
42.107653
122
0.529802
false
TNick/pyl2extra
pyl2extra/scripts/show_weights.py
1
2406
#!/usr/bin/env python # -*- coding: utf-8 -*- """ The application allows you to show the weights of a class that inherits from pylearn2's Model. To start, goto File > Open pickled model... and select the file that has your saved mode. Loading might take a while and the window will look frozen while loading. Once the ...
bsd-3-clause
2,361,575,124,443,841,500
24.595745
70
0.702826
false
Compositional/orders-aws
test/container.py
1
4871
import argparse import sys import unittest import os from util.Api import Api from time import sleep from util.Docker import Docker from util.Dredd import Dredd class ServiceMock: container_name = '' hostname = '' def start_container(self): command = ['docker', 'run', '-d', '--...
apache-2.0
7,471,264,352,763,497,000
37.65873
136
0.564976
false
mgax/airship
airship/core.py
1
8257
import os import sys import logging import json import random import string from pipes import quote as shellquote from path import path import yaml from kv import KV import pkg_resources import blinker from .daemons import Supervisor from . import deployer log = logging.getLogger(__name__) CFG_LINKS_FOLDER = 'active'...
bsd-2-clause
-984,668,476,783,880,200
28.808664
79
0.619595
false
gale320/flexisip
doc/dk.py
1
2830
import sys import argparse from dokuwiki import DokuWiki, DokuWikiError import ConfigParser, os default_host= 'https://linphone.org/dokuwiki' # read from a configuration file for user/pass/host. This allows for out-of-cli specification of these parameters. config_file = '~/.flexiwiki.doku.cfg' config_section = '...
agpl-3.0
2,832,659,949,157,442,600
34.3875
193
0.713428
false
K4zuki/mbed
workspace_tools/upload_results.py
1
6420
""" mbed SDK Copyright (c) 2011-2013 ARM 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 wr...
apache-2.0
7,804,318,430,020,577,000
35.067416
143
0.627726
false
nrc/rustc-perf
collector/benchmarks/cranelift-codegen/cranelift-codegen/meta-python/base/instructions.py
2
62503
""" Cranelift base instruction set. This module defines the basic Cranelift instruction set that all targets support. """ from __future__ import absolute_import from cdsl.operands import Operand, VARIABLE_ARGS from cdsl.typevar import TypeVar from cdsl.instructions import Instruction, InstructionGroup from base.types ...
mit
-7,390,072,463,605,613,000
29.578767
79
0.58242
false
avocado-framework/avocado-vt
virttest/utils_libvirt/libvirt_ceph_utils.py
1
7176
""" High-level libvirt ceph utility functions. This module is meant to reduce code size by performing common ceph setup procedures. :author: Chunfu Wen <chwen@redhat.com> :copyright: 2021 Red Hat Inc. """ import logging import os from avocado.core import exceptions from avocado.utils import process from virttest im...
gpl-2.0
-4,209,220,713,909,102,000
40.241379
103
0.600056
false
vault/bugit
daemon/worker.py
1
4359
import os, sys, pwd, grp, syslog, signal import optparse from .gitolite import GitoliteUserConf, RepositoryConf from bugit.common.models import User from bugit import settings from bugit.common.redis_client import redis_db, CommandQueue import subprocess DEBUG = False def call(args): f = open('/dev/null', 'w'...
mit
2,685,993,408,391,374,300
23.216667
112
0.602202
false
th0mmeke/thesis
model/runner-for-results-819350e-stable-environment.py
1
3223
import os import random import itertools import model #experiments = [[1, 1, 1, 1, 1, 1]] def dist_a(source, correlation): return max(0.0,min(1.0, random.gauss(source, 1.0-correlation))) def dist_b(source, correlation): x = random.gauss(source, 1.0-correlation) while x < 0.0 or x > 1.0: x = ...
gpl-2.0
314,472,225,541,171,700
36.045977
186
0.575861
false
thecrackofdawn/Peach2.3
Peach/Generators/xmlstuff.py
1
10980
''' Currently contains W3C XML test suite @author: Michael Eddington @version: $Id: xmlstuff.py 2576 2011-11-10 01:28:11Z egriko $ ''' # # Copyright (c) 2006-2008 Michael Eddington # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files ...
mit
-4,180,879,214,686,776,300
27.298969
90
0.697723
false
hailinzeng/zhuaxia
zhuaxia/i18n/msg_cn.py
2
7738
# -*- coding:utf-8 -*- head_xm = u'[虾]' head_163 = u'[易]' #summary fmt_summary_skip_title = u'增量下载忽略列表:' fmt_summary_skip_header = u'来源\t 最后下载时间 \t歌曲名\t保存路径' fmt_summary_success_title = u'成功下载列表:' fmt_summary_success_header = u'歌曲名\t保存路...
mit
-3,345,620,565,306,967,000
36.708609
95
0.47471
false
CiscoDevNet/coding-skills-sample-code
coding102-REST-python-dcloud/manage-users.py
1
5294
# Example of calling REST API from Python to manage APIC-EM users/roles using APIC-EM APIs. # * THIS SAMPLE APPLICATION AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY # * OF ANY KIND BY CISCO, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED # * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY FITNESS FOR A PA...
apache-2.0
6,717,940,767,170,355,000
37.369565
110
0.740839
false
googleapis/google-api-java-client-services
generator/tests/java_generator_test.py
1
10681
#!/usr/bin/python2.7 # Copyright 2011 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 requi...
apache-2.0
3,248,056,579,300,821,000
35.20678
79
0.583466
false
yardstick17/menu_parser
build/lib/menu_parser/read_image.py
1
4962
import operator import re import cv2 from PIL import Image import pytesser import reading_white_text import smooth_image INVERT_COLOR_THRESHOLD = 128 def make_string_alphanmeric(lines): s = re.sub('[^0-9a-zA-Z\n]+', ' ', lines) return s def greyscale_image_mean(file_name): size = 128, 128 im = Im...
mit
-4,252,909,431,922,263,000
25.253968
115
0.563886
false
eallik/spinoff
spinoff/util/http.py
1
2866
import base64 from zope.interface import implements from twisted.internet import reactor, defer, protocol from twisted.internet.defer import inlineCallbacks, returnValue, succeed from twisted.web.client import Agent from twisted.web.http_headers import Headers from twisted.web.iweb import IBodyProducer class receiv...
bsd-2-clause
6,940,835,037,128,578,000
26.557692
75
0.679693
false
joehewitt/devon
devon/test.py
1
24687
import devon.log import inspect, types, sys, traceback, os.path, re, cgi, imp, glob, functools, unittest, shutil from importing import * # ************************************************************************************************** UnknownType = 0 FixtureType = 1 SuiteType = 2 WrapperType = 3 FunctionT...
bsd-3-clause
-8,813,859,618,627,568,000
31.019455
100
0.527727
false
Schevo/schevo
schevo/store/tests/test_store_persistent.py
1
1979
""" $URL: svn+ssh://svn/repos/trunk/durus/test/utest_persistent.py $ $Id: utest_persistent.py 27079 2005-07-25 20:54:05Z dbinger $ """ from cPickle import dumps, loads from schevo.store.connection import Connection from schevo.store.file_storage import TempFileStorage from schevo.store.persistent import Persiste...
mit
5,094,368,412,979,079,000
27.984848
66
0.550783
false
hsoft/moneyguru
core/model/oven.py
1
3911
# Copyright 2019 Virgil Dupras # # This software is licensed under the "GPLv3" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.gnu.org/licenses/gpl-3.0.html from datetime import date from ._ccore import oven_cook_txns class Oven: ...
gpl-3.0
3,079,686,459,639,464,400
45.559524
100
0.625927
false
lmallin/coverage_test
coverage_report.py
1
3527
#!/usr/bin/env python ################################# # File name: covergae.py # Author: Lucy Mallin # Date created: 16/05/2017 # Date last modified: 20/05/2017 # Python version: 2.7 # License: MIT ################################# import sys import pandas as pd import pdfkit import argparse from jinja2 import En...
mit
-1,907,351,030,892,528,600
37.336957
229
0.682733
false
secnot/uva-onlinejudge-solutions
10037 - Bridge/main.py
1
2153
import sys from heapq import heappush, heappop, heapify BEFORE = True AFTER = False def load_num(): line = sys.stdin.readline() if line == ' ' or line == '\n': return None return int(line) def load_case(): npeople = load_num() people = [] for p in range(npeople): people.app...
mit
-6,432,722,989,349,239,000
20.316832
56
0.464004
false
jimstorch/netboa
netboa/websocket/ws_service.py
1
3660
#------------------------------------------------------------------------------ # netboa/websocket/ws_service.py # Copyright 2012 Jim Storch # 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 Licen...
apache-2.0
-7,630,492,887,478,344,000
38.782609
80
0.656831
false
tjcsl/ion
intranet/apps/events/forms.py
1
1889
from django import forms from django.utils import timezone from ..groups.models import Group from .models import Event class EventForm(forms.ModelForm): def __init__(self, *args, all_groups=False, **kwargs): super().__init__(*args, **kwargs) if not all_groups: self.fields["groups"].qu...
gpl-2.0
1,669,203,879,041,194,200
34.641509
143
0.574907
false
fedspendingtransparency/data-act-broker
dataactbroker/userRoutes.py
1
4114
from flask import request from dataactbroker.handlers.accountHandler import AccountHandler from dataactbroker.permissions import permissions_check from dataactbroker.routeUtils import RouteUtils def add_user_routes(app,system_email,bcrypt): """ Create routes related to file submission for flask app """ ...
cc0-1.0
26,972,574,176,193,828
49.170732
147
0.709285
false
vipmike007/tp-qemu
qemu/tests/watchdog.py
1
12668
import re import time import logging from autotest.client.shared import error from autotest.client.shared import utils from virttest import utils_misc from virttest import env_process from virttest import utils_test @error.context_aware def run(test, params, env): """ Configure watchdog, crash the guest and ...
gpl-2.0
-2,609,541,550,980,241,000
40.94702
88
0.59078
false
arantonitis/soar
docs/source/conf.py
1
5579
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Soar documentation build configuration file, created by # sphinx-quickstart on Tue Jul 11 15:37:16 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autog...
lgpl-3.0
6,338,401,613,598,052,000
28.834225
103
0.670371
false
rbalda/neural_ocr
env/lib/python2.7/site-packages/pybrain/optimization/memetic/memetic.py
1
2537
__author__ = 'Tom Schaul, tom@idsia.ch' from pybrain.optimization.optimizer import BlackBoxOptimizer, TopologyOptimizer from pybrain.optimization.hillclimber import HillClimber from pybrain.structure.evolvables.maskedparameters import MaskedParameters class MemeticSearch(HillClimber, TopologyOptimizer): """ Inte...
mit
-2,982,297,332,251,377,000
40.606557
120
0.569176
false
xeor/hohu
api/data/src/settings.py
1
4232
import os BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) SECRET_KEY = os.environ.get('SECRET_KEY', 'zo3^4x8eqz8*ye9r$hrh*w)13)l@w7ymod_#%%&7+6+j*8l&$#') DEBUG = bool(os.environ.get('DEBUG', False)) if DEBUG: print('WARNING: The DEBUG is set to True.') DEV = bool(os.environ.get('DEV', Fal...
mit
-3,050,842,136,101,800,400
25.78481
95
0.632325
false
berth64/modded_modded_1257ad
source/process_sounds.py
1
1810
import sys sys.dont_write_bytecode = True from header_common import * from module_info import * from module_sounds import * # Lav's export_dir tweak export_dir = '%s/' % export_dir.replace('\\', '/').rstrip('/') def write_python_header(sounds): file = open("./ID_sounds.py","w") for i_sound in xrange(...
agpl-3.0
-8,116,568,112,333,687,000
29.206897
67
0.596133
false
ericdill/fileStore
filestore/test/utils.py
1
2853
from __future__ import (unicode_literals, print_function, division, absolute_import) import uuid import itertools from filestore.handlers_base import HandlerBase import numpy as np from filestore.utils import install_sentinels conn = None db_name = "fs_testing_disposable_{}".format(str(uuid.uu...
bsd-3-clause
4,817,130,636,533,387,000
27.247525
70
0.613389
false
rosenvladimirov/addons
partner_credit_control/__openerp__.py
1
1867
# -*- coding: utf-8 -*- ############################################################################## # # Partner Credit Control module for Odoo # Copyright (C) 2017 Rosen Vladimirov (vladimirov.rosen@gmail.com) # @author Rosen Vladimirov <vladimirov.rosen@gmail.com> # # This program is free software: you ...
agpl-3.0
-7,689,910,014,790,602,000
35.607843
86
0.612748
false
SectorAlpha/AlphaVEN
alphaven.py
1
13528
import os import argparse as ap import maker import warnings import datetime as dt import subprocess as sp #Consts FADEIN_STRINGS = ["in", "In", "fadein", "Fadein", "fi"] FADEOUT_STRINGS = ["out", "Out", "fadeout", "Fadeout", "fo"] class Ven(): def __init__(self): """Create new AlphaVEN instance.""" ...
gpl-3.0
-7,385,270,786,826,338,000
38.328488
96
0.491499
false
joshisa/eve-sqlalchemy
setup.py
1
1573
#!/usr/bin/env python from setuptools import setup DESCRIPTION = ("REST API framework powered by Flask, SQLAlchemy and good " "intentions.") with open('README.rst') as f: LONG_DESCRIPTION = f.read() with open('CHANGES') as f: LONG_DESCRIPTION += f.read() install_requires = [ 'Eve>=0.5,<0....
bsd-3-clause
4,076,205,884,460,376,600
28.12963
74
0.583598
false
hrishioa/Aviato
flask/Lib/site-packages/osgeo/scripts/gdalimport.py
3
2966
#!/usr/bin/env python #****************************************************************************** # $Id$ # # Name: gdalimport # Project: GDAL Python Interface # Purpose: Import a GDAL supported file to Tiled GeoTIFF, and build overviews # Author: Frank Warmerdam, warmerdam@pobox.com # #**************...
gpl-2.0
-288,890,926,724,166,500
32.325843
79
0.620364
false
wakiyamap/electrum-mona
electrum_mona/scripts/bip70.py
1
1061
#!/usr/bin/env python3 # create a BIP70 payment request signed with a certificate # FIXME: the code here is outdated, and no longer working import tlslite from electrum_mona.transaction import Transaction from electrum_mona import paymentrequest from electrum_mona import paymentrequest_pb2 as pb2 from electrum_mona.b...
mit
-6,627,236,905,453,368,000
27.675676
77
0.755891
false
buffalotheory/critter_list
pyplayer/test/008_play_and_queue.py
1
1274
#!/usr/bin/env python3 # Bryant Hansen # USAGE: # sys.argv[0] media_file # where media_file full path/filename to mplayer-compatible file on the local # system # # initial conditions: pyplayerd is running import os import sys from time import sleep import traceback import pyplayer_config as config import pyplay...
gpl-2.0
3,219,515,862,726,316,500
25
150
0.613815
false
msrb/freeipa
ipaplatform/base/paths.py
1
16762
# Authors: # Tomas Babej <tbabej@redhat.com> # # Copyright (C) 2014 Red Hat # see file 'COPYING' for use and warranty information # # 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 vers...
gpl-3.0
-5,471,396,839,473,048,000
46.08427
110
0.671042
false
vellonce/PizzaFria
podcasting/utils/fields.py
1
3044
""" Django Extensions model fields """ from __future__ import unicode_literals import uuid from django.db.models import CharField class UUIDVersionError(Exception): pass class UUIDField(CharField): """UUIDField By default uses UUID version 1 (generate from host ID, sequence number and current tim...
gpl-2.0
3,639,509,219,665,002,500
33.988506
87
0.606439
false
hyperkitty/hyperkitty
hyperkitty/views/accounts.py
1
12051
# -*- coding: utf-8 -*- # Copyright (C) 2014-2015 by the Free Software Foundation, Inc. # # This file is part of HyperKitty. # # HyperKitty 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 t...
gpl-3.0
-7,425,740,729,090,428,000
35.853211
85
0.630985
false
danstowell/markovrenewal
experiments/chiffchaffch_excerpted.py
1
3883
#!/bin/env python """This file contains some utility functions taken from Dan's larger file 'chiffchaffch.py'. Excerpted here are the functions invoked by the main MMRP experiment scripts.""" import os.path import matplotlib.pyplot as plt # User parameters: filteramp = True filtermingap = True doplots = True basepa...
gpl-2.0
1,707,280,764,705,154,600
39.447917
132
0.671388
false
Willyham/tchannel-python
tchannel/messages/init_response.py
1
1651
# Copyright (c) 2015 Uber Technologies, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publ...
mit
7,071,208,595,602,744,000
39.268293
79
0.740157
false
MikeHoffert/caladbolg-engine
caladbolg/graphics/graphics_context.py
1
1831
""" Stores global access to draw to the window. The graphics context is the embodiment of what will be drawn. Whenever something wants draw to the screen, it must do so via what is provided here. In particular, most drawing is done by providing sprites and data about how to position, rotate, and scale the sprite....
mit
-2,301,690,636,659,394,800
36.145833
119
0.703441
false
rossp/django-helpdesk
helpdesk/tests/test_kb.py
1
3431
# -*- coding: utf-8 -*- from django.urls import reverse from django.test import TestCase from helpdesk.models import KBCategory, KBItem, Queue, Ticket from helpdesk.tests.helpers import (get_staff_user, reload_urlconf, User, create_ticket, print_response) class KBTests(TestCase): def setUp(self): self.q...
bsd-3-clause
-1,983,312,118,619,831,000
41.8875
151
0.619353
false
xiaoshi657/myfile
spider/tencent/tencent/spiders/tencentPosition.py
1
1425
# -*- coding: utf-8 -*- import scrapy from tencent.items import TencentItem class TencentpositionSpider(scrapy.Spider): name = "tencent" allowed_domains = ["tencent.com"] url = "http://hr.tencent.com/position.php?&start=" offset = 0 start_urls = [url + str(offset)] def parse(self, response):...
apache-2.0
-3,275,327,250,168,577,000
31.897436
80
0.544817
false
shucommon/little-routine
python/AI/opencv/gui/tracebar.py
1
1274
''' For cv.getTrackbarPos() function, first argument is the trackbar name, second one is the window name to which it is attached, third argument is the default value, fourth one is the maximum value fifth one is the callback function which is executed everytime trackbar value changes. The callback function always has a...
gpl-3.0
-7,508,665,367,235,700,000
29.333333
86
0.689168
false
leiferikb/bitpop
src/tools/telemetry/telemetry/core/backends/chrome/inspector_backend.py
1
10535
# Copyright 2013 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. import logging import os import sys from telemetry import decorators from telemetry.core import bitmap from telemetry.core import exceptions from telemetry....
gpl-3.0
-4,911,296,670,180,827,000
32.444444
80
0.686853
false
sony/nnabla
python/test/solver/test_adagrad.py
1
1644
# Copyright 2017,2018,2019,2020,2021 Sony 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 # # Unless required by applicable law...
apache-2.0
-2,056,768,373,708,694,000
31.235294
91
0.678224
false
RicardoJohann/frappe
frappe/twofactor.py
1
13724
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe from frappe import _ import pyotp, os from frappe.utils.background_jobs import enqueue from jinja2 import Template from pyqrcode import create as qrcreate from six ...
mit
7,357,835,376,024,494,000
33.054591
159
0.698047
false
danmichaelo/SDBot
sdbot/webinterface.py
1
3127
from flask import Flask from flask import render_template from time import time from datetime import datetime, timedelta import calendar import locale import numpy as np import os import sqlite3 import locale for loc in ['no_NO', 'nb_NO.utf8']: try: locale.setlocale(locale.LC_ALL, loc) except locale....
unlicense
-6,798,628,287,456,228,000
31.237113
140
0.548769
false
mozilla/FlightDeck
apps/base/helpers.py
1
5351
import os import urllib import urlparse import json from django.conf import settings from django.template import (Library, loader, TemplateSyntaxError, Node, Variable, VariableDoesNotExist) from django.template.defaultfilters import escapejs from django.utils.encoding import smart_str from...
bsd-3-clause
4,042,840,007,349,534,700
31.430303
82
0.627546
false
ThomasDoylend/Zen
sys/boot/bootstrap/autoloader.py
1
1298
#Zen # #AutoLoader import imp class AutoLoader: #Takes care of intelligently loading any app/service. name = 'Auto-loader' def __init__(self,kernel): self.kernel = kernel self.fs = self.kernel.get_service('fs') self.load_hash = 0 def load(self,path): ...
mit
-3,007,266,417,041,747,500
29.209302
81
0.540062
false
SchadkoAO/FDTD_Solver
world_surface/helpers/generate_surface.py
2
1056
import numpy as np def generate_surface(y_size, delta_x, grain_size): wing_size = 12 * grain_size noise = np.random.random(y_size + wing_size) * 2 * delta_x - delta_x noise = noise / np.max(noise) * delta_x gauss = np.fromfunction(lambda i: np.exp( (i - 3 * grain_size) / (2 * grain_size ^ 2)),...
mit
-6,537,101,377,705,883,000
33.064516
83
0.544508
false
thequbit/yellr-server
yellr-serv/yellrserv/ep_client_notification.py
1
1077
from pyramid.view import view_config import client_utils import utils ''' @view_config(route_name='get_notifications.json') def get_notifications(request): result = {'success': False} status_code = 200 try: #if True: success, error_text, language_code, lat, lng, \ client = client...
agpl-3.0
-3,728,312,044,257,253,000
22.413043
58
0.578459
false
cosurgi/trunk
examples/qm/2d-hydrogeneigen+positron-small-TEN-2.py
1
9929
#!/usr/bin/python # -*- coding: utf-8 -*- dimensions = 2 SMALLER = 1 size1d = 560/SMALLER GRIDSIZE = [224/SMALLER,180/SMALLER] # GRIDSIZE = [320,256] halfSize = [size1d,size1d*(1.0*GRIDSIZE[1]/GRIDSIZE[0]),0.1]# must be three components, because yade is inherently 3D and uses Vector3r. Remaining component...
gpl-2.0
8,754,685,277,358,878,000
53.483516
236
0.606898
false
JohnyEngine/CNC
heekscnc/ocl_funcs.py
1
8389
import ocl import math from nc.nc import * import tempfile def STLSurfFromFile(filepath): s = ocl.STLSurf() ocl.STLReader(filepath, s) return s def cut_path(path, dcf, z1, mat_allowance, mm, units, rapid_to, incremental_rapid_to): dcf.setPath(path) dcf.setSampling(0.1) # FIXME: this should be adju...
apache-2.0
1,130,080,577,587,595,900
38.200935
288
0.569198
false
ebrelsford/django-phillydata
phillydata/parcels/migrations/0001_initial.py
1
1431
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.contrib.gis.db.models.fields class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Parcel', fields=[ ...
bsd-3-clause
-2,359,019,668,350,720,500
50.107143
224
0.640112
false
locuslab/icnn
RL/src/bundle_entropy.py
1
3796
import numpy as np def logistic(x): return 1. / (1. + np.exp(-x)) def logexp1p(x): """ Numerically stable log(1+exp(x))""" y = np.zeros_like(x) I = x>1 y[I] = np.log1p(np.exp(-x[I]))+x[I] y[~I] = np.log1p(np.exp(x[~I])) return y def proj_newton_logistic(A,b,lam0=None, line_search=True): ...
apache-2.0
2,989,840,518,906,655,000
26.911765
84
0.41491
false
ArcherSys/ArcherSys
Lib/lib2to3/fixes/fix_raise.py
1
8918
<<<<<<< HEAD <<<<<<< HEAD """Fixer for 'raise E, V, T' raise -> raise raise E -> raise E raise E, V -> raise E(V) raise E, V, T -> raise E(V).with_traceback(T) raise E, None, T -> raise E.with_traceback(T) raise (((E, E'), E''), E'''), V -> raise E(V) raise "foo", V, T -> warns about st...
mit
-638,410,223,580,926,300
31.311594
80
0.541041
false
MacHu-GWU/docfly-project
docs/source/conf.py
1
5900
# -*- coding: utf-8 -*- # # docfly documentation build configuration file, created by # sphinx-quickstart on Mon Jul 17 14:40:39 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # Al...
mit
7,803,259,674,895,007,000
29.569948
79
0.671695
false
paurosello/frappe
frappe/core/doctype/page/page.py
1
4671
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe import os from frappe.model.document import Document from frappe.build import html_to_js_template from frappe.model.utils import render_include from frappe import co...
mit
-5,529,530,856,666,826,000
29.135484
84
0.657247
false
ThomasHangstoerfer/pyHomeCtrl
gcalendar.py
1
3832
from __future__ import print_function import httplib2 import os from apiclient import discovery from oauth2client import client from oauth2client import tools from oauth2client.file import Storage import datetime try: import argparse flags = argparse.ArgumentParser(parents=[tools.argparser]).parse_args() ex...
apache-2.0
5,739,775,279,411,638,000
35.150943
190
0.662578
false
ZeeD26/python101
docs/exercises/is_palindrome_string.py
1
1679
r""" A palindrome_ is a word, phrase, number or sequence of characters which reads the same backward as forward. Examples for words are *radar*, *level*, and *racecar*. Write a function that checks whether a :class:`strings <str>` is a palindrome or not. .. autofunction:: is_palindrome_string Start by downloading the...
bsd-3-clause
-4,171,778,432,318,806,000
25.650794
79
0.626563
false
uyjco0/ted-scimu
base.py
1
7063
# -*- encoding: utf-8 -*- # # 'base.py' # # Copyright (C) 2013 Jorge Couchet <jorge.couchet at gmail.com> # # This file is part of 'ted-scimu' # # 'ted-scimu' 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,...
gpl-3.0
-8,542,019,304,850,642,000
36.521277
209
0.626311
false
Kortemme-Lab/klab
klab/bio/fragments/hpc/SGE.py
1
10116
#!/usr/bin/python # encoding: utf-8 """ SGE.py Fragment generation submission module for the Sun Grid Engine. Created by Shane O'Connor 2013 Use this as a basis for your cluster system module. The following functionality should be provided: - A FragmentsJob class for array runs which creates a script object membe...
mit
-9,208,388,450,866,699,000
40.459016
223
0.606366
false
chenjiandongx/pyecharts
pyecharts/charts/basic_charts/funnel.py
1
1865
from ... import options as opts from ... import types from ...charts.chart import Chart from ...globals import ChartType class Funnel(Chart): """ <<< Funnel >>> Funnel diagram is suitable for one-way analysis of single process with standardized business process, long cycle and multiple lin...
mit
7,241,232,577,728,788,000
31.303571
70
0.52815
false
ahopkins/amhopkins.com
publish.py
1
2485
from medium import Client import os import glob from bs4 import BeautifulSoup from pathlib import Path PATH = os.path.dirname(os.path.abspath(__file__)) MEDIUM = os.path.join(PATH, 'medium-published') with open(os.path.join(PATH, 'KEYS', 'medium'), 'r') as file: application_id, application_secret, access_token =...
mit
552,634,826,619,762,300
26.611111
100
0.58672
false
FedoraScientific/salome-paravis
test/VisuPrs/3D_viewer/B1.py
1
1520
# Copyright (C) 2010-2014 CEA/DEN, EDF R&D # # This library 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 2.1 of the License, or (at your option) any later version. # # This library ...
lgpl-2.1
4,260,798,725,414,599,700
27.148148
81
0.733553
false
JaeGyu/PythonEx_1
dictEx1.py
1
1310
a = {'jan':1,'feb':2} print(a) print(type(a)) b = dict(jan=1,feb=2) print(b) print("abc".title()) month_names = [("a",1),("b",2)] c = {name.title():num for name, num in month_names} print(c) d = {name:num for name,num in month_names if num % 2 == 0} print(d) months = dict(month_names) print(months) print(months.it...
mit
-2,067,533,604,493,950,700
16.275362
58
0.618289
false
acsone/purchase-workflow
purchase_triple_discount/tests/test_purchase_discount.py
1
3731
# -*- coding: utf-8 -*- # Copyright 2017 Tecnativa - David Vidal # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from openerp.tests import common class TestPurchaseOrder(common.SavepointCase): @classmethod def setUpClass(self): super(TestPurchaseOrder, self).setUpClass() self...
agpl-3.0
-3,025,830,336,393,303,600
44.5
76
0.647816
false
ryfx/modrana
modules/mod_projection.py
1
17094
# -*- coding: utf-8 -*- #---------------------------------------------------------------------------- # Projection code (lat/long to screen conversions) #---------------------------------------------------------------------------- # Copyright 2007-2008, Oliver White # # This program is free software: you can redistribu...
gpl-3.0
6,599,801,769,442,898,000
36.735099
128
0.576694
false
partofthething/home-assistant
homeassistant/components/blink/__init__.py
1
5383
"""Support for Blink Home Camera System.""" import asyncio from copy import deepcopy import logging from blinkpy.auth import Auth from blinkpy.blinkpy import Blink import voluptuous as vol from homeassistant.components import persistent_notification from homeassistant.components.blink.const import ( DEFAULT_SCAN_...
mit
7,426,953,159,554,015,000
29.936782
141
0.663756
false
stackforge/osprofiler
releasenotes/source/conf.py
1
8992
# -*- coding: utf-8 -*- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software...
apache-2.0
5,053,364,346,222,410,000
31.462094
79
0.704293
false
d33tah/pgcli
tests/test_smart_completion_multiple_schemata.py
1
13725
from __future__ import unicode_literals import pytest from prompt_toolkit.completion import Completion from prompt_toolkit.document import Document from pgcli.packages.function_metadata import FunctionMetadata metadata = { 'tables': { 'public': { 'users': [...
bsd-3-clause
9,199,341,364,369,424,000
43.710098
101
0.624991
false
Brahimbaz/venom-xbmc-addons-beta
plugin.video.vstream/resources/hosters/videott.py
1
3207
from resources.lib.handler.requestHandler import cRequestHandler #from t0mm0.common.net import Net from resources.lib.parser import cParser from resources.lib.config import cConfig from resources.hosters.hoster import iHoster import urllib, urllib2,re import xbmcgui try: import json except: import simplejson as jso...
gpl-2.0
777,405,009,120,400,800
26.177966
130
0.510446
false
ggljzr/pytRobot
pytrobot/flaskapp.py
1
1871
from flask import Flask, render_template, redirect, url_for, flash, abort, send_file import json from datetime import datetime import subprocess from picamera.exc import PiCameraMMALError from .robotdriver import DirError from .utils import sys_info from .camera import capture_img app = Flask(__name__) a...
mit
3,341,696,799,198,722,000
23.657534
84
0.668626
false
dropbox/changes-lxc-wrapper
setup.py
1
1242
#!/usr/bin/env python3 """ changes-lxc-wrapper =================== :copyright: (c) 2014 Dropbox, Inc. """ from setuptools import setup, find_packages tests_require = [ 'coverage', 'mock>=1.0.1,<1.1.0', 'pytest>=2.6.1,<2.7.0', ] install_requires = [ 'raven>=5.0.0,<5.1.0', ] setup( name='changes-...
apache-2.0
-4,583,006,840,170,972,700
24.346939
78
0.590982
false
gencer/sentry
tests/sentry/api/endpoints/test_group_events.py
1
5955
from __future__ import absolute_import import six from sentry import tagstore from sentry.testutils import APITestCase class GroupEventsTest(APITestCase): def test_simple(self): self.login_as(user=self.user) group = self.create_group() event_1 = self.create_event('a' * 32, group=group) ...
bsd-3-clause
-8,439,634,137,532,483,000
34.029412
100
0.572964
false
edx/edx-analytics-pipeline
edx/analytics/tasks/enterprise/enterprise_user.py
1
7793
"""Gather data related to enterprise users""" import logging import luigi import luigi.task from edx.analytics.tasks.common.mysql_load import MysqlInsertTask from edx.analytics.tasks.enterprise.enterprise_database_imports import ( ImportBenefitTask, ImportConditionalOfferTask, ImportDataSharingConsentTask, I...
agpl-3.0
-5,238,539,878,268,993,000
34.747706
112
0.649942
false
naoyat/latin
Verb.py
1
1574
#!/usr/bin/env python # -*- coding: utf-8 -*- PARTICIPLE = 1024 IMPERATIVE = 512 INDICATIVE = 256 PASSIVE = 16 ING = 8 FUTURE = 4 PAST = 2 PERFECT = 1 INDICATIVE_ACTIVE_PRESENT = INDICATIVE #| PRESENT INDICATIVE_ACTIVE_IMPERFECT = INDICATIVE ...
mit
3,606,079,984,408,599,000
41.833333
75
0.623217
false
openstack/designate
designate/conf/api.py
1
4809
# Copyright 2012 Managed I.T. # # Author: Kiall Mac Innes <kiall@managedit.ie> # # 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 r...
apache-2.0
491,817,049,776,111,360
42.324324
79
0.609274
false
wwitzel3/awx
awx/main/tests/functional/test_rbac_workflow.py
1
8738
import pytest from awx.main.access import ( WorkflowJobTemplateAccess, WorkflowJobTemplateNodeAccess, WorkflowJobAccess, # WorkflowJobNodeAccess ) from awx.main.models import InventorySource, JobLaunchConfig @pytest.fixture def wfjt(workflow_job_template_factory, organization): objects = workflo...
apache-2.0
3,863,832,381,449,744,400
39.267281
137
0.690776
false
xyos/horarios
fabfile.py
1
1045
from fabric.api import run, lcd, local from fabric.colors import green, red import os file_path = os.getcwd() def activate(command): if os.name == "nt": local("%s/Scripts/activate.bat && " + command, file_path) elif os.name == "posix": local("/bin/bash -c 'source " + file_path + "/bin/activat...
mit
-3,426,333,867,810,408,000
26.5
88
0.640191
false
crukci-bioinformatics/galaxy
crukci-tools/tools/cri/unused/myTools/bed_complement.py
1
2833
#!/usr/bin/python import getopt, sys import encode from encode import * def regions_complement(regions): comp_regions = encode.regions() for region_name in regions.keys(): # store an alias for the region with name region_name - just readability data = regions[region_name] comp_regions...
mit
7,322,969,428,473,056,000
27.616162
89
0.595482
false
CLVsol/odoo_cl_addons
cl_base/__openerp__.py
1
2138
# -*- encoding: utf-8 -*- ################################################################################ # # # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol # # ...
agpl-3.0
2,684,312,985,247,366,700
48.72093
80
0.455566
false
james-powis/puppetboard
puppetboard/utils.py
1
3121
from __future__ import absolute_import from __future__ import unicode_literals import json import logging from math import ceil from requests.exceptions import HTTPError, ConnectionError from pypuppetdb.errors import EmptyResponseError from flask import abort # Python 3 compatibility try: xrange except NameErr...
apache-2.0
924,701,120,338,025,100
23.968
76
0.579622
false
haiyangd/python-porject
src/ovirt/node/utils/fs/__init__.py
1
25700
#!/usr/bin/python # -*- coding: utf-8 -*- # # fs/__init__.py - Copyright (C) 2012-2014 Red Hat, Inc. # Written by Fabian Deutsch <fabiand@redhat.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Founda...
gpl-2.0
-4,748,768,677,427,009,000
31.044888
79
0.548171
false
amitjamadagni/sympy
sympy/matrices/expressions/tests/test_matrix_exprs.py
2
5025
from __future__ import with_statement from sympy.core import S, symbols, Add, Mul from sympy.functions import transpose, sin, cos, sqrt from sympy.simplify import simplify from sympy.matrices import (Identity, ImmutableMatrix, Inverse, MatAdd, MatMul, MatPow, Matrix, MatrixExpr, MatrixSymbol, ShapeError, ZeroM...
bsd-3-clause
-7,855,414,790,303,279,000
24.769231
79
0.579502
false
PALab/stalta
plotevents.py
1
3156
'''plot event info''' import base import datetime import numpy as np import matplotlib if not base.Globs["iswin"]: matplotlib.use("TkAgg") import matplotlib.pyplot as plt from logger import * def eventplot(tin, y, sta, lta, ratio, trigs, dt, t0, tsta, tlta, trig, detrig, desense, ...
mit
8,170,216,897,380,982,000
31.574468
78
0.540241
false
ray-project/ray
python/ray/tests/test_healthcheck.py
1
1656
# coding: utf-8 import logging import pytest import signal import subprocess import sys import time import ray logger = logging.getLogger(__name__) def test_healthcheck(): res = subprocess.run(["ray", "health-check"]) assert res.returncode != 0 ray.init() res = subprocess.run(["ray", "health-check"...
apache-2.0
3,782,194,128,236,310,500
26.147541
72
0.634662
false
p2pu/learning-circles
backup/utils.py
1
2707
from django.conf import settings from dcu.active_memory import upload_rotate import datetime import os.path import subprocess import logging logger = logging.getLogger(__name__) class BackupFailed(Exception): pass def backup_media(): ''' make a backup of media files ''' timestamp = datetime.d...
mit
6,255,254,812,936,844,000
32.012195
102
0.65423
false
rdio/sentry
tests/sentry/smtp/tests.py
1
1451
import os.path from sentry.models import Activity from sentry.services.smtp import SentrySMTPServer, STATUS from sentry.testutils import TestCase from sentry.utils.email import group_id_to_email, email_to_group_id fixture = open(os.path.dirname(os.path.realpath(__file__)) + '/email.txt').read() class SentrySMTPTest(...
bsd-3-clause
7,942,685,029,278,876,000
44.34375
117
0.699518
false
mbakke/ganeti
lib/qlang.py
1
9513
# # # Copyright (C) 2010, 2011 Google Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distri...
gpl-2.0
5,798,625,394,325,158,000
27.14497
80
0.646799
false
gumob/django-stripe
stripe/signals.py
1
5752
""" Provides the following signals: - stripe_webhook_charge_succeeded - stripe_webhook_charge_failed - stripe_webhook_charge_refunded - stripe_webhook_charge_disputed - stripe_webhook_customer_created - stripe_webhook_customer_updated - stripe_webhook_customer_deleted - stripe_webhook_customer_subscription_created - s...
mit
5,131,202,563,527,160,000
53.780952
105
0.807024
false
HarmonyEnterpriseSolutions/harmony-platform
src/gnue/common/external/plex/DFA.py
1
5424
#======================================================================= # # Python Lexical Analyser # # Converting NFA to DFA # #======================================================================= from src.gnue.common.external.plex.Machines import LOWEST_PRIORITY from src.gnue.common.external.plex.Transitions...
gpl-2.0
4,180,384,056,127,945,700
33.993548
82
0.69469
false
LLNL/spack
var/spack/repos/builtin/packages/quicksilver/package.py
2
1948
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Quicksilver(MakefilePackage): """Quicksilver is a proxy application that represents some e...
lgpl-2.1
1,920,603,991,302,244,400
29.920635
78
0.61807
false
liuxue1990/python-ll1-parser-generator
rm_recur.py
1
3552
from ll1_symbols import * class RmRecurEngine(object): """docstring for RmRecurEngine""" def __init__(self, prodc_list, non_term_set): self.prodc_list = prodc_list self.non_term_list = list(non_term_set) # self.non_term_prodc_map = {non_term: [] for non_term in self.non_term_list} # self.update_non_term_map...
gpl-3.0
4,279,328,949,209,288,700
37.193548
135
0.682151
false
ACECentre/SpeechBubblev1
speechbubble/speechbubble/campaign/admin.py
1
8218
import csv from django import forms from django.shortcuts import render_to_response from django import template from django.utils.functional import update_wrapper from django.contrib import admin from django.http import HttpResponseRedirect from django.contrib.admin.util import unquote from django.core.exceptions impor...
bsd-3-clause
6,368,169,875,508,079,000
37.764151
233
0.57155
false
marquesarthur/python-bugzilla-report-api
data.py
1
8067
import json import requests import datetime import time import sys import re import plotly.plotly as py import plotly.graph_objs as graph from time import mktime from datetime import date from pprint import pprint from bug_backlog import Backlog from bug_components import Component from bug_developers import Assignee ...
mit
-8,067,715,161,354,324,000
32.6125
157
0.670138
false