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
elifesciences/elife-metrics
src/article_metrics/crossref/citations.py
1
1921
from dateutil.relativedelta import relativedelta from article_metrics import models, utils, handler from django.conf import settings import logging from xml.dom.minidom import parseString LOG = logging.getLogger(__name__) URL = "https://doi.crossref.org/servlet/getForwardLinks" def fetch(doi): LOG.info("fetchin...
gpl-3.0
3,356,759,889,692,223,500
29.983871
120
0.667361
false
3.511883
false
false
false
nfirvine/skjl
skjl/core.py
1
1389
import skjl.db import collections class DbObject(collections.Mapping): def __init__(self, _id, **kwargs): self._data = { '_id': _id } self._data.update(kwargs) def __getitem__(self, k): return self._data[k] def __len__(self): return len(self._data) ...
mit
8,085,719,362,877,941,000
24.722222
74
0.527718
false
3.815934
false
false
false
mfherbst/spack
var/spack/repos/builtin/packages/cctools/package.py
5
3037
############################################################################## # 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
8,393,746,646,960,989,000
44.328358
113
0.646362
false
3.712714
false
false
false
SchoolIdolTomodachi/frgl
web/migrations/0007_auto_20150928_2142.py
1
2615
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('web', '0006_remove_ownedcard_max_level'),...
apache-2.0
-8,724,476,751,960,614,000
46.545455
249
0.588145
false
3.962121
false
false
false
ellisonleao/pyshorteners
pyshorteners/shorteners/gitio.py
1
1373
from pyshorteners.base import BaseShortener from pyshorteners.exceptions import ShorteningErrorException class Shortener(BaseShortener): """Git.io shortener Implementation Example: >>> import pyshorteners >>> s = pyshorteners.Shortener(code='12345') >>> s.gitio.short('https://github....
gpl-3.0
4,859,935,204,713,364,000
27.020408
77
0.594319
false
4.026393
false
false
false
lethosor/py-wikibot-legacy
wikibot/ui.py
1
3602
""" User interface """ from __future__ import division __metaclass__ = type import os import sys import wikibot import wikibot.util as util def getTerminalSize(): # Found at http://stackoverflow.com/questions/566746 env = os.environ def ioctl_GWINSZ(fd): try: import fcntl, termios, s...
gpl-3.0
-5,101,304,799,515,994,000
32.045872
110
0.505552
false
3.480193
false
false
false
jtgans/squish
lib/squish/reportcommand.py
1
4225
#!/usr/bin/env python # -*- python -*- # # Copyright (C) 2008 Google, Inc. All Rights Reserved. # # 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 ...
gpl-2.0
2,074,599,780,978,077,400
27.355705
80
0.656568
false
3.785842
true
false
false
bahtou/HMA-Proxy-Spider
HMA_Proxy_Spider/processors.py
1
2183
# HMA has a unique method of presenting IP addresses # This processors applies a method to extract HMA IP addresses from scrapy import log import re class GetIPAddresses(object): '''Parse HTML and extract IP addresses ''' def __init__(self): self.re_IP = re.compile(r'\d+\.\d+\.\d+\.\d+|\d+\.\d+\.\...
mit
2,730,050,688,793,023,500
34.209677
106
0.541915
false
3.532362
false
false
false
adi-sharma/RLIE_A3C
code/vec_consolidate.py
1
2953
''' script to consolidate vectorizers Input: files from dloads Output: into consolidated ''' import numpy as np import copy import sys, json, pdb, pickle, operator, collections from itertools import izip import inflect import predict as predict import helper from sklearn.metrics.pairwise import cosine_sim...
mit
5,738,618,951,371,823,000
26.598131
118
0.684389
false
3.714465
false
false
false
zjonke/EImotif
eim/models/kwta/model_settings_loader.py
1
5642
class NetworkModuleSettings: def __init__(self, module): config = dict( # network anatomy params numinp=module.NUMINP, numexc=module.NUMEXC, numinh=module.NUMINH, syn_in_conn_prob=module.SYN_IN_CONN_PROB, syn_ei_conn_prob=module.SYN_EI_CONN_PROB, syn_ie_conn_prob=mod...
mit
-6,578,050,780,126,812,000
34.26875
163
0.583481
false
2.57508
false
false
false
gajim/gajim
gajim/gtk/groupchat_roster.py
1
16403
# This file is part of Gajim. # # Gajim 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 3 only. # # Gajim is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the...
gpl-3.0
-887,818,098,081,870,000
32.890496
77
0.565628
false
3.866808
false
false
false
vacuumlabs/NexteriaCRM
nexteria/nextis/admin.py
2
2777
from django.contrib import admin from django.shortcuts import HttpResponse # Register your models here. # TODO super user zajozor, rootroot from django.contrib.auth.models import User,Group from .models import * admin.site.register(User) admin.site.register(Group) class ClovekAdmin(admin.ModelAdmin): list_di...
bsd-2-clause
-3,144,946,648,420,689,400
26.22549
106
0.68023
false
3.065121
false
false
false
Grumbel/rfactortools
rfactortools/scn.py
1
3757
# rFactor .scn/.gen file manipulation tool # Copyright (C) 2014 Ingo Ruhnke <grumbel@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 3 of the License, or # (at your o...
gpl-3.0
-4,645,117,278,568,105,000
30.571429
87
0.595954
false
3.475486
false
false
false
MatthewWilkes/mw4068-packaging
src/melange/setup.py
1
1261
"""Minimal setup script to appease buildout for Melange. """ import os import re from setuptools import setup, find_packages match_version = re.compile("version: ([0-9\-]+)") try: appyaml = open(os.path.join("app", "app.yaml.template")) version = match_version.findall(appyaml.read())[0] except: version = "...
apache-2.0
-6,632,694,027,532,329,000
28.325581
83
0.544806
false
3.809668
false
false
false
nathanhilbert/FPA_Core
openspending/views/api_v2/dataview.py
1
1932
import logging import sys import traceback import json from flask import Blueprint, request from flask.ext.login import current_user from openspending.core import db from openspending.model import Dataview from openspending.auth import require from openspending.lib.jsonexport import jsonify from openspending.views.c...
agpl-3.0
8,607,197,746,228,009,000
25.108108
87
0.673913
false
3.708253
false
false
false
Zen-CODE/kivybits
Examples/Properties/main.py
1
1727
''' A demo of Kivy Properties and why they rule ''' from kivy.app import App from kivy.properties import ObjectProperty from kivy.uix.boxlayout import BoxLayout from kivy.lang import Builder from kivy.animation import Animation, AnimationTransition Builder.load_string(''' <ButtonBox>: b1: b1 b2: b2 b3: b3 ...
mit
1,348,336,295,121,731,300
24.028986
76
0.571511
false
3.612971
false
false
false
jabbalaci/jabbapylib
jabbapylib/decorators/jdecor.py
1
1888
#!/usr/bin/python """ Some useful decorators. "jd" stands for "jabba's decorator" :) jd_time: print debug info when entering a function print debug info when quitting a function print execution time of the function jd_requires: Useful if you call external programs/commands. If the given command d...
gpl-3.0
-1,216,265,155,619,379,200
23.842105
93
0.601165
false
3.908903
false
false
false
asreimer/piCalc
main.py
1
2081
from mpmath import mp # A python function to calculate pi accurate to an input tolerance def calculate_pi_to_nth_digit(tol=mp.power(10,-1000)): #TODO: calculate pi up to the Nth requested digit. Only output up to Nth digit. mp.dps = -mp.log10(tol) diff = mp.mpf(1) i = mp.mpf(0) prev = mp.mpf(1) total = mp.mpf(0) ...
gpl-3.0
1,740,848,985,992,344,300
34.896552
104
0.623258
false
2.152017
false
false
false
Mitali-Sodhi/CodeLingo
Dataset/python/test_replica_set_reconfig.py
1
5970
# Copyright 2013 MongoDB, 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 writing, so...
mit
-6,731,717,178,277,838,000
30.925134
78
0.625963
false
3.834297
true
false
false
RealTimeWeb/datasets
preprocess/energy/process.py
1
3434
import pandas as pd import json import states from tqdm import tqdm df = pd.read_csv('Complete_SEDS.csv') codes = df['MSN'].unique() sources = [c[:2] for c in codes] uses = [c[2:4] for c in codes] purposes = [c[4] for c in codes] #print(list(sorted(set(sources)))) #print(list(sorted(set(uses)))) #print(list(sorted(s...
gpl-2.0
-3,701,675,703,528,384,500
28.101695
68
0.49767
false
3.305101
false
false
false
examachine/pisi
pisi/util/fs.py
1
11886
# -*- coding:utf-8 -*- # # Copyright (C) 2005, TUBITAK/UEKAE # # 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. # # Pleas...
gpl-3.0
4,609,210,268,081,019,400
32.576271
114
0.580262
false
3.715536
false
false
false
eblot/miscripts
Python/adsl/modem.py
1
13518
#!/usr/bin/env python3 """Track ADSL modem bit allocation map from CPE data. This has been developed with Buffalo WBMR-HP-G300H. """ from argparse import ArgumentParser, FileType from collections import defaultdict from getpass import getpass from logging import DEBUG, ERROR, getLogger, Formatter, StreamHandler f...
mit
8,727,821,857,866,319,000
35.436658
79
0.510874
false
3.880023
false
false
false
cj4777/vimrc
bundle/vim-nim/autoload/nim_vim.py
1
2437
import threading, Queue, subprocess, signal, os try: import vim except ImportError: class Vim: def command(self, x): print("Executing vim command: " + x) vim = Vim() class NimThread(threading.Thread): def __init__(self, project_path): super(NimThread, self).__init__() self.tasks = Queue.Q...
gpl-2.0
273,167,615,610,109,820
23.867347
104
0.620845
false
3.384722
false
false
false
Kilerd/nougat
nougat/context/response.py
1
2777
from typing import Dict, List, Tuple, Optional class Response: def __init__(self, code: int=200, status: Optional[str]=None): self.__version = '1.1' self.code: int = code self.status: str = status self.content: str = '' self.type: str = 'text/html' self.charset: ...
mit
-8,624,862,760,582,449,000
31.290698
126
0.541952
false
4.226788
false
false
false
nrclark/opkg
tests/core/23_force_depends.py
3
1484
#! /usr/bin/env python # # Create package 'a' with a nonexistent dependency. # Install 'a' with --force-depends and check that 'a' is installed. # # Create package 'b' which depends on 'c' # Install 'b' with --force-depends and check that both 'b' and 'c' are installed. # Remove 'c' with --force-depends and check that ...
gpl-2.0
3,960,908,566,121,260,000
31.26087
96
0.699461
false
3.157447
false
false
false
blaze/dask
dask/base.py
1
37839
from collections import OrderedDict from collections.abc import Mapping, Iterator from contextlib import contextmanager from functools import partial from hashlib import md5 from operator import getitem import inspect import pickle import os import threading import uuid from distutils.version import LooseVersion from ...
bsd-3-clause
-8,081,680,606,068,015,000
31.960801
98
0.608261
false
4.207138
false
false
false
Erotemic/utool
utool/tests/_oldtest_decor.py
1
5034
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function import inspect import utool def func1(arg1, arg2): pass def func2(arg1, arg2, arg4=5, *args, **kwargs): pass def func3(arg1, arg2, arg4=5, **kwargs): pass def func4(*args): pass def func5(**kwargs): p...
apache-2.0
7,611,194,839,962,530,000
24.296482
81
0.559396
false
3.275211
true
false
false
brchiu/tensorflow
tensorflow/contrib/integrate/__init__.py
25
1147
# Copyright 2016 The TensorFlow 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 applica...
apache-2.0
3,630,647,409,609,346,000
31.771429
80
0.714037
false
4.140794
false
false
false
NVlabs/timeloop
scripts/apply_license.py
1
7327
#!/usr/bin/env python3 # Copyright (c) 2019, NVIDIA CORPORATION. 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, ...
bsd-3-clause
-1,915,422,674,310,626,300
30.581897
101
0.603385
false
3.844176
false
false
false
pombredanne/pex
tests/test_integration.py
1
1285
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import os import sys from twitter.common.contextutil import environment_as, temporary_dir, temporary_file from pex.testing import run_simple_pex_test def test_pex_execute(): body = "...
apache-2.0
5,302,624,788,467,240,000
26.340426
84
0.658366
false
3.220551
true
false
false
rationalAgent/edx-platform-custom
cms/djangoapps/contentstore/tests/test_item.py
2
8653
from contentstore.tests.test_course_settings import CourseTestCase from xmodule.modulestore.tests.factories import CourseFactory from django.core.urlresolvers import reverse from xmodule.capa_module import CapaDescriptor import json from xmodule.modulestore.django import modulestore import datetime from pytz import UTC...
agpl-3.0
8,842,923,420,499,047,000
34.609053
117
0.568242
false
4.337343
true
false
false
deeso/python_scrirpts
ida/ida_python_cpp_cleanup.py
1
2595
start = 0x04EA8A4 end = 0x4EAFF8 if start == 0xFFFFFFF or\ end == 0xFFFFFFF or\ start == end: print "Please enter a valid address for start and end!" def get_alignment(length, align = 4): if (length % align) == 0: return 0 return align - (length % align) def get_end_addr_and_type_desc(ea, end): desc_str = "...
apache-2.0
7,611,397,532,817,845,000
26.03125
91
0.619653
false
2.514535
false
false
false
isudox/leetcode-solution
python-algorithm/leetcode/regular_expression_matching.py
1
1801
"""10. Regular Expression Matching https://leetcode.com/problems/regular-expression-matching/description/ Given an input string (s) and a pattern (p), implement regular expression matching with support for '.' and '*'. '.' Matches any single character. '*' Matches zero or more of the preceding element. The matchi...
mit
2,136,845,455,099,409,200
18.290323
77
0.573579
false
3.13089
false
false
false
andrewhead/ReadableStrings
fetch/resource_links.py
1
3536
#! /usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals import logging import time from peewee import fn from fetch.api import make_request, default_requests_session from models import Dataset, Resource from lock import lock_method from progressbar import ProgressBar, Percentage, Bar, E...
mit
1,319,721,535,171,144,400
31.740741
95
0.618778
false
4.1649
false
false
false
nyaruka/sigtrac
sigtrac/carriers/migrations/0006_set_colors.py
1
4958
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): "Write your forwards methods here." from sigtrac.carriers.models import Carrier Carrier.objects.filter(sl...
mit
-2,051,025,133,456,974,600
66.917808
187
0.564744
false
3.632234
false
false
false
photoninger/ansible
lib/ansible/modules/cloud/amazon/iam_role_facts.py
16
6484
#!/usr/bin/python # Copyright: Ansible Project # 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 ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
-9,207,135,741,394,032,000
30.475728
101
0.644818
false
3.951249
false
false
false
benmos/nixops
nixops/nix_expr.py
13
10180
import re import string from textwrap import dedent __all__ = ['py2nix', 'nix2py', 'nixmerge', 'expand_dict', 'RawValue', 'Function'] class RawValue(object): def __init__(self, value): self.value = value def get_min_length(self): return len(self.value) def is_inlineable(self...
lgpl-3.0
6,660,137,855,939,228,000
31.83871
79
0.534185
false
3.912375
false
false
false
papaloizouc/sockets
graph/lastfm.py
1
9243
import flask import requests from pprint import pprint import os import pickle from py2neo import neo4j from py2neo import cypher import json import py2neo import time from flask import Flask, jsonify, request, Response from datetime import timedelta from flask import make_response, request, current_app from functools...
gpl-2.0
1,677,575,755,028,383,700
28.25
92
0.580656
false
3.509112
false
false
false
lkloh/aimbat-lite
src/pysmo/aimbat/plotphase.py
2
17512
#!/usr/bin/env python #------------------------------------------------ # Filename: plotphase.py # Author: Xiaoting Lou # Email: xlou@u.northwestern.edu # # Copyright (c) 2009-2012 Xiaoting Lou #------------------------------------------------ """ Python module for plotting multiple seismograms in one axes. Plot...
gpl-3.0
1,865,448,868,372,038,100
28.531197
114
0.659719
false
2.590149
false
false
false
etetoolkit/ete
ete3/ncbi_taxonomy/__init__.py
5
1509
from __future__ import absolute_import # #START_LICENSE########################################################### # # # This file is part of the Environment for Tree Exploration program # (ETE). http://etetoolkit.org # # ETE is free software: you can redistribute it and/or modify it # under the terms of the GNU Gener...
gpl-3.0
-8,796,745,529,585,930,000
36.725
75
0.658714
false
3.716749
false
false
false
convexquad/treebank
RNN/rnn.py
1
11928
""" rnn.py Recursive Neural Network (RNN) for Treebank sentiment Written by Alex Bain (https://github.com/convexquad/treebank) """ import numpy import os import treebank D = 30 # Dimensionality of our word model R = 0.0001 # Range for the uniform dist to initialize the words C = treebank.C # Number of ...
apache-2.0
4,668,730,069,101,782,000
38.627907
138
0.5861
false
3.215961
false
false
false
google-research/google-research
tcc/visualize_alignment.py
1
6809
# 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
-7,805,049,392,694,768,000
27.48954
85
0.629755
false
3.228544
false
false
false
n2o/guhema
products/migrations/0057_auto_20160118_2025.py
1
2432
# -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2016-01-18 20:25 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('products', '0056_auto_20160118_2012'), ] operations = [ migrations.AddField(...
mit
-7,149,487,411,108,340,000
33.714286
82
0.566255
false
4.090909
false
false
false
amirkdv/biseqt
experiments/blot_rearrangement.py
1
7255
import numpy as np from matplotlib import gridspec import matplotlib import logging from matplotlib import pyplot as plt from mpl_toolkits.axes_grid1 import make_axes_locatable from biseqt.pw import Aligner, STD_MODE, LOCAL from biseqt.blot import WordBlot from biseqt.sequence import Alphabet from biseqt.stochastics i...
bsd-3-clause
-1,504,459,344,907,506,700
37.386243
81
0.578911
false
2.97458
false
false
false
squaresLab/Houston
experiments/preprocess_data.py
1
5565
import logging import os import json import csv import concurrent.futures import random import argparse from ruamel.yaml import YAML from filter_truth import filter_truth_traces, VALID_LIST_OUTPUT logger = logging.getLogger('houston') # type: logging.Logger logger.setLevel(logging.DEBUG) def setup_logging(verbose:...
mit
-7,657,608,485,950,160,000
40.222222
123
0.578437
false
3.992109
false
false
false
Supato/linkitos
linkitos/models/content.py
1
1127
""" Models containing Content (links), Tags, Relations """ from django.db import models class Content(models.Model): """ Content model """ url = models.URLField(blank=True, null=True) description = models.CharField(max_length=2048, blank=True) tags = models.ManyToManyField('Tag', through='Cont...
gpl-2.0
-3,868,754,494,829,242,000
24.044444
66
0.651287
false
3.794613
false
false
false
seat3542/EasyLauncherGamePack
minesweeper/Minesweeper.py
2
16629
#!/usr/bin/python3 ############################################################# # File Name: Minesweeper.py # Author: A.S. ("LittleFireDragon") # Date: 11/11/14 # Purpose: The classic game, Minesweeper, made in python. ############################################################# from tkinter import * from...
gpl-3.0
599,296,067,015,804,700
35.467105
68
0.662457
false
3.066384
true
false
false
openstack/dragonflow
dragonflow/controller/df_base_app.py
1
10981
# Copyright (c) 2015 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...
apache-2.0
9,081,459,014,941,514,000
35.481728
79
0.544577
false
4.467453
false
false
false
chengky/nw.js
tools/file_util.py
77
4471
# Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights # reserved. Use of this source code is governed by a BSD-style license that # can be found in the LICENSE file. from glob import iglob import os import shutil import sys import time def read_file(name, normalize = True): """ Read a file. """...
mit
4,186,955,550,774,932,500
30.70922
87
0.580631
false
3.776182
false
false
false
seap-udea/interstellar
initials.py
1
3214
import numpy as np import re f=open("initials.conf") qsolution=0 qelements=0 qcovariance=0 solution="" elements="" covariance="" isolution=-1 ielements=-1 icovariance=-1 for line in f: if re.match("^\s*$",line):continue line=line.replace("\n","") #HEADER if "#*" in line: if "SOLUTION" in line...
gpl-3.0
-2,278,499,309,520,353,000
33.934783
105
0.456752
false
3.579065
false
false
false
openstack/cinder
cinder/api/v3/views/backups.py
2
1696
# Copyright 2017 FiberHome Telecommunication Technologies CO.,LTD # 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/LI...
apache-2.0
-7,450,611,815,388,150,000
41.4
78
0.689858
false
4.067146
false
false
false
geotagx/pybossa
pybossa/extensions.py
1
3249
# -*- coding: utf8 -*- # This file is part of PyBossa. # # Copyright (C) 2015 SciFabric LTD. # # PyBossa 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 op...
agpl-3.0
4,241,975,181,179,411,000
24.992
79
0.729763
false
3.578194
false
false
false
539h/pymastermind
gui.py
1
8731
""" this is the code of the GUI Copyright (C) 2015 Corentin Bocquillon <corentin@nybble.fr> 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 ...
gpl-3.0
-4,721,904,355,437,898,000
51.584337
103
0.672013
false
3.33805
false
false
false
yuyuz/FLASH
benchmarks/sklearn/ml_framework.py
1
31630
import time import os import arff import numpy as np import HPOlib.benchmark_util as benchmark_util from sklearn.cross_validation import cross_val_score from sklearn.metrics import accuracy_score from sklearn.pipeline import Pipeline from sklearn.datasets import load_iris from MultilabelClassifier import MultilabelCl...
gpl-3.0
-6,366,487,717,579,679,000
47.069909
176
0.5503
false
3.854497
false
false
false
pyjs/pyjs
examples/gridtest/__main__.py
8
1053
#!/usr/bin/env python # -*- coding: utf-8 -*- TARGETS = [ 'GridTest.py', ] PACKAGE = { 'title': 'Grid Test', 'desc': 'Demo of grid control', } def setup(targets): '''Setup example for translation, MUST call util.setup(targets).''' util.setup(targets) def translate(): '''Translate example...
apache-2.0
2,736,890,138,262,434,300
18.867925
77
0.591643
false
3.631034
false
false
false
carangorango/sgl
tests/test_converters.py
2
32114
from __future__ import division import numpy as np import pytest from democritus.converters import DynamicsFactory, ElementsFactory, BivariateFunctionReader, StatesFactory, \ GameFactory, MetricFactory, PriorsFactory, SimulationSpecReader, ElementSetFactory, MessageSetFactory, \ ActionSetFactory from democrit...
gpl-2.0
3,701,547,585,347,260,000
47.954268
119
0.579031
false
3.681532
true
false
false
UsAndRufus/Danger-Chorus
app/hello/testapp/views_old.py
1
6031
from django.http import HttpResponse from hello.testapp.models import * from django.template import Context, Template import urllib2 from xml.etree.ElementTree import ElementTree, tostring import urllib import json #this part is used to extract the common name of every animal(from the database)and split it onto new...
apache-2.0
6,840,418,108,498,575,000
34.89881
288
0.62444
false
3.293829
false
false
false
jinghaomiao/apollo
modules/tools/mapshow/libs/planning.py
3
20994
#!/usr/bin/env python3 ############################################################################### # Copyright 2017 The Apollo 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...
apache-2.0
-7,349,271,314,876,518,000
41.497976
85
0.569448
false
3.398737
false
false
false
hoburg/gpkit
gpkit/constraints/bounded.py
1
3963
"Implements Bounded" from collections import defaultdict import numpy as np from .. import Variable from .set import ConstraintSet def varkey_bounds(varkeys, lower, upper): """Returns constraints list bounding all varkeys. Arguments --------- varkeys : iterable list of varkeys to create bound...
mit
276,064,874,305,396,060
35.694444
79
0.590209
false
4.508532
false
false
false
ArchaeoPY/ArchaeoPY
GUI_Templates/plotter.py
1
4987
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'mpl.ui' # # Created: Mon Nov 24 15:07:00 2014 # by: PyQt4 UI code generator 4.10.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeE...
gpl-2.0
-5,058,783,934,316,210,000
50.412371
110
0.698015
false
3.77803
false
false
false
quark-zju/wcdesktop
WallpaperClockDesktop.py
1
9301
#!/usr/bin/env python2 import os import sys from datetime import datetime from random import choice import time import pygtk pygtk.require('2.0') import gtk import gobject from WallpaperClock import WallpaperClock # redraw rate, in 0.001 seconds FRAME_REFRESH_RATE = 50 # theme change rate, in second THEME_CHANGE_...
mit
6,130,945,979,606,646,000
33.576208
111
0.565316
false
3.841801
false
false
false
yasir1brahim/OLiMS
report/olims_report_analysisper_service.py
2
2447
import time from openerp import api, models import datetime class ReportAnalysisPerService(models.AbstractModel): _name = 'report.olims.report_analysisper_service' def _get_analyses(self, analyses, analyses_services): service_analyses_dict = {} service_category = {} for service in ana...
agpl-3.0
8,927,601,571,447,413,000
42.714286
135
0.588476
false
3.829421
false
false
false
skibblenybbles/django-grunt
setup.py
1
1268
#!/usr/bin/env python import os from setuptools import setup, find_packages import grunt def read(filename): with open(os.path.join(os.path.dirname(__file__), filename)) as source: return source.read() setup( name="django-grunt", version=grunt.__version__, description="Django tools for inte...
mit
2,139,061,167,144,054,300
29.926829
79
0.626183
false
4.130293
false
false
false
puapinyoying/IsoSeqScripts
DemultiplexFlncFasta.py
1
5154
#! /usr/env python # Script to demultiplex barcoded full-length isoseq reads into their own # individual fasta files (barcodes are referred to as primers in the sequence # files because they are technically custom primers. Will use primer/barcode # interchangably) import re import sys import os import argparse impor...
mit
6,975,244,262,098,230,000
34.798611
81
0.64901
false
3.601677
false
false
false
erwindl0/python-rpc
org.eclipse.triquetrum.python.service/scripts/scisoftpy/python/pyplot.py
1
5177
### # Copyright 2011 Diamond Light Source 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 applicable law or agr...
epl-1.0
3,865,609,436,828,520,400
32.616883
146
0.656558
false
3.653493
false
false
false
breezechen/eurasia
src/eurasia/fcgi.py
1
17388
from cgietc import wsgi, json, Form, SimpleUpload, Browser, Comet from socket2 import mainloop0, mainloop as mainloop1, SSL, Disconnect, \ SocketFile, Sockets, TcpServer import os, re, sys from sys import stderr from weakref import proxy from time import gmtime, strftime, time from struct import pack, unpack, calcsiz...
bsd-3-clause
-7,598,529,600,531,919,000
24.018705
95
0.61876
false
2.954128
false
false
false
goibibo/woof
tests/test_transactions.py
1
1676
# -*- coding: utf-8 -*- import os import logging import time import thread from woof.transactions import TransactionLogger logging.basicConfig( format='%(asctime)s.%(msecs)s:%(name)s:%(thread)d:%(levelname)s:%(process)d:%(message)s', filename='/tmp/kafkalog', level=logging.INFO ) logger = logg...
apache-2.0
426,010,752,153,006,400
24.246154
97
0.6039
false
3.19883
false
false
false
zubie7a/Algorithms
Advent_of_Code/2018/Day_05/day_05.2.py
3
1995
# https://adventofcode.com/2018/day/5 # List of logs to read from STDIN. polymers = [] # test_polymers = [ # "dabAcCaCBAcCcaDA" # ] # Any better way to read until EOF without any clear number of lines? try: while True: line = str(input()) # print(line) polymers.append(line) except Exc...
mit
8,621,700,135,708,971,000
32.813559
77
0.609023
false
3.75
false
false
false
viswimmer1/PythonGenerator
data/python_files/29560771/index.py
2
6227
import pyjd # dummy in pyjs from pyjamas.ui.TabBar import TabBar from pyjamas.ui.TabPanel import TabPanel from pyjamas.ui import HasAlignment from pyjamas.ui.Image import Image from pyjamas.ui.DockPanel import DockPanel from pyjamas.ui import HasAlignment from pyjamas.ui.VerticalPanel import VerticalPanel from pyjamas...
gpl-2.0
9,002,359,036,937,655,000
33.027322
79
0.595471
false
3.691168
false
false
false
Kwentar/Dream-Crusher
app/dreams_views.py
1
1722
from flask import Blueprint, render_template, redirect, url_for, g, request from flask_login import login_required, current_user from app.forms import DreamsForm from app.models import Dream dream_module = Blueprint('dreams', __name__, template_folder='templates') @dream_module.route('/dreams', methods=['GET', 'POST'...
apache-2.0
6,327,799,108,568,528,000
43.153846
107
0.606272
false
3.389764
false
false
false
mpSchrader/gym-sokoban
examples/Profile_Performance.py
1
1065
import cProfile import gym import gym_sokoban import time import argparse parser = argparse.ArgumentParser(description='Run environment with random selected actions.') parser.add_argument('--rounds', '-r', metavar='rounds', type=int, help='number of rounds to play (default: 20)', default=20) parser...
mit
6,240,954,923,500,136,000
30.323529
93
0.662911
false
3.227273
false
false
false
wdzhou/mantid
scripts/AbinsModules/CalculateSingleCrystal.py
1
2500
from __future__ import (absolute_import, division, print_function) import AbinsModules class CalculateSingleCrystal(AbinsModules.IOmodule): def __init__(self, filename=None, abins_data=None, temperature=None): """ @param filename: name of input DFT filename @param abins_data: object of ty...
gpl-3.0
7,707,750,842,940,635,000
38.0625
119
0.6528
false
3.759398
false
false
false
open-o/nfvo
lcm/lcm/pub/nfvi/vim/api/openstack/image.py
1
3744
# Copyright 2016 ZTE 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 in ...
apache-2.0
1,237,889,200,798,680,300
34.320755
112
0.637019
false
3.457064
false
false
false
tripzero/snetcam
snetcam/recognitionprotocol.py
1
1960
import json from base64 import b64decode, b64encode import numpy as np class Messages: @staticmethod def list_users(filter = None): msg = { "method" : "list_users", "filter": filter} return json.dumps(msg) @staticmethod def list_users_with_level(level): msg = { "method" : "list_users_with_level", "level": ...
lgpl-2.1
5,773,464,413,376,487,000
22.914634
90
0.662245
false
3.0625
false
false
false
cockpit-project/cockpituous
ansible/roles/cockpit-demo-fakeupdates/updateinfo-test.py
1
4701
#!/usr/bin/python3 import sys import subprocess repo_dir = "/var/tmp/repo" updateInfo = {} def cmd(command): subprocess.check_call(command, shell=True) # disable all existing repositories cmd("rm -rf /etc/yum.repos.d/* /var/cache/yum/*") # have PackageKit start from a clean slate cmd("systemctl stop packagekit...
lgpl-2.1
1,175,600,501,683,834,000
33.065217
173
0.60987
false
3.140281
false
false
false
OGGM/oggm
oggm/mpi.py
5
3582
"""MPI process management helpers and setup""" from mpi4py import MPI from oggm import cfg import atexit import argparse import sys OGGM_MPI_SIZE = 0 OGGM_MPI_COMM = None OGGM_MPI_ROOT = 0 def _imprint(s): print(s) sys.stdout.flush() def _shutdown_slaves(): global OGGM_MPI_COMM if OGGM_MPI_COMM is ...
bsd-3-clause
4,926,578,666,598,572,000
26.553846
75
0.611949
false
3.112076
false
false
false
UITools/saleor
saleor/graphql/core/utils.py
1
1328
import graphene from django.core.exceptions import ValidationError def clean_seo_fields(data): """Extract and assign seo fields to given dictionary.""" seo_fields = data.pop('seo', None) if seo_fields: data['seo_title'] = seo_fields.get('title') data['seo_description'] = seo_fields.get('de...
bsd-3-clause
9,093,346,185,664,826,000
33.051282
75
0.64759
false
3.550802
false
false
false
sukeesh/Jarvis
jarviscli/plugins/write_agenda.py
1
4096
""" Jarvis plugin for keeping your own personal events' agenda! Using this feature one can store in a csv file all the needed details for an event to remember. More specifically, these details are date, time, place, title and description of the upcoming event. """ import csv import os import time import datetime fro...
mit
-1,040,354,543,779,064,000
34.929825
74
0.5354
false
4.617813
false
false
false
kroger/pyknon
pyknon/notation.py
3
1888
import re from fractions import Fraction REGEX_NOTE = re.compile("([a-gA-GRr])([b#]*)([0-9]*)([.]*)([',]*)") class NotationError(Exception): pass def parse_accidental(acc): n = len(acc) if acc else 0 return -n if "b" in acc else n def parse_octave(string): """5 is central octave. Return 5 as a fa...
mit
7,928,507,041,230,290,000
25.971429
80
0.574682
false
3.141431
false
false
false
thequbit/chatterstats
views.py
1
1319
from db.tweets import tweets as _tweets from pyramid.view import view_config import string import re import nltk import simplejson as json @view_config(renderer="words.pt", name="words.json") def words_view(request): t = _tweets('lisa.duffnet.local','csuser','password123%%%','chatterstats') results = t.getlast...
gpl-3.0
6,235,785,997,781,423,000
36.685714
80
0.588324
false
3.498674
false
false
false
Esri/ArcREST
src/arcrest/ags/_imageservice.py
2
55610
from __future__ import absolute_import from __future__ import print_function from .._abstract.abstract import BaseSecurityHandler, BaseAGSServer from ..security import AGSTokenSecurityHandler, PortalServerSecurityHandler from ..common.general import MosaicRuleObject, local_time_to_online import datetime, urllib import ...
apache-2.0
7,276,296,458,118,012,000
43.169976
110
0.5918
false
5.015332
false
false
false
petervaro/formbuilder
views.py
1
2482
## INFO ######################################################################## ## ## ## formbuilder ## ## =========== ...
gpl-3.0
160,898,668,250,523,700
64.315789
80
0.342466
false
6.331633
false
false
false
bostonlink/nwmaltego
nw_threat_2_UA.py
1
2112
#!/usr/bin/env python # Copyright (C) 2012 nwmaltego Developer. # This file is part of nwmaltego - https://github.com/bostonlink/nwmaltego # See the file 'LICENSE' for copying permission. # Maltego NW Threat to Client Application (User Agent) # Author: David Bressler (@bostonlink) import sys import urllib2, urllib, j...
gpl-3.0
8,792,999,784,737,040,000
29.623188
106
0.63447
false
3.087719
false
false
false
andikleen/pmu-tools
ucevent/ucevent.py
1
35401
#!/usr/bin/env python # Copyright (c) 2013, Intel Corporation # Author: Andi Kleen # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU General Public License, # version 2, as published by the Free Software Foundation. # # This program is distributed in...
gpl-2.0
1,019,101,288,583,481,600
30.135444
101
0.522471
false
3.497086
false
false
false
vizzie-tx/epub3-template
subsetFonts.py
1
2664
n#!/usr/bin/env python # Copyright (c) 2014-2016 Larry Daffner # 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, mo...
mit
-7,944,858,715,714,681,000
34.52
70
0.65015
false
3.900439
false
false
false
mlskit/astromlskit
REGRESSION/ridgefront.py
2
2947
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'ridgefront.ui' # # Created: Mon Apr 06 08:47:55 2015 # by: PyQt4 UI code generator 4.10.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except Att...
gpl-3.0
-1,600,901,500,475,255,300
42.985075
79
0.67696
false
3.702261
false
false
false
simonreich/DLRG-Wettkampf
lib/lauflisten.py
1
11075
# -*- coding: utf-8 -*- """ This file is part of DLRG-Wettkampf. Foobar 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. ...
lgpl-3.0
-6,028,504,500,142,594,000
29.67036
122
0.518154
false
3.554414
false
false
false
luzfcb/django_documentos
django_documentos/templatetags/django_documentos_tags.py
1
1529
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals from django import template from django.forms.models import modelform_factory from simple_history.forms import new_readonly_form_class from ..utils import identificador register = template.Library() @register.filter d...
bsd-3-clause
-1,283,278,348,093,367,800
24.065574
86
0.69588
false
3.46712
false
false
false
google/grr
colab/grr_colab/convert.py
1
5072
#!/usr/bin/env python """Module containing functions for converting messages to dataframe.""" import collections import datetime import stat from typing import Text, Sequence, List, Any, Dict, Optional import pandas as pd from google.protobuf import descriptor from google.protobuf import message from grr_response_pro...
apache-2.0
6,928,928,856,506,745,000
27.022099
80
0.687303
false
3.757037
false
false
false
Vauxoo/stock-logistics-warehouse
procurement_auto_create_group/models/procurement_group.py
2
1206
# Copyright 2017 Eficent Business and IT Consulting Services, S.L. # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo import api, models, _ from odoo.exceptions import UserError class ProcurementGroup(models.Model): _inherit = 'procurement.group' @api.model def _get_rule(sel...
agpl-3.0
8,380,621,078,367,003,000
37.903226
79
0.635987
false
3.928339
false
false
false
grembo/buildbot
master/buildbot/data/logchunks.py
11
4962
# This file is part of Buildbot. Buildbot is free software: you can # redistribute it and/or modify it under the terms of the GNU General Public # License as published by the Free Software Foundation, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
281,602,326,580,893,860
34.442857
96
0.635631
false
3.736446
false
false
false
RPiAwesomeness/BeamBot
store.py
1
5506
""" This file is part of PyBot, PyBot(c) RPiAwesomeness 2015-2016 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 option) any lat...
agpl-3.0
-9,149,998,240,598,296,000
33.628931
114
0.543226
false
4.016047
true
false
false
openwns/wrowser
openwns/wrowser/probeselector/dataacquisition/Compose.py
1
3482
############################################################################### # This file is part of openWNS (open Wireless Network Simulator) # _____________________________________________________________________________ # # Copyright (C) 2004-2007 # Chair of Communication Networks (ComNets) # Kopernikusstr. 16, D-...
gpl-2.0
2,599,883,141,875,917,000
34.530612
87
0.587881
false
4.106132
false
false
false
ayosec/pyslide
Pyslide/Presentation/base.py
1
9716
# -*- coding: latin1 -*- # # Copyright (C) 2003, 2004 Ayose Cazorla León # # Authors # Ayose Cazorla <ayose.cazorla@hispalinux.es> # # This file is part of Pyslide. # # Pyslide 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...
gpl-2.0
-3,954,084,593,502,776,300
31.824324
88
0.542404
false
4.118694
false
false
false
USGSDenverPychron/pychron
pychron/pipeline/plot/panels/icfactor_panel.py
1
1426
# =============================================================================== # Copyright 2015 Jake Ross # # 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...
apache-2.0
-1,574,811,721,124,899,300
45
81
0.605891
false
4.883562
false
false
false
google/cog
cognitive/constants.py
1
3427
# Copyright 2018 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/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
-439,335,461,570,460,400
29.873874
80
0.606069
false
3.022046
false
false
false
qateam123/eq
app/schema/answer.py
1
3436
import logging import bleach from app.questionnaire_state.exceptions import StateException from app.questionnaire_state.state_answer import StateAnswer from app.schema.exceptions import TypeCheckingException from app.schema.item import Item logger = logging.getLogger(__name__) class Answer(Item): def __init__(...
mit
-6,363,564,798,983,430,000
33.707071
142
0.612049
false
4.18514
false
false
false
zfergus2/Seam-Minimization
tools/compute_bilerp_vals_main.py
2
10312
#!/usr/bin/env python -u """ Written by Zachary Ferguson """ from __future__ import print_function, division import os import sys import argparse import time from recordclass import recordclass import pdb import numpy import includes import obj_reader import weight_data import texture import seam_erasure from uti...
mit
-5,616,922,335,525,431,000
35.960573
79
0.619085
false
3.651558
false
false
false
hradec/gaffer
python/GafferUI/GadgetWidget.py
4
10980
########################################################################## # # Copyright (c) 2011-2012, 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
7,438,458,354,474,921,000
31.776119
131
0.70337
false
3.608281
false
false
false
fboender/jerrybuild
jerrybuild/main.py
1
7025
#!/usr/bin/env python """ Jerrybuild main """ import argparse import logging import signal import socket from . import bottle from .bottle import request from . import __METADATA__ from . import wsgi_server from . import tools from . import vacuum from . import build_queue as bq from . import routes # noqa: F401 fro...
gpl-3.0
4,903,745,998,538,577,000
34.841837
116
0.579644
false
3.924581
true
false
false