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
manpen/thrill
run/ec2-setup/spot.py
4
3829
#!/usr/bin/env python ########################################################################## # run/ec2-setup/spot.py # # Part of Project Thrill - http://project-thrill.org # # Copyright (C) 2015 Matthias Stumpp <mstumpp@gmail.com> # # All rights reserved. Published under the BSD-2 license in the LICENSE file. #####...
bsd-2-clause
-3,321,554,130,345,154,600
35.817308
103
0.517106
false
4.406214
false
false
false
pandeydivesh15/item_sharing_portal
src/chat_start/views.py
1
1808
from django.shortcuts import render, redirect, get_object_or_404 from django.http import HttpResponse from django.contrib import messages # Create your views here. from User.models import User, check_if_auth_user from .models import Chat # def recv_chat(request, id = None): # check = check_if_auth_user(request) # if...
mit
-6,699,987,483,744,186,000
33.769231
82
0.681416
false
2.825
false
false
false
nsadovskiy/jtv_to_xmltv
convert.py
1
2884
#!/usr/bin/env python # -*- coding: utf-8 -*- from struct import unpack from shutil import rmtree from sys import argv, exit from zipfile import ZipFile from tempfile import gettempdir from datetime import datetime, timedelta from os import removedirs, mkdir, listdir from os.path import join, abspath, isfile, isdir, s...
mit
-9,216,850,653,093,969,000
27.27451
87
0.609917
false
2.927919
false
false
false
suzlab/Autoware
ros/src/sensing/drivers/camera/packages/pylon_camera/pylon_camera/scripts/file_sequencer.py
3
2130
#! /usr/bin/env python #pylint: disable=E0611 import os import cv2 import rospy import actionlib from cv_bridge import CvBridge from camera_control_msgs.msg import GrabSequenceAction, GrabSequenceResult __author__ = 'nikolas' server = None bridge = CvBridge() def load_folder(folder): file_list = os.listdir(fo...
bsd-3-clause
1,649,402,350,740,693,200
24.662651
94
0.613615
false
3.480392
false
false
false
AnhellO/DAS_Sistemas
Ago-Dic-2020/aguirre-juarez-david/Segundo Parcial/ejercicio-5/data/transfer.py
1
1122
import peewee import time import json db = peewee.PostgresqlDatabase( "users", user="postgres", host="postgres", port=5432 ) class Person(peewee.Model): first_name = peewee.CharField() last_name = peewee.CharField() balance = peewee.CharField() age = peewee.IntegerField() eye_color = peewee.CharField() comp...
mit
2,650,179,613,108,571,000
16.825397
36
0.663993
false
2.684211
false
false
false
raphaottoni/twitter-lda
preprocess/tweet2lda/geraEntrada.py
1
1171
from os import listdir from os.path import isfile, join import gzip mypath = "../../data/tweets_clean/" hashtags = open("../../data/top-hash-tags/top300hashtags","r") wordsToRemove = open("../../data/top-words/unwanted-words","r") saida = gzip.open("../../data/entradaLDA/tweetDocument.gz","w") validTags = {tag.strip...
mit
-6,419,212,875,929,669,000
35.59375
89
0.648164
false
3.208219
false
false
false
rickerc/cinder_audit
cinder/tests/test_volume_transfer.py
1
5901
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2013 OpenStack Foundation # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENS...
apache-2.0
7,996,088,350,034,051,000
41.76087
78
0.569395
false
4.224052
true
false
false
gt-big-data/gtpd-crawler
crawler.py
1
8703
#!/usr/bin/env python # This file is the main driver the crawls GTPD logs and stores things in the database. import re from datetime import datetime from sys import argv import requests from bs4 import BeautifulSoup as Soup import db # This is the base URL where we grab data from. # Note the wildcard page number at...
mit
2,938,764,519,010,680,000
32.602317
119
0.634264
false
3.566803
false
false
false
crscardellino/dnnwsd
dnnwsd/corpus/semeval.py
1
3478
# -*- coding: utf-8 -*- import logging import os import re import unicodedata from collections import defaultdict from .base import Word, Sentence, Corpus, CorpusDirectoryIterator from ..utils.setup_logging import setup_logging setup_logging() logger = logging.getLogger(__name__) def _get_word(line): word_inf...
bsd-3-clause
-4,826,118,085,029,100,000
35.229167
109
0.596895
false
3.509586
false
false
false
jlew/Web2Py-Symposium
models/db.py
1
9236
# -*- coding: utf-8 -*- # by default give a view/generic.extension to all actions from localhost # none otherwise. a pattern can be 'controller/function.extension' response.generic_patterns = ['*'] if request.is_local else [] ######################################################################### # Symposium Table #...
gpl-3.0
-5,655,051,017,291,047,000
42.566038
160
0.609138
false
3.814952
false
false
false
anthropo-lab/XP
EPHEMER/dill_resp_project/dill_resp/pages.py
1
7016
from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from .models import Constants ################################################# # Pages specific to baseline treatment ################################################# class Decision_Baseline(Page): form_model = 'player' ...
gpl-3.0
3,090,999,151,373,078,500
29.758772
113
0.575075
false
3.49427
false
false
false
mikejarrett/mj-helpers
mj_helpers/mj_stats.py
1
2552
#!/usr/bin/env python # -*- coding: utf8 -*- """ Command line argument to print stats to screen after profileit has been run. """ from pstats import Stats import argparse import sys import os SORTING = { 'calls': 'Call count', 'cumulative': 'Cumulative time', 'file': 'File name', 'module': 'File name'...
mit
-822,056,312,968,767,100
27.043956
78
0.596395
false
3.950464
false
false
false
rainwoodman/fastPM
tests/plottests.py
2
1106
from matplotlib.backends.backend_agg import FigureCanvasAgg from matplotlib.figure import Figure import numpy import glob import os TRAVIS_BUILD_NUMBER = os.environ.get('TRAVIS_BUILD_NUMBER', 'local') TRAVIS_COMMIT = os.environ.get('TRAVIS_COMMIT', 'local') def plotps(filename, ax): klin, plin = numpy.loadtxt('pow...
gpl-3.0
-2,557,472,463,241,925,600
28.891892
68
0.688065
false
2.560185
false
false
false
ryfeus/lambda-packs
pytorch/source/torch/nn/modules/pooling.py
1
42210
import torch from .module import Module from .utils import _single, _pair, _triple from .. import functional as F from ..._jit_internal import weak_module, weak_script_method @weak_module class _MaxPoolNd(Module): __constants__ = ['kernel_size', 'stride', 'padding', 'dilation', 'return_indic...
mit
8,170,641,874,441,014,000
39.743243
125
0.577778
false
3.53074
false
false
false
fga-gpp-mds/2017.2-Receituario-Medico
medical_prescription/prescription/views/create_copy_prescription.py
1
6547
# Django from django.template.loader import render_to_string from django.http import JsonResponse # Local Django from prescription.views import CreatePrescriptionView from prescription.forms import (CreatePrescriptionForm) from prescription.models import (Prescription, PrescriptionHasM...
mit
-4,315,838,302,017,862,700
43.842466
109
0.604552
false
4.310072
false
false
false
mitdbg/aurum-datadiscovery
nearpy/hashes/unibucket.py
1
2207
# -*- coding: utf-8 -*- # Copyright (c) 2013 Ole Krause-Sparmann # 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,...
mit
7,054,915,911,498,014,000
33.484375
79
0.6715
false
4.302144
true
false
false
huhuibin147/osu-qqbot
multi.py
1
2107
import multiprocessing import traceback import requests import time import json import pymysql osu_api_key = 'b68fc239f6b8bdcbb766320bf4579696c270b349' def get_url(url, timeout=1): try: res = requests.get(url, timeout=timeout) return res except: print('超时..') return 0 conn = p...
gpl-2.0
5,232,487,931,835,305,000
28.041667
231
0.548063
false
3.125561
false
false
false
ergs/rever
tests/test_version_bump.py
1
1185
"""Tests the version bumper activity.""" from rever import vcsutils from rever.logger import current_logger from rever.main import env_main REVER_XSH = """ $ACTIVITIES = ['version_bump'] $DAG['version_bump'].args = [[ ('init.py', r'__version__\s*=.*', "__version__ = '$VERSION'"), ('appveyor.yml', r'version:\...
bsd-3-clause
3,834,158,076,065,594,400
30.184211
89
0.587342
false
3.046272
false
false
false
keith/travis.vim
travis/travis.py
1
1086
import json import urllib2 # Fuck you python. # If someone can explain to me why python makes this such a # pain In the ass I would love that try: from travis.gitrepo import GitRepo from travis.travisresponse import TravisResponse except ImportError: from gitrepo import GitRepo from travisresponse impo...
mit
5,952,331,363,371,764,000
24.857143
71
0.596685
false
3.757785
false
false
false
ThePheonixGuy/ThePhoenixCogs
music/music.py
1
6478
import discord import os from discord.ext import commands import asyncio from .utils.dataIO import dataIO from __main__ import send_cmd_help import chardet import time from cogs.utils.chat_formatting import pagify try: # Check if Tabulate is installed import validators validatorAvailable = True except Import...
mit
-7,507,776,354,414,953,000
35.59887
125
0.578728
false
3.996299
false
false
false
ClockworkNet/svyn
svyn/svynworker.py
1
6856
# Standard library from collections import OrderedDict import logging import os import pwd import re from distutils.version import LooseVersion # Third-party import pysvn LOG = logging.getLogger(__name__) class SvynWorker(object): """Mediates pysvn calls""" DEF_BRANCHES_DIR = 'branches' DEF_TAG_DIR = ...
mit
-8,039,373,575,561,438,000
27.806723
77
0.542299
false
3.944764
false
false
false
ldm5180/hammerhead
hab/killawatt/sensorhistory.py
1
5149
import time, datetime import sys import traceback def formatExceptionInfo(maxTBlevel=5): cla, exc, trbk = sys.exc_info() excName = cla.__name__ try: excArgs = exc.__dict__["args"] except KeyError: excArgs = "<no args>" excTb = traceback.format_tb(trbk, maxTBlevel) return (excName...
lgpl-2.1
-6,430,840,590,073,457,000
35.260563
184
0.555836
false
4.041601
false
false
false
luckyagarwal/author-clustering
Quick_Main.py
1
6504
from __future__ import division, unicode_literals from sklearn import metrics from sklearn.metrics import r2_score #from textblob import TextBlob import numpy as np import glob import json import os from sklearn.cluster import KMeans from sklearn.cluster import AgglomerativeClustering import sortedcollections from s...
mit
-4,810,467,587,472,350,000
29.971429
109
0.590867
false
3.299848
false
false
false
wylee/runcommands
src/runcommands/util/misc.py
1
3837
import functools import importlib import os from ..exc import RunAborted def abort(return_code=0, message="Aborted", color=True): from .printer import printer if message: if color is True: color = "error" if return_code else "warning" if color: message = printer.color...
mit
-9,147,119,131,357,776,000
27.007299
99
0.567892
false
4.125806
false
false
false
GbalsaC/bitnamiP
venv/lib/python2.7/site-packages/lepl/_example/tutorial_3.py
2
2879
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
agpl-3.0
3,469,592,797,582,764,500
32.870588
81
0.62348
false
3.387059
false
false
false
mywdka/grovepi_sensorlogger
sensors/dust.py
1
1326
# USAGE # # Connect the dust sensor to Port 8 on the GrovePi. The dust sensor only works on that port # The dust sensor takes 30 seconds to update the new values # # the fist byte is 1 for a new value and 0 for old values # second byte is the concentration in pcs/0.01cf import time import grovepi from threading import...
gpl-3.0
-8,440,974,949,864,105,000
27.212766
91
0.592006
false
3.417526
false
false
false
bear/ninka
ninka/indieauth.py
1
5480
# -*- coding: utf-8 -*- """ :copyright: (c) 2014-2016 by Mike Taylor :license: MIT, see LICENSE for more details. IndieAuth Toolkit """ import requests from bs4 import BeautifulSoup, SoupStrainer try: # Python v3 from urllib.parse import urlparse, parse_qs, ParseResult except ImportError: from urlparse impo...
mit
-4,730,699,311,231,702,000
38.142857
126
0.612956
false
4.041298
false
false
false
FedericoGarza/tsfeatures
tsfeatures/tsfeatures_r.py
1
5790
#!/usr/bin/env python # coding: utf-8 from typing import List import pandas as pd import rpy2.robjects as robjects from rpy2.robjects import pandas2ri def tsfeatures_r(ts: pd.DataFrame, freq: int, features: List[str] = ["length", "acf_features", "arch_stat", ...
mit
7,027,859,617,552,417,000
36.354839
105
0.532124
false
4.254225
false
false
false
mlperf/training_results_v0.7
Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/python/mxnet/numpy/random.py
1
12205
# 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 u...
apache-2.0
1,831,810,409,334,913,800
36.786378
112
0.632282
false
3.848944
false
false
false
krafczyk/spack
var/spack/repos/builtin/packages/py-spefile/package.py
2
1792
############################################################################## # 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
7,240,776,867,981,125,000
41.666667
78
0.676897
false
3.991091
false
false
false
nullzero/wprobot
scripts/DYKChecker.py
1
7090
#!/usr/bin/python # -*- coding: utf-8 -*- """DYKChecker!""" __version__ = "1.0.1" __author__ = "Sorawee Porncharoenwase" import difflib import json import init import wp import pywikibot import time from wp import lre def glob(): global anchorBegin, anchorEnd, subst, anchor anchor = ur"[\uE000-\uF8FF]" ...
mit
-8,346,001,404,454,083,000
32.377551
83
0.464843
false
2.530754
false
false
false
GPflow/GPflow
doc/source/notebooks/advanced/changepoints.pct.py
1
2737
# --- # jupyter: # jupytext: # formats: ipynb,.pct.py:percent # text_representation: # extension: .py # format_name: percent # format_version: '1.3' # jupytext_version: 1.3.3 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- # %% [markdown] ...
apache-2.0
2,515,088,676,655,442,400
31.2
327
0.686518
false
2.77305
false
false
false
DarthMaulware/EquationGroupLeaks
Leak #4 - Don't Forget Your Base/EQGRP-Auction-File/Linux/bin/emptybowl.py
1
1031
#!/usr/bin/python import sys import socket if(len(sys.argv) < 4): print "" print "Usage: %s <target-host> <port> <cmd-string>" % sys.argv[0] print " --NOTE: All spaces in <cmd-string> will be replaced by \\t's" print " -- A good default might be: " print " 'mkdir /tmp/.scsi ; cd /tmp/.scsi && telnet <host> <port>...
unlicense
-6,901,834,885,931,735,000
38.653846
131
0.626576
false
2.392111
false
false
false
ljwolf/pysal
pysal/spreg/summary_output.py
2
56019
"""Internal helper files for user output.""" __author__ = "Luc Anselin luc.anselin@asu.edu, David C. Folch david.folch@asu.edu, Pedro V. Amaral pedro.amaral@asu.edu, Jing Yao jingyao@asu.edu" import textwrap as TW import numpy as np import copy as COPY import diagnostics as diagnostics import diagnostics_tsls as diag...
bsd-3-clause
394,691,061,426,138,000
37.03055
146
0.545815
false
3.219668
true
false
false
Ecogenomics/GTDBNCBI
src/gtdb/User.py
1
2769
############################################################################### # # # 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 # ...
gpl-3.0
-3,535,352,353,167,806,500
35.434211
79
0.516793
false
4.892226
false
false
false
HouseWare/TheHub
database/init_db.py
1
2928
#!/usr/bin/env python import db # Instantiate code object for info code. info_code = db.Code(code = "I001", value = "System Boot") # Instantiate severities to use in notifications. notification = db.Severity(value = "Notification") warning = db.Severity(value = "Warning") alert = db.Severity(value = "Alert") # Insta...
mit
725,456,556,186,054,500
33.046512
79
0.71209
false
3.575092
false
false
false
junyanz/iGAN
ui/ui_warp.py
1
3537
import numpy as np import cv2 from lib import utils class UIWarp(): def __init__(self, img_size, scale, nc=3): self.img_size = img_size self.scale = scale self.nc = nc self.img = np.zeros((img_size, img_size, self.nc), np.uint8) self.mask = np.zeros((img_size, img_size, 1), ...
mit
4,978,793,305,002,965,000
34.019802
87
0.527283
false
2.903941
false
false
false
pastebt/dwm
iqiyi.py
1
5671
# -*- coding: utf8 -*- import sys import time import json import random import hashlib from subprocess import Popen, PIPE from mybs import SelStr from comm import DWM, match1, echo, start, debug class I2(DWM): # http://cn-proxy.com/ def __init__(self): #DWM.__init__(self) #DWM.__init__(self,...
gpl-3.0
2,202,494,889,001,154,800
34.086957
76
0.482209
false
2.913357
false
false
false
arne-cl/discoursegraphs
src/discoursegraphs/readwrite/rst/dis/disgraph.py
1
7494
#!/usr/bin/env python # -*- coding: utf-8 -*- # Author: Arne Neumann <discoursegraphs.programming@arne.cl> """ This module converts a *.dis file (used by old versions of RSTTool to annotate rhetorical structure) into a networkx-based directed graph (``DiscourseDocumentGraph``). """ import os from discoursegraphs imp...
bsd-3-clause
576,108,981,407,271,800
43.082353
100
0.548839
false
4.0312
false
false
false
DeepVisionTeam/TensorFlowBook
rnn/sin/lstm_sin.py
2
3352
from __future__ import absolute_import, division, print_function import random import numpy as np import tensorflow as tf from tensorflow.contrib.rnn.python.ops import core_rnn from tensorflow.contrib.rnn.python.ops import core_rnn_cell def build_data(n): xs = [] ys = [] for i in range(0, 2000): ...
apache-2.0
2,088,985,318,783,766,300
31.543689
72
0.586814
false
2.976909
true
false
false
AmericanResearchInstitute/poweru-server
pr_services/exam_system/form_widget_manager.py
1
3133
""" FormWidget Manager class. :author: Michael Hrivnak <mhrivnak@americanri.com> :copyright: Copyright 2010 American Research Institute, Inc. """ __docformat__ = "restructuredtext en" # PowerReg from pr_services.object_manager import ObjectManager from pr_services.rpc.service import service_method import facade cla...
bsd-3-clause
5,807,002,355,663,812,000
35.430233
95
0.568146
false
3.970849
false
false
false
openattic/openattic
backend/rest/auth.py
1
5778
# -*- coding: utf-8 -*- """ * Copyright (C) 2011-2016, it-novum GmbH <community@openattic.org> * * openATTIC 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 package is distribu...
gpl-2.0
-3,378,545,961,051,875,000
38.848276
105
0.677397
false
4.264207
false
false
false
mikadam/LadderiLogical
source/extra_ui.py
1
7583
''' File name: extra_ui.py Author: Michal Adamkiewicz Date: 2014 - 2015 This file implements the extra UI elements such as the input/output panel and directional selectors ''' import tkinter.ttk as ttk import tkinter as tk from asm_compiler import CompilerSettingsWindow class IOBoard(ttk.Frame): forbiden_chars=...
mit
-6,358,412,148,740,617,000
29.580645
113
0.570091
false
3.228182
true
false
false
kkuunnddaannkk/vispy
vispy/geometry/calculations.py
13
4221
# -*- coding: utf-8 -*- # Copyright (c) 2015, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. """Miscellaneous functions """ import numpy as np from ..ext.six import string_types ############################################################################### # Thes...
bsd-3-clause
-7,364,713,376,896,814,000
30.036765
79
0.526652
false
3.232006
false
false
false
brennie/reviewboard
reviewboard/search/signal_processor.py
1
8314
"""The signal processor for Review Board search.""" from __future__ import unicode_literals import threading from functools import partial from django.contrib.auth.models import User from django.db.models.signals import post_delete, post_save, m2m_changed from django.utils import six from haystack.signals import Bas...
mit
7,731,476,334,440,754,000
37.669767
98
0.580828
false
4.618889
false
false
false
araith/pyDEA
tests/test_solution.py
2
5742
import pytest from pulp import LpStatusOptimal from pyDEA.core.data_processing.solution import Solution, SolutionWithVRS, SolutionWithSuperEfficiency from pyDEA.core.data_processing.input_data import InputData from tests.test_input_data import data def test_solution_add_efficiency_score(data): s = Solution(data...
mit
-4,972,855,184,888,037,000
37.02649
102
0.637931
false
2.729087
true
false
false
stanley-cheung/grpc
src/python/grpcio_status/status_commands.py
13
1669
# Copyright 2018 The gRPC Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
apache-2.0
-16,429,308,457,367,456
33.061224
75
0.670461
false
3.964371
false
false
false
sinelaw/enough
livec/codegui/widget_for.py
3
3236
# Copyright (c) 2007 Enough Project. # See LICENSE for details. import nodes from functools import partial from codegui import style from gui.Box import HBox from gui.TextEdit import TextEdit, make_label from gui.ProxyWidget import ProxyWidget from lib.observable.List import List from lib.observable.FuncCall import F...
gpl-3.0
-7,330,661,035,736,608,000
34.56044
105
0.69932
false
3.802585
false
false
false
OpenLD/enigma2-wetek
lib/python/Plugins/Extensions/LDteam/extras/Epg_Auto.py
1
4782
#!/usr/bin/env python # -*- coding: UTF-8 -*- ## ## Epg_Auto for Enigma2 ## ## Copyright (c) 2012-2016 OpenLD ## Javier Sayago <admin@lonasdigital.com> ## Contact: javilonas@esp-desarrolladores.com ## ## Licensed under the Apache License, Version 2.0 (the "License"); ## you may not use this file exce...
gpl-2.0
-3,881,053,795,016,717,300
41.87156
192
0.679214
false
2.839667
false
false
false
deepmind/sonnet
sonnet/src/axis_norm_test.py
1
11968
# Copyright 2019 The Sonnet 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 l...
apache-2.0
7,080,316,980,084,915,000
36.517241
80
0.589405
false
3.571471
true
false
false
Tsjerk/MartiniTools
gmx/tpr/tprio.py
1
12516
import versions import io import struct import numpy class Integer(int): """Integer from a binary stream, with index""" def __new__(cls, stream): pos = stream.tell() obj = int.__new__(cls, struct.unpack(">l", stream.read(4))[0]) obj.position = pos return obj def pack(sel...
gpl-2.0
5,288,702,956,801,240,000
29.378641
105
0.545861
false
3.90028
false
false
false
wnyc/autosync
autosync/daemon.py
1
12173
use_gevent = False import select from pyinotify import WatchManager, Notifier, ThreadedNotifier, EventsCodes, ProcessEvent import autosync import autosync.actors import autosync.actors.s3 from autosync.files import File import gflags from loggin import info, debug, warning import os.path import re import gflags impo...
gpl-3.0
-1,569,665,048,896,833,300
30.700521
89
0.538815
false
3.922978
false
false
false
clarinsi/reldi-api
src/core/train_tagger.py
1
4214
#!/usr/bin/python #-*-coding:utf8-*- import sys import re import codecs import cPickle as pickle import pycrfsuite sys.stdout = codecs.getwriter('utf8')(sys.stdout) def conll_iter(stream): sent=[] for line in stream: if line.strip()=='': yield sent sent=[] else: sent.append(line.decode(...
gpl-3.0
-8,464,212,195,727,737,000
25.173913
119
0.608211
false
2.874488
false
false
false
termoshtt/DataProcessor
lib/dataprocessor/tests/test_move_node.py
3
3577
# coding=utf-8 import os import copy from .utils import TestNodeListAndDir from ..pipes.move_node import move_node from ..nodes import get from ..exception import DataProcessorError class TestMoveNode(TestNodeListAndDir): """.""" def test_move_dir2dir(self): """ move dir to dir li...
gpl-3.0
-1,852,119,689,637,683,500
29.57265
79
0.5896
false
3.355535
true
false
false
henry232323/Pesterchum-Discord
emojis.py
1
1896
#!/usr/bin/env python3 # Copyright (c) 2016-2020, henry232323 # # 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
8,663,618,880,968,485,000
36.92
83
0.673523
false
3.869388
false
false
false
stepank/pyws
src/pyws/protocols/soap/xsd.py
1
3722
from lxml import etree as et from pyws.functions import args from utils import * class UnknownType(Exception): def __str__(self): return 'Unknown type: %s' % self.args[0] class Type(object): _represents = None def __init__(self, type, ns=None, nsmap=None): self.type = type s...
mit
6,454,175,234,193,197,000
23.649007
77
0.617947
false
3.656189
false
false
false
taroved/pol
pol/server.py
1
15977
from __future__ import print_function from datetime import datetime from hashlib import md5 import json import pickle import time, sys, traceback import re import six from lxml import etree from twisted.web import server, resource from twisted.internet import reactor, endpoints, defer from twisted.web.client import A...
mit
4,373,813,146,493,836,300
38.449383
336
0.578331
false
3.97339
true
false
false
lcoandrade/DsgTools
core/Factories/ThreadFactory/genericThread.py
1
1813
# -*- coding: utf-8 -*- """ /*************************************************************************** DsgTools A QGIS plugin Brazilian Army Cartographic Production Tools ------------------- begin : 2015-03-29 git sha ...
gpl-2.0
-5,270,310,044,844,931,000
36
96
0.419195
false
5.20977
false
false
false
jantman/tuxostat
fs_backup/home/tuxostat/devel/PhidgetsPython/Phidgets/Phidget.py
1
24705
"""Copyright 2008 Phidgets Inc. This work is licensed under the Creative Commons Attribution 2.5 Canada License. To view a copy of this license, visit http://creativecommons.org/licenses/by/2.5/ca/ """ __author__ = 'Adam Stelmack' __version__ = '2.1.4' __date__ = 'May 02 2008' from threading import * from ...
gpl-3.0
-4,168,412,556,841,928,700
41.959075
243
0.619105
false
4.576695
false
false
false
wangtaoking1/found_website
项目代码/classification.py
1
6580
# -*- coding: utf-8 -*- #search函数,参数为输入文件,输出文件,关键词。关键词与输入文件的每六行进行匹配(六行为一条微博),如果出现该关键词,则把该微博输出到输出文件中 def search(input_file,output_file,key): line = input_file.readline() if line == "\n": line = input_file.readline() while line: #如果文件没有结束,继续读取 lines = "" lines += line ...
gpl-2.0
-812,805,497,189,426,000
26.171171
75
0.639589
false
2.670208
false
false
false
dvor85/kodi.repo
addons_xml_generator.py
1
6436
# -*- coding: utf-8 -*- # * # * Copyright (C) 2012-2013 Garrett Brown # * Copyright (C) 2010 j48antialias # * # * 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...
gpl-2.0
-4,974,245,560,876,014,000
35.068182
129
0.548677
false
3.68
false
false
false
sparkslabs/kamaelia_
Sketches/JL/pygame/pygui.py
3
2548
# -*- coding: utf-8 -*- #simple scrolling textbox using Pygame # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the...
apache-2.0
5,699,382,882,291,597,000
32.090909
84
0.710361
false
3.304799
false
false
false
davandev/davanserver
davan/util/helper_functions.py
1
3298
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import logging import urllib from urllib import quote global logger logger = logging.getLogger(os.path.basename(__file__)) def debug_big(message): tmpStr = "\n==============================================================================\n" tmpStr += me...
mit
1,858,447,342,524,689,400
32.927835
102
0.555454
false
3.648559
false
false
false
msincenselee/vnpy
vnpy/gateway/gj/gj_gateway.py
1
49000
# 国金交易客户端 + easytrader 接口 # 华富资产 李来佳 28888502 import os import sys import copy import csv import dbf import traceback import pandas as pd from typing import Any, Dict, List from datetime import datetime, timedelta from time import sleep from functools import lru_cache from collections import OrderedDict from multiproc...
mit
8,360,197,393,499,855,000
34.252494
165
0.506183
false
3.202984
false
false
false
jpurma/Kataja
plugins/SpreadNet/Parser.py
1
21833
try: from SpreadNet.XBar import XBar from SpreadNet.Feature import Feature from kataja.syntax.SyntaxState import SyntaxState from kataja.saved.DerivationStep import DerivationStep except ImportError: from XBar import XBar from Feature import Feature import json import time REMOVE_BAD...
gpl-3.0
-3,793,092,469,338,765,300
35.510309
119
0.474967
false
4.058561
false
false
false
muatik/dahi
dahi/bots.py
1
1068
from bson import ObjectId from dahi.bot import Bot from dahi.knowledgebase import KnowledgeBase class BotNotFoundError(Exception): def __init__(self, message): super(BotNotFoundError, self).__init__() self.message = message class Builder(object): def __init__(self, storage): super(B...
mit
6,173,045,002,197,694,000
26.384615
74
0.595506
false
4.107692
false
false
false
fegin/playcode
python/coutput/cprint.py
1
1065
from __future__ import print_function def cprint(*args, **kwargs): if not hasattr(cprint, 'table'): cprint.table = {} cprint.table['RED'] = '\033[91m' cprint.table['GREEN'] = '\033[92m' cprint.table['YELLOW'] = '\033[93m' cprint.table['BLUE'] = '\033[94m' cprint.tabl...
apache-2.0
-1,588,763,279,319,646,200
28.583333
44
0.544601
false
3.150888
true
false
false
gmist/3dhero2
main/apps/feedback/api.py
2
1181
# coding: utf-8 from google.appengine.ext import ndb from flask.ext import restful import flask from apps import auth from core import util from core.api import helpers import models class FeedbacksAPI(restful.Resource): @auth.admin_required def get(self): feedback_dbs, next_cursor, prev_cursor = models.Fee...
mit
9,028,362,275,627,370,000
25.244444
71
0.679932
false
3.403458
false
false
false
Impactstory/sherlockoa
date_range.py
2
7198
from sqlalchemy.dialects.postgresql import JSONB from executor import execute import requests from time import time import datetime import shortuuid from urllib import quote import os import re import geoip2.webservice from app import logger from app import db from util import elapsed from util import safe_commit from...
mit
-443,580,006,394,881,900
39.666667
264
0.560156
false
3.840982
false
false
false
cranmer/parametrized-learning
Graph.py
1
9975
#!/usr/bin/env python # https://github.com/svenkreiss/PyROOTUtils/blob/master/PyROOTUtils/Graph.py __author__ = "Sven Kreiss" import ROOT from array import array class Graph( ROOT.TGraph ): def __init__( self, x, y=None, fillColor=None, lineColor=None, lineStyle=None, lineWidth=None, markerSize=None, markerCo...
bsd-2-clause
654,878,315,164,227,500
35.672794
202
0.521704
false
3.205334
false
false
false
blalab/csv2mr
Journaler.py
1
4908
import hashlib import os import cPickle import time import csv import errno import json class Journaler: ''' Plan of Action: + The queuer receives a generator which is a pipe that comes all the way from the source file + The generator has items that are already conformant to the receiving Ring schema ...
mit
-144,673,667,637,451,550
27.369942
130
0.529136
false
4.11745
false
false
false
linmajia/dlbench
tools/tensorflow/cnn/alexnet/cifar10_input.py
1
9979
# Copyright 2015 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...
mit
-7,711,222,345,237,494,000
36.942966
85
0.678926
false
3.623457
false
false
false
half-potato/P-BODI
prototype/PBOD.py
1
5394
import math import numpy import cv2 import util class PBOD: # angle refers to the view def __init__( self, heightFromGround, pixelWidth, pixelHeight, widthAngle, heightAngle, cameraDirection = [1.0, 0.0, 0.0]): self.h = heightFromGround self.widthAngle = widthAngle self.heightAngle = he...
mit
-7,525,658,746,082,100,000
39.253731
134
0.578977
false
3.156232
false
false
false
nevil-brownlee/pypy-libtrace
lib/plt/try-ip.py
1
2869
import plt, ipp import os # try-ip.py: test program for pypy plt print "- - - - -" base = "/Users/jbro111" # OSX #base = "/home/nevil" # Ubuntu #fn = "pypy/1000packets.pcap.gz" # vlan id 1051 (Waikato) #fn = "pypy/anon-v6.pcap" fn = "pypy/anon-v4.pcap" trace_format = "pcapfile" full_fn = base + '/' + fn p...
gpl-3.0
8,068,992,133,630,241,000
23.947826
81
0.526316
false
2.490451
false
false
false
postfix/https-ids
lib/printer.py
2
14393
#!/usr/bin/env python3.4 # Author: Olivier van der Toorn <o.i.vandertoorn@student.utwente.nl> # Description: The printing module import datetime import os import re import subprocess import sys import time import io try: from termcolor import colored except ImportError: print("Termcolor import failed") ...
bsd-3-clause
-5,420,015,681,672,302,000
28.37551
149
0.634475
false
3.583022
false
false
false
fusionbox/satchless
satchless/category/app.py
1
4419
from django.conf.urls import patterns, url from django.http import Http404 from django.http import HttpResponseNotFound from django.template.response import TemplateResponse from ..product import app from . import models class CategorizedProductApp(app.ProductApp): app_name = 'category' category_model = model...
bsd-3-clause
-2,977,731,433,440,985,000
39.172727
101
0.594705
false
3.934996
false
false
false
tobijk/ecromedos
lib/net/ecromedos/preprocessor.py
1
4503
# -*- coding: utf-8 -*- # # Desc: This file is part of the ecromedos Document Preparation System # Author: Tobias Koch <tobias@tobijk.de> # License: MIT # URL: http://www.ecromedos.net # import os, sys, imp from net.ecromedos.error import ECMDSError, ECMDSPluginError class ECMDSPreprocessor(): def __init...
mit
-3,320,452,984,631,503,000
28.625
77
0.501221
false
4.436453
false
false
false
hansfilipelo/pyWebExtractor
printOuts.py
1
1960
#!/usr/bin/env python3 # Purpose: Generates "commander" file interface in HTML # Creators: Jens Edhammer and Hans-Filip Elo from os import listdir from os.path import join,isfile import textwrap def listSourceDir(source): return [files for files in listdir(source) if not files.startswith(".")] # ---------------...
mit
-7,108,545,731,220,712,000
19.851064
119
0.419388
false
4.375
false
false
false
YuMao1993/DRL
PG/PGEnv.py
1
1588
""" Environment """ import gym import numpy as np import PGConfig class PGEnvironment: def __init__(self, environment_name, display=False, frame_skipping=False): self._env = gym.make(environment_name) self._dispaly = display self._done = True self._total_episode_reward = 0 ...
mit
-9,135,162,780,983,791,000
28.962264
116
0.602645
false
4.178947
false
false
false
r2t2sdr/r2t2
soft/scripts/r2t2.py
1
1987
#!/usr/bin/python import cgi, cgitb import os import time from lockfile import LockFile r2t2file = '../r2t2reg/r2t2.txt' r2t2lock = '../r2t2reg/r2t2.lock' timeout = 300 form = cgi.FieldStorage() # get post event call = form.getvalue('call') location = form.getvalue('location') band = form.getvalue('band') rig =...
gpl-3.0
190,598,380,539,590,000
23.530864
104
0.605435
false
2.65287
false
false
false
JGiard/AutoValue
autovalue/__init__.py
1
2462
from collections.abc import Hashable from functools import wraps from inspect import getmembers, signature __version__ = '0.7.2' def autovalue(cls): attributes = [] for member in getmembers(cls): if member[0] == '__init__': for name, parameter in signature(member[1]).parameters.items(): ...
lgpl-3.0
-4,747,077,672,052,693,000
31.826667
93
0.536962
false
4.130872
false
false
false
ScreamingUdder/mantid
Framework/PythonInterface/plugins/algorithms/NMoldyn4Interpolation.py
3
6233
# Author: Alex Phimister 08/2016 # pylint: disable=invalid-name import math import numpy as np import scipy as sc from sys import version_info from mantid.simpleapi import * from mantid.kernel import * from mantid.api import * class NMoldyn4Interpolation(PythonAlgorithm): def category(self): return 'Sim...
gpl-3.0
7,464,587,541,915,180,000
41.986207
97
0.589764
false
4.052666
false
false
false
cybersphinx/wzgraphicsmods
tools/masterserver/game.py
3
5164
#!/usr/bin/env python # # This file is part of the Warzone 2100 Resurrection Project. # Copyright (c) 2007-2009 Warzone 2100 Resurrection Project # # Warzone 2100 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 Foundatio...
gpl-2.0
1,522,559,887,215,703,600
36.970588
133
0.558095
false
3.611189
false
false
false
batxes/4c2vhic
SHH_WT_models/SHH_WT_models_final_output_0.1_-0.1_11000/SHH_WT_models25278.py
2
17566
import _surface import chimera try: import chimera.runCommand except: pass from VolumePath import markerset as ms try: from VolumePath import Marker_Set, Link new_marker_set=Marker_Set except: from VolumePath import volume_path_dialog d= volume_path_dialog(True) new_marker_set= d.new_marker_set marker_set...
gpl-3.0
2,721,775,871,692,918,300
46.093834
74
0.699761
false
2.616714
false
false
false
aarongarrett/inspyred
examples/advanced/logging_example.py
2
2170
from random import Random from time import time import inspyred import math # Define an additional "necessary" function for the evaluator # to see how it must be handled when using pp. def my_squaring_function(x): return x**2 def generate_rastrigin(random, args): size = args.get('num_inputs', 10) return [...
mit
-4,414,546,021,388,072,400
34.57377
89
0.566359
false
3.813708
false
false
false
rfriedlein/zenoss
ZenPacks/ZenPacks.Coredial.StatusReport/ZenPacks/Coredial/StatusReport/interfaces.py
19
1837
from Products.Zuul.form import schema from Products.Zuul.interfaces.component import IComponentInfo from Products.Zuul.interfaces.template import IRRDDataSourceInfo # ZuulMessageFactory is the translation layer. You will see strings intended to # been seen in the web interface wrapped in _t(). This is so that these st...
gpl-3.0
-4,093,752,936,291,527,700
39.822222
79
0.765378
false
3.835073
false
false
false
QuantScientist/Deep-Learning-Boot-Camp
docker/jupyter_notebook_config.py
1
1242
# Copyright 2015 The deep-ml.com 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 applic...
mit
-17,487,588,716,743,118
35.529412
83
0.71256
false
3.558739
false
false
false
solus-project/evolve-sc
xng/util/markdown.py
2
10723
#!/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
5,745,134,893,656,878,000
30.686391
80
0.437255
false
4.299478
false
false
false
ronaldosvieira/machado-search
engine.py
1
1823
#!/usr/bin/env python # -*- coding: utf-8 -*- import machado, numpy as np import os.path from whoosh.analysis import RegexTokenizer, LowercaseFilter, StopFilter, CharsetFilter from whoosh.fields import Schema, TEXT, ID from whoosh.index import create_in, open_dir from whoosh.query import * from whoosh.qparser import M...
mit
3,085,844,089,562,016,000
34.076923
237
0.707076
false
3.512524
false
false
false
LCOGT/valhalla
valhalla/common/test_telescope_states.py
1
22708
from valhalla.common.telescope_states import (TelescopeStates, get_telescope_availability_per_day, combine_telescope_availabilities_by_site_and_class) from valhalla.common.configdb import TelescopeKey from valhalla.common.test_helpers import ConfigDBTestMixin from valhalla....
gpl-3.0
1,780,242,500,108,279,300
55.912281
118
0.516294
false
3.813907
true
false
false
ideascube/ideascube
ideascube/monitoring/tests/factories.py
1
1148
from datetime import datetime, timezone import factory from factory.fuzzy import FuzzyText from ideascube.tests.factories import UserFactory from ..models import Entry, Inventory, Loan, Specimen, StockItem class EntryFactory(factory.django.DjangoModelFactory): user = factory.SubFactory(UserFactory) module ...
agpl-3.0
724,134,141,640,832,500
22.916667
73
0.731707
false
3.972318
false
false
false
openp2pdesign/OpenMetaDesignApp
modules/classes.py
1
12749
# -*- coding: utf-8 -*- # # Open MetaDesign 0.1 # # Author: Massimo Menichinelli # Website: # http://openmetadesign.org # http://openp2pdesign.org # # License: GPL v.3 # from lxml import etree class businessmodel(): "A class for the business model of the project" def __init__(self): self.valueproposi...
gpl-3.0
-4,697,487,457,472,132,000
42.657534
119
0.595544
false
4.09377
false
false
false
rchakra3/x9115rc3
hw/code/8/optimizer/mws.py
1
6257
from __future__ import division import random from common import prerun from model.helpers.candidate import Candidate from helpers.a12 import a12 def mws(model, p=0.5, threshold=0.001, max_tries=500, max_changes=10, era_size=100, era0=None, lives=5): best_can = None normalize = prerun(model) aggregate =...
gpl-2.0
7,275,451,944,823,557,000
30.60101
119
0.487134
false
3.78753
false
false
false
sideeffects/stats_core
stats_main/time_series.py
1
9494
from django.db import connections from dateutil.relativedelta import relativedelta from qsstats import QuerySetStats from django.db.models import Avg, Sum, Count import utils #=============================================================================== def fill_missing_dates_with_zeros(time_series, agg_by, interv...
mit
547,369,393,971,277,700
37.75102
80
0.489362
false
4.257399
false
false
false
mattbasta/perfalator
perfalator/webapp.py
1
1589
import simplejson as json from unicodehelper import decode from .specs.webapps import WebappSpec def detect_webapp(err, package): """Detect, parse, and validate a webapp manifest.""" # Parse the file. with open(package, mode="r") as f: return detect_webapp_string(err, f.read()) def detect_weba...
bsd-3-clause
-8,559,967,284,625,816,000
30.78
78
0.599748
false
4.237333
false
false
false
Pfeter/SpaceShooter
main.py
1
2517
import sys, random, pygame from pygame.locals import QUIT, KEYDOWN, K_ESCAPE from spaceship import Spaceship from background2 import Background from keyboard_event_controller import keyboard_event_controller class Screen(object): def __init__(self, width=640, height=400, fps=60, stars=200): self.running = ...
mit
-2,102,043,584,910,878,200
33.479452
93
0.595153
false
3.773613
false
false
false
quantmind/lux
lux/ext/oauth/twitter/__init__.py
1
2083
''' ''' from ..oauth import OAuth1 twitter_cards = {} def twitter_card(cls): type = cls.__name__.lower() twitter_cards[type] = cls() return cls class Twitter(OAuth1): auth_uri = 'https://api.twitter.com/oauth/authorize' request_token_uri = 'https://api.twitter.com/oauth/request_token' toke...
bsd-3-clause
-7,712,684,468,897,958,000
25.0375
69
0.567451
false
3.62892
false
false
false
novapost/django-i18nurl
i18nurl/views.py
1
2548
"""Views to manage active language.""" from django.conf import settings from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from django.utils.http import is_safe_url from django.utils.translation import override from django.views.generic import FormView, RedirectView from i18nurl....
bsd-3-clause
2,384,267,443,895,358,500
36.470588
76
0.653846
false
4.378007
false
false
false
alberlab/alabtools
alabtools/api.py
1
40698
# Copyright (C) 2017 University of Southern California and # Nan Hua # # Authors: Nan Hua # # 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 Licen...
gpl-3.0
-5,348,119,111,245,666,000
35.897552
144
0.520787
false
3.918167
false
false
false
robertomest/convnet-study
rme/models/resnet.py
1
8864
import keras import keras.backend as K from keras.models import Model from keras.layers import (Input, Convolution2D, Activation, BatchNormalization, merge, GlobalAveragePooling2D, Dense, Dropout) from keras.regularizers import l2 from rme.datasets import cifar10, cifar100, svhn, mnist, prepro...
mit
4,811,126,839,611,148,000
39.847926
84
0.573556
false
3.671914
false
false
false