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
tools/extract/screener.py
renoneto/swing_trading
8
12770451
<reponame>renoneto/swing_trading<filename>tools/extract/screener.py from bs4 import BeautifulSoup from requests import Session import pandas as pd HEADERS = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) '\ 'AppleWebKit/537.36 (KHTML, like Gecko) '\ 'Chrome/75.0.3770....
3.25
3
resample/mov.py
VenoMpie/pyrescene
18
12770452
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2012-2014 pyReScene # # 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 ri...
1.945313
2
PEPit/examples/unconstrained_convex_minimization/subgradient_method.py
bgoujaud/PEPit
44
12770453
from math import sqrt from PEPit import PEP from PEPit.functions import ConvexLipschitzFunction def wc_subgradient_method(M, n, gamma, verbose=1): """ Consider the minimization problem .. math:: f_\\star \\triangleq \\min_x f(x), where :math:`f` is convex and :math:`M`-Lipschitz. This problem is a ...
3.90625
4
BasicExperiments/MovieListTask_Builder_d1.py
djangraw/PsychoPyParadigms
50
12770454
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This experiment was created using PsychoPy2 Experiment Builder (v1.90.1), on Tue May 8 15:02:31 2018 Created 5/8/18 by DJ. Updated 5/8/18 by DJ - added NetStationEEG code from https://github.com/imnotamember/PyNetstation (per Pete's instructions) Updated 6/8/18 by...
2.703125
3
deep_rl/actor_critic/__init__.py
jkulhanek/deep-rl-pytorch
7
12770455
<gh_stars>1-10 from .agent import ActorCriticAgent # noqa: F401 from .ppo import PPO # noqa: F401 from .a2c import A2C # noqa: F401 from .a2c import A2CDynamicBatch # noqa: F401 from .acktr import ACKTR # noqa: F401 from .a3c import A3C # noqa: F401 from .unreal import Unreal, UnrealAgent # noqa: F401
1.09375
1
abc/abc189/abc189c-2.py
c-yan/atcoder
1
12770456
<gh_stars>1-10 from sys import setrecursionlimit setrecursionlimit(10 ** 6) N, *A = map(int, open(0).read().split()) def f(a): n = len(a) m = min(a) result = m * n i = 0 for j in range(n): if a[j] != m: continue if i < j: result = max(result, f(a[i:j])) ...
2.484375
2
cli/list_train_en.py
ftnext/chatbot-lecture-2021
1
12770457
<gh_stars>1-10 from chatterbot import ChatBot from chatterbot.trainers import ListTrainer conversation = [ "Hello.", "Hi there!", "How are you doing?", "I'm doing great.", "That is good to hear.", "Thank you.", "You're welcome.", ] if __name__ == "__main__": chatbot = ChatBot("Training...
3.046875
3
samples/python_durable_bindings/DurableFanoutOrchestrationTrigger/__init__.py
msarm/azure-functions-durable-python
9
12770458
import logging import azure.functions as func import azure.durable_functions as df def generator_function(context): tasks = [] for i in range(30): current_task = context.df.callActivity("DurableActivity", str(i)) tasks.append(current_task) results = yield context.df.task_all(tasks) l...
2.5625
3
uqcsbot/scripts/parking.py
dhood/uqcsbot
38
12770459
from uqcsbot import bot, Command from uqcsbot.utils.command_utils import loading_status from typing import Tuple import requests from bs4 import BeautifulSoup as Soup def get_pf_parking_data() -> Tuple[int, str]: """ Returns a parking HTML document from the UQ P&F website """ page = requests.get("htt...
2.859375
3
example_vocmax_calculation.py
toddkarin/vocmax
5
12770460
<reponame>toddkarin/vocmax<gh_stars>1-10 """ This script shows an example calculation for calculating the maximum string length allowed in a particular location. The method proceeds in the following steps - Choose module parameters - Choose racking method - Set maximum allowable string voltage. - Import weather data...
2.625
3
src/config/common/vnc_type_conv.py
biswajit-mandal/contrail-controller
5
12770461
<filename>src/config/common/vnc_type_conv.py # # Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # import sys import re import types from types import * import vnc_api_service # dictionary representation to XML representation def dict_to_elem(wrap_tag, obj_dict): xml_str = "<%s>" % (wrap_tag) ...
2.390625
2
rpy2json/project/medias.py
jean-plank/rpy2html
2
12770462
<filename>rpy2json/project/medias.py from os import path def load(GAME_BASE_DIR, res, media_type, key, media): if media != None: full_path = path.join(GAME_BASE_DIR, media) if path.isfile(full_path): res[media_type][key] = full_path return else: var_name...
2.53125
3
users/management/commands/compute_first_sighting.py
maverick-labs-pune/wikirumours
0
12770463
import csv import datetime import os from django.contrib.gis.geos import Point from django.core.management import BaseCommand, CommandError from django.db import transaction from geopy import Nominatim from countries.models import Country from report.models import Report, Sighting, ReportedViaChoice from users.models...
2.125
2
pyjournal.py
dwillcox/pyjournal2
0
12770464
<gh_stars>0 #!/usr/bin/env python3 """ a simple commandline-driven scientific journal in LaTeX managed by git """ import pyjournal2.main_util as main_util if __name__ == "__main__": tdefs = main_util.read_config() targs = main_util.get_args(tdefs) main_util.main(targs, tdefs)
1.617188
2
modules/vcd_vapp_vm_nic.py
MichalTaratuta/ansible-module-vcloud-director
0
12770465
<gh_stars>0 # Copyright © 2018 VMware, Inc. All Rights Reserved. # SPDX-License-Identifier: BSD-2-Clause # !/usr/bin/python ANSIBLE_METADATA = { 'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community' } DOCUMENTATION = ''' --- module: vcd_vapp_vm_nic short_description: Ansible Modul...
1.554688
2
cse521/hw1/p1_data/old/p1_sorted1.py
interesting-courses/UW_coursework
2
12770466
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Oct 5 23:54:49 2018 @author: tyler """ import numpy as np #%% def postprocess_cut(supernodes_original,supernodes_f,supernode_nonempty_Q,not_loop_Q): ''' returns : partition of original vertices of $G$ and size of coresponding cut '''...
2.78125
3
main.py
apl-ocean-engineering/DeepLabv3.pytorch
0
12770467
import numpy as np import torch from scipy.io import loadmat import cv2 import time import deepLabv3.deeplab as deeplab from deepLabv3.pascal import VOCSegmentation from deepLabv3.cityscapes import Cityscapes from deepLabv3.utils import AverageMeter, inter_and_union, load_model from deepLabv3.detector import Detector...
2.125
2
tests/test_worker.py
rpSebastian/AutoCFR
1
12770468
import time from autocfr.worker import Worker, VecWorker, GroupVecWorker import numpy as np import ray class DiverContainer(Worker): @ray.remote def run(task): a = task["a"] b = task["b"] result = { "worker_index": task["worker_index"], "group_index": task["grou...
2.5
2
research/cv/ArtTrack/src/model/losses.py
mindspore-ai/models
77
12770469
<reponame>mindspore-ai/models<gh_stars>10-100 # Copyright 2022 Huawei Technologies Co., Ltd # # 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 # # ...
2.28125
2
oauth/migrations/0003_auto_20190531_0914.py
enjoy-binbin/Django-blog
111
12770470
<reponame>enjoy-binbin/Django-blog # Generated by Django 2.1.5 on 2019-05-31 09:14 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('oauth', '0002_auto_20190512_1129'), ] operations = [ migrations.AlterModelOptions( name='oauthconfig'...
1.554688
2
pirates/piratesgui/SheetFrame.py
itsyaboyrocket/pirates
3
12770471
# uncompyle6 version 3.2.0 # Python bytecode 2.4 (62061) # Decompiled from: Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)] # Embedded file name: pirates.piratesgui.SheetFrame from pirates.piratesgui import ListFrame from pirates.piratesgui import PiratesGuiGlobals class SheetFram...
2.234375
2
src/tools/pid_printer.py
rishvantsingh/kmlog
0
12770472
# Copyright 2021 - 2022, <NAME> <<EMAIL>>, Dr. <NAME> <<EMAIL>> # Use of this source code is governed by an MIT-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/MIT. # This is a small debug utility to print the pid KMLogger is # running on to help with profiling import os ...
1.5625
2
src/intelliflow/core/platform/definitions/aws/kms/client_wrapper.py
amzn/rheoceros
4
12770473
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 import json import logging from typing import Set, Tuple from botocore.exceptions import ClientError from intelliflow.core.platform.definitions.aws.common import _is_trust_policy_AWS_principle_deleted logger =...
1.992188
2
apis/rest/agent_checkin.py
3lpsy/FactionAPI
1
12770474
from flask import jsonify, request from flask_restful import Resource, reqparse from processing import agent_checkin from processing.user_role import authorized_groups from logger import log agent_checkin_parser = reqparse.RequestParser() agent_checkin_parser.add_argument('TransportId') agent_checkin_parser.add_argum...
2.203125
2
client2.py
pabitra0177/ITR-internship
0
12770475
<reponame>pabitra0177/ITR-internship import socket import time # ? HOW to check the connection does exist # ? How to unbind # ? socket.error: [Errno 111] Connection refused s=socket.socket() host='127.0.0.1' port=1121 while s.connect((host,port)): print s.recv(1024) time.sleep(0.5)
3.21875
3
vmain.py
DBMSRmutl/meterOCR
7
12770476
import os import sys import subprocess foldername = 'results' ocrFileName = 'python v1-3-arg.py' for filename in os.listdir('/home/ubuntu/pyview/Test/pics'): #print filename fullFilename = (u'/home/ubuntu/pyview/Test/pics/'+filename) #create new path for results pathForEachResult = foldernam...
2.578125
3
zoneh/threads/pusher.py
RaminAT/zoneh
8
12770477
<gh_stars>1-10 """Pusher threads module.""" import logging from telegram import InlineKeyboardMarkup, InlineKeyboardButton from zoneh.captcha import captcha from zoneh.commons import CommonThread from zoneh.conf import get_config from zoneh.parsers.formatter import FormattedRecord from zoneh.utils import shallow_sle...
2.40625
2
main/change.py
PiRobotLm5G/Adeept_RaspTank
0
12770478
<filename>main/change.py<gh_stars>0 #!/usr/bin/python import time import smbus import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) bus = smbus.SMBus(1) def __WriteByte(register16, addr, data): a1 = (register16 >> 8) & 0xFF a0 = register16 & 0xFF try: bus.write_i2c_block_data(addr, a1, [a0, (data & 0xFF...
2.765625
3
last_social_activity/social_networks/facebook.py
intelligenia/django-last-social-activity
2
12770479
<gh_stars>1-10 # -.- coding: utf-8 -.- from __future__ import unicode_literals, absolute_import from django.conf import settings from dateutil import parser import requests try: from urllib.request import urlopen, HTTPError except ImportError: from urllib2 import urlopen, HTTPError from httplib import HTTPExcept...
2.515625
3
kive/FixtureFiles/demo/CodeResources/prelim_map.py
cfe-lab/Kive
2
12770480
<reponame>cfe-lab/Kive #! /usr/bin/env python """ Shipyard-style bowtie2 Run bowtie2 on paired-end FASTQ data sets with user-supplied *.bt2 bowtie2 SAM format output to <stdout> for redirection via subprocess.Popen Sort outputs by refname. Convert to CSV format and write to file. """ import argparse import csv import...
2.25
2
asynctest.py
uskoo/CitrusDrop
0
12770481
import json import os from urllib.parse import parse_qsl import asyncio from requests_oauthlib import OAuth1Session from flask import Flask, jsonify, request, redirect, url_for from flask import render_template from citrus_drop import CitrusDrop app = Flask(__name__) user_drop = { 'screen_name': '未取得', ...
2.6875
3
stRT/tdr/__init__.py
Yao-14/stAnalysis
0
12770482
from .models import * from .widgets import *
1.101563
1
saau/sections/ancestry/irish.py
Mause/statistical_atlas_of_au
0
12770483
<reponame>Mause/statistical_atlas_of_au # ancestry-irish from . import AncestryImageProvider from ...utils.header import render_header_to class IrishAncestryImageProvider(AncestryImageProvider): filename = 'irish.json' ancestry_name = 'Irish' def build_image(self): return render_header_to( ...
2.375
2
rest-service/manager_rest/security/user_handler.py
TS-at-WS/cloudify-manager
124
12770484
<filename>rest-service/manager_rest/security/user_handler.py ######### # Copyright (c) 2013 GigaSpaces Technologies Ltd. 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 # ...
1.921875
2
api_service.py
gve-sw/gve_devnet_ise_expanded_grace_period_guest_portal
0
12770485
<gh_stars>0 # Copyright (c) 2021 Cisco and/or its affiliates. # This software is licensed to you under the terms of the Cisco Sample # Code License, Version 1.1 (the "License"). You may obtain a copy of the # License at # https://developer.cisco.com/docs/licenses # All use of the material herein must ...
1.6875
2
Paper_13/Classes/Transfer_to_RAM.py
ADGiuliano/DevAndCompForRecSys2016
0
12770486
""" @author: <NAME> @contact: <EMAIL> @organization: University of Padua """ import sqlite3 import datetime import Pikle_operations as p_o from Functions import Time_Calcolation as tc from Functions import Users_dict as u_d from Functions import Items_dict as i_d from Functions import Users_Items_groups_di...
2.4375
2
src/Kattis/2021/MSOE_Comp_Prog/Week_9/D/missinggnomes2.py
phungj/MSOE_Comp_Prog_Py
0
12770487
params = input().split(" ") params = [int(param) for param in params] if params[0] == params[1]: for i in range(1, params[0] + 1): print(input()) exit(0) else: all_gnomes = set(range(1, params[0] + 1)) remaining_gnomes = [] sorted = True prev_gnome = -1 for _ in range(params[1]):...
3.484375
3
sympybotics/kinematics.py
ZhangMeiHuiROS/Sym_RobotD
117
12770488
import sympy _id = lambda x: x class Kinematics(object): """Robot symbolic Jacobians. kinobj.J: list of link frame Jacobians - complete (6 x N): [linear_velocity angular_velocity] = J * joint_velocities kinobj.Jc: list of link center-of-mass Jacobians - c...
2.71875
3
deriv_api/easy_future.py
sasikala-binary/python-deriv-api
2
12770489
<filename>deriv_api/easy_future.py from __future__ import annotations import asyncio from asyncio import Future, CancelledError, InvalidStateError from typing import Any, Optional, TypeVar, Union, Callable import weakref _S = TypeVar("_S") class EasyFuture(Future): """A class that extend asyncio Future class and...
2.640625
3
setup.py
ashb/gh-action-encrypted-secrets
2
12770490
# Copyright 2020 Astronomer 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 writin...
1.929688
2
tests/cli/__init__.py
pcarranzav2/pyuavcan
0
12770491
<reponame>pcarranzav2/pyuavcan # # Copyright (c) 2019 UAVCAN Development Team # This software is distributed under the terms of the MIT License. # Author: <NAME> <<EMAIL>> # import sys import typing import dataclasses @dataclasses.dataclass(frozen=True) class TransportConfig: cli_args: typing.Sequence[str] ...
2.265625
2
qbittorrent/connectors.py
CuteFwan/aqbit
0
12770492
from .errors import TorrentHashNotFound, TorrentNotValid, HttpException import aiohttp import asyncio import json class AConnector: def __init__(self, *, base, session = None, loop = None): self.base = base self.loop = loop or asyncio.get_event_loop() self.session = session async def ...
2.765625
3
tests/test_aquamonitor_integration_client.py
NIVANorge/odm2-postgres-api
0
12770493
import os import pytest from httpx import AsyncClient from odm2_postgres_api.aquamonitor.aquamonitor_client import ( get_method_by_id, get_project_stations, get_taxonomy, get_taxonomy_domain_id, get_taxonomy_codes, ) from odm2_postgres_api.aquamonitor.aquamonitor_mapping import METHODS_NIVABASE_MA...
2.421875
2
testproj/testproj/util.py
MilanPecov/drf-yasg
2,788
12770494
from django.templatetags.static import static from django.utils.functional import lazy static_lazy = lazy(static, str)
1.40625
1
src/werdich_cfr/models/Cnn3D.py
awerdich/werdich-cfr
0
12770495
<reponame>awerdich/werdich-cfr # Imports from tensorflow.keras import layers, Model from tensorflow.keras.layers import BatchNormalization, Conv3D, MaxPooling3D, Dense, Flatten class Convmodel: kreg = None # regularizers.l2(0.001) #None pad = 'valid' strd = None def __init__(self, model_dict): ...
2.296875
2
DailyProgrammer/DP20120706B.py
DayGitH/Python-Challenges
2
12770496
""" Write a program that, given an ASCII binary matrix of 0's and 1's like this: 0000000000000000 0000000000000000 0000011001110000 0000001111010000 0000011001110000 0000011011100000 0000000000110000 0000101000010000 0000000000000000 0000000000000000 0000000000000000 Outputs the smallest cropped sub-matrix that still...
3.65625
4
resp.py
ainilili/ocr-server
1
12770497
import json class RespVo: def __init__(self): self.code = 0 self.msg = '' self.data = {}
2.109375
2
app/qnn_builder.py
mahabubul-alam/qnn_circuits_pennylane
10
12770498
import pennylane as qml import numpy as np if __name__ != '__main__': from . encoder.encoding_circuits import EncodingCircuitsPennylane from . pqc.parametric_circuits import ParametricCircuitsPennylane from . measurement.measurement_circuits import MeasurementCircuitsPennylane class PennylaneQNNCi...
2.34375
2
engine.py
gaetanV/python
0
12770499
pointer=-1 lock=0 def setSeq(data) : if lock == 1: exit(2) globals()['pointer']=-1 globals()['data']=data.split(',') globals()['lock']=1 def raw_input() : globals()['pointer']+=1 try: return data[pointer] except IndexError: exit(0) def open(path,mode) : exit(3)
2.96875
3
raft_asyncio/server.py
aratz-lasa/py-raft
0
12770500
import asyncio from typing import List from . import utils from .abc import IRaftServer from .errors import * from .rpc import protocol as prot from .rpc import rpc from .state_machine import RaftStateMachine, State, Command ELECTION_TIMEOUT = 0.5 FLEXIBLE_PAXOS_QUORUM = 2 / 6 RPC_TIMEOUT = 1 class ClusterMember: ...
2.3125
2
train_speaker.py
airbert-vln/airbert
17
12770501
""" Train a speaker model on R2R """ import logging from typing import List, Tuple, Dict import copy import os import random import shutil import sys from datetime import datetime from tqdm import tqdm import numpy as np import torch import torch.distributed as dist import torch.nn.functional as F from torch import nn ...
2.25
2
problem_1.py
adamkells/project_euler
0
12770502
result = 0 for i in range(1000): if i%3==0 or i%5==0: result += i print(result)
3.78125
4
PiCN/Layers/LinkLayer/FaceIDTable/test/__init__.py
NikolaiRutz/PiCN
0
12770503
<gh_stars>0 """Tests for the FaceIDTable"""
0.914063
1
cross_validation.py
JeffreyCNL/hidden_markov
0
12770504
<reponame>JeffreyCNL/hidden_markov # this is to use cross validation to obtain the number of states import numpy as np from sklearn.model_selection import KFold from hmm_class import hmm import random from sklearn.preprocessing import normalize # load the obs and split into k fold. def split_load_data(filename...
2.671875
3
Tesi/3_modelTester/5_costsTester.py
LucaCamerani/EcoFin-library
9
12770505
""" 5_costsTester.py Created by <NAME> at 18/02/2021, University of Milano-Bicocca. (<EMAIL>) All rights reserved. This file is part of the EcoFin-Library (https://github.com/LucaCamerani/EcoFin-Library), and is released under the "BSD Open Source License". """ """ 4_portfolioTester.py Created by <NAME> at 10/02/20...
1.828125
2
extractor/credit.py
shalev67/AdvWebProject
1
12770506
import textract from itertools import tee import base64 import bson import uuid import os from flask import Flask, request, jsonify import datetime from pymongo import MongoClient import string import json UPLOAD_FOLDER = '/tmp/' ALLOWED_EXTENSIONS = {'pdf'} app = Flask(__name__) app.config['UPLOAD_FOLDER'] = UPLOAD_...
2.25
2
utils/folder_functions.py
miniautonomous/engine_ai
1
12770507
<gh_stars>1-10 import os import platform import json import glob import tkinter import tkinter.filedialog as file_dialog from tkfilebrowser import askopendirnames as multi_directories class UserPath(object): def __init__(self, app_module=None): """ This class covers a bunch of generic file IO op...
3.28125
3
tests/unit_tests/test_get_pinnacle_data.py
conorreid/dst_scoring_model
1
12770508
<reponame>conorreid/dst_scoring_model import unittest.mock as mock import dst_scoring_model.get_pinnacle_data as get_pinnacle_data def construct_request_content(): response = mock.MagicMock() response.content = mock.MagicMock(return_value="hello") return response @mock.patch("requests.get", return_valu...
2.515625
3
setup.py
toluaina/essync
1
12770509
<reponame>toluaina/essync<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- """The setup script.""" import os import re from setuptools import find_packages, setup HERE = os.path.dirname(os.path.abspath(__file__)) def get_version() -> str: filename: str = os.path.join(HERE, "pgsync", "__init__.py") ...
1.421875
1
try.py
tssga-arch/myotc
0
12770510
#!/usr/bin/env python3 import re from pprint import pprint import os import yaml import random import string from passlib.hash import md5_crypt, sha256_crypt, sha512_crypt secrets_file = '_secrets_file_' yaml_pp_vars = dict(os.environ) yaml_pp_vars[secrets_file] = '_secrets.yaml' secrets = None sshkey_re = re.comp...
2.53125
3
setup.py
cheshire3/cheshire3
3
12770511
"""Setup file for cheshire3 package.""" from __future__ import with_statement import sys import os import inspect from warnings import warn # Import Distribute / Setuptools from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages from pkg_resources import DistributionNotFound...
2.171875
2
env/lib/python3.8/site-packages/ask_sdk_core/view_resolvers/locale_template_enumerator.py
adamash99/alexa-play-pot-of-greed
496
12770512
<gh_stars>100-1000 # -- coding: utf-8 -- # # Copyright 2019 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://aws.amazon.com/ap...
2.125
2
uw_iasystem/__init__.py
uw-it-aca/uw-restclients-iasystem
0
12770513
# Copyright 2021 UW-IT, University of Washington # SPDX-License-Identifier: Apache-2.0 import json import logging from restclients_core.exceptions import DataFailureException from uw_iasystem.dao import IASystem_DAO from uw_iasystem.exceptions import TermEvalNotCreated from uw_iasystem.util.thread import ThreadWithRes...
2.265625
2
pytorch-official-tutorials/3_neural_networks.py
aFewThings/pytorch-tutorial
0
12770514
<filename>pytorch-official-tutorials/3_neural_networks.py # Define NN import torch import torch.nn as nn import torch.nn.functional as F class Net(nn.Module): def __init__(self): super(Net, self).__init__() # 1 input image channel(grayscale), 6 output channels, 3x3 square convolution kern...
3.828125
4
djpaddle/urls.py
abroun/dj-paddle
32
12770515
<gh_stars>10-100 from django.urls import path from . import views app_name = "djpaddle" urlpatterns = [ path("webhook/", views.paddle_webhook_view, name="webhook"), path("post-checkout/", views.post_checkout_api_view, name="post_checkout_api"), ]
1.65625
2
visualization/basic_examples/anim_pc_csv.py
KeyueZhu/XenomatiX
1
12770516
<reponame>KeyueZhu/XenomatiX<gh_stars>1-10 import open3d as o3d import numpy as np import time import csv import os from matplotlib import cm # read csv files and store all frames # play frame by frame after that folder = "/home/mcity/xenomatix/visualization/pc_csv/" # folder = "/home/mcity/Desktop/eastern_market_xpc...
2.265625
2
main.py
mrkiril/HW4_probability_cache
0
12770517
import asyncio import logging import os import sys import redis import aiohttp_jinja2 import jinja2 import uvloop from rediscluster import RedisCluster from aiohttp import log, web from aiomisc import ThreadPoolExecutor from peewee import Proxy from peewee_asyncext import PooledPostgresqlExtDatabase from app.api.rout...
2.15625
2
code/004.py
i4leader/Python-Basic-Pratice-100question
0
12770518
<reponame>i4leader/Python-Basic-Pratice-100question<gh_stars>0 #!/usr/bin/python3 year = int(input("请输入年:")) month = int(input("请输入月份:")) day = int(input("请输入几号:")) leapyear = [0,31,29,31,30,31,30,31,31,30,31,30,31] normalyear = [0,31,28,31,30,31,30,31,31,30,31,30,31] days = 0 i = month if year%4 == 0: for temp...
3.5625
4
master_code/otherMiscCode/tools_da_riordinare/kd3hdf5.py
brunetto/MasterThesisCode
0
12770519
#!/usr/bin/env python import time import tables as tb import numpy as np import sys # Global variables for patching the tree. n_traverse = 0 #################################################################################### # kd3 # ...
3.28125
3
examples/dip/blog/views.py
navycut/navycut
13
12770520
<reponame>navycut/navycut from navycut.urls import MethodView from navycut.http import JsonResponse from .models import * # write your views here. class IndexView(MethodView): def get(self): return JsonResponse(message="Salve Mundi!") class GargiView(MethodView): def get(self): gargi= Gargi.q...
2.34375
2
src/lib/model.py
Timokleia/QCANet
26
12770521
# -*- coding: utf-8 -*- import numpy as np import chainer from chainer import cuda, Function, Variable from chainer import Link, Chain, ChainList import chainer.functions as F import chainer.links as L from src.lib.loss import softmax_dice_loss class Model_L2(Chain): def __init__( self, nd...
2.359375
2
asseteour/resolver/base_asset_wrapper.py
ImagineersHub/asseteour
0
12770522
<gh_stars>0 from abc import ABCMeta, abstractmethod from typing import Dict class BaseAssetWrapper(metaclass=ABCMeta): @classmethod @abstractmethod def parse_obj(cls, payload: Dict): pass @classmethod @abstractmethod def schema_json(cls, indent=4): pass @abstractmethod ...
2.671875
3
core/domain/summary_services_test.py
Himanshu1495/oppia
0
12770523
<filename>core/domain/summary_services_test.py<gh_stars>0 # coding: utf-8 # # Copyright 2014 The Oppia 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 # # h...
1.976563
2
MeasureCoffee.py
ciauri/CoffeeRobot
2
12770524
<reponame>ciauri/CoffeeRobot<filename>MeasureCoffee.py import numpy as np import argparse import glob import cv2 import io import picamera from Twitter import Twitter import onlineCoffee import time def auto_canny(image, sigma=0.33): v = np.median(image) lower = int(max(0, (1.0 - sigma) * v)) upper = int(mi...
2.75
3
pyloess.py
jcrotinger/pyloess
3
12770525
# pylint: disable-msg=E1101 """ Wrapper to lowess and stl routines. LOWESS: Initial Fortran code available at: http://netlib.bell-labs.com/netlib/go/lowess.f.gz initial author: <NAME>, 1979. Simple to double precision conversion of the Fortran code by Pierre Gerard-Marchant, 2007/03. STL: Initial Fortran code availa...
1.34375
1
python/oneflow/compatible/single_client/__init__.py
grybd/oneflow
0
12770526
<reponame>grybd/oneflow """ Copyright 2020 The OneFlow 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 ...
1.53125
2
napari/plugins/__init__.py
yinawang28/napari
0
12770527
<gh_stars>0 import sys from pluggy import HookimplMarker from ._hook_callers import execute_hook from .exceptions import PluginError, PluginImportError, PluginRegistrationError from .manager import PluginManager # Marker to be imported and used in plugins (and for own implementations) # Note: plugins may also just i...
1.828125
2
orchestration/__init__.py
gonzalorodrigo/ScSFWorkload
1
12770528
<gh_stars>1-10 import os from time import sleep from commonLib.DBManager import DB from orchestration.analyzing import (AnalysisRunnerSingle, AnalysisRunnerDelta, AnalysisGroupRunner) from orchestration.definition import (ExperimentDefinition, ...
2.421875
2
003-input.py
richardvecsey/python-basics
3
12770529
<filename>003-input.py """ Get input from user via console or command line ----------------------------------------------- Output: (string) """ name = input('What is your name? ') print('Hello {}!'.format(name))
3.8125
4
security_monkey/auditors/github/org.py
boladmin/security_monkey
4,258
12770530
# Copyright 2017 Netflix # # 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 ag...
2.546875
3
hivs_pp/migrations/0012_allow_blank_gender_field_on_delivery.py
tehamalab/hivs
0
12770531
# Generated by Django 2.0.7 on 2018-10-25 16:57 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('hivs_pp', '0011_rename_field_confidential_to_is_confidential_on_service'), ] operations = [ migrations.Alte...
1.59375
2
core/WxMsgModel.py
NextStand/WechatBiz
1
12770532
<gh_stars>1-10 # coding:utf-8 """ 微信消息模板 """ __author__ = 'BLUE' __time__ = 'Wed May 22 2019 11:14:55 GMT+0800' # ------------------------------------------------------------------------ from .Exceptions import ParseError from .WechatBase import WxBizMsgTypeBase, WxBizCrmEventBase, WxBizContactUserBase, WxBizContactPa...
2.1875
2
molsysmt/attic/fix.py
dprada/molsysmt
3
12770533
<filename>molsysmt/attic/fix.py from .multitool import get_form from .multitool import get as _get from ._private_tools.exceptions import * _chain_IDs=['A','B','C','D','E','F','G','H','I','J','K','L','M', 'N','O','P','Q','R','S','T','U','V','W','X','Y','Z'] def fix_chains(item,chains=None): in_form =...
2.28125
2
plugins/beacon/setup.py
ernadhalilovic/alerta-contrib
0
12770534
from setuptools import setup, find_packages version = '0.0.1' setup( name="alerta-beacon", version=version, description='Alerta plugin for Beacon', url='https://github.com/ernadhalilovic/alerta-contrib', license='MIT', author='<NAME>', author_email='<EMAIL>', packages=find_packages(), ...
1.125
1
niapy/tests/test_task.py
hrnciar/NiaPy
0
12770535
<filename>niapy/tests/test_task.py # encoding=utf8 from unittest import TestCase import numpy as np from numpy.random import default_rng from niapy.benchmarks import Benchmark from niapy.task import StoppingTask, ThrowingTask from niapy.util import full_array, FesException, GenException, RefException class MyBenchm...
2.484375
2
torchfes/colvar/coordination.py
AkihideHayashi/torchfes1
0
12770536
from math import inf from typing import Dict, Tuple, List import torch from torch import nn, Tensor import pointneighbor as pn from ..adj import get_adj_sft_spc, vec_sod from .. import properties as p def ravel1(idx: List[Tensor], siz: List[int]): return pn.fn.ravel1( torch.stack(idx), torch.tensor(siz, d...
2.15625
2
tests/wheel_google_cloud.py
gflaherty/rules_pyz
26
12770537
import google print 'google:', google, google.__path__ import google.cloud print 'google.cloud:', google.cloud import google.cloud.datastore def main(): # tests "extras" dependencies, as well as native dependencies # google.cloud is also an "implicit" namespace package: the tool needs to make it a "real" ...
2.09375
2
npt/datasets/income.py
jacobkimmel/non-parametric-transformers
302
12770538
<filename>npt/datasets/income.py from pathlib import Path import numpy as np import pandas as pd from sklearn.datasets import fetch_openml from npt.datasets.base import BaseDataset class IncomeDataset(BaseDataset): def __init__(self, c): super().__init__( fixed_test_set_index=-99762) ...
2.984375
3
src/library/requirements.py
dylanhogg/crazy-awesome-python
13
12770539
<filename>src/library/requirements.py import urllib.request import urllib.error from pathlib import Path from loguru import logger def save_content(repopath, branch, filename, content): folder = "data/" Path(folder).mkdir(parents=True, exist_ok=True) out_filename = folder + repopath.replace("/", "~") + f...
2.96875
3
libraries/botbuilder-core/tests/test_private_conversation_state.py
Fl4v/botbuilder-python
388
12770540
<filename>libraries/botbuilder-core/tests/test_private_conversation_state.py # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import aiounittest from botbuilder.core import MemoryStorage, TurnContext, PrivateConversationState from botbuilder.core.adapters import TestAdapte...
2.421875
2
school/migrations/0010_auto_20200816_0326.py
threecoolcat/ThreeCoolCat
6
12770541
<filename>school/migrations/0010_auto_20200816_0326.py # Generated by Django 3.0.7 on 2020-08-16 03:26 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('school', '0008_auto_20200816_0303'), ] operations = [ # migrations.AlterField( ...
1.648438
2
src/h02_learn/dataset/__init__.py
devpouya/GeneralizedEasyFirstParser
0
12770542
<reponame>devpouya/GeneralizedEasyFirstParser from os import path from torch.utils.data import DataLoader from h01_data import load_vocabs, load_embeddings, get_ud_fname, get_oracle_actions#,get_oracle_actions_small,get_ud_fname_small from utils import constants from .syntax import SyntaxDataset, LanguageBatchSampler ...
2.375
2
buildroot/support/testing/infra/emulator.py
rbrenton/hassos
617
12770543
<reponame>rbrenton/hassos import pexpect import infra class Emulator(object): def __init__(self, builddir, downloaddir, logtofile, timeout_multiplier): self.qemu = None self.downloaddir = downloaddir self.logfile = infra.open_log_file(builddir, "run", logtofile) # We use elastic ...
2.296875
2
main.py
harunlakodla/colab-socket-image-pyngrok
0
12770544
<gh_stars>0 """ loop dosyası içerisinde raspberry pi programımızın akışı sağlanacaktır.. resimler webSocketsOpencvServer üzerinden akışı sağlanacaktır.. roboSocketCom üzerinden pyserial kütüphanesi sayesinde verilerimizin akışı mikrokontrolcüye gidecektir. """ import socket,threading,_thread,asyncio from webSocke...
2.796875
3
azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/models/__init__.py
JonathanGailliez/azure-sdk-for-python
1
12770545
<filename>azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/models/__init__.py # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license inf...
1.4375
1
subtask_134/generate_submission_format_retrieval_teststd.py
i2r-simmc/i2r-simmc-2021
0
12770546
import argparse import json from copy import deepcopy import numpy as np def write_submission_output(dialog_turn_id_data, retrieval_scores, output_submission_format_path): """ Write the model_scores in """ submission_format_output=[] for dialog in dialog_turn_id_data: _dialog=[] for ...
2.828125
3
riffraff/riffle.py
RealPolitiX/riffraff
0
12770547
<filename>riffraff/riffle.py #! /usr/bin/env python # -*- coding: utf-8 -*- import numpy as np def riffle(*arr): """ Interleave multiple arrays of the same number of elements. **Parameter**\n *arr: array A number of arrays **Return**\n riffarr: 1D array An array with interle...
3.3125
3
lang/py/cookbook/v2/source/cb2_2_29_sol_1.py
ch1huizong/learning
0
12770548
def VersionFile(file_spec, vtype='copy'): import os, shutil if os.path.isfile(file_spec): # check the 'vtype' parameter if vtype not in ('copy', 'rename'): raise ValueError, 'Unknown vtype %r' % (vtype,) # Determine root filename so the extension doesn't get longer n...
2.984375
3
frankenstrings/frankenstrings.py
CybercentreCanada/assemblyline-service-frankenstrings
2
12770549
""" FrankenStrings Service """ import binascii import hashlib import mmap import os import re import traceback from typing import Dict, Iterable, List, Optional, Set, Tuple import magic import pefile from assemblyline.common.net import is_valid_domain, is_valid_email from assemblyline.common.str_utils import safe_s...
1.882813
2
src/metadata/get_dependents.py
Yanivmd/maloss
1
12770550
<gh_stars>1-10 import pickle import sys results = [] def getdependentsofpackage(pkg_manager, pkg_name): for pkg in G.predecessors(pkg_name): print pkg if pkg == pkg_manager: continue else: if pkg not in results: results.append(pkg) getde...
2.859375
3