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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
40333577823 | import feedparser
from lxml.html import fromstring
from config.config import get_software_list, save_threat_db, save_vuln
from config.config import check_saved_threats, check_saved_vulns
class CISAVulnerability:
def __init__(self, vendor_product, description, published, cvss, cve_info):
self.vendor_produc... | aleprada/PyMISP_CISA_alerts | cisa/cisa.py | cisa.py | py | 4,382 | python | en | code | 6 | github-code | 18 | [
{
"api_name": "config.config.get_software_list",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "config.config.get_software_list",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "feedparser.parse",
"line_number": 62,
"usage_type": "call"
},
{
"... |
74337276199 | #Program to convert a color image to grayscale image
from skimage import color, io
#Read an image from a file
img = io.imread('image.png')
#Convert the image tp grayscale
hsv_image = color.rgb2hsv(img)
io.imshow(hsv_image)
io.show()
| PacktPublishing/Computer-Vision-with-Python-3 | Chapter01/codes/skimage_rgb_hsv.py | skimage_rgb_hsv.py | py | 239 | python | en | code | 61 | github-code | 18 | [
{
"api_name": "skimage.io.imread",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "skimage.io",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "skimage.color.rgb2hsv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "skimage.color",
"... |
71398600999 | import collections, copy
Card = collections.namedtuple('Card',['rank','suit'])
class Deck(object):
def __int__(self):
''' Initializes a deck of cards.'''
ranks = [str(n) for n in range(2,11)] + list('JQKA')
suits = 'spades diamonds clubs hearts'.split()
self._cards = [Card(rank,suit) for rank in ranks for... | zacharytower/FlipBackCards | cards.py | cards.py | py | 979 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "collections.namedtuple",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number": 27,
"usage_type": "call"
}
] |
9129704424 | def imrotate(img_path:str, degree:np.float32, interpolation='nearest'):
if interpolation not in ['nearest','bilinear']:
print("Unknown Interpolation. Plese Choose either 'nearest' or 'bilinear'")
import sys
sys.exit(1)
import skimage.io
import math as ma
# check... | bkumardevan07/Digital-Image-Processing | Assignment-2/ImgRotate.py | ImgRotate.py | py | 3,539 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sys.exit",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "skimage.io.io.imread",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "skimage.io.io",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "skimage.io",
"lin... |
20998067813 | from flask import Flask
#from werkzeug.datastructures import T #架站軟體 做route回應
app = Flask(__name__) # route 設定
from flask import request,abort #request接收訊息
from linebot import LineBotApi,WebhookHandler # LINEBOTAPI接收訊息 # handle 識別碼
from linebot.exceptions import InvalidSignatureError
from linebot.models import MessageE... | Ricky1647/linebot | linebotest.py | linebotest.py | py | 5,231 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask.Flask",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "linebot.LineBotApi",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "linebot.WebhookHandler",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path.join",
... |
21173254060 | #!/usr/bin/env python
"""
Data classes defining Variants with added functionality for manipulating them.
"""
from typing import Optional
from pysam import VariantFile
from pysam.libcbcf import VariantRecord
from var_annot.ensembl import get_vep_data
class Variants:
"""Data class managing many Variant classes as ... | kwdunaway/variant_annotation | var_annot/variants.py | variants.py | py | 6,397 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pysam.VariantFile",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "typing.Optional",
"line_number": 43,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
... |
72223282921 | import torch
import torch.nn as nn
from timm.models.layers import DropPath
from model.gcn_lib.torch_edge import DenseDilatedKnnGraph
from model.gcn_lib.torch_vertex import GraphConv2d
from model.gcn_lib.torch_nn import get_act_layer
from torch.nn import Sequential as Seq
from data import ClipFramesLen
class FFN(nn.Mo... | Xiong-JiaHao/GraphPhys | Denoise_Graph.py | Denoise_Graph.py | py | 4,966 | python | en | code | 0 | github-code | 18 | [
{
"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.Sequential",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"lin... |
72157105000 | from functools import cache
from matplotlib import pyplot as plt
from itertools import combinations
from joblib import Parallel, delayed
import json
import random
import os
import math
import numpy as np
# imports for Isaac's code
from filtered_constraints import filtered_constraints as fc, make_correct_rows as crow... | ikmartin/ising-clustering | constraint-reduction/aux_generation.py | aux_generation.py | py | 2,488 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.path.splitext",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numb... |
28898153796 | import logging
from pathlib import Path
import pytest
from flit_core import config
samples_dir = Path(__file__).parent / 'samples'
def test_flatten_entrypoints():
r = config.flatten_entrypoints({'a': {'b': {'c': 'd'}, 'e': {'f': {'g': 'h'}}, 'i': 'j'}})
assert r == {'a': {'i': 'j'}, 'a.b': {'c': 'd'}, 'a.e.f... | pypa/flit | flit_core/flit_core/tests/test_config.py | test_config.py | py | 7,316 | python | en | code | 2,031 | github-code | 18 | [
{
"api_name": "pathlib.Path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flit_core.config.flatten_entrypoints",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flit_core.config",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "fli... |
24950161916 | import controller
import time
from hardpotato import *
import numpy as np
import matplotlib.pyplot as plt
import softpotato as sp
from scipy.optimize import curve_fit
import os
from scipy.stats import linregress
import shutil
import serial
import time
import dill
from pathlib import Path
import datetime
number_runs =... | jrlLAB/ElectroLab | src/electrolab/b_cleaning_macrochip_test.py | b_cleaning_macrochip_test.py | py | 12,413 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "time.time",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "os.mkdir",
"line_number": 27,... |
33855124562 | from django import forms
from django.contrib.admin import register, ModelAdmin
from django.urls import path, reverse
from django.utils.html import format_html
from django_mptt_admin.admin import DjangoMpttAdmin
from leaflet.admin import LeafletGeoAdmin
import logging
from reversion.admin import VersionAdmin
from thread... | bryceprince0/it-assets | organisation/admin.py | admin.py | py | 9,245 | python | en | code | null | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "django.forms.ModelForm",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "django.forms... |
74775772518 |
import argparse
import cv2
ap=argparse.ArgumentParser()
ap.add_argument("-i", "--image", required = True, help='Path to the image')
args=vars(ap.parse_args())
image=cv2.imread(args["image"])
print("width: %d pixels" % (image.shape[1])) #goruntunun boyutlarini inceler
print("height: %d pixels" % (image.shap... | kubracetinkaya/OpenCV | 3/book1.py | book1.py | py | 486 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"line_n... |
24305565208 | import requests
# Make a GET request to the API endpoint
response = requests.get('https://api.adzuna.com/v1/api/jobs/us/search/1?app_id=cc3c6bd4&app_key=3fe3e17eff25c1091b93ff10a8f6a8f3&results_per_page=6')
# Parse the JSON response
data = response.json()
# Extract the information from each job
jobs = data['results'... | Abdelrhman2021/Job-Portal-Website | Trial.py | Trial.py | py | 1,195 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 4,
"usage_type": "call"
}
] |
32172481145 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# @Description:
# @PreInstall:
# @Author : claer
# @File : time_util.py
# @Version: 1.0.0
# @Time : 2019/9/25 18:49
# @Project: scripts_python
# @Package:
# @Software: PyCharm
import datetime
import time
def get_every_day(begin_date, end_date):
"""
获取两个日期间的所有... | bajins/scripts_python | utils/time_util.py | time_util.py | py | 1,673 | python | en | code | 6 | github-code | 18 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 25,
"usage_type": "call"
},
{
"api_... |
7300472045 | import cv2
import time
import sys
import traceback
import numpy as np
from .utils import EasyDict
from rich import print
import slideflow as sf
from slideflow.util import model_backend
if sf.util.tf_available:
import tensorflow as tf
import slideflow.io.tensorflow
gpus = tf.config.experimental.list_physic... | abdulkarimab/slideflow | slideflow/workbench/slide_renderer.py | slide_renderer.py | py | 12,898 | python | en | code | null | github-code | 18 | [
{
"api_name": "slideflow.util",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.config.experimental.list_physical_devices",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "tensorflow.config",
"line_number": 15,
"usage_type": "attribute"... |
12695788829 | import asyncio
import board
import keypad
agua = 0
radio = 9.0
intervalo = 10
ajuste = 1.18
limite = 1000
def pluviometria():
global agua
agua += 1
print("Agua: ",agua)
# def resetPluviometria()
# global agua
# agua = 0
def calcularMM():
global agua
mm = agua * 0.2794
return mm
... | manuelblancopavon/EstacionMeteorologica | Programacion/RaspberryPiPicoW/tests/pluviometro.py | pluviometro.py | py | 1,079 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "keypad.Keys",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "asyncio.sleep",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "asyncio.sleep",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "asyncio.create_task",
"li... |
14763653873 | import time
import math
import operator
from PIL import Image
from functools import reduce
from appium.webdriver.common.touch_action import TouchAction
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from Utils.YamlMethod import XiaoMaUtils
fr... | trentwangmeng/test | Base/WebBase.py | WebBase.py | py | 7,735 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "Base.InitDriver.init_driver",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.support.wait.WebDriverWait",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.support.wait.WebDriverWait",
"line_number": 44,
... |
7124995370 | import torch
from torch import nn
import torch.nn.functional as F
from torch.autograd import Function, Variable
from .backbone import build_backbone
from .transformer import build_transformer, TransformerEncoder, TransformerEncoderLayer
import numpy as np
import IPython
e = IPython.embed
def reparametrize(mu, logva... | wang59695487/hand_teleop_real_sim_mix_adr | models/act/detr_vae.py | detr_vae.py | py | 10,944 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "IPython.embed",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.autograd.Variable",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.power",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.array",
... |
2980218988 | # importing models.
import argparse
import torch
import json
import torchvision
from torchvision import datasets, transforms, models
from torch import nn
from torch import optim
import torch.nn.functional as F
from PIL import Image
import matplotlib.pyplot as plt
import numpy as np
def main():
# getting argu... | emilearthur/Udacity_Image_Classifier_Project | predict.py | predict.py | py | 4,304 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "json.load",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.round",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "torch.load",
"line_... |
10778846484 | """
You are playing the following Bulls and Cows game with your friend: You write down a number and ask your friend to guess what the number is. Each time your friend makes a guess, you provide a hint that indicates how many digits in said guess match your secret number exactly in both digit and position (called "bulls... | QuickLearner171998/Competitive-Programming | Leetcode SeptemberChallenge/Bulls and Cows.py | Bulls and Cows.py | py | 1,788 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "collections.Counter",
"line_number": 33,
"usage_type": "call"
}
] |
28459743144 | #Data Manipulation
import numpy as np
import pandas as pd
#plotting
import matplotlib.pyplot as plt
##Mchine Learning
from sklearn.neighbors import KNeighborsClassifier
from sklearn.metrics import accuracy_score
## Data fetching
df=pd.read_csv('E:/dta/Google.csv')
df=df.dropna()
df=df[['Open','Hi... | Waweru007/ALL-ML | KNN_Trading Strategy.py | KNN_Trading Strategy.py | py | 1,913 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.read_csv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "... |
11068642972 | import urllib.request
from bs4 import BeautifulSoup
import csv
class Scraper:
def __init__(self, site):
self.site = site
def save_data(self,data):
headers = data[0].keys()
with open("news_data.csv", 'w') as out_file:
dict_writer = csv.DictWriter(out_file,headers)
... | sandeep-kasar/web-scraping-instagram | scrap_news.py | scrap_news.py | py | 1,484 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "csv.DictWriter",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "urllib.request.request.urlopen",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_nam... |
29577142145 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
'''
author: @thewhitetulip
A small python script to extract browsing history and bookmarks from various
browsers, currently supports firefox and chromium (partially)
'''
import sqlite3
import os
from datetime import datetime
import sys
import argparse
import webbrowser
d... | thewhitetulip/pyfox | pyfox.py | pyfox.py | py | 6,237 | python | en | code | 20 | github-code | 18 | [
{
"api_name": "webbrowser.open",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.fromtimestamp",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 67,
"usage_type": "name"
},
{
"api_name": "dat... |
23873946639 | from concurrent import futures
import time
import math
import logging
import grpc
import cli_grpc_pb2 as pb2
import cli_grpc_pb2_grpc as pb2_grpc
from helper_functions import read_database, find_entry
class FileServicer(pb2_grpc.FileServicer):
def __init__(self):
self.db = read_database()
def stat(s... | TomasHricina/rest-grpc-CLI-client | grpc_server.py | grpc_server.py | py | 1,469 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "cli_grpc_pb2_grpc.FileServicer",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "helper_functions.read_database",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "helper_functions.find_entry",
"line_number": 17,
"usage_type": "call"
... |
21035625592 | import sys
import os
import yaml
import re
import urllib.request
DEBUG_FLAG = True
class label_configure:
def is_url(self, path: str) -> bool:
pattern = "https?://[\w/:%#\$&\?\(\)~\.=\+\-]+"
if re.match(pattern, path):
return True
else:
return False
def __init... | Ar-Ray-code/PyamlQt | pyamlqt/label_configure.py | label_configure.py | py | 11,083 | python | en | code | 7 | github-code | 18 | [
{
"api_name": "re.match",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "yaml.load",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "yaml.FullLoader",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number":... |
4711774762 | import requests
import os
from jose import jwk, jwt
from jose.utils import base64url_decode
import time
import re
# The below token validation is based on
# https://github.com/awslabs/aws-support-tools/blob/master/Cognito/decode-verify-jwt/decode-verify-jwt.py
# and https://aws.amazon.com/blogs/mobile/integrating-ama... | smdump/terraform-serverless-react | backend/auth/handler.py | handler.py | py | 9,109 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "jose.jwt.get_unverified_headers",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "jose.jwt... |
1006923763 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import datetime as dt
import requests_db as rdb
import data_save
def create_pie(date, year = None):
if len(date) == 4: # Проверяем на запрос, на год
year = date
data = rdb.operation_list(date, only_table='expense', year... | McKrei/FinanceBot | visualization.py | visualization.py | py | 3,293 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "requests_db.operation_list",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "data_save.... |
25367719952 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Oct 28 16:52:55 2022
@author: anselmo
Probabilidade
"""
# DISTRIBUIÇÃO CONTINUA
def uniform_cdf(x: float)-> float:
"Retorna a probabilidade de uma variável aleatória uniforme ser < = x"
if x < 0:
return 0 # a aleatória uniforme nunca... | novais04/dszero | scratch/probability.py | probability.py | py | 5,248 | python | pt | code | 0 | github-code | 18 | [
{
"api_name": "math.sqrt",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "math.pi",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "math.exp",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_nu... |
73417770920 | import sys, os
import numpy as np
from itertools import islice
from fpe_drawing import draw_relative_rate
def load_fpe_data(path, skip_header):
"""
Columns:
Bloc__Id
Bloc_Nam
Trial_No
Trial_Id
TrialNam
ITIBegin
__ITIEnd
StmBegin
_Latency
... | cpicanco/player_plugins | self_contained/fpe_methods.py | fpe_methods.py | py | 9,555 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "os.path.isfile",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "numpy.genfromtxt",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"li... |
7468010721 | # -*- coding: utf-8 -*-
import time
import json
import requests
from datetime import datetime
import numpy as np
import matplotlib
import matplotlib.figure
from matplotlib.font_manager import FontProperties
from matplotlib.backends.backend_agg import FigureCanvasAgg
from matplotlib.patches import Polygon
from matplotl... | xufive/2020Pyday | CoV19_2d.py | CoV19_2d.py | py | 9,040 | python | en | code | 12 | github-code | 18 | [
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 19,
"usage_type": "attribute"
},
{
... |
40062665404 | #!/usr/bin/env python
import pandas as pd
import json
from pyvttbl import DataFrame
from pyvttbl.plotting import *
from collections import namedtuple
class VarianceAnalyzer(object):
"""
This script reads in a list of learner profiles and a list of their scores (each is a json object) then performs
an an... | usuallycwdillon/ARL-DA | src/anova.py | anova.py | py | 11,604 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.read_csv",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"lin... |
18316896390 | import cv2
# Capture the video from the default camera
webcam_video_stream = cv2.VideoCapture("../Videos/Compressed/Bella_Ciao.mp4")
face_detection_classifier = cv2.CascadeClassifier("../Models/haarcascades/haarcascade_frontalface_default.xml")
# Initialize the array varaible to hold all the face locations in the fr... | htootayzaaung/Deep-Learning-Human-Faces | Facial_Detection/video_face_detection_haarcascade.py | video_face_detection_haarcascade.py | py | 1,436 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.CascadeClassifier",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "cv2.rectangle",
"... |
5333498411 | from django.shortcuts import render, HttpResponse
from django.contrib.auth import get_user_model
User = get_user_model()
from .models import Video, Comment
def hello(request):
names = ["Egor", "Petr", "Fedor", "Elena"]
return render(request, "video.html", {"content": names})
return HttpResponse("<h1>hello... | Emeraldem/My-Repo | videoclips/views.py | views.py | py | 1,277 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.HttpResponse",
"line_number": 10,
"usage_type": "call"
},
{... |
11595425574 | from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QComboBox, QGroupBox, QHBoxLayout
class JoinTypePicker(QGroupBox):
def __init__(self, brush):
super().__init__('Join Type')
self.brush = brush
self.picker = QComboBox()
self.picker.addItem('Bevel')
self.picker.addIte... | yannikinniger/paint-app | src/menus/brush_menus/JoinTypePicker.py | JoinTypePicker.py | py | 1,126 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "PyQt5.QtWidgets.QGroupBox",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QComboBox",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QHBoxLayout",
"line_number": 20,
"usage_type": "call"
},
{
"ap... |
25963452731 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('mii_sorter', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='MovieQuestionSet',
fiel... | MiiRaGe/miilibrary | mii_rating/migrations/0001_initial.py | 0001_initial.py | py | 1,293 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.CreateModel",
"line_number": 14,
"usage_type": "call"
},
... |
5992669370 | import cv2
import emilib
import time
camera = cv2.VideoCapture(0)
while True:
ret, im = camera.read()
ret, jpg = cv2.imencode(".jpg", im)
msg = emilib.emi_msg(
msgnum=1,
data=jpg.tobytes(),
ipaddr="127.0.0.1", # Change to the IP where server.py is in
flag=emilib.emi_flag.... | lscooperlee/emilib | examples/stream_server/camera.py | camera.py | py | 394 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.imencode",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "emilib.emi_msg",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "emilib.emi_flag",
"li... |
73597741160 | # Sound playing library for weather station
import time
import threading
import vlc
import gtts
import state
class SoundPlayer():
def __init__(self):
SoundPlayer.instance = vlc.Instance('--aout=alsa')
SoundPlayer.player = SoundPlayer.instance.media_player_new()
SoundPlayer.bbChimes = Sou... | njtracey/WeatherPi | sounds.py | sounds.py | py | 3,305 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "vlc.Instance",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "state.soundsOn",
"... |
14950218731 | # A part of NonVisual Desktop Access (NVDA)
# Copyright (C) 2010-2023 NV Access Limited, World Light Information Limited,
# Hong Kong Blind Union, Babbage B.V., Julien Cochuyt, Cyrille Bougot
# This file is covered by the GNU General Public License.
# See the file COPYING for more details.
from enum import IntEn... | nvaccess/nvda | source/characterProcessing.py | characterProcessing.py | py | 25,536 | python | en | code | 1,802 | github-code | 18 | [
{
"api_name": "typing.TypeVar",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "typing.Generic",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "typing.Callable",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "typing.Callable",
"... |
12618486378 | from django.urls import path
from .views import CreateAccountView, SignUpView
app_name = 'users'
urlpatterns = [
path('create-account/', CreateAccountView.as_view(), name='createAccount'),
# path('user-account/<int:pk>/', AccountView.as_view(), name='userAccount'),
path('signup/', SignUpView.as_view(), n... | MamzelNyf/SheCodes_django-project | she_codes_news/users/urls.py | urls.py | py | 336 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "views.CreateAccountView.as_view",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "views.CreateAccountView",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": ... |
71724479721 | import os
import sys
import shutil
import argparse
import concurrent.futures
from tqdm import tqdm
def copy_file(src, dst):
if os.path.exists(src):
shutil.copy2(src, dst)
def organize_and_copy(line, data_dir, class_grouping, dst_fold_group_dir, split):
image_filename = f'{line.strip()}.jpg'
labe... | geezacoleman/Palmer-detection | setup_dataset.py | setup_dataset.py | py | 4,307 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "os.path.exists",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "shutil.copy2",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_num... |
30399313841 | import streamlit as st
import pandas as pd
import numpy as np
import pydeck as pdk
class MapConfigWidget:
"""
Class to define a webapp section for Maps Configurations.
"""
def __init__(self, index, ids):
self.index = index * 6
self.ids = ids
self.data_type = st.selectbox("Data... | jamesluc007/darp-analyzer | utils/streamlit_utils.py | streamlit_utils.py | py | 4,543 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "streamlit.selectbox",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "streamlit.caption",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "streamlit.caption",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "streamlit.rad... |
71426941160 | import numpy as np
import pandas as pd
import lightgbm as lgbm
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.metrics import cohen_kappa_score
from sklearn.metrics import make_scorer
from sklearn.model_selection import cross_val_score
from skopt import gp_minimize
from skopt.space import Re... | aorursy/new-nb-3 | gsreyan_simple-exploration-of-description-column.py | gsreyan_simple-exploration-of-description-column.py | py | 14,009 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "plotly.offline.init_notebook_mode",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "plotly.offline",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "pandas.options",
"line_number": 58,
"usage_type": "attribute"
},
{
"api_name": "... |
28959031351 | # -*- coding: utf-8 -*-
import asyncio
import os
import ssl
import slixmpp
from slixmpp.xmlstream.handler import Callback
from slixmpp.xmlstream.matcher import MatchXPath
from ..base.chat_bot import ChatBot
class XMPP(ChatBot):
__name__ = "XMPP"
__type__ = "addon"
__version__ = "0.23"
__status__ = ... | pyload/pyload | src/pyload/plugins/addons/XMPP.py | XMPP.py | py | 9,913 | python | en | code | 3,038 | github-code | 18 | [
{
"api_name": "base.chat_bot.ChatBot",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "slixmpp.jid.JID",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "slixmpp.jid",
"line_number": 52,
"usage_type": "attribute"
},
{
"api_name": "os.name",
... |
2176783315 | import logging
from pyThreadsEx import serialize, future, no_target_exception
from pyThreadsEx import thread_pool, thread_pool_full_exception
from pyThreadsEx import thread_pool_stopped_exception
from time import sleep
from threading import Lock
import unittest
class serialize_fixture(unittest.TestCase):
'''
... | nickrmc83/Pythreadsex- | pyThreadsExTest.py | pyThreadsExTest.py | py | 4,643 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "unittest.TestCase",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pyThreadsEx.serialize",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "unittest.TestCase",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "py... |
28811374467 | from flask import Blueprint, redirect, render_template, request, flash, jsonify, url_for
from flask_login import login_required, current_user
from .models import CommentTodo, Note, Todo, User,Comment, Mark
from . import db
import json
views = Blueprint('views', __name__)
@views.route('/', methods=['GET', 'POST'])
@l... | azizktata/FlaskNotesProject | website/views.py | views.py | py | 6,841 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask.Blueprint",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "flask.request.... |
24727026338 | from GP import gp
import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import norm
np.random.seed(123)
u = 0.5
def f(x):
return 5 * np.sin(3 * x) + 0.3 * x ** 2 - 2 * x
def get_data(x=None):
if x is None:
x = np.random.uniform(-2, 2)
y = f(x) + np.random.randn() * u
return x... | neal-o-r/bayesopt | bayesopt.py | bayesopt.py | py | 1,681 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.random.seed",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "numpy.sin",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.random.uniform",
... |
25806006860 | from boto3 import client
from botocore.waiter import WaiterModel, create_waiter_with_client
from syndicate.commons.log_helper import get_logger
from syndicate.connection.helper import apply_methods_decorator, retry
from syndicate.core.helper import dict_keys_to_camel_case
_LOG = get_logger('syndicate.connection.batch... | epam/aws-syndicate | syndicate/connection/batch_connection.py | batch_connection.py | py | 8,945 | python | en | code | 49 | github-code | 18 | [
{
"api_name": "syndicate.commons.log_helper.get_logger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "syndicate.core.helper.dict_keys_to_camel_case",
"line_number": 35,
"usage_type": "cal... |
11622118372 | import pickle
import numpy as np
import os.path
import base64
from PIL import Image
import sys
class Preprocessor:
def __init__(self):
self.target_shape = [28,28]
self.splitchar = "&"
def preprocess(self, jpgtxt):
# data = base64.decodestring(data)
data = jpgtxt.split(',')[-1]
data = base64.b64decode(data... | jhanreg11/char-recog | server/model/preprocessor.py | preprocessor.py | py | 2,251 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "base64.b64decode",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_num... |
19179511968 | # -*- coding: utf-8 -*-
from pathlib import Path
import logging
from sqlalchemy.orm import sessionmaker
from scrapy.exceptions import DropItem
from database.models import Movie, MoviePoster, Director, Producer, Star, db_connect, create_table
class WikipediaScraperPipeline(object):
def __init__(self):
loggi... | imtiaz101325/movie_api | wikipedia_scraper/pipelines.py | pipelines.py | py | 2,161 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "logging.info",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "database.models.db_connect",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "database.models.... |
31789365791 | from common.helpers.datetimehelpers import seconds
def parse_ohlcv(data: dict, mls: bool=True) -> dict:
'''
JSON-serializes a single OHLCV datum
The `time` attribute of the datum must represent a millisecond
It can be of type `str` or `int`
:params:
`data`: dict - a single OHLCV datum... | coinForRich/coin-for-rich | web/routes/api/ws/utils/parsers.py | parsers.py | py | 715 | python | en | code | 63 | github-code | 18 | [
{
"api_name": "common.helpers.datetimehelpers.seconds",
"line_number": 18,
"usage_type": "call"
}
] |
18647223010 | from django.core.validators import RegexValidator
from rest_framework.serializers import (
Serializer,
ModelSerializer,
IntegerField,
CharField,
EmailField,
DateTimeField,
ListField,
SerializerMethodField,
HiddenField,
)
from rest_framework.exceptions import ValidationError
from rest... | Romez1990/highm-server | users/serializers.py | serializers.py | py | 10,444 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "rest_framework.serializers.Serializer",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.IntegerField",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "rest_framework.serializers.CharField",
"line_number": 36,
"... |
39463080542 | """
Module description ...
Reference:
- Surename1, Forename1 Initials., Surename2, Forename2 Initials, YEAR. Publication/Book title
Publisher, Number(Volume No), pp.142-161.
"""
import numpy as np
import matplotlib.pyplot as plt
def draw_lagrangian_descriptor(LD, LD_type, grid_parameters, tau, p_value, norm = True, c... | champsproject/lagrangian_descriptors | book/content/pylds/tools.py | tools.py | py | 4,071 | python | en | code | 15 | github-code | 18 | [
{
"api_name": "numpy.array",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "numpy.nanmin",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "numpy.nanmax",
"line_number"... |
16514886817 | import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import shutil
import os
from pyspark.sql import SparkSession
import pyspark.sql.functions as F
from pyspark.ml.feature import StringIndexer
from pyspark.ml.recommendation import ALS
from pyspark.ml.evaluation import RegressionEvaluator
from pyspark.ml.tuning impo... | pigeongcc/BigDataProject | scripts/model.py | model.py | py | 3,814 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "sys.setdefaultencoding",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder.appName",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder",
"line_number": 22,
"usage_type": "attri... |
4979117816 | import re
import uuid
import subprocess
try:
from subprocess import DEVNULL # py3k
except ImportError:
import os
DEVNULL = open(os.devnull, 'wb')
class ScannerInterface:
def __init__(self, ssh_prefix):
self.os_version = None
self.os_family = None
self.os_detection_weight = 0... | vulnersCom/zabbix-threat-control | os-report/scan_modules/os_detect.py | os_detect.py | py | 1,492 | python | en | code | 201 | github-code | 18 | [
{
"api_name": "subprocess.DEVNULL",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "os.devnull",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "uuid.uuid4",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "uuid.uuid4",
"line_... |
488213750 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Module for data simulation, geometrical resources.
Tong Zhang <zhangt@frib.msu.edu>
2017-03-27 11:29:39 AM EDT
"""
import numpy as np
EPS = np.finfo(float).eps
class Point(object):
"""Points in 2D Cartesian coordinate system, if invalid input is detected,
r... | phantasy-project/phantasy | phantasy/library/physics/geometry.py | geometry.py | py | 18,374 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "numpy.finfo",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.random.random",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 54,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.random... |
23072832363 | #!/usr/bin/env python
# Version 1.0
# Author Alexis Blanchet-Cohen
# Date: 24/03/2014
import argparse
import ConfigParser
import glob
import os
import subprocess
import util
parser = argparse.ArgumentParser(description='Converts BAM files to bedGraph files.')
parser.add_argument("-s", "--submitJobsToQueue", help="Su... | blancha/abcngspipelines | bisseq/coverage_bedgraph_queue.py | coverage_bedgraph_queue.py | py | 1,501 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "util.readConfigurationFiles",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os... |
2198004653 | """
This module contains the API service for predicting credit card default based on data supplied by user on web UI
"""
import sys
import os
sys.path.append(f"{os.getcwd()}")
import joblib
from fastapi import FastAPI
import uvicorn
import pandas as pd
from pydantic import BaseModel
import time
from utils.preprocess i... | theabrahamaudu/credit_card_default_predictor | src/main.py | main.py | py | 2,988 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sys.path.append",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "utils.backend_log_config.backend... |
43823503197 | import requests
from bs4 import BeautifulSoup
from selenium import webdriver
from time import sleep
import pandas as pd
import openpyxl
wb = openpyxl.Workbook()
raw = requests.get("https://comic.naver.com/webtoon/weekdayList?week=dailyplus&view=list&order=User",
headers = {"User-Agent" : "Mozilla/5... | zzckckck3/WebtoonRec | crawling/pythonProject3/main.py | main.py | py | 2,319 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "openpyxl.Workbook",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"lin... |
21464024133 | from django.urls import path
from . import views
app_name = 'circulo'
urlpatterns = [
path('', views.IndexView.as_view(), name='index'),
path('<int:pk>', views.CirculoView.as_view(), name='circulo'),
path('persona/<int:pk>', views.PersonaView.as_view(), name='persona'),
path('deseo/<int:pk>', views.D... | jstitch/gift_circle | GiftCircle/circulo/urls.py | urls.py | py | 968 | python | es | code | 1 | github-code | 18 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
34485865000 | from django import template
from django.template.loader import render_to_string
from ..models import Category, RecipeComment
register = template.Library()
@register.inclusion_tag('main/recipe_cart.html')
def show_recipe_cart(recipe, r_photo, request, current_page=None):
is_liked = False
is_bookmark = False
... | Svjatoslav-so/KitchenWorld | kitchen_world/main/templatetags/main_tags.py | main_tags.py | py | 3,436 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.template.Library",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.template.loader.render_to_string",
"line_number": 87,
"usage_type": "call"
},
{
"api... |
12235699476 | from flask import Flask, jsonify, request
from test import test
app = Flask(__name__)
def get_prediction(image_bytes):
prediction = test(image_path=image_bytes, deploy=True)
return prediction
@app.route('/predict', methods=['POST'])
def predict():
if request.method == 'POST':
file = request.fil... | Duc0509Ngo/Pokemon-classfication | src/api_deploy.py | api_deploy.py | py | 511 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "test.test",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"li... |
3165291070 | import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from keras import layers, models, callbacks
import tensorflow as tf
import json
import os
from ruamel.yaml import YAML
np.random.seed(1337)
metrics = []
val_metrics = []
def lo... | masc-it/dvc_test | train.py | train.py | py | 3,284 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.random.seed",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "ruamel.yaml.YAML",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "keras.callbacks.... |
26911231094 | # Get json files from train.txt and test.txt from MJ Dataset
import os
import random
import argparse
import json
'''
Get new train/test lists from original one
Args:
txt_file: path to the annotation txt file of the original mjdataset
num: number of trainging/test images you want to use
prob: probability t... | wuzhenyusjtu/LPCVC20-VideoTextSpotting | lpcv_crnn/get_data_json.py | get_data_json.py | py | 2,019 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "random.randint",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "os.path",
"li... |
73973908201 | import zipfile
import os
folder_path = 'C:\\Users\\qw2\\Desktop\\Fire_Scars_Archive'
save_path = 'C:\\Users\\qw2\\Desktop\\Fire_Scars_Archive\\shapefiles'
for file in os.scandir(folder_path):
if file.name.split('.')[-1] == 'zip':
zip_path = os.path.join(folder_path, file.name)
with zipfil... | benwirf/Fire_analysis | extract_firescar_zips.py | extract_firescar_zips.py | py | 398 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.scandir",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "zipfile.ZipFile",
"line_number"... |
4006674644 | import ast
import importlib
import os
import sys
import uuid
from tensorflow.python.platform import flags
from tensorflow.python.util import tf_inspect
FLAGS = flags.FLAGS
flags.DEFINE_string(
'wrapped_tpu_test_module_relative', None,
'The Python-style relative path to the user-given test. If test is in same ... | tensorflow/tensorflow | tensorflow/python/tpu/tpu_test_wrapper.py | tpu_test_wrapper.py | py | 7,163 | python | en | code | 178,918 | github-code | 18 | [
{
"api_name": "tensorflow.python.platform.flags.FLAGS",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.python.platform.flags",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "tensorflow.python.platform.flags.DEFINE_string",
"line_number": ... |
3272506491 | import tensorflow as tf
import numpy as np
from tensorflow import nn as F
from bench.core.executer import Executer
def bbox_rescale(bboxes, scale_factor=1.0):
"""Rescale bounding box w.r.t. scale_factor.
Args:
bboxes (Tensor): Shape (n, 4) for bboxes or (n, 5) for rois
scale_factor (float): r... | DeepLink-org/DLOP-Bench | bench/samples/long_tail/bucket2bbox/xla_impl.py | xla_impl.py | py | 5,067 | python | en | code | 38 | github-code | 18 | [
{
"api_name": "tensorflow.stack",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "tensorflow.stack",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.ceil",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "tensorflow.reshape",
... |
20182222923 | '''
All the functions necessary to parse and store to the BD
'''
from tqdm import tqdm
import pandas as pd
import numpy as np
import sys
import sqlite3 as sql
import time
from datetime import datetime
def c_geo_point_2d_FLOAT(x):
out = []
for i in x.split(','):
try:
out.append(float(i))
except Va... | raphaelauv/Paris-Traffic-Prediction | src/parseFill_BD_Function.py | parseFill_BD_Function.py | py | 3,540 | python | en | code | 9 | github-code | 18 | [
{
"api_name": "numpy.nan",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "sqlite3.connect",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_... |
22030516714 | import numpy as np
import matplotlib.pyplot as plt
x = np.arange(0,10,0.1)
cos_x = np.cos(x)
plt.plot(x, cos_x)
plt.title('Cos')
plt.xlabel('x')
plt.ylabel('cos(x)')
plt.show()
| dinofirer/activity_1 | src/cos_plot.py | cos_plot.py | py | 179 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.arange",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"l... |
74875754280 | import os
import torch
import re
import time
import argparse
from transformers import AutoModelForCausalLM, GPT2Config, AutoTokenizer, GPT2LMHeadModel
from transformers_neuronx.module import save_pretrained_split
from transformers_neuronx.gpt2.model import GPT2ForSampling
from transformers_neuronx.config import NeuronC... | jhp612/DevConBostonMLWorkshop | scripts/04_compile_and_generate.py | 04_compile_and_generate.py | py | 2,344 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "transformers_neuronx.gpt2.model.GPT2ForSampling.from_pretrained",
"line_number": 21,
"usage_type"... |
22238286931 | from distributed import Client
def main():
scheduler_host = 'pinac31'
# client = Client(cluster)
# scheduler_address="tcp://134.58.41.100:8786"
scheduler_address = f'{scheduler_host}:8786'
client = Client(address=scheduler_address)
client.shutdown()
print("Shutting down client, its connec... | ML-KULeuven/KBC-as-PU-Learning | dask_utils/close_ssh_cluster.py | close_ssh_cluster.py | py | 390 | python | en | code | 7 | github-code | 18 | [
{
"api_name": "distributed.Client",
"line_number": 10,
"usage_type": "call"
}
] |
4005213974 | import collections
import functools
from functools import partial
import itertools
import operator
import unittest
from unittest import SkipTest
import warnings
from absl.testing import absltest
from absl.testing import parameterized
import numpy as onp
import six
from tensorflow.python.framework import errors_impl
f... | tensorflow/tensorflow | tensorflow/python/ops/numpy_ops/tests/np_test.py | np_test.py | py | 139,242 | python | en | code | 178,918 | github-code | 18 | [
{
"api_name": "tensorflow.python.ops.numpy_ops.tests.config.config.parse_flags_with_absl",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "tensorflow.python.ops.numpy_ops.tests.config.config",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "tensorflow.python.o... |
29523858719 | import streamlit as st
import pandas as pd
import punto_corte as pc
st.set_page_config(page_title=u"Resumen de datos",
page_icon=":ledger:",
layout="centered",
initial_sidebar_state="auto",
menu_items=None)
st.markdown(u"# Resumen de datos"... | jboscomendoza/pypuntocorte | pages/1_Resumen_de_datos.py | 1_Resumen_de_datos.py | py | 1,042 | python | es | code | 0 | github-code | 18 | [
{
"api_name": "streamlit.set_page_config",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "streamlit.markdown",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "streamlit.session_state",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name... |
36912454821 | # -*- coding: utf-8 -*-
"""Utility functions used for the Flask Processing Controller Interface"""
from http import HTTPStatus
from functools import wraps
import jsonschema
from flask import request
from config_db.sbi_client import SchedulingBlockDbClient
DB = SchedulingBlockDbClient()
def get_root_url():
"""... | rtobar/integration-prototype | sip/examples/flask_processing_controller/app/api/utils.py | utils.py | py | 2,120 | python | en | code | null | github-code | 18 | [
{
"api_name": "config_db.sbi_client.SchedulingBlockDbClient",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask.request.url_root",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 21,
"usage_type": "name"
},
{... |
11376771545 | import csv
import numpy as np
import matplotlib.pyplot as plt
import scipy.fft
import scipy.signal as signal
def file_to_signal_array(file_path):
with open(file_path, mode='r') as file:
csv_reader = csv.reader(file)
next(csv_reader)
signal = []
for row in csv_reader:
sig... | HFossdal/Project-1-TMA4215-Numerical-Mathematics | code/task2/2e.py | 2e.py | py | 2,045 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "csv.reader",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "scipy.signal",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "scipy.signal.append",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "scipy.signal",
"line_n... |
9666286796 | #!/usr/bin/env python
##################################################
## DEPENDENCIES
import sys
import os
import os.path
try:
import builtins as builtin
except ImportError:
import __builtin__ as builtin
from os.path import getmtime, exists
import time
import types
from Cheetah.Version import MinCompatib... | rosmod/rosmod | gui/templates/component_hpp.py | component_hpp.py | py | 20,596 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "Cheetah.NameMapper.valueFromFrameOrSearchList",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "Cheetah.NameMapper.valueFromSearchList",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "Cheetah.NameMapper.valueForName",
"line_number": 31,
... |
27337803226 | ###############
# moonraker #
###############
def main():
import boto3
import argparse
import sys
import datetime
from os import environ
from pkg_resources import resource_filename
from json import dumps
from pathlib import Path
# from moonraker.amiget import get_amimap
from mo... | iancharles/moonraker | src/moonraker/ec2.py | ec2.py | py | 13,184 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 74,
"usage_type": "attribute"
},
{
"api_name": "... |
32542366902 | # Authored by Cem Kaya & ...
import threading
import json
from time import strptime
import requests as req
from flask_cors import CORS
from flask import Flask, render_template, request, send_from_directory, send_file
import torch
import torchvision
import cv2
import numpy as np
import base64
from matplotli... | Cem-Kaya/007_hw3 | server/tests/back_random.py | back_random.py | py | 3,180 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "flask.Flask",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "flask.request.files... |
4819977242 | """
767. Reorganize String
Given a string s, rearrange the characters of s so that any two adjacent characters are not the same.
Return any possible rearrangement of s or return "" if not possible.
Example1:
Input: s = "aab"
Output: "aba"
Example2:
Input: s = "aaab"
Output: ""
Constraints:
1 <= s.length <= 500
s con... | tkwang0530/LeetCode | 0767.py | 0767.py | py | 2,500 | python | en | code | 4 | github-code | 18 | [
{
"api_name": "collections.Counter",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "heapq.heappush",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "heapq.heappop",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "heapq.heappop",
... |
40902402704 | # import sqlite3 database
import sqlite3
# handel the exception in try and except block
try:
# create a database with name of mymovie
con = sqlite3.connect("data.db")
print("Database is Created") # message show
con.commit() # commit all task
except: # except block
print("Error is occurred") # m... | Jatin-nabhoya/Cash-Managementt-System | connection.py | connection.py | py | 332 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sqlite3.connect",
"line_number": 7,
"usage_type": "call"
}
] |
2561087403 | import bpy
import random
import urllib
import urllib.request
import numpy as np
# Constants
mapWidthInDegree = 360.0
mapHeightInDegree = 180.0
mapStartLon = -180.0
mapStartLat = 90.0
pixelTileWidth = 256
pixelTileHeight = pixelTileWidth
maximumZoom = 3
elevationOffset = -8201
elevationScale = 115.4588
tileWidth = ma... | nsadras/spaceapps-mars-terrain | mars.py | mars.py | py | 3,795 | python | en | code | 4 | github-code | 18 | [
{
"api_name": "numpy.floor",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.floor",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "bpy.data",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "urllib.request.urlretrieve",
... |
42140824904 | import hashlib
import random
import time
from concurrent.futures import ThreadPoolExecutor
from typing import Dict, List, Optional, Union
from Pyro5.api import Proxy, expose
from Pyro5.errors import CommunicationError
from .node import Node, NodeType, Linker
from .finger_table import FingerTable
from .hash_table impo... | alejandroklever/pychordnet | dscraping/chord_node.py | chord_node.py | py | 11,304 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "node.Node",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "node.NodeType.chord",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "node.NodeType",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "node.Linker",
"l... |
10799277134 | from __future__ import annotations
import os
from random import randrange
from ndspy.rom import NintendoDSRom
from PIL import Image, ImageDraw
from skytemple_files.graphics.kao.handler import KaoHandler
rom: NintendoDSRom = NintendoDSRom.fromFile(
os.path.join("..", "..", "..", "..", "..", "..", "CLEAN_ROM", "p... | SkyTemple/skytemple-files | test/skytemple_files_test/graphics/kao/fixtures/_generate_fixtures.py | _generate_fixtures.py | py | 1,103 | python | en | code | 16 | github-code | 18 | [
{
"api_name": "ndspy.rom.NintendoDSRom",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "ndspy.rom.NintendoDSRom.fromFile",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": ... |
20430122732 | import os
from pprint import pprint as pp
import colorgram
from flask import Flask
from flask import render_template
app = Flask(__name__)
def get_filenames(f_dir, prefix='', suffix=''):
"""Get list of filenames within a directory. Optionally scope by prefix/suffix."""
f_names = []
for r,d,files in os.wal... | fogonwater/simple-color-extract | app.py | app.py | py | 1,413 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "colorgram.extract",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"lin... |
38357692196 | '''
Created by Francesco
29 November 2021
'''
#functions and script to compute correlations in space and time
import numpy as np
from matplotlib import pyplot as plt
from matplotlib import cm
import sys
import os
import utils
import utilsPlot as uplot
############################ Static Structure Factor ##############... | farceri/spAnalysis | spFourierAnalysis.py | spFourierAnalysis.py | py | 8,853 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.loadtxt",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.sep",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "utils.readFromParams",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "utils.readFromParams",... |
10758348690 | #!/usr/bin/env python
import subprocess
import argparse
import itertools
import json
import sys
parser = argparse.ArgumentParser(description='Create a grid from json')
parser.add_argument('filename', help='Json or python that contains the grid parameters')
parser.add_argument('--cmd', required=True)
parser.add_argumen... | FAIRNS/sentence-processing-MEG-LSTM | Code/LSTM/lm-training/grid.py | grid.py | py | 1,872 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "itertools.product",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "sys.stderr.write",... |
6233254897 | from django.core.cache import cache
from django.http import Http404
from django.utils.translation import ugettext as _
from rest_framework.permissions import BasePermission
from apps.api import AuthApi
from apps.dataflow.handlers.dataid import DataId
from apps.dataflow.handlers.flow import Flow
# from apps.dataflow.m... | Tencent/bk-base | src/dataweb/app/apps/dataflow/permissions.py | permissions.py | py | 8,080 | python | en | code | 85 | github-code | 18 | [
{
"api_name": "apps.api.AuthApi.check_user_perm",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "apps.api.AuthApi",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "apps.api.AuthApi.batch_check_user_perm",
"line_number": 29,
"usage_type": "call"
},
... |
10370805689 | import torch
import coremltools as ct
from conv_tasnet import ConvTasNet
from cached_model import CachedModel
from thop import profile
RECEPTIVE_FIELD = 516
R = 2
X = 7
N = 256
H = 512
base_model = CachedModel("checkpoints/clearvoice_iphone_causal_anechoic_reverb/final.pth.tar", input_channels=2, N=N, use_cuda=Fa... | vivjay30/clearbuds | clearbuds_waveform/src/model_to_coreml.py | model_to_coreml.py | py | 2,678 | python | en | code | 34 | github-code | 18 | [
{
"api_name": "cached_model.CachedModel",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.randn",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.randn",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "torch.jit.trace",
... |
74091880680 | import re
import difflib
from event import Event
try:
import imgurpython
except (ImportError, SystemError):
print("Warning: QDB module requires imgurpython.")
imgurpython = object
try:
import requests
except (ImportError, SystemError):
print("Warning: QDB module requires requests.")
requests =... | hlmtre/pybot | modules/qdb.py | qdb.py | py | 21,555 | python | en | code | 10 | github-code | 18 | [
{
"api_name": "imgur_credentials.ImgurCredentials",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "imgur_credentials.ImgurCredentials.imgur_client_id",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "imgur_credentials.ImgurCredentials",
"line_number"... |
34022576888 | from asgiref.sync import sync_to_async
from django.contrib.auth.models import AbstractUser
from django.db.models import Q
from fastapi import HTTPException, APIRouter, Depends
from typing import Optional
from uuid import UUID
from ix.api.auth import get_request_user
from ix.datasources.models import DataSource
from ix... | kreneskyp/ix | ix/api/datasources/endpoints.py | endpoints.py | py | 3,624 | python | en | code | 809 | github-code | 18 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "uuid.UUID",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "django.contrib.auth.mo... |
12868511044 | import numpy as np
import matplotlib.pyplot as plt
def main():
# load data files
data_sm = np.loadtxt("./data/data_SM.txt", delimiter=",")
data_class_labels = np.loadtxt("./data/data_Class_Labels.txt")
# initialize some variables for simplicity
number_of_data_points = len(data_sm)
... | sumeyye-agac/performance-analysis-of-biometric-system | main.py | main.py | py | 5,124 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "numpy.loadtxt",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.concatenate",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line... |
74515134441 | import os
import time
import argparse
import random
import logging
import string
import warnings
import json
import numpy as np
import pickle as pkl
import uuid
import glob
import time
import csv
import itertools
import mxnet as mx
from mxnet import gluon
import gluonnlp as nlp
from gluonnlp.model import bert_12_768_1... | hhexiy/debiased | src/runner.py | runner.py | py | 30,663 | python | en | code | 23 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 73,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_... |
14144835346 | import logging.config
import os
from excelprinter import ExcelPrinter
from itchiobundlegetter import ItchIoBundleGetter
from steamidnamegetter import SteamIdNameGetter
from steaminfofiller import SteamInfoFiller
def init_logging():
os.makedirs('logs', exist_ok=True)
logging.config.fileConfig('logging.conf')
... | donthub/itch-io-steam-bundle-info | main.py | main.py | py | 715 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.makedirs",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.config.config.fileConfig",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.config.config",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name"... |
20617018554 | """This script is the test script for Deep3DFaceRecon_pytorch
"""
import torch
import tensorflow as tf
import numpy as np
import cv2
import trimesh
import os
import glob
import platform
import argparse
import time
from mtcnn import MTCNN
from util.load_mats import load_lm3d
from data.flist_dataset import default_fli... | ngdangha/Deep3D | api.py | api.py | py | 5,095 | python | en | code | null | github-code | 18 | [
{
"api_name": "flask.Flask",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_numbe... |
37991728552 | from typing import Optional
import nnj
import torch
from backpack import extend
from torch import nn
from pytorch_laplace.hessian.base import HessianCalculator
class BCEHessianCalculator(HessianCalculator):
"Binary Cross Entropy"
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs... | FrederikWarburg/pytorch-laplace | pytorch_laplace/hessian/bce.py | bce.py | py | 1,437 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "pytorch_laplace.hessian.base.HessianCalculator",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "backpack.extend",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.nn.BCEWithLogitsLoss",
"line_number": 17,
"usage_type": "call"
},
... |
71283414759 | from django.shortcuts import render
from Trinamic.models import Product, Category, Item
from FieldValue.models import Field
from Media.models import Media
def index(request):
return render(request, 'BASE.html')
def product_center(request, p_id, c_id):
product = Product.objects.get(pk=p_id)
if c_id:
... | h2magic-axious/RestApiServer | Trinamic/local_views.py | local_views.py | py | 1,523 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.shortcuts.render",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "Trinamic.models.Product.objects.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "Trinamic.models.Product.objects",
"line_number": 13,
"usage_type": "attribute"... |
4987090878 | import pygame
import random
import Player
import Projectile
#VARIABLES ============================================
# Buff images
buff_heal = 'Assets/buff_heal.png'
buff_projectile_firerate = 'Assets/buff_projectile_firerate.png'
buff_projectile_speed = 'Assets/buff_projectile_speed.png'
buff_player_speed = 'Assets/... | MJeffery0/kitty-cat-blast-attack | KittyCatBlastAttack/Buff.py | Buff.py | py | 2,578 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pygame.sprite",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "random.choice",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pygame.image.load",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pygame.image",
... |
70114597481 | #
# https://leetcode.com/problems/container-with-most-water/
#
# You are given an integer array height of length n. There are n vertical lines
# drawn such that the two endpoints of the ith line are (i, 0) and (i, height[i]).
#
# Find two lines that together with the x-axis form a container, such that
# the containe... | CountChu/LeetCodePython | p_0001_0100/solutions/0011-most-water-s2.py | 0011-most-water-s2.py | py | 1,339 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pdb.set_trace",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "sys.modules",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "typing.List",
"line_number": 42,
"usage_type": "name"
}
] |
33463589682 | import pytest
from django.urls import reverse_lazy
from orders.models import Shop
@pytest.mark.django_db
def test_create_model_shop():
shop = Shop.objects.create(name='Happy Shop')
count = Shop.objects.count()
assert shop.pk == 1
assert shop.name == 'Happy Shop'
assert count == 1
@pytest.mark.dj... | Saidalo1/test_teamwork_project | orders/tests/test_shop.py | test_shop.py | py | 1,286 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "orders.models.Shop.objects.create",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "orders.models.Shop.objects",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "orders.models.Shop",
"line_number": 8,
"usage_type": "name"
},
{
... |
73053932840 | import numpy as np
import scipy.signal
from scipy.interpolate import CubicSpline
import files
class SplineUpsampling(object):
def __init__(self,new_size=128):
self.name="spline"
self.new_size=new_size
def __call__(self,feat_i):
old_size=feat_i.shape[0]
old_x=np.arange(old_size)... | tjacek/ts_ensemble | spline.py | spline.py | py | 1,195 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.arange",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "scipy.interpolate.CubicSpline",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "scipy.interpo... |
3940694328 | from __future__ import print_function
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
import numpy as np
from matplotlib import pyplot as plt
class LeNet5(nn.Module):
def __init__(self):
super(LeNet5, self).__init_... | JessCooley/CSCI-6961-Group-4-Project | MLOspiderboost.py | MLOspiderboost.py | py | 7,100 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "torch.nn.Module",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.