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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
32425523875 | import random
import time
from typing import Set
import schedule
from timmy import core
from timmy.data.war_state import WarState
from timmy.data.word_war import WordWar
from timmy.db_access import word_war_db
class WarTicker:
def __init__(self):
self.loaded_wars: Set[WordWar] = set()
self.activ... | utoxin/TimTheWordWarBot | timmy/core/warticker.py | warticker.py | py | 6,662 | python | en | code | 14 | github-code | 1 | [
{
"api_name": "typing.Set",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "timmy.data.word_war.WordWar",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.Set",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "timmy.data.word_war... |
19963060538 | import os
import sys
import numpy as np
from collections import OrderedDict
def groupSinglets(comp_name):
d = { "sm": "SM",
"lin": "L ",
"quad": "Q ",
"lin_mixed": "M ",
"sm_lin_quad": "SM+L+Q ",
"quad_mixed": "Q+Q+M ",
"sm_lin_quad_mixed": "SM+L+L+Q+Q+M ... | GiacomoBoldrini/D6tomkDatacard | makeDummies.py | makeDummies.py | py | 25,816 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "sys.exit",
"line_number": 199,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 207,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 239,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_num... |
12078242829 | import jittor as jt
from jittor import init
import math
from os.path import join as pjoin
from collections import OrderedDict
from jittor import nn
def np2th(weights, conv=False):
'Possibly convert HWIO to OIHW.'
if conv:
weights = weights.transpose([3, 2, 0, 1])
return jt.float32(weights)... | THU-CVlab/JMedSeg | model/TransUNet/vit_seg_modeling_resnet_skip.py | vit_seg_modeling_resnet_skip.py | py | 6,666 | python | en | code | 56 | github-code | 1 | [
{
"api_name": "jittor.float32",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "jittor.nn.Conv",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "jittor.nn",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "jittor.mean",
"line_... |
8662219899 | from django.core.management.base import BaseCommand
from django.utils.crypto import get_random_string
from django.utils import timezone
from user_paste.models import User, Post
import datetime
import string
class Command(BaseCommand):
help = 'Generates fake data for a local sqlite database'
def add_arguments(... | LoganHodgins/Pasta-Paste | user_paste/management/commands/gen_localdb.py | gen_localdb.py | py | 1,899 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.utils.timezone.now",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.utils.timezone",
"line_number": 16,
"usage_type": "name"
},
{... |
6619883045 | import pytesseract
import os
import sys
from PIL import Image
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfgen import canvas
from reportlab.lib.units import cm
from reportlab.pdfbase.ttfonts import TTFont
from reportlab.lib.pagesizes import A4
import fitz
import shutil
from PyQt5.QtGui i... | bydmak/pdfconvertpdf | main.py | main.py | py | 3,708 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pytesseract.pytesseract",
"line_number": 47,
"usage_type": "attribute"
},
{
"api_name": "fitz.open",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "os.mkdir",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_... |
10785625199 | # coding:utf-8
"""
@file: .py
@author: dannyXSC
@ide: PyCharm
@createTime: 2022年05月04日 21点47分
@Function: 请描述这个py文件的作用
"""
from Modal.Affiliation import Affiliation
from py2neo import Graph, NodeMatcher, Node
class AffiliationRepo:
label = "Affiliation"
def __init__(self):
pass
@staticmethod
... | dannyXSC/BusinessIntelligence | ETL/Repository/AffiliationRepo.py | AffiliationRepo.py | py | 1,653 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "py2neo.Graph",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "Modal.Affiliation.Affiliation",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "py2neo.NodeMatcher",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "py2neo.... |
20828422696 | from projects.models import *
from communities.models import *
from users.models import MossaicUser
from risk_models.models import *
from django import forms
from django.forms.models import inlineformset_factory
from django.forms.models import modelformset_factory
from django.forms.models import BaseInlineFormSet
fro... | parauchf/mossaic | risk_models/forms.py | forms.py | py | 2,232 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "django.forms.Form",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "django.forms.CharField",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "django.for... |
3789596757 | from django.shortcuts import render, HttpResponse, redirect
# HttpResponse = texto / redirect = redirecciones
from miapp.models import Article # Para usar modelos
from django.db.models import Q # Para usar OR en consultas
from miapp.forms import FormArticle # Para usar la clase formulario
from django.contrib import mes... | jesusbritomolina/Master-Python | 22-django/AprendiendoDjango/miapp/views.py | views.py | py | 10,896 | python | es | code | 0 | github-code | 1 | [
{
"api_name": "django.shortcuts.render",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 86,
"usage_type": "call"
},
{
"api_nam... |
38784164623 | from flask import Flask, render_template, request
import requests
from flask_fontawesome import FontAwesome
import folium
import csv
from folium.plugins import HeatMap
import datetime
from flask import Response
import statistics
import matplotlib.pyplot as plt
from matplotlib.figure import Figure
from matplotlib.backen... | andrew-hua/Y10Coding | trafficprogramfiles/hello.py | hello.py | py | 7,155 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "csv.reader",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "flask.Fl... |
33879492913 | import sys, time
import numpy as np
import matplotlib.pyplot as pl
from matplotlib.backends.backend_pdf import PdfPages
import h5py
from combined_model import CombinedInterpolator
from spi.comparison_models import PiecewiseC3K
from spi.utils import dict_struct, within_bounds
from spi.plotting import get_stats, qualit... | bd-j/spi | demo/miles_irtf_c3k/loo_combined.py | loo_combined.py | py | 7,722 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "combined_model.CombinedInterpolator",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "combined_params.pad_bounds",
"line_number": 44,
"usage_type": "call"
},
{
"api_na... |
1969927426 | import os
import json
import argparse
import time
import logging
from bs4 import BeautifulSoup
from typing import Optional, Dict
from doc2txt.grobid2json.grobid.grobid_client import GrobidClient
from doc2txt.grobid2json.tei_to_json import convert_tei_xml_file_to_s2orc_json, convert_tei_xml_soup_to_s2orc_json
from doc2... | clowder-framework/extractors-s2orc-pdf2text | doc2txt/grobid2json/process_pdf.py | process_pdf.py | py | 3,947 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "typing.Optional",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "doc2txt.grobid2json.gro... |
26211091171 | import os
import unittest
import itertools
import traceback
from chesspy import players
from chesspy.game import Game
from chesspy.board import Board
from chesspy.color import Color
from multiprocessing import Pool
from chesspy.analyzers import is_in_check, is_in_mate, adjacent_kings
class PlayerTest:
class TestP... | mikepartelow/chesspy | app/tests/test_players.py | test_players.py | py | 6,059 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "unittest.TestCase",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "chesspy.game.Game",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Pool",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "chesspy... |
6831655892 | import numpy as np
import imageio
from skimage.transform import resize
from scipy.ndimage import gaussian_filter
import matplotlib.pyplot as plt
import timeit
def mssim(
x: np.ndarray,
y: np.ndarray,
) -> float:
# Standard choice for the parameters
K1 = 0.01
K2 = 0... | 6-62x10-34Js/ImageProcessingAndPatternRecognition | interpolation_error_bluethner.py | interpolation_error_bluethner.py | py | 4,093 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.ndarray",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "numpy.ndarray",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "numpy.float64",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "numpy.float6... |
72974484835 | from datetime import datetime
from models.models import User, App, Lumos
from api import db
def resolve_users(obj, info):
return User.query.all()
def resolve_user(obj, info, user_id):
return User.query.get(user_id)
def resolve_create_user(obj, info, username, email, password):
new_user = User(username=u... | EdMarzal97/dux-backend | api/resolvers.py | resolvers.py | py | 2,765 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "models.models.User.query.all",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "models.models.User.query",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "models.models.User",
"line_number": 7,
"usage_type": "name"
},
{
"api_na... |
31386333656 | from lingpy import *
from lingpy.evaluate.acd import *
from collections import defaultdict, OrderedDict
from lingpy.evaluate.acd import _get_bcubed_score
def get_rhymes(dataset):
csv = csv2list(dataset+'.tsv',
strip_lines=False)
header = [h.lower() for h in csv[0]]
rest = csv[1:]
out = []
... | digling/network-in-hcp-paper | evaluation/rhymes.py | rhymes.py | py | 3,252 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "collections.OrderedDict",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "lingpy.evaluate.acd._get_bcubed_score",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "lingpy.evaluate.acd._get_bcubed_score",
"line_number": 80,
"usage_type": "c... |
44625569644 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 26 00:02:01 2018
@author: elenabg
"""
import sys
import time
import pickle
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
import re
import csv
df_all = pickle.load(open("df_all.p", "rb")) # cargar dataframe... | ElenaBadilloG/Noche-y-Niebla-Project | explore_all_data.py | explore_all_data.py | py | 4,608 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pickle.load",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "re.IGNORECASE",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "pandas.to_datetime",
"l... |
41564702032 | from bs4 import BeautifulSoup
import xlsxwriter
workbook = xlsxwriter.Workbook('aliexpress.xlsx')
worksheet = workbook.add_worksheet()
orders = []
fileN = 14
def readDataHTML():
global days
global weekdayBuckets
global mptc
global tptc
global targetdir
global fileN
for i in range(... | DawidPietrykowski/AliReader | AliReader/AliReader.py | AliReader.py | py | 4,155 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "xlsxwriter.Workbook",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "xlsxwriter.exceptions",
"line_number": 121,
"usage_type": "attribute"
}
] |
20628891853 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 5 19:54:41 2020
@author: phalinp
"""
import cv2 as cv
import numpy as np
def draw_rectangle(img):
cv.rectangle(img,(384,0),(510,128),(0,255,255),3)
#For rectangle if have to give top left corner i.e. (384,0)
#and bottom right i.... | P-H-Pancholi/opencv-python-tutorials | GUI_Features/draw_shapes_on_image.py | draw_shapes_on_image.py | py | 1,190 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "cv2.rectangle",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "cv2.destroyAllWindows",
"lin... |
16284369692 | """
validate and maniopulate genbank files.
"""
from setuptools import find_packages, setup
dependencies = ['click']
setup(
name='faketool',
version='0.1.4',
url='https://github.com/sgordon007/fake-tool',
license='BSD',
author='Sean Gordon',
author_email='seangordon07@gmail.com',
descripti... | sgordon007/fake-tool | setup.py | setup.py | py | 1,617 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "setuptools.setup",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 17,
"usage_type": "call"
}
] |
42110400732 | import cv2
# using USB webcam number 1
cam = cv2.VideoCapture(0)
# You can save your video according to the same size as your webcam stream or hardcode the size you like
# frame_width = int(cam.get(3))
# frame_height = int(cam.get(4))
# recorder = cv2.VideoWriter('output.avi', cv2.VideoWriter_fourcc('M','J','P','G'),... | abuelgasimsaadeldin/opencv-starter-pack | python/basic/video_writer.py | video_writer.py | py | 979 | python | en | code | null | github-code | 1 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.VideoWriter",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.VideoWriter_fourcc",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
... |
1887982137 | import datetime
def check_hour(hour):
"""
Check if an hour format is valid for the bot.
:param hour:
:return:
"""
if not hour:
return False
# If there are not ":" in the hour, is invalid.
if ":" not in hour:
return False
# Here it divides the hour in hours and min... | FernandooMarinn/Extra_hours_bot | Functionalities/Functionalities.py | Functionalities.py | py | 18,933 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "datetime.datetime.now",
"line_number": 186,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 186,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 187,
"usage_type": "call"
},
{
"api_na... |
8139571648 | from functools import cmp_to_key
class Solution:
def reconstructQueue(self, people: list) -> list:
people = sorted(people, key=cmp_to_key(self.cmp))
ans = []
for p in people:
ans.insert(p[1], p)
return ans
def cmp(self, a: list, b: list):
if a[0] > b[0]:
... | MinecraftDawn/LeetCode | Medium/406. Queue Reconstruction by Height(sort&greedy).py | 406. Queue Reconstruction by Height(sort&greedy).py | py | 499 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "functools.cmp_to_key",
"line_number": 6,
"usage_type": "call"
}
] |
72557088994 | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
# In[ ]:
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
"""
Created on Fri Oct 13 20:37:30 2023
@author: saimo
"""
import streamlit as st
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns... | saimohan16/CMSE-830-Foundations-of-Data-Science | Framingham_app/app.py | app.py | py | 35,064 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "streamlit.set_option",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "streamlit.set_page_config",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "stream... |
8865653662 | # -*- coding: utf-8 -*-
"""
Created on Wed Jul 31 09:10:52 2019
@author: Acer
"""
#%%
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
data=pd.read_csv(r"D:\projects\zomato.csv")
data.describe()
data.columns
# Transforming rate column
data['rate_new'] = data['rate'].ast... | atharva246/Machine-Learning-and-Data-Science | Zomato's Restaurant Rating Prediction.py | Zomato's Restaurant Rating Prediction.py | py | 9,234 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.nan",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "numpy.nan",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "seaborn.set",
"line... |
72921628835 | import urllib.request, json
from libbottles.utils import connection
from libbottles.exceptions import NoConnection
class Request:
_headers = {}
def __init__(self, headers: dict = None):
self._headers["User-Agent"] = "libbottles client (usebottles.com)"
if headers is not None:
s... | bottlesdevs/libbottles | libbottles/utils/request.py | request.py | py | 730 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "libbottles.utils.connection.check",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "libbottles.utils.connection",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "libbottles.exceptions.NoConnection",
"line_number": 17,
"usage_type": "call... |
71346990433 | # Add a filter to a palette
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-i', default="Palette.dmp", help='Input tileset palette file. default is Palette.dmp')
parser.add_argument('-o', default="Palette2.dmp", help='Output tileset palette file. default is Palette2.dmp')
parser.add_argument('... | Huichelaar/HuichFE | Graphics/RGBFilter.py | RGBFilter.py | py | 1,442 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 4,
"usage_type": "call"
}
] |
21578951425 | # -*- coding:utf-8 -*-
"""
time:2021/2/24
author:李辰旭
organization: BIT
contact: QQ:316469360
——————————————————————————————
description:
$ 处理二值合成轨迹图的一些函数。
主要包括:
滤波降噪
提取轮廓质心
拟合二次曲线
计算像素高度
——————————————————————————————
note:
python3.7以上版本才可运行
"""
import numpy as np
import cv2 as cv
from scipy.optimiz... | ChenXu-Li/kinect_measure_height | process.py | process.py | py | 4,148 | python | zh | code | 2 | github-code | 1 | [
{
"api_name": "cv2.findContours",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "cv2.RETR_EXTERNAL",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "cv2.CHAIN_APPROX_SIMPLE",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "... |
6536893855 | import torch
from torch.nn import functional as F
def compute_mvg(d_latents, latent_name, mean_v, inv_cov_v):
if latent_name == "W":
_w = d_latents["W"]
_v = F.leaky_relu(_w, negative_slope=5.0)
dv = (_v - mean_v)
loss = (dv.matmul(inv_cov_v).matmul(dv.T))
return loss
e... | adobe-research/sam_inversion | src/loss_utils.py | loss_utils.py | py | 1,421 | python | en | code | 168 | github-code | 1 | [
{
"api_name": "torch.nn.functional.leaky_relu",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.nn.functional",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "torch.nn.functional.leaky_relu",
"line_number": 14,
"usage_type": "call"
},
{
"a... |
18555835371 | import requests
from bs4 import BeautifulSoup
from selenium import webdriver
import time
import random
import os
from sqlalchemy.orm import sessionmaker
from sqlalchemy import create_engine
from model import *
from user_agent import generate_user_agent
import re
MAIN_URL = 'https://usa.tommy.com/ProductListingView'
d... | nonameuser2019/parser_tommy | parser.py | parser.py | py | 9,682 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname... |
11460338892 | from django.db import models
from django.utils.translation import gettext_lazy as _
class VCard(models.Model):
"""
Vcard model.
"""
title = models.CharField(
_("Title"),
blank=True,
max_length=150,
default="",
)
def __str__(self):
return self.title
... | 7saikat7/django-qr-vcard | qr_vcard/models/vcard.py | vcard.py | py | 409 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.db.models.Model",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "... |
26885414895 | import json
from datetime import timedelta
from db.redis import init_redis_pool
async def add_test_result_to_redis(result_id: int, user_id: int, id_company: int, id_quiz: int, data: dict):
redis = await init_redis_pool()
key = f"result_test:{result_id:}:id_user:{user_id}:id_company:{id_company}:id_quiz:{id_... | saindi/internship | app/db/redis_actions.py | redis_actions.py | py | 905 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "db.redis.init_redis_pool",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "db.redis.init_r... |
32790785348 | import requests
from bs4 import BeautifulSoup
import json
# URL of the web page to scrape
url = 'https://nookipedia.com/wiki/Category:New_Horizons_fish_icons'
# Send an HTTP request to the web page
response = requests.get(url)
# Check if the request was successful
if response.status_code == 200:
# Parse the HTML... | JohnMcSwiney/acnh_encyclopedia | server/img_scraping.py | img_scraping.py | py | 1,012 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 27,
"usage_type": "call"
}
] |
1917816925 | from trackingsimpy.simulation.revisit_interval import BaseRISimulation
from trackingsimpy.tracking import TrackingComputer
from trackingsimpy.radar import PositionRadar
import filterpy.common
from filterpy.kalman import IMMEstimator, KalmanFilter
from trackingsimpy.common.motion_model import constant_turn_rate_matrix, ... | PetteriPulkkinen/TrackingSimPy | trackingsimpy/simulation/revisit_interval/defined_imm.py | defined_imm.py | py | 4,167 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "trackingsimpy.simulation.revisit_interval.BaseRISimulation",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.eye",
"line_number": 20,
"usage_type": "call"
},
{
"... |
2299030097 | import json
import subprocess
import os
import zmq
class CommandLineBarcodeReader():
def __init__(self, config_path="scandit_commandline",port=5556):
self.context = zmq.Context()
self.process = None
self.config_path = config_path
self.port = port
self.start_comman... | xulihang/Barcode-Reading-Performance-Test | barcode_reader/commandline.py | commandline.py | py | 2,416 | python | en | code | 11 | github-code | 1 | [
{
"api_name": "zmq.Context",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "zmq.REQ",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "zmq.NOBLOCK",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "subprocess.Popen",
"line... |
22594227372 | ####################################################
##### This is focal loss class for multi class #####
##### University of Tokyo Doi Kento #####
####################################################
import torch
import torch.nn as nn
import torch.nn.functional as F
# I refered https://github.com/c0nn3r/Re... | ISCAS007/torchseg | torchseg/utils/loss/focalloss2d.py | focalloss2d.py | py | 2,324 | python | en | code | 7 | github-code | 1 | [
{
"api_name": "torch.nn.Module",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "torch.nn.functional.cross_entropy",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "torch... |
30523416801 | import sys
import random
import re
from functools import partial
from tqdm import tqdm
from junkdrawer import generator_looper
def lindenate(liRules, sInput="", lIterations=1):
"""This function iteratively processes a set of find-and-replace rules, liRules, on a given string, sInput.
By defaul... | Thelnar/Lindenmayer-Fractals-Web-App | lindenmayer.py | lindenmayer.py | py | 10,433 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "re.compile",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 68,
"usage_type": "attribute"
},
{
"api_name": "random.random",
"line_number... |
40759520304 | import json
import pickle
import random
from os.path import join, dirname
import nltk
from nltk.corpus import treebank
from nltk.tag.sequential import ClassifierBasedPOSTagger
MODEL_META = {
"corpus": "treebank",
"lang": "en",
"model_id": "nltk_treebank_clftagger",
"tagset": "Penn Treebank",
"algo... | OpenJarbas/ModelZoo | train/postag/nltk_treebank_clf_postag.py | nltk_treebank_clf_postag.py | py | 1,106 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "nltk.download",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_n... |
69878608033 | import sys
from collections import deque
N, M, V = map(int, sys.stdin.readline().split())
graph = [[0]*(N+1) for i in range(N+1)]
#인접행렬생성
for i in range(M):
a, b = map(int, sys.stdin.readline().split())
graph[a][b] = graph[b][a] = 1
visited = [False] * (N + 1)
def dfs(V):
visited[V] = True
print(V, ... | jjongram/demo-repository | self_study/src/baekjoon/bfsdfspractice.py | bfsdfspractice.py | py | 778 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "sys.stdin.readline",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "sys.stdin.readline",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"li... |
43073974779 | import logging
from typing import Dict
import grpc
from needlestack.apis import collections_pb2
from needlestack.apis import servicers_pb2
from needlestack.apis import servicers_pb2_grpc
from needlestack.apis import serializers
from needlestack.collections.collection import Collection
from needlestack.collections.sha... | needlehaystack/needlestack | needlestack/servicers/searcher.py | searcher.py | py | 6,488 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "needlestack.apis.servicers_pb2_grpc.SearcherServicer",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "needlestack.apis.servicers_pb2_grpc",
"line_number": 20,
"usa... |
29317960475 |
import sys
import time
import os
import gc
import json
import argparse
from pathlib import Path
os.environ["JAX_PLATFORMS"] = "cpu"
import jax
import flax
import numpy as np
import jax.numpy as jnp
import orbax
import orbax.checkpoint
from optax import MaskedNode
from etils import epath
from praxis import base_hyper... | Lisennlp/paxml_praxis | paxml/my_scripts/converts/qwen_hf_to_paxml.py | qwen_hf_to_paxml.py | py | 10,005 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.environ",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "paxml.train_states.TrainState",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "paxml.train_states",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": ... |
29453296966 | #
from typing import List
import numpy as np
from verypy.classic_heuristics.parallel_savings import clarke_wright_savings_function
from verypy.classic_heuristics.gaskell_savings import gaskell_lambda_savings_function, gaskell_pi_savings_function
from verypy.classic_heuristics.sweep import bisect_angle
SAVINGS_FN = {
... | jokofa/NRR | lib/nrr/utils.py | utils.py | py | 6,997 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "verypy.classic_heuristics.parallel_savings.clarke_wright_savings_function",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "verypy.classic_heuristics.gaskell_savings.gaskell_lambda_savings_function",
"line_number": 11,
"usage_type": "name"
},
{
"api_name"... |
34214137069 | """
Exp 00 - Tests Data preprocessing and trains a basic linear regression
Model for abalone age prediction
"""
from datetime import datetime
from sklearn.linear_model import LinearRegression
import numpy as np
class Exp00:
""" Experiment Class to test and run abalone data processing
... | zaccross/Linear-Regression-Project-0.5 | exp00.py | exp00.py | py | 5,389 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.loadtxt",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number"... |
26844478578 | import pytest
import hashtags as ht
@pytest.fixture
def tweets():
return [
{
'id_str': '1',
'text': " Doesn't matter what the text is. ",
'entities': {
'hashtags': [
{'text': 'fOO'},
{'text': 'Bar'}
... | marklar/massiu | test/test_hashtags.py | test_hashtags.py | py | 1,311 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pytest.fixture",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "hashtags.get_hashtags",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "hashtags.has_hashtag",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "hashtag... |
26434848146 | """create item table
Revision ID: ff9dac589eea
Revises: 8c1c7409f4e5
Create Date: 2022-07-10 08:58:37.265281
"""
from alembic import op
import sqlalchemy as sa
from datetime import datetime
# revision identifiers, used by Alembic.
revision = 'ff9dac589eea'
down_revision = '8c1c7409f4e5'
branch_labels = None
depends_... | guneybilen/fastAPI_justlikenew | alembic/versions/ff9dac589eea_create_item_table.py | ff9dac589eea_create_item_table.py | py | 1,168 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "alembic.op.create_table",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integ... |
27286453553 | from __future__ import annotations
import warnings
from typing import TYPE_CHECKING, Any, Dict, Optional, Union
import numpy as np
import pandas as pd
if TYPE_CHECKING: # pragma: no cover
from cleanlab.datalab.internal.data import Data
from cleanlab.datalab.internal.issue_manager import IssueManager
fro... | cleanlab/cleanlab | cleanlab/datalab/internal/data_issues.py | data_issues.py | py | 10,122 | python | en | code | 7,004 | github-code | 1 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "cleanlab.datalab.internal.data.Data",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "pandas.DataFrame",
"line_number": 36,
"usage_type": "attribute"
},
{
"api... |
73116502755 | import json
from dataclasses import dataclass
from datetime import datetime
from functools import partial
from typing import Optional
import arrow
# import pytest
from arrow import Arrow
from lyubishchev.clockify_fetcher.fetcher import (
generate_time_interval_from_time_series,
) # generate_event_from_time_seri... | eliteGoblin/lyubishchev | tests/unit/clockify_fetcher/test_generate_time_interval_from_time_series.py | test_generate_time_interval_from_time_series.py | py | 4,992 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "functools.partial",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "arrow.Arrow",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "arrow.get",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line... |
30654758574 | import os
import numpy as np
import zarr
from pyproj import Proj, transform
from rasterio import Affine
from rasterio.crs import CRS
from rasterio.transform import rowcol, xy
from scipy.stats import binom
def albers_conus_extent():
return "-2493045.0 177285.0 2342655.0 3310005.0"
def albers_conus_crs():
re... | carbonplan/forest-risks | carbonplan_forest_risks/utils.py | utils.py | py | 4,259 | python | en | code | 29 | github-code | 1 | [
{
"api_name": "numpy.asarray",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "rasterio.transform.xy",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "rasterio.Affine",
... |
16001559321 |
import unittest
# Modules needed to support tests
import os
import os.path
import tempfile
# Module under test
import dedupe.detector.detector as detector
class TestProcessFilename(unittest.TestCase):
def _make_standard_file_at(self, filename):
fout = open(filename, 'w+b')
fout.write(self.... | pcurry/DeDupe | test/python2.7/dedupe/detector/detector_test.py | detector_test.py | py | 1,694 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "unittest.TestCase",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "tempfile.mkdtemp",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.rmdir",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"... |
13463218914 | import argparse
import sys
import os
from random import randint as rand
#this will store lists of all the predictions needed for the labels
preds = {}
def dataReader(data_file):
f = open(data_file)
data = []
i = 0
for line in f.readlines():
line = [float(x) for x in line.split()]
d... | FrancisDcruz/ML_Algorithms | Bagged_Decission_Stump/Bagged_Decission_Stump.py | Bagged_Decission_Stump.py | py | 5,659 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "random.randint",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 180,
"usage_type": "call"
}
] |
33953298529 | from torch.utils.data import Dataset
from PIL import Image
from glob import glob
from tqdm import tqdm
import os
#SubClass of Dataset that takes the IN9L dataset stored in the folder
#indicated by the parameter "root" and perform operation on it
class IN9L_dataset(Dataset):
def __init__(
self,
... | Giordano-Cicchetti/MaskTune_NN | IN9L/IN9L.py | IN9L.py | py | 1,910 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 9,
"usage_type": "name"
},
{
"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",
... |
37555770747 | import requests
import lxml.html
headers = {"User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0"}
def Japanese_translation(english):
results = set()
url = 'https://jisho.org/search/'
response = requests.get(url + english, headers=headers)
html = lxml.html.froms... | HiroRittsu/DevelopingEnglish | lib/JISHO_ORG.py | JISHO_ORG.py | py | 1,078 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "lxml.html.html.fromstring",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "lxml.html.html",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "lxml.html"... |
24172843200 | import torch
def init_weights(m) -> None:
if isinstance(m, torch.nn.Linear):
torch.nn.init.xavier_uniform_(m.weight)
m.bias.data.fill_(0.01)
if isinstance(m, torch.nn.Embedding):
torch.nn.init.xavier_uniform_(m.weight)
class CategoryClassification(torch.nn.Module):
def __init__(
... | alexflorensa/product-category-classification | models/categoryclassification.py | categoryclassification.py | py | 1,216 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.nn",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.init.xavier_uniform_",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
... |
12951104701 | from typing import Any
from datetime import datetime
from datasets import load_dataset
import meilisearch
# https://huggingface.co/datasets/mc4
dataset = load_dataset("mc4", "ja", split="train", streaming=True)
documents: list[dict[str, Any]] = list(dataset.take(30000))
# add primary key and convert datetime string in... | Wattyyy/ms-error-reproduction | mc4_index.py | mc4_index.py | py | 824 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "datasets.load_dataset",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "typing.Any",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.da... |
21603769373 | from typing import List, Callable, Tuple
SUPER_MODULO = 5*17*7*13*19*11*3*2
def basic_monkey_throw(value: int, divider: int, success_monkey: int, fail_monkey: int) -> Tuple[int, int]:
# new_value = int(value / 3) # PART 1
new_value = value % SUPER_MODULO # PART 2
if new_value % divider == 0:
# new... | jochemvanweelde/adventofcode | aoc2022/Day 11/monkey_in_the_middle.py | monkey_in_the_middle.py | py | 4,374 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.Tuple",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.Callable",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_numb... |
15087752784 | import base64
from Crypto.Cipher import AES as aes
from Crypto.Util.Padding import pad
from Crypto.Random import get_random_bytes
from Crypto.Util.Padding import pad, unpad
key = get_random_bytes(16)
iv = b''
if iv == b'':
iv = get_random_bytes(16)
print(iv)
# cipher = aes.new(key, aes.MODE_CBC, iv)
# ... | alitcy/fyp-21-s1-02 | enc-dec.py | enc-dec.py | py | 2,111 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "Crypto.Random.get_random_bytes",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "Crypto.Random.get_random_bytes",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "Crypto.Cipher.AES.new",
"line_number": 25,
"usage_type": "call"
},
{
... |
69971042913 | # import modules
import pygame
import time
import random
#initialize pygame
pygame.init()
#########################################################
# our game variables
#get colors
white = (255, 255, 255)
black = (0, 0, 0)
red = (255, 0, 0)
blue = (20, 136, 234)
display_width = 800 #game width
display_height = 600 #... | evanswanjau/slither | slither.py | slither.py | py | 7,241 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "pygame.init",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "pygame.display... |
31533506345 | # 1. Connect to database
from pymongo import MongoClient
# from bson.objectid import ObjectId
uri = "mongodb://admin:Hanoi1@ds029224.mlab.com:29224/c4e21"
client = MongoClient(uri)
db = client.get_database()
# 2. Select collection
posts = db['posts']
# 3. Create document
post = {
"title": "Hôm nay là thứ 3",
... | unpreghini/htanh-lab-c4e21 | Lab1/db_blog.py | db_blog.py | py | 623 | python | vi | code | 0 | github-code | 1 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 6,
"usage_type": "call"
}
] |
40296713959 | '''
Rotina para gabarito da estratégia de busca de geolocalização do sensor SEARCH1
Programa de Autoria de Henrique Guimarães Coutinho. Domínio público.
Última atualização: 09/09/2021.
Como citar: endereço github.
'''
import numpy as np
#import matplotlib
import matplotlib.pyplot as plt
import math as m
... | henriquecoutin/search1 | Explore_and_Analyse_Data.py | Explore_and_Analyse_Data.py | py | 3,585 | python | pt | code | 1 | github-code | 1 | [
{
"api_name": "math.sqrt",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "math.pow",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 56,
"... |
7305644829 | import json
from src import plugin_loader
from unittest import TestCase
from src.attribute_methods import attribute_runner
root_directory = 'unit-tests/attribute_methods/sources/'
class TestAttributeRunner(TestCase):
def test_equal(self):
max_allowed = 0.4
with open(root_directory + 'settings.jso... | akhtyamovrr/plagchecker | unit-tests/attribute_methods/test_attribute_runner.py | test_attribute_runner.py | py | 732 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "unittest.TestCase",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "json.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "src.plugin_loader.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "src.plugin_loader",... |
34308854571 | # [si]rc - Asynchronous source RCON tool.
from decorators import *
import functools
from textwrap import dedent
import logging
import model
import sqlalchemy
import time
__all__ = [
"list", "select",
"add", "set", "delete",
"stats", "status", "rcon",
"error", "help"
]
def list( ... | koenbollen/sirc | src/commands.py | commands.py | py | 6,447 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "model.Server.search",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "model.Server",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "model.session.commit",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "model.sess... |
17609033288 | from weconnect.models.reviews import Review
from flask import current_app as app
class ReviewController():
"""
Controls all CRUD operations of the Review object.
"""
def create_review(self, content, business_id, user_id):
"""
Creates and adds a review to the app database.
... | JoshuaOndieki/weconnect | weconnect/review_controller.py | review_controller.py | py | 1,641 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "flask.current_app.database",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "flask.current_app",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "weconnect.models.reviews.Review",
"line_number": 25,
"usage_type": "call"
},
{
... |
16139182495 | import torch
from torch import nn
import torchvision.datasets as datasets
from torch.utils.data import Subset, DataLoader, TensorDataset
import numpy as np
import matplotlib.pyplot as plt
from tqdm import tqdm
from typing import Tuple
import os
import cv2
def get_cv_datasets(
dataset: torch.Tensor,
epoch_nr:... | m-ulmestrand/ego-generator | face/train.py | train.py | py | 7,497 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.Tensor",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "numpy.ndarray",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "numpy.concatenate",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "torch.utils.da... |
41579158009 | from flask import Flask, render_template, request, redirect, url_for, flash, abort, session, jsonify
import json
import os.path
# from werkzeug.utils import secure_filename
import datetime
import os
app = Flask(__name__)
app.permanent_session_lifetime = datetime.timedelta(days=30)
# Set up this secret_key to be genera... | StellarApp/dl-image-recognition | app.py | app.py | py | 2,634 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.urandom",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.session.keys",
"lin... |
13056722078 | from django.core.management.base import BaseCommand, CommandError
from bhojanalayas.models import Address, Details
import csv
# from float import float
class Command(BaseCommand):
def add_arguments(self, parser):
pass
def handle(self, *args, **options):
with open('../../../../restaurantsa912... | megharana/Fortinet-Challenge | WorldBhojanalaya/bhojanalayas/management/commands/moveCSVToDb.py | moveCSVToDb.py | py | 1,929 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "csv.reader",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "bhojanalayas.models.Details",
"line_number": 19,
"usage_type": "call"
},
{
"api... |
10285812257 | from selenium import webdriver
from selenium.common.exceptions import TimeoutException
import xlsxwriter as xw
workbook = xw.Workbook("scrap2.xlsx")
worksheet = workbook.add_worksheet("Noticias")
# worksheet_error_page = workbook.add_worksheet("Erros de página")
# worksheet_error_content = workbook.add_worksheet("Erro... | HugoPfeffer/web-scrap-casb | noticias v2.py | noticias v2.py | py | 2,675 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "xlsxwriter.Workbook",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Firefox",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "sele... |
71606823075 | # !/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019/10/11 14:31
# @Author : Tao.Xu
# @Email : tao.xu2008@outlook.com
import sys
import json
import superelasticsearch
from superelasticsearch import SuperElasticsearch
from elasticsearch import serializer, exceptions
from tlib import log
from tlib.retry... | txu2k8/libs-py | tlib/es/elasticsearch_super.py | elasticsearch_super.py | py | 17,979 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "sys.version_info",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "imp.reload",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "imp.reload",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sys.setdefaultencoding",
... |
5118190626 | import copy
import logging
from random import sample, uniform
import unittest
import numpy as np
import pandas as pd
import time
from sklearn.ensemble import RandomForestClassifier
from make_data import make_data
import mr
N_SAMPLES = [100, 1000, 10000]
N_CLASSES = [(3, 1), (5, 1), (7, 1)]
N_FEATURES = [12]
N_INFO =... | bradgwest/mtrf | debug_mr.py | debug_mr.py | py | 3,880 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "make_data.make_data",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "sklearn.ensemble.RandomForestClassifier",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "mr.mr_double_dataset",
"line_number": 80,
"usage_type": "call"
},
{
"... |
5699937924 | from django.conf import settings
from django.contrib.auth.base_user import BaseUserManager
from django.contrib.auth.models import AbstractUser
from django.contrib.postgres.fields import ArrayField
from django.db import models, transaction
from django.db.models import F
from lottery.models import Draw, get_number_of_ti... | conyappa/backend | conyappa/accounts/models.py | models.py | py | 7,960 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.conf.settings.INITIAL_EXTRA_TICKETS_TTL",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "django.db.models.QuerySet",
"line_number": 19,
"usage_type": "at... |
26401545941 | from flask import Flask, request, redirect, render_template, flash
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['DEBUG'] = True
app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+pymysql://build-a-blog:buildablog@localhost:8889/build-a-blog'
app.config['SQLALCHEMY_ECHO'] = True
db = SQLAlchemy(... | noragharris/build-a-blog | main.py | main.py | py | 1,740 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.request.args",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "flask.r... |
70497481953 | from functools import cmp_to_key
class Player(object):
def __init__(self, name, score):
self.name = name
self.score = score
def __repr__(self):
return f'{self.name} {self.score}'
def comparator(a, b):
if a.score > b.score:
return -1
elif a.score < b.sc... | NathanFee/InterviewQuestions | sort_complex.py | sort_complex.py | py | 950 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "functools.cmp_to_key",
"line_number": 33,
"usage_type": "call"
}
] |
72427446434 | from django.shortcuts import get_object_or_404,render, HttpResponseRedirect
from django.shortcuts import render
from django.contrib import messages
from .forms import todoform,dateform
from django.shortcuts import redirect
from django.conf import settings
# Create your views here.
# import datetime
from datetime impor... | ashtiv/django-diary | accounts/views.py | views.py | py | 7,635 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pprint.PrettyPrinter",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "logging.... |
29219958398 | from PyQt5.QtWidgets import QApplication, QSystemTrayIcon,QMenu
from PyQt5.QtGui import QIcon
import sys
from PyQt5.QtWidgets import QApplication, QSystemTrayIcon,QMenu
from PyQt5.QtGui import QIcon
from firebase_admin import credentials
from firebase_admin import db
import os
import speech_recognition as sr
import win... | BryanTG1221/IDA | IDA/scripts/icon.py | icon.py | py | 3,113 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.startfile",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.startfile",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pyttsx3.init",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "speech_recognition.Recognizer"... |
44425282922 | import configparser
import os
class ProjectConfig:
_cf = None
def __init__(self):
if ProjectConfig._cf is None:
try:
# 拼接获得config.ini路径
__CONFIG_FILE_PATH = os.path.dirname(os.path.abspath(__file__))
__CONFIG_FILE_NAME = 'config.ini'
... | cxb1004/emotion | config.py | config.py | py | 1,288 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.dirname",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "configparser.RawConfigPa... |
13786581127 | import cv2
img = cv2.imread('araba.png')
print(type(img))
# <class 'numpy.ndarray'>
print(img.shape)
cv2.imshow('orgin', img)
img_rotate_90_clockwise = cv2.rotate(img, cv2.ROTATE_90_CLOCKWISE)
cv2.imshow('cv_rotate_90_clockwise.jpg', img_rotate_90_clockwise)
# True
img_rotate_90_counterclockwise = cv2.... | MetehanYildiz25/ImageProcessing | Görüntü İşleme/aynalma_yöntem_2.py | aynalma_yöntem_2.py | py | 621 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "cv2.imread",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.rotate",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.ROTATE_90_CLOCKWISE",
"line_nu... |
8785524037 | from __future__ import absolute_import, division, print_function
import tempfile
import pytest
import paayes
TEST_RESOURCE_ID = "file_123"
class TestFileUpload(object):
@pytest.fixture(scope="function")
def setup_upload_api_base(self):
paayes.upload_api_base = paayes.api_base
paayes.api_b... | paayes/paayes-python | tests/api_resources/test_file_upload.py | test_file_upload.py | py | 2,061 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "paayes.upload_api_base",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "paayes.api_base",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "paayes.api_base",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": ... |
14485940599 | from boggle import Boggle
from flask import Flask, request, render_template, session, jsonify
boggle_game = Boggle()
app = Flask(__name__)
app.config["SECRET_KEY"] = "Chicken fears Maximus"
# default page / board
@app.route("/")
def homepage():
"""Creating a new board for the game"""
board = boggle_game... | shaunwo/19-flask-boggle | app.py | app.py | py | 1,600 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "boggle.Boggle",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.session",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "flask.session.get",
"line_n... |
22462377193 | from sklearn.feature_extraction.text import TfidfVectorizer
from preprocess import *
from db_controller import *
from konlpy.tag import Okt, Kkma, Mecab
from numpy.linalg import norm
from numpy import dot
import numpy as np
import os
import sys
def text_slice(documents:list): # db에서 꺼낸 기사 데이터 정제 -> [' 기사본문 ', ' 기사본문 '... | Mayberry2021/tf_idf | DTM.py | DTM.py | py | 1,528 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sklearn.feature_extraction.text.TfidfVectorizer",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.dot",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.norm",
"line_number": 31,
"usage_type": "call"
},
{
"api_n... |
26070430980 | import pytest
from django.core.files.base import ContentFile
try:
from wagtail.core.models import Page
except ImportError:
from wagtail.wagtailcore.models import Page
from wagtail_svgmap.models import ImageMap
from wagtail_svgmap.tests.utils import EXAMPLE2_SVG_DATA, IDS_IN_EXAMPLE2_SVG, IDS_IN_EXAMPLE_SVG
... | City-of-Helsinki/wagtail-svgmap | wagtail_svgmap/tests/test_model.py | test_model.py | py | 2,694 | python | en | code | 13 | github-code | 1 | [
{
"api_name": "wagtail_svgmap.models.ImageMap.objects.create",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "wagtail_svgmap.models.ImageMap.objects",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "wagtail_svgmap.models.ImageMap",
"line_number": 15,... |
72000249953 | import time
import math
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
import pytest
def calc():
return str(math.log(int(time.time())))
@pytest.fixture(scope="function... | lexeg/stepik---auto-tests-course | part#3/lesson-6_step-3.py | lesson-6_step-3.py | py | 1,482 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "math.log",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
... |
29069366892 | #blibliotheque
import json
from datetime import datetime
#variable
liste_taches = []
tache = {
"nom" :'',
"deadline" : '',
"statut" : '',
}
utilisateurs = {}
#///////LOGIN////////
nom_utilisateur = input("Entrez votre nom s'il vous plait :")
if nom_utilisateur in ut... | DTC-Formation/test-1-3-Woutnak | tp.py | tp.py | py | 2,680 | python | fr | code | 0 | github-code | 1 | [
{
"api_name": "datetime.datetime",
"line_number": 51,
"usage_type": "name"
},
{
"api_name": "datetime.datetime",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.fromisoformat",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "d... |
1502144500 | from typing import List
def rotate_clockwise(matrix: List[List[int]]) -> None:
"""
Rotate a nxn 2D int matrix 90 degrees clockwise in place
Args:
matrix: A nxn 2D int matrix
Returns:
matrix being roated 90 degree clockwise in place
Raises:
TypeError: If the matrix is ... | ucsd-ets/python-docker-example | pyapp/rotate_clockwise.py | rotate_clockwise.py | py | 1,014 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.List",
"line_number": 3,
"usage_type": "name"
}
] |
20495855214 | import torch
from typing import Tuple
def precompute_freqs_cis(dim: int, end: int, theta: float) -> torch.Tensor:
freqs = 1.0 / (theta ** (torch.arange(0, dim, 2)[: (dim // 2)].float() / dim))
t = torch.arange(end, device=freqs.device) # type: ignore
freqs = torch.outer(t, freqs).float() # type: ignore
... | mistralai/mistral-src | mistral/rope.py | rope.py | py | 882 | python | en | code | 4,296 | github-code | 1 | [
{
"api_name": "torch.arange",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "torch.arange",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.outer",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.polar",
"line_number": 9... |
19037842932 | import re
import numpy as np
import pandas as pd
from sklearn.linear_model import LogisticRegression
from sklearn.ensemble import RandomForestClassifier
from sklearn.impute import SimpleImputer
from imblearn.under_sampling \
import (RandomUnderSampler,
TomekLinks,
InstanceHardnessThreshold)... | vcerqueira/activity_monitoring_mimic | experiments_workflows/workflows.py | workflows.py | py | 9,133 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "experiments_workflows.general.prepare_training_set",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "sklearn.impute.SimpleImputer",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "sklearn.ensemble.RandomForestClassifier",
"line_number": 61,
... |
71940530913 | # -*- coding: utf-8 -*-
"""Tests for the LifeScan OneTouch Ultra 2 driver."""
__author__ = 'Diego Elio Pettenò'
__email__ = 'flameeyes@flameeyes.eu'
__copyright__ = 'Copyright © 2013, Diego Elio Pettenò'
__license__ = 'MIT'
import os
import sys
import unittest
import mock
sys.path.append(os.path.dirname(os.path.dir... | hrishioa/Juventas | Code/glucometerutils/test/test_otultra2.py | test_otultra2.py | py | 2,392 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "sys.path.append",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
22273310545 | import urllib.request
import json
import os
import ssl
from decouple import config
def allowSelfSignedHttps(allowed):
# bypass the server certificate verification on client side
if (
allowed
and not os.environ.get("PYTHONHTTPSVERIFY", "")
and getattr(ssl, "_create_unverified_context", ... | dhrumilpatel30/MachineLearingDemo | mlapp/mlconfigration.py | mlconfigration.py | py | 1,901 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "os.environ.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "ssl._create_default_https_context",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": ... |
22963801181 | from __future__ import unicode_literals
import unittest
import os
import dxfgrabber
filename = os.path.join(os.path.dirname(__file__), "assure_3d_coords.dxf")
DWG = dxfgrabber.readfile(filename, {"assure_3d_coords": True})
pcoords = [(1., 1., 0.), (-3., 2., 0.), (7., -1., 0.), (10., 10., 0.)]
class TestAssure3dC... | mozman/dxfgrabber | tests/test_assure_3d_coords.py | test_assure_3d_coords.py | py | 1,159 | python | en | code | 63 | github-code | 1 | [
{
"api_name": "os.path.join",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "dxfgrabber.readfile",
"lin... |
1585935309 | from typing import Optional, List
from highcharts_core.options.series.base import SeriesBase
from highcharts_core.options.series.data.treegraph import TreegraphData
from highcharts_core.options.plot_options.treegraph import TreegraphOptions
from highcharts_core.utility_functions import mro__to_untrimmed_dict
class T... | highcharts-for-python/highcharts-core | highcharts_core/options/series/treegraph.py | treegraph.py | py | 6,249 | python | en | code | 40 | github-code | 1 | [
{
"api_name": "highcharts_core.options.series.base.SeriesBase",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "highcharts_core.options.plot_options.treegraph.TreegraphOptions",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number":... |
17713082668 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 19 11:54:08 2020
@author: dohertyguirand
"""
from bert import Ner
import urllib.request
import io
import PyPDF2 as p2
import sys
sys.stdout = open('ex13', 'w')
url = 'https://pdf.usaid.gov/pdf_docs/PA00WPD5.pdf'
open = urllib.request.urlopen(ur... | yoditgetahun/decevals | decevals/findingtitles.py | findingtitles.py | py | 1,688 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.stdout",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "urllib.request.request.urlopen",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_na... |
24881547819 | from pathlib import Path
from downloader.config import default_config, UpdateLinuxEnvironment
from downloader.constants import K_DATABASES, K_DB_URL, K_SECTION, K_VERBOSE, K_CONFIG_PATH, K_USER_DEFINED_OPTIONS, \
K_COMMIT, K_UPDATE_LINUX_ENVIRONMENT, K_FAIL_ON_FILE_ERROR, K_UPDATE_LINUX
from downloader.full_run_se... | theypsilon-test/downloader | src/test/fake_full_run_service.py | fake_full_run_service.py | py | 5,295 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "downloader.full_run_service.FullRunService",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "downloader.config.default_config",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "test.fake_file_system_factory.FileSystemFactory",
"line_number": ... |
8499194960 | #!/usr/bin/env python3
"""
libminutaria-cli
================
:Authors:
Locynaeh
:Version:
1.0
Command Line Interface (CLI)) based on the libminutaria library.
This script is directly usable in a terminal. Use -h/--help arguments for more
information on how to use the CLI provided.
"""
from datetime import ... | Locynaeh/minutaria | minutaria-cli.py | minutaria-cli.py | py | 1,930 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "datetime.timedelta",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "libminutaria.get_cli_args",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "libminutaria.handle_cli_args",
"line_number": 36,
"usage_type": "call"
},
{
"api_nam... |
26383762180 | # -*- coding: utf-8 -*-
"""
ETM
"""
import numpy as np
import nltk
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize, RegexpTokenizer
from nltk.corpus import wordnet
from nltk.stem import WordNetLemmatizer
lemmatizer = WordNetLemmatizer()
from sklearn.feature_extraction import DictVectorizer
f... | anoopkdcs/REDAffectiveLM | Baselines/emotion_term_model.py | emotion_term_model.py | py | 9,858 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "nltk.stem.WordNetLemmatizer",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "nltk.download",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.ran... |
16991129528 | import dash_bootstrap_components as dbc
import pandas as pd
import plotly.express as px
from dash import html, dcc
import plotly.io as pio
pio.templates.default = "simple_white"
class FastViewCo2(object):
def __init__(self, data):
self.df_co2 = data
Un_Kt = 1000
co2_country = data.groupby(... | apinzonf/ds4a-carbon-market-project | app/fast_view_co2.py | fast_view_co2.py | py | 6,124 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "plotly.io.templates",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "plotly.io",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "pandas.DataFrame",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "plotly.express.chor... |
32838489808 | from enum import Enum
users = []
class Account(Enum):
USD = "USD"
KZT = "KZT"
RUB = "RUB"
EUR = "EUR"
class BankAccount:
name: str
surname: str
amount: int = 0
account: Account = 'KZT'
def __init__(self, name:str, surname:str, account:Account) -> None:
self... | akmaral0519/lab3 | task1.py | task1.py | py | 5,153 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "enum.Enum",
"line_number": 4,
"usage_type": "name"
}
] |
36458767221 | import cv2
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
def iterative_algorithm(img):
img_array = np.array(img).astype(np.float32)
I=img_array
Ti=50 #Set initial arbitrary value as threshold value
b=1
m,n=I.shape
diff = 255
count = 1
while diff!=0:
... | ravi-kr-singh/Image_Processing_nd_Computer_Vision_Programs | 07_iterative_algorithm.py | 07_iterative_algorithm.py | py | 1,614 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.array",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "cv2.imread",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_numb... |
71864036835 | from django.forms import ModelForm
from django.http import HttpResponse, HttpResponseNotFound, HttpResponseGone
from django.shortcuts import render, redirect, get_object_or_404
import datetime
from app.models import Book
class BookForm(ModelForm):
class Meta:
model = Book
fields = ['name', 'pages... | AshtonIzmev/crud-datatables-django | app/views.py | views.py | py | 1,879 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "app.models.Book",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.http.HttpResponse",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "app.mo... |
14928155080 | """Some useful type aliases relevant to this project."""
import pathlib
from typing import AbstractSet, Callable, List, Mapping, Optional, Tuple, Union
import torch
Layer = Union[int, str]
Unit = Tuple[Layer, int]
PathLike = Union[str, pathlib.Path]
TensorPair = Tuple[torch.Tensor, torch.Tensor]
TensorTriplet = Tup... | evandez/neuron-descriptions | src/utils/typing.py | typing.py | py | 960 | python | en | code | 59 | github-code | 1 | [
{
"api_name": "typing.Union",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number"... |
4454586278 | import json
from django.test import TestCase
from wagtail.models import Site
from ..models import GeneralPage
class TestGeneral(TestCase):
def setUp(self):
root = Site.objects.get().root_page
self.general_page = GeneralPage(
title="General page",
teaser_text="test",
... | nationalarchives/ds-wagtail | etna/generic_pages/tests/test_models.py | test_models.py | py | 802 | python | en | code | 8 | github-code | 1 | [
{
"api_name": "django.test.TestCase",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "wagtail.models.Site.objects.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "wagtail.models.Site.objects",
"line_number": 12,
"usage_type": "attribute"
},
{
... |
9980427418 | from helpers import *
import cv2
import tensorflow as tf
import json
import sys
# Checking for incorrect usage
if len(sys.argv) != 2:
print("Usage: python main.py path_to_image")
exit(-1)
image_file = sys.argv[1]
# These are set to the default names from exported models, update as needed.
INPUT_T... | AdvaitTahilyani/plant-health-classifier | main.py | main.py | py | 6,144 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.argv",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "cv2.imread",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_number":... |
5025490453 | # coding=utf-8
from pickle import FALSE
from sys import flags, version_info
from tkinter import filedialog
from STCore.Component import StarElement
from logging import root
from operator import contains
from os import scandir
from tkinter.constants import W
import matplotlib
from matplotlib import axes
imp... | JotaRata/StarTrak | STCore/ImageView.py | ImageView.py | py | 20,497 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "matplotlib.use",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "matplotlib.rcParams.update",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "ma... |
22545016509 | import pygame
from levels import *
from constants import *
from player import Player
from sounds import Sound
class Game:
def __init__(self):
pygame.init()
self.background_sound = Sound()
pygame.key.set_repeat(50, 50)
size = [SCREEN_WIDTH, SCREEN_HEIGHT]
self.screen = pyg... | gustavooquinteiro/mathgame | mathgame/game.py | game.py | py | 10,259 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pygame.init",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sounds.Sound",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pygame.key.set_repeat",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pygame.key",
"line... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.