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
sources/praline/client/project/pipeline/orchestration.py
dansandu/praline
0
12797351
from praline.client.project.pipeline.cache import Cache from praline.client.project.pipeline.stage_resources import StageResources from praline.client.project.pipeline.stages.stage import Stage from praline.client.repository.remote_proxy import RemoteProxy from praline.common.algorithm.graph.instance_traversal import m...
1.9375
2
results texture.py
wr0gers/PixelMiner
0
12797352
<filename>results texture.py import os import re import numpy as np import matplotlib.pyplot as plt from ccc import concordance_correlation_coefficient from scipy.stats import wilcoxon, ttest_rel, ttest_ind, mannwhitneyu, ranksums from scipy.stats import f, shapiro, bartlett, f_oneway, kruskal from statsmodels.stats.w...
2.21875
2
base/command_parse/argparse_readfile_example.py
Bio-MingChen/python_best_practice
0
12797353
import sys import argparse from textwrap import dedent def main(kwargs): with kwargs["infile"] as indata,\ kwargs["ofile"] as odata: for line in indata: odata.write(line) if __name__ == "__main__": parser = argparse.ArgumentParser( prog = "argparse_example", # defa...
2.890625
3
src/astrometry_azel/io.py
scienceopen/astrometry
6
12797354
<reponame>scienceopen/astrometry<filename>src/astrometry_azel/io.py """ Image stack -> average -> write FITS Because ImageJ has been a little buggy about writing FITS files, in particular the header that astrometry.net then crashes on, we wrote this quick script to ingest a variety of files and average the specified ...
2.359375
2
Scripts/VRM_DeleteLeafBones.py
TheHoodieGuy02/VRoid2UE4_BlenderScripts
3
12797355
# Obliterate unused leaf bones in VRoid models! import bpy context = bpy.context obj = context.object # By default, VRM Importer includes leaf bones automatically. # It's cool and stuff, but it's not necessary for Blender, and will spew out # scary long warning when imported to UE4. # Use this script to obliterate th...
1.757813
2
20.armstrongInRange.py
A-Little-Hat/Python-Basics
0
12797356
s=int(input("enter start ")) e=int(input("enter a end ")) for n in range(s,e+1): order=len(str(n)) num=0 backup=n while(n>0): x=n%10 num+=x**order n=n//10 if(num==backup): print(num,"\t",end='')
3.375
3
src/app/app.py
Rexhaif/RSA-Core
2
12797357
<gh_stars>1-10 from flask import Flask, jsonify from flask_jwt_extended import JWTManager from .config import config from .controllers import * from .utils import ListConverter from .security import * application = Flask("rsa-core") application.config['JWT_SECRET_KEY'] = config['jwt_key'] jwt = JWTManager(applicati...
2.375
2
mp/data/datasets/ds_mr_hippocampus_harp.py
MECLabTUDA/OOD-Gen
0
12797358
# ------------------------------------------------------------------------------ # Hippocampus segmentation task for the HarP dataset # (http://www.hippocampal-protocol.net/SOPs/index.php) # ------------------------------------------------------------------------------ import os import re import SimpleITK as sitk imp...
2.453125
2
elements/utils.py
jhnnsrs/arbeider
0
12797359
def buildRepresentationName(name, nodeid): if nodeid is not None: return f"{name} {nodeid}" else: return f"{name}" def buildTransformationName(roi, representation, transformer, input_transformation, nodeid): if input_transformation is None: return f"{transformer.name}_rep-{repr...
2.75
3
udacity/deep-learning/assignments/notmnist.py
balazssimon/ml-playground
0
12797360
# These are all the modules we'll be using later. Make sure you can import them # before proceeding further. # code changed to Python3 import matplotlib import matplotlib.pyplot as plt import numpy as np import os import sys import tarfile from IPython.display import display, Image from scipy import ndima...
2.703125
3
scripts/jrk_simple_test.py
jones7625/jrk_controller
1
12797361
#!/usr/bin/env python import serial import time from sys import stdout print("starting jrk_simple_test") ser = serial.Serial( "/dev/ttyACM0", 9600) # input to the JRK controller for sending it commands print("connected to: " + ser.portstr + " for sending commands to JRK") init_cmd = "\xAA" jrk_id = "\x0B" set_targ...
2.8125
3
src/cardapp/utils.py
raphv/cardmapper
0
12797362
<filename>src/cardapp/utils.py # -*- coding: utf-8 -*- import re from html import unescape from bleach.sanitizer import Cleaner from html5lib.filters.base import Filter PARAGRAPH_TAGS = ['p', 'h1', 'h2', 'h3', 'h4', 'li'] STYLE_TAGS = ['strong', 'em'] class ProcessDescription(Filter): def __iter__(self): ...
2.515625
3
oo/pessoa.py
arisobel/pythonbirds
0
12797363
<reponame>arisobel/pythonbirds class Pessoa: olhos = 2 def __init__(self, *filhos, nome=None, idade=10): self.nome = nome self.idade = idade self.filhos = list(filhos) def cumprimentar(self): return f"olá {self.nome} id({id(self)})" @staticmethod def metodo_e...
3.515625
4
lumin/data_processing/file_proc.py
nflanner/lumin
43
12797364
<gh_stars>10-100 import h5py import numpy as np import pandas as pd from typing import List, Union, Optional, Any, Tuple, Dict import os from pathlib import Path import json from sklearn.model_selection import StratifiedKFold, KFold __all__ = ['save_to_grp', 'fold2foldfile', 'df2foldfile', 'add_meta_data'] def save...
2.21875
2
TranskribusDU/visu/deco.py
Transkribus/TranskribusDU
20
12797365
<filename>TranskribusDU/visu/deco.py<gh_stars>10-100 """ A class that reflect a decoration to be made on certain XML node using WX """ import types, os from collections import defaultdict import glob import logging import random from lxml import etree #import cStringIO import wx sEncoding = "utf-8" def setEncoding(...
2.828125
3
ex/ex7.py
bluethon/lpthw
0
12797366
<filename>ex/ex7.py from sys import argv script, first, second, third = argv print("The script is called:", script) print("Your first variable is:", first) print("Your second variable is:", second) print("Your third variable is:", third) # $ python ex13.py first 2nd 3rd # The script is called: ex13.py # Your first v...
3.09375
3
online/build/livereload/livereload/server.py
hiphopsmurf/bitcoin-secured
1
12797367
# -*- coding: utf-8 -*- """livereload.app Core Server of LiveReload. """ import os import logging import time import mimetypes import webbrowser from tornado import ioloop from tornado import escape from tornado import websocket from tornado.web import RequestHandler, Application from tornado.util import ObjectDict ...
2.25
2
app/form.py
CalebF98/tbcc-moonkin-dps-simulator
0
12797368
from flask_wtf import FlaskForm from wtforms import StringField, IntegerField from wtforms.fields.simple import SubmitField from wtforms.validators import DataRequired, NumberRange class SimParamsForm(FlaskForm): intellect = IntegerField('Intellect', [NumberRange(0,1000)]) spellpower = IntegerField('Spellpower...
2.5
2
nba_api/stats/endpoints/teamdetails.py
AlexEidt/nba_api
1
12797369
from nba_api.stats.endpoints._base import Endpoint from nba_api.stats.library.http import NBAStatsHTTP class TeamDetails(Endpoint): endpoint = 'teamdetails' expected_data = {'TeamAwardsChampionships': ['YEARAWARDED', 'OPPOSITETEAM'], 'TeamAwardsConf': ['YEARAWARDED', 'OPPOSITETEAM'], 'TeamAwardsDiv': ['YEARAW...
2.5625
3
seating_charts/migrations/0006_auto_20160203_1332.py
rectory-school/rectory-apps
0
12797370
<reponame>rectory-school/rectory-apps # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('seating_charts', '0005_auto_20160203_1110'), ] operations = [ migrations.AlterModelOpt...
1.46875
1
ch4/4_3_list_of_depths.py
xuanyuwang/ctci
0
12797371
import unittest class node(): def __init__(self, value=None): self.value = value self.left = None self.right = None def solution(root): res = [] queue = [] queue.append(root) while queue: numberOfNodesInThisLevel = len(queue) level = [queue.pop() for _ in r...
3.984375
4
classes/dice_rolling/shadowrun_rolling.py
ephreal/rollbot
2
12797372
# -*- coding: utf-8 -*- """ This software is licensed under the License (MIT) located at https://github.com/ephreal/rollbot/Licence Please see the license for any restrictions or rights granted to you by the License. """ from utils.rolling import rolling_utils class Shadowrun3Roller(): """ The shadowrun ro...
3.234375
3
Emulator/__main__.py
samedamci/7seg-Emulator
0
12797373
<gh_stars>0 #!/usr/bin/env python3 import os import sys if __name__ == "__main__": sys.path.insert(1, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from Emulator.emulator import main main()
1.578125
2
sunspec2/smdx.py
mptei/pysunspec2
26
12797374
""" Copyright (C) 2020 SunSpec Alliance 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, modify, merg...
1.273438
1
src/mmw/apps/home/views.py
mmcfarland/model-my-watershed
1
12797375
<gh_stars>1-10 # -*- coding: utf-8 -*- from __future__ import print_function from __future__ import unicode_literals from __future__ import division from django.contrib.auth.models import User from django.shortcuts import render_to_response from django.template.context_processors import csrf from rest_framework import...
2.09375
2
pspy/pspy_utils.py
xgarrido/pspy
6
12797376
<reponame>xgarrido/pspy """ Utils for pspy. """ import os import numpy as np def ps_lensed_theory_to_dict(filename, output_type, lmax=None, start_at_zero=False): """Read a lensed power spectrum from CAMB and return a dictionnary Parameters ---------- filename : string the name of the CAMB lens...
2.546875
3
DQN/Network.py
hojunkim13/master2048
0
12797377
<gh_stars>0 import torch import torch.nn as nn class DQNNetwork(nn.Module): def __init__(self, n_state, n_action): super(DQNNetwork, self).__init__() self.ConvNet = nn.Sequential( nn.Conv2d(n_state[0], 64, 3, 1, 1), nn.ReLU(), nn.Conv2d(64, 256, 3, 1, 1), ...
2.421875
2
dynamorm/__init__.py
borgstrom/dynomallow
81
12797378
"""The base module namespace simply imports the most frequently used objects to simplify imports in clients: .. code-block:: python from dynamorm import DynaModel """ from .model import DynaModel # noqa from .indexes import ( GlobalIndex, LocalIndex, ProjectAll, ProjectKeys, ProjectInclude, ...
1.648438
2
my9221.py
mcauser/micropython-my9221
4
12797379
""" MicroPython MY9221 LED driver https://github.com/mcauser/micropython-my9221 MIT License Copyright (c) 2018 <NAME> 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, includin...
2.640625
3
procasl/_utils.py
salma1601/process-asl-old
1
12797380
<reponame>salma1601/process-asl-old import os import glob import warnings import numpy as np import nibabel def _single_glob(pattern): filenames = glob.glob(pattern) if not filenames: print('Warning: non exitant file with pattern {}'.format(pattern)) return None if len(filenames) > 1: ...
2.703125
3
inkscape-set-css-class-master/set_css_class.py
ilnanny/Inkscape-addons
3
12797381
<filename>inkscape-set-css-class-master/set_css_class.py #!/usr/bin/env python """ Sets a css class on selected elements, while optionally removing the elements' styling. If inline styles are not removed, the css class might not have effect. Inspired by MergeStyles (and best used together with it). """ __author__ = ...
2.84375
3
hummingbot/strategy/execution2/__init__.py
anyachopra97/hummingbot
0
12797382
<reponame>anyachopra97/hummingbot #!/usr/bin/env python from .execution2 import Execution2Strategy __all__ = [ Execution2Strategy ]
0.980469
1
src/bpp/models/grant.py
iplweb/django-bpp
1
12797383
from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.db import models from django.db.models import CASCADE class Grant(models.Model): nazwa_projektu = models.TextField(blank=True, null=True) zrodlo_finansowania = models.TextFie...
2.03125
2
self/test/preprocess_test.py
luweishuang/rasa
0
12797384
<gh_stars>0 # -*- coding: utf-8 -*- import jieba jieba.load_userdict("user_dict.txt") line_list = ["查询安顺站一号风机的电压曲线", "查询安各庄1母线的故障信息", "开始进行南京站设备状态核实", "看下安顺站3月1号的静态功率曲线"] for cur_line in line_list: seg_list = jieba.cut(cur_line.strip()) print("jieba rst: " + "/ ".join(...
2.703125
3
Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/lms/djangoapps/debug/views.py
osoco/better-ways-of-thinking-about-software
3
12797385
"""Views for debugging and diagnostics""" import pprint import traceback from codejail.safe_exec import safe_exec from django.contrib.auth.decorators import login_required from django.http import Http404, HttpResponse from django.utils.html import escape from django.views.decorators.csrf import ensure_csrf_cookie f...
2.125
2
solutions/1254_number_of_closed_islands.py
YiqunPeng/leetcode_pro
0
12797386
<filename>solutions/1254_number_of_closed_islands.py<gh_stars>0 class Solution: def closedIsland(self, grid: List[List[int]]) -> int: res = 0 for i in range(len(grid)): for j in range(len(grid[0])): if grid[i][j] == 0: grid[i][j] = 1 ...
2.890625
3
src/tidygraphtool/graph_measures.py
jstonge/tidygraphtool
0
12797387
"""Calculate metrics on graph""" import graph_tool.all as gt from .nodedataframe import NodeDataFrame from .context import expect_nodes def graph_component_count(G: gt.Graph, directed: bool = False) -> NodeDataFrame: expect_nodes(G) counted_comp, _ = gt.label_components(G, directed=di...
2.5625
3
pysh/transforms/alpha/lazybools.py
drslump/pysh
3
12797388
<reponame>drslump/pysh """ In Python it's not possible to overload the boolean operators (``not``, ``and``, ``or``) since they have short-circuiting semantics (PEP-532 is deferred right now). The problem manifests when trying to use a ``cmd and ok or fail`` or similar constructs, which are quite common in shell script...
2.640625
3
users/urls.py
Bytlot/foodgram-project
0
12797389
<gh_stars>0 from django.contrib.auth import views as auth_views from django.urls import path from . import views urlpatterns = [ path('signup/', views.SignUp.as_view(), name='signup'), path( 'login/', auth_views.LoginView.as_view(template_name='auth/authForm.html'), name='login' ),...
1.789063
2
bevy/app/options.py
ZechCodes/bevy.app
0
12797390
from bevy.injection import AutoInject, detect_dependencies from bevy.app.args import ArgumentParser, CLIArgs from typing import Any import os @detect_dependencies class Options(AutoInject): """The options object aggregates all options values that the Bevy.App application pulls in from the environment.""" arg...
2.703125
3
reto2.py
MiguelSanchezP/Bitsxlamarato2020
2
12797391
f = open ("./Files/COPEDICATClinicSympt_DATA_2020-12-17_1642.csv", 'r') data = [] for line in f: data.append(line) #covid and other illnesses: COVID_vrs = [] for value in data: if value.split(',')[122] == '1' and value.split(',')[131] == '1': COVID_vrs.append(value) elif value.split(',')[127] == '1' and v...
2.9375
3
synbols/predefined_datasets.py
shikhar-srivastava/synbols
0
12797392
import logging import numpy as np import math from .drawing import Camouflage, NoPattern, SolidColor, MultiGradient, ImagePattern, Gradient, Image, Symbol from .fonts import LANGUAGE_MAP from .generate import ( dataset_generator, basic_attribute_sampler, flatten_mask, flatten_mask_except_first, ad...
2.265625
2
Pyrado/pyrado/environment_wrappers/state_augmentation.py
jacarvalho/SimuRLacra
0
12797393
<reponame>jacarvalho/SimuRLacra import numpy as np from init_args_serializer import Serializable from pyrado.environment_wrappers.base import EnvWrapper from pyrado.environment_wrappers.utils import inner_env from pyrado.environments.base import Env from pyrado.utils.data_types import EnvSpec from pyrado.spaces.box im...
2.03125
2
WCST_Scoring.py
Wyko/WCST
3
12797394
<filename>WCST_Scoring.py from __future__ import with_statement import re, csv, os from prettytable import PrettyTable # The top level folder which contains the tests PATH = os.getcwd() # r"C:\Users\wyko.terhaar\Downloads\Map voor Wyko\raw" # Variables which contain the column numbers, used for readability SU...
2.78125
3
shodohflo/redis_handler.py
m3047/shodoflo
10
12797395
<filename>shodohflo/redis_handler.py<gh_stars>1-10 #!/usr/bin/python3 # Copyright (c) 2019 by <NAME> # # 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/LICE...
2.859375
3
src/lib/models/networks/GN.py
hz-ants/CenterPose-
96
12797396
<gh_stars>10-100 from torch import nn def group_norm(out_channels): num_groups = 32 if out_channels % 32 == 0: return nn.GroupNorm(num_groups, out_channels) else: return nn.GroupNorm(num_groups // 2, out_channels)
2.59375
3
test/test_builtins/test_arithmetics.py
dragonteros/unsuspected-hangeul
62
12797397
<filename>test/test_builtins/test_arithmetics.py from test.test_base import TestBase class TestArithmetics(TestBase): def test_multiply(self): _test = self._assert_execute _test('ㄱ ㄴ ㄷ ㄹ ㄱㅎㅁ', "0") _test('ㄴㄱ ㄴ ㄷ ㄹ ㄱㅎㅁ', "-6") _test('(ㄷ ㄴㄱ ㅅㅎㄷ) ㄷ ㄱㅎㄷ', "1.0") _test('(ㄷ ㄴㄱ ㅅㅎ...
2.890625
3
waapi/test/test_large_payload.py
kakyoism/waapi-client-python
23
12797398
<reponame>kakyoism/waapi-client-python<filename>waapi/test/test_large_payload.py import unittest from waapi import WaapiClient, connect, CannotConnectToWaapiException class LargePayload(unittest.TestCase): def test_large_rpc(self): with WaapiClient() as client: result = client.call("ak.wwise....
2.40625
2
scripts/generate_gan_data.py
ssundaram21/6.819FinalProjectRAMP
2
12797399
<reponame>ssundaram21/6.819FinalProjectRAMP import pickle import numpy as np import pandas as pd import tensorflow as tf import PIL.Image import imageio # import tfutils import matplotlib.pyplot as plt import os import sys from IPython.core.interactiveshell import InteractiveShell InteractiveShell.ast_node_interactivi...
2.234375
2
swampymud/character.py
ufosc/MuddySwamp
10
12797400
<reponame>ufosc/MuddySwamp """Module defining the CharacterClass metaclass and Character class, which serves as the basis for all in-game characters. This module also defines the 'Filter', used for CharacterClass-based permissions systems, and 'Command', a wrapper that converts methods into commands that can be invoke...
2.59375
3
app/front/tree/home/api/indicators/route.py
jgphilpott/polyplot
5
12797401
<filename>app/front/tree/home/api/indicators/route.py from ast import literal_eval from flask import jsonify, request from back.mongo.data.collect.indicators.mongo import find_indicators def register_api_indicators_route(app): @app.route("/api/indicators") def api_indicators(): query = literal_eval(r...
2.421875
2
mpunet/errors/deprecated_warnings.py
alexsosn/MultiPlanarUNet
156
12797402
from mpunet.logging import ScreenLogger def warn_sparse_param(logger): logger = logger or ScreenLogger sparse_err = "mpunet 0.1.3 or higher requires integer targets" \ " as opposed to one-hot encoded targets. Setting the 'sparse'" \ " parameter no longer has any effect and ma...
2.25
2
cisco_ucs_vlan_cli_interface.py
drew-russell/Cisco-UCS-VLAN-Management
3
12797403
""" A Python CLI interface that utilizes the Cisco UCS SDK to: - Connect to a UCSM domain - View and Add VLANs - Add a VLAN to a vNIC Please note that there is very little error handling present so proceed accordingly. """ from UcsSdk import UcsHandle from UcsSdk import UcsUtils from UcsSdk.MoMeta.FabricVlan impor...
2.5
2
gridvm/network/protocol/packet/__init__.py
GeorgeTG/gridvm
0
12797404
<gh_stars>0 from .ptype import PacketType from .header import PacketHeader from .packet import Packet from .factory import *
1.164063
1
setup.py
sauzher/Products.LDAPMultiPlugins
0
12797405
<filename>setup.py import os from setuptools import setup from setuptools import find_packages NAME = 'LDAPMultiPlugins' here = os.path.abspath(os.path.dirname(__file__)) package = os.path.join(here, 'Products', NAME) def _read(name): f = open(os.path.join(package, name)) return f.read() _boundary = '\n' + (...
1.71875
2
main.py
stspbu/code-change-miner
1
12797406
import ast import os import pickle import sys import stackimpact import datetime import argparse import multiprocessing from log import logger from patterns import Miner from patterns.models import Fragment, Pattern from vcs.traverse import GitAnalyzer, RepoInfo, Method import pyflowgraph import changegraph import se...
2.109375
2
distribution/monty.py
proprefenetre/distributions
0
12797407
<filename>distribution/monty.py from distribution import Distribution, DistGroup # Monty hall problem # you have chosen door A. Do you switch to win a car? # D: # Monty opens door B _and_ there is no car there # H: # 1: the car is behind door A: # p(open A): 0 (we picked A) # p(open B): .5 # p...
3.1875
3
morphium/ia.py
pudo/morphium
1
12797408
<reponame>pudo/morphium import os import logging import boto from boto.s3.connection import OrdinaryCallingFormat import mimetypes from datetime import datetime from morphium.util import env, TAG_LATEST log = logging.getLogger(__name__) config = {} class InternetArchive(object): """A scraper archive on the inte...
2.265625
2
SCRAPERS/pricegrabber.py
tgtads/yahooFinanceEventStudy
0
12797409
#!/usr/bin/python3 # DESCRIPTION # An efficient python script that reads a line separated list of stock symbols # with optional start and end dates for range and saves the relevant daily # volume and adjusted closing prices from Yahoo Finance. # a logfile is also created to summarise the outcome in terms of available ...
3.234375
3
tests/test_warnings.py
flashdagger/conmon
0
12797410
<reponame>flashdagger/conmon #!/usr/bin/env python # -*- coding: UTF-8 -*- import re import pytest from conmon.warnings import Regex output = [ "src/main/src/Em_FilteringQmFu.c: In function " "\u2018Em_FilteringQmFu_processSensorSignals\u2019:", "src/main/src/Em_FilteringQmFu.c:266:5: warning: implicit d...
1.890625
2
src/cybersource/signature.py
thelabnyc/django-oscar-cybersource
3
12797411
from django.core.exceptions import SuspiciousOperation import hashlib import hmac import base64 class SecureAcceptanceSigner(object): def __init__(self, secret_key): self.secret_key = secret_key def sign(self, data, signed_fields): key = self.secret_key.encode("utf-8") msg_raw = self....
2.34375
2
Chapter 1- Arrays and Strings/problem2/method1.py
lorderikir/Cracking-the-Coding-Interview
6
12797412
<reponame>lorderikir/Cracking-the-Coding-Interview def permutation(stringA, stringB): listA = list(stringA) listB = list(stringB) listA.sort() listB.sort() if(listA != listB): return False else: return True
3.546875
4
web/ancv_html_scraper.py
silvos590/ancv_restaurant_scraper
1
12797413
from os import makedirs, path from lxml import html import requests import urllib import getopt, sys, os import re import time from selenium import webdriver from selenium.webdriver.chrome.options import Options #old_address = lambda n,city: f'https://guide.ancv.com/recherche/liste/cv?page={n}&rows=30&f%5B0%5D=im_fiel...
2.859375
3
Backup.py
paringandhi10/AND_lab
0
12797414
<reponame>paringandhi10/AND_lab import getpass import telnetlib print "******You are now Backing up CISCO and ARISTA router******" user = raw_input ("Enter your username of CISCO and ARISTA:") password = getpass.getpass() HOST =("192.168.13.144","192.168.13.145","192.168.13.146") for i in HOST:
2.34375
2
index.py
crystal-ctrl/engineering_project
5
12797415
import dash import dash_html_components as html import dash_core_components as dcc from dash.dependencies import Input, Output import plotly.graph_objs as go import plotly.express as px import pandas as pd import numpy as np from app import app from app import server from apps import state, county cases = pd.read_csv...
2.40625
2
ThreeJson.py
The-Fonz/freecad-parametric-generator
11
12797416
# # Adapted from https://github.com/dcowden/cadquery/blob/master/cadquery/freecad_impl/exporters.py # Objects that represent # three.js JSON object notation # https://github.com/mrdoob/three.js/wiki/JSON-Model-format-3 # JSON_TEMPLATE= """\ { "metadata" : { "formatVersion" : 3, "gen...
2.109375
2
setup.py
dimastark/pyndler
0
12797417
#!/usr/bin/env python """ Bundle Python packages into a single script A utility needed to build multiple files into a single script. It can be useful for distribution or for easy writing of code and bundle it (for example for www.codingame.com) """ import re from distutils.core import setup description, long_descri...
1.875
2
admin.py
dev-easyshares/company
0
12797418
<reponame>dev-easyshares/company from django.contrib import admin from django.conf import settings from django.views.decorators.cache import never_cache from django.contrib.admin.options import TO_FIELD_VAR from django.contrib.admin.utils import unquote from django.urls import reverse, resolve from django.http import H...
1.734375
2
tmeval/corpora/generate/uci.py
arlenk/topic-model-evaluation
0
12797419
<filename>tmeval/corpora/generate/uci.py<gh_stars>0 """ Datasets from UCI https://archive.ics.uci.edu/ml/datasets.html """ import urllib import os from itertools import islice import copy from gensim.models import VocabTransform from gensim.corpora.dictionary import Dictionary from gensim.corpora import MmCorpus, Uc...
2.953125
3
fusion_tests/fsnTicketsByAddress.py
ReDeFinance/web3fsnpy
4
12797420
#!/usr/bin/env python3 from datetime import datetime #web3fusion from web3fsnpy import Fsn linkToChain = { 'network' : 'mainnet', # One of 'testnet', or 'mainnet' 'provider' : 'WebSocket', # One of 'WebSocket', 'HTTP', or 'IPC' 'gateway' : 'wss://mainnetpublicgateway1.fusionnetwork.io:...
2.28125
2
link_provider/py/provide_raw_dataset_links.py
WiSig-dataset/wisig-process-raw
0
12797421
<gh_stars>0 #!/usr/bin/env python # coding: utf-8 # In[2]: get_ipython().run_line_magic('load_ext', 'autoreload') get_ipython().run_line_magic('autoreload', '2') import matplotlib.pyplot as plt import numpy as np import pickle import os import scipy.optimize # In[3]: import os GPU = "" os.environ["CUDA_DEVICE_O...
2.28125
2
src/coolbeans/tools/folding.py
runarp/coolbeans
5
12797422
import re import datetime class DateFoldStreamProxy: old_date = None date_re = re.compile(r"(?P<year>\d\d\d\d)-(?P<month>\d\d)-(?P<day>\d\d).*") def __init__(self, stream): self.stream = stream def close(self): self.stream.close() def render_month(self, date: datetime.date): ...
3.015625
3
create_dataset.py
Jarema/ml-cluster-strings
0
12797423
import extract_features as ef import numpy as np with open('./input.csv','r',encoding='utf-8') as input_file: with open('./dataset.csv','w',encoding='utf-8') as dataset: for line in input_file: r = line.split(',') x = r[0].strip() y = r[1].strip() example = ef.extractFeatures(x) r...
2.875
3
orm.py
macTracyHuang/cs50w_project1
0
12797424
import os from flask import Flask from application import get_app from models import * from flask_session import Session app = get_app() session = Session(app) # Tell Flask what SQLAlchemy databas to use. # app.config["SQLALCHEMY_DATABASE_URI"] = "postgresql://postgres:a1234567@localhost" # app.config["SQLALCHEMY_DAT...
2.734375
3
yolo_labels/LabelBox/reader.py
AIForMobility/datasets
0
12797425
<filename>yolo_labels/LabelBox/reader.py import pandas as pd from typing import Union import json import os from yolo_labels.shared import LabelReader class LabelBoxLabelReader(LabelReader): def __init__(self, input_path: str, label_id_mapper: dict, separator: str = ',', images_folder: str = '', ...
2.859375
3
tests/test_documentation.py
datosgobar/pydatajson
13
12797426
<gh_stars>10-100 #!/usr/bin/env python # -*- coding: utf-8 -*- """Tests del modulo pydatajson.""" from __future__ import unicode_literals from __future__ import print_function from __future__ import with_statement import os.path import unittest import nose from .context import pydatajson from pydatajson.documentatio...
2.5625
3
imapEmailClient.py
fjh1997/Socket-SMTP-POP3-IMAP
1
12797427
import socket, ssl, base64, sys, time, math print "Connecting.." username = "" password = "" # Choose a mail server (e.g. Google mail server) and call it mailserver mailserver = ('imap.163.com', 143) # Create socket called clientSocket and establish a TCP connection with mailserver #Fill in start #sslSocket = ...
3.4375
3
backend/server.py
Longi94/rl-loadout
17
12797428
<reponame>Longi94/rl-loadout import logging from datetime import timedelta from flask import jsonify from flask_cors import CORS from flask_jwt_extended import JWTManager from werkzeug.exceptions import HTTPException, default_exceptions import connexion from utils.network import log_endpoints from utils.network.exc imp...
1.875
2
source-code-from-author-book/Listings-for-Second-Edition/listing_8_29.py
robrac/algorithms-exercises-with-python
0
12797429
def mismatchLinks(pattern): augPattern = "0"+pattern links = {} links[1] = 0 for k in range(2,len(augPattern)): s = links[k-1] stop = False while s>=1 and not stop: if augPattern[s] == augPattern[k-1]: stop = True else: s = ...
3.25
3
src/pretalx/person/exporters.py
MaxRink/pretalx
0
12797430
<reponame>MaxRink/pretalx import csv import io from django.utils.translation import ugettext_lazy as _ from pretalx.common.exporter import BaseExporter from pretalx.submission.models import SubmissionStates class CSVSpeakerExporter(BaseExporter): public = False icon = 'fa-users' identifier = 'speakers....
2.125
2
djay/blueprints/command/context.py
aleontiev/django-cli
24
12797431
import click import inflection @click.command() @click.argument("name") @click.option("--doc") def get_context(name, doc): """Generate a command with given name. The command can be run immediately after generation. For example: dj generate command bar dj run manage.py bar """ na...
2.578125
3
tests/reader/test_iso19139.py
cehbrecht/md-ingestion
4
12797432
<reponame>cehbrecht/md-ingestion<gh_stars>1-10 import os import pytest from mdingestion.reader import ISO19139Reader from tests.common import TESTDATA_DIR def test_envidat_iso19139(): point_file = os.path.join( TESTDATA_DIR, 'envidat-iso19139', 'SET_1', 'xml', 'bbox_2ea750c6-4354-5f0a-9b67-2275d922d06f...
2.015625
2
printerc/printerc.py
lopezpdvn/printer73x
2
12797433
#!/usr/bin/env python # coding=utf-8 # Author: <NAME> # Contact: <EMAIL> '''Numerical controller for the printer73x system. **printerc** is an interactive command line interface for the numerical control of the **printer73x** system. printerc drives printerm through mcircuit; printerc stablishes a serial connection ...
3.125
3
utils.py
wiaderwek/musebert
24
12797434
<reponame>wiaderwek/musebert<filename>utils.py from torch.optim.lr_scheduler import LambdaLR def get_linear_schedule_with_warmup(optimizer, num_warmup_steps, num_training_steps, final_lr_factor, last_epoch=-1): """ Copied and **modified**...
2.921875
3
tests/test_examplegen.py
matth79/multispecies-whale-detection
1
12797435
<gh_stars>1-10 # Copyright 2022 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 applicable law or agreed ...
1.984375
2
evogtk/widgets.py
R3v1L/evogtk
0
12797436
# -*- coding: utf-8 -*- ############################################################################### # Copyright (C) 2008 EVO Sistemas Libres <<EMAIL>> # 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 Fou...
1.203125
1
Codes/Abaqus_Indentation/2D/scripts_2D/geom_specimen.py
materialsguy/Predict_Nanoindentation_Tip_Wear
0
12797437
s = mdb.models['Model-1'].ConstrainedSketch(name='__profile__', sheetSize=200.0) g, v, d, c = s.geometry, s.vertices, s.dimensions, s.constraints s.sketchOptions.setValues(viewStyle=AXISYM) s.setPrimaryObject(option=STANDALONE) s.ConstructionLine(point1=(0.0, -100.0), point2=(0.0, 100.0)) s.FixedConstraint(entity=g[2])...
1.742188
2
automounter.py
bpayne-novanta/automounter
1
12797438
from contextlib import contextmanager import requests def _validate_response(response): if response.status_code == 200: return response json = response.json() raise Exception(json["message"]) def _release_lease(lease_id): _validate_response(requests.post("http://localhost:3000/leases/release"...
2.609375
3
src/python/CreateTraversalGraphs.py
furodet/xpegraph
0
12797439
<gh_stars>0 """ Reads a collection of partitions, created by BuildFragments, to produce their traversal graphs. Input to this program are: * The base name of fragment files * The number of fragments to process Output is a collection of mtx files, with the same base name, suffixed by the fragment number and a capi...
2.9375
3
backend/handlers/graphql/utils/subscription.py
al-indigo/vmemperor
0
12797440
<filename>backend/handlers/graphql/utils/subscription.py import asyncio from dataclasses import dataclass from typing import Dict, Type import graphene from graphene import ObjectType from graphene.types.resolver import dict_resolver from graphql import ResolveInfo from rethinkdb import RethinkDB from rethinkdb.errors...
1.984375
2
basic_qlestimator.py
marwenbelkaid/basic-ql-model-fitting
0
12797441
<filename>basic_qlestimator.py from sklearn.base import BaseEstimator import inspect import numpy as np import random import math ''' Define softmax function ''' def softmax(opts, tau): norm = 0 ret = [] for i in range(0,len(opts)): ret.append(math.exp(opts[i]/tau)) norm += ret[i] for i in range(0,len(opts...
2.859375
3
PYTHON/pythonDesafios/desafio048.py
Santos1000/Curso-Python
0
12797442
<reponame>Santos1000/Curso-Python cont = 0 soma = 0 for c in range(1, 501, 2): if c % 3 ==0: soma = soma + c cont = cont + 1 print(f'A soma de todos os dos {cont} numeros impares sera:{soma} ')
3.625
4
TestMovimientos/unitary_derivative.py
JDanielGar/ConvolutionMovements
0
12797443
# 05 de Junio del 2018 # 31 Mayo 2018 import numpy as np import matplotlib.pyplot as plt from time import sleep import cv2 class Recurrent_Photo: ''' Recurrent Photo only for testing ''' def __init__(self, iterations=100, resize=(1280, 720)): self.camera = cv2.VideoCapture(0) self.vi...
3.15625
3
msldap/authentication/spnego/asn1_structs.py
blshkv/msldap
1
12797444
#!/usr/bin/env python3 # # Author: # <NAME> (@skelsec) # # https://www.rfc-editor.org/rfc/rfc4178.txt from asn1crypto.core import ObjectIdentifier, Sequence, SequenceOf, Enumerated, GeneralString, OctetString, BitString, Choice, Any, Boolean import enum import os import io TAG = 'explicit' # class UNIVERSAL = 0 AP...
1.929688
2
ecr-build-push.py
diegoaltx/drone-ecr-build-push
1
12797445
import docker import boto3 import os import sys import base64 from datetime import datetime, timezone def get_docker_client(): return docker.from_env() def get_ecr_clients(settings): clients = [] for region in settings['regions']: clients.append(boto3.client('ecr', aws_access_key_id=settings['acces...
2.0625
2
samcli/commands/local/lib/local_context.py
Bradleywboggs/aws-sam-cli
0
12797446
from samcli.cli.context import Context import click class LocalContext(Context): def __init__(self): super().__init__() self._aws_account_id = None @property def aws_account_id(self): return self._aws_account_id @aws_account_id.setter def aws_account_id(self, value): ...
2.203125
2
amfe/mor/hyper_red/__init__.py
sivasanarul/amfe_topopt
0
12797447
# # Copyright (c) 2018 TECHNICAL UNIVERSITY OF MUNICH, DEPARTMENT OF MECHANICAL ENGINEERING, CHAIR OF APPLIED MECHANICS, # BOLTZMANNSTRASSE 15, 85748 GARCHING/MUNICH, GERMANY, <EMAIL>. # # Distributed under 3-Clause BSD license. See LICENSE file for more information. # """ Hyper reduction module """ from .ecsw import...
0.996094
1
traffic_engineering/benchmarks/benchmark_helpers.py
stanford-futuredata/POP
15
12797448
<gh_stars>10-100 from collections import defaultdict from glob import iglob import argparse import os import sys sys.path.append("..") from lib.partitioning import FMPartitioning, SpectralClustering PROBLEM_NAMES = [ "GtsCe.graphml", "UsCarrier.graphml", "Cogentco.graphml", "Colt.graphml", "Tat...
1.773438
2
Products/GSContentManager/add_page.py
groupserver/Products.GSContentManager
0
12797449
# coding=utf-8 '''Implementation of the Add Page form. ''' try: from five.formlib.formbase import AddForm except ImportError: from Products.Five.formlib.formbase import AddForm # lint:ok from zope.component import createObject from zope.formlib import form from Products.Five.browser.pagetemplatefile import Zop...
2.09375
2
Array/Partition_List.py
shua2018ti/Google
87
12797450
''' Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should preserve the original relative order of the nodes in each of the two partitions. For example, Given 1->4->3->2->5->2 and x = 3, return 1->2->2->4->3->5. ''' # Definition for si...
3.96875
4