repo_name
stringlengths
5
92
path
stringlengths
4
221
copies
stringclasses
19 values
size
stringlengths
4
6
content
stringlengths
766
896k
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
32
997
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
13.6
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
DBuildService/atomic-reactor
atomic_reactor/plugins/build_source_container.py
1
3849
""" Copyright (c) 2019 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ import os import subprocess import tempfile from atomic_reactor.build import BuildResult from atomic_reactor.constants import (PLUGIN_SOURCE_...
bsd-3-clause
-4,306,701,115,934,783,500
36.735294
99
0.638348
false
3.837488
false
false
false
acil-bwh/SlicerCIP
Scripted/CIP_/CIP/logic/EventsTrigger.py
1
2466
class EventsTrigger(object): """ 'Abstract' class that has a mechanism to subscribe and trigger events """ def __init__(self): self.__events__ = [] self.__eventsCallbacks__ = {} self.__eventsCount__ = 0 @property def events(self): return self.__events__ def ...
bsd-3-clause
-5,451,498,751,310,841,000
42.263158
138
0.644769
false
4.575139
false
false
false
Fleeg/fleeg-platform
link/migrations/0001_initial.py
1
3024
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-01-21 18:21 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('account', '__first__'), ] oper...
agpl-3.0
-4,756,169,835,546,349,000
47
138
0.574735
false
4.2
false
false
false
mrcslws/nupic.research
projects/dynamic_sparse/validation/test_iterative_pruning.py
1
1996
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2019, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
-3,114,277,414,524,010,500
30.68254
73
0.641283
false
3.577061
false
false
false
minghuascode/pyj
library/pyjamas/ui/HTMLLinkPanel.py
1
1988
from pyjamas.ui.HTMLPanel import HTMLPanel from pyjamas.ui.Hyperlink import Hyperlink from pyjamas import Window from pyjamas import DOM class HTMLLinkPanel(HTMLPanel): def __init__(self, html="", **kwargs): self.hyperlinks = [] HTMLPanel.__init__(self, html, **kwargs) def setHTML(self, html)...
apache-2.0
-3,861,831,791,995,955,000
32.694915
75
0.545775
false
4.133056
false
false
false
nsubiron/SublimeSuricate
lib/settings.py
1
3540
# Sublime Suricate, Copyright (C) 2013 N. Subiron # # This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you # are welcome to 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 (...
gpl-3.0
-4,090,290,248,179,325,000
32.084112
81
0.648588
false
3.778015
false
false
false
tristeen/RTS-Simulator
rts/mState.py
1
3697
import math import random import mMap from misc.mLogger import log from misc import utils import random class RTSState(mMap.mMap): def __init__(self, d, camp): super(RTSState, self).__init__(d) self.camp = camp def Clone(self): st = RTSState(self.to_dict(), self.camp) return st def equal(self, state): ...
mit
-6,769,616,184,281,385,000
22.547771
101
0.626454
false
2.627576
false
false
false
KelSolaar/sIBL_GUI
sibl_gui/components/core/templates_outliner/templates_outliner.py
1
75391
#!/usr/bin/env python # -*- coding: utf-8 -*- """ **templates_outliner.py** **Platform:** Windows, Linux, Mac Os X. **Description:** Defines the :class:`TemplatesOutliner` Component Interface class. **Others:** """ from __future__ import unicode_literals import os import platform import re import sys if...
gpl-3.0
-2,440,541,239,006,415,400
39.016454
141
0.569033
false
4.716359
false
false
false
wgergely/After-Effects
Maya/standalone.py
1
2206
# -*- coding: utf-8 -*- # pylint: disable=E1101, I1101, C0103, C0301, R0913, E0401, C0413 """Maya standalone context.""" import os import sys MAYA_LOCATION = r'C:\Program Files\Autodesk\Maya2018' MAYA_BIN = r'C:\Program Files\Autodesk\Maya2018\bin' MTOA_EXTENSIONS_PATH = r'C:\solidangle\mtoadeploy\2018\extensions' Q...
mit
6,119,666,044,479,041,000
28.026316
88
0.693563
false
2.895013
false
false
false
SINGROUP/pycp2k
pycp2k/classes/_force_matching1.py
1
1399
from pycp2k.inputsection import InputSection from ._compare_energies1 import _compare_energies1 from ._compare_forces1 import _compare_forces1 class _force_matching1(InputSection): def __init__(self): InputSection.__init__(self) self.Optimize_file_name = None self.Ref_traj_file_name = None...
lgpl-3.0
-7,583,532,691,834,028,000
50.814815
467
0.645461
false
3.194064
false
false
false
travel-intelligence/flasfka
setup.py
1
1608
# -*- coding: utf-8 -*- """ Push/Pull on Kafka over HTTP """ from setuptools import setup from subprocess import check_output as run from subprocess import CalledProcessError import sys import os from flasfka import __version__ # Travis uploads our releases on pypi when the tests are passing and there # is a new ta...
mit
-8,993,859,213,536,265,000
28.777778
75
0.629353
false
3.730858
false
true
false
honnibal/spaCy
spacy/displacy/templates.py
1
2571
# coding: utf8 from __future__ import unicode_literals # Setting explicit height and max-width: none on the SVG is required for # Jupyter to render it properly in a cell TPL_DEP_SVG = """ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:lang="{lang}" id="{id}" class="displacy" w...
mit
8,251,126,806,409,686,000
35.728571
312
0.649553
false
2.800654
false
true
false
pualxiao/pyenv-installer
setup.py
1
1030
import distutils.core from distutils.command.install import install import subprocess class PyenvInstall(install): def run(self): print(subprocess.check_output(['bash', 'bin/pyenv-installer'])) with open('README.rst') as file: long_description = file.read() distutils.core.setup( version='2015011...
mit
-7,404,762,627,322,683,000
29.294118
71
0.647573
false
4.153226
false
false
false
archlinux/archweb
news/views.py
1
2543
from django import forms from django.conf import settings from django.core.mail import EmailMessage from django.http import HttpResponse from django.shortcuts import get_object_or_404, redirect from django.template import loader from django.views.decorators.http import require_POST from django.views.generic import Deta...
gpl-2.0
3,187,957,363,548,591,000
30.012195
127
0.66221
false
3.745214
false
false
false
ChenglongChen/Kaggle_HomeDepot
Code/Chenglong/get_feature_conf_linear_stacking.py
1
7469
# -*- coding: utf-8 -*- """ @author: Chenglong Chen <c.chenglong@gmail.com> @brief: generate feature conf for the following models (most of which are linear models) - reg_skl_ridge - reg_skl_bayesian_ridge - reg_skl_lasso - reg_skl_lsvr - reg_xgb_linear - reg_keras_dnn (n...
mit
-3,370,424,729,518,298,600
23.569079
129
0.579863
false
3.195978
true
false
false
gbanegas/HappyClient
migration/env.py
1
2112
from __future__ import with_statement from alembic import context from sqlalchemy import engine_from_config, pool from logging.config import fileConfig # this is the Alembic Config object, which provides # access to the values within the .ini file in use. config = context.config # Interpret the config file for Python...
apache-2.0
6,247,591,407,888,438,000
27.931507
69
0.684659
false
4.190476
true
false
false
exaile/exaile
xlgui/preferences/widgets.py
1
33912
# Copyright (C) 2008-2010 Adam Olsen # # 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, or (at your option) # any later version. # # This program is distributed in the hope that...
gpl-2.0
-1,620,276,805,065,975,300
28.695271
88
0.584188
false
4.169679
false
false
false
vsiivola/vesamusictraining
lib/resource_simplehtml.py
1
4458
#!/usr/bin/env python """Creates the media files and database fixtures for Vesa's Music Trainer.""" import logging import os import re from typing import Dict, Optional from resource_base import BuildTarget LOGGER = logging.getLogger(__name__) HTML_TEMPLATE = """<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transit...
bsd-3-clause
-1,509,600,440,775,579,400
40.277778
96
0.499103
false
3.711907
false
false
false
JoseBlanca/ngs_crumbs
crumbs/settings.py
1
4923
# Copyright 2012 Jose Blanca, Peio Ziarsolo, COMAV-Univ. Politecnica Valencia # This file is part of ngs_crumbs. # ngs_crumbs 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, ...
gpl-3.0
7,303,150,130,454,446,000
31.176471
79
0.703839
false
3.174081
false
false
false
marknca/cling
dependencies/scss/scss_meta.py
1
2197
#-*- coding: utf-8 -*- """ pyScss, a Scss compiler for Python @author German M. Bravo (Kronuz) <german.mb@gmail.com> @version 1.2.0 alpha @see https://github.com/Kronuz/pyScss @copyright (c) 2012-2013 German M. Bravo (Kronuz) @license MIT License http://www.opensource.org/licenses/mit-lic...
apache-2.0
-1,225,172,330,657,079,000
36.237288
80
0.724169
false
3.111898
false
false
false
chihongze/girlfriend
girlfriend/plugin/excel.py
1
5490
# coding: utf-8 import xlrd import time import random import types import xlsxwriter from StringIO import StringIO from girlfriend.util.lang import ( args2fields, SequenceCollectionType ) from girlfriend.data.table import AbstractTable from girlfriend.plugin.data import AbstractDataReader class ExcelReaderPl...
mit
-2,902,981,250,176,907,300
29.942529
77
0.598068
false
3.927061
false
false
false
davinellulinvega/SpheroMouse
mouse.py
1
2772
#!/usr/bin/python # -*- coding: utf-8 -*- __author__ = 'davinellulinvega' from sphero_driver import sphero_driver import pyautogui from time import sleep # Define the size of the screen width, height = pyautogui.size() half_width = width / 2 half_height = height / 2 pyautogui.FAILSAFE = False # Define a function f...
lgpl-3.0
-5,150,611,249,706,489,000
29.130435
116
0.700577
false
3.261176
false
false
false
thatneat/petl
setup.py
1
1346
from __future__ import print_function, absolute_import, division from ast import literal_eval from distutils.core import setup def get_version(source='petl/__init__.py'): with open(source) as f: for line in f: if line.startswith('__version__'): return literal_eval(line.split(...
mit
6,906,650,021,279,503,000
34.421053
79
0.579495
false
4.091185
false
false
false
CiscoSystems/jujucharm-n1k
charms/precise/juju-gui/tests/test_utils.py
1
50606
# This file is part of the Juju GUI, which lets users view and manage Juju # environments within a graphical interface (https://launchpad.net/juju-gui). # Copyright (C) 2012-2013 Canonical Ltd. # # This program is free software: you can redistribute it and/or modify it under # the terms of the GNU Affero General Public...
apache-2.0
-6,968,436,779,733,894,000
39.227345
79
0.617002
false
3.728157
true
false
false
vcrini/cbr2djvu
cbr2djvu.py
1
1136
#!/usr/bin/python # -*- coding: utf-8 -*- import os import shutil import sys from subprocess import call import tempfile import magic env = os.environ.copy() env['MAGICK_TMPDIR'] = tempfile.mkdtemp(dir=os.getcwd()) def convert(filename): directory = tempfile.mkdtemp() os.chdir(directory) filename = os.p...
gpl-2.0
7,152,145,809,202,884,000
20.846154
63
0.566901
false
3.283237
false
false
false
jeffmorais/estrutura-de-dados
soma_quadrados.py
1
1910
from collections import Counter from collections import deque def soma_quadrados(n): test=0 aux=n res = {0:[0], 1:[1]} if n>=0 and n<=1: return res[n] else: quad=[] test=2 while test<=aux: n=test for q in range(1,n+1): ...
mit
607,065,658,926,150,900
26.681159
73
0.52356
false
3.095624
true
false
false
FilipMalczak/corpy
src/main/python/corpy/core.py
1
1061
import types class CorpyRuntime: def __init__(self, configuration): self.configuration = configuration def get_components(self): return dict(self.configuration.__dict__) def component(class_or_foo): if isinstance(class_or_foo, type): clazz = class_or_foo elif isinstance(class...
apache-2.0
-609,070,897,693,372,400
26.921053
91
0.60509
false
4.160784
true
false
false
syabro/django_mediatoolset
mediatoolset/management/commands/loaddata_with_media.py
1
1876
import os import shutil from django.conf import settings from django.core import serializers from django.core.management.commands.loaddata import Command as LoaddataCommand from django.db.models import FileField class Command(LoaddataCommand): def handle(self, *fixture_labels, **options): super(Command, ...
mit
2,237,305,081,493,083,400
45.9
116
0.64339
false
3.983015
false
false
false
mjordan/pkppln
services/microservices/validate_bag.py
1
1351
import os from services.PlnService import PlnService import pkppln import bagit import zipfile import shutil class ValidateBag(PlnService): """Validate a bag in a deposit""" def state_before(self): return 'payloadVerified' def state_after(self): return 'bagValidated' def execute(se...
gpl-3.0
5,493,576,950,560,890,000
27.744681
68
0.582531
false
3.784314
false
false
false
MadsJensen/malthe_alpha_project
fwd_inv.py
1
3446
""" Doc string goes here. @author: mje mads [] cnru.dk """ import socket import mne from mne.minimum_norm import make_inverse_operator import os # import subprocess import glob cmd = "/usr/local/common/meeg-cfin/configurations/bin/submit_to_isis" # SETUP PATHS AND PREPARE RAW DATA hostname = socket.gethostname() ...
mit
2,468,889,138,565,906,400
32.134615
78
0.548172
false
3.428856
false
false
false
pombreda/https-gitorious.org-appstream-software-center
test/test_addons.py
1
2305
#!/usr/bin/python import unittest from testutils import setup_test_env setup_test_env() from softwarecenter.db.pkginfo import get_pkg_info class TestSCAddons(unittest.TestCase): """ tests the addons """ def setUp(self): self.cache = get_pkg_info() self.cache.open() def test_get_addons...
gpl-3.0
-398,762,153,800,454,140
33.924242
79
0.607809
false
3.466165
true
false
false
super13/tensorflow-speech-recognition-pai
src/preProcessData/wavtotfrecords.py
1
1573
#!/usr/bin/env python # -*- coding: utf-8 -*- # """ transform wav files to tfrecords. usage : python wavtotfrecords.py dirname tfrecordsFileName egg : python wavtotfrecords.py train-dir train.tfrecords """ import os import sys import tensorflow as tf import numpy as np from features.utils.load_audio_to_mem import g...
mit
1,849,613,331,995,784,700
28.980769
78
0.627325
false
3.168699
false
false
false
phievo/phievo
Examples/Methyl.py
1
6136
## Create a methylation interaction from phievo import __silent__,__verbose__ if __verbose__: print("Execute Methyl (Interaction Template)") from phievo.Networks import mutation from phievo.Networks import deriv2 from phievo.Networks import classes_eds2 import copy ## Define the function that assigns new paramet...
lgpl-3.0
8,465,405,386,646,926,000
36.876543
134
0.658409
false
3.184224
false
false
false
Athemis/PyDSF
ui/mplwidget.py
1
2733
from PyQt5 import QtWidgets from PyQt5.QtCore import QCoreApplication from matplotlib.backends.backend_qt5agg import (FigureCanvasQTAgg as FigureCanvas) from matplotlib.backends.backend_qt5agg import (NavigationToolbar2QT as ...
mit
8,196,216,573,821,732,000
37.492958
77
0.612148
false
4.539867
false
false
false
EscapeLife/common-python-scripts
scripts/check_memory.py
1
1468
#!/usr/bin/env python # encoding: utf-8 #========================================================================================= # 如果提示告警信息,可以根据提示看是否为libgmp版本低的问题,如果是的话,直接升级就可以了 # 使用源码安装或者yum直接安装 #========================================================================================= import argparse import parami...
apache-2.0
4,852,110,352,853,459,000
33.974359
101
0.581378
false
3.216981
false
false
false
hicinformatic/DJANGO-APP_Authenta
models.py
1
19435
from django.db import models from django.utils.translation import ugettext as _ from django.core.validators import MinValueValidator, MaxValueValidator, MinLengthValidator, MaxLengthValidator,RegexValidator from django.contrib.auth.models import User, Group, Permission import random import string from .settings impor...
gpl-3.0
1,347,190,716,806,569,500
30.64658
126
0.493567
false
4.7046
false
false
false
Smoothieware/Smoothieware
fast-stream.py
1
2988
#!/usr/bin/env python """\ Stream g-code to Smoothie USB serial connection Based on GRBL stream.py, but completely different """ from __future__ import print_function import sys import argparse import serial import threading import time import signal import sys errorflg = False intrflg = False def signal_term_hand...
gpl-3.0
954,539,669,062,893,400
22.904
101
0.614123
false
3.511163
false
false
false
FedericoCeratto/lightyears
code/ui.py
1
17342
# # 20,000 Light Years Into Space # This game is licensed under GPL v2, and copyright (C) Jack Whitham 2006-07. # # Do you believe in the users? import pygame , random from pygame.locals import * import stats , menu , draw_obj , mail , particle , tutor import resource from map_items import * from primitives import...
gpl-2.0
-6,321,136,411,997,031,000
32.871094
85
0.509918
false
3.761006
false
false
false
matthiasplappert/lego-elevator
elevator.py
1
2512
#!/usr/bin/python import serial from Queue import Queue, Empty import time import threading from dotstar import Adafruit_DotStar BAUDRATE = 115200 DEVICE = '/dev/ttyACM0' DATAPIN = 20 CLOCKPIN = 21 NUMPIXELS = 59 BLUE = 0x0000FF GREEN = 0xFF0000 RED = 0x00FF00 OFF = 0x000000 ELEVATOR_DOWN = b'd' ELEVATOR...
gpl-3.0
4,372,351,016,660,468,000
24.896907
79
0.586385
false
3.313984
false
false
false
276562578/baidustory
baidustory.py
1
2234
#!/usr/bin/python #coding:utf-8 print '这是一个抓取百度贴吧小说的爬虫,将某部小说贴吧的精品贴进行抓取并合并在一起'+'\n' import urllib2 import re #url=raw_input('请输入精品连载贴地址') url='http://tieba.baidu.com/f/good?kw=%E5%A4%A7%E4%B8%BB%E5%AE%B0&ie=utf-8&cid=2' #找到每一章节帖子的地址,并以page_address列表形式存储 def get_page_address(): #这里的函数可以连起来写 #像这样 html=urllib2.urlop...
gpl-3.0
-149,551,047,161,510,900
38.92
117
0.620741
false
2.42233
false
false
false
colour-science/colour-science.org
tasks.py
1
1699
# -*- coding: utf-8 -*- """ Invoke - Tasks ============== """ from __future__ import unicode_literals from invoke import task __author__ = 'Colour Developers' __copyright__ = 'Copyright (C) 2013-2021 - Colour Developers' __license__ = 'New BSD License - https://opensource.org/licenses/BSD-3-Clause' __maintainer__ = ...
bsd-3-clause
5,180,346,486,369,861,000
18.988235
78
0.570924
false
3.693478
false
false
false
SatoshiNakamotoGeoscripting/SatoshiNakamotoGeoscripting
Tweets project/sentimentAnalyzerVader.py
1
4995
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Fri Jan 27 16:23:07 2017 @author: user """ ## FOUND HERE http://www.nltk.org/howto/sentiment.html ## Source code http://www.nltk.org/_modules/nltk/sentiment/vader.html ## http://www.nltk.org/api/nltk.sentiment.html ## Hutto, C.J. & Gilbert, E.E. (2014). VAD...
mit
-4,219,276,119,546,220,000
38.96
121
0.624825
false
3.463939
false
false
false
reissmann/PyTgen
configs/xp1.py
1
5767
''' Copyright (c) 2012 Sven Reissmann <sven@0x80.io> This file is part of the PyTgen traffic generator. PyTgen 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...
gpl-3.0
3,112,552,111,622,368,000
50.035398
193
0.509277
false
3.13765
false
false
false
mikeboers/C3Linearize
setup.py
1
1166
from distutils.core import setup setup( name='C3Linearize', version='0.1.0', description='Python implementation of the C3 linearization algorithm.', url='http://github.com/mikeboers/C3Linearize', py_modules=['c3linearize'], author='Mike Boers', author_email='c3linearize@mikeboers.com'...
bsd-3-clause
-6,231,679,453,400,698,000
34.333333
75
0.59777
false
4.255474
false
true
false
mdbartos/RIPS
temperature/census_year_compat.py
1
1057
import numpy as np import pandas as pd import geopandas as gpd from geopandas import tools census_old = '/home/kircheis/data/shp/census/census_tracts_all/census_tracts_1990.shp' census_new = '/home/kircheis/data/shp/census/census_tracts_all/census_tracts_2014.shp' df_90 = gpd.read_file(census_old) df_14 = gpd.read_fi...
mit
3,268,306,680,844,698,600
35.448276
164
0.658467
false
2.452436
false
true
false
itsrachelfish/gstreamer
preview.py
1
5408
import os import time import signal import subprocess from datetime import datetime from select import select camera = dict() command = dict() currentVideo = dict() commandTimeout = 5 def startVideo(camera, resolution="width=1280,height=720"): directory = "camera/" + str(camera) + "/" + datetime.now().strftime("...
gpl-2.0
-1,269,651,193,475,749,600
33.44586
248
0.527922
false
3.907514
false
false
false
Mausy5043/ubundiagd
daemon15.py
1
4996
#!/usr/bin/env python # Based on previous work by # Charles Menguy (see: http://stackoverflow.com/questions/10217067/implementing-a-full-python-unix-style-daemon-process) # and Sander Marechal (see: http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/) # Adapted by M.Hendrix [2015] (deprecated)...
mit
-2,956,924,764,112,557,600
35.735294
128
0.630705
false
3.344043
false
false
false
google/skia
tools/android/measure_fps.py
2
1394
#!/usr/bin/env python # Copyright 2017 Google Inc. # # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from __future__ import print_function import optparse import re import subprocess import time def query_surfaceflinger_frame_count(): parcel = subprocess.Pope...
bsd-3-clause
-8,101,786,456,625,272,000
25.807692
75
0.66571
false
3.737265
false
false
false
openstack/oslo.context
releasenotes/source/conf.py
1
8643
# -*- coding: utf-8 -*- # Copyright (C) 2020 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
apache-2.0
6,351,396,031,582,769,000
32.370656
79
0.708435
false
3.832816
false
false
false
SpaceGroupUCL/qgisSpaceSyntaxToolkit
esstoolkit/external/networkx/algorithms/tests/test_sparsifiers.py
4
4043
"""Unit tests for the sparsifier computation functions.""" import pytest import networkx as nx from networkx.utils import py_random_state _seed = 2 def _test_spanner(G, spanner, stretch, weight=None): """Test whether a spanner is valid. This function tests whether the given spanner is a subgraph of the ...
gpl-3.0
-8,946,419,108,409,216,000
28.510949
78
0.644571
false
3.377611
true
false
false
i19870503/i19870503
Python/kegg_map_color.py
1
1316
from urllib.parse import urlparse import urllib.request import re import requests as req from PIL import Image from io import BytesIO import pandas as pd kegg_out = pd.read_table('/home/zluna/Work/kegg/2.xls') headers = {'User-Agent' : 'Mozilla/5.0 (Linux;Android 6.0;Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTM...
gpl-2.0
-3,536,817,236,411,083,300
40.125
161
0.661094
false
2.611111
false
false
false
mgp/coding-in-the-real-world-code-samples
code-samples/ch-bittorrent-client-case-study/bencode.py
1
8213
# Copyright (C) 2001-2002 Bram Cohen # # 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, ...
apache-2.0
809,009,702,031,387,800
23.887879
122
0.57689
false
3.319725
false
false
false
jkthompson/nupic
py/regions/SPRegion.py
1
36420
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
gpl-3.0
6,989,874,241,734,602,000
33.488636
99
0.596513
false
4.44038
false
false
false
swift-nav/peregrine
peregrine/iqgen/bits/tcxo_factory.py
2
2021
# Copyright (C) 2016 Swift Navigation Inc. # Contact: Valeri Atamaniouk <valeri@swiftnav.com> # # This source is subject to the license found in the file 'LICENSE' which must # be be distributed together with this source. All other rights reserved. # # THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF A...
gpl-3.0
-1,870,101,731,011,039,500
28.720588
78
0.680851
false
3.213037
false
false
false
MobProgramming/MobTimer.Python
Infrastructure/CountdownManager.py
1
1350
import datetime import time class CountdownManager(object): def __init__(self, root_tk_app): self.start_time = time.time() self.minutes = 0 self.seconds = 0 self.time_change_callbacks = [] self.count_down_total = datetime.timedelta(days=-1, minutes=0, seconds=0) se...
mit
-2,718,077,430,360,165,400
35.513514
111
0.640741
false
3.708791
false
false
false
nbessi/l10n-switzerland
__unported__/l10n_ch_dta/payment.py
1
1449
# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi. Copyright Camptocamp SA # Donors: Hasa Sàrl, Open Net Sàrl and Prisme Solutions Informatique SA # # This program is free software: you can redistribute it and/or modify # it unde...
agpl-3.0
-9,097,814,641,466,798,000
44.21875
87
0.565308
false
4.452308
false
false
false
joelsmith/openshift-tools
ansible/roles/lib_git/library/git_merge.py
1
14419
#!/usr/bin/env python # ___ ___ _ _ ___ ___ _ _____ ___ ___ # / __| __| \| | __| _ \ /_\_ _| __| \ # | (_ | _|| .` | _|| / / _ \| | | _|| |) | # \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____ # | \ / _ \ | \| |/ _ \_ _| | __| \_ _|_ _| # | |) | (_) | | .` | (_) || | | _|| |) | | ...
apache-2.0
-3,352,005,166,285,744,000
30.209957
120
0.516679
false
4.113837
false
false
false
ge0rgi/cinder
cinder/api/contrib/volume_transfer.py
1
6224
# Copyright 2011 OpenStack Foundation # 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 requ...
apache-2.0
8,315,506,419,070,124,000
35.611765
78
0.599293
false
4.546384
false
false
false
patjouk/djangogirls
applications/migrations/0015_auto_20151203_1109.py
1
1285
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('applications', '0014_auto_20150814_0439'), ] operations = [ migrations.AlterField( model_name='application', ...
bsd-3-clause
-8,440,414,282,770,642,000
52.541667
480
0.652918
false
4.341216
false
false
false
aringh/odl
examples/space/simple_rn.py
1
4104
"""An example of a very simple space, the space rn. Including some benchmarks with an optimized version. """ import numpy as np import odl from odl.space.base_tensors import TensorSpace, Tensor from odl.util.testutils import Timer class SimpleRn(TensorSpace): """The real space R^n, non-optimized implmentation."...
mpl-2.0
2,834,706,837,063,019,500
28.52518
78
0.584064
false
3.152074
false
false
false
nicozhang/pyspider
pyspider/fetcher/tornado_fetcher.py
1
27165
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<i@binux.me> # http://binux.me # Created on 2012-12-17 11:07:19 from __future__ import unicode_literals import os import sys import six import copy import time import json import logging import trac...
apache-2.0
1,857,981,678,926,246,400
36.887029
110
0.539555
false
4.125911
false
false
false
mjwestcott/projecteuler
python/problem64.py
1
1634
""" problem64.py https://projecteuler.net/problem=64 The first ten continued fraction representations of (irrational) square roots are: sqrt(2)=[1;(2)] period=1 sqrt(3)=[1;(1,2)] period=2 sqrt(5)=[2;(4)] period=1 sqrt(6)=[2;(2,4)] period=2 sqrt(7)=[2;(1,1,1,4)] ...
mit
-679,435,573,260,069,200
31.68
98
0.575275
false
2.938849
false
false
false
kaji-project/shinken
shinken/objects/timeperiod.py
1
32079
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2009-2014: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # Gregory Starck, g.starck@gmail.com # Hartmut Goebel, h.goebel@goebel-consult.de # # This file is part of Shinken. # # Shinken is free software: you can redis...
agpl-3.0
7,439,761,182,976,732,000
38.216381
150
0.508276
false
3.405053
false
false
false
iglpdc/dmrg101
dmrg101/utils/models/hubbard_model.py
1
4153
"""A few convenience functions to setup the Hubbard model. .. math:: H=\sum_{i}\vec{S}_{i}\cdot\vec{S}_{i+1}= \sum_{i}\left[S^{z}_{i}S^{z}_{i+1}+ \frac{1}{2}\left(S^{\dagger}_{i}S^{-}_{i+1}+ S^{-}_{i}S^{\dagger}_{i+1}\right)\right] """ class HubbardModel(object): """Implements a few convenience fu...
mit
-898,470,415,023,037,800
45.144444
87
0.57934
false
2.854296
false
false
false
herrera-luis-alberto/UChSonicAnemometer
software/utilities.py
1
2375
# # Copyright (C) 2013 UNIVERSIDAD DE CHILE. # # 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 program is dist...
gpl-3.0
-7,615,983,306,939,609,000
36.109375
77
0.733474
false
3.566066
false
false
false
amueller/word_cloud
examples/emoji.py
1
2207
#!/usr/bin/env python """ Emoji Example =============== A simple example that shows how to include emoji. Note that this example does not seem to work on OS X, but does work correctly in Ubuntu. There are 3 important steps to follow to include emoji: 1) Read the text input with io.open instead of the built in open. ...
mit
-5,022,895,760,860,490,000
44.040816
113
0.725872
false
3.635914
false
false
false
jrugis/cell_mesh
vox_geometry_ORIGINAL.py
1
2431
#!/usr/bin/python import numpy as np import libtiff as tf import time as tm from operator import add import geo fdir = "layers/" tdir = "geometry/" fname = "cellsN8R" # time the code t1 = tm.time() # get the reduced image stack print "load image stack" f = tf.TIFF3D.open(fdir+fname+".tif", mode='r') images = f.re...
gpl-3.0
4,789,773,116,387,446,000
30.166667
88
0.643357
false
2.692137
false
false
false
DuCalixte/stock_scraper
simple_cgi_python_server.py
1
2887
#!/usr/bin/python from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer from os import curdir, sep import sys, getopt import cgi class ServerHandler(BaseHTTPRequestHandler): # Handler for the GET requests def do_GET(self): if self.path=="/": self.path="/app/views/index.html" try: # Check the file ...
mit
-4,768,539,710,734,336,000
26.759615
83
0.652927
false
3.186534
false
false
false
Lazza/RecuperaBit
recuperabit/utils.py
1
11140
"""Collection of utility functions.""" # RecuperaBit # Copyright 2014-2021 Andrea Lazzarotto # # This file is part of RecuperaBit. # # RecuperaBit 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 versio...
gpl-3.0
-7,770,371,724,455,393,000
30.468927
93
0.572801
false
3.798159
false
false
false
ahmetcemturan/SFACT
skeinforge_application/skeinforge_utilities/skeinforge_help.py
1
3725
""" Help has buttons and menu items to open help, blog and forum pages in your primary browser. """ from __future__ import absolute_import #Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module. import __init__ from...
agpl-3.0
-1,454,038,206,393,969,700
56.307692
163
0.743893
false
3.581731
false
false
false
Diyago/Machine-Learning-scripts
DEEP LEARNING/Pytorch from scratch/word2vec-embeddings/utils.py
1
1512
import re from collections import Counter def preprocess(text): # Replace punctuation with tokens so we can use them in our model text = text.lower() text = text.replace(".", " <PERIOD> ") text = text.replace(",", " <COMMA> ") text = text.replace('"', " <QUOTATION_MARK> ") text = text.replace...
apache-2.0
2,550,184,521,592,176,000
34.162791
73
0.623677
false
3.491917
false
false
false
dipanm/ytdragon
ytdragon/ytpage.py
1
3399
#!/usr/bin/python3 -u import os import logging import string import re import urllib from urllib import parse as urlparse import pprint from lxml import html default_host = "youtube.com" default_hurl = "https://"+default_host skip_codes = { "#": "COMMENT", "@" : "DONE", "?" : "BAD_ITEM", "=" : "COMMAND" } u...
gpl-3.0
-4,245,832,291,803,000,300
26.634146
104
0.559576
false
2.519644
false
false
false
solus-project/evolve-sc
xng/application.py
2
3076
#!/usr/bin/env python2 # -*- coding: utf-8 -*- # # This file is part of solus-sc # # Copyright © 2013-2018 Ikey Doherty <ikey@solus-project.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
-1,940,108,545,832,785,200
30.060606
72
0.595772
false
3.942308
false
false
false
multidadosti-erp/multidadosti-addons
general_payments/models/account_payment.py
1
8028
from datetime import datetime from odoo import api, fields, models from odoo.tools.translate import _ from odoo.exceptions import UserError, ValidationError class AccountPayment(models.Model): _inherit = 'account.payment' payment_amount_original = fields.Monetary(string='Original Value', ...
agpl-3.0
1,683,337,759,244,076,000
37.763285
150
0.56817
false
4.14677
false
false
false
won0089/oppia
scripts/install_third_party.py
1
9591
# 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 required by applicable ...
apache-2.0
-2,492,920,486,599,524,400
38.9625
90
0.648942
false
3.736268
false
false
false
atodorov/dnf
dnf/cli/cli.py
1
44597
# Copyright 2005 Duke University # Copyright (C) 2012-2015 Red Hat, 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 versi...
gpl-2.0
388,673,573,406,924,300
39.432457
104
0.568289
false
4.157841
true
false
false
magfest/ubersystem
uber/api.py
1
38302
import re import uuid from datetime import datetime from functools import wraps import cherrypy import pytz import six from cherrypy import HTTPError from dateutil import parser as dateparser from pockets import unwrap from time import mktime from residue import UTCDateTime from sqlalchemy import and_, func, or_ from ...
agpl-3.0
-382,661,947,119,875,000
36.477495
121
0.552425
false
4.135838
false
false
false
gingerswede/ITSecCardGame
src/Controller/Master.py
1
3311
''' IDE: Eclipse (PyDev) Python version: 2.7 Operating system: Windows 8.1 @author: Emil Carlsson @copyright: 2015 Emil Carlsson @license: This program is distributed under the terms of the GNU General Public License ''' import Tkinter as tk, pygame from Tkconstants import NW, BOTH from View import GlobalFunc from Co...
gpl-3.0
-7,776,639,673,486,931,000
29.385321
135
0.597101
false
4.023086
false
false
false
TUT-ARG/sed_vis
tests/visualization_test.py
1
4772
#!/usr/bin/env python import sed_vis import dcase_util import os mode = 'probability' current_path = os.path.dirname(os.path.realpath(__file__)) if mode == 'dcase2016': audio_container = dcase_util.containers.AudioContainer().load( os.path.join(current_path, 'data', 'a001.wav') ) event_lists = { ...
mit
-4,408,422,476,550,994,000
31.25
84
0.615046
false
3.519174
false
false
false
mete0r/hypua2jamo
src/hypua2jamo/__init__.py
1
2055
# -*- coding: utf-8 -*- # hypua2jamo: Convert Hanyang-PUA code to unicode Hangul Jamo # Copyright (C) 2012 mete0r # # This file is part of hypua2jamo. # # hypua2jamo 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...
lgpl-3.0
-3,895,820,284,967,063,600
31.619048
77
0.723601
false
3.689408
false
false
false
reinforceio/tensorforce
tensorforce/environments/vizdoom.py
1
5707
# Copyright 2020 Tensorforce Team. 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 la...
apache-2.0
7,290,622,197,792,052,000
38.358621
96
0.631856
false
3.884956
false
false
false
codebhendi/alfred-bot
wiki.py
1
1295
import re from urllib2 import Request, urlopen, URLError import json def handle(text, speaker): # method to get the wiki summary get_wiki(text, speaker) def get_wiki(title, speaker): # get the user voice input as string # make a call to the Wikipedia API request = Request('https://en.wikipedia.or...
mit
1,545,980,548,038,383,600
30.609756
134
0.656371
false
3.658192
false
false
false
xstrengthofonex/code-live-tutorials
python_web_development/tcp_server/redis_clone/threaded_redis_clone.py
1
1560
import socket import threading local = threading.local() def handle(conn): local.data = {} while True: message = conn.recv(1024).decode() fields = message.rstrip("\r\n").split(" ") command = fields[0] if command == "QUIT": break if len(fields) < 2: ...
mit
-438,459,386,589,432,770
26.385965
76
0.524359
false
4.020619
false
false
false
bbqsrc/kbdgen
pysrc/kbdgen/orderedyaml.py
2
1796
import io from collections import OrderedDict import yaml import yaml.constructor # Courtesy of https://gist.github.com/844388. Thanks! class OrderedDictYAMLLoader(yaml.Loader): """A YAML loader that loads mappings into ordered dictionaries.""" def __init__(self, *args, **kwargs): yaml.Loader.__ini...
apache-2.0
-2,055,110,915,693,184,000
29.965517
85
0.586303
false
4.196262
false
false
false
HPI-SWA-Lab/RSqueak
rsqueakvm/primitives/constants.py
1
6591
# ___________________________________________________________________________ # SmallInteger Primitives ADD = 1 SUBTRACT = 2 LESSTHAN = 3 GREATERTHAN = 4 LESSOREQUAL = 5 GREATEROREQUAL = 6 EQUAL = 7 NOTEQUAL = 8 MULTIPLY = 9 DIVIDE = 10 MOD = 11 DIV = 12 QUO = 13 BIT_AND = 14 BIT_OR = 15 BIT_XOR = 16 BIT_SHIFT = 17 MAK...
bsd-3-clause
7,074,637,390,688,386,000
25.258964
124
0.551206
false
3.362755
false
false
false
HybridF5/jacket
jacket/storage/backup/drivers/tsm.py
1
20861
# Copyright 2013 IBM Corp # 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 appl...
apache-2.0
7,567,753,356,534,532,000
38.065543
79
0.540386
false
4.228867
false
false
false
micaiahparker/dicebot
cog/tic.py
1
4405
from discord.ext.commands import command, group from .cog import Cog from random import choice def get_column(i, grid): return [row[i] for row in grid] def check_row(row): return row == "XXX" or row == "OOO" def get_diags(grid): return ("".join(str(grid[x][y]) for x, y in [(0, 0), (1, 1),(2, 2)]), ...
mit
243,149,239,420,478,900
28.965986
95
0.516005
false
3.521183
false
false
false
danhuss/faker
faker/providers/ssn/es_MX/__init__.py
1
5840
""" SSN provider for es_MX. This module adds a provider for mexican SSN, along with Unique Population Registry Code (CURP) and Federal Taxpayer Registry ID (RFC). """ import random import string from .. import Provider as BaseProvider ALPHABET = string.ascii_uppercase ALPHANUMERIC = string.digits + ALPHABET VOWELS ...
mit
8,095,526,841,442,611,000
22.449799
89
0.533996
false
3.112473
false
false
false
CLVsol/odoo_api
clv_person.py
1
13970
#!/usr/bin/env python # -*- encoding: utf-8 -*- ################################################################################ # # # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol # # ...
agpl-3.0
-4,161,943,679,262,339,000
33.647643
106
0.541216
false
3.823384
false
false
false
kornai/pymachine
src/pymachine/wrapper.py
1
8561
#!/usr/bin/env python from copy import deepcopy import cPickle import logging import os import re import sys from pymachine.construction import VerbConstruction from pymachine.sentence_parser import SentenceParser from pymachine.lexicon import Lexicon from pymachine.utils import ensure_dir, MachineGraph, MachineTraver...
mit
-4,532,952,299,784,070,000
36.384279
79
0.559397
false
4.013596
false
false
false
lionheartX/tensorflow-on-ios-tutorial
test.py
1
1624
import os import numpy as np import tensorflow as tf from sklearn import metrics checkpoint_dir = "/tmp/voice/" X_test = np.load("X_test.npy") y_test = np.load("y_test.npy") print("Test set size:", X_test.shape) # To compute on test set, if you have trained the model, you should have # a graph.pb file, we're going ...
mit
8,695,598,589,253,565,000
32.854167
79
0.71798
false
2.947368
true
false
false
nurey/disclosed
app/search.py
1
1979
#!/usr/bin/env python # encoding: utf-8 """ search.py Created by Ilia Lobsanov on 2008-04-12. Copyright (c) 2008 Nurey Networks Inc. All rights reserved. """ import wsgiref.handlers import logging import os #import pprint #pp = pprint.PrettyPrinter(indent=4,depth=5) from google.appengine.ext import webapp, search, d...
mit
8,614,315,598,677,794,000
26.109589
71
0.703386
false
3.515098
false
false
false
danlamanna/scratch
geonotebook/layers.py
1
14932
from collections import namedtuple from collections import OrderedDict import sys import six from . import annotations from .config import Config from .vis.utils import discrete_colors, RasterStyleOptions, \ rgba2hex, VectorStyleOptions BBox = namedtuple('BBox', ['ulx', 'uly', 'lrx', 'lry']) class Geonoteboo...
apache-2.0
509,879,575,440,018,900
32.706546
79
0.574404
false
4.271167
true
false
false
sassoftware/mirrorball
updatebot/groupmgr/group.py
1
17094
# # Copyright (c) SAS Institute, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
apache-2.0
6,035,839,908,508,412,000
33.051793
85
0.570259
false
4.456204
false
false
false
edm1/myopia-education-MR
1_extract_instruments/merge_weights_to_dosage.py
1
2881
#!/usr/bin/env python # -*- coding: utf-8 -*- # import sys import pandas as pd from functools import partial from pprint import pprint def main(): # Args indosage = sys.argv[1] inweights = sys.argv[2] insample = sys.argv[3] outf = sys.argv[4] # Load weights into dict weight_dict = load_...
mit
-2,071,590,774,918,096,600
29.978495
84
0.585561
false
3.385429
false
false
false
F5Networks/f5-ansible
ansible_collections/f5networks/f5_modules/plugins/modules/bigiq_application_https_waf.py
1
33157
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2018, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type DOCUMENTATION = r''' --- module: bigiq_application_https...
gpl-3.0
-8,529,539,818,730,759,000
31.128876
113
0.551528
false
4.487953
false
false
false
jangorecki/h2o-3
h2o-bindings/bin/gen_R.py
1
23070
#!/usr/bin/env python # -*- encoding: utf-8 -*- from __future__ import unicode_literals import bindings as bi import sys PY3 = sys.version_info[0] == 3 str_type = str if PY3 else (str, unicode) # ---------------------------------------------------------------------------------------------------------------------- # ...
apache-2.0
-1,986,338,802,887,520,300
50.726457
460
0.539358
false
3.744522
false
false
false
Vutshi/qutip
examples/cavity-qubit-correlation-3.py
1
1743
# # Example: Calculate the correlation function for a cavity that is coupled to # a qubit. # from qutip import * from pylab import * import time import warnings warnings.simplefilter("error", np.ComplexWarning) def calc_correlation(E, kappa, gamma, g, wc, w0, wl, N, tlist): # # returns the two-time correlati...
gpl-3.0
-8,360,645,354,519,356,000
25.014925
96
0.634538
false
2.740566
false
false
false
hufsm/tu_gen2_libsigrokdecode
decoders/ps2/pd.py
1
4017
## ## This file is part of the libsigrokdecode project. ## ## Copyright (C) 2016 Daniel Schulte <trilader@schroedingers-bit.net> ## ## 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
7,013,878,939,315,223,000
32.198347
77
0.560368
false
3.265854
false
false
false
danielballan/vistools
setup.py
1
1761
from __future__ import (absolute_import, division, print_function) import sys import warnings try: from setuptools import setup except ImportError: try: from setuptools.core import setup except ImportError: from distutils.core import setup from distutils.core import setup, Extension impor...
bsd-3-clause
2,885,555,588,982,058,000
26.092308
69
0.523566
false
4.413534
false
false
false