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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
18824511482 | import os
dir_path = os.path.abspath(os.path.join(__file__ ,"../..")) # Moves one level up in the directory
import sys
sys.path.append(dir_path)
import logging
import time
import json
import numpy as np
import pandas as pd
import shutil
import random
from sklearn.utils import shuffle
from src.config import get_con... | Sardhendu/PropertyClassification | jobs/data_load.py | data_load.py | py | 20,497 | python | en | code | 23 | github-code | 7 | [
{
"api_name": "os.path.abspath",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"line_nu... |
3873798197 | from cgi import test
from datetime import datetime
from datetime import timedelta
import random
import re
from unittest import result
from flask import (
Blueprint, flash, g, redirect, render_template, request, session, url_for
)
from app import exam
from app.auth import configured_required, login_required
from ap... | dikwickley/planit | app/practice.py | practice.py | py | 13,863 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Blueprint",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "app.db.get_db",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 89,
"usage_type": "call"
},
{
"api_name": "app.auth.login_re... |
1089274234 | """empty message
Revision ID: 6b2cc6652042
Revises: a3e3a35deb56
Create Date: 2023-04-12 06:05:42.474902
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '6b2cc6652042'
down_revision = 'a3e3a35deb56'
branch_labels = None
depends_on = None
def upgrade():
# ... | ChuchoAraujo/data-base-simple | migrations/versions/6b2cc6652042_.py | 6b2cc6652042_.py | py | 1,922 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "alembic.op.create_table",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integ... |
13659144039 | import numpy as np
import json
from Layers import Dense
import logging
def mse(y_true, y_pred):
y_true = np.array(y_true)
y_pred = np.array(y_pred)
return np.mean(np.power(y_true-y_pred,2))
def mse_prime(y_true, y_pred):
y_true = np.array(y_true)
y_pred = np.array(y_pred)
return 2*(y_pred-y... | GuruprasadDalvi/Useful-Scripts | Python/Neural Network Lib/Network.py | Network.py | py | 1,740 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.array",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.power",
"line_number": 11,... |
40737918743 | import os
import sys
import json
import requests
from web3 import Web3
from solcx import install_solc
from solcx import get_solc_version, set_solc_version, compile_files
#Connecting to node
endpoint = "http://127.0.0.1:8545"
w3 = Web3(Web3.HTTPProvider(endpoint, request_kwargs={'timeout': 60}))
if (not w3.isConnecte... | cartesi/tournament-dlib | test/reveal_commit_test.py | reveal_commit_test.py | py | 4,092 | python | en | code | 4 | github-code | 7 | [
{
"api_name": "web3.Web3",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "web3.Web3.HTTPProvider",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_numbe... |
40781792499 | from django.shortcuts import render,redirect,get_object_or_404,reverse
from .forms import ArticleForm
from django.contrib import messages
from .models import Article,Comment
from django.contrib.auth.decorators import login_required
# Create your views here.
def articles(request):
#arama yapmak bu kadar kolay...
... | muslumyunsal/muslum_blog | article/views.py | views.py | py | 3,580 | python | tr | code | 0 | github-code | 7 | [
{
"api_name": "models.Article.objects.filter",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "models.Article.objects",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "models.Article",
"line_number": 13,
"usage_type": "name"
},
{
"api_name... |
72850918302 | import os.path as osp
from argparse import ArgumentParser
import mmcv
from mmcv.utils import ProgressBar
from mmocr.apis import init_detector, model_inference
from mmocr.models import build_detector # noqa: F401
from mmocr.utils import list_from_file, list_to_file
def gen_target_path(target_root_path, src_name, su... | Ascend/ModelZoo-PyTorch | PyTorch/built-in/cv/detection/DBpp_ID4145_for_PyTorch/tools/det_test_imgs.py | det_test_imgs.py | py | 3,613 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "os.path.split",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "os.path.splitext",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 2... |
35064490763 | import argparse
import logging
import sys
from typing import Any
from typing import Callable
from typing import Container
from typing import List
from typing import Optional
from typing import Sequence
from typing import Tuple
from typing import Type
from typing import Union
import a_sync
from marathon import Marathon... | Yelp/paasta | paasta_tools/check_services_replication_tools.py | check_services_replication_tools.py | py | 9,476 | python | en | code | 1,652 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "typing.Callable",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "mypy_extensions.Arg",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "paasta_tools.ut... |
70059951905 |
import requests
from bs4 import BeautifulSoup as bs
response = requests.get('https://www.pycon.kr/2017/')
html = response.text
#print(response.text)
#soup = bs(html, 'html.parser')
soup = bs(html, 'lxml')
title = soup.select('body > div.frontpage > div.onsky > div > div > p')
print(title[0].text)
| zylerk/ApexFund | ABL_F00429/ABL_F00429/simple.py | simple.py | py | 308 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 13,
"usage_type": "call"
}
] |
71135465505 | import string
import nltk
from nltk.collocations import *
from nltk.corpus import stopwords
def compare_types_reviews(pos_reviews, neg_reviews):
"""
Compare two lists of texts and find bigrams unique to each one
:param pos_reviews: List of positive reviews
:param neg_reviews: List of negative reviews... | alexbanert/AmazonReviewsAnalysis | features_extraction.py | features_extraction.py | py | 2,127 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "string.punctuation",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords",
"line_number": 37,
"usage_type": "name"
},
{
"api_nam... |
33081083914 | import pandas as pd
import dash
from dash import dcc , html
from dash.dependencies import Input, Output
# Load the CSV file into a Pandas DataFrame
df = pd.read_csv("airline_routes.csv")
# Initialize the Dash app
app = dash.Dash(__name__)
# Layout of the web application
app.layout = html.Div([
html.H1("Airline R... | fister12/AirlineAnalytics | AirlineOptimizationApp.py | AirlineOptimizationApp.py | py | 1,517 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.read_csv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "dash.Dash",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "dash.html.Div",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "dash.html",
"line_number":... |
86345106959 | import torch
import torch.nn as nn
from vit_pytorch.vit import Transformer, repeat
class ViT(nn.Module):
def __init__(self, *, num_views, num_classes, dim, depth, heads, mlp_dim, pool='cls',
dim_head=64, dropout=0., emb_dropout=0.):
# super().__init__()
super(ViT, self).__init__()... | TingtingLiao/CAR | lib/model/transformer.py | transformer.py | py | 1,752 | python | en | code | 87 | github-code | 7 | [
{
"api_name": "torch.nn.Module",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torch.nn.Parameter",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_n... |
21579835435 | import os
import torch
import torchvision
import torchvision.transforms as transforms
import torch.optim as optim
from torch import nn
# from torch.utils.tensorboard import SummaryWriter
from torch.utils.data import Dataset
from config import config
import logging
# ============================= Logger Settings ==... | erap129/NASUtils | pytorch_model_train.py | pytorch_model_train.py | py | 2,881 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.path.exists",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line... |
24564468597 | """Combine documents by doing a first pass and then refining on more documents."""
from __future__ import annotations
from typing import Any, Dict, List, Tuple
from langchain_core.documents import Document
from langchain_core.prompts import BasePromptTemplate, format_document
from langchain_core.prompts.prompt impor... | langchain-ai/langchain | libs/langchain/langchain/chains/combine_documents/refine.py | refine.py | py | 9,106 | python | en | code | 68,990 | github-code | 7 | [
{
"api_name": "langchain_core.prompts.prompt.PromptTemplate",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "langchain_core.prompts.prompt.PromptTemplate",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "langchain.chains.combine_documents.base.BaseCombineDocu... |
25901126820 | from flask import render_template, flash, redirect, url_for, request
from flask_login import current_user, login_user, logout_user, login_required
from app import app
from app.forms import LoginForm, RegistrationForm
from app.models import User
from werkzeug.urls import url_parse
from app import db
@app.route('/hello... | matcodewarrior/microblog | app/routes.py | routes.py | py | 2,801 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "app.app.route",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "app.app",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "flask.render_template",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "app.app.route",
"line... |
8551140700 | # created by Sijmen van der Willik
# 04/02/2018 14:02
import json
class Coordinaat(object):
def __init__(self, x, y):
self.x = x
self.y = y
class Schatkaart:
def __init__(self, path):
# vanaf hier wordt de file geladen en geparset
with open(path) as f:
content = ... | sijmenw/schatzoeken | coordinaat.py | coordinaat.py | py | 827 | python | nl | code | 0 | github-code | 7 | [
{
"api_name": "json.loads",
"line_number": 23,
"usage_type": "call"
}
] |
70829369504 | import itertools
import random
for k in itertools.count():
if all(random.randint(1,6)==2 for _ in range(3)):
break
print(f"Took {k} tries to get 3 2's")
# for i in itertools.count(1):
# s = "Fizz" if not i%3 else ""
# s += "Buzz" if not i%5 else ""
# s = s if s else str(i)
# print(s)
# fo... | PacktPublishing/Getting-Started-with-Modern-Python | Section4/generators_itertools.py | generators_itertools.py | py | 806 | python | en | code | 9 | github-code | 7 | [
{
"api_name": "itertools.count",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 5,
"usage_type": "call"
}
] |
26503143526 | from scripts import run_model
import time
# files for running the model
# Sequence and label files
train_enz_file = './data/seq/TrainEnzymeSequence.csv'
label_file = './data/label/TrainEnzymeLabels.csv'
# Feature dir for iFeature,kernel,possum
ifeat_vec_dir = './data/features/ifeature/featvec/train/'
kernel_vec_dir =... | deeprob/Protein-Classification-Tool | scratch.py | scratch.py | py | 747 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "time.time",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "scripts.run_model.check_performance",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "scripts.run_model",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "time.... |
10795273051 | # Import required packages
import pandas as pd
import numpy as np
from scipy.stats import t
class OLS:
"""Retrieves OLS estimator, standard errors and confidence intervals
- Initialization parameters:
- target = Pandas dataframe with target variable
- regressors = Pandas dataframe wi... | jose-jaen/Advanced-Econometrics | Algorithms/Python Code/Finite-Sample-Theory.py | Finite-Sample-Theory.py | py | 7,877 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.matmul",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.inv",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "numpy.linalg.pinv",
... |
2814839342 | import pickle
import requests
from bs4 import BeautifulSoup, element
URL = "https://medium.com/@owenyin/here-lies-wordle-2021-2027-full-answer-list-52017ee99e86"
response = requests.get(URL)
wordle_answers_webpage = response.text
soup = BeautifulSoup(wordle_answers_webpage, "html.parser")
big_text = soup.f... | Harry-Andrews/Wordle-Best-Guess-Scorer | get_word_data.py | get_word_data.py | py | 1,801 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "bs4.element.NavigableString",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "bs4.ele... |
36028923109 | from multiprocessing import Pool, cpu_count
import dill
from hic3defdr.util.progress import tqdm_avail, tqdm
def _pack_for_apply(fn, kwargs_list):
return [dill.dumps((fn, kwargs)) for kwargs in kwargs_list]
def _unpack_for_apply(payload):
fn, kwargs = dill.loads(payload)
return fn(**kwargs)
def para... | thomasgilgenast/hic3defdr | hic3defdr/util/parallelization.py | parallelization.py | py | 2,824 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "dill.dumps",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "dill.loads",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "multiprocessing.cpu_count",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Pool",... |
16747339211 | #!/usr/bin/env python3
import os
import argparse
import json
import yaml
parser = argparse.ArgumentParser(
description="This program converts json to yaml and vice versa. A file is saved with the json or yaml extension. if the file with that name exists, the program will overwrite it.",
usage="%(prog)s [optio... | marc010/netology_homework | sysadm-homeworks/04-script-03-yaml/04-script-03-yaml-task-03.py | 04-script-03-yaml-task-03.py | py | 2,709 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "json.decoder",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "yaml.safe_load",
... |
14091074558 | import json
from app.common import FROM_BLOCK_KEY, TO_BLOCK_KEY
from app.tokens.helpers import TokenHelpers
from app.tokens.serializers import contract_schema
from app.web3.helpers import Web3Helpers
from .constants import BLOCK_NUMBER, BLOCK, \
CONTRACT_ADDRESS_1, CONTRACT_ABI_1, \
CONTRACT_ADDRESS_2, CONTRAC... | nmvalera/vertogas-api | tests/test_web3.py | test_web3.py | py | 3,721 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "app.tokens.helpers.TokenHelpers",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "constants.CONTRACT_ADDRESS_1",
"line_number": 15,
"usage_type": "argument"
},
{
"api_name": "constants.CONTRACT_ABI_1",
"line_number": 15,
"usage_type": "argument"
... |
72276884704 | from typing import List
from fastapi import APIRouter, Depends, HTTPException, status
from fastapi.encoders import jsonable_encoder
from sqlalchemy.orm import Session
import datetime
import schemas, oauth2
from models import *
from database import get_db
router = APIRouter(
tags=['Social Contrib'],
prefix="/so... | BuzzDyne/PPAFastAPI | app/routers/socialContrib.py | socialContrib.py | py | 4,050 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.Session",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "fastapi.Depends",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "database.get... |
73946733342 | from django.contrib import admin
from django.urls import path,include
from . import views
app_name='country'
urlpatterns = [
path('', views.data, name='person_list'),
path('ajax/load-cities/', views.load_states, name='ajax_load_cities'),
path('getdetails/',views.getdetails),
path('uploadfil... | Bhanupriya08/login-logout | country/urls.py | urls.py | py | 680 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
40157588814 | from datasets import load_dataset, load_metric, load_from_disk
import numpy as np
import torch
import argparse
torch.set_printoptions(profile="full")
import random
from transformers import AutoTokenizer
from transformers import AutoModelForSequenceClassification, AutoConfig, TrainingArguments, Trainer
def setup_seed... | zhouhaoyi/JAT2022 | run_glue.py | run_glue.py | py | 5,574 | python | en | code | 9 | github-code | 7 | [
{
"api_name": "torch.set_printoptions",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "torch.manual_seed",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.cuda.manual_seed",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.... |
20952309607 | # coding=utf-8
from django.shortcuts import render
from msg_model import models
def login(request):
return render(request, 'login.html')
def index(request):
try:
# 返回字段
return_item = {}
# 获取登录状态
is_login = request.session.get('is_login')
# 判断用户是否登录
if is_login... | panjunbing/MsgForward | MsgForward/views.py | views.py | py | 1,226 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "django.shortcuts.render",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "msg_model.models.User.objects.filter",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "msg_model.models.User",
"line_number": 20,
"usage_type": "attribute"
},
{... |
20513430727 | from django_cron import CronJobBase, Schedule
from googleapiclient.discovery import build
from googleapiclient.errors import HttpError
from datetime import datetime, timedelta, timezone
from django.conf import settings
from .models import Video
class YouTubeApiFetch(CronJobBase):
RUN_EVERY_MINS = settings.CRON_RU... | sashank27/Youtube-API | api/cron.py | cron.py | py | 2,212 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django_cron.CronJobBase",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.conf.settings.CRON_RUN_FREQENCY_MINS",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 10,
"usage_type": "name"
... |
19449923180 | from glob import glob
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.colors
import os
import skimage.draw
import numpy as np
from tqdm.auto import tqdm
import cv2
import random
from sklearn.model_selection import train_test_split
import warnings
from awesometools.single2coco import convert2coco
... | pzSuen/awesome-code-zoo | awesometools/extract_patches_sliding.py | extract_patches_sliding.py | py | 23,207 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
... |
9530010089 | # Custom zeroconf implementation based on python-zeroconf
# (https://github.com/jstasiak/python-zeroconf) that supports Python 2
import errno
import logging
import select
import socket
import struct
import sys
import threading
import time
import ifaddr
log = logging.getLogger(__name__)
# Some timing constants
_LIS... | wjcarpenter/mvturnho_esphome_ili9341 | esphome/zeroconf.py | zeroconf.py | py | 23,989 | python | en | code | 4 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "struct.Struct",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "sys.exc_info",
"line_number": 89,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_nu... |
73910995422 | from typing import List
def remove_element(arr: List[int], key: int) -> int:
swap_point = 0
for i in range(len(arr)):
if arr[i] != key:
arr[i], arr[swap_point] = arr[swap_point], arr[i]
swap_point += 1
return swap_point
test1 = [3, 2, 3, 6, 3, 10, 9, 3]
assert remove_elem... | cs-cordero/interview-prep | grokking-coding/two_pointers/remove_elements.py | remove_elements.py | py | 465 | python | en | code | 9 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 4,
"usage_type": "name"
}
] |
33212511934 | import numpy as np
import matplotlib.pyplot as plt
from . import receivers
from . import sources
from .survey import Survey
# Import geometric_factor to make it available through
# SimPEG.resistivity.utils.geometric_factor (to ensure backward compatibility)
from ..utils import geometric_factor # noqa: F401
def Wen... | simpeg/simpeg | SimPEG/electromagnetics/static/resistivity/utils.py | utils.py | py | 4,141 | python | en | code | 438 | github-code | 7 | [
{
"api_name": "numpy.arange",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "numpy.r_",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "numpy.any",
"line_number":... |
25574246083 | from flask import Flask, request
from leap import leap
import json
app = Flask(__name__)
@app.route('/initialize')
def initialize_leap():
"""Route to initialize leap blockchain.
If its the first time this route gets called it will will create the genesis block and do all the initializer
stuff.
:retu... | Nijinsha/leap | leap/node.py | node.py | py | 1,288 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "leap.leap.create_leap",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "leap.leap",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "json.dumps",
"line_num... |
5294707308 | import argparse
from sacrebleu import metrics
import torch
import torch.nn as nn
import json
import numpy as np
import os
from torch.nn.utils.rnn import pad_sequence
from torch.utils.data import DataLoader, Dataset
from hybridnmt import TransformerLSTM, Config, Decoder
import math
import sys
import sacrebleu.metrics as... | alexrasla/TransformerLSTM | nmtdecoder.py | nmtdecoder.py | py | 9,560 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.path.append",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "hybridnmt.Config.PATH",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "hybridnmt.Co... |
23495914515 | from bs4 import BeautifulSoup
import requests
def find_price_on_instacart(product_name):
search_url = f"https://www.instacart.com/search?q={product_name}"
try:
response = requests.get(search_url)
soup = BeautifulSoup(response.text, "html.parser")
# Assuming you're looking ... | Alex-Sheardown/Recipe_Scraper | price_collection.py | price_collection.py | py | 768 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 9,
"usage_type": "call"
}
] |
19701922378 | import setuptools
with open('README.md', 'r') as fh:
long_description = fh.read()
setuptools.setup(
name='django-admin-left-menu',
version='0.1.1',
include_package_data=True,
license='BSD License',
description='A simple left menu for DjangoAdmin',
long_description=long_description,
lon... | ChanMo/django-admin-left-menu | setup.py | setup.py | py | 1,062 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "setuptools.setup",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 17,
"usage_type": "call"
}
] |
34359920590 | import pygame
import tkinter as tk
from tkinter import ttk
from Paddle import Paddle
from Ball import Ball
# from DropBox import DropBox
from DropBox2 import DropBox2
# Define some colors
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
GREEN = (0, 255, 0)
RED = (255, 0, 0)
GREY = (169, 169, 169)
LIGHT_GREY = (109, 109, 10... | braxtoneidem/PyPong | Pong.py | Pong.py | py | 4,363 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pygame.init",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "DropBox2.DropBox2",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "DropBox2.DropBox2",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "pygame.K_UP",
"li... |
13962957925 | '''
@Author: your name
@Date: 2019-10-30 21:03:58
@LastEditTime : 2019-12-27 16:10:29
@LastEditors : Please set LastEditors
@Description: In User Settings Edit
@FilePath: models\gae\model.py
'''
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.parameter import Parameter
from... | itsosy/csmddi | models/gae/model.py | model.py | py | 7,216 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "torch.nn.Module",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "models.gae.layers.GraphConvolution",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torc... |
20479625498 | import src # My utility functions
from collections import defaultdict, Counter
import re
STRINGS = sorted(src.read())
def sleepiest(strings):
guards = defaultdict(Counter)
current_guard = 0
sleep_minute = 0
for s in strings:
if 'Guard' in s:
current_guard = int(re.search(r'#(\d+)... | Nomen-Heroum/Advent_of_Code | 2018/day4.py | day4.py | py | 1,298 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "src.read",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 9,
"usage_type": "argument"
},
{
"api_name": "re.search",
... |
35354079971 | import pandas as pd
from pandas import DataFrame
import numpy as np
from itertools import combinations
import json
column_names = ["userid", "item", "category","buy_flag"]
data = pd.read_csv("../../dataset/taobao_data/data_train.csv",names=column_names, dtype=str )
userid = '1'
items = []
final_items = []
k=0
f = op... | sangyongjia/tf-recsys | recommender/word2vec/generate_item2item_dataset_improve.py | generate_item2item_dataset_improve.py | py | 1,837 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "pandas.read_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "itertools.combinations",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line... |
15525143091 | from fastapi import FastAPI
import uvicorn
from routes.user import usersRouter
from routes.article import articlesRouter
from routes.comment import commentRouter
from fastapi.middleware.cors import CORSMiddleware
app = FastAPI()
app.include_router(usersRouter)
app.include_router(articlesRouter)
app.include_router(com... | iso11ml/API_REST | main.py | main.py | py | 757 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "routes.user.usersRouter",
"line_number": 9,
"usage_type": "argument"
},
{
"api_name": "routes.article.articlesRouter",
"line_number": 10,
"usage_type": "argument"
},
{
"api_n... |
41460727125 | # -*- coding: utf-8 -*-
import logging
import config
_handler = logging.StreamHandler()
_formatter = logging.Formatter(config.LOG_FORMAT)
_handler.setFormatter(_formatter)
logger = logging.getLogger(config.LOGGER_NAME)
logger.addHandler(_handler)
logger.setLevel(logging.DEBUG)
| livoras/easydict | easydict/logger.py | logger.py | py | 281 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "logging.StreamHandler",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "logging.Formatter",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "config.LOG_FORMAT",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "logging.g... |
7685880681 | import pandas as pd
from twilio.rest import Client
# Your Account SID from twilio.com/console
account_sid = "ACfc2176b9bda9de5140eb3c770c6e627f"
# Your Auth Token from twilio.com/console
auth_token = "4a73d5e590e425d182406ef1cdfc15ad"
client = Client(account_sid, auth_token)
lista_meses = ['janeiro','fevereiro','mar... | Tenacc/Leitor-de-excel-com-envio-de-SMS | main.py | main.py | py | 1,036 | python | pt | code | 0 | github-code | 7 | [
{
"api_name": "twilio.rest.Client",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.read_excel",
"line_number": 16,
"usage_type": "call"
}
] |
29675116117 | import os
import time
import tweepy
import requests
from datetime import datetime
from dotenv import load_dotenv
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
dotenv_path = BASE_DIR + '/../../.env'
load_dotenv(dotenv_path)
current_date = datetime.today().strftime('%d-%m-%Y')
district_id_bbmp = 294 # BBMP
de... | RajshekharHoratti/cowin_vaccine_availability_tracker_using_a_twitter_bot | cowin_vaccine_availability_tracker_with_twitter_bot/cowin_twitter_bot.py | cowin_twitter_bot.py | py | 1,840 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.path.abspath",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "dotenv.load_dotenv",
"l... |
8529305879 | import sqlalchemy as db
import pandas as pd
class DBController:
def __init__(self, db_name: str):
self.db_name = db_name
self.engine = None
self.connection = None
metadata = None
def connect_db(self):
"""This method creates and returns a SQL-Alchemy engine t... | Jriosv/challenge-1 | db_controller.py | db_controller.py | py | 3,192 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.MetaData",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "sq... |
24830912949 | from app.db.configuration import sa
from app.model.employee import EmployeeModel
from flask.testing import FlaskClient
from flask import Flask
class TestDepartmentOverallPerformance:
def test_when_no_data_available(self, client: FlaskClient, app: Flask) -> None:
with app.app_context():
sa.ses... | WojciechKubak/FLASK-BASE | tests/routes/statistics/test_departments_overall_performance.py | test_departments_overall_performance.py | py | 1,130 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.testing.FlaskClient",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "app.db.configuration.app_context",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "... |
11125656218 | import logging
import os.path
# logger handler
logger = logging.getLogger ( 'Defacement Checker' )
logger.setLevel ( logging.INFO )
# create console handler and set level to debug
ch = logging.StreamHandler ( )
ch.setLevel ( logging.DEBUG )
# create formatter
formatter = logging.Formatter ( '%(asctime)s - %(name)s -... | Madhuka/site-defacement-cheacker | src/application_logger.py | application_logger.py | py | 1,026 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "logging.StreamHandler",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG"... |
27916897089 | from math import cos, sin, atan2, pi
import itertools
import pya
from pya import Point, DPoint, DVector, DSimplePolygon, SimplePolygon, DPolygon, Polygon, Region
from pya import Trans, DTrans, CplxTrans, DCplxTrans, ICplxTrans
from classLib.baseClasses import ComplexBase
from classLib.coplanars import CPW, CPWArc
fro... | shamil777/KLayout-python | Examples/lumped_element_resonator.py | lumped_element_resonator.py | py | 9,005 | python | en | code | 16 | github-code | 7 | [
{
"api_name": "pya.Application.instance",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "pya.Application",
"line_number": 50,
"usage_type": "attribute"
},
{
"api_name": "pya.PCellDeclarationHelper",
"line_number": 71,
"usage_type": "attribute"
},
{
"api... |
17844159809 | import os
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import cv2
import skimage.io as io
import scipy.io as scio
from search_polygon_predict import seg_color_trans, edge_embedding
from Hungarian_algorithm import match_trans_by_Hungarian
'''
indoorSeg方法:Indoor Scene Layout Estimation fr... | zhangjingxian1998/lcnn_room | predict_lcnn/02_LinSeg_lsun.py | 02_LinSeg_lsun.py | py | 4,107 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.path.join",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 47,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 4... |
71329309342 |
import scipy.io as sio
import sklearn.preprocessing as prep
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data as Data
import matplotlib.pyplot as plt
import torch.backends.cudnn as cudnn
import torch.nn.init as init
# torch.set_default_tensor_type(torch.Dou... | LachlanXu/Capstone | brainnetcnn.py | brainnetcnn.py | py | 7,576 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.nn.Linear",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.init.xavi... |
37041070490 | from __future__ import print_function
import argparse
import cv2
def display_image(img):
# 영상 정보 출력
print("(rows,cols,ch): {}".format(img.shape))
# 영상 출력 윈도우 생성
cv2.namedWindow('image',cv2.WINDOW_NORMAL)
# 윈도우에 영상 출력
cv2.imshow('image',img)
# 사용자 입력 대기
cv2.waitKey(0)
... | Sonny-Kor/Python-cv2 | display_image2.py | display_image2.py | py | 1,639 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "cv2.namedWindow",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.WINDOW_NORMAL",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "cv2.imshow",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"... |
6248204703 | import numpy as np
import open3d as o3d
import teaserpp_python
import numpy as np
import copy
from helpers import *
def resizing(pcd1_path, pcd2_path):
# 첫 번째 point cloud와 두 번째 point cloud 불러오기
pcd1 = o3d.io.read_point_cloud(pcd1_path)
pcd2 = o3d.io.read_point_cloud(pcd2_path)
o3d.visualization.draw_g... | cwha0212/map_merge | teaserpp.py | teaserpp.py | py | 4,092 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "open3d.io.read_point_cloud",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "open3d.io",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "open3d.io.read_point_cloud",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "... |
29613391379 | from utils import bin_dose
def fixed_dose(state, t, reward_fn):
a = bin_dose(35.0)
r = reward_fn(a, state)
return a, r
def age_to_decade(age):
if isinstance(age, str):
return int(age[0])
return float('nan')
def clinical_dosing_nan_to_zero(state,t,reward_fn):
a = clinical_dosing_alg(st... | ancorso/CS234_Final_Project | baseline_algs.py | baseline_algs.py | py | 1,302 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "utils.bin_dose",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "utils.bin_dose",
"line_number": 38,
"usage_type": "call"
}
] |
11161029717 | import numpy as np
import math
import csv
import matplotlib.pyplot as plt
plt.figure(figsize=(12, 6))
batch = 7424123
batch_name = '7424123-cohort-size-40IID-10trials-s1'
cohort_size = [5,10,15,20,30]
seed = list(range(1,11))
# seeds
for i in range(len(seed)):
rounds = []
# cohort sizes
for j in range(5):
test... | alexandriapawlik/federated | results/7424123-cohort-size-40IID-10trials-s1/graph.py | graph.py | py | 1,006 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "csv.reader",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot... |
36513752421 | from django.urls import path
from . import views
urlpatterns = [
path("login/", views.loginUser,name = 'login'),
path("logout/", views.logoutUser,name = 'logout'),
path("", views.profiles,name = 'profiles'),
path('profile/<str:pk>/', views.userProfile, name = 'user-profile'),
# path('userprof/<... | Soham2402/SIESdevs | users/urls.py | urls.py | py | 931 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
26189874047 | from global_vars import DEVICE, OUTPUT_DIR, LR
from torchvision import datasets, transforms
from torch.utils.data import DataLoader
from torch import nn, optim
import numpy as np
import torch
from typing import Tuple
import pickle
import time
import copy
import os
# modified function from
# https://pytorch.org/tuto... | andre1M/enterideas_assignment | src/utils.py | utils.py | py | 4,337 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "torch.nn.Module",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "torch.nn.Module",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"li... |
38958717686 | from selenium import webdriver
browser = webdriver.Chrome()
'''
link = 'http://suninjuly.github.io/redirect_accept.html'
browser.get(link)
submit = browser.find_element_by_css_selector('button[type="submit"]')
submit.click()
new_window = browser.window_handles[1]
browser.switch_to.window(new_window)
'''
link = 'htt... | mgolubyatnikov/stepik-selenium-course | 07-window.py | 07-window.py | py | 697 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 2,
"usage_type": "name"
},
{
"api_name": "math.log",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "math.sin",
"l... |
2133467673 | from typing import List, Optional
import datetime
from fastapi import APIRouter, Form, Depends
from starlette.responses import RedirectResponse
from starlette.status import HTTP_303_SEE_OTHER
from sqlalchemy.orm import Session
from db import schemas
from api.dependencies import get_db
from api.api import (
add_ac... | pwildenhain/payday-budget-api | api/forms.py | forms.py | py | 5,059 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "typing.Optional",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.orm.Sess... |
7873787938 | # project: p2
# submitter: rrgeorge
# partner: none
from io import TextIOWrapper
from zipfile import ZipFile
import csv, re
class ZippedCSVReader:
def __init__(self, filename):
self.filename = filename
with ZipFile(filename) as zf:
self.paths = zf.namelist()
self.paths.sort... | robiscuits/Decision-Tree | tree.py | tree.py | py | 8,566 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "zipfile.ZipFile",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "zipfile.ZipFile",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "io.TextIOWrapper",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "zipfile.ZipFile",
... |
34768666027 | import config
import reader
import sys
def print_error(err):
sys.stderr.write(err)
def print_message(msg):
sys.stdout.write(msg)
def check_input():
infile = config.DEFAULT_INPUT_FILE if len(sys.argv) <= 1 else sys.argv[1]
edge_sets = None
try:
f = open(infile)
in_reader = reader... | jimmyjwu/maximum_leaf_spanning_tree | python/checker.py | checker.py | py | 2,057 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "sys.stderr.write",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.stderr",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "sys.stdout.write",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"lin... |
2604839058 | from pytube import YouTube
url = "https://youtu.be/6GaYbeHYLqA"
my_video = YouTube(url)
# resolving MacOS error: run the following in PyCharm terminal
# open /Applications/Python\ 3.7/Install\ Certificates.command
my_video = my_video.streams.get_highest_resolution()
print("done1")
my_video.download()
print("done2")
| hachihung/download-YouTube-video | download youtube.py | download youtube.py | py | 320 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pytube.YouTube",
"line_number": 4,
"usage_type": "call"
}
] |
72870353502 | import torch
from fairseq.utils import new_arange
from fairseq.tasks import register_task
from fairseq.tasks.translation import TranslationTask, load_langpair_dataset
@register_task('translation_lev')
class TranslationLevenshteinTask(TranslationTask):
"""
Translation (Sequence Generation) task for Levenshtei... | Ascend/ModelZoo-PyTorch | PyTorch/dev/nlp/FairSeq_Transformer_ID0496_for_PyTorch/fairseq/tasks/translation_lev.py | translation_lev.py | py | 6,234 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "fairseq.tasks.translation.TranslationTask",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "fairseq.tasks.translation.TranslationTask.add_args",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "fairseq.tasks.translation.TranslationTask",
"line... |
17141273713 | import jax
from jax import numpy as jnp
from flax import linen as fnn
class Encoder(fnn.Module):
features: int = 64
training: bool = True
@fnn.compact
def __call__(self, x):
z1 = fnn.Conv(self.features, kernel_size=(3, 3))(x)
z1 = fnn.relu(z1)
z1 = fnn.Conv(self.features, kern... | syu-tan/jax-unet | models.py | models.py | py | 4,708 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flax.linen.Module",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "flax.linen",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "flax.linen.Conv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flax.linen",
"lin... |
43718955225 | import os
import json
import torch
import numpy as np
import matplotlib.pyplot as plt
from IPython.display import Image, display, HTML
from torch.autograd import Variable
import arabic_reshaper as ar
from bidi.algorithm import get_display
plt.rcParams['figure.figsize'] = (10, 8)
plt.rcParams['font.family'] = 'sans-s... | snrazavi/Deep_Learning_in_Python_2018 | Week07/Persian_Image_Captioning/utils.py | utils.py | py | 2,469 | python | en | code | 126 | github-code | 7 | [
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 13,
"usage_type": "attribute"
},
{
... |
72900564062 | """
https://leetcode.com/problems/minimum-index-sum-of-two-lists/
"""
from typing import List
class Solution:
def findRestaurant(self, list1: List[str], list2: List[str]) -> List[str]:
memo1 = {s: i for i, s in enumerate(list1)}
memo2 = {s: i for i, s in enumerate(list2)}
commons = {s: m... | eronekogin/leetcode | 2020/minimum_index_sum_of_two_lists.py | minimum_index_sum_of_two_lists.py | py | 470 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 10,
"usage_type": "name"
}
] |
3196141558 | import math
from torch import nn
def get_activation(name: str) -> nn.Module:
name = name.lower()
if name == "relu":
return nn.ReLU()
elif name == "gelu":
return nn.GELU()
elif name == "sigmoid":
return nn.Sigmoid()
elif name in ("swish", "silu"):
return nn.SiLU()
... | SimonLarsen/stort | models/example.py | example.py | py | 2,744 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "torch.nn.ReLU",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "torch.nn.GELU",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 10,
... |
627073109 | import requests
from bs4 import BeautifulSoup as BS
def get_soup(url:str) -> BS:
response = requests.get(url)
soup = BS(response.text, 'lxml')
return soup
def get_last_page(soup:BS) -> int:
last = soup.find('li', {'class':'last'})
if last is None:
return 1
return int(last.text) | MunarbekJ/mini_project | bots/bot_with_parsing/parsing/parsing_utils.py | parsing_utils.py | py | 313 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "bs4.BeautifulSoup",
... |
71214256542 | from collections import defaultdict
def makeConnected(n, connections):
if len(connections) < n - 1:
return -1
# Create graph
graph = defaultdict(list)
for u, v in connections:
graph[u].append(v)
graph[v].append(u)
# DFS to find connected components
visited... | ane1ok/oop | hw1.py | hw1.py | py | 920 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "collections.defaultdict",
"line_number": 8,
"usage_type": "call"
}
] |
71076820064 | from app.services.route_auth import authorize_and_log
import os
import platform
import re
import psutil
from datetime import datetime
from fastapi import APIRouter, Request, Depends
from fastapi.templating import Jinja2Templates
from app.api.depends.manager import manager
templates = Jinja2Templates(directory="app/r... | Linklelo/pear-admin-fastapi | app/api/routes/admin/monitor.py | monitor.py | py | 3,514 | python | en | code | 15 | github-code | 7 | [
{
"api_name": "fastapi.templating.Jinja2Templates",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "fastapi.APIRouter",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "fastapi.Request",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "... |
12998840496 | from quantification import quantify
from identification import identify
from get_nutritional_info import nutrients
import cv2
import argparse
''' main.py:
This class is used to run the back end classes: identification, quantification and get nutritional information
Values are returned to the server by being printed. A... | HarryGleeson/MealAnalyzer | MealAnalyzerBackend/main.py | main.py | py | 1,178 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "identification.identify",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "quantifica... |
18461600891 | """meiduo URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... | daxiong001/meiduo | meiduo/urls.py | urls.py | py | 2,006 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.urls.path",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "... |
34581939738 | import os
import sys
import random
import subprocess
import argparse
#~ local imports
import srvr_codes
import my_paths
import prefixes
def args_setup():
parser = argparse.ArgumentParser(
description = "OpenVPN connection thingy.",
epilog = "Example: python ovpn_connect.py -c uk")
parser.add... | alleetanner/ovpn | ovpn_connect.py | ovpn_connect.py | py | 1,672 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "my_paths.udp",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "my_paths.auth",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "subproce... |
28400365408 | from django.conf import settings
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase
from apps.projects.models import Study, Project, Analysis
from os.path import join
class ViewsTest(TestCase):
def setUp(self):
self.project_name = "PT... | mdschramm/dashboardngs | pbg/apps/cancer/tests/test_views.py | test_views.py | py | 1,413 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.test.TestCase",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.TEST_DIRECTORY",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_na... |
32129222037 | """empty message
Revision ID: 21c2a9ebd5e1
Revises: 272d63492648
Create Date: 2020-06-14 00:13:35.962986
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '21c2a9ebd5e1'
down_revision = '272d63492648'
branch_labels = None... | Mubangizi/project-cohort-backend | migrations/versions/21c2a9ebd5e1_.py | 21c2a9ebd5e1_.py | py | 1,103 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "alembic.op.drop_table",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "alembic.op.create_table",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "alembic.op",... |
33801885462 | """
Routine to load master dicitonary
Version for LM 2020 Master Dictionary
Bill McDonald
Date: 201510 Updated: 202201
"""
import datetime as dt
def load_masterdictionary(file_path, print_flag=False, f_log=None, get_other=False):
start_local = dt.datetime.now()
# Setup dictionaries
_master_dictionary = ... | felixpoirier1/PolyFinances | utils/MasterDictionary.py | MasterDictionary.py | py | 5,247 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "datetime.datetime.now",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.now",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "da... |
15030118588 | import pandas as pd
import networkx as nx
#Sample Population
pop = pd.read_csv('Data/erie-data/Erie_pop_id.csv').iloc[:,1:]#.set_index('id')
print('Total population in ERIE County is:', len(pop))
#Networks"
#hhold_networks
hhold_nw = nx.read_adjlist('Data/erie-data/networks/hhold_nw.csv', delimiter=',')
#daycare
dayc... | njiang8/seir-multi | src/parameter.py | parameter.py | py | 950 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.read_csv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "networkx.read_adjlist",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "networkx.read_adjlist",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "networkx.r... |
2261573537 | import os
import cv2 as cv
def find_images(dir, ext):
print(ext[0])
if ext[0] != ".":
ext = "." + ext
for file in os.listdir(dir):
if file.endswith(ext):
resizeImg(dir + "\\" + file, "small-images\\" + file, 0.2)
def resizeImg(src, dst, factor):
img = cv.imread(src)
res... | tomer-DL/imageClassifier | image_finder.py | image_finder.py | py | 532 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.listdir",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.INTER_AREA",
"line_number": 1... |
42842493959 | # -*- coding: utf-8 -*-
from __future__ import print_function
from probabilityFunctions import delta, delta2, err, err2, est, Ptheta, PthetaMax
from sage.all import RR, ZZ, ceil, sqrt, pi, cos, arccos, floor, sin
import numpy as np
import matplotlib.pyplot as plt
from samplingfailures import normalize, rotate, sampleF... | KULeuven-COSIC/PQCRYPTO-decryption-failures | DirectionalFailureBoosting/findingfailurelocation.py | findingfailurelocation.py | py | 10,946 | python | en | code | 8 | github-code | 7 | [
{
"api_name": "sage.all.RR",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sage.all.RR",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sage.all.RR",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sage.all.RR",
"line_number": ... |
8038859693 |
import math
import pygame
import random
# from player import Plane
# from enemy import Enemy
# Import pygame.locals for easier access to key coordinates
# Updated to conform to flake8 and black standards
from pygame.locals import (
FULLSCREEN,
RLEACCEL,
K_UP,
K_DOWN,
K_LEFT,
K_RIGHT,
K_ESC... | MolluscMonk/game_testing | the_room.py | the_room.py | py | 4,010 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "math.sqrt",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "math.atan",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "math.cos",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "math.sin",
"line_number": 45,
"u... |
36325145763 | # %%
import pandas as pd
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_squared_error, mean_absolute_error, mean_absolute_percentage_error
# %%
# Read the input file into a pandas DataFrame
df = pd.read_csv('input-data.csv')
df
# ... | cpalazzi-ra/forecasting-attendance | forecast-attendance.py | forecast-attendance.py | py | 2,793 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.read_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.get_dummi... |
11167609397 | from flask import *
import sqlite3
app = Flask(__name__)
@app.route("/")
def index():
return render_template("index.html")
#############################################################################
@app.route("/add")
def add():
return render_template("add.html")
@app.route("/savedetails",methods = ["PO... | anfernee84/Pysoft | Flask_HW/crud.py | crud.py | py | 3,492 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sqlite3.connect",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "sqlite3.Row",
"li... |
29369892521 | import redis
import time
import json
import logging
r = redis.StrictRedis(host='localhost', port=6379, db=0, decode_responses=True)
class RedisLogin:
EXPIRATION_TIME = 60 * 5
MAX_FAILED_ATTEMTPS = 5
@staticmethod
def make_redis_key(email, ip):
return '{0}-{1}'.format(email, ip)
@staticme... | tiilt-lab/chemistry-dashboard | server/redis_helper.py | redis_helper.py | py | 3,191 | python | en | code | 4 | github-code | 7 | [
{
"api_name": "redis.StrictRedis",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 2... |
29141713328 | import numpy as np
from matplotlib import pyplot as plt
# Utility functions
# Cost function J
def cost(x, y, theta):
m = np.size(y)
#j = np.sum(np.square(np.matmul(x, theta) - y))/(2 * m)
j=((np.matmul(x, theta) - y).transpose()*(np.matmul(x, theta) - y))/(2 * m)
#j = ((x* theta - y).transpose() * (... | A9Marshe/ML | session3/Utility.py | Utility.py | py | 1,603 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.size",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.matmul",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.size",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 20... |
71108709343 | import os
import re
import time
import threading
import webbrowser
import argparse
# Opções de instalação e configuração do ambiente e do Django
parser = argparse.ArgumentParser(description='Opções de instalação do Django')
parser.add_argument('-i', '--ignore', action='store_true',
help='Ignora a ... | amaurirg/django_config | django_config.py | django_config.py | py | 7,412 | python | pt | code | 0 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"lin... |
8997296024 | import abc
from collections import defaultdict
from typing import Iterable, TYPE_CHECKING, Any, Optional, List, Dict, Tuple, Union, Set
from pandas import DataFrame
from pathpy.core.classes import BaseClass
from pathpy.core.api import Node
from pathpy.models.network import Network
from pathpy.models.directed_acyclic_... | pathpy/pathpy | pathpy/processes/process.py | process.py | py | 10,287 | python | en | code | 77 | github-code | 7 | [
{
"api_name": "pathpy.logger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pathpy.models.network.Network",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "pathpy.models.network.Network",
"line_number": 28,
"usage_type": "name"
},
{
"api_nam... |
7793265382 | #!/usr/bin/env python
###################################################################################
# Written by Wei, Hang #
# weihanghank@gmail.com #
##############################################... | highopes/k8s_networkpolicy | aci2k8s.py | aci2k8s.py | py | 4,638 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "my_py.k8s.data_input.read_data",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "kubernetes.config.load_kube_config",
"line_number": 111,
"usage_type": "call"
},
{
"api_name": "kubernetes.config",
"line_number": 111,
"usage_type": "name"
},
{
... |
17147129754 | from endpoint.models import Mapping, Fullname
from django.shortcuts import render, get_object_or_404
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework.exceptions import APIException
from rest_framework import viewsets
from endpoint.serializers import MappingSeri... | PGower/PNS | pns_web/endpoint/views.py | views.py | py | 4,796 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "rest_framework.views.APIView",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "rest_framework.exceptions.APIException",
"line_number": 28,
"usage_type": "call"
},
{
... |
73498501983 | from flask import Flask, request, render_template, flash
from bs4 import BeautifulSoup
import requests, re, os, time, secrets
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKCYAN = '\033[96m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\... | tommiecc/ScrolllerDownloader | src/app.py | app.py | py | 5,204 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "secrets.token_hex",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "requests.exceptions",
... |
2798303912 | '''子弹射击'''
import pygame
from pygame.sprite import Group
from Settings import Settings
from ship import Ship
import check as ck
from button import Button
from gameStats import GameStats
from ScoreBoard import Scoreboard
def run_game():
'''背景 平台初始化'''
pygame.init()
ai_settings = Settings()
#screen = pyg... | harry-fan/python-crawler | pygame/alien_invasion.py | alien_invasion.py | py | 1,796 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pygame.init",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "Settings.Settings",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pygame.display"... |
6885643187 | from flask import Flask, render_template, request, url_for,redirect,flash
import sys
sys.path.append('/home/h4si/instaBot/IntsgramTwitterBot')
from database import dbLite
app = Flask(__name__)
app.secret_key = b'_5#y2L"F4Q8z\n\xec]/'
@app.route('/',methods=('GET', 'POST'))
def home():
error = None
if request... | HasiEraPro/IntsgramTwitterBot | webServerFlask/server.py | server.py | py | 1,635 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.path.append",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"li... |
9063714724 | import discord
from discord.utils import get
from discord.ext import commands
import os
import youtube_dl
client = commands.Bot(command_prefix="!")
@client.command()
async def conectar(ctx):
canal = ctx.message.author.voice.channel
if not canal:
await ctx.send("No estas conectado a un canal de voz")
... | JosephAnderson234/discrod-bot | test/test2.py | test2.py | py | 574 | python | es | code | 0 | github-code | 7 | [
{
"api_name": "discord.ext.commands.Bot",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "discord.utils.get",
"line_number": 15,
"usage_type": "call"
}
] |
2778763851 | import threading
import socket
import json
from peer_broadcast import PeerBroadcast
import socket_protocol as sp
BUFFER_SIZE = 1024
# The handler for peer connections
class PeerHandler(threading.Thread):
def __init__(self, conn, peer_list, server, handlers):
threading.Thread.__init__(self)
se... | Mechasparrow/Sparkles | p2p-networking/server_p2p_node.py | server_p2p_node.py | py | 5,634 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "threading.Thread",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "threading.Thread.__init__",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": ... |
43048402634 | import praw
from praw.util.token_manager import FileTokenManager
import os
import logging
import secrets
import string
from random import random,randint
from datetime import datetime
from time import sleep, time
REQUEST_DELAY_IN_SECONDS=5
logger = logging.basicConfig(
level=logging.INFO,
encoding='utf-8',
... | lazynooblet/reddit-nuke | docker/src/app.py | app.py | py | 4,513 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.basicConfig",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.getenv",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line... |
72599413344 | import random
import sys
import numpy as np
import seaborn as sns
import scipy.stats as stats
if len(sys.argv) < 3:
print("Need two argumnets: outputfile, cases")
print("i.e python create_test.py test.txt 1000000")
exit()
outputFile = sys.argv[1]
cases = int(sys.argv[2])
# some other variables that can b... | ZhaoFuheng/Panakos-Chasing-the-Tail | src/P4_Panakos/create_test_zipf.py | create_test_zipf.py | py | 773 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "sys.argv",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "numpy.arange",
"line_num... |
32083911677 | from django.shortcuts import redirect
from django.views.generic import ListView
from taggit.models import Tag
from hitcount.views import HitCountDetailView
from django.http import JsonResponse
from connectors.Blogs.BlogManager import PostConnector
class HomeView(ListView):
blog_connector = PostConnector()
... | Developer-R-7/CaffeineCode | blog/views.py | views.py | py | 6,258 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "django.views.generic.ListView",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "connectors.Blogs.BlogManager.PostConnector",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.views.generic.ListView",
"line_number": 30,
"usage_type":... |
8721315333 | import shutil
import os
import numpy as np
import shutil
from numpy import genfromtxt
from common import *
import multiprocessing
from multiprocessing import Pool
#raw_db_list_path = '../data/lrs2/raw/pretrain.txt'
#raw_db_list_path = '../data/lrs2/raw/test.txt'
#raw_db_list_path = '../data/lrs2/raw/val.txt'
raw_db_l... | itsyoavshalev/End-to-End-Lip-Synchronization-with-a-Temporal-AutoEncoder | Utils/generate_frames_from_videos.py | generate_frames_from_videos.py | py | 2,065 | python | en | code | 17 | github-code | 7 | [
{
"api_name": "os.path.isfile",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "os.mkdir",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 4... |
1751404284 | from flask import Flask, request,abort,jsonify,Response
from flask_restful import Api, Resource, reqparse
import requests
from requests.auth import HTTPBasicAuth
import urllib3
urllib3.disable_warnings()
import arrow
from infinisdk import InfiniBox
from capacity import GB,GiB
from zone import *
from shared import *
imp... | ibrenner/ibox_translator | volume.py | volume.py | py | 11,306 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "urllib3.disable_warnings",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "infi.dtypes.iqn.make_iscsi_name",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "requests.auth.HTTPBasicAuth",
"line_number": 67,
"usage_type": "call"
},
{
... |
17558433539 | from __future__ import annotations
import re
import dataclasses as dc
import argparse
from pathlib import Path
import logging
import logging.config
import sqlite3
import time
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
from ... | seungbaeji/binance-crawler | link_crawler/main.py | main.py | py | 4,514 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "logging.basicConfig",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "dataclasses.f... |
8313680799 | import numpy as np
import pylab as plt
import time
import random
from scipy.sparse.linalg import eigs,eigsh
from scipy.sparse.linalg import LinearOperator
# def Sx(phi1,i1):
# k=np.zeros([2**(l-1-i1),2**(i1+1)])
# k[:,:]=np.reshape(phi1,[2**(l-1-i1),2**(i1+1)],'F')[:,:]
# for i in np.arange(0,2**... | ashodkh/Density-Matrix-Renormalization | lanczos.py | lanczos.py | py | 1,463 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.zeros",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.mod",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 42,... |
31532023205 | #!/usr/bin/env python3
"""Utility to vendor and install Python pip packages from source."""
import argparse
import json
import logging
import os
import re
import sys
from typing import Dict
from typing import List
from typing import NamedTuple
from typing import Optional
import urllib.request
import config
import pyp... | draffensperger/pipsource | pipsource/pipsource.py | pipsource.py | py | 3,798 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "requireme... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.