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
43597637487
import datetime def parse_weather_data(weather_data, location_start, location_end): start_index = num_days_from_now(location_start) end_index = num_days_from_now(location_end) day_range = range(start_index,end_index+1) parsed_data = {} for day_num,day_weather in weather_data.items(): ...
apham727/WeatherForItinerary
parseweatherdata.py
parseweatherdata.py
py
687
python
en
code
0
github-code
21
[ { "api_name": "datetime.datetime.now", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 15, "usage_type": "attribute" }, { "api_name": "datetime.date", "line_number": 17, "usage_type": "call" } ]
8845912151
# Solucionando a equação da reta para diferentes pontos # Reta: -1x + 4x + 0.4 # ax + by + c = 0 # y = (-a*x - c)/b # A reta é um classificador """ Note queoponto p₁ está na reta,enquanto p₂ está acima da retaep3 abaixo.Ao solucionaraequação da reta para esses três pontos,tivemos respectivamente resultados nulo(=0),pos...
Vicrrs/starting_in_pytorch
Solução_da_eq_da_reta.py
Solução_da_eq_da_reta.py
py
1,223
python
pt
code
0
github-code
21
[ { "api_name": "numpy.linspace", "line_number": 25, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.axvline", "line_number": 31, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 31, "usage_type": "name" }, { "api_name": "matplotlib...
70741541494
import numpy as np import cv2 from matplotlib import pyplot as plt # img1 = cv2.imread('../frontend/repo/joico/Tratamento/Original/Joi-0079.jpg',0) # img2 = cv2.imread('../frontend/repo/joico/Tratamento/Original/CE_TreatmentMasque_500ml_Joi-0210.jpg', 0) # Initiate STAR detector orb = cv2.ORB_create() # print(help(o...
jlobasso/imageMatcher
backend/matches/fast.py
fast.py
py
1,129
python
en
code
1
github-code
21
[ { "api_name": "cv2.ORB_create", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.BFMatcher", "line_number": 18, "usage_type": "call" }, { "api_name": "cv2.NORM_HAMMING", "line_number": 18, "usage_type": "attribute" }, { "api_name": "cv2.drawMatches", ...
9419282872
""" 2▹ Utwórz klasę dla storczyków. Storczyki z zasady mają różne kolory, pory kwitnienia, gatunki. Utwórz dowolne atrybuty i metody. Dodaj atrybut wspólny dla wszystkich storczyków - królestwo roślin. Utwórz kilka storczyków z różnymi parametrami. """ import datetime class Orchid: common_type = 'plant' def ...
gekogit/pythonCourse
11_OOP/02_orchid.py
02_orchid.py
py
1,030
python
pl
code
0
github-code
21
[ { "api_name": "datetime.datetime.now", "line_number": 18, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 18, "usage_type": "attribute" } ]
17950913690
import argparse from datetime import datetime import time import configparser from phish_detector import PhishDetector from rich import print as printc if __name__ == "__main__": # Arguments parser = argparse.ArgumentParser(prog='HookPhish.py', description='A Python script designed to aid in the detection of ...
0liverFlow/HookPhish
HookPhish.py
HookPhish.py
py
5,289
python
en
code
26
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "phish_detector.PhishDetector", "line_number": 36, "usage_type": "call" }, { "api_name": "rich.print", "line_number": 37, "usage_type": "call" }, { "api_name": "phish...
42421695914
from django.shortcuts import render, get_object_or_404, redirect from django.contrib import messages from django.utils import timezone import datetime from accounts.models import * from django.contrib.auth.decorators import login_required @login_required(login_url='login') def book_in(request): if request.method ...
Ziyodulla-Abdukarimov/Library-assistant
library/services.py
services.py
py
5,868
python
en
code
3
github-code
21
[ { "api_name": "django.shortcuts.render", "line_number": 19, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 20, "usage_type": "call" }, { "api_name": "django.contrib.auth.decorators.login_required", "line_number": 9, "usage_type": "call" ...
6666977187
# Created by wushuyi on 2016/8/7 0007. from flask import request, jsonify from flask.json import dumps as json_dumps from flask.views import View from store.disk import FileManager import config class FileManagerView(View): methods = ['POST', 'GET'] def __init__(self): self.filemanager = FileManager(...
wushuyi/filemanager
viewer.py
viewer.py
py
2,067
python
en
code
0
github-code
21
[ { "api_name": "flask.views.View", "line_number": 9, "usage_type": "name" }, { "api_name": "store.disk.FileManager", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.request.args.get", "line_number": 17, "usage_type": "call" }, { "api_name": "flask.r...
27487733117
import os import pickle import dgl def train_topo_check(): graph_data_path = os.path.join('../resources/dataset/c/test/graph_data_no_loop.pkl') with open(graph_data_path, 'rb') as f: data_lst = pickle.load(f) print('The length of original dataset is %s'%len(data_lst)) topolog_len_lst = {} ...
YuanJiangGit/Code-Representation-Graph-LSTM
DataProcess/DataCheck.py
DataCheck.py
py
2,001
python
en
code
8
github-code
21
[ { "api_name": "os.path.join", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "pickle.load", "line_number": 8, "usage_type": "call" }, { "api_name": "dgl.topological_nodes_generator", ...
26106832376
from typing import List from urllib.parse import urlencode import pytest from fastapi import Request from fastapi.responses import JSONResponse, RedirectResponse from httpx import AsyncClient from hypothesis import given, settings from hypothesis.provisional import urls from hypothesis.strategies import emails, permut...
HarrySky/melodiam
tests/auth/test_melodiam_auth.py
test_melodiam_auth.py
py
3,848
python
en
code
0
github-code
21
[ { "api_name": "fastapi.Request", "line_number": 24, "usage_type": "name" }, { "api_name": "fastapi.responses.JSONResponse", "line_number": 25, "usage_type": "call" }, { "api_name": "melodiam.auth.api.get", "line_number": 23, "usage_type": "call" }, { "api_name": "...
2398875237
from django.shortcuts import render,redirect from django.http import HttpResponse from book.models import Book # Create your views here. def homepage(request): # view - function based View(FBV) # request -- http request # user defined func all_books = Book.objects.all() # print(all_books) return rend...
TousifGit/LibraryProject
book/views.py
views.py
py
2,141
python
en
code
0
github-code
21
[ { "api_name": "book.models.Book.objects.all", "line_number": 8, "usage_type": "call" }, { "api_name": "book.models.Book.objects", "line_number": 8, "usage_type": "attribute" }, { "api_name": "book.models.Book", "line_number": 8, "usage_type": "name" }, { "api_name...
36254843921
import pickle import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import numpy as np plt.rcParams.update({'font.size': 12}) out_name = "out_frozen_lake3.csv" # Default: out.csv hist_name = 'hist_frozen_lake.pkl' DF = pd.read_csv(out_name) DF.rename(columns={'Errors': 'Asymptotic Convergence Err...
mshaocong/VRTDC
plot.py
plot.py
py
1,981
python
en
code
0
github-code
21
[ { "api_name": "matplotlib.pyplot.rcParams.update", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 6, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 6, "usage_type": "name" }, { "...
28502048641
# 23. Merge k Sorted Lists # You are given an array of k linked-lists lists, each linked-list is # sorted in ascending order. # Merge all the linked-lists into one sorted linked-list and return it. # Example 1: # Input: lists = [[1,4,5],[1,3,4],[2,6]] # Output: [1,1,2,3,4,4,5,6] # Explanation: The linked-lists are:...
DmitryVlaznev/leetcode
23-merge-k-sorted-lists.py
23-merge-k-sorted-lists.py
py
2,039
python
en
code
2
github-code
21
[ { "api_name": "typing.List", "line_number": 47, "usage_type": "name" }, { "api_name": "heapq.heappush", "line_number": 51, "usage_type": "call" }, { "api_name": "heapq.heappop", "line_number": 54, "usage_type": "call" }, { "api_name": "heapq.heappush", "line_n...
14684627000
from principal import gui from random import randint from principal.gui import * from Estructura.Grafo import * from Estructura.Queue import * from Estructura.Tanque import * import json import threading class Main: if __name__ == '__main__': grafo = Grafo() with open('p.json') as f: ...
MarcoContreras23/ProjectoGrafos
principal/Main.py
Main.py
py
1,075
python
es
code
0
github-code
21
[ { "api_name": "json.load", "line_number": 16, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 26, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 29, "usage_type": "call" }, { "api_name": "random.randint", "line_nu...
72452144374
import pygame import math from queue import PriorityQueue import time WIDTH = 600 WIN = pygame.display.set_mode((WIDTH, WIDTH)) pygame.display.set_caption("A* Path Finding Algorithm") RED = (255, 0, 0) GREEN = (0, 255, 0) BLUE = (0, 0, 255) WHITE = (255, 255, 255) BLACK = (0, 0, 0) ORANGE = (255, 165, 0) TURQUOISE =...
Myancko/A-star
chase.py
chase.py
py
17,278
python
en
code
0
github-code
21
[ { "api_name": "pygame.display.set_mode", "line_number": 8, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pygame.display.set_caption", "line_number": 9, "usage_type": "call" }, { "api_name": "p...
28015909146
import sys import os from txt2ngrams import * import re import pandas as pd from collections import Counter import logging def extractFileName(line): tokens = line.rstrip().split() linkname = tokens[0] linkpathsplit = linkname.split('/') fname = linkpathsplit[-1]+'_'+tokens[1]+'.txt' return fname ...
nejmngrams/nejmngrams.github.io
parsescripts/multitxt2ngrams.py
multitxt2ngrams.py
py
1,765
python
en
code
0
github-code
21
[ { "api_name": "re.split", "line_number": 17, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 21, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 22, "usage_type": "call" }, { "api_name": "collections.Counter"...
24088030418
from utils import constant as const from model.user import User from model.book import Book # access library def check_book(books: dict, case: str, user=User, value=any): # validate for key, book in books.items(): if case == const.BORROW_BOOK: if book.borrower == User: prin...
gilangdarmawan48/Fungsional
function/book.py
book.py
py
3,502
python
en
code
0
github-code
21
[ { "api_name": "model.user.User", "line_number": 7, "usage_type": "name" }, { "api_name": "utils.constant.BORROW_BOOK", "line_number": 10, "usage_type": "attribute" }, { "api_name": "utils.constant", "line_number": 10, "usage_type": "name" }, { "api_name": "model.u...
11094994252
import gc from iminuit import Minuit import os import yaml import numpy as np from fermipy.gtanalysis import GTAnalysis import psutil process = psutil.Process(os.getpid()) '''Class that handles the grid analysis, e.g. selection of g/m, fitting, data handling. ''' class Janitor: '''Because janitors do the work. ...
specktakel/ts_limit
grid_ts/janitor_copy.py
janitor_copy.py
py
8,932
python
en
code
0
github-code
21
[ { "api_name": "psutil.Process", "line_number": 8, "usage_type": "call" }, { "api_name": "os.getpid", "line_number": 8, "usage_type": "call" }, { "api_name": "ts_limit.grid_survival_prob.probs.Probs", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy....
8728012059
from flask import Flask, jsonify, request from integracao import integracacao_Spotter_Moskit from http.client import HTTPConnection import logging from sys import stdout import os app = Flask(__name__) # Definindo logger HTTPConnection.debuglevel = 0 logger = logging.getLogger(__name__) stdOut = logging.StreamHandl...
lukasmachado-elysia/Integracao-Spotter-Moskit
app.py
app.py
py
2,395
python
en
code
2
github-code
21
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "http.client.HTTPConnection.debuglevel", "line_number": 11, "usage_type": "attribute" }, { "api_name": "http.client.HTTPConnection", "line_number": 11, "usage_type": "name" }, { "...
13517045952
import os import numpy as np from src.SB3.encoder import EgocentricEncoders from src.SB3.ppo import PPO_AUX from src.igibson.multi_object_env import MultiObjectEnv try: from stable_baselines3.common.utils import set_random_seed from stable_baselines3.common.vec_env import SubprocVecEnv, VecMonitor except M...
robot-learning-freiburg/Multi-Object-Search
evaluate.py
evaluate.py
py
5,090
python
en
code
8
github-code
21
[ { "api_name": "os.path.join", "line_number": 43, "usage_type": "call" }, { "api_name": "os.path", "line_number": 43, "usage_type": "attribute" }, { "api_name": "src.igibson.multi_object_env.MultiObjectEnv", "line_number": 44, "usage_type": "call" }, { "api_name": ...
29917117935
# -*- coding: utf-8 -*- from flask import Flask, jsonify app = Flask(__name__) # Route pour fournir des données JSON @app.route('/api/data', methods=["GET"]) def get_data(): data = {'message': 'Données depuis le serveur Flask'} return jsonify(data) if __name__ == '__main__': app.run(debug=True)
DeVerMyst/DEVIA2023
E_c_Streamlit-demo/10_flaskserveur.py
10_flaskserveur.py
py
314
python
fr
code
3
github-code
21
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_number": 11, "usage_type": "call" } ]
36577646705
from flask import session, jsonify,render_template,current_app,abort,g,request from info import models, db from info.utils.commons import user_login_data from info.utils.response_code import RET from . import news_blue #关注功能 @news_blue.route('/followed_user',methods=["POST"]) @user_login_data def followed_user(): ...
redelephant5/information_hmh
info/modules/news/views.py
views.py
py
11,273
python
en
code
0
github-code
21
[ { "api_name": "flask.g.user", "line_number": 22, "usage_type": "attribute" }, { "api_name": "flask.g", "line_number": 22, "usage_type": "name" }, { "api_name": "flask.jsonify", "line_number": 23, "usage_type": "call" }, { "api_name": "info.utils.response_code.RET....
42673095154
"""startup URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based...
alexneysis/jino
users/urls.py
urls.py
py
1,252
python
en
code
1
github-code
21
[ { "api_name": "django.conf.urls.url", "line_number": 23, "usage_type": "call" }, { "api_name": "users.views.send_client", "line_number": 23, "usage_type": "attribute" }, { "api_name": "users.views", "line_number": 23, "usage_type": "name" }, { "api_name": "django....
29964747073
from sys import stdin from collections import deque from copy import deepcopy input = stdin.readline n = int(input()) def bfs(land, col, row, not_visited, rain): dx, dy = [-1,1,0,0],[0,0,-1,1] queue = deque() queue.append((col, row)) while queue: node = queue.popleft() if not_visited[n...
GDSC-SCH/2021-GDSCSCH-AlgorithmStudy
15_이준용/2468.py
2468.py
py
1,120
python
en
code
0
github-code
21
[ { "api_name": "sys.stdin.readline", "line_number": 4, "usage_type": "attribute" }, { "api_name": "sys.stdin", "line_number": 4, "usage_type": "name" }, { "api_name": "collections.deque", "line_number": 10, "usage_type": "call" }, { "api_name": "copy.deepcopy", ...
15068882657
''' 天气预报小程序 V0.1 ''' import urllib.request import json import string import matplotlib.pyplot as plt import numpy as np from matplotlib.font_manager import FontProperties #字体管理器 def Weather_forcast(city,district_code): Font = FontProperties(fname="C:\Windows\Fonts\simkai.ttf") url = 'http://api.m...
YangPotatoes/Python_visual
Charpter2/Weather_forecast.py
Weather_forecast.py
py
1,428
python
en
code
0
github-code
21
[ { "api_name": "matplotlib.font_manager.FontProperties", "line_number": 12, "usage_type": "call" }, { "api_name": "urllib.request.parse.quote", "line_number": 17, "usage_type": "call" }, { "api_name": "urllib.request.parse", "line_number": 17, "usage_type": "attribute" }...
27184780021
from flask import Blueprint, render_template, request, flash from flask_mysqldb import MySQL from .. import mysql covid = Blueprint('covid', __name__) @covid.route('/covid', methods=['GET', 'POST']) def covid_check(): status=200 cur = mysql.connection.cursor() cur2 = mysql.connection.cursor() if reque...
ThanosBb3/Database_Project
app/backend/covid.py
covid.py
py
2,654
python
en
code
0
github-code
21
[ { "api_name": "flask.Blueprint", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 12, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 12, "usage_type": "name" }, { "api_name": "flask.request....
15469329514
import io import unittest from pygopherd import testutil from pygopherd.protocols.wap import WAPProtocol class TestWAPProtocol(unittest.TestCase): def setUp(self): self.config = testutil.get_config() self.logfile = testutil.get_string_logger() self.rfile = io.BytesIO(b"Accept:text/plain\n...
michael-lazar/pygopherd
tests/protocols/test_wap.py
test_wap.py
py
2,220
python
en
code
23
github-code
21
[ { "api_name": "unittest.TestCase", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pygopherd.testutil.get_config", "line_number": 10, "usage_type": "call" }, { "api_name": "pygopherd.testutil", "line_number": 10, "usage_type": "name" }, { "api_name":...
74929967412
import torch from torch import nn class FS_Encoder(nn.Module): def __init__(self): super(FS_Encoder, self).__init__() self.flatten = nn.Flatten() self.encoder = nn.Sequential( self.conv_block(1, 64), self.conv_block(64, 64), self.conv_block(64, 64), ...
JovianPlanet/protonet-seg
models/encoder.py
encoder.py
py
3,948
python
en
code
1
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 4, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 4, "usage_type": "name" }, { "api_name": "torch.nn.Flatten", "line_number": 7, "usage_type": "call" }, { "api_name": "torch.nn", "line_numb...
16871801443
from decimal import Decimal import json prefixes = [ ("", "", Decimal(1E+0)), ("yotta", "Y", Decimal(1E+24)), ("zetta", "Z", Decimal(1E+21)), ("exa", "E", Decimal(1E+18)), ("peta", "P", Decimal(1E+15)), ("tera", "T", Decimal(1E+12)), ("giga", "G", Decimal(1E+9)), ("mega", "M", Decimal(...
musabkilic/UnitConverter
converter.py
converter.py
py
3,320
python
en
code
0
github-code
21
[ { "api_name": "decimal.Decimal", "line_number": 6, "usage_type": "call" }, { "api_name": "decimal.Decimal", "line_number": 7, "usage_type": "call" }, { "api_name": "decimal.Decimal", "line_number": 8, "usage_type": "call" }, { "api_name": "decimal.Decimal", "l...
38667962143
import numpy as np import torch import gym import wrappers import signal from actor import Actor from critic import Critic # helper function to convert numpy arrays to tensors def t(x): return torch.tensor(x) env = wrappers.make_env("PongNoFrameskip-v4") #,render_mode="rgb_array" print(f"Observation s...
entangledqubit0110/Pong-RL-PLE
agents/actor_critic/train_onestep.py
train_onestep.py
py
2,530
python
en
code
0
github-code
21
[ { "api_name": "torch.tensor", "line_number": 11, "usage_type": "call" }, { "api_name": "wrappers.make_env", "line_number": 14, "usage_type": "call" }, { "api_name": "actor.Actor", "line_number": 21, "usage_type": "call" }, { "api_name": "critic.Critic", "line_...
9115350445
import dateutil.parser def read_info_file(filepath): lines = file(filepath + ".info").readlines() info = dict() info["date_last_absent"] = lines[0].replace('\n', '') if (info['date_last_absent'] == ""): info['date_last_absent'] = None else: info['date_last_absent'] = dateutil.parser...
timothyyu/ml_monorepo
statarb/src/python/lib/datafiles.py
datafiles.py
py
1,247
python
en
code
59
github-code
21
[ { "api_name": "dateutil.parser.parser.parse", "line_number": 10, "usage_type": "call" }, { "api_name": "dateutil.parser.parser", "line_number": 10, "usage_type": "attribute" }, { "api_name": "dateutil.parser", "line_number": 10, "usage_type": "name" }, { "api_name...
8430745452
#!/usr/bin/env python import sys import cv2 as cv import numpy as np drawing = False ix, iy = -1, -1 img = None color = None flood = False rec_size = 5 def floodify(img, color, x, y): flags = 4 flags | 255 << 8 h, w = img.shape[:2] mask = np.zeros((h+2, w+2), np.uint8) cv.floodFill(img, mask, (x...
mengxx123/board2slides
occlusion.py
occlusion.py
py
3,605
python
en
code
null
github-code
21
[ { "api_name": "numpy.zeros", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 19, "usage_type": "attribute" }, { "api_name": "cv2.floodFill", "line_number": 20, "usage_type": "call" }, { "api_name": "cv2.EVENT_LBUTTONDOWN", ...
74336885813
import numpy as np import torch import torch.nn as nn import dgl import os.path as osp from copy import deepcopy from utils import io from model.BaseEmbeddingModel import BaseEmbeddingModel, init_emb_table from model.module import dot_product, bpr_loss, bce_loss, cosine_contrastive_loss from model.LightGCN import get_...
xiransong/xGCN
model/xGCN.py
xGCN.py
py
22,262
python
en
code
1
github-code
21
[ { "api_name": "torch.nn", "line_number": 16, "usage_type": "attribute" }, { "api_name": "torch.nn.Sequential", "line_number": 20, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 20, "usage_type": "attribute" }, { "api_name": "torch.nn.Sequential",...
30921241130
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys import socket import statistics import threading thread_number = 10 res_mean = [None] * thread_number res_stdev = [None] * thread_number class TCPClient(threading.Thread): def __init__(self, offset, host, port): super().__init__() s...
yanniknoc/msca32019
a3 - Networking/client_solution.py
client_solution.py
py
1,515
python
en
code
0
github-code
21
[ { "api_name": "threading.Thread", "line_number": 14, "usage_type": "attribute" }, { "api_name": "socket.socket", "line_number": 26, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 26, "usage_type": "attribute" }, { "api_name": "socket.SOCK_S...
41096241456
from PyInquirer import prompt from rich.console import Console import startup console = Console() startup.startup() want_guide = prompt( { "type": "input", "name": "guided", "message": "Do you want to use a guided creation or do you want to go unguided? (G/U)", } ) if...
DR4UGUR/SantasList
main.py
main.py
py
490
python
en
code
8
github-code
21
[ { "api_name": "rich.console.Console", "line_number": 4, "usage_type": "call" }, { "api_name": "startup.startup", "line_number": 5, "usage_type": "call" }, { "api_name": "PyInquirer.prompt", "line_number": 6, "usage_type": "call" }, { "api_name": "startup.guided", ...
17056900343
import base64 import bluenrg.codes import bluenrg.commands import bluenrg.events import re import datetime import json import logging import RPi.GPIO as gpio import time import _strptime # Attempt to avoid: Failed to import _strptime because the import lockis held by another thread from jwcrypto import jwk, jwe from ...
autopi-io/autopi-core
src/salt/base/ext/_engines/ble_manager.py
ble_manager.py
py
9,042
python
en
code
142
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 25, "usage_type": "call" }, { "api_name": "messaging.EventDrivenMessageProcessor", "line_number": 30, "usage_type": "call" }, { "api_name": "bluenrg.connection.SerialConnection", "line_number": 32, "usage_type": "call" }...
34585994910
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat May 13 17:57:10 2017 @author: Falaize """ from pyphs import Graph import numpy as np from pyphs.dictionary.edges import DissipativeLinear, StorageLinear from pyphs.misc.rst import equation from pyphs.config import EPS from ..tools import componentDoc, ...
pyphs/pyphs
pyphs/dictionary/fraccalc/fractional_integrators.py
fractional_integrators.py
py
9,675
python
en
code
39
github-code
21
[ { "api_name": "pyphs.Graph", "line_number": 21, "usage_type": "name" }, { "api_name": "pyphs.Graph.__init__", "line_number": 24, "usage_type": "call" }, { "api_name": "pyphs.Graph", "line_number": 24, "usage_type": "name" }, { "api_name": "tools.parametersDefault"...
6026202873
from data.mri_data import SliceData, MultiSliceData from torch.utils.data import Sampler import math class VolumeSampler(Sampler): """ Ensures each batch comes from the same volume. Used for evaluation metrics to be computed over each volume. """ def __init__(self, dataset, batches_per_volume=1):...
seansegal/fastMRI
data/volume_sampler.py
volume_sampler.py
py
1,390
python
en
code
2
github-code
21
[ { "api_name": "torch.utils.data.Sampler", "line_number": 6, "usage_type": "name" }, { "api_name": "math.ceil", "line_number": 31, "usage_type": "call" } ]
39498193157
import requests def get_token(g): # test if token is still valid req_uri = "https://tasks.googleapis.com/tasks/v1/users/@me/lists" headers = {'Authorization': 'Bearer {}'.format(g['auth_token']['access_token']), 'Accept': 'application/json', } r = requests.get(req_uri, headers=h...
thalitadru/gtasks-todoist-sync
oauth.py
oauth.py
py
820
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 9, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 17, "usage_type": "call" } ]
72455377333
from torch import nn from typing import Literal from typing import NamedTuple, Final import torch from backbone import make_layers, darknet class Yolov1(nn.Module): def __init__(self,classes:int, backbone:nn.Module = make_layers(darknet,3), split_size=7,num_boxes=2, ...
Asmail790/Yolov1
model.py
model.py
py
1,525
python
en
code
0
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 8, "usage_type": "name" }, { "api_name": "torch.nn.Module", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.nn", "line...
32456233143
"""This module provides some basic operations that help to manipulate audio signal""" import decimal import numpy as np import sklearn def round_half_up(number): """Round half up a number :param number: the number to be rounded; :return: rounded value. """ rounded_value = int(decimal.Decimal(nu...
MinaevIB/Voice-Activity-Detector
utils/audio_operations.py
audio_operations.py
py
3,419
python
en
code
0
github-code
21
[ { "api_name": "decimal.Decimal", "line_number": 15, "usage_type": "call" }, { "api_name": "decimal.ROUND_HALF_UP", "line_number": 15, "usage_type": "attribute" }, { "api_name": "numpy.ceil", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.abs", ...
20727190142
import io from operator import mod import sys _INPUT = """\ 4 1 3 1 3 2 2 1 3 """ sys.stdin = io.StringIO(_INPUT) # --------------------------------- from decimal import Decimal n = int(input()) probs = [] for i in range(n): a, b = map(Decimal, input().split()) probs.append((i, a / (a + b))) probs.sort(...
makima333/Atcoder-ganbaru
contest/abc308/C.py
C.py
py
385
python
en
code
0
github-code
21
[ { "api_name": "sys.stdin", "line_number": 14, "usage_type": "attribute" }, { "api_name": "io.StringIO", "line_number": 14, "usage_type": "call" }, { "api_name": "decimal.Decimal", "line_number": 24, "usage_type": "argument" } ]
42235814221
from flask import Flask, render_template import requests app = Flask(__name__) @app.route("/") def home(): blog_url = "https://api.npoint.io/e42b353ee387383898c7" response = requests.get(blog_url) posts = response.json() return render_template("index.html", posts=posts) @app.route("/about...
maryletteroa/100DaysOfCode-Python
59/main.py
main.py
py
758
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.render_template", ...
29348914438
from django.shortcuts import render from django.http import HttpResponseRedirect from django.shortcuts import reverse from django import forms from . import util import markdown2 import random2 def index(request): return render(request, "encyclopedia/index.html", { "entries": util.list_entries() }) d...
soninirav/wiki
encyclopedia/views.py
views.py
py
2,794
python
en
code
0
github-code
21
[ { "api_name": "django.shortcuts.render", "line_number": 10, "usage_type": "call" }, { "api_name": "django.http.HttpResponseRedirect", "line_number": 20, "usage_type": "call" }, { "api_name": "django.shortcuts.reverse", "line_number": 20, "usage_type": "call" }, { ...
37423452647
#!/usr/bin/env python import rospy import math import tf2_ros from std_msgs.msg import Float64 import json def logCamPos(): pass def getMarkerState(tfBuffer, marker): trans = None rot = None counter = 0 rate = rospy.Rate(100) # 100hz while not rospy.is_shutdown(): counter += 1 ...
keszegrobert/ros_robotic_arm
src/armrecog.py
armrecog.py
py
3,350
python
en
code
0
github-code
21
[ { "api_name": "rospy.Rate", "line_number": 16, "usage_type": "call" }, { "api_name": "rospy.is_shutdown", "line_number": 17, "usage_type": "call" }, { "api_name": "rospy.Time.now", "line_number": 23, "usage_type": "call" }, { "api_name": "rospy.Time", "line_nu...
10106074758
from utils.http import HttpClient from settings.loader import load_config_file cnf = load_config_file() def base_url(): process_memory = cnf["process_memory"] return f"{process_memory['scheme']}://{process_memory['host']}:{process_memory['port']}" def save_document(collection, data): url = base_url() ...
fernandocandrade/Plataforma-Domain
Platform.App/python-template/sdk/process_memory.py
process_memory.py
py
898
python
en
code
1
github-code
21
[ { "api_name": "settings.loader.load_config_file", "line_number": 5, "usage_type": "call" }, { "api_name": "utils.http.HttpClient", "line_number": 14, "usage_type": "call" }, { "api_name": "utils.http.HttpClient", "line_number": 22, "usage_type": "call" }, { "api_n...
8419159618
#!/usr/bin/env python import ROOT import argparse parser = argparse.ArgumentParser() parser.add_argument("basename", help="basename of fit file to extract discontinuities from") parser.add_argument("poi", help="parameter to find discontinuities in") args = parser.parse_args() systematics = ['CERR1','CERR2','CMS_eff_e...
TopEFT/EFTFit
Fitter/scripts/DiscontinuityFinder.py
DiscontinuityFinder.py
py
2,339
python
en
code
3
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 5, "usage_type": "call" }, { "api_name": "ROOT.TFile.Open", "line_number": 18, "usage_type": "call" }, { "api_name": "ROOT.TFile", "line_number": 18, "usage_type": "attribute" } ]
9097800971
import numpy as np import tensorflow as tf from abc import ABC, abstractmethod from typing import List from secretflow.security.privacy.accounting.rdp_accountant import ( get_rdp, get_privacy_spent_rdp, ) from secretflow.security.privacy.accounting.gdp_accountant import ( cal_mu_poisson, cal_mu_unifor...
primihub/hackathon
winning-project/Vpcdap/code/隐私求交/PSI/secretflow/security/privacy/mechanism/tensorflow/layers.py
layers.py
py
5,541
python
en
code
18
github-code
21
[ { "api_name": "tensorflow.keras", "line_number": 18, "usage_type": "attribute" }, { "api_name": "abc.ABC", "line_number": 18, "usage_type": "name" }, { "api_name": "abc.abstractmethod", "line_number": 22, "usage_type": "name" }, { "api_name": "tensorflow.keras.lay...
13287933191
# -*- coding: utf-8 -*- """ Created on Thu Sep 6 16:49:20 2018 @author: Razib """ import numpy as np from helper_analysis import * from matplotlib.colors import LogNorm import math as ma import glob from multicore_Part1_def_simpleKER_HoHoCN import SingleThread import matplotlib.pyplot as plt if __name__ == '__mai...
raphaelphys/Analysis-for-ALS
multicore_Part2_ana_simpleKER_HoHoCN.py
multicore_Part2_ana_simpleKER_HoHoCN.py
py
8,710
python
en
code
0
github-code
21
[ { "api_name": "glob.glob", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.fromfile", "line_number": 43, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 69, "usage_type": "call" }, { "api_name": "multiprocessing.Pool", "line...
25160189181
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Mon Dec 2 7:01:25 2017 @author: Yann Vernaz """ # utilitaires pour le Meetup ML Pau import os import csv import numpy as np from random import sample import itertools import matplotlib.pyplot as plt def data_generate(fileName='data.csv', w=[1., 2., -1], ...
machine-learning-pau/distributed-optimization
utilsLab1.py
utilsLab1.py
py
11,587
python
en
code
1
github-code
21
[ { "api_name": "numpy.random.normal", "line_number": 37, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 37, "usage_type": "attribute" }, { "api_name": "numpy.random.normal", "line_number": 38, "usage_type": "call" }, { "api_name": "numpy.rando...
4437510565
import cv2 as cv import matplotlib import matplotlib.pyplot as plt import numpy as np from fire import Fire def get_keypoint_mesh(length=105, width=76): nx, ny = (13, 8) x = np.linspace(0, length, nx) y = np.linspace(0, width, ny) xv, yv = np.meshgrid(x, y, indexing="ij") xv = xv.flatten() y...
AtomScott/homography-estimation
scripts/draw_keypoints.py
draw_keypoints.py
py
979
python
en
code
0
github-code
21
[ { "api_name": "numpy.linspace", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.meshgrid", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.load", "line_n...
13415762165
from sqlalchemy import Column, DateTime, Float, Integer import vigorish.database as db from vigorish.util.datetime_util import utc_now class TimeBetweenPitches(db.Base): __tablename__ = "time_between_pitches" id = Column(Integer, primary_key=True) between_pitches_sample_size = Column(Integer, default=0)...
a-luna/vigorish
src/vigorish/models/time_between_pitches.py
time_between_pitches.py
py
4,220
python
en
code
2
github-code
21
[ { "api_name": "vigorish.database.Base", "line_number": 7, "usage_type": "attribute" }, { "api_name": "vigorish.database", "line_number": 7, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 10, "usage_type": "call" }, { "api_name": "sqlalch...
5268626236
# adapted from https://pytorch.org/tutorials/beginner/pytorch_with_examples.html import numpy as np import matplotlib.pyplot as plt # Create random input and output data x = np.linspace(-np.pi, np.pi, 2000) y_true = np.sin(x) # Random initialization a = np.random.randn() b = np.random.randn() c = np.random.randn()...
mmbahnasy/NeuralNetworkTutorial
function_approximation.py
function_approximation.py
py
1,482
python
en
code
0
github-code
21
[ { "api_name": "numpy.linspace", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 8, "usage_type": "attribute" }, { "api_name": "numpy.sin", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.random.randn", "line_nu...
40365349534
from datetime import datetime, timedelta, date from functools import partial from itertools import groupby from dateutil.relativedelta import relativedelta from odoo import api, fields, models, _ from odoo.exceptions import UserError, ValidationError from odoo.tools.misc import formatLang from odoo.osv import expressi...
omikronkreatif/Kanjabungnew
asa_simpin_syariah/models/syariah_pembiayaan.py
syariah_pembiayaan.py
py
108,290
python
en
code
0
github-code
21
[ { "api_name": "odoo.models.Model", "line_number": 16, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 16, "usage_type": "name" }, { "api_name": "odoo.fields.Many2one", "line_number": 19, "usage_type": "call" }, { "api_name": "odoo.fields",...
1335292271
from collections import deque def solution(prices): prices = deque(prices) answer = [] while prices: count = 0 current_price = prices.popleft() for next_price in prices: if current_price <= next_price: count += 1 count += 1 break ...
konsent/coding_test_python
week_03/00_queue.py
00_queue.py
py
627
python
en
code
0
github-code
21
[ { "api_name": "collections.deque", "line_number": 4, "usage_type": "call" } ]
4927128225
import requests from bs4 import BeautifulSoup as bs from linebot.models import * from linebot import LineBotApi from config import * from quick_message import * from User import * # SPEECH NWES BOT feng_chia_url = "https://www.iecs.fcu.edu.tw/" url = "https://www.iecs.fcu.edu.tw/news/?category=speech" dash = "---------...
mengxian0913/Line-bot
speech.py
speech.py
py
2,538
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 68, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 69, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 86, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "...
25945497021
from fakts.discovery.beacon import advertise, retrieve_bindings from fakts.discovery.base import FaktsEndpoint import asyncio from fakts.discovery.advertised import alisten, ListenBinding import pytest @pytest.mark.network def test_can_retrieve_bindings(): bindings = retrieve_bindings() assert len(bindings) >...
jhnnsrs/fakts
tests/test_send_and_receive.py
test_send_and_receive.py
py
1,722
python
en
code
0
github-code
21
[ { "api_name": "fakts.discovery.beacon.retrieve_bindings", "line_number": 10, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 8, "usage_type": "attribute" }, { "api_name": "fakts.discovery.beacon.retrieve_bindings", "line_number": 17, "usage_type": "cal...
31941813595
import torch import torch.nn as nn from torch.utils.data import DataLoader import torchvision import torchvision.models as models import torchvision.transforms as transforms import os import copy import random import argparse from utils import * def eval(data_loader, model, topk=(1,), device=None, print_freq=10): ...
BingoH/MFTC
random_select.py
random_select.py
py
6,191
python
en
code
0
github-code
21
[ { "api_name": "torch.zeros", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.nn.DataParallel", "line_number": 22, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 22, "usage_type": "name" }, { "api_name": "torch.no_grad", "line_...
27086815516
import pandas as pd import os from section_parameters.SectionParametersE6 import SectionParametersE6 from modules.FilesAndDates import FilesAndDates from modules.FrostDepthPlot import FrostDepthPlot from modules.FigureFormatting import FigureFormatting from modules.AnimatorPlots import AnimatorPlots from modules.Freezi...
reeksts/VegDim_test_site_frost_analysis
main.py
main.py
py
3,795
python
en
code
0
github-code
21
[ { "api_name": "section_parameters.SectionParametersE6", "line_number": 21, "usage_type": "name" }, { "api_name": "section_parameters.SectionParametersE6.SectionParametersE6", "line_number": 21, "usage_type": "call" }, { "api_name": "testsite_data.TestsiteDataE6.SampleDataE6", ...
20235197303
import numpy as np import matplotlib.pyplot as plt n = 20 p = np.zeros(n) r = np.arange(0,4.0,0.005) ra = np.arange(0,n,1) on = np.ones(n); for m in r: r = m p = np.zeros(n) p[0] = 0.2 for i in range(0,n-1): p[i + 1] = r*p[i]*(1-p[i]) ant = int((n/2)-1) dep = int(n-1) My_rango = p[ant:dep] my_set = se...
6arlos6/Logistic-map-chaotic-behaviour-
CAOS.py
CAOS.py
py
447
python
en
code
1
github-code
21
[ { "api_name": "numpy.zeros", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 8,...
73451075894
from discord.ext import commands import discord import datetime class Example(commands.Cog): def __init__(self, bot): self.bot = bot @staticmethod def example_check(ctx): return ctx.author.id in [1234, 7328] @commands.command(name='decorators', enabled=False) @commands.cooldown(...
LolRiTTeR/LolRiTTeRBot
cogs/example.py
example.py
py
1,587
python
en
code
5
github-code
21
[ { "api_name": "discord.ext.commands.Cog", "line_number": 7, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 7, "usage_type": "name" }, { "api_name": "discord.ext.commands.command", "line_number": 15, "usage_type": "call" }, { "api...
13047608585
from cavachon.config.config_mapping.AnalysisAttributionScoreConfig import AnalysisAttributionScoreConfig from cavachon.config.config_mapping.ConfigMapping import ConfigMapping from cavachon.utils.GeneralUtils import GeneralUtils from typing import Any, List, Mapping class AnalysisConfig(ConfigMapping): """AnalysisCo...
dn070017/CAVACHON
cavachon/config/config_mapping/AnalysisConfig.py
AnalysisConfig.py
py
3,034
python
en
code
0
github-code
21
[ { "api_name": "cavachon.config.config_mapping.ConfigMapping.ConfigMapping", "line_number": 6, "usage_type": "name" }, { "api_name": "typing.Mapping", "line_number": 34, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 34, "usage_type": "name" }, { ...
32122441800
#! /usr/bin/env python # -*- coding: utf-8 -*- from flask import Flask, request import json import os from datetime import datetime, timedelta import logging import logging.handlers #import end # configure log LOG_FILE = "gitlab-receiver.log" handler = logging.handlers.RotatingFileHandler(LOG_FILE, maxBy...
jiebers/Py
web_hooks.py
web_hooks.py
py
1,102
python
en
code
0
github-code
21
[ { "api_name": "logging.handlers.RotatingFileHandler", "line_number": 14, "usage_type": "call" }, { "api_name": "logging.handlers", "line_number": 14, "usage_type": "attribute" }, { "api_name": "logging.Formatter", "line_number": 16, "usage_type": "call" }, { "api_...
28098008032
from django.shortcuts import render import requests import json from django.http import HttpResponseRedirect from .forms import NameForm from .weather import Weather #Afficher les données météo à partir de l'id de la ville def weather(request, city_id): weather1=Weather(city_id) weather1.retriveWeathInfo() ...
emmanuelderevel/g4meteo
meteo/city/views.py
views.py
py
1,269
python
en
code
0
github-code
21
[ { "api_name": "weather.Weather", "line_number": 10, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 13, "usage_type": "call" }, { "api_name": "forms.NameForm", "line_number": 21, "usage_type": "call" }, { "api_name": "json.load", ...
25338041220
import datetime import pytz from celery import states from django.core import mail from django.template.loader import render_to_string from django.test import TestCase, override_settings from freezegun import freeze_time from menus.factories import DishFactory, UserFactory from menus.models import Dish from menus.task...
dzbrozek/emenu-api
emenuapi/menus/tests/test_tasks.py
test_tasks.py
py
3,078
python
en
code
0
github-code
21
[ { "api_name": "django.test.TestCase", "line_number": 14, "usage_type": "name" }, { "api_name": "menus.tasks.report_dishes.apply", "line_number": 16, "usage_type": "call" }, { "api_name": "menus.tasks.report_dishes", "line_number": 16, "usage_type": "name" }, { "ap...
2699630598
import matplotlib.pyplot as plt import numpy as np from random import randint l = [] n = 0 l2 = [] while n <20000: n += 1000 l.append(n) l2.append(randint(1,9)) lis = np.array(l) lis2 = np.array(l2) plt.plot(lis, lis2) plt.ylabel('tamanho da metrix') plt.xlabel('numero de interações') plt.show()
raphapinho/resolu--oSistemasLineares
test.py
test.py
py
316
python
en
code
0
github-code
21
[ { "api_name": "random.randint", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "...
14854941754
import numpy as np from sklearn.metrics import * from sklearn.svm import LinearSVR from sklearn.linear_model import LogisticRegression, SGDClassifier, SGDRegressor,LinearRegression from utils import * from variables import * def get_model(X_train,Y_train): model = LogisticRegression(penalty='l2',C=1.0,n_jobs=-1) ...
navreeetkaur/Sentiment-Classification
predict.py
predict.py
py
1,259
python
en
code
0
github-code
21
[ { "api_name": "sklearn.linear_model.LogisticRegression", "line_number": 13, "usage_type": "call" }, { "api_name": "sklearn.linear_model.LogisticRegression", "line_number": 18, "usage_type": "call" }, { "api_name": "sklearn.linear_model.SGDRegressor", "line_number": 25, "u...
11831895457
import httplib import urllib import time import hashlib import json API_SECRET = "{A130BFEE-EEF0-4733-9064-17FAFC341F26}" API_HOST = "m.grupaluxmed.pl" API_BASE_URL = "/PatientPortalProxyBE/api/" # x-api request headers X_API_VERSION = "2" X_API_CLIENT = "client_android" X_API_LANG = "pl" class Luxmed: def __in...
filipduch/luxmedAPI
luxmed.py
luxmed.py
py
5,209
python
en
code
2
github-code
21
[ { "api_name": "urllib.urlencode", "line_number": 33, "usage_type": "call" }, { "api_name": "httplib.HTTPSConnection", "line_number": 36, "usage_type": "call" }, { "api_name": "httplib.OK", "line_number": 40, "usage_type": "attribute" }, { "api_name": "json.loads",...
34319762753
import gensim from gensim import corpora from gensim.models.lsimodel import LsiModel import plotly.express as px import pandas as pd with open('transcript.txt', 'r') as file: text_data = file.read() #segment text into sentences text_data = text_data.split('.') print(text_data) # Tokenize the text data tokenized_t...
advaitpaliwal/NotesAI
test/test2.py
test2.py
py
1,246
python
en
code
1
github-code
21
[ { "api_name": "gensim.utils.simple_preprocess", "line_number": 14, "usage_type": "call" }, { "api_name": "gensim.utils", "line_number": 14, "usage_type": "attribute" }, { "api_name": "gensim.parsing", "line_number": 17, "usage_type": "attribute" }, { "api_name": "...
75038657013
import csv import numpy import re from typing import List, Dict, Optional EmojiSentimentDict = Dict[int, numpy.ndarray] EMOJI_SENTIMENT_MAPPING_FILE = "emoji_sentiment_mapping.csv" EMOJI_REGEX = re.compile( "[" "\U0001F1E0-\U0001F1FF" # flags (iOS) "\U0001F300-\U0001F5FF" # symbols & pictographs "\...
lukastrm/csa-data
csadata/emoji.py
emoji.py
py
4,098
python
en
code
0
github-code
21
[ { "api_name": "typing.Dict", "line_number": 6, "usage_type": "name" }, { "api_name": "numpy.ndarray", "line_number": 6, "usage_type": "attribute" }, { "api_name": "re.compile", "line_number": 10, "usage_type": "call" }, { "api_name": "importlib.resources.open_text...
22166985744
import json class CalculatePopularity(): def __init__(self, runTime, file='liveStream.json'): self.runTime = runTime self.fname = file def calculateScore(self): self.totalTweets = 0 self.retweetCount = 0 self.likes_score = [] self.followers_score = [] w...
AparaV/Twitter-Analysis
calculatePopularity.py
calculatePopularity.py
py
2,225
python
en
code
5
github-code
21
[ { "api_name": "json.loads", "line_number": 17, "usage_type": "call" } ]
11490268230
import torch import torch.nn as nn import torchvision.models as models from torch.autograd import Variable import torch.nn.functional as F import numpy as np class EncoderCNN(nn.Module): def __init__(self, embed_size): super(EncoderCNN, self).__init__() # Resnet resnet = models.resnet50(...
supracharger/AI-Computer-Vision-Master
P2_Image_Captioning/model.py
model.py
py
6,215
python
en
code
0
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 9, "usage_type": "name" }, { "api_name": "torchvision.models.resnet50", "line_number": 13, "usage_type": "call" }, { "api_name": "torchvision.m...
24023150222
#!/usr/bin/env python # -*- coding: utf-8 -*- from django.utils.unittest import skipUnless from django.test import TestCase from django_hadoop.models import CommonJob from django_hadoop.runner import LocalJobRunner, RestJobRunner from django_hadoop import RUNNING, COMPLETED, HADOOP_JOB_CMD, JOB_MANAGER_CLASS JOB_RU...
Obie-Wan/django_hadoop
django_hadoop/tests.py
tests.py
py
2,395
python
en
code
20
github-code
21
[ { "api_name": "django_hadoop.JOB_MANAGER_CLASS.get_runner", "line_number": 12, "usage_type": "call" }, { "api_name": "django_hadoop.JOB_MANAGER_CLASS", "line_number": 12, "usage_type": "name" }, { "api_name": "django.test.TestCase", "line_number": 17, "usage_type": "name"...
6066921571
import sys import random import matplotlib matplotlib.use('Qt5Agg') from PySide6 import QtCore, QtWidgets, QtGui from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.figure import Figure from mpl_toolkits.basemap import Basemap class MplCanvas(FigureCanvas): def __in...
neuromorphs/NeuroP
examples/tsp_demo/tsp_demo.py
tsp_demo.py
py
4,880
python
en
code
5
github-code
21
[ { "api_name": "matplotlib.use", "line_number": 4, "usage_type": "call" }, { "api_name": "matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg", "line_number": 14, "usage_type": "name" }, { "api_name": "matplotlib.figure.Figure", "line_number": 16, "usage_type": "call" }...
73035233973
"""utils.py Utility functions for Fauxmo. """ import socket from fauxmo import logger import uuid def get_local_ip(ip_address): """Attempt to get the local network-connected IP address""" if ip_address is None or ip_address.lower() == "auto": logger.debug("Attempting to get IP address automatically...
LiuFang816/SALSTM_py_data
python/n8henrie_fauxmo/fauxmo-master/src/fauxmo/utils.py
utils.py
py
1,176
python
en
code
9
github-code
21
[ { "api_name": "fauxmo.logger.debug", "line_number": 15, "usage_type": "call" }, { "api_name": "fauxmo.logger", "line_number": 15, "usage_type": "name" }, { "api_name": "socket.gethostname", "line_number": 17, "usage_type": "call" }, { "api_name": "socket.gethostby...
14635402782
""" Pre-Processing Script Function takes as input *only* pandas series objects and performs various pre-processing steps Pre-processing functions available include 1. Remove Numbers 2. Remove Roman Numbers 3. Tf-Idf Weighting Restrict the corpus to only words that have tf-idf values more than a specified threshold 4. ...
nogibjj/esg-controversy-tracker
pre_processing_scripts/pre_processing.py
pre_processing.py
py
3,561
python
en
code
0
github-code
21
[ { "api_name": "nltk.stem.PorterStemmer", "line_number": 26, "usage_type": "call" }, { "api_name": "nltk.tokenize.WhitespaceTokenizer", "line_number": 27, "usage_type": "call" }, { "api_name": "sklearn.feature_extraction.text.TfidfVectorizer", "line_number": 37, "usage_typ...
21404244230
import requests from flask import jsonify user_data = jsonify({ 'surname': 'a', 'name': 'b', 'age': 87, 'position': 'captain', 'speciality': None, 'address': None, 'email': 'po@inf.rr', ...
dariapotapova/restful
tests/test3.py
test3.py
py
1,113
python
en
code
0
github-code
21
[ { "api_name": "flask.jsonify", "line_number": 5, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 17, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 18, "usage_type": "call" }, { "api_name": "requests.get", "line_numbe...
21616886035
from celery import Celery from datetime import timedelta from elasticsearch import Elasticsearch __all__ = ( 'app', ) CONFIG = { 'broker': 'amqp://guest@localhost//' } app = Celery('tasks', backend='amqp', broker=CONFIG['broker'], include=['tasks.twitter_tasks']) # Giv...
randonia/bouzouki
src/tasks/task_queue.py
task_queue.py
py
540
python
en
code
0
github-code
21
[ { "api_name": "celery.Celery", "line_number": 13, "usage_type": "call" } ]
27367291146
import os from PIL import Image # Chemin du dossier contenant les images d'origine dossier_source = "/Users/adeleimparato/Documents/Montpellier/UM/Semestre3/Image_Secu_DeepLearning/ProjetImage_M2/Code/img_align_celeba" # Chemin du dossier de destination pour les images converties dossier_destination = "/Users/adeleim...
Adeleimpa/ProjetImage_M2
Code/data_convert.py
data_convert.py
py
1,555
python
fr
code
0
github-code
21
[ { "api_name": "os.path.exists", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 12, "usage_type": "call" }, { "api_name": "os.listdir", "line_number...
31353265893
#Given: At most 15 UniProt Protein Database access IDs #Return: For each protein possessing N-glycosylation motif, output its given access ID followed by list of locations in protein string where motif can be found #N-glycosylation motif: N{P}[ST]{P} #[] = either/or, {} = any except from urllib.request import u...
agolikova/Rosalind-Bioinformatics-Solutions
Code/MPRT_Finding a protein motif.py
MPRT_Finding a protein motif.py
py
1,843
python
en
code
1
github-code
21
[ { "api_name": "urllib.request.urlopen", "line_number": 17, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 28, "usage_type": "call" }, { "api_name": "Bio.SeqIO.parse", "line_number": 31, "usage_type": "call" }, { "api_name": "Bio.SeqIO", "li...
73704559411
# E-mail import smtplib import time from email.mime.text import MIMEText import email.utils from password import mail_info class send_message: def __init__(self, to_mail, title= '제목을 입력해주세요', msg= '내용을 입력해주세요'): self.to_mail = to_mail self.title = title self.msg = msg self.__confi...
applewoods/before_and_after_COVID19
crawler/send_mail.py
send_mail.py
py
783
python
en
code
0
github-code
21
[ { "api_name": "password.mail_info", "line_number": 15, "usage_type": "call" }, { "api_name": "smtplib.SMTP_SSL", "line_number": 19, "usage_type": "call" }, { "api_name": "email.mime.text.MIMEText", "line_number": 21, "usage_type": "call" } ]
70642763574
import cv2 import pandas as pd import numpy as np import json from collections import namedtuple def get_namedtuple_from_json_string(line): return json.loads(line, object_hook=lambda d: namedtuple('stuff', d.keys())(*d.values())) class TrainingFileReader: def __init__(self, path_to_training="../training/"):...
enliktjioe/deltax
RCSnail-AI-lite/src/learning/training/training_file_reader.py
training_file_reader.py
py
1,400
python
en
code
0
github-code
21
[ { "api_name": "json.loads", "line_number": 9, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_number": 17, "usage_type": "call" }, { "api_name": "cv2.waitKey", "l...
30213133516
from django.test import TestCase from django.contrib.auth.models import User from api.models import Store, Section, Product class TestCreateProduct(TestCase): @classmethod def setUpTestData(cls): test_store = Store.objects.create( name='testName123', contacts='TestContacts', ...
Hr-kutsarov/DYI-store
api/tests.py
tests.py
py
2,138
python
en
code
0
github-code
21
[ { "api_name": "django.test.TestCase", "line_number": 6, "usage_type": "name" }, { "api_name": "api.models.Store.objects.create", "line_number": 9, "usage_type": "call" }, { "api_name": "api.models.Store.objects", "line_number": 9, "usage_type": "attribute" }, { "a...
23324151025
from datetime import datetime from typing import Union, Optional, List from aiogram.types import CallbackQuery from aiogram.utils.exceptions import BadRequest from functions.event.templates_messages import ME from loader import bot, _ from utils.db_api import db_commands async def add_events_to_user(call: CallbackQ...
DavidRomanovizc/DatingBot
functions/event/extra_features.py
extra_features.py
py
3,901
python
en
code
87
github-code
21
[ { "api_name": "aiogram.types.CallbackQuery", "line_number": 12, "usage_type": "name" }, { "api_name": "utils.db_api.db_commands.select_user", "line_number": 16, "usage_type": "call" }, { "api_name": "utils.db_api.db_commands", "line_number": 16, "usage_type": "name" }, ...
10415128948
import sys import os.path import argparse import getpass from typing import Union, NoReturn from .interface import SQLiteFileInterface from .core import AsymKey, CryptoHandler class SQLiteCLI: def __init__( self, filename: str, asym_key_public: Union[None, str] = None, ...
matthiashuschle/cryp-to-go
cryp_to_go/cli.py
cli.py
py
5,608
python
en
code
0
github-code
21
[ { "api_name": "typing.Union", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 16, "usage_type": "name" }, { "api_name": "os.path.path.exists", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.path", "lin...
34018687365
from setuptools import setup import os with open(os.path.join(os.path.dirname(__file__), 'README.md')) as f: README = f.read() setup( name='tracer', version='0.1.0', author='weak_ptr', author_email='weak_ptr@163.com', url='https://github.com/nnnewb/tracer', py_modules=['tracer'], keywo...
nnnewb/tracer
setup.py
setup.py
py
454
python
en
code
0
github-code
21
[ { "api_name": "os.path.join", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 4, "usage_type": "call" }, { "api_name": "setuptools.setup", "line_n...
75057107251
from rest_framework import serializers from api.models import Location from django.contrib.auth.models import User '''Example of Regular Serializer class LocationSerializer(serializers.Serializer): pk = serializers.IntegerField(read_only=True) name = serializers.CharField(required=True, allow_blank=False, max_...
jonathanmeier5/kpi_tracker
api/serializers.py
serializers.py
py
1,745
python
en
code
0
github-code
21
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 34, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 34, "usage_type": "name" }, { "api_name": "rest_framework.serializers.ReadOnlyField", "line_number": 35, ...
26134447916
from django.urls import path from django.contrib import admin from . import views app_name = 'accounts' urlpatterns = [ path('userinfo/', views.userinfo, name='userinfo'), path('signup/', views.SignUpView.as_view(), name='signup'), path('login/', views.LoginView.as_view(), name='login'), path('logout/...
abubaman/MLift
accounts/urls.py
urls.py
py
654
python
en
code
0
github-code
21
[ { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 10, "usage_type": "call" }, { "api_name": "django.urls.path", ...
33863805062
import ffmpeg import file_util PRESENTATION_TIMESTAMPS = "PTS-STARTPTS" MP4 = 'mp4' MP3 = 'mp3' ALLOWED_MEDIA_TYPES = [MP3, MP4] @staticmethod def trim_media(input_file, start_seconds, end_seconds, mediatype): if mediatype not in ALLOWED_MEDIA_TYPES: raise TypeError(f"Only trimming {ALLOWED_MEDIA_TYPES} ...
PietroSassone/youtube-downloader-desktop-app
youtube_downloader/util/media_trimmer.py
media_trimmer.py
py
1,241
python
en
code
1
github-code
21
[ { "api_name": "file_util.delete_file_if_exists", "line_number": 17, "usage_type": "call" }, { "api_name": "ffmpeg.input", "line_number": 19, "usage_type": "call" }, { "api_name": "ffmpeg.concat", "line_number": 29, "usage_type": "call" }, { "api_name": "ffmpeg.out...
25689804368
from PyQt5.QtWidgets import (QLabel) from PyQt5.QtCore import (Qt, QRect) from PyQt5.QtGui import (QPainter, QFont, QFontMetricsF, QBrush) from .TMessageLabel import TMessageLabel from .PicBase64 import get class TMessage(QLabel): '单条消息' def __init__(self, massage, rwidth, parent=None): super(TMessage...
Drelf2018/Liter
Liter_Client/TMessage.py
TMessage.py
py
2,681
python
en
code
0
github-code
21
[ { "api_name": "PyQt5.QtWidgets.QLabel", "line_number": 8, "usage_type": "name" }, { "api_name": "TMessageLabel.TMessageLabel", "line_number": 22, "usage_type": "call" }, { "api_name": "PicBase64.get", "line_number": 28, "usage_type": "call" }, { "api_name": "PyQt5...
202917858
import numpy as np import matplotlib.pyplot as plt from sklearn.metrics import roc_auc_score, precision_score, recall_score, accuracy_score from sklearn.model_selection import train_test_split import torch import torch import torch.nn as nn import torch.optim as optim from torch.autograd import Variable import torch.n...
MatthewK3023/EEG-Classification
EEG_Classification.py
EEG_Classification.py
py
8,552
python
en
code
11
github-code
21
[ { "api_name": "os.environ", "line_number": 17, "usage_type": "attribute" }, { "api_name": "torch.cuda.set_device", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 18, "usage_type": "attribute" }, { "api_name": "warnings.filter...
12592915377
# python align.py --camera=nikon --focal_length=21 import argparse import glob import tqdm import os import os.path as op import json import rawpy import numpy as np import cv2 from skimage.exposure import match_histograms, equalize_hist import skimage.filters import datetime import time import copy import pickle ...
igor-morawski/reverse-undistortion
align.py
align.py
py
10,045
python
en
code
0
github-code
21
[ { "api_name": "rawpy.imread", "line_number": 46, "usage_type": "call" }, { "api_name": "numpy.expand_dims", "line_number": 49, "usage_type": "call" }, { "api_name": "numpy.concatenate", "line_number": 54, "usage_type": "call" }, { "api_name": "rawpy.imread", "...
33257530258
import pandas as pd import numpy as np import shutil, os, functools, itertools import multiprocessing as mp def read_bedgraph(bg_file): df = [] with open(bg_file, 'r') as bgf: lines = bgf.readlines() for i in range(len(lines)): if i!=0: tl = lines[i].split('\t') tl[...
mehdiforoozandeh/SAGAconf
_utils.py
_utils.py
py
12,323
python
en
code
1
github-code
21
[ { "api_name": "pandas.DataFrame", "line_number": 15, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 18, "usage_type": "call" }, { "api_name": "os.system", "line_number": 43, "usage_type": "call" }, { "api_name": "os.system", "line_number": ...
13375949991
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import yaml import numpy as np from easydict import EasyDict as edict config = edict() config.OUTPUT_DIR = 'output' config.LOG_DIR = 'log' config.DATA_DIR = '' config.BACKBONE_MODEL = 'pose_resnet'...
sail-sg/mvp
lib/core/config.py
config.py
py
10,991
python
en
code
296
github-code
21
[ { "api_name": "easydict.EasyDict", "line_number": 11, "usage_type": "call" }, { "api_name": "easydict.EasyDict", "line_number": 23, "usage_type": "call" }, { "api_name": "easydict.EasyDict", "line_number": 28, "usage_type": "call" }, { "api_name": "easydict.EasyDi...
27738306615
import streamlit as st from PIL import Image import numpy as np import tensorflow as tf from tensorflow import keras st.title("Fashion Classifier") uploaded_file = st.file_uploader("Choose an square image file", type=["jpg", "png"]) model = keras.models.load_model("CNN_model_2.h5") labels = ['T-shirt', 'Trous...
kyle-paul/Fashion-Classifier
app.py
app.py
py
783
python
en
code
0
github-code
21
[ { "api_name": "streamlit.title", "line_number": 7, "usage_type": "call" }, { "api_name": "streamlit.file_uploader", "line_number": 8, "usage_type": "call" }, { "api_name": "tensorflow.keras.models.load_model", "line_number": 9, "usage_type": "call" }, { "api_name"...
14699048093
""" Example code inspired in scrpay tutorial powered by Elias Dorneles http://pythonclub.com.br/material-do-tutorial-web-scraping-na-nuvem.html """ import scrapy class QuoteSpiderXpath(scrapy.Spider): name = "quotes-xpath" start_urls = ("http://spidyquotes.herokuapp.com/tableful/",) download_delay = 1....
n1lux/scrapy-basic
quote_spyder_xpath.py
quote_spyder_xpath.py
py
857
python
en
code
0
github-code
21
[ { "api_name": "scrapy.Spider", "line_number": 11, "usage_type": "attribute" }, { "api_name": "scrapy.Request", "line_number": 25, "usage_type": "call" } ]
4734518843
from kivy.uix.modalview import ModalView from kivy.uix.button import Button from kivy.uix.boxlayout import BoxLayout from kivy.lang.builder import Builder from global_variables import WINDOW from sqlite_requests import db Builder.load_file(r'treasure_cave_game/level_constructor.kv') class ConstructField(ModalView): ...
snckmykek/game
treasure_cave_game/level_constructor.py
level_constructor.py
py
9,096
python
en
code
0
github-code
21
[ { "api_name": "kivy.lang.builder.Builder.load_file", "line_number": 8, "usage_type": "call" }, { "api_name": "kivy.lang.builder.Builder", "line_number": 8, "usage_type": "name" }, { "api_name": "kivy.uix.modalview.ModalView", "line_number": 11, "usage_type": "name" }, ...
1449286232
import scrapy from scrapy_playwright.page import PageCoroutine class JoshSpider(scrapy.Spider): name = 'josh' def start_requests(self): yield scrapy.Request('https://shop.mango.com/gb/women/skirts-midi/midi-satin-skirt_17042020.html?c=99', meta=dict( ...
NickKarakov/Edited_project
edited/edited/spiders/josh.py
josh.py
py
1,104
python
en
code
0
github-code
21
[ { "api_name": "scrapy.Spider", "line_number": 5, "usage_type": "attribute" }, { "api_name": "scrapy.Request", "line_number": 9, "usage_type": "call" }, { "api_name": "scrapy_playwright.page.PageCoroutine", "line_number": 14, "usage_type": "call" } ]
73036805493
import numpy as np import theano from theano.tests import unittest_tools as utt from pymc3.math import LogDet, logdet from .helpers import SeededTest class TestLogDet(SeededTest): def setUp(self): utt.seed_rng() self.op_class = LogDet self.op = logdet def validate(self, input_mat): ...
LiuFang816/SALSTM_py_data
python/pymc-devs_pymc3/pymc3-master/pymc3/tests/test_math.py
test_math.py
py
1,037
python
en
code
9
github-code
21
[ { "api_name": "helpers.SeededTest", "line_number": 7, "usage_type": "name" }, { "api_name": "theano.tests.unittest_tools.seed_rng", "line_number": 10, "usage_type": "call" }, { "api_name": "theano.tests.unittest_tools", "line_number": 10, "usage_type": "name" }, { ...
33495014210
import re from psycopg2.policies import ClusterAwareLoadBalancer,TopologyAwareLoadBalancer class LoadBalanceProperties: CONNECTION_MANAGER_MAP = {} placements = '' SIMPLE_LB = 'simple' refreshInterval = -1 failed_host_ttl_seconds = -1 def __init__(self, dsn, **kwargs): self.SIMPLE_LB =...
yugabyte/psycopg2
lib/loadbalanceproperties.py
loadbalanceproperties.py
py
4,656
python
en
code
null
github-code
21
[ { "api_name": "re.compile", "line_number": 29, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 42, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 51, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 60, ...
43253677852
# Import required libraries import speech_recognition as sr import os import time import openai import boto3 from dotenv import load_dotenv from playsound import playsound load_dotenv() # Configure OpenAI API key and model engine openai.api_key = os.environ.get('OPENAI_API_KEY') # Initialize AWS Polly client polly_c...
IkuStudies/Genie_GPT
junggpt.py
junggpt.py
py
3,019
python
en
code
0
github-code
21
[ { "api_name": "dotenv.load_dotenv", "line_number": 10, "usage_type": "call" }, { "api_name": "openai.api_key", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.environ.get", "line_number": 13, "usage_type": "call" }, { "api_name": "os.environ", ...