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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
40804962659 | from django.shortcuts import render
from .scrapers import Pixnet
# Create your views here.
def index(request):
articles = ''
restaurant = []
if request.method == "POST":
pixnet = Pixnet(request.POST.get('restaurant_name'))
articles = pixnet.get_articles()
# 找歷史資訊-
restaurant.append(articles[0][... | hcw0915/For_Meet.jobs | 1_Pixnet_FOODLOG/articles/views.py | views.py | py | 474 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "scrapers.Pixnet",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 20,
"usage_type": "call"
}
] |
38856980409 | import numpy as np
import wave
import pyaudio
import socket
import threading
import time
streamstop = False
def SoundStreamClient(server_host, server_port):
SERVER_HOST = server_host
SERVER_PORT = int(server_port)
global streamstop
audio = pyaudio.PyAudio()
# オーディオプロパティ
FORMAT = pyaudio.paIn... | polyu-17002407g/aiit-group5-2021 | pyaudio/client.py | client.py | py | 2,273 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pyaudio.PyAudio",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pyaudio.paInt16",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "socket.socket",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
... |
72115727079 | import pathlib
import shutil
import tomllib
__all__ = ["ProjectHandler"]
CIRCUITPY_DIR = "CIRCUITPY"
MPY_EXT = ".mpy"
CODE_FILE = "code.py"
SETTINGS_FILE = "settings.toml"
class ProjectHandler:
def __init__(
self, project_file: pathlib.Path, debug_dir: pathlib.Path | None = None
):
"""Class ... | mareuter/adafruit_projects | src/project_helper/project_handler.py | project_handler.py | py | 5,088 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pathlib.Path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "shutil.copy",
"line_n... |
33303155299 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from matplotlib.animation import FuncAnimation
import math
num_node = 20
# file_RL = open("Animation\Algo_" + str(num_node) + ".txt", 'r', encoding='UTF-8')
file_Algo = open("Animation\Algo_WC_" + str(num_node) + ".txt", 'r',... | fancyhsu/RL_Project | Animation/makingGraph.py | makingGraph.py | py | 5,326 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 131,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 131,
"usage_type": "name"
}
] |
39679394204 | import torch, torchmetrics, torch.nn as nn
from pytorch_lightning import LightningModule
class SupervisedLearning(LightningModule):
def __init__(self, args, encoder, output_dim=50):
super().__init__()
self.save_hyperparameters(args)
self.criterion = self.configure_criterion()
self.... | klean2050/VCMR | vcmr/trainers/supervised_learning.py | supervised_learning.py | py | 2,425 | python | en | code | 6 | github-code | 18 | [
{
"api_name": "pytorch_lightning.LightningModule",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "torchmetrics.AveragePrecision",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 17,
"usage_type": "call"
},
{
... |
34612149570 | """API module."""
from typing import Union, Tuple
import logging
import requests
from requests import exceptions
class ApiResponseError(Exception):
def __init__(self, message: str, status: int = None) -> None:
super().__init__(message)
self.status = status
class PortalApi(object):
def __in... | iwayag/iway-certbot-dns-auth | iway_certbot_dns_auth/api.py | api.py | py | 4,205 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "typing.Union",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "requests.exceptions.ConnectionError",
"line_number": 64,
"usage_type": "attribute"
},
{
"api_name": "re... |
74996858279 | import discord
from typing import Any, Dict, List
from datetime import datetime
from discord import Color as c
from enum import Enum
from urllib.parse import urlparse
from json import dump
class Platform:
def __init__(self, name: str, emoji: str, base_url: str) -> None:
self.name = name
self.emoji... | letruxux/sassobot | common.py | common.py | py | 4,354 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "urllib.parse.urlparse",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "typing.Dict",
"line_number": 41,
"usage_type": "name"
},
{
"api_name": "json.dump",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "typing.Dict",
"line_n... |
28570587185 | import requests
import json
def get_book(search):
url = 'https://www.googleapis.com/books/v1/volumes?q='
url += search
params = {'search': search}
r = requests.get(url=url, params=params)
data = r.json()
return data
| MajkelMax/Library_Django | book/api/services.py | services.py | py | 242 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
}
] |
6116234614 | from flask import Flask, render_template, request
import whois
import socket
app = Flask(__name__)
#Index page
@app.route("/")
def my_form():
return render_template("index.html")
#Get host info
@app.route("/hostlocation", methods=['GET','POST'])
def my_form_hostlocation():
if request.method == 'GET':
return r... | dabcoder/py-docker-whois | myapplication/app.py | app.py | py | 901 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "flask.requ... |
73558505000 | """
populate_reconcile_queue_test
"""
import json
import pathlib
from test.utils import check_queue_size
import pytest
from cbers2stac.populate_reconcile_queue.code import populate_queue_with_subdirs
@pytest.mark.s3_bucket_args("cbers-stac")
@pytest.mark.sqs_queue_args("queue")
def test_populate_queue_with_subdirs... | fredliporace/cbers-2-stac | test/populate_reconcile_queue_test.py | populate_reconcile_queue_test.py | py | 1,260 | python | en | code | 12 | github-code | 18 | [
{
"api_name": "pathlib.Path",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "cbers2stac.populate_reconcile_queue.code.populate_queue_with_subdirs",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "test.utils.check_queue_size",
"line_number": 38,
"usage... |
1812156605 | import sys
from PyQt5.QtWidgets import QApplication
from Simulador.display import Display
from Simulador.objects import Car, Ball, Arc
from coms import BTComs, SimComs
from controller import Controller
from task_manager import TaskManager
from vision import Vision
import numpy as np
if __name__ == "__main__":
simu... | santiago-larrain/Robotic-Proyects | Bored/main_v1.py | main_v1.py | py | 3,166 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "sys.__excepthook__",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets.QApplication",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "Simulador.display.Display",
"line_number": 22,
"usage_type": "call"
},
{
"ap... |
31484556590 | import os
import numpy as np
import mujoco_py
import matplotlib as mpl
mpl.use('Qt4Agg')
import matplotlib.pyplot as plt
model_path = os.path.join('..','gym_kuka_mujoco','envs','assets', 'full_kuka_mesh_collision.xml')
model = mujoco_py.load_model_from_path(model_path)
# model.integrator = 0
sim = mujoco_py.MjSim(mode... | HarvardAgileRoboticsLab/gym-kuka-mujoco | examples/attic/kuka_model_pd_controller.py | kuka_model_pd_controller.py | py | 2,405 | python | en | code | 33 | github-code | 18 | [
{
"api_name": "matplotlib.use",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "mujoco_py.load_model_from_path"... |
24268583262 | import time as time
from datetime import timedelta
from functools import reduce
import dolfin as d
import ufl as ufl
from .gryphon_toolbox import gryphon_toolbox, linearStage, nonlinearStage
class backwardEuler(gryphon_toolbox):
def __init__(self, T, u, f, bcs=[], tdf=[], tdfBC=[]):
# The current backwa... | skare/gryphon-project | source/src/backwardEuler.py | backwardEuler.py | py | 5,410 | python | en | code | 10 | github-code | 18 | [
{
"api_name": "gryphon_toolbox.gryphon_toolbox",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "gryphon_toolbox.gryphon_toolbox.__init__",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "gryphon_toolbox.gryphon_toolbox",
"line_number": 19,
"usage_type... |
1291168069 | import os,sys
sys.path.append(os.path.abspath(__file__ + '/../'))
from os.path import *
from defects4j import *
from major_report_parser import *
from utils import fix_proj_1f, rela_to_abs_path, get_config_dir
from config_loader import load_config
def show_bug(d4j_proj:Defects4J, mutant_id:str):
proj = d4j_proj.pr... | mutrepair/BenchmarkingAPR | d4j_scripts/check_bug.py | check_bug.py | py | 1,581 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sys.path.append",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
28624266135 | # noinspection PyUnresolvedReferences
import os
import threading
import subprocess
import functools
import collections
import time
import sys
import sublime_plugin
import sublime
def sublime3():
return sys.version_info >= (3, 0)
if sublime3():
from .terminal import sal_build
class DataListener(object)... | andrewzeng/SALSyntax | builder.py | builder.py | py | 7,988 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sys.version_info",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.name",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "subprocess.STARTUPINFO",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "subprocess.... |
15935202675 | from typing import List
class Solution:
# Approach 1: Hash Table and Loop. O(n) Time | O(n) Space
def majorityElement(self, nums: List[int]) -> int:
numCount = {}
for num in nums:
numCount[num] = 1 if num not in numCount else numCount[num] + 1
if numCount[num] > len(num... | MikeMcmanus95/PythonAlgos | Arrays/majorityElement.py | majorityElement.py | py | 837 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "typing.List",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 14,
"usage_type": "name"
}
] |
35443289635 | import discord, gspread
from discord.ext import commands
from discord.utils import get
from oauth2client.service_account import ServiceAccountCredentials
#scope = ['https://spreadsheets.google.com/feeds',
# 'https://www.googleapis.com/auth/drive']
#creds = ServiceAccountCredentials.from_json_keyfile_n... | dyslexda/tobreenoip_pub | cogs/sudoku.py | sudoku.py | py | 9,083 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "discord.ext.commands.command",
"line_number": 18,
"usage_type": "call"
},
{
"a... |
27801978866 | import sqlite3
def connect():
conn=sqlite3.connect("books.db")
cur=conn.cursor()
cur.execute("CREATE TABLE IF NOT EXISTS book(id INTEGER PRIMARY KEY,titlu TEXT,autor TEXT,an_lansare INTEGER,editura TEXT)")
conn.commit()
conn.close()
def insert(title,autor,an_lansare,editura):
... | SilviuVladut/BookStore | backend.py | backend.py | py | 1,437 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sqlite3.connect",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
... |
24234406718 | from discord.ext import commands, tasks
from itertools import cycle
from tinydb import *
from colorama import Fore, Back, Style
import discord
import colorama
import requests
import json
import time
import os
os.system('cls')
authenticity_token = 'ODMyNjU2ODk2NDQ3NzQxOTc0.YHm-Kg.Ss2tMHtIDX1zKcYbIOB0yQWVlLE'
client = ... | 6sn/pythonbot | bot.py | bot.py | py | 1,562 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.system",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands.Bot",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "discord.Membe... |
43024242252 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import logging
logging.getLogger().setLevel(logging.DEBUG)
from vilya.libs.mlock import MLock
from vilya.models.project import CodeDoubanProject
from vilya.models.ticket import Ticket
from vilya.models.lru_counter import (
ProjectOwnLRUCounter, Projec... | douban/code | vilya/models/pull.py | pull.py | py | 7,853 | python | en | code | 1,812 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "vilya.models.npull.Pull2",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "vilya.mod... |
8484620900 | from multiprocessing.dummy import Pool
import os
from dotenv import load_dotenv, find_dotenv
from flask.cli import with_appcontext
from myapp import app, create_app, Database
from myapp.models import User, Score
@app.cli.command(help='Calculate user\'s score and register')
@with_appcontext
def register_user_scores... | karayok/flask-skeleton | run.py | run.py | py | 990 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "myapp.models.User.get_users",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "myapp.models.User",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "multiprocessing.dummy.Pool",
"line_number": 16,
"usage_type": "call"
},
{
"api_name... |
2610365589 | from tensorflow.keras.models import load_model
from tensorflow.keras.losses import Loss
from tensorflow.nn import weighted_cross_entropy_with_logits
import tensorflow.keras.preprocessing.image as tkpi
from helper import resource_path
class weighted_loss(Loss):
def __init__(self, **kwargs):
super().__init__... | adheeshenoy/TB_XRAY-CLASSIFIER | app/models.py | models.py | py | 1,435 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "tensorflow.keras.losses.Loss",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "tensorflow.keras.models.load_model",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "helper.resource_path",
"line_number": 22,
"usage_type": "call"
},
{
... |
11328881548 | import os
import time
import unittest
from lib2to3.pgen2 import driver
import json
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from pynput.keyboard import Key
from SanityTest.shared_elements import... | RanCommbox/qa-automation | SanityTest/helper_base.py | helper_base.py | py | 5,888 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "SanityTest.driver_instanse.Driver",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "SanityTest.select_by.SelectBy.ID",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "SanityTest.select_by.SelectBy",
"line_number": 33,
"usage_type": ... |
11605938101 | import torch
import torch.nn as nn
import torch.optim as optim
import numpy as np
import random
from collections import namedtuple, deque
# Define the network structure
class QNetwork(nn.Module):
def __init__(self, state_size, action_size, seed, fc1_units=64, fc2_units=64):
super(QNetwork, self).__init__()... | litosly/csc2233_gpu_scheduling_2023Fall | cluster-trace-gpu-v2020/simulator/rl_helpers.py | rl_helpers.py | py | 5,594 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "torch.nn.Module",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "torch.manual_seed",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.nn.Linear",
"... |
3906324202 | # @@@@@@@@@@@@@@@@@@@@@@@@
# **Code by Aron Talai****
# @@@@@@@@@@@@@@@@@@@@@@@@
# utility functions for common nlp topic modelling tasks
# def libs
import os
import pickle
import nltk
import re
import string
import spacy
import scipy.sparse
import gensim
import pyLDAvis.gensim
import gensim.corpora as corpor... | atalai/nlp_utils | topic_modelling/topic_modeling.py | topic_modeling.py | py | 5,638 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "spacy.load",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "spacy.lang.en.English",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "os.abort",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "gensim.corpora.Dictionary",... |
17233711312 | from .AbstractDNN import AbstractDNN
from . import utils
import tensorflow as tf
import random
import numpy as np
import json
save_file_name = "savefile.ckpt"
parameters_file_name = "paras.json"
gpu_usage_w_limit = True
loaded_models = {
}
def get_DeepQNetwork(path, **kwargs):
if path not in loaded_models:
try:
... | clarkwkw/mahjong-ai | MLUtils/SimpleDeepQNetwork.py | SimpleDeepQNetwork.py | py | 7,772 | python | en | code | 25 | github-code | 18 | [
{
"api_name": "tensorflow.Graph",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "tensorflow.ConfigProto",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "tensorflow.Session",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "tensorflow... |
26386772481 | # inspired by https://laszukdawid.com/blog/2021/01/26/parsing-tensorboard-data-locally/
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import pandas as pd
from tensorflow.python.summary.summary_iterator import summary_iterator
from tqdm import tqdm
def convert_tb_data(root_dir, sort_by=None):
"""Convert loca... | Velythyl/tb-extract | tb2pandas.py | tb2pandas.py | py | 4,068 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.environ",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "pandas.DataFrame",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "tensorflow.python.summary.summary_iterator.summary_iterator",
"line_number": 33,
"usage_type": "call"
}... |
22160104602 | from flask import Flask, render_template, request, redirect, current_app
from dependency_injector.wiring import inject, Provide
from sqlalchemy.orm import Session
import pandas as pd
from werkzeug.utils import secure_filename
from logging import Logger
import os
import json
from .models import Process, DataColumn, Data... | pablo721/validation-tool | app/views.py | views.py | py | 5,095 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "db.DbClient",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "dependency_injector.wiring.Provide",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "containers.Container.db_client",
"line_number": 18,
"usage_type": "attribute"
},
{
... |
16008031559 | import tensorflow as tf
import numpy as np
from tensorflow.keras.datasets import mnist
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Conv2D, ReLU, GlobalAveragePooling2D, Dense, Lambda, GlobalMaxPooling2D,Flatten
from art.estimators.classification import TensorFlowV2Classifier
from ... | RandomAnass/Analysis-of-new-phenomena-in-deep-learning | scripts/fashion_mnist_gpu_create_models.py | fashion_mnist_gpu_create_models.py | py | 9,018 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "tensorflow.keras",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.keras.utils.to_categorical",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras",
"line_number": 27,
"usage_type": "attribute"
},
{
... |
13601797051 | import csv
import os
from collections import namedtuple
from datetime import datetime
from pprint import pprint
new_col_names = ['gene_id', 'log2_fold_change', 'p_value', 'q_value']
delimiter = '\t'
def get_max_fold_change_to_handle_inf(infile):
maxvalue = 0
with open(infile) as source:
rdr = csv.Dic... | kbaseapps/kb_cufflinks | lib/kb_cufflinks/core/cuffdiff_output.py | cuffdiff_output.py | py | 4,587 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "csv.DictReader",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "csv.DictReader",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "csv.DictWriter",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",... |
31650421915 | from fastapi import FastAPI, File, UploadFile
import requests
import shutil
from pathlib import Path
from fastapi import UploadFile
import pandas as pd
import json
from pydantic import BaseModel
from starlette.responses import FileResponse
from fastapi.middleware.cors import CORSMiddleware
path="https://random-data... | wonejo92/fastApiServicable | app.py | app.py | py | 6,773 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "fastapi.middleware.cors.CORSMiddleware",
"line_number": 22,
"usage_type": "argument"
},
{
"api_name": "requests.get",
"line_number": 60,
"usage_type": "call"
},
{
"api_name"... |
8338414025 | # api_code/api/crud.py
from datetime import datetime, timezone
from sqlalchemy import delete, update
from sqlalchemy.orm import Session, aliased
from . import models, schemas
# USERS
def get_users(db: Session, email: str = None):
q = db.query(models.User)
if email is not None:
q = q.filter(models.U... | sparsh-ai/recohut | docs/07-devops/fastapi/project-railway-api/api/crud.py | crud.py | py | 5,267 | python | en | code | 91 | github-code | 18 | [
{
"api_name": "sqlalchemy.orm.Session",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.orm.Session",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.orm.Session",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "... |
26080236223 | #!/usr/bin/env python
# encoding: utf-8
from django.shortcuts import render_to_response
from django.http.response import HttpResponse, Http404, HttpResponseRedirect
from django.views.decorators.csrf import csrf_exempt
import hashlib
from xml.etree import ElementTree as etree
from django.utils.encoding import smart_str
... | flywen/bae | weixin/views.py | views.py | py | 3,896 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "hashlib.sha1",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "django.http.response.HttpResponse",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render_to_response",
"line_number": 32,
"usage_type": "call"
},
{
... |
26517207965 | import acme
from acme import specs
from acme.agents.tf import dqn
from acme.testing import fakes
import numpy as np
import sonnet as snt
from absl.testing import absltest
def _make_network(action_spec: specs.DiscreteArray) -> snt.Module:
return snt.Sequential([
snt.Flatten(),
snt.nets.MLP([50, 50, acti... | deepmind/acme | acme/agents/tf/dqn/agent_test.py | agent_test.py | py | 1,143 | python | en | code | 3,100 | github-code | 18 | [
{
"api_name": "acme.specs.DiscreteArray",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "acme.specs",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "sonnet.Sequential",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sonnet.Fla... |
9422828342 | from datetime import datetime, timedelta, timezone
import pinhook.plugin
def nick_key(message):
return "{}.{}".format(message.channel, message.nick)
def greetings_key(message):
return "greetings.messages.{}".format(nick_key(message))
@pinhook.plugin.listener("greetings")
def greetings_plugin(message):
... | plathrop/greybot | plugins/greetings.py | greetings.py | py | 1,522 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "datetime.timedelta",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "datetime.t... |
18921387815 | #!/usr/bin/python3
import requests
import json
import subprocess
#
# Monitoring Upload
#
who = requests.get('http://localhost:5000/who')
os = requests.get('http://localhost:5000/os/kernel')
swap = requests.get('http://localhost:5000/swap/so')
mem = requests.get('http://localhost:5000/mem/free')
cpu = requests.get('ht... | jaoa12or/entregasemana3 | curl.py | curl.py | py | 2,316 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_numbe... |
16942499981 | #!/usr/bin/env python
import numpy as np
import roslib
roslib.load_manifest('rgbdslam')
import rospy
import tf
def convertToQuaternion( R ):
'''Convert orthonormal rotation matrix to quaternion representation.'''
tr = np.trace( R )
if tr > 0:
S = 2 * np.sqrt( tr + 1.0 )
qw = 0.25 * S
qx = ( R[2,1] -... | rossbar/rgbdslam | rgbdslam/nodes/fixed_tf_broadcaster.py | fixed_tf_broadcaster.py | py | 1,763 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "roslib.load_manifest",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.trace",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_num... |
15505464411 | #!/usr/bin/python3
"""
Fetches https://alx-intranet.hbtn.io/status.
Usage: ./4-hbtn_status.py
Returns:
The body of the response to the request, as a string.
Example:
./4-hbtn_status.py
Features:
- Uses the Python requests library to make a GET
request to a specified URL.
"""
import requests
if __n... | badepojulateef/alx-higher_level_programming | 0x11-python-network_1/4-hbtn_status.py | 4-hbtn_status.py | py | 774 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 24,
"usage_type": "call"
}
] |
32383054176 | """add log
Revision ID: 7c0c7ad663ac
Revises: c30b19286ffc
Create Date: 2022-09-07 21:25:38.412373
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = '7c0c7ad663ac'
down_revision = 'c30b19286ffc'
branch_labels = None
depends_on = None
def upgrade() -> None:
#... | hibiya-itchief/quaint-api | migration/versions/7c0c7ad663ac_add_log.py | 7c0c7ad663ac_add_log.py | py | 1,422 | python | en | code | 8 | github-code | 18 | [
{
"api_name": "alembic.op.create_table",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integ... |
213661667 | import os
import time
import torch
def train_model(output_dir, net, dataloaders_dict, criterion, scheduler, optimizer, num_epochs, device):
# ネットワークをGPUへ
net.to(device)
# ネットワークがある程度固定であれば、高速化させる
torch.backends.cudnn.benchmark = True
batch_size = dataloaders_dict["train"].batch_size
# 画像の... | neurobiology-ut/PHILOW | src/napari_philow/segmentation/train.py | train.py | py | 5,011 | python | en | code | 22 | github-code | 18 | [
{
"api_name": "torch.backends",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_numbe... |
15856657267 | from pptx import Presentation
from pptx.enum.text import PP_ALIGN
from PIL import Image
import os,sys
def add_slide_with_picture(pptx_path, img_path, title='title'):
im = Image.open(img_path)
iw, ih = im.size
# load a presentation and get its dimensions
prs = Presentation(pptx_path)
sh, sw =... | aspyk/vegeo_trend_analysis | tools/TOOL_pptx.py | TOOL_pptx.py | py | 1,620 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "PIL.Image.open",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "pptx.Presentation",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pptx.enum.text.PP_ALIGN.CENT... |
35800715480 | import os
import pathlib
import glob
import argparse
import cv2
from utils import *
class input_file:
inputRegistry = []
def __init__(self, file_path):
self.filePath = file_path
self.lectureName = pathlib.Path(file_path).stem
self.fileExt = pathlib.Path(file_path).suffix
self.si_dirPath = ''
self.con_dirPa... | rustumchhor/lectureslideconverter | main.py | main.py | py | 1,956 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "pathlib.Path",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number":... |
2590750035 | from flask import Flask,render_template
app=Flask(__name__)
@app.route('/')
@app.route('/user/<username>')
def index(username):
user = {
'D':{
'name':'Mr D',
'age':100,
'gender':'male'
},
'A':{'name':'Mr.A',
'age':200,
'gender':'... | hodu2019/hoangduc-fundametnal-c417 | Webmodule/web1/homework/ex2.py | ex2.py | py | 741 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask.Flask",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 28,
"usage_type": "call"
}
] |
22117522069 | #pyqt draft
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QToolTip
from PyQt5.QtCore import Qt, QCoreApplication
from PyQt5.QtGui import QIcon, QFont
class Form(QWidget): #기본 form
def __init__(self): #생성자
QWidget.__init__(self, flags=Qt.Widget)
self.init_widget() #위젯 생... | brilliantOh/POS_packages | pyqt practice/pyqt_tooltip.py | pyqt_tooltip.py | py | 1,169 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QWidget.__init__",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 10,
"usage_type": "name"
},
{
"a... |
2631355660 | from collections import defaultdict
from heapdict import heapdict
from heapq import *
def prim(start_node, edges):
mst = list()
adjacent_edges = defaultdict(list)
for weight, n1, n2 in edges:
adjacent_edges[n1].append((weight, n1, n2))
adjacent_edges[n2].append((weight, n2, n1))
connec... | sangwoo7957/Algorithm | Prim.py | Prim.py | py | 2,038 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "collections.defaultdict",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "heapdict.heapdict",
"line_number": 28,
"usage_type": "call"
}
] |
71084934760 | from PyQt5.QtWidgets import QLabel
from PyQt5.QtCore import Qt
import math
CHARFIT = 25
def setCharFit(length):
global CHARFIT
CHARFIT = length // 24
def showText(app, xFactor, yFactor, widthFactor, heightFactor, width, styleBound, styleText, text, textCenter=True):
"""Shows text with surround... | CodingEZ/Speech-Practice-and-Transcription | TextPYQT.py | TextPYQT.py | py | 2,756 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "PyQt5.QtWidgets.QLabel",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QLabel",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtCore.Qt.AlignCenter",
"line_number": 23,
"usage_type": "attribute"
},
{
"ap... |
5304424892 | import torch
import torch.nn as nn
from typing import Union, List, Dict, Any, cast
class VGG(nn.Module):
def __init__(
self,
features: nn.Module,
num_classes: int = 1000,
init_weights: bool = True,
mean: torch.tensor = None,
std: torch.tensor = None
) -> None:
... | ByungKwanLee/Causal-Adversarial-Instruments | models/vgg.py | vgg.py | py | 3,302 | python | en | code | 37 | github-code | 18 | [
{
"api_name": "torch.nn.Module",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "torch.nn.Module",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_... |
73609684521 | import argparse
import psycopg2
import os
from multiprocessing import Pool
import datetime
from itertools import repeat
# TO DO: Convert to logging
def print_msg(error_id, msg):
time_string = str(datetime.datetime.now())
msg_text = time_string + " - " + error_id + ": " + msg
print(msg_text)
### TO DO
# ... | jimmylowell/py_pg_cmds | py_pg_cmds.py | py_pg_cmds.py | py | 5,348 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "datetime.datetime.now",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path.join"... |
72224312681 | # -*- coding: utf-8 -*-
from sklearn.linear_model import LinearRegression
from sklearn.linear_model import Ridge
from sklearn.linear_model import Lasso
from sklearn.model_selection import train_test_split, cross_val_predict
from sklearn import metrics
import matplotlib.pyplot as plt
import numpy as np
import pandas as ... | ZhouNan1212/Machine-Learning | GeneralizedLinearModels.py | GeneralizedLinearModels.py | py | 10,347 | python | zh | code | 0 | github-code | 18 | [
{
"api_name": "logging.basicConfig",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "logging.StreamHandler",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "logging.... |
3023517304 | import json,difflib
from difflib import get_close_matches
data = json.load(open("data.json"))
def define(word):
word = word.lower()
if word in set(data):
return (word,data[word],True)
elif len(get_close_matches(word,data.keys(),cutoff=0.8)) > 0:
inp = input(f"Did you mean {get_close_matche... | ManjunathRK1251/Dictionary | Dictionary.py | Dictionary.py | py | 1,748 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "json.load",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "difflib.get_close_matches",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "difflib.get_close_matches",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "difflib.... |
40613006954 | from statsmodels.formula.api import ols
from statsmodels.stats.anova import anova_lm
import pandas as pd
import sys
path = str(sys.path[0]).replace('\\run','')
data = pd.read_csv(path + '/data/creditcard_exp.csv')
df = data[['Income', 'edu_class']].dropna(how='any', axis=0)
df['edu_class'] = df['edu_class'].astype('s... | benbenhub/python-apply | run/方差分析与卡方检验.py | 方差分析与卡方检验.py | py | 1,698 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sys.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "statsmodels.stats.anova.anova_lm",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "statsmod... |
40999769847 | import sys
import cv2
import imutils
import os
from sys import platform
import argparse
import numpy as np
def wxfopenpose(i):
try:
dir_path = os.path.dirname(os.path.realpath(__file__))
try:
sys.path.append('../../python')
from openpose import pyopenpose as op
except ImportError as e:
print(
'Err... | SabrinaKung/openpose-implementation | openpose.py | openpose.py | py | 3,679 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.path.dirname",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"... |
31205388480 | from itertools import product
def hamming_distance(a, b, a_offset):
if len(a) < len(b) + a_offset:
return 9999999999
return sum(1 if a[i + a_offset] != bb else 0 for (i, bb) in enumerate(b))
if __name__ == '__main__':
f = open('rosalind_ba2b.txt').readlines()
k = int(f[0].rstrip())
dna_l... | paskudnicc/Itmo | 3 year/bioinf/ba2b.py | ba2b.py | py | 601 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "itertools.product",
"line_number": 16,
"usage_type": "call"
}
] |
73079918761 | #!/usr/bin/env python3
import os
import re
import shutil
import xml.etree.ElementTree
from lxml import etree
import argparse
TPCAS2_XENBASE_DIR = "/data/textpresso/tpcas-2/xenbase"
INFO_FILE_DIR = "/data/textpresso/xenbase_info"
def format_date(date_str):
"""
Convert input date_str to the format of "YYYY-MM... | alliance-genome/agr_textpresso | tpctools/getbib/make_bib.py | make_bib.py | py | 8,904 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "lxml.etree.parse",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number":... |
26708155023 | #!/usr/bin/python3
import sqlite3
import pyqtgraph
import pg_time_axis
from PyQt5 import QtGui, QtCore
class PlotWindow(pyqtgraph.PlotWidget):
def __init__(self):
pyqtgraph.PlotWidget.__init__(self)
# Initialise sqlite
con = sqlite3.connect('data.db')
cur = con.cursor()
#... | TimSw/test | qt/pyqt5_plotwidget.py | pyqt5_plotwidget.py | py | 4,477 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pyqtgraph.PlotWidget",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pyqtgraph.PlotWidget.__init__",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pyqtgraph.PlotWidget",
"line_number": 10,
"usage_type": "attribute"
},
{
"... |
36670021093 | from miro.gtcache import gettext as _
import logging
from miro import app
from miro import prefs
import os
from miro.eventloop import as_urgent
from miro.database import DDBObject, ObjectNotFoundError
from miro import opml
from miro.plat import resources
from miro import guide
from miro import feed
from miro import fol... | cool-RR/Miro | tv/lib/theme.py | theme.py | py | 7,361 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "miro.database.DDBObject",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "miro.app.config.get",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "miro.app.config",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "miro... |
19611609360 | from imutils.perspective import four_point_transform
from imutils import contours
import numpy as np
import argparse
import imutils
import cv2
#ANSWER_KEY = {0: 4, 1: 3, 2: 3, 3: 3, 4: 1, 5: 1, 6: 4,7: 0, 8: 3, 9: 1, 10: 1, 11: 1, 12: 2, 13: 3, 14: 4}
def getAnswers(x, y, h, w, coords):
ap = argparse.Argumen... | khan-1995/OMR-Sheet-Evaluator | test_grader.py | test_grader.py | py | 3,718 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "cv2.INTER_AREA",
"l... |
28141284630 | import pandas as pd
from openpyxl import load_workbook
from pandas import DataFrame as df
def excel_output(self):
# print(("#" * int(self.id)) + " " + self.id)
w_name = str(self.id) + "_elemento.xlsx"
w_elem = pd.ExcelWriter(w_name)
Results = ['fax', 'press_y', 'dry', 'mx', 'mome_y', 'cor_y', 'pres... | kny5/strucpy | dev_files/scripts/output_excel.py | output_excel.py | py | 922 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.ExcelWriter",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "openpyxl.load_workbook",
"line_number": 20,
"usage_type": "call"
}
] |
26505552292 | import matplotlib.pyplot as plt
import gym
import minerl
import dataclasses
from minerl3161.wrappers import minerlWrapper
from minerl3161.hyperparameters import MineRLDQNHyperparameters
def main():
print("creating env...")
env = gym.make('MineRLNavigateDense-v0')
print("resetting env...")
state = env... | will-maclean/MineRL | src/scripts/visualise_state.py | visualise_state.py | py | 658 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "gym.make",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot... |
35600240545 | import psycopg2 #postgresql
import re
import sys
import pytest
class QueryCheck:
def dbconnect(self, db, username, password):
self.con = psycopg2.connect(database=db, user=username, password=password, host="webcourse.cs.nuim.ie",
port="5432")
print("Database ... | rk-netizen/FYP | main.py | main.py | py | 6,388 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "psycopg2.connect",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "sys.exc_info",
"line_number":... |
2675140710 | import sys
from urllib.request import urlopen
from bs4 import BeautifulSoup
import pandas as pd
import http.client
import json
import csv
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
from sklearn.preprocessing import StandardScaler
from sklearn.cluster import KMeans
from sklearn.de... | dhashemi22/Projects | NBA Player Comparison Pre & Post COVID/scraper.py | scraper.py | py | 4,363 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "seaborn.set",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "urllib.request.urlopen",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame... |
31111050016 | """This file contains the migration mixin for SQLite.
The mixin has the same behavior as the postgresql migrator,
but has different logging messages.
Hence, the methods are overriden to account for this."""
from kinto.core.storage.postgresql import migrator
import logging
import os
logger = logging.getLogger(__name__... | zeeshanabid94/kinto-sqlite | sqlite_support/migrator.py | migrator.py | py | 3,491 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "kinto.core.storage.postgresql.migrator.MigratorMixin",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "kinto.core.storage.postgresql.migrator",
"line_number": 12,
"... |
70631178281 | import math
import numpy as np
import torch
import torch.nn.functional as F
from typing import List
from src.LBM.LBM_collision import LBMCollision2d
from src.LBM.utils import CellType, KBCType
class LBMCollisionMRT2d(LBMCollision2d):
rank = 2
def __init__(
self,
*args,
**kwargs,
... | meng-yijie1996/LBM-Ferrofluid | src/LBM/LBM_collision/LBM_collision_MRT_2d.py | LBM_collision_MRT_2d.py | py | 7,834 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "src.LBM.LBM_collision.LBMCollision2d",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "torch.zeros",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.Tensor",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "torch.T... |
25638086301 | #!/usr/bin/python3
from datetime import datetime
import re
def parseWord(w):
x = re.search("([a-z]+)", w)
return x.group(1).upper()
seed = "2022-01-23"
seedIndex = 219 + 8
seedDate = datetime.strptime(seed, "%Y-%m-%d")
curDate = datetime.today()
deltaDate = curDate - seedDate
delta = deltaDate.days
curWordIn... | cool-mist/WordleWords | genSite.py | genSite.py | py | 896 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "re.search",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "datetime.dateti... |
37423199645 | """error"""
from typing import Callable
import sys
def input_error(func: Callable[..., None]) -> Callable[..., None]:
"""Decorator for handling input errors"""
def wrapper_input_error(*args: tuple, **kwargs: dict) -> None:
"""Wrapper function for handling input errors"""
try:
func... | AleksandrRevuka/group_project_personal_helper | personal_helper/error.py | error.py | py | 714 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "typing.Callable",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "sys.exit",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 24,
... |
37847829690 | import numpy as np
import typing
def fourier(img: np.ndarray) -> np.ndarray:
"""Transform greyscale image (shape (x, y, 1) or shape (x, y)) to Fourier spectrogram"""
if len(np.shape(img)) == 2:
img = np.expand_dims(img, axis=2)
img = np.mean(img, axis=2)
f = np.fft.fft2(img)
fshift = np.ff... | EQuiw/2023-detection-scalingattacks | scaleatt/defenses/detection/frequency/spectrum/utils/f_utils.py | f_utils.py | py | 6,135 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.ndarray",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "numpy.shape",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.expand_dims",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_... |
14321232091 | from datetime import datetime
import json
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import os
WINDOW = "1920,1080"
chrome_options = Options()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--window-size=%s' %WINDOW)
headless_browsers = []
chrome_inst... | sanketdhole/webVisitorAPI | util.py | util.py | py | 2,039 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "selenium.webdriver.chrome.options.Options",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 17,
"usage_type": "name"
},
{
... |
33636099215 | from src.processor import Session
from dateutil.parser import parse
record = {'ip': '123.123.123.1', 'date': '0366-12-24', 'time': '23:59:59'}
baddate = {'ip': '123.123.123.1', 'date': '0x66-12-24', 'time': '23:59:59'}
badtime = {'ip': '123.123.123.1', 'date': '0366-12-24', 'time': 'z3:59:59'}
def test_session_init... | brandonkrull/edgar-analytics | tests_py/test_session.py | test_session.py | py | 1,194 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "dateutil.parser.parse",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "src.processor.Session",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "dateutil.parser.parse",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "src... |
73236609961 | # -*- coding: utf-8 -*-
import os
import sys
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
version = "0.0.4"
def read_file(filename):
if os.path.exists(filename):
with open(filename) as fd:
return fd.read()
return ''
class PyTest(T... | magmax/gtd | setup.py | setup.py | py | 2,639 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.path.exists",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "setuptools.command.test.test",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "setuptools.c... |
20647197572 | import logging
import webapp2
import re
from bs4 import BeautifulSoup
from google.appengine.api import urlfetch
from model import Deal
FEED_URL = 'https://www.ozbargain.com.au/deals/feed'
class Fetch(webapp2.RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'text/plain'
tr... | donny/cardinal | fetch.py | fetch.py | py | 1,709 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "webapp2.RequestHandler",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "google.appengine.api.urlfetch.fetch",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "google.appengine.api.urlfetch",
"line_number": 17,
"usage_type": "name"
... |
15209015479 | import opals
from opals import Import, Bounds
import os, csv
# By convention, we abbreviate matplotlib as mpl
import matplotlib as mpl
# select the graphics kit to use
mpl.use("TkAgg")
# import does not work recursively,
# so we need to import the sub-module, too.
# By convention, we name it plt.
import matpl... | xiyutailang1101/LiDAR_xy | test01.py | test01.py | py | 2,234 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "matplotlib.use",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
... |
28331443593 |
from pprint import pprint
import os
import googleapiclient.discovery
from googleapiclient.discovery import build
import subprocess
import requests
import youtube_dl
from yt_dlp import YoutubeDL
from youtube_dl.utils import DateRange
import time
from dotenv import load_dotenv
from pathlib import Path
def get_video... | floftus-at-csm/web-apis | youtube_search.py | youtube_search.py | py | 8,937 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "googleapiclient.discovery.discovery.build",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "googleapiclient.discovery.discovery",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "googleapiclient.discovery",
"line_number": 25,
"usage_... |
35996585144 | import os, sys, pygame
from pygame.locals import *
pygame.init()
fpsClock = pygame.time.Clock()
gameScreen = pygame.display.set_mode((960, 960))
pygame.display.set_caption('Dragon Warrior Pygame')
overworld = []
with open('overworld.txt') as mapfile:
overworld = list(map(int, mapfile.read().split('\n')))
tantag... | ascripp/dw_project | dwgame.py | dwgame.py | py | 3,424 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "pygame.init",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pygame.time.Clock",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.time",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.set_mode",... |
27100050268 | # app/api/meeting_room.py
from fastapi import APIRouter, Depends
from sqlalchemy.ext.asyncio import AsyncSession
from app.api.endpoints.validators import check_meeting_room_exists, check_name_duplicate
from app.core.db import get_async_session
from app.core.user import current_superuser
# Вместо импортов 6 функций им... | Invictus-7/room_reserve | app/api/endpoints/meeting_room.py | meeting_room.py | py | 3,746 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "app.schemas.meeting_room.MeetingRoomCreate",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.ext.asyncio.AsyncSession",
"line_number": 31,
"usage_type": "name... |
31849987705 | """
This Class is to provide model for moilapp application. to make it not make confuse on the plugin class
"""
import cv2
import os
import yaml
from PyQt6.QtCore import pyqtSignal, QObject, Qt, QTimer
from PyQt6.QtWidgets import QMessageBox
class ModelApps(QObject):
image_original = pyqtSignal(object)
image_... | Herusyahputra/PycharmProjects | moilapp-develop_anto/src/models/model_apps.py | model_apps.py | py | 23,250 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "PyQt6.QtCore.QObject",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "PyQt6.QtCore.pyqtSignal",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "PyQt6.QtCore.pyqtSignal",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "... |
35323127411 | # coding: UTF-8
import requests
import json
from scripts.data_process import extractor
# website-background
def get_default_search_word() -> dict:
Data = requests.get('https://api.bilibili.com/x/web-interface/search/default')
JsonData = json.loads(Data.text)
return {'response_code': Data.status_... | labo-China/Bilibili_viewer | WebApi/background.py | background.py | py | 2,526 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "scripts.data_process.extractor",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.get",
... |
13233299327 | from matplotlib import animation
import matplotlib.pyplot as plt
import numpy as np
import Classes as cs
import Functions as fnc
noise_std = 0.25
path = []
laser = []
estimation = []
time = []
Laser = cs.Laser_Measurement(noise_variance= noise_std)
frame_num = 250
for i in range(0,frame_num):
... | Aral-Sarrafi/AI_FOR_ROBOTICS | Kalman_Filter/main.py | main.py | py | 2,520 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "Classes.Laser_Measurement",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "Functions.path_generator",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "Classes.kalman_filter",
"line_number": 33,
"usage_type": "attribute"
},
{
"api... |
28079952711 | import wikipedia
import click
@click.command()
@click.option(
"--name", prompt="wikipedia page to scrape", help="web page we want to scrape"
)
def scrape(name, length=1):
result = wikipedia.summary("Microsoft", sentences=length)
click.echo(click.style(f"{result}:", bg="white", fg="blue"))
if __name__ ==... | jitendra-40078/Python-MLops-Function | wikibot.py | wikibot.py | py | 346 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "wikipedia.summary",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "click.echo",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "click.style",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "click.command",
"line_nu... |
21103593824 | import onnx
from onnx import TensorProto, helper
# Loop is so the Tranpose output is used in a subgraph
loop_body = helper.make_graph(
[
helper.make_node("Add", ["transpose:0", "loop_state_in"], ["loop_state_out"], "Add1"),
],
"Loop_body",
[
helper.make_tensor_value_info("iteration_num"... | microsoft/onnxruntime | onnxruntime/test/testdata/ort_github_issue_10305.py | ort_github_issue_10305.py | py | 2,374 | python | en | code | 9,700 | github-code | 18 | [
{
"api_name": "onnx.helper.make_graph",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "onnx.helper",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "onnx.helper.make_node",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "onnx.helper",
... |
74514501800 | import unittest
from io import StringIO
import sys
from atividade_m3s2 import calcular_juros_simples
class TesteCalculoJurosSimples(unittest.TestCase):
def setUp(self):
self.old_stdout = sys.stdout
sys.stdout = StringIO()
def tearDown(self):
sys.stdout = self.old_stdout
def t... | CharlesHenriquedf/UltimaSchoolAtividades | modulo_4_semana2/test_atividade_m3s2.py | test_atividade_m3s2.py | py | 906 | python | pt | code | 0 | github-code | 18 | [
{
"api_name": "unittest.TestCase",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "sys.stdout",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "sys.stdout",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "io.StringIO",
... |
25412174719 | import os
from os.path import isfile, isdir, join, dirname, getmtime, getsize
from errno import ENOENT
import json
from .make_config import MAKE_CONFIG
from .utils import get_all_files
try:
from hashlib import blake2s as encode
except ImportError:
from hashlib import md5 as encode
class HashStorage:
last_hashes =... | zheka2304/innercore-mod-toolchain | toolchain/toolchain/python/innercoremodtoolchain/hash_storage.py | hash_storage.py | py | 2,499 | python | en | code | 29 | github-code | 18 | [
{
"api_name": "os.path.isfile",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "hashlib.md5",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_numbe... |
12028308545 | from PyQt5.QtWidgets import QMainWindow, QWidget, QHBoxLayout
from PyQt5.QtGui import QIcon
from .canvas import Canvas
from .sidebar import Sidebar
from ..interpreter import Interpreter
class MainWindow(QMainWindow):
"""
Main widget of the gui.
"""
def __init__(self):
super(MainWindow, self... | koz0325/MiniGebra | minigebra/gui/main_window.py | main_window.py | py | 1,469 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtGui.QIcon",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "canvas.Canvas",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sidebar.S... |
37386967963 | 'Will track your stocks, including profit, loss, when to sell, and average taxes on the stock.'
import time
import yfinance as yf
ticker_1 = input("Ticker 1 ")
symbols = ["TSLA", "NIO", ticker_1]
result = {}
for symbol in symbols:
data = yf.Ticker(symbol)
today_data = data.history(period='1d')
result[symbo... | Ashisaphnx/STX-TRKR | stx.py | stx.py | py | 373 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "yfinance.Ticker",
"line_number": 9,
"usage_type": "call"
}
] |
4541328210 | from pymongo import MongoClient
# creating connections for communicating with Mongo DB
client = MongoClient('localhost:27017')
db = client.EmployeeData
db.Employees.update_one(
{"id": '001'},
{
"$set": {
"name":'AAA',
"age":51,
"country":'Korea'
}
... | ranamajid007/fianlproject | pymongo/update_data.py | update_data.py | py | 334 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 4,
"usage_type": "call"
}
] |
32974297416 | # -*- coding: utf-8 -*-
import json
import re
from json.decoder import JSONDecodeError
from .filter_error import ParamsValueError
from .filter_rules import Rule
_false_str_list = ["False", "false", "No", "no", "0", "None", "", "[]", "()", "{}", "0.0"]
class BaseFilter(object):
"""
过滤器基类
"""
# 错误码
... | Rgcsh/flask_loonflow_client | app/libs/pre_request/filter_plugin.py | filter_plugin.py | py | 6,632 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "filter_error.ParamsValueError",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "filter_error.ParamsValueError",
"line_number": 81,
"usage_type": "call"
},
{
"api_name": "filter_regexp.Regexp",
"line_number": 103,
"usage_type": "call"
},
{
... |
69805277479 | """
Utilities for handling image data
Directly ported from Dataflowr with slight modification
https://github.com/dataflowr/notebooks
"""
import torch
import torchvision
import matplotlib.pyplot as plt
from torch.utils.data import Dataset
def load_data(data_name, root_dir, train=True, download=True):
valid_data... | xianyingkong/dsc-capstone-b05-q1 | utils/image_data_utils.py | image_data_utils.py | py | 4,446 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "torchvision.transforms.Compose",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "torchvision.transforms.Resize",
"line_number": 24,
"usage_type": "call"
},
... |
2745457317 | import io
import os
import shutil
import tempfile
from docker import errors
import pytest
import six
from .base import BaseAPIIntegrationTest, BUSYBOX
from ..helpers import random_name, requires_api_version, requires_experimental
class BuildTest(BaseAPIIntegrationTest):
def test_build_streaming(self):
... | ksshanam/docker-py | tests/integration/api_build_test.py | api_build_test.py | py | 12,376 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "base.BaseAPIIntegrationTest",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "io.BytesIO",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "six.PY3",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "io.StringIO",
... |
8610865122 | import os
import torch
from torch import Tensor
from torch.utils.data import Dataset, DataLoader
import numpy as np
import youtokentome as yttm
from functools import partial
def create_tokenizer(tokenizer_path, datasets, vocab_size, tokens, temp_file_path='tokenizer_text.temp'):
# Load tokenizer
if os.path.ex... | kzvdar42/kontur-test | data_utils.py | data_utils.py | py | 7,030 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.path.exists",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "youtokentome.BPE",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
"line_... |
34680690773 | """
VintedPyInterface
By Alix Hamidou 2023
"""
from fake_useragent import UserAgent
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from dataclasses import dataclass
import time
""... | ProfesseurIssou/VintedPyInterface | src/__init__.py | __init__.py | py | 2,385 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "dataclasses.dataclass",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 48,
"usage_type": "attribute"
},
{
"api_na... |
106796133 | ### Python script to use SNAP as InSAR processor for TSX/TDX processing compatible with StaMPS PSI processing
# Author: Jonas Ziemer, adapted from Jose Manuel Delgado Blasco (snap2stamps package)
# Date: 01/01/2023
# Version: 2.1, Python 3.9
# Step 1: unzip downloaded TSX scenes (.tar; .tar.gz)
# Step 2: preparing sec... | mdelgadoblasco/snap2stamps | bin/stripmap_step_3_ifg_sar.py | stripmap_step_3_ifg_sar.py | py | 5,227 | python | en | code | 91 | github-code | 18 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sys.stdout.flush",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "argparse.Arg... |
74011010919 | #coding: cp1251
from __future__ import absolute_import, print_function
from pony.py23compat import PY2
from datetime import date, time, datetime, timedelta
from decimal import Decimal
from uuid import UUID, uuid4
from time import time as get_time
from pony.orm.core import *
#db = Database('oracle', 'pre... | buhtigexa/Nerit | lib/python2.7/site-packages/pony/orm/examples/alldatatypes.py | alldatatypes.py | py | 2,760 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "decimal.Decimal",
"line_number": 26,
"usage_type": "argument"
},
{
"api_name": "datetime.datetime",
"line_number": 28,
"usage_type": "argument"
},
{
"api_name": "datetime.date",
"line_number": 29,
"usage_type": "argument"
},
{
"api_name": "datetime.... |
35552955723 | from collections import defaultdict
from baseline.relation import VideoRelation
from baseline.trajectory import Trajectory
def greedy_relational_association(short_term_relations, truncate_per_segment=100):
# group short-term relations by their staring frames
pstart_relations = defaultdict(list)
for r in ... | AquilaPYF/VidVRD-py3 | baseline/association.py | association.py | py | 1,714 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "collections.defaultdict",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "baseline.trajectory.Trajectory",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "baseline.trajectory.Trajectory",
"line_number": 26,
"usage_type": "call"
},
{
... |
39526198698 | import pathlib
inputx = '''..##.......
#...#...#..
.#....#..#.
..#.#...#.#
.#...##..#.
..#.##.....
.#.#.#....#
.#........#
#.##...#...
#...##....#
.#..#...#.#'''
inputy = pathlib.Path('./day3.input').read_text()
input = inputx
rows = input.splitlines()
height = len(rows)
width = len(rows[0])
def tfs(dx, dy): # t... | michaelbrewerdavis/advent2021 | 2020/day3.py | day3.py | py | 636 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pathlib.Path",
"line_number": 15,
"usage_type": "call"
}
] |
27083148999 | import pytest
from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from drf_react_template.schema_form_encoder import (
COLUMN_PROCESSOR_OVERRIDE_KEY,
DEPENDENCY_CONDITIONAL_KEY,
DEPENDENCY_DYNAMIC_KEY,
DEPENDENCY_OVERRIDE_KEY,
DEPENDENCY_SIMPLE_KEY,
SCH... | yoyowallet/drf-react-template-framework | tests/test_schema_form_encoder.py | test_schema_form_encoder.py | py | 16,232 | python | en | code | 10 | github-code | 18 | [
{
"api_name": "drf_react_template.schema_form_encoder.SchemaProcessor",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "example.polls.serializers.QuestionSerializer",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "drf_react_template.schema_form_encoder.UiSche... |
71964798759 | #!/usr/bin/python
# coding: UTF-8
import os, sys, subprocess, uuid as unique
from lxml import etree as et
import sqlite3 as sqlite
from sqlite3 import Error
import modules.error as error
class SimpleObject(object):
def __init__(self, is_new, uuid, dbfile):
if is_new == True:
if not uuid == No... | yufujimoto/SurveyDataCollector | modules/features.py | features.py | py | 55,294 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "uuid.uuid4",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "uuid.setter",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "sqlite3.connect",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "sqlite3.Error",
"line... |
12060233288 | from django.shortcuts import render,redirect
from ajoutProduitCatalogue.models import *
from templates.forms import *
# Create your views here.
def index(request):
return render(request, "index.html")
def listeProduits(request):
tous_les_produits = Produit.objects.all()
contenu = {"Produits": tous_les... | baldia275/tentative_1 | ajoutProduitCatalogue/views.py | views.py | py | 1,028 | python | fr | code | 0 | github-code | 18 | [
{
"api_name": "django.shortcuts.render",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 29,
"usage_type": "call"
},
{
"api_name... |
629118722 | from functools import partial
from itertools import cycle
import matplotlib.pyplot as plt
from PySide6.QtCore import Qt, Signal
from PySide6.QtGui import QCursor
from PySide6.QtWidgets import (
QCheckBox, QDialog, QDialogButtonBox, QMenu, QVBoxLayout
)
from hexrdgui.constants import ViewType
from hexrdgui.line_p... | HEXRD/hexrdgui | hexrdgui/tree_views/generic_picks_tree_view.py | generic_picks_tree_view.py | py | 15,797 | python | en | code | 22 | github-code | 18 | [
{
"api_name": "hexrdgui.tree_views.base_dict_tree_item_model.BaseTreeItemModel.KEY_COL",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "hexrdgui.tree_views.base_dict_tree_item_model.BaseTreeItemModel",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "hexr... |
21111348922 | import re
import pytest
from django.contrib.gis.geos import Point
from care.facility.models import District, Facility, FacilityCapacity, FacilityLocalGovtBody, State
from care.users.models import User
from config.tests.helper import assert_equal_dicts, mock_equal
# flake8: noqa
@pytest.fixture()
def user_data():
... | chrishna1/care | care/facility/tests/test_facility.py | test_facility.py | py | 14,407 | python | en | code | null | github-code | 18 | [
{
"api_name": "pytest.fixture",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "care.facility.models.Facility.objects.create",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "care.facility.models.Facility.objects",
"line_number": 28,
"usage_type": "att... |
17845858563 | import configparser
import json
from flask import Flask, request, jsonify
from AccessManagementService import ServiceInterface, logging, databaseInstance, app
databaseInstance.init_app(app)
config = configparser.ConfigParser()
config.read('AccessManagementConfig.ini')
def request_preparation(request, path):
t... | sreddy-bwi/Smart-Share-Backend | AccessManagementService/RequestHandler.py | RequestHandler.py | py | 1,189 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "AccessManagementService.databaseInstance.init_app",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "AccessManagementService.app",
"line_number": 8,
"usage_type": "argument"
},
{
"api_name": "AccessManagementService.databaseInstance",
"line_number": 8,
... |
16186273825 | import asyncio
import pyautogui
import time
from struct import unpack
from bleak import BleakClient
address = "61:D7:A3:07:2F:15"
characteristic_uuid = "19b10000-2905-537e-4f6c-d104768a1214"
async def main(address):
async with BleakClient(address) as client:
client.get_services()
while True:
... | Latchia/PyGame | breakout_game_nicla_sense_me/control.py | control.py | py | 1,055 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "bleak.BleakClient",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "struct.unpack",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pyautogui.press",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pyautogui.press",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.