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
omnidet/train_semantic.py
AtlasGooo2/WoodScape
348
12773651
<filename>omnidet/train_semantic.py """ Semantic segmentation training for OmniDet. # author: <NAME> <<EMAIL>> This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; Authors provide no warranty with the software and are not liable for anything. """ import time import numpy as np i...
2.515625
3
DjangoAPI/apiApp/migrations/0001_initial.py
ChunjunHu/webservice
0
12773652
<reponame>ChunjunHu/webservice # Generated by Django 3.2.5 on 2022-03-09 22:06 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone import uuid class Migration(migrations.Migration): initial = True dependencies ...
1.835938
2
convertE00toSHP/converte00toshp.py
borchert/metadata-tools
0
12773653
<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- # --------------------------------------------------------------------------- # converte00toshp.py # Created on: 2014-01-08 # Description: Convert e00 files to shapefiles # --------------------------------------------------------------------------- # Convert ...
2.234375
2
Python/tests/test_support_vector_machine.py
RyanShahidi/easyml
37
12773654
"""TO BE EDITED. """ # from easyml import def test_foo(): assert 1 == 1
1.445313
1
force_bdss/tests/probe_classes/ui_hooks.py
scottwedge/force-bdss
2
12773655
# (C) Copyright 2010-2020 Enthought, Inc., Austin, TX # All rights reserved. from traits.api import Bool from force_bdss.api import BaseUIHooksFactory, BaseUIHooksManager class ProbeUIHooksManager(BaseUIHooksManager): before_execution_called = Bool() after_execution_called = Bool() before_save_called =...
2.140625
2
backend/stock/migrations/0019_auto_20210215_2009.py
fengxia41103/stock
1
12773656
<reponame>fengxia41103/stock # Generated by Django 3.1.6 on 2021-02-15 20:09 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('stock', '0018_balancesheet_common_stock'), ] operations = [ migrations.AddField( model_name='mystoc...
1.625
2
web-backend/routes/student.py
Nahemah1022/Seat-Reservation-System
0
12773657
<filename>web-backend/routes/student.py from email import message from fastapi import APIRouter, HTTPException,Depends from sqlalchemy.orm import Session from typing import List from config.db import getDBSession from models.model import t_Student from schemas import studentSchema studentRouter = APIRouter() @stude...
2.640625
3
yoka_bot/items.py
CooperLuan/yoka_bot
0
12773658
# -*- coding: utf-8 -*- # Define here the models for your scraped items # # See documentation in: # http://doc.scrapy.org/en/latest/topics/items.html import scrapy class YokaBotItem(scrapy.Item): # define the fields for your item here like: # name = scrapy.Field() pass class YokaBotBrandListItem(scrap...
2.484375
2
make_dataset/color_correct.py
enomotokenji/mcgan-cvprw2017-chainer
3
12773659
<filename>make_dataset/color_correct.py import os import argparse from PIL import Image from tqdm import tqdm import colorcorrect.algorithm as cca from colorcorrect.util import from_pil, to_pil def color_correct(args): in_dir = args.in_dir out_dir = args.out_dir if not os.path.exists(in_dir): rai...
2.78125
3
old/System/Utils.py
broadinstitute/cms
13
12773660
"""Miscellaneous utilities. """ import sys, os, inspect, time, shutil, types, pickle, numpy, re from string import Template from traceback import print_exc from numpy import nan, isnan #import Tools.pp.pp as pp def TypeInfer(column): """Take a list of strings, and attempt to infer a datatype that fits them all. If...
2.78125
3
autobahn/twisted/flashpolicy.py
dimddev/AutobahnPython
0
12773661
<gh_stars>0 ############################################################################### # # The MIT License (MIT) # # Copyright (c) Tavendo GmbH # # 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 S...
1.554688
2
Contest/ABC037/a/main.py
mpses/AtCoder
0
12773662
<gh_stars>0 #!/usr/bin/env python3 a, b, c = map(int, input().split()) print(c // min(a, b))
2.46875
2
Python/Courses/Python-Tutorials.Telusko/02.Miscellaneous/22.01-Binary Search.py
shihab4t/Books-Code
0
12773663
<gh_stars>0 def binary_search(nums, target): low = 0 high = len(nums) - 1 while low <= high: mid = low + ((high - low) // 2) if nums[mid] > target: high = mid-1 elif nums[mid] < target: low = mid+1 else: return mid return -1 if __name...
3.78125
4
lib/solutions/CHK/checkout_solution.py
DPNT-Sourcecode/CHK-vkwa01
0
12773664
<reponame>DPNT-Sourcecode/CHK-vkwa01 from collections import Counter class Basket: """ Helper class to calculate checkout """ prices = { "A": 50, "B": 30, "C": 20, "D": 15, "E": 40, "F": 10, "G": 20, "H": 10, "I": 35, "J":...
2.375
2
epollchain/models.py
yashgupta10/blockchain
1
12773665
# -*- coding: utf-8 -*- """ Created on Sun Feb 2 22:40:45 2020 @author: yashm """ import json from itsdangerous import TimedJSONWebSignatureSerializer as Serializer from flask import current_app from epollchain import login_manager#db, from flask_login import UserMixin @login_manager.user_loader def load_user(user_...
2.3125
2
mswindows/get_pytables_version.py
joshmoore/PyTables
3
12773666
<reponame>joshmoore/PyTables # Print the version splitted in three components import sys verfile = sys.argv[1] f = open(verfile) version = f.read() l = [a[0] for a in version.split('.') if a[0] in '0123456789'] # If no revision, '0' is added if len(l) == 2: l.append('0') for i in l: print i, f....
2.90625
3
tests/test_hvr3_polyC.py
ryanraaum/oldowan.mtconvert
2
12773667
<filename>tests/test_hvr3_polyC.py from oldowan.mtconvert.seq2sites import seq2sites from oldowan.polymorphism import Polymorphism def test_normal_polyC(): """Normal Poly C stretch at end of HVR3 Seq: CAAAGACACCCCCCACA Seq: CAAAGACACCCCCCACA rCRS: CAAAGACACCCCCCACA Sites: <None> """ se...
2.40625
2
gtfs_bounds.py
Trillium-Solutions/gtfs-bounds
0
12773668
#!/usr/bin/env python3 # # Copyright (C) 2020 Trillium Solutions <<EMAIL>> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this program except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # # ...
2.1875
2
python/eet/pipelines/text_classification.py
SidaZh/EET
0
12773669
# # Created by djz on 2022/04/01. # import numpy as np from typing import Dict from transformers.file_utils import ExplicitEnum, add_end_docstrings, is_tf_available, is_torch_available from .base import GenericTensor, Pipeline def sigmoid(_outputs): return 1.0 / (1.0 + np.exp(-_outputs)) def softmax(_outputs): ...
2.46875
2
users/__init__.py
Tech-With-Tim/models
2
12773670
<reponame>Tech-With-Tim/models from .user import User from .token import Token __all__ = ( User, Token, )
1.273438
1
vln/trainer.py
raphael-sch/map2seq_vln
1
12773671
import torch from utils import AverageMeter import time import math class OutdoorVlnTrainer: def __init__(self, opts, agent, optimizer): self.opts = opts self.agent = agent self.optimizer = optimizer self.device = torch.device("cuda" if torch.cuda.is_available() else "cpu") de...
2.390625
2
src/epstats/server/res.py
samuelpucek/ep-stats
12
12773672
<gh_stars>10-100 import pandas as pd from typing import List from pydantic import BaseModel, Field from ..toolkit import Evaluation from .req import Experiment, Metric, Check class MetricStat(BaseModel): """ Per-variant metric evaluation result. """ exp_variant_id: str = Field(title="Variant in the ...
2.90625
3
main.py
Vexus178/Hikiri-chan
0
12773673
<filename>main.py import inspect import os, sys from imgurpython import ImgurClient import webbrowser import praw import random client_id = 'imgur id' client_secret = 'imgur secret' access_token = '<PASSWORD> token' refresh_token = '<PASSWORD>' imgur_dictionary = None with open("count.txt", "r") as coun: ...
3.140625
3
src/Server/config/settings/productiondemo.py
tejpratap545/denselight_system
0
12773674
<gh_stars>0 from .base import * # noqa pylint: disable=unused-import,unused-wildcard-import,wildcard-import from sentry_sdk.integrations.celery import CeleryIntegration from sentry_sdk.integrations.django import DjangoIntegration from sentry_sdk.integrations.logging import LoggingIntegration import logging import sen...
1.671875
2
_import_grammars.py
andsild/dragonfly-modules
1
12773675
<reponame>andsild/dragonfly-modules<gh_stars>1-10 """ To load grammars, natlink has a file core\natlinkmain.py That file uses reflection and many if-statements, making it hard to trace bugs from reloading. Most importantly, it doesn't load directories. This files lets you define grammar-rules whereever you want (also ...
1.992188
2
m209/tests/test_main.py
gremmie/m209
0
12773676
<filename>m209/tests/test_main.py # Copyright (C) 2013 by <NAME>. # This file is part of m209, the M-209 simulation. # m209 is released under the MIT License (see LICENSE.txt). import os import tempfile import unittest from ..main import main class KeyGenTestCase(unittest.TestCase): def setUp(self): s...
2.796875
3
carebt_kb/carebt_kb/plugin_base.py
adlatusrobotics/carebt_ros2
1
12773677
<reponame>adlatusrobotics/carebt_ros2<gh_stars>1-10 # Copyright 2022 <NAME> (<EMAIL>) # # 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 # # Un...
2.0625
2
372.Super Pow.py
zyd2001/LeetCode
0
12773678
class Solution: def superPow(self, a: int, b: List[int]) -> int: if (a % 1337 == 0): return 0 return pow(a, reduce(lambda x, y: x * 10 + y, b), 1337)
2.9375
3
python/pts-multi.py
vasaantk/bin
0
12773679
#! /usr/bin/env python # Written by <NAME>. Friday, 27 May 2016. import re from pylab import * import sys from mpldatacursor import datacursor usrFile = sys.argv[1:] if len(usrFile) == 0: print "" print "# pts-multi.py takes input from multiple COMP.PTS files" print "# from <NAME>'s pts-diff.f and plots...
2.15625
2
mq/credentials2.py
suparek/rabbitlib
1
12773680
# -*- coding: utf-8 -* import hmac import base64 import time import hashlib import os import sys import pika class AliyunCredentialsProvider: """ Python2.7适用,根据阿里云的 accessKey,accessSecret,instanceId算出amqp连接使用的username和password instanceId可以从AMQP控制台首页复制 """ ACCESS_FROM_USER = 0 def __init__(sel...
2.734375
3
back/boxtribute_server/models/definitions/size_range.py
flisowna/boxtribute
0
12773681
<reponame>flisowna/boxtribute from peewee import CharField, IntegerField from ...db import db class SizeRange(db.Model): label = CharField(null=True) seq = IntegerField(null=True) class Meta: table_name = "sizegroup"
2.359375
2
chat/admin.py
bekzod-fayzikuloff/djChat
0
12773682
from django.contrib import admin from . import models @admin.register(models.Message) class MessageAdmin(admin.ModelAdmin): list_filter = ('owner', 'created') list_display = ('text', 'to_chat') search_fields = ('owner', 'to_chat') @admin.register(models.Chat) class ChatAdmin(admin.ModelAdmin): pass ...
1.828125
2
yari/mixins/visibility.py
cr8ivecodesmith/yari
0
12773683
<reponame>cr8ivecodesmith/yari<filename>yari/mixins/visibility.py """ Visibility Mixin """ __all__ = ('Visibility',) from kivy.properties import BooleanProperty def handle_visibility(this, value): this.size_hint_x = 1 if this.visible else 0 this.opacity = 1 if this.visible else 0 this.disabled = not thi...
2.234375
2
lrtc_lib/orchestrator/orchestrator_api.py
MovestaDev/low-resource-text-classification-framework
57
12773684
# (c) Copyright IBM Corporation 2020. # LICENSE: Apache License 2.0 (Apache-2.0) # http://www.apache.org/licenses/LICENSE-2.0 import glob import logging import os import traceback from collections import Counter from enum import Enum from typing import Mapping, List, Sequence, Tuple, Set import lrtc_lib.data_access....
1.71875
2
Python/Fundamentals/Introduction/hello_world.py
handtjaxon1/Coding-Dojo-Development
0
12773685
<reponame>handtjaxon1/Coding-Dojo-Development print("Hello, world!") x = "Hello World" print(x) y = 42 print(y)
2.640625
3
coremodules/files/eudata.py
devinligman/tcam2
0
12773686
import os import coredata.DataManager as dataManager import coredata.TestController as testController event_dispatcher = None def setup(): print("setup?") def runNumberChanged(event): if runFileExists() is False: initRunFile() def getRunFileLocation(): runNumber = dataManager.runNumber tc...
2.5
2
generators/root/templates/base/ansible/staging.py
thetribeio/generator-project
19
12773687
<reponame>thetribeio/generator-project<gh_stars>10-100 #!/usr/bin/env python3 """ Staging inventory script """ from inventory import inventory if __name__ == "__main__": inventory("staging")
1.53125
2
Project4/code/SplitMerge.py
jyczju/CVprojects
0
12773688
<reponame>jyczju/CVprojects ''' 图像切割+边缘识别 浙江大学控制学院《数字图像处理与机器视觉》第三次作业 jyczju 2022/4/6 v1.0 ''' import cv2 import numpy as np import sys from imgnode import ImgNode import matplotlib.pyplot as plt def region_split_merge(img, min_area=(1,1), threshold=5.0): ''' 区域分裂合并算法,主要依靠ImgNode类实现 输入:待处理图像,分裂的最小区域,合并的相似性判...
2.515625
3
src/misc.py
Dorijan-Cirkveni/AutoSolvingMatrix
0
12773689
def StringToDict(s): RES = dict() for e in set(s): RES[e] = 0 for e in s: RES[e] += 1 return RES
3.46875
3
webapp/creators/corrections.py
PASTAplus/umbra
0
12773690
#!/usr/bin/env python # -*- coding: utf-8 -*- """ :Mod: corrections :Synopsis: Read in the various corrections files in XML format: NICKNAMES_FILE = 'corrections_nicknames.xml' ORCID_CORRECTIONS_FILE = 'corrections_orcids.xml' ORGANIZATIONS_FILE = 'organizations.xml' OVERRIDES_FILE...
2.296875
2
Zane/cogs/dbots.py
crrapi/Zane
0
12773691
<filename>Zane/cogs/dbots.py import os import dbl import asyncio class DiscordBotsOrgAPI: def __init__(self, bot): self.bot = bot self.token = os.environ['DBL_TOKEN'] self.dbl_py = dbl.Client(self.bot, self.token) self.bot.loop.create_task(self._update_stats()) async def _up...
2.40625
2
fragile/core/base_classes.py
Guillemdb/fragile
35
12773692
<reponame>Guillemdb/fragile<filename>fragile/core/base_classes.py from typing import Callable, Dict, List, Tuple, Union import judo from judo import random_state from fragile.core.states import OneWalker, States, StatesEnv, StatesModel, StatesWalkers from fragile.core.typing import StateDict, Tensor class StatesOwn...
2.5625
3
marlo/crowdai_helpers.py
spMohanty/marlo
214
12773693
#!/usr/bin/env python import os import crowdai_api ######################################################################## # Instatiate Event Notifier ######################################################################## crowdai_events = crowdai_api.events.CrowdAIEvents() class CrowdAIMarloEvents: REQUEST_ENV...
2.421875
2
utils/transfer_utils.py
sunayana/ph-poverty-mapping
61
12773694
<gh_stars>10-100 # -*- coding: utf-8 -*- """Utility methods for training Night Lights Model""" from __future__ import print_function, division import time import os import copy import gc import shutil import wandb import matplotlib.pyplot as plt from PIL import Image import numpy as np import pandas as pd from decim...
2.328125
2
roombapy/roomba_factory.py
Erelen-Laiquendi/roombapy
17
12773695
<reponame>Erelen-Laiquendi/roombapy from roombapy import Roomba from roombapy.remote_client import RoombaRemoteClient class RoombaFactory: """ Allows you to create Roomba class to control your robot """ @staticmethod def create_roomba( address=None, blid=None, password=<PASSWORD>, continu...
2.75
3
tests/dismod_execution/test_case_4.py
ihmeuw/cascade-at
1
12773696
<reponame>ihmeuw/cascade-at<filename>tests/dismod_execution/test_case_4.py import pytest if __name__ == '__main__': import example_db import dismod_tests else: from . import example_db from . import dismod_tests from cascade_at.dismod.api.run_dismod import run_dismod from numpy import abs import re pri...
1.875
2
source/code/preprocessing/dataloader.py
IooHooI/NEURAL_NETWORKS
0
12773697
import os import json import numpy as np import pandas as pd import requests from sklearn.datasets import load_boston from sklearn.pipeline import FeatureUnion from sklearn.pipeline import Pipeline from sklearn.preprocessing import StandardScaler from sklearn.preprocessing import PolynomialFeatures from tqdm import tq...
2.5625
3
setup.py
robbertstruyven/cs207-FinalProject
0
12773698
import setuptools # read the contents of your README file from os import path this_directory = path.abspath(path.dirname(__file__)) with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f: long_description = f.read() setuptools.setup( name='AD-cs207', version='1.0.0', author='<NA...
1.601563
2
main.py
imnotender/Wallpaperify
0
12773699
import requests import json import ctypes import tempfile import os import time import base64 from dotenv import load_dotenv load_dotenv() REFRESH_TOKEN = os.getenv("REFRESH_TOKEN") ACCESS_TOKEN = os.getenv("ACCESS_TOKEN") EXPIRATION_TIME = float(os.getenv("EXPIRATION_TIME")) CLIENT_ID = os.getenv("CLIENT_ID") CLIEN...
2.953125
3
app/admin/admin.py
hXtreme/HCP-Project
0
12773700
import csv from io import StringIO import os.path as op from flask import request, redirect, Response, flash, url_for from werkzeug.exceptions import HTTPException from flask_admin import Admin from flask_admin.base import expose from flask_admin.contrib.sqla import ModelView from flask_admin.contrib.fileadmin import ...
2.3125
2
hackathon/migrations/0001_initial.py
natalijabujevic0708/ci-hackathon-app
11
12773701
# Generated by Django 3.1.1 on 2020-10-15 19:02 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUT...
1.75
2
mekpie/util.py
ejrbuss/mekpie
0
12773702
from re import sub from os import walk, mkdir, rename, remove from sys import stderr from shutil import rmtree from os.path import isfile, isdir, join, basename, splitext, exists from filecmp import dircmp import mekpie.debug as debug import mekpie.messages as messages from .cli import panic, log #...
2.6875
3
backend/api/school/tests.py
jacorea/ismp
3
12773703
<reponame>jacorea/ismp from rest_framework.reverse import reverse from rest_framework.test import APITestCase, APIClient from rest_framework.views import status from api.school.models import School from api.school.serializers import SchoolSerializer class BaseViewTest(APITestCase): client = APIClient() @stat...
2.46875
2
tools/check_jobs_documented.py
pmarcinkiewicz1/zuul-jobs
1
12773704
#!/usr/bin/env python # # Copyright 2019 Red Hat, 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 la...
2.15625
2
fb5logging/loggerconstants.py
samiwilf/FAMBench
9
12773705
<reponame>samiwilf/FAMBench<gh_stars>1-10 """ Master list of constants for logger Mostly logger keys, but some other constants as well. """ # loggerkey - header HEADER = "header" # loggerkey - timing info EPOCH_START = "epoch_start" EPOCH_STOP = "epoch_stop" RUN_START = "run_start" RUN_STOP = "run_stop" BATCH_START =...
1.273438
1
test/test.py
zephyrzoom/douyu
28
12773706
<reponame>zephyrzoom/douyu import socket import time s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(('172.16.17.32', 8011)) #s.sendall(b'type@=loginreq/username@=auto_qZ1JCRPZC6/password@=<PASSWORD>/ro<PASSWORD>ass@=/roomid@=265352/devid@=5DCE2FFCE0E61AB11F77D935D10E6E0B/rt@=1437381860/vk@=f78f45ff35...
2.21875
2
modulo1/4 Trabajo y formateo - Cadenas.py
OmarGP/Python1
0
12773707
##################################################################### # Trabajando con Cadenas de Texto # ##################################################################### cadena = " <NAME>!! " print(cadena) print(cadena[10]) print(cadena[3:]) print(cadena[:10]) print(cadena[2...
4.1875
4
build_local_zipnum.py
ikreymer/webarchive-indexing
35
12773708
<filename>build_local_zipnum.py import os import glob from argparse import ArgumentParser from zipnumclusterjob import ZipNumClusterJob from mrjob.launch import MRJobLauncher import logging import sys log = logging.getLogger(__name__) #============================================================================= de...
2.34375
2
handwriting-synthesis/hw_generator_config.py
blow-the-fluff/parking
0
12773709
DO_RUN_BIAS_TEST=False DEBUG = False INPUT_CSV=False ROOT_FOLDER="/home/jupyter/forms-ocr" OUTPUT_FOLDER= ROOT_FOLDER + "/sample_images" GEN_FOLDER = OUTPUT_FOLDER + "/img" LOCALE = "en_GB" DUMMY_GENERATOR=0 FIELD_DICT_3FIELDS= {'Name':(0,0),'Tax':(0,0), 'Address':(0,0) } FIELD_DICT_7FIELDS= {'N...
1.648438
2
Doraemon/Crawlers/google_KG.py
131250208/Doraemon
2
12773710
<reponame>131250208/Doraemon ''' the code is invalid @ 2020.10.09 ''' import random import time from bs4 import BeautifulSoup from urllib import parse import re from Doraemon.Requests import requests_dora, proxies_dora from tqdm import tqdm import logging # ORG_KEYWORDS = ["college", "company", "university", "school",...
2.625
3
creational/abstract_factory/data/soldiers/soldier.py
Kozak24/Patterns
0
12773711
<gh_stars>0 from abc import ABC, abstractmethod class Soldier(ABC): _ID = 0 _SOLDIER_TYPE = "Soldier" def __init__(self, hp, attack): self._id = Soldier._ID self._hp = hp self._attack = attack Soldier._ID += 1 @abstractmethod def patrol(self): pass @a...
3.328125
3
var/spack/repos/builtin/packages/py-agate/package.py
jeanbez/spack
0
12773712
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack.package import * class PyAgate(PythonPackage): """agate is a Python data analysis library that is optimiz...
1.992188
2
lib/oci_utils/migrate/__init__.py
guidotijskens/oci-utils
35
12773713
<filename>lib/oci_utils/migrate/__init__.py<gh_stars>10-100 # oci-utils # # Copyright (c) 2019, 2020 Oracle and/or its affiliates. All rights reserved. # Licensed under the Universal Permissive License v 1.0 as shown # at http://oss.oracle.com/licenses/upl. """ Initialisation of the migrate package. """ import logging ...
2.53125
3
camera_calibration/camera_calibration.py
kamino410/edsdk-sample
23
12773714
#coding: UTF-8 import sys import os import os.path import glob import cv2 import numpy as np CAPTUREDDIR = './captured' CALIBFLAG = 0 # cv2.CALIB_FIX_K3 def calibFromImages(dirname, chess_shape, chess_block_size): if not os.path.exists(dirname): print('Directory \'' + dirname + '\' was not found') ...
2.796875
3
7KYU/largest_pair_sum.py
yaznasivasai/python_codewars
4
12773715
from typing import List def largest_pair_sum(numbers: List[int]) -> int: return sum(sorted(numbers, reverse=True)[:2])
3.25
3
weather_comparison/weather_api1/apps.py
is-dev-djangoproject-ss-2020/project-repository
0
12773716
from django.apps import AppConfig class WeatherApi1Config(AppConfig): name = 'weather_api1'
1.359375
1
language.py
ErrorNoInternet/Doge-Utilities
6
12773717
<reponame>ErrorNoInternet/Doge-Utilities data = { "en": { "no_permission": "You do not have permission to use this command!", "not_command_sender": "You are not the sender of that command!", "vote_message": "Thank you for voting for Doge Utilities!", "banned_message": "You are banned...
1.8125
2
class exercise.py
UcheOlisa312/josephcsc102
0
12773718
<reponame>UcheOlisa312/josephcsc102 class Student: studentLevel = 'first year computer science 2020/2021 session' studentCounter = 0 def __init__(self, thename, thematricno, thesex, thehostelname , theage,thecsc102examscore): self.name = thename self.matricno = thematricno self.sex ...
3.75
4
ci/checks/commit-message.py
sineagles/Adlik
2
12773719
#!/usr/bin/env python3 # Copyright 2019 ZTE corporation. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 import re import subprocess def main(): subject_regex = re.compile(r'[^a-z\s]\S*( \S+)*[^.]') has_failure = False commit_messages = subprocess.check_output(args=['git', 'log', '--format=%...
2.484375
2
main.py
mattrwh-pC506/hexus-training-grounds
1
12773720
<filename>main.py """Train Reinforcement Learning agent. To run: python main.py """ import argparse import sys import matplotlib.pyplot as plt import ujson as json from game.hexus import Hexus from rl.agent import Agent def process_args(): """Process command line args.""" message = 'Interactive Rein...
3.015625
3
tests/test_commands.py
peradecki/fold-fastalike
1
12773721
<filename>tests/test_commands.py<gh_stars>1-10 import os.path import shutil import subprocess import time import pathlib # Handle paths and prepare output test_folder = pathlib.Path(__file__).parent.resolve() output_folder = os.path.join(test_folder, 'test_outputs') if os.path.isdir(output_folder): shutil.rmtree(...
2.21875
2
grnglow/glow/models/comment.py
xiaokai111/green-glow
18
12773722
# -*- encoding: utf-8 -*- ''' Created on 2012-3-22 @author: Neil ''' from django.db import models # from photo import Photo from user import User class Comment(models.Model): """ 评论的数据模型 """ photo_id = models.IntegerField() photo_owner = models.ForeignKey(User, related_name='comment_photo_owner')...
2.328125
2
tfHub_sentence_similarity/tfHub_sentence_similarity.py
jae-yong-2/awesomeScripts
245
12773723
import re import string import tensorflow_hub as hub from scipy.spatial.distance import cdist module_url = "https://tfhub.dev/google/universal-sentence-encoder/4" class SimilarityModel(): def __init__(self): print("Loading model from tf hub...") self.model = hub.load(module_url) print("mo...
2.65625
3
dist/book/codes/105-1.py
EManualResource/book-python-basic
0
12773724
<reponame>EManualResource/book-python-basic #! /usr/bin/env python #coding:utf-8 """ 请计算:19+2*4-8/2 """ a = 19+2*4-8/2 print a
2.015625
2
examples/pytorch/dimenet/modules/embedding_block.py
ketyi/dgl
9,516
12773725
import numpy as np import torch import torch.nn as nn from modules.envelope import Envelope from modules.initializers import GlorotOrthogonal class EmbeddingBlock(nn.Module): def __init__(self, emb_size, num_radial, bessel_funcs, cutoff, ...
2.3125
2
Unit 1 Variables and Statements/Lesson4.2.py
ItsMrTurtle/PythonChris
0
12773726
# -*- coding: utf-8 -*- """ Created on Sun Apr 19 19:32:39 2020 @author: abcdk """ # 5 Data types # Int, Float, Boolean, String, Null
1.484375
1
core/textinput.py
3ldr0n/elzring
0
12773727
import pygame from gamesettings import GameSettings as gs class TextInput(pygame.sprite.Sprite): def __init__(self, x, y, width, height): """Inputs any kind of text on screen. Parameters ---------- x: int X axis position of the input bar. y: int Y...
3.859375
4
paleomix/common/utilities.py
MikkelSchubert/paleomix
33
12773728
#!/usr/bin/python3 # # Copyright (c) 2012 <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, modif...
2.15625
2
shared/database/ODBC/winODBCdeclarations.py
infostreams/webindex
1
12773729
<reponame>infostreams/webindex<gh_stars>1-10 # success values # sql.h SQL_INVALID_HANDLE = -2 SQL_ERROR = -1 SQL_SUCCESS = 0 SQL_SUCCESS_WITH_INFO = 1 SQL_STILL_EXECUTING = 2 SQL_NEED_DATA = 99 SQL_NO_DATA_FOUND = 100 sql_errors = [SQL_ERROR, SQL_INVALID_HANDLE] # sqlext.h SQL_FETCH_NEXT = 0x...
1.40625
1
Django/permission_demo/rbac/models.py
taoyan/python
1
12773730
<reponame>taoyan/python<filename>Django/permission_demo/rbac/models.py from django.db import models # Create your models here. class User(models.Model): name = models.CharField(max_length=32) pwd = models.CharField(max_length=32) roles = models.ManyToManyField(to="Role") def __str__(self): return sel...
2.625
3
21/amicable.py
bobismijnnaam/bobe-euler
0
12773731
<reponame>bobismijnnaam/bobe-euler<gh_stars>0 import Utils pf = Utils.NumberJuggler() total = [] for i in range(1, 10000): iDiv = pf.getDivisors(i); j = sum(iDiv); jDiv = pf.getDivisors(j); k = sum(jDiv); if i == k and i != j: print(str(i) + " <=> " + str(j)) if i not in total: total.appen...
3.28125
3
Ec_candidates_tweets_sentiment_an.py
sayalaruano/Sentiment-analysis-of-Ecuadorian-political-tweets-from-2021election-with-Natural-Language-Processing
1
12773732
<gh_stars>1-10 # imports import pandas as pd import nltk from keras.preprocessing.text import Tokenizer from nltk.corpus import stopwords, words from matplotlib import pyplot as plt from keras.utils import to_categorical import numpy as np from sklearn.model_selection import train_test_split from keras import models, l...
3.109375
3
sksurgerysurfacematch/utils/registration_utils.py
UCL/scikit-surgerysurfacematch
1
12773733
# -*- coding: utf-8 -*- """ Various registration routines to reduce duplication. """ import numpy as np import sksurgerycore.transforms.matrix as mt import sksurgerysurfacematch.interfaces.rigid_registration as rr def do_rigid_registration(reconstructed_cloud, reference_cloud, ...
2.421875
2
wolfpack/lib/alpha_addr.py
s1na/wolfpack
1
12773734
import socket import nmap from wolfpack.beta.settings import PORT as alpha_port def get_network_ip(): '''Get local IP address''' s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.connect(('google.com', 0)) return s.getsockname()[0] def get_alpha_addr(): '''Find & get IP address of alpha in...
2.828125
3
source_hunter/__main__.py
pyeprog/source_hunter
2
12773735
<reponame>pyeprog/source_hunter from source_hunter.hunter import hunt if __name__ == '__main__': hunt()
1.1875
1
utilities.py
Iammuratc/semiconductorGrowth
1
12773736
<reponame>Iammuratc/semiconductorGrowth # -*- coding: utf-8 -*- """ Created on Thu Aug 8 23:39:10 2019 @author: Admin """ from datetime import datetime def isTimeFormat(input): try: minute, second = input.split(':') if minute.isdigit() and second.isdigit(): return True ...
2.71875
3
questions/q270_array_peak/code.py
aadhityasw/Competitive-Programs
0
12773737
class Solution: # @param A : list of integers # @return an integer def perfectPeak(self, A): n = len(A) left = [0] * n right = [0] * n left[0] = A[0] right[n-1] = A[n-1] for i in range(1, n) : left[i] = max(left[i-1], A[i]) for i in rang...
2.953125
3
utils/plot_networks.py
LiwenxuanNJU/TVpgGLM
1
12773738
# From https://groups.google.com/forum/#!topic/networkx-discuss/FwYk0ixLDuY # Plot weighted directed positive/negative network graph import networkx as nx import matplotlib.pyplot as plt from matplotlib.patches import FancyArrowPatch, Circle import numpy as np def draw_curvy_network(G, pos, ax, node_radius=0.02, nod...
3.25
3
app/editor/animation_editor/animation_properties.py
zerorock1312/lt-maker-master
0
12773739
<reponame>zerorock1312/lt-maker-master import time from PyQt5.QtWidgets import QWidget, QHBoxLayout, QVBoxLayout, \ QSizePolicy, QFrame, QSplitter, QRadioButton, QLineEdit, QLabel, QSpinBox, \ QStyle, QToolButton from PyQt5.QtCore import Qt from PyQt5.QtGui import QPixmap, QPainter, QImage, QColor, QPen from ...
2.15625
2
presqt/targets/zenodo/utilities/helpers/upload_helper.py
djordjetrajkovic/presqt
3
12773740
import json import requests from rest_framework import status from presqt.utilities import PresQTResponseException def zenodo_upload_helper(auth_parameter, project_title=None): """ Initialize a new project on Zenodo. Parameters ---------- auth_parameter : str The Authentication paramete...
2.640625
3
malspider_django/dashboard/management/commands/del_alerts.py
andrewhenke/malspider
453
12773741
# # Copyright (c) 2016-present, Cisco Systems, Inc. All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. # from django.core.management.base import BaseCommand, CommandError from dashboard.models import Alert from...
1.6875
2
Graph.py
bitsPleaseHacked22/UofaPathfinder
0
12773742
<filename>Graph.py<gh_stars>0 import sys import numpy as np class Graph(object): def __init__(self): nodes = np.loadtxt("assets/nodes.csv", dtype=str, delimiter=',') matrix = np.genfromtxt("assets/AM.csv", delimiter=',', filling_values=1000) init_graph = {} for node in n...
3.203125
3
material/assignment2/code/movements.py
mpambasange/MachineLearning
16
12773743
<gh_stars>10-100 #!/usr/bin/env Python3 ''' This file will read in data and start your mlp network. You can leave this file mostly untouched and do your mlp implementation in mlp.py. ''' # Feel free to use numpy in your MLP if you like to. import numpy as np import mlp filename = '../data/movements_day1-3....
3.328125
3
ros/nodes/simple_run.py
asukiaaa/kagotos
0
12773744
#!/usr/bin/env python import rospy from sensor_msgs.msg import LaserScan from geometry_msgs.msg import Twist pub = rospy.Publisher('cmd_vel', Twist, queue_size=10) def set_motor_speed(left, right): twist = Twist() if (left > 0.0 and right > 0.0): twist.linear.x = 1.0 elif (left <= 0.0 and right > ...
2.515625
3
trace-engine/__main__.py
ameli/trace
0
12773745
print('trace!')
1.265625
1
moto/cloudwatch/responses.py
EvaSDK/moto
0
12773746
from moto.core.responses import BaseResponse from .models import cloudwatch_backend class CloudWatchResponse(BaseResponse): def put_metric_alarm(self): name = self._get_param('AlarmName') comparison_operator = self._get_param('ComparisonOperator') evaluation_periods = self._get_param('Eva...
2.09375
2
Build.py
Carreau/all-jupyter
0
12773747
<reponame>Carreau/all-jupyter import os from pathlib import Path ld = os.listdir('public/ecosystem') p = Path('public/ecosystem') import yaml data =[] for sub in p.iterdir(): if not sub.is_dir(): continue y = (sub / 'data.yaml') if not y.exists(): raise ValueError(f'{y} should exists') ...
2.5
2
rearrangement/evaluation/model_eval.py
ylabbe/rearrangement-planning
40
12773748
<reponame>ylabbe/rearrangement-planning<filename>rearrangement/evaluation/model_eval.py<gh_stars>10-100 from pathlib import Path import numpy as np from ..dataset.lmdb import LMDBDataset from ..dataset.real_scene_dataset import RealSceneDataset from ..datasets_cfg import SYNTHETIC_DATASETS, REAL_DATASETS, DS_DIR cla...
2.34375
2
locmoss/kgram.py
jm-begon/locmoss
0
12773749
from hashlib import sha1 class Buffer(object): def __init__(self, capacity): self.circ = [None for _ in range(capacity)] self.top = 0 def __iter__(self): size = len(self.circ) for i in range(size): o = self.circ[(self.top + i) % size] if o is None: ...
2.703125
3
tests/models/test_worklist.py
thtroyer/simple-text-generator
1
12773750
<reponame>thtroyer/simple-text-generator from simpletextgenerator.models.worklist import WorkItem, WorkList, TrainingWorkItem, GeneratingWorkItem def test_trainingWorkItem(): training_work_item = TrainingWorkItem(50) assert (training_work_item.get_time_estimate(training_rate=50)) == 1 assert (training_wor...
2.546875
3