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
summerlight/anlp
src/dataset.py
1
1423
import glob import json from data_gen import segmentation def iter_segment(doc): text = doc['text'] for segment in doc['metadata']: yield segment['lang'], text[segment['begin']:segment['end']] def iter_sentences(doc): for lang, segment in iter_segment(doc): for st in segmentation.by_sent...
apache-2.0
8,273,688,745,576,388,000
23.982456
72
0.598032
false
rhyolight/nupic.son
tests/app/soc/modules/gci/views/helper/test_redirect_helper.py
1
2784
# Copyright 2012 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
apache-2.0
-4,398,309,877,168,222,700
31.372093
74
0.704741
false
spininertia/graph-mining-rdbms
src/phase-3/src/radius/radius.py
1
5219
import sys import random import math def time_it(fn): def wrapped(*args): import time start = time.time() fn(*args) used = time.time() - start print "%s used %s" % (str(fn), used) return wrapped @time_it def assign_fm(conn, tbl_name, edge_table, k): cur = conn.cursor() # cur.execute("delete from %s" % t...
mit
5,590,543,969,746,547,000
34.746575
207
0.670627
false
subhrm/google-code-jam-solutions
solutions/helpers/CodeJam-0.3.0/codejam/datastructures/summing_list.py
1
1482
class summing_list: layers = [[0]] size = 0 def __init__(self, iter=None): if iter != None: for i in iter: self.append(i) def _sum(self, i): t = 0 for r in self.layers: if i % 2: t += r[i - 1] i >>= 1 r...
mit
-5,533,822,066,006,853,000
22.52381
62
0.434548
false
mschuurman/FMSpy
nomad/core/atom_lib.py
1
1315
""" A library containing atom widths, atomic numbers, etc. """ import nomad.math.constants as constants atom_name = ['X', 'H', 'D', 'T', 'He', 'Li', 'Be', 'B', 'C', 'N', 'O', 'F', 'Ne', 'Na', 'Mg', 'Al', 'Si', 'P', 'S', 'Cl', 'Ar'] atom_width = [0.0, 4.5, 4.5, 4.5, 0.0, 0.0, 0.0, 0.0, 22.5, 19.5, 13.0,...
lgpl-3.0
1,649,243,495,155,439,900
40.09375
80
0.551331
false
mnahm5/django-estore
Lib/site-packages/awscli/customizations/configure/configure.py
1
5970
# Copyright 2016 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
mit
-5,048,483,693,558,224,000
41.340426
78
0.623116
false
mihirskulkarni/Marathi_entropy
vishwakosh_book.py
1
2497
"""This file downloads a particular volume of Marathi Vishwakosh (https://marathivishwakosh.maharashtra.gov.in/) and saves the pages spread across twenty files using a modulo of 20 to the number of Vishkosh page entry. Run using 'python vishwkosh_book.py volume' from terminal where volume is the Volume of Vishwakosh y...
mit
4,571,756,763,722,109,400
38.634921
218
0.638767
false
ProfessorX/Config
.PyCharm30/system/python_stubs/-1247972723/gtk/_gtk/Button.py
1
10341
# encoding: utf-8 # module gtk._gtk # from /usr/lib/python2.7/dist-packages/gtk-2.0/gtk/_gtk.so # by generator 1.135 # no doc # imports import atk as __atk import gio as __gio import gobject as __gobject import gobject._gobject as __gobject__gobject from Bin import Bin from Activatable import Activatable class But...
gpl-2.0
6,431,609,921,830,176,000
34.536082
117
0.653805
false
notmatthancock/notmatthancock.github.io
code/py/region_growing/test_rg_c_nbhds.py
1
1325
import numpy as np import time import region_growing_python as rgp import region_growing as rgc from mayavi import mlab nx = 61; ny = 51; nz = 71; tx = np.linspace(-3,3,nx) ty = np.linspace(-3,3,ny) tz = np.linspace(-3,3,nz) x,y,z = np.meshgrid(tx,ty,tz) w = x**4 - 5*x**2 + y**4 - 5*y**2 + z**4 - 5*z**2 vol = -np....
mit
5,758,518,461,227,146,000
25.5
76
0.524528
false
wpoely86/vsc-base
lib/vsc/utils/docs.py
2
2359
# # # Copyright 2015-2015 Ghent University # # This file is part of vsc-base, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en), # the Hercules foundation (htt...
lgpl-2.1
598,923,523,764,895,000
31.763889
111
0.682493
false
lingcheng99/Algorithm
UnorderedList.py
1
2979
""" Implement Unordered List, or linked list, in python. The building block is the class Node. Refer to http://interactivepython.org/runestone/static/pythonds/BasicDS/ImplementinganUnorderedListLinkedLists.html With added functions append(),index(),insert(),pop() """ class Node: def __init__(self,initdata): ...
mit
-6,844,272,348,078,900,000
25.131579
115
0.540785
false
lrowe/experimental.cssselect
src/experimental/cssselect.py
1
32885
# Copyright (c) 2004 Ian Bicking. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the fo...
bsd-3-clause
3,333,491,425,375,984,600
30.711668
141
0.517075
false
comradealain/project_SM
simulation.py
1
2956
import random def generateTBA(rda): if rda == 0: return 4 elif rda >= 1 and rda <= 25: return 1 elif rda >= 26 and rda <= 65: return 2 elif rda >= 66 and rda <= 85: return 3 else: return 4 def ward_1_service_time(rds): if rds == 0: return 6 elif rds >= 1 and rds <= 20: return 4 e...
apache-2.0
295,882,825,480,630,100
19.246575
75
0.584574
false
cschenck/blender_sim
fluid_sim_deps/blender-2.69/2.69/scripts/addons/add_mesh_extra_objects/add_mesh_polysphere.py
1
3014
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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 distrib...
gpl-3.0
-9,061,756,271,475,560,000
33.25
352
0.682482
false
shub0/algorithm-data-structure
python/find_all_anagrams_in_a_string.py
1
1819
''' Given a string s and a non-empty string p, find all the start indices of p's anagrams in s. Strings consists of lowercase English letters only and the length of both strings s and p will not be larger than 20,100. The order of output does not matter. Example 1: Input: s: "cbaebabacd" p: "abc" Output: [0, 6] E...
bsd-3-clause
3,415,879,451,393,332,700
24.985714
121
0.563496
false
jaredks/euler
011/011.py
1
2013
from operator import mul grid = ''' 08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08 49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00 81 49 31 73 55 79 14 29 93 71 40 67 53 88 30 03 49 13 36 65 52 70 95 23 04 60 11 42 69 24 68 56 01 32 56 71 37 02 36 91 22 31 16 71 51 67 63 89 41 92 36 54 22 40 4...
bsd-3-clause
-7,601,371,052,642,599,000
37.711538
72
0.600596
false
espressopp/espressopp
src/analysis/Energy.py
1
3336
# Copyright (C) 2012,2013,2016 # Max Planck Institute for Polymer Research # Copyright (C) 2008,2009,2010,2011 # Max-Planck-Institute for Polymer Research & Fraunhofer SCAI # # This file is part of ESPResSo++. # # ESPResSo++ is free software: you can redistribute it and/or modify # it under the terms of ...
gpl-3.0
4,654,429,180,132,888,000
29.327273
72
0.593525
false
RyanChinSang/ECNG3020-ORSS4SCVI
BETA/TestCode/OpenCV/APP-HaarCasObjDet.py
1
1432
import cv2 import winsound face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml') eye_cascade = cv2.CascadeClassifier('haarcascade_eye.xml') cap = cv2.VideoCapture(0) while 1: ret, img = cap.read() gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) faces = face_cascade.detectMultiScale(gra...
gpl-3.0
3,332,008,008,454,831,000
33.095238
82
0.550279
false
JWarmenhoven/seaborn
seaborn/external/six.py
1
22856
"""Utilities for writing code that runs on Python 2 and 3""" # Copyright (c) 2010-2014 Benjamin Peterson # # 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 with...
bsd-3-clause
8,124,192,446,177,840,000
35.164557
183
0.633444
false
Azure/azure-sdk-for-python
tools/azure-devtools/src/azure_devtools/scenario_tests/base.py
1
8281
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
mit
-2,261,887,048,090,919,200
34.088983
113
0.589663
false
ignatenkobrain/dnf
dnf/yum/misc.py
1
17291
# misc.py # Copyright (C) 2012-2014 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This program is distributed in the hope th...
gpl-2.0
-6,934,695,240,067,391,000
31.748106
81
0.590654
false
TribeMedia/synapse
synapse/storage/search.py
2
21943
# -*- coding: utf-8 -*- # Copyright 2015, 2016 OpenMarket Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
-260,597,499,633,490,400
35.090461
89
0.53165
false
us-ignite/us_ignite
us_ignite/visualize/views.py
1
4853
from collections import Counter from itertools import chain, combinations from django.conf import settings from django.core.urlresolvers import reverse from django.utils.http import urlquote from django.template.response import TemplateResponse from us_ignite.apps.models import Application, Domain from us_ignite.acti...
bsd-3-clause
-1,046,862,841,806,588,800
29.71519
90
0.613435
false
gajim/gajim
setup.py
1
6382
#!/usr/bin/env python3 import os import sys if sys.version_info < (3, 7): sys.exit('Gajim needs Python 3.7+') from setuptools import setup, find_packages from setuptools import Command from setuptools.command.build_py import build_py as _build from setuptools.command.install import install as _install from distu...
gpl-3.0
-902,459,553,658,906,400
28.546296
82
0.561109
false
eclecticitguy/pynet_paid
class3/ex1_cfg_change_checker.py
1
1466
#!/usr/bin/env python from snmp_helper import snmp_get_oid_v3,snmp_extract from time import localtime, asctime COMMUNITY_STRING = 'galileo' SNMP_PORT = 161 SYS_NAME = '1.3.6.1.2.1.1.5.0' SYS_UPTIME = '1.3.6.1.2.1.1.3.0' RUN_LAST_CHANGED = '1.3.6.1.4.1.9.9.43.1.1.1.0' SYS_TIME_SEC = 100 DEBUG = True class NetworkDevi...
apache-2.0
-2,640,716,995,446,702,600
25.654545
83
0.598909
false
Malpp/Mouse
main.py
1
1323
import win32api, win32con, win32gui, sys from flask import Flask, send_from_directory, request def click(): (x,y) = win32gui.GetCursorPos() win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,x,y,0,0) win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP,x,y,0,0) def rclick(): (x,y) = win32gui.GetC...
mit
6,223,938,385,834,088,000
22.5
65
0.617536
false
mscuthbert/abjad
abjad/tools/rhythmmakertools/Talea.py
1
4052
# -*- encoding: utf-8 -*- from abjad.tools import datastructuretools from abjad.tools import durationtools from abjad.tools import mathtools from abjad.tools.abctools import AbjadValueObject class Talea(AbjadValueObject): '''Talea. .. container:: example :: >>> talea = rhythmmakertools...
gpl-3.0
-1,012,879,435,689,339,300
24.173913
76
0.52542
false
birkin/iip_processing_project
run_travis_tests.py
1
1651
# -*- coding: utf-8 -*- # flake8: noqa from __future__ import unicode_literals import os import sys import django from django.conf import settings from django.test.utils import get_runner if __name__ == '__main__': os.environ['DJANGO_SETTINGS_MODULE'] = 'config.settings_travis' ## initialize dummy envvars u...
mit
-4,447,388,191,950,271,500
37.395349
106
0.635978
false
chrisdickinson/tweezers
docs/conf.py
1
7099
# -*- coding: utf-8 -*- # # Read The Docs documentation build configuration file, created by # sphinx-quickstart on Sat Aug 14 00:06:40 2010. # # 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. #...
mit
-3,958,156,139,127,151,600
31.865741
80
0.709396
false
geminy/aidear
snippets/cppfunc/cppcheck/cppcheck-1.80/addons/cert.py
1
2959
#!/usr/bin/env python # # Cert: Some extra CERT checkers # # Cppcheck itself handles many CERT rules. Cppcheck warns when there is undefined behaviour. # # Example usage of this addon (scan a sourcefile main.cpp) # cppcheck --dump main.cpp # python cert.py main.cpp.dump import cppcheckdata import sys import re def r...
gpl-3.0
-200,426,525,887,534,100
32.247191
120
0.604258
false
zhuangjun1981/retinotopic_mapping
retinotopic_mapping/tools/PlottingTools.py
1
15373
# -*- coding: utf-8 -*- """ Created on Fri Oct 31 11:07:20 2014 @author: junz """ import numpy as np import matplotlib.pyplot as plt from matplotlib import cm import matplotlib.colors as col import scipy.ndimage as ni import ImageAnalysis as ia try: import skimage.external.tifffile as tf except ImportError: i...
gpl-3.0
-1,346,868,571,658,882,600
30.566735
130
0.601899
false
vmonaco/rpscontest
agents/ga3.py
1
2188
import random, math def highest(v): return random.choice([i for i in range(len(v)) if max(v) == v[i]]) def lowest(v): return random.choice([i for i in range(len(v)) if min(v) == v[i]]) def best(c): return highest([c[1]-c[2], c[2]-c[0], c[0]-c[1]]) if(1): if (input == ""): N = 1 AR1 =...
bsd-3-clause
5,412,806,603,121,290,000
20.89
91
0.423218
false
capitalone/cloud-custodian
c7n/filters/iamanalyzer.py
1
3700
# Copyright 2020 Kapil Thangavelu # Copyright The Cloud Custodian Authors. # SPDX-License-Identifier: Apache-2.0 from .core import ValueFilter from c7n.exceptions import PolicyExecutionError from c7n.manager import resources from c7n.utils import type_schema, local_session, chunks class AccessAnalyzer(ValueFilter)...
apache-2.0
642,151,827,018,064,900
32.944954
93
0.576486
false
yuzie007/ph_analysis
ph_analysis/structure/displacements.py
1
3767
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function, unicode_literals) import numpy as np import pandas as pd __author__ = 'Yuji Ikeda' __version__ = '0.1.0' def create_statistical_functions(): return [ ('sum', np.sum), ...
mit
-3,088,064,216,329,875,000
30.391667
70
0.525086
false
jiaxiaolei/pycate
testDataBase.py
1
1836
# -*- coding:utf-8 -*- ''' 测试注册用户 ''' import sys import os sys.path.append(os.getcwd()) from pycate.model import MInfo import unittest class SimpleWidgetTestCase(unittest.TestCase): def setUp(self): # from model.info_model import MInfo # con = pymongo.Connection('localhost') ...
mit
-8,782,239,406,494,044,000
28.4
80
0.576206
false
ViennaRNA/forgi
test/forgi/threedee/model/coarse_grain_test.py
1
34193
from __future__ import absolute_import from __future__ import print_function from __future__ import division from builtins import range import warnings import unittest import sys import itertools as it import copy import time import math import logging import os.path import os import shutil import contextlib try: ...
gpl-3.0
5,012,917,585,060,716,000
39.08558
544
0.57038
false
quininer/isperdal
isperdal/node.py
1
9290
from copy import copy from asyncio import async, coroutine, iscoroutinefunction from functools import reduce from types import FunctionType from traceback import format_exc from .request import Request from .response import Response from .adapter import AioHTTPServer from .utils import Result, Ok, Err, unok codes = ...
mit
6,039,643,017,386,810,000
27.94081
78
0.45296
false
sudheesh001/pontoon
pontoon/base/tests/test_helpers.py
1
1622
from datetime import timedelta from django_nose.tools import assert_equal from pontoon.base.templatetags.helpers import format_datetime, format_timedelta from pontoon.base.tests import TestCase from pontoon.base.utils import aware_datetime class FormatDatetimeTests(TestCase): def test_format_datetime_none(self)...
bsd-3-clause
8,075,762,976,926,366,000
35.863636
80
0.681874
false
Kilves/finnchan
chan/middleware.py
1
1108
#!/usr/bin/python # -*- coding: UTF-8 -*- from django.db import connection import pytz from django.utils import timezone from django.utils.deprecation import MiddlewareMixin class SqlPrintMiddleware(object): def __init__(self, get_response): self.get_response = get_response def __call__(self, request): res...
bsd-3-clause
9,118,361,435,977,298,000
26.02439
118
0.703971
false
ehuelsmann/openipam
openIPAM/pydhcplib/pydhcplib/dhcp_packet.py
1
8561
# Anemon Dhcp # Copyright (C) 2005 Mathieu Ignacio -- mignacio@april.org # # 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 versio...
gpl-3.0
-5,894,849,955,585,104,000
34.970588
88
0.629483
false
dealien/Red-Magician
cogs/customcom.py
1
7261
from discord.ext import commands from .utils.dataIO import dataIO from .utils import checks from .utils.chat_formatting import pagify, box import os import re class CustomCommands: """Custom commands Creates commands used to display text""" def __init__(self, bot): self.bot = bot self.fi...
gpl-3.0
-8,956,969,772,257,303,000
35.305
77
0.564523
false
SEC-i/ecoControl
server/functions.py
1
3643
import logging from datetime import datetime import dateutil.relativedelta from django.core.exceptions import ObjectDoesNotExist from django.core.cache import cache from django.utils.timezone import utc from models import Device, Configuration, DeviceConfiguration, Sensor, SensorValue, SensorValueDaily logger = log...
mit
-5,605,838,481,541,959,000
30.678261
100
0.6437
false
yamila-moreno/api-example
src/tests/conftest.py
1
1237
import pytest from sqlalchemy_utils import database_exists, create_database, drop_database from repositories.config import Base from repositories.config import engine from repositories.session import session_manager @pytest.fixture(scope="session", autouse=True) def create_db(request): print("\n===> Create and s...
gpl-3.0
4,282,494,401,670,037,500
25.891304
76
0.712207
false
zhaozengguang/opencog
opencog/python/spatiotemporal/temporal_events/composition/__init__.py
1
1286
from math import fabs, sqrt __author__ = 'keyvan' def unpack(relation, start_reference=0, length_reference=1): before, same, after = relation similarity = same / (1 - fabs(before - after)) solutions = [] lengths = length_reference / similarity**2, length_reference * similarity**2 for i in xrang...
agpl-3.0
-8,653,190,817,699,188,000
40.483871
113
0.643079
false
superfluidity/RDCL3D
code/toscaparser/elements/capabilitytype.py
1
3738
# 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
-5,516,950,418,608,418,000
42.976471
78
0.619048
false
juanchopanza/pyhistuples
pyhistuples/tests/test_axis.py
1
1802
''' Test suite for histogram.axis class. ''' __author__ = "Juan PALACIOS juan.palacios@nikhef.nl" from nose import tools as nt from pyhistuples.pyhistogram.histogram import Axis def test_instantiate_axis() : ax = Axis(100, -50, 50, "My first axis") nt.assert_true(ax is not None) def test_axis_parameters()...
gpl-3.0
1,465,637,483,166,221,800
25.895522
58
0.620422
false
morrisonlevi/FrameworkBenchmarks
go/setup.py
1
1362
import subprocess import sys import os import setup_util def start(args, logfile, errfile): setup_util.replace_text("go/src/hello/hello.go", "tcp\(.*:3306\)", "tcp(" + args.database_host + ":3306)") if os.name == 'nt': #subprocess.call("rmdir /s /q pkg\\windows_amd64", shell=True, cwd="go") #subprocess.cal...
bsd-3-clause
-8,111,111,646,161,563,000
45.965517
130
0.660793
false
b1-systems/kiwi
kiwi/bootloader/config/grub2.py
1
32822
# Copyright (c) 2015 SUSE Linux GmbH. All rights reserved. # # This file is part of kiwi. # # kiwi 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 la...
gpl-3.0
8,704,260,187,807,104,000
37.209546
80
0.546249
false
thethythy/Mnemopwd
mnemopwd/test/test_certificat/client.py
1
2847
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2015-2016, Thierry Lemeunier <thierry at lemeunier dot net> # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # 1. Redistributions ...
bsd-2-clause
8,528,119,219,875,919,000
35.5
84
0.734809
false
eamigo86/graphene-django-extras
tests/conftest.py
1
3393
import os import sys import django from django.core import management def pytest_addoption(parser): parser.addoption( "--no-pkgroot", action="store_true", default=False, help="Remove package root directory from sys.path, ensuring that " "graphene_django_extras is imported ...
mit
-834,246,997,406,322,000
32.93
105
0.607722
false
viaict/viaduct
app/views/contact.py
1
2562
from flask import Blueprint, flash, redirect, render_template, url_for from flask_babel import lazy_gettext as _ from flask_login import current_user from app import db from app.decorators import require_role from app.forms import init_form from app.forms.contact import ContactForm from app.models.contact import Conta...
mit
-6,932,138,509,350,813,000
35.6
77
0.65847
false
GabrielCebrianM/hm-tools
bd.py
1
3191
#!/usr/bin/python # # Copyright 2017 Gabriel Cebrian # # 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 appl...
apache-2.0
-1,747,636,242,468,938,000
39.910256
80
0.663428
false
openstack/neutron-lib
neutron_lib/plugins/ml2/api.py
1
47478
# 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 agreed to in...
apache-2.0
675,974,605,653,809,500
37.631408
79
0.685855
false
goblinhack/MundusMeus
python/things/snow_mound.py
1
1029
import tp import mm def thing_init(t): return total_snow_mound = 0 def snow_mound1_init(d1000_roll, tiles=[]): global total_snow_mound name = "snow_mound" + str(total_snow_mound + 1) total_snow_mound = total_snow_mound + 1 x = tp.Tp(name=name, is_snow_mound=True, ...
lgpl-3.0
-994,316,061,098,651,600
20.893617
57
0.624879
false
konrad/kufpybio
kufpybio/genelistmerger.py
1
5536
import os import sys import kufpybio.helpers as helpers import sqlite3 from kufpybio.gene import Gene class GeneListMerger(object): def __init__(self, min_overlap_percentage=None, perform_gene_merging=True): # This flag influeces the general behavior. It it is set to # True gene will be merged i.e...
isc
-8,489,984,370,511,121,000
39.115942
85
0.563223
false
yohanko88/gem5-DC
configs/common/Options.py
1
20572
# Copyright (c) 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 functionality ...
bsd-3-clause
2,514,934,502,683,104,000
54.152815
149
0.60631
false
setten/pymatgen
pymatgen/io/abinit/abiobjects.py
1
50073
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ Low-level objects providing an abstraction for the objects involved in the calculation. """ from __future__ import unicode_literals, division, print_function import collections import abc import six import ...
mit
8,545,368,226,780,103,000
33.226247
118
0.57536
false
stevepeak/tornwrap
tornwrap/ratelimited.py
1
2242
import functools def ratelimited(user=None, guest=None, redis_key_format="ratelimited.%s"): """Rate limit decorator ### Headers X-RateLimit-Limit: 1000 X-RateLimit-Remaining: 567 X-RateLimit-Reset: 1242711173 ### Status when rate limited Status: 403 Forbidden """ if user: ...
apache-2.0
-8,635,257,606,699,489,000
32.462687
128
0.535682
false
foligny/browsershots-psycopg2
shotserver/shotserver04/accounts/views.py
1
15999
# browsershots.org - Test your web design in different browsers # Copyright (C) 2007 Johann C. Rocholl <johann@browsershots.org> # # Browsershots 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 ...
gpl-3.0
8,503,850,407,645,171,000
35.196833
79
0.638665
false
AkiraKito/fivalid
tests/validator_tests.py
1
11335
# -*- coding: utf-8 -*- import sys, os import unittest sys.path.insert(0, os.path.join('..', 'fivalid')) from validators import ( ValidationError, InvalidTypeError, InvalidValueError, All, Any, ValueAdapter, Not, Failure, Pass, Number, FreeText, Equal, Regex, AllowType, Prefix, Type, Length...
bsd-2-clause
-9,160,175,959,743,405,000
24.110855
87
0.551826
false
marklescroart/bvp
bvp/Classes/background.py
1
11453
# Imports import os import six from bvp.utils.blender import add_group, grab_only, apply_material from .constraint import ObConstraint, CamConstraint from .mapped_class import MappedClass from .object import Object # Should be moved, along with test below #from .Camera import Camera #from .Scene import Scene #from .Sk...
bsd-2-clause
7,110,691,385,194,409,000
43.738281
198
0.568672
false
racker/python-raxcli
raxcli/apps/registry/commands/configuration/get.py
1
1315
# Copyright 2013 Rackspace # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the...
apache-2.0
-2,164,299,640,498,415,900
36.571429
74
0.738403
false
lobiCode/VoterChat
models.py
1
5261
""" Copyright 2014 VoterChat 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 distr...
apache-2.0
3,637,071,216,091,454,000
24.293269
76
0.545904
false
scalingdata/Impala
tests/query_test/test_insert.py
1
7872
#!/usr/bin/env python # Copyright (c) 2012 Cloudera, Inc. All rights reserved. # Targeted Impala insert tests # import logging import os import pytest from testdata.common import widetable from tests.beeswax.impala_beeswax import ImpalaBeeswaxException from tests.common.test_vector import * from tests.common.impala_tes...
apache-2.0
-1,758,821,530,453,139,700
41.782609
91
0.697282
false
transientlunatic/otter
otter/_version.py
1
18447
# This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by githubs download-from-tag # feature). Distribution tarballs (built by setup.py sdist) and build # directories (produced by setup.py build) will contain a much shorter file # that just contains t...
isc
5,727,230,803,950,140,000
34.475
79
0.575161
false
snopt/snopt-python
examples/snmainb.py
1
7041
""" An example SNOPTB problem. """ import numpy as np from snopt import snoptb, SNOPT_options def hexCon(mode,x,fCon,gCon,nState): two = 2.0 fCon[ 0] = x[0]**2 + x[5]**2 fCon[ 1] = (x[1] - x[0])**2 + (x[6] - x[5])**2 fCon[ 2] = (x[2] - x[0])**2 + x[5]**2 fCon[ 3] = (x[0]...
mit
1,068,860,622,659,655,700
17.876676
82
0.47337
false
haum/pelican-flickrtag
pelican_flickrtag/flickr.py
1
51012
""" flickr.py Copyright 2004-2006 James Clarke <james@jamesclarke.info> Portions Copyright 2007-2008 Joshua Henderson <joshhendo@gmail.com> THIS SOFTWARE IS SUPPLIED WITHOUT WARRANTY OF ANY KIND, AND MAY BE COPIED, MODIFIED OR DISTRIBUTED IN ANY WAY, AS LONG AS THIS NOTICE AND ACKNOWLEDGEMENT OF AUTHORSHIP...
mit
2,333,938,505,118,494,000
35.255864
129
0.592959
false
Wikia/sparrow
apps/tasks/models.py
1
2950
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models import django.dispatch from django.utils.translation import ugettext as _ from django.core.urlresolvers import reverse from django_enumfield import enum import celery.states from common.utils import build_absolute_uri from te...
mit
1,629,196,924,086,525,200
30.052632
93
0.622712
false
matthiasplappert/motion_classification
src/toolkit/util.py
1
2470
import numpy as np from sklearn.utils.validation import check_array class NotFittedError(ValueError, AttributeError): pass def check_feature_array(array, n_features=None): array = check_array(array, ensure_2d=True, allow_nd=False) if n_features is not None and array.shape[1] != n_features: raise...
mit
7,985,787,210,350,598,000
36.424242
84
0.648178
false
Makeystreet/makeystreet
woot/apps/catalog/migrations/0035_fix_sequence_problem.py
1
26017
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models def increase_sequence(dbName): highest_number = db.execute('select id from '+dbName+' order by id desc limit 1;')[0][0] db.execute('alter sequence...
apache-2.0
-3,799,775,966,838,581,000
84.582237
478
0.57055
false
scieloorg/processing
publication/documents_dates.py
1
9255
# coding: utf-8 """ Este processamento gera uma tabulação de datas do artigo (publicação, submissão, aceite, entrada no scieloe atualização no scielo) """ import argparse import logging import codecs import datetime import xylose.scielodocument import utils import choices logger = logging.getLogger(__name__) d...
bsd-2-clause
-2,701,754,983,626,913,000
34.706564
106
0.62208
false
Phdntom/NLCpyro
cluster.py
1
13290
from constants import * from class_lib import * import numpy as np #from collections import deque class Cluster: def __init__(self,unit,num,links,file_ext): self.nodes = [] self.edges = [] self.sites = [] self.bonds = [] if unit == "site": self.nodes.append( Site(links) ) self.site...
mit
432,265,689,906,784,450
26.177914
114
0.440181
false
generic-library/cxx-lutin
lutin_cxx.py
1
2452
#!/usr/bin/python import lutin.module as module import lutin.tools as tools import lutin.debug as debug import os def get_type(): return "LIBRARY" def get_desc(): return "clang generic lib c++" def get_licence(): return "bsd-like" def get_compagny_type(): return "com" def get_compagny_name(): return "Univers...
mit
5,658,622,599,852,151,000
23.039216
127
0.658238
false
pangwong11/jumpball
bd_analyze/nba_season_stats_analyzer.py
1
5069
#!/usr/bin/python import numpy as np import matplotlib.pyplot as pyplot from datetime import datetime import os import glob import sys import re import argparse import cv2 import random import ast # Argument parsing #parser = argparse.ArgumentParser(description='Jumpball analyze') #parser.add_argument('-s', '--seas...
apache-2.0
7,157,394,456,494,761,000
32.793333
139
0.632472
false
arhangel6/RecipeWizard
Server/views.py
1
4673
#Apache2 Python server from __future__ import print_function from django.shortcuts import render import time from django.http import HttpResponse import smtplib import MySQLdb import sys import os import xmpp def mytest(request): if request.GET: value = request.GET form=value['form'] for...
mit
-1,179,523,186,130,479,000
25.815476
294
0.64006
false
sunil07t/e-mission-server
emission/analysis/plotting/leaflet_osm/ipython_helper.py
1
2375
""" Helper functions that can display leaflet maps inline in an ipython notebook """ from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from future import standard_library standard_library.install_aliases() from builtins i...
bsd-3-clause
1,357,911,082,733,183,500
40.666667
169
0.674526
false
samatt/OpenWPM
automation/DataAggregator/LevelDBAggregator.py
1
3112
from ..SocketInterface import serversocket from ..MPLogger import loggingclient import plyvel import pyhash import zlib import time import os def LevelDBAggregator(manager_params, status_queue, batch_size=100): """ Receives <key, value> pairs from other processes and writes them to the central database. ...
gpl-3.0
627,267,241,104,379,900
32.106383
94
0.636247
false
rlkelly/Lasagne
lasagne/layers/base.py
1
10847
from collections import OrderedDict from .. import utils __all__ = [ "Layer", "MergeLayer", ] # Layer base class class Layer(object): """ The :class:`Layer` class represents a single layer of a neural network. It should be subclassed when implementing new types of layers. Because each lay...
mit
-2,088,890,510,987,845,400
34.917219
79
0.600258
false
anomaly/prestans
tests/rest/test_error_response.py
1
1721
import unittest from prestans import exception from prestans.http import STATUS from prestans.rest import ErrorResponse from prestans.serializer import JSON class ErrorResponseTest(unittest.TestCase): def test_init(self): raised_exception = exception.NoEndpointError() json_serializer = JSON() ...
bsd-3-clause
6,392,393,921,434,553,000
28.672414
100
0.64846
false
kirichoi/tellurium
tellurium/plotting/engine_plotly.py
1
8252
""" Plotly implementation of the plotting engine. """ from __future__ import print_function, absolute_import from .engine import PlottingEngine, PlottingFigure, PlottingLayout, filterWithSelections, TiledFigure, LowerTriFigure import numpy as np import plotly from plotly.graph_objs import Scatter, Scatter3d, Layout, D...
apache-2.0
4,276,770,955,068,682,000
33.099174
143
0.518541
false
windelbouwman/ppci-mirror
tools/compile_libmad.py
1
2909
""" Helper script to build libmad Version: libmad-0.15.1b Usage: - Download the libmad sourcecode. - Unzip the sourcecode - Set the environment variable LIBMAD_FOLDER to the unzipped dir - Run this script """ import sys import os import logging import time try: from powertb import print_exc except ImportError...
bsd-2-clause
-3,491,428,419,139,794,000
25.688073
77
0.562049
false
kevin-f-liu/WSBAuto
src/finbox_master/finbox_request.py
1
1927
import requests import io import json import csv from math import floor class finboxRequest: def __init__(self): self.url = "https://api.finbox.io/beta" self.headers = { 'authorization': "Bearer 509e960d5d374b8958f00bd5e977d13f001925fe", 'accept': "application/json", 'c...
mit
2,399,845,872,434,627,000
27.776119
88
0.613389
false
SageHack/cloud-buster
bust/descriptor/httpresponse.py
1
1544
import http.client class HttpResponse(object): responses = {} def __init__(self, domain, port=None, timeout=10, ssl=False): self.domain = domain self.timeout = timeout self.ssl = ssl if port is None and ssl is False: self.port = 80 elif port is None and s...
gpl-3.0
3,020,122,162,320,796,000
26.087719
74
0.518782
false
yogiben/Sublime-AdvancedNewFile
advanced_new_file/anf_util.py
2
6650
import sublime import re import os ALIAS_SETTING = "alias" DEFAULT_INITIAL_SETTING = "default_initial" USE_CURSOR_TEXT_SETTING = "use_cursor_text" SHOW_FILES_SETTING = "show_files" SHOW_PATH_SETTING = "show_path" DEFAULT_ROOT_SETTING = "default_root" DEFAULT_PATH_SETTING = "default_path" DEFAULT_FOLDER_INDEX_SETTING =...
mit
2,186,392,461,701,609,200
33.635417
78
0.626767
false
Wonjuseo/Project101
1/1-3. Deep Neural Network.py
1
2311
# tensorflow, numpy를 사용하기위해 import import tensorflow as tf import numpy as np # Deep learning을 위해 데이터를 읽습니다. data = np.loadtxt('./data.csv',delimiter=',',unpack=True,dtype='float32') # csv자료의 0부터 2번째 까지의 feature를 x_data에 넣습니다. # 나머지는 분류가 되는 데이터로 y_data에 넣습니다. x_data = np.transpose(data[0:3]) y_data = np.transpose(da...
apache-2.0
4,703,986,917,182,859,000
28.952381
83
0.656598
false
akamensky/sssd
src/tests/intg/ent_test.py
1
15643
# # ent.py module tests # # Copyright (c) 2015 Red Hat, Inc. # Author: Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com> # # This 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 only # # This progra...
gpl-3.0
-5,550,892,307,697,194,000
35.893868
75
0.618488
false
nkmk/python-snippets
notebook/dict_keys_values_items.py
1
1226
d = {'key1': 1, 'key2': 2, 'key3': 3} for k in d: print(k) # key1 # key2 # key3 for k in d.keys(): print(k) # key1 # key2 # key3 keys = d.keys() print(keys) print(type(keys)) # dict_keys(['key1', 'key2', 'key3']) # <class 'dict_keys'> k_list = list(d.keys()) print(k_list) print(type(k_list)) # ['key1', 'key...
mit
-5,212,486,417,184,300,000
12.931818
53
0.532626
false
marcy-terui/lamvery
lamvery/actions/base.py
1
2145
# -*- coding: utf-8 -*- from abc import ABCMeta, abstractmethod from lamvery.config import Config from lamvery.log import get_logger from lamvery.clients import ( LambdaClient, KmsClient, EventsClient, LogsClient, ApiGatewayClient ) class BaseAction: __metaclass__ = ABCMeta _logger = No...
mit
7,051,185,281,122,870,000
24.843373
80
0.551981
false
smurfix/HomEvenT
homevent/__init__.py
1
1392
# -*- coding: utf-8 -*- ## ## Copyright © 2007-2012, Matthias Urlichs <matthias@urlichs.de> ## ## 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 ## (a...
gpl-3.0
7,894,517,567,996,938,000
27.387755
72
0.728972
false
TalShor/SciLMM
scilmm/Tests/test_IBDCompute.py
1
2451
import os from os.path import join from unittest import TestCase import numpy as np from scilmm import IBDCompute class TestIBDCompute(TestCase): def setUp(self): self.ibd_compute = IBDCompute() def test_compute_relationships(self): pedigree, entries_list = self.ibd_compute.compute_relation...
gpl-3.0
2,016,989,683,003,051,000
46.134615
120
0.651163
false
MonamAgarwal/final
GTG/backends/generictomboy.py
1
24956
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Getting Things GNOME! - a personal organizer for the GNOME desktop # Copyright (c) 2008-2013 - Lionel Dricot & Bertrand Rousseau # # This program is free software: you can redistribute it and/or modify it under # t...
gpl-3.0
-3,160,080,868,538,627,000
41.155405
79
0.520877
false
Varbin/EEH
_vendor/ldap3/extend/microsoft/modifyPassword.py
1
2949
""" """ # Created on 2015.11.27 # # Author: Giovanni Cannata # # Copyright 2015, 2016, 2017 Giovanni Cannata # # This file is part of ldap3. # # ldap3 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, ei...
bsd-2-clause
760,434,525,089,643,100
40.535211
167
0.658867
false
cobbler/cobbler
cobbler/cobbler_collections/mgmtclasses.py
1
2621
""" Copyright 2010, Kelsey Hightower Kelsey Hightower <kelsey.hightower@gmail.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later versi...
gpl-2.0
9,148,162,134,582,847,000
31.358025
110
0.642884
false
dunkhong/grr
grr/client/grr_response_client/client_actions/osquery.py
1
8557
#!/usr/bin/env python """A module with client action for talking with osquery.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import collections import os from future.builtins import map from future.utils import iterkeys from typing import Any from t...
apache-2.0
4,801,668,196,163,386,000
30.003623
110
0.698142
false
Shouqun/node-gn
tools/depot_tools/third_party/mock/__init__.py
1
75516
# Test tools for mocking and patching. # Copyright (C) 2007-2012 Michael Foord & the mock team # E-mail: fuzzyman AT voidspace DOT org DOT uk # mock 1.0 # http://www.voidspace.org.uk/python/mock/ # Released subject to the BSD License # Please see http://www.voidspace.org.uk/python/license.shtml # Scripts maintained ...
mit
-4,632,028,154,239,288,000
30.917582
86
0.576156
false
ucloud/uai-sdk
uai/api/get_uai_srv_bill_unitprice.py
1
1616
# Copyright 2017 The UAI-SDK Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
apache-2.0
2,526,936,735,926,777,300
42.675676
126
0.66646
false
CGATOxford/Optic
scripts/species_map2species_map.py
1
2392
''' species_map2species_map.py ============================================= :Author: Nick Ilott :Release: $Id$ :Date: |today| :Tags: Python Purpose ------- Convert species ids from a species_map file to names provided from genome files. Usage ----- Example:: python species_map2species_map.py --help Type:: ...
mit
7,700,726,483,877,517,000
24.72043
120
0.645903
false
HaroldMills/Vesper
vesper/signal/tests/test_wave_file_signal.py
1
1904
from pathlib import Path from vesper.signal.signal_error import SignalError from vesper.signal.tests.test_signal import SignalTests from vesper.signal.time_axis import TimeAxis from vesper.signal.wave_file_signal import WaveFileSignal from vesper.tests.test_case import TestCase import vesper.signal.tests.utils as util...
mit
-2,105,206,468,277,141,800
34.924528
79
0.608718
false
Jigsaw-Code/net-analysis
netanalysis/ooni/data/fetch_measurements.py
1
4198
#!/usr/bin/python # # Copyright 2021 Jigsaw Operations 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 applicabl...
apache-2.0
-6,089,849,323,202,821,000
34.880342
142
0.661982
false
mozman/ezdxf
examples/text_layout_engine_usage.py
1
12087
# Copyright (c) 2021, Manfred Moitzi # License: MIT License import sys from typing import Iterable import pathlib import random import ezdxf from ezdxf import zoom, print_config from ezdxf.math import Matrix44 from ezdxf.tools import fonts from ezdxf.tools import text_layout as tl """ This example shows the usage o...
mit
3,524,110,919,165,388,000
31.756098
83
0.643667
false