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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
14962719294 | # In this challenge, your goal is to send a POST request to /pentesterlab with the body of the request containing:
# <key><value>please</value></key>
# and the header Content-Type set to application/xml.
import requests
url = 'http://ptl-dc37519e-8422755a.libcurl.so/pentesterlab'
headers = {'Content-Type' : 'applica... | morellanthony/PL-http-badge | http_32.py | http_32.py | py | 506 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "requests.post",
"line_number": 14,
"usage_type": "call"
}
] |
35439453726 | #!/usr/bin/python3
"""
Python script that takes 2 arguments in order to solve this challenge.
The first argument will be the repository name.
The second argument will be the owner name.
"""
import sys
import requests
if __name__ == '__main__':
if len(sys.argv) != 3:
print("Usage: {} <repository> <owner>".... | namestarlit/alx-higher_level_programming | 0x11-python-network_1/100-github_commits.py | 100-github_commits.py | py | 902 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 16... |
6147296081 | # -*- coding: utf-8 -*-
"""
Created on Thu Feb 23 19:38:30 2023
@author: dkane
"""
# This script merges 2 or more stdf files
# Merged file includes exactly 1 part result sequence per (x,y) coordinate
# If bin 1 result exists for (x,y), merged file will use the bin 1 part result sequence
# If no bin 1 result exists fo... | dyrkane7/stdf_processing | old rev/stdf_merge_v3.py | stdf_merge_v3.py | py | 26,069 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.path.isfile",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "Semi_ATE.STDF.utils.is_STDF",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "Semi_ATE.STDF... |
19573785487 | # This is your main script.
from time import sleep
from machine import PWM, Pin
import random
import json
import urequests
import Extensions as __ext
import gc
gc.enable()
from _thread import start_new_thread as thread
import time
# State gc
# State section
global L_state
L_state = True
# Global Variable
global c_B... | plumest/TagTrack | hardware/main.py | main.py | py | 8,220 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "gc.enable",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "machine.PWM",
"line_number": 45,
... |
32489371252 | from django.core.mail import send_mail
from Blog.celery import app
from .models import Newsletter
@app.task
def send_email_newsletter():
for user in Newsletter.objects.all():
send_mail(
'News. Newsletter',
'Message',
'theluckyfeed1@gmail.com',
[user.email],... | Ramsly/Blog | email_newsletter/tasks.py | tasks.py | py | 363 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "models.Newsletter.objects.all",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "models.Newsletter.objects",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "models.Newsletter",
"line_number": 9,
"usage_type": "name"
},
{
"api_n... |
70018113332 |
from urllib.request import urlopen
import json
import pandas as pd
import numpy as np
import datetime as dt
from Alpaca_config import fmp_api_key
from Universes import TOP10_US_SECTOR
base_fmp_url = 'https://financialmodelingprep.com/api/'
# Senators transactions ---------------------------------------------------... | alexanu/alpaca_snippets | fmp_plays.py | fmp_plays.py | py | 11,554 | python | en | code | 7 | github-code | 21 | [
{
"api_name": "Alpaca_config.fmp_api_key",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "urllib.request.urlopen",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.json_normalize",
"line_number": 20,
"usage_type": "call"
},
{
"api_name":... |
2949472411 | import unittest
import HtmlTestRunner
from selenium import webdriver
import os
import sys
import time
import random
PRV1_DIR = os.path.dirname(os.path.abspath(__file__)) # Get the root directory of currently file
PRV2_DIR = os.path.dirname(os.path.abspath(PRV1_DIR)) # Get the root directory of PRV1
ROOT_DIR = os.pat... | vicvu07/automationPractice | HiepVQ_TrainingAutomationTest/automationPractice/testCases/package/test_CreateAccount_DataDriven.py | test_CreateAccount_DataDriven.py | py | 4,207 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.path.dirname",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line... |
528951322 | import logging
import sys
import re
from sqlalchemy.exc import PendingRollbackError
from aiogram import Dispatcher, types
from aiogram.dispatcher import FSMContext
from aiogram.dispatcher.filters.state import State, StatesGroup
from aiogram.utils.markdown import text, bold, italic, code
from aiogram.utils.emoji import... | vinter-man/teleword | app/handlers/api.py | api.py | py | 16,262 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "sys.stdout",
... |
43036468341 | import sqlite3
from django.shortcuts import render, reverse
from django.contrib.auth.decorators import login_required
from ijosephapp.models import Job
from ijosephapp.models import JobCategory
from ijosephapp.models import model_factory
from ..connection import Connection
def get_categories():
with sqlite3.conne... | CarolineMadison/I_Joseph_Capstone_API | ijosephproject/ijosephapp/views/jobs/form.py | form.py | py | 887 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "sqlite3.connect",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "connection.Connection.db_path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "connection.Connection",
"line_number": 11,
"usage_type": "name"
},
{
"api_name... |
42921452092 | from typing import Optional
from .linked_list import Node
def kth_to_last(k: int, head: Node) -> Optional[Node]:
"""Returns the kth to last element of a singly linked list
Args:
k: Number of spaces from the end of the list
head: Start of linked list
Returns:
The k-th node from t... | danong/ctci-6th-solutions | pythonsolutions/linked_list/kth_to_last.py | kth_to_last.py | py | 677 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "linked_list.Node",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 6,
"usage_type": "name"
}
] |
40333158302 | '''
File: board_square.py
Author: Gurjinder Singh
Date: 11/6/2020
Section: 53
E-mail: gsingh10@umbc.edu
Description: practice with classes?
'''
class UrPiece:
def __init__(self, color, symbol):
self.color = color
self.position = None
... | gsingh2124/CMSC-201 | Homeworks/hw6/project2maybe/board_square.py | board_square.py | py | 4,492 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "json.loads",
"line_number": 74,
"usage_type": "call"
}
] |
10893177006 | import warnings
from gettext import gettext as _
from itertools import repeat, zip_longest
from math import ceil
from typing import Callable, Dict, Generator, Iterable, List, Optional, Tuple
from kitty.cli_stub import DiffCLIOptions
from kitty.fast_data_types import truncate_point_for_length, wcswidth
from kitty.types... | dominikb1888/.dotfiles | Applications/Home Manager Apps/kitty.app/Contents/Resources/kitty/kittens/diff/render.py | render.py | py | 22,078 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "tui.images.can_display_images",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "warnings.warn",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "kitty.types.run_once",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "typi... |
19976088260 | #!/usr/bin/python3
"""Alta3 Research - Exploring OpenAPIs with requests"""
# documentation for this API is at
# https://anapioficeandfire.com/Documentation
import requests
NAPI = "http://api.open-notify.org/astros.json"
def main():
## Send HTTPS GET to the API of ICE and Fire
gotresp = requests.get(NAPI)
... | jyotisinghva/mycode | chall1/nasa.py | nasa.py | py | 545 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
}
] |
70307138612 | import torch
import torch.nn as nn
from torch.nn import functional as F
def conv(nin, nout, kernel_size=3, stride=1, padding=1, bias=True, layer=nn.Conv2d, norm_layer=None, num_groups=None,
activ=nn.ReLU(inplace=True), maxpool=None, **kwargs):
layers = []
layers.append(
layer(nin, nout, kerne... | luizgh/avc_nips_2018 | models/layers.py | layers.py | py | 1,648 | python | en | code | 19 | github-code | 21 | [
{
"api_name": "torch.nn.Conv2d",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torch.nn.ReLU",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number"... |
30013575862 | import boto3
import json
#import awspricing
#
client=boto3.client('ec2')
client2 = boto3.client('pricing')
response = client.describe_instance_types(
Filters = [
{
'Name' : 'instance-type',
'Values':[ 't3.large' ]
}
]
)
price=[]
typelist=[]
for i in response['InstanceTyp... | shivakarthikd/aws-catalogue-data | Apifetcher.py | Apifetcher.py | py | 1,335 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "boto3.client",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 35,
"usage_type": "call"
}
] |
21332136089 | import re
import logging
from datetime import datetime
def makeNumPattern(word):
"""Helper function to create patterns used to find results.
Args:
word (str): result to search for
"""
#re structure finds - White Blood Count: 3.78/37/Thirtyseven
template = r"(%s:\s*)(\d+\W{0,1}\d*)|(%s:\s+$)... | beliefs22/pulltimeline | insertdataip.py | insertdataip.py | py | 4,101 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "re.compile",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "re.M",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "re.compile",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "re.M",
"line_number": 21,
"us... |
26703286076 |
import requests
import pandas as pd
import numpy as np
from bs4 import BeautifulSoup
from urllib.parse import urljoin
import time
import lxml
web_analysis = {'CareerCross': 'https://www.careercross.com/en/job-search/result/69419949'}
titles = []
urls = []
updates = []
locations = []
jobs = []
salaries = []
experience... | Don97MHD/web-scraping-using-beautifulsoap | web_scraping_using_python.py | web_scraping_using_python.py | py | 4,925 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "time.sleep",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "urllib.parse.urljoin",
... |
19597217899 | from pygame import mixer
from pyowm import OWM
from pyowm.utils import timestamps
from pyowm.weatherapi25.weather import Weather
from datetime import datetime, timedelta
import numpy as np
import scipy.io.wavfile
import math
import yaml
import ntplib
import os
import urllib.request
def internet_on():
try:
... | low-pass/weathervolt | src/util.py | util.py | py | 3,710 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "urllib.request.request.urlopen",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "urllib.request",
"line_number": 16,
"usage_type": "name"
},
{
"api_nam... |
37511732973 | """
Representing a particular window on scren
"""
from View.Observer import Observer, Observable
from curses import echo, noecho, curs_set, A_REVERSE, A_UNDERLINE, color_pair
from curses.textpad import Textbox
class TaskListWindow(Observer, Observable):
def __init__(self, name, window, view, controller):
... | Rast999/Tasker | View/tasklistwindow.py | tasklistwindow.py | py | 8,860 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "View.Observer.Observer",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "View.Observer.Observable",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "View.Observer.Observable.__init__",
"line_number": 12,
"usage_type": "call"
},
{
"a... |
42368057313 | # This code calculates how far into the walls of the finite well the wave
# function is able to tunnel as a function of the potential energy outside the
# well.
import numpy as np
from scipy.integrate import odeint
from scipy.optimize import brentq
import matplotlib.pyplot as plt
m = 1
hbar = 1
init = 0, 1
x = np.lin... | ryanburd/SEsolvers | tunneling_depth.py | tunneling_depth.py | py | 2,701 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.linspace",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "scipy.integrate.odeint",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.trapz",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "numpy.sign",
"l... |
3310451672 | from __future__ import annotations
import sys
import os
import gettext
import locale
from typing import Callable, Protocol
import gi
gi.require_version('Gtk', '4.0')
from gi.repository import Gtk, GLib, Gdk
location = locale.getlocale()
try:
loc = gettext.translation('views', localedir='locale', languages=[locat... | ivangarciaquintela/IPM | 2223-p_desktop-equipo-20-main/views.py | views.py | py | 4,024 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "gi.require_version",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "locale.getlocale",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "gettext.translation",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "gettext.trans... |
39194847057 | import requests
url = "https://172.16.30.102/api/aaaLogin.json"
payload = "{\n \"aaaUser\":{\n \"attributes\":{\n \"name\":\"cisco\",\n \"pwd\":\"cisco\"\n }\n }\n}"
headers = {
'Content-Type': 'application/json',
}
response = requests.post(url, headers=headers,
... | taimoorahmed91/pythoncodes | nxapi-rest.py | nxapi-rest.py | py | 1,018 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "requests.post",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "requests.put",
"line_number": 37,
"usage_type": "call"
}
] |
73186819891 | from fastapi import FastAPI, Query
import subprocess
from PIL import Image
from io import BytesIO
app = FastAPI()
@app.get("/predict/")
async def predict_structure(seq: str = Query(..., title="RNA sequence"), ss: str = Query(..., title="Secondary Structure")):
# Prepare the RNA input file
with open("rna_input... | mkhalake7/RNA_cap | app.py | app.py | py | 1,053 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "fastapi.Query",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "subprocess.run",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "PIL.Image.new",
"line_... |
73029551733 | from __future__ import absolute_import, division, print_function
import pandas as pd
from ..base import compute
from .accessor import Accessor
from .utils import (has_known_categories, clear_known_categories, is_scalar,
is_categorical_dtype)
def _categorize_block(df, categories, index):
"""... | LiuFang816/SALSTM_py_data | python/dask_dask/dask-master/dask/dataframe/categorical.py | categorical.py | py | 6,882 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "utils.is_categorical_dtype",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pandas.Categorical",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "utils.is_categorical_dtype",
"line_number": 25,
"usage_type": "call"
},
{
"api_name... |
74121020211 | # -*- coding: utf-8 -*-
"""
Created on Wed May 26 14:23:37 2021
@author: Alexandros Papagiannakis, Christine Jacobs-Wagner lab, Sarafan ChEM-H, Stanford University 2021
"""
import scipy.ndimage as ndi
import scipy.signal as scisig
import numpy as np
import matplotlib.pyplot as plt
from skimage import filte... | JacobsWagnerLab/published | Papagiannakis_2023/microfluidics_segmentation_ghv.py | microfluidics_segmentation_ghv.py | py | 53,278 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "skimage.io.imread",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "skimage.io",
... |
70165896694 | from .element import Element
import pandapower
class Generator(Element):
def createElement(self, network):
if not self.input.empty:
for index, row in self.input.iterrows():
pandapower.create_gen(
net=network,
bus=row['bus'],
p_kw=row['p_kw'],
index=row['index'],
name=... | ksbengal11/PowerflowGUI | Element/generator.py | generator.py | py | 332 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "element.Element",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "pandapower.create_gen",
"line_number": 8,
"usage_type": "call"
}
] |
12506119661 | import tkinter as tk
import csv
import os
from exif import Image
root = tk.Tk()
def getLoc():
text_box.delete(1.0, "end-1c")
Dir = Picfolder_entry.get()
text_box.insert('1.0'," -------coordinates-------")
def dms_to_dd(gps_coords, gps_coords_ref):
d, m, s = gps_coords
dd = d + m / 60 + s / 3600
... | gabrielbrian/CoordinateExtraction | coordinates.py | coordinates.py | py | 1,846 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "tkinter.Tk",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 23,
... |
32762513850 | from math import log
from string import punctuation
import pymorphy2
import json
import os
k1 = 2.0
b = 0.75
def score_BM25(n, qf, N, dl, avdl):
'''
n - docs with word
qf - freq in doc
N - total docs
dl - doc length
avdl - average doc length
'''
K = compute_K(dl, avdl)
IDF = log((N... | alexvinyar/infopoisk_homeworks | flask/ranging.py | ranging.py | py | 1,876 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "math.log",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pymorphy2.MorphAnalyzer",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_nu... |
17772007254 | from dataclasses import dataclass, field
from pathlib import Path
from configparser import ConfigParser
import shutil, os, json
@dataclass
class Config:
# The default lighthouse(s) for a client to report to.
nebula_lighthouses: dict[str, list[str]]
# The name of the logger as it appears in logs.... | techdev5521/nebula-registration-api | src/nebula_registration_api/config.py | config.py | py | 3,136 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pathlib.Path",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "shutil.which",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "shutil.which",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_numbe... |
26442764869 | import pygame as pg
from ..base.image_element import Image_Element
class Image(Image_Element):
@classmethod
def from_file(cls, file, alpha=False, **kwargs):
if alpha:
image = pg.image.load(file).convert_alpha()
else:
image = pg.image.load(file).convert()
return... | milkmull/Card-Game-Final | ui/element/standard/image.py | image.py | py | 743 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "base.image_element.Image_Element",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "pygame.image.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pyg... |
28502783011 | # 788. Rotated Digits
# Medium
# An integer x is a good if after rotating each digit individually by
# 180 degrees, we get a valid number that is different from x. Each
# digit must be rotated - we cannot choose to leave it alone.
# A number is valid if each digit remains a digit after rotation. For
# example:
# 0,... | DmitryVlaznev/leetcode | 788-rotated-digits.py | 788-rotated-digits.py | py | 1,647 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "utils.checkValue",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "utils.checkValue",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "utils.checkValue",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "utils.checkValue",... |
10450561622 | # 1743
from collections import deque
import sys
input = sys.stdin.readline
def bfs(r,c):
q = deque([(r,c)])
visit[r][c] = 1
dist = 1
while q:
r,c = q.popleft()
for dr,dc in dirs:
new_r, new_c = r+dr,c+dc
if 0<= new_r <N and 0<=new_c<M and graph[new_r][new_c] a... | inkyu0103/BOJ | DFS , BFS/1743.py | 1743.py | py | 843 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.stdin",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 7,
"usage_type": "call"
}
] |
7225518027 | from datetime import date
import json
import pandas as pd
from google.cloud import bigquery, client
def write_predictions_to_bigquery(
predictions: pd.DataFrame, config: dict, client: client = None
) -> None:
project = config["write_project"]
if client is None:
bq_client = bigquery.Client(projec... | xluo-ds/docker-etl | jobs/kpi-forecasting/kpi-forecasting/Utils/DBWriter.py | DBWriter.py | py | 3,574 | python | en | code | null | github-code | 21 | [
{
"api_name": "pandas.DataFrame",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "google.cloud.client",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "google.cloud.client",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "google.... |
18406597089 | from itertools import accumulate; from math import floor,ceil,sqrt; import operator; import random; import string; from bisect import *; from collections import deque, defaultdict, Counter, OrderedDict; from functools import reduce,cache; from heapq import *; import unittest; from typing import List,Optional; from func... | afzalsiddique/problem-solving | Problem_Solving_Python/leetcode/lc875.py | lc875.py | py | 1,863 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "math.ceil",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "unittest.TestCase",
"line_number... |
3313216907 | import mysql.connector
from json import load
from os.path import join, dirname
class tables: #class containing all table related functions
def create_tables(cursor):
cursor.execute('CREATE TABLE Job_Types1 (Category varchar(100) NOT NULL, PRIMARY KEY(Category))')
cursor.exe... | Saransh-Tiwari-2002/LinkedIn-Job-Scrape | mysql_upload.py | mysql_upload.py | py | 5,626 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "json.load",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number":... |
29340228515 | from django.urls import path
from goodlist.views import *
urlpatterns = [
path('', IndexPage.as_view(), name='index_url'),
path('good/<str:slug>/', GoodDetail.as_view(), name='good_detail_url'),
path('brand/<str:slug>/', BrandDetail.as_view(), name='brand_detail_url'),
path('category/<str:slug>/', Cate... | metallurk/django | goodlist/urls.py | urls.py | py | 515 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
18533540793 | # SoftwareSerial: https://docs.arduino.cc/learn/built-in-libraries/software-serial?queryID=567b9d5f7c13cf19558448db49f377dd&_gl=1*1j5g6j5*_ga*MTc5MTAxMzQ3MC4xNjc1MzQyMTM3*_ga_NEXN8H46L5*MTY3NjgzMjk1MC42LjEuMTY3NjgzNTExNS4wLjAuMA..#write
# pyserial: https://pythonhosted.org/pyserial/shortintro.html
# port setup: https:/... | MonkyDCristian/jabri | arduino/accel_plus_bluetooth/accel_resiver.py | accel_resiver.py | py | 623 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "serial.Serial",
"line_number": 8,
"usage_type": "call"
}
] |
20568308075 | from django.urls import path
from . import views
urlpatterns = [
path('', views.index , name='index'),
path('login', views.login, name='login'),
path('signup', views.signup, name='singUp'),
path('home', views.home, name='home'),
#path('tryapi', views.tryapi, name='tryapi'),
path('uploadimage',... | nikhiln-code/faceverifier | faceverifier/urls.py | urls.py | py | 526 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
72404930613 | import os
import pandas as pd
import matplotlib.pyplot as plt
#read in data
dir = os.path.dirname(os.path.realpath(__file__))
results = pd.read_csv(dir + os.path.sep + "results.txt", header=0)
#create and label graph
fig, ax = plt.subplots(1,1)
fig.suptitle("Number of visible craters as a function of time")
ax.set_xl... | ikjh/planet-cratering-simulation | analyze/analyze_results.py | analyze_results.py | py | 816 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.path.dirname",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"lin... |
8651672636 | # noqa
from datetime import datetime
import arrow
from django.utils import timezone
def get_date_range(from_date=None, to_date=None):
"""获取一段时间中的每一个date"""
# 先把时间转为带时区的时间
current_tz = timezone.get_current_timezone()
if not isinstance(from_date, arrow.Arrow):
from_date = arrow.Arrow.fromdate(... | mycyzs/fta | web_app/fta_utils/date_tool.py | date_tool.py | py | 1,478 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.utils.timezone.get_current_timezone",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.utils.timezone",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "arrow.Arrow",
"line_number": 12,
"usage_type": "attribute"
},
{
... |
13323799135 | import xml.etree.ElementTree as ET
import urllib.request, urllib.parse, urllib.error
from bs4 import BeautifulSoup
import ssl, json
# Ignore SSL certificate errors
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
url = 'http://py4e-data.dr-chuck.net/comments_944145.json'
... | NevetsKuro/Junk-Python-Programs | JSONReader.py | JSONReader.py | py | 536 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "ssl.create_default_context",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "ssl.CERT_NONE",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "urllib.request.request.urlopen",
"line_number": 13,
"usage_type": "call"
},
{
"api_na... |
34319631117 | from pyrevit.framework import List
from pyrevit import revit, DB
import pprint
import clr
clr.AddReference('RevitAPI')
clr.AddReference('RevitAPIUI')
clr.AddReference("System")
from Autodesk.Revit.DB import FilteredElementCollector
from Autodesk.Revit.DB import BuiltInCategory, ElementId, XYZ, ExternalFileReference, \... | tkahng/nerv_pyrevit | CustomExtension.extension/Nerv.tab/backup/BIM Group Tools.panel/Team.stack2/Parameters.pulldown/Element in Category.pushbutton/script.py | script.py | py | 1,979 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "clr.AddReference",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "clr.AddReference",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "clr.AddReference",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "clr.AddReferenceByPar... |
23920333122 | """
readset.py contains one class: ReadSet, which is a small abstraction
of sets to reads, helping with read accounting and ensuring reads
encounted twice during read separation are not output twice.
"""
from Bio.Seq import Seq
from collections import namedtuple
Read = namedtuple("Read", ["seq", "qual"])
def revcom... | vsbuffalo/readphaser | readset.py | readset.py | py | 4,474 | python | en | code | 6 | github-code | 21 | [
{
"api_name": "collections.namedtuple",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "Bio.Seq.Seq",
"line_number": 14,
"usage_type": "call"
}
] |
39904877942 | # Used to define the general values used in the project
import os
from enum import Enum
from api import types
FILE_TYPE_TO_PATH = {
types.FILE_TYPE_COMMON: "Common",
types.FILE_TYPE_VIDEO_TV: "TV",
types.FILE_TYPE_VIDEO_MOVIE: "Movie",
types.FILE_TYPE_VIDEO_MIXED: "VideoMixed",
types.FILE_TYPE_MU... | opennaslab/kubespider | kubespider/api/values.py | values.py | py | 2,908 | python | en | code | 1,636 | github-code | 21 | [
{
"api_name": "api.types.FILE_TYPE_COMMON",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "api.types",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "api.types.FILE_TYPE_VIDEO_TV",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_nam... |
32957030353 | from collections import defaultdict
def repeated_blocks(buffer, block_length=8):
reps = defaultdict(lambda: -1) # initialise every possible value with -1
for i in range(0, len(buffer), block_length):
block = bytes(buffer[i:i + block_length])
reps[block] += 1 # will count the number of times thi... | prerna-grg/Btech-Course-assignments | Crypto/Pals/C8.py | C8.py | py | 730 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "collections.defaultdict",
"line_number": 4,
"usage_type": "call"
}
] |
4672958193 | import gzip
from datetime import datetime
import csv
import traceback
seconds_per_year = 366 * 24 * 60 * 60.0
years = {year: datetime(year, 1, 1) for year in range(1800, 2100)}
def to_float_year(dt):
year = dt.year
start = years[year]
fractional = (dt - start).total_seconds() / seconds_per_year
retur... | StoCon/pycon2016 | write_data.py | write_data.py | py | 1,739 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "datetime.datetime",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "traceba... |
20105730293 | # -*- coding: utf-8 -*-
# @Time : 2018/7/27 9:46
# @Author : Mat
# @Email : mat_wu@163.com
# @File : main.py
# @Software: PyCharm
from tkinter import *
from tkinter import filedialog
from PIL import ImageTk, Image
import numpy as np
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
... | Tony1886/python_workplace | pycharm/diffraction calculation/main.py | main.py | py | 9,100 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "numpy.array",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.shape",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.size",
"line_number": 2... |
15634823860 | from rest_framework import serializers
class DictSerializer(serializers.ListSerializer):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.default_error_messages['not_a_dict'] = 'Expected a dict of items but got type "{input_type}".'
def get_initial(self):
if... | bencord0/tf_backend | core/serializers/dict_serializer.py | dict_serializer.py | py | 1,798 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "rest_framework.serializers.ListSerializer",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.ValidationError",
"line_number": 27,
"... |
41924543562 | import bpy
from . import preferences
from . import bone_functions as b_fun
class SwapBonesWeightsOperator(bpy.types.Operator):
"""Swap bones weights"""
bl_idname = "armature.ocr_swap_bones_weights"
bl_label = "Swap bones weights"
bl_options = {'REGISTER', 'UNDO'}
@classmethod
def poll(cls, con... | artempoletsky/blender_1_click_rig | one_click_rig/swap_bones_weights.py | swap_bones_weights.py | py | 1,064 | python | en | code | 29 | github-code | 21 | [
{
"api_name": "bpy.types",
"line_number": 5,
"usage_type": "attribute"
}
] |
29976701343 | import os
import torch
import torch.nn as nn
import numpy as np
import pdb
import cv2
class Solver(nn.Module):
def __init__(self, h, w, check_offsets=[1,3,5], alpha1=10.0, alpha2=10.0, sigma1=20.0, sigma2=3.0):
# check_offset: The checkerboard size to fetch depth
# alpha1, alpha2: The weights of da... | thuzhaowang/idn-solver | core/networks/solver.py | solver.py | py | 12,623 | python | en | code | 45 | github-code | 21 | [
{
"api_name": "torch.nn.Module",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "torch.meshgrid",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch.arange",
"line_n... |
8598316392 | import pandas as pd
import yellowbrick as yb
from yellowbrick.features.rankd import Rank1D, Rank2D
from yellowbrick.features.pca import PCADecomposition
from sklearn import preprocessing
Columns = ["duration","protocol_type","service","flag","src_bytes",
"dst_bytes","land","wrong_fragment","urgent","hot","num_fai... | PacktPublishing/Mastering-Machine-Learning-for-Penetration-Testing | Chapter06/visualizations.py | visualizations.py | py | 1,534 | python | en | code | 326 | github-code | 21 | [
{
"api_name": "pandas.read_csv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.LabelEncoder",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing",
"line_number": 21,
"usage_type": "name"
},
{
"api_name... |
26670624006 | import random
from numpy import arange
from typing import Callable
import Fumagalli_Motta_Tarantino_2020.Configurations.StoreConfig as StoreConfig
import Fumagalli_Motta_Tarantino_2020.Models.Base as Base
import Fumagalli_Motta_Tarantino_2020.Models.Types as Types
import Fumagalli_Motta_Tarantino_2020.Models.Distribut... | manuelbieri/Fumagalli_2020 | Fumagalli_Motta_Tarantino_2020/Configurations/FindConfig.py | FindConfig.py | py | 7,438 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.arange",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "random.choices",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "Fumagalli_Motta_Tarantino_2020.Configurations.StoreConfig.ParameterModel",
"line_number": 55,
"usage_type": "... |
1766623010 | import logging
import json
import os
from time import sleep
from sampler import Sampler
from scrobbler import Scrobbler
from fingerprinter import Fingerprinter
FINGERPRINT_API_KEY = os.environ.get("FINGERPRINT_API_KEY")
LASTFM_API_KEY = os.environ.get("LASTFM_API_KEY")
LASTFM_SECRET = os.environ.get("LASTFM_SECRET")... | antoniaelsen/butler | src/main.py | main.py | py | 2,322 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.environ.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_... |
26776203991 | # Author: Adolphus Lee
import scipy.io
import numpy as np
import matplotlib.pyplot as plt
data = scipy.io.loadmat('data/house00002.mat')
matrix = data['image']
matrixlist = np.squeeze(np.matrix(matrix)).tolist()
#####################################################################################
def colormap(matr... | FIT2082/28464400_RESEARCH_NOTEBOOK | Python Code/other_python_files/initial_backup.py | initial_backup.py | py | 4,270 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "scipy.io.io.loadmat",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "scipy.io.io",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "scipy.io",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "numpy.squeeze",
"line_... |
17666153066 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
A module for running: Initial sampling -> Similarity functions
-> Processing images -> Combining metrics -> Creating quantiles -> Sampling from quantiles
in one run
"""
import os
import definitions
import metric_combiner
import preprocess_images
import qua... | Overhaug/HuJuRecSys | sim/main.py | main.py | py | 1,896 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "utils.get_df",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "utils.get_df",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "sampler.sample_n_per_year",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "preprocess_images... |
7288899805 | from .views import *
from django.urls import path
urlpatterns = [
path("create-todo/", create_todo, name="create_todo"),
path("compeleted_task/<int:id>", complete_task, name="complete_task"),
path("uncompeleted_task/<int:id>", un_complete_task, name="uncomplete_task"),
path("update_task/<int:id>", edit... | dipk-pawar/todo_project | todo_app/urls.py | urls.py | py | 415 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
23437408095 | """
utility script containing the load functions for the learners
"""
from __future__ import division, print_function, absolute_import
def load_lr_learner(learner_params):
"""
create a logistic regression learner
:param learner_params: dict(string, object), the parameters for
load_learner
:return ... | ayonsn017/TrainingSetCamouflage | code/load_learners.py | load_learners.py | py | 754 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sklearn.linear_model.LogisticRegression",
"line_number": 21,
"usage_type": "call"
}
] |
3504475992 | import openpyxl
from openpyxl.styles import Font, Border, Side
from openpyxl.utils import get_column_letter
import json
import os
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
def upload_to_drive(filename):
gauth = GoogleAuth()
# Try to load saved client credentials
gauth.LoadC... | Team-2502/ScoutingServer2019 | export.py | export.py | py | 18,084 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pydrive.auth.GoogleAuth",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pydrive.drive.GoogleDrive",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "openpyxl.utils.get_column_letter",
"line_number": 54,
"usage_type": "call"
},
{
... |
33627937963 | # MONTE CARLO TEST WITH HARMONIC OSCILLATOR iN 1D
import time
import numpy as np
from numba import njit
import math as m
import matplotlib.pyplot as plt
import random as rd
N_eq = 5000 # Equilibration steps
N_steps = 50000 # Simulation steps
alpha = 2.0 # Variational parameter for the WF
# Function to compute the... | NerusSkyhigh/computationalphysics2021 | Exercise_4/Warmup_HO/Warmup_HO.py | Warmup_HO.py | py | 6,165 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "math.exp",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numba.njit",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "random.uniform",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "random.uniform",
"line_number"... |
22762473736 | from django.test import TestCase
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APIClient
from accounts.models import ForumUser
from music.models import ForumCategory, ForumPosted
class TestAPI(TestCase):
def setUp(self) -> None:
self.client = APIClient(... | LeroyGorn/musician_hub | src/api/tests/tests.py | tests.py | py | 1,462 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.test.TestCase",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "rest_framework.test.APIClient",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "music.models.ForumPosted.objects.create",
"line_number": 13,
"usage_type": "call"
},... |
73278219251 | import calendar
import json
def add_error_to_error_list(error, error_list):
"""Takes an error and error_list
Appends error to error_list if it is not None
Returns modified error list."""
if error:
error_list.append(error)
return error_list
def check_if_coordinates(coordinates):
"""Ret... | qdaniel4/capstoneProject4 | ui_support/ui_support.py | ui_support.py | py | 4,171 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "calendar.month_name",
"line_number": 67,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 96,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 110,
"usage_type": "call"
},
{
"api_name": "json.loads",
"lin... |
36522802982 | import streamlit as st
from utils import load_data
def app():
data = load_data()
# Tìm kiếm xem ID nào chưa gán
for i in range(len(data)):
if data.iloc[i]['is_labeled'] == 0:
selected = i
break
st.title("Gán nhãn câu hỏi tương đồng DeepCare.IO")
id = st.number_inpu... | nducthang/tool-label-deepcare | add_similary.py | add_similary.py | py | 3,170 | python | vi | code | 1 | github-code | 21 | [
{
"api_name": "utils.load_data",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "streamlit.title",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "streamlit.number_input",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "streamlit.write... |
42967195542 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('bookmarks', '0003_bookmark_description'),
]
operations = [
migrations.AlterField(
model_name='bookmark',
... | Shatnerz/AndrewBookmarks | bookmarks/migrations/0004_auto_20150922_2224.py | 0004_auto_20150922_2224.py | py | 443 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AlterField",
"line_number": 14,
"usage_type": "call"
},
{... |
6504452590 | import pytest
from pathlib import Path
from axcell.helpers.paper_extractor import PaperExtractor
from axcell.data.paper_collection import PaperCollection
from shutil import copyfileobj
import gzip
def test_extraction(tmpdir):
# pack main.tex to an archive
tmpdir = Path(tmpdir)
source = Path(__file__).reso... | paperswithcode/axcell | tests/test_extraction.py | test_extraction.py | py | 1,194 | python | en | code | 365 | github-code | 21 | [
{
"api_name": "pathlib.Path",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "gzip.open",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "shutil.copyfileobj",
"line_nu... |
26189730196 | import time
import socket
import cv2
from GlobalVar import globalVar
import logging
logging.basicConfig(level=logging.DEBUG)
UDP_PORT = 38892
class OpenCVCamera():
def __init__(self, device=0):
import cv2
self.cap = cv2.VideoCapture(device)
def is_opened(self):
return self.cap.isOpen... | orthogonalkk/MaixBoard | CameralControl/camera_process.py | camera_process.py | py | 2,259 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "logging.basicConfig",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.IMWRITE_JPE... |
20910925306 | from flask import Flask, render_template, request, jsonify, flash, redirect, url_for, session, escape
from firebase import firebase
import json
import pandas as pd
import matplotlib
import pyrebase
matplotlib.use('Agg')
app = Flask(__name__)
app.secret_key = 'AMACHIabs'
firebase = firebase.FirebaseApplicat... | lkhas/firstapp | application.py | application.py | py | 5,010 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "matplotlib.use",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "firebase.firebase",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "firebase.firebase.Firebase... |
6826335385 | import tkinter
import tkinter.messagebox
import sqlite3
conn=sqlite3.connect("HDMS.db")
#variables
rootU=None
rootD=None
rootS=None
head=None
inp_s=None
searchB=None
#display/search button----
def Search_button():
global inp_s,entry,errorS,t,i,q,dis1,dis2,dis3,dis4,dis5,dis6,dis7,dis8,dis9,dis10
global l1,l2,... | Kartik018/Hospital-Databse-Management-System | patient_registration.py | patient_registration.py | py | 9,669 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "sqlite3.connect",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "tkinter.messagebox.showinfo",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "tkinter.messagebox",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "tk... |
34196743667 | import logging
import random
import time
import cflib.crtp
from cflib.crazyflie import Crazyflie
from cflib.utils import uri_helper
address = uri_helper.uri_from_env(default='radio://0/80/2M/E7E7E7E7E7')
# Only output errors from the logging framework
logging.basicConfig(level=logging.ERROR)
class ParamExample:
... | bitcraze/crazyflie-lib-python | examples/parameters/basicparam.py | basicparam.py | py | 5,292 | python | en | code | 227 | github-code | 21 | [
{
"api_name": "cflib.utils.uri_helper.uri_from_env",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cflib.utils.uri_helper",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "logging.basicConfig",
"line_number": 12,
"usage_type": "call"
},
{
"api_... |
40894050115 | from enum import IntEnum
from typing import Dict, List, Optional
from shared.mem_layout import get_memory_layout
from .csr import CSRFile
from .dmem import Dmem
from .constants import ErrBits, Status
from .ext_regs import OTBNExtRegs
from .flags import FlagReg
from .gpr import GPRs
from .loop import LoopStack
from .r... | KiranaGowda/https-github.com-lowRISC-opentitan | hw/ip/otbn/dv/otbnsim/sim/state.py | state.py | py | 19,131 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "enum.IntEnum",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "gpr.GPRs",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "reg.RegFile",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "wsr.WSRFile",
"line_number": 68... |
12850684624 | # -*- coding: utf-8 -*-
"""
Created on Fri Feb 10 13:46:32 2023
@author: HuangAlan
img generator ref:
https://keras.io/zh/preprocessing/image/
https://blog.csdn.net/dugudaibo/article/details/87719078
"""
import os
import numpy as np
import random
import tensorflow as tf
from sklearn.model_sele... | tr1ggerone/python_tensorflow | image_classification/script_image_catdog_clf_cnn.py | script_image_catdog_clf_cnn.py | py | 7,878 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.random.seed",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "random.seed",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.environ",
"lin... |
3760980945 | import json
import os
with open("accounts/binary/accounts.json", "r") as f:
accounts = json.load(f)
uin_list = []
for i in accounts["accounts"]:
uin = i["uin"]
uin_list.append(uin)
if not uin_list:
print("No accounts")
exit()
print(uin_list)
for file in os.listdir("accounts"):
if not os.pat... | MxEmerson/Pallas-Bot | tools/clear_accounts.py | clear_accounts.py | py | 529 | python | en | code | null | github-code | 21 | [
{
"api_name": "json.load",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
... |
31875970465 | from typing import List
class Solution:
def searchInsert(self, nums: List[int], target: int) -> int:
lo = 0
up = len(nums) - 1
while lo <= up:
mid = (lo + up) // 2
if nums[mid] < target:
lo = mid + 1
elif nums[mid] > target:
... | hao134/My_Leetcode | python_ver/35_Search_Insert_Position.py | 35_Search_Insert_Position.py | py | 484 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "typing.List",
"line_number": 3,
"usage_type": "name"
}
] |
8803151743 |
import common
from config import *
# import config
resource = dir()
class sCheck:
def check(self):
"""
检查配置环境
:return:
"""
data_dicts = {}
for item in resource:
if item.find("rp_db") >= 0:
try:
common.get_mysql(ite... | BackEnd-Project/reading-pro-system-py | service/sCheck.py | sCheck.py | py | 735 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "common.get_mysql",
"line_number": 21,
"usage_type": "call"
}
] |
17687920456 | from tqdm import tqdm
from youtube_scraper import Scraper
from bs4 import BeautifulSoup
import argparse
import time
import pickle
import ray
parser = argparse.ArgumentParser(description="")
parser.add_argument("--url", help= "Video url")
def main(url):
if url is None:
url = "https://www.youtube.com/watch... | manuelgilm/youtube_scraper | examples/retrieving_basic_info.py | retrieving_basic_info.py | py | 1,811 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "youtube_scraper.Scraper",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pickle.dump",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm"... |
32213842534 |
from rich.console import Console
import random
def dictionary_from_file(file_name):
d = set()
with open(file_name) as f:
for line in f:
d.add(line.strip().upper())
return d
scrabble_dict = dictionary_from_file('dictionary_scrabble.txt')
def start_game():
print('Enter number of le... | codereport/scrabble | wordle/hurdle.py | hurdle.py | py | 1,619 | python | en | code | 5 | github-code | 21 | [
{
"api_name": "rich.console.Console",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "random.random",
"line_number": 26,
"usage_type": "call"
}
] |
42238829620 | import mailparser
from pyspark import SparkContext
import pandas as pd
import string
import re
sc =SparkContext()
import os, nltk
from nltk.stem import LancasterStemmer
from nltk.stem import PorterStemmer
from nltk.corpus import wordnet as wn
from nltk import word_tokenize, pos_tag
nltk.download('wordnet')
nltk.downloa... | Thomas-Faure/Data_Science | wordAnalysis.py | wordAnalysis.py | py | 2,106 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pyspark.SparkContext",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "nltk.download",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "nltk.download",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "nltk.download",
"... |
71836712373 | from typing import List
class Solution:
def transpose(self, A: List[List[int]]) -> List[List[int]]:
if not A:
return []
num_cols = len(A)
num_rows = len(A[0])
base_row = [0] * num_cols
transposed: List[List[int]] = []
for i in range(num_rows):
... | emman27/leetcode | transpose_matrix.py | transpose_matrix.py | py | 528 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 11,
"usage_type": "name"
}
] |
74506453173 |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import sys
from scipy.signal import find_peaks
import os
import ast
import multiprocessing as mp
#######################################################################################################
#globals
#############... | trachman1/lattice-tumor-ctdna | make_figs.py | make_figs.py | py | 27,129 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "numpy.pi",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "scipy.signal.find_peaks",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "numpy.power",
... |
34223821294 | # https://docs.ray.io/en/latest/tune/examples/tune_mnist_keras.html
# https://docs.ray.io/en/latest/tune/index.html
import ray
from ray import air, tune
from ray.tune.integration.keras import TuneReportCallback
# importing the required packages
import tensorflow as tf
# импорт слоев
from tensorflow.keras import layer... | tishina26/test_task_ML_cnn_ray_cluster | ray_light_cnn.py | ray_light_cnn.py | py | 2,894 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "tensorflow.keras.datasets.mnist.load_data",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.datasets.mnist",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 33,
"usage_type": "call"
},
{... |
5902358044 | from sklearn.base import BaseEstimator, TransformerMixin
class WordReplacement(BaseEstimator, TransformerMixin):
def __init__(self, words_replace=('name', []), replacement='', expand=None,
expand_top_n=10, disimlar=('disimlar_name', [])):
self.words_replace = words_replace
self.expand_top_n ... | dayanfcosta/fiqa-2018-task1 | feature_extractors/WordReplacement.py | WordReplacement.py | py | 1,736 | python | en | code | 11 | github-code | 21 | [
{
"api_name": "sklearn.base.BaseEstimator",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "sklearn.base.TransformerMixin",
"line_number": 4,
"usage_type": "name"
}
] |
42224077751 | import os
import configparser
class Config():
sessions = {}
def __init__(self,path):
self.confpath = path.replace("\\","/") + "/config"
self.confpath = self.confpath.replace("/application", "")
if not os.path.exists(self.confpath):
os.mkdir(self.confpath)
self.confp... | chobitces/test | app/config.py | config.py | py | 2,168 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "os.path.exists",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.mkdir",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "configparser.ConfigParser",
... |
32517850280 | import sqlite3
class Schema:
def __init__(self):
self.conn = sqlite3.connect('back_end.db')
self.create_attr_table()
def __del__(self):
self.conn.commit()
self.conn.close()
def create_attr_table(self):
query = """
CREATE TABLE IF NOT EXISTS "Attributes" (
... | zombie1864/core | server/models.py | models.py | py | 2,492 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sqlite3.connect",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "sqlite3.Row",
"line_number": 33,
"usage_type": "attribute"
}
] |
33635031493 | import logging
import os
from datetime import datetime as dt
import pandas as pd
import pywhatkit as py
from mt5monitor_dbv1.configuration.app_config import config
def send_notification_msg(message):
message = create_message()
if config['send_notification']:
if config['send_instant_msg']:
... | nerusm/MT5Monitor_EMACross_DBv1 | mt5monitor_dbv1/notification/whats_app.py | whats_app.py | py | 1,994 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "mt5monitor_dbv1.configuration.app_config.config",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "mt5monitor_dbv1.configuration.app_config.config",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "mt5monitor_dbv1.configuration.app_config.config",... |
43184028289 | from __future__ import division
import numpy
from control.plants.linear_DS import Linear_DS, discretized_matrices
class Eye(Linear_DS):
"""Eye model is taken from 'Biological learning and control' by
Shadmehr, pg """
def __init__(self, dt, init_state=[[0], [0], [0], [0]], delay=0, Q=None, R=None):
... | youssefzaky/phd | gaze_control/gaze_control/1D/eye_plant.py | eye_plant.py | py | 1,066 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "control.plants.linear_DS.Linear_DS",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.eye",... |
6665064590 | import os
# the mode argument of the os.makedirs function may be ignored on some systems
# umask (user file-creation mode mask) specify the default denial value of variable mode,
# which means if this value is passed to makedirs function,
# it will be ignored and a folder/file with d_________ will be created
# we can e... | anatanick/TKBC | test.py | test.py | py | 11,567 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "sys.path.insert"... |
21858458971 | import cv2
import serial
from FingerCountingModule import FingerCounting
port = "com16"
baudRate = 9600
ard = serial.Serial(port, baudRate)
def main():
cap = cv2.VideoCapture(0)
last_value = 0
while True:
success, img = cap.read()
img = cv2.flip(img, 1)
counting = F... | Mohamed-Walid-24/OneHand_FingerCounter_7Segment | main.py | main.py | py | 676 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "serial.Serial",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.flip",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "FingerCountingModule.FingerCou... |
71099505012 | from rest_framework.viewsets import ModelViewSet
from accounts.models.custom_users import StoreRepresentative
from shop.models import Product, ProductColor, ProductSize, ProductVariant, ProductSpecification
from orders.models import Order, OrderProduct
from rest_framework.permissions import IsAuthenticated
from .serial... | duaasayed/drf-ecommerce-api | dashboard/views.py | views.py | py | 3,394 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "rest_framework.viewsets.ModelViewSet",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "shop.models.Product.objects.select_related",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "shop.models.Product.objects",
"line_number": 11,
"usage_t... |
71669322292 | import pefile
import numpy as np
# import os
execs = [
"1F2EB7B090018D975E6D9B40868C94CA",
"33DE5067A433A6EC5C328067DC18EC37",
"65018CD542145A3792BA09985734C12A",
"650A6FCA433EE243391E4B4C11F09438",
"6FAA4740F99408D4D2DDDD0B09BBDEFD",
"785003A405BC7A4EBCBB21DDB757BF3F",
"8442AE37B91F279A9F06DE4C60B286A3",
"99A39866A65... | Crismaria11/Lab03_SecDS | sa.py | sa.py | py | 6,453 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pefile.PE",
"line_number": 88,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 219,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 226,
"usage_type": "call"
},
{
"api_name": "numpy.unique",
"line_num... |
13751783517 | '''IMO 2020 Short List C1 problem solver for n
'''
import itertools
def main(n: int) -> int:
badPermutations = 0
for permutation in itertools.permutations(range(1,n+1)):
for key, val in enumerate(permutation):
if key < n-1 and (key+1)* val > (key+2) * permutation[key+1]:
bad... | mblasterx/Projects | imo2020slc1.py | imo2020slc1.py | py | 717 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "itertools.permutations",
"line_number": 7,
"usage_type": "call"
}
] |
35281281728 | import speech_recognition as sr
import webbrowser
import time
import playsound
import os
import random
from gtts import gTTS
from time import ctime
# The user is able to ask eve questions such as their name, the time, find location for a place, and search something
rec = sr.Recognizer()
def record_audio(ask = False)... | charlyecastro/eve | assistant.py | assistant.py | py | 1,812 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "speech_recognition.Recognizer",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "speech_recognition.Microphone",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "speech_recognition.UnknownValueError",
"line_number": 22,
"usage_type": "attr... |
35841202539 | #!/usr/bin/env python
import rospy
import actionlib
from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal, MoveBaseResult
from tf.transformations import euler_from_quaternion, quaternion_from_euler, quaternion_multiply
from samana_msgs.msg import Int16Array, Bump
from geometry_msgs.msg import Point, Twist
from tf... | Combinacijus/Samana-Autonomous-Robot | ROS/samana_ws/src/samana/src/bug_algorithm.py | bug_algorithm.py | py | 10,896 | python | en | code | 5 | github-code | 21 | [
{
"api_name": "sys.exit",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "math.radians",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "actionlib.SimpleActionServer",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "move_base_msgs.msg... |
32908182557 | reversed ={
'Elements' : 'TELEMENTS',
'element' : 'TELEMENT',
'type' : 'TTYPE',
'item' : 'TITEM',
'Carnet' : 'TCARNET',
'DPI' : 'TDPI',
'Nombre' : 'TNOMBRE',
'Carrera' : 'TCARRERA',
'Password' : 'TPASSWORD',
'Creditos' : 'TCREDITOS',
'Edad' : 'TEDAD',
'Correo' : 'TCORREO'... | LuisCutzal/-EDD-Tarea5_201700841 | Analizadores/Lexico.py | Lexico.py | py | 1,312 | python | es | code | 0 | github-code | 21 | [
{
"api_name": "ply.lex.lex",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "ply.lex",
"line_number": 64,
"usage_type": "name"
},
{
"api_name": "re.IGNORECASE",
"line_number": 64,
"usage_type": "attribute"
}
] |
35965195400 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from sklearn.model_selection import train_test_split
from torch.utils import data
import os, sys, argparse, math, pickle
import os.path as op
import numpy as np
class Dataset(data.Dataset):
"""
Build a data iterator.... | HaihuaM/fanchu_classify | nn.py | nn.py | py | 10,374 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.utils.data",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "torch.nn.Module",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "t... |
35730014160 | #!/usr/bin/python
import sys
import csv
from collections import Counter
def reducer():
hours = []
oldKey = None
reader = csv.reader(sys.stdin, delimiter='\t')
writer = csv.writer(sys.stdout, delimiter='\t', quotechar='"', quoting=csv.QUOTE_ALL)
for line in reader:
if len(line) != 2:
... | shahrukhx01/moocs | udacity_intro_to_hadoop_and_mapreduce/capstone/student_hours/reducer.py | reducer.py | py | 1,402 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "csv.reader",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "csv.writer",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": ... |
1269365580 | # -*- coding: utf-8 -*-
"""
Created on Wed Dec 4 16:38:46 2019
@author: Jimny
"""
import tensorflow as tf
## Import needed packages
import numpy as np
import pandas as pd
import os
import matplotlib.pyplot as plt
import matplotlib
import matplotlib.lines as mlines
from tqdm import tqdm
from skl... | oscar12xi/ANLY-590 | ANLY 590 Project/keras_drop.py | keras_drop.py | py | 10,586 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.options",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "warnings.filterwarnings",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "pandas.... |
23245791506 | from PyQt5.QtWidgets import QApplication, QTabWidget, QWidget, QShortcut, QMainWindow, QStackedWidget
from PyQt5.QtWidgets import QGridLayout, QPushButton
from enums.enums import ViewTypeGameplaySelection, ViewTypeLocal
class GameModeSelectView(QWidget):
buttonsMaxWidth = 200
def __init__(self, parent=None):
... | Hornster/Citadels | Citadels/logics/views/gameplaySelection/gameModeSelectView.py | gameModeSelectView.py | py | 1,559 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QGridLayout",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QPushButton",
"line_number": 12,
"usage_type": "call"
},
{
"ap... |
34749740416 | from multiprocessing import synchronize
from fastapi import Depends, HTTPException, Response, status, APIRouter
from app import models, schemas, oauth2
from app.database import get_db
from sqlalchemy.orm import Session
router = APIRouter(prefix="/vote", tags=["Vote"])
@router.post("", status_code=status.HTTP_201_CR... | adomhamza/Ecomm_FastAPI | app/routers/vote.py | vote.py | py | 3,231 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "app.schemas.Vote",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "app.schemas",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.orm.Ses... |
16774697829 | import os
from loguru import logger
# Get the directory of the project
project_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Create the logs directory under the project directory
log_dir = os.path.join(project_dir, 'logs')
os.makedirs(log_dir, exist_ok=True)
# Configure the logger
logger.add(
... | vvitzilaios/faceRecognition | util/logger.py | logger.py | py | 517 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.path.dirname",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_nu... |
12809269380 | import os
from flask import Flask, jsonify, request
from math import sqrt
app = Flask(__name__)
@app.route('/')
def nao_entre_em_panico():
contador = 0
primeiro = 0
proximo = 1
fibo = 0
result = "Sequencia Fibonacci"
while contador < 50:
fibo = primeiro + proximo
primeiro = ... | rafahorus/defciberac4 | fibo.py | fibo.py | py | 561 | python | pt | code | 0 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 26,
"usage_type": "attribute"
}
] |
73653903091 | import typing
from abc import abstractmethod, ABCMeta
from typing import Union, Callable
import torch
from torch import nn
import numpy as np
def l1_norm_threshold(weight: np.ndarray, ratio = 0.5) -> np.ndarray:
"""return a bool array"""
assert len(weight.shape) == 4, f"Only support conv weight, got shape: {we... | Joey61Liuyi/Prun_OOD | common.py | common.py | py | 5,995 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "numpy.ndarray",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "numpy.abs",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.argsort",
"line_numbe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.