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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
38036313732 | from importlib import invalidate_caches
from importlib import import_module
def write_py(name, parameters, statements):
'''
Description: opens and writes out a python file named based on name and content based on statements/parameters
Input: name as a str, parameter (function arguments) as a list, ... | ayokunle321/BitonicSortMetaProgram | meta.py | meta.py | py | 6,442 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "importlib.invalidate_caches",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "importlib.import_module",
"line_number": 62,
"usage_type": "call"
}
] |
7138575564 | """Tokenization classes."""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import collections
import os
import sys
import unicodedata
import random
import six
import logging
from torch.utils.data import Dataset
import torch
import numpy as np
from callback... | laohur/PoorBERT | v1/model/PretrainQaDataset.py | PretrainQaDataset.py | py | 6,409 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "torch.utils.d... |
16404420448 | from django.http import request, HttpResponseRedirect, HttpResponse
from django.shortcuts import render, redirect, get_object_or_404
from .forms import ContactoForm
from .forms import Publiform, CustomUserCreationForm
from .forms import Otraform, RegisForm, LoginForm
from .forms import comentarioform, uwuform, postisfo... | sblli/blog_con_errocitos | views.py | views.py | py | 6,270 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "forms.postisform",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "models.postis.objects.all",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "models.postis.objects",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": ... |
17278006061 | #!/usr/bin/python3
"""function that queries the Reddit API and prints the titles of the first
10 hot posts listed for a given subreddit"""
import requests
def top_ten(subreddit):
"""top ten posts"""
url = 'https://api.reddit.com/r/{}/hot/'.format(subreddit)
header = {'User-Agent': 'ubuntu:hbredditapp:v1.0... | mateo-a/holberton-system_engineering-devops | 0x16-api_advanced/1-top_ten.py | 1-top_ten.py | py | 645 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
}
] |
69986857149 | """
Various helper methods for the farm-related modules
"""
import argparse
import torch
from torch import nn
def str2bool(v):
if isinstance(v, bool):
return v
if v.lower() in ('yes', 'true', 't', 'y', '1'):
return True
elif v.lower() in ('no', 'false', 'f', 'n', '0'):
return False
... | OFAI/farm-tools | farm_tools/farm_utils.py | farm_utils.py | py | 4,066 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentTypeError",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",
"line_number": 47,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 47,
"usage_type": "name"
},
{
"api_name": "torch.nn",
... |
31711626081 | """Unit tests for sr830 library connected to an instrument."""
import argparse
import math
import random
import time
import numpy as np
import pytest
import visa
import sr830
parser = argparse.ArgumentParser()
parser.add_argument(
"-r", "--resource-name", help="VISA resource name",
)
parser.add_argument(
"-o"... | jmball/srs_sr830 | src/sr830/test_sr830.py | test_sr830.py | py | 21,742 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sr830.sr830",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pytest.raises",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "numpy.random.unifor... |
72007203068 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""fbscraper package.
This module is used for parsing or dumping a FB JSON (see help
command for further details).
Examples
--------
Using the CLI:
$ ./fbscraper.py dumper -s 10000 -c request_data.txt
$ ./fbscraper.py parser -m dl -d all -i output/*/c... | elcoc0/fbscraper | fbscraper/__main__.py | __main__.py | py | 9,448 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "argparse.ArgumentTypeError",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentTypeError",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentTypeError",
"line_number": 54,
"usage_type": "call"
},
{
"... |
29586684795 | import pandas
import pandas as pd
import ray
import requests
from typing import Dict, Any
import hashlib
import json
def dict_hash(dictionary: Dict[str, Any]) -> str:
"""MD5 hash of a dictionary."""
dhash = hashlib.md5()
# We need to sort arguments so {'a': 1, 'b': 2} is
# the same as {'b': 2, 'a': 1}... | vdevigere/nba_dataloader | src/nba_dataloader/DataFetcher.py | DataFetcher.py | py | 1,921 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.Dict",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "hashlib.md5",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 15... |
71608260349 | import torch
import copy
import torch.nn as nn
from djtransgan.model import Encoder, Frontend, PostProcessor, Unzipper
from djtransgan.model import estimate_postprocessor_in_dim, estimate_postprocessor_out_dims
from djtransgan.mixer import Mixer
class Generator(nn.Module):
def __init__(self,
unz... | ChenPaulYu/DJtransGAN | djtransgan/model/generator.py | generator.py | py | 5,099 | python | en | code | 86 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "djtransgan.model.Frontend",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "djtransgan.mode... |
40350684712 | import logging
import os
import sys
import nltk
from nltk.stem import WordNetLemmatizer
import utilities
lppDashedMWEPath = '../Corpora/LPP/mwe-dashed.txt'
lppRawPath = '../Corpora/LPP/raw.txt'
# @TODO
lppCrossedPath = '../Corpora/LPP/mwe.txt'
lppConlluPath = '../Corpora/LPP/conll.txt'
lppLexiconPath = '../Corpora/... | hazemalsaied/ATILF-LLF-MWE-Analyser | Scripts/lpp.py | lpp.py | py | 4,874 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "nltk.word_tokenize",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "logging.warn",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "os.path.basename",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_... |
9830923986 | # -*- coding: utf-8 -*-
##
# @file z_transform_app.py
# @brief Contain a gui calculating the Z Transform
# @author Gabriel H Riqueti
# @email gabrielhriqueti@gmail.com
# @date 27/04/2021
#
from PySide2 import QtWidgets
from PySide2.QtWidgets import QApplication
import sys
import sympy
from biomedical_si... | gabrielriqu3ti/biomedical_signal_processing | biomedical_signal_processing/tools/z_transform_app.py | z_transform_app.py | py | 4,730 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "PySide2.QtWidgets.QWidget",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "PySide2.QtWidgets",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "PySide2.QtWidgets.QLabel",
"line_number": 29,
"usage_type": "call"
},
{
"api_nam... |
20265853582 | import streamlit as st
import plotly.graph_objects as go
import numpy as np
import pandas as pd
import datetime
#mapbox_access_token = open(".mapbox_token").read()
mapbox_access_token = st.secrets["mapbox_token"]
st.set_page_config(
page_title="Pronóstico Río Salado",
page_icon="❤️",
layout="wide",
... | emilopez/streamlit_first_steps | streamlit_test4.py | streamlit_test4.py | py | 2,579 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "streamlit.secrets",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "streamlit.set_page_config",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "streamlit.columns",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "str... |
18028655944 | import os
import psutil
def get_open_ports():
open_ports = []
for conn in psutil.net_connections(kind='inet'):
laddr, raddr, status, pid = conn.laddr, conn.raddr, conn.status, conn.pid
if raddr:
open_ports.append(f"{laddr} <--> {raddr} {status} {pid}")
else:
... | KIMJOONSIG/Reboot3 | Windows/OpenPorts.py | OpenPorts.py | py | 776 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "psutil.net_connections",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.expanduser",
... |
70228676027 | from django.shortcuts import render
from django.views.generic.base import TemplateView
from transbank.webpay.webpay_plus.transaction import Transaction
from venta.models import *
import requests
# Create your views here.
class HomePageView(TemplateView):
template_name = "core/home.html"
def get(self, request... | juponce/MusicPro-Front | MusicPro/core/views.py | views.py | py | 2,299 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.views.generic.base.TemplateView",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.shortcuts.render",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "transbank.webpay.webpay_plus.transaction.Transaction",
"line_number": 24,
"... |
33195734008 | from typing import Dict, List
import numpy as np
from sklearn.base import BaseEstimator
from sklearn.metrics import classification_report
import yaml
from yaml import Loader
import pickle as pkl
from rich.table import Table
import rich
from sdv.metadata import SingleTableMetadata
from src.data import Data
def s... | PeDiot/tabular-sbgm | src/utils.py | utils.py | py | 4,259 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pickle.dump",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "yaml.load",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "yaml.Loader",
"line_number": 33... |
37005599771 | #coding: utf-8
import urllib2
import urlparse
import cookielib
import logging
log = logging.getLogger("reader")
log.setLevel(logging.DEBUG)
class UrlReader(object):
def __init__(self):
self._cj = cookielib.CookieJar()
self._opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(self._cj))
def set_cook... | mgbaozi/ruankusb | lib/reader.py | reader.py | py | 836 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "cookielib.CookieJar",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "urllib2.build_... |
40180835419 | import spacy
from spacy.tokens import Doc
import json
from conlleval import evaluate_conll_file
import random
glove_word_list = set()
with open('/home/jliu/data/WordVector/glove.6B.300d.txt') as filein:
for line in filein:
glove_word_list.add(line.strip().split()[0])
def read_m2e2():
file1 = '/home/jl... | jianliu-ml/Multimedia-EE | code/textualEE/refine_result.py | refine_result.py | py | 5,855 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "json.loads",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "spacy.tokens.Doc",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "spacy.load",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "conlleval.evaluate_conll_file"... |
28582410956 | import json
from http import cookiejar
import logging
import requests
import pandas as pd
from conf import db_cfg
from sqlalchemy import create_engine, text
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', filename="./logs/login.txt"
)
logger =... | kaihongChan/fordeal | login.py | login.py | py | 1,930 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.basicConfig",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "conf.db_cfg",
... |
70054428029 | import csv
import datetime
from utility import clear_screen
def create_entry():
"""Collects user input: date, task name, time spent and notes.
And writes it to a csv file
"""
clear_screen()
while True: # collects a date
try:
input_date = input("Enter a date: (Format: DD/MM/YY... | joeybruijns/techdegree-project-03 | entries.py | entries.py | py | 1,605 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "utility.clear_screen",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "utility.clear_screen... |
9094606375 | # -*- coding: utf-8 -*-
"""
@author: Doğa Veske
"""
import numpy
import gwsurrogate
import h5py
import time
import xml.etree.ElementTree as ET
tic=time.time()
sur=gwsurrogate.LoadSurrogate('NRHybSur3dq8')#name of the waveform families used
snr=numpy.zeros((100,100)) #Consider integer masses until 99 so... | dveske/observation-bias-gw | calculateSNR.py | calculateSNR.py | py | 2,523 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "time.time",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "gwsurrogate.LoadSurrogate",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "h5py.File",
"line... |
28323751203 | from django.shortcuts import render, redirect
from products.models import Product, Order
from django.contrib.auth.decorators import login_required
from cart.cart import Cart
import numpy as np
from django.contrib.auth.models import User
from django.contrib import messages
@login_required(login_url="/accounts/login")
... | SanjayRajR/product-recommender | main/shoppingcart/views.py | views.py | py | 2,800 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cart.cart",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "cart.cart.Cart",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "products.models.Product.objects.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "products... |
29669800304 |
import numpy as np
import pandas as pd
from jieba import posseg
import jieba
from gensim.models import Word2Vec
from gensim.models.word2vec import LineSentence
def segment(sentence, cut_type='word',pos=False):
if pos:
word_pos_seq = posseg.lcut(sentence)
word_seq, pos_seq=[],[]
if cut_typ... | lanweicai/NLP | S1/ProjectAutoMasterQA/dataprocess/workshop_test.py | workshop_test.py | py | 1,955 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "jieba.posseg.lcut",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "jieba.posseg",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "jieba.posseg.lcut",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "jieba.posseg",
"... |
18917130661 | from flask import Flask, Response
import prometheus_client
import sys
import socket
import json
import ipaddress
from ctypes import *
import struct
class IMSI_STRUCT(Structure):
_fields_ = [("imsi", c_byte*16)]
class PLMN(Structure):
_fields_ = [("idx", c_byte*3)]
class TAI(Structure):
_fields_ = [("plmn... | omec-project/Nucleus | pyserver/monitor_client.py | monitor_client.py | py | 6,475 | python | en | code | 15 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 81,
"usage_type": "call"
},
{
"api_name": "socket.socket",
"line_number": 91... |
292837650 | # coding: utf-8
from __future__ import absolute_import
from flask import json
from six import BytesIO
from swagger_server.models.pet import Pet # noqa: E501
from swagger_server.test import BaseTestCase
class TestPetController(BaseTestCase):
"""PetController integration test stubs"""
def test_add_pet(self... | FreeZ11/FlaskZespolowe | python-flask-server-generated/python-flask-server/swagger_server/test/test_pet_controller.py | test_pet_controller.py | py | 1,807 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "swagger_server.test.BaseTestCase",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "swagger_server.models.pet.Pet",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "flask.json.dumps",
"line_number": 24,
"usage_type": "call"
},
{
"a... |
28441920206 | from flask import render_template
from .import main
from ..request import get_sources,get_article,get_allnews
@main.route('/')
def index():
'''
View root page function that returns the index page and its data
'''
allnew = get_allnews()
print(allnew)
# Getting popular New
popular_movie = ... | peter-wairimu/News_App | app/main/views.py | views.py | py | 776 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "request.get_allnews",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "request.get_sources",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "request... |
5539574942 | import numpy as np
import cv2
def my_normalize(src):
dst = src.copy()
dst *= 255
dst = np.clip(dst,0,255)
return dst.astype(np.uint8)
def add_gaus_noise(src,mean=0,sigma=0.1):
#src : 0 ~ 255, dst : 0 ~ 1
dst = src / 255
(h,w) = dst.shape
noise = np.random.normal(mean,sigma,size=(h... | daebakk/Image-Processing | Assignment/[IP]실습07 - Image Restoration/Gaussian_noise.py | Gaussian_noise.py | py | 1,023 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.clip",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.normal",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"li... |
2535730017 | import struct
from twisted.python import log
do_log = False
def _unpack_H_string(s, offset):
l, = struct.unpack_from("!H", s, offset)
return s[offset+2:offset+2+l], offset + 2 + l
class PDU(object):
def __len__(self):
return self.header_size + self.pdu_length
@classmethod
def unpack(cls,... | rickardholmberg/twisteddicom | twisteddicom/pdu.py | pdu.py | py | 39,080 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "struct.unpack_from",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "struct.unpack",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "struct.unpack",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "struct.calcsize",
"... |
44762427344 | import json
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
matplotlib.rcParams["mathtext.fontset"] = "stix"
def load_file(fname, drop=None):
with open(fname, "r", encoding="utf-8") as f:
data = np.array(json.load(f))
if drop is not None:
data = data[:drop]
return data
def ... | lirundong/MSThesis | img/GQ_Nets/grad-of-kl-detach/plot_kl_to_ce_angle.py | plot_kl_to_ce_angle.py | py | 1,990 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.rcParams",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subpl... |
28599441227 | import cv2
import mediapipe as mp
import numpy as np #배열지원
mp_drawing = mp.solutions.drawing_utils #pose 그리기
mp_pose = mp.solutions.pose #pose 측정
cap = cv2.VideoCapture(0) # 실시간 동영상 캡쳐
cap.set(cv2.CAP_PROP_FRAME_WIDTH, 640)
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 480)
# Curl counter variables
counter = 0
lc... | woojinchoi17/Hi_Mirror | other code/percentage_bar.py | percentage_bar.py | py | 5,919 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "mediapipe.solutions",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "mediapipe.solutions",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.C... |
18091190329 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('account', '0008_auto_20150125_0036'),
]
operations = [
migrations.AlterField(
model_name='basicmemberinformation... | hongdangodori/slehome | slehome/account/migrations/0009_auto_20150125_0213.py | 0009_auto_20150125_0213.py | py | 531 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AlterField",
"line_number": 14,
"usage_type": "call"
},
{... |
2639485941 | import nextcord
from nextcord import (
slash_command,
Interaction,
)
from nextcord.ext import commands
import datetime
import random
import os
import motor
import motor.motor_asyncio
import cooldowns
cluster = motor.motor_asyncio.AsyncIOMotorClient("mongodb+srv://FlameyosFlow:reZPy4ZKz5YqumS@discord.fm5pk.m... | coderFlameyosFlow/Famu-Bot | cogs/economy/beg.py | beg.py | py | 2,740 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "motor.motor_asyncio.AsyncIOMotorClient",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "motor.motor_asyncio",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "nextcord.ext.commands.Cog",
"line_number": 40,
"usage_type": "attribute"
... |
17544259456 | from sticher import Stitcher
import argparse
import imutils
import cv2
import os
import progressbar
import utils
import numpy as np
# construct the argument parse and parse the arguments
ap = argparse.ArgumentParser()
ap.add_argument("-v", "--video", required=True,
help="path to the first image")
args = vars(ap.parse... | abdullacontractor/bookish-potato | video_stabilizer.py | video_stabilizer.py | py | 2,267 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
... |
33821707764 | import argparse
import sys, os
sys.path.append(
os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), r"../../../"))
)
import sparse_operation_kit as sok
import tensorflow as tf
from test_sparse_emb_demo_model_single_worker import check_saved_embedding_variables
import pickle
import utils
fr... | NVIDIA-Merlin/HugeCTR | sparse_operation_kit/unit_test/test_scripts/tf2/test_dense_emb_demo_model_single_worker.py | test_dense_emb_demo_model_single_worker.py | py | 13,608 | python | en | code | 849 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
26260093494 | import cv2
import numpy as np
from keras.models import load_model
model=load_model("./model2-021.model")
labels_dict={0:'aksh',1:'jan'}
face_img = cv2.imread("janu.jpg", 1)
resized=cv2.resize(face_img,(150,150))
normalized=resized/255.0
reshaped=np.reshape(normalized,(1,150,150,3))
reshaped = np.vstack([... | Aksharmodiak30/Face_Recognition_CNN | test1.py | test1.py | py | 445 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "keras.models.load_model",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.reshape",
"line... |
18525393985 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import Sequential, Linear, ReLU
from torch_geometric.nn import GINConv, global_add_pool
from drp.models.registry import COMPONENTS,BACKBONES
from torch_geometric.nn import GATConv, GatedGraphConv
from torch import Tensor
from torch.nn impo... | yivan-WYYGDSG/AGMI | drp/models/components/encoders/agmi_gate_encoder.py | agmi_gate_encoder.py | py | 3,518 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "torch_geometric.nn.GatedGraphConv",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "torch.nn.GRUCell",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "torc... |
22551126935 | import os
from pathlib import Path
from flask import Blueprint, render_template, request, flash, redirect, url_for, jsonify, send_file
from werkzeug.utils import secure_filename
from config import UPLOAD_FOLDER, ABSOLUTE_PATH, API_STORAGE
from database import db
from forms.metrics import SelectMetricsForm, StartEvalu... | ArturZhukovets/Metrics-evaluation | app/controllers/metrics.py | metrics.py | py | 5,542 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Blueprint",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "forms.metrics.StartEvaluateMetricForm",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 23,
"usage_type": "call"
},
{
"api_n... |
42976417918 | import colorama
import numpy as np
import torch
from tqdm import trange
from transformers import GPT2Tokenizer
from cog import BasePredictor, Input, BaseModel
import KID
from KID.agent import KIDAgent
from KID.envs import GPT2Env
from KID.infra import Frame
from KID.policy import KIDPolicy
class Output(BaseModel):
... | microsoft/KID | scripts/predict.py | predict.py | py | 3,057 | python | en | code | 67 | github-code | 6 | [
{
"api_name": "cog.BaseModel",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "cog.BasePredictor",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
... |
1522054564 | import heapq
import multiprocessing as mp
import torch
from torchvision import ops as tvops
from matplotlib import pyplot as plt
# The precision at each recall level r is interpolated by taking the maximum precision measured for a method for which the corresponding recall exceeds r
# assigned to groundtruth objects s... | laitalaj/cvpce | cvpce/metrics.py | metrics.py | py | 8,646 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "torchvision.ops.box_iou",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torchvision.ops",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "torch.sort",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.zeros",
... |
30640858022 | from django.db import models
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
from .manager import UserManager
class User(AbstractBaseUser, PermissionsMixin):
email = models.CharField(max_length=200, unique=True)
phone_number = models.CharField(max_length=11, unique=True)
full_name... | Mahshid-Saedi/Realestate | realestate/account/models.py | models.py | py | 1,031 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.contrib.auth.models.AbstractBaseUser",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.contrib.auth.models.PermissionsMixin",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 6,
"usa... |
71174546109 | from tune_elements import *
from abc_character_encoding import ensure_unicode, unicode_text_to_abc
import wx
import sys
PY3 = sys.version_info.major > 2
if PY3:
xrange = range
class AbcContext(object):
def __init__(self, editor, settings, on_invalidate=None):
self._editor = editor
self.on_inva... | jwdj/EasyABC | abc_context.py | abc_context.py | py | 17,072 | python | en | code | 67 | github-code | 6 | [
{
"api_name": "sys.version_info",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "abc_character_encoding.ensure_unicode",
"line_number": 103,
"usage_type": "call"
},
{
"api_name": "abc_character_encoding.unicode_text_to_abc",
"line_number": 332,
"usage_type"... |
5679753594 | #!/usr/bin/env python
"""Make mega response maps"""
import ROOT
# from MyStyle import My_Style
# My_Style.cd()
import os
from collections import OrderedDict
import sys
from array import array
from bisect import bisect_left
from copy import deepcopy
from math import sqrt
from itertools import product
# My stuff
# im... | raggleton/QGAnalysisPlotting | makeMegaMaps.py | makeMegaMaps.py | py | 4,653 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "ROOT.PyConfig",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "ROOT.gROOT.SetBatch",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "ROOT.gROOT",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "ROOT.TH1.SetDe... |
38778829004 | import socket
import sys
import json
username = input("Enter username: ")
msg_message = "This is my message."
msg_register = {"command":"register","username":username}
msg_deregister = {"command":"deregister","username":username}
server_addr = input("Enter server address: ")
server_port = input("Port:")
server_port ... | Bol3x/CSNETWK_MsgBoard_MP | message_client.py | message_client.py | py | 2,623 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "socket.socket",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_DGRAM",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "json.dumps",... |
18050065606 | import wget
import subprocess
from xml.dom.minidom import parse
import math
import pandas as pd
minLat=input("minLat:")
maxLat=input("maxLat:")
minLon=input("minLon:")
maxLon=input("maxLon:")
product_type=input("product_type:")
ingestion_date_FROM=input("ingestion_date_FROM:")
ingestion_date_TO=input("ingestion_date_T... | HulkZhang001/get | get.py | get.py | py | 2,981 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "subprocess.call",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "xml.dom.minidom.parse",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "math.ceil",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "subprocess.call",
... |
3689234297 | # %%
from datetime import datetime
from pathlib import Path
import os
while True:
folder = input("Input a Folder: ")
if Path(folder).is_dir() == False:
print(f"Input a valid Folder")
if Path(folder).is_dir() == True and not "".__eq__(folder):
print(f"Input folder is '{folder}'")
our... | sam21nw/python-scripts | files-and-folders.py | files-and-folders.py | py | 750 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pathlib.Path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number... |
13991205308 | import openai
from key import key
openai.api_key = key
def chat(msg, messages=None):
if messages is None:
messages = []
messages.append({"role": "user", "content": msg})
completion = openai.ChatCompletion.create(model="gpt-3.5-turbo", messages=messages)
reply = completion['choices'][0]['mess... | Janghyun1230/speech2speech_chatGPT | chat.py | chat.py | py | 818 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "openai.api_key",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "key.key",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "openai.ChatCompletion.create",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "openai.ChatCom... |
40606043715 | #!/usr/bin/python3
""" a Python script that, using this REST API """
import json
import requests
from sys import argv
if __name__ == "__main__":
user = 'https://jsonplaceholder.typicode.com/users/{}'.format(
argv[1])
data = requests.get(user)
data = data.json()
_id = data.get("id")
nam... | jesus4388/holbertonschool-system_engineering-devops | 0x15-api/0-gather_data_from_an_API.py | 0-gather_data_from_an_API.py | py | 829 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_number": 18,
... |
24423065594 | from torch.utils.data import Dataset
from pathlib import Path
from itertools import islice
import numpy as np
import imageio
import torch
import random
import cv2
from functools import partial
from flow_utils import load_flow
from abc import abstractmethod, ABCMeta
class StaticRandomCrop(object):
def __init__(sel... | zhenzhenxiang/SemanticsSharing | pre_train/optical_flow/dataset.py | dataset.py | py | 11,025 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "random.randint",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "itertools.islice",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "torch.utils.data.Datas... |
1518608671 | from django import forms
from django.forms.widgets import Widget
CHART_CHOICES = (
('#1', 'Bar chart'),
('#2', 'Pie chart'),
('#3', 'Line chart'),
)
RESULT_CHOICES = (
('#1', 'transaction'),
('#2', 'sales date'),
)
class SalesSearchForm(forms.Form):
date_from = forms.DateField(widge... | Emmanuel-thomas/first-website | src/sales/forms.py | forms.py | py | 703 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.forms.Form",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "django.forms.DateField",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.for... |
31930801792 | import time
import h5py
import numbers
import inspect
import os, sys, atexit
import numpy as np
import tensorflow as tf
from garage.algos import RLAlgorithm
import garage.misc.logger as logger
from garage.tf.plotter import Plotter
from garage.tf.samplers import BatchSampler
from garage.tf.samplers import OnPolicyVect... | amolchanov86/quad_sim2multireal | quad_train/algos/batch_polopt.py | batch_polopt.py | py | 14,737 | python | en | code | 19 | github-code | 6 | [
{
"api_name": "garage.algos.RLAlgorithm",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "garage.misc.logger.get_snapshot_dir",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "garage.misc.logger",
"line_number": 86,
"usage_type": "name"
},
{
"a... |
19137683721 | #!/python/bin/python
#Author: Zach Farmer
#Purpose: Feature Selection
"""
Following function is designed to find features that contain the greatest
explanation power in regards to the classification goal of identifying
poi's. Function implements sklearn's SelectPercentile method and PCA methods.
Parame... | Zalefar/Udacity_Data_Analyst_ND | Project_5/select_features.py | select_features.py | py | 2,953 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sklearn.feature_selection.SelectPercentile",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "sklearn.feature_selection.f_classif",
"line_number": 38,
"usage_type": "argument"
},
{
"api_name": "sklearn.decomposition.PCA",
"line_number": 41,
"usage_... |
32100508514 | import threading
import tempfile
import kmbotos as kmos
import shutil
write_lock = threading.Lock()
def read_proxies_from_file(file_path):
with open(file_path, "r") as file:
proxies = [line.strip() for line in file.readlines()]
return proxies
def create_temporary_directory():
return tempfile.mk... | Knoz9/Web-Scraper-iPhone | kmbotfilemanager.py | kmbotfilemanager.py | py | 3,029 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "threading.Lock",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "tempfile.mkdtemp",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "shutil.move",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "kmbotos.restart_program",
... |
43976643373 | from utils import *
from scipy.sparse import csr_matrix
from collections import Counter
import math
class Invertedfile_TFIDF:
def __init__(self, data: pd.DataFrame) -> None:
self.data = data
self.processed_q2_list = data['processed_ques2'].tolist()
print("Build vocabulary...")
s... | anhoa-vu/Text-Matching-System | Invertedfile_TFIDF.py | Invertedfile_TFIDF.py | py | 5,970 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.Counter",
"line_number": 125,
"usage_type": "call"
},
{
"api_name": "math.log2",
"line_number": 137,
"usage_type": "call"
},
{
"api_name": "scipy.sparse.csr_matrix",
"line_number": 141,
"usage_type": "call"
},
{
"api_name": "scipy.sparse... |
19702809610 | import matplotlib.pyplot as plt
from matplotlib import cm
import numpy as np
def plot_maze(trial, ax, other=None):
orig_maze_array = trial.env._maze
prey_pos = trial.env._state_space[trial['init_state']['target_state']]
agent_pos = [trial.env._state_space[i] for i in trial.agent_state]
agent_init_pos =... | aidapiccato/search-world | search_world/utils/plot_utils.py | plot_utils.py | py | 1,325 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.flip",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.Circle",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "numpy.flip",
... |
40687609903 | import abc
import logging
from ctypes import c_ulong
from functools import lru_cache
from socket import AF_INET, AF_INET6, inet_ntop
from struct import pack
from typing import Tuple
import psutil
from magma.kernsnoopd import metrics
# TASK_COMM_LEN is the string length of binary names that the kernel reports.
# Value... | magma/magma | lte/gateway/python/magma/kernsnoopd/handlers.py | handlers.py | py | 7,101 | python | en | code | 1,605 | github-code | 6 | [
{
"api_name": "abc.ABC",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "abc.abstractmethod",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "ctypes.c_ulong",
"line_number": 61,
"usage_type": "name"
},
{
"api_name": "psutil.Process",
... |
11121424467 | import imblearn
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib import pyplot
import matplotlib
from imblearn.combine import SMOTEENN,SMOTETomek
from imblearn.under_sampling import OneSidedSelection
from sklearn.decomposition import PCA
'''
def handleLabel(input):
label_lis... | 1013497232/SK-FLOW | flowdetect/handle_imbalance.py | handle_imbalance.py | py | 2,519 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "numpy.unique",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.scatter",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "matplotlib.p... |
70129579069 | #-----------------------------Code12-----------------------------------------------------#
# import sys
# sys.path.append('/content/drive/MyDrive/Code/Libs2/classes.py')
# import classes as C
#-----------------------------------------------------------------------------------------#
from PIL import Image
import torch
i... | PongthepGeo/geophysics_23 | codes/seismic/test.py | test.py | py | 5,818 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.device",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append"... |
24316818662 | import json
import requests
#Setup the endpoint and create the bearer token
endpoint = 'https://login.microsoftonline.com/[TENANT_ID]/oauth2/token'
headers = {'Content-Type': 'application/x-www-form-urlencoded'}
payload = 'grant_type=client_credentials&client_id=[CLIENT_ID]&client_secret=[CLIENT_SECRET]&resource=https%... | hurtn/datalake-on-ADLS | APIs/create_security_group.py | create_security_group.py | py | 1,074 | python | en | code | 31 | github-code | 6 | [
{
"api_name": "requests.post",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 26,
"usage_type": "call"
}
] |
20948207043 | from spacy.cli.download import download as spacy_download
import spacy
import re
import json
from eval_data import cqs, sents
from reqtagger import ReqTagger
def load_spacy(model_name):
try:
model = spacy.load(model_name)
except OSError:
print(f"Spacy models '{model_name}' not found. Download... | reqtagger/ReqTagger | reqtagger/evaluate.py | evaluate.py | py | 2,878 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "spacy.load",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "spacy.cli.download.download",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "spacy.load",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "reqtagger.ReqTagger... |
71520946747 |
"""
[5,7,7,8,8,10]
l =0, r= 5
len = 6, mid = 2
mid = l + (r -l)/2
target = 8
5,7,7,8,8,10
l m r -> nums[m] < target
5,7,7,8,8,10
l m r -> m==target , nums[m-1] != target
5,7,7,8, 8,10
lrm
5,7,7,8, 8,10
lmr , m ==target , nums[m-1] != target {return nums[m]}
... | lintang-b-s/leetcode-solution | my-folder/problems/find_first_and_last_position_of_element_in_sorted_array/solution.py | solution.py | py | 1,524 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 48,
"usage_type": "name"
}
] |
34688635516 | import math
import torch
from types import MethodType
import inspect
import k_diffusion as K
import torch.nn.functional as F
from tqdm import tqdm
from modules import devices, shared, sd_samplers_common
from modules.shared import state, cmd_opts
from modules.processing import opt_f
from tile_utils.utils import *
fr... | pkuliyi2015/multidiffusion-upscaler-for-automatic1111 | tile_methods/abstractdiffusion.py | abstractdiffusion.py | py | 33,824 | python | en | code | 3,800 | github-code | 6 | [
{
"api_name": "modules.shared.sd_model",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "modules.shared",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "modules.shared.sd_model",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name... |
6793101557 | from shapely.geometry import Polygon
def get_bb_from_centroid(x, y, width, height):
topLeftPoint = x - width, y + height
topRightPoint = x + width, y + height
bottomRightPoint = x + width, y - height
bottomLeftPoint = x - width, y - height
return topLeftPoint, bottomRightPoint
def get_cords_for... | konishon/vechical-detect-and-track | tracking/mathhelper.py | mathhelper.py | py | 4,373 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "shapely.geometry.Polygon",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "shapely.geometry.Polygon",
"line_number": 75,
"usage_type": "call"
}
] |
17940224881 | from sklearn.cluster import KMeans
from sklearn.preprocessing import scale
from sklearn.model_selection import train_test_split
import pandas as pd
import json
import numpy as np
def transf(feature):
ff = json.loads(feature.replace("'",'"'))
ff = pd.DataFrame(ff)
return ff.values
def re_transf(feature_list... | jingmouren/antifraud | antifraud/feature_engineering/cnn/kmeans_generate_newdata.py | kmeans_generate_newdata.py | py | 5,761 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.loads",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number":... |
5809026859 | # ---
# jupyter:
# jupytext:
# formats: ipynb,py
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.9.1+dev
# kernelspec:
# display_name: Python [conda env:biovectors]
# language: python
# name: conda-env-biovectors-... | greenelab/biovectors | biorxiv_experiment/02_convert_biorxiv_to_bioc_format.py | 02_convert_biorxiv_to_bioc_format.py | py | 4,290 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "pathlib.Path",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "lxml.etree.XMLParser",
"li... |
3118798320 | import datetime
from django.test import TestCase
from django import forms
from lessons.models import User, Student, DayOfTheWeek, SchoolTerm, Booking, Invoice
from lessons.forms import BookingEditForm
from lessons.tests.helpers import create_days_of_the_week, create_user_groups
class BookingEditFormTestCase(TestCase)... | SaujanShr/Falcon | lessons/tests/forms/test_booking_edit_form.py | test_booking_edit_form.py | py | 13,559 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "django.test.TestCase",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "lessons.tests.helpers.create_user_groups",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "lessons.tests.helpers.create_days_of_the_week",
"line_number": 16,
"usage_ty... |
36285489456 | import io
import numpy as np
import os
import torch
import torch.nn as nn
import torch.optim as optim
import torchvision.models as models
import torchvision.transforms as transforms
from torch.utils.data import Dataset, DataLoader
from torch.utils.data.sampler import SubsetRandomSampler
from PIL import Image
from tqdm ... | abeja-inc/Platform_handson | bulldog_classification/train.py | train.py | py | 9,088 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "torch.device",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.environ.get",... |
21341170313 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# author: KrianJ
# datetime:2022/5/8 22:20
# software: PyCharm-predict_ffm_tf2
import tensorflow as tf
from tensorflow.keras import optimizers, losses, metrics
from sklearn.metrics import accuracy_score
from models_tf2.FFM import FFM
from utils.load_data import lo... | KrianJ/CtrEstimate | predict_ffm_tf2.py | predict_ffm_tf2.py | py | 1,834 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "utils.load_data.load_criteo_data",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tensorflow.cast",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "tensorflow.float32",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name... |
33728970062 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('skills', '0002_role_description'),
]
operations = [
migrations.AlterField(
model_name='seniority',
n... | cmdelatorre/roses | skills/migrations/0003_auto_20140928_2213.py | 0003_auto_20140928_2213.py | py | 403 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AlterField",
"line_number": 14,
"usage_type": "call"
},
{... |
20538630339 | """
Find how many times the sorted array is rotated
"""
"""
Time Complexity:- O(logn)
Space Complexity:- o(1)
"""
from typing import List
def findKRotation(arr: List[int]) -> int:
# Get the length of the input array 'arr'.
n = len(arr)
# Initialize the left and right pointers, 'ans' to positive infinity... | Amit258012/100daysofcode | Day8/how_many_times_rotated.py | how_many_times_rotated.py | py | 1,059 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 12,
"usage_type": "name"
}
] |
16422201393 | # !/usr/bin/env python3.5
# -*- coding: utf-8 -*-
# @Author: zhangqiang1104@pku.edu.cn
# @File: inputMatrix.py
# @Time: 18/4/9 15:48
# @Desc:
###################################################################
# second, prepare text samples and their labels
# print ('(1) load texts...')
# import os
# texts ... | YingShenPKU/shortTextClassify | system/classify/inputMatrix.py | inputMatrix.py | py | 3,392 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "jieba.cut",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "keras.models.load_model",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 83,
"usage_type": "call"
}
] |
2785518035 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
import atexit
import logging as log
from time import sleep
from html import escape
from datetime import date
import requests
def flush(config):
# prepare config
c = {'token': '', 'chat': '', 'caption': '\'通知摘要\''}
c.update(config)
if not c['toke... | TechCiel/Reachee | sender/telegram_summary.py | telegram_summary.py | py | 1,852 | python | en | code | 11 | github-code | 6 | [
{
"api_name": "datetime.date.today",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "requests.post",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "logging.debug",
"... |
15983128718 | from uuid import uuid4
from loguru import logger
class ArtistModel:
def __init__(self, songs_result_from_genius: dict, artist_id: int):
self.artist_id = artist_id
self.songs = songs_result_from_genius.get("response", {}).get("songs", [])
self.transaction_id = str(uuid4())
async def _... | vinireeis/Mjolnir | src/domain/artist/model.py | model.py | py | 2,486 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "uuid.uuid4",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "loguru.logger.error",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "loguru.logger",
"line_number": 52,
"usage_type": "name"
}
] |
40124665643 | """Pytest fixtures for testing suite."""
import shutil
import pytest
from sec_edgar_downloader import Downloader
@pytest.fixture(scope="function")
def downloader(tmp_path):
tmp_dir = tmp_path / "Downloads"
tmp_dir.mkdir()
dl = Downloader(tmp_dir)
yield dl, tmp_dir
shutil.rmtree(tmp_dir)
| plemonopoulos/Utilizing-unstructured-data-for-business-intelligence | SEC-10-K-Forms/sec-edgar-downloader-master/tests/conftest.py | conftest.py | py | 314 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sec_edgar_downloader.Downloader",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "shutil.rmtree",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 11,
"usage_type": "call"
}
] |
14424946223 | #!/usr/bin/python3
#-*- coding: utf-8 -*-
import sys
from elasticsearch import Elasticsearch
es_host = "127.0.0.1" #elasticsearch data host & port
es_port = "9200"
def moviesearch(searchword):
counter = 1
D={}
es = Elasticsearch([{'host':es_host,'port':es_port}],timeout=30)
#choose subject, searchword
sub... | mochangil/OSS_project | es/testsearch.py | testsearch.py | py | 944 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "elasticsearch.Elasticsearch",
"line_number": 13,
"usage_type": "call"
}
] |
5140742200 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import render, redirect
from django.views.generic import View
from django.contrib import messages
from jurnal.models import Jurnal
from transaksi.models import Transaksi
from django.http import HttpResponse
from django.contrib.auth.... | nunenuh/LatihanDjangoL1 | transaksi/views.py | views.py | py | 4,415 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.contrib.auth.mixins.LoginRequiredMixin",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "django.views.generic.View",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "jurnal.models",
"line_number": 22,
"usage_type": "name"
},
{
... |
29852053178 | from rest_framework.views import APIView
from django.shortcuts import render
from rest_framework.response import Response
from rest_framework import status
from django.http import HttpResponse, Http404, JsonResponse
from usermanagement.utils import RequestValidator
from django.contrib.auth.models import User
imp... | salran40/POAP | fabric/views.py | views.py | py | 33,196 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "django.http.HttpResponse",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "rest_framework.views.APIView",
"line_number": 44,
"usage_type": "name"
},
{
"api_name"... |
19063213761 | # Minet KEGG access functions
# Import modules
import re
import sys
import time
import queue
import threading
from requests import get as rget
from rdkit import Chem
# Import scripts
from poppy_helpers import *
from progress import Progress
# Define functions
def get_KEGG_text(kegg_id, krest="http://rest.kegg.jp"):
... | Asplund-Samuelsson/POPPY | poppy_KEGG_helpers.py | poppy_KEGG_helpers.py | py | 10,541 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "re.fullmatch",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "re.fullmatch",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number"... |
39123888800 | from sqlalchemy import (
ARRAY,
Boolean,
Column,
Integer,
JSON,
Numeric,
String,
TIMESTAMP,
Text,
)
from configs.database import Base
class Users(Base):
"""
user model
"""
__tablename__ = "users"
__table_args__ = {"schema": "users"}
id = Column(Integer,... | Dimaps716/prueba_backend_R5 | src/models/users/users.py | users.py | py | 1,033 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "configs.database.Base",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integer",
"line_number": 25,
"usage_type": "argument"
},
{
"api_name": "sqlalc... |
74176206587 | from django.shortcuts import render
# Create your views here.
import requests
def home(request):
country = request.GET.get('country')
month = request.GET.get('month')
year = request.GET.get('year')
url = f'https://api.aladhan.com/v1/calendarByAddress?address={country}&month={month}&year={year}'
... | ihababbas/football-project | adan/views.py | views.py | py | 545 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 25,
"usage_type": "call"
}
] |
30301603292 | import logging
from ignis.executor.core.modules.IModule import IModule
from ignis.executor.core.modules.impl.ICommImpl import ICommImpl
from ignis.rpc.executor.comm.ICommModule import Iface as ICommModuleIface
logger = logging.getLogger(__name__)
class ICommModule(IModule, ICommModuleIface):
def __init__(self, ex... | andreasolla/core-python | ignis/executor/core/modules/ICommModule.py | ICommModule.py | py | 3,226 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "ignis.executor.core.modules.IModule.IModule",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "ignis.rpc.executor.comm.ICommModule.Iface",
"line_number": 10,
"usage_type":... |
39955155290 | from django.views import View, generic
from django.shortcuts import render, redirect, HttpResponseRedirect, HttpResponse
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.auth.decorators import login_required
from .models import Catalog, Product, Gallery, Bracket, User
from django.conf impor... | di875c/shop | start_site/views.py | views.py | py | 7,825 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.views.View",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "models.Catalog.objects.all",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "models.Catalog.objects",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name... |
4435929876 | from abc import ABC
from datetime import datetime
from data.note import Note
from module.menu import Menu
class Add(Menu, ABC):
def execute(self, notes: dict) -> dict:
name = input("Введите название заметки: ")
body = input("Введите содержание: ")
last_id = 0
if notes:
... | Guillaumette/ControlReview | module/add.py | add.py | py | 594 | python | ru | code | 0 | github-code | 6 | [
{
"api_name": "module.menu.Menu",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "abc.ABC",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "data.note.Note",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"li... |
14988614265 | from setuptools import setup
package_name = 'sensory_controller'
setup(
name=package_name,
version='0.0.0',
packages=[package_name],
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + package_name]),
('share/' + package_name, ['package.xml']),
],
... | PetriJF/Hexapod | src/sensory_controller/setup.py | setup.py | py | 681 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "setuptools.setup",
"line_number": 5,
"usage_type": "call"
}
] |
30754685435 | from collections import Counter
for _ in range(int(input())):
n = int(input())
a = list(map(int, input().split(' ')))
b = Counter(a)
if b[0]:
print(len(a)-b[0])
else:
flag = False
for v in b.values():
if v > 1:
flag = True
if flag:
... | Tanguyvans/Codeforces | 789/A.py | A.py | py | 384 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.Counter",
"line_number": 7,
"usage_type": "call"
}
] |
12339464543 | #### TODO ####
'''
Schedule follows and unfollows
expand post possibilities
logging and try catching
Metadata for followers
emails on errors
'''
####
from API import InstagramBot, PexelsBot, GooglePlacesBot
from Caption import Caption
from SubmissionValidator import SubmissionValidator
import urllib.request
import ... | jblb2424/travelbot | main.py | main.py | py | 2,944 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "API.GooglePlacesBot",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "Caption.Caption",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "API.InstagramBot",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "API.InstagramBot... |
27133383272 | import tkinter as tk
from tkinter.constants import ANCHOR
from PIL import ImageTk,Image
from tkinter import ttk
from tkinter import messagebox
from tkinter import filedialog
import sqlite3
def main():
root = tk.Tk()
Login(root)
root.mainloop()
def logout(master):
master.withdraw()
toplevel ... | polekstulod/crms | main.py | main.py | py | 34,433 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "tkinter.Tk",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "tkinter.Toplevel",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "tkinter.Toplevel",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tkinter.Toplevel",
"... |
11775433407 | import logging
from datetime import datetime
from deye_events import DeyeEventList, DeyeEventProcessor
from deye_modbus import DeyeModbus
class DeyeSetTimeProcessor(DeyeEventProcessor):
"""
Set logger time when the logger becomes available online.
"""
def __init__(self, modbus: DeyeModbus):
... | kbialek/deye-inverter-mqtt | src/deye_set_time_processor.py | deye_set_time_processor.py | py | 1,482 | python | en | code | 154 | github-code | 6 | [
{
"api_name": "deye_events.DeyeEventProcessor",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "deye_modbus.DeyeModbus",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name":... |
27211783209 | import pytest
from practice_atcoder.abs.kagami_mochi import question
class Test(object):
@pytest.mark.parametrize("n,dn,expect", [
("4", ["10", "8", "8", "6"], "3"),
("3", ["15", "15", "15"], "1"),
("7", ["50", "30", "50", "100", "50", "80", "30"], "4"),
])
def test(self, n, dn, e... | powerpenguincat/practice-atcoder | tests/abs/test_kagami_mochi.py | test_kagami_mochi.py | py | 369 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "practice_atcoder.abs.kagami_mochi.question",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 7,
"usage_type": "attribute"
}
] |
39797308 | from __future__ import print_function
import torch
from torch import jit
import collections
import numpy as np
import math
import typing
import gc
from torch.utils.data import Subset, Dataset
DEBUG_CHECKS = False
def gc_cuda():
gc.collect()
torch.cuda.empty_cache()
def get_cuda_total_memory():
return... | BlackHC/BatchBALD | src/torch_utils.py | torch_utils.py | py | 6,322 | python | en | code | 210 | github-code | 6 | [
{
"api_name": "gc.collect",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.cuda.empty_cache",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "torch.cuda.get_devi... |
25205801790 | import os
import langid
import glob
filter_lang = ['ja', 'ko']
def main():
filter_dict = dict()
for filename in glob.glob('./*.txt'):
f = open(filename, 'r')
for line in f.readlines():
for word in line.split():
lang, conf = langid.classify(word)
if ... | etups/PixHack2016 | jieba/detect_lang.py | detect_lang.py | py | 669 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "glob.glob",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "langid.classify",
"line_number": 14,
"usage_type": "call"
}
] |
844231119 | # coding: utf-8
"""
Use the pseudoinverse of the extended system states to compute the output
weights.
"""
from __future__ import (
absolute_import,
division,
print_function,
unicode_literals,
)
import logging
import hyperopt
import hyperopt.mongoexp
import numpy as np
from esn import Esn
from esn.... | 0x64746b/python-esn | examples/frequency_generator/pseudoinverse.py | pseudoinverse.py | py | 4,865 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.tanh",
"line_number": 54,
"usage_type": "attribute"
},
{
"api_name": "hyperopt.hp.quniform",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "hyperopt.hp",
... |
27516700206 | from selenium import webdriver
import chromedriver_autoinstaller
chromedriver_autoinstaller.install()
opts = webdriver.ChromeOptions()
opts.add_argument("--headless")
opts.add_argument("--no-sandbox")
opts.add_argument("--disable-dev-shm-usage")
driver = webdriver.Chrome(options=opts)
driver.get("https://www.youtub... | Tintin361/Kiri-Chan | test.py | test.py | py | 432 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "chromedriver_autoinstaller.install",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.ChromeOptions",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 6,
"usage_type": "name"
},
{
... |
11194146043 | from argparse import ArgumentParser, Namespace
from tqdm import tqdm
import os
from shutil import copyfile
def parse_args():
parser = ArgumentParser()
parser.add_argument(
'-i', '--input', type=str, required=True,
help='Path to SIDD data folder'
)
parser.add_argument(
'-o', '--... | AlexeySrus/WPNet | research_pipelines/datasets/convert_sidd_to_paired_dataset.py | convert_sidd_to_paired_dataset.py | py | 1,208 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"... |
34641420635 | import ccxt
import market_lister
import json
import time
from datetime import datetime
from dateutil import tz
from pytz import timezone
class calculator:
def __init__(self, usd_cap=8000):
self.usd_cap = usd_cap
def write_data(self, symbol): #writes the BTC/USDT tick to data #fetches symbol ticker (... | officialnico/arb | calculator.py | calculator.py | py | 2,988 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "ccxt.binance",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "dateutil.tz.gettz",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "dateutil.tz",
"line_numb... |
910162950 | import datetime
import json
import subprocess
def transform_git_date(s):
"""Convert a date printed by git into a more condensed one."""
words = s.split()
return '%s %02i, %s' % (words[1], int(words[2]), words[4])
def get_releaseinfo():
"""Retrieve release info from git and also write releaseinfo.jso... | theochem/horton | doc/releaseinfo.py | releaseinfo.py | py | 1,689 | python | en | code | 83 | github-code | 6 | [
{
"api_name": "datetime.datetime.now",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "subprocess.check_output",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "... |
18019031011 | #################################
# Date: 2021/05/28
# Author: Miles Xu
# Email: kanonxmm@163.com
# Desc.: 生成随机行大文件
# 'A' 占一个字节, 1024个 占1KB
# ',' 占一个字节, 1024个 占1KB
# '\n' 占两个字节, 1024个 占2KB
#################################
# -*- coding: utf-8 -*-
import random
from tqdm import trange
fro... | DemonXD/Algorithm_Archieve | SORTS_and_MERGE-SORT/testfile/genLFile.py | genLFile.py | py | 1,448 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "random.choices",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "tqdm.trange",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_num... |
13071825109 | """Create the Flask app for the locations service."""
from bson.objectid import ObjectId
from datetime import datetime
from flask import (
Blueprint,
Flask,
jsonify,
make_response,
request)
from json import dumps
from pymongo import MongoClient
# Constants
DB_NAME = 'mongodb'
DB_USER = 'root'
DB_P... | charlesj68/microservice-tutorial | locations/source/locations.py | locations.py | py | 5,886 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "flask.Blueprint",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "flask.request.get_json",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "flask.requ... |
3712882089 | import pandas as pd
import numpy as np
import os
import matplotlib.pyplot as plt
from sklearn.preprocessing import OneHotEncoder
from sklearn.preprocessing import Imputer
from sklearn.preprocessing import LabelBinarizer
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler
from sklear... | Pengyang-Xu/ML | python/test.py | test.py | py | 3,793 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sklearn.base.BaseEstimator",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "sklearn.base.TransformerMixin",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "sklearn.base.BaseEstimator",
"line_number": 20,
"usage_type": "name"
},
{
... |
11236088523 | from flask import Flask, request, render_template, redirect, url_for
import nltk
import pickle
from textblob import TextBlob
import urllib.request as urllib
import json
import random
app = Flask(__name__)
@app.route("/")
def homepage():
return render_template('index.html', searchgif="", input_text="")... | nvurdien/Giffrey | app.py | app.py | py | 3,859 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.request.form",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "flask.reques... |
31264755169 | from matplotlib import pyplot as plt
import math
def find_t(vi,th):
theta = th * (math.pi/180)
viy= ((math.sin(theta)*vi))
t = viy/9.8
return t
def show_vector(vi,theta,len_of_time):
x_vals=[]
y_vals=[]
theta = theta*(math.pi/180)
viy = vi*math.sin(theta)
vix = ... | some-coder-online/plot-and-show-trajectory | testing.py | testing.py | py | 690 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "math.pi",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "math.sin",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "math.pi",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "math.sin",
"line_number": 17,
... |
457578517 | import torch
import torch.nn as nn
class SVMORegularizer(nn.Module):
def __init__(self):
super().__init__()
self.beta = 1e-3
def dominant_eigenvalue(self, A):
N, _ = A.size()
x = torch.rand(N, 1, device='cuda')
Ax = (A @ x)
AAx = (A @ Ax)
return AA... | peterzpy/ACL-DGReID | fastreid/modeling/losses/svmo.py | svmo.py | py | 1,025 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "torch.rand",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.eye",
"line_number":... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.