repo_name
stringlengths
6
61
path
stringlengths
4
230
copies
stringlengths
1
3
size
stringlengths
4
6
text
stringlengths
1.01k
850k
license
stringclasses
15 values
hash
int64
-9,220,477,234,079,998,000
9,219,060,020B
line_mean
float64
11.6
96.6
line_max
int64
32
939
alpha_frac
float64
0.26
0.9
autogenerated
bool
1 class
ratio
float64
1.62
6.1
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
YJoe/SpaceShips
Desktop/Python/space_scroll/Start_up.py
1
1590
import pygame import random import math from Settings import Settings pygame.init() clock = pygame.time.Clock() def deg_to_rad(degrees): return degrees / 180.0 * math.pi # variables to control game states home_state = 1 info_state = 2 game_state = 3 pause_state = 4 shop_state = 5 settings_state = 6 quit_state = ...
gpl-3.0
-1,097,112,209,323,025,900
29
83
0.723899
false
3.154762
false
false
false
polarise/RP-python
compute_rho.py
1
1038
#!/home/paulk/software/bin/python from __future__ import division from sys import argv,exit,stderr import rpy2.robjects as R from rpy2.robjects.packages import importr qvalue = importr('qvalue') cor = R.r['cor'] qunif = R.r['qunif'] runif = R.r['runif'] sort = R.r['sort'] try: prefix = argv[1] except IndexError: p...
gpl-2.0
1,321,716,852,320,594,700
25.615385
74
0.663776
false
2.575682
false
false
false
gklyne/annalist
src/annalist_root/annalist/models/objectcache.py
1
10794
from __future__ import unicode_literals from __future__ import absolute_import, division, print_function """ This module provides an object cacheing framework for arbitrary Python values. The intent is thatall cacghe logic can be isolated, and may be re-implemented using a network cache faclity such as MemCache or Red...
mit
7,360,627,060,750,772,000
34.159609
95
0.588475
false
4.432854
false
false
false
BorisNikulin/kevin-bacon-py
AdjacencyList.py
1
2440
from queue import Queue class ALGraph: def __init__(self): self.__graph = {} def add_vertex_edge(self, v1, e, v2): if v1 not in self.__graph: self.__graph[v1] = [] else: self.__graph[v1].append((v2, e)) def add_vertex_edge_undirected(self, v1,...
mit
1,085,735,054,346,800,500
28.756098
86
0.505328
false
3.818466
false
false
false
Rzaaeeff/FacebookLikeGrabber
FacebookLikeGrabber.py
1
1711
__author__ = 'rzaaeeff' #Dependencies start from requests import get import json #Finish class FacebookLikeGrabber: def __init__(self, access_token): self.access_token_str = '?access_token=%s' % access_token def get_likes_by_post_id(self, post_id): """ Facebook uses p...
gpl-2.0
-3,517,868,380,791,561,000
30.283019
210
0.540035
false
3.97907
false
false
false
peeringdb/peeringdb-py
peeringdb/_tasks_sequential.py
1
1651
""" Wrapper module for sequential task (continuation) handling. Use as fallback for _tasks_async when async/await is not available. """ from types import GeneratorType class UpdateTask: "Wrap a generator in a task-like interface" def __init__(self, gen, desc): """ Arguments: - gen...
apache-2.0
6,169,636,268,537,176,000
20.166667
71
0.579043
false
3.978313
false
false
false
tadamic/sokoenginepy
src/sokoenginepy/manager/sokoban_plus.py
1
10316
from .. import utilities from .piece import DEFAULT_PIECE_ID class SokobanPlusDataError(ValueError): pass class SokobanPlus: """ Manages Sokoban+ data for game board. **Sokoban+ rules** In this variant of game rules, each box and each goal on board get number tag (color). Game objective ch...
gpl-3.0
4,151,498,084,753,524,700
31.338558
88
0.559035
false
3.884036
false
false
false
JesGor/test_rest
apprest/views.py
1
1691
from django.http import HttpResponse from django.views.decorators.csrf import csrf_exempt from rest_framework.renderers import JSONRenderer from rest_framework.parsers import JSONParser from rest_framework import status from .models import Empresa, Calificacion from .serializers import EmpresaSerializer, CalificacionSe...
gpl-2.0
972,403,972,535,338,800
28.666667
66
0.760497
false
3.264479
false
false
false
morevnaproject/RenderChan
renderchan/httpserver.py
2
4162
__author__ = 'Ivan Mahonin' from gettext import gettext as _ from argparse import ArgumentParser from http.server import BaseHTTPRequestHandler, HTTPServer from urllib.parse import parse_qs from urllib.parse import unquote from urllib.parse import urlparse import os.path import json from renderchan.core import Render...
bsd-3-clause
-1,991,866,624,910,789,600
37.537037
146
0.596588
false
4.048638
false
false
false
daevaorn/sentry
tests/sentry/api/endpoints/test_group_details.py
2
5852
from __future__ import absolute_import, print_function from datetime import timedelta from django.utils import timezone from sentry.models import ( Activity, Group, GroupAssignee, GroupBookmark, GroupSeen, GroupSnooze, GroupStatus, GroupTagValue, Release ) from sentry.testutils import APITestCase class Grou...
bsd-3-clause
-3,845,956,371,487,922,700
27.407767
81
0.595523
false
3.817352
true
false
false
dc3-plaso/plaso
tests/parsers/utmpx.py
1
2564
#!/usr/bin/python # -*- coding: utf-8 -*- """Tests for UTMPX file parser.""" import unittest from plaso.formatters import utmpx # pylint: disable=unused-import from plaso.lib import timelib from plaso.parsers import utmpx from tests import test_lib as shared_test_lib from tests.parsers import test_lib class Utmpx...
apache-2.0
8,200,209,274,617,385,000
30.268293
67
0.691108
false
3.460189
true
false
false
UpSea/midProjects
BasicOperations/02_Datetime/Datatime To str.py
1
1246
import time as time import datetime as dt dateEnd = dt.datetime.now() strEnd = dateEnd.strftime('%Y-%m-%d %H:%M:%S') print('now:'+strEnd) '''mid 以下程序将一个确定期间字符串日期等分为若干段,之后分段输出字符串 ''' timeFrom = '2016-05-20 00:00:00' timeTo = '2016-05-30 00:00:00' phases = 3 print timeFrom,timeTo #mid 1)str to pyTimeStamp timeStampFr...
mit
8,901,578,867,318,427,000
30.131579
80
0.684433
false
2.723502
false
false
false
saimn/astropy
astropy/coordinates/calculation.py
3
7008
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst # Standard library import re import textwrap import warnings from datetime import datetime from urllib.request import urlopen, Request # Third-party from astropy import time as atime from astropy.utils.console import color_print,...
bsd-3-clause
1,458,674,728,459,648,800
36.475936
100
0.572203
false
3.159603
false
false
false
jcmcclurg/serverpower
profiling/generateRampRateTestPlots.py
1
1388
verbose = True saveFig = True showFig = True if verbose: print "Loading general modules..." import numpy as np import sys if verbose: print "Loading matplotlib module..." import matplotlib.pyplot as plt if verbose: print "Loading custom functions..." from defaultGetPower import readPowerFile if verbose: print "...
gpl-2.0
1,362,174,705,579,429,400
22.931034
78
0.70389
false
2.732283
false
false
false
jupyter/nbgrader
nbgrader/tests/apps/test_api.py
3
36897
import pytest import sys import os import shutil import filecmp from os.path import join from traitlets.config import Config from datetime import datetime from ...apps.api import NbGraderAPI from ...coursedir import CourseDirectory from ...utils import rmtree, get_username, parse_utc from .. import run_nbgrader from ...
bsd-3-clause
2,897,264,296,471,364,600
44.106357
124
0.567499
false
3.430046
true
false
false
crs4/omero.biobank
examples/create_markers_sets.py
1
4865
# BEGIN_COPYRIGHT # END_COPYRIGHT # pylint: disable=W0105, C0103 """ .. This example shows how to handle genetic marker data. **NOTE:** the example assumes that the KB already contains all objects created by the example on importing individuals. Suppose you have run a series of genotyping assays where the DNA samp...
gpl-2.0
-8,684,772,627,203,433,000
34.772059
73
0.710791
false
3.181818
false
false
false
abitofalchemy/ScientificImpactPrediction
json_dataset_tograph.py
1
2398
__author__ = 'saguinag'+'@'+'nd.edu' __version__ = "0.1.0" ## ## json_dataset_tograph = convert twitter (json format) dataset to a graph object ## arguments: input file (json) ## ## VersionLog: # 0.0.1 Initial commit # import argparse,traceback,optparse import urllib, json import sys def json_load_byteified(fi...
mit
3,842,952,083,991,179,300
26.883721
82
0.650542
false
3.358543
false
false
false
sawankh/MMOTracker
src/dataAnalysis/dsl/grammar/behaviour/readFile.py
2
1546
#!/usr/bin/python # Title: readFile.py # Description: Contains the grammar and methods for reading a file # Author: Sawan J. Kapai Harpalani # Date: 2016-06-26 # Version: 0.1 # Usage: python readFile.py # Notes: # python_version: 2.6.6 # License: Copyright 200X Sawan J. Kapai Harpalani # This file is part of MMOTrack...
gpl-3.0
-6,108,897,773,729,414,000
44.5
120
0.717335
false
3.743341
false
false
false
WaldurChatbot/Waldur-Chatbot
common/offline_graphs/totalcosts_offline.py
1
16907
import json import collections import matplotlib matplotlib.use('Agg') # requirement of matplotlib import matplotlib.pyplot as plt import numpy as np from textwrap import wrap myinput = """[ { "url":"https://api.etais.ee/api/invoices/9e67980771a94de3bd0075fe84522b05/", "uuid":"9e67980771a94de3bd0075f...
mit
2,200,156,060,488,851,500
30.251386
116
0.528538
false
3.155468
false
false
false
lltk/lltk
lltk/caching.py
1
5363
#!/usr/bin/python # -*- coding: UTF-8 -*- __all__ = ['register', 'enable', 'disable', 'get', 'put', 'exists', 'cached', 'Cache'] from functools import wraps import lltk.config as config from lltk.helpers import debug, warning from lltk.exceptions import CacheFatalError caches = {} def register(cache): ''' Regist...
lgpl-3.0
-7,534,432,656,292,242,000
24.660287
110
0.658214
false
3.358172
false
false
false
mineo/mpd_pydb
setup.py
1
1278
#!/usr/bin/env python2 from __future__ import print_function from setuptools import setup from sys import version_info if version_info < (3, 5): requirements = ["pathlib"] else: requirements = [] setup(name="mpd_pydb", author="Wieland Hoffmann", author_email="themineo@gmail.com", packages=["...
mit
2,467,657,736,107,854,300
35.514286
70
0.579812
false
3.920245
false
false
false
fw4spl-org/fw4spl-git
hooks/check_commit.py
1
3013
#!/usr/bin/env python2 # -*- coding: UTF-8 -*- import re import common class Types(object): def __iter__(self): return (x for x in ['feat', 'fix', 'perf', 'revert', 'docs', 'chore', 'style', 'refactor', 'test', 'merge']) TYPES = Types() TITLE_PATTERN_REGEX = r'(?P<type>' + '|'.join(TYPES) + ')\((?P<s...
lgpl-3.0
-865,163,373,709,589,600
28.539216
116
0.609691
false
3.61271
false
false
false
mitnk/notes
index.py
1
1208
#!/usr/bin/env python import os import yaml NO_INDEX = set(['PL', 'Others', 'Topics', 'Roadmap']) def load_mkdocs(): filename = 'mkdocs.yml' with open(filename) as f: return yaml.load(f.read()) def make_index(docs): groups = docs['pages'] for group in groups: topic = group.keys()[0...
mit
4,829,976,709,307,048,000
24.702128
74
0.519868
false
3.238606
false
false
false
gridsim/gridsim
test/test_DLF2.py
1
3003
# This is a test program for the DirectLoadFlowCalculator present in the # gridsim.electricalnetwork module. It computes the example given in # http://home.eng.iastate.edu/~jdm/ee553/DCPowerFlowEquations.pdf pp. 10-15 and # compare results with those of the reference. import unittest import numpy as np from gridsim.e...
gpl-3.0
-2,668,466,233,681,159,700
33.918605
79
0.525808
false
3.307269
true
false
false
knoppo/pi3bar
pi3bar/plugins/clock.py
1
1269
from pi3bar.plugins.base import Plugin import datetime class Clock(Plugin): """ :class:`pi3bar.app.Pi3Bar` plugin to show the current date and time. :param full_format: :class:`str` - :meth:`datetime.datetime.strftime` argument :param short_format: :class:`str` - :meth:`datetime.datetime.strftime` ar...
mit
7,539,013,647,937,396,000
30.725
107
0.611505
false
3.515235
false
false
false
floatec/ProsDataBase
ProsDataBase/database/tests/grouptest.py
1
3530
from django.test import TestCase from ..models import * from ..tests.factory import * from django.test.client import Client from ..views.api import * # funzt bisher alles class GroupTest(TestCase): def test_serializeAll(self): # ================================================================= # t...
bsd-2-clause
-1,643,750,423,225,071,600
41.53012
85
0.436261
false
5.711974
true
false
false
koobonil/Boss2D
Boss2D/addon/_old/webrtc-qt5.11.2_for_boss/modules/audio_processing/test/py_quality_assessment/quality_assessment/echo_path_simulation_unittest.py
9
3035
# Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. # # Use of this source code is governed by a BSD-style license # that can be found in the LICENSE file in the root of the source # tree. An additional intellectual property rights grant can be found # in the file PATENTS. All contributing project au...
mit
-6,845,322,949,738,666,000
36.469136
80
0.719275
false
4.084791
true
false
false
jmtoivan/apparatus
src/bmgraph/file.py
2
9308
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import with_statement import sys import traceback import StringIO import logging logging.basicConfig(level=logging.WARNING) logger = logging.getLogger("bmgraph.file") class NotImplementedError(Exception): pass class mdict(dict): """This class implem...
gpl-2.0
3,065,605,060,408,539,600
30.130435
103
0.502578
false
3.909282
false
false
false
rimpybharot/CMPE273
mid-term/encoder_pb2_grpc.py
1
2101
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! import grpc import encoder_pb2 as encoder__pb2 class EncoderStub(object): # missing associated documentation comment in .proto file pass def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ ...
mit
-8,531,388,553,193,744,000
32.349206
76
0.71109
false
4.314168
false
false
false
GaelMagnan/PyGitHook
src/Hooks/Hook.py
1
8074
""" Git Hook. The Simple python way to code Hooks Hook is the base class for every Hook. AUTHOR: Gael Magnan de bornier """ import sys import os import re from tempfile import NamedTemporaryFile from contextlib import contextmanager from src.Utils import Bash from src.Tasks import HookTask class Hook(object): ...
gpl-2.0
-6,777,289,918,627,628,000
34.725664
107
0.502353
false
4.691458
false
false
false
dmpiergiacomo/scion
python/path_server/base.py
1
20649
# Copyright 2014 ETH Zurich # # 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, sof...
apache-2.0
-3,079,775,288,533,546,000
38.256654
99
0.573926
false
3.778408
false
false
false
olamotte/sbblocator
utils.py
1
3069
import time from functools import wraps def retry(ExceptionToCheck, tries=4, delay=3, backoff=2, logger=None): """Retry calling the decorated function using an exponential backoff.""" """Copyright (c) 2013, SaltyCrane All rights reserved. Redistribution and use in source and binary forms, with or without modifica...
unlicense
6,351,903,952,804,055,000
39.92
77
0.688498
false
4.628959
false
false
false
verifiedpixel/superdesk
server/apps/planning.py
10
1989
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license from superde...
agpl-3.0
2,288,588,184,138,790,400
25.878378
77
0.589744
false
3.954274
false
false
false
yuraic/koza4ok
examples/draw.py
2
4678
# Author: Yuriy Ilchenko (ilchenko@physics.utexas.edu) # Compare two ROC curves from scikit-learn and from TMVA (using skTMVA converter) import os import sys if os.environ['TERM'] == 'xterm': os.environ['TERM'] = 'vt100' # Now it's OK to import readline :) # Import ROOT libraries import ROOT import array from ...
mit
-3,488,663,077,255,613,400
23.621053
81
0.678068
false
2.523193
true
false
false
yidawang/brainiak
examples/utils/fmrisim_example.py
2
7403
# Copyright 2016 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
apache-2.0
7,489,342,609,411,777,000
37.759162
79
0.574767
false
4.138066
false
false
false
Klaudit/livestreamer
src/livestreamer/plugins/rtve.py
32
1661
import re from livestreamer.plugin import Plugin, PluginError from livestreamer.plugin.api import http from livestreamer.stream import HLSStream # The last four channel_paths repsond with 301 and provide # a redirect location that corresponds to a channel_path above. _url_re = re.compile(r""" https?://www\.rtve\....
bsd-2-clause
-4,746,790,248,737,518,000
27.637931
92
0.629741
false
2.971377
false
false
false
terbolous/SickRage
lib/guessit/rules/properties/episodes.py
18
21850
#!/usr/bin/env python # -*- coding: utf-8 -*- """ episode, season, episode_count, season_count and episode_details properties """ import copy from collections import defaultdict from rebulk import Rebulk, RemoveMatch, Rule, AppendMatch, RenameMatch from rebulk.match import Match from rebulk.remodule import re from reb...
gpl-3.0
-3,951,014,639,551,786,000
41.344961
119
0.573272
false
4.062093
false
false
false
sdykes3/myrtleApp
server/server.py
1
6757
#!/usr/bin/env python import web import json urls = ( '/checkIngredients', 'checkIngredients', '/markOut/(.*)', 'markOut', '/markIn/(.*)', 'markIn' ) jsonString = '''[ { "type": "liquor", "id" : "brandy", "name": "Brandy", "inStock": true }, { "type": "liquor", "id" : "bour...
mit
-7,296,965,727,733,815,000
14.569124
66
0.462335
false
2.726796
false
false
false
msurkovsky/kaira
gui/settings.py
6
2850
import gtk class SettingsWidget(gtk.Notebook): def __init__(self, app): gtk.Notebook.__init__(self) self.app = app self.set_tab_pos(gtk.POS_LEFT) self.append_page(self._generic_settings(), gtk.Label("Generic")) self.append_page(self._completion_settings(), gtk.Label("Compl...
gpl-3.0
-8,428,830,736,328,680,000
42.861538
100
0.584912
false
3.914835
false
false
false
sghai/robottelo
robottelo/cli/auth.py
3
1157
# -*- encoding: utf-8 -*- """ Usage:: hammer auth [OPTIONS] SUBCOMMAND [ARG] ... Parameters:: SUBCOMMAND subcommand [ARG] ... subcommand arguments Subcommands:: login Set credentials logout Wipe your credentials ...
gpl-3.0
-7,402,639,921,279,210,000
25.906977
71
0.560933
false
4.537255
false
false
false
nmc-probe/emulab-nome
protogeni/test/version1/tuntest.py
1
11262
#! /usr/bin/env python # # Copyright (c) 2008-2010 University of Utah and the Flux Group. # # {{{GENIPUBLIC-LICENSE # # GENI Public License # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and/or hardware specification (the "Work") to # deal in the Work without rest...
agpl-3.0
-5,964,417,454,744,307,000
28.872679
79
0.621826
false
3.465231
false
false
false
AntonioQu/pythontest
get_city.py
1
1595
# pip install XlsxWriter # pip install requests beautifulsoup4 import requests import bs4 import xlsxwriter import sys def progress_bar(percent, bar_length=30): hashes = '#' * int(round(percent * bar_length)) spaces = '-' * (bar_length - len(hashes)) sys.stdout.write("\rPercent: [...
apache-2.0
635,753,228,543,512,700
25.982456
100
0.660188
false
2.889493
false
false
false
poschi3/AdventOfCode2015
day14/day14.py
1
1337
totalflight = 2503 kmmax = 0 winner = None reindeers = list() class Reindeer: def __init__(self, name, speed, duration, pause): self.name = name self.speed = speed self.duration = duration self.pause = pause self.points = 0 def distanceAt(self, flight): iterat...
mit
-6,517,702,240,340,848,000
19.890625
61
0.567689
false
3.293103
false
false
false
perfectsearch/sandman
code/buildscripts/textui/getch.py
1
2670
#!/usr/bin/env python # # $Id: sadm_getch.py 9424 2011-06-13 18:42:04Z ahartvigsen $ # # Proprietary and confidential. # Copyright $Date:: 2011#$ Perfect Search Corporation. # All rights reserved. # def getch(): """Gets a single character from stdin. Does not echo to the screen.""" return _impl() class _ge...
mit
7,634,219,220,338,520,000
29.689655
100
0.586517
false
3.734266
false
false
false
fireflame241/Jelly-Explainer
named_parsing.py
1
6859
from jelly import * # NOTE: This still has indentation issues from wikis import quicks_wiki, atoms_wiki, quicks_tail #quicks_tail to be used to format quicks like so: # Ternary if # <condition> # ... # <if-clause> # ... # <else-clause> # ... for k in quicks: quicks[k].token = k for k in hypers: ...
mit
-8,745,419,046,236,431,000
25.488372
143
0.641498
false
2.702254
false
false
false
RedHenLab/ControversyDetection
src/controversy_scoring.py
1
2071
#!/usr/bin/env python3 import sqlite3 import pandas as pd from scipy.stats import chi2_contingency cnx_lda = sqlite3.connect("1_31_LDA.db") cnx_sentiment = sqlite3.connect("2016-01_sentiments_annotated.db") # get topic distribution over stories _ = pd.read_sql("SELECT * FROM [1_31_LDA]", cnx_lda) topics = [str(i) f...
gpl-2.0
-3,052,488,400,251,001,000
30.861538
92
0.657653
false
2.954351
false
false
false
Silianbo/salary-prediction-with-machine-learning
DataCrawer.py
3
1399
#encoding: utf-8 """ Nothing to say """ from __future__ import print_function import re import requests from BeautifulSoup import BeautifulSoup as soup from sqlalchemy.orm import sessionmaker import sys from Tasks import getContent import DataModel from DataModel import Salary import datetime import time LAGOU_JOB_UR...
gpl-2.0
-3,625,143,950,399,576,000
29.413043
105
0.616869
false
3.179545
false
false
false
nikhilgarg459/bcs
bcs_server/account.py
2
1958
#!usr/bin/env python # -*-coding:utf8-*- from datetime import datetime from server_logger import log __doc__ = """ * Account class """ class Account: def __init__(self, name, email, password, account_type): self.name = name self.email = email self.password = password s...
mit
8,810,352,944,762,448,000
29.59375
82
0.551583
false
3.787234
false
false
false
captiosus/treadmill
tests/appcfg/abort_test.py
1
3800
"""Unit test for treadmill.appcfg.abort """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import io import json import os import shutil import tempfile import unittest import kazoo import mock import treadmill fro...
apache-2.0
4,938,947,858,906,630,000
33.234234
75
0.614211
false
3.525046
true
false
false
slashdd/sos
sos/report/plugins/ds.py
1
3536
# Copyright (C) 2007 Red Hat, Inc., Kent Lamb <klamb@redhat.com> # Copyright (C) 2014 Red Hat, Inc., Bryn M. Reeves <bmr@redhat.com> # Copyright (C) 2021 Red Hat, Inc., Mark Reynolds <mreynolds@redhat.com> # # This file is part of the sos project: https://github.com/sosreport/sos # # This copyrighted material is made a...
gpl-2.0
3,939,228,121,040,642,600
36.221053
79
0.568156
false
2.966443
false
false
false
avastjohn/maventy_new
search/templatetags/searchtags.py
1
6107
# -*- coding: utf-8 -*- from django.conf import settings from django.template import TemplateSyntaxError, TemplateDoesNotExist from django.template.loader import get_template from django.utils.safestring import mark_safe from itertools import ifilter from ragendja.template import Library import re whitespace = re.comp...
bsd-3-clause
-2,424,585,837,204,797,000
33.308989
106
0.604716
false
3.674489
false
false
false
karlnapf/kameleon-mcmc
kameleon_mcmc/tools/MatrixTools.py
1
1967
""" 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. Written (W) 2013 Heiko Strathmann Written (W) 2013 Dino Sejdinovic """ fro...
bsd-2-clause
-7,081,884,426,567,236,000
28.358209
83
0.567361
false
3.531418
false
false
false
jmbeuken/abinit
scripts/post_processing/ElectronPhononCoupling/ElectronPhononCoupling/data/LiF_g2/__init__.py
2
1772
import os from os.path import join as pjoin dirname = os.path.dirname(__file__) nqpt = 3 wtq = [0.125, 0.5, 0.375] DDB_fnames = [ pjoin(dirname, fname) for fname in """ odat_calc_DS5_DDB.nc odat_calc_DS9_DDB.nc odat_calc_DS13_DDB.nc """...
gpl-3.0
5,406,779,415,015,076,000
29.033898
56
0.485327
false
2.928926
false
false
false
cpina/science-cruise-data-management
ScienceCruiseDataManagement/main/management/commands/updateeventlocations.py
1
4254
from django.core.management.base import BaseCommand, CommandError from main.models import EventAction, PositionUncertainty, PositionSource from django.conf import settings from main import utils # This file is part of https://github.com/cpina/science-cruise-data-management # # This project was programmed in a hurry w...
mit
-4,826,362,323,577,263,000
46.277778
169
0.647626
false
4.009425
false
false
false
signalfx/signalfx-python
signalfx/signalflow/errors.py
1
1840
# Copyright (C) 2016 SignalFx, Inc. All rights reserved. class SignalFlowException(Exception): """A generic error encountered when interacting with the SignalFx SignalFlow API.""" def __init__(self, code, message=None, error_type=None): self._code = code self._message = message se...
apache-2.0
436,478,070,167,203,840
25.666667
78
0.603261
false
4.220183
false
false
false
ebottabi/mmakinde-ebot
flask_react/server/app.py
1
1514
import os from flask import request, jsonify, abort from flask_app import create_app, db from flask_app.models import User, Role, Document config_name = os.getenv('FLASK_CONFIG') app = create_app(config_name) @app.route('/') def index(): return jsonify({ "message": "Welcome to Document Manager"}) @app.route('/us...
apache-2.0
-2,344,024,401,241,587,700
23.031746
70
0.67041
false
3.496536
false
false
false
kaazoo/DrQueueIPython
etc/mentalray_sg.py
2
3737
# -*- coding: utf-8 -*- """ DrQueue render template for Mental Ray Copyright (C) 2011 Andreas Schroeder This file is part of DrQueue. Licensed under GNU General Public License version 3. See LICENSE for details. """ import os import DrQueue from DrQueue import engine_helpers def run_renderer(env_dict): # def...
gpl-3.0
5,246,072,343,090,412,000
32.070796
169
0.619213
false
3.4506
false
false
false
tjtrebat/algorithms
algorithms/sorting/quicksort/quicksort.py
1
2252
""" quicksort.py -- sorts an array of integers using the Quicksort sorting algorithm. When executed, uses a randomized version of quicksort to obtain a good average-case performance over all inputs. """ __author__ = 'Tom' import random def sort(data, p, r): """ Sorts the data from p to r Attributes:...
gpl-2.0
5,903,304,838,772,438,000
29.445946
114
0.596803
false
3.491473
false
false
false
1flow/1flow
oneflow/core/admin/language.py
2
2912
# -*- coding: utf-8 -*- u""" Copyright 2013-2014 Olivier Cortès <oc@1flow.io>. This file is part of the 1flow project. 1flow 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...
agpl-3.0
-5,439,481,210,857,402,000
32.848837
79
0.620749
false
3.83531
false
false
false
mrts/foodbank-campaign
src/foodbank/settings.py
1
4616
""" Django settings for foodbank project. Generated by 'django-admin startproject' using Django 2.0. For more information on this file, see https://docs.djangoproject.com/en/2.0/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.0/ref/settings/ """ import os imp...
mit
7,900,825,950,640,479,000
25.528736
102
0.686092
false
3.364431
false
false
false
chiara-paci/dinosaurus
dinosaurus_lib/config.py
1
4742
# -*- coding: utf-8 -*- import datetime PAGINATION=250 PRIMARY_MASTER="rvvmdns03pl.server.intra.rve." EMAIL_ADMIN="nsmaster.regione.veneto.it." BASE_DIR="/home/chiara/dinosaurus" VERSION_FILE="/home/chiara/dinosaurus/VERSION" fd=open(VERSION_FILE,'r') VERSION="".join(fd.readlines()).strip() fd.close() THEMES_DIR=...
gpl-3.0
4,065,850,318,391,263,000
30.825503
113
0.589836
false
2.76986
false
false
false
tuxite/pharmaship
pharmaship/inventory/export.py
1
16202
# -*- coding: utf-8; -*- """Export methods for Inventory application.""" import tarfile import time import io import hashlib from pathlib import PurePath from yaml import dump try: from yaml import CDumper as Dumper except ImportError: from yaml import Dumper from django.core import serializers from django....
agpl-3.0
3,850,545,553,416,638,500
33.2537
123
0.650846
false
3.685623
false
false
false
RedHatInsights/insights-core
insights/parsers/iptables.py
1
8316
""" IPTables configuration ====================== Module for processing output of the ``iptables-save`` and ``ip6tables-save`` commands. Parsers included are: IPTables - command ``iptables-save`` ------------------------------------ IP6Tables - command ``ip6tables-save`` -------------------------------------- IPTa...
apache-2.0
-8,611,245,743,958,177,000
35.156522
243
0.567701
false
3.986577
true
false
false
GENI-NSF/gram
juno/install/Keystone.py
1
5642
#---------------------------------------------------------------------- # Copyright (c) 2013 Raytheon BBN Technologies # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and/or hardware specification (the "Work") to # deal in the Work without restriction, including witho...
mit
3,796,973,718,651,089,400
52.733333
149
0.655441
false
3.801887
true
false
false
wasit7/visionmarker
alpha/visionmarker/app/migrations/0001_initial.py
1
3783
# -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2016-10-21 19:42 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migratio...
mit
2,221,291,614,650,264,800
44.035714
163
0.567803
false
4.303754
false
false
false
edoburu/django-any-urlfield
setup.py
1
2594
#!/usr/bin/env python from setuptools import setup, find_packages from os import path import codecs import os import re import sys # When creating the sdist, make sure the django.mo file also exists: if 'sdist' in sys.argv or 'develop' in sys.argv: os.chdir('any_urlfield') try: from django.core import ...
apache-2.0
2,856,539,361,783,235,000
30.634146
95
0.615266
false
3.912519
false
false
false
Nrikolo/X8_AutoPilot
fsm/scripts/fsm_states.py
1
15703
#!/usr/bin/env python #General Imports import roslib; #roslib.load_manifest('smach_tutorials') roslib.load_manifest('fsm') import rospy import time import random import math import numpy import smach import smach_ros #For dealing with msgs from std_msgs.msg import Float32 from geometry_msgs.msg import PoseStamped, Pos...
gpl-2.0
3,482,930,527,921,378,300
51.518395
162
0.568554
false
4.386313
false
false
false
Evnsan/MAC0448
ep3/porta.py
1
1653
#!/usr/bin/python from datagrama import Datagrama class Porta(object): def __init__(self): #definicao dos campos de um segmento self.enlace = None self.ip = None self.tamanhoBuffer = None self.buffer = [] self.modoVerboso = False super(Porta, self).__init__...
gpl-2.0
4,058,502,042,517,190,000
21.337838
51
0.562613
false
3.539615
false
false
false
junishikawa911/CAR-E
pytodb.py
1
1153
from pymongo import MongoClient #Step 1: Connect to MongoDB - Note: Change connection string as needed client = MongoClient("mongodb://jun_ishikawa:EUgx3hId7TuJnZeZ@car-e-mainframe-shard-00-00-tppcz.mongodb.net:27017,car-e-mainframe-shard-00-01-tppcz.mongodb.net:27017,car-e-mainframe-shard-00-02-tppcz.mongodb.net:27017...
mit
3,231,768,840,390,031,000
59.736842
291
0.725932
false
2.875312
false
false
false
enguy/FAST-iCLIP
bin/oldscripts/fastclip.py
2
65904
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <codecell> import os import cmath import math import sys import numpy as np import glob import subprocess import re from matplotlib_venn import venn2 import pandas as pd from collections import defaultdict from operator import itemgetter import matplotlib as mpl i...
gpl-2.0
3,409,307,261,350,917,000
42.13089
329
0.702674
false
3.036631
false
false
false
yrakcaz/music-style-classifier
src/ai.py
1
1667
from songmodel import SongModel from extractor import Extractor from sklearn import svm, multiclass, neighbors import subprocess, math class AI: def __init__(self, song): self.song = song self.model = SongModel() self.extractor = Extractor() self.tempo = 0 self.rolloffmoy = ...
gpl-2.0
2,355,641,711,767,800,000
35.23913
101
0.610078
false
3.218147
false
false
false
MostlyOpen/odoo_addons_jcafb
myo_survey_cst/wizard/survey_file_arquive_wizard.py
1
2349
# -*- coding: utf-8 -*- ############################################################################### # # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol # # 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 #...
agpl-3.0
1,237,427,965,669,874,700
32.084507
81
0.61771
false
3.934673
false
false
false
YuHongJun/python-training
work_two_Crawler/catch_mzui.py
1
3114
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # http://cuiqingcai.com/3179.html __author__ = 'Demi Yu' from bs4 import BeautifulSoup import os from Download import request class mzitu(): def all_url(self, url): html = request.get(url,3) ##调用request函数把套图地址传进去会返回给我们一个response all_a = BeautifulSoup...
mit
686,732,049,385,913,300
37.727273
136
0.58216
false
2.160609
false
false
false
ajyoon/brown
examples/feldman_projections_2/score.py
1
5909
from typing import Union from brown import constants from brown.core import brown from brown.core.font import Font from brown.core.music_font import MusicFont from brown.core.object_group import ObjectGroup from brown.core.path import Path from brown.core.pen import Pen from brown.core.pen_pattern import PenPattern fr...
gpl-3.0
-1,098,191,962,342,558,000
40.034722
79
0.575055
false
4.094941
false
false
false
rizar/actor-critic-public
bin/pack_to_hdf5.py
1
2224
#!/usr/bin/env python import h5py import numpy import argparse import cPickle from fuel.datasets.hdf5 import H5PYDataset def pack(f, name, dataset_pathes): datasets = [cPickle.load(open(path)) for path in dataset_pathes] data = sum(datasets, []) dtype = h5py.special_dtype(vlen=numpy.dtype('int32')) t...
mit
2,333,511,898,382,353,400
38.017544
80
0.540468
false
3.756757
false
false
false
grantSwalwell/Machine-Learning
Embedding/PreEmbed.py
1
1338
import os import numpy import word2toke def getCommonVecs(num=10000, d=100, path="C:/Users/Grant/PycharmProjects/Machine-Learning/Embedding/"): fname = os.path.join(path, "glove.6B." + str(d) + "d.txt") f = open(fname, 'r', encoding="utf-8") dic = {} for step, line, in zip(range(num), f): ent...
mit
6,394,171,580,117,049,000
26.326531
114
0.586697
false
2.902386
false
false
false
david618/Simulator
pythonScripts/reset_counts.py
1
2071
#!/usr/bin/python2 # requires install python-httplib2 # apt-get install python-httplib2 # Run using python2 # python2 get_counts.py # The sha-bang is set for ubuntu 16.04 # Windows # pip isntall httplib2 import httplib2 import sys import json source_hosts = [] sink_hosts = [] args = sys.argv numargs = len(args)...
apache-2.0
2,931,455,239,615,329,300
19.919192
95
0.557219
false
3.601739
false
false
false
stricklin/Gambot
MoveGenerator.py
1
5742
from Move import Move class MoveGenerator: def __init__(self, board): """ makes all legal moves for the side on move :param board: the board to make moves for """ self.board = board self.pieces = self.get_all_pieces() self.moves = [] self.get_moves(s...
gpl-3.0
6,963,039,227,782,971,000
38.875
106
0.587078
false
4.015385
false
false
false
osaddon/cimi
cimi/cimiapp/machineimage.py
1
6370
# Copyright (c) 2012 IBM # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
apache-2.0
-7,873,371,230,516,636,000
37.841463
78
0.513972
false
4.420541
false
false
false
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-2.2/Lib/tokenize.py
1
10661
"""Tokenization help for Python programs. generate_tokens(readline) is a generator that breaks a stream of text into Python tokens. It accepts a readline-like method which is called repeatedly to get the next line of input (or "" for EOF). It generates 5-tuples with these members: the token type (see token.py) ...
mit
-5,903,353,024,651,132,000
39.846743
80
0.477441
false
3.755195
false
false
false
mgiannikouris/vi-firmware
script/make_trips.py
3
3361
#!/usr/bin/env python import sys from xml.etree import ElementTree as ET import json import re import datetime class DestFileCreator: nextTrip = 1 def __init__(self, firstTrip): self.nextTrip = firstTrip def next_dest(self, data_file): newName = "Trip" + str(self.nextTrip).zfill(3) + "-"...
bsd-3-clause
3,610,042,837,803,529,000
29.554545
95
0.540315
false
4.232997
false
false
false
mesosphere/dcos-kafka-service
frameworks/kafka/tests/test_active_directory_zookeeper_auth.py
1
5966
""" This module tests the interaction of Kafka with Zookeeper with authentication enabled """ import logging import uuid import pytest import sdk_cmd import sdk_install import sdk_marathon import sdk_utils from tests import active_directory from tests import auth from tests import config from tests import test_utils ...
apache-2.0
-6,718,657,523,241,052,000
28.83
105
0.572746
false
3.642247
true
false
false
cc-archive/jtoolkit
jToolkit/widgets/grid.py
1
14502
#!/usr/bin/env python # -*- coding: utf-8 -*- """grid module: responsible for building up grid widgets""" # Copyright 2002, 2003 St James Software # # This file is part of jToolkit. # # jToolkit is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as publishe...
gpl-2.0
-4,524,484,315,021,323,300
36.275064
124
0.658944
false
3.77853
false
false
false
lsst-sqre/zenodio
setup.py
1
1113
from setuptools import setup, find_packages import os packagename = 'zenodio' description = 'I/O with Zenodo.' author = 'Jonathan Sick' author_email = 'jsick@lsst.org' license = 'MIT' url = 'https://github.com/lsst-sqre/zenodio' version = '0.1.1.dev0' def read(filename): full_filename = os.path.join( os...
mit
-2,961,864,877,985,767,400
24.883721
76
0.638814
false
3.456522
false
false
false
wkww/art-c
web/scalica/micro/views.py
2
4598
from django.contrib.auth import logout, login, authenticate from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.http import HttpResponse from django.shortcuts import render from django....
mit
-3,015,600,426,929,801,700
28.101266
89
0.665289
false
3.385862
false
false
false
ministryofjustice/money-to-prisoners-transaction-uploader
main.py
1
2665
import logging import logging.config import os import sys import sentry_sdk from mtp_transaction_uploader import settings from mtp_transaction_uploader.upload import main as transaction_uploader def setup_monitoring(): """ Setup logging and exception reporting """ logging_conf = { 'version':...
mit
938,083,083,143,458,300
27.052632
84
0.526829
false
4.190252
false
false
false
viswimmer1/PythonGenerator
data/python_files/33075525/generator.py
1
4072
import os import re import cache from fields import RequiresField, ModulesField, PackagesField from template import template, show_field import jinja2 import simplejson as json from wtforms import form, fields import logging from uuid import uuid4 as uuid log = logging.getLogger(__name__) safe_string = jinja2.Markup ...
gpl-2.0
4,055,651,554,083,751,400
30.083969
76
0.574902
false
4.219689
false
false
false
tsuru/rpaas
tests/test_nginx.py
1
8607
# Copyright 2016 rpaas authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. import unittest import mock from rpaas.nginx import Nginx, NginxError class NginxTestCase(unittest.TestCase): def setUp(self): self.cache_headers =...
bsd-3-clause
-1,738,867,843,030,581,200
40.379808
109
0.609272
false
3.796648
true
false
false
axbaretto/beam
sdks/python/apache_beam/runners/portability/local_job_service_main.py
5
5787
# # 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 "License"); you may not us...
apache-2.0
7,439,806,534,146,865,000
33.041176
80
0.672542
false
3.709615
false
false
false
openstack/vitrage
vitrage/graph/driver/graph.py
1
12340
# Copyright 2016 - Alcatel-Lucent # # 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 wri...
apache-2.0
-3,534,215,445,248,439,000
27.764569
79
0.582334
false
4.118825
false
false
false
wdv4758h/Yeppp
library/sources/core/kernels/binop/binop_IVV_IV.py
1
5017
from peachpy.x86_64 import * from peachpy import * import common.YepStatus as YepStatus from common.pipeline import software_pipelined_loop from common.instruction_selection import * def binop_IVV_IV(arg_x, arg_y, arg_n, op, isa_ext): # First we set some constants based on the input/output types # so that we c...
bsd-3-clause
3,629,260,896,634,825,700
42.25
136
0.665139
false
3.104579
true
false
false
WmHHooper/aima-python
submissions/Thompson/vacuum2.py
1
2607
import agents as ag #testsdjhfakdjfhds def HW2Agent() -> object: def program(percept): bump, status = percept if status == 'Dirty': action = 'Suck' else: lastBump, lastStatus, = program.oldPercepts[-1] lastAction = program.oldActions[-1] if p...
mit
2,600,238,648,749,636,600
31.5875
61
0.410433
false
4.918868
false
false
false
pykit/pykit-cpy
pykit_cpy/lower/lower_convert.py
1
1746
# -*- coding: utf-8 -*- """ Lower all conversions between native values <-> objects to calls to a runtime.conversion module set in the environment. """ from __future__ import print_function, division, absolute_import from pykit import types from pykit.ir import transform, GlobalValue, Module, Builder def build_conve...
bsd-3-clause
-5,180,342,390,082,493,000
35.395833
78
0.672394
false
3.837363
false
false
false
niktre/espressopp
contrib/mpi4py/mpi4py-2.0.0/conf/epydocify.py
11
3073
#!/usr/bin/env python # -------------------------------------------------------------------- from mpi4py import MPI try: from signal import signal, SIGPIPE, SIG_IGN signal(SIGPIPE, SIG_IGN) except ImportError: pass # -------------------------------------------------------------------- try: from doc...
gpl-3.0
4,019,386,524,033,540,600
26.936364
70
0.509925
false
3.71584
false
false
false
the-engine-room/crowdata
crowdataapp/urls.py
1
2375
from django.conf.urls import patterns, url from crowdataapp import views urlpatterns = patterns('crowdataapp.views', url(r'^$', 'document_set_index', name='document_set_index'), url(r'^pleaselogin$', ...
mit
2,779,071,065,911,481,000
49.531915
99
0.347789
false
4.979036
false
true
false
aurora-pro/apex-sigma
sigma/plugins/administration/evaluate.py
1
1210
from config import permitted_id import discord import inspect async def evaluate(cmd, message, args): if message.author.id in permitted_id: if not args: await message.channel.send(cmd.help()) else: try: execution = " ".join(args) output = ev...
gpl-3.0
6,171,629,511,094,829,000
39.066667
99
0.524126
false
4.262411
false
false
false
migueldvb/piernik
make_test.py
1
1835
#!/usr/bin/env python import sys import getopt import os import subprocess as sp import shutil as sh import xmlrpclib class MakeTest(object): def __init__(self,test): self.initpath = os.getcwd() self.runpath = os.path.join(self.initpath,'runs',test) self.test = test os.chdir(self.runp...
gpl-3.0
-3,363,016,374,321,181,000
23.797297
111
0.590191
false
3.230634
true
false
false
pystruct/pystruct
doc/conf.py
2
10691
# -*- coding: utf-8 -*- # # pystruct documentation build configuration file, created by # sphinx-quickstart on Fri May 3 17:14:50 2013. # # 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. # # ...
bsd-2-clause
-1,833,842,543,130,741,800
31.39697
88
0.682069
false
3.713442
true
false
false
10c8/pixelbot
PluginAPI.py
1
5326
#: vim set encoding=utf-8 : ## # PixelBot Plugin API # Tools for creating plugins for the bot # # version 0.2 # author William F. # copyright MIT ## # Imports import asyncio import logging # Main class class Plugin(object): def __init__(self, bot, name, description, version, author, data): self.bot...
mit
-335,620,228,300,371,700
25.89899
79
0.495869
false
4.3021
false
false
false
lmazuel/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_frontend_ip_configuration_py3.py
1
3140
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
6,454,073,461,142,669,000
46.575758
238
0.644586
false
4.015345
false
false
false