repo_name
stringlengths
6
90
path
stringlengths
4
230
copies
stringlengths
1
4
size
stringlengths
4
7
content
stringlengths
734
985k
license
stringclasses
15 values
hash
int64
-9,223,303,126,770,100,000
9,223,233,360B
line_mean
float64
3.79
99.6
line_max
int64
19
999
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
8.06
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
andrewyoung1991/abjad
abjad/tools/documentationtools/ClassCrawler.py
1
2100
# -*- encoding: utf-8 -*- import os import types from abjad.tools import abctools from abjad.tools.documentationtools.ModuleCrawler import ModuleCrawler class ClassCrawler(abctools.AbjadObject): r'''Class crawler. ''' ### CLASS VARIABLES ### __slots__ = ( '_code_root', '_include_priv...
gpl-3.0
8,742,102,243,658,480,000
24.938272
76
0.56
false
4.242424
false
false
false
taranjeet/EvalAI
settings/prod.py
2
3039
from .common import * # noqa: ignore=F405 import os import raven DEBUG = False ALLOWED_HOSTS = ['evalapi.cloudcv.org', 'evalai.cloudcv.org'] # Database # https://docs.djangoproject.com/en/1.10.2/ref/settings/#databases CORS_ORIGIN_ALLOW_ALL = False CORS_ORIGIN_WHITELIST = ( 'evalai.cloudcv.org', 'evalai....
bsd-3-clause
-2,328,223,741,048,208,000
32.032609
107
0.668312
false
3.035964
false
false
false
redhat-openstack/cinder
cinder/volume/drivers/san/solaris.py
6
10428
# Copyright 2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
apache-2.0
5,909,033,068,414,339,000
35.461538
79
0.582758
false
3.786492
true
false
false
dotKom/onlineweb4
apps/careeropportunity/forms.py
1
1290
from django import forms from apps.careeropportunity.models import CareerOpportunity class AddCareerOpportunityForm(forms.ModelForm): title = forms.CharField(label='Tittel', required=True, max_length=100, widget=forms.TextInput( attrs={'placeholder': 'Tittel for karrieremuligheten'})) ingress = form...
mit
7,345,608,997,329,193,000
52.666667
100
0.701863
false
3.587744
false
false
false
kaspermarstal/SimpleElastix
Testing/Unit/Python/sitkNumpyArrayConversionTest.py
1
10501
#========================================================================== # # Copyright Insight Software Consortium # # 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...
apache-2.0
-1,179,954,146,895,075,800
38.626415
99
0.635273
false
3.101299
true
false
false
09zwcbupt/undergrad_thesis
ext/poxdesk/qx/tool/pylib/generator/code/CodeGenerator.py
1
57051
#!/usr/bin/env python # -*- coding: utf-8 -*- ################################################################################ # # qooxdoo - the new era of web development # # http://qooxdoo.org # # Copyright: # 2006-2011 1&1 Internet AG, Germany, http://www.1und1.de # # License: # LGPL: http://www.gnu.org/l...
gpl-3.0
4,929,823,813,569,869,000
40.764275
167
0.551849
false
4.566557
true
false
false
Bookmark-Novels/Gatekeeper
gatekeeper.py
1
2900
from datetime import datetime, timedelta import json import uuid from flask import abort, jsonify, redirect, render_template, request, session, url_for from app import app, bcrypt from models.account import Account from models.nonce import Nonce from models.session import Session from modules.cookie import get_cookie...
mit
-9,053,121,620,156,015,000
31.222222
120
0.591034
false
4.233577
true
false
false
redsolution/django-model-url
modelurl/utils.py
1
17217
""" Utils to replace macro with url for specified objects. And to replace urls with macro. """ import re import threading from django.conf import settings from django.core.urlresolvers import RegexURLResolver from django.template import NodeList from django.utils.safestring import mark_safe from urlmethods import ur...
gpl-3.0
6,166,248,529,469,361,000
30.824399
161
0.543416
false
3.787286
false
false
false
googleinterns/userjourneytool
ujt/constants.py
1
6092
""" Constants for UJT. Generally contains constants for styling. """ from collections import defaultdict from typing import Any, Dict from graph_structures_pb2 import NodeType, Status from . import id_constants # functional constants SLI_CACHE_TIMEOUT_SECONDS = 30 CLIENT_CLASS = "CLIENT" HIGHLIGHTED_UJ_EDGE_CLASS ...
apache-2.0
-4,861,488,999,316,049,000
25.60262
87
0.583388
false
3.092386
false
false
false
thebachchaoproject/safewatch-ivr
safewatch_ivr_app/Utilities/WritingToJson.py
1
2276
import json import os #from bson.objectid import ObjectId # To encode the object id of mongoDB to JSON object..!!! class JSONEncoder(json.JSONEncoder): def default(self, o): if isinstance(o, ObjectId): return str(o) return json.JSONEncoder.default(self, o) # To encode the Dae and timme...
mit
-1,359,408,333,732,414,700
36.933333
117
0.638401
false
3.084011
false
false
false
sceeter89/command-center
plugins/sensors/alarm/alarm.py
1
1621
import RPi.GPIO as GPIO from yapsy.IPlugin import IPlugin from api.sensor import Sensor ALARM_ARMED_PIN = 10 ALARM_ALERT_PIN = 9 class Alarm(Sensor, IPlugin): ITEMS_LIMIT = 20 TRIGGER_THRESHOLD = 15 DROP_THRESHOLD = 5 def __init__(self): super().__init__() GPIO.setmode(GPIO.BCM) ...
mit
2,425,902,017,933,137,000
29.584906
105
0.613202
false
3.229084
false
false
false
ooici/coverage-model
coverage_model/test/coverage_test_base.py
1
55142
#!/usr/bin/env python """ @package coverage_model.test.test_coverage @file coverage_model/test/ @author James Case @author Christopher Mueller @brief Base tests for all coverages """ from coverage_model import * from coverage_model.coverage import * from nose.plugins.attrib import attr import unittest import numpy as...
bsd-2-clause
5,914,516,496,441,555,000
37.887165
174
0.595644
false
3.828774
true
false
false
Didero/DideRobot
commands/Generators.py
1
91724
import datetime, glob, inspect, json, os, random, re, string from CommandTemplate import CommandTemplate from IrcMessage import IrcMessage from util import FileUtil from util import IrcFormattingUtil from util import StringUtil import GlobalStore from CommandException import CommandException fieldCommandPrefix = u"$...
mit
1,115,995,670,835,774,500
47.763424
279
0.748812
false
3.675134
false
false
false
vinchoi/fishplay
flask/lib/python2.7/site-packages/setuptools/ssl_support.py
100
8119
import os import socket import atexit import re from setuptools.extern.six.moves import urllib, http_client, map import pkg_resources from pkg_resources import ResolutionError, ExtractionError try: import ssl except ImportError: ssl = None __all__ = [ 'VerifyingHTTPSHandler', 'find_ca_bundle', 'is_avail...
gpl-3.0
-6,532,622,208,705,187,000
32.411523
82
0.595024
false
4.17859
false
false
false
marplaa/SerialBus
python_lib/sensor_device.py
1
1122
VALUE_TYPE_FLAG = 0 VALUE_TYPE_BYTE = 1 VALUE_TYPE_INT = 2 VALUE_TYPE_FLOAT = 3 DATA_TYPE_BYTE = 0 DATA_TYPE_INT = 1 DATA_TYPE_FLOAT = 2 DATA_TYPE_STRING = 3 # value_ids DATA = 0 LOW_THRES = 1 HIGH_THRES = 2 MIN_IMPULSE_LENGTH = 3 MIN_IDLE_LENGTH = 4 MAX_FAILS = 5 HYSTERESIS = 6 INTERVAL = 7 INVERT = 8 SENSOR_VALU...
gpl-3.0
-5,676,147,877,470,458,000
26.365854
58
0.534759
false
3.319527
false
false
false
vaideesg/omsdk
omsdk/http/sdkrestpdu.py
1
4617
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # # Copyright © 2017 Dell Inc. or its subsidiaries. All rights reserved. # Dell, EMC, and other trademarks are trademarks of Dell Inc. or its # subsidiaries. Other trademarks may be trademarks of their respective owners. # # This program is free software: you can redistr...
gpl-3.0
-5,916,098,338,975,813,000
31.514085
90
0.555772
false
3.601404
false
false
false
saltares/conjugate
scraping/verbix_parser.py
1
5538
# -*- coding: utf-8 -*- import logging from bs4 import BeautifulSoup class VerbixParser: def parse(self, document): try: translation = self.__get_translation(document) translation['modes'] = self.__get_modes(document) return translation except Exception as e: ...
apache-2.0
-600,681,630,555,227,300
35.682119
108
0.503611
false
4.350353
false
false
false
googleads/google-ads-python
google/ads/googleads/v6/services/types/customer_label_service.py
1
4711
# -*- 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 o...
apache-2.0
-7,649,088,819,946,955,000
32.892086
124
0.680535
false
4.374188
false
false
false
google/starthinker
dags/dbm_to_bigquery_dag.py
1
6434
########################################################################### # # 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 # # https://www.apache.org/l...
apache-2.0
4,860,727,558,291,293,000
33.778378
146
0.526111
false
4.42808
false
false
false
OpenChemistry/tomviz
tomviz/python/BinVolumeByTwo.py
1
1208
def transform(dataset): """Downsample volume by a factor of 2""" from tomviz import utils import scipy.ndimage import numpy as np array = dataset.active_scalars # Downsample the dataset x2 using order 1 spline (linear) # Calculate out array shape zoom = (0.5, 0.5, 0.5) result_shap...
bsd-3-clause
-6,325,547,662,108,176,000
35.606061
72
0.573675
false
4.108844
false
false
false
Azure/azure-sdk-for-python
sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/_models.py
1
33978
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
3,953,882,401,992,869,000
35.732973
146
0.621343
false
3.972177
false
false
false
google-research/google-research
gfsa/datasets/graph_bundle.py
1
10309
# 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
4,322,004,806,651,760,000
36.900735
80
0.690465
false
3.799853
true
false
false
oscurart/BlenderAddons
oscurart_mesh_cache_tools.py
1
17041
bl_info = { "name": "Mesh Cache Tools", "author": "Oscurart", "version": (1, 0, 1), "blender": (2, 70, 0), "location": "Tools > Mesh Cache Tools", "description": "Tools for Management Mesh Cache Process", "warning": "", "wiki_url": "", "tracker_url": "https://developer.blender.org/ma...
gpl-2.0
1,742,715,747,388,060,400
34.725367
109
0.593216
false
3.602748
false
false
false
u3099811/BaxterTictacToe
src/ros_speech2text/test/test_speech_detection.py
2
4124
from unittest import TestCase import numpy as np from s2t.speech_detection import (StaticSilenceDetector, DynamicSilenceDetector, normalize, NORMAL_MAXIMUM, add_silence) class TestNormalize(TestCase): @staticm...
apache-2.0
-6,681,522,988,290,768,000
34.551724
69
0.620029
false
3.278219
true
false
false
daq-tools/kotori
kotori/io/export/tabular.py
1
3547
# -*- coding: utf-8 -*- # (c) 2016-2021 Andreas Motl <andreas.motl@elmyra.de> import tempfile from twisted.logger import Logger, LogLevel from twisted.web.template import renderElement from kotori.io.export.html import DatatablesPage from kotori.io.protocol.util import get_data_uri from kotori.io.export.util import dat...
agpl-3.0
-3,478,968,317,857,207,000
38.411111
109
0.627855
false
3.777423
false
false
false
pmav99/praktoras
utils/debug.py
1
1868
# (C) Fractal Industries, Inc. 2016 # (C) Datadog, Inc. 2010-2016 # All rights reserved # Licensed under Simplified BSD License (see LICENSE) # stdlib from pprint import pprint import inspect import os import sys # project from config import get_checksd_path, get_confd_path from util import get_os def run_check(nam...
bsd-3-clause
-4,320,495,523,042,940,400
26.470588
101
0.631692
false
3.677165
true
false
false
wagtail/wagtail
wagtail/admin/migrations/0001_create_admin_access_permissions.py
6
1753
# -*- coding: utf-8 -*- from django.db import migrations def create_admin_access_permissions(apps, schema_editor): ContentType = apps.get_model('contenttypes.ContentType') Permission = apps.get_model('auth.Permission') Group = apps.get_model('auth.Group') # Add a content type to hang the 'can access ...
bsd-3-clause
8,761,670,193,491,936,000
32.075472
95
0.685111
false
4.224096
false
false
false
makerdao/maker.py
pymaker/lifecycle.py
1
20908
# This file is part of Maker Keeper Framework. # # Copyright (C) 2017-2018 reverendus # # 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 opti...
agpl-3.0
6,317,996,291,367,452,000
41.238384
127
0.611775
false
4.327882
false
false
false
anthropo-lab/XP
XP Expurgement/__temp_migrations/XP_vol_update/0001_initial.py
1
9734
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2019-01-30 12:31 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import otree.db.models import otree_save_the_change.mixins class Migration(migrations.Migration): initial = True depende...
gpl-3.0
8,390,676,115,477,453,000
78.786885
295
0.584652
false
3.355395
false
false
false
vit2/vit-e2
lib/python/Components/InputDevice.py
33
8049
from config import config, ConfigSlider, ConfigSubsection, ConfigYesNo, ConfigText, ConfigInteger from os import listdir, open as os_open, close as os_close, write as os_write, O_RDWR, O_NONBLOCK from Tools.Directories import pathExists from fcntl import ioctl import struct # asm-generic/ioctl.h IOC_NRBITS = 8L IOC_TY...
gpl-2.0
-4,273,489,425,222,370,300
35.256757
140
0.707293
false
3.091014
true
false
false
torcato/JupyterTextAuthenticator
setup.py
1
2156
#!/usr/bin/env python # coding: utf-8 # Copyright (c) Juptyer Development Team. # Distributed under the terms of the Modified BSD License. #----------------------------------------------------------------------------- # Minimal Python version sanity check (from IPython/Jupyterhub) #-----------------------------------...
mit
46,384,590,383,777,530
30.705882
108
0.549165
false
4.170213
false
false
false
williamdjones/protein_binding
create_h5.py
1
1855
#!/home/wdjo224/miniconda3/envs/protein_binding/bin python import h5py import pandas as pd import numpy as np import glob import argparse from tqdm import tqdm parser = argparse.ArgumentParser(description="Combine fragmented csv files, output h5") parser.add_argument('--i',type=str,help="input file paths to csv fil...
mit
-407,863,735,588,689,100
32.727273
109
0.58221
false
3.454376
false
false
false
sen506/Runner
RunnerTools/ReplaceVariable.py
1
2145
import gc; import re; import os; from SingleLineXMLOperator import SingleLineXMLOperator as reader; regFindVariable = re.compile("(%.*?%)"); regFindWildCard = re.compile(r";?([^\s]+\\\*);?"); class ReplaceVariable(): def __init__(self): pass; @staticmethod def _replaceVar(dict, key, visit...
gpl-2.0
6,524,961,556,899,778,000
32.53125
121
0.529604
false
3.809947
false
false
false
karstenw/nodebox-pyobjc
examples/Extended Application/matplotlib/examples/statistics/hexbin_demo.py
1
3189
""" =========== Hexbin Demo =========== Plotting hexbins with Matplotlib. Hexbin is an axes method or pyplot function that is essentially a pcolor of a 2-D histogram with hexagonal cells. It can be much more informative than a scatter plot. In the first subplot below, try substituting 'scatter' for 'hexbin'. """ im...
mit
-424,524,509,301,708,200
23.914063
82
0.610223
false
2.684343
false
false
false
mancoast/CPythonPyc_test
fail/314_test_compileall.py
2
2628
import sys import compileall import imp import os import py_compile import shutil import struct import sys import tempfile import time from test import support import unittest import io class CompileallTests(unittest.TestCase): def setUp(self): self.directory = tempfile.mkdtemp() self.source_path...
gpl-3.0
-1,128,210,697,735,988,400
29.206897
86
0.606545
false
3.738265
true
false
false
mlperf/training_results_v0.7
Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/3rdparty/onnx-tensorrt/third_party/onnx/onnx/backend/test/case/node/sum.py
2
1323
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import numpy as np # type: ignore import onnx from ..base import Base from . import expect class Sum(Base): @staticmethod def export(): # type: () -> None ...
apache-2.0
1,495,014,796,961,692,000
29.068182
71
0.530612
false
3.5
false
false
false
chrisspen/wptablefinder
setup.py
1
1424
#!/usr/bin/env python # -*- coding: utf-8 -*- import os from distutils.core import setup, Command import wptablefinder # class TestCommand(Command): # description = "Runs unittests." # user_options = [] # def initialize_options(self): # pass # def finalize_options(self): # pass # de...
mit
3,092,376,200,540,518,400
28.666667
71
0.601124
false
3.605063
false
false
false
AsherYang/ThreeLine
server/ffstore/handler/WxLoginHandler.py
1
2408
#! /usr/bin/python # -*- coding:utf-8 -*- """ Author: AsherYang Email: ouyangfan1991@gmail.com Date: 2018/7/1 Desc: 用于登录运维微信 本类基于wxpy 以及 wechat_sender 同时结合自己weichatutil(私有pypi源) 进行搭建 注意: 1. 后台监听账号需要事先登录 2. 接受者,必须是后台监听的微信号的好友,才能成功发送消息 """ import sys sys.path.append('../') import tornado.web from tornado.web...
apache-2.0
-9,052,842,296,962,202,000
33.46875
106
0.610154
false
2.648259
false
false
false
openstack/smaug
karbor/objects/trigger.py
1
3420
# 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 # d...
apache-2.0
1,821,232,033,423,947,500
32.861386
78
0.647076
false
3.899658
false
false
false
specify/specify7
specifyweb/stored_queries/queryfieldspec.py
1
9619
import re, logging from collections import namedtuple, deque from sqlalchemy import orm, sql from django.core.exceptions import ObjectDoesNotExist from specifyweb.specify.models import datamodel from specifyweb.specify.uiformatters import get_uiformatter from . import models from .query_ops import QueryOps logger ...
gpl-2.0
-6,340,187,569,203,445,000
39.415966
114
0.577711
false
3.846062
false
false
false
ch3pjw/junction
jcn/container_elements.py
1
12669
# Copyright (C) 2013 Paul Weaver <p.weaver@ruthorn.co.uk> # # 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. # # This pro...
gpl-3.0
6,586,194,748,719,492,000
31.236641
78
0.565159
false
4.043728
false
false
false
SoftwearDevelopment/spynl
spynl/main/about/endpoints.py
1
4976
""" This module provides information for version, db, build and enviroment. """ import sys import os import json from pyramid.renderers import render from pyramid.i18n import negotiate_locale_name from spynl.main.exceptions import SpynlException from spynl.main.version import __version__ as spynl_version from spynl....
mit
-1,076,275,507,305,061,600
30.897436
81
0.61455
false
3.896633
false
false
false
SINGROUP/MechAFM
simple-vafm-image.py
1
10712
#!usr/bin/env python import numpy, matplotlib, os, sys, gzip, glob import argparse from copy import deepcopy import matplotlib.pyplot as plt from matplotlib.ticker import MultipleLocator, FormatStrFormatter # Parse command line parser = argparse.ArgumentParser(description="Create a vafm image from the mechafm output....
mit
5,220,360,481,633,062,000
35.311864
269
0.581497
false
2.788857
false
false
false
ImageEngine/gaffer
python/GafferUI/CompoundNumericPlugValueWidget.py
7
8226
########################################################################## # # Copyright (c) 2011-2013, John Haddon. All rights reserved. # Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted prov...
bsd-3-clause
-4,640,846,214,003,259,000
34.004255
118
0.703015
false
3.581193
false
false
false
christobal54/aei-py
bin/et-unmix.py
1
13880
#!/usr/bin/python ##### # et_unmix.py performs least-squares # spectral ummixing on an image file using the # HyperspectralUnmixing module from the Orfeo Toolbox # # c. 2016 Christopher Anderson ##### import os import random import sys import gdal as gdal import numpy as np import earthtools as et # create a cla...
gpl-2.0
3,827,176,553,486,079,000
31.505855
116
0.534942
false
3.757445
false
false
false
gragas/buffalo
buffalo/examples/pong/play.py
1
1178
import pygame from buffalo import utils from buffalo.scene import Scene from slider import Slider from square import Square class Play(Scene): def __init__(self): Scene.__init__(self) self.BACKGROUND_COLOR = (0, 0, 0, 255) self.slider1 = Slider( (50, utils.SCREEN_H // 2...
gpl-2.0
9,080,931,699,418,778,000
25.772727
96
0.56961
false
3.31831
false
false
false
Abhinav117/pymtl
pisa/__init__.py
4
2298
#========================================================================= # Modular Python Build System __init__ file #========================================================================= # List of collection modules import elf import pisa_inst_test_utils # List of single-class modules from IsaImpl ...
bsd-3-clause
-7,981,628,258,942,820,000
23.709677
74
0.704091
false
2.934866
true
false
false
glaudsonml/kurgan-ai
libs/Transport.py
1
1984
import sys,os import re, random import time, signal from multiprocessing import Process import stomp import re from daemonize import Daemonize from os.path import basename current_dir = os.path.basename(os.getcwd()) if current_dir == "agents": sys.path.append('../') if current_dir == "Kurgan-Framework": sys.pa...
apache-2.0
-5,780,925,143,660,467,000
26.943662
103
0.648185
false
3.263158
false
false
false
hammerhorn/hammerhorn-jive
toilet/toilet_preview.py
1
1974
#!/usr/bin/env python """ Allow the user to preview the available fonts for toilet (or figlet). """ import argparse import os import subprocess import sys from cjh.cli import Cli from cjh.config import Config from cjh.lists import PlainList __author__ = 'Chris Horn <hammerhorn@gmail.com>' __license__ = 'GPL' ## PR...
gpl-2.0
-4,797,768,268,407,850,000
23.675
75
0.580041
false
3.236066
false
false
false
ROCmSoftwarePlatform/Tensile
Tensile/Tests/extended/convolution_config/test_backwardweights_nchw.py
1
6387
################################################################################ # Copyright 2020-2021 Advanced Micro Devices, Inc. All rights reserved. # # 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 t...
mit
-2,465,922,993,764,194,000
52.672269
96
0.633318
false
3.441272
true
false
false
kostassabulis/nbody-workshop-2015
nbody/leapfrog_gpu.py
1
1596
"""Leapfrog integrator""" import gnumpy as gpu import numpy as np def calculate_dt(v, delta_v, N_bodies, alpha): a_max = 0. for i in range(N_bodies): delta_v = gpu.garray(delta_v) a = gpu.sum(delta_v[i,:]**2) if a > a_max: a_max = a a_max_index = i ...
mit
5,044,158,288,615,213,000
32.957447
103
0.519424
false
2.819788
false
false
false
DavidWhittingham/arcpyext
arcpyext/_patches/_mp/Layer.py
1
3405
# coding=utf-8 """ This module contains patches to Esri's *arcpy._mp.Layer* class. These patches may insert functionality or fix issues directly in the *arcpy._mp.Layer* class. """ import arcpy from .Field import Field from .CimEditor import CimEditor from ._cim_helpers import enrich_conn_props, recursive_process_co...
bsd-3-clause
-6,808,526,644,822,792,000
39.547619
123
0.702496
false
4.283019
false
false
false
SalesforceFoundation/CumulusCI
cumulusci/tasks/salesforce/__init__.py
1
3767
"""Salesforce tasks This package uses a lazy import system inspired by werkzeug (for startup speed and to avoid problems with import cycles). We should be able to replace LazyModule with a module-level __getattr__ one we drop support for Python 3.6. """ from types import ModuleType import sys ORIGINS = { "BaseRe...
bsd-3-clause
3,892,176,829,202,857,500
47.294872
100
0.731617
false
3.759481
false
false
false
blomquisg/heat
heat/common/utils.py
1
10575
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
apache-2.0
8,695,305,888,241,845,000
27.427419
79
0.585721
false
4.095662
false
false
false
lanesawyer/island
forum/views/newthread.py
1
4055
from django import forms from django.conf import settings from django_mako_plus.controller import view_function, RedirectException from django.http import HttpResponse, HttpResponseRedirect, Http404 from django.utils.safestring import mark_safe from homepage import models as hmod from lib.filters import * import lib.wi...
apache-2.0
-6,627,462,575,390,975,000
42.148936
175
0.697904
false
3.744229
false
false
false
numenta/htmresearch
htmresearch/support/reberGrammar.py
12
5861
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2015, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
agpl-3.0
-3,088,743,693,171,959,300
27.31401
90
0.616789
false
3.58033
false
false
false
krafczyk/spack
var/spack/repos/builtin/packages/r-proc/package.py
4
2043
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
-2,475,474,809,280,583,000
45.431818
78
0.664709
false
3.714545
false
false
false
sanguinariojoe/FreeCAD
src/Mod/Draft/DraftFillet.py
16
7906
# *************************************************************************** # * Copyright (c) 2020 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> * # * * # * This program is free software; you can redistribute it and/or modify * # * it...
lgpl-2.1
-2,056,459,339,708,119,000
40.177083
79
0.626613
false
4.141435
false
false
false
leafstorm/barry
barry/utils.py
1
4377
#!/usr/bin/env python # -*- coding: utf-8 -*- """ barry.utils =========== Internal utilities used by Barry, you know the drill. :copyright: (C) 2013, Matthew Frazier :license: MIT/X11, see LICENSE for details """ import os import time import subprocess def run_command(*command, **options): """ Runs a comman...
mit
-733,559,894,214,382,300
37.394737
77
0.573452
false
4.385772
false
false
false
buriy/django-transhette
transhette/templatetags/transhette_tags.py
1
3558
import copy from django import template from django.conf import settings from django.template.loader import render_to_string from django.template import TemplateSyntaxError, TokenParser from django.templatetags.i18n import TranslateNode from django.utils.translation import get_language from django.utils.translation.tr...
lgpl-3.0
-8,393,488,793,244,513,000
27.926829
82
0.62226
false
3.940199
false
false
false
klahnakoski/MySQL-to-S3
vendor/jx_python/expressions.py
1
11809
# encoding: utf-8 # # # 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/. # # Author: Kyle Lahnakoski (kyle@lahnakoski.com) # from __future__ import absolute_import from __f...
mpl-2.0
5,366,085,541,418,608,000
31.986034
150
0.618935
false
2.982824
false
false
false
mitchellrj/touchdown
touchdown/provisioner/provisioner.py
1
1418
# 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
9,114,960,031,360,331,000
27.938776
83
0.716502
false
4.039886
false
false
false
nloyolag/music-albums
music_albums/views.py
1
1628
#coding:utf-8 # Python imports import datetime # Django imports from django.http import HttpResponse from django.views.generic import View from django.contrib import messages from django.utils import timezone import django.template.context import django.shortcuts # Music albums imports from music_albums import model...
mit
4,248,868,244,806,494,700
24.84127
59
0.576167
false
4.59887
false
false
false
messagebird/python-rest-api
messagebird/group.py
1
1180
from messagebird.base import Base from messagebird.base_list import BaseList class ContactReference(Base): def __init__(self): self.href = None self.totalCount = None class GroupList(BaseList): def __init__(self): # Signal the BaseList that we're expecting items of type Group... ...
bsd-2-clause
-5,206,481,709,982,531,000
22.137255
73
0.64322
false
4.290909
false
false
false
ZwickyTransientFacility/ztf_sim
ztf_sim/field_selection/srg.py
1
5855
""" @author: yuhanyao """ from glob import glob import os import logging import astropy.constants as const import numpy as np import pandas as pd from astropy import units as u from astropy.coordinates import SkyCoord from astropy.time import Time from astropy.coordinates import get_sun from ..Fields import Fields from...
bsd-3-clause
7,706,495,551,533,530,000
33.239766
249
0.619812
false
2.990296
false
false
false
nonNoise/PyGamepad
PyGamepad.py
1
4232
# -*- coding: utf-8 -*- ############################################################ #The MIT License (MIT) #Copyright (c) 2017 Yuta KItagami #Project: https://github.com/nonNoise/akilib ############################################################ import struct class Gamepad : def __init__(self,fileaddr): ...
mit
-5,679,839,865,987,085,000
31.46875
86
0.328922
false
3.906015
false
false
false
MTG/freesound-datasets
datasets/migrations/0001_initial.py
1
4134
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-03-14 15:20 from __future__ import unicode_literals import django.contrib.postgres.fields.jsonb from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ]...
agpl-3.0
1,858,602,364,875,152,400
44.933333
143
0.571359
false
4.31074
false
false
false
gic888/MIEN
nmpml/parameters.py
1
14200
#!/usr/bin/evn python ## Copyright (C) 2005-2006 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 License, or (at your option) any later version. ##...
gpl-2.0
8,734,828,119,064,252,000
30.767338
633
0.676549
false
3.032244
false
false
false
solter/pyTutorial
src/quadratic_eqn/simple_script.py
1
1877
#!/usr/bin/env python3 """ This is a multiline comment. Python ignores the entire section between the triple quotes. These type of comments are commonly used for documentation (docstrings). You should include 1 docstring at the top of all python modules describing what the module does. here is the docstring for thi...
mit
5,172,645,825,371,563,000
34.415094
101
0.708578
false
3.253033
false
false
false
JeffPaine/nhd_search
nhd_search/settings.py
1
2708
""" Django settings for nhd_search project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ import os from django.conf.global_settings import TEMPLATE_CONTEXT_PROC...
mit
-4,095,844,845,229,414,400
23.396396
83
0.72969
false
3.274486
false
false
false
nbartos/calico
calico/felix/refcount.py
1
13755
# Copyright (c) Metaswitch Networks 2015. All rights reserved. import collections import functools import logging import weakref from calico.felix.actor import Actor, actor_message import gevent _log = logging.getLogger(__name__) # States that a reference-counted actor can be in. # Initial state, created but not ye...
apache-2.0
-8,331,161,654,563,831,000
38.639769
79
0.602763
false
4.019579
false
false
false
alexksikes/wikitrivia
app/models/categories.py
1
2859
# Author: Alex Ksikes lang = 'en' base_query = '/wiki/ site:' + lang + '.wikipedia.org -disambiguation -"up to conform" -"a stub" \ -"is the * day" -"was a * year" -"list of years"' yahoo_queries = dict( comics = '"comic books" OR "comic book" OR "manga" OR "comics" OR "graphic novel"', movies = 'tv OR movie ...
agpl-3.0
5,350,080,876,497,182,000
51
183
0.634488
false
3.145215
false
false
false
reclaro/pacmanex
pacmanex/pacmanexplained.py
1
2223
import pygame TILE_DIM = 20 LINES = 36 COL = 28 class Game(object): def _draw_maze(self, maze): # for x in range(TILE_DIM/2, COL * TILE_DIM , TILE_DIM): # self.maze[(x,)] pass def get_maze(self): MAZE = {} if not self.MAZE: self.MAZE = _...
apache-2.0
3,431,342,124,482,706,000
35.442623
95
0.555106
false
3.705
false
false
false
FireBladeNooT/Medusa_1_6
medusa/nzb_splitter.py
1
7853
# coding=utf-8 # Author: Nic Wolfe <nic@wolfeden.ca> # # This file is part of Medusa. # # Medusa 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 late...
gpl-3.0
9,022,817,339,063,969,000
35.18894
134
0.631733
false
3.623904
false
false
false
TuKo/brainiak
examples/factoranalysis/get_tfa_input_from_nifti.py
7
2657
# Copyright 2016 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://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
apache-2.0
6,783,961,296,342,298,000
34.905405
113
0.671058
false
3.205066
false
false
false
NYU-CS6313-Projects/Charts-for-CompStat
data/crash_cleaner.py
1
3650
#!/user/bin/python # this python script cleans raw crash data and subsets the last n days of observations # if n=-1 all rows of the raw dataset are kept # WEEK and YEAR attributes are derived import pandas as pd import numpy as np import datetime as dt import re import os import logging dpath = './' def date_parser...
mit
-4,805,883,582,482,366,000
30.73913
116
0.631507
false
2.784134
false
false
false
joostvanzwieten/nutils
nutils/matrix/__init__.py
1
3464
# Copyright (c) 2014 Evalf # # 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, publish, distribute, s...
mit
6,220,068,468,375,703,000
39.27907
127
0.726617
false
3.677282
false
false
false
Pulgama/supriya
tests/test_patterns_Pbus_Pfx_Pgroup.py
1
7049
import pytest import uqbar.strings import supriya.nonrealtime import supriya.patterns import supriya.synthdefs import supriya.ugens with supriya.synthdefs.SynthDefBuilder(in_=0, out=0) as builder: source = supriya.ugens.In.ar(bus=builder["in_"]) source = supriya.ugens.Limiter.ar(source=source) supriya.uge...
mit
8,053,321,620,209,914,000
27.083665
80
0.350546
false
4.467047
false
false
false
anurag03/integration_tests
cfme/tests/intelligence/reports/test_validate_chargeback_report.py
1
27765
# -*- coding: utf-8 -*- # """ Chargeback reports are supported for all infra and cloud providers. Chargeback reports report costs based on 1)resource usage, 2)resource allocation Costs are reported for the usage of the following resources by VMs: memory, cpu, network io, disk io, storage. Costs are reported for the al...
gpl-2.0
5,481,742,980,819,304,000
40.877828
100
0.653052
false
3.807597
true
false
false
ShadowPrince/seasondog
seasondog/database.py
1
3947
import os from seasondog import info from seasondog import runtime as r NAME = "plain" VERSION = 1.0 DB = 1 TRANSACTION = 2 PATH = 3 PLAYER_ARGS = 4 EPISODE = 5 STRLEN = 512 transaction = None def text(s, ln): if len(s) <= ln: return s + "".join([chr(0) for i in range(ln - len(s))]) else: ...
epl-1.0
4,152,003,828,732,872,000
22.35503
115
0.520395
false
3.456217
false
false
false
daeseokyoun/youtube-dl
youtube_dl/extractor/cspan.py
17
6350
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( int_or_none, unescapeHTML, find_xpath_attr, smuggle_url, determine_ext, ExtractorError, ) from .senateisvp import SenateISVPIE class CSpanIE(InfoExtractor): _VALID_URL = r'https?://(...
unlicense
-2,042,299,595,607,223,600
40.503268
251
0.519843
false
3.518006
false
false
false
zstackio/zstack-woodpecker
integrationtest/vm/mini/log/test_mn_log_delete.py
1
3683
''' management_server_log auto delete test 1.get global config value & mn_log delete threshold 2.mock log files(management-server-*.log.gz) 3.resize management-server.log, bigger than threshold(default 450MB) 4.zstack_ctl restart_node 5.check logs size @author Zhaohao ''' import zstackwoodpecker.test_lib as test_lib im...
apache-2.0
757,431,186,992,857,600
50.873239
175
0.712463
false
2.844015
true
false
false
etuna-SBF-kog/Stadsparken
env/lib/python2.7/site-packages/compressor/parser/lxml.py
4
1894
from __future__ import absolute_import from django.core.exceptions import ImproperlyConfigured from django.utils.encoding import smart_unicode from compressor.exceptions import ParserError from compressor.parser import ParserBase from compressor.utils.decorators import cached_property class LxmlParser(ParserBase): ...
gpl-3.0
882,375,893,643,373,000
32.22807
82
0.63358
false
4.314351
false
false
false
JaneliaSciComp/Ax
ax1b.py
1
4714
#from numba import autojit import pyfftw import struct import numpy as np import glob import sys import os #import pdb import math from scipy import stats import scipy.io.wavfile as wavfile from dpss import dpss def nextpow2(i): n = 2 while n < i: n = n * 2 return n #@autojit #@profile def ftest(data, ta...
bsd-3-clause
1,757,764,456,536,943,000
28.647799
86
0.591218
false
2.295034
false
false
false
gamesbrewer/kegger
kegger/kegger.py
1
4761
#!C:\Python27\python.exe from distutils.dir_util import copy_tree, remove_tree import os import sys import getopt import fileinput import kegger frameworks = ['flask', 'bottle', 'pyramid', 'cherrypy'] framework = '' ''' Basically, this handles the option when kegger is called. ''' def print_error(error=None): ...
cc0-1.0
5,359,503,531,914,657,000
35.623077
108
0.606385
false
3.58509
false
false
false
alixedi/django_reform
reform/templatetags/reform.py
1
1627
from django import template from django.template.loader import get_template import itertools register = template.Library() def grouper(n, iterable, fillvalue=None): "grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx" args = [iter(iterable)] * n return itertools.izip_longest(fillvalue=fillvalue, *args) @registe...
bsd-3-clause
-1,983,321,310,183,687,000
33.617021
74
0.645974
false
3.837264
false
false
false
dippatel1994/oppia
extensions/rules/code_evaluation.py
9
2477
# coding: utf-8 # # Copyright 2014 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
apache-2.0
3,927,778,112,214,010,400
37.107692
79
0.681873
false
4.219761
false
false
false
jwodder/doapi
doapi/cli/action.py
1
4733
import argparse from itertools import chain from six.moves import map # pylint: disable=redefined-builtin from . import _util as util from ..action import Action def main(argv=None, parsed=None): parser = argparse.ArgumentParser(parents=[util.universal], prog=...
mit
-911,755,895,452,835,600
44.509615
79
0.525671
false
4.577369
false
false
false
CurrencyCloud/currencycloud-python
src/currencycloud/clients/conversions.py
1
3531
'''This module provides a class for Conversions calls to the CC API''' from currencycloud.http import Http from currencycloud.resources import PaginatedCollection, Conversion class Conversions(Http): '''This class provides an interface to the Conversions endpoints of the CC API''' def create(self, **kwargs)...
mit
-8,947,009,892,605,252,000
49.442857
109
0.671481
false
4.348522
false
false
false
jakeogh/anormbookmarker
anormbookmarker/test/tests/WordMisSpelling/conflicting_misspelling.py
1
1635
#!/usr/bin/env python3 from anormbookmarker.test.test_enviroment import * with self_contained_session(CONFIG.database_timestamp) as session: BASE.metadata.create_all(session.bind) # make tag to misspell later plants = Tag.construct(session=session, tag='plants') session.commit() # make tag to mis...
mit
1,083,468,890,251,808,400
36.159091
105
0.642813
false
3.820093
false
true
false
azjps/bokeh
examples/plotting/server/selection_histogram.py
7
3668
# You must first run "bokeh serve" to view this example import numpy as np from bokeh.client import push_session from bokeh.layouts import row, column from bokeh.models import BoxSelectTool, LassoSelectTool, Spacer from bokeh.plotting import curdoc, figure session = push_session(curdoc()) # create three normal popu...
bsd-3-clause
-8,586,804,989,113,477,000
37.208333
101
0.682116
false
2.677372
false
false
false
nacc/autotest
server/hosts/base_classes_unittest.py
3
3991
#!/usr/bin/python import unittest try: import autotest.common as common except ImportError: import common from autotest.client.shared import global_config from autotest.client.shared.test_utils import mock from autotest.server import utils from autotest.server.hosts import base_classes, bootloader class tes...
gpl-2.0
-5,040,661,570,290,258,000
33.704348
73
0.602105
false
3.833814
true
false
false
crossroadchurch/paul
openlp/plugins/presentations/presentationplugin.py
1
9070
# -*- coding: utf-8 -*- # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 ############################################################################### # OpenLP - Open Source Lyrics Projection # # ------------------------------------------------------...
gpl-2.0
164,290,730,165,613,000
46.486911
120
0.577398
false
4.900054
false
false
false
artminster/artminster
contrib/billing/views.py
1
2983
from django.core.urlresolvers import reverse from django.contrib import messages from django.views.generic import TemplateView, FormView from django.views.generic.detail import DetailView from django.views.generic.edit import CreateView, UpdateView, DeleteView from django.conf import settings from artminster.core.util...
mit
-5,582,137,184,308,409,000
36.772152
112
0.730473
false
3.468605
false
false
false
yxdragon/myvi
myvi/manager.py
1
9225
import struct import numpy as np import moderngl from time import time from skimage.io import imread import numpy as np from math import sin, cos, tan, pi import scipy.ndimage as nimg def look_at(eye, target, up, dtype=None): forward = (target - eye)/np.linalg.norm(target - eye) side = (np.cross(forward, up))...
bsd-3-clause
-4,899,586,009,631,321,000
31.258741
90
0.580379
false
2.686372
false
false
false
OCForks/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/servers/http_server_base_unittest.py
121
2675
# Copyright (C) 2012 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
5,314,754,336,002,327,000
45.12069
77
0.73757
false
4.342532
true
false
false
Fitblip/python-jsonschema-objects
python_jsonschema_objects/validators.py
1
7706
import six class ValidationError(Exception): pass klassType = type def multipleOf(param, value): quot, rem = divmod(value, param) if rem != 0: raise ValidationError( "{0} was not a multiple of {1}".format(value, param)) def type(p...
mit
6,715,468,453,388,050,000
35.178404
102
0.537373
false
4.90828
false
false
false
matteraByte/5eDataParser
Objects/MonsterFieldsXml.py
1
1674
class MonsterFieldsSpecialAbilities(object): ROOT = 'trait' NAME = 'name' DESCRIPTION = 'text' class MonsterFieldsActions(object): ROOT = 'action' NAME = 'name' DESCRIPTION = 'text' # could be multiple nodes that need to be stitched together DAMAGE_DICE = 'attack' DAMAGE_BONUS = 'atta...
gpl-3.0
-1,193,892,135,444,939,300
24.753846
85
0.649343
false
3.18251
false
false
false
OGRECave/blender2ogre
io_ogre/ogre/mesh.py
1
39282
import os, time, sys, logging import bmesh import mathutils # When bpy is already in local, we know this is not the initial import... if "bpy" in locals(): # ...so we need to reload our submodule(s) using importlib import importlib if "report" in locals(): importlib.reload(report) if "material"...
lgpl-2.1
-7,209,880,084,558,670,000
42.45354
230
0.502622
false
4.056801
false
false
false
thjm/Sketches
Python/Flasher/readFLASH.py
1
6949
#! /usr/bin/env python # # readFLASH.py: example for reading from an EPROM/EEPROM # plugged into the FlashReader hardware # import sys import time # for parsing command line options from argparse import ArgumentParser # reading/writing Intel Hex files # see also: http://pythonhosted.org/IntelHex from i...
mit
4,651,602,230,736,952,000
29.47807
90
0.611743
false
3.365133
false
false
false