seq_id
stringlengths
4
11
text
stringlengths
113
2.92M
repo_name
stringlengths
4
125
sub_path
stringlengths
3
214
file_name
stringlengths
3
160
file_ext
stringclasses
18 values
file_size_in_byte
int64
113
2.92M
program_lang
stringclasses
1 value
lang
stringclasses
93 values
doc_type
stringclasses
1 value
stars
int64
0
179k
dataset
stringclasses
3 values
pt
stringclasses
78 values
42634550933
__author__ = 'Aaron Yang' __email__ = 'byang971@usc.edu' __date__ = '8/10/2020 5:05 PM' class Solution: def reverse(self, x: int) -> int: flag = x < 0 c_list = [c for c in list(str(x))] c_list.reverse() res = "" for i, c in enumerate(c_list): if c.isnumeric(): ...
AaronYang2333/CSCI_570
records/08-10/rever.py
rever.py
py
650
python
en
code
107
github-code
50
33470901957
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Jan 25 19:57:25 2022 @author: tim """ import skrf as rf import matplotlib.pyplot as plt f_div=1e9 short2port = rf.Network('test/short_after_cal_v3.s2p') short1port = rf.Network(frequency = short2port.f/f_div, s=short2port.s[:,0,0], name='short') open2...
practable/pocket-vna-one-port
arduino/plot_manual_test.py
plot_manual_test.py
py
1,122
python
en
code
0
github-code
50
20436652183
from youtube_transcript_api import YouTubeTranscriptApi as trans from youtube_transcript_api._errors import TranscriptsDisabled, NoTranscriptFound import pandas as pd import bs4 as bs import requests import os from datetime import datetime, timedelta import re from exceptions import check_keyerror_cause, QuotaExceededE...
ethanhinton/finfluencer-finance
functions.py
functions.py
py
10,468
python
en
code
0
github-code
50
73658936475
def distance(space, bs_x, bs_y, tx, ty, lv): st = [[bs_x, bs_y, 0]] v = [[0] * N for _ in range(N)] if space[tx][ty] > lv: return -1 while st: x, y, d = st.pop(0) if x == tx and y == ty: return d for dx, dy in ((-1,0), (0,-1), (0,1), (1,0)): ...
Dodant/potential-octo
백준/Gold/16236. 아기 상어/아기 상어.py
아기 상어.py
py
1,434
python
en
code
0
github-code
50
23997978147
bl_info = { "name": "KTX Tools", "author": "Roel Koster", "version": (3, 5), "blender": (2, 7, 0), "location": "View3D > Tools", "category": "Tools"} import bpy, mathutils, math, random, colorsys, bmesh, operator from mathutils import Vector class KTXAssignRandomDiffuseColors(bpy.types.Opera...
JT-a/blenderpython279
scripts/addons_extern/KTX_Tools.py
KTX_Tools.py
py
53,694
python
en
code
5
github-code
50
3712147461
import numpy as np from matplotlib import pyplot as plt from PIL import Image as im # reading the image and store it in img object img = im.open('c:\\Users\\User\\Downloads\\black.jpg') #disply the image by img object img.show() #convert image to array img_to_array = np.asarray(img) #convert array ...
gupta06rashika/Histogram-Equalization-algorithm-for-a-given-gray-scale-image
hist.py
hist.py
py
2,515
python
en
code
1
github-code
50
11906126869
""" This service makes AE.Cache use a memcached backend rather than disk for the component cache. To turn this on, define memcacheCacheBackend to be a list of ip address of memcache servers. If it is None, this will fall back to the usual skunk cache. """ import cPickle import memcache import AE.Cache from Logger...
BackupTheBerlios/skunkweb-svn
tags/SKUNKWEB_RELEASE_3_4_4/SkunkWeb/Services/aememcache.py
aememcache.py
py
1,828
python
en
code
1
github-code
50
29976365994
from __future__ import print_function from pysnmp.entity.rfc3413.oneliner import cmdgen from config import SNMP_DETAILS def collect_snmp_data(hostname, oid): # cmdGen = cmdgen.CommandGenerator() snmp_target = (hostname, SNMP_DETAILS['port']) cmd_gen = cmdgen.CommandGenerator() (error_detected, error_...
rfdmeshkath/dcim_tool
networking_scripts/snmp.py
snmp.py
py
879
python
en
code
0
github-code
50
24161153551
from mapeventApp.models import AddEvent,Staff from django.shortcuts import redirect, render from django.core.paginator import Paginator import datetime def map(request): # if request.user.is_anonymous: # return redirect ("/login") # date=datetime.date.today() # maping = AddEvent.objects.filter(fromdate__gte=date...
Vipul-Patilw/In-Progress-Mapevent-Class-based-Django
mapeventProjectClassBased/mapeventApp/home.py
home.py
py
1,753
python
en
code
0
github-code
50
25123689269
#!/bin/env python3 __author__ = "Richard Pöttler" __copyright__ = "Copyright (c) 2022 Richard Pöttler" __license__ = "MIT" __email__ = "richard.poettler@gmail.com" from argparse import ArgumentParser from configparser import ConfigParser, ExtendedInterpolation from json import loads from logging import error, info, ...
poettler-ric/pylib
preparewflow.py
preparewflow.py
py
30,017
python
en
code
0
github-code
50
24616010947
# implementation based on "A Comparison of Several Greatest Common Divisor Algorithms" # http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.259.1877&rep=rep1&type=pdf def brute_force(a, b): gcd = 0 # check whether a or b is the lower value if a > b: low = b else: low = a fo...
caterinasworld/gcd
gcd_naive.py
gcd_naive.py
py
419
python
en
code
0
github-code
50
21730770753
from time import time import pytest from algorithm.goal_function import iterator_over_day, Metric from basic_structures import Classes, Lecturer as Lect, Room from basic_structures.classes import UnavailableClasses from data_generation.basic_config import DAY_TIME_WEIGHTS, \ GOAL_FUNCTION_WEIGHTS from schedule.we...
Ignisolver/The-Optimization-Algorithm-for-the-University-Timetabling-Problem
tests/test_algorithm/test_goal_function.py
test_goal_function.py
py
3,337
python
en
code
0
github-code
50
13730490173
#LUCKY 7s #Arya Vishnu #Virtual Dice I guess import random while True: count7 = 0 rolls = int(input("---------------\nHow many rolls: ")) for i in range(0, rolls): r1 = random.randint(1, 6) r2 = random.randint(1, 6) add = r1 + r2 print("(" + str(r1) + ", " + ...
Ar-Vi/pythonChallenges
ICS3.py
ICS3.py
py
460
python
en
code
0
github-code
50
32796007853
from __future__ import division from __future__ import print_function from sklearn.feature_extraction import DictVectorizer from sklearn.preprocessing import LabelEncoder import datetime import sys, gzip import numpy as np import tensorflow as tf import tensorflow.contrib.metrics as tf_metrics import tensorflow.cont...
varisd/MLFix
scripts/neural.py
neural.py
py
12,913
python
en
code
0
github-code
50
41393011134
import jieba txt = open("d:/Desktop/Emily/HKUST/MAFS 6010U - Artificial Intelligence in Finance/project/weibo/云从科技_19.txt", encoding="utf-8").read() #加载停用词表 stopwords = [line.strip() for line in open("d:/Desktop/Emily/HKUST/MAFS 6010U - Artificial Intelligence in Finance/project/CS.txt",encoding="utf-8").readlines()...
aifin-hkust/aifin-hkust.github.io
2019/project/Orange_source/Analysis.py
Analysis.py
py
784
python
en
code
5
github-code
50
24914307854
#!/usr/bin/env python import json import redis import os from random import randint from flask import Flask, render_template, request REDIS_HOST = os.getenv("REDIS_HOST", "localhost") REDIS_PORT = os.getenv("REDIS_PORT", 6379) app = Flask(__name__) @app.route('/') def index(): return render_template('index.h...
jharley/flask-balance
app/balance.py
balance.py
py
823
python
en
code
0
github-code
50
5655333560
doc = 'i bought an apple .\ni ate it .\nit is delicious .' lst = doc.replace('\n', ' ').split(' ') print(lst) # ['i', 'bought', 'an', 'apple', '.', 'i', 'ate', 'it', '.', 'it', 'is', 'delicious', '.'] word2freq = {} for w in lst: if w in word2freq: word2freq[w] += 1 else: word2freq[w] = 1 print(...
SeiichiN/LaLa-Python
55hon-2/en04.py
en04.py
py
428
python
en
code
0
github-code
50
4456728622
from time import sleep print() print('=-'*30) print() bco='BANCO EPB INVESTIMENTOS LTDA' print(f'{bco:^60}') print() print('=-'*30) print() sleep(1) cx_eletr='CAIXA ELETRONICO 24H' cx_1=('**'*10) cx_2=('--'*30) agrd=('AGUARDE.....') print(f'{cx_1}{cx_eletr}{cx_1}') print() sleep(1) saldo_inicial=1000 ...
Edubernardes70/Python_Atividades
Caixa eletrônico.py
Caixa eletrônico.py
py
3,018
python
pt
code
0
github-code
50
28036725360
import math class Calcolatrice: def somma(self, a, b): return a + b def sottrazione(self, a, b): return a - b def moltiplicazione(self, a, b): return a * b def divisione(self, a, b): if b == 0: return "Impossibile dividere per zero" ret...
Pietrofox/Python_Volpe
calcolatrice_user.py
calcolatrice_user.py
py
3,121
python
it
code
1
github-code
50
40727268302
import time from lxml import etree from pykml.parser import Schema from pykml.factory import KML_ElementMaker as KML from pykml.factory import GX_ElementMaker as GX from quad_mesh_simplify import simplify_mesh import numpy as np from aerpawlib.util import Coordinate, VectorNED from lib.util import * from lib.mappin...
MihailSichitiu/aerpaw_drone_corridor_IEEE
aerpaw-drone-corridor/ground/ground_logger.py
ground_logger.py
py
9,252
python
en
code
0
github-code
50
13174461869
import sys,os import readline import pyfiglet from .miscellaneous.completer import * from .settings import * ############ OUTPUT GRAPHICS ################ class bcolors: HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' BOL...
EB113/RandomStuff
SimpleCI/src/menu.py
menu.py
py
3,119
python
en
code
0
github-code
50
36603226692
import functools import warnings from typing import Any, Callable, Optional, TypeVar, overload from exabel_data_sdk.util.warnings import ExabelDeprecationWarning FunctionT = TypeVar("FunctionT", bound=Callable[..., Any]) # Pylint flags '__func' as an invalid argument name, but we want the '__' prefix to make Mypy #...
Exabel/python-sdk
exabel_data_sdk/util/deprecate_arguments.py
deprecate_arguments.py
py
3,180
python
en
code
5
github-code
50
73397106075
import csv import os import random import sys import time from PyQt5.QtWidgets import * from PyQt5.QtGui import * from PyQt5.QtCore import Qt, QTimer from model import Player from utils import log class Game(QWidget): def __init__(self): super().__init__() self.counter = 0 self.load_data...
Curt-H/LotteryWithGUI
app.py
app.py
py
9,220
python
en
code
0
github-code
50
74899355356
import re from typing import Set from .model.board import * from .model.player import Player from collections import defaultdict class StateNode(): def __init__(self, move: str, state: str, comment: str = "", depth: int = None): self.move = move self.state = state self.comment = comment ...
ameyerow/chess-trainer
src/preprocess.py
preprocess.py
py
6,410
python
en
code
2
github-code
50
30826629234
import unittest from sample import HandleHolder class HandleHolderTest(unittest.TestCase): def testCreation(self): holder = HandleHolder(HandleHolder.createHandle()) holder2 = HandleHolder(HandleHolder.createHandle()) self.assertEqual(holder.compare(holder2), False) def testTransfer(s...
pyside/Shiboken
tests/samplebinding/handleholder_test.py
handleholder_test.py
py
670
python
en
code
83
github-code
50
14075574208
def get_sqrt(x): low=0 high=x while low<=high: mid=(low+high)//2 if mid*mid>x: high=mid-1 elif mid*mid<x: low=mid+1 else: return mid return high print(get_sqrt(25)) print(get_sqrt(8))
abuchireddygari/com_sandbox
py-leetcode/find_sqrt.py
find_sqrt.py
py
272
python
en
code
0
github-code
50
74680335515
print("输入第一个数") a = int(input()) print("输入第二个数") b = int(input()) #开始循环取余数,因为这里循环次数是未知的,所以我们使用while while a%b!=0: num = a%b #交叉赋值 a = b b = num #这段可以简写为 a,b=b,(a%b) print("最大公约数为%d" % b)
LearnerPing/coding-think
Python/Untitled-1.py
Untitled-1.py
py
308
python
zh
code
0
github-code
50
4703132626
# -*- coding: utf-8 -*- """ Just an example on how to set parameters for plots """ import matplotlib.pyplot as plt from . import plots import numpy as np #%% plot configurations plt.rcParams["figure.figsize"] = plt.rcParamsDefault["figure.figsize"] plt.rcParams["figure.figsize"] = (24,10) def set_parameters(main_title...
eferlius/basicPlots
figure_parameters.py
figure_parameters.py
py
2,305
python
en
code
0
github-code
50
21869090633
import uuid from django.conf import settings from rest_framework.response import Response from rest_framework.views import APIView from django.core.files.storage import default_storage from . import recognizer class RecognizerView(APIView): def get(self, _): return Response({ 'check': True ...
buldozzzer/inventorybase
tess_ocr/main/views.py
views.py
py
809
python
en
code
0
github-code
50
13016739020
import time import webapp2 import logging import json from Request import Request from google.appengine.api.logservice import logservice from gcm import GCM from RequestHandler import RequestHandler from Users import User class getRequestHandler(webapp2.RequestHandler): def head(self): self.response.statu...
kdroll/SafeWalk
server/getRequestHandler.py
getRequestHandler.py
py
2,201
python
en
code
0
github-code
50
73794229916
def main(): adapters = [0] with open("input.txt") as f: for line in f: adapters.append(int(line)) adapters.sort() diff_1, diff_3 = 0, 1 for i in range(len(adapters) - 1): if adapters[i + 1] - adapters[i] == 1: diff_1 += 1 elif adapters[i + 1] - adapter...
916-Serban-Cristian/AOC2020
Day10/level1.py
level1.py
py
391
python
en
code
0
github-code
50
11464853891
# BJ2776_암기왕 def binary(s, e, nums, num): while s <= e: mid = (s+e)//2 if num1[mid] == num: return 1 elif num1[mid] < num: s = mid + 1 else: e = mid - 1 return 0 T = int(input()) for _ in range(T): N = int(input()) num1 = list(map(int...
5angjae/Algorithm
BAEKJOON/Python/BJ2776.py
BJ2776.py
py
578
python
en
code
0
github-code
50
15932857848
# Returns index of x in arr if present, else -1 def binarySearch_rec (arr, l, r, x): #https://www.geeksforgeeks.org/binary-search/ # Check base case if r >= l: mid = l + (r - l)//2 # If element is present at the middle itself if arr[mid] == x: return mid ...
ShanaWeissman/Senior-Capstone
invertedindex.py
invertedindex.py
py
3,427
python
en
code
0
github-code
50
28550604009
# coding=utf-8 """Test working with net.""" import pytest from loader import network def test_download(): """Test downloading URL document.""" # PREPARE expected = open( 'tests/pages/origin/stepanenkoartem.github.io.html', mode='rb', ).read() actual = network.download('https://st...
StepanenkoArtem/python-project-lvl3
tests/test_network.py
test_network.py
py
1,721
python
en
code
2
github-code
50
30237115768
#!/usr/bin/python print("Content-Type: text/html\n\n") def pokemontable(data): table = "<table border = 1>\n" for list in data: table += "\t<tr>" for item in list: table += "<td>" + str(item) + "</td>" table += "</tr>\n" table += "</table>" return table with open("i...
JasonX354/computationalOmicsLab
python/pokemon/HW36.py
HW36.py
py
2,410
python
en
code
0
github-code
50
42013984188
import requests import asyncio from time import sleep from datetime import datetime from utils import net_monitor from config import COLLECTOR_URL, INTERVAL from classes.flow import Flow from classes.frr_ospfv3 import FrrOspfv3 flow = Flow(INTERVAL) while True: connections = [] try: flows = net_monito...
maurohirt/Docker_GNS3
routers/src/pcc.py
pcc.py
py
1,861
python
en
code
0
github-code
50
9890375405
""" 97. Interleaving String Add to List Description Submission Solutions Total Accepted: 64775 Total Submissions: 268978 Difficulty: Hard Contributors: Admin Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2. For example, Given: s1 = "aabcc", s2 = "dbbca", When s3 = "aadbbcbcac", return t...
fwangboulder/DataStructureAndAlgorithms
#97InterleavingString.py
#97InterleavingString.py
py
1,329
python
en
code
0
github-code
50
35267967180
from collections import deque from threading import Lock import logging from spinn_utilities.log import FormatAdapter from spinnman.messages.eieio.command_messages import ( EventStopRequest, HostSendSequencedData) from spinn_front_end_common.utilities.exceptions import SpinnFrontEndException logger = FormatAdapter...
SpiNNakerManchester/SpiNNFrontEndCommon
spinn_front_end_common/interface/buffer_management/storage_objects/buffers_sent_deque.py
buffers_sent_deque.py
py
6,922
python
en
code
12
github-code
50
27780693808
import unittest from unittest.mock import MagicMock from flashflow.cmd.coord import States from flashflow.msg import FFMsg class MockMeasrProtocol: ''' Mock coord.MeasrProtocol ''' pass class MockTorController(MagicMock): pass def rand_listen_addr(): from random import randint # return '[::1]:...
pastly/flashflow
tests/unit/test_coord.py
test_coord.py
py
6,423
python
en
code
1
github-code
50
26260564088
import openai import os import requests from data_layer.storage import upload_blob from dotenv import load_dotenv, find_dotenv _ = load_dotenv(find_dotenv()) openai.api_key = os.getenv('OPENAI_API_KEY') script_dir = os.path.dirname(os.path.abspath(__file__)) static_folder = os.path.join(script_dir, '../static') co...
kpister/prompt-linter
data/scraping/repos/jpscardoso97~code-tales/src~backend~illustration_generator.py
src~backend~illustration_generator.py
py
1,280
python
en
code
0
github-code
50
19298900539
# -*- coding:utf-8 -*- """ @Author: lamborghini @Date: 2018-11-30 13:58:24 @Desc: 主窗口 """ from PyQt5.QtWidgets import QMainWindow, QDockWidget, QSizePolicy, QMenuBar, QAction from PyQt5.QtCore import Qt from bpwidget import graphictab from bpwidget import detailui, menuui, bpattrwidget, searchui from pubcode.pubqt.pu...
mandeling/Blueprint
bpwidget/blueprintview.py
blueprintview.py
py
4,372
python
en
code
1
github-code
50
40887923288
# add function result = 0 def add(num): global result result += num return result print(add(3)) # 3 print(add(4)) # 7 result1 = 0 result2 = 0 # 각각의 함수에는 영향을 끼치지 않는다. def add1(num): global result1 result1 += num return result1 def add2(num): global result2 ...
naelkim/study
Algorithm/class/class.py
class.py
py
1,858
python
en
code
0
github-code
50
24046919934
from time import sleep import time import threading class BoxFiller(threading.Thread): def __init__(self,parent): threading.Thread.__init__(self) self.parent = parent def run(self): count = 0 for i in range(30): sleep(.5) count += 1 self.parent...
rouge8/hitsearch
threadtest/maker.py
maker.py
py
1,288
python
en
code
8
github-code
50
24355048748
import re import requests # 爬取所有奥特曼图片 # 声明 UA headers = { "User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.85 Safari/537.36" } # 存储异常路径,防止出现爬取失败情况 errorList = [] # run方法 def run(): url = "http://www.ultramanclub.com/allultraman/" try: ...
Nevergiveupp/python-in-action
src/main/prince/getUltramanImage.py
getUltramanImage.py
py
3,209
python
en
code
0
github-code
50
18071561060
import pprint pp = pprint .PrettyPrinter() sigs = {} gates = [] class Gate(): def __init__(self, op, dst, src0, src1): self.op = op self.dst = dst self.src0 = src0 self.src1 = src1 self.resolved = False def resolve(self): if self.resolved: return T...
falyse/advent-of-code
2015/07/main.py
main.py
py
2,213
python
en
code
0
github-code
50
36793218735
import math from heapq import * def func(s): counters = {} for c in s: counters[c] = counters.setdefault(c,0) + 1 buckets = [] for c,f in counters.items(): if f > math.ceil(len(s)/2.0): raise ValueError('No valid') heappush(buckets, [-f,c]) output = [] wh...
baites/examples
algorithms/python/ex001.py
ex001.py
py
716
python
en
code
4
github-code
50
40095094210
import copy import os def SplitV(config, validationDir): ##List with all jobs jobs = [] SplitVType = "single" ##List with all wished IOVs IOVs = [] ##Start with single SplitV jobs if not SplitVType in config["validations"]["SplitV"]: raise Exception("No 'single' key word in confi...
cms-sw/cmssw
Alignment/OfflineValidation/python/TkAlAllInOneTool/SplitV.py
SplitV.py
py
4,390
python
en
code
985
github-code
50
70481602397
import os import threading import logging import sched import time import flask from flask import Flask, render_template, request, redirect, url_for import pyttsx3 import license mit = license.find("MIT") from functions import create_alarm, bbc_news, announcements_alarm, notifications_covid app = Flask(__name__) log...
BiancaStaicu16/SmartAlarm
smart_alarm.py
smart_alarm.py
py
6,548
python
en
code
0
github-code
50
71382326235
# -*- coding: utf-8 -*- import logging import uvclight from grokcore.component import provider from fanstatic import Library, Resource from nva.psyquizz.models.interfaces import IQuizzSecurity from grokcore.component import context, Subscription from zope.interface import Interface, implementer from uvclight.utils imp...
novareto/psyquizz.bgetem
src/psyquizz/bgetem/__init__.py
__init__.py
py
3,245
python
en
code
0
github-code
50
31632386367
from __future__ import print_function import json import logging import time import random import pyDes from .device import Device from .DESFire_DEF import * from .util import byte_array_to_human_readable_hex _logger = logging.getLogger(__name__) class DESFireCommunicationError(Exception): """Outgoing DESFire c...
patsys/desfire-python
Desfire/DESFire.py
DESFire.py
py
27,257
python
en
code
15
github-code
50
9263352550
"""Das Spielerobject""" from pygame import image as pyimage from pygame import transform as pytransform import drawer from healthbar import Healthbar path = 'img//player//' class Player(object): def __init__(self): self.IMG_stand = loadIMG(path + 'stand.png') self.IMG_dodgeL = loadIMG(path + 'do...
Benzcker/youKnowWhat
player.py
player.py
py
3,123
python
en
code
0
github-code
50
18023383241
# -*- coding:utf-8 -*- """ @author: guoxiaorui @file: 2131_longest_palindrome.py @time: 2022-01-12 23:56:25 """ from typing import List from collections import Counter class Solution: def longestPalindrome(self, words: List[str]) -> int: count = Counter(words) ans = 0 has_middle = False ...
sun10081/leetcode_practice_xiaorui
questions/2101_2200/2131_2140/2131_longest_palindrome.py
2131_longest_palindrome.py
py
1,072
python
en
code
0
github-code
50
3046991163
#/usr/bin/python3 import os import pyfiglet class FileRenamer: def __init__(self, folderPath, text, replaceWith, extension): self.folderPath = folderPath self.text = text self.replaceWith = replaceWith self.extension = extension def rename_files(self): try: ...
LRS4/python-automation
file-renamer/renamer.py
renamer.py
py
1,894
python
en
code
1
github-code
50
255903687
#!/bin/python #-*- coding: utf8 -*- def evalPoly(a, t, reverse = False): if reverse: a = list(a) a.reverse() n = len(a) - 1 b = [0.0] * len(a) c = [0.0] * len(a) b[-1] = a[-1] c[-1] = b[-1] for k in range(n-1, 0, -1): b[k] = a[k] + t*b[k+1] c[k] = b[k] + t*c...
liyp0095/ISU_PA
2019F/CS577/Assignment5/PolynomialEvaluation.py
PolynomialEvaluation.py
py
734
python
en
code
0
github-code
50
71028070557
import matplotlib.pyplot as plt import csv input_file = "/home/ole/master/test_onto/coords.csv" x = [] y = [] labels = [] counter = 0 with open(input_file,'r') as csvfile: plots = csv.reader(csvfile, delimiter=',') for row in plots: x.append(float(row[0])) y.append(float(row[1])) lab...
oholter/matcher-with-word-embedings
py/plot/plot.py
plot.py
py
803
python
en
code
1
github-code
50
35423933415
# -*- coding: utf-8 -*- import logging import ask_sdk_core.utils as ask_utils import paho.mqtt.client as mqtt from ask_sdk_core.skill_builder import SkillBuilder from ask_sdk_core.dispatch_components import AbstractRequestHandler from ask_sdk_core.dispatch_components import AbstractExceptionHandler from as...
EliasAquino/LeerEscribirTopicos_PahoMQTT_Skill
lambda/lambda_function.py
lambda_function.py
py
9,742
python
en
code
0
github-code
50
1844700960
import sys, os, time import numpy as np import stft as STFT import math import sineModel as SM import IPython import utilFunctions as UF from IPython.core.debugger import set_trace class AudioSineModel: def __init__(self, file_path): self.file_path= file_path self.frequencies = None self.magnitudes = Non...
arthurtofani/sin-mod-fingerprint
lib/audio_sine_model.py
audio_sine_model.py
py
1,953
python
en
code
0
github-code
50
29473179865
import re from utils.command import Command class Oobify(Command): def __init__(self): super().__init__("oobify") def oob(self, string): new_string = re.sub('[aeiouy]b','a', string) new_string = re.sub('[aeiouy]','oob', new_string) new_string = re.sub('[AEIOUY]','Oob',new_strin...
XenonMolecule/G-Bot
commands/oobify.py
oobify.py
py
656
python
en
code
0
github-code
50
23009922243
__author__ = 'anastasiiakorosteleva' import requests from bs4 import BeautifulSoup from Bio import Entrez Entrez.email = 'ptichka.sinichka1@gmail.com' def makelink(db, indexes): index = [i for i in indexes] list_of_ref = [] if db.lower() == "protein": for i in index: list_of_ref.append...
AnastasiiaKorosteleva/Python
bioinf_dobrynin/fasta_find.py
fasta_find.py
py
2,241
python
en
code
0
github-code
50
41234180086
import os import mysql.connector def main(path): foldersInPath = os.listdir(path) rows = [] for folder in foldersInPath: if folder == "onSale": getFilesPath = os.path.join(path, folder) filesInFolder = os.listdir(getFilesPath) for img in filesInFolder: ...
DeeAmps/PyScripts
onSalesSql.py
onSalesSql.py
py
1,321
python
en
code
0
github-code
50
69903390876
from collections import deque def sol(arr): pile = float('inf') while arr: #num = arr.pop() num = arr.pop(0) if arr[0] > arr[-1] else arr.pop(-1) if num > pile: return "No" pile = num return "Yes" for _ in range(int(input())): n = int(inp...
AdityaChirravuri/CompetitiveProgramming
HackerRank/Python/Collections/PillingUp!.py
PillingUp!.py
py
438
python
en
code
0
github-code
50
10827853738
def Grundy(dict_succ): vertices=list(reversed(sorted(dict_succ.keys()))) #start from the last nodes of graph (nodes having no successors) g_dict={} #grundy function dictionnary (of each node) g_list=[] for k in vertices: g_list=[] l=[] tmp_dic={} if len(dict_succ[k])==0 : g=0 l.append(k) tmp_dic[g...
abmounir/Grundy
grundy.py
grundy.py
py
1,015
python
en
code
1
github-code
50
34260995192
"""Testing facility for conkit.io.a2m""" __author__ = "Felix Simkovic" __date__ = "30 Jul 2018" import unittest from conkit.io.a2m import A2mParser from conkit.io.tests.helpers import ParserTestCase class TestA2mParser(ParserTestCase): def test_read_1(self): msa = """GSMFTPKPPQDSAVI--GYCVKQGAVMKNWKRRY...
rigdenlab/conkit
conkit/io/tests/test_a2m.py
test_a2m.py
py
2,618
python
en
code
20
github-code
50
31858510463
from torch import nn import torch def conv_nd(dims, *args, **kwargs): if dims == 1: return nn.Conv1d(*args, **kwargs) elif dims == 2: return nn.Conv2d(*args, **kwargs) elif dims == 3: return nn.Conv3d(*args, **kwargs) raise ValueError(f"unsupported dimensions: {dims}") def avg...
Daming-TF/kohya_ray
library/sdxl_t2i_adapter.py
sdxl_t2i_adapter.py
py
8,092
python
en
code
0
github-code
50
26203936898
""" The code creates a web application using Streamlit, a Python library for building interactive web apps. # Author: Anonymous # Date: June 06, 2023 """ # streamlit packages import streamlit as st from streamlit_extras.switch_page_button import switch_page from streamlit_extras.app_logo import add_logo from streamlit...
kpister/prompt-linter
data/scraping/repos/AnonymousPaperSubmission123~StoryPoint/pages~02_create_visualizations.py
pages~02_create_visualizations.py
py
59,373
python
en
code
0
github-code
50
20374505028
import logging from abc import ABC from pyrogram import types from bot.errors import RuleViolated from core import main_logger from core.log import event_logger log: logging.Logger = main_logger(__name__) logger: logging.Logger = event_logger(__name__) class BaseRule: """The basic rule for all validation rules...
allen0099/UserBot
bot/validation/rules/base.py
base.py
py
1,893
python
en
code
4
github-code
50
70068283997
from radio_protocol import * import json import csrd J_READ = "READ" J_WRITE = "WRITE" J_OPERATION = "OPERATION" J_ACTION = "ACTION" J_UNKOWN = "UNKNOW" J_FROM = "from" J_TO = "to" J_NAME = "name" J_DATE = "date" J_ID = "id" J_TYPE = "type" J_ACTION_TYPE = "action_type" J_GROUP = "group" J_ELEMENT = "element" J_NEXTST...
amaurial/projects
carsystem/control-station-gui/src/json_csrd.py
json_csrd.py
py
9,763
python
en
code
1
github-code
50
74632025756
from time import sleep import requests import bs4 from bs4 import BeautifulSoup import pandas as pd from random import choice import re from datetime import datetime desktop_agents = [ 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36', 'Mo...
AmarVivek/Web-Scraping
Get_Data.py
Get_Data.py
py
7,835
python
en
code
0
github-code
50
71334428635
import numpy as np from numpy.linalg import inv, det, norm as mag from math import exp, log, pi import time from .kernel_methods import cartesian_operation, default_covariance_func, get_gradient_funcs from functools import partial from copy import deepcopy from random import random from .utilities import create_pool d...
davidgbe/fpmd_with_ml
lib/gaussian_process/gradient_descent.py
gradient_descent.py
py
5,404
python
en
code
2
github-code
50
19848930255
import tkinter as tk #importing tkinter module from PIL import ImageTk, Image #importing PIL for image processing. import tkinter.filedialog as tf from stegano import exifHeader as stg from tkinter import messagebox def close_open(): window.destroy() First_Screen() def back_de...
VishvaAvenue/Steganographer
STEGNOGRAPHER.pyw
STEGNOGRAPHER.pyw
pyw
7,213
python
en
code
0
github-code
50
37060922159
import csv import re import pdb import requests from lxml import etree import json import string import os def validate(item): if item == None: item = '' if type(item) == int or type(item) == float: item = str(item) if type(item) == list: item = ' '.join(item) return item.re...
coralisland-git/Coach-Scraper
phase_1/officials_myohsaa_org/scrape.py
scrape.py
py
3,828
python
en
code
0
github-code
50
31790259859
""" This script handles the loading of the cleaned metadata into the mongodb. Data from scraping server is compressed. server: scraping server workdir: data/corpus command: tar -czvf KCP_<list_of_corpus_ids_to_compress_separated_by_underscore>.tar.gz Send compressed data to gateway: server: scraping server workdir: d...
PinkDiamond1/wb-nlp-apps
pipelines/loading/load_metadata.py
load_metadata.py
py
6,181
python
en
code
null
github-code
50
12787411219
import sys import argparse import numpy as np import pickle from sklearn.tree import DecisionTreeRegressor from sklearn.cluster import MiniBatchKMeans from multiprocessing import Process, Queue from multiprocessing.pool import ThreadPool from helper import * """ Directory Structure: depth-pose-estimation/ data...
ddxue/depth-pose-estimation
models/random-tree-walks/rtw.py
rtw.py
py
22,165
python
en
code
16
github-code
50
17623358754
# 文件读取的方式 from os import SEEK_SET # 打开文件 f = open(file="file.txt", mode="r+", encoding="utf8"); # 一次读取指定长度的行,(默认读取一整行),当当前行字节长度小于指定长度时,全部读取 line = f.readline(2); print("文件内容:",line); # 一次性读取缓冲大小的文件8000多字节,返回每一行构成的列表,当前 lines = f.readlines(); #小于当前行的字节时仍产输出当前行的字节 print("文件内容:",li...
jionjion/Python_WorkSpace
PythonBase/src/grammar/file/文件读取.py
文件读取.py
py
974
python
zh
code
0
github-code
50
28150700620
# Dictionaries provided by the instructor MENU = { "espresso": { "ingredients": { "water": 50, "coffee": 18, }, "cost": 1.5, }, "latte": { "ingredients": { "water": 200, "milk": 150, "coffee": 24, ...
MarieTKD/coffee_machine
coffee.py
coffee.py
py
3,031
python
en
code
0
github-code
50
31579912658
""" Tweaks. """ import abjad def bundle_tweaks(argument, tweaks, i=None, total=None, overwrite=False): if not tweaks: return argument all_tweaks = [] for item in tweaks: if isinstance(item, tuple): assert len(item) == 2 item, index = item if 0 <= index a...
trevorbaca/baca
baca/tweaks.py
tweaks.py
py
1,032
python
en
code
7
github-code
50
39042954466
from math import sqrt; from itertools import count, islice def isPrime(n): return n > 1 and all(n%i for i in islice(count(2), int(sqrt(n)-1))) def max_prime(a,b): n = 0 while True : polynome = n**2 + a*n + b #print("polynome",n,polynome) if not isPrime(polynome): re...
axel584/Project_Euler
027.py
027.py
py
601
python
en
code
0
github-code
50
19953939788
import grpc import threading import sys from infinera.chm6.dataplane.v2 import odu_config_pb2 from grpc_client_adaptor import CrudService def delete_odu_object(odu_id): odu_config = odu_config_pb2.Chm6OduConfig() odu_config.base_config.config_id.value = "1-4-L" + str(odu_id) + "-1" return odu_config de...
Sampu1980/chm5
scripts/ut/deprecated/delete_odu_v2.py
delete_odu_v2.py
py
758
python
en
code
0
github-code
50
3665486757
import h5py import blosc2 import blosc2_grok import numpy as np from skimage.metrics import structural_similarity as ssim from tqdm import tqdm from time import time if __name__ == '__main__': # Register grok codec locally blosc2.register_codec('grok', 160) # Define the compression and decompression para...
Blosc/blosc2_grok
bench/encode-blocking.py
encode-blocking.py
py
2,034
python
en
code
0
github-code
50
19248398401
import pygame from main_entity import * class Main_destroyable_block(Main_entity): def __init__(self, x, y, y_sprite_sheet_index): super().__init__(x, y, y_sprite_sheet_index) self.can_remove = False self.life_span_after_removal = 300 self.timer_to_remove_start = 0 def updat...
ravenstudios/bomberman
main_destroyable_block.py
main_destroyable_block.py
py
636
python
en
code
1
github-code
50
30843635414
from slackclient import SlackClient import pytz #import datetime import time import re import sys, json import serial from channelsList import ChannelsList from slacker import Slacker import unicodedata import threading from threadTimer import ThreadTimer def hello(s): print(s) MSG_NUM = 16 ...
PUT-PTM/2019_SlackDisplay
Slack-Bot/slackbot.py
slackbot.py
py
4,601
python
en
code
0
github-code
50
36590185495
import pyfiglet import os import sys import time from termcolor import colored os.system("clear") def mengetik(s): for c in s + '\n': sys.stdout.write(c) sys.stdout.flush() # Kecepatan mengetik time.sleep(0.1) mengetik(colored(">> Halo, selamat datang di program kami","green")) mengetik(colored(">> Selamat m...
RyanCod3/ImplementasiIPAS
IPAS.py
IPAS.py
py
13,058
python
id
code
1
github-code
50
19769392333
revision = '3b866be530cb' down_revision = '802322a84154' branch_labels = None depends_on = None import alembic import sqlalchemy def upgrade(): alembic.op.add_column('clips', sqlalchemy.Column('deleted', sqlalchemy.Boolean, nullable=False, server_default='false') ) def downgrade(): alembic.op.drop_column('clips...
mrphlip/lrrbot
alembic/versions/3b866be530cb_add_deleted_column_to_clips.py
3b866be530cb_add_deleted_column_to_clips.py
py
334
python
en
code
30
github-code
50
791611810
from config.scaled_yolov4_config import CFG as scaled_yolov4_cfg class Struct(object): """Comment removed""" def __init__(self, data): for name, value in data.items(): setattr(self, name, self._wrap(value)) def _wrap(self, value): if isinstance(value, (tuple, list, set, froze...
wangermeng2021/EfficientDet-tensorflow2
utils/common.py
common.py
py
793
python
en
code
10
github-code
50
20123904709
import networkx as nx import matplotlib.pyplot as plt from networkx import jaccard_coefficient import relate_code.util.filepath as fp import relate_code.util.NMI as nmi import relate_code.util.modularity as md import math import relate_code.util.tools as tools import relate_code.util.lfrTools as lfrtool import networkx...
wuhen15/community_dection
relate_code/testFN.py
testFN.py
py
1,721
python
en
code
0
github-code
50
29285372245
def solution(n, words): answer = [0, 0] past_lst = set([words[0]]) mod = [n] + [i for i in range(1, n)] length = len(words) for i in range(length - 1): if words[i][-1] != words[i + 1][0]: break if words[i + 1] in past_lst: break if len(words[i + 1]) < 2: break past_l...
osj3474/Algorithm-Practice
BackToBasic/pro_english.py
pro_english.py
py
446
python
en
code
1
github-code
50
38660861523
from db_connect import db from iexfinance.refdata import get_symbols from my_enums import Exchange, StockColumn from utils import convert_dataframe_to_document from yfinance import Ticker import json import pandas as pd def initialize_stocks(): '''Clear and initialize database.''' # Clear db.Stocks db.St...
plsloan/Stock_Analysis
db_utils.py
db_utils.py
py
3,774
python
en
code
0
github-code
50
42735181219
import torch.nn as nn import torch import torch.utils.data import numpy as np import pandas as pd class NCFData(torch.utils.data.Dataset): def __init__(self, features, num_item, train_mat=None, num_ng=0, is_training=None): super(NCFData, self).__init__() # Note that the labels are only useful when ...
yijianfenghou/PyRecommendationSystem
NCF/NCF_pytorch.py
NCF_pytorch.py
py
6,076
python
en
code
2
github-code
50
38106581534
#libreria para visualizar la interfaz import pygame # Colores del tablero de ajedrez NEGRO = (0, 0, 0) BLANCO = (255, 255, 255) CAFE = (128,64,0) REINA = (234,190,63) # Tamaño de la celda LARGO = 20 ALTO = 20 # Margen entre las celdas. MARGEN = 5 grid = [] for fila in range(8): grid.append([]) for column...
ArmandoRamirezCarrillo/reinasGui
queenGui.py
queenGui.py
py
3,417
python
es
code
0
github-code
50
24963214631
# F1 -> ao usuário e retorna a resposta do usuário # F2 -> receberá um dicionário e insere um objeto dentro do dic # Pesquisar -> recebe o dic e a chave, preenche uma lista # com o resultado da pesquisa (get()), verifica se não está # vazio ( != diferente ). Caso seja true, exibe os dados. # ---- % ---- # Prime...
bielzfreitas/Exercicios-Python
Funcoes/Funcoes_Dicionarios.py
Funcoes_Dicionarios.py
py
2,033
python
pt
code
0
github-code
50
27058482527
from django.urls import path from . import views app_name = "administration" urlpatterns = [ path('', views.home_view, name='home'), path('register', views.register_request, name='register'), path('login', views.login_request, name='login'), path('logout', views.logout_request, name='logout'), pa...
rajatnai49/PRAVAS
administration/urls.py
urls.py
py
376
python
en
code
0
github-code
50
74851069916
from __future__ import division, print_function from six.moves import zip, map from six import string_types import warnings import os import sys import gc import fnmatch import time import json from datetime import datetime from collections import OrderedDict if sys.version_info.major == 2: try: from numa...
esa/auromat
auromat/mapping/spacecraft.py
spacecraft.py
py
27,418
python
en
code
17
github-code
50
29448160283
import matplotlib.pyplot as plt import csv import matplotlib x = [] y = [] n = 10 #it takes every n-th values. n=1 is full resoltuion with open('datavalues.txt','r') as csvfile: data = csv.reader(csvfile, delimiter=';',quoting=csv.QUOTE_NONNUMERIC) j=0 k=0 for row in data: print("number of row...
aprila14/DistanceSensor
plot.py
plot.py
py
1,275
python
en
code
0
github-code
50
41154752341
import os.path import sys import numpy as np import pandas as pd from btax.util import get_paths globals().update(get_paths()) _OOH_VALUE = os.path.join(_DATA_DIR, 'b101.csv') _DEBT_NFCORP = os.path.join(_DATA_DIR, 'l103.csv') _DEBT_NCORP = os.path.join(_DATA_DIR, 'l104.csv') _DEBT_FCORP = os.path.join(_DATA_DIR, 'l20...
18418n9f2nn1n/B-Tax
btax/calibrate_financing.py
calibrate_financing.py
py
7,488
python
en
code
null
github-code
50
25730776660
""" Read file into texts and calls. It's ok if you don't understand how to read files """ import csv with open('texts.csv', 'r') as f: reader = csv.reader(f) texts = list(reader) with open('calls.csv', 'r') as f: reader = csv.reader(f) calls = list(reader) """ TASK 2: Which telephone number spent the...
evmiguel/udacity_ds_algo
P0/Task2.py
Task2.py
py
1,477
python
en
code
0
github-code
50
72957373594
import os import sys import pandas as pd # Check if the correct number of command-line arguments is provided if len(sys.argv) != 2: sys.stderr.write("Arguments error. Usage:\n") sys.stderr.write("\tpython3 clean_features.py data-file\n") sys.exit(1) # Set the path to the input data data_path = sys.argv[1...
OrlovAlexandr/NY_taxi_travel_time
scripts/data_scripts/clean_features.py
clean_features.py
py
1,139
python
en
code
0
github-code
50
22453164947
import sys, os, tempfile, stat, glob try: import mlflow except ImportError: mlflow = None # this prevent setting tracking ON try: from common.trace import traceln except ImportError: def traceln(*o): print(*o, file=sys.stderr, flush=True) # Either load the config from the application PYTHONPATH...
Transkribus/TranskribusDU
TranskribusDU/util/Tracking.py
Tracking.py
py
7,454
python
en
code
21
github-code
50
18897614330
#!/usr/bin/python # -*- coding: UTF-8 -*- import os import math pi = 3.14159265358979324 a = 6378245.0 ee = 0.00669342162296594323 x_pi = 3.14159265358979324 * 3000.0 / 180.0 def outOfChina(lat, lng): if lng < 72.004 or lng > 137.8347: return True if lat < 0.8293 or lat > 55.8271: retu...
lichuanqi/Python_Learn_Note
map_visualization/gps_convert.py
gps_convert.py
py
2,675
python
en
code
2
github-code
50
20922589920
import gzip import io import lz4.frame import struct import proio.proto as proto magic_bytes = [b'\xe1', b'\xc1', b'\x00', b'\x00', b'\x00', b'\x00', b'\x00', b'\x00', b'\x00', b'\x00', b'\x00', b'\x00', b'\x00', b...
decibelcooper/proio
py-proio/proio/writer.py
writer.py
py
3,900
python
en
code
2
github-code
50
25581271803
# Выведите таблицу размером n×n, заполненную числами от 1 до n2 по спирали, выходящей из левого верхнего угла и закрученной по часовой стрелке, как показано в примере (здесь n=5): # Sample Input: # 5 # Sample Output: # 1 2 3 4 5 # 16 17 18 19 6 # 15 24 25 20 7 # 14 23 22 21 8 # 13 12 11 10 9 #n - размерность матрицы n...
hoiihop/chekio
array.py
array.py
py
1,858
python
ru
code
0
github-code
50