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
jobson_systemtests/cli.py
adamkewley/jobson_systemtests
0
12796151
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # 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 t...
2.328125
2
conventions/migrations/0008_auto_20210831_1707.py
MTES-MCT/appel
0
12796152
<filename>conventions/migrations/0008_auto_20210831_1707.py # Generated by Django 3.2.5 on 2021-08-31 15:07 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("conventions", "0007_auto_20210831_0908"), ] operations = [ migrations.AddField( ...
1.382813
1
src/findRepeatedDnaSequences.py
JL1829/LeetCode
0
12796153
<gh_stars>0 """ 所有的DNA都是由一系列缩写为`A`, `C`, `G`, `T`的核苷酸组成, 例如: `ACGAATTCCG`。在研究DNA时,识别DNA中重复的序列有时候会对研究很有帮助。 编写一个函数, 找出所有的目标子串,目标子串长度为`L`, 且在DNA字符串`s` 中出现次数超过一次 **test case** >>> s = "AAAAACCCCCAAAAACCCCCCAAAAAGGGTTT" >>> findRepeatedDnaSequence(sequence=s, length=10) ['AAAAACCCCC', 'CCCCCAAAAA'] >>> s = 'AAAAAAAAAAAAA...
3.78125
4
onyx/main.py
mudkipdev/onyx
0
12796154
from discord.ext import commands import discord import yaml import os class Bot(commands.Bot): async def get_prefix(self, bot, message): """Fetches the current prefix in the guild from the database.""" return commands.when_mentioned_or("onyx ") def __init__(self): """Initialize the bot...
2.515625
3
src/search/views.py
l27-0-0-1/sigma
0
12796155
import urllib.parse from django.shortcuts import render #from ckan_model import stub as ckan from ckan_model import production as ckan #from ..ckan_model import production as ckan import django.http def index(request: django.http.HttpRequest): payload = {} google = ckan.Search() payload['top_tags'] = ...
2.140625
2
plot_redshift_distr.py
anjmittu/SwiftGRB_PEanalysis-master
5
12796156
import numpy as np from scipy.integrate import quad import matplotlib.pyplot as plt def Redshift(n0, n1, n2, z1=3.6, z=np.linspace(0,10,num=1001)): Rlow = np.power((1.0 + z), n1) Rhigh = np.power((1.0 + z), n2) rbrk = np.power((1.0 + z1), n1 - n2) R = Rlow * (z <= z1) + rbrk * Rhigh * (z > z1) R *= n0 / R[0] ret...
2.609375
3
Leetcode/1000-2000/1872. Stone Game VIII/1872.py
Next-Gen-UI/Code-Dynamics
0
12796157
<filename>Leetcode/1000-2000/1872. Stone Game VIII/1872.py class Solution: def stoneGameVIII(self, stones: List[int]) -> int: n = len(stones) prefix = list(accumulate(stones)) # dp[i] := max score diff the current player can get when the game starts # at i, i.e., stones[0..i] are merged whose value is...
3.1875
3
src/jupyter_contrib_nbextensions/hello.py
satishv21/jupyter_contrib_nbextensions
0
12796158
<filename>src/jupyter_contrib_nbextensions/hello.py def main(str): print("nonce")
1.117188
1
game_summary/__init__.py
ch4zm/blaseball-game-summary
0
12796159
<gh_stars>0 _program = "game-summary" __version__ = "0.7.1"
1.007813
1
examples/reply_keyboard/button.py
dotX12/waio
24
12796160
from waio.keyboard.reply import QuickReplyContentText, QuickReply, KeyboardButton, QuickReplyContentImage from callback import callback_reply_keyboard def generate_keyboard_place(): kb_content = QuickReplyContentText( header="Куда вы сегодня хотите сходить?", text="Выберите из предложенного списка...
2.453125
2
KAT7/reduction/horizon_mask_reduction.py
ska-sa/katsdpscripts
0
12796161
<gh_stars>0 #!/usr/bin/python # Plot horizon mask import optparse import numpy as np import matplotlib.pyplot as plt import matplotlib.mlab as mlab import scape from katpoint import rad2deg def remove_rfi(d,width=3,sigma=5,axis=1): for i in range(len(d.scans)): d.scans[i].data = scape.stats.remove_spikes...
2.53125
3
vim/vimfiles/python3/search_notes.py
sharat87/lawn
5
12796162
#!/usr/bin/env python # Python script for fast text file searching using keyword index on disk. # # Author: <NAME> <<EMAIL>> # Last Change: November 1, 2015 # URL: http://peterodding.com/code/vim/notes/ # License: MIT # # This Python script can be used by the notes.vim plug-in to perform fast # keyword searches in the...
3.15625
3
formatic/walkers/function_injection_walker.py
welchbj/formatic
2
12796163
"""Implementation of the FunctionInjectionWalker class.""" from inspect import ( signature as inspect_signature) from types import ( CodeType, FunctionType) from typing import ( Iterator, Optional) from .abstract_injection_walker import ( AbstractInjectionWalker) from .code_object_injection_w...
2.75
3
tests/test_pathutils.py
pombredanne/https-github.com-nexB-tracecode-toolkit
21
12796164
# # Copyright (c) nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/tracecode-toolkit/ # The TraceCode software is licensed under the Apache License version 2.0. # Data generated with TraceCode require an acknowledgment. # TraceCode is a trademark of nexB Inc. # # You may not use ...
1.375
1
django_learning/dim_sum/migrations/0002_dimsum_history.py
angelptli/django-learning
0
12796165
# Generated by Django 3.2.8 on 2021-10-24 01:32 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('dim_sum', '0001_initial'), ] operations = [ migrations.AddField( model_name='dimsum', name='history', fi...
1.671875
2
tests/unit/api/models/test_subscriptions.py
kikkomep/life_monitor
5
12796166
# Copyright (c) 2020-2021 CRS4 # # 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, distribu...
2.046875
2
src/yolo4/BaseModel.py
xiao9616/yolo4_tensorflow2
212
12796167
# ============================================= # -*- coding: utf-8 -*- # @Time : 2020/5/14 上午10:50 # @Author : xiao9616 # @Email : <EMAIL> # @File : BaseModel.py # @Software: PyCharm # ============================================ import logging import tensorflow as tf import os f...
2.34375
2
2019/20/day20.py
mfep/advent-of-code-2020
2
12796168
import networkx as nx import sys from collections import defaultdict sys.setrecursionlimit(100000000) def direct_paths(lines): world = nx.Graph() for row,line in enumerate(lines): for col,obj in enumerate(line): if obj != '.': continue if line[col - 1] == '.': ...
2.828125
3
rp2paths/DotStyle.py
brsynth/RP2paths
13
12796169
<filename>rp2paths/DotStyle.py """Class for setting the appearance of a dot file. Copyright (C) 2016-2017 <NAME>, JL Faulon's research group, INRA Use of this source code is governed by the MIT license that can be found in the LICENSE.txt file. """ class NodeStyle(object): """General class for node style.""" ...
2.921875
3
mandala/tests/test_deletion.py
amakelov/mandala
9
12796170
<reponame>amakelov/mandala<filename>mandala/tests/test_deletion.py from .utils import * from .funcs import * from .conftest import setup_tests def test_simple(setup_tests): storage, cts = setup_tests storage:Storage ############################################################################ ###...
2.171875
2
ist-study-table-roc.py
lhwangbo/m-ist
0
12796171
import time import matplotlib.pyplot as plt from joblib import dump, load from sklearn.model_selection import * # A custom-made library for reporting from my_eval_functions import set_seeds, get_clf_eval, dingdong, printtimer # Written by <NAME>, MD. Dec 2021. ##### BEGIN print('Loading dataframe, base, and ensemble c...
2.65625
3
src/utils.py
qbasista/api-scraper
0
12796172
<filename>src/utils.py from typing import Dict def add_prefix_to_keys(data: Dict, prefix: str) -> Dict: keys = [*data.keys()] for key in keys: data[f"{prefix}_{key}"] = data.pop(key) return data
2.765625
3
unit_tests/LLC1/test_create_llc1.py
LandRegistry/maintain-frontend
1
12796173
<filename>unit_tests/LLC1/test_create_llc1.py<gh_stars>1-10 from flask_testing import TestCase from unit_tests.utilities import Utilities from maintain_frontend import main from maintain_frontend.dependencies.session_api.session import Session from maintain_frontend.constants.permissions import Permissions from flask i...
2.390625
2
ex022.py
LucasIdalino/Exerc-cios-do-Curso
0
12796174
<gh_stars>0 #Valor da variável sem espaços no ínicio e fim. nome = str(input("Seu nome: ")).strip() #Valor da variável em letras maiúscula. print("Maiúscula:", nome.upper(), "\033[1;32m<--\033[m") #Valor da variável em letras minúsculas. print("Minúscula:", nome.lower(), "\033[1;32m<--\033[m") #Contando quantas letr...
3.9375
4
client.py
bollacker/lri-b
0
12796175
<filename>client.py #!/usr/bin/env python # Copyright 2012-2013 inBloom, Inc. and its affiliates. # # 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....
2.5
2
DarkCTF 2020/Web/Source/exploit.py
UnknownAbyss/CTF-Write-ups
73
12796176
import requests url = 'http://source.darkarmy.xyz/' r = requests.get(url, headers={ 'user-agent': '9e9', }) print(r.text) # darkCTF{changeing_http_user_agent_is_easy}
2.421875
2
facetracker/__init__.py
amitibo/pyfacetracker
2
12796177
""" pyfacetracker: Python wrapper for FaceTracker. ============================================== FaceTracker is a library for deformable face tracking written in C++ using OpenCV 2, authored by <NAME> and maintained by <NAME>. It is available free for non-commercial use, and may be redistributed under these co...
1.445313
1
code/main-multislot-ewc.py
gungui98/sumbt
99
12796178
import csv import os import logging import argparse import random import collections import operator from tqdm import tqdm, trange import numpy as np import torch from torch.utils.data import TensorDataset, DataLoader, RandomSampler, SequentialSampler from torch.utils.data.distributed import DistributedSampler from p...
2.28125
2
s3-encfs-fuse.py
hirokikana/s3-encfs-fuse
0
12796179
<gh_stars>0 #!/usr/bin/env python #-*- coding: utf-8 -*- from s3encfs.s3fs import S3FS from sys import argv, exit import logging from fuse import FUSE if __name__ == '__main__': if len(argv) != 2: print('usage: %s <mountpoint>' % argv[0]) exit(1) logging.basicConfig(level=logging.DEBUG) f...
1.914063
2
ipcrg/resources/id_mapping/download_human_gene_mapping.py
iPC-project-H2020/ipcrg
3
12796180
<filename>ipcrg/resources/id_mapping/download_human_gene_mapping.py<gh_stars>1-10 """Download the latest NCBI id mapping for humans.""" import os import argparse import urllib.request import pandas as pd MAPPING_FTP_FILEPATH = ( 'ftp://ftp.ncbi.nlm.nih.gov/gene/DATA/' 'gene2accession.gz' ) TAX_ID = 9606 parse...
2.953125
3
openslides_backend/action/action_interface.py
reiterl/openslides-backend
0
12796181
from typing import Any, Dict, List from mypy_extensions import TypedDict from typing_extensions import Protocol ActionPayload = List[Dict[str, Any]] ActionPayloadWithLabel = TypedDict( "ActionPayloadWithLabel", {"action": str, "data": ActionPayload} ) Payload = List[ActionPayloadWithLabel] ActionResult = TypedDi...
2.6875
3
openmct_python_example/python-server/test.py
waltoncade/KSD_GroundSystems
2
12796182
<reponame>waltoncade/KSD_GroundSystems<gh_stars>1-10 import queue, threading, time hist = queue.Queue() real = queue.Queue() def putData(): histStart = 0 realStart = 0 while True: time.sleep(1) hist.put(histStart) real.put(realStart) histStart = histStart - 1 realS...
2.6875
3
aerolyzer/wunderData.py
Aerolyzer/Aerolyzer
9
12796183
<gh_stars>1-10 import urllib2 import json import sys import os #def get_wunderkey() def get_data(coord): ''' Purpose: The purpose of this script is to retrieve meteorological data of a given comma-separated latitude and longitute coordinates via the wunderground API. Inputs: coord:...
3.625
4
reader.py
pianomania/cifar10
2
12796184
import numpy as np import os import re import cPickle class read_cifar10(object): def __init__(self, data_path=None, is_training=True): self.data_path = data_path self.is_training = is_training def load_data(self): files = os.listdir(self.data_path) if self.is_training is True: pattern = ...
2.390625
2
things_cli/__init__.py
thingsapi/things-cli
49
12796185
<gh_stars>10-100 """A simple Python 3 CLI to read your Things app data.""" __author__ = "<NAME>" __copyright__ = "2021 <NAME>" __credits__ = ["<NAME>"] __license__ = "Apache License 2.0" __version__ = "0.1.2" __maintainer__ = "<NAME>" __email__ = "<EMAIL>" __status__ = "Development"
1.375
1
packages/core/minos-microservice-networks/minos/networks/brokers/handlers/__init__.py
bhardwajRahul/minos-python
247
12796186
from .impl import ( BrokerHandler, ) from .ports import ( BrokerHandlerService, BrokerPort, )
1.148438
1
combinatorics.py
GoaPhuDen/algorithms-in-python
100
12796187
""" Various combinatorics functions. """ __author__ = "<NAME>" __date__ = "2015-02-20" def factorial(n): if n == 0: return 1 else: return n * factorial(n-1) def permutations(lst): result = [] def permute(current, rest): if rest == []: result.append(current) ...
4.03125
4
sqliscan/lib/reporter.py
Marzooq13579/Hack-Gadgets
8
12796188
<reponame>Marzooq13579/Hack-Gadgets from lib.colour import colours class Report: def __init__(self, msg, result=False): """ Handles the message and report it back to console :param msg : String type message :param result : the boolean object indicating if the url is vulnerable ...
3.03125
3
assessment/migrations/0008_auto_20190125_1249.py
kenware/Assessment
0
12796189
# Generated by Django 2.1.4 on 2019-01-25 12:49 import datetime import django.contrib.postgres.fields.jsonb from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('assessment', '0007_answer_is_correct_choice'), ] operations = [ migrations.Remov...
1.828125
2
scripts/plot_compartment_strength.py
Lila14/multimds
0
12796190
<filename>scripts/plot_compartment_strength.py from matplotlib import pyplot as plt import sys sys.path.append("..") import compartment_analysis as ca import data_tools as dt import os paths = sys.argv[1:len(sys.argv)] prefixes = [os.path.basename(path) for path in paths] structs = [dt.structureFromBed(path) for path ...
2.390625
2
tests/__init__.py
crashfrog/peewee-pymssql
0
12796191
"""Unit test package for peewee_pymssql."""
1.132813
1
server/social_network/views.py
ctcusc/django-react-boilerplate
5
12796192
"""API views for social_network.""" from rest_framework import viewsets from rest_framework.decorators import api_view, detail_route from rest_framework.response import Response from rest_framework.reverse import reverse from .models import Profile, Post, Vote from .serializers import ProfileSerializer, PostSerialize...
2.734375
3
HITCON/2018/children_tcache/exploit.py
Per5ianCat/ctf-writeups
476
12796193
#!/usr/bin/env python from pwn import * def new_heap(size, data, attack=False): p.sendlineafter('Your choice: ', '1') p.sendlineafter('Size:', str(size)) if attack: return p.sendafter('Data:', data) if len(data) < size: p.sendline() def show_heap(index): p.sendlineafter('Your ...
2.546875
3
CKButils.py
MathAI-LAB/CKB
5
12796194
<filename>CKButils.py # -*- coding: utf-8 -*- import torch from torch.autograd import Variable import sys ################################## # Network & Variable ################################## def weights_init(m): """Initialize network parameters.""" classname = m.__class__.__name__ if classname.find('...
2.796875
3
Time_Series_DataAnalysis_Tool/__init__.py
chetanrrk/Time_Series_Data_Analysis_Tools
1
12796195
import Time_Series_DataAnalysis_Tool.time_series_analysis import Time_Series_DataAnalysis_Tool.examples import Time_Series_DataAnalysis_Tool.test
1
1
spladder/classes/counts.py
ratschlab/spladder
96
12796196
<filename>spladder/classes/counts.py import numpy as np class Counts: def __init__(self, seg_num): self.segments = np.zeros((seg_num,), dtype='float') self.seg_pos = np.zeros((seg_num,), dtype='float') self.edges = np.zeros((0, 2), dtype='float')
2.796875
3
ven2/lib/python2.7/site-packages/zope/security/metadirectives.py
manliu1225/Facebook_crawler
3
12796197
<reponame>manliu1225/Facebook_crawler ############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL sh...
1.703125
2
src/compas_singular/rhino/rhino/__init__.py
christiandimitri/compas_singular
1
12796198
from __future__ import absolute_import from __future__ import division from __future__ import print_function from .density import * from .display import * from .getters import * from .pattern import * from .patternartist import * __all__ = [name for name in dir() if not name.startswith('_')]
1.507813
2
uc2data/helpers.py
TUBklima/UC2Data
6
12796199
from .Dataset import Dataset from pathlib import Path def check_multi(folder): pathlist = Path(folder).glob('**/*.nc') for path in pathlist: outfile = Path(str(path).replace(".nc", ".check")) try: with Dataset(path) as i_data: i_data.uc2_check() i_...
2.578125
3
dolo/compiler/model_numeric.py
zlqs1985/dolo
0
12796200
import ast from collections import OrderedDict from .codegen import to_source from .function_compiler_ast import timeshift, StandardizeDatesSimple from dolo.compiler.recipes import recipes from numba import njit class NumericModel: calibration = None calibration_dict = None covariances = None markov_c...
2.125
2
tests/bmc_test.py
reich6534/SumoPY
0
12796201
<reponame>reich6534/SumoPY<filename>tests/bmc_test.py from nose.tools import * from bmc.book import Book def setup(): print ("SETUP!") def teardown(): print("TEAR DOWN!") def test_bookname(): matthew = Book("Matthew", 27) assert_equal(matthew.name, "Matthew") @raises (IndexError) def test_small(): ...
2.328125
2
tests/vfs/gzip_file_system.py
Defense-Cyber-Crime-Center/dfvfs
2
12796202
#!/usr/bin/python # -*- coding: utf-8 -*- """Tests for the file system implementation using gzip.""" import os import unittest from dfvfs.path import gzip_path_spec from dfvfs.path import os_path_spec from dfvfs.resolver import context from dfvfs.vfs import gzip_file_system class GzipFileSystemTest(unittest.TestCas...
2.609375
3
Informatik1/Midterms Prep/midterms hs19/count_keywords.py
Queentaker/uzh
8
12796203
<reponame>Queentaker/uzh<filename>Informatik1/Midterms Prep/midterms hs19/count_keywords.py def count_keywords(path, keywords): words = [] sol = dict() with open(path) as file: for line in file: for word in line.split(): words.append(word.lower()) for elemen...
3.46875
3
delphi/translators/for2py/strings.py
mikiec84/delphi
25
12796204
<filename>delphi/translators/for2py/strings.py """ File: strings.py Purpose: Code implementing string objects (corresponding to the Fortran CHARACTER type) in the code generated by for2py. Usage: see the document "for2py: Miscellaneous constructs" """ class String: def __init__(self, length =...
3.140625
3
functional-problems/deleteNodeFromBst.py
vikas-t/DS-Algo
0
12796205
<filename>functional-problems/deleteNodeFromBst.py #!/usr/bin/python3 # https://practice.geeksforgeeks.org/problems/delete-a-node-from-bst/1 def minValueNode(root): """ Returns the iorder successor or the next higher node as per the inorder traversal """ current = root # loop down to find...
3.984375
4
codeforces/acmsguru/112.py
Ashindustry007/competitive-programming
506
12796206
#!/usr/bin/env python3 # https://codeforces.com/problemsets/acmsguru/problem/99999/112 a,b=map(int,input().split()) print(pow(a,b)-pow(b,a))
3.265625
3
catkin_ws/src/tugasakhir/ta_vision/scripts/uji_transdata.py
musyafaarif/workspace
0
12796207
#!/usr/bin/env python3 import ta_vision from vision.camera import Camera from color_detection import ColorDetection import cv2 as cv import rospy import time import math from geometry_msgs.msg import PointStamped from gazebo_msgs.msg import ModelStates from gazebo_msgs.srv import SetModelState from gazebo_msgs.msg i...
2.171875
2
Standard Library/typing/typing/special_form.py
subhadeep-123/Python-Documents
2
12796208
<filename>Standard Library/typing/typing/special_form.py from typing import Any, AnyStr, Callable, ClassVar, Final, List, Literal, Optional, Tuple, Union # This a tuple defined with variable lenght def print_tuple(data: Tuple[Any, ...]) -> None: print(data) def test_union(a: Union[int, float], b: Union[...
3.109375
3
src/init.py
arnulfojr/simple-pos
1
12796209
<filename>src/init.py from werkzeug.wsgi import DispatcherMiddleware from werkzeug.serving import run_simple from flask import Flask from api import app as api_app from frontend import app as frontend_app from settings import HOSTNAME, PORT, USE_RELOADER, USE_DEBUGGER application = DispatcherMiddleware(frontend_ap...
1.710938
2
examples/smart_contracts/v2/python/contract_account.py
TheChronicMonster/docs
92
12796210
<reponame>TheChronicMonster/docs from algosdk.v2client import algod from algosdk.future.transaction import PaymentTxn, LogicSig, LogicSigTransaction import base64 def wait_for_confirmation(client, txid): """ Utility function to wait until the transaction is confirmed before proceeding. """ last_rou...
2.828125
3
Item2Vec/production/produce_item_sim.py
whz-NJ/PersonalRecommendation
7
12796211
<reponame>whz-NJ/PersonalRecommendation #-*-coding:utf8-*- """ author:zhiyuan date:2019 produce item sim file """ import os import numpy as np import operator import sys def load_item_vec(input_file): """ Args: input_file: item vec file Return: dict key:itemid value:np.array([num1, num2.....
2.703125
3
snipz/main.py
deta/programs
5
12796212
<filename>snipz/main.py import secrets, string from deta.lib import App, Database from fastapi.responses import HTMLResponse from deta.lib.responses import JSON from fastapi import FastAPI, Response from fastapi.middleware.cors import CORSMiddleware from passlib.context import CryptContext from pydantic import BaseMode...
2.234375
2
v5-unity/codechella-to-codcast/convert.py
ipflsfiles/PyTutor
17
12796213
<reponame>ipflsfiles/PyTutor # this script converts a codechella session log recorded by # ../../v3/opt_togetherjs/server.js # # and turns it into the codcast format, which is readable by # ../js/recorder.ts and ../js/demovideo.ts # # writes JSON output to stdout # created: 2018-05-27 ''' NB: now that i think about ...
1.84375
2
11_20/day-19/etch-a-sketch.py
srakhe/100-days-py
0
12796214
from turtle import Turtle, Screen my_turtle = Turtle() screen = Screen() my_turtle.shape('arrow') def forward(): my_turtle.forward(10) def backward(): my_turtle.back(10) def right(): my_turtle.right(10) def left(): my_turtle.left(10) def clear_screen(): my_turtle.penup() my_turtle.home...
3.546875
4
constants/flags.py
CataLatas/earthbound-script-dumper
2
12796215
# Flag names for MOTHER2/Earthbound # Luckily, every version uses the same flag IDs FLAG_NAMES = { 1: 'TEMP_1', 2: 'TEMP_2', 3: 'TEMP_3', 4: 'TEMP_4', 5: 'TEMP_5', 6: 'TEMP_6', 7: 'TEMP_7', 8: 'TEMP_8', 9: 'TEMP_9', 10: 'TEMP_10', 11: 'ENEMY_SUPPRESS', ...
1.3125
1
xjsonrpc/client/integrations/pytest.py
bernhardkaindl/pjrpc
0
12796216
""" `pytest <https://docs.pytest.org/en/latest/>`_ client library integration. Implements some utilities for mocking out ``xjsonrpc`` library clients. """ import asyncio import collections import functools as ft import json import unittest.mock from typing import Any, Callable, Dict, Optional, Union import pytest im...
2.4375
2
scripts/temp/palindrome.py
AgnirudraSil/tetris
3
12796217
<reponame>AgnirudraSil/tetris<filename>scripts/temp/palindrome.py inp = input("Enter a number or word: ") if inp[::-1].lower() == inp.lower(): print("Palindrome") else: print("Not Palindrome")
3.734375
4
schedy/pbt.py
incalia/schedy-client
4
12796218
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals #: Minimize the objective MINIMIZE = 'min' #: Maximize the objective MAXIMIZE = 'max' class Truncate(object): _EXPLOIT_STRATEGY_NAME = 'truncate' def __init__(self, proportion=0.2): ''' ...
3.375
3
dl/pytorch/rnn/tv_script.py
xta0/Python-Playground
0
12796219
# load in data import helper import numpy as np import torch import torch.nn as nn from string import punctuation from collections import Counter from torch.utils.data import TensorDataset, DataLoader data_dir = './data/Seinfeld_Scripts.txt' text = helper.load_data(data_dir) # Check for a GPU train_on_gpu = torch.cu...
2.921875
3
python3/incident/set-owner-and-members-by-phase.py
ibmresilient/resilient-scripts
26
12796220
<filename>python3/incident/set-owner-and-members-by-phase.py # (c) Copyright IBM Corp. 2010, 2020. All Rights Reserved. # Script to set incident owner and members based on Incident Phase. # To be run when the phase changes. # Phase is a select field with API name `phase_id`, # so the tests below are written as # ...
2.78125
3
data/external/repositories_2to3/238397/ucla-cs145-kaggle-master/linearsvclassifier.py
Keesiu/meta-kaggle
0
12796221
<gh_stars>0 """ linearsvclassifier.py Builds a linear support vector classifier ~78 pct accuracy, 0m10.881s execution time """ from classifier import Classifier from matrixdatabase import MatrixDatabase from sklearn.svm import LinearSVC as SVC class LinearSVClassifier(Classifier): def __init__(self,...
2.390625
2
alana_pepper/src/alana_node_classes/behaviour_manager.py
cdondrup/inaugural_pepper
0
12796222
import rospy import service_utils as su from nao_interaction_msgs.srv import BehaviorManagerControl, BehaviorManagerControlRequest from nao_interaction_msgs.srv import BehaviorManagerInfo, BehaviorManagerInfoRequest def start_behaviour(name): su.call_service( "/naoqi_driver/behaviour_manager/start_behavio...
2.171875
2
next_word_prediction_using_universal_sentence_encoder.py
Adminixtrator/Next-Word-Prediction-using-Universal-Sentence-Encoder.
4
12796223
# -*- coding: utf-8 -*- """Next-Word Prediction using Universal Sentence Encoder.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1r2ma5P7w2LE30L1o5mAyNPLE7Qi3JxoL # **Google drive for local storage** _NB: All comments are written to facilitate s...
2.3125
2
paddle2onnx/graph/dygraph_helper.py
neonhuang/Paddle2ONNX
95
12796224
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License" # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
1.945313
2
recipes/LibriSpeech/ASR/transformer/train_cl.py
Darshan7575/speechbrain
0
12796225
<reponame>Darshan7575/speechbrain #!/usr/bin/env python3 """Recipe for training a Transformer ASR system with librispeech. The system employs an encoder, a decoder, and an attention mechanism between them. Decoding is performed with (CTC/Att joint) beamsearch coupled with a neural language model. To run this recipe, d...
2.28125
2
app/services/hubspot.py
PrudhviRaj5/boilerplate-sanic
0
12796226
import requests import ujson # from b2b_app.config import CONFIG class Hubspot: def __init__(self, hub_id, refresh_token): self.hub_id = hub_id self.refresh_token = refresh_token self.access_token = self.get_access_token(refresh_token) self._lists_url = 'https://api.hubapi.com/conta...
2.40625
2
mmgen/models/architectures/ddpm/modules.py
plutoyuxie/mmgeneration
718
12796227
<reponame>plutoyuxie/mmgeneration<gh_stars>100-1000 # Copyright (c) OpenMMLab. All rights reserved. from copy import deepcopy from functools import partial import mmcv import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import ACTIVATION_LAYERS from mmcv.cnn.bricks impor...
2.265625
2
0_PythonFundamental/1_15_conditioning2.py
hnwarid/DQLabAcademy
0
12796228
jam = 13 if 5 <= jam < 12: # selama jam di antara 5 s.d. 12 print("Selamat pagi!") elif jam >= 12 and jam < 17: # selama jam di antara 12 s.d. 17 # simplified: elif 12 <= jam < 17 print("Selamat siang!") elif jam >= 17 and jam < 19: # selama jam di antara 17 s.d. 19 print("Selamat sore!") else: # sel...
3.765625
4
flir_frame_grabber.py
ralphkok/flir-frame-grabber
1
12796229
<filename>flir_frame_grabber.py import PySpin import threading import time import cv2 class FLIRFrameGrabber: _is_camera_inited = False _latest_camera_frame = None _last_frame_grab_time = 0 _frame_grab_fps = 0 def is_running(self): return self._is_running def get_camera(self): ...
2.5
2
file_builder/test/lambda_test.py
btrekkie/file-builder
1
12796230
import os from .. import FileBuilder from .file_builder_test import FileBuilderTest class LambdaTest(FileBuilderTest): """Tests that ``FileBuilder`` methods accept lambda arguments. Tests that ``FileBuilder`` methods accept lambdas for arguments that must be callables. """ def _build_file(self,...
2.78125
3
parser/team09/instrucciones.py
MinervaVilchez/tytus
0
12796231
<filename>parser/team09/instrucciones.py import tabla_simbolos as TS import Errores as E base_actual = None class Instruccion(): def __init__(self, tipo, instruccion): self.tipo = tipo self.instruccion = instruccion class Select(): def __init__(self, dist, selcol, fromcol, joins, order, cond...
2.6875
3
scrape_mars.py
asianhenry/web-scraping-challenge
0
12796232
#!/usr/bin/env python # coding: utf-8 def scrape(): import pandas as pd from splinter import Browser from bs4 import BeautifulSoup import time #dictionary with all data mars_data={} executable_path = {'executable_path': 'chromedriver.exe'} browser = Browser('chrome', **executable...
3.234375
3
python/exercicios_avaliativos/cap_3/fibonacci.py
alavarsedouglas/fiap_repository
0
12796233
<filename>python/exercicios_avaliativos/cap_3/fibonacci.py f = [] f.append(1) f.append(1) n = 0 test = int(input('Digite a posição desejada para saber o número de Fibonacci: ')) while n <= test: f.append(f[n] + f[n+1]) n += 1 print('O número da posição {} é: {} na sequência de Fibonacci!'.format(n-1, f[n-2]))
4.125
4
packages/python.py
zpcc/mpkg-pkgs
1
12796234
from mpkg.common import Soft from mpkg.utils import Search class Package(Soft): ID = 'python' def _prepare(self): data = self.data links = {'32bit': 'https://www.python.org/ftp/python/{ver}/python-{ver}.exe', '64bit': 'https://www.python.org/ftp/python/{ver}/python-{ver}-amd6...
2.328125
2
ceilometer/opts.py
andymcc/ceilometer
0
12796235
# Copyright 2014 eNovance # # 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, so...
0.964844
1
vktrainer/models.py
pmourlanne/VKTrainer
0
12796236
# -*- coding: utf-8 -*- import json import os import random from shutil import copyfile from flask import url_for, current_app as app from flask_login import UserMixin from sqlalchemy import func, desc # from vktrainer import db, app, login_manager from vktrainer import db, login_manager from vktrainer.utils import...
2.375
2
mc3/stats/prayer.py
alulujasmine/mc3
6
12796237
<reponame>alulujasmine/mc3 # Copyright (c) 2015-2021 <NAME> and contributors. # mc3 is open-source software under the MIT license (see LICENSE). __all__ = [ "prayer_beads", ] def prayer_beads(data=None, nprays=0): """ Implement a prayer-bead method to estimate parameter uncertainties. Parameters ...
2.546875
3
kaldi/lm/__init__.py
mxmpl/pykaldi
916
12796238
from ._arpa_file_parser import ArpaParseOptions from ._arpa_lm_compiler import * from ._const_arpa_lm import * from ._kaldi_rnnlm import * __all__ = [name for name in dir() if name[0] != '_' and not name.endswith('Base')]
1.242188
1
Python/CeV/Exercicios/ex38.py
WerickL/Learning
0
12796239
<filename>Python/CeV/Exercicios/ex38.py<gh_stars>0 from math import floor n1 = float(input('Digite um número inteiro:')) n2 = float(input('Digite outro número inteiro:')) if floor(n1) > floor(n2): print('O primeiro número é maior que o segundo!') elif floor(n1) < floor(n2): print('O segundo número é maior que o...
4.09375
4
Implementations/Kattis/others/02/Impl-02-2/armystrenghteasy.py
MilladMuhammadi/Competitive-Programming
0
12796240
for i in range(int(input())): input() Ng,Nm = map(int,input().split()) g=list(map(int,input().split())) m=list(map(int,input().split())) g.sort() m.sort() gg,mm=0,0 while (gg<Ng and mm<Nm): if (m[mm]<=g[gg]): mm+=1 else: gg+=1 if (gg==Ng): ...
3.296875
3
raspberrypi/python/python1_test.py
dambergn/programing-examples
0
12796241
<filename>raspberrypi/python/python1_test.py #!/usr/bin/python print 'Python1 Test Sucessfull'
1.070313
1
Python/pyworkout/modules_and_packages/menu/__init__.py
honchardev/Fun
0
12796242
from menu.menu import menu
1.0625
1
test/integration/ggrc/models/test_document.py
Killswitchz/ggrc-core
0
12796243
<reponame>Killswitchz/ggrc-core<filename>test/integration/ggrc/models/test_document.py<gh_stars>0 # Copyright (C) 2017 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """Integration tests for Document""" from ggrc.models import all_models from integration.ggrc import TestCas...
2.140625
2
vdpwi/utils/preprocess.py
achyudh/castor
132
12796244
import argparse import os from scipy.special import erf from scipy.stats import truncnorm import numpy as np import data def build_vector_cache(glove_filename, vec_cache_filename, vocab): print("Building vector cache...") with open(glove_filename) as f, open(vec_cache_filename, "w") as f2: for line i...
2.34375
2
unicode2koi8r.py
SlimyMonkey/divePython
1
12796245
<reponame>SlimyMonkey/divePython """Convert Cyrillic from iso-8859-1 Unicode-encoded to KOI8-R-encoded This script is used during the build process of the Russian translation of "Dive Into Python" (http://diveintopython.org/). It takes one argument, which can be either an HTML file or a directory. If a file, it conve...
2.71875
3
dramkit/optimizer/pso.py
Genlovy-Hoo/dramkit
0
12796246
<reponame>Genlovy-Hoo/dramkit # -*- coding: utf-8 -*- import time import numpy as np from dramkit.gentools import isnull from dramkit.optimizer.utils_heuristic import rand_init def pso(objf, func_opter_parms): ''' 粒子群优化算法(Particle Swarm Optimization) PSO algorithm TODO ---- 目前仅考虑自变量连续实数情况,以...
2.109375
2
PythonTest/t32.py
Hyyyyyyyyyy/acm
0
12796247
<gh_stars>0 the_count = [1,2,3,4,5] fruits = ['apple','orange','pear','apricot'] change = [1,'pennies',2,'dimes',3,'quarters'] for num in the_count: print "This is count %d" % num for i in fruits: print "A fruit of type: %s" % i for i in change: print "I got %r" % i elements = [] j = "5" for i in range(0,...
3.6875
4
RecoLocalTracker/SubCollectionProducers/python/ClusterMultiplicityFilter_cfi.py
ckamtsikis/cmssw
852
12796248
<gh_stars>100-1000 import FWCore.ParameterSet.Config as cms tifClusterFilter = cms.EDFilter("ClusterMultiplicityFilter", MaxNumberOfClusters = cms.uint32(300), ClusterCollection = cms.InputTag('siStripClusters') )
1.15625
1
src/lib/pytch/actor.py
Liampobob/pytch-vm
0
12796249
<gh_stars>0 from pytch.syscalls import ( play_sound, registered_instances, wait_seconds, ) from pytch.project import FRAMES_PER_SECOND def _is_number(x): return isinstance(x, int) or isinstance(x, float) class Actor: Sounds = [] _appearance_names = None def start_sound(self, sound_name...
2.5
2
setup.py
CSCfi/beacon-network
3
12796250
<reponame>CSCfi/beacon-network<gh_stars>1-10 from setuptools import setup setup( name="beacon_network", version="1.4.0", description="Beacon Network services", long_description_content_type="text/markdown", project_urls={ "Source": "https://github.com/CSCfi/beacon-network", }, ...
1.703125
2