seq_id
string
text
string
repo_name
string
sub_path
string
file_name
string
file_ext
string
file_size_in_byte
int64
program_lang
string
lang
string
doc_type
string
stars
int64
dataset
string
pt
string
api
list
24539747408
# Author : Catveloper # Problem : https://www.acmicpc.net/problem/10866 # 01/06 15:03 import sys from collections import deque def input(): return sys.stdin.readline().rstrip() N = int(input()) arr = input() oper = '+-*/' dic = {} stack = [] d = deque() for i in range(N): d.append(int(input())) for i in arr: ...
CheolheeLee0/Algorithm
Queue,Stack,Deck/후위표기식2_dic,deque,and,fstring.py
후위표기식2_dic,deque,and,fstring.py
py
820
python
en
code
0
github-code
7
[ { "api_name": "sys.stdin.readline", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 8, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 15, "usage_type": "call" } ]
22804092152
import matplotlib.pyplot as plt from Agl_m_v01 import sestavMaticiVzdalenosti, nactiDataDoPole import numpy as np def najdiNejvzdalenejsiBod(matice, bod): ''' metoda pro nalezeni nejvzdalenejsiho bodu od daneho bodu :param matice: matice vzdalenosti :param bod: bod, ke kteremu hledam nejv...
Fiiila/ZSUR_Semestralni_Prace
Maximin.py
Maximin.py
py
5,438
python
cs
code
0
github-code
7
[ { "api_name": "numpy.shape", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.shape", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.shape", "line_number": 58, "usage_type": "call" }, { "api_name": "numpy.inf", "line_number": 73...
29611863453
from pathlib import Path from typing import TYPE_CHECKING from jsonpickle import dumps, loads if TYPE_CHECKING: from .models.game import Game __all__ = [ 'SAVE_FILE', 'save_game', 'load_game', 'save_exists' ] SAVE_FILE = Path('savedata.json') def save_exists() -> bool: return SAVE_FILE.exi...
sharkbound/jacktextadventure
textgame/save.py
save.py
py
527
python
en
code
0
github-code
7
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 6, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 16, "usage_type": "call" }, { "api_name": "jsonpickle.loads", "line_number": 25, "usage_type": "call" }, { "api_name": "jsonpickle.dumps", ...
39281547271
import logging import numpy as np from cn.ivker.ogeek.util.Dict import Dict logger = logging.getLogger("Array") class Array: @staticmethod def extract(data, selected): """ 按selected从data中取出相应的数据 :param data: :param selected: :return: """ if len(select...
ivker/OGeek
cn/ivker/ogeek/util/Array.py
Array.py
py
2,401
python
en
code
0
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 37, "usage_type": "call" }, { "api_name": "cn.ivker.ogeek.util.Dict.D...
14267398765
# pylint: disable=missing-module-docstring,missing-class-docstring, missing-function-docstring import uuid import json import random import pytest from django.urls import reverse from .models import LearningMaterial URL_GET_ALL = reverse('get-all-materials') @pytest.mark.django_db def test_get_materials_exists(cl...
sopermaf/polyglossa
learning_materials/tests.py
tests.py
py
2,103
python
en
code
0
github-code
7
[ { "api_name": "django.urls.reverse", "line_number": 12, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 15, "usage_type": "attribute" }, { "api_name": "models.LearningMaterial.CERFLevel", "line_number": 24, "usage_type": "attribute" }, { "api_n...
9171255544
import pygame import os import random import sys def load_image(name, colorkey=None): fullname = os.path.join('data', name) try: image = pygame.image.load(fullname) if colorkey is not None: if colorkey is -1: colorkey = image.get_at((0, 0)) image.set_col...
Aniyar/Trumpy-Grumpy
trumpy grumpy/helper_functions.py
helper_functions.py
py
1,093
python
en
code
0
github-code
7
[ { "api_name": "os.path.join", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pygame.image.load", "line_number": 10, "usage_type": "call" }, { "api_name": "pygame.image", "line_nu...
30975107033
import collections import json import matplotlib.pyplot as plt filename = "test.json" f = open(filename, 'r') data = json.load(f) f.close() ndata = collections.OrderedDict(sorted(data['n'].items())) n_vals = ndata.keys() t_vals = [] temp_tvals = [] for key in n_vals: for element in ndata[key]: temp_t...
meehande/MatrixFactorizationRecommender
plot_test_results.py
plot_test_results.py
py
562
python
en
code
0
github-code
7
[ { "api_name": "json.load", "line_number": 8, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 28, "usage_type": "call" }, { "api_name": "matplotlib.py...
29319737468
""" This script is checking the availability of investment gin, and sending emails to specified recipients whenever it'S availability changes. """ import os import smtplib import ssl from typing import List import requests from bs4 import BeautifulSoup page = "https://www.lepsinalada.cz/gin/hvozd-gin/" class_to...
grdddj/My-codebase
Python/Webpage Checker/check.py
check.py
py
3,244
python
en
code
0
github-code
7
[ { "api_name": "os.path.dirname", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.join", "lin...
9013196470
from django.shortcuts import get_object_or_404, render from django.http import HttpResponse, Http404 from django.template import loader from .models import Article def get_article_content(request, id): try: article = get_object_or_404(Article, id=id) article_html_string = loader.render_to_string(...
gadjetron/webnotes_blog
content_browser/views.py
views.py
py
1,951
python
en
code
0
github-code
7
[ { "api_name": "django.shortcuts.get_object_or_404", "line_number": 10, "usage_type": "call" }, { "api_name": "models.Article", "line_number": 10, "usage_type": "argument" }, { "api_name": "django.template.loader.render_to_string", "line_number": 11, "usage_type": "call" ...
41243907603
import statistics import time import dlib from detectors.feature_detector import * from detectors.keypoint_detector import * def calibrate(): keypoints = [] calibration_points = [] capture = cv2.VideoCapture(0, cv2.CAP_DSHOW) i = 0 while (i < 4): _, input = capture.read() # used _ to i...
isysterov990/gaze-controlled-computer
gui/calibration.py
calibration.py
py
4,273
python
en
code
1
github-code
7
[ { "api_name": "statistics.mean", "line_number": 34, "usage_type": "call" }, { "api_name": "statistics.mean", "line_number": 35, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 44, "usage_type": "call" }, { "api_name": "dlib.get_frontal_face_dete...
41617806834
from collections import defaultdict A , B =map(int,input().split()) A_list=defaultdict(list) B_list=[] for index in range(1,A+1): A_list[input()].append(index) for index in range(1,B+1): B_list.append(input()) for x in B_list : if x in A_list : print(*A_list.get(x)) else : pr...
m3y3ah/python
HackerRank/DefaultDict_Tutorial.py
DefaultDict_Tutorial.py
py
429
python
en
code
0
github-code
7
[ { "api_name": "collections.defaultdict", "line_number": 3, "usage_type": "call" } ]
30925562614
from settings.get_settings import join_strings, check_if_exists_or_write, SETTINGS import datetime table_location = join_strings( SETTINGS["paths"]["latex"]["latex_path"], SETTINGS["paths"]["latex"]["table_path"]) CUBES = check_if_exists_or_write( SETTINGS["paths"]["cube_json"], base=SETTINGS["paths"]["parent_p...
AadvikVashist/Titan_Limb_Fitting
fitting_code/paper_generation/data_to_latex_table.py
data_to_latex_table.py
py
8,757
python
en
code
0
github-code
7
[ { "api_name": "settings.get_settings.join_strings", "line_number": 3, "usage_type": "call" }, { "api_name": "settings.get_settings.SETTINGS", "line_number": 4, "usage_type": "name" }, { "api_name": "settings.get_settings.check_if_exists_or_write", "line_number": 5, "usage...
19485678660
#!/usr/bin/python # -*- coding:utf-8 -*- import sys import os picdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'pic') libdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'lib') if os.path.exists(libdir): sys.path.append(libdir) import logging from ...
rgodragon/ADIO
Audiobook-shelf-master/Raspberry Pi/etc/epd4_test.py
epd4_test.py
py
5,444
python
en
code
0
github-code
7
[ { "api_name": "os.path.join", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path.realpath", "line_n...
24733637166
import argparse import numpy as np import onnxruntime import torch from scipy.io.wavfile import write import commons import utils from text import text_to_sequence def get_text(text, hps): text_norm = text_to_sequence(text, hps.data.text_cleaners) if hps.data.add_blank: text_norm = commons.intersper...
p0p4k/vits2_pytorch
infer_onnx.py
infer_onnx.py
py
1,824
python
en
code
338
github-code
7
[ { "api_name": "text.text_to_sequence", "line_number": 14, "usage_type": "call" }, { "api_name": "commons.intersperse", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.LongTensor", "line_number": 17, "usage_type": "call" }, { "api_name": "argparse.A...
27035499811
from datetime import datetime as dt import openpyxl from openpyxl.utils import get_column_letter from openpyxl.utils.cell import (column_index_from_string, coordinate_from_string) # заполнить вручную file_name = 'Приложение 1__(2).xlsx' #название файла sheet_name = 'Волгоградский 32 ко...
PavelShabanov/exc
py-exc.py
py-exc.py
py
7,644
python
ru
code
0
github-code
7
[ { "api_name": "openpyxl.utils.cell.coordinate_from_string", "line_number": 36, "usage_type": "call" }, { "api_name": "openpyxl.utils.cell.column_index_from_string", "line_number": 37, "usage_type": "call" }, { "api_name": "openpyxl.utils.cell.coordinate_from_string", "line_nu...
4511548720
from django.shortcuts import render, get_object_or_404, redirect from django.utils import timezone from .models import Post from .forms import PostForm #위에서 .은 현재 디렉토리를 의미함 # Create your views here. # view는 어플리케이션의 로직을 넣는 곳이다. # 각 함수 하나하나를 각각 view라고 하는 듯. # urls.py에 있는 view의 이름과 일치해야 함. 근데 둘 중에 뭐랑 일치해야 하는거지? def pos...
HyesuBae/my-first-blog
blog/views.py
views.py
py
1,998
python
ko
code
0
github-code
7
[ { "api_name": "models.Post.objects.all", "line_number": 14, "usage_type": "call" }, { "api_name": "models.Post.objects", "line_number": 14, "usage_type": "attribute" }, { "api_name": "models.Post", "line_number": 14, "usage_type": "name" }, { "api_name": "django.s...
1909877558
import glob import os import re import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np import pandas as pd from scipy.optimize import curve_fit from scipy import constants mpl.rcParams['figure.dpi'] = 100 mpl.rcParams['font.size'] = 14 mpl.rcParams['savefig.dpi'] = 300 mpl.rcParams['l...
vishniakou/device-analysis
mobility_extraction.py
mobility_extraction.py
py
8,199
python
en
code
1
github-code
7
[ { "api_name": "matplotlib.rcParams", "line_number": 11, "usage_type": "attribute" }, { "api_name": "matplotlib.rcParams", "line_number": 12, "usage_type": "attribute" }, { "api_name": "matplotlib.rcParams", "line_number": 13, "usage_type": "attribute" }, { "api_na...
35086137196
import matplotlib.pyplot as plt x=[-5,-4,-3,-2,-1,0,1,2,3,4,5] y=[27,17,9,3,1,0,1,3,9,17,27] plt.plot(x, y, color = "b" ) plt.title("$y=x^2-x-3$ Grafiği") plt.xlabel("x ekseni") plt.ylabel("y ekseni") plt.show()
OsmanYavuz-web/PythonOdev2
3/B.py
B.py
py
214
python
en
code
0
github-code
7
[ { "api_name": "matplotlib.pyplot.plot", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 6, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.title", "line_number": 7, "usage_type": "call" }, { "api_name": "matplot...
72960858142
import matplotlib.pyplot as plt colrs = { 'green': (0.39,0.73,0.42,0.5), 'grey': (1, 1, 1, 0.6), 'grey_trans': (1, 1, 1, 0.25), 'grey_super_trans': (1,1,1, 0.05), 'dark': "#121212" } assumption = { 'max_value_x' : 1000, ## Hours of music 'text_size': 8 } def gen_plot(x=10.24,y=5.76, dpi=...
jay-chau/spotify
plotting.py
plotting.py
py
1,184
python
en
code
0
github-code
7
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 17, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.axes", "line_number": 17, "usage_type": "call" }, { "api_name": "mat...
9419163348
from tqdm import tqdm from glob import glob from os import remove as remove_file from ults import run_query,get_query_s3_location,update_query_dbname,BATCH_SIZE from more_itertools import chunked EXOGENOUS_DIR = "mimiciii/out/exogenous/" EXOGENOUS_DATAPOINTS_SQL = "mimiciii/in/exogenous_datapoints.SQL" EXOGENOUS_DATA...
AdamBanham/ICPM2021
mimiciii/steps/exogenous.py
exogenous.py
py
2,088
python
en
code
3
github-code
7
[ { "api_name": "ults.get_query_s3_location", "line_number": 17, "usage_type": "call" }, { "api_name": "ults.update_query_dbname", "line_number": 19, "usage_type": "call" }, { "api_name": "ults.update_query_dbname", "line_number": 20, "usage_type": "call" }, { "api_...
12788920878
import config import psutil import datetime import os import re from mailer import Mailer from .exceptions import ConfigurationException import math class BackupManager: def __init__(self, file_size_unit: str = None, backup_increase: float = None, pg_host: str = ...
MatthewAllDev/PostgreSQL_backup_and_telegram_notification
backup_manager/backup_manager.py
backup_manager.py
py
8,636
python
en
code
0
github-code
7
[ { "api_name": "config.FILE_SIZE_UNIT", "line_number": 25, "usage_type": "attribute" }, { "api_name": "config.BACKUP_INCREASE", "line_number": 29, "usage_type": "attribute" }, { "api_name": "config.PG_HOST", "line_number": 33, "usage_type": "attribute" }, { "api_na...
23609061150
from tqdm import tqdm import geocoder from twitter_demographer.components import Component import logging from twitter_demographer.components import not_null import time class NominatimDecoder(Component): """ Wrappers on the geocoder API to disambiguate users' locations using nominatim from open street map ...
arafat877/twitter-demographer
twitter_demographer/geolocation/nominatim.py
nominatim.py
py
1,668
python
en
code
null
github-code
7
[ { "api_name": "twitter_demographer.components.Component", "line_number": 8, "usage_type": "name" }, { "api_name": "logging.StreamHandler", "line_number": 26, "usage_type": "call" }, { "api_name": "logging.ERROR", "line_number": 27, "usage_type": "attribute" }, { "...
36992628905
import youtube_dl def getVid(link): ydl = youtube_dl.YoutubeDL({'outtmpl': '%(id)s%(ext)s'}) with ydl: result = ydl.extract_info( link, download=False # We just want to extract the info ) if 'entries' in result: # Can be a playlist or a list of videos ...
EllisK-L/Django-Youtube-Downloader
YoutubeDownloader/downloader/utils.py
utils.py
py
572
python
en
code
4
github-code
7
[ { "api_name": "youtube_dl.YoutubeDL", "line_number": 5, "usage_type": "call" } ]
42485937091
import json import logging import mimetypes import os import requests from six.moves.urllib.parse import urljoin CAPTIONBOT_API = 'https://www.captionbot.ai/api/' logger = logging.getLogger('imgcaption') class API(object): def __init__(self): self.session = requests.Session() self.watermark = ''...
DeanF/imgcaption
imgcaption/imgcaption.py
imgcaption.py
py
2,032
python
en
code
2
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "requests.Session", "line_number": 15, "usage_type": "call" }, { "api_name": "six.moves.urllib.parse.urljoin", "line_number": 22, "usage_type": "call" }, { "api_name": "jso...
22556474913
# -*- coding: utf-8 -*- # __author__ = "yw" """ # Serializers用于定义API的表现形式,如:返回那些字段、返回怎样的格式等。 # 这里序列化Django自带的User和Group。 # 创建数据序列化 """ # from django.contrib.auth.models import User,Group from rest_framework import serializers from api.models import User,Group class UserSerializer(serializers.HyperlinkedModelSerializer...
heuje/django_restful
api/serializers.py
serializers.py
py
641
python
en
code
0
github-code
7
[ { "api_name": "rest_framework.serializers.HyperlinkedModelSerializer", "line_number": 12, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 12, "usage_type": "name" }, { "api_name": "api.models.User", "line_number": 14, "usage_type": ...
70183755745
import MySQLdb from MySQLdb.connections import Connection from MySQLdb.cursors import Cursor # pip install mysqlclient~=2.0.3 import contextlib from typing import ( ContextManager, ) @contextlib.contextmanager def connection(*args, **kwargs) -> ContextManager[Connection]: conn = MySQLdb.connect(*args, **kwarg...
Dudeldel/KardioApp
api/db_connector.py
db_connector.py
py
710
python
en
code
1
github-code
7
[ { "api_name": "MySQLdb.connect", "line_number": 12, "usage_type": "call" }, { "api_name": "contextlib.contextmanager", "line_number": 10, "usage_type": "attribute" }, { "api_name": "typing.ContextManager", "line_number": 11, "usage_type": "name" }, { "api_name": "...
31411013559
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import requests from time import time from jsonpath import jsonpath from pythonProject.common.handle_conf import conf from pythonProject.common.handle_sign import Handle_sign class Base_class: base_url = conf.get('env', 'base_url') @classmethod def admin_lo...
wdj-hmm/pythonlearn
pythonProject/testcases/fixture.py
fixture.py
py
3,256
python
en
code
0
github-code
7
[ { "api_name": "pythonProject.common.handle_conf.conf.get", "line_number": 12, "usage_type": "call" }, { "api_name": "pythonProject.common.handle_conf.conf", "line_number": 12, "usage_type": "name" }, { "api_name": "pythonProject.common.handle_conf.conf.get", "line_number": 20...
22343712048
""" Created on Sun Apr 10 17:54:35 2016 Author: Felipe M. Vieira Description: Assignment 03 """ import os import pandas as pd # version '0.18.0' import seaborn # version '0.7.0' import matplotlib.pyplot as plt # version'1.3.1' import numpy as np from project_library import DATASETS_PATH # reads the input file...
fmv1992/data_analysis_and_interpretation_specialization
01_data_management_and_visualization/03_assignment/03_assignment.py
03_assignment.py
py
1,349
python
en
code
0
github-code
7
[ { "api_name": "pandas.read_csv", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 22, "usage_type": "call" }, { "api_name": "project_library.DATASETS_PATH", "line_number": 23, "usage_type": "argument" }, { "api_name": "os.pat...
41270336845
from multiprocessing import Process, Queue import cv2 import numpy as np import requests import polyline import json import time import pyclipper class NavigationEvent: def __init__(self, txt, coordinates, is_drawable, is_viewable, is_turn): self.text_command = txt self.event_coordinates = coordin...
the1adi/ANDE
main.py
main.py
py
31,581
python
en
code
0
github-code
7
[ { "api_name": "numpy.sqrt", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.square", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 38, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": ...
16066772049
# -*- coding: utf-8 -*- import csv import sys import time import random import copy import math import os import numpy as np import os.path as pt from skimage import io from skimage import transform as tr from argparse import ArgumentParser from chainer import cuda sys.path.append(os.getcwd()) from src.lib.model impo...
funalab/QCANet
src/tools/test_nsn.py
test_nsn.py
py
9,391
python
en
code
31
github-code
7
[ { "api_name": "sys.path.append", "line_number": 17, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path.exists", "line_nu...
15857463058
# -*- coding: utf-8 -*- import torch import os import logging from transformers import AdamW, get_linear_schedule_with_warmup from torch.utils.data import TensorDataset, DataLoader, RandomSampler def start_from_pretrained(pre_mdl_path, model): cp_mdl = BertModel.from_pretrained(pre_mdl_path) a, b = model.s...
kids/bert_nlu
train.py
train.py
py
3,585
python
en
code
8
github-code
7
[ { "api_name": "os.path.exists", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path", "line_number": 27, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 28, "usage_type": "call" }, { "api_name": "torch.optim.SGD", "line_n...
1537565419
import os.path import os import re import time import requests from requests_html import HTMLSession from bs4 import BeautifulSoup from dotenv import load_dotenv dotenv_path = '../../.env' load_dotenv(dotenv_path) userName = os.environ.get("userName") userName = str(userName) with open('/home/' + userName + '/Discor...
JesseObvious/DiscordProject
PythonPlex/SourceCode/fileSizeCheck.py
fileSizeCheck.py
py
1,658
python
en
code
0
github-code
7
[ { "api_name": "dotenv.load_dotenv", "line_number": 11, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 13, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 13, "usage_type": "attribute" }, { "api_name": "re.sub", "line_...
14782095149
# import modules here import pygame import os from random import randint import pygame.draw_py # Initializing imgs img = "img" # load Logo logo_img = pygame.image.load(os.path.join(img, "Logo.png")) # Load Dino dino_img1 = pygame.image.load(os.path.join(img, "dino", "frame1.png")) dino_img2 = pygame.image.load(os....
mbalboni25/dino
main.py
main.py
py
20,914
python
en
code
0
github-code
7
[ { "api_name": "pygame.image.load", "line_number": 14, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_...
26868883993
import logging from typing import Any, MutableMapping, Optional from cloudformation_cli_python_lib import ( Action, HandlerErrorCode, OperationStatus, ProgressEvent, Resource, SessionProxy, ) from datadog_api_client.v1 import ApiException from datadog_api_client.v1.api import downtimes_api from...
DataDog/datadog-cloudformation-resources
datadog-monitors-downtime-handler/src/datadog_monitors_downtime/handlers.py
handlers.py
py
8,531
python
en
code
47
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 22, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 23, "usage_type": "attribute" }, { "api_name": "cloudformation_cli_python_lib.Resource", "line_number": 27, "usage_type": "call" }, { "api_n...
4392263357
# -*- coding: utf-8 -*- from torch import nn, Tensor from abc import ABC, abstractmethod from typing import Tuple, Optional, List import logging logger = logging.getLogger(__name__) class BaseLatentFeatureModel(nn.Module, ABC): def __init__(self) -> None: super().__init__() @abstractmethod d...
uclnlp/ctp
ctp/models/base.py
base.py
py
1,078
python
en
code
49
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.nn.Module", "line_number": 14, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 14, "usage_type": "name" }, { "api_name": "abc.ABC", "line_n...
3527562860
from datetime import datetime from os import mkdir from pathlib import Path import pandas as pd import pytest from freezegun import freeze_time from noisy_stocks_data_orchestrator.customdatastructures import ( CorrDatabaseQuery, StockTimeSeries, ) """ Single source of truth for fixtures across tests """ # Sc...
KevinFocke/noisy_stocks_data_orchestrator
tests/conftest.py
conftest.py
py
14,025
python
en
code
1
github-code
7
[ { "api_name": "pytest.fixture", "line_number": 27, "usage_type": "attribute" }, { "api_name": "pandas.DataFrame", "line_number": 34, "usage_type": "call" }, { "api_name": "pandas.NaT", "line_number": 41, "usage_type": "attribute" }, { "api_name": "noisy_stocks_dat...
72868331422
import struct import numpy as np import sys, os import argparse cv_type_to_dtype = { 5: np.dtype('float32') } dtype_to_cv_type = {v: k for k, v in cv_type_to_dtype.items()} def write_mat(f, m): """Write mat m to file f""" if len(m.shape) == 1: rows = m.shape[0] cols = 1 else: ...
Ascend/ModelZoo-PyTorch
PyTorch/dev/cv/image_classification/ArcFace_ID0852_for_PyTorch/eval_deepglint_merge.py
eval_deepglint_merge.py
py
2,347
python
en
code
31
github-code
7
[ { "api_name": "numpy.dtype", "line_number": 7, "usage_type": "call" }, { "api_name": "struct.pack", "line_number": 20, "usage_type": "call" }, { "api_name": "struct.unpack", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.fromstring", "line_num...
6696199994
from PyQt5.QtCore import ( QAbstractItemModel, QModelIndex, Qt, QVariant ) from PyQt5.QtWidgets import QApplication, QTreeView class TreeItem(object): def __init__(self, content, parentItem): self.content = content self.parentItem = parentItem self.childItems = [] def appe...
cnc-club/dxf2gcode
python_examples/treewidget.py
treewidget.py
py
3,322
python
en
code
12
github-code
7
[ { "api_name": "PyQt5.QtCore.QVariant", "line_number": 30, "usage_type": "call" }, { "api_name": "PyQt5.QtCore.QVariant", "line_number": 32, "usage_type": "call" }, { "api_name": "PyQt5.QtCore.QAbstractItemModel", "line_number": 42, "usage_type": "name" }, { "api_n...
39667217954
# Here you'll find things that are useful but # have more specific utilities import numpy as np import copy import torch from torch.utils.data import Dataset from torch.utils.data import DataLoader #################################### ######## Useful functions ########## #################################### def se...
RichieHakim/tensor_regression
util.py
util.py
py
3,855
python
en
code
0
github-code
7
[ { "api_name": "torch.cuda.is_available", "line_number": 26, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 26, "usage_type": "attribute" }, { "api_name": "numpy.unique", "line_number": 53, "usage_type": "call" }, { "api_name": "copy.deepcopy", ...
34278505135
from flask import Flask, request, jsonify app = Flask(__name__) @app.route('/', methods=['POST']) def calc_fibo_json(): num = request.form['num'] try: num = int(num) except: return jsonify({ "error": "Not a number", }), 400 return jsonify({ "input": num, ...
kapong/flask101
03_fibonacci_post.py
03_fibonacci_post.py
py
537
python
en
code
0
github-code
7
[ { "api_name": "flask.Flask", "line_number": 3, "usage_type": "call" }, { "api_name": "flask.request.form", "line_number": 7, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 7, "usage_type": "name" }, { "api_name": "flask.jsonify", "l...
12237990050
from django.http import JsonResponse,HttpResponse from django.shortcuts import render,redirect from web.forms.project import ProjectMdoelForm from web import models from utils.tencent.cos import create_bucket import time def project_list(request): if request.method=='GET': """ 从数据库获取两部分数据 我创...
xihanghang/blog_project
web/views/project_list.py
project_list.py
py
3,274
python
en
code
0
github-code
7
[ { "api_name": "web.models.Project.objects.filter", "line_number": 20, "usage_type": "call" }, { "api_name": "web.models.Project", "line_number": 20, "usage_type": "attribute" }, { "api_name": "web.models", "line_number": 20, "usage_type": "name" }, { "api_name": "...
9622196388
''' 将原始数据划分为训练样本和测试样本 ''' import argparse import os import cv2 from tqdm import tqdm import random import math import numpy as np import shutil def mkdir_dir(path): if not os.path.exists(path): os.makedirs(path) def mkdir_dir_(path): if not os.path.exists(path): os.makedirs(path) else: ...
qinggangwu/date_process
contain_cha_region_det/split_train_test_imgs.py
split_train_test_imgs.py
py
2,996
python
en
code
1
github-code
7
[ { "api_name": "os.path.exists", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.exists", "line_nu...
33461775311
#coding: utf8 import sys from os.path import dirname, abspath sys.path.append(dirname(dirname(abspath(__file__)))) import os import io def jsonify(name, res_msg, chat_time): js = {} js['name'] = name js['content'] = res_msg js['time'] = chat_time return js def get_file_info(path): (filepat...
evilking-yh/abuse_it
app/tools/utils.py
utils.py
py
791
python
en
code
2
github-code
7
[ { "api_name": "sys.path.append", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path.abspath", "lin...
27277312079
#https://openweathermap.org #https://openweathermap.org/current #https://api.openweathermap.org/data/2.5/weather?lat={lat}&lon={lon}&appid={API key} #criar uma conta no site, assim é possível obter uma key import requests def rodar(): #ler o apikey.txt with open('apikey.txt', 'r') as arquivo: api_key = ...
JHE4N/consultar-clima
main.py
main.py
py
964
python
pt
code
0
github-code
7
[ { "api_name": "requests.get", "line_number": 14, "usage_type": "call" } ]
471531866
import json from collections import defaultdict from itertools import groupby import click from complianceio.opencontrol import OpenControl @click.command() @click.argument( "source", type=click.Path(exists=True, dir_okay=False, file_okay=True, resolve_path=True), ) @click.argument("component-name") def mai...
CivicActions/compliance-io
examples/to_jsonl.py
to_jsonl.py
py
1,177
python
en
code
4
github-code
7
[ { "api_name": "complianceio.opencontrol.OpenControl.load", "line_number": 17, "usage_type": "call" }, { "api_name": "complianceio.opencontrol.OpenControl", "line_number": 17, "usage_type": "name" }, { "api_name": "collections.defaultdict", "line_number": 19, "usage_type":...
26479589794
from cmath import inf from turtle import color, width from soupsieve import closest from sqlalchemy import null import networkx as nx import matplotlib.pyplot as plt # you may need to install networkx #### here we are just reading and converting the graph into adjacency matrix n = -1 graph = {} G = nx.Graph() file =...
DYernar/graph_algorithms
dijkstra.py
dijkstra.py
py
3,731
python
en
code
0
github-code
7
[ { "api_name": "networkx.Graph", "line_number": 13, "usage_type": "call" }, { "api_name": "cmath.inf", "line_number": 76, "usage_type": "name" }, { "api_name": "networkx.get_edge_attributes", "line_number": 108, "usage_type": "call" }, { "api_name": "networkx.get_e...
2334157810
#!/usr/bin/env python import argparse import os from datetime import datetime from jinja2 import Template parser = argparse.ArgumentParser( description='Python app project setup' ) parser.add_argument( '--author-name', '-a', dest='author_name', type=str, required=True, help='Your full name (...
micahhausler/python-template
new_project.py
new_project.py
py
5,371
python
en
code
0
github-code
7
[ { "api_name": "argparse.ArgumentParser", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime.utcnow", "line_number": 84, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 84, "usage_type": "name" }, { "api_name": "jin...
36520913349
import configparser import loguru import psycopg2 from flask import request from flask_cors import CORS from loguru import logger from time import gmtime, strftime from flask import Flask, jsonify import configurations from datetime import datetime as dt from dbprocess import dbprocess sysdate = dt.now() conn = psyco...
giridharanbabu/DFXClassification_V1
training_updates.py
training_updates.py
py
2,411
python
en
code
0
github-code
7
[ { "api_name": "datetime.datetime.now", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 13, "usage_type": "name" }, { "api_name": "psycopg2.connect", "line_number": 15, "usage_type": "call" }, { "api_name": "configuratio...
35137911623
import requests import csv import re import time import pandas as pd from joblib import Parallel, delayed from io import BytesIO import subprocess import time import numpy as np import random import datetime import multiprocess as mp rootURL = 'https://marketplace.deweydata.io' #Replace authorization with valid creden...
sofiaaj/sg_workshop
retrieve_safegraph_data.py
retrieve_safegraph_data.py
py
3,029
python
en
code
0
github-code
7
[ { "api_name": "pandas.DataFrame", "line_number": 18, "usage_type": "call" }, { "api_name": "re.search", "line_number": 26, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 30, "usage_type": "call" }, { "api_name": "time.sleep", "line_numb...
40297113826
# Databricks notebook source # MAGIC %md # MAGIC ## Mount the Blob storages # COMMAND ---------- # MAGIC %md # MAGIC ### Mount the Landing Zone Blob # COMMAND ---------- # MAGIC %run Users/akshay.shinde@d2iconsulting.com.au/common_utilities/connect_landing_zone # COMMAND ---------- # MAGIC %md # MAGIC ### Mount t...
akshayshinde121992/databricks_version_sample
notebooks/Users/akshay.shinde@d2iconsulting.com.au/data modelling/Databricks versioning sample.py
Databricks versioning sample.py
py
6,462
python
en
code
0
github-code
7
[ { "api_name": "pyspark.sql.functions.col", "line_number": 93, "usage_type": "call" }, { "api_name": "pyspark.sql.functions.col", "line_number": 94, "usage_type": "call" }, { "api_name": "pyspark.sql.functions", "line_number": 94, "usage_type": "name" }, { "api_nam...
14641440432
"""models for a2c agents""" import torch from torch import nn import torch.nn.functional as F class ActorCritic(nn.Module): def __init__(self, l_obs, n_act, hidden_size=32): super(ActorCritic, self).__init__() self.l_obs = l_obs self.n_act = n_act self.hidden_size = hidd...
woithook/Meta-gradient_RL
models/models.py
models.py
py
2,632
python
en
code
0
github-code
7
[ { "api_name": "torch.nn.Module", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 7, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.nn", "line_...
22997145330
# Initial exploration of the data to see what's up # This is for the first set of data we ended up using in the project import sys import pandas as pd import matplotlib.pyplot as plt data_dir = 'data_tscorrect' plot_dir = 'plots' num_sensors = 8 size = 'PM1' plt.figure() # First, read the ground truth sensor, takin...
zackziegler95/blind_sensor_calibration
analyze.py
analyze.py
py
1,769
python
en
code
1
github-code
7
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 13, "usage_type": "name" }, { "api_name": "pandas.to_datetime", "line_number": 17, "usage_type": "call" }, { "api_name": "pandas....
17812186472
import sqlite3 import hashlib import os.path import shutil class data_dedup_func(object): def __init__(self): self.temp_path = r"E:/Arpit/Personal n Clg/4th yr project dedupliction/Main Project/DataDedup/server/temp/" def hash_cal(self, filename): h = hashlib.sha1() f_path...
arpitdiwan/Data_Deduplication-
server/data_dedup.py
data_dedup.py
py
3,675
python
en
code
0
github-code
7
[ { "api_name": "hashlib.sha1", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.path.join", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path.path", "line_number": 25, "usage_type": "attribute" }, { "api_name": "os.path", "line_...
6147961945
''' Importing modules ''' import os import pandas as pd import numpy as np import pandas as pd import matplotlib.pyplot as plt import pdb import pickle import datetime import random import torch import torchvision import torch.nn as nn import torch.nn.functional as F import torch.optim as opt import numpy as np from ...
Sirish07/DeepCleanArchive
python_scripts/best.py
best.py
py
30,110
python
en
code
0
github-code
7
[ { "api_name": "os.getcwd", "line_number": 30, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 31, "usage_type": "call" }, { "api_name": "os.path", "line_number": 31, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number":...
9242099480
#!/usr/bin/python # -*- coding: UTF-8 -*- # data-analysis # basicSVM.py """ Description: 基础版SVM author : zhangjingbo Date: 2018/12/20 """ import os import numpy as np import pickle import matplotlib.pylab as plt import random class basicSVM: def __init__(self, testSet='testSet'): sel...
GibZhang/ml-practice
SVM/basicSVM.py
basicSVM.py
py
6,935
python
en
code
0
github-code
7
[ { "api_name": "os.path.isfile", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "numpy.mat", "line_number": 36, "usage_type": "call" }, { "api_name": "pickle.load", "line_number"...
16736770260
import io import numpy as np import collections # import faiss import scipy.spatial import torch def load_vectors(fname, maxload=200000, norm=True, center=False, verbose=True): if verbose: print("Loading vectors from %s" % fname) fin = io.open(fname, 'r', encoding='utf-8', newline='\n', errors='ignore'...
Immortals88/TKGC
utils.py
utils.py
py
7,843
python
en
code
1
github-code
7
[ { "api_name": "io.open", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.linalg.norm", "line_number"...
23414108783
#!/usr/bin/env python # -*- coding: utf-8 -*- from flask import * import os, time, random, json, socket from utils.chars import saveCharacter, switchCharacter, saveUnsavedPlayers app = Flask(__name__) app.secret_key = os.urandom(24) @app.route('/save/<identifier>/<disconnect>') def save(identifier, disconnect): if d...
jeagqer/adrp-current
[adrp]/adrp_characterspawn/[adrp-char-api]/app.py
app.py
py
1,407
python
en
code
0
github-code
7
[ { "api_name": "os.urandom", "line_number": 8, "usage_type": "call" }, { "api_name": "time.time", "line_number": 18, "usage_type": "call" }, { "api_name": "utils.chars.saveCharacter", "line_number": 19, "usage_type": "call" }, { "api_name": "time.time", "line_n...
2487974701
import cv2 import numpy as np img = np.zeros((600, 600, 3), np.uint8) cv2.line(img, (0, 0), (img.shape[1], img.shape[0]), (0, 255, 0), 8) # cv2.line(影像, 开始座标, 结束座标, 颜色, 线条宽度) # 在图像上画线 # img.shape[0] = 600 、 img.shape[1] = 600 、 img.shape[2] = 3 cv2.rectangle(img, (0, 0), (400, 300), (0, 0, 255), cv2.FILLED) # cv2.re...
PatrickWhiteGG/test2
YT_excercise/YT_test2_drawing.py
YT_test2_drawing.py
py
1,154
python
zh
code
0
github-code
7
[ { "api_name": "numpy.zeros", "line_number": 4, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 4, "usage_type": "attribute" }, { "api_name": "cv2.line", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.rectangle", "line_number":...
9965865403
def identify_locations(outputs): overlaps = [] # overlapping paths for part 1 path = [] # all scaffold locations, for part 2 for i in range(len(outputs)): for j in range(len(outputs[i])): characters = [] #center characters.append(outputs[i][j]=='#') ...
p-mckenzie/Advent_of_Code_2019
day17.py
day17.py
py
6,125
python
en
code
1
github-code
7
[ { "api_name": "itertools.permutations", "line_number": 125, "usage_type": "call" }, { "api_name": "intComputer.IntcodeComputer", "line_number": 147, "usage_type": "call" } ]
6749981259
import pandas as pd import numpy as np import torch import torch.nn as nn import torch.optim as optim from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler from torch.utils.data import DataLoader, TensorDataset device = torch.device("cuda" if torch.cuda.is_available() e...
Jainil5/diabetes-detector
main.py
main.py
py
4,921
python
en
code
1
github-code
7
[ { "api_name": "torch.device", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 11, "usage_type": "attribute" }, { "api_name": "pandas.read_csv"...
71314365982
from collections import deque N = int(input()) adj = [[] for _ in range(N + 1)] visit = [[False] * (N + 1) for _ in range(N + 1)] dist = [[0] * (N + 1) for _ in range(N + 1)] minScore = 1e9 answer = [] while True: a, b = map(int, input().split()) if a == -1 and b == -1: break adj[a].append(b) ...
ddb8036631/algorithm
src/너비우선탐색/boj_2660.py
boj_2660.py
py
967
python
en
code
0
github-code
7
[ { "api_name": "collections.deque", "line_number": 18, "usage_type": "call" } ]
22519030107
import sys import warnings import numpy as np import matplotlib.pyplot as plt from skimage.segmentation import (morphological_geodesic_active_contour, inverse_gaussian_gradient) import skimage import cv2 import os import SimpleITK as sitk import glob import napari def view...
fahimehazari/BoneMicrostructureAanalysisTool
Bone_Mask.py
Bone_Mask.py
py
7,634
python
en
code
1
github-code
7
[ { "api_name": "napari.view_image", "line_number": 22, "usage_type": "call" }, { "api_name": "napari.run", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.copy", "line_number": 33, "usage_type": "call" }, { "api_name": "SimpleITK.GetArrayFromImage",...
6757069409
from django import forms from .models import ReporteDiario, Funda, Defecto, PorcentajeDefecto # Asegúrate de importar los modelos necesarios from django.forms import modelformset_factory # class ReporteDiarioForm(forms.ModelForm): # class Meta: # model = ReporteDiario # fields = '__all__' # ma...
Jaisartuyk/control-calidad
tra_calidad/reporte_diario/forms.py
forms.py
py
2,433
python
es
code
0
github-code
7
[ { "api_name": "django.forms.ModelForm", "line_number": 14, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 14, "usage_type": "name" }, { "api_name": "django.forms.ModelMultipleChoiceField", "line_number": 15, "usage_type": "call" }, { "ap...
5870165500
import argparse import logging import os import os.path as osp import time import re from collections import deque import torch import torch.nn.functional as F import torch_geometric.transforms as T from torch_geometric.data import DataLoader from DatasetLoader.loader import LoadDataset from Utils.helper import time_...
MaGiiK02/pygeometric_pointnet2
Project/train_cls.py
train_cls.py
py
10,484
python
en
code
3
github-code
7
[ { "api_name": "argparse.ArgumentParser", "line_number": 31, "usage_type": "call" }, { "api_name": "torch.nn.functional.nll_loss", "line_number": 75, "usage_type": "call" }, { "api_name": "torch.nn.functional", "line_number": 75, "usage_type": "name" }, { "api_name...
9106671336
import os import multiprocessing as mp file_list = os.listdir("2-GeneFamiliesDivTimeAligned/") def to_run(fasta_file): os.chdir("2-GeneFamiliesDivTimeAligned/") os.system("iqtree2 -s " + str(fasta_file) + " -nt 1") pool = mp.Pool(15) pool.map(to_run, file_list)
freitas-lucas/SGP_Anopheles
3-LoopIQTREE.py
3-LoopIQTREE.py
py
267
python
en
code
0
github-code
7
[ { "api_name": "os.listdir", "line_number": 4, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": 7, "usage_type": "call" }, { "api_name": "os.system", "line_number": 8, "usage_type": "call" }, { "api_name": "multiprocessing.Pool", "line_number": ...
24040634049
from fastapi import APIRouter, Depends from fastapi.exceptions import HTTPException from config.db import db from templates import webhook_template from functions import auth from models.models import User app = APIRouter() @app.get("/admin/users") async def getAllUsers(admin: User = Depends(auth.get_current_user)): ...
ubaida985/ODU_Backend
routes/admin.py
admin.py
py
2,050
python
en
code
0
github-code
7
[ { "api_name": "fastapi.APIRouter", "line_number": 8, "usage_type": "call" }, { "api_name": "models.models.User", "line_number": 11, "usage_type": "name" }, { "api_name": "fastapi.Depends", "line_number": 11, "usage_type": "call" }, { "api_name": "functions.auth.ge...
10227658984
import logging logger = logging.getLogger("live_control") from django.shortcuts import render_to_response from django.http import HttpResponse, HttpResponseRedirect from django.template import loader from django.contrib.auth.decorators import login_required from django.template import RequestContext from django.core....
mohkof1106/test
controller_setup/views.py
views.py
py
3,443
python
en
code
0
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 2, "usage_type": "call" }, { "api_name": "django.template.loader.get_template", "line_number": 23, "usage_type": "call" }, { "api_name": "django.template.loader", "line_number": 23, "usage_type": "name" }, { "api_n...
12454696393
from django.test import TestCase, Client from django.urls import reverse from review.models import comments from account.models import User, Business class TestViews(TestCase): '''Login required - cant test all functunals''' def setUp(self): # Create objects self.client = Client() self...
eizikr/EasyShop
review/tests/test_views.py
test_views.py
py
824
python
en
code
2
github-code
7
[ { "api_name": "django.test.TestCase", "line_number": 6, "usage_type": "name" }, { "api_name": "django.test.Client", "line_number": 11, "usage_type": "call" }, { "api_name": "review.models.comments.objects.create", "line_number": 12, "usage_type": "call" }, { "api_...
10012095687
import pygame from game import Game SCREEN_WIDTH = 1024 SCREEN_HEIGHT = 576 FPS = 60 def main(): pygame.init() screen = pygame.display.set_mode((SCREEN_WIDTH,SCREEN_HEIGHT)) pygame.display.set_caption("Maze Escape-3D") done = False clock = pygame.time.Clock() ga...
Chenyungchin/Maze_Escape-3D
main.py
main.py
py
509
python
en
code
0
github-code
7
[ { "api_name": "pygame.init", "line_number": 12, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 14, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 14, "usage_type": "attribute" }, { "api_name": "pygame.displa...
36312483982
from decouple import config if __name__ == "__main__": DEBUG = config('DEBUG', default=False, cast=bool) print('DEBUG', DEBUG) ''' environment variables have precedence over config files. os.environ['PATH'] = '/my_path' ''' PATH = config('PATH', cast=str) print('PATH', PATH)
twtrubiks/python-notes
python-decouple-tutorial/tutorial.py
tutorial.py
py
309
python
en
code
94
github-code
7
[ { "api_name": "decouple.config", "line_number": 4, "usage_type": "call" }, { "api_name": "decouple.config", "line_number": 10, "usage_type": "call" } ]
29661701030
from uuid import UUID from django.urls import reverse import pytest from rest_framework import status from rest_framework.test import APIClient from tests.factories import RecipeFactory pytestmark = [pytest.mark.django_db] def get_recipe_detail_url(recipe_id: str) -> str: """Return a recipe detail url.""" ...
savilard/foodplan
backend/tests/test_api/test_recipes/test_recipe_update.py
test_recipe_update.py
py
1,307
python
en
code
0
github-code
7
[ { "api_name": "pytest.mark", "line_number": 11, "usage_type": "attribute" }, { "api_name": "django.urls.reverse", "line_number": 16, "usage_type": "call" }, { "api_name": "tests.factories.RecipeFactory", "line_number": 19, "usage_type": "name" }, { "api_name": "re...
71979251744
"""" This script performs the first preprocessing step: Vocals Isolation. It uses the MadTwinNet (https://github.com/dr-costas/mad-twinnet) as a source-separation algorithm, yielding close to SOTA results at the moment of writing this code. """ def isolate_vocals( d00sr01_f1, weights_d0, rnn_e...
ddcas/singing-language-identification
preprocessing/vocals_isolation.py
vocals_isolation.py
py
5,956
python
en
code
0
github-code
7
[ { "api_name": "torch.set_grad_enabled", "line_number": 62, "usage_type": "call" }, { "api_name": "utils.settings.debug", "line_number": 74, "usage_type": "name" }, { "api_name": "utils.settings.debug", "line_number": 82, "usage_type": "name" }, { "api_name": "torc...
32370428868
import streamlit as st import pandas as pd import gig_scraper def local_css(file_name): with open(file_name) as f: st.markdown(f'<style>{f.read()}</style>', unsafe_allow_html=True) def remote_css(url): st.markdown(f'<link href="{url}" rel="stylesheet">', unsafe_allow_html=True) def icon(...
monkphx/Craigsilist-gig-finder
app.py
app.py
py
1,793
python
en
code
0
github-code
7
[ { "api_name": "streamlit.markdown", "line_number": 6, "usage_type": "call" }, { "api_name": "streamlit.markdown", "line_number": 9, "usage_type": "call" }, { "api_name": "streamlit.markdown", "line_number": 12, "usage_type": "call" }, { "api_name": "gig_scraper.st...
17838250023
import spacy nlp = spacy.load("en_core_web_lg") class FileCleaning: def __init__(self,filename): self.filename = filename def filtering(self): with open(self.filename) as f: lines = f.readlines() for line in range(0,len(lines)): lines[line] = lines[...
aryansuri42/NLP-using-spacy-and-simpletransformers
DataCleaning.py
DataCleaning.py
py
2,350
python
en
code
0
github-code
7
[ { "api_name": "spacy.load", "line_number": 2, "usage_type": "call" } ]
38140758713
__author__ = 'roman' from bottle import request, Bottle, abort from bottle import route, run, template, static_file import json import jsonpickle from client import Client from serverToClientMessage import ServerToClientMessage from taskmanager import * from serverPageToServerMessage import * from serverToServerPageMe...
TkachenkoRoman/WebWork
main.py
main.py
py
10,153
python
en
code
0
github-code
7
[ { "api_name": "bottle.Bottle", "line_number": 16, "usage_type": "call" }, { "api_name": "jsonpickle.encode", "line_number": 29, "usage_type": "call" }, { "api_name": "jsonpickle.encode", "line_number": 38, "usage_type": "call" }, { "api_name": "jsonpickle.encode",...
18357199296
# -*- coding: utf-8 -*- """ @author: Yifan Cheng, Skylar Du, Yashash Gaurav, Mark He """ # import os import time import random import requests import numpy as np import pandas as pd from bs4 import BeautifulSoup from selenium import webdriver from urllib.request import urlopen from pandas.core.frame import DataFrame f...
junhuih/DFP-Project
fetch_all_data.py
fetch_all_data.py
py
11,221
python
en
code
0
github-code
7
[ { "api_name": "urllib.request.urlopen", "line_number": 40, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 41, "usage_type": "call" }, { "api_name": "pandas.core.frame.DataFrame", "line_number": 86, "usage_type": "call" }, { "api_name": "...
74977609184
# ========== # Created by Ivan Gadjev # 2020.02.01 # # Library of custom functions that aid in projects using pyRadia, genesis, elegant, and varius other codes and analyses. # # # ========== # import sys # import os import time import bisect import json import scipy.constants as pc import numpy as np import sci...
igred8/customlib
customlib.py
customlib.py
py
41,524
python
en
code
0
github-code
7
[ { "api_name": "json.JSONEncoder", "line_number": 26, "usage_type": "attribute" }, { "api_name": "numpy.ndarray", "line_number": 36, "usage_type": "attribute" }, { "api_name": "json.JSONEncoder.default", "line_number": 39, "usage_type": "call" }, { "api_name": "jso...
27770050049
from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import collections import enum from googlecloudsdk.api_lib.storage import cloud_api from googlecloudsdk.command_lib.storage import errors from googlecloudsdk.command_lib.storage import plurality_checkable_it...
twistedpair/google-cloud-sdk
google-cloud-sdk/lib/googlecloudsdk/command_lib/storage/name_expansion.py
name_expansion.py
py
10,563
python
en
code
55
github-code
7
[ { "api_name": "enum.Enum", "line_number": 18, "usage_type": "attribute" }, { "api_name": "enum.Enum", "line_number": 26, "usage_type": "attribute" }, { "api_name": "googlecloudsdk.api_lib.storage.cloud_api.FieldsScope", "line_number": 47, "usage_type": "attribute" }, ...
14199215335
# from pudb import set_trace; set_trace() from typing import List import math class Solution1: def countQuadruplets(self, nums: List[int]) -> int: """TLE, because num_smaller and num_larger takes too long to build. """ N = len(nums) # num_smaller[i][j] is the number of vals smaller...
FanchenBao/leetcode
LeetCode_2552.py
LeetCode_2552.py
py
5,695
python
en
code
1
github-code
7
[ { "api_name": "typing.List", "line_number": 7, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 37, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 94, "usage_type": "name" } ]
26954657246
import codecs import datetime import logging import os import re import sys import urllib2 import hashlib from cghub_python_api import WSAPIRequest, SOLRRequest from cghub_python_api.utils import urlopen from django.conf import settings from django.template.loader import render_to_string from django.utils import time...
dudarev/cghub
cghub/apps/core/requests.py
requests.py
py
14,332
python
en
code
5
github-code
7
[ { "api_name": "django.conf.settings.API_TYPE", "line_number": 22, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 22, "usage_type": "name" }, { "api_name": "cghub_python_api.WSAPIRequest", "line_number": 23, "usage_type": "name" }, { ...
36662041355
from skimage import io import numpy as np im1 = io.imread('1.pgm') im2 = io.imread('2.pgm') x = np.array(im1) y = np.array(im2) z = abs(x/100 - y/100) z = z*100 SAD = np.sum(z) SSD = np.sum(z**2) print(SAD, SSD)
steven0129/ML-assignment
assignment1/example/test.py
test.py
py
227
python
en
code
0
github-code
7
[ { "api_name": "skimage.io.imread", "line_number": 4, "usage_type": "call" }, { "api_name": "skimage.io", "line_number": 4, "usage_type": "name" }, { "api_name": "skimage.io.imread", "line_number": 5, "usage_type": "call" }, { "api_name": "skimage.io", "line_nu...
31903369490
__author__ = 'brian' import atom import numpy as np class MStructureObj: def __init__(self, data, num_species,num_beg_rules, num_cluster_rules, num_j_rules): data = data.split() self.num_beg_rules = num_beg_rules self.num_cluster_rules = num_cluster_rules self.num_j_rules = num_j_r...
bjblank2/GUM_mark3
m_structure.py
m_structure.py
py
3,766
python
en
code
1
github-code
7
[ { "api_name": "numpy.ones", "line_number": 38, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 39, "usage_type": "call" }, { "api_name": "atom.AtomObj", "line_number": 45, "usage_type": "call" }, { "api_name": "atom.AtomObj", "line_number": ...
39022099463
from __future__ import print_function from __future__ import absolute_import from __future__ import division import math import torch from torch import nn import torch.nn.functional as F import torchvision.models as models from .network_utils import * class StateEncoderShallowCNN(torch.nn.Module): """ state...
xfgao/VRKitchen
Script/deep_rl/network/state_encoder.py
state_encoder.py
py
2,151
python
en
code
18
github-code
7
[ { "api_name": "torch.nn", "line_number": 14, "usage_type": "attribute" }, { "api_name": "torch.nn.Conv2d", "line_number": 22, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 22, "usage_type": "name" }, { "api_name": "torch.nn.BatchNorm2d", "li...
1117519287
import streamlit as st from torchtyping import TensorType as TT from transformer_lens.hook_points import HookPoint from .environment import get_action_preds from .visualizations import plot_action_preds, plot_single_residual_stream_contributions, plot_single_residual_stream_contributions_comparison from .analysis impo...
echowne/DecisionTransformerInterpretability
src/streamlit_app/causal_analysis_components.py
causal_analysis_components.py
py
3,306
python
en
code
null
github-code
7
[ { "api_name": "streamlit.expander", "line_number": 12, "usage_type": "call" }, { "api_name": "streamlit.write", "line_number": 13, "usage_type": "call" }, { "api_name": "streamlit.columns", "line_number": 20, "usage_type": "call" }, { "api_name": "streamlit.select...
21517048152
import json import os file_path = os.path.join('bananafashion/input_data/womendata.json') with open(file_path) as f: women_new_arrival = json.load(f) file_path = os.path.join('bananafashion/input_data/homedata.json') with open(file_path) as f: home = json.load(f) file_path = os.path.join('banan...
hericlibong/HIDDEN_API_SCRAPING
bananafashion/utils.py
utils.py
py
834
python
en
code
0
github-code
7
[ { "api_name": "os.path.join", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 10...
26201279793
import re from copy import deepcopy from tqdm import tqdm # split sentences into lines without meta def get_lines(sent, ans_sent): meta_lines = re.search('^(#.*\n)*', sent).group() no_meta_sent = sent[len(meta_lines):] lines = no_meta_sent.split('\n') meta_lines_ans = re.search('^(#.*\n)*', ...
yashkens/belarusian_enh_dep_annotation
scripts/tokenization_aligner.py
tokenization_aligner.py
py
9,029
python
en
code
0
github-code
7
[ { "api_name": "re.search", "line_number": 8, "usage_type": "call" }, { "api_name": "re.search", "line_number": 11, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 140, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 170,...
20965867210
import os import cv2 import tensorflow as tf import numpy as np from DataGenerator import ImageDataGenerator from DHN import * batch_size = 100 hash_K = 48 checkpoint_path = os.path.join(os.getcwd(), "tmp\\dhn") def toBinaryString(binary_like_values): numOfImage, bit_length = binary_like_values.shape list_str...
ycdfwzy/ADS-Project2
Query.py
Query.py
py
6,566
python
en
code
0
github-code
7
[ { "api_name": "os.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 10, "usage_type": "call" }, { "api_name": "tensorflow.placeholder", "lin...
40615577399
import os import sys import cv2 def images2vedio(in_dir, out_dir, out_name, fps=2): im_names = os.listdir(in_dir) im_names.sort() im_paths = [in_dir + im_name.strip() for im_name in im_names] out_path = out_dir + out_name # error: 'module' object has no attribute VideoWriter_fourcc # fourcc = cv2.VideoWri...
zimenglan-sysu-512/pose_action_caffe
tools/utils/ims2video.py
ims2video.py
py
840
python
en
code
6
github-code
7
[ { "api_name": "os.listdir", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.cv.CV_FOURCC", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.cv", "line_number": 13, "usage_type": "attribute" }, { "api_name": "cv2.VideoWriter", "line_nu...
10835927166
import itertools def part1(numbers): for x, y in itertools.combinations(numbers, 2): if x + y == 2020: return x * y def part2(numbers): for x, y, z in itertools.combinations(numbers, 3): if x + y + z == 2020: return x * y * z def main(inp): with open(inp) as f: ...
szampier/adventofcode2020
src/day01.py
day01.py
py
583
python
en
code
0
github-code
7
[ { "api_name": "itertools.combinations", "line_number": 4, "usage_type": "call" }, { "api_name": "itertools.combinations", "line_number": 9, "usage_type": "call" } ]
9390111256
# -*- coding: utf-8 -*- #!/usr/bin/env python import matplotlib.pyplot as plt import os.path import os import argparse import json parser = argparse.ArgumentParser(description='Train report build') parser.add_argument('-a', '--history', help='History file name',default=None) args = parser.parse_args() history_list...
luismalta/DeepRL-Robotics
plot.py
plot.py
py
2,503
python
en
code
0
github-code
7
[ { "api_name": "argparse.ArgumentParser", "line_number": 12, "usage_type": "call" }, { "api_name": "os.walk", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_n...
13348623793
# "The __init__.py files are required to make Python treat the # directories as containing packages" # -- http://docs.python.org/tutorial/modules.html from ConfigParser import ConfigParser from sqlalchemy.engine.url import make_url from traincheck import TrainingRecordsRd TRAINING_SECTION = 'training' def from_co...
kumc-bmi/heron-admin
heron_wsgi/traincheck/__init__.py
__init__.py
py
852
python
en
code
0
github-code
7
[ { "api_name": "ConfigParser.ConfigParser", "line_number": 15, "usage_type": "call" }, { "api_name": "sqlalchemy.engine.url.make_url", "line_number": 17, "usage_type": "call" }, { "api_name": "traincheck.TrainingRecordsRd", "line_number": 25, "usage_type": "call" } ]
33737882240
import cv2 as cv import numpy as np import pickle # Load the camera calibration parameters from the .pkl files calibration_data = pickle.load(open("calibration.pkl", "rb")) cameraMatrix, dist = calibration_data # Load an image for pose estimation image_path = 'images/img21.png' # Replace with the path to your image ...
RidhaOuni07/CameraCalibration
renderaCube.py
renderaCube.py
py
2,019
python
en
code
0
github-code
7
[ { "api_name": "pickle.load", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 14, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_num...
32172829625
# Corner Detections import cv2 import numpy as np # Load image then grayscale image = cv2.imread('images/chess.jpg') gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) # The cornerHarris function requires the array datatype to be float32 gray = np.float32(gray) harris_corners = cv2.cornerHarris(gray, 3, 3, ...
PkParadox88/30days_of_openCV
day18/day18.py
day18.py
py
1,018
python
en
code
4
github-code
7
[ { "api_name": "cv2.imread", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 8, "usage_type": "attribute" }, { "api_name": "numpy.float32", "lin...
43410186119
# -*- coding: utf-8 -*- """ Created on Tue Mar 24 01:57:39 2020 @author: agarcia20 """ import yfinance as yf import math stock = yf.Ticker("XOM") # Get ticker expiration = stock.options[0] ...
adriang1174/financial_scripts
call_conodr.py
call_conodr.py
py
2,505
python
en
code
2
github-code
7
[ { "api_name": "yfinance.Ticker", "line_number": 11, "usage_type": "call" }, { "api_name": "math.gcd", "line_number": 31, "usage_type": "call" } ]
27980106710
import serial import sys with open('Tester_clean.hex', 'r') as f: archivo = f.read().split('\n') archivo.pop() print(archivo) print(type(archivo)) # puerto = serial.Serial('COM4', 9600, rtscts = True) # rtscts = False PARA PROTEUS !!!!!!!!!!! puerto = serial.Serial('COM1', 9600, rtscts = False) # rtscts = False...
MrRomo/MrBootloader
Ejemplo/ejemplo.py
ejemplo.py
py
720
python
es
code
0
github-code
7
[ { "api_name": "serial.Serial", "line_number": 11, "usage_type": "call" } ]
72198657504
from recipes.decorators import catch import pytest class TestCatch: @pytest.mark.parametrize( 'action, kls, kws', [('warn', UserWarning, {}), ('raise', ValueError, {}), ('raise', TypeError, dict(alternate=TypeError))] ) def test_decor(self, action, kls, kws): @...
astromancer/recipes
tests/decororators/test_common.py
test_common.py
py
1,121
python
en
code
0
github-code
7
[ { "api_name": "recipes.decorators.catch", "line_number": 16, "usage_type": "call" }, { "api_name": "pytest.warns", "line_number": 20, "usage_type": "attribute" }, { "api_name": "pytest.raises", "line_number": 20, "usage_type": "attribute" }, { "api_name": "pytest....
44358074867
import cherrypy import json import splunk.appserver.mrsparkle.controllers as controllers from splunk.appserver.mrsparkle.lib import jsonresponse from splunk.appserver.mrsparkle.lib.decorators import expose_page from splunk.appserver.mrsparkle.lib.routes import route from splunk.rest import simpleRequest import sys fro...
davidratcliffe/es_eventgens
SA-ThreatIntelligence/appserver/controllers/customsearchbuilder.py
customsearchbuilder.py
py
6,084
python
en
code
1
github-code
7
[ { "api_name": "sys.path.append", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "splunk.clilib.bundle_paths.make_splunkhome_path", "line_number": 11, "usage_type": "call" }, { "api...
70889191905
#!/usr/bin/env python2 import logging import subprocess import os.path import shlex import importlib.resources import clamsig import csv class ClamSigVis: ''' Use the tooling ''' # Use the default directory _freshclam_dir = None # Use the default path by default _bin_path = None #...
chalbersma/clamsig
clamsig/sigvis.py
sigvis.py
py
4,746
python
en
code
0
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 42, "usage_type": "call" }, { "api_name": "importlib.resources.resources.path", "line_number": 60, "usage_type": "call" }, { "api_name": "importlib.resources.resources", "line_number": 60, "usage_type": "attribute" }, ...
612175889
from sentence_transformers import SentenceTransformer from collections import defaultdict from graph_model import dialogue_graph import pickle import numpy as np import sys import torch from graph_model.cluster_selection.cluster_selection import PredictNextCluster, prepare_input from graph_model import dialogue_graph...
Kirill456Z/graph-model
graph_model/model.py
model.py
py
3,117
python
en
code
0
github-code
7
[ { "api_name": "sys.modules", "line_number": 16, "usage_type": "attribute" }, { "api_name": "graph_model.dialogue_graph", "line_number": 16, "usage_type": "name" }, { "api_name": "sys.modules", "line_number": 17, "usage_type": "attribute" }, { "api_name": "graph_mo...
7700952603
import os import json import numpy as np def convert(JSON_FOLDER, NPY_PATH): # Initialize an empty list to accumulate the pose data pose_data_list = [] # Loop over all JSON files in the folder for JSON_FILE in sorted(os.listdir(JSON_FOLDER)): # Check if the file is a JSON file if JSON...
tijiang13/InstantAvatar
scripts/custom/convert_openpose_json_to_npy.py
convert_openpose_json_to_npy.py
py
1,495
python
en
code
250
github-code
7
[ { "api_name": "os.listdir", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 1...