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
35753692980
"""Other: Number of papers per country/region (pie)""" from asyncio import run from matplotlib import pyplot as plt from matplotlib.axes import Axes from pandas import DataFrame, concat from uvloop import install from cmt_statistics_tool.statistics import plot_df from cmt_statistics_tool.statistics.s03_02 import both...
HPI-Information-Systems/cmt_statistics_tool
cmt_statistics_tool/statistics/s03_04.py
s03_04.py
py
1,275
python
en
code
1
github-code
7
[ { "api_name": "pandas.DataFrame", "line_number": 13, "usage_type": "name" }, { "api_name": "matplotlib.axes.Axes", "line_number": 13, "usage_type": "name" }, { "api_name": "pandas.DataFrame", "line_number": 18, "usage_type": "call" }, { "api_name": "pandas.concat"...
29989534075
import os, json import numpy as np from argparse import ArgumentParser from tqdm import tqdm from collections import defaultdict from pprint import pprint import ipdb def read_file(filename): with open(filename, 'r') as fp: lines = fp.readlines() all_data = [json.loads(l) for l in lines] return all...
ej0cl6/TextEE
data/preprocessing/geneva/process_geneva.py
process_geneva.py
py
3,858
python
en
code
5
github-code
7
[ { "api_name": "json.loads", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number"...
37513098324
import scrapy import time import random import requests from lxml.html import fromstring from urllib.parse import urlparse import os class BaseSpider(scrapy.Spider): name = "BaseSpider" currentPagesScraped = 0 def __init__(self, **kwargs): self.project_urls = [] super().__init__(**kwargs) ...
resess/BlogScrapeUtilities
spiders/BaseSpider.py
BaseSpider.py
py
2,275
python
en
code
1
github-code
7
[ { "api_name": "scrapy.Spider", "line_number": 9, "usage_type": "attribute" }, { "api_name": "scrapy.Request", "line_number": 20, "usage_type": "call" }, { "api_name": "scrapy.Request", "line_number": 24, "usage_type": "call" }, { "api_name": "lxml.html.fromstring"...
74771260382
from pathlib import Path from dlplan.core import SyntacticElementFactory, DenotationsCaches from dlplan.novelty import NoveltyBase, TupleGraph from dlplan.policy import PolicyFactory from dlplan.serialization import Data, serialize, deserialize from dlplan.state_space import generate_state_space HERE = Path(__file__)...
rleap-project/dlplan
api/python/tests/serialization/gripper/test_gripper.py
test_gripper.py
py
4,770
python
en
code
6
github-code
7
[ { "api_name": "pathlib.Path", "line_number": 9, "usage_type": "call" }, { "api_name": "dlplan.state_space.generate_state_space", "line_number": 13, "usage_type": "call" }, { "api_name": "dlplan.state_space.generate_state_space", "line_number": 14, "usage_type": "call" }...
2879391278
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import configparser import logging import random import re import socket from pathlib import Path import praw import requests from bdfr.exceptions import BulkDownloaderException, RedditAuthenticationError logger = logging.getLogger(__name__) class OAuth2Authenticator...
aliparlakci/bulk-downloader-for-reddit
bdfr/oauth2.py
oauth2.py
py
4,184
python
en
code
2,113
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 28, "usage_type": "call" }, { "api_name": "bdfr.exceptions.BulkDownloaderException", "line_number": 35, "usage_type": "call" }, { "api_name":...
40919953588
from cereal import car from common.realtime import DT_CTRL from common.numpy_fast import interp, clip from common.conversions import Conversions as CV from selfdrive.car import apply_std_steer_torque_limits, create_gas_interceptor_command from selfdrive.car.gm import gmcan from selfdrive.car.gm.values import DBC, CanBu...
ds5ajd/ds5ajd_bolt
selfdrive/car/gm/carcontroller.py
carcontroller.py
py
12,873
python
en
code
1
github-code
7
[ { "api_name": "common.conversions.Conversions.KPH_TO_MS", "line_number": 13, "usage_type": "attribute" }, { "api_name": "common.conversions.Conversions", "line_number": 13, "usage_type": "name" }, { "api_name": "cereal.car.CarControl", "line_number": 14, "usage_type": "at...
29539774236
import argparse import json import os import shutil import time from collections import defaultdict import requests from cli import StatefulActivity, ensure_engine_exists, ensure_node_running, ensure_node_has_api, activitystep, \ CLIArgsException from cli.mmt import bleu, charcut from cli.mmt.engine import Engine...
modernmt/modernmt
cli/evaluate.py
evaluate.py
py
12,338
python
en
code
314
github-code
7
[ { "api_name": "cli.mmt.charcut.corpus_charcut", "line_number": 36, "usage_type": "call" }, { "api_name": "cli.mmt.charcut", "line_number": 36, "usage_type": "name" }, { "api_name": "cli.mmt.bleu.corpus_bleu", "line_number": 47, "usage_type": "call" }, { "api_name"...
35839590056
import praw import config import configTwitter import tweepy, time, sys, os #REDDIT def bot_login(): print("Logging in...") r = praw.Reddit(username = config.username, password = config.password, client_id = config.client_id, client_secret = config.client_secret, user_agent = "Raptors bot v1....
jeffreypann/raptorsSuperFan
superFan.py
superFan.py
py
1,756
python
en
code
0
github-code
7
[ { "api_name": "praw.Reddit", "line_number": 9, "usage_type": "call" }, { "api_name": "config.username", "line_number": 9, "usage_type": "attribute" }, { "api_name": "config.password", "line_number": 10, "usage_type": "attribute" }, { "api_name": "config.client_id"...
27041880491
from aiogram import types from create_bot import bot from database_queries import get_all_id_tg, get_user_info, set_end_time from requests_to_VK_API import get_newsfeed, get_video import asyncio import math async def get_posts(): while True: for id_tg in get_all_id_tg(): user = get_user_info(i...
PavelShershnoyv/ReposterVk_bot
post_handler.py
post_handler.py
py
4,273
python
en
code
0
github-code
7
[ { "api_name": "database_queries.get_all_id_tg", "line_number": 11, "usage_type": "call" }, { "api_name": "database_queries.get_user_info", "line_number": 12, "usage_type": "call" }, { "api_name": "requests_to_VK_API.get_newsfeed", "line_number": 22, "usage_type": "call" ...
31871218611
"""Simple hello world Nodejs example based on the serverless pattern: Amazon API Gateway to AWS Lambda: https://serverlessland.com/patterns/apigw-lambda-cdk Source: https://github.com/aws-samples/serverless-patterns/tree/main/apigw-lambda-cdk """ import logging import json import os BENCHMARK_CONFIG = """ apigw_node...
ServiBench/ReplicationPackage
applications/serverless-patterns/src/apigw_node_benchmark.py
apigw_node_benchmark.py
py
1,841
python
en
code
5
github-code
7
[ { "api_name": "json.load", "line_number": 36, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 38, "usage_type": "call" } ]
9124670128
# -*- coding: utf-8 -*- """ This is a custom version of the postgresql_psycopg2 adaptor that overrides last_insert_id so that it works with inherited tables. Instead of using pg_get_serial_sequence, this finds the default value of the primary key for the table and parse out the sequence name from that. As of May 2015...
catmaid/CATMAID
django/lib/custom_postgresql_psycopg2/base.py
base.py
py
2,908
python
en
code
178
github-code
7
[ { "api_name": "django.contrib.gis.db.backends.postgis.operations.PostGISOperations", "line_number": 42, "usage_type": "name" }, { "api_name": "re.search", "line_number": 63, "usage_type": "call" }, { "api_name": "django.contrib.gis.db.backends.postgis.base.DatabaseWrapper", "...
24241940196
from tkinter import * from PIL import ImageTk, Image root=Tk() images = [] #root.attributes('-fullscreen', True) #canvas = Canvas(root, width=1920, height=1080) #canvas.pack() #canvas.create_text(300,100, text="Pi Fighter", fill="red",font="72") #def gameScreen(event): #print("hi") def wipeScreen(): for widg...
cbatts1228/Portfolio
PythonProjects/BattsPiFighter/piFighterRev0.py
piFighterRev0.py
py
4,906
python
en
code
0
github-code
7
[ { "api_name": "PIL.Image.open", "line_number": 23, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 23, "usage_type": "name" }, { "api_name": "PIL.ImageTk.PhotoImage", "line_number": 25, "usage_type": "call" }, { "api_name": "PIL.ImageTk", "li...
39736773226
from os import listdir, path, makedirs from os.path import isfile, join, isdir from IPython.display import display, Markdown, Latex import nbformat as nbf import re, string class Migration(object): def __init__(self, old_journal_dir, new_journal_dir): self.set_old_journal_dir(old_journal_dir) sel...
mhsquire/PowershellFileScripts
jupyter/journal/migration.py
migration.py
py
3,719
python
en
code
0
github-code
7
[ { "api_name": "os.path.isfile", "line_number": 31, "usage_type": "call" }, { "api_name": "nbformat.v4.new_notebook", "line_number": 37, "usage_type": "call" }, { "api_name": "nbformat.v4", "line_number": 37, "usage_type": "attribute" }, { "api_name": "os.path.isdi...
41973968274
import json import locale import time import discord from core.decorators import check_permissions from core.infractions_manager import Infraction, InfractionEmbedBuilder from discord import Embed, User from discord.ext import commands # Set local time locale.setlocale(locale.LC_TIME,'') class Warn(commands.Cog): ...
voXrey/KV2S-moderation
cogs/commands/moderation/warn.py
warn.py
py
5,476
python
en
code
2
github-code
7
[ { "api_name": "locale.setlocale", "line_number": 13, "usage_type": "call" }, { "api_name": "locale.LC_TIME", "line_number": 13, "usage_type": "attribute" }, { "api_name": "discord.ext.commands.Cog", "line_number": 15, "usage_type": "attribute" }, { "api_name": "di...
35036611547
"""added item Revision ID: 698a3660ca7c Revises: f695a4a3e158 Create Date: 2020-03-14 00:47:35.986357 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql # revision identifiers, used by Alembic. revision = '698a3660ca7c' down_revision = 'f695a4a3e158' branch_labels = None de...
TKone7/product-api
migrations/versions/698a3660ca7c_added_item.py
698a3660ca7c_added_item.py
py
1,190
python
en
code
1
github-code
7
[ { "api_name": "alembic.op.create_table", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 22, "usage_type": "call" }, { "api_name": "sqlalchemy.Integ...
22672120846
# %% import pandas as pd import numpy as np import matplotlib.pyplot as plt models = ['ResNet50', 'MobileNetV2', 'ResNet101', 'BERT', 'Transformer'] # %% def get_data(csv_file, error=False): df = pd.read_csv(csv_file) df = df.drop(df.columns[0], axis=1) df.index = models df = df.drop(df.columns[-3], ...
eth-easl/orion
artifact_evaluation/fig10/plot_latency.py
plot_latency.py
py
1,934
python
en
code
12
github-code
7
[ { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 46, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 46, "usage_type": "name" }, { "api_name": "numpy.ar...
70942243102
import sys import os.path import argparse import math import json import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torch.optim.lr_scheduler as lr_scheduler from torch.nn.utils import clip_grad_norm_ from torch.autograd import Variable import torch.backe...
LiYounian/VQA
vqatest.py
vqatest.py
py
4,816
python
en
code
0
github-code
7
[ { "api_name": "config.model_type", "line_number": 20, "usage_type": "attribute" }, { "api_name": "config.model_type", "line_number": 22, "usage_type": "attribute" }, { "api_name": "config.model_type", "line_number": 24, "usage_type": "attribute" }, { "api_name": "...
43667347575
#!/bin/env python3 import re STRING_PATTERN = re.compile("'.+?(?<!\\\\)'") def parse_list(input: str): return (str(m.group()[1:-1]) for m in STRING_PATTERN.finditer(input)) def do_migration(): import psycopg from psycopg.rows import dict_row with psycopg.connect("host=127.0.0.1 dbname=integrated_sys...
Vogel612/info-integration-project
etl/etl_animeplanet.py
etl_animeplanet.py
py
3,541
python
en
code
0
github-code
7
[ { "api_name": "re.compile", "line_number": 5, "usage_type": "call" }, { "api_name": "psycopg.connect", "line_number": 13, "usage_type": "call" }, { "api_name": "psycopg.rows.dict_row", "line_number": 13, "usage_type": "name" } ]
15400647199
import os import argparse from PyQt6.QtWidgets import QApplication from gui import DocumentMergeWindow template_dir = os.path.dirname(os.path.realpath(__file__)) template_dir = os.path.join(template_dir, 'templates') parser = argparse.ArgumentParser(description='Merge multiple Word document templates') parse...
colinbrownec/DocMerge
main.py
main.py
py
713
python
en
code
0
github-code
7
[ { "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": "os.path.join", "line_n...
33938346563
import configparser from datetime import datetime import os from pyspark.sql import SparkSession from pyspark.sql.functions import udf, col, monotonically_increasing_id from pyspark.sql.functions import year, month, dayofmonth, hour, weekofyear, date_format, dayofweek from pyspark.sql.types import StructType, StructFie...
robertgv/Data_Lake_in_AWS
etl.py
etl.py
py
8,010
python
en
code
0
github-code
7
[ { "api_name": "configparser.ConfigParser", "line_number": 10, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 15, "usage_type": "attribute" }, { "api_name": "pyspark.sql...
73911063262
from typing import List class UnionFind: def __init__(self, n: int) -> None: self.uf = list(range(n)) self.components = n def find(self, i: int) -> int: if self.uf[i] != i: self.uf[i] = self.find(self.uf[i]) return self.uf[i] def union(self, a: int, b: int) ->...
cs-cordero/interview-prep
leetcode/0547_friend_circles.py
0547_friend_circles.py
py
829
python
en
code
9
github-code
7
[ { "api_name": "typing.List", "line_number": 23, "usage_type": "name" } ]
11593210586
# Mengimpor modul-modul yang diperlukan from django.shortcuts import render from django.shortcuts import redirect from django.contrib.auth.forms import UserCreationForm from django.contrib import messages from django.contrib.auth import authenticate, login, logout from django.contrib.auth.decorators import login_requir...
febidamanik/tugas2-pbp
todolist/views.py
views.py
py
3,668
python
en
code
0
github-code
7
[ { "api_name": "todolist.models.Task.objects.filter", "line_number": 21, "usage_type": "call" }, { "api_name": "todolist.models.Task.objects", "line_number": 21, "usage_type": "attribute" }, { "api_name": "todolist.models.Task", "line_number": 21, "usage_type": "name" },...
70079705182
# # Tests for Ai (2020) Enertech parameter set loads # import pybamm import unittest import os class TestAi2020(unittest.TestCase): def test_load_params(self): Li_plating = pybamm.ParameterValues({}).read_parameters_csv( pybamm.get_parameters_filepath( "input/parameters/lithium...
emptylkj/PyBaMM
tests/unit/test_parameters/test_parameter_sets/test_OKane2020.py
test_OKane2020.py
py
1,519
python
en
code
0
github-code
7
[ { "api_name": "unittest.TestCase", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pybamm.ParameterValues", "line_number": 11, "usage_type": "call" }, { "api_name": "pybamm.get_parameters_filepath", "line_number": 12, "usage_type": "call" }, { "api_n...
7623469842
#!/usr/bin/env python # -*- coding: utf-8 -*- import ast from io import open import re import sys import subprocess from setuptools import Command, setup, find_packages _version_re = re.compile(r"__version__\s+=\s+(.*)") with open("urestapi/__init__.py", "rb") as f: version = str( ast.literal_eval(_versi...
uptycslabs/urestapi
setup.py
setup.py
py
2,077
python
en
code
0
github-code
7
[ { "api_name": "re.compile", "line_number": 11, "usage_type": "call" }, { "api_name": "io.open", "line_number": 13, "usage_type": "call" }, { "api_name": "ast.literal_eval", "line_number": 15, "usage_type": "call" }, { "api_name": "io.open", "line_number": 21, ...
18331469509
"""Face Detection Module""" from enum import Enum import cv2 from skimage import io from keras.models import model_from_json from mtcnn_cv2 import MTCNN import numpy as np json_file = open('./api/machine_learning/weights/emotion_model.json', 'r') loaded_model_json = json_file.read() json_file.close() emotion_model = m...
PlatoSys/face-detection
api/machine_learning/face_detection.py
face_detection.py
py
8,295
python
en
code
0
github-code
7
[ { "api_name": "keras.models.model_from_json", "line_number": 12, "usage_type": "call" }, { "api_name": "mtcnn_cv2.MTCNN", "line_number": 19, "usage_type": "call" }, { "api_name": "skimage.io.imread", "line_number": 23, "usage_type": "call" }, { "api_name": "skimag...
71852622945
# XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX # Orbital Mechanics & Dynamics Software Collection # Author: Steven Anderson # Created: JUL 2022 # Brief: This script is to plot a satellite's orbit # # XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX import matplotlib.pyplot a...
dezwemmer/orbitalmech
OrbitalRepo/Algorithms/visualization/plotSatOrbit.py
plotSatOrbit.py
py
844
python
en
code
0
github-code
7
[ { "api_name": "numpy.mgrid", "line_number": 17, "usage_type": "attribute" }, { "api_name": "numpy.pi", "line_number": 17, "usage_type": "attribute" }, { "api_name": "numpy.cos", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number...
17141292550
import torch import torch.nn as nn import torch.nn.functional as F import math from .block import TopDownBlock, BottomUpBlock from vistem.modeling.backbone import Backbone from vistem.modeling.layers import Conv2d, get_norm from vistem.utils import weight_init from vistem.structures import ShapeSpec __all__ = ['BiFP...
major196512/vistem
vistem/modeling/backbone/bifpn/model.py
model.py
py
2,825
python
en
code
5
github-code
7
[ { "api_name": "vistem.modeling.backbone.Backbone", "line_number": 15, "usage_type": "name" }, { "api_name": "vistem.modeling.backbone.Backbone", "line_number": 20, "usage_type": "argument" }, { "api_name": "block.TopDownBlock", "line_number": 31, "usage_type": "call" },...
18654979611
import functools import click from click import Context, HelpFormatter from dbt.cli.options import MultiOption # define common parameters project_path = click.option( "--project-path", type=click.Path(exists=True), default=".", help="The path to the dbt project to operate on. Defaults to the current d...
dbt-labs/dbt-meshify
dbt_meshify/cli.py
cli.py
py
3,649
python
en
code
72
github-code
7
[ { "api_name": "click.option", "line_number": 8, "usage_type": "call" }, { "api_name": "click.Path", "line_number": 10, "usage_type": "call" }, { "api_name": "click.option", "line_number": 15, "usage_type": "call" }, { "api_name": "dbt.cli.options.MultiOption", ...
28647350599
import numpy as np import pickle import pandas as pd import streamlit as st from PIL import Image pickle_in = open("classifier.pkl","rb") classifier=pickle.load(pickle_in) def welcome(): return "Welcome All" def predict_impact(opened_by, location, ID_caller, Category_id, ID): """Let's find...
prernagaikwad/impact-prediction
app.py
app.py
py
1,839
python
en
code
1
github-code
7
[ { "api_name": "pickle.load", "line_number": 10, "usage_type": "call" }, { "api_name": "streamlit.markdown", "line_number": 57, "usage_type": "call" }, { "api_name": "streamlit.text_input", "line_number": 60, "usage_type": "call" }, { "api_name": "streamlit.text_in...
16765375803
from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.chrome.options import Options import time import xlwt option = Options() option.add_argument('--headless') chrome_driver = 'E:\chromedriver.exe' driver = webdriver.Chrome(chrome_options=option,executable_path=chrome...
2470370075/other_spider
selenium_test.py
selenium_test.py
py
1,593
python
en
code
0
github-code
7
[ { "api_name": "selenium.webdriver.chrome.options.Options", "line_number": 7, "usage_type": "call" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 11, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 11, "usage_type": "name" }, { ...
16642692830
from typing import ( Optional, List ) from qgis.PyQt.QtCore import ( QObject, pyqtSignal ) from qgis.core import QgsMapLayer from kart.utils import setting, setSetting from ..kartapi import ( Repository, KartException ) class RepoManager(QObject): """ Manages the local repositories...
Kaessham/kart-qgis-plugin
kart/core/repo_manager.py
repo_manager.py
py
2,534
python
en
code
null
github-code
7
[ { "api_name": "qgis.PyQt.QtCore.QObject", "line_number": 21, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 26, "usage_type": "name" }, { "api_name": "qgis.PyQt.QtCore.pyqtSignal", "line_number": 28, "usage_type": "call" }, { "api_name": "...
29662814690
from django.core.validators import MaxValueValidator from django.core.validators import MinValueValidator from django.db import models from django.utils import timezone from phonenumber_field.modelfields import PhoneNumberField from location.models import Location class OrderQuerySet(models.QuerySet): """Order ...
savilard/delivery-drf-api
src/backend/foodcartapp/models/order.py
order.py
py
4,179
python
en
code
0
github-code
7
[ { "api_name": "django.db.models.QuerySet", "line_number": 11, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 11, "usage_type": "name" }, { "api_name": "django.db.models.Sum", "line_number": 17, "usage_type": "call" }, { "api_name": "...
28016252387
import os from flask import Flask, request, abort, jsonify import face_recognition import json from werkzeug.utils import secure_filename import numpy as np app = Flask(__name__) app.config['MAX_CONTENT_LENGTH'] = 16 * 1024 * 1024 app.debug = True face_encodes = [] data_dir = "./data" # You can change this to any f...
liuyanmin120/face
main.py
main.py
py
2,800
python
en
code
1
github-code
7
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.request.files", "line_number": 28, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 28, "usage_type": "name" }, { "api_name": "json.dumps", "l...
33510722559
import torch import math import numpy as np ######################### ### Design Parameters ### ######################### n = 100 # amount of antenna elements m = 6 # dimension of our state space m1x_0 = torch.ones(m, 1) m1x_0 = torch.transpose(torch.tensor([[2.5, -9.1, 1.5, 0.01, 0.97, 0]], dtype=torch.float), 0, 1...
LukasHolliger/RFLocalization
One-Shot Localize/parameters.py
parameters.py
py
2,004
python
en
code
0
github-code
7
[ { "api_name": "torch.ones", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.transpose", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.tensor", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.float", "line_numbe...
31527283283
import argparse import os import re import subprocess import sys import common # ========= COMMAND LINE ARGUMENTS ======== def parse_arguments(): parser = argparse.ArgumentParser(description="Create Qt Creator development package.") parser.add_argument('--source', '-s', help='path to the Qt Creator sources',...
loaden/qtcreator
scripts/createDevPackage.py
createDevPackage.py
py
4,167
python
en
code
17
github-code
7
[ { "api_name": "argparse.ArgumentParser", "line_number": 12, "usage_type": "call" }, { "api_name": "common.is_windows_platform", "line_number": 19, "usage_type": "call" }, { "api_name": "common.is_windows_platform", "line_number": 52, "usage_type": "call" }, { "api...
22760686408
from django.urls import path from . import views urlpatterns = [ path("", views.index, name="index"), path("natwit", views.natwit, name="natwit"), path("yodyiam", views.yodyiam, name="yodyiam"), path("<str:name>", views.greet, name="greet") ]
natthawit-jan/django-proj
first/urls.py
urls.py
py
262
python
en
code
0
github-code
7
[ { "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", ...
70797647902
#!/bin/python3 import os import getopt import yaml import math import sys JD_ID = 00.00 META = False def parseArgs(): global META try: opts, args = getopt.getopt(sys.argv[1:], "hf:p:m", ["help", "file=", "path="]) except: sys.exit(2) source_file = "../res/jd.yaml" ...
dandeeccastro/jd_filesystem_generator
src/main.py
main.py
py
2,177
python
en
code
0
github-code
7
[ { "api_name": "getopt.getopt", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 15, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 18, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 25...
22701215890
from rest_framework import serializers from rest_framework.validators import UniqueValidator from .models import Account, Address def validate_address(address_to_check): """This function will do a simple validation to check if the address is already in the DB.""" qs = Address.objects.filter( ...
York13Pud/python-project-home-monitoring
backend/api/apps/accounts/validators.py
validators.py
py
1,870
python
en
code
1
github-code
7
[ { "api_name": "models.Address.objects.filter", "line_number": 12, "usage_type": "call" }, { "api_name": "models.Address.objects", "line_number": 12, "usage_type": "attribute" }, { "api_name": "models.Address", "line_number": 12, "usage_type": "name" }, { "api_name...
39404111837
import unittest import mongomock import uuid from datetime import datetime from database.crud import MongoTransactionCRUD, MongoAccountCRUD from schemas import Transaction, CurrencyAmount, Account, BankLink, InstitutionInfo mock_transactions = [ Transaction( id=str(uuid.uuid4()), origin="origin", ...
genfu94/Monee
backend/test/test_crud.py
test_crud.py
py
2,264
python
en
code
0
github-code
7
[ { "api_name": "schemas.Transaction", "line_number": 9, "usage_type": "call" }, { "api_name": "uuid.uuid4", "line_number": 10, "usage_type": "call" }, { "api_name": "schemas.CurrencyAmount", "line_number": 12, "usage_type": "call" }, { "api_name": "uuid.uuid4", ...
8473144060
from django.shortcuts import render, redirect from django.template.context_processors import csrf from django.conf import settings from django.http import HttpResponse from upload_form.models import FileNameModel import sys, os UPLOADE_DIR = os.path.dirname(os.path.abspath(__file__)) + '/vowel_cut/input_file/' DOWNLOAD...
KaijiS/Cut_Vowel
upload_form/views.py
views.py
py
2,868
python
en
code
0
github-code
7
[ { "api_name": "os.path.dirname", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path.dirname", "line...
7866366227
import json from django.contrib.auth.models import User from django.contrib.auth.decorators import login_required from django.shortcuts import render, redirect from django.shortcuts import get_object_or_404, get_list_or_404 from django.http import HttpResponse, Http404, HttpResponseRedirect, JsonResponse from .models ...
ozzy92/JaysConnect4
connect4/rester.py
rester.py
py
1,927
python
en
code
0
github-code
7
[ { "api_name": "models.Game", "line_number": 17, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 20, "usage_type": "call" }, { "api_name": "consumers.GamesConsumer.send_available_update", "line_number": 21, "usage_type": "call" }, { "api_name": "...
71652519583
import telebot from PIL import Image import pytesseract import keyboards from skimage.filters import threshold_local import numpy as np import cv2 import imutils import os def order_points(pts): rect = np.zeros((4, 2), dtype = "float32") s = pts.sum(axis = 1) rect[0] = pts[np.argmin(s)] rect[2] = pts[np.argmax(s)...
DruzhininKirill/documentobot
cv_alg.py
cv_alg.py
py
2,471
python
en
code
0
github-code
7
[ { "api_name": "numpy.zeros", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.argmin", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.argmax", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.diff", "line_number":...
15109785571
from itertools import permutations def operation_sum(path): op_sum = 1 row = 1 for char in path: if char == 'R': row_value = row op_sum += row_value elif char == 'D': row += 1 row_value = row op_sum += row_value return op_sum def possible_paths(m,n,sval): init_path = 'R'*(m-1) + 'D'*(n-1) a...
shivaramakrishna99/NTU_MS_SBS
AY20_MBDS_questions/Question 1/1.py
1.py
py
573
python
en
code
0
github-code
7
[ { "api_name": "itertools.permutations", "line_number": 18, "usage_type": "call" } ]
20265264867
''' usage.py ''' import os from toy_component import ToyComponent import flask import dash import dash_html_components as html app = dash.Dash('') app.scripts.config.serve_locally = True # <div className="container"> # <h1>Demo: toy-component</h1> # <ToyComponent # className="toy" # label="...
craigmorten/toy-plotly-dash-component
toy-component/usage.py
usage.py
py
1,351
python
en
code
0
github-code
7
[ { "api_name": "dash.Dash", "line_number": 11, "usage_type": "call" }, { "api_name": "dash_html_components.Div", "line_number": 26, "usage_type": "call" }, { "api_name": "dash_html_components.H1", "line_number": 27, "usage_type": "call" }, { "api_name": "toy_compon...
7719451878
import json import gzip import logging import requests from prometheus_client.core import REGISTRY, GaugeMetricFamily from prometheus_client import make_wsgi_app, start_wsgi_server from wsgiref.simple_server import make_server ESI_URL = "https://esi.evetech.net" DATASOURCE = "tranquility" logger = logging.getLogger(...
safeties-red/eve-online-prometheus-exporter
exporter/main.py
main.py
py
3,398
python
en
code
1
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "requests.Session", "line_number": 22, "usage_type": "call" }, { "api_name": "prometheus_client.core.GaugeMetricFamily", "line_number": 35, "usage_type": "call" }, { "api_n...
16308933918
from os.path import normpath from pprint import pformat from django.conf import settings from django.core.signals import request_started from django.dispatch import Signal from django.template.context import get_standard_processors from django.template.loader import render_to_string from django.test.signals import tem...
spreeker/democracygame
external_apps/django-debug-toolbar/debug_toolbar/panels/template.py
template.py
py
2,986
python
en
code
9
github-code
7
[ { "api_name": "django.template.Template.render", "line_number": 20, "usage_type": "attribute" }, { "api_name": "django.template.Template", "line_number": 20, "usage_type": "name" }, { "api_name": "django.test.utils.instrumented_test_render", "line_number": 20, "usage_type...
25153777505
import os from abc import abstractmethod from typing import Callable, Optional, Tuple, Union import torch import torch.nn as nn from loguru import logger from omegaconf import OmegaConf from .registry import MODEL_BACKBONE_DICT, MODEL_HEAD_DICT, MODEL_NECK_DICT from .utils import BackboneOutput, DetectionModelOutput,...
Nota-NetsPresso/netspresso-trainer
src/netspresso_trainer/models/base.py
base.py
py
4,625
python
en
code
10
github-code
7
[ { "api_name": "torch.nn.Module", "line_number": 14, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 16, "usage_type": "name" }, { "api_name": "typing.Union", "lin...
35249094706
#!/usr/bin/python ''' Part of the Qt-Deployment scripts @package qt-deploy ''' import os import sys import stat import shutil import zipfile import tarfile import ConfigParser import argparse import subprocess from subprocess import check_call def copy(src, dst): if os.path.islink(src): linkto = os.readl...
machinekoder/Qt-Deployment-Scripts
qt-deploy.py
qt-deploy.py
py
21,496
python
en
code
2
github-code
7
[ { "api_name": "os.path.islink", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "os.readlink", "line_number": 21, "usage_type": "call" }, { "api_name": "os.symlink", "line_number...
73689787422
import torch import torch.nn.functional as F def temp_denoise(model, noisyframe, sigma_noise): '''Encapsulates call to denoising model and handles padding. Expects noisyframe to be normalized in [0., 1.] ''' # make size a multiple of four (we have two scales in the denoiser) sh_im = noisyframe.size() expanded_h...
xiangly55/ReMoNet
Gaussian_exp/ReMoNet.py
ReMoNet.py
py
3,193
python
en
code
9
github-code
7
[ { "api_name": "torch.nn.functional.pad", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.nn.functional", "line_number": 17, "usage_type": "name" }, { "api_name": "torch.nn.functional.pad", "line_number": 18, "usage_type": "call" }, { "api_name": "t...
24326626780
# -*- coding: utf-8 -*- """ Created on Wed Jun 27 00:48:07 2018 @author: Tareq """ ''' - two ways of creating dataframe 1. using the dataframe syntax and read_csv. read_excel - line is the default graph type for the plot method - tareq.j@metroc.ca ''' import os os.chdir(r'C:\Users\mfatemeh\Desktop\python') import pa...
fatemehKi/data_analytics
plots.py
plots.py
py
12,762
python
en
code
0
github-code
7
[ { "api_name": "os.chdir", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.read_excel", "line_number": 21, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 29, "usage_type": "call" }, { "api_name": "pandas.read_excel", "...
74915832542
from fastapi import FastAPI from modules import mongodb import json from datetime import datetime app = FastAPI() @app.get("/") def read_root(): return {"Hello": "World"} @app.post("/bookmark") async def add_bookmark(url: str, label: str = None): # get current date and time now = datetime.now() dt ...
hotheadhacker/bookmarker-fastAPI-REST-python
main.py
main.py
py
756
python
en
code
0
github-code
7
[ { "api_name": "fastapi.FastAPI", "line_number": 6, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 17, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 17, "usage_type": "name" }, { "api_name": "datetime.datet...
33437742851
import json import jsonschema import os import re import reframe as rfm import reframe.core.exceptions as errors import reframe.utility.jsonext as jsonext import reframe.utility.versioning as versioning DATA_VERSION = '1.3.0' _SCHEMA = os.path.join(rfm.INSTALL_PREFIX, 'reframe/schemas/runreport.json') class _RunRe...
toxa81/reframe
reframe/frontend/runreport.py
runreport.py
py
4,461
python
en
code
null
github-code
7
[ { "api_name": "os.path.join", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "reframe.INSTALL_PREFIX", "line_number": 13, "usage_type": "attribute" }, { "api_name": "reframe.core.ex...
36690582258
from django.core.paginator import Paginator from django.http import HttpResponse from django.shortcuts import render from rest_framework import viewsets from rest_framework import permissions as drf_permissions from rest_framework.decorators import action from . import models, permissions, serializers def index(requ...
SuperLalka/stilsoft-test
transport_routes/views.py
views.py
py
3,169
python
en
code
0
github-code
7
[ { "api_name": "django.core.paginator.Paginator", "line_number": 13, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 15, "usage_type": "call" }, { "api_name": "rest_framework.viewsets.ModelViewSet", "line_number": 20, "usage_type": "attribut...
3938159138
"""restore unique naming scheme for gene models if, e.g., sequences were ran through the predictor individually, instead of as a whole genome, and current gene IDs are non-unique. Also adds species prefix. Assumes all transcript names etc exactly contain the gene ID; if this isn't true Transcript IDs won't end up uniqu...
weberlab-hhu/helixer_scratch
method_comp/running_augustus/scripts/make_unique_names.py
make_unique_names.py
py
1,640
python
en
code
0
github-code
7
[ { "api_name": "argparse.ArgumentParser", "line_number": 24, "usage_type": "call" }, { "api_name": "dustdas.gffhelper.read_gff_file", "line_number": 34, "usage_type": "call" }, { "api_name": "dustdas.gffhelper", "line_number": 34, "usage_type": "name" }, { "api_nam...
20095630778
from openpyxl import load_workbook import csv wb = load_workbook(filename = '/home/nic/Dokumenty/web/venv/data.xlsx') ws = wb['nic'] ws2 = wb['pamet'] indexp = ws2['A9'].value print(indexp) odmerp = ws2['A4'].value if odmerp == "?" : newRowLocation = ws.max_row +1 file = open('/home/nic/Do...
Buldadavid/stitekweb
stitekweb-old/venv/pokus_odmer.py
pokus_odmer.py
py
629
python
en
code
0
github-code
7
[ { "api_name": "openpyxl.load_workbook", "line_number": 4, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 18, "usage_type": "call" } ]
37505819036
from itertools import count def parse(s): try: return int(s) except ValueError: return s def assemble(code): for line in code.split('\n'): op_name, op1, *op2 = line.strip().split(' ') yield [op_name, parse(op1), parse(op2[0]) if op2 else None] def solve(insts, **init_re...
dopplershift/advent-of-code
2016/day25.py
day25.py
py
1,420
python
en
code
6
github-code
7
[ { "api_name": "itertools.count", "line_number": 39, "usage_type": "call" }, { "api_name": "aocd.models.Puzzle", "line_number": 56, "usage_type": "call" } ]
72867141982
import torch import pickle import gensim from create_vocab import Vocabulary, create_vocab model_config = { #'gpu': 1, 'npu': 0, '<PAD>': 0, '<SOS>': 1, '<EOS>': 2, '<UNK>': 3, 'n_layers': 2, 'dropout': 0.2, 'output_dim': 6, # number of classes 'hidden_dim': 500, 'n_epochs...
Ascend/ModelZoo-PyTorch
PyTorch/contrib/nlp/multimodal-speech-emotion-recognition_ID2977_for_PyTorch/lstm_classifier/t2e/config.py
config.py
py
1,055
python
en
code
31
github-code
7
[ { "api_name": "pickle.load", "line_number": 36, "usage_type": "call" }, { "api_name": "create_vocab.create_vocab", "line_number": 38, "usage_type": "call" }, { "api_name": "utils.generate_word_embeddings", "line_number": 39, "usage_type": "call" } ]
27509929676
#!/usr/bin/env python from __future__ import with_statement import os import sys import errno import re import hashlib from fuse import FUSE, FuseOSError, Operations from .fs_config import KeyfileFSConfig from .fs_keyfiles import KeyfileFSKeyfiles from .constants import * class STAT_FILETYPE: # https://git...
neoatlantis/KeyfileFS
keyfilefs/fs.py
fs.py
py
6,670
python
en
code
0
github-code
7
[ { "api_name": "hashlib.sha512", "line_number": 46, "usage_type": "call" }, { "api_name": "fuse.Operations", "line_number": 58, "usage_type": "name" }, { "api_name": "os.getuid", "line_number": 61, "usage_type": "call" }, { "api_name": "os.getgid", "line_number...
38561679012
import json for i in range(1, 27): data = { "name": chr(i + 64), "description": "This is a NFT collection of Alphabets Collectibles", "image": "ipfs://bafybeifjft3uqjkzk2tlqm6pupwoiks5n2mswhjlyy6fom7vk76sko6eti/"+str(i)+".png", "attributes": [ { "trait_t...
UsamaRashid/minting-website-react
pythonScript/main.py
main.py
py
617
python
en
code
0
github-code
7
[ { "api_name": "json.dump", "line_number": 22, "usage_type": "call" } ]
70669646624
import requests from utils.config import PATH, ASSET_ENDPOINTS from utils.tools import _check_endpoint, _check_errors, _check_optional_filter, grab_headers class Assets(object): def __init__(self): self._PATH = PATH self._class_type = "assets" def _get_all_assets(self, optional_filter="") -> ...
engoyji/messari-py
rest/assets.py
assets.py
py
2,275
python
en
code
0
github-code
7
[ { "api_name": "utils.config.PATH", "line_number": 7, "usage_type": "name" }, { "api_name": "utils.tools._check_optional_filter", "line_number": 15, "usage_type": "call" }, { "api_name": "utils.tools._check_endpoint", "line_number": 16, "usage_type": "call" }, { "a...
35484380940
from lxml import html from argparse import ArgumentParser import re import requests def verify_url(url): new_url = url if url[:4] == "http" and url[4] != "s": new_url = "https" + url[4:] regex = "https://(www\.)?nzherald\.co\.nz/[a-zA-Z]+/news/article\.cfm\?c_id=\d&objectid=\d{8}" assert re.ma...
alexhutman/nz-herald-free
nz_herald_free_content.py
nz_herald_free_content.py
py
1,281
python
en
code
0
github-code
7
[ { "api_name": "re.match", "line_number": 12, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 16, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 26, "usage_type": "call" }, { "api_name": "lxml.html.fromstring", ...
23663105994
import unittest import azure.functions as func from second_function.Function import main class TestFunction(unittest.TestCase): def test_second_function(self): # Construct a mock HTTP request req = func.HttpRequest( method='GET', body=None, url='/api/second_func...
Pavel-Hrabec/Azure-Resume-Challenge
backend/test/tests/test_httptrigger.py
test_httptrigger.py
py
537
python
en
code
6
github-code
7
[ { "api_name": "unittest.TestCase", "line_number": 6, "usage_type": "attribute" }, { "api_name": "azure.functions.HttpRequest", "line_number": 9, "usage_type": "call" }, { "api_name": "azure.functions", "line_number": 9, "usage_type": "name" }, { "api_name": "secon...
40978964121
from typing import List, Tuple, Optional from collections import defaultdict,deque from functools import cache import heapq from sortedcontainers import SortedDict,SortedList class Solution: def modifiedGraphEdges(self, n: int, edges: List[List[int]], source: int, destination: int, target: int) -> List[List[int]]...
wherby/code
contest/00000c315d89/c346/q4/t4.py
t4.py
py
1,529
python
en
code
1
github-code
7
[ { "api_name": "typing.List", "line_number": 9, "usage_type": "name" }, { "api_name": "heapq.heappop", "line_number": 20, "usage_type": "call" }, { "api_name": "heapq.heappush", "line_number": 28, "usage_type": "call" } ]
40979141661
from typing import List, Tuple, Optional from collections import defaultdict,deque from functools import cache import heapq from heapq import heappop,heappush from sortedcontainers import SortedDict,SortedList class Solution: def minAbsoluteDifference(self, nums: List[int], x: int) -> int: sl = SortedLis...
wherby/code
contest/00000c315d89/c358/q3/t3.py
t3.py
py
768
python
en
code
1
github-code
7
[ { "api_name": "typing.List", "line_number": 10, "usage_type": "name" }, { "api_name": "sortedcontainers.SortedList", "line_number": 11, "usage_type": "call" } ]
35753518130
import collections import functools import itertools import operator import resource from pathlib import Path from tqdm.auto import tqdm from wikipedia_cleanup.ar.template_predictor import AssociationRulesTemplatePredictor from wikipedia_cleanup.predict import TrainAndPredictFramework def generate_grid(**items): ...
HPI-Information-Systems/wikipedia_cleanup
wikipedia_cleanup/ar/grid.py
grid.py
py
1,980
python
en
code
2
github-code
7
[ { "api_name": "itertools.starmap", "line_number": 15, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 16, "usage_type": "call" }, { "api_name": "itertools.product", "line_number": 17, "usage_type": "call" }, { "api_name": "functools....
4783534769
#!/usr/bin/env python3 """ This module is used to get the catalogs that should be added or removed from a device. """ from collections import defaultdict def get_device_catalogs(groups, device_manifest, default_catalog, add_catalogs=False, remove_catalogs=False) -> list: """Get the catalogs that should be added...
almenscorner/Munki-Manifest-Generator
munki_manifest_generator/get_device_catalogs.py
get_device_catalogs.py
py
1,978
python
en
code
12
github-code
7
[ { "api_name": "collections.defaultdict", "line_number": 28, "usage_type": "call" } ]
12571135879
from keras.preprocessing.image import ImageDataGenerator import importlib import numpy as np import random from keras.utils import to_categorical from sklearn.preprocessing import LabelEncoder import utils.df_preprocessing as preprocess def labels_provider(l, n): while len(l) > 0: poped = l[:n] l = l[...
DenGuzawr22/Fashion-Product-Images-Generation
src/utils/image_provider.py
image_provider.py
py
6,447
python
en
code
0
github-code
7
[ { "api_name": "utils.df_preprocessing.filter_articles", "line_number": 44, "usage_type": "call" }, { "api_name": "utils.df_preprocessing", "line_number": 44, "usage_type": "name" }, { "api_name": "utils.df_preprocessing.get_clean_DF", "line_number": 44, "usage_type": "cal...
20563930035
"""This module provides the bsimport's CLI.""" # bsimport/cli.py import typer from pathlib import Path from typing import Any, Optional, Tuple from bsimport import ( ERRORS, EXT_ERROR, NO_FILE_ERROR, NO_ID_ERROR, SUCCESS, __app_name__, __version__, config, imp ) app = typer.Typer() @app.command() def init...
JulioLoayzaM/bsimport
bsimport/cli.py
cli.py
py
11,845
python
en
code
4
github-code
7
[ { "api_name": "typer.Typer", "line_number": 14, "usage_type": "call" }, { "api_name": "typer.Option", "line_number": 19, "usage_type": "call" }, { "api_name": "typer.Option", "line_number": 24, "usage_type": "call" }, { "api_name": "typer.Option", "line_number...
20283094096
import os from typing import OrderedDict import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import hydra from models.losses_pointnet import * from models.pointnet2_utils import PointNetSetAbstraction,PointNetFeaturePropagation from utils.config import bcolors from utils.debugging im...
abahnasy/4D-PLS
models/pointnet2_sem_seg.py
pointnet2_sem_seg.py
py
13,364
python
en
code
0
github-code
7
[ { "api_name": "torch.nn.Module", "line_number": 23, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 23, "usage_type": "name" }, { "api_name": "numpy.sort", "line_number": 41, "usage_type": "call" }, { "api_name": "torch.from_numpy", "line...
18269171889
import time from abc import ABC from dataclasses import dataclass from datetime import datetime from flask import Flask, render_template, url_for from datetime import datetime from flask_sqlalchemy import SQLAlchemy # Example of playlist information here # playtlist_template = {'_type': 'playlist', # 'entries': [],...
ddlinz/vox_mortis
vox/data_entry.py
data_entry.py
py
6,444
python
en
code
0
github-code
7
[ { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 106, "usage_type": "call" }, { "api_name": "dataclasses.dataclass", "line_number": 109, "usage_type": "name" }, { "api_name": "datetime.datetime.utcnow", "line_number": 122, "usage_type": "attribute" }, { ...
14388462066
import unittest from ..targeting.targeter import * from ..messaging.test_messenger import Messenger from ..data.values import Direction, Status from multiprocessing import Queue class TestTargeter(unittest.TestCase): messenger = Messenger() motion_queue = Queue() targeter = Targeter(None, motion_queue, No...
icheered/LaserTurretProject
Laptop/testing/test_targeter_methods.py
test_targeter_methods.py
py
4,493
python
en
code
0
github-code
7
[ { "api_name": "unittest.TestCase", "line_number": 8, "usage_type": "attribute" }, { "api_name": "messaging.test_messenger.Messenger", "line_number": 9, "usage_type": "call" }, { "api_name": "multiprocessing.Queue", "line_number": 10, "usage_type": "call" }, { "api...
3690071143
# Q4.Python dictionary(sort by key) object ko json data ::mai convert karne ka program likho? import json dic = {'4': 5, '6': 7,'1': 3,'2': 4} list1=[] for i in dic: list1.append(i) #print(list1) i=0 while i<len(list1): j=0 while j<len(list1): if list1[i]<list1[j]: list1[i],list1[j]=list...
Deepti-20/json_questions
python_jsonsort.py
python_jsonsort.py
py
542
python
en
code
1
github-code
7
[ { "api_name": "json.dump", "line_number": 25, "usage_type": "call" } ]
72354902623
from typing import Union, List, AnyStr, Optional from aiogram.contrib.fsm_storage import memory from .base import BaseStorage class MemoryStorage(BaseStorage, memory.MemoryStorage): def resolve_address(self, chat, user): chat_id, user_id = self.check_address(chat=chat, user=user) if chat_id no...
leotrubach/aiogram-scenario
aiogram_scenario/fsm/storages/memory.py
memory.py
py
1,837
python
en
code
0
github-code
7
[ { "api_name": "base.BaseStorage", "line_number": 8, "usage_type": "name" }, { "api_name": "aiogram.contrib.fsm_storage.memory.MemoryStorage", "line_number": 8, "usage_type": "attribute" }, { "api_name": "aiogram.contrib.fsm_storage.memory", "line_number": 8, "usage_type":...
16853395150
import asyncore import threading from multiprocessing import Queue import subprocess import sys, os, socket, platform import time import datetime import logging class FixGUIServer: def __init__(self, sendQueue=None, recvQueue=None): logging.basicConfig(filename='fixGUIServer.log', level=logging.DEBUG) ...
Eurybiadan/Fixation_GUI
fixationgui/wxFixProc.py
wxFixProc.py
py
5,725
python
en
code
4
github-code
7
[ { "api_name": "logging.basicConfig", "line_number": 14, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", ...
6822011243
from fastapi import APIRouter, HTTPException from pydantic import BaseModel import logging from thunder_loja.db_handler import DBHandler # Data class ClientData(BaseModel): cpf: int name: str # Router router = APIRouter( prefix="/cliente", tags=["cliente"], responses={404: {"description": "Not ...
ThunderLoja/backend
thunder_loja/routers/client_router.py
client_router.py
py
2,697
python
en
code
0
github-code
7
[ { "api_name": "pydantic.BaseModel", "line_number": 9, "usage_type": "name" }, { "api_name": "fastapi.APIRouter", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 22, "usage_type": "call" }, { "api_name": "thunder_loja.db...
8234296210
import os import glob from setuptools import Extension, setup, Distribution def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name = "pymkeviewer", version = "@PYMKEVIEWER_VERSION@", author = "Magik Eye Inc.", author_email = "jan@magik-eye.com", descrip...
MagikEyeInc/SDK
pymkeviewer/pymkeviewer/setup.py
setup.py
py
1,149
python
en
code
13
github-code
7
[ { "api_name": "os.path.join", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 6, "usage_type": "call" }, { "api_name": "setuptools.setup", "line_n...
32168660123
''' https://gis.stackexchange.com/questions/57005/python-gdal-write-new-raster-using-projection-from-old ''' import yaml import os import rasterio import numpy as np from tqdm import tqdm from PIL import Image NO_DATA = 9999 def parse_name(file): h,w = file.split('_') return(int(h),int(w)) def _rebuil...
Cybonic/DL_vineyard_segmentation_study
utils/tif_utils.py
tif_utils.py
py
2,730
python
en
code
6
github-code
7
[ { "api_name": "numpy.zeros", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 23, "usage_type": "attribute" }, { "api_name": "os.path.isdir", "line_number": 44, "usage_type": "call" }, { "api_name": "os.path", "line_number...
70996344223
import base64 import pickle import tempfile from pathlib import Path from unittest import TestCase from unittest.mock import ANY, patch, call, MagicMock from dkutils.constants import GMAIL_APPROVAL_STRING from dkutils.gmail_api.gmail_client import create_base64_encoded_token, GmailClientException, \ get_object_fro...
DataKitchen/DKUtils
tests/gmail_api/test_gmail_client.py
test_gmail_client.py
py
13,384
python
en
code
2
github-code
7
[ { "api_name": "pathlib.Path", "line_number": 12, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_number": 27, "usage_type": "name" }, { "api_name": "dkutils.gmail_api.gmail_client.create_message", "line_number": 38, "usage_type": "call" }, { "api_...
43555214777
# -*- coding: utf-8 -*- """ Created on Wed Oct 27 15:43:40 2021 @author: Bing Computing multidimensional Gaussian integral with Gaussian-Hermite quadrature """ from scipy.special import roots_hermite import numpy as np from math import sqrt, pi import itertools class Quadrature(): def __init__(self): ...
binggu56/pyqed
pyqed/quadrature.py
quadrature.py
py
2,644
python
en
code
10
github-code
7
[ { "api_name": "math.sqrt", "line_number": 50, "usage_type": "call" }, { "api_name": "math.pi", "line_number": 50, "usage_type": "argument" }, { "api_name": "numpy.sum", "line_number": 52, "usage_type": "call" }, { "api_name": "scipy.special.roots_hermite", "li...
29922423901
import matplotlib.image as mpimg import numpy as np import cv2 import os #debug mode debug = False def calibrateCam(): #Get the images' name images = os.listdir("camera_cal/") objpoints = [] # original points imgpoints = [] # img points w = 9 # widht of chessboard corners h = 6 # height of...
jixiaojie/CarND-Advanced-Lane-Lines
functions.py
functions.py
py
6,982
python
en
code
0
github-code
7
[ { "api_name": "os.listdir", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 22, "usage_type": "attribute" }, { "api_name": "matplotlib.image.imread", ...
26441171220
"""initial migration Revision ID: f4cb1d642c93 Revises: c9b27415f8de Create Date: 2021-05-28 23:22:20.313121 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'f4cb1d642c93' down_revision = 'c9b27415f8de' branch_labels = None depends_on = None def upgrade(): ...
mahjabeen-a/CoviSafe
migrations/versions/f4cb1d642c93_initial_migration.py
f4cb1d642c93_initial_migration.py
py
800
python
en
code
1
github-code
7
[ { "api_name": "alembic.op.batch_alter_table", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "alembic.op.batch_alter_table", "line_number": 29, "usage_type": "call" }, { "api_name": "...
20120852067
import copy import gym import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch.optim import Adam from rltoolkit.models.utils import hard_target_update from rltoolkit.utils.scheduler import LinearDecayScheduler class QNet(nn.Module): def __init__(self, observation_space,...
jianzhnie/deep-rl-toolkit
examples/tutorials/Multi-Agent/idqn/agent.py
agent.py
py
3,777
python
en
code
14
github-code
7
[ { "api_name": "torch.nn.Module", "line_number": 14, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 14, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.nn", "lin...
72844091422
from __future__ import print_function import argparse import copy import logging import os import sys import time import stat import multiprocessing import numpy as np import torch import yaml from torch.utils.data import DataLoader from wenet.dataset.dataset import Dataset from wenet.utils.common import IGNORE_ID f...
Ascend/ModelZoo-PyTorch
ACL_PyTorch/built-in/audio/Wenet2_for_Pytorch/recognize_om.py
recognize_om.py
py
15,701
python
en
code
31
github-code
7
[ { "api_name": "sys.exit", "line_number": 27, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 33, "usage_type": "call" }, { "api_name": "ais_bench.infer.interface.InferSession", "line_number": 108, "usage_type": "call" }, { "api_name...
43037381707
from flask import Flask, render_template, flash, redirect, url_for, request import sqlite3 from os import listdir from os.path import isfile, join import random import datetime lastseen = datetime.datetime.now() kills = 0 app = Flask(__name__) conn = sqlite3.connect("cat.db") c = conn.cursor() c.execute("CREATE TA...
scaratozzolo/LastSeen
app/__init__.py
__init__.py
py
2,363
python
en
code
0
github-code
7
[ { "api_name": "datetime.datetime.now", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 8, "usage_type": "attribute" }, { "api_name": "flask.Flask", "line_number": 12, "usage_type": "call" }, { "api_name": "sqlite3.connec...
17288728663
import gi gi.require_version("Gtk", "3.0") from gi.repository import Gtk as gtk from gi.repository import GObject as gobject import os from subprocess import Popen, PIPE import fcntl wnd = gtk.Window() wnd.set_default_size(800, 600) wnd.connect("destroy", gtk.main_quit) textview = gtk.TextView() #textview.modify_font...
venomega/pydumps
gui/gtk/ex.py
ex.py
py
955
python
en
code
0
github-code
7
[ { "api_name": "gi.require_version", "line_number": 2, "usage_type": "call" }, { "api_name": "gi.repository.Gtk.Window", "line_number": 9, "usage_type": "call" }, { "api_name": "gi.repository.Gtk", "line_number": 9, "usage_type": "name" }, { "api_name": "gi.reposit...
29466434076
import json import falcon class ObjRequestClass: def on_get(self, req, resp): resp.status = falcon.HTTP_200 if 'name' in req.params and 'age' in req.params: output = { 'name': req.params['name'], 'age': req.params['age'], } else:...
JordanVScher/posa_api
posa_api/app3.py
app3.py
py
546
python
en
code
0
github-code
7
[ { "api_name": "falcon.HTTP_200", "line_number": 9, "usage_type": "attribute" }, { "api_name": "falcon.HTTP_404", "line_number": 17, "usage_type": "attribute" }, { "api_name": "json.dumps", "line_number": 22, "usage_type": "call" }, { "api_name": "falcon.API", ...
6617584839
#!/usr/bin/env python # -*- coding: utf-8 -*- try: from setuptools import setup except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup VERSION = '0.22-dev' if __name__ == '__main__': setup( name = 'django-tastypie-extendedmodelresource', ...
tryolabs/django-tastypie-extendedmodelresource
setup.py
setup.py
py
1,412
python
en
code
44
github-code
7
[ { "api_name": "ez_setup.use_setuptools", "line_number": 7, "usage_type": "call" }, { "api_name": "setuptools.setup", "line_number": 13, "usage_type": "call" } ]
30273232236
from typing import NamedTuple from src.lib.solution import SolutionABC class Move(NamedTuple): start: int end: int number: int class Solution(SolutionABC): def common_parse(self) -> (list[list[str]], list[Move]): stack, movements = self._data.split("\n\n") stacks: list[list[str]] = ...
raui100/AdventOfCode
2022/python/src/solutions/day_05.py
day_05.py
py
1,765
python
en
code
1
github-code
7
[ { "api_name": "typing.NamedTuple", "line_number": 6, "usage_type": "name" }, { "api_name": "src.lib.solution.SolutionABC", "line_number": 12, "usage_type": "name" } ]
5369317237
""" Violinplots =========== """ import numpy as np import seaborn as sns import matplotlib.pyplot as plt sns.set(style="ticks") rs = np.random.RandomState(0) n, p = 40, 8 d = rs.normal(0, 1, (n, p)) d += np.log(np.arange(1, p + 1)) * -5 + 10 f, ax = plt.subplots() sns.offset_spines() sns.violinplot(d) sns.despine(...
Prooffreader/Prooffreader_snippets
seaborn_examples/violinplots.py
violinplots.py
py
331
python
en
code
0
github-code
7
[ { "api_name": "seaborn.set", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.random.RandomState", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 12, "usage_type": "attribute" }, { "api_name": "numpy.log", ...
74943768222
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import cv2 import numpy as np import rospy from cv_bridge import CvBridge, CvBridgeError from sensor_msgs.msg import Image from detect_image import DetectIma...
jzhugithub/object_detection_icra_ros_py
src/object_detection_icra_ros_py_node.py
object_detection_icra_ros_py_node.py
py
4,330
python
en
code
0
github-code
7
[ { "api_name": "os.path.join", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path", "line_number": 26, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.array", "line_num...
42908097680
# pylint: disable=too-few-public-methods,missing-class-docstring """Models for bills application.""" from django.db import models from djmoney.models.fields import MoneyField from accounts.models import User class Participant(models.Model): """Model for event's participants.""" event = models.ForeignKey( ...
KozielPiotr/shared-bills
bills/models.py
models.py
py
2,447
python
en
code
0
github-code
7
[ { "api_name": "django.db.models.Model", "line_number": 10, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 10, "usage_type": "name" }, { "api_name": "django.db.models.ForeignKey", "line_number": 13, "usage_type": "call" }, { "api_name...
70412260704
# encoding=utf-8 # encoding=utf-8 import os from prettyprinter import pprint your_path=r'C:\Users\Administrator\Pictures' # 这里定义你要遍历的路径 def read_file(f_path): if os.path.isdir(f_path): #判断是否为文件夹 f_list = os.listdir(f_path) # 获得目录下所有文件 for file in f_list: read_file(f_path + '\\' + file...
codeccc/python-segments
file/file_iter.py
file_iter.py
py
534
python
en
code
0
github-code
7
[ { "api_name": "os.path.isdir", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 11, "usage_type": "call" }, { "api_name": "prettyprinter.pprint", "lin...
18915137636
import inspect import importlib import sys import os from collections import OrderedDict from sos.component import SoSComponent from sos.policies import import_policy from sos.report.plugins import Plugin from sos.utilities import bold, ImporterHelper from textwrap import fill try: TERMSIZE = min(os.get_terminal_...
sosreport/sos
sos/help/__init__.py
__init__.py
py
10,657
python
en
code
470
github-code
7
[ { "api_name": "os.get_terminal_size", "line_number": 14, "usage_type": "call" }, { "api_name": "sos.component.SoSComponent", "line_number": 19, "usage_type": "name" }, { "api_name": "sys.exit", "line_number": 61, "usage_type": "call" }, { "api_name": "sys.exit", ...
18747499523
# -*- coding: utf-8 -*- from scrapy.utils.response import open_in_browser from scrapy import Spider from scrapy.http import FormRequest, Request from quotes.items import ProjectItem import pymongo from quotes.helpers.auth import AuthEncrypt class QuotesSpider(Spider): name = 'quotes' start_urls = ('http://quo...
duanribeiro/serasa_exercise
quotes/spiders/quotes.py
quotes.py
py
2,182
python
en
code
0
github-code
7
[ { "api_name": "scrapy.Spider", "line_number": 10, "usage_type": "name" }, { "api_name": "pymongo.MongoClient", "line_number": 15, "usage_type": "call" }, { "api_name": "quotes.helpers.auth.AuthEncrypt", "line_number": 27, "usage_type": "call" }, { "api_name": "scr...
28222793187
""" leopard.core.repayment_plan ==================== 模块介绍 ----------------------- 本模块定义了 还款计划的生成方法 开发责任人 ----------------------- * mzj@abstack.com 评审责任人 ----------------------- 模块成员 ----------------------- """ import datetime import logging from decimal import Decimal from dateutil.relativedelta import relatived...
xxguo/leopard
leopard/core/repayment_plan.py
repayment_plan.py
py
4,392
python
en
code
0
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 32, "usage_type": "call" }, { "api_name": "dateutil.relativedelta.relativedelta", "line_number": 36, "usage_type": "call" }, { "api_name": "dateutil.relativedelta.relativedelta", "line_number": 40, "usage_type": "call" }...
6293714122
""" HFSS: spiral inductor --------------------- This example shows how you can use PyAEDT to create a spiral inductor, solve it, and plot results. """ ############################################################# # Perform required imports # ~~~~~~~~~~~~~~~~~~~~~~~~ # Perform required imports. import os import pyaedt...
ansys/pyaedt
examples/02-HFSS/HFSS_Spiral.py
HFSS_Spiral.py
py
6,518
python
en
code
158
github-code
7
[ { "api_name": "pyaedt.generate_unique_project_name", "line_number": 15, "usage_type": "call" }, { "api_name": "pyaedt.Hfss", "line_number": 31, "usage_type": "call" }, { "api_name": "pyaedt.constants", "line_number": 95, "usage_type": "attribute" }, { "api_name": ...
21437852011
from django.contrib import admin from checkout.models import Order, OrderLineItem class OrderLineItemAdminInline(admin.TabularInline): model = OrderLineItem readonly_fields = ("lineitem_total",) class OrderAdmin(admin.ModelAdmin): inlines = (OrderLineItemAdminInline,) readonly_fields = ( "...
Tmuat/handmade-by-ellie
checkout/admin.py
admin.py
py
1,232
python
en
code
0
github-code
7
[ { "api_name": "django.contrib.admin.TabularInline", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 6, "usage_type": "name" }, { "api_name": "checkout.models.OrderLineItem", "line_number": 7, "usage_type": "name" }, ...
14195277175
# from pudb import set_trace; set_trace() from typing import List from random import randrange, randint, choices from collections import Counter from bisect import bisect_right """ I spent way too long on this problem because I was misled by an expected output, and because I forgot to include the edges when working o...
FanchenBao/leetcode
2020_08_challenge/08_22_2020.py
08_22_2020.py
py
3,292
python
en
code
1
github-code
7
[ { "api_name": "typing.List", "line_number": 27, "usage_type": "name" }, { "api_name": "random.randrange", "line_number": 49, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 52, "usage_type": "call" }, { "api_name": "typing.List", "line_n...
72225458462
import re import pandas as pd import datetime as dt from dateutil.parser import parse from bs4 import BeautifulSoup import requests import variables as var def teams_from_title(title): """ Parses team names from preview page title Parameters: title (str): page title ...
DanVolodin/MatchPredictionNLP
data_scrapping.py
data_scrapping.py
py
14,039
python
en
code
1
github-code
7
[ { "api_name": "variables.week_days", "line_number": 29, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 45, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 47, "usage_type": "call" }, { "api_name": "re.compile", ...
71719488863
import torch import torch.nn as nn import torch.nn.functional as F from copy import deepcopy from dassl.data import DataManager from dassl.optim import build_optimizer, build_lr_scheduler from dassl.utils import count_num_param from dassl.engine import TRAINER_REGISTRY, TrainerX from dassl.metrics import co...
pukility/chs-Dassl.pytorch-master
dassl/engine/dg/copadg.py
copadg.py
py
9,557
python
en
code
0
github-code
7
[ { "api_name": "torch.nn.Module", "line_number": 18, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 18, "usage_type": "name" }, { "api_name": "torch.nn.ModuleList", "line_number": 21, "usage_type": "call" }, { "api_name": "torch.nn", "lin...