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
oas_test.py
Yixian-work/cs229-project
0
54100
from cs229_project_scenario import ObstacleAvoidanceScenario import numpy as np import gym import time from matplotlib import pyplot as plt if __name__ == "__main__": oas = ObstacleAvoidanceScenario() #oas = gym.make() dt = 0.1 u = (0., 0.) total_reward = 0. plot_reward = [] fo...
3.21875
3
src/lib/utils.py
snxfz947/EmailForwardingValidator
0
54101
<filename>src/lib/utils.py import json import os def config_get_dev(): with open("../dev_config.json") as config_file: return json.load(config_file) def config_get_user(): with open("../user_config.json") as config_file: return json.load(config_file) def config_get_backup_size(): retur...
2.171875
2
Soft_Computing/fuzzy_relations.py
nirantak/programming-exercises
1
54102
""" Implement Fuzzy set relations like - Max-Min and Max-Product """ import sys from textwrap import dedent from typing import List from .fuzzy_sets import max_min, max_product def get_output(x: List[List[float]]) -> str: res = "\n ".join(str(i) for i in x) return f"[{res}]" def main(): choices = ["Max...
3.90625
4
auto_stars.py
fjwCode/auto-stars
7
54103
<gh_stars>1-10 from time import sleep from faker import Faker from platinum import Chromium from selenium import webdriver def generate_account(mark='yeah'): faker = Faker() user = faker.name().replace(' ', mark) email = mark + faker.email() password = faker.password() return user, email, passwo...
2.59375
3
Segger/promod_dialog.py
gregdp/segger
6
54104
# Copyright (c) 2020 <NAME> - <EMAIL> # 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, merge, publish, di...
1.554688
2
python/cvi_toolkit/inference/onnx/run_onnx_detector_yolo.py
sophgo/tpu_compiler
3
54105
#!/usr/bin/env python3 import numpy as np import os import sys import argparse import glob import time import onnx import onnxruntime import cv2 import caffe from cvi_toolkit.model import OnnxModel from cvi_toolkit.utils.yolov3_util import preprocess, postprocess_v2, postprocess_v3, postprocess_v4_tiny, draw def chec...
2.296875
2
6.0002/problem_sets/ps1/ps1b.py
Haplo-Dragon/MIT
0
54106
########################### # 6.0002 Problem Set 1b: Space Change # Name: <NAME> # Collaborators: <NAME>, Yale CS lecture - Computer Science 201a, Prof. <NAME> # Time: # Author: charz, cdenise # ================================ # Part B: Golden Eggs # ================================ # Problem 1 def dp_make_weight(e...
4.25
4
algolib/graph/undirected.py
niemmi/algolib
0
54107
<reponame>niemmi/algolib<gh_stars>0 """Undirected graph that doesn't have multi-edges but may contain loops. Both vertices and edges may have associated properties. Vertices as stored as an adjacency matrix using dicts and as a separate dict that maybe iterated over. Time complexity of the operations: - check if edge ...
3.515625
4
jraph/experimental/sharded_graphnet.py
speckhard/jraph
0
54108
<filename>jraph/experimental/sharded_graphnet.py # Copyright 2020 DeepMind Technologies Limited. # 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 # https://www.apache.org/licenses/LICENSE-2.0 ...
2.078125
2
src/vastconntally.py
fegan104/roam
1
54109
import pickle import time import numpy as np from macrel import graphs from macrel import vast11data as vast INTERVAL_SEC = 900.0 N = len(vast.NODES) SERVICES = { 1: "Mux", 17: "Quote", 21: "FTP", 22: "SSH", 23: "Telnet", 25: "SMTP", 53: "DNS", 80: "HTTP", 88: "Kerberos", ...
2.078125
2
pylibscrypt/test_properties.py
jvarho/pylibscrypt
19
54110
# Copyright (c) 2017-2021, <NAME> # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WA...
2.4375
2
libraries/mosek/9.3/tools/examples/fusion/python/portfolio_4_transcost.py
TimDSF/SBSOS_ShapeSegmentation
0
54111
<reponame>TimDSF/SBSOS_ShapeSegmentation<filename>libraries/mosek/9.3/tools/examples/fusion/python/portfolio_4_transcost.py ## # Copyright: Copyright (c) MOSEK ApS, Denmark. All rights reserved. # # File: portfolio_4_transcost.py # # Purpose : Implements a basic portfolio optimization model # with ...
2.65625
3
Experiments/Spark/count_caching.py
HTaeha/Deep-Learning-based-Coding-Guide-onAspect
0
54112
<filename>Experiments/Spark/count_caching.py<gh_stars>0 input_repository = '/home/alog0/taeha/Spark/Count_caching/input/All_uncache_1' count = 0 with open(input_repository, 'r', encoding='utf-8-sig') as data_file: while True: line = data_file.readline() if not line: break line_split = line.split(':') path ...
2.9375
3
api-v2/config_helper.py
MikeChurvis/mikechurvis.github.io
1
54113
from django.core.exceptions import ImproperlyConfigured def validate_settings(settings, required_settings: set[str]): required_settings = { 'CONTACTFORM_NAME_MAX_LENGTH', 'CONTACTFORM_ORGANIZATION_MAX_LENGTH', 'CONTACTFORM_EMAIL_MAX_LENGTH', 'CONTACTFORM_EMAIL_REGULAR_EXPRESSION', ...
2.59375
3
tasks.py
mcataford/lukewarmbeer
0
54114
from invoke import task class NoDeviceFoundException(Exception): pass SKETCH_PATH = './src/LukeWarmBeer' def _find_board(ctx): board_list = ctx.run('bin/arduino-cli board list', hide='stdout') lines = board_list.stdout.split('\n') for line in lines[1:]: cleaned_line = [token for token in lin...
2.421875
2
library/publicip.py
c3w/common
0
54115
#!/usr/bin/python3 from ansible.module_utils.basic import * from ansible.module_utils.urls import * import json import socket def get_ip_google(): try: response = open_url('http://169.254.169.254/computeMetadata/v1/instance/network-interfaces/0/access-configs/0/external-ip', headers={'Metadata...
2.296875
2
finbot/apps/appwsrv/blueprints/base.py
jean-edouard-boulanger/finbot
1
54116
<reponame>jean-edouard-boulanger/finbot from finbot.core.web_service import Route from finbot.core import environment from flask import Blueprint API_V1 = Route("/api/v1") base_api = Blueprint("api", __name__) @base_api.route(API_V1.healthy(), methods=["GET"]) def healthy(): return {"healthy": True} @base_ap...
2.046875
2
07_Greedy/distribute_candy.py
Sheetal0601/InterviewBit
61
54117
# Distribute Candy # https://www.interviewbit.com/problems/distribute-candy/ # # There are N children standing in a line. Each child is assigned a rating value. # # You are giving candies to these children subjected to the following requirements: # Each child must have at least one candy. # Children with a higher rati...
3.921875
4
submit_job/app.py
zaro0508/lambda-batch-utils
0
54118
<filename>submit_job/app.py import json import boto3 import logging import os from botocore.exceptions import ClientError log = logging.getLogger(__name__) log.setLevel(logging.DEBUG) def get_batch_client(): return boto3.client('batch') def get_env_var_value(env_var): '''Get the value of an environment variable...
2.21875
2
lantz/princetoninstruments/spectrapro.py
zhong-lab/code
1
54119
<reponame>zhong-lab/code<gh_stars>1-10 # -*- coding: utf-8 -*- """ lantz.drivers.princetoninstruments.spectrapro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Implementation of SpectraPro over a Socket Author: <NAME> Date: 06/14/2021 """ from collections import OrderedDict from lantz import Action, Feat, DictFeat, ...
2.015625
2
aizynthfinder/interfaces/gui/clustering.py
0x2b3bfa0/aizynthfinder
1
54120
<reponame>0x2b3bfa0/aizynthfinder<filename>aizynthfinder/interfaces/gui/clustering.py """ Module containing a GUI extension for clustering """ import matplotlib.pylab as plt import numpy as np from ipywidgets import Output, Label, BoundedIntText, Button, HBox, Tab from IPython.display import display from scipy.cluster....
2.625
3
filtering/filtering/spiders/ali_tech.py
CareWB/filtering
2
54121
# -*- coding: utf-8 -*- import scrapy import json import time from filtering.items import FilteringItem class AliTechSpider(scrapy.Spider): name = 'ali_tech' alias = '阿里技术' group = '技术' def start_requests(self): headers = { 'User-Agent':'Mozilla/5.0 (Linux; Android 5.0; SM-G900P...
2.78125
3
corocc/_base.py
hniksic/corocc
10
54122
import types import threading import time __all__ = 'suspend', 'suspending', 'start', 'Continuation', _CONT_REQUEST = object() @types.coroutine def suspend(fn, *args): """Suspend the currently running coroutine and invoke FN with the continuation.""" cont = yield _CONT_REQUEST fn(cont, *args) cont_re...
3
3
examples/algo/sac/sac.py
jidiai/ai_lab
99
54123
import sys from pathlib import Path import os import torch from torch.optim import Adam import torch.nn as nn import torch.nn.functional as F import numpy as np from networks.critic import Critic from networks.actor import NoisyActor, CategoricalActor, GaussianActor base_dir = Path(__file__).resolve().parent.parent....
2.109375
2
server/web.py
xiaojieluo/dove-admin
1
54124
<filename>server/web.py from jinja2 import Environment, PackageLoader, TemplateNotFound import jinja2 import yaml import os from sanic import response import sqlite3 class Cache(object): ''' 刷新缓存 1. 更新 content 目录下的文件到数据库 dove 没有删除文件操作 ''' def __init__(self): pass def update(self): ...
2.53125
3
middleware/legato/driver/controller/ili9488/config/ili9488_files.py
automaate/gfx3.8
0
54125
<filename>middleware/legato/driver/controller/ili9488/config/ili9488_files.py # coding: utf-8 ############################################################################## # Copyright (C) 2018 Microchip Technology Inc. and its subsidiaries. # # Subject to your compliance with these terms, you may use Microchip sof...
1.21875
1
src/alarm_builder.py
lajanki/alarmpi
0
54126
import subprocess import importlib import os import inspect import logging import pydub import pydub.playback from src import utils from src.handlers import get_festival_tts, get_greeting event_logger = logging.getLogger("eventLogger") class AlarmBuilder: def __init__(self, config): self.config = con...
2.5625
3
snmpagent_unity/unity_impl/DiskQueueLength.py
factioninc/snmp-unity-agent
2
54127
<reponame>factioninc/snmp-unity-agent class DiskQueueLength(object): def read_get(self, name, idx_name, unity_client): return unity_client.get_disk_queue_length(idx_name) class DiskQueueLengthColumn(object): def get_idx(self, name, idx, unity_client): return unity_client.get_disks()
2.109375
2
setup.py
stkobsar/RandomForest
0
54128
<gh_stars>0 import setuptools setuptools.setup(name='RandomForest', version="0.1git status.0", url = "https://github.com/stkobsar/RandomForest.git", description='Random Forest algorithm use case', author='<NAME>', author_email='<EMAIL>', packages=setuptools.find_packages(), in...
1.28125
1
spell_bee/migrations/0005_auto_20170522_1049.py
haideralipunjabi/django_quiz
0
54129
<filename>spell_bee/migrations/0005_auto_20170522_1049.py<gh_stars>0 # -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-05-22 05:19 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('spell_bee', '0004_auto_20...
1.484375
1
ch3/TIY/TIYp36.py
hewittaj/python_crash_course
0
54130
<reponame>hewittaj/python_crash_course #3-1 # names = ['will', 'jess', 'jacob', 'adam'] # for name in names: # print(name.title()) #3-2 names = ['will', 'jess', 'jacob', 'adam'] for name in names: print(f"Hello, {name.title()}")
3.9375
4
tests/bugs/core_1253_test.py
FirebirdSQL/firebird-qa
1
54131
<reponame>FirebirdSQL/firebird-qa #coding:utf-8 # # id: bugs.core_1253 # title: LIST(DISTINCT) concatenate VARCHAR values as CHAR # decription: # tracker_id: CORE-1253 # min_versions: [] # versions: 2.1 # qmid: bugs.core_1253 import pytest from firebird.qa import db_factory, isql_act,...
2.109375
2
mudforge/ansi/circle.py
volundmush/mudforge
1
54132
""" This is supposed to be a Gate-side processor for CircleMUD style ANSI... In the new design this'll probably be best moved to Forge-side. """ from rich.text import Text from mudforge.ansi import DECODER as decoder import re import random DEFAULT_COLORS = { "0": "0", # Normal "1": "0;36", # Roomna...
2.125
2
scify/__init__.py
DanielBok/scify
6
54133
<filename>scify/__init__.py # -*- coding: utf-8 -*- """Top-level package for scify.""" __author__ = """<NAME>""" __email__ = '<EMAIL>' __version__ = '0.1.0'
0.863281
1
Chapter 08/Chap08_Example8.24.py
bpbpublications/Programming-Techniques-using-Python
0
54134
<filename>Chapter 08/Chap08_Example8.24.py class Student: def __init__(self): self.name = 'Mohan' self.age = 10 self.country = 'India' def mydelete(self): del self.age myobj1 = Student() print("Before deleting: ") print(myobj1.__dict__) del myobj1.country # dele...
4
4
tkinter/index.py
Sudani-Coder/python
0
54135
from tkinter import * # create window object app = Tk() app.title("Part Manager") app.geometry("700x350") #strat program app.mainloop()
2.515625
3
setup.py
erfaneshrati/meta-transfer-learning
16
54136
<filename>setup.py """ Module configuration. """ from setuptools import setup setup( name='supervised-mtl', version='0.0.1', description='Meta-transfer learning over Reptile and MAML', url='https://github.com/erfaneshrati/supervised-mtl', author='<NAME>', author_email='<EMAIL>', license='M...
1.296875
1
stratifi_tests/test_login.py
DashkevichBy/Advisors.stratiFi.frontend
0
54137
<gh_stars>0 import logging import os import pytest import time from common import BaseTest from pages.advisors_stratifi_pages.sign_in_page import SignInPage from pages.advisors_stratifi_pages.stratifi_page import StratifiPage class TestLogin(BaseTest): stratifi_page = StratifiPage() sign_in_page = SignInPag...
2.078125
2
tests/factories.py
helloyxy/shopcarts
3
54138
# Copyright 2016, 2019 <NAME>. 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
2.75
3
clover/examples/gps.py
lvsoft/clover
146
54139
# Information: https://clover.coex.tech/en/simple_offboard.html#navigateglobal import rospy from clover import srv from std_srvs.srv import Trigger import math rospy.init_node('flight') get_telemetry = rospy.ServiceProxy('get_telemetry', srv.GetTelemetry) navigate = rospy.ServiceProxy('navigate', srv.Navigate) navig...
2.609375
3
examples/using_classes/DeleteObject/delete_object.py
praveenbommalibits/JSONManipulator
2
54140
<filename>examples/using_classes/DeleteObject/delete_object.py import sys import os from JSONManipulator import DeleteObject DeleteObject( key="isbn", value=1935182927, full_path=os.path.join( sys.path[0], "examples/using_classes/DeleteObject/books_after_deletion.json" ) )
2.375
2
src/morphocut/contrib/ecotaxa.py
ammark100/morphocut
0
54141
<filename>src/morphocut/contrib/ecotaxa.py """ Read and write EcoTaxa archives. "`EcoTaxa`_ is a web application dedicated to the visual exploration and the taxonomic annotation of images that illustrate the beauty of planktonic biodiversity." .. _EcoTaxa: https://ecotaxa.obs-vlfr.fr/ """ import fnmatch i...
3
3
evoflow/selection/select_fittest.py
joaogui1/evoflow
33
54142
<gh_stars>10-100 # Copyright 2020 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 agree...
2.71875
3
tidecv/data.py
wuhandashuaibi/tide
0
54143
import os from collections import defaultdict import numpy as np import cv2 from . import functions as f class Data(): """ A class to hold ground truth or predictions data in an easy to work with format. Note that any time they appear, bounding boxes are [x, y, width, height] and masks are either a list of polyg...
3.1875
3
examples/navigation-system/app.py
ppsirg/gino-tornado
3
54144
<filename>examples/navigation-system/app.py #!/usr/local/python/bin/python # -*- coding: utf-8 -*- """ Gino-tornado app example. """ # general imports # tornado imports import tornado from tornado import gen from tornado.ioloop import IOLoop # local imports from servers import build_service from settings import SSL_O...
2.328125
2
lib/newman_conway.py
MaiteArp/dynamic-programming
0
54145
<reponame>MaiteArp/dynamic-programming def newman_conway(num): """ Returns a list of the Newman Conway numbers for the given value. Time Complexity: O(n) Space Complexity: O(n) """ if num == 0: raise(ValueError) if num == 1: return "1" if num == 2: return "1 1...
4.21875
4
src/syncro/__main__.py
cav71/syncro
0
54146
"""starts a sync remote server """ import os import getpass import pathlib import logging import click from . import cli import paramiko import paramiko.sftp_client import syncro.support as support import syncro.cli as cli logger = logging.getLogger(__name__) def add_arguments(parser): parser.add_argument("h...
2.734375
3
api/poe_server.py
fossabot/proof-of-existence
3
54147
<reponame>fossabot/proof-of-existence<gh_stars>1-10 import binascii import json as JSON from base64 import b64encode, b64decode from datetime import datetime from sanic import Sanic from sanic.response import json from sanic_cors import CORS, cross_origin from poe_libs import Document port = 8000 class Server(obje...
2.171875
2
future-release/api/migrations/0006_auto_20210606_1218.py
shauray8/we_must_know_website
0
54148
<gh_stars>0 # Generated by Django 3.1.4 on 2021-06-06 06:48 import api.models from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('api', '0005_auto_20210528_1632'), ] operations = [ migrations.AlterField( model_name='room', ...
1.671875
2
lnbits/extensions/events/models.py
blackcoffeexbt/lnbits-legend
76
54149
<gh_stars>10-100 from fastapi.param_functions import Query from pydantic import BaseModel class CreateEvent(BaseModel): wallet: str name: str info: str closing_date: str event_start_date: str event_end_date: str amount_tickets: int = Query(..., ge=0) price_per_ticket: int = Query(..., ...
2.453125
2
users/urls.py
csl619/meal_app
0
54150
from django.urls import path from . import views as user_views urlpatterns = [ path('staff_admin/register/', user_views.register, name='register'), path('profile/', user_views.profile, name='profile'), path( 'update_meal_categories/', user_views.edit_meal_cats, name='edit_meal_cats'), p...
1.539063
2
tgcf/past.py
kaushalruparel/tgcf
0
54151
"""The module for running tgcf in past mode. - past mode can only operate with a user account. - past mode deals with all existing messages. """ import asyncio import logging import time from telethon import TelegramClient from telethon.errors.rpcerrorlist import FloodWaitError from telethon.tl.custom.message import...
2.171875
2
memegencli/__init__.py
MineRobber9000/memegen-cli
0
54152
<filename>memegencli/__init__.py<gh_stars>0 # grab memegencli.memegrab.Meme and memegencli.memegrab.CustomMeme from memegen.memegrab import Meme, CustomMeme
1.25
1
tcp_windows_scan.py
froyo75/scapy_scan_dos
1
54153
#! /usr/bin/python import logging logging.getLogger("scapy.runtime").setLevel(logging.ERROR) from scapy.all import * dst_ip = "10.0.0.1" src_port = RandShort() dst_port=80 window_scan_resp = sr1(IP(dst=dst_ip)/TCP(dport=dst_port,flags="A"),timeout=10) if (str(type(window_scan_resp))=="<type 'NoneType'>...
2.5625
3
experiments/process_mmds.py
LiamGon/BML_project_BayesNN
50
54154
# Copyright 2018 <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/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
2.609375
3
MultipleComparision.py
simplymanas/python-learning
4
54155
# Multiple Comparisons # the way vs. the better way # simplify chained comparison # <NAME> # <NAME> day of 2020 time_of_the_day = 6 day_of_the_week = 'mon' # this way if time_of_the_day < 12 and time_of_the_day > 6: print('Good morning') # a better way if 6 < time_of_the_day < 12: print('Good morning') # this w...
4.59375
5
example/myapp.py
pawnhearts/configuru
1
54156
from config import config import os print('env DBURL:', os.environ.get('DB_URL')) print('config:', config.db_url)
2.03125
2
maths/prime_adam_check.py
ATCtech/Python
2
54157
"""Prime Adam Int Check""" import math def prime_check(number: int) -> bool: """ A number is prime if it has exactly two dividers: 1 and itself. Example : 2, 3, 5, 7 """ if number < 2: # Numbers less than 2 are not prime. return False for i in range(2, int(math.sqrt(number) + 1...
4.4375
4
ibpy_native/interfaces/delegates/order.py
Devtography/ibpy_native
6
54158
"""Internal delegate module for orders related features.""" import abc from typing import Dict, Optional from ibapi import contract as ib_contract from ibapi import order as ib_order from ibapi import order_state as ib_order_state from ibpy_native import error from ibpy_native import models from ibpy_native.utils imp...
2.484375
2
setup.py
morucci/cryptysto
0
54159
<reponame>morucci/cryptysto from setuptools import setup import pathlib here = pathlib.Path(__file__).parent.resolve() setup( name="cryptysto", version="0.0.1", description="A small tool to compute assets across exchanges", url="https://github.com/morucci/cryptysto", author="<NAME>", author_em...
1.71875
2
scripts/portal/enterInfo.py
G00dBye/YYMS
54
54160
<filename>scripts/portal/enterInfo.py # Created by MechAviv # ID :: [104000000] # Lith Harbor : Lith Harbor sm.warp(104000004, 1)
1.28125
1
devml/__init__.py
jgonzal3/devml
22
54161
""" API Example: from devml import stats, mkdata path = "/Users/noah/src/wulio/checkout/" org_df = mkdata.create_org_df(path) author_counts = stats.author_commit_count(org_df) """ __version__ = "0.5.1"
1.296875
1
fwd_alg_both_graph.py
collaborative-robotics/ABT
5
54162
<gh_stars>1-10 #!/usr/bin/env python import numpy as np # operations on numerical arrays import csv # file I/O import math as m import sys # for command line args import operator # for sorting list of class instances import numpy as np from scipy import stats import datetime a...
2.5625
3
pdfmerge/migrations/0003_auto_20190616_1823.py
rupin/pdfmerger
0
54163
<filename>pdfmerge/migrations/0003_auto_20190616_1823.py # Generated by Django 2.1.3 on 2019-06-16 12:53 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('pdfmerge', '0002_auto_20190616_1800'), ] operations = [ migrations.RemoveField( ...
1.289063
1
Python/UberX.py
israellp24/CursoPOOUber
0
54164
<filename>Python/UberX.py from car import Car class UberX(Car): brand=str model=str def __init__(self, license, driver,brand,model): super().__init__(license, driver) self.brand=brand self.model=model
3.1875
3
utils.py
abcdabcd987/acm-compiler-judge
8
54165
<filename>utils.py # -*- coding: utf-8 -*- from __future__ import unicode_literals import re import time import pytz import arrow import StringIO import dateutil.parser from datetime import datetime import settings def format_from_utc(dt): if not dt: return '' dt = settings.TIMEZONE.fromutc(dt.replace(tzinfo...
2.578125
3
Task/Find-common-directory-path/Python/find-common-directory-path-3.py
LaudateCorpus1/RosettaCodeData
1
54166
<gh_stars>1-10 >>> paths = ['/home/user1/tmp/coverage/test', '/home/user1/tmp/covert/operator', '/home/user1/tmp/coven/members'] >>> os.path.dirname(os.path.commonprefix(paths)) '/home/user1/tmp'
1.5
2
getnewsdata/nengyuan/chezhiwang/spiders/zhongche.py
1658484908/Million-text-analysis
1
54167
<filename>getnewsdata/nengyuan/chezhiwang/spiders/zhongche.py<gh_stars>1-10 from scrapy.spider import BaseSpider from chezhiwang.arrangurl import * from chezhiwang import items from chezhiwang import myre class DmozSpider(BaseSpider): name = "zhongche" allowed_domains = ["chinanews.cn"] # start_urls = [ ...
2.75
3
ImageConversion.py
nisargmshah/classification-project
1
54168
<gh_stars>1-10 import base64 class Image: """ This class takes in a base64 string representation of an image and gives the user the ability to return it in base64 and binary form. Note: Input to this class must be string; otherwise, will raise a TypeError """ # make default image a generic im...
3.546875
4
setup.py
aws-samples/ml-lineage-helper
7
54169
from setuptools import setup setup( name="ml-lineage-helper", version="0.1", description="A wrapper around SageMaker ML Lineage Tracking extending ML Lineage to end-to-end ML lifecycles, including additional capabilities around Feature Store groups, queries, and other relevant artifacts.", url="https:/...
1.09375
1
srdk/cy/lang_tools/get_stressed_phones_for_htk.py
techiaith/seilwaith-adnabod-lleferydd
1
54170
<filename>srdk/cy/lang_tools/get_stressed_phones_for_htk.py import sys, re, traceback from llef.llef import get_stressed_phones def get_stressed_phones_for_htk(word): try: stressed_phones = get_stressed_phones(word) except (ValueError, TypeError): return '','','' lexiconword=word if lexiconword.startswith("'"...
2.734375
3
codes/RedSpider.py
MasterScott/hack4career
96
54171
# -*- coding: cp1254 -*- # Expired Domain Check v1.0 # Author: <NAME> # E-mail: mert [ . ] sarica [ @ ] gmail [ . ] com # URL: https://www.mertsarica.com import scrapy from scrapy.spiders import CrawlSpider, Rule from scrapy.linkextractors import LinkExtractor from scrapy.http import Request from urlparse import urlpa...
2.53125
3
root/scripts/setup/01_0_backup.py
DragonCrafted87/docker-alpine-spigot
0
54172
<reponame>DragonCrafted87/docker-alpine-spigot #!/usr/bin/python3 # System Imports from datetime import datetime from os import getenv from pathlib import PurePath from tarfile import open as tar_open # Local Imports from python_logger import create_logger #pylint: disable=import-error def main(): logger = create_...
2.203125
2
Task1C.py
ai387/ia-flood-risk-project
0
54173
# ARZINA: RUNNING THIS CODE IN GEO GIVES YOU A DIFFERENT OUTPUT TO WHAT IS EXPECTED (ON THE TASK IT GIVES EXAMPLE OUTPUT, # ARZINA: BUT MY OUTPUT IS NOT THE SAME' # ARZINA: I SUSPECT IT IS THE HAVERSINE FORMULA WHICH I'M USING WRONG from floodsystem.stationdata import build_station_list from floodsystem.geo import sta...
3.03125
3
python/merge-the-tools.py
gajubadge11/hackerrank-3
21
54174
<reponame>gajubadge11/hackerrank-3<filename>python/merge-the-tools.py from collections import OrderedDict def merge_the_tools(string, split_length): splits = split_strings(string, split_length) result = remove_repeats(splits) print ("\n".join(result)) def split_strings(string, split_length): return [...
3.609375
4
requests_/auth_.py
bailihua93/pylearn
0
54175
import requests from requests.auth import HTTPBasicAuth r = requests.get('http://localhost:5000', auth=HTTPBasicAuth('username', 'password')) r = requests.get('http://localhost:5000', auth=('username', 'password')) # 简写,默认的东西 print(r.status_code) from requests_oauthlib import OAuth1 url= '' auth = OAuth1('APP_key','...
2.734375
3
Google_Files_Finder.py
jeziellago/GoogleFilesFinder
4
54176
#!/usr/bin/python # Google File Finder - Finished in Dec, 2016 # Powered by <NAME> [<EMAIL>] import os import googlesearch """ --------------------------------------------------------------------------- """ def cut_string(text, limit): i = 0 while i > -1: s = str(text[i:(i+1)]) i = i + 1 if s == limit: te...
3.0625
3
psu_dp832.py
mbrunnen/rigolctl
3
54177
#!/usr/bin/env python2 import vxi11 import time import argparse if __name__ == "__main__": ap = argparse.ArgumentParser() ap.add_argument("DEVICE", nargs=1, help="Device to connect to") ap.add_argument("--toggle", "-t", action="store_const", dest="action", const="toggle", ...
2.546875
3
shimmer/apps/BtStream/python/accelCalRead.py
tinyos-io/tinyos-3.x-contrib
0
54178
#!/usr/bin/python import sys, struct, array, time, serial def wait_for_ack(): ddata = "" ack = struct.pack('B', 0xff) while ddata != ack: ddata = ser.read(1) return if len(sys.argv) < 2: print "no device specified" print "You need to specifiy the serial port of the shimmer you wish to connect...
3.109375
3
Easy/MinStack.py
a-shah8/LeetCode
1
54179
<gh_stars>1-10 ## Designing MinStack ## 1. Using Linked List ## 2. Using Arrays/Lists class MinStack: head = None def __init__(self): """ initialize your data structure here. """ def push(self, x: int) -> None: if self.head==None: self.head = self.Node(x, x...
3.859375
4
src/stat_tests/exp2_online_anova.py
miaoli-psy/Psychophysics_exps
0
54180
<reponame>miaoli-psy/Psychophysics_exps # -*- coding: utf-8 -*- """ Project: Psychophysics_exps Creator: Miao Create time: 2021-04-19 16:24 IDE: PyCharm Introduction: exp2 online, anova, and pariwise comparison """ import pandas as pd from statsmodels.stats.anova import AnovaRM import pingouin as pg from src.stat_tes...
2.234375
2
lls_dd/cmdline.py
VolkerH/Lattice_Lightsheet_Deskew_Deconv
16
54181
<gh_stars>10-100 from lls_dd import Experimentfolder, ExperimentProcessor import os import pathlib import click from lls_dd.settings import create_fixed_settings class ProcessCmd(object): def __init__(self, exp_folder, fixed_settings=None, home=None, debug=False): if not fixed_settings: # chec...
2.078125
2
server/tests/test_models.py
NBanski/XSS-Catcher
98
54182
<reponame>NBanski/XSS-Catcher<filename>server/tests/test_models.py import json from app import db from app.models import Blocklist, Client, Settings, User, init_app from xss import app from .fixtures import client, client_empty from .functions import * def test_client_to_dict_clients(client): access_header, _ =...
2.46875
2
dynaconf/loaders/py_loader.py
dmsimard/dynaconf
0
54183
import io import errno import types import importlib import inspect from pathlib import Path from dynaconf import default_settings from dynaconf.utils.files import find_file from dynaconf.utils import DynaconfDict, object_merge, raw_logger def load(obj, settings_module, identifier='py', silent=False, key=None): "...
2.3125
2
uetl/doc_events.py
ashish-greycube/UETL
0
54184
<gh_stars>0 from __future__ import unicode_literals import frappe, erpnext, json from frappe import _ def validate_for_duplicate_items_based_on_date(self,method): if self.doctype=='Sales Order': date_field='delivery_date' elif self.doctype=='Purchase Order': date_field='schedule_date' chk_...
2.046875
2
samples/auth.py
Sovos-Compliance/COAPI-python-sample
0
54185
<reponame>Sovos-Compliance/COAPI-python-sample<gh_stars>0 from samples import helpers import time import config class Authentication: def __init__(self): self._access_token = '' self._access_token_expire = 0 self._api_key = config.API_KEY self._secret = config.SECRET_KEY se...
2.53125
3
KuGou_/Tools/WebTools/KuGouWebTools.py
ChineseCode-coder/KuGouDownloader
1
54186
# coding = UTF-8 import time import re import js2py import requests import json import KuGou from KuGou.Requirement import Header class MusicList(object): """从酷狗获取要查询的歌曲的结果列表""" def __init__(self, MusicName: str) -> None: """初始化该类: 检查参数正确性,创建时间戳,初始化签名和数据容器,初始化JS命名空间(初始化命名空间并添加签名创建函数)。 ...
2.609375
3
code.py
AshishJaiswar/olympic-hero
0
54187
# -------------- #Importing header files import pandas as pd import numpy as np import matplotlib.pyplot as plt #Path of the file path #Code starts here data=pd.read_csv(path) data.rename(columns={'Total':'Total_Medals'},inplace=True) data.head(10) # -------------- #Code starts here data['Better_E...
3.328125
3
xls/dslx/fuzzer/run_fuzz_shll_test.py
ted-xie/xls
0
54188
# Lint as: python3 # # Copyright 2020 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 a...
1.953125
2
driver/directory.py
koltenfluckiger/pyseleniummanagement
0
54189
try: from enum import Enum from pathlib import Path as path import os except ImportError as err: print("Unable to import: {}".format(err)) exit() class Directory(Enum): DEFAULT_WINDOWS_FIREFOX = "{}\\Roaming\\Mozilla\\Firefox\\Profiles".format( os.getenv('APPDATA')) DEFAULT_WINDOW...
2.703125
3
remo/remozilla/__init__.py
Mozilla-GitHub-Standards/6f6b18ac63685c6bf60fff95a3bbcc598378c77ceb14c7404172c570dd1e971d
27
54190
<gh_stars>10-100 default_app_config = 'remo.remozilla.apps.RemozillaConfig'
1.03125
1
core/utils/serializer.py
chiaki64/Windless
10
54191
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import time from utils.period import todate from utils.shortcut import (rebuild_html, render) class Serializer: # 一定要传form={}进来 def __init__(self, **kwargs): self.data = self.serialize(kwargs.get('form')) self.exclude ...
2.234375
2
lib/datasets/vg/generate_dataset.py
ruotianluo/Context-aware-ZSR
59
54192
<reponame>ruotianluo/Context-aware-ZSR from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import json import os from collections import Counter, defaultdict import numpy as np np.random.seed(123) import re import argpars...
1.929688
2
electripy/physics/charge_distribution.py
dylannalex/electripy
21
54193
from numpy import ndarray, array from electripy.physics.charges import PointCharge class _ChargesSet: """ A _ChargesSet instance is a group of charges. The electric field at a given point can be calculated as the sum of each electric field at that point for every charge in the charge set. """ ...
3.4375
3
pygps/server/__main__.py
sillyemperor/pygps
2
54194
# -*- coding:utf8 -*- import logging from twisted.internet import reactor from pygps.server.handlers import ProtocalTCPFactory, ProtocalUDPHandler from pygps.server.pusher import ThreadQueuePusher, DalPusher from pygps.goodhope.dal import GPSDal from pygps.protocol.bsj import A5, Km from pygps.protocol.longhan import L...
1.914063
2
checkers.py
akimovstv/YPS
1
54195
<filename>checkers.py<gh_stars>1-10 """ Additional tools for checking request arguments. """ import datetime def checked_date(s: str) -> str: """ Return `s`, if `s` is valid date in format YYYY-mm-dd (e.g. 2021-05-05), otherwise raise ValueError. """ try: return datetime.datetime.strptime...
3.3125
3
core/report.py
alnvdl/oks
2
54196
#!/usr/bin/env python #-*- coding:utf-8 -*- import datetime from core.output import * class Report: NAME = "" DESCRIPTION = "" OPTIONS = [] def __init__(self, db): self.db = db self.data = [] self.bits = [] # An option has the following syntax: # ...
3
3
tsne_precompute/1_precompute_tsne.py
emcoglab/sensorimotor-distance-calculator
1
54197
<reponame>emcoglab/sensorimotor-distance-calculator from config import Config from sensorimotor_norms.config.config import Config as SMConfig; SMConfig(use_config_overrides_from_file=Config.path) from tsne import valid_distance_names, SensorimotorTSNE if __name__ == '__main__': for distance in valid_distance_name...
1.984375
2
setup.py
bndl/cyhll
1
54198
#!/usr/bin/env python from setuptools import setup, find_packages, Extension extensions = [ Extension('cyhll.hyperloglog', ['cyhll/hyperloglog.pyx']), Extension('cyhll.murmer3', ['cyhll/murmer3.pyx']), ] try: from Cython.Build import cythonize extensions = cythonize(extensions, ...
1.617188
2
sodoku_generator_brute_force.py
Mxrcon/python-sodoku
0
54199
import random square = [[1,2,3],[4,5,6],[7,8,9]] def get_square(): line =[i for i in range(1,10)] lst = random.sample(line, 9) square = [lst[i:i + 3] for i in range(0, len(lst), 3)] return square def valid_line(line): if sorted(line) == [1,2,3,4,5,6,7,8,9]: return True else: return False de...
3.625
4