max_stars_repo_path
stringlengths
3
269
max_stars_repo_name
stringlengths
4
119
max_stars_count
int64
0
191k
id
stringlengths
1
7
content
stringlengths
6
1.05M
score
float64
0.23
5.13
int_score
int64
0
5
pointcloud2raster/__version__.py
NorthArrowResearch/pointcloud2raster
0
13900
<gh_stars>0 __version__="0.3"
1.0625
1
api/views.py
oil-rope/oil-and-rope
8
13901
from django.http import JsonResponse from django.shortcuts import reverse from django.urls import NoReverseMatch from django.views import View from rest_framework import __version__ as drf_version from rest_framework.exceptions import ValidationError from rest_framework.permissions import AllowAny from rest_framework.r...
2.078125
2
5_AIOps/Mlflow.py
stormsinbrewing/Covid-19-Predictor
3
13902
<reponame>stormsinbrewing/Covid-19-Predictor from verta import Client import pickle import mlflow import mlflow.sklearn from mlflow.tracking import MlflowClient import os def downloadArtifact(proj,exp_name,exp_run, serialization): client = Client("http://localhost:3000") proj = client.set_project(proj) exp...
2.28125
2
src/arclink/apps/misc/dump_db.py
yannikbehr/seiscomp3
94
13903
<filename>src/arclink/apps/misc/dump_db.py #!/usr/bin/env python #***************************************************************************** # dump_db.py # # Dump inventory database in XML format # # (c) 2006 <NAME>, GFZ Potsdam # (c) 2007 <NAME>, GFZ Potsdam # # This program is free software; you can redistribute ...
2.1875
2
ypricemagic/magic.py
cartercarlson/ypricemagic
1
13904
<gh_stars>1-10 import logging from typing import Optional from y import magic from y.datatypes import UsdPrice from y.typing import AnyAddressType, Block logger = logging.getLogger(__name__) def get_price(token: AnyAddressType, block: Optional[Block] = None) -> UsdPrice: logger.warn('ypricemagic is in the proce...
2.296875
2
zerver/tests/test_realm_playgrounds.py
moazzammoriani/zulip
3
13905
from zerver.lib.actions import do_add_realm_playground from zerver.lib.test_classes import ZulipTestCase from zerver.models import RealmPlayground, get_realm class RealmPlaygroundTests(ZulipTestCase): def test_create_one_playground_entry(self) -> None: iago = self.example_user("iago") payload = {...
2.15625
2
seisflows/plugins/optimize/NLCG.py
niyiyu2316/seisflows
1
13906
# # This is Seisflows # # See LICENCE file # # ############################################################################### # Import system modules import os # Import Numpy import numpy as np # Local imports from seisflows.tools import unix from seisflows.tools.math import dot from seisflows.tools.tools import lo...
2.125
2
sa/profiles/Cisco/SCOS/profile.py
prorevizor/noc
84
13907
# --------------------------------------------------------------------- # Vendor: Cisco # OS: SCOS # --------------------------------------------------------------------- # Copyright (C) 2007-2012 The NOC Project # See LICENSE for details # --------------------------------------------------------------------- # NO...
2.078125
2
airflow/providers/amazon/aws/example_dags/example_hive_to_dynamodb.py
npodewitz/airflow
8,092
13908
<gh_stars>1000+ # 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"...
1.898438
2
tle_download/__init__.py
cognitive-space/tle-download
0
13909
__version__ = "0.1.0" from tle_download.main import get_tles, write_tles
1.046875
1
bmi203_hw3/methods.py
cjmathy/bmi203_hw3
0
13910
<gh_stars>0 import numpy as np import random def align(pair,sequences,scoring_matrix,penalties,aa_dict): seq1, seq2 = sequences[pair[0]], sequences[pair[1]] #Create matrix F (containing maximum scores up to cell F(i,j)) and tracking matrix P (containing the tracking flag describing whether the step into the cell wa...
2.703125
3
custom_components/netatmo/select.py
mauriziosacca/netatmo_custom
5
13911
<filename>custom_components/netatmo/select.py """Support for the Netatmo climate schedule selector.""" from __future__ import annotations import logging from homeassistant.components.select import SelectEntity from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant, callback ...
2.265625
2
Olympiad Solutions/URI/1943.py
Ashwanigupta9125/code-DS-ALGO
36
13912
<reponame>Ashwanigupta9125/code-DS-ALGO<filename>Olympiad Solutions/URI/1943.py<gh_stars>10-100 # <NAME> # Solution to https://www.urionlinejudge.com.br/judge/problems/view/1943 #!/usr/bin/env python2.7 # encoding : utf-8 e = int(raw_input()) if e == 1: print "Top 1" elif e <= 3: print "Top 3" elif e <= 5: print "To...
3.421875
3
skbot/ignition/sdformat/bindings/v15/physics.py
FirefoxMetzger/ropy
6
13913
from dataclasses import dataclass, field from typing import Optional __NAMESPACE__ = "sdformat/v1.5/physics.xsd" @dataclass class Physics: """ The physics tag specifies the type and properties of the dynamics engine. Parameters ---------- max_step_size: Maximum time step size at which every syst...
2.953125
3
lib/surface/help.py
bshaffer/google-cloud-sdk
0
13914
<gh_stars>0 # -*- coding: utf-8 -*- # # Copyright 2013 Google Inc. 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 # # U...
1.75
2
algocoin/__init__.py
dendisuhubdy/algo-coin
252
13915
<filename>algocoin/__init__.py from .main import main as run # noqa: F401 __version__ = '0.0.3'
1.117188
1
mmrazor/models/architectures/components/backbones/__init__.py
HIT-cwh/mmrazor
553
13916
<gh_stars>100-1000 # Copyright (c) OpenMMLab. All rights reserved. from .darts_backbone import DartsBackbone from .searchable_mobilenet import SearchableMobileNet from .searchable_shufflenet_v2 import SearchableShuffleNetV2 __all__ = ['DartsBackbone', 'SearchableShuffleNetV2', 'SearchableMobileNet']
1.0625
1
tools/ideabuck/scripts/generate_grammar_kit.py
thelvis4/buck
1
13917
#!/usr/bin/env python # Copyright 2018-present Facebook, 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 applica...
1.953125
2
d_parser/d_spider_24int.py
Holovin/D_GrabDemo
0
13918
from lxml import html from d_parser.d_spider_common import DSpiderCommon from d_parser.helpers.re_set import Ree from helpers.url_generator import UrlGenerator from d_parser.helpers.stat_counter import StatCounter as SC VERSION = 29 # Warn: Don't remove task argument even if not use it (it's break grab and spider ...
2.296875
2
agents/displays/mcts_display.py
johink/willsmith
0
13919
<reponame>johink/willsmith from tkinter import Label, GROOVE from willsmith.gui_display_controller import GUIDisplayController class MCTSDisplay(GUIDisplayController): """ The display controller for MCTSAgent. Creates a Tkinter GUI that displays some stats about the agent's latest moves. """ ...
3.015625
3
mrgcn.py
bretthannigan/relational-gcn
0
13920
#!/usr/bin/python3 import logging import argparse from time import time import toml from data.io.knowledge_graph import KnowledgeGraph from data.io.tarball import Tarball from data.io.tsv import TSV from data.utils import is_readable, is_writable from embeddings import graph_structure from tasks.node_classification ...
1.96875
2
core.py
aminPial/Overwatch-Streaming-Automation
1
13921
import argparse, time, os, cv2, shutil, datetime, math, subprocess, pickle, multiprocessing from actn import * ap = argparse.ArgumentParser() # for help -> python alpha.py --help ap.add_argument("-f", "--file", required=True, help="name of the file") ap.add_argument("-o", "--output", required=True, ...
2.859375
3
reports/ipam-reports/ip-primary-missing.py
ryanmerolle/reports
0
13922
from dcim.choices import DeviceStatusChoices from dcim.models import Device from extras.reports import Report class DeviceIPReport(Report): description = ( "Check that every device has either an IPv4 or IPv6 primary address assigned" ) def test_primary_ip4(self): for device in Device.obje...
2.453125
2
runtime/bots/irc/main.py
AKhilRaghav0/dovenetwork
0
13923
import socket import random import os import requests import re import github import minecraft import string import sys HOST = "xeroxirc.net" PORT = 6667 NICK = "ak_sus" #PASSWORD = os.getenv("PASSWORD") CHANNEL = "#BlockySurvival" SERVER = "" readbuffer = "" def send(message): s.send(message) print(message) s ...
2.84375
3
evaluate.py
PhilippMarquardt/Amazing-Semantic-Segmentation
0
13924
""" The file defines the evaluate process on target dataset. @Author: <NAME> @Github: https://github.com/luyanger1799 @Project: https://github.com/luyanger1799/amazing-semantic-segmentation """ from sklearn.metrics import multilabel_confusion_matrix from amazingutils.helpers import * from amazingutils.utils import lo...
2.96875
3
examples/pso_trail/demo_gpso.py
gmjustforfun/code
0
13925
from pso.GPSO import GPSO import numpy as np import time import pandas as pd np.random.seed(42) # f1 完成 def Sphere(p): # Sphere函数 out_put = 0 for i in p: out_put += i ** 2 return out_put # f2 完成 def Sch222(x): out_put = 0 out_put01 = 1 for i in x: out_put += abs(i) ...
2.359375
2
setup.py
Juniper/contrail-server-manager
12
13926
<filename>setup.py<gh_stars>10-100 # # Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # from setuptools import setup import setuptools setup( name='contrail-server-manager', version='0.1dev', packages=setuptools.find_packages(exclude=["*.pyc"]), zip_safe=False, long_description="Se...
1.101563
1
Modules/Loadable/Markups/Testing/Python/MarkupsSceneViewRestoreTestManyLists.py
TheInterventionCentre/NorMIT-Plan-App
0
13927
# Test restoring a scene with multiple lists with different number # of fiducials # first fiducial list displayNode1 = slicer.vtkMRMLMarkupsDisplayNode() slicer.mrmlScene.AddNode(displayNode1) fidNode1 = slicer.vtkMRMLMarkupsFiducialNode() fidNode1.SetName("FidNode1") slicer.mrmlScene.AddNode(fidNode1) fidNode1.Set...
2.25
2
segmentfault/apps/msg/consumer.py
Yookyiss/segmentfault
0
13928
# -*- coding:utf-8 -*- # @Time : 2019/7/21 12:35 PM # @Author : __wutonghe__ # docs https://channels.readthedocs.io/en/latest/tutorial/part_3.html#rewrite-the-consumer-to-be-asynchronous from channels.generic.websocket import AsyncWebsocketConsumer import json class MessageConsumer(AsyncWebsocketConsumer): "...
2.796875
3
tests/utils/test_interpolator.py
JelleAalbers/hypney
0
13929
<gh_stars>0 import eagerpy as ep import numpy as np from scipy.interpolate import RegularGridInterpolator import hypney tl = ep.numpy def test_regular_grid_interpolator(): """Adapted from https://github.com/sbarratt/torch_interpolations/blob/master/tests/test_grid_interpolator.py """ points = [tl.ar...
2.046875
2
python/database.py
bvmeggelen/routino
1
13930
<filename>python/database.py #!/usr/bin/python3 ########################################## # Routino database access from Python. # # Part of the Routino routing software. ########################################## # This file Copyright 2018 <NAME> # # This program is free software: you can redistribute it and/or modif...
2.40625
2
vcsver/tests/test_util.py
janneronkko/vcsver
1
13931
import io from .. import util def test_parsing_pkg_info_file(mocker): open_mock = mocker.patch('vcsver.util.open') open_mock.return_value = io.StringIO( 'Name: name\n' 'Version: 1.0\n' ) pkg_info_data = util.parse_pkg_info_file(mocker.sentinel.path) open_mock = open_mock.assert_...
2.421875
2
matrixFuncs/determinant.py
AmaarMarfatia/MatrixFunctions
0
13932
<filename>matrixFuncs/determinant.py def determinant(matA): dimA = [] # find dimensions of arrA a = matA while type(a) == list: dimA.append(len(a)) a = a[0] #is it square if dimA[0] != dimA[1]: raise Exception("Matrix is not square") #find determinant total = 0 ...
3.765625
4
priv/flatex/flatex.py
w495/survey-cbvr
1
13933
#!/usr/bin/env python # This "flattens" a LaTeX document by replacing all # \input{X} lines w/ the text actually contained in X. See # associated README.md for details. # Use as a python module in a python script by saying import flatex then flatex.main(in file, out file) import os import re import sys de...
3.171875
3
sigal/plugins/encrypt/__init__.py
fidergo-stephane-gourichon/sigal
0
13934
from .encrypt import register
1.070313
1
pull_1m/pull_v2.py
tlh45342/polygon-pull
0
13935
<reponame>tlh45342/polygon-pull import datetime import os import pandas from polygon.rest.client import RESTClient def ts_to_datetime(ts) -> str: return datetime.datetime.fromtimestamp(ts / 1000.0).strftime('%Y-%m-%d %H:%M') def pull_day(Symbol, from_): POLYGON_API_KEY = os.environ.get('POLYGON_A...
2.703125
3
pwython/__main__.py
Adwaith-Rajesh/Pwython
0
13936
from random import choice, randint from re import sub, split, findall from string import ascii_letters from subprocess import PIPE, Popen from sys import argv, executable, stderr from .responses import pronouns, reactions, remarks def owoify(text): if type(text) == bytes: text = str(text)[2:-1].replace("...
2.890625
3
botnet/fabfile.py
MrScytheLULZ/Simple-python-cnc
23
13937
import os from fabric.api import env, run, sudo, execute, local, settings, \ hide, open_shell, parallel, serial, put from fabric.decorators import hosts from fabric.contrib.console import confirm import fabric.colors as fab_col import paramiko import getpass from tabulate import tabulate file_hosts = "hosts.txt" ...
2.859375
3
shared.py
gattis/magnum-py
0
13938
<filename>shared.py objects = {} def instantiate(): # This function is called once during server startup. Modify the global 'objects' dict with of instantiated # shared objects that you wish to store in the parent process and have access to from child request handler # processes. Each object must supp...
3.09375
3
appengine/cr-buildbucket/legacy/api_common.py
xinghun61/infra
2
13939
<filename>appengine/cr-buildbucket/legacy/api_common.py # Copyright 2017 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 json from google.appengine.ext import ndb from google.protobuf import json_format from google...
2.046875
2
src/probnum/random_variables/__init__.py
admdev8/probnum
0
13940
""" This package implements random variables. Random variables are the primary in- and outputs of probabilistic numerical methods. A generic signature of such methods looks like this: .. highlight:: python .. code-block:: python randvar_out, info = probnum_method(problem, randvar_in, **kwargs) """ from ._dirac ...
2.859375
3
test/acceptance/features/steps/generic_testapp.py
multi-arch/service-binding-operator
0
13941
from app import App import requests import json import polling2 from behave import step from openshift import Openshift from util import substitute_scenario_id from string import Template class GenericTestApp(App): deployment_name_pattern = "{name}" def __init__(self, name, namespace, app_image="ghcr.io/mul...
2.21875
2
SKY130_PDK/gen_param.py
ALIGN-analoglayout/ALIGN-pdk-sky130
0
13942
<gh_stars>0 import json import logging from math import sqrt, floor, ceil, log10 from copy import deepcopy logger = logging.getLogger(__name__) def limit_pairs(pairs): # Hack to limit aspect ratios when there are a lot of choices if len(pairs) > 12: new_pairs = [] log10_aspect_ratios = [-0.3, ...
2.65625
3
forcephot/throttles.py
lukeshingles/atlasserver
5
13943
<filename>forcephot/throttles.py from rest_framework.throttling import SimpleRateThrottle class ForcedPhotRateThrottle(SimpleRateThrottle): """ Limits the rate of API calls by different amounts for various parts of the API. Any view that has the `throttle_scope` property set will be throttled. The u...
2.828125
3
dot_vim/plugged/ultisnips/test/test_SnippetOptions.py
gabefgonc/san-francisco-rice-dotfiles
10
13944
<gh_stars>1-10 # encoding: utf-8 from test.vim_test_case import VimTestCase as _VimTest from test.constant import * from test.util import running_on_windows class SnippetOptions_OnlyExpandWhenWSInFront_Expand(_VimTest): snippets = ("test", "Expand me!", "", "b") keys = "test" + EX wanted = "Expand me!" ...
2.078125
2
Solver.py
kazemisoroush/JCL
0
13945
from scipy.optimize import minimize class Solver(object): # initialize the object def __init__(self, servers, alpha, teta, lambda_s): self.c_prime = 0 self.teta = teta self.alpha = alpha self.lambda_s = lambda_s # fill servers specification in arrays for solver use ...
3.1875
3
scope/device/spectra.py
drew-sinha/rpc-scope
0
13946
<gh_stars>0 # This code is licensed under the MIT License (see LICENSE file for details) import threading import time from ..util import smart_serial from ..util import property_device from ..util import state_stack from ..config import scope_configuration from . import iotool def _make_dac_bytes(IIC_Addr, bit): ...
2.078125
2
src/rics/utility/perf/__init__.py
rsundqvist/rics
1
13947
"""Performance testing utility.""" from ._format_perf_counter import format_perf_counter from ._multi_case_timer import MultiCaseTimer from ._util import plot_run, to_dataframe from ._wrappers import run_multivariate_test __all__ = [ "MultiCaseTimer", "run_multivariate_test", "format_perf_counter", "p...
1.34375
1
LinkPrediction/pruning.py
x-zho14/Unified-LTH-GNN
29
13948
<filename>LinkPrediction/pruning.py import numpy as np import torch from sklearn.metrics import roc_auc_score from sklearn.metrics import average_precision_score def test(model, features, adj, sparse, adj_sparse, test_edges, test_edges_false): eps = 1e-4 embeds, _,_, S= model.embed(features, adj, sparse, No...
2.28125
2
imap_wrapper.py
tbrownaw/rss-imap
2
13949
import email import logging import re from imapclient import IMAPClient class IMAPError(IOError): pass class ImapWrapper: """A wrapper around imaplib, since that's a bit lower-level than I'd prefer to work with.""" #This regex is: # list of flags in parens # quoted delimiter # possible-q...
2.71875
3
beeline/version.py
noam-stein/beeline-python
0
13950
VERSION = '2.11.2'
1.117188
1
genie/seg.py
karawoo/Genie
0
13951
<gh_stars>0 import logging import os import pandas as pd from .example_filetype_format import FileTypeFormat from . import process_functions logger = logging.getLogger(__name__) class seg(FileTypeFormat): _fileType = "seg" _process_kwargs = ["newPath", "databaseSynId"] def _validateFilename(self, fi...
2.609375
3
serve/api/predict.py
HalleyYoung/musicautobot
402
13952
import sys from . import app sys.path.append(str(app.config['LIB_PATH'])) from musicautobot.music_transformer import * from musicautobot.config import * from flask import Response, send_from_directory, send_file, request, jsonify from .save import to_s3 import torch import traceback torch.set_num_threads(4) data = ...
1.953125
2
tests/test_user.py
meisnate12/trakt.py
147
13953
from __future__ import absolute_import, division, print_function from tests.core import mock from trakt import Trakt from httmock import HTTMock import pytest def test_likes(): with HTTMock(mock.fixtures, mock.unknown): with Trakt.configuration.auth('mock', 'mock'): likes = Trakt['users'].li...
2.203125
2
main.py
mohamed-seyam/Image-Mixer-
0
13954
import sys import PyQt5.QtWidgets as qtw import PyQt5.QtCore as qtc from Image import Image from main_layout import Ui_MainWindow import logging import os logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) formatter = logging.Formatter('%(levelname)s:%(name)s:%(asctime)s - %(message)s') file_handler ...
2.34375
2
main_project/tienda_lissa_app/forms.py
NahuelA/TiendaLissa_Django
0
13955
from django import forms # Form for create sales class FormSales(forms.Form): # Atributes for form # NOTE: date_creation and total fields, it will be created dynamically name = forms.CharField(label="Nombre", max_length=50, required=True, ...
2.6875
3
src/vargenpath/pipeline.py
AldisiRana/VarGenPath
0
13956
# -*- coding: utf-8 -*- """Pipeline for VarGenPath""" from typing import Optional from .constants import LINKSET_PATH, FILE_TYPES from .utils import ( get_cytoscape_connection, get_associated_genes, var_genes_network, extend_vargen_network, save_session, save_image, save_network ) def get_vargenpath_network...
2.40625
2
ott/examples/fairness/models.py
MUCDK/ott
232
13957
<gh_stars>100-1000 # coding=utf-8 # Copyright 2021 Google LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
2.640625
3
src/create_hbjsons.py
karim-daw/pollination-app
0
13958
from models import shoe_box def createHBjsons() -> None: for i in range(4): # increment on shoebox dimensions _width = 4.0 + i*0.5 _height = 3.5 + i*0.1 _depth = 4.0 + i*0.5 # init shoe_box sb = shoe_box.Shoebox(width=_width , height=_height , depth=_...
2.734375
3
reikna/core/__init__.py
ringw/reikna
122
13959
<gh_stars>100-1000 from reikna.core.signature import Type, Annotation, Parameter, Signature from reikna.core.computation import Computation from reikna.core.transformation import Transformation, Indices
1.171875
1
docs/setup/mysite/models/__init__.py
pauleveritt/pyramid_sqltraversal
6
13960
from sqlalchemy import engine_from_config from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker from sqlalchemy.schema import MetaData import zope.sqlalchemy from .node import Node NAMING_CONVENTION = { "ix": 'ix_%(column_0_label)s', "uq": "uq_%(table_name)s_%(column_0...
2.234375
2
nngen/onnx/shape.py
RyusukeYamano/nngen
207
13961
<filename>nngen/onnx/shape.py from __future__ import absolute_import from __future__ import print_function from __future__ import division def Shape(visitor, node): input = visitor.visit(node.input[0]) shape = input.shape if (input.get_layout() is not None and input.get_onnx_layout() is not None and ...
2.578125
3
nales/NDS/interfaces.py
Jojain/Nales
5
13962
import typing from typing import ( Any, Callable, Dict, Iterable, List, Literal, Optional, Set, Tuple, Union, ) from ncadquery import Workplane from OCP.Quantity import Quantity_NameOfColor from OCP.TCollection import TCollection_ExtendedString from OCP.TDataStd import TDataStd_...
2.21875
2
plane_1.0/plane/hero.py
misaka46/Aircraft-war
0
13963
<reponame>misaka46/Aircraft-war from flyingObject import FlyingObject from bullet import Bullet import random class Hero(FlyingObject): """英雄机""" index = 2 # 标志位 def __init__(self, screen, images): # self.screen = screen self.images = images # 英雄级图片数组,为Surface实例 # image = pygame...
3.21875
3
chip9-emulator/emulator.py
Quphoria/CHIP9
1
13964
import sys import pygame as pg import numpy as np import random import time pic = np.zeros(shape=(128,64)) width = 128 height = 64 refresh_rate = 60 interval = 1 / refresh_rate bootrom_file = "bootrom0" rom_file = "rom" # rom_file = "hello_world" debug = False pg.display.init() display = pg.display.set_mode((width*4...
2.75
3
Burp/lib/data.py
wisdark/HUNT
1,628
13965
<reponame>wisdark/HUNT from __future__ import print_function import json import os class Data(): shared_state = {} def __init__(self): self.__dict__ = self.shared_state self.set_checklist(None) self.set_issues() def set_checklist(self, file_name): is_empty = file_name is N...
2.703125
3
twisted/test/stdio_test_write.py
engdan77/otis_app
0
13966
# -*- test-case-name: twisted.test.test_stdio.StandardInputOutputTests.test_write -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Main program for the child process run by L{twisted.test.test_stdio.StandardInputOutputTests.test_write} to test that ITransport.write() works for process tr...
2.140625
2
pyweb/overload.py
DrDaveD/wlcg-wpad
0
13967
# calculate the load on each org import threading # cannot use from wpad_dispatch here, have to import whole module, # because of circular dependency import wpad_dispatch from wpad_utils import * from wlcg_wpad import getiporg orgcleanminutes = 5 orgcleantime = 0 # Minute records keep track of the number of requ...
2.546875
3
test/bulk_insert.py
jfcarter2358/Ceres
0
13968
<reponame>jfcarter2358/Ceres import requests from datetime import datetime import time headers = { 'Content-Type': 'application/json' } with open('test/logs.txt', 'r') as f: logs = f.read().split('\n') levels = ['INFO', 'WARN', 'DEBUG', 'ERROR', 'TRACE'] messages = [] for i in range(0, len(logs)): if i...
2.5
2
tests/test_jsons.py
jrinks/greater-chicago-food-despository
0
13969
import os import sys sys.path.append(os.path.abspath('')) # Raises linting error because not at top of file # Not sure how to resolve this with the pathing from src import uploadJson # noqa: E402 import src.config as config # noqa: E402 # Taking out of commission until new geojson format requested developed # def te...
2.296875
2
tetris.py
AkshayRaul/Python-Scripts
0
13970
<filename>tetris.py #!/usr/bin/env python """ Code is personal property of the owner.Rights reserved by the user only. Codes on https://github.com/kt97679/tetris Attempt to spread the open source knowledge :) """ import sys import select import tty import termios import random import os import time import fcntl if (sy...
2.859375
3
cucm.py
PresidioCode/cucm-exporter
10
13971
<reponame>PresidioCode/cucm-exporter import time import json def export_users(ucm_axl): """ retrieve users from ucm """ try: user_list = ucm_axl.get_users( tagfilter={ "userid": "", "firstName": "", "lastName": "", "di...
2.40625
2
web.backend/config.py
Forevka/YTDownloader
1
13972
host = "localhost" port = 9999 dboptions = { "host": "192.168.3.11", "user": "postgres", "password": "<PASSWORD>", "database": "zno_bot", 'migrate': True } API_PATH = '/api/' API_VERSION = 'v1' API_URL = API_PATH + API_VERSION
1.242188
1
ml_train.py
ElvinOuyang/LearningFlask
0
13973
import pandas as pd import numpy as np from sklearn.datasets import load_iris from sklearn.naive_bayes import GaussianNB import pickle def train_iris_nb(): """Train a GaussianNB model on iris dataset.""" X, y_train = load_iris(return_X_y=True, as_frame=True) colnames = X.columns X_train = X.values ...
3.09375
3
UFOscrapy/UFOscrapy/pipelines.py
anaheino/Ufo-sightings-map
0
13974
<reponame>anaheino/Ufo-sightings-map # -*- coding: utf-8 -*- from .parserules import parseAll class UfoscrapyPipeline(object): def process_item(self, item, spider): """ Parsitaan regexin ja datetimen avulla kentät oikeaan muotoon. """ try: item['loc'] = item['loc'][...
2.640625
3
precompressed/context_processors.py
EightMedia/django-precompressed
4
13975
<reponame>EightMedia/django-precompressed # ***************************************************************************** # precompressed/context_processors.py # ***************************************************************************** """ A set of request processors that return dictionaries to be merged into a te...
2.109375
2
Code/pytorchFwdModel.py
mChataign/smileCompletion
4
13976
#Import modules import os import pandas as pd import numpy as np from pandas import DatetimeIndex import dask import scipy import time import glob import torch import torch.nn as nn from live_plotter import live_plotter import matplotlib.pyplot as plt from mpl_toolkits import mplot3d from functools impo...
2.125
2
quickstart.py
s-samarth/Learning-Tensorflow
0
13977
import numpy as np import tensorflow as tf from tensorflow import keras import warnings warnings.filterwarnings('ignore') mnist = tf.keras.datasets.mnist (X_train, y_train), (X_test, y_test) = mnist.load_data() X_train, X_test = X_train / 255.0, X_test / 255.0 X_train.shape = (60000, 28, 28) model = tf.keras.Sequen...
3.0625
3
pyquil/__init__.py
ftripier/pyquil
0
13978
<filename>pyquil/__init__.py __version__ = "2.1.0.dev0" from pyquil.quil import Program from pyquil.api import list_quantum_computers, get_qc
1.070313
1
equation_solution.py
free-free/Algorithm
7
13979
<gh_stars>1-10 #!/bin/env python3.5 import math def test_func(x): return x*x*x+1.1*x*x+0.9*x-1.4 def df_test_func(x): return 3*x*x+2.2*x+0.9 # binary seperation def binary_seperation(func, x, ap=0.001): list(x).sort() x2 = x.pop() x1 = x.pop() y1 = func(x1) y2 = func(x2) if y1 =...
3.328125
3
test/test_sparql/test_sparql_parser.py
trishnaguha/rdfextras
3
13980
import unittest from rdflib import Graph def buildQueryArgs(q): return dict(select="", where="", optional="") class SPARQLParserTest(unittest.TestCase): known_issue = True def setUp(self): self.graph = Graph() pass def tearDown(self): pass tests = [ ("basic", """\ ...
2.828125
3
day1.py
derek-elliott/aoc2018
0
13981
class Frequency: def __init__(self): self.frequency = 0 def increment(self, i): self.frequency = self.frequency + i def decrement(self, i): self.frequency = self.frequency - i def __str__(self): return str(self.frequency) def __repr__(self): return str(self.fr...
3.46875
3
file_sync_tool/transfer/process.py
jackd248/file-sync-tool
0
13982
<gh_stars>0 #!/usr/bin/env python3 # -*- coding: future_fstrings -*- from db_sync_tool.utility import mode, system, output, helper from db_sync_tool.remote import client as remote_client from file_sync_tool.transfer import utility def transfer_files(): """ Transfering configured files between clients :re...
2.015625
2
src/main/python/Training+Data+Analysis.py
sully90/dp-search-service
0
13983
<filename>src/main/python/Training+Data+Analysis.py # coding: utf-8 # # Training Set Analysis # The purpose of this notebook is to compute the kernel density estimate of the PDF between the judgement and each feature in a training set, in order to estimate how each feature is performing. # # # TODO # Modify features...
3.09375
3
src/utility_lib/collection_utilities/collection_utilities.py
DonalChilde/utility_lib
0
13984
<gh_stars>0 from operator import attrgetter, itemgetter from typing import ( Sequence, Any, Tuple, Union, List, Iterable, Dict, Callable, NamedTuple, ) SortSpec = NamedTuple("SortSpec", [("sort_key", Union[str, int]), ("reversed", bool)]) def optional_collection(argument, collect...
2.609375
3
manage_it/catalog/admin.py
ShangShungInstitute/django-manage-it
1
13985
<reponame>ShangShungInstitute/django-manage-it<gh_stars>1-10 from django.contrib import admin from models import Location, ItemTemplate, Log, Inventory, Supplier class ItemTemplateAdmin(admin.ModelAdmin): filter_horizontal = ('supplies', 'suppliers') admin.site.register(Location) admin.site.register(ItemTemplat...
1.679688
2
core_get/actions/module.py
core-get/core-get
0
13986
<filename>core_get/actions/module.py from typing import Dict, Type from injector import Module, Binder from core_get.actions.action import Action from core_get.actions.init.init import Init from core_get.actions.init.init_options import InitOptions from core_get.actions.install.install import Install from core_get.ac...
1.851563
2
venv/Lib/site-packages/direct/particles/ParticleEffect.py
ferris77/pacman
0
13987
from panda3d.core import * # Leave these imports in, they may be used by ptf files. from panda3d.physics import * from . import Particles from . import ForceGroup from direct.directnotify import DirectNotifyGlobal class ParticleEffect(NodePath): notify = DirectNotifyGlobal.directNotify.newCategory('ParticleEff...
2.015625
2
orchestra/contrib/payments/models.py
udm88/django-orchestra
68
13988
from django.core.exceptions import ValidationError from django.db import models from django.utils.functional import cached_property from django.utils.translation import ugettext_lazy as _ from jsonfield import JSONField from orchestra.models.fields import PrivateFileField from orchestra.models.queryset import group_by...
1.9375
2
src/visualisation/draw_map.py
Aluriak/24hducode2016
0
13989
<gh_stars>0 # -*- coding: utf-8 -*- ########## # IMPORT # ########## import plotly.offline as py import plotly.tools as tls tls.set_credentials_file(username='ducktypers', api_key='<KEY>') ######## # MAIN # ######## def draw_map(lon, lat, text, titre='NO TITLE'): """ Take 3 list as input, and the title of...
2.734375
3
src/promnesia/sources/reddit.py
seanbreckenridge/promnesia-fork
2
13990
<gh_stars>1-10 ''' Uses HPI [[https://github.com/karlicoss/HPI/blob/master/doc/MODULES.org#myreddit][reddit]] module ''' from itertools import chain from typing import Set, Optional from ..common import Visit, Loc, extract_urls, Results, logger def index(*, render_markdown: bool = False, renderer: Optional['RedditR...
2.375
2
puwifi.py
SaicharanKandukuri/logmein
4
13991
import optparse import sys from sys import getsizeof import logging from signal import signal, SIGINT import time import requests # MIT License # # Copyright (c) 2022 SaicharanKandukuri # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation file...
2.125
2
sphinxsimulink/diagram/application.py
dekalinowski/sphinx-simulink
2
13992
""" sphinx-simulink.application ~~~~~~~~~~~~~~~~~~~~~~~ Embed Simulink diagrams on your documentation. :copyright: Copyright 2016 by <NAME> <<EMAIL>>. :license: MIT, see LICENSE for details. """ import matlab.engine import os from sphinx.errors import SphinxError from sphinx.util.osuti...
1.851563
2
bentoml/pytorch_lightning.py
francoisserra/BentoML
1
13993
<reponame>francoisserra/BentoML<filename>bentoml/pytorch_lightning.py from ._internal.frameworks.pytorch_lightning import load from ._internal.frameworks.pytorch_lightning import save from ._internal.frameworks.pytorch_lightning import load_runner __all__ = ["load", "load_runner", "save"]
1.25
1
bugex_online/bugex_webapp/templatetags/custom_tags.py
fkleon/bugex-online
0
13994
<gh_stars>0 from django import template from django.conf import settings register = template.Library() @register.simple_tag def settings_value(name): """ This Tag allows to access values from the configuration file in the templates. """ try: return settings.__getattr__(name) except Attribu...
2.046875
2
CreateRobot.py
KonstantinosAng/KinectPython
5
13995
""" Author: <NAME> Date: 04/02/2020 All rights reserved. Feel free to use and modify and if you like it give it a star. Import the Robot's Step Files and Color/Scale/Assemble them using the instructions in /RoboDK/KUKA/KUKA LWR IV+ Description (for Original=kuka_lwr_model_description.json, for custom=custom_kuka_lwr_m...
2.625
3
tests/Parser/701isNotSubtitleFile_test.py
Bas-Man/TVShowFile
0
13996
import unittest from context import parser class TVShowFileParserTests(unittest.TestCase): def setUp(self): self.filename = parser.Parser("test.2018.S01E01E02.mkv") def tearDown(self): self.filename = None def testisSubtitleFileSRT(self): self.assertFalse(self.filename.isSubs) ...
2.703125
3
archdiffer/tests/tests_rest_routes.py
Kratochvilova/archdiffer
0
13997
<filename>archdiffer/tests/tests_rest_routes.py<gh_stars>0 # -*- coding: utf-8 -*- # This file is part of Archdiffer and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ Created on Sat May 12 20:39:46 2018 @author: <NAME> <<EMAIL>> """ from random import choice from dateti...
2.4375
2
src/posts/templatetags/urlify.py
thunderoy/blogger
0
13998
from urllib.parse import quote from django import template register = template.Library() @register.filter def urlify(value): return quote(value)
1.726563
2
producto/migrations/0004_auto_20180611_2350.py
JohanVasquez/crud-venta-libre
0
13999
# Generated by Django 2.0.6 on 2018-06-11 23:50 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('producto', '0003_auto_20180611_2248'), ] operations = [ migrations.RenameModel( old_name='Venta', new_name='Ventas', ...
1.570313
2