repo_name
stringlengths
5
92
path
stringlengths
4
232
copies
stringclasses
19 values
size
stringlengths
4
7
content
stringlengths
721
1.04M
license
stringclasses
15 values
hash
int64
-9,223,277,421,539,062,000
9,223,102,107B
line_mean
float64
6.51
99.9
line_max
int64
15
997
alpha_frac
float64
0.25
0.97
autogenerated
bool
1 class
alien4cloud/alien4cloud-cloudify3-provider
alien4cloud-cloudify3-provider/src/test/resources/outputs/blueprints/amazon/lamp/plugins/custom_wf_plugin/plugin/utils.py
1
33387
from handlers import build_persistent_event_tasks from handlers import build_wf_event_task from handlers import host_post_start from handlers import host_pre_stop from cloudify.workflows import tasks as workflow_tasks def _get_nodes_instances(ctx, node_id): instances = [] for node in ctx.nodes: for in...
apache-2.0
1,327,009,776,229,327,400
48.098529
191
0.643664
false
caganze/wisps
wisps/simulations/effective_numbers.py
1
16319
##adds survey parameters such as magnitude etc. to things from .initialize import * from tqdm import tqdm from scipy.interpolate import interp1d import wisps from .initialize import SELECTION_FUNCTION, SPGRID from wisps import drop_nan from astropy.coordinates import SkyCoord #import pymc3 as pm from .core import ...
mit
146,500,805,738,429,980
34.631004
121
0.662541
false
nouiz/pydy
examples/Kane1985/Chapter6/Ex11.7_11.8.py
1
7491
#!/usr/bin/env python # -*- coding: utf-8 -*- """Exercises 11.7, 11.8 from Kane 1985.""" from __future__ import division from sympy import expand, solve, symbols, trigsimp, sin, cos, Matrix from sympy.physics.mechanics import ReferenceFrame, RigidBody, Point from sympy.physics.mechanics import dot, dynamicsymbols, ine...
bsd-3-clause
4,809,107,665,599,585,000
31.012821
76
0.591243
false
jianhuashao/WebDownloadJobsManage
server/db_insert_row.py
1
2070
###### configuration start ######## job_target = 'appid_to_asin' client_id = 'server_test' ###### configuration finish ######## ###### custom function start, need to modify according to real case def job_upsert_bulk(): conn = sqlite3.connect('./amazon_ec2.db') c = conn.cursor() c.execute('SELECT app_id FROM appid_...
apache-2.0
9,039,640,467,172,764,000
28.571429
109
0.657488
false
prasannav7/ggrc-core
test/selenium/src/lib/page/widget/info_widget.py
2
7787
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: jernej@reciprocitylabs.com # Maintained By: jernej@reciprocitylabs.com """Page object models for the info widget of the object""" from lib import...
apache-2.0
1,664,238,434,229,085,400
28.384906
78
0.711827
false
talis/disturbometer-hack
in-house/scan.py
1
3536
import nmap from time import time, sleep, gmtime, strftime import os, os.path import requests import ConfigParser import urllib2 import subprocess import datetime import fileinput from firebase import firebase config = ConfigParser.ConfigParser() config.read([os.path.expanduser("~/netscan/.netscan"), '/etc/netscan']) ...
gpl-2.0
8,241,085,545,684,713,000
27.983607
133
0.6694
false
phelmig/outside_
mvp/outside/frontend/migrations/0001_initial.py
1
2511
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.db.models.deletion from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operati...
mit
6,772,364,062,739,232,000
43.839286
141
0.574671
false
mk23/snmpy
lib/snmpy/httpd.py
1
4578
#!/usr/bin/env python2.7 import BaseHTTPServer import collections import logging import os import re import socket import sys import signal import time import traceback import urllib import urlparse from snmpy import log_error, __version__ LOG = logging.getLogger() class HTTPError(Exception): code = 500 d...
mit
-6,797,718,559,616,790,000
28.535484
107
0.585408
false
dleecefft/pcapstats
abin/attackduration.py
1
4074
#!/usr/bin/env python # take a large CSV and filter out service attacks so the duration can be calculated # # Take protocol and array of ports as arguments # # Assuming 10 minute buckets for duration, if new traffic seen more than 10 mins # after last consider it a new gnore all traffic sourced from the self IP, pass ...
apache-2.0
-7,831,274,221,280,399,000
28.309353
144
0.613893
false
davido/buck
src/com/facebook/buck/json/buck_parser/buck.py
1
56883
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import with_statement import __builtin__ import __future__ import contextlib from pathlib import _Accessor, Path, PureWindowsPath, PurePath, PosixPath from pywatchman import bser, WatchmanError...
apache-2.0
2,255,676,063,977,430,500
36.670861
100
0.608161
false
edawson/rkmh
scripts/make_random_mix.py
1
2794
import random import argparse def parse_args(): parser = argparse.ArgumentParser() parser.add_argument("-i", "--input", dest="infile", required=True, help="A two column file in format LABEL\tPATH_TO_FILE with the strain label and the path to a file containing reads") parser.add_argument("-n", "--num-infs",...
mit
1,601,783,119,895,584,500
33.073171
188
0.599499
false
yostashiro/rfhk-addons
account_payment_term/account_payment_term.py
1
5693
# -*- coding: utf-8 -*- # Odoo, Open Source Management Solution # Copyright (C) 2014 - hiro TAKADA. All Rights Reserved # @author hiro TAKADA <hiro@thdo.biz> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # publ...
agpl-3.0
4,166,531,314,814,181,000
37.993151
78
0.552784
false
josiah-wolf-oberholtzer/consort
consort/tools/GraceHandler.py
1
4797
import abjad import collections from abjad.tools import abctools from abjad.tools import mathtools from abjad.tools import schemetools from abjad.tools import scoretools from abjad.tools import selectiontools class GraceHandler(abctools.AbjadValueObject): r'''A grace maker. :: >>> grace_handler = co...
mit
-1,673,588,689,567,768,000
29.75
77
0.56577
false
windskyer/mvpn
mvpn/api/openstack/__init__.py
1
13161
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # 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 ...
gpl-2.0
-6,611,409,914,591,845,000
37.037572
79
0.600486
false
batxes/4c2vhic
Six_mouse_models/Six_mouse_models_final_output_0.2_-0.1_11000/Six_mouse_models25517.py
2
18205
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
1,271,492,513,630,737,000
45.323155
71
0.699423
false
langmark/langmark
bench.py
1
5837
from subprocess import * from tempfile import TemporaryFile SHELL = '/bin/bash' class Bench: workingDir = '' test = '' name = '' script = {} expected_result = None def __init__(self, workingDir, test, name, script, expected_result): self.workingDir = workingDir self.test = tes...
agpl-3.0
4,863,677,003,644,323,000
30.722826
121
0.528525
false
blanu/py-obfsproxy
src/obfsproxy/transports/obfs3.py
1
3953
#!/usr/bin/python # -*- coding: utf-8 -*- """ The obfs3 module implements the obfs3 protocol. """ from dust.extensions.lite.lite_socket2 import makeSession, \ makeEphemeralSession, createEphemeralKeypair from dust.core.dust_packet import IV_SIZE, KEY_SIZE from obfsproxy.crypto.aes import AESCoder from obfsproxy....
bsd-3-clause
1,986,426,773,387,766,000
32.786325
211
0.657222
false
oasiswork/redmine-gitlab-migrator
redmine_gitlab_migrator/tests/fake.py
1
21520
JOHN = { "id": 1, "username": "john_smith", "name": "John Smith", "state": "active", "avatar_url": "http://localhost:3000/uploads/user/avatar/1/cd8.jpeg", } JACK = { "id": 2, "username": "jack_smith", "name": "Jack Smith", "state": "blocked", "avatar_url": "http://gravatar.co...
gpl-3.0
-6,922,241,936,037,922,000
32.78179
92
0.349552
false
Mirantis/pumphouse
pumphouse/tasks/volume.py
1
19332
# Copyright (c) 2014 Mirantis 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, ...
apache-2.0
1,995,769,146,947,880,400
39.957627
79
0.53083
false
python-hyper/h11
h11/_receivebuffer.py
1
5029
import re import sys __all__ = ["ReceiveBuffer"] # Operations we want to support: # - find next \r\n or \r\n\r\n (\n or \n\n are also acceptable), # or wait until there is one # - read at-most-N bytes # Goals: # - on average, do this fast # - worst case, do this in O(n) where n is the number of bytes processed # P...
mit
-4,813,296,127,556,579,000
32.085526
82
0.625373
false
bretttegart/treadmill
lib/python/treadmill/cli/allocation.py
1
12254
"""Manage Treadmill allocations. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import logging import click import six from treadmill import admin from treadmill import cli from treadmill import context from tr...
apache-2.0
3,437,529,103,501,396,500
35.909639
79
0.571324
false
openstack/octavia
octavia/tests/unit/controller/worker/v1/flows/test_listener_flows.py
1
3624
# Copyright 2015 Hewlett-Packard Development Company, L.P. # # 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...
apache-2.0
6,545,145,231,941,151,000
38.824176
76
0.730408
false
ctu-geoforall-lab/qgis-map-coords-plugin
test/test_map_corners_coordinates_dialog.py
1
1185
# coding=utf-8 """DockWidget test. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. """ __author__ = ...
gpl-3.0
610,606,995,660,806,000
25.333333
78
0.693671
false
FabriceSalvaire/Musica
Musica/Audio/AudioFormat.py
1
5905
#################################################################################################### # # Musica - A Music Theory Package for Python # Copyright (C) 2017 Fabrice Salvaire # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as pub...
gpl-3.0
-1,246,414,079,907,805,000
30.409574
100
0.48569
false
ntruessel/qcgc
test/test_object.py
1
1283
from support import lib,ffi from qcgc_test import QCGCTest import unittest class ObjectTestCase(QCGCTest): def test_write_barrier(self): o = self.allocate(16) self.push_root(o) arena = lib.qcgc_arena_addr(ffi.cast("cell_t *", o)) o.hdr.flags = o.hdr.flags & ~lib.QCGC_GRAY_FLAG ...
mit
6,391,577,869,932,116,000
43.241379
98
0.617303
false
InsightSoftwareConsortium/ITKTextureFeatures
setup.py
1
2155
from __future__ import print_function from os import sys, path try: from skbuild import setup except ImportError: print('scikit-build is required to build from source.', file=sys.stderr) print('Please run:', file=sys.stderr) print('', file=sys.stderr) print(' python -m pip install scikit-build') ...
apache-2.0
-3,684,967,971,074,094,600
39.660377
89
0.630626
false
cfournie/important
tests/important/test_main.py
1
18388
# Copyright (c) 2016-2017 Chris Fournier. All rights reserved. # Use of this source code is governed by a MIT-style license that can be found # in the LICENSE file. import codecs import important.__main__ import os import pytest import re import socket import tempfile from configparser import ConfigParser from click.t...
mit
-4,709,496,163,778,642,000
33.434457
79
0.586687
false
nikcub/Sketch
sketch/security.py
1
3916
# -*- coding: utf-8 -*- """ werkzeug.security ~~~~~~~~~~~~~~~~~ Security related helpers such as secure password hashing tools. :copyright: (c) 2010 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import hmac import string fr...
bsd-2-clause
2,387,173,661,759,478,300
36.653846
82
0.600102
false
jackchi/interview-prep
heap/merge_k_sorted_lists.py
1
1093
# Definition for singly-linked list. class ListNode: def __init__(self, x): self.val = x self.next = None # Using heapq.heappush(), heappop(). class MyListNode: def __init__(self, node): self.node = node self.val = node.val self.next = node.next def __lt__...
mit
5,077,036,129,893,837,000
25.658537
82
0.52333
false
gjcarneiro/pybindgen
pybindgen/cppmethod.py
1
50491
""" Wrap C++ class methods and constructods. """ import warnings import traceback from copy import copy from pybindgen.typehandlers.base import ForwardWrapperBase, ReverseWrapperBase, \ join_ctype_and_name, CodeGenerationError from pybindgen.typehandlers.base import ReturnValue, Parameter from pybindgen.typehandl...
lgpl-2.1
5,605,360,505,516,741,000
41.075833
132
0.590977
false
LotosikRa/Flask-User
flask_user/views.py
1
28699
""" This file contains view functions for Flask-User forms. :copyright: (c) 2013 by Ling Thio :author: Ling Thio (ling.thio@gmail.com) :license: Simplified BSD License, see LICENSE.txt for more details.""" from datetime import datetime from flask import current_app, flash, redirect, request, url_for from ...
bsd-2-clause
2,104,407,580,183,631,600
37.782432
204
0.638977
false
ioverfl0w/mate
lib/Client.py
1
3545
from enum import Enum import ssl import socket import traceback class Client: # Client # # This is the backbone to each client, providing an interface for # communications. Connection info is kept here. def __init__(self, engine, profile): self.engine = engine self.profile = profi...
gpl-3.0
-1,066,069,108,500,124,900
30.936937
106
0.576869
false
codocedo/fca
examples/algorithms_canonicalbase/ex15_duquenneguigues_enhanced.py
1
1971
""" FCA - Python libraries to support FCA tasks Copyright (C) 2017 Victor Codocedo 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 vers...
gpl-3.0
-3,051,173,548,028,785,700
34.836364
129
0.70624
false
buttinsky/buttinsky
modules/reporting/hpfeeds_logger.py
1
1076
import hpfeeds from configobj import ConfigObj from base_logger import BaseLogger class HPFeedsLogger(BaseLogger): def __init__(self): self.buttinsky_config = ConfigObj("conf/buttinsky.cfg") if self.buttinsky_config["hpfeeds"]["enabled"] == "False": self.options = {'enabled': 'False...
gpl-3.0
-6,975,376,877,467,801,000
31.606061
81
0.546468
false
croscon/fleaker
fleaker/_compat.py
1
1944
# ~*~ coding: utf-8 ~*~ """ fleaker._compat ~~~~~~~~~~~~~~~ A small series of compatibility functions and wrappers for internal use, so we aren't tied to any particular compat library. :copyright: (c) 2016 by Croscon Consulting, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import sy...
bsd-3-clause
-536,280,329,635,828,030
31.949153
112
0.653292
false
ndp-systemes/odoo-addons
odoo_s3/models/res_config.py
1
4360
# -*- coding: utf8 -*- # # Copyright (C) 2020 NDP Systèmes (<http://www.ndp-systemes.fr>). # # 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 # Licen...
agpl-3.0
-3,236,531,748,106,679,300
35.940678
113
0.607708
false
sysadminmatmoz/odoo7_pmis
crm_project_task/__openerp__.py
1
1892
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (c) 2013 Matmoz d.o.o. (info at matmoz.si) # All Rights Reserved. # # WARNING: This program as such is intended to be used by professional # programmers who take the whole resp...
agpl-3.0
6,299,233,562,790,521,000
45.146341
106
0.627378
false
rwightman/pytorch-image-models
timm/data/dataset_factory.py
1
1161
import os from .dataset import IterableImageDataset, ImageDataset def _search_split(root, split): # look for sub-folder with name of split in root and use that if it exists split_name = split.split('[')[0] try_root = os.path.join(root, split_name) if os.path.exists(try_root): return try_root ...
apache-2.0
-6,119,592,489,921,484,000
37.7
116
0.658915
false
flyingSprite/spinelle
spinelle/items.py
1
2199
# -*- coding: utf-8 -*- """Scrapy Item Classes.""" # Define here the models for your scraped items # # See documentation in: # http://doc.scrapy.org/en/latest/topics/items.html import scrapy from conf.settings import MISSION_MESSAGE class SpinelleItem(scrapy.Item): """Class SpinelleItem start.""" # define ...
mit
2,872,879,574,652,138,500
22.645161
51
0.594361
false
mrachinskiy/blender-addon-jewelcraft
var.py
1
5878
# ##### BEGIN GPL LICENSE BLOCK ##### # # JewelCraft jewelry design toolkit for Blender. # Copyright (C) 2015-2019 Mikhail Rachinskiy # # 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, eith...
mit
-2,959,003,655,584,730,000
31.819209
86
0.559649
false
100grams/flask-security
flask_security/registerable.py
1
1322
# -*- coding: utf-8 -*- """ flask.ext.security.registerable ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Flask-Security registerable module :copyright: (c) 2012 by Matt Wright. :license: MIT, see LICENSE for more details. """ from flask import current_app as app from werkzeug.local import LocalProxy from .co...
mit
-3,752,129,269,934,212,000
29.744186
80
0.677005
false
10clouds/edx-platform
lms/djangoapps/certificates/apis/v0/tests/test_views.py
1
4367
""" Tests for the Certificate REST APIs. """ from django.core.urlresolvers import reverse from rest_framework import status from rest_framework.test import APITestCase from certificates.models import CertificateStatuses from certificates.tests.factories import GeneratedCertificateFactory from course_modes.models impor...
agpl-3.0
6,934,313,275,434,016,000
36.646552
92
0.63728
false
molpopgen/fwdpy11
fwdpy11/tskit_tools/_dump_tables_to_tskit.py
1
8513
# # Copyright (C) 2017 Kevin Thornton <krthornt@uci.edu> # # This file is part of fwdpy11. # # fwdpy11 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,379,776,156,415,916,500
33.326613
87
0.640667
false
luiscberrocal/django-acp-calendar
acp_calendar/api/views.py
1
2419
from rest_framework import views from rest_framework.generics import ListAPIView from rest_framework.response import Response from .serializers import ACPHolidaySerializer, StandardResultsSetPagination from ..models import ACPHoliday, ACPCalendarException class ACPHolidayListAPIView(ListAPIView): # queryset = AC...
bsd-3-clause
-4,229,287,150,021,772,300
32.136986
95
0.582885
false
morucci/repoxplorer
repoxplorer/controllers/metadata.py
1
1669
# Copyright 2017, Fabien Boucher # Copyright 2017, Red Hat # # 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 appli...
apache-2.0
9,083,070,565,232,355,000
34.510638
75
0.680048
false
blindmancs/overwatch-sound-export
wem-extract.py
1
2269
import os, subprocess, shutil, hashlib, csv, pprint, sys, json print "Overwatch wem extractor v0.2" # get config with open('config.json') as data_file: config = json.load(data_file) counter = 1 unknown = 0 # get hash storage hashStorage = dict([]) with open(config["paths"]["important"], 'r') as csvfile: hashreader =...
mit
771,568,709,034,336,400
38.12069
173
0.639048
false
lythien/pokemongo
pokemongo_bot/cell_workers/telegram_task.py
1
5098
# -*- coding: utf-8 -*- import telegram import os import logging import json from pokemongo_bot.base_task import BaseTask from pokemongo_bot.base_dir import _base_dir from pokemongo_bot.event_handlers import TelegramHandler from pprint import pprint import re class TelegramTask(BaseTask): SUPPORTED_TASK_API_VERSI...
mit
-8,862,224,719,461,403,000
51.020408
182
0.52805
false
google/edward2
edward2/tensorflow/generated_random_variables.py
1
3046
# coding=utf-8 # Copyright 2021 The Edward2 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 o...
apache-2.0
7,178,639,709,417,940,000
32.108696
87
0.671044
false
joeryan/pytest-practice
test_wallet.py
1
1160
# test_wallet.py import pytest from wallet import Wallet, InsufficientAmount, NegativeTransaction @pytest.fixture def empty_wallet(): '''Returns a wallet with balance = 0 ''' return Wallet() @pytest.fixture def wallet(): '''Returns a wallet with balance = 20 ''' return Wallet(20) def test_default_initia...
mit
7,643,415,817,432,646,000
23.166667
75
0.728448
false
twhyntie/tasl-data-management
ann_to_ori.py
1
4195
#!/usr/bin/env python # -*- coding: utf-8 -*- """ MoEDAL and CERN@school - ANN -> ORI. See the README.md file and the GitHub wiki for more information. http://cernatschool.web.cern.ch """ # Import the code needed to manage files. import os, glob #...for parsing the arguments. import argparse #...for the logg...
mit
-1,542,262,857,198,386,200
31.022901
133
0.545411
false
mhcrnl/PmwTkEx
java2s/bestway.py
1
1580
import Tkinter as tk from alarm import Alarm class Demo1: def __init__(self, master): self.master= master self.frame= tk.Frame(self.master) self.button1=tk.Button(self.frame, text="new WIndow", width=25, command=self.new_window) self.button1.pack() ...
apache-2.0
6,828,671,468,090,991,000
27.214286
71
0.558861
false
SIDDHARTH-SRIVASTAVA/cookiecutter_demo
config/urls.py
1
1239
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.conf.urls import include, url from django.conf.urls.static import static from django.contrib import admin from django.views.generic import TemplateView urlpatterns = [ url(r'^$', TemplateView.as_view(templ...
bsd-3-clause
3,073,614,984,067,249,700
35.441176
91
0.682809
false
PaddlePaddle/models
dygraph/ocr_recognition/eval.py
1
3727
# Copyright (c) 2018 PaddlePaddle 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 appli...
apache-2.0
-3,910,822,482,956,702,700
35.910891
115
0.634022
false
withtone/depot_tools
testing_support/coverage_utils.py
1
2321
# Copyright 2013 The Chromium 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 distutils.version import os import sys import textwrap import unittest ROOT_PATH = os.path.abspath(os.path.join( os.path.dirname(os.path.dirname(...
bsd-3-clause
3,896,842,965,212,962,300
32.157143
79
0.67514
false
simpleai-team/simpleai
simpleai/environments.py
1
1821
# -*- coding: utf-8 -*- class Environment(object): def __init__(self, agents, initial_state): self.agents = agents self.initial_state = initial_state self.state = initial_state def run(self, steps=10000, viewer=None): self.state = self.initial_state for step in range(...
mit
-2,535,582,616,593,432,000
32.109091
105
0.607908
false
oxc/Flexget
flexget/api/__init__.py
1
10797
from __future__ import unicode_literals, division, absolute_import from builtins import * # pylint: disable=unused-import, redefined-builtin import json import logging import os import pkgutil from collections import deque from functools import wraps from flask import Flask, request from flask_cors import CORS from ...
mit
7,584,931,719,360,193,000
30.570175
120
0.598685
false
landryb/psutil
psutil/_pslinux.py
1
40764
#!/usr/bin/env python # Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Linux platform implementation.""" from __future__ import division import base64 import errno import functools import os import ...
bsd-3-clause
-3,912,702,703,387,849,000
36.058182
79
0.513002
false
igemsoftware2017/USTC-Software-2017
biohub/forum/urls.py
1
1047
from django.conf.urls import url # noqa from biohub.core.routes import register_api from rest_framework.routers import DefaultRouter from biohub.forum.views import PostViewSet, ArticleViewSet,\ ExperienceViewSet, ActivityViewSet, UserExperienceViewSet from biohub.biobrick.views import BiobrickViewSet, UserBrickVi...
gpl-3.0
-6,952,451,560,745,784,000
42.625
91
0.797517
false
andrew-lundgren/gwpy
gwpy/plotter/gps.py
1
12444
# -*- coding: utf-8 -*- # Copyright (C) Duncan Macleod (2013) # # This file is part of GWpy. # # GWpy 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
-3,410,339,135,117,639,700
32.184
78
0.560029
false
rafaqz/citation.vim
python/citation_vim/citation.py
1
1050
# -*- coding: utf-8 -*- import os.path import sys import vim class Citation(object): @staticmethod def connect(): """ Returns source from builder, printing any errors from python to the vim console. wrapping everything in "try: except:" is bad practise generally, bu...
mit
-8,070,158,736,649,339,000
28.166667
76
0.631429
false
nachocano/asml
src/asml/stream/file.py
1
1246
import gzip import itertools from asml.network.registry import RegistryClient from asml.network.stream import StreamClient from asml.autogen.services.ttypes import ComponentType from asml.parser.factory import ParserFactory class FileStream: def __init__(self, module_properties): self._path = module_properties['...
bsd-2-clause
595,372,818,678,393,700
34.628571
84
0.707865
false
bgris/ODL_bgris
odl/set/sets.py
1
18340
# Copyright 2014-2016 The ODL development group # # This file is part of ODL. # # ODL 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. ...
gpl-3.0
4,197,167,307,302,358,000
27.969984
77
0.551641
false
Gentux/imap-cli
imap_cli/list_mail.py
1
3247
# -*- coding: utf-8 -*- """Functions returning an IMAP account state Usage: imap-cli-list [options] [<directory>] Options: -c, --config-file=<FILE> Configuration file (`~/.config/imap-cli` by default) -f, --format=<FMT> Output format -l, --limit=<limit> ...
mit
-8,579,020,054,911,035,000
31.148515
76
0.54789
false
shengqh/ngsperl
lib/SmallRNA/shortReadSource.py
1
7216
import argparse import sys import logging import os import csv class ReadItem: def __init__(self, sequence): self.Sequence = sequence self.TotalCount = 0 self.SampleMap = {} class AnnotationItem: def __init__(self, sequence, category): self.Sequence = sequence self.TotalCount = 0 self.Cate...
apache-2.0
-32,105,371,650,366,696
40.953488
231
0.643847
false
davikrehalt/WGAN-mod
LGNN.py
1
7206
from __future__ import print_function,division import numpy as np import six.moves.cPickle as pickle import theano import theano.tensor as T from theano.tensor.nnet import conv2d from ops import tmax,tmin,tbox from optimize import rmsprop,sgd from theano.tensor.shared_randomstreams import RandomStreams from lmlp import...
mit
-3,272,632,604,160,528,000
33.811594
104
0.524008
false
fuxprojesi/scom
api/scom/__init__.py
1
8876
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # # Copyright (C) 2006-2009, 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 2 of the License, or (at your # option) ...
gpl-3.0
5,917,463,265,078,946,000
42.087379
209
0.554304
false
suizokukan/anceps
dchars/documentation/Sphinx/cauldron/conf.py
1
8175
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Sphinx documentation build configuration file, created by # sphinx-quickstart on Wed Mar 7 16:29:12 2012. # # 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 # autog...
gpl-3.0
-7,892,574,046,738,405,000
31.569721
83
0.700673
false
Nexedi/neoppod
neo/tests/stat_zodb.py
1
5924
#!/usr/bin/env python # -*- coding: utf-8 -*- import math, random, sys from cStringIO import StringIO from ZODB.utils import p64, u64 from ZODB.BaseStorage import TransactionRecord from ZODB.FileStorage import FileStorage # Stats of a 43.5 GB production Data.fs # µ σ # size of ob...
gpl-2.0
4,795,595,070,822,774,000
36
74
0.499493
false
dmccloskey/SBaaS_resequencing
SBaaS_resequencing/stage01_resequencing_coverage_postgresql_models.py
1
22272
from SBaaS_base.postgresql_orm_base import * class data_stage01_resequencing_coverage(Base): __tablename__ = 'data_stage01_resequencing_coverage' id = Column(Integer, Sequence('data_stage01_resequencing_coverage_id_seq'), primary_key=True) #analysis_id = Column(String(500)) experiment_id = Column(...
mit
4,372,799,767,990,308,000
38.844365
150
0.592807
false
Litterman/EZClimate
ezclimate/storage_tree.py
1
14568
import numpy as np from abc import ABCMeta, abstractmethod class BaseStorageTree(object, metaclass=ABCMeta): """Abstract storage class for the EZ-Climate model. Parameters ---------- decision_times : ndarray or list array of years from start where decisions about mitigation levels are done ...
mit
-5,740,833,807,873,182,000
31.017582
106
0.531439
false
Radmor/med_search
src/auth_ex/models.py
1
3347
from django.db import models from django.contrib.auth.models import (AbstractBaseUser, BaseUserManager, PermissionsMixin) from django.utils import timezone from django.utils.translation import ugettext_lazy as _ from django.core.mail import send_mail class UserManager(B...
mit
8,102,120,660,992,061,000
32.153061
78
0.591276
false
F5Networks/f5-openstack-agent
f5_openstack_agent/lbaasv2/drivers/bigip/test/test_listener_services.py
1
26417
#!/usr/bin/env python # Copyright (c) 2017,2018, F5 Networks, 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 app...
apache-2.0
5,955,353,809,390,750,000
41.402889
79
0.596207
false
MatthewShao/mitmproxy
mitmproxy/flow.py
1
4943
import time import typing # noqa import uuid from mitmproxy import connections from mitmproxy import controller, exceptions # noqa from mitmproxy import stateobject from mitmproxy import version class Error(stateobject.StateObject): """ An Error. This is distinct from an protocol error respon...
mit
-712,453,570,105,986,000
26.159341
88
0.566053
false
makinacorpus/django
tests/urlpatterns_reverse/tests.py
1
33866
""" Unit tests for reverse URL lookups. """ from __future__ import absolute_import, unicode_literals import unittest from django.conf import settings from django.contrib.auth.models import User from django.core.exceptions import ImproperlyConfigured, ViewDoesNotExist from django.core.urlresolvers import (reverse, res...
bsd-3-clause
704,285,376,750,728,800
51.424149
187
0.622867
false
afiodorov/openrent
get_properties.py
1
5049
#!/usr/bin/python3 import argparse import urllib.request import json from bs4 import BeautifulSoup from urllib.parse import urlencode from collections import OrderedDict from get_url import parse_property_page, property_filepath from slackclient import SlackClient import os with open(os.path.join(os.path.dirname(os.p...
mit
7,630,087,364,108,958,000
30.360248
79
0.582492
false
buddyli/android_intership
controller/order_oper.py
1
1980
#!/usr/bin/env python #-*- encoding:utf-8 -*- from bottle import route, mako_template as template, redirect, request, response, get, post from bottle import static_file, view #为了不经过controller直接返回诸如html,css等静态文件引入 from model.documents import * from setting import * DATE_FORMAT = '%Y-%m-%d %H:%M:%S' # 入库格式化时间 @post('/...
apache-2.0
-9,172,087,376,719,491,000
27.313433
91
0.699895
false
paramsingh/listenbrainz-server
listenbrainz/webserver/views/api_tools.py
1
14036
import listenbrainz.webserver.rabbitmq_connection as rabbitmq_connection import listenbrainz.webserver.redis_connection as redis_connection import pika import pika.exceptions import sys import time import ujson import uuid from flask import current_app from listenbrainz.listen import Listen from listenbrainz.webserver...
gpl-2.0
3,013,694,120,402,643,000
39.449568
123
0.632801
false
silentsee/blog
www/sae/taskqueue.py
1
5945
#!/usr/bin/env python # -*-coding: utf8 -*- """Task Queue API TaskQueue is a distributed task queue service provided by SAE for developers as a simple way to execute asynchronous user tasks. Example: 1. Add a GET task. from sae.taskqueue import Task, TaskQueue queue = TaskQueue('queue_name') queue....
gpl-2.0
-2,218,251,079,284,938,000
28.285714
80
0.585198
false
veltri/DLV2
tests/parser/blocksworld-leone.test.py
1
6083
input = """ % invocation: % dlv <name of this file> <problem instance> -silent -N=k -pfilter=move % % where % <problem instance> is the file which contains the specification of the % planning problem (i.e. initial state and goal state) % -silent suppresses various version informat...
apache-2.0
1,593,773,574,213,591,600
27.548544
75
0.620582
false
sergey-dryabzhinsky/dedupsqlfs
dedupsqlfs/db/mysql/table/tmp_id_count.py
1
1793
# -*- coding: utf8 -*- __author__ = 'sergey' from dedupsqlfs.db.mysql.table import Table class TableTmpIdCount( Table ): _engine = "MEMORY" _table_name = "tmp_id_count" def create( self ): c = self.getCursor() # Create table c.execute( "CREATE TABLE IF NOT EXISTS `...
mit
-1,683,537,798,874,675,700
21.135802
65
0.427775
false
SilverBlogTeam/SilverBlog
upgrade/upgrade_from_3.py
1
2450
if __name__ == '__main__': print("The upgrade script has changed. You need to execute the upgrade command again to update the data structure.") exit(0) import hashlib import hmac import json import tarfile import time import uuid import os from common import file def add_page_id(list_item): list_item["u...
bsd-3-clause
2,824,646,979,222,521,000
34.014286
120
0.630204
false
Azure/azure-sdk-for-python
sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_inbound_nat_rules_operations.py
1
22156
# 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 may ...
mit
2,369,471,168,192,281,000
50.050691
232
0.649982
false
beilunyang/someCrawlers
dmzj_noimages/crawler_scrapy/spiders/new_comic.py
1
2232
# -*- coding: utf-8 -*- import scrapy import json from scrapy.http.request import Request from crawler_scrapy.items import ComicItem, ChapterItem class NewComicSpider(scrapy.Spider): name = "new_comic" allowed_domains = ["v2.api.dmzj.com"] start_urls = ['http://v2.api.dmzj.com/latest/100/%d.json?channel=i...
mit
8,639,724,893,511,159,000
48.488889
252
0.591195
false
zetaops/ulakbus
ulakbus/views/personel/gorevlendirme.py
1
11363
# -*- coding: utf-8 -*- # Copyright (C) 2015 ZetaOps Inc. # # This file is licensed under the GNU General Public License v3 # (GPLv3). See LICENSE.txt for details. # """ Görevlendirme İki tür görevlendirme vardır. - Kurum içi görevlendirme - Kurum dışı görevlendirme Bu iş akışı CrudView nesnesi...
gpl-3.0
-7,893,549,455,030,729,000
37.851724
100
0.602201
false
michael-lazar/rtv
tests/test_page.py
1
4486
# -*- coding: utf-8 -*- from __future__ import unicode_literals import curses import pytest from rtv.page import Page, PageController, logged_in try: from unittest import mock except ImportError: import mock def test_page_logged_in(terminal): page = mock.MagicMock() page.term = terminal @log...
mit
-6,188,440,139,794,180,000
30.152778
76
0.622381
false
liZe/Mailanie
mailanie/folder.py
1
3506
# Mailanie - Cute Mailbox Explorator # Copyright 2009 Guillaume Ayoub <guillaume.ayoub@kozea.fr> # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation # Mailanie is distributed in the hope ...
gpl-3.0
5,270,585,255,919,672,000
31.766355
83
0.60097
false
flywalk/arcoin-abe
tools/namecoin_dump.py
2
5192
#!/usr/bin/env python # Dump the Namecoin name data to standard output. # Copyright(C) 2011 by John Tobey <John.Tobey@gmail.com> # 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 v...
agpl-3.0
-8,135,155,456,383,940,000
34.806897
79
0.576656
false
cocrawler/cocrawler
tests/warc/test-warc.py
1
2012
import hashlib import socket import unittest.mock as mock from cocrawler.warc import CCWARCWriter from cocrawler.urls import URL serials = {} def get_serial(name): serial = serials.get(name, 0) + 1 serials[name] = serial return '{:05}'.format(serial) prefix = 'CC-TEST-01' subprefix = 'FOO' max_size = ...
apache-2.0
7,130,431,656,061,292,000
33.689655
106
0.66004
false
guoxu3/oms_backend
oms/handlers/check/check_user_input.py
1
1202
#!/usr/bin/env python # -*- coding:utf-8 -*- from lib import verify def check_user_input(user_dict): """ check user input info format @parm user_dict: Dictionary, an user info dictionary @return ok: Boolean , info check pass or not @return info: String, message return to user ...
mit
2,033,750,513,010,724,600
28.317073
87
0.600666
false
bolkedebruin/airflow
airflow/contrib/hooks/gcp_transfer_hook.py
1
1810
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
apache-2.0
5,510,072,899,475,796,000
36.708333
108
0.728729
false
jourzero/AdvisoryEmail
vulnerabilities.py
1
18983
#!/usr/bin/python #-------------------------------------------------------------------------------------------------- # vulnerabilities.py: Python module used by CveAdvisory.py #-------------------------------------------------------------------------------------------------- #import sqlite3 as lite #from vfeed import ...
mit
-6,675,970,663,002,118,000
37.661914
798
0.597166
false
cjerdonek/open-rcv
openrcv/scripts/run.py
1
7805
# # Copyright (c) 2014 Chris Jerdonek. All rights reserved. # # 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, modi...
mit
8,046,200,062,402,807,000
33.535398
89
0.650096
false
Azure/azure-sdk-for-python
sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_vpn_gateways_operations.py
1
32616
# 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 may ...
mit
4,182,380,463,459,013,600
47.608048
188
0.63429
false
kata198/indexedredis
IndexedRedis/fields/compressed.py
1
6418
# Copyright (c) 2014, 2015, 2016, 2017 Timothy Savannah under LGPL version 2.1. See LICENSE for more information. # # fields.compressed - Some types and objects related to compressed fields. Use in place of IRField ( in FIELDS array to activate functionality ) # # vim: set ts=8 shiftwidth=8 softtabstop=8 noexpandtab ...
lgpl-2.1
-1,738,514,993,853,213,700
34.458564
387
0.718916
false
pjuu/pjuu
scripts/key_migrate_04_to_05.py
1
5466
# -*- coding: utf8 -*- """Migrate the Redis key names from version before and including 0.4 to the new naming conversion used by 0.5. The only changes are that keys related are key spaced using Redis hashtags. For example; user:1 would become {user:1} user:1:followers would become {user:1}:followers post...
agpl-3.0
4,722,508,495,406,022,000
35.198675
79
0.43981
false
rubenvillegas/iclr2017mcnet
src/BasicConvLSTMCell.py
1
4385
""" Convolutional LSTM cell implementation from https://github.com/loliverhennigh """ import tensorflow as tf class BasicConvLSTMCell(object): """Basic Conv LSTM recurrent network cell. """ def __init__(self, shape, filter_size, num_features, forget_bias=1.0, input_size=None, state_is_tuple=False...
mit
6,455,835,358,366,756,000
37.80531
80
0.630331
false
deliarusu/text-annotation
annotation/annotate.py
1
2700
import numpy as np MEDIAN = 'median' AVERAGE = 'average' def annotate_token(current_token_id, window_tokens, \ token_concepts, relatedness, rel_concepts): ''' Annotate the tokens in a given token window. :param current_token_id: token to be annotated :param window_tok...
apache-2.0
4,469,924,775,189,018,600
29.693182
76
0.542593
false
tcezard/RADmapper
lib/utils/utils_commands.py
1
6623
''' Created on 8 Apr 2010 @author: tcezard ''' from threading import Thread import logging from subprocess import Popen, PIPE import os ################################### # Command utilities # ################################### class Output_Logger(Thread): """Close the stdin and log the s...
mit
-2,029,656,377,923,653,000
32.12
130
0.608939
false
eoinof/stem
test/unit/version.py
1
9756
""" Unit tests for the stem.version.Version parsing and class. """ import unittest import stem.version from stem.version import Version import stem.util.system import test.mocking as mocking TOR_VERSION_OUTPUT = """Mar 22 23:09:37.088 [notice] Tor v0.2.2.35 \ (git-73ff13ab3cc9570d). This is experimental software. Do...
lgpl-3.0
4,414,252,045,822,614,000
36.667954
94
0.674047
false
vectorijk/servo
components/script/dom/bindings/codegen/CodegenRust.py
1
230667
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # Common codegen classes. import operator import re import string import textwrap import functools from WebIDL import ...
mpl-2.0
-6,487,346,425,059,309,000
37.748026
117
0.571018
false