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
5406939429
""" Revision ID: 274c92aeae37 Revises: b13c53d0fe24 Create Date: 2020-09-09 11:18:14.077634 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = "274c92aeae37" down_revision = "b13c53d0fe24" branch_labels = None depends_on = None def upgrade(): # ### commands ...
shimaomao/fastapi-starter
migrations/versions/274c92aeae37_add_avatar_path.py
274c92aeae37_add_avatar_path.py
py
784
python
en
code
0
github-code
7
[ { "api_name": "alembic.op.add_column", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 21, "usage_type": "call" }, { "api_name": "sqlalchemy.String"...
27429452945
""" Local Volatility models """ import numpy as np from cores.MC import ArrayBT import matplotlib.pyplot as plt # I should have coded in C++, since python is too slow. Anyway, local vol tree is just a toy. # Mckean SDE and particle estimation are the most powerful tools in the LV model and SLV model. class LVBT(obje...
Peimou/OptionTools
LVtools.py
LVtools.py
py
5,588
python
en
code
4
github-code
7
[ { "api_name": "cores.MC.ArrayBT", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.zeros_like", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_nu...
35319892761
"""MDL Retriever""" from openicl import DatasetReader, PromptTemplate from openicl.icl_retriever.icl_topk_retriever import TopkRetriever from openicl.utils.calculate import entropy from openicl.utils.logging import get_logger from typing import List, Union, Optional, Tuple from transformers import AutoModelForCausalLM...
Shark-NLP/OpenICL
openicl/icl_retriever/icl_mdl_retriever.py
icl_mdl_retriever.py
py
7,594
python
en
code
460
github-code
7
[ { "api_name": "openicl.utils.logging.get_logger", "line_number": 14, "usage_type": "call" }, { "api_name": "openicl.icl_retriever.icl_topk_retriever.TopkRetriever", "line_number": 17, "usage_type": "name" }, { "api_name": "openicl.DatasetReader", "line_number": 44, "usage...
14832992699
import requests import zipfile import csv import boto3 from datetime import date, datetime from dataclasses import dataclass from io import BytesIO, TextIOWrapper from typing import Union, Tuple, List, Dict, Iterator CSV_ZIP_URL = "https://www.arcgis.com/sharing/rest/content/items/d73ed67e4cc84a84b818ea2c5caef696/data...
transitmatters/data-ingestion
ingestor/chalicelib/speed_restrictions.py
speed_restrictions.py
py
4,343
python
en
code
1
github-code
7
[ { "api_name": "typing.Tuple", "line_number": 12, "usage_type": "name" }, { "api_name": "datetime.date", "line_number": 12, "usage_type": "name" }, { "api_name": "datetime.date", "line_number": 18, "usage_type": "name" }, { "api_name": "datetime.date", "line_nu...
44926722184
import os,sys,hashlib,cx_Oracle from flask import * if sys.platform.startswith("darwin"): cx_Oracle.init_oracle_client(lib_dir=os.environ.get("HOME")+"/instantclient_19_3") elif sys.platform.startswith("win32"): cx_Oracle.init_oracle_client(lib_dir=r"C:\instantclient_21_3") def init_session(connection, reques...
MahdeeMushfiqueKamal/Combined-Engineering-Admission-System
Admin End/app_admin.py
app_admin.py
py
19,074
python
en
code
0
github-code
7
[ { "api_name": "sys.platform.startswith", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.platform", "line_number": 4, "usage_type": "attribute" }, { "api_name": "cx_Oracle.init_oracle_client", "line_number": 5, "usage_type": "call" }, { "api_name": "o...
14670500503
from pydantic import BaseModel from datetime import datetime class PostBase(BaseModel): title: str content: str class Post(PostBase): id: int created_at: datetime class Config: # даёт понимание pydantiку что можно типизировать данные (переводит обьект в словарь) orm_mode = True class P...
Aqua-Lively/little-app
app/schemas.py
schemas.py
py
430
python
ru
code
0
github-code
7
[ { "api_name": "pydantic.BaseModel", "line_number": 4, "usage_type": "name" }, { "api_name": "datetime.datetime", "line_number": 10, "usage_type": "name" } ]
547290489
import h5py import operator import numpy as np from larpixreco.types import Hit from larpixreco.RecoLogging import getLogger logger = getLogger(__name__) class HitParser(object): ''' A helper for parsing data files into `Hit` types ''' _col2name_map = { # col : name 0 : 'channelid', 1 : 'chipid...
larpix/larpix-reconstruction
larpixreco/HitParser.py
HitParser.py
py
3,723
python
en
code
0
github-code
7
[ { "api_name": "larpixreco.RecoLogging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "h5py.File", "line_number": 28, "usage_type": "call" }, { "api_name": "larpixreco.types.Hit", "line_number": 41, "usage_type": "call" }, { "api_name": "operat...
10072588406
from PIL import Image path_append = "../images/" images = ["NES-Mario-and-Luigi.png", "NES-Mario-Enemies-and-Bosses.png", "NES-Mario-World1-1.png"] color_dict = {} for image in images: image = path_append + image im = Image.open(image) for x in range(im.width): for y in range(im.height): ...
Joecool48/ece-385
final_project/scripts/color_counter.py
color_counter.py
py
403
python
en
code
0
github-code
7
[ { "api_name": "PIL.Image.open", "line_number": 10, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 10, "usage_type": "name" } ]
31245145467
#!/usr/bin/env python import asyncio from Urlspinging.filter_out404 import filter_all import time def read_list(file_name): urls = [] with open(file_name) as f: [urls.append(line) for line in f.readlines()] return urls def store_list(urls:list, file_name:str): with open(file_name, 'w') as...
latifah221b/orphan_detect
filtering_err_pages.py
filtering_err_pages.py
py
1,145
python
en
code
1
github-code
7
[ { "api_name": "time.time", "line_number": 18, "usage_type": "call" }, { "api_name": "Urlspinging.filter_out404.filter_all", "line_number": 20, "usage_type": "call" }, { "api_name": "time.time", "line_number": 23, "usage_type": "call" }, { "api_name": "asyncio.run"...
33067886685
import argparse import os import re import sys import textwrap import time from typing import Dict, Optional, List import paramiko FILE_ABS_PATH = os.path.dirname(__file__) ROOT_PATH = os.path.join(FILE_ABS_PATH, os.pardir) sys.path.append(ROOT_PATH) from myio.common_io import read_lines, read_json_obj, read_json5_o...
DBGroup-SUSTech/QEVIS
data_process/collect/collector.py
collector.py
py
9,194
python
en
code
4
github-code
7
[ { "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.join", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number"...
74209902302
#-*- coding:utf-8 -*- import warnings import logging from miasm.ir.ir import Lifter, AssignBlock from miasm.expression.expression import ExprOp, ExprAssign log = logging.getLogger("analysis") console_handler = logging.StreamHandler() console_handler.setFormatter(logging.Formatter("[%(levelname)-8s]: %(message)s")) ...
cea-sec/miasm
miasm/ir/analysis.py
analysis.py
py
3,689
python
en
code
3,204
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.StreamHandler", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.Formatter", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.WAR...
74254667744
# Key Competencies: # Samples - Ability to obtain a sample mean. Sampling is a process used in statistical analysis in which a predetermined number of observations are taken from a larger group. A sample is refers to a smaller, manageable version of a larger group. # Outliers - An understanding of an outlier, an o...
edreisMD/HackerHank
general_statistics.py
general_statistics.py
py
7,909
python
en
code
0
github-code
7
[ { "api_name": "math.comb", "line_number": 18, "usage_type": "call" }, { "api_name": "math.e", "line_number": 35, "usage_type": "attribute" }, { "api_name": "math.factorial", "line_number": 35, "usage_type": "call" }, { "api_name": "statistics.NormalDist", "lin...
24667915146
from itertools import chain, combinations_with_replacement import time def work_back(work, length): go_back = 1 # loop in reverse for idx in range( length, -1, -1 ): # check if at last char if work[idx] == chr(126): go_back = 1 work[idx] = chr(33) else: ...
Alfonso/Computer-Security
Assignment4/test.py
test.py
py
916
python
en
code
1
github-code
7
[ { "api_name": "itertools.chain.from_iterable", "line_number": 26, "usage_type": "call" }, { "api_name": "itertools.chain", "line_number": 26, "usage_type": "name" }, { "api_name": "itertools.combinations_with_replacement", "line_number": 26, "usage_type": "call" }, { ...
18267078919
from apps.finance.models import Persona from apps.inventory.models import Deposito, Item from django.db import models from django.utils.html import format_html class Finca(models.Model): descripcion = models.CharField( max_length=200, verbose_name="Descripción", unique=True ) dimension_ha = models...
toviaferna/turbo-potato
apps/farming/models.py
models.py
py
16,178
python
es
code
2
github-code
7
[ { "api_name": "django.db.models.Model", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 8, "usage_type": "call" }, { "api_name": "...
13525534333
#!/usr/bin/env python import os from setuptools import setup, find_packages PACKAGE_DIR = 'fcc_complaints' with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme: README = readme.read() # Allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), o...
gdoermann/fcc_complaints
setup.py
setup.py
py
1,481
python
en
code
0
github-code
7
[ { "api_name": "os.path.join", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 7, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": ...
21847630322
import hmac from json import JSONDecodeError from sys import hexversion from pyramid.view import view_config from ..utils import send, devsay import logging log = logging.getLogger(__name__) @view_config(route_name='api', renderer="json") def api(request): """Handle custom channel requests from the API.""" ...
FuelRats/JIRAAnnouncer
jiraannouncer/views/api.py
api.py
py
2,207
python
en
code
0
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "utils.devsay", "line_number": 22, "usage_type": "call" }, { "api_name": "hmac.new", "line_number": 28, "usage_type": "call" }, { "api_name": "sys.hexversion", "line_nu...
69976274142
#!/usr/bin/python import os import os.path import sys import json def maybe_update_to_2(part_info): if "version" not in part_info: part_info["version"] = 2 # Allow for multiple categories for parts such as PDBs that are also OSDs. if part_info["category"]: part_info["categories"] = [part_info["cat...
rcbuild-info/scrape
refactor_scripts/merge.py
merge.py
py
2,752
python
en
code
1
github-code
7
[ { "api_name": "os.path.islink", "line_number": 48, "usage_type": "call" }, { "api_name": "os.path", "line_number": 48, "usage_type": "attribute" }, { "api_name": "os.realpath", "line_number": 49, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_nu...
70132810142
import os from api import create_api_folder from env import create_env_file from packages import install_packages from config import create_config_folder from app import create_app def create_nodejs_api(project_name): try: new_directory = os.path.join(os.getcwd(), project_name) os.mkdir(new_director...
AtakanKanburoglu947/create_nodejs_api
init.py
init.py
py
737
python
en
code
0
github-code
7
[ { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 9, "usage_type": "call" }, { "api_name": "os.mkdir", "line_number": 10, ...
11645458364
import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable from torchvision import models from transformers import BertForSequenceClassification, GPT2Model import os import json import torch.utils.data as data from data import CaptionDataset class G_LSTM(nn.Module): """...
m-abbas-ansari/ASD-Classification
model.py
model.py
py
16,014
python
en
code
1
github-code
7
[ { "api_name": "torch.nn.Module", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 13, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_number": 22, "usage_type": "call" }, { "api_name": "torch.nn", "line_nu...
29567755618
from flask import flash, render_template,request,redirect, session,url_for from config import server from factoryDao import dao from models import Code, File, Post import os from validation.fileValidation import validation_file class ControllerPost: @server.loggin_required def create_post(self): post...
GuilhermeHenrique659/CodeBooks
controllers/postcontrollers.py
postcontrollers.py
py
2,570
python
en
code
1
github-code
7
[ { "api_name": "flask.request.form", "line_number": 13, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 13, "usage_type": "name" }, { "api_name": "flask.request.files.getlist", "line_number": 14, "usage_type": "call" }, { "api_name": "fla...
26275806243
# python main.py --ae onepix from silence_tensorflow import silence_tensorflow silence_tensorflow() import tensorflow as tf from tkinter import Y from modules.pre import * from modules.model import model from modules.attack import PixelAttacker from modules.plot import * from modules.Attention_layer import Attention_...
zncud/lab_poison
replica.py
replica.py
py
1,972
python
en
code
0
github-code
7
[ { "api_name": "silence_tensorflow.silence_tensorflow", "line_number": 3, "usage_type": "call" }, { "api_name": "modules.model.model", "line_number": 16, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 17, "usage_type": "call" }, { "...
32046200569
# coding:utf8 import base64 # 导入base64模块 import os def pictob64(path): # 将图片转换成base64格式 with open(path, 'rb') as pic: # 以 读字节的方式打开图片 b64 = base64.b64encode(pic.read()) # b64对图片字节进行加密, 返回加密后的字节值 # print(str(b64, 'utf8')) # 验证后发现没有str(b64, 'utf8')也行 # 其实不行,b64encode返回时字节值 b '***...
Gievance/PythonScripts
Pic22base64.py
Pic22base64.py
py
1,367
python
en
code
0
github-code
7
[ { "api_name": "base64.b64encode", "line_number": 9, "usage_type": "call" }, { "api_name": "base64.b64decode", "line_number": 23, "usage_type": "call" } ]
1691454935
from flask_restful import reqparse, Resource from sqlalchemy.sql.expression import update from models.user import Users from flask import abort, jsonify, make_response, request from api.v1.app import db from datetime import datetime from flask_restful_swagger import swagger from datetime import timezone from flask_jwt_...
Theemiss/Quick_Report
api/v1/views/user.py
user.py
py
13,267
python
en
code
3
github-code
7
[ { "api_name": "flask_restful.reqparse.RequestParser", "line_number": 17, "usage_type": "call" }, { "api_name": "flask_restful.reqparse", "line_number": 17, "usage_type": "name" }, { "api_name": "flask_restful.reqparse.RequestParser", "line_number": 35, "usage_type": "call...
4279114039
from typing import Any, Optional, Union from torch import Tensor from rllib.dataset.datatypes import Observation, Trajectory from rllib.model import AbstractModel from rllib.policy import AbstractPolicy from rllib.util.logger import Logger class AbstractMBAlgorithm(object): dynamical_model: AbstractModel rew...
SamueleMeta/optimal_is
rllib/algorithms/abstract_mb_algorithm.pyi
abstract_mb_algorithm.pyi
pyi
1,192
python
en
code
0
github-code
7
[ { "api_name": "rllib.model.AbstractModel", "line_number": 11, "usage_type": "name" }, { "api_name": "rllib.model.AbstractModel", "line_number": 12, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 13, "usage_type": "name" }, { "api_name": "r...
28679592792
from copy import deepcopy import torch import torch.nn as nn def build_model(args): model = _build_torchvision_model(args.model, pretrained=args.pretrained) classifier = nn.Linear(model.fc.in_features, args.num_classes) setattr(model, "fc", classifier) # replace with the target classifier ...
ytaek-oh/mlssl-simple
model.py
model.py
py
2,022
python
en
code
1
github-code
7
[ { "api_name": "torch.nn.Linear", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 9, "usage_type": "name" }, { "api_name": "torch.cuda.is_available", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.cuda", "line...
39180968123
#!/usr/bin/env python # coding: utf-8 # In[30]: import numpy as np import math import matplotlib.pyplot as plt # Large sample of $(x_1, x_2)$, derive average $a$ and $b$ from sample. These $a$ and $b$ will be used in $g(x)$ and $E_{out}$ # In[31]: x_1 = np.random.uniform(-1, 1, 10000) x_2 = np.random.uniform(-1...
nhsuh/bv-experiment
bv_experiment.py
bv_experiment.py
py
1,986
python
en
code
0
github-code
7
[ { "api_name": "numpy.random.uniform", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 17, "usage_type": "attribute" }, { "api_name": "numpy.random.uniform", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.ran...
70308197982
import json import matplotlib.pyplot as plt from datetime import datetime # Load and parse JSON data with explicit encoding specification with open('jira_data.json', 'r', encoding='utf-8') as json_file: data = json.load(json_file) # Initialize dictionaries to store status, assignee, and date information status_di...
ninethsense/jira
Issue-plot/issue-history-plot.py
issue-history-plot.py
py
2,569
python
en
code
0
github-code
7
[ { "api_name": "json.load", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 16, "usage_type": "name" }, { "api_name": "matplotlib.pypl...
247280024
import numpy as np from scipy import sparse def spectralband(A,zinit,zfin): degrees = sparse.csc_matrix.sum(A,0) degrees = np.asarray(degrees).reshape(-1) Ntot = len(degrees) cm = sum(degrees)/Ntot for z in np.linspace(zinit,zfin,1000): unique, counts = np.unique(degrees, return_counts=True) R1 = 0 S2 = 0...
tatsuro-kawamoto/modularity_eigenvalues
SpectralModularity.py
SpectralModularity.py
py
1,462
python
en
code
0
github-code
7
[ { "api_name": "scipy.sparse.csc_matrix.sum", "line_number": 6, "usage_type": "call" }, { "api_name": "scipy.sparse.csc_matrix", "line_number": 6, "usage_type": "attribute" }, { "api_name": "scipy.sparse", "line_number": 6, "usage_type": "name" }, { "api_name": "nu...
5074993484
from gamelogic.event_queue import EventQueue from gamelogic.clock import Clock import unittest import time import pygame class TestClock(unittest.TestCase): def setUp(self): pygame.init() self.clock = Clock() def test_wait_time(self): start = time.time() for i in range(65): ...
Hempppa/ot-harjoitustyo
src/tests/small_classes_test.py
small_classes_test.py
py
818
python
en
code
0
github-code
7
[ { "api_name": "unittest.TestCase", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pygame.init", "line_number": 9, "usage_type": "call" }, { "api_name": "gamelogic.clock.Clock", "line_number": 10, "usage_type": "call" }, { "api_name": "time.time", ...
70603034143
import os from typing import Tuple from PIL import Image , ImageDraw from pyvips import Image as VipsImage from chess import Board from importlib import resources class Chess_Image: """ Creates Single Image frames for rendering the GIFs as per requirements. Parameters ---------- colors : tupl...
tryingsomestuff/Minic
Tools/video/create_frame.py
create_frame.py
py
5,831
python
en
code
84
github-code
7
[ { "api_name": "importlib.resources.files", "line_number": 45, "usage_type": "call" }, { "api_name": "importlib.resources", "line_number": 45, "usage_type": "name" }, { "api_name": "os.listdir", "line_number": 57, "usage_type": "call" }, { "api_name": "os.path.join...
70438838943
from django.urls import path, include from .views import (## Nursery Views PlantCreateAPIView, PlantListAPIView, PlantRUDAPIView, ViewOrdersAPIView, ## User Views AllPlantsListAPIView, ...
Samjoel3101/PlantEcommerce
Django_React_Project/nursery/api/urls.py
urls.py
py
1,212
python
en
code
1
github-code
7
[ { "api_name": "django.urls.path", "line_number": 16, "usage_type": "call" }, { "api_name": "django.urls.include", "line_number": 16, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 17, "usage_type": "call" }, { "api_name": "views.PlantCrea...
41546863468
import requests import re import time ua = { 'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0' } si = input("输入开始页数:") si1 = int(si) su = input("输入结尾页数:") su1 = int(su) delayed = input("嫌慢可以调延时,最佳为1:") delayed1 = int(delayed) print("。。。。") while si1<su...
zhoubest6/Projects
爬图片/爬虫1.1.py
爬虫1.1.py
py
1,514
python
en
code
0
github-code
7
[ { "api_name": "requests.get", "line_number": 22, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 23, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 26, "usage_type": "call" }, { "api_name": "re.findall", "line_number": ...
10211785151
import pandas as pd import lxml.html import requests import io class TokyoOpenDataCatalogDownloader: def __init__(self, urls_csv_name: str, export_file_name: str): self.export_file_name = export_file_name self.download_targets = pd.read_csv(urls_csv_name).URL.tolist() self.download_target_u...
tori-takashi/tokyo_opendata_catalog_downloader
downloader.py
downloader.py
py
2,093
python
en
code
0
github-code
7
[ { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.concat", "line_number": 27, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 30, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line...
33832694039
import pyttsx3 as voz import speech_recognition as sr import subprocess as sub from datetime import datetime #configuracion de la voz del asistente voice=voz.init() voices=voice.getProperty('voices') voice.setProperty('voice',voices[0].id) voice.setProperty('rate',140) def say(text): voice.say(text)...
Jolitechrdcoder/proyectos
Xor.py
Xor.py
py
1,685
python
es
code
1
github-code
7
[ { "api_name": "pyttsx3.init", "line_number": 8, "usage_type": "call" }, { "api_name": "speech_recognition.Recognizer", "line_number": 18, "usage_type": "call" }, { "api_name": "speech_recognition.Microphone", "line_number": 20, "usage_type": "call" }, { "api_name"...
30474578738
import os import shutil from natsort import natsorted from reportlab.lib.pagesizes import A4, portrait from reportlab.pdfgen import canvas # 下载的文件夹 cartoon_path = './test/' # 生成的pdf cartoon_pdf = './cartoon.pdf' # 存储所有图像路径 all_img = [] # 修改文件夹的名字,以便排序 def renamePre(path): filename = os.listdir(path) for file...
2000PJL/EasyCartoon
main.py
main.py
py
1,675
python
en
code
null
github-code
7
[ { "api_name": "os.listdir", "line_number": 17, "usage_type": "call" }, { "api_name": "os.rename", "line_number": 22, "usage_type": "call" }, { "api_name": "shutil.rmtree", "line_number": 24, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 29...
41243114196
"""Builds Markov chains from Discord chat history and provides a bot command interface to display them.""" import ujson import os import random import re import string import discord from discord.ext import commands from itertools import product import markovify import datetime import traceback DEFAULT_N...
coizioc/math-bot-markov
markov.py
markov.py
py
20,083
python
en
code
1
github-code
7
[ { "api_name": "os.listdir", "line_number": 36, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 86, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 86, "usage_type": "attribute" }, { "api_name": "random.c...
42166660992
import pandas as pd from datetime import datetime, date import src.visualization.visualize as vz import src.auxiliary.auxiliary as aux import src.data.wrangling as w import src.data.database as db from flask import Flask, request import telebot import os from ratelimit import limits, sleep_and_retry API = os.getenv(...
rpacco/momentum_bot
main.py
main.py
py
5,455
python
en
code
0
github-code
7
[ { "api_name": "os.getenv", "line_number": 14, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 17, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 18, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 19, ...
13791239032
from anndata import AnnData from typing import Optional, Union import matplotlib.pyplot as plt import scanpy as sc import numpy as np def check_trajectory( adata: AnnData, library_id: str = None, use_label: str = "louvain", basis: str = "umap", pseudotime_key: str = "dpt_pseudotime", trajector...
BiomedicalMachineLearning/stLearn
stlearn/plotting/trajectory/check_trajectory.py
check_trajectory.py
py
2,005
python
en
code
125
github-code
7
[ { "api_name": "anndata.AnnData", "line_number": 9, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 20, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 39, "usage_type": "call" }, { "api_name": "matplotlib.pypl...
72233944224
import json from channels.generic.websocket import AsyncWebsocketConsumer #from asgiref.sync import await_to_sync from chat.services import chat_save_message class ChatConsumer(AsyncWebsocketConsumer): """ handshake websocket front end """ room_name = None room_group_name = None async def connect(s...
codingelle/django-whatsapp-web-clone
chat/consumers.py
consumers.py
py
2,355
python
en
code
123
github-code
7
[ { "api_name": "channels.generic.websocket.AsyncWebsocketConsumer", "line_number": 8, "usage_type": "name" }, { "api_name": "json.loads", "line_number": 37, "usage_type": "call" }, { "api_name": "chat.services.chat_save_message", "line_number": 54, "usage_type": "call" }...
20040821938
import requests import traceback from googleapiclient.discovery import build from robos.pln.pipeline import Pipeline from robos import robo_state from util.gerencia_arquivo import GerenciaArquivo as ga from wand.image import Image from wand.display import display from wand.color import Color from wand.font import Fon...
Volpe6/RoboCriadorVideoComBlender
src/robos/robo_imagem.py
robo_imagem.py
py
3,265
python
pt
code
1
github-code
7
[ { "api_name": "robos.pln.pipeline.Pipeline", "line_number": 17, "usage_type": "call" }, { "api_name": "dotenv.load_dotenv", "line_number": 19, "usage_type": "call" }, { "api_name": "googleapiclient.discovery.build", "line_number": 21, "usage_type": "call" }, { "ap...
70996761503
import copy import sys import os from gym_pybullet_drones.envs.BaseAviary import DroneModel, Physics from gym_pybullet_drones.envs.CtrlAviary import CtrlAviary from gym_pybullet_drones.envs.VisionAviary import VisionAviary from gym_pybullet_drones.control.DSLPIDControl import DSLPIDControl from gym_pybullet_drones.con...
Data-Science-in-Mechanical-Engineering/ET-distributed-UAV-path-planner
CPSTestbed/Projects/EventTriggeredDMPCStateSpace/dmpc_statespace_simulation.py
dmpc_statespace_simulation.py
py
15,421
python
en
code
2
github-code
7
[ { "api_name": "copy.deepcopy", "line_number": 49, "usage_type": "call" }, { "api_name": "CPSTestbed.useful_scripts.cuboid.Cuboid", "line_number": 52, "usage_type": "call" }, { "api_name": "CPSTestbed.useful_scripts.cuboid", "line_number": 52, "usage_type": "name" }, {...
14664466888
# wsse/server/default/store.py # coding=utf-8 # pywsse # Authors: Rushy Panchal, Naphat Sanguansin, Adam Libresco, Jérémie Lumbroso # Date: August 30th, 2016 # Description: Store implementation for default server. import sqlite3 import contextlib import datetime from ... import settings, utc class SQLit...
bmorck/TigerTravel
wsse/server/default/store.py
store.py
py
3,363
python
en
code
2
github-code
7
[ { "api_name": "sqlite3.connect", "line_number": 35, "usage_type": "call" }, { "api_name": "contextlib.contextmanager", "line_number": 47, "usage_type": "attribute" }, { "api_name": "datetime.datetime.utcnow", "line_number": 87, "usage_type": "call" }, { "api_name"...
5589463998
# Decoding # pip install opencv-python import cv2 # Open the desired image (can also be a jpg) img = cv2.imread("img/qr_App.png") # Instantiate a new detector object detector = cv2.QRCodeDetector() # Decode the image data = detector.detectAndDecode(img) # Show the results print("Output from QRCode:") print(data...
DebajyotiTalukder2001/My-Repo
CodeSpeedy/CodeSpeedy/QRCode/QRCode/qr_out.py
qr_out.py
py
326
python
en
code
1
github-code
7
[ { "api_name": "cv2.imread", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.QRCodeDetector", "line_number": 12, "usage_type": "call" } ]
1588368815
import torch import torchvision from torch.utils.data import DataLoader from torch import nn from alive_progress import alive_bar train_data = torchvision.datasets.EMNIST( root='dataset', split='digits', train=True, transform=torchvision.transforms.ToTensor(), download=True ) test_data = torchvisi...
chris901003/DeepLearning
pytorch_classification/Others/EMNIST_Digit.py
EMNIST_Digit.py
py
2,406
python
en
code
7
github-code
7
[ { "api_name": "torchvision.datasets.EMNIST", "line_number": 7, "usage_type": "call" }, { "api_name": "torchvision.datasets", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torchvision.transforms.ToTensor", "line_number": 11, "usage_type": "call" }, { ...
9624733151
import logging from .i3d import I3D from .config import get_config def get_symbol(name, modality = 'rgb', drop_out = 0.5, print_net=False, arch_estimator = None, arch_d = None, **kwargs): if name.upper() == "I3D": net = I3D(modality = modality, dropout_prob = drop_out, arch_estimator = arch_estimator, ar...
facebookresearch/dmc-net
code/dmcnet_I3D/network/symbol_builder.py
symbol_builder.py
py
654
python
en
code
45
github-code
7
[ { "api_name": "i3d.I3D", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.error", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.debug", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.debug", "line_number":...
22789848693
from django.conf import global_settings from django.urls import reverse_lazy from environs import Env from sale_ads.paths import LOCALE_DIR, STATIC_DIR, TEMPLATE_DIR _env = Env() _env.read_env() # Main HOME_URL = reverse_lazy("ads_list") # Application definition INSTALLED_APPS = [ "modeltranslation", "d...
mikhkhann/sale-ads
src/sale_ads/conf/settings/base.py
base.py
py
4,573
python
en
code
0
github-code
7
[ { "api_name": "environs.Env", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.reverse_lazy", "line_number": 13, "usage_type": "call" }, { "api_name": "django.conf.global_settings.AUTHENTICATION_BACKENDS", "line_number": 80, "usage_type": "attribute" ...
72870050462
import sys from argparse import ArgumentParser import torch import tqdm import torch.nn.functional as F from sklearn.metrics import accuracy_score from torch import nn from torch.optim import Adam, SGD import numpy as np from dataset.dataloader_classifier import Dataset from dataset.config import Config from models.tr...
Ascend/ModelZoo-PyTorch
PyTorch/dev/cv/image_classification/mBART_ID1550_for_PyTorch/classify_intent.py
classify_intent.py
py
6,863
python
en
code
31
github-code
7
[ { "api_name": "os.getenv", "line_number": 17, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.npu.current_device", "line_number": 19, "usage_type": "call" }, { "api_name": "torch.npu", "line_nu...
73461592543
from django.urls import path, include from django.contrib import admin from . import views app_name = 'dashboard' urlpatterns = [ path('', views.dashboard, name="dashboard"), path('dashboard/', views.dashboard, name="dashboard"), path('produit/', views.produit, name="produit"), path('client/<str:pk...
mkjunior/hc-cmd-client
dashboard/urls.py
urls.py
py
571
python
en
code
0
github-code
7
[ { "api_name": "django.urls.path", "line_number": 10, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 11, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 12, "usage_type": "call" }, { "api_name": "django.urls.path",...
32075537561
import requests import sys import logging import math from .base import ControllerBase from ..status import ExitStatus class CubeController(ControllerBase): def __init__(self, username, password): self.username = username self.password = password self.info_web = None self.app_token = None # functio...
highvolt-dev/tmo-monitor
tmo_monitor/gateway/arcadyan.py
arcadyan.py
py
2,693
python
en
code
85
github-code
7
[ { "api_name": "base.ControllerBase", "line_number": 8, "usage_type": "name" }, { "api_name": "requests.post", "line_number": 17, "usage_type": "call" }, { "api_name": "logging.critical", "line_number": 19, "usage_type": "call" }, { "api_name": "sys.exit", "lin...
25100553167
from flask import Flask, request, render_template #import os, sys from konlpy.tag import Okt app = Flask(__name__) @app.route('/', methods=['GET', 'POST']) def index(): if request.method == 'POST': # 웹 폼에서 POST 요청을 처리하는 부분 user_input = request.form['user_input'] # 모델 수행 부분 => 함수로 ...
Songhee120/cj-aihackathon-binkani
web/app.py
app.py
py
649
python
en
code
0
github-code
7
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 9, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 9, "usage_type": "name" }, { "api_name": "flask.request.form",...
15180946888
import os import re from collections import defaultdict from .transliteration import Transliteration from .transliteration.colour import copy_colour, minimize_colour class Entry: def __init__(self, idx, trad, simp, pinyin, defs): self.idx = idx self.trad = trad self.simp = simp sel...
julienbaley/zhtools
lib/zhtools/cedict.py
cedict.py
py
1,980
python
en
code
0
github-code
7
[ { "api_name": "transliteration.Transliteration", "line_number": 17, "usage_type": "call" }, { "api_name": "transliteration.colour.minimize_colour", "line_number": 19, "usage_type": "call" }, { "api_name": "transliteration.colour.copy_colour", "line_number": 19, "usage_typ...
33240084434
#!/usr/bin/env python # -*- coding: utf-8 -*- import csv import matplotlib.pyplot as plt import numpy as np mk = ['o', 'x', '+', '*', 's', 'd', 'o', '^', '<', '>', 'h', 'p', 'x'] cl = ['tab:blue', 'tab:brown', 'tab:orange', 'tab:pink', 'tab:green', 'tab:cyan', 'tab:red'] ftSize = 13 cnt = 0 cntCkt = 0 tr = [] basel...
SJTU-ECTL/VECBEE
SASIMI-VECBEE/script/motivation.py
motivation.py
py
5,751
python
en
code
7
github-code
7
[ { "api_name": "matplotlib.pyplot.rcParams", "line_number": 18, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 18, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 32, "usage_type": "call" }, { "api_name...
44616957923
from flask import Flask, request import json from .db_access import find_embeddings from .t_SNE import fit_tsne app = Flask(__name__) @app.route("/api", methods = ['POST', 'GET']) def hello_world(): data = find_embeddings() tsne = fit_tsne(data) print(tsne[0:5]) response = { "message": "Hell...
GradientFlow-ai/fast-api-ocean
api/index.py
index.py
py
467
python
en
code
0
github-code
7
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "db_access.find_embeddings", "line_number": 11, "usage_type": "call" }, { "api_name": "t_SNE.fit_tsne", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.request.met...
12173626412
# 아이디어 : 1. 나이트의 8방향 정의 # 2. 방문 여부를 위한 graph 0으로 초기화 # 알고리즘 : bfs # 자료구조 : queue(deque) # 시작지점 - (x, y), 도착지점 - (p, q) from collections import deque import sys input = sys.stdin.readline # bfs 함수 정의 def bfs(x, y): # 시작노드 및 큐 정의 queue = deque() queue.append((x, y, 0)) graph[...
GinToFim/coding-test
백준/Silver/7562. 나이트의 이동/나이트의 이동.py
나이트의 이동.py
py
1,365
python
ko
code
0
github-code
7
[ { "api_name": "sys.stdin", "line_number": 10, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 15, "usage_type": "call" } ]
9075045007
import enum import copy import claripy from claripy.operations import infix, prefix class BASIC_OP_TYPE(enum.Enum): MEM = 0, REG = 1, CONST = 2, TEMP = 3, _g_type_dict = { 'mem': BASIC_OP_TYPE.MEM, 'reg': BASIC_OP_TYPE.REG, 'BVV': BASIC_OP_TYPE.CONST, 'tmp': BASIC_OP_TYPE.TEMP } de...
sem2vec/sem2vec-SE
src/formula.py
formula.py
py
6,410
python
en
code
12
github-code
7
[ { "api_name": "enum.Enum", "line_number": 7, "usage_type": "attribute" }, { "api_name": "copy.deepcopy", "line_number": 52, "usage_type": "call" }, { "api_name": "claripy.operations.infix", "line_number": 70, "usage_type": "name" }, { "api_name": "claripy.operatio...
28067262709
import os import shutil from datetime import datetime def clear_screen(): os.system("cls" if os.name == "nt" else "clear") def format_file_size(size): if size < 1024: return f"{size} bytes" elif size < 1024 * 1024: return f"{size / 1024:.1f} KB" else: return f"{size / (1024 * 1...
navjack/chatGPT-generated-python-CMDline
command.py
command.py
py
2,069
python
en
code
0
github-code
7
[ { "api_name": "os.system", "line_number": 6, "usage_type": "call" }, { "api_name": "os.name", "line_number": 6, "usage_type": "attribute" }, { "api_name": "datetime.datetime.fromtimestamp", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.datetim...
7623491362
from __future__ import absolute_import from __future__ import unicode_literals import json import jwt import datetime import requests import time import urllib3 import re __all__ = [ "ERROR", "Warning", "InterfaceERROR", "DatabaseERROR", "InternalERROR", "OperationalERROR", "ProgrammingERR...
uptycslabs/urestapi
urestapi/uptycs_rest_api.py
uptycs_rest_api.py
py
10,841
python
en
code
0
github-code
7
[ { "api_name": "urllib3.disable_warnings", "line_number": 84, "usage_type": "call" }, { "api_name": "urllib3.exceptions", "line_number": 84, "usage_type": "attribute" }, { "api_name": "datetime.datetime.utcnow", "line_number": 102, "usage_type": "call" }, { "api_na...
72850584862
import json import logging from collections import defaultdict from mmcv.utils import get_logger def get_root_logger(log_file=None, log_level=logging.INFO): """Get root logger. Args: log_file (str, optional): File path of log. Defaults to None. log_level (int, optional): The level of logger....
Ascend/ModelZoo-PyTorch
PyTorch/built-in/cv/classification/Resnet50_Cifar_for_PyTorch/mmcls/utils/logger.py
logger.py
py
1,684
python
en
code
31
github-code
7
[ { "api_name": "logging.INFO", "line_number": 8, "usage_type": "attribute" }, { "api_name": "mmcv.utils.get_logger", "line_number": 19, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 46, "usage_type": "call" }, { "api_name": "collections.default...
37604200405
"""Tests for bocs.""" from vizier._src.algorithms.designers import harmonica from vizier._src.algorithms.testing import test_runners from vizier._src.benchmarks.experimenters import combo_experimenter from absl.testing import absltest class HarmonicaTest(absltest.TestCase): def test_make_suggestions(self): ex...
apollo65524532/CFU-Playground
third_party/python/vizier/vizier/_src/algorithms/designers/harmonica_test.py
harmonica_test.py
py
807
python
en
code
0
github-code
7
[ { "api_name": "absl.testing.absltest.TestCase", "line_number": 9, "usage_type": "attribute" }, { "api_name": "absl.testing.absltest", "line_number": 9, "usage_type": "name" }, { "api_name": "vizier._src.benchmarks.experimenters.combo_experimenter.IsingExperimenter", "line_num...
20386304014
# -*- coding: utf-8 -*- import urllib import urllib2 import re import sys import json class ObjectConstructor(object): def __init__(self, index, queryword): with open('./info/' + str(index) + '.txt', 'r') as f: self.data = json.load(f) self.key_words = list(queryword) def get_...
lanqing30/TinySearchEngine
Main/object_constructor.py
object_constructor.py
py
988
python
en
code
0
github-code
7
[ { "api_name": "json.load", "line_number": 12, "usage_type": "call" } ]
20835141370
from flask import Flask, render_template, request import numpy as np import pandas as pd from sklearn.preprocessing import StandardScaler from src.pipeline.predict_pipeline import CustomData, PredictPipeline import warnings warnings.filterwarnings('ignore') application = Flask(__name__) app = application # @app.ro...
chaitanya-24/Heart-Failure-Prediction
app.py
app.py
py
1,824
python
en
code
0
github-code
7
[ { "api_name": "warnings.filterwarnings", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 21, "usage_type": "attribute" }, { "api_name": "flask.re...
14199707605
# from pudb import set_trace; set_trace() from typing import List class Solution: def nextGreaterElements(self, nums: List[int]) -> List[int]: """LeetCode 503 The same stack solution as in the easier version of this problem. The only trick is that we need to run the same algorithm twice t...
FanchenBao/leetcode
LeetCode_503.py
LeetCode_503.py
py
1,201
python
en
code
1
github-code
7
[ { "api_name": "typing.List", "line_number": 6, "usage_type": "name" } ]
9365086131
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from pyquery import PyQuery def get_exchange_rate(): html = PyQuery('https://rate.bot.com.tw/xrt?Lang=zh-TW') currency_names = html('div.hidden-phone').text().split() bid_filter = 'td.rate-content-cash[data-table="本行現金買入"]' offer_filer = 'td.rate-content-...
RayShinLee/Line-Bot-currency-crawler
scraper.py
scraper.py
py
910
python
en
code
0
github-code
7
[ { "api_name": "pyquery.PyQuery", "line_number": 7, "usage_type": "call" } ]
5202171254
import argparse import os import parser from functools import partial import dataset import evaluate import longrange import lovely_tensors as lt import matplotlib.pyplot as plt import numpy as np import torch import util import wandb from tqdm import tqdm from tqdm.auto import tqdm lt.monkey_patch() def train_tr...
akarshkumar0101/transformer-memory
skip/train.py
train.py
py
13,020
python
en
code
1
github-code
7
[ { "api_name": "lovely_tensors.monkey_patch", "line_number": 19, "usage_type": "call" }, { "api_name": "torch.optim.Adam", "line_number": 25, "usage_type": "call" }, { "api_name": "torch.optim", "line_number": 25, "usage_type": "attribute" }, { "api_name": "dataset...
38130439875
import matplotlib.pyplot as plt from datetime import datetime, timedelta import numpy as np from datetime import datetime, timedelta from matplotlib.dates import date2num from floodsystem.analysis import polyfit def plot_water_levels(station, dates, levels): """ Function that plots a graph of the water level ...
ashJA65/FloodWarning
floodsystem/plot.py
plot.py
py
1,715
python
en
code
0
github-code
7
[ { "api_name": "matplotlib.pyplot.plot", "line_number": 19, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 19, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.axhline", "line_number": 26, "usage_type": "call" }, { "api_name": "ma...
70803677022
import json, os from myVars import myCurrentMat class materialsFile: """ More abstract object for the current materials file. Methods: get(): Gets and interprets the materials file. Returns a list of material() objects. getraw(): Gets and de-serializes the object, but that's it. List is in this ...
it-fm/3DPy
Capstone/myFileFxs/myFile.py
myFile.py
py
3,998
python
en
code
0
github-code
7
[ { "api_name": "os.path.exists", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 30, "usage_type": "call" }, { "api_name": "json.JSONDecodeError", "lin...
11627943775
from uuid import UUID from sqlalchemy.ext.asyncio import AsyncSession from fastapi import APIRouter, Depends from fastapi_pagination import Page from db.database import get_db from api.employee import services from api.employee.schemas import ( Employee as SchemaEmloyee, PostEmployee as SchemaPostEmployee, ...
IMaG1337/inventory_managment
app/api/employee/views.py
views.py
py
1,864
python
en
code
0
github-code
7
[ { "api_name": "fastapi.APIRouter", "line_number": 17, "usage_type": "call" }, { "api_name": "sqlalchemy.ext.asyncio.AsyncSession", "line_number": 24, "usage_type": "name" }, { "api_name": "fastapi.Depends", "line_number": 24, "usage_type": "call" }, { "api_name": ...
28360233447
"""Core game engine logic.""" import ctypes import enum import logging import operator import textwrap import importlib.resources from typing import Iterator from typing import Literal from typing import MutableMapping from typing import Optional from typing import Tuple from typing import Union from PIL import Image, ...
ouroborean/A-A
src/animearena/engine.py
engine.py
py
20,870
python
en
code
0
github-code
7
[ { "api_name": "importlib.resources.resources.path", "line_number": 25, "usage_type": "call" }, { "api_name": "importlib.resources.resources", "line_number": 25, "usage_type": "attribute" }, { "api_name": "importlib.resources", "line_number": 25, "usage_type": "name" }, ...
24312087328
import pygtk pygtk.require('2.0') import gtk from matplotlib.figure import Figure from matplotlib.backends.backend_gtk import FigureCanvasGTK as FigureCanvas from seatree.modules.hc.manipulate_hc import ManipulateXYData class XYDialog: def __init__(self, title, parent, filename, tmpn, type): # create matplotlib ...
thwbecker/seatree
python/seatree/modules/hc/xyDialog.py
xyDialog.py
py
2,352
python
en
code
11
github-code
7
[ { "api_name": "pygtk.require", "line_number": 2, "usage_type": "call" }, { "api_name": "matplotlib.figure.Figure", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.backends.backend_gtk.FigureCanvasGTK", "line_number": 14, "usage_type": "call" }, { ...
1061438113
from decimal import Decimal import unittest import datetime import rdflib # needed for eval(repr(...)) below from rdflib.term import Literal, URIRef, _XSD_DOUBLE, bind, _XSD_BOOLEAN from rdflib.namespace import XSD class TestLiteral(unittest.TestCase): def setUp(self): pass def test_repr_apostrophe...
kaocher82/rdflib
test/test_literal.py
test_literal.py
py
9,191
python
en
code
null
github-code
7
[ { "api_name": "unittest.TestCase", "line_number": 10, "usage_type": "attribute" }, { "api_name": "rdflib.Literal", "line_number": 15, "usage_type": "call" }, { "api_name": "rdflib.Literal", "line_number": 20, "usage_type": "call" }, { "api_name": "rdflib.Graph", ...
3556106510
#!/usr/bin/env python # -*- coding:utf-8 -*- import configparser import os import sys base_path = os.getcwd() sys.path.append(base_path) class ReadIni(): # def __init__(self, file_name=None, node=None): # if file_name == None: # file_name = base_path + '/config/LocalElement.ini' # if...
Hasi-liu/SeleniumPythonTest
Util/read_ini.py
read_ini.py
py
982
python
en
code
0
github-code
7
[ { "api_name": "os.getcwd", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.path.append", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "configparser.ConfigParser", ...
3887643631
import os from django import forms from django.forms import ModelForm from django.core.exceptions import ValidationError from django.contrib.auth.models import User from django.contrib.auth.forms import UserCreationForm from django.template.defaultfilters import filesizeformat from magic import Magic from .models impor...
SasView/sasmodel-marketplace
marketplace/forms.py
forms.py
py
5,292
python
en
code
1
github-code
7
[ { "api_name": "django.forms.FileField", "line_number": 15, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 15, "usage_type": "name" }, { "api_name": "os.path.splitext", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path", ...
24982279398
# python3 """ File name: finding_exit_from_maze.py Author: Sayuri Monarrez Yesaki Date created: 04/06/2022 Date last modified: 04/06/2022 Python version: 3.9 A maze is a rectangular grid of cells with walls between some of adjacent cells. You would like to check whether there is a path from a given cell to a given exi...
SayuriMY/Coursera-AlgorithmsOnGraphs
Reachability/finding_exit_from_maze.py
finding_exit_from_maze.py
py
3,902
python
en
code
0
github-code
7
[ { "api_name": "typing.List", "line_number": 33, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 56, "usage_type": "name" }, { "api_name": "sys.stdin.read", "line_number": 103, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number"...
30287607536
# -*- coding: utf-8 -*- # pylint: disable=arguments-differ, abstract-method from __future__ import absolute_import import logging import torch LOGGER = logging.getLogger(__name__) class CrossEntropyLabelSmooth(torch.nn.Module): def __init__(self, num_classes, epsilon, reduction='avg'): super(CrossEntro...
wbaek/torchskeleton
skeleton/nn/modules/loss.py
loss.py
py
993
python
en
code
26
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 12, "usage_type": "attribute" }, { "api_name": "torch.nn.LogSoftmax", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.nn", "li...
2052918458
from rest_framework import serializers from .models import (Ecole, Classe, Eleve, Questionnaire, Commentaire) # Ecole class EcoleSerializer(serializers.ModelSerializer): class Meta: model = Ecole fields = ( 'id', 'enseignant', 'titre', 'latitude', ...
gnopor/SchoolConsultation
backend/schoolResearch/serialisers.py
serialisers.py
py
1,953
python
fr
code
0
github-code
7
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 7, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 7, "usage_type": "name" }, { "api_name": "models.Ecole", "line_number": 9, "usage_type": "name" }, { ...
32951600622
import datetime import pytest from pydeequ.analyzers import Mean from sqlmodel import Session from thoth import repository, service_layer from thoth.anomaly import AnomalyScoring, Score from thoth.anomaly.models import SimpleModelFactory from thoth.anomaly.optimization import AnomalyOptimization, MetricOptimization f...
rafaelleinio/thoth
tests/integration/thoth/test_service_layer.py
test_service_layer.py
py
6,832
python
en
code
15
github-code
7
[ { "api_name": "pytest.raises", "line_number": 18, "usage_type": "call" }, { "api_name": "thoth.service_layer._build_repo", "line_number": 19, "usage_type": "call" }, { "api_name": "thoth.service_layer", "line_number": 19, "usage_type": "name" }, { "api_name": "tho...
34029491748
import numpy as np import torch.nn as nn import torch from transformers import DistilBertTokenizerFast, DistilBertModel from torch.utils.data import Dataset, DataLoader class BertForRegression(nn.Module): def __init__(self): super().__init__() self.bert = DistilBertModel.from_pretrained('distilbe...
kenkangg/nlp-yelp-reviews
src/modeling/bert.py
bert.py
py
1,683
python
en
code
0
github-code
7
[ { "api_name": "torch.nn.Module", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 9, "usage_type": "name" }, { "api_name": "transformers.DistilBertModel.from_pretrained", "line_number": 12, "usage_type": "call" }, { "api_name...
28609120168
# -*- coding: utf-8 -*- import scrapy class FinancespiderSpider(scrapy.Spider): name = 'financespider' allowed_domains = ['www.yellowpages.com.au'] start_urls = ['https://www.yellowpages.com.au/search/listings?clue=financial+planners&locationClue=&lat=&lon='] def parse(self, response): items ...
iamrizwan007/WebScrapingProjects
Financial1/Financial1/spiders/financespider.py
financespider.py
py
1,342
python
en
code
0
github-code
7
[ { "api_name": "scrapy.Spider", "line_number": 5, "usage_type": "attribute" } ]
31056495765
""" 2. Написать программу сложения и умножения двух шестнадцатеричных чисел. При этом каждое число представляется как массив, элементы которого — цифры числа. Например, пользователь ввёл A2 и C4F. Нужно сохранить их как [‘A’, ‘2’] и [‘C’, ‘4’, ‘F’] соответственно. Сумма чисел из примера: [‘C’, ‘F’, ‘1’], произведение -...
egreenius/ai.algorithms_python
lesson_5/les_5_hw_2.py
les_5_hw_2.py
py
4,414
python
ru
code
0
github-code
7
[ { "api_name": "collections.deque", "line_number": 16, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 17, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 26, "usage_type": "call" }, { "api_name": "collections.deq...
70728477024
import setuptools def get_content(*filename): """ Gets the content of a file and returns it as a string Args: filename(str): Name of file to pull content from Returns: str: Content from file """ content = "" for file in filename: with open(file, "r") as full_description:...
Descent098/pyerewolf
setup.py
setup.py
py
1,131
python
en
code
0
github-code
7
[ { "api_name": "setuptools.setup", "line_number": 16, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 29, "usage_type": "call" } ]
69958111265
""" Game controller input for Kivy. Open game controllers as they become available, expose with full SDL2 API. """ # Kivy must open so we can find the symbols, # or kivyjoy must explicitly link with the same # kivyjoy2 shared library as kivy. import kivy.app from kivy.event import EventDispatcher from kivy.propertie...
dholth/kivyjoy
kivyjoy/controller.py
controller.py
py
2,247
python
en
code
0
github-code
7
[ { "api_name": "kivyjoy.JoyDeviceEvent", "line_number": 21, "usage_type": "attribute" }, { "api_name": "kivyjoy.JoyAxisEvent", "line_number": 22, "usage_type": "attribute" }, { "api_name": "kivyjoy.JoyHatEvent", "line_number": 23, "usage_type": "attribute" }, { "ap...
27416403757
#!/usr/local/bin/python # # Lane change simulation import os from PIL import Image import matplotlib as mpl mpl.use('tkagg') import matplotlib.animation as animation import matplotlib.pyplot as plt import time import pdb from pdb import set_trace as st from car import Car import numpy as np from numpy import cos, sin,...
abadithela/layered_testing
sim.py
sim.py
py
3,893
python
en
code
0
github-code
7
[ { "api_name": "matplotlib.use", "line_number": 8, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 21, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 21, "usage_type": "name" }, { "api_name": "car.state", "line_number":...
9676009836
# -*- coding: UTF-8 -*- from __future__ import unicode_literals, print_function, division from datetime import datetime from pprint import pprint import common RETRIEVE_COLUMNS = { 0: ('date', lambda v: datetime.strptime(v, '%Y%m%d').date()), 1: ('name', lambda v: v), 2: ('key', lambda v: v), 3: ('modu...
dawncold/mw-utils
process_export.py
process_export.py
py
1,672
python
en
code
0
github-code
7
[ { "api_name": "datetime.datetime.strptime", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 8, "usage_type": "name" }, { "api_name": "common.get_filename", "line_number": 48, "usage_type": "call" }, { "api_name": "common...
26721520328
import inspect import io from typing import ( TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Optional, Sequence, Type, TypeVar, Union, ) import click import cloup if TYPE_CHECKING: # pragma: no cover import click.shell_completion from cloup.constraints import ...
alexreg/typer-cloup
typer_cloup/models.py
models.py
py
18,471
python
en
code
null
github-code
7
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 20, "usage_type": "name" }, { "api_name": "typing.Type", "line_number": 30, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 30, "usage_type": "name" }, { "api_name": "cloup.Context", "line...
2280505817
# Assignment 12 Analysis -- Emily ''' -pull out spike and y-layers in image -(spike) look at distributions of synapse density in the spike across x,y,z -make old plots prettier/writeup this weekend -(spike) in old hist graphs, make bin size a function of sample size -extract image(s) in dataset of y-layers -talk...
akaseahawk/ArtOfDataScience2016
code/assignment12_emily.py
assignment12_emily.py
py
3,046
python
en
code
1
github-code
7
[ { "api_name": "numpy.set_printoptions", "line_number": 20, "usage_type": "call" }, { "api_name": "urllib2.urlopen", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.genfromtxt", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.where",...
70646222943
from BulletHero import BulletForHero import pygame if __name__ == '__main__': pygame.init() window = pygame.display.set_mode([512, 768]) clock = pygame.time.Clock() # 初始化弹夹 bullets = BulletForHero(window) while True: # 清空屏幕 window.fill((0, 0, 0)) # 子弹坐标 bu...
liucz25/pygame-flywar
BulletHeroTest.py
BulletHeroTest.py
py
607
python
en
code
0
github-code
7
[ { "api_name": "pygame.init", "line_number": 7, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 8, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pygame.time.Cloc...
30678227875
#!pip install streamlit import streamlit as st import pandas as pd import numpy as np import pickle from pycaret.classification import * st.set_page_config(page_title = 'Simulador - Case Ifood', layout = 'wide', initial_sidebar_state = 'expanded') st.title('Simulador -...
0verthrive/docker-streamlit-predition
cn-checkpoint2/app.py
app.py
py
904
python
pt
code
0
github-code
7
[ { "api_name": "streamlit.set_page_config", "line_number": 8, "usage_type": "call" }, { "api_name": "streamlit.title", "line_number": 12, "usage_type": "call" }, { "api_name": "streamlit.expander", "line_number": 13, "usage_type": "call" }, { "api_name": "streamlit...
35170834536
import os import json import pandas as pd from datetime import date, datetime from flask import Flask, Response, request, render_template, send_from_directory, abort, jsonify import Solver.db as db import Solver.solver as solver from Solver.pivot_table import create_pivot_table from Solver.predictor_futuro import ( ...
akouvach/indicadores
app.py
app.py
py
11,685
python
en
code
0
github-code
7
[ { "api_name": "flask.Flask", "line_number": 24, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 29, "usage_type": "call" }, { "api_name": "flask.request.ars.get", "line_number": 33, "usage_type": "call" }, { "api_name": "flask.request...
14531067186
import sqlite3,os cxn = sqlite3.connect('tags.db') cur = cxn.cursor() try: cur.execute('CREATE TABLE filetags(file_path VARCHAR(255), tag VARCHAR(20))') except: pass control=0 #try: while control!=-1: print("1) TAG A FILE") print("2) LIST TAGS") print("3) LIST FILES") print("4) FIND FILES BY SINGLE TAG") print(...
jeffhou/PyQt_test
test.py
test.py
py
589
python
en
code
0
github-code
7
[ { "api_name": "sqlite3.connect", "line_number": 3, "usage_type": "call" } ]
72573328544
import numpy as np from collections import Counter import matplotlib.pyplot as plt class DecisionTreeNode(object): def __init__(self, indices): self.indices = indices self.leftChild = None self.rightChild = None self.leaf = False def setSplit(self, splitFeat, splitVal, inform...
pjh2011/RandomForestClasses
decisionTreeClass.py
decisionTreeClass.py
py
9,153
python
en
code
0
github-code
7
[ { "api_name": "collections.Counter", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 66, "usage_type": "call" }, { "api_name": "numpy.sort", "line_number": 67, "usage_type": "call" }, { "api_name": "numpy.array", "line_n...
9720045138
from structlog.testing import capture_logs from mo_ldap_import_export.logging import logger from mo_ldap_import_export.processors import _hide_cpr def test_hide_cpr(): cpr_string = ( "my cpr no. is 010101-1234. " "My wife's cpr no. is 0102011235. " "This is not a cpr-no, but a telephone n...
magenta-aps/os2mo-ldap-import-export
tests/test_logging.py
test_logging.py
py
1,550
python
en
code
0
github-code
7
[ { "api_name": "mo_ldap_import_export.processors._hide_cpr", "line_number": 14, "usage_type": "call" }, { "api_name": "structlog.testing.capture_logs", "line_number": 22, "usage_type": "call" }, { "api_name": "mo_ldap_import_export.logging.logger.info", "line_number": 23, ...
40922304701
import warnings import requests from typing import List from bs4 import BeautifulSoup from langchain.docstore.document import Document class NCCSLoader: def __init__(self, urls): self.urls = urls def scrap_url(self, url: str) -> Document: response = requests.get(url) soup = B...
ChanMunFai/querychatbot
loaders.py
loaders.py
py
917
python
en
code
0
github-code
7
[ { "api_name": "requests.get", "line_number": 12, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 13, "usage_type": "call" }, { "api_name": "langchain.docstore.document.Document", "line_number": 18, "usage_type": "call" }, { "api_name": "l...
71091189665
from decimal import Decimal import pytest from wightinvoices.invoice import models def create_invoice(): client = models.Client(name='a', address='b') client.save() from django.contrib.auth import get_user_model user, created = get_user_model().objects.get_or_create(username='admin') invoice = m...
linovia/wight-invoices
tests/unitary/test_invoice.py
test_invoice.py
py
1,188
python
en
code
0
github-code
7
[ { "api_name": "wightinvoices.invoice.models.Client", "line_number": 7, "usage_type": "call" }, { "api_name": "wightinvoices.invoice.models", "line_number": 7, "usage_type": "name" }, { "api_name": "django.contrib.auth.get_user_model", "line_number": 11, "usage_type": "cal...
26043384778
import os import time import numpy as np from skimage import io, feature """ 只需要求出小人的位置,和屏幕中心的位置,就可以实现自动跳跃 万变不离其宗,不论目标方块如何变化,中心法则肯定是正确的 """ # 把adb命令添加到环境变量 os.environ['path'] += ";" + os.path.abspath("./adb/") # 是否调试,如果调试,保存截图 debug = True img_count = 0 # 图片编号 person = (63, 53, 81) # 小人的颜色 center = (650, 373) # 中心...
weiyinfu/wechat_jump
android自动.py
android自动.py
py
2,010
python
zh
code
0
github-code
7
[ { "api_name": "os.environ", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_...
24563419497
"""Agent for working with pandas objects.""" from typing import Any, Dict, List, Optional from langchain.agents.agent import AgentExecutor from langchain.agents.mrkl.base import ZeroShotAgent from langchain.callbacks.base import BaseCallbackManager from langchain.chains.llm import LLMChain from langchain.llms.base imp...
langchain-ai/langchain
libs/experimental/langchain_experimental/agents/agent_toolkits/spark/base.py
base.py
py
2,750
python
en
code
68,990
github-code
7
[ { "api_name": "typing.Any", "line_number": 14, "usage_type": "name" }, { "api_name": "pyspark.sql.DataFrame", "line_number": 18, "usage_type": "argument" }, { "api_name": "typing.Any", "line_number": 23, "usage_type": "name" }, { "api_name": "pyspark.sql.connect.d...
15855434797
from .models import Post from django.shortcuts import render, get_object_or_404 from .forms import PostForm from django.utils import timezone from django.shortcuts import redirect from django.http import HttpResponse from django.http import JsonResponse from django.core.paginator import EmptyPage, PageNotAnInteger, Pag...
radhac88/SMNS
shiva/Django/blog/views.py
views.py
py
2,763
python
en
code
0
github-code
7
[ { "api_name": "models.Post.objects.count", "line_number": 12, "usage_type": "call" }, { "api_name": "models.Post.objects", "line_number": 12, "usage_type": "attribute" }, { "api_name": "models.Post", "line_number": 12, "usage_type": "name" }, { "api_name": "models...
11527526023
from typing import Iterable, Set, List, Dict import os import logging from datetime import datetime, timedelta, timezone, date from dateutil import parser from functools import wraps from collections import defaultdict import time import re import html from flask import jsonify, request, current_app from werkzeug.secur...
hyplabs/forecast-redacted
backend/server.py
server.py
py
82,416
python
en
code
2
github-code
7
[ { "api_name": "logging.basicConfig", "line_number": 42, "usage_type": "call" }, { "api_name": "logging.WARN", "line_number": 42, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 43, "usage_type": "call" }, { "api_name": "logging.INFO"...
74478068383
import random import matplotlib.pyplot as plt # Simple rule def ptesting(N,k): for i in range(k): a = random.randint(1,N-1) if N % a == 0: return False return True # 2nd approach using fermet little theorem def mod_exp(b,e,m): ret = 1 while e> 0 : if e % 2 == ...
MadRajib/Data-Structures
Assignment-III/primality testing/primeTest.py
primeTest.py
py
937
python
en
code
0
github-code
7
[ { "api_name": "random.randint", "line_number": 8, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 26, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 48, "usage_type": "call" }, { "api_name": "matplotlib.pyplot...
21141481260
import os import sys import argparse import time import requests import random import configparser from picamera import PiCamera from google.cloud import automl_v1beta1 MODE_AUTO = 'auto' MODE_MANUAL = 'manual' def get_prediction(content): conf = get_predict_conf() prediction_client = automl_v1beta1.Predict...
kita83/Image-predict
predict.py
predict.py
py
4,232
python
en
code
0
github-code
7
[ { "api_name": "google.cloud.automl_v1beta1.PredictionServiceClient", "line_number": 18, "usage_type": "call" }, { "api_name": "google.cloud.automl_v1beta1", "line_number": 18, "usage_type": "name" }, { "api_name": "picamera.PiCamera", "line_number": 30, "usage_type": "cal...
30603254976
from __future__ import division from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import sys import os import argparse from propeller.service.client import InferenceClient from propeller import log import six import utils.data from time import time imp...
PaddleToturial-v2/DeepLearningAndPaddleTutorial-v2
lesson14/ernie/service/client.py
client.py
py
4,071
python
en
code
23
github-code
7
[ { "api_name": "propeller.service.client.InferenceClient", "line_number": 16, "usage_type": "name" }, { "api_name": "utils.data.data.CharTokenizer", "line_number": 28, "usage_type": "call" }, { "api_name": "utils.data.data", "line_number": 28, "usage_type": "attribute" }...