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
7751695337
import torch def total_loss(model, loss_fn, dataset): loader = torch.utils.data.DataLoader(dataset, batch_size=64, shuffle=False, num_workers=2) total_loss = 0 for inputs, labels in loader: outputs = model(inputs.cuda()) total_loss += loss_fn(outputs, labels.cuda()).item() return total...
sAbhay/DP-SGD
fine_tune/pytorch/src/training/image_classification/evaluation.py
evaluation.py
py
681
python
en
code
1
github-code
18
[ { "api_name": "torch.utils.data.DataLoader", "line_number": 5, "usage_type": "call" }, { "api_name": "torch.utils", "line_number": 5, "usage_type": "attribute" }, { "api_name": "torch.utils.data.DataLoader", "line_number": 14, "usage_type": "call" }, { "api_name":...
26957337794
import numpy as np import networkx as nx import torch from scipy.linalg import fractional_matrix_power, inv import scipy.sparse as sp import random import yaml import logging def load_best_configs(args, path): with open(path, "r") as f: configs = yaml.load(f, yaml.FullLoader) if args.dataset not in co...
XinPeng97/TNNLS_DCLN
utils.py
utils.py
py
5,658
python
en
code
2
github-code
18
[ { "api_name": "yaml.load", "line_number": 12, "usage_type": "call" }, { "api_name": "yaml.FullLoader", "line_number": 12, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 30, "usage_type": "call" }, { "api_name": "argparse.Argum...
29531344992
from os import listdir from os.path import isfile, join, splitext import json import gambar import ocr def main(): features = [] for type in ['number', 'upper', 'lower']: bw = gambar.to_bw(gambar.to_gray(gambar.read('ocr_train_{}.PNG'.format(type)))) features.extend([array.tolist() for array i...
sumartoyo/IF5181-UAS
py/ocr_train.py
ocr_train.py
py
863
python
en
code
0
github-code
18
[ { "api_name": "gambar.to_bw", "line_number": 11, "usage_type": "call" }, { "api_name": "gambar.to_gray", "line_number": 11, "usage_type": "call" }, { "api_name": "gambar.read", "line_number": 11, "usage_type": "call" }, { "api_name": "ocr.get_features", "line_...
556066483
import csv from django.contrib.auth.models import Group, User from django.core.management.base import BaseCommand from dfirtrack_main.management.commands._check_file import check_file class Command(BaseCommand): '''add users from file to group.''' # command help message help = 'Add users from file to g...
dfirtrack/dfirtrack
dfirtrack_main/management/commands/add_users_to_group.py
add_users_to_group.py
py
4,234
python
en
code
451
github-code
18
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 9, "usage_type": "name" }, { "api_name": "dfirtrack_main.management.commands._check_file.check_file", "line_number": 85, "usage_type": "call" }, { "api_name": "django.contrib.auth.models.Group.objects.get", ...
29540719550
import os import shutil import subprocess from pathlib import Path import pandas as pd def run_all(dir): for seed_folder in os.listdir(dir): print("Handling ", seed_folder) model_path, config_path = "", "" files = os.listdir(os.path.join(dir, seed_folder)) for file in files: ...
ArabelaTso/DeepFD
CodeBook/Utils/FileHandler.py
FileHandler.py
py
2,491
python
en
code
10
github-code
18
[ { "api_name": "os.listdir", "line_number": 8, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, ...
9272096785
from flask import Flask, render_template, session, redirect, request, flash from flask_app import app from flask_app.models.user import User from flask_app.models.task import Task from flask_app.models.project import Project # variablized route files dashboard = 'projects.html' project_detail_page = 'group_project...
fujohn/project_management
project_management_flask/flask_app/controllers/projects.py
projects.py
py
3,370
python
en
code
1
github-code
18
[ { "api_name": "flask.session", "line_number": 19, "usage_type": "name" }, { "api_name": "flask.flash", "line_number": 20, "usage_type": "call" }, { "api_name": "flask.redirect", "line_number": 21, "usage_type": "call" }, { "api_name": "flask.session", "line_nu...
9769195263
import cloudscraper from datetime import datetime import time,random from lxml import etree from concurrent.futures import ThreadPoolExecutor,as_completed,wait, FIRST_COMPLETED, ALL_COMPLETED import threading import time import sys import os import django pwd = os.path.dirname(os.path.realpath(__file__)) # 获取项目名的目录(因...
iii706/examazon
spider/get_words_info.py
get_words_info.py
py
6,435
python
en
code
1
github-code
18
[ { "api_name": "os.path.dirname", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 13, "usage_type": "call" }, { "api_name": "sys.path.append", "...
72150322921
# -*- coding: utf-8 -*- import pymysql, os import shutil,os db = pymysql.connect("localhost", "root", "123456", "testdb", charset="utf8") cursor = db.cursor() idalls = open("C:/Users/Administrator/Desktop/ids.txt", encoding='utf8').readlines() def selectINFObyID(productID): path = '' number = 0 #sq...
lifesaver0129/Basic-DL
SKlearn/TFIDF.py
TFIDF.py
py
1,090
python
en
code
0
github-code
18
[ { "api_name": "pymysql.connect", "line_number": 6, "usage_type": "call" } ]
31508263650
# 2020-03-04 Lyon # MNIST数据集:http://yann.lecun.com/exdb/mnist/ from PIL import Image,ImageOps import struct import tensorflow as tf from tensorflow import keras import matplotlib.pyplot as plt import os import random import numpy as np from network import LeNet for gpu in tf.config.experimental.list_physical_devices(...
Flowingsun007/DeepLearningTutorial
ImageClassification/train_lenet.py
train_lenet.py
py
6,555
python
en
code
122
github-code
18
[ { "api_name": "tensorflow.config.experimental.list_physical_devices", "line_number": 14, "usage_type": "call" }, { "api_name": "tensorflow.config", "line_number": 14, "usage_type": "attribute" }, { "api_name": "tensorflow.config.experimental.set_memory_growth", "line_number":...
41809524500
#!/usr/bin/env python # -*- coding: utf-8 -*- """ The Alkemy app model is designed to help keep track of the game data. Default language ---------------- As Alkemy is a french edited game with most of its audience in France, the default language is set to french and so are the labels. update...
dad3zero/BiG-Alkemy-django
Alkemy/models.py
models.py
py
5,917
python
en
code
0
github-code
18
[ { "api_name": "django.db.models.Model", "line_number": 27, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 27, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 57, "usage_type": "call" }, { "api_name"...
14046072163
import csv import itertools as i from pprint import pprint import json from io import StringIO def parse(): with open("./citations.csv", 'rb') as f: txt = f.read() buf = StringIO(txt.decode('utf-8', errors='ignore')) reader = csv.reader(buf) next(reader) for line in reader:...
kenpu/kenpu.ca
compile-pubs.py
compile-pubs.py
py
1,452
python
en
code
0
github-code
18
[ { "api_name": "io.StringIO", "line_number": 10, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 12, "usage_type": "call" }, { "api_name": "itertools.groupby", "line_number": 40, "usage_type": "call" }, { "api_name": "itertools.groupby", "lin...
18713601283
import multiprocessing import numpy as np from multi_mesh.components.interpolator import inverse_transform from multi_mesh.components.interpolator import get_coefficients from pykdtree.kdtree import KDTree from tqdm import tqdm def map_to_ellipse(base_mesh, mesh): """Takes a base mesh with ellipticity topography ...
solvithrastar/MultiMesh
multi_mesh/components/v2_interpolation_tools.py
v2_interpolation_tools.py
py
8,578
python
en
code
4
github-code
18
[ { "api_name": "numpy.sqrt", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.copy", "line_number": 25,...
31328999192
#!/usr/bin/env python import fileinput from collections import Counter from collections import defaultdict N = ['abcefg', 'cf', 'acdeg', 'acdfg', 'bcdf', 'abdfg', 'abdefg', 'acf', 'abcdefg', 'abcdfg'] # socres W = list() T = 0 def check_freq(input, wires): # use letter frequence to find wires freqs = def...
schans/aoc2021
08/displays.py
displays.py
py
2,184
python
en
code
1
github-code
18
[ { "api_name": "collections.defaultdict", "line_number": 18, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 20, "usage_type": "call" }, { "api_name": "fileinput.input", "line_number": 89, "usage_type": "call" } ]
21102972434
import unittest import numpy as np import torch from onnx import TensorProto, helper from torch import nn np.random.seed(0) torch.manual_seed(0) torch.set_printoptions(threshold=10000) def create_neox_attention_graph( batch_size, seq_len, hidden_size, qkv_weight, qkv_bias, num_heads, ): ...
microsoft/onnxruntime
onnxruntime/test/python/transformers/test_parity_neox_attention.py
test_parity_neox_attention.py
py
18,724
python
en
code
9,700
github-code
18
[ { "api_name": "numpy.random.seed", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.manual_seed", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.set_printopt...
15317075548
import sys from collections import deque from collections import defaultdict n, m, v = map(int,sys.stdin.readline().split()) # 인접 행렬을 이용한 BFS arr = [[0] * (n+1) for _ in range(n+1)] # 인접 리스트를 이용한 BFS al = defaultdict(list) check = [False] * (n+1) for _ in range(m): i, j = map(int, sys.stdin.readline().split()) ...
cldud400/python-coding-test
문제풀이/1260-1.py
1260-1.py
py
1,200
python
ko
code
0
github-code
18
[ { "api_name": "sys.stdin.readline", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 4, "usage_type": "attribute" }, { "api_name": "collections.defaultdict", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.stdin.rea...
9937726621
import argparse import time import collections import os import sys import torch import torch.nn from torch.autograd import Variable import torch.nn as nn import numpy np = numpy import matplotlib.pyplot as plt from models import RNN, GRU from models import make_model as TRANSFORMER #################################...
swechhasingh/deep-learning-coursework
hw2_seq_language_models/generate.py
generate.py
py
6,319
python
en
code
0
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.manual_seed", "line_number": 55, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 58, "usage_type": "call" }, { "api_name": "tor...
15302517194
#--------------------- Packages import numpy as np import pandas as pd import psycopg2 import re # --------------------- Pandas Dataframe """ Script to load in the csv, preprocess the data and create a new feature called the total contents to be used as an input for text mining""" ## Read in CSV DATABASE_URL = 'postg...
SulmanK/Video-Game-Recommendation-Engine
App_Deployment/model/preprocessing.py
preprocessing.py
py
2,500
python
en
code
2
github-code
18
[ { "api_name": "psycopg2.connect", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.read_sql", "line_number": 13, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 55, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 5...
16922012865
from collections import deque import random import torch import torch.nn as nn import numpy as np from poke_env.player.player import Player, BattleOrder from poke_env.player.battle_order import ForfeitBattleOrder from utils import player_action_to_move class ReplayMemory(object): def __init__(self, capacity): ...
jchen20/OpenAI-Gym-Leaders
dqn_agent.py
dqn_agent.py
py
5,037
python
en
code
0
github-code
18
[ { "api_name": "collections.deque", "line_number": 15, "usage_type": "call" }, { "api_name": "random.sample", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.nn.Module", "line_number": 30, "usage_type": "attribute" }, { "api_name": "torch.nn", "...
449359470
''' from function.asset import misc reload(misc) ''' #... Reload module from function.framework.reloadWrapper import reloadWrapper as reload from function.pipeline import logger reload(logger) import maya.cmds as mc #... Instance logger module class MiscLogger(logger.MayaLogger): LOGGER_NAME = "asset.misc" def ...
narongtum/nmTools
riggerTools/python/function/asset/misc.py
misc.py
py
578
python
en
code
1
github-code
18
[ { "api_name": "function.framework.reloadWrapper.reloadWrapper", "line_number": 10, "usage_type": "call" }, { "api_name": "function.pipeline.logger", "line_number": 10, "usage_type": "argument" }, { "api_name": "function.pipeline.logger.MayaLogger", "line_number": 15, "usa...
5243902579
from django.http import Http404, HttpResponseRedirect from django.utils.translation import gettext as _ from django.shortcuts import get_object_or_404 from channelguide.channels.models import Channel from channelguide.flags.models import Flag def flag(request, id): if 'flag' not in request.REQUEST: raise ...
kmshi/miroguide
channelguide/flags/views.py
views.py
py
1,177
python
en
code
1
github-code
18
[ { "api_name": "django.http.Http404", "line_number": 10, "usage_type": "name" }, { "api_name": "django.http.Http404", "line_number": 14, "usage_type": "name" }, { "api_name": "django.utils.translation.gettext", "line_number": 16, "usage_type": "call" }, { "api_name...
72870269481
from django.urls import path from django.views.generic import ListView,UpdateView,DeleteView,DetailView,CreateView from .views import BillAddView, BillCreateView, BillDeleteView, BillDetailView, BillListView, CustomerCreateView, CustomerDeleteView, CustomerDetailView, CustomerEditView,CustomerListView, DistributorCreat...
Harshelite2503/Coffee-Shop-Final
app/urls.py
urls.py
py
2,982
python
en
code
0
github-code
18
[ { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "api_name": "views.HomePageView.as_view", "line_number": 5, "usage_type": "call" }, { "api_name": "views.HomePageView", "line_number": 5, "usage_type": "name" }, { "api_name": "django.ur...
4261517177
import tornado.ioloop import tornado.web from proportion_calculator import api_get_tags, api_get_merged_tags class TagsHandler(tornado.web.RequestHandler): def get(self, term): self.content_type = 'application/json' tags = api_get_tags(term) self.write(tags) class SuggestHandler(tornado.w...
flavioribeiro/video-tags-suggestion
server.py
server.py
py
912
python
en
code
1
github-code
18
[ { "api_name": "tornado.ioloop.web", "line_number": 6, "usage_type": "attribute" }, { "api_name": "tornado.ioloop", "line_number": 6, "usage_type": "name" }, { "api_name": "proportion_calculator.api_get_tags", "line_number": 9, "usage_type": "call" }, { "api_name":...
25914734141
import json import numpy as np import torch import torch.nn as nn import time import math import collections use_frequency = True def sigmoid(x): return 1 / (1 + math.exp(-x)) #with open('shuffled_class_dict.json', 'r') as f1: with open('culled_class_dict_bitcost_compar.json', 'r') as f1: class_dict = json.loa...
stanleythepug/Predicting-Amuzgo-inflectional-tone-patterns
learn_weights_and_activationsGSCweight_whole_blend_embed_pns.py
learn_weights_and_activationsGSCweight_whole_blend_embed_pns.py
py
11,506
python
en
code
0
github-code
18
[ { "api_name": "math.exp", "line_number": 12, "usage_type": "call" }, { "api_name": "json.load", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.set_printoptions", "line_number": 25, "usage_type": "call" }, { "api_name": "collections.defaultdict", ...
1074795229
# Programmers 깊이/너비 우선 탐색(DFS/BFS) 3. 게임 맵 최단거리 # 시간복잡도: O(N) from collections import deque def solution(maps): n, m = len(maps), len(maps[0]) if maps[n-2][-1] == 0 and maps[-1][m-2] == 0: return -1 dx = [1, -1, 0, 0] dy = [0, 0, 1, -1] graph = [[-1] * m for _ in range(n)] queue ...
JiSuMun/Algorithm-Study
W11/KimGyuri/1844_게임맵.py
1844_게임맵.py
py
1,294
python
ko
code
3
github-code
18
[ { "api_name": "collections.deque", "line_number": 15, "usage_type": "call" } ]
31607051215
# -*- coding: utf-8 -*- """ @author: gy19cp Student ID: 201376715 University of Leeds ___________________ Assessment 2 Version 3 ___________________ agentframework2.py file is run before the model2.py file. """ # Libraries imported: import matplotlib import matplotlib.pyplot import agen...
gy19cp/GEOG5990Assessment2
Version_3/model2.py
model2.py
py
3,510
python
en
code
0
github-code
18
[ { "api_name": "csv.reader", "line_number": 33, "usage_type": "call" }, { "api_name": "csv.QUOTE_NONNUMERIC", "line_number": 33, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 36, "usage_type": "call" }, { "api_name": "matplot...
17805347072
from selenium import webdriver as opcoesSelenium from selenium.webdriver.common.by import By import pyautogui import pandas as pd navegador = opcoesSelenium.Chrome() #Abrindo site navegador.get('https://rpachallengeocr.azurewebsites.net/') listaDataFrame = [] linha = 1 i = 1 while i < 4: elemento...
babicosta/ExtraindoDadosSite
ExtraindoDadosTabelaSite.py
ExtraindoDadosTabelaSite.py
py
1,226
python
pt
code
0
github-code
18
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 6, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 6, "usage_type": "name" }, { "api_name": "selenium.webdriver.common.by.By.XPATH", "line_number": 16, "usage_type": "attribute" }, { ...
69845846761
import io import os from time import strftime import pandas as pd from datetime import datetime from django.conf import settings from django.db.models import Count, DateField, DateTimeField from django.db.models.functions import Cast, TruncDate from django.shortcuts import render, redirect, get_object_or_404 from dja...
nkrings-nettersheim/turnverein
turnfest/views.py
views.py
py
37,206
python
de
code
0
github-code
18
[ { "api_name": "django.shortcuts.render", "line_number": 50, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 54, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 58, "usage_type": "call" }, { "api_name"...
39656343594
import cv2 img = cv2.imread("galaxy.jpg", 0) #pass 1 to read in colour #pass 0 to read in grayscale #-1 to read in colour with alpha channel (transparency operations) print(type(img)) #image stores as a numpy array - matrix of numbers print(img) print(img.shape) #resolution of the image print(img.ndim) #number of dim...
rahulj1601/Python
Image Processing/Loading, Displaying, Reisizing, Writing Images.py
Loading, Displaying, Reisizing, Writing Images.py
py
1,146
python
en
code
0
github-code
18
[ { "api_name": "cv2.imread", "line_number": 3, "usage_type": "call" }, { "api_name": "cv2.resize", "line_number": 20, "usage_type": "call" }, { "api_name": "cv2.resize", "line_number": 21, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 23, ...
3968976991
import pdb import graphs import torch import utils import os from pathlib import Path import pandas as pd import numpy as np import matplotlib.pyplot as plt import math import functools import nibabel as nib from sklearn.decomposition import PCA from sklearn.manifold import TSNE import seaborn as sns from scipy.stats i...
chrisjmyoon/loca
agents/eval_plot.py
eval_plot.py
py
16,212
python
en
code
0
github-code
18
[ { "api_name": "os.path.expanduser", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path", "line_number": 29, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 30, "usage_type": "call" }, { "api_name": "os.path", "line_numb...
22893151125
from __future__ import print_function import datetime from airflow import DAG from airflow.models import Variable from airflow.operators.dummy_operator import DummyOperator from airflow.operators.bash_operator import BashOperator import pendulum default_args = { ### Defau...
sdespotis/Master-Projects
Architectures/airflow/p2822111-t1 (1).py
p2822111-t1 (1).py
py
2,936
python
en
code
0
github-code
18
[ { "api_name": "datetime.datetime", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 12, "usage_type": "call" }, { "api_name": "airflow.DAG", "line_number": 15, "usage_type": "call" }, { "api_name": "pendulum.datetime", ...
12094565840
from django import forms from django.forms import extras from django.core.exceptions import ValidationError class StatsForm(forms.Form): timeframe = forms.ChoiceField( choices = [ ["timeframe_day", "Heute"], ["timeframe_mon", "Diesen Monat"], ["timeframe_yrs", "Dieses Jahr"], ["timefra...
martinmeinke/rlog
charts/forms.py
forms.py
py
1,545
python
en
code
6
github-code
18
[ { "api_name": "django.forms.Form", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 5, "usage_type": "name" }, { "api_name": "django.forms.ChoiceField", "line_number": 6, "usage_type": "call" }, { "api_name": "django.form...
32937931303
import asyncio import unittest import pymysql from heralding.capabilities import mysql from heralding.misc.common import cancel_all_pending_tasks from heralding.reporting.reporting_relay import ReportingRelay class MySQLTests(unittest.TestCase): def setUp(self): self.loop = asyncio.new_event_loop() asynci...
johnnykv/heralding
heralding/tests/test_mysql.py
test_mysql.py
py
1,888
python
en
code
358
github-code
18
[ { "api_name": "unittest.TestCase", "line_number": 10, "usage_type": "attribute" }, { "api_name": "asyncio.new_event_loop", "line_number": 13, "usage_type": "call" }, { "api_name": "asyncio.set_event_loop", "line_number": 14, "usage_type": "call" }, { "api_name": "...
9977323253
""" 驱动对象获取方法 """ import time from appium import webdriver def get_driver(): """获取驱动对象方法""" # 获取驱动对象 capabilities = { "platformName": "Android", # 测试平台(Android、iOS) "platformVersion": "5.1.1", # 测试系统版本 "deviceName": "f100", # 测试设备名称 # "platformVersion": "6...
bm12138/enfu
utils.py
utils.py
py
1,141
python
en
code
0
github-code
18
[ { "api_name": "appium.webdriver.Remote", "line_number": 27, "usage_type": "call" }, { "api_name": "appium.webdriver", "line_number": 27, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 36, "usage_type": "call" } ]
27696164948
######################################################################### ## Project: ICON Vote Stagnancy Investigation ## ## Date: July 2020 ## ## Author: Tono / Sung Wook Chung (Transcranial Solutions) ## ## transcranial.solution...
Transcranial-Solutions/ICONProject
data_analysis/04_vote_stagnancy/06_count_voting_activity.py
06_count_voting_activity.py
py
4,232
python
en
code
6
github-code
18
[ { "api_name": "pandas.set_option", "line_number": 26, "usage_type": "call" }, { "api_name": "pandas.set_option", "line_number": 27, "usage_type": "call" }, { "api_name": "seaborn.set", "line_number": 40, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.sty...
22803375134
import os from typing import List, Tuple from PIL import Image from torch.utils.data import Dataset, DataLoader from torchvision import transforms as T from torch import Tensor from argparse import Namespace from UPD_study.utilities.utils import GenericDataloader from glob import glob from multiprocessing import Pool, ...
iolag/UPD_study
UPD_study/models/CutPaste/datasets/RF.py
RF.py
py
3,279
python
en
code
18
github-code
18
[ { "api_name": "argparse.Namespace", "line_number": 15, "usage_type": "name" }, { "api_name": "glob.glob", "line_number": 30, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 30, "usage_type": "call" }, { "api_name": "os.path", "line_number"...
5727015822
from setuptools import setup import codecs import os def read_readme(): here = os.path.abspath(os.path.dirname(__file__)) with codecs.open(os.path.join(here, 'README.rst'), encoding='utf-8') as f: long_description = f.read() return long_description setup( # Basic information name='bios...
WilliamTG/biosim-g07-engesaeth-grenersen
setup.py
setup.py
py
920
python
en
code
0
github-code
18
[ { "api_name": "os.path.abspath", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 6, "usage_type": "call" }, { "api_name": "codecs.open", "line_num...
12117901513
#!/usr/bin/env python """ Isolated roll mechanism for moving robot's wrists """ import robot import copy import constants RH_rolling = False LH_rolling = False def roll (roll_limb): global LH_initial_angle global RH_initial_angle if roll_limb == 'left': limb = robot.left_limb mode = r...
Sean-Skilling/baxter-project
src/baxter_subscriber/robot_wrists.py
robot_wrists.py
py
1,724
python
en
code
0
github-code
18
[ { "api_name": "robot.left_limb", "line_number": 21, "usage_type": "attribute" }, { "api_name": "robot.LH_roll_mode", "line_number": 22, "usage_type": "attribute" }, { "api_name": "robot.right_limb", "line_number": 26, "usage_type": "attribute" }, { "api_name": "ro...
4703382052
import os import argparse import numpy as np import torch import torch.nn as nn import torch.optim as optim from torch.utils.data import DataLoader, Dataset from sklearn.metrics import log_loss from sklearn.model_selection import train_test_split import pickle class AudioDataset(Dataset): def __init__(self, feat_...
lsy0882/Audio_classification_using_SoundNet
train_mlp.py
train_mlp.py
py
7,960
python
en
code
0
github-code
18
[ { "api_name": "torch.utils.data.Dataset", "line_number": 13, "usage_type": "name" }, { "api_name": "torch.tensor", "line_number": 25, "usage_type": "call" }, { "api_name": "torch.float", "line_number": 25, "usage_type": "attribute" }, { "api_name": "torch.tensor",...
39044855388
#!/usr/bin/env python from __future__ import print_function import argparse import torch import torch.nn.functional as F from torch.nn import Parameter from nn.conv import EdgeSAGEConv class EdgePropSAGETwoSoftmax(torch.jit.ScriptModule): def __init__(self, in_dim, hidden, out_dim, edge_dim, task_type, ...
Angel-ML/PyTorch-On-Angel
python/graph/edgeprop.py
edgeprop.py
py
5,298
python
en
code
162
github-code
18
[ { "api_name": "torch.jit", "line_number": 12, "usage_type": "attribute" }, { "api_name": "torch.nn.BCELoss", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 18, "usage_type": "attribute" }, { "api_name": "torch.tensor", "lin...
16435190116
from argparse import ArgumentParser from email.policy import default from StorageHandler import StorageHandler from DatasetHandler import DatasetHandler import nltk import os def buildParser(): parser=ArgumentParser() parser.add_argument("-fred-api-file",dest="fred_api_file", type=str, default="") parser...
Frankgamer97/ValuesFromText
src/app.py
app.py
py
3,773
python
en
code
0
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "StorageHandler.StorageHandler.load_api", "line_number": 56, "usage_type": "call" }, { "api_name": "StorageHandler.StorageHandler", "line_number": 56, "usage_type": "name" ...
36603865923
from django.shortcuts import render from django.views.generic.base import View import json from .models import * from Data2.models import * from django.shortcuts import redirect from Config.models import * from django.urls import reverse try: from apps.Utils.script.new_step1 import * except: from apps.Utils.py...
Escaflowne1985/NovelAIUser
apps/Data/views.py
views.py
py
10,575
python
en
code
43
github-code
18
[ { "api_name": "django.shortcuts.render", "line_number": 61, "usage_type": "call" }, { "api_name": "django.views.generic.base.View", "line_number": 65, "usage_type": "name" }, { "api_name": "django.shortcuts.render", "line_number": 70, "usage_type": "call" }, { "ap...
35112672658
import pymysql, requests from bs4 import BeautifulSoup from Model import top250 class ImdbScrapper: def __init__(self): self.movies = [] # list obiektow klasy modelu -> top250 # self.obiekt -> zakres widoczności obejmuje całą klasę ImdbScrapper def getTop250(self): try: ...
paulamatosek/webscrapping
Main.py
Main.py
py
4,025
python
en
code
1
github-code
18
[ { "api_name": "requests.get", "line_number": 17, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 24, "usage_type": "call" }, { "api_name": "Model.top250", "line_number": 40, "usage_type": "call" }, { "api_name": "requests.get", "line_...
40568772590
import cv2 import time from cvzone.SelfiSegmentationModule import SelfiSegmentation import cvzone import pyfakewebcam from os import listdir from os.path import isfile, join onlyfiles = [f for f in listdir("images/") if isfile(join("images/", f))] # Capture the image and set the size cap = cv2.VideoCapture(0) cap.set(...
eren23/cvzone-bgremover
main.py
main.py
py
1,838
python
en
code
0
github-code
18
[ { "api_name": "os.listdir", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_numb...
21947971276
import logging logging.getLogger("scapy.runtime").setLevel(logging.ERROR) import time import scapy.all as scapy import argparse import sys import multiprocessing as mp import subprocess # import pyfiglet # # ascii_banner = pyfiglet.figlet_format("Network Hacker", font="banner3-D") # print(ascii_banner) def get_argu...
NomanNasirMinhas/Network-Controller
arp_spoofer.py
arp_spoofer.py
py
6,991
python
en
code
1
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 3, "usage_type": "call" }, { "api_name": "logging.ERROR", "line_number": 3, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 18, "usage_type": "call" }, { "api_name": "scapy.all....
23981856063
import datetime import hashlib import json import random import pytest, tarantool from apiscoring import api from apiscoring.store import Store pytest.store = Store('api_store') pytest.context = {} pytest.headers = {} class Mock: """Mocking class for get_interest internal call of store.get(cid)""" @staticm...
jBuly4/OTUS_projects
month_2/04_Testing/api_testing/tests/integrated_tests/test_api.py
test_api.py
py
8,911
python
en
code
0
github-code
18
[ { "api_name": "pytest.store", "line_number": 11, "usage_type": "attribute" }, { "api_name": "apiscoring.store.Store", "line_number": 11, "usage_type": "call" }, { "api_name": "pytest.context", "line_number": 12, "usage_type": "attribute" }, { "api_name": "pytest.h...
21714984926
from django.conf.urls import url from . import views from django.contrib.sitemaps.views import sitemap from bloggit.sitemaps import PostSiteMap sitemaps = { 'posts' : PostSiteMap, } urlpatterns = [ url(r'^(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/'\ r'(?P<post>[-\w]+)/$', views.post_deta...
amanfojnr/codephil
bloggit/urls.py
urls.py
py
550
python
en
code
1
github-code
18
[ { "api_name": "bloggit.sitemaps.PostSiteMap", "line_number": 7, "usage_type": "name" }, { "api_name": "django.conf.urls.url", "line_number": 11, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 14, "usage_type": "call" }, { "api_name": ...
43155231799
from sklearn.metrics import classification_report from sklearn.metrics import confusion_matrix from sklearn.model_selection import train_test_split from sklearn.neighbors import KNeighborsClassifier from sklearn.preprocessing import StandardScaler from utils.transfer_data import get_2022_stats from utils.transfer_data...
rogersheu/All-NBA-Predictions
models/kNNmodeling.py
kNNmodeling.py
py
1,372
python
en
code
2
github-code
18
[ { "api_name": "sklearn.model_selection.train_test_split", "line_number": 12, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.StandardScaler", "line_number": 16, "usage_type": "call" }, { "api_name": "sklearn.neighbors.KNeighborsClassifier", "line_number": 22, ...
30077043677
from ctypes import c_ushort import requests # import requests_cache from bs4 import BeautifulSoup from time import time import json import random # requests_cache.install_cache(expire_after=18000, allowable_methods=('GET', 'POST')) # Reading company urls with open('random_5000_urls.jsonl','r') as f: lines = f.r...
hiteshshekhat/indeed-scraper
indeed_company_scraper.py
indeed_company_scraper.py
py
3,001
python
en
code
0
github-code
18
[ { "api_name": "json.loads", "line_number": 17, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 28, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 31, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_...
36103162938
# -*- coding: utf-8 -*- """ Created on Wed Feb 8 15:32:58 2017 @author: luzhangqin """ import matplotlib.pyplot as plt from matplotlib.font_manager import FontProperties #linux shell: fc-list :lang=zh font = FontProperties(fname=r'/usr/share/fonts/truetype/arphic/ukai.ttc', size = 10) import numpy as np plt.figure()...
TonyLDS/sklearn
4-1.py
4-1.py
py
459
python
en
code
0
github-code
18
[ { "api_name": "matplotlib.font_manager.FontProperties", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 13, "usage_type": "name" }, { ...
10002380678
from datetime import datetime import json import uuid from sqlalchemy.ext.declarative import DeclarativeMeta from flask.json import JSONEncoder #ALLOWED_EXTENSIONS = {'pdf'} def allowed_file(filename, allowed_ext={'pdf'}): return '.' in filename and \ filename.rsplit('.', 1)[1].lower() in allowed_ext ...
apj-lml/201-File-System
website/myhelper.py
myhelper.py
py
2,550
python
en
code
0
github-code
18
[ { "api_name": "uuid.uuid4", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 23, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 23, "usage_type": "name" }, { "api_name": "json.loads", ...
27666661111
from selenium import webdriver import subprocess import time,csv from datetime import datetime import json import shutil,os import requests def read_config_file(path): f = open(path) data_dic = json.load(f) return data_dic data = read_config_file('/root/dynamic_analysis_framework/config_e...
raja08blr/Transaction_protection_Automation
common_functions_library.py
common_functions_library.py
py
3,494
python
en
code
0
github-code
18
[ { "api_name": "json.load", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 31, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 34, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 36,...
4086427692
""" camera.py --------------- Functions related to data acquisition with cameras. """ import numpy as np import math import os import pandas as pd import pybullet as p def convert_depth_frame_to_pointcloud(depth_image, serialnumber, camera_intrinsics): """ Convert the depthmap to a 3D point cloud Paramet...
susu1210/3d_object_reconstruction
utils/camera.py
camera.py
py
3,337
python
en
code
1
github-code
18
[ { "api_name": "numpy.linspace", "line_number": 38, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 39, "usage_type": "call" }, { "api_name": "numpy.meshgrid", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.multiply", "li...
534290936
''' Different manufactured testprolbmes problems solving :math:`-\Delta u_a = f` on the unit interval ''' from fenics import * import sympy as sym def power_function(alpha = 0.51, plot_sol = False): ''' Babushka example: :math:`u=x^{\\alpha}` with :math:`0.5 < \\alpha < 1.5` Args: alpha (float...
IngeborgGjerde/GFEM
src/testproblems.py
testproblems.py
py
5,167
python
en
code
0
github-code
18
[ { "api_name": "sympy.symbols", "line_number": 27, "usage_type": "call" }, { "api_name": "sympy.printing.ccode", "line_number": 39, "usage_type": "call" }, { "api_name": "sympy.printing", "line_number": 39, "usage_type": "attribute" }, { "api_name": "sympy.symbols"...
16730455445
# -*- coding: utf-8 -*- """ P1: Test a Perceptual Phenomenon Stroop data analysis and visualization in python 04/20/16 """ import pandas as pd import numpy as np import matplotlib.pyplot as plt from scipy import stats ########################################################################## ## 1. Read stroop dataset ...
super-penguin/Data_Projects
Test_Perceptual_Phenomenon/stroop.py
stroop.py
py
5,308
python
en
code
1
github-code
18
[ { "api_name": "pandas.read_csv", "line_number": 14, "usage_type": "call" }, { "api_name": "scipy.stats.ttest_rel", "line_number": 22, "usage_type": "call" }, { "api_name": "scipy.stats", "line_number": 22, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.f...
32660105416
#%% import torch as th import cv2 from utils import alive_conv, alive_pool, Buffer from models import Cell import numpy as np hidden_size = 13 color_size = 3 state_size = hidden_size + color_size downsampled_size = 64 device = th.device('cpu') img_shape = (1, 3, 64, 64) alive_thres = 0.1 #%% buffer = Buffer(256) cell...
tensorway/Neural-cellular-automata-and-Bitcoin
basic_eval.py
basic_eval.py
py
1,569
python
en
code
0
github-code
18
[ { "api_name": "torch.device", "line_number": 12, "usage_type": "call" }, { "api_name": "utils.Buffer", "line_number": 17, "usage_type": "call" }, { "api_name": "models.Cell", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.load", "line_number":...
9475458023
from typing import List from datetime import datetime, timedelta from databasepackage.data_base import DataBase import random import numpy as np from copy import deepcopy START_TIME = datetime.now() class InnerParticle: def __init__(self, index_array: List[int]): self.current_position = index_array ...
nadiczka/trip-around-krakow
algorithm/is_correct.py
is_correct.py
py
7,461
python
en
code
0
github-code
18
[ { "api_name": "datetime.datetime.now", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 8, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 12, "usage_type": "name" }, { "api_name": "random.shuffle", ...
34571939529
from flask import Flask, request, jsonify import vonage from web3 import Web3 app = Flask(__name__) # Initialize Vonage client = vonage.Client(key="b78ec810", secret="SkV66w8nnV1Wsi0v") sms = vonage.Sms(client) # Initialize Web3 w3 = Web3(Web3.HTTPProvider('https://sepolia.infura.io/v3/a99fc8833eb8497e84637ab7db564a...
dimoz29/sms_test_contract
app.py
app.py
py
894
python
en
code
1
github-code
18
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "vonage.Client", "line_number": 8, "usage_type": "call" }, { "api_name": "vonage.Sms", "line_number": 9, "usage_type": "call" }, { "api_name": "web3.Web3", "line_number": 12, ...
20994374269
# TODO: # - Allow windows to be read from a file. import copy import cProfile import gc import logging import pickle import pstats import time import warnings from concurrent.futures import ALL_COMPLETED, ThreadPoolExecutor from concurrent.futures import wait as cf_wait from functools import partial from itertools imp...
sukhdeep2/skylens_lite
skylens/window_utils.py
window_utils.py
py
31,850
python
en
code
0
github-code
18
[ { "api_name": "jax.numpy.int32", "line_number": 93, "usage_type": "call" }, { "api_name": "jax.numpy", "line_number": 93, "usage_type": "name" }, { "api_name": "jax.numpy.int32", "line_number": 95, "usage_type": "call" }, { "api_name": "jax.numpy", "line_numbe...
33842169428
from invoke import task from dotenv import load_dotenv from os import system load_dotenv() @task def registry_login(c): c.run("docker login -u $GITHUB_USER -p $GITHUB_TOKEN ghcr.io") # run for the first time only @task def install_vagrant_plugins(c): c.run("vagrant plugin install vagrant-env") @task def vag...
OleksandrTimoshenko/link_shortener
tasks.py
tasks.py
py
1,318
python
en
code
0
github-code
18
[ { "api_name": "dotenv.load_dotenv", "line_number": 5, "usage_type": "call" }, { "api_name": "invoke.task", "line_number": 7, "usage_type": "name" }, { "api_name": "invoke.task", "line_number": 12, "usage_type": "name" }, { "api_name": "os.system", "line_number...
8868932959
# Import Splinter and BeautifulSoup from splinter import Browser from bs4 import BeautifulSoup import pandas as pd import datetime as dt def scrape_all(): # Initiate headless driver for deployment browser = Browser("chrome", executable_path="chromedriver", headless=True) news_title, news_paragraph = mars_news...
menlodoug/Mission-to-Mars
scraping.py
scraping.py
py
5,145
python
en
code
0
github-code
18
[ { "api_name": "splinter.Browser", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 17, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 17, "usage_type": "attribute" }, { "api_name": "bs4.Beau...
70152544041
import tkinter as tk from tkinter import filedialog, messagebox from cryptography.fernet import Fernet import os class FaceLock: def __init__(self, root): self.root = root self.root.title("File Locking System") self.root.geometry("800x600") self.keys = {} # Dictionary to ...
RohitR-J/Nikhil_Project
t1.py
t1.py
py
3,463
python
en
code
0
github-code
18
[ { "api_name": "os.path.exists", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "cryptography.fernet.Fernet.generate_key", "line_number": 28, "usage_type": "call" }, { "api_name": "c...
28409733348
u'\n:\u521b\u5efa\u65f6\u95f4: 2020/5/18 23:57\n:\u4f5c\u8005: \u82cd\u4e4b\u5e7b\u7075\n:\u6211\u7684\u4e3b\u9875: https://cpcgskill.com\n:QQ: 2921251087\n:\u7231\u53d1\u7535: https://afdian.net/@Phantom_of_the_Cang\n:aboutcg: https://www.aboutcg.org/teacher/54335\n:bilibili: https://space.bilibili.com/351598127\n' i...
cpcgskill/Maya_tools
build/_44a6428a69494567aed2941f480fe31f/CPMel/ui/__init__.py
__init__.py
py
8,149
python
en
code
3
github-code
18
[ { "api_name": "api.OpenMayaUI.MQtUtil.mainWindow", "line_number": 22, "usage_type": "call" }, { "api_name": "api.OpenMayaUI.MQtUtil", "line_number": 22, "usage_type": "attribute" }, { "api_name": "api.OpenMayaUI", "line_number": 22, "usage_type": "name" }, { "api_...
40648985874
import bpy import numpy from bpy.props import (StringProperty, IntProperty, EnumProperty ) from bpy.types import ( Operator ) import imageProcessing from voxelize import pointsToVoxels from marching imp...
Beskamir/BlenderDepthMaps
src/depthMapsUI_Operator_Generate.py
depthMapsUI_Operator_Generate.py
py
2,936
python
en
code
3
github-code
18
[ { "api_name": "bpy.types.Operator", "line_number": 18, "usage_type": "name" }, { "api_name": "bpy.props.StringProperty", "line_number": 22, "usage_type": "call" }, { "api_name": "bpy.props.StringProperty", "line_number": 23, "usage_type": "call" }, { "api_name": "...
17648315629
import matplotlib.pyplot as plt import numpy as np x = 0.1 N=np.linspace(1,100,100) y = N*x*np.exp(-2*x*N) AT=x*N plt.plot(N, y) #plt.legend(loc="upper right") plt.title("Kihasználtság időszeletelt ALOHA esetén") plt.ylim(ymin=0) plt.xlim(xmin=1) plt.xlim(xmax=100) plt.xticks([10, 20, 30, 40, 50, 60, 70 ,80, 90, 100])...
Jelenszky/Zarovizsga
aloha_N.py
aloha_N.py
py
382
python
hu
code
0
github-code
18
[ { "api_name": "numpy.linspace", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", ...
73310066919
from faker import Faker from sqlmodel import SQLModel, Session, select from model import Tile, Team from db import engine SQLModel.metadata.create_all(engine) tiles = [ {"col": 0, "row": 0, "description": "See No Evil/Hear No Evil"}, {"col": 1, "row": 0, "description": "Telephone Booth"}, {"col": 2, "row"...
calvin-laurenson/ucdhunt
backend/api/bootstrap_db.py
bootstrap_db.py
py
2,370
python
en
code
0
github-code
18
[ { "api_name": "sqlmodel.SQLModel.metadata.create_all", "line_number": 6, "usage_type": "call" }, { "api_name": "db.engine", "line_number": 6, "usage_type": "argument" }, { "api_name": "sqlmodel.SQLModel.metadata", "line_number": 6, "usage_type": "attribute" }, { "...
19000476407
from datetime import timedelta import pandas as pd import pyspark.pandas as ps from pyspark.testing.pandasutils import PandasOnSparkTestCase, TestUtils class TimedeltaIndexTest(PandasOnSparkTestCase, TestUtils): @property def pidx(self): return pd.TimedeltaIndex( [ timede...
jackkolokasis/tera_applications
spark/spark-3.3.0/python/pyspark/pandas/tests/indexes/test_timedelta.py
test_timedelta.py
py
1,999
python
en
code
5
github-code
18
[ { "api_name": "pyspark.testing.pandasutils.PandasOnSparkTestCase", "line_number": 9, "usage_type": "name" }, { "api_name": "pyspark.testing.pandasutils.TestUtils", "line_number": 9, "usage_type": "name" }, { "api_name": "pandas.TimedeltaIndex", "line_number": 12, "usage_t...
18838097251
import base64 import serial import time from enum import Enum from typing import List, Tuple WRITE_COMMAND_SIZE = 19 READ_COMMAND_SIZE = 10 # Packet head, tail, and command id HEAD = b'\xaa' TAIL = b'\xab' SEND_COMMAND_BYTE = b'\xb4' # Data constants (will be decoded by bytes later) EMPTY_DATA_BYTE = b'00' ALL_DEVI...
davidshere/airquality
airquality-reading/sds011.py
sds011.py
py
7,425
python
en
code
0
github-code
18
[ { "api_name": "enum.Enum", "line_number": 22, "usage_type": "name" }, { "api_name": "enum.Enum", "line_number": 25, "usage_type": "name" }, { "api_name": "enum.Enum", "line_number": 28, "usage_type": "name" }, { "api_name": "enum.Enum", "line_number": 35, ...
24040619212
#!/usr/bin/python3 import os import sys import argparse import subprocess import shutil import glob import os.path def convert(f_input, f_output): print('#### CONVERT START ####') loglevel = f'-loglevel {args.loglevel}' if args.codec == 'libx264': hwaccel = '' hwoptions = '' option...
hasi6363/utils
m2ts_encoder.py
m2ts_encoder.py
py
5,329
python
en
code
0
github-code
18
[ { "api_name": "subprocess.run", "line_number": 50, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 55, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 55, "usage_type": "call" }, { "api_name": "os.path", "line_number": 55...
17864228482
#!/usr/bin/env python3 ''' PCA is data dependent, no use to calculate an index! You won't be able to easily recreate it SELF: how to? ''' # VERY IMPORTANT what have I done with NVC measurement? Should be included in the PCA import subprocess import pandas as pd import numpy as np import argparse import os import sea...
aperz/vacou
vacou.py
vacou.py
py
15,900
python
en
code
0
github-code
18
[ { "api_name": "rpy2.robjects.pandas2ri.activate", "line_number": 32, "usage_type": "call" }, { "api_name": "rpy2.robjects.pandas2ri", "line_number": 32, "usage_type": "name" }, { "api_name": "pandas.set_option", "line_number": 40, "usage_type": "call" }, { "api_na...
3625254264
import numpy as np import torch import random import numpy as np from .visualize import StatsLogger from .quantize_model import quantize def init_seeds(n): old_seed = (torch.seed(), np.random.get_state()) if isinstance(n,tuple): torch.manual_seed(n[0]) random.seed(n[0]) np.random.set_st...
thomasreolon/svs_detection
utils/__init__.py
__init__.py
py
882
python
en
code
0
github-code
18
[ { "api_name": "torch.seed", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.random.get_state", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.manual_seed", ...
1843933572
from odoo import fields, models, _ from odoo.exceptions import UserError from xlwt import * from io import BytesIO import base64 from datetime import date from dateutil.relativedelta import relativedelta class sale_order_subscription_report(models.TransientModel): _name = 'sale.order.subscription.report' _des...
albi-m/demo14
processcontrol_auditoria/models/sale_order_subscription_report.py
sale_order_subscription_report.py
py
11,390
python
en
code
0
github-code
18
[ { "api_name": "odoo.models.TransientModel", "line_number": 10, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 10, "usage_type": "name" }, { "api_name": "datetime.date.today", "line_number": 15, "usage_type": "call" }, { "api_name": "datet...
21580363870
import json import os import sys from collections import defaultdict import numpy as np import torch from PIL import Image from torch.utils.data import Dataset import cv2 import random from typing import List, Union from string import punctuation sys.path.append(f"{os.environ['HOME']}/AlexaArena/") from modeling.vl_m...
amazon-science/alexa-arena
modeling/vl_model/data_generators/vl_data_generator.py
vl_data_generator.py
py
20,753
python
en
code
75
github-code
18
[ { "api_name": "sys.path.append", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 15, "usage_type": "attribute" }, { "api_name": "modeling.vl_model.data_...
26547785122
import functools import hashlib # For hashing import json import pickle # binary JSON alternative # External packages # Python equivalent to axios in the front end app import requests # from utility is a folder. with the empty file __init__.py all the other # files are bundled. # so we can import 'from folderName.f...
chrisAlide3/pythonBlockchain
blockchain.py
blockchain.py
py
19,017
python
en
code
0
github-code
18
[ { "api_name": "block.Block", "line_number": 34, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 103, "usage_type": "call" }, { "api_name": "transaction.Transaction", "line_number": 108, "usage_type": "call" }, { "api_name": "block.Block", "l...
74338283239
"""Example authentication backend used by oauth login flow""" from typing import Any from django.contrib.auth.backends import BaseBackend from django.contrib.auth.base_user import AbstractBaseUser # pylint: disable=unused-import from django.contrib.auth import get_user_model from django.http.request import HttpRequest...
PHACDataHub/django-phac_aspc-helpers
phac_aspc/django/helpers/auth/backend.py
backend.py
py
1,441
python
en
code
0
github-code
18
[ { "api_name": "django.contrib.auth.backends.BaseBackend", "line_number": 9, "usage_type": "name" }, { "api_name": "django.http.request.HttpRequest", "line_number": 18, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 18, "usage_type": "name" }, { ...
35894569488
import datetime from PacketIdenficication import PacketIdentification from PacketSequenceControl import PacketSequenceControl from PacketPrimaryHeader import PacketPrimaryHeader from PacketSecondaryHeader import PacketSecondaryHeader from PacketDataField import PacketDataField from SpacePacket import SpacePacket class...
TUDSaT/Comms_Software
Space_Packet_Protocol/PacketAssembly.py
PacketAssembly.py
py
2,223
python
en
code
6
github-code
18
[ { "api_name": "PacketIdenficication.PacketIdentification", "line_number": 30, "usage_type": "call" }, { "api_name": "PacketSequenceControl.PacketSequenceControl", "line_number": 32, "usage_type": "call" }, { "api_name": "PacketPrimaryHeader.PacketPrimaryHeader", "line_number"...
42605116208
from random import shuffle import itertools from .parametermap import ParameterMap def combinations(parameters, N): """ Returns all combinations of parameters with *N* subdivisions. *N* may be of any form accepted by `core.getdividions` """ values = getdivisions(parameters, N) return itertools.product(...
njwilson23/psm
psm/core.py
core.py
py
2,345
python
en
code
0
github-code
18
[ { "api_name": "itertools.product", "line_number": 9, "usage_type": "call" }, { "api_name": "parametermap.ParameterMap", "line_number": 13, "usage_type": "call" }, { "api_name": "parametermap.ParameterMap", "line_number": 25, "usage_type": "call" }, { "api_name": "...
23795866773
from decimal import Decimal from typing import Any, Dict import pytest from pydantic import ValidationError from bo4e import Energieherkunft, Energiemix, Erzeugungsart, Oekolabel, Oekozertifikat, Sparte from tests.serialization_helper import assert_serialization_roundtrip example_energiemix = Energiemix( energie...
bo4e/BO4E-python
tests/test_energiemix.py
test_energiemix.py
py
3,849
python
de
code
10
github-code
18
[ { "api_name": "bo4e.Energiemix", "line_number": 10, "usage_type": "call" }, { "api_name": "bo4e.Sparte.STROM", "line_number": 12, "usage_type": "attribute" }, { "api_name": "bo4e.Sparte", "line_number": 12, "usage_type": "name" }, { "api_name": "bo4e.Energieherkun...
28296686006
import json import os import tempfile from json import JSONDecodeError from jet_bridge_base.exceptions.request_error import RequestError from jet_bridge_base.exceptions.validation_error import ValidationError from jet_bridge_base.utils.crypt import get_sha256_hash from six import string_types from jet_bridge_base imp...
jet-admin/jet-bridge
packages/jet_bridge_base/jet_bridge_base/request.py
request.py
py
6,384
python
en
code
1,486
github-code
18
[ { "api_name": "six.string_types", "line_number": 63, "usage_type": "argument" }, { "api_name": "json.loads", "line_number": 66, "usage_type": "call" }, { "api_name": "jet_bridge_base.exceptions.request_error.RequestError", "line_number": 68, "usage_type": "call" }, { ...
21119373264
""" Given an array in which all numbers except two are repeated once. (i.e. we have 2n+2 numbers and n numbers are occurring twice and remaining two have occurred once). Find those two numbers in the most efficient way. """ from typing import Tuple def non_repeating(arr: list) -> Tuple[int, int]: xor: int = 0 ...
rrwt/daily-coding-challenge
gfg/sorting_searching/find_two_non_repeating_elements.py
find_two_non_repeating_elements.py
py
608
python
en
code
1
github-code
18
[ { "api_name": "typing.Tuple", "line_number": 9, "usage_type": "name" } ]
17845845114
import pickle from google.auth.transport.requests import Request def google_api_credentials(token_file): _credentials = None try: with open(token_file, 'rb') as token: _credentials = pickle.load(token) if _credentials and _credentials.expired and _credentials.refresh_token: ...
rhz007/google_apis
credentials.py
credentials.py
py
710
python
en
code
0
github-code
18
[ { "api_name": "pickle.load", "line_number": 9, "usage_type": "call" }, { "api_name": "google.auth.transport.requests.Request", "line_number": 12, "usage_type": "call" }, { "api_name": "pickle.dump", "line_number": 15, "usage_type": "call" } ]
37052840369
""" Server to debug python mbe growth recipes. A virtual emulation of the MBE. """ import SocketServer, gzip, copy import matplotlib.pyplot as plt import numpy as np import pandas as pd import cPickle as pickle import ntpath from SocketServer import TCPServer import matplotlib matplotlib.rc('legend', fontsize=10, ha...
Martin09/MBEToolbox
Virtual_MBE/virtual_mbe_server_host.py
virtual_mbe_server_host.py
py
18,137
python
en
code
0
github-code
18
[ { "api_name": "matplotlib.rc", "line_number": 15, "usage_type": "call" }, { "api_name": "SocketServer.TCPServer", "line_number": 18, "usage_type": "name" }, { "api_name": "SocketServer.TCPServer.__init__", "line_number": 24, "usage_type": "call" }, { "api_name": "...
13700745934
# -*- coding: utf-8 -*- # @Time : 2018/11/22 15:00 import pymongo import pymssql from requests import codes import requests import hashlib from multiprocessing.pool import Pool from lxml import etree server="192.168.8.212" user="sa" password="123456" con=pymssql.connect(server,user,password,"Search") cursor=con.c...
gmgmt/Spider
爬虫/day4/NASA论文.py
NASA论文.py
py
5,275
python
en
code
1
github-code
18
[ { "api_name": "pymssql.connect", "line_number": 16, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_number": 38, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 45, "usage_type": "call" }, { "api_name": "requests.codes.ok", ...
10984069274
from django.shortcuts import render import pandas as pd from plotly.offline import plot import plotly.graph_objects as go import plotly.express as px # py.init_notebook_mode(connected=False) # Create your views here. def barras(request): # Carregando os dados df = pd.read_csv('media/data.csv') # C...
thiagovl/grafico-plotly-python-django
core/views.py
views.py
py
2,634
python
pt
code
0
github-code
18
[ { "api_name": "pandas.read_csv", "line_number": 14, "usage_type": "call" }, { "api_name": "plotly.graph_objects.Scatter", "line_number": 17, "usage_type": "call" }, { "api_name": "plotly.graph_objects", "line_number": 17, "usage_type": "name" }, { "api_name": "plo...
74793155238
from typing import Dict, List, Optional, Text from django.db.models.query import QuerySet from django.utils.translation import ugettext as _ from zerver.lib.cache import generic_bulk_cached_fetch, user_profile_cache_key_id, \ user_profile_by_id_cache_key from zerver.lib.request import JsonableError from zerver.mo...
ty-xy/zg13
zerver/lib/users.py
users.py
py
5,733
python
en
code
0
github-code
18
[ { "api_name": "typing.Text", "line_number": 14, "usage_type": "name" }, { "api_name": "zerver.models.UserProfile.MAX_NAME_LENGTH", "line_number": 16, "usage_type": "attribute" }, { "api_name": "zerver.models.UserProfile", "line_number": 16, "usage_type": "name" }, { ...
39723068951
import pandas as pd import json # 定义一个函数将文本从GBK编码转换为UTF-8编码 def gbk2utf8(line): try: line = line.decode("gbk").encode("utf-8") except: return line else: return line # 读取CSV文件,指定编码为GBK data = pd.read_csv(r'price2016.csv', encoding="gbk") # 创建一个空字典用于存储数据 dictionary = dict() # 将列名...
MayBeTheWorld/python-work
secondCourseWord/0208.py
0208.py
py
802
python
en
code
1
github-code
18
[ { "api_name": "pandas.read_csv", "line_number": 16, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 28, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 31, "usage_type": "call" } ]
33697404482
import spotipy import json import spotipy.util as util scope = 'user-library-read' username = 'Victor Valero' token = util.prompt_for_user_token(username, scope) search_str = 'The Limboos' if token: sp = spotipy.Spotify(auth=token) result = sp.search(search_str, type='artist') print (json.dumps(...
vitycola/SpotifyD3Graphs
artistas.py
artistas.py
py
389
python
en
code
0
github-code
18
[ { "api_name": "spotipy.util.prompt_for_user_token", "line_number": 7, "usage_type": "call" }, { "api_name": "spotipy.util", "line_number": 7, "usage_type": "name" }, { "api_name": "spotipy.Spotify", "line_number": 10, "usage_type": "call" }, { "api_name": "json.du...
9993888350
#!/usr/bin/env python def hello(): print("hello,world") hello() import pymongo uri = "mongodb://sa:123@127.0.0.1:27017/?authSource=admin&authMechanism=SCRAM-SHA-256" myclient = pymongo.MongoClient(uri) dblist = myclient.list_database_names() print([r for r in dblist]) #dblist = myclient.database_names() if "h...
James12wl/myPythonproject
com/wang/day01.py
day01.py
py
1,311
python
en
code
0
github-code
18
[ { "api_name": "pymongo.MongoClient", "line_number": 9, "usage_type": "call" } ]
74005479719
import requests def get_quote() -> tuple: response = requests.get(url = "https://api.quotable.io/random") if response.status_code != 200: return "Everything will be ok", "Terry" data = response.json() content = data["content"] author = data["author"] return content, author def ...
terryyyz/terryyyz
python.py
python.py
py
542
python
en
code
0
github-code
18
[ { "api_name": "requests.get", "line_number": 4, "usage_type": "call" } ]
38707903222
import unittest from hw6 import people_doc, find_shelf, list_documents, add_documents, delete_doc from parameterized import parameterized class TestFunction(unittest.TestCase): @parameterized.expand( [ ('10006', 'Владелец документа Аристарх Павлов'), ('2207 876234', 'Владе...
YanaPolyahova/hw_6_ap
test_unittest_hw6.py
test_unittest_hw6.py
py
2,102
python
ru
code
0
github-code
18
[ { "api_name": "unittest.TestCase", "line_number": 6, "usage_type": "attribute" }, { "api_name": "hw6.people_doc", "line_number": 18, "usage_type": "call" }, { "api_name": "parameterized.parameterized.expand", "line_number": 7, "usage_type": "call" }, { "api_name":...
34387758008
from chatterbot import ChatBot from chatterbot.trainers import ListTrainer import pysrt import glob """ Module for training and executing a chat bot using subtitles files """ bot = ChatBot("SubtitlesBot") def train(subtitles_path): """ Train a bot using a set of subtitles files """ dialogs = [] print("...
notsag-dev/subtitles-chatbot
chatbot.py
chatbot.py
py
1,322
python
en
code
0
github-code
18
[ { "api_name": "chatterbot.ChatBot", "line_number": 10, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 17, "usage_type": "call" }, { "api_name": "pysrt.open", "line_number": 20, "usage_type": "call" }, { "api_name": "chatterbot.trainers.ListTrain...
31722107720
import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' from keras_preprocessing.image import ImageDataGenerator from emnist import list_datasets from emnist import extract_training_samples from emnist import extract_test_samples import keras from keras.layers import Dense, Dropout, Convolution2D, MaxPooling2D from keras.l...
miGa77/AMK-DataAnalysis
App/Tuner.py
Tuner.py
py
6,348
python
en
code
0
github-code
18
[ { "api_name": "os.environ", "line_number": 3, "usage_type": "attribute" }, { "api_name": "emnist.list_datasets", "line_number": 16, "usage_type": "call" }, { "api_name": "emnist.extract_training_samples", "line_number": 19, "usage_type": "call" }, { "api_name": "e...
21728330092
import numpy as np import sklearn import sklearn.datasets class ToyDataset(object): def __init__(self, dim, data_file=None, static_data=None): if data_file is not None: self.static_data = np.load(data_file) elif static_data is not None: self.static_data = static_data ...
GFNOrg/EB_GFN
synthetic/synthetic_data.py
synthetic_data.py
py
5,888
python
en
code
64
github-code
18
[ { "api_name": "numpy.load", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.random.shuffle", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 34, "usage_type": "attribute" }, { "api_name": "numpy.random.RandomS...
17635946928
import json import logging import os import time import requests logger = logging.getLogger() logger.setLevel(logging.DEBUG) def lambda_handler(event, context): (cold, hot) = parse_input(event) logger.info("Processing meter values: cold %d, hot %d", cold, hot) r = submit_meters(cold, hot) return { ...
ppalex7/IoT
send-meter-data-to-mosvodokanal/lambda_function.py
lambda_function.py
py
4,162
python
en
code
0
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 10, "usage_type": "attribute" }, { "api_name": "json.dumps", "line_number": 22, "usage_type": "call" }, { "api_name": "time.time", "line_...
72782821160
import requests import json import logging from b2c.wxapp.models.wx_app_review_state_type import WXAppReviewStateType logger = logging.getLogger('django') wx_api_base_url = 'https://api.weixin.qq.com/' # 小程序基本信息 base_info_url = wx_api_base_url + 'cgi-bin/account/getaccountbasicinfo?access_token=' # 设置域名 modify_doma...
PyZyyong/users
wxapp/wechat_api.py
wechat_api.py
py
10,078
python
en
code
0
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 43, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 45, "usage_type": "call" }, { "api_name": "requests.post", "line_nu...
27337168391
# Author: Teon Brooks <teon.brooks@gmail.com> # # License: BSD (3-clause) import os.path as op import numpy as np from numpy.testing import (assert_array_almost_equal, assert_array_equal, assert_equal) import pytest from scipy import linalg import scipy.io import mne from mne import pick_t...
soheilbr82/BluegrassWorkingMemory
Python_Engine/Lib/site-packages/mne/io/kit/tests/test_kit.py
test_kit.py
py
10,843
python
en
code
5
github-code
18
[ { "api_name": "os.path.join", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path", "line_number": 27, "usage_type": "name" }, { "api_name": "os.path.dirname", "line_number": 27, "usage_type": "call" }, { "api_name": "mne.io.kit.__file__", "line_...
3272479591
import torch from bench.core.executer import Executer def boxes_for_nms(boxes, idxs, class_agnostic=False): """Boxes for NMS. Arguments: boxes (torch.Tensor): boxes in shape (N, 4). idxs (torch.Tensor): each index value correspond to a bbox cluster, and NMS will not be applied between elements...
DeepLink-org/DLOP-Bench
bench/samples/long_tail/boxes_for_nms/torch_impl.py
torch_impl.py
py
1,011
python
en
code
38
github-code
18
[ { "api_name": "torch.from_numpy", "line_number": 26, "usage_type": "call" }, { "api_name": "torch.from_numpy", "line_number": 27, "usage_type": "call" }, { "api_name": "bench.core.executer.Executer", "line_number": 33, "usage_type": "call" } ]
26516610785
from typing import Sequence from acme import types from acme.adders.reverb import sequence as adders from acme.adders.reverb import structured from acme.adders.reverb import test_cases from acme.adders.reverb import test_utils import dm_env import numpy as np from reverb import structured_writer as sw import tree fro...
deepmind/acme
acme/adders/reverb/structured_test.py
structured_test.py
py
3,810
python
en
code
3,100
github-code
18
[ { "api_name": "acme.adders.reverb.test_utils.AdderTestMixin", "line_number": 17, "usage_type": "attribute" }, { "api_name": "acme.adders.reverb.test_utils", "line_number": 17, "usage_type": "name" }, { "api_name": "absl.testing.parameterized.TestCase", "line_number": 17, ...
40885786399
# Serving the Models as a Docker Image # 1. mlflow run . # 2. mlflow models build-docker -m "./mlruns/0/<run-id>/artifacts/model" -n "tf_serve" # 3. docker run -p 5001:8080 "tf_serve" # working REST api command # curl -X POST -H "Content-Type:application/json; format=pandas-split" --data '{"columns":["SepalLength", "S...
hcw-00/MLOps_examples
mlflow/tf2_docker_serve/requests_prediction.py
requests_prediction.py
py
1,131
python
en
code
0
github-code
18
[ { "api_name": "requests.post", "line_number": 17, "usage_type": "call" } ]
36556828586
import json from bs4 import BeautifulSoup from flask import Flask, render_template, request, url_for, redirect, flash, make_response, jsonify import os import glob app = Flask(__name__) app.debug = True @app.route('/totgetdata', methods=['GET','POST']) def get_data(): urll = request.args.get('url').strip() cwd = o...
saumyabhadani95/trickortruth
backend/src/read_json.py
read_json.py
py
2,732
python
en
code
0
github-code
18
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.request.args.get", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.request.args", "line_number": 13, "usage_type": "attribute" }, { "api_name": "flask.reque...
5118935777
import psycopg2 import time import os import sys import stomp from urllib import request, parse, error import json from listeners import ServiceRegistrationListener, MessageListener time.sleep(2) def start_registry_listener(hosts): print("starting registry listener") queue = stomp.Connection(host_and_port...
StefanEvanghelides/eai2019
MessageBus/main.py
main.py
py
1,773
python
en
code
0
github-code
18
[ { "api_name": "time.sleep", "line_number": 13, "usage_type": "call" }, { "api_name": "stomp.Connection", "line_number": 18, "usage_type": "call" }, { "api_name": "listeners.ServiceRegistrationListener", "line_number": 19, "usage_type": "call" }, { "api_name": "sto...