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
src/utils/tools.py
Xuenew/2c
0
17600
<reponame>Xuenew/2c<gh_stars>0 #!/usr/bin/env python """ Created by howie.hu at 2021/4/7. Description:通用函数 Changelog: all notable changes to this file will be documented """ import hashlib def md5_encryption(string: str) -> str: """ 对字符串进行md5加密 :param string: 加密目标字符串 :return: """ ...
1.976563
2
anaconda-mode/0.1.13/jedi-0.15.1-py3.7.egg/jedi/evaluate/gradual/annotation.py
space-scl/emacs.d
2
17601
""" PEP 0484 ( https://www.python.org/dev/peps/pep-0484/ ) describes type hints through function annotations. There is a strong suggestion in this document that only the type of type hinting defined in PEP0484 should be allowed as annotations in future python versions. """ import re from parso import ParserSyntaxErro...
3.109375
3
string_30.py
Technicoryx/python_strings_inbuilt_functions
0
17602
"""Below Python Programme demonstrate rpartition functions in a string""" string = "Python is fun" # 'is' separator is found print(string.rpartition('is ')) # 'not' separator is not found print(string.rpartition('not ')) string = "Python is fun, isn't it" # splits at last occurence of 'is' print(string.rpartition('...
4.09375
4
env/lib/python3.8/site-packages/unidecode/x054.py
avdhari/enigma
48
17603
<filename>env/lib/python3.8/site-packages/unidecode/x054.py data = ( 'Mie ', # 0x00 'Xu ', # 0x01 'Mang ', # 0x02 'Chi ', # 0x03 'Ge ', # 0x04 'Xuan ', # 0x05 'Yao ', # 0x06 'Zi ', # 0x07 'He ', # 0x08 'Ji ', # 0x09 'Diao ', # 0x0a 'Cun ', # 0x0b 'Tong ', # 0x0c 'Ming ', # 0x0d...
1.304688
1
merge_sort.py
BCLaird/refreshers
0
17604
<filename>merge_sort.py<gh_stars>0 import sys import unittest def merge(nums1, nums2): """ :param nums1: Sorted list of numbers. :param nums2: Sorted list of numbers. :return: Combined sorted list of numbers. """ merged = list() while len(nums1) != 0 and len(nums2) != 0: if nums1...
3.890625
4
tests/test_utils/test_textio.py
hongxuenong/mmocr
2,261
17605
# Copyright (c) OpenMMLab. All rights reserved. import tempfile from mmocr.utils import list_from_file, list_to_file lists = [ [], [' '], ['\t'], ['a'], [1], [1.], ['a', 'b'], ['a', 1, 1.], [1, 1., 'a'], ['啊', '啊啊'], ['選択', 'noël', 'Информацией', 'ÄÆä'], ] def test_list_t...
2.9375
3
License Plate Detection.py
jairajsahgal/License_Plate_and_Face_Recognition
0
17606
import cv2 from Text_Detection import detect_characters, detect_string, detect_words import re from live_recognition import facial_recognition # def rescale_frame(frame, percent=75): width = int(frame.shape[1] * percent/ 100) height = int(frame.shape[0] * percent/ 100) dim = (width, height) ret...
2.734375
3
LogParser/LTEV2.py
a22057916w/python_advance
0
17607
##! python3 ##============================================================================== ## Copyright (c) 2021 COMPAL Electronic Inc. All rights reserved. ## This program contains proprietary and confidential information. ## All rights reserved except as may be permitted by prior written consent. ## ## ...
2
2
cnn/test2.py
INFINITSY/darts
0
17608
<reponame>INFINITSY/darts import matplotlib.pyplot as plt import numpy as np # darts_025 = [0, 0, 0, 0, 2, 5, 6, 7, 8] darts_025 = [0, 0, 0, 2, 3, 5, 7, 8] darts_05 = [0, 0, 3, 3, 4, 4, 5, 7, 7] adas_025_9 = [0, 0, 0, 0, 3, 5, 7] adas_05_9 = [0, 0, 1, 4, 5, 6, 6, 7, 7, 7, 7] adas_05_95 = [] adas_05_97 = [0, 0, 0, 2, 4...
2.578125
3
great_international/panels/capital_invest.py
uktrade/directory-cms
6
17609
from wagtail.admin.edit_handlers import ( InlinePanel, HelpPanel, FieldPanel, FieldRowPanel, MultiFieldPanel, PageChooserPanel, ) from wagtail.documents.edit_handlers import DocumentChooserPanel from wagtail.images.edit_handlers import ImageChooserPanel from core.helpers import make_translated_interface from c...
2.015625
2
_6_EXERCISE_BASIC SYNTAX, CONDITIONAL STATEMENTS AND LOOPS/_7_Maximum_Multiple.py
YordanPetrovDS/Python_Fundamentals
0
17610
<gh_stars>0 divisor = int(input()) bound = int(input()) for num in range(bound, 0, -1): if num % divisor == 0: print(num) break
3.5
4
Task1C.py
benkw26/IA-Flood-Warning-Project
0
17611
from floodsystem.geo import stations_within_radius from floodsystem.stationdata import build_station_list def run(): """Requirements for Task 1C""" # Build list of stations stations = build_station_list() # Store the coordinates of Cambridge City Centre CambCoord = (52.2053, 0.1218) #store the...
3.25
3
fixture/project.py
Sashatq/bugtrack
0
17612
from model.objects import Objects import time class ProjectHelper: def __init__(self, app): self.app = app project_cache = None def get_project_list(self): if self.project_cache is None: wd = self.app.wd self.open_manage_project_page() self.project_ca...
2.5625
3
john_doe/cities/hungary.py
xioren/JohnDoe
0
17613
<reponame>xioren/JohnDoe cities = [ 'Budapest', 'Debrecen', 'Miskolc', 'Szeged', 'Pecs', 'Zuglo', 'Gyor', 'Nyiregyhaza', 'Kecskemet', 'Szekesfehervar', 'Szombathely', 'Jozsefvaros', 'Paradsasvar', 'Szolnok', 'Tatabanya', 'Kaposvar', 'Bekescsaba', '...
1.617188
2
carbon0/carbon_quiz/migrations/0010_auto_20200909_0853.py
Carbon0-Games/carbon0-web-app
2
17614
# Generated by Django 3.1.1 on 2020-09-09 12:53 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("carbon_quiz", "0009_auto_20200908_2201"), ] operations = [ migrations.RemoveField( model_name="mission", name="descr...
1.71875
2
wstack/cli/input.py
CCSGroupInternational/wstack
0
17615
import json from ..webstack import run as webstack_run def process(json_file_list): for json_filename in json_file_list: with open(json_filename) as json_file: json_data = json.load(json_file) webstack_data = json_data.get('webstack', None) if webstack_data: ...
2.5625
3
imgtags.py
Donearm/scripts
25
17616
<filename>imgtags.py<gh_stars>10-100 #!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright (c) 2011-2019, <NAME> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Publ...
2.34375
2
notes-to-self/trace.py
guilledk/trio
4,681
17617
import trio import os import json from itertools import count # Experiment with generating Chrome Event Trace format, which can be browsed # through chrome://tracing or other mechanisms. # # Screenshot: https://files.gitter.im/python-trio/general/fp6w/image.png # # Trace format docs: https://docs.google.com/document/d...
2.609375
3
common/data_refinery_common/models/__init__.py
dongbohu/ccdl_test
0
17618
<reponame>dongbohu/ccdl_test from data_refinery_common.models.surveys import SurveyJob, SurveyJobKeyValue from data_refinery_common.models.batches import ( BatchStatuses, Batch, BatchKeyValue, File ) from data_refinery_common.models.jobs import ( WorkerJob, DownloaderJob, ProcessorJob ) from...
1.109375
1
src/client_sample.py
ryoutoku/gunicorn-soap
0
17619
from zeep import Client from models import RequestParameter class Caller: def __init__(self): wsdl_url = "http://0.0.0.0:8080/?wsdl" self._name = "dummy_name" self._times = 3 self._client = Client(wsdl_url) def call_say_hello_1(self): result = self._client.service.say...
2.890625
3
rest_api/views.py
vikash98k/django-rest-api
1
17620
<filename>rest_api/views.py from rest_framework import generics from .permissions import IsOwner from .serializers import BucketlistSerializer, UserSerializer from .models import Bucketlist from django.contrib.auth.models import User from rest_framework.permissions import IsAuthenticated from rest_framework.authenticat...
2.234375
2
darling_ansible/python_venv/lib/python3.7/site-packages/oci/core/models/create_ip_sec_tunnel_bgp_session_details.py
revnav/sandbox
0
17621
# coding: utf-8 # Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c...
2.015625
2
server_django/prikmeter/views.py
ttencate/smartmetertap
1
17622
<filename>server_django/prikmeter/views.py<gh_stars>1-10 from django.contrib import auth, messages from django.shortcuts import redirect, render from django.views.decorators.http import require_POST, require_safe @require_safe def index(request): context = {} return render(request, 'prikmeter/index.html', con...
2.109375
2
scenarios/order_show/executable.py
trenton42/txbalanced
0
17623
import balanced balanced.configure('ak-test-1o9QKwUCrwstHW<KEY>') order = balanced.Order.fetch('/orders/OR7qAh5x1cFzX0U9hD628LPa')
1.414063
1
python/array/leetcode/move_zero.py
googege/algo-learn
153
17624
<reponame>googege/algo-learn<filename>python/array/leetcode/move_zero.py from typing import List # 移动零 class Solution: # 新开一个数组 def moveZeroes1(self, nums: List[int]) -> None: temp, k = [0] * len(nums), 0 for n in nums: if n != 0: temp[k] = n k +=...
3.59375
4
make_tfrecords.py
ssarfjoo/improvedsegan
36
17625
from __future__ import print_function import tensorflow as tf import numpy as np from collections import namedtuple, OrderedDict from subprocess import call import scipy.io.wavfile as wavfile import argparse import codecs import timeit import struct import toml import re import sys import os def _int64_feature(value)...
2.296875
2
software.py
schamberg97/bullshitMgimoProj
0
17626
<reponame>schamberg97/bullshitMgimoProj from myShop import MyShop from myBot import MYBOT from sMenu import Menu class software: @staticmethod def runShowTables(): #подключаем библиотеку import xml.dom.minidom as minidom from sMenu import Menu #читаем XML из файла dom = minidom.parse("myShop.xml") dom...
2.71875
3
examples/basic.py
EmbarkStudios/Python-xNormal
52
17627
import xNormal xNormal.run("piano_high.obj", "piano_low.obj", "piano.png", width=256, height=256, gen_normals = True, gen_ao = True)
1.867188
2
jina/executors/evaluators/rank/recall.py
yk/jina
0
17628
<reponame>yk/jina from typing import Sequence, Any, Optional from . import BaseRankingEvaluator class RecallEvaluator(BaseRankingEvaluator): """A :class:`RecallEvaluator` evaluates the Precision of the search. It computes how many of the first given `eval_at` groundtruth are found in the matches """ ...
2.78125
3
tests/tests_main.py
insilications/tqdm-clr
22,617
17629
<filename>tests/tests_main.py """Test CLI usage.""" import logging import subprocess # nosec import sys from functools import wraps from os import linesep from tqdm.cli import TqdmKeyError, TqdmTypeError, main from tqdm.utils import IS_WIN from .tests_tqdm import BytesIO, _range, closing, mark, raises def restore_...
2.359375
2
plugins/commands.py
Kalpesh0/Project01
0
17630
<reponame>Kalpesh0/Project01 #!/usr/bin/env python3 # -*- coding: utf-8 -*- # @REQUEST_M0viz from pyrogram import Client, filters from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton from script import script @Client.on_message(filters.command(["start"]) & filters.private) async def start(client, m...
2.34375
2
gpjax/utils.py
thomaspinder/GPJax
44
17631
from copy import deepcopy from typing import Tuple import jax.numpy as jnp from jax.scipy.linalg import cho_factor, cho_solve from multipledispatch import dispatch from .types import Array def I(n: int) -> Array: """ Compute an n x n identity matrix. :param n: The size of of the matrix. :return: An ...
2.65625
3
tools/replace_version.py
jasmcaus/image-deep-learning-keras
681
17632
import os def replace_version(old_version, new_version): if not isinstance(old_version, tuple) or not isinstance(new_version, tuple): raise ValueError("`old_version` and `new_version` must be a version tuple. Eg: (1.2.3)") major, minor, micro = old_version[:3] old_version = f'{major}.{minor}.{mic...
3.125
3
DashExperiments/make_plot.py
magruener/reconstructing-proprietary-video-streaming-algorithms
9
17633
import argparse import math import matplotlib.pyplot as plt import os import numpy as np import shutil import pandas as pd import seaborn as sns sns.set() sns.set_context("talk") NUM_BINS = 100 path = '../Data/Video_Info/Pensieve_Info/PenieveVideo_video_info' video_mappings = {} video_mappings['300'] = '320x180x30_v...
2.109375
2
aiopoke/objects/utility/common_models/encounter.py
beastmatser/aiopokeapi
3
17634
from typing import TYPE_CHECKING, Any, Dict, List from aiopoke.utils.minimal_resources import MinimalResource from aiopoke.utils.resource import Resource if TYPE_CHECKING: from aiopoke.objects.resources import EncounterConditionValue, EncounterMethod class Encounter(Resource): min_level: int max_level: ...
2.515625
3
2015/solutions/day1.py
rsizem2/aoc_2020
0
17635
def read_file(test = True): if test: filename = '../tests/day1.txt' else: filename = '../input/day1.txt' with open(filename) as file: temp = list() for line in file: temp.append(line.strip()) return temp def puzzle1(): temp = read_file(False)[0] floo...
3.515625
4
setup.py
Kamuish/StarSearch
0
17636
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from setuptools import setup setup(name='starsearch', version='0.3', description='Package to dig into the ESO archives', author='<NAME>', author_email='<EMAIL>', license='MIT', url='https://github.com/jdavidrcamacho/starsearch', p...
0.980469
1
test/integration/test_genomes.py
beatrizserrano/galaxy
0
17637
import os import tempfile from unittest.mock import patch from galaxy.exceptions import ( ObjectNotFound, ReferenceDataError, ) from galaxy_test.driver import integration_util BUILDS_DATA = ( "?\tunspecified (?)", "hg_test\tdescription of hg_test", "hg_test_nolen\tdescription of hg_test_nolen", ) ...
2.1875
2
examples/exersice2DimRed.py
s2812135/Data_Challenges_WiSe2122
0
17638
import numpy as np import pandas as pd import os from tqdm import tqdm import pacmap import matplotlib.pyplot as plt from sklearn.manifold import TSNE import umap def darius1(numberDirectory): path = "" if(numberDirectory == 1): directorys = [ ['training_setA/training/', 'p0'] ] ...
2.296875
2
release.py
jhofmann/yubiauth
17
17639
<filename>release.py # Copyright (c) 2013 Yubico AB # All rights reserved. # # Redistribution and use in source and binary forms, with or # without modification, are permitted provided that the following # conditions are met: # # 1. Redistributions of source code must retain the above copyright # notice,...
1.585938
2
fabfile.py
8081594571/bgtools_web
1
17640
<gh_stars>1-10 # Credit goes to https://bitbucket.org/spookylukey/django-fabfile-starter/src import os import datetime as dt from io import StringIO import json import posixpath import fabric import requests from fabsettings import (USER, HOST, DJANGO_APP_NAME, DJANGO_APPS_DIR, LOGS_ROOT_D...
2.21875
2
Deep Thumbnail Face Classification and Verification/models/ShuffleNetV2.py
roycechan/portfolio
1
17641
import torch from torch import nn from torch.autograd import Variable import config def init_weights(self): for m in self.modules(): if isinstance(m, nn.Conv2d): nn.init.xavier_normal_(m.weight) if m.bias is not None: nn.init.constant_(m.bias, 0) def conv(in_chann...
2.453125
2
warhorn_api.py
jagerkin/warbot
1
17642
<gh_stars>1-10 # Copyright 2021 <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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
2.015625
2
regnerf/internal/models.py
gunpowder78/google-research
1
17643
# coding=utf-8 # Copyright 2022 The Google Research Authors. # # 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 applicab...
1.820313
2
Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/Tools/DCC/Maya/constants.py
prophetl33t/o3de
0
17644
<reponame>prophetl33t/o3de # coding:utf-8 #!/usr/bin/python # # Copyright (c) Contributors to the Open 3D Engine Project. # For complete copyright and license terms please see the LICENSE at the root of this distribution. # # SPDX-License-Identifier: Apache-2.0 OR MIT # # # ---------------------------------------------...
1.734375
2
lib/data/finetune_imagenet.py
liqi17thu/Stand-Alone-Self-Attention
1
17645
<reponame>liqi17thu/Stand-Alone-Self-Attention import torch import torchvision.datasets as datasets import torchvision.transforms as transforms from lib.data.data_util import ImageNetPolicy, ToBGRTensor from lib.config import cfg from lib.data.transformer_v2 import get_transforms def finetune_imagenet(): transfo...
2.25
2
test/acceptance/test_kamma.py
marceljanerfont/kamma
1
17646
# -*- encoding: utf-8 -*- try: import unittest2 as unittest except ImportError: import unittest from multiprocessing import Manager from random import randint import logging import sys import os import copy import shutil # add kamma path sys.path.insert(0, os.path.abspath(os.path.join(os.path.dir...
2.265625
2
wrappers/python/demo_mp_sync.py
Qworg/libfreenect
10
17647
<reponame>Qworg/libfreenect<gh_stars>1-10 #!/usr/bin/env python import freenect import matplotlib.pyplot as mp import frame_convert import signal keep_running = True def get_depth(): return frame_convert.pretty_depth(freenect.sync_get_depth()[0]) def get_video(): return freenect.sync_get_video()[0] def h...
2.265625
2
codes/models/modules/LPIPS/compute_dists.py
DinJerr/BasicSR
5
17648
<filename>codes/models/modules/LPIPS/compute_dists.py #import models from models.modules.LPIPS import perceptual_loss as models #################### # metric #################### model = None def calculate_lpips(img1_im, img2_im, use_gpu=False, net='squeeze', spatial=False): '''calculate Perceptual Metric using ...
2.171875
2
msgraph-cli-extensions/v1_0/sites_v1_0/azext_sites_v1_0/vendored_sdks/sites/models/_sites_enums.py
thewahome/msgraph-cli
0
17649
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
2.15625
2
evntbus/decorators.py
jmwri/eventbus
0
17650
import typing if typing.TYPE_CHECKING: from evntbus.bus import Bus def listen_decorator(evntbus: 'Bus'): class ListenDecorator(object): def __init__(self, event: typing.Type, priority: int = 5): self.event = event self.priority = priority def __call__(self, f: typing....
2.890625
3
src/shortcircuit/model/crestprocessor.py
farshield/shortcircu
35
17651
<gh_stars>10-100 # crestprocessor.py import threading from PySide import QtCore from crest.crest import Crest class CrestProcessor(QtCore.QObject): """ CREST Middle-ware """ login_response = QtCore.Signal(str) logout_response = QtCore.Signal() location_response = QtCore.Signal(str) destin...
2.375
2
src/commands/pipelines.py
vicobits/sawi-cli
1
17652
<reponame>vicobits/sawi-cli # -*- coding: utf-8 -*- import click from src.commands.project import Project from src.commands.server import Server from src.commands.config import WebServer from src.common.context import CommandContext from src.common.decorators import settings, update_config_file class Pipeline: ...
1.875
2
build.py
jmetzz/coffee-chatbot
0
17653
<filename>build.py from pybuilder.core import use_plugin, init use_plugin("python.core") use_plugin("python.unittest") use_plugin("python.install_dependencies") use_plugin("python.flake8") use_plugin("python.coverage") name = "ActionServerPybuilder" default_task = ['install_dependencies', 'analyze', 'publish'] @init...
2.265625
2
electrumsv/devices/hw_wallet/plugin.py
tuoshao/electrumsv
1
17654
#!/usr/bin/env python2 # -*- mode: python -*- # # Electrum - lightweight Bitcoin client # Copyright (C) 2016 The Electrum developers # # 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...
1.726563
2
api_service/tests/test_model_ids.py
seattleflu/Seattle-Flu-Incidence-Mapper
6
17655
<reponame>seattleflu/Seattle-Flu-Incidence-Mapper import unittest from seattle_flu_incidence_mapper.utils import get_model_id class TestGetIdFromQuery(unittest.TestCase): def test_ids_match_expected(self): ids = { "f39442e6883958971ecc1d0213c59f91": {"model_type":"inla","observed":["encounte...
2.6875
3
Cleaning.py
TharindraParanagama/MovieClassification
0
17656
import csv input = open('MovieI.csv', 'rb') output = open('MovieO.csv', 'wb') writer = csv.writer(output) for row in csv.reader(input): for i in range(len(row)): if(row[0]==''): break elif(row[1]==''): break elif(row[2]==''): break elif(row[3]==''...
3.265625
3
venues/apps.py
danroberts728/hsvdotbeer
18
17657
<reponame>danroberts728/hsvdotbeer from django.apps import AppConfig class VenuesConfig(AppConfig): name = "venues"
1.414063
1
problems/remove-duplicates-from-sorted-list.py
sailikhithk/tech-interview-prep
0
17658
""" The key is to use a set to remember if we seen the node or not. Next, think about how we are going to *remove* the duplicate node? The answer is to simply link the previous node to the next node. So we need to keep a pointer `prev` on the previous node as we iterate the linked list. So, the solution. Create a set ...
4.1875
4
corehq/apps/analytics/signals.py
kkrampa/commcare-hq
1
17659
<reponame>kkrampa/commcare-hq from __future__ import absolute_import from __future__ import unicode_literals import six from django.conf import settings from django.contrib.auth.signals import user_logged_in from corehq.apps.analytics.tasks import ( track_user_sign_in_on_hubspot, HUBSPOT_COOKIE, update_hub...
1.617188
2
manage.py
BeyondLam/Flask_Blog_Python3
2
17660
from app import create_app, db from flask_script import Manager from flask_migrate import Migrate, MigrateCommand app = create_app("develop") manager = Manager(app) Migrate(app, db) manager.add_command("db", MigrateCommand) # 初始化管理员账号数据,添加manager命令 @manager.command def create_admin(): from app.models import Admi...
2.65625
3
qiling/qiling/cc/intel.py
mrTavas/owasp-fstm-auto
2
17661
<gh_stars>1-10 #!/usr/bin/env python3 # # Cross Platform and Multi Architecture Advanced Binary Emulation Framework from unicorn.x86_const import ( UC_X86_REG_AX, UC_X86_REG_EAX, UC_X86_REG_RAX, UC_X86_REG_RCX, UC_X86_REG_RDI, UC_X86_REG_RDX, UC_X86_REG_RSI, UC_X86_REG_R8, UC_X86_REG_R9, UC_X86_REG_R10 ) from qil...
2.390625
2
Alexa_Dynamo.py
gnomesoup/pyDynamo
0
17662
### ----------- Python Code ------------### import csv from flask import Flask, render_template from flask_ask import Ask, statement, question, session import pandas as pd ### ------------- Start Alexa Stuff ---------### app = Flask(__name__) ask = Ask(app, "/") #logging.getLogger("flask_ask").setLevel(logging.DE...
2.921875
3
HW/hklearn/model.py
leguiart/Machine-Learning
0
17663
import abc ''' Interfaz sobre la cual todo modelo implementa. Todo modelo dentro de la biblioteca hklearn implementa los siguientes comportamientos: -fit : Entrena el modelo con un a matriz de ejemplos X y sus respectivas etiquetas y -predict : El modelo entrenado, predice con base en una entrada X ...
3.34375
3
pecos/utils/smat_util.py
UniqueUpToPermutation/pecos
2
17664
# Copyright 2021 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/apache2.0/ # # or in the "license" file acco...
2.625
3
MSMetaEnhancer/libs/Curator.py
xtrojak/pyMSPannotator
2
17665
<reponame>xtrojak/pyMSPannotator from matchms import utils class Curator: """ Curator makes sure that all data is curated before the actual annotation can proceed. Currently, fixing CAS numbers to correct format is supported. """ def curate_spectra(self, spectra): """ Iterates over...
2.453125
2
bin/install_megadrivers.py
antmicro/kvm-aosp-external-mesa3d
0
17666
<filename>bin/install_megadrivers.py<gh_stars>0 #!/usr/bin/env python # encoding=utf-8 # Copyright © 2017-2018 Intel Corporation # 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 restr...
1.992188
2
python_files/helpers.py
nilamo/pytchie
10
17667
#!/usr/bin/env python import os import sys def midi_to_freq(num): """ Takes a MIDI number and returns a frequency in Hz for corresponding note. """ num_a = num - 69 freq = 440 * 2**(num_a / 12.0) return freq def fp(relative): #if hasattr(sys, "_MEIPASS"): # return os.path.join(sys._MEIPASS,...
3.25
3
test/integrationMyndFskr.py
redhog/ferenda
18
17668
# -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function, unicode_literals) from builtins import * import os import sys import shutil import inspect from ferenda import TextReader, util from ferenda.testutil import RepoTester, file_parametrize from ferenda.compa...
2.234375
2
OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/GL/NV/geometry_program4.py
JE-Chen/je_old_repo
0
17669
'''Autogenerated by xml_generate script, do not edit!''' from OpenGL import platform as _p, arrays # Code generation uses this from OpenGL.raw.GL import _types as _cs # End users want this... from OpenGL.raw.GL._types import * from OpenGL.raw.GL import _errors from OpenGL.constant import Constant as _C import...
1.507813
2
benchbuild/projects/benchbuild/xz.py
sturmianseq/benchbuild
11
17670
from plumbum import local import benchbuild as bb from benchbuild.environments.domain.declarative import ContainerImage from benchbuild.source import HTTP from benchbuild.utils.cmd import make, tar class XZ(bb.Project): """ XZ """ VERSION = '5.2.1' NAME = 'xz' DOMAIN = 'compression' GROUP = 'benc...
2.140625
2
train.py
sazzad/CarND-Behavioral-Cloning-P3
0
17671
import numpy as np import csv import cv2 from keras.models import Sequential from keras.layers import Dense, Flatten def load_data(): lines = [] with open('Data/driving_log.csv') as csvfile: reader = csv.reader(csvfile) for line in reader: lines.append(line) images = [] mea...
2.984375
3
models/FedXXX/resnet_utils.py
TD21forever/QoS-Predcition-Algorithm-library
2
17672
from abc import get_cache_token from collections import OrderedDict from torch import nn class ResidualBlock(nn.Module): def __init__(self, in_size, out_size): super().__init__() self.in_size, self.out_size = in_size, out_size self.blocks = nn.Identity() self.shortcut = nn.Identit...
2.40625
2
xblock/test/test_json_conversion.py
edly-io/XBlock
0
17673
""" Tests asserting that ModelTypes convert to and from json when working with ModelDatas """ # Allow inspection of private class members # pylint: disable=protected-access from mock import Mock from xblock.core import XBlock from xblock.fields import Field, Scope, ScopeIds from xblock.field_data import DictFieldData ...
2.828125
3
uq_benchmark_2019/experiment_utils.py
pedersor/google-research
0
17674
# coding=utf-8 # Copyright 2022 The Google Research Authors. # # 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 applicab...
1.765625
2
modisco/coordproducers.py
Bluedragon137/tfmodisco
0
17675
from __future__ import division, print_function, absolute_import from .core import SeqletCoordinates from modisco import util import numpy as np from collections import defaultdict, Counter, OrderedDict import itertools import sys import time from .value_provider import ( AbstractValTransformer, AbsPercentileValTra...
1.773438
2
Google Jam/2016/lastword.py
djphan/Prog-Problems
0
17676
import sys def lastWord ( inputString ): results = [] outputString = inputString[0] for i in range(1, len(inputString)): intermediateString = sorted([outputString + inputString[i], inputString[i] + outputString ]) outputString = intermediateString[1] return outputString numTests = in...
3.5625
4
aiotdlib/api/types/update.py
pylakey/pytdlib
37
17677
# =============================================================================== # # # # This file has been generated automatically!! Do not change this manually! # # ...
1.351563
1
lib/tests/test_integration.py
OneIdentity/safeguard-sessions-plugin-cyberark-vault
0
17678
<reponame>OneIdentity/safeguard-sessions-plugin-cyberark-vault # # Copyright (c) 2019 One Identity # # 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 l...
1.554688
2
forum_modules/akismet/startup.py
Stackato-Apps/osqa
1
17679
import json from django.utils.translation import ugettext as _ from django.http import HttpResponse, HttpResponseRedirect from django.template import RequestContext from django.utils.encoding import smart_str from django.shortcuts import render_to_response from forum.modules import decorate from forum import views fro...
2.015625
2
prototype/python/element_translator.py
doanminhdang/YAML_MATH
1
17680
""" Translate an element, which is described by the YAML method file and a descriptor file, into a target function. Procedure: 1. When analyzing a YAML file, parse the call to the method-element, to get: - list of inputs, - list of outputs 2. Parse the YAML of that element, to know the name of the inputs and outputs...
3.953125
4
build_feature_vectors_32.py
weberdc/find_hccs
7
17681
#!/usr/bin/env python3 import csv import gzip import json import networkx as nx import sys import time import utils from argparse import ArgumentParser from calculate_activity_network import embedded_extended_tweet_url, root_of_conversation from collections import defaultdict from datetime import datetime from utils ...
2.453125
2
WEEKS/CD_Sata-Structures/_RESOURCES/CODESIGNAL/first_duplicate.py
webdevhub42/Lambda
0
17682
def firstDuplicate(a): number_frequencies, number_indices, duplicate_index = {}, {}, {} # Iterate through list and increment frequency count # if number not in dict. Also, note the index asscoiated # with the value for i in range(len(a)): if a[i] not in number_frequencies: numbe...
3.46875
3
src/viewer/abs/forms.py
ozacas/asxtrade
8
17683
<gh_stars>1-10 from django import forms from django.core.exceptions import ValidationError from abs.models import dataflows class ABSDataflowForm(forms.Form): dataflow = forms.ChoiceField(choices=(), required=True) def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.fi...
2.375
2
pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dot1x/clear.py
patrickboertje/genielibs
1
17684
<reponame>patrickboertje/genielibs<filename>pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dot1x/clear.py # Python import logging # Unicon from unicon.core.errors import SubCommandFailure # Logger log = logging.getLogger(__name__) def clear_access_session_intf(device, intf): """ clear access-session interface {} ...
2.078125
2
pipeline/forms.py
jnis77diver/django-pipeline
0
17685
<filename>pipeline/forms.py """Support for referencing Pipeline packages in forms and widgets.""" from __future__ import unicode_literals from django.contrib.staticfiles.storage import staticfiles_storage from django.utils.functional import cached_property try: from django.utils.six import iteritems, add_metaclas...
2.328125
2
api_user/views.py
archkwon/python-django-restful-mysql
0
17686
from django.http import QueryDict from django.http.response import JsonResponse from rest_framework import viewsets, status from rest_framework.views import APIView from .serializers import * class UserInfoViewSet(viewsets.ModelViewSet): queryset = UserInfoModel.objects.all() serializer_class = UserInfoSerial...
2.171875
2
vms/create_kit_files.py
vmssoftware/python_3_8_2
3
17687
import os import re import sys def spec_replacer(match): if match.group(0) == ' ': return '^_' return '^' + match.group(0) def create_content(type, major, minor, level, edit): python_dir = '/python$root' python_dir_len = len(python_dir) all_dirs = [] all_files = [] spec_pattern = r...
2.375
2
dotfiles/config/feltnerm/bin/dots.py
feltnerm/dotfiles
4
17688
<reponame>feltnerm/dotfiles #!/usr/bin/env python # .py # @TODO: # - fix the diffing # - use rsync across hosts or something fancy import argparse, difflib, functools, re, shutil, subprocess, sys, time, os from pprint import pprint __description__ = "Manage your dotfiles." ls = lambda path: os.listdir(path) ls_abs ...
2.390625
2
plot_log_population.py
catskillsresearch/openasr20
0
17689
<filename>plot_log_population.py import matplotlib.pylab as plt def plot_log_population(population, _title, _xlabel, _ylabel, _bins): plt.hist(population,bins=_bins) plt.xlabel(_xlabel) plt.ylabel(_ylabel) plt.title(_title) plt.yscale('log'); plt.show()
3
3
src/stargazer/stargazer.py
magazino/stargazer
1
17690
""" Driver class for Hagisonic Stargazer, with no ROS dependencies. """ from serial import Serial from collections import deque import re import yaml import time import logging import rospy import numpy as np from threading import Thread, Event from tf import transformations # STX: char that represents the start of a ...
2.65625
3
example.py
karishmashuklaa/flatifyLists
0
17691
from flatifylists import flatifyList example = [[[1,2], [3,[4,[5],6],7],8,9]] print(flatifyList(example))
2.78125
3
pympeg/_probe.py
AP-Atul/pympeg
5
17692
<reponame>AP-Atul/pympeg<filename>pympeg/_probe.py import os import json import subprocess from ._exceptions import ProbeException __all__ = ['probe'] def probe(filename, cmd='ffprobe', timeout=None): """Runs the ffprobe on the given file and outputs in json format """ if not os.path.isfile(filename): ...
2.65625
3
example/func_doc.py
tinashime/Python27
0
17693
def printMax(x,y): '''prints the maximum of two numbers. The two values must be integers.''' x = int(x) y = int(y) if x > y: print x,'is maximun' else: print y,'is maximum' printMax(3,5) print printMax.__doc__
4.15625
4
wifi_dos_own.py
Mr-Cracker-Pro/red-python-scripts
1,353
17694
<filename>wifi_dos_own.py #!/usr/bin/env python3 # Disclaimer: # This script is for educational purposes only. # Do not use against any network that you don't own or have authorization to test. #!/usr/bin/python3 # We will be using the csv module to work with the data captured by airodump-ng. import csv # If we m...
2.96875
3
lightwood/mixers/helpers/debugging.py
ritwik12/lightwood
0
17695
<reponame>ritwik12/lightwood import subprocess def get_gpu_memory_map(): ''' Keys are device ids as integers. Values are memory usage as integers in MB. ''' result = subprocess.check_output( [ 'nvidia-smi', '--query-gpu=memory.used', '--format=csv,nounits,no...
3.015625
3
optimization/prac1/tests/test_ridge.py
shaandesai1/AIMS
0
17696
import unittest from sys import argv import numpy as np import torch from objective.ridge import Ridge, Ridge_ClosedForm, Ridge_Gradient from .utils import Container, assert_all_close, assert_all_close_dict def _init_ridge(cls): np.random.seed(1234) torch.manual_seed(1234) n_features = 3 n_samples ...
2.5625
3
app/parking/views.py
zollf/CITS3200
0
17697
<filename>app/parking/views.py from django.shortcuts import redirect from django.http.response import JsonResponse from django.http import HttpResponse from django.views.decorators.csrf import csrf_protect from django.contrib.auth.decorators import login_required from rest_framework.response import Response from rest_...
2.09375
2
utils.py
eepLearning/learn2learn
0
17698
<filename>utils.py import numpy as np import torch from torch.autograd import grad from learn2learn.utils import clone_module, update_module from torch import nn, optim def maml_update(model, lr, grads=None): """ [[Source]](https://github.com/learnables/learn2learn/blob/master/learn2learn/algorithms/maml.py) **De...
3.25
3
sigda/test/graylog.py
yangluoshen/sigda
0
17699
<filename>sigda/test/graylog.py #coding:utf-8 #from graypy import GELFHandler import logging.config import logging ''' handler = GELFHandler(host='0.0.0.0', port=12201) logger = logging.getLogger() logger.addHandler(handler) logger.error('catch error') ''' LOG_LEVEL = 'DEBUG' def get_log_config(category): log_...
2.28125
2