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
72870085662
import torch import torch.nn as nn import torch.nn.functional as F class Net(nn.Module): def __init__(self): super(Net, self).__init__() self.conv1 = nn.Conv2d(1, 16, 2, 1) self.conv2 = nn.Conv2d(16, 32, 2, 1) self.dropout1 = nn.Dropout(0.25) self.dropout2 = nn.Dropout(0.5) ...
Ascend/ModelZoo-PyTorch
PyTorch/dev/cv/image_classification/pFedMe_ID1597_for_PyTorch/FLAlgorithms/trainmodel/models.py
models.py
py
5,108
python
en
code
31
github-code
7
[ { "api_name": "torch.nn.Module", "line_number": 5, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 5, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.nn", "line_numbe...
72979497822
import sys import requests from typing import List, Union import xmltodict import json class BaseQuery: # class atributes PACKAGE_ROOT = '.' HEADERS = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36', } @...
leoxiang66/requests-toolkit
requests_toolkit/_academic.py
_academic.py
py
4,242
python
en
code
0
github-code
7
[ { "api_name": "requests.get", "line_number": 28, "usage_type": "call" }, { "api_name": "xmltodict.parse", "line_number": 86, "usage_type": "call" }, { "api_name": "typing.Union", "line_number": 83, "usage_type": "name" }, { "api_name": "typing.List", "line_num...
71481083422
from django.http import HttpResponse from django.shortcuts import render from post.models import Post def post_list(request): posts = Post.objects.all() context = { 'posts': posts } return render(request, 'post/post_list.html', context=context) def post_detail(request, post_pk): post = P...
Gyong1211/my-insta
django_app/post/views.py
views.py
py
462
python
en
code
0
github-code
7
[ { "api_name": "post.models.Post.objects.all", "line_number": 7, "usage_type": "call" }, { "api_name": "post.models.Post.objects", "line_number": 7, "usage_type": "attribute" }, { "api_name": "post.models.Post", "line_number": 7, "usage_type": "name" }, { "api_name...
37306000456
from revere.sources.base import BaseRevereSource from sqlalchemy import create_engine class DatabaseSource(BaseRevereSource): name = 'Database' def __init__(self, description=None, config={}): super(DatabaseSource, self).__init__(description, config) required_params = ['connection_string'] ...
pegler/revere
revere/sources/database.py
database.py
py
1,055
python
en
code
8
github-code
7
[ { "api_name": "revere.sources.base.BaseRevereSource", "line_number": 5, "usage_type": "name" }, { "api_name": "sqlalchemy.create_engine", "line_number": 16, "usage_type": "call" } ]
22465620156
from difflib import SequenceMatcher import pandas as pd import cv2 from pytesseract import image_to_string import pytesseract import os pytesseract.pytesseract.tesseract_cmd = r"C:\Program Files\Tesseract-OCR\tesseract.exe" labels = ["croaked растаял", "величии лишил", "Вот он ваш знак", "гидов лавки", "дружбу cloud...
KoriganGH/ComputerVision
lab_7/task3.py
task3.py
py
3,769
python
ru
code
0
github-code
7
[ { "api_name": "pytesseract.pytesseract", "line_number": 9, "usage_type": "attribute" }, { "api_name": "cv2.imread", "line_number": 18, "usage_type": "call" }, { "api_name": "pytesseract.image_to_string", "line_number": 27, "usage_type": "call" }, { "api_name": "cv...
74934170142
import os.path as osp import time from argparse import ArgumentParser, Namespace from mmengine import Config, DictAction, mkdir_or_exist from uce.edit import EDITORS, load_editor, parse_concepts, save_editor from uce.utils import setup_logger def parse_args() -> Namespace: parser = ArgumentParser('Edit model we...
YecanLee/Concept_Editing_Stable_Diffusion
uce_paper_related/edit_model_comment.py
edit_model_comment.py
py
4,539
python
en
code
0
github-code
7
[ { "api_name": "argparse.ArgumentParser", "line_number": 12, "usage_type": "call" }, { "api_name": "mmengine.DictAction", "line_number": 67, "usage_type": "name" }, { "api_name": "argparse.Namespace", "line_number": 11, "usage_type": "name" }, { "api_name": "mmengi...
31915649335
def getPermutation(n,k): from functools import reduce n_list=[str(i) for i in range(1,n+1)] n_list="".join(n_list)#如果是n_list=" ".join(n_list)。这里" "里面是有空格的,则生成的字符串之间都是有空格的 #permutations=reduce([lambda s,c:p[:i]+c+p[i:] for i in range(len(p)) for p in s],n_list,[]) #生成全排列注意点 permutations = reduce(...
zhouhaosame/leetcode_zh
1-60/60_permutation_sequence.py
60_permutation_sequence.py
py
2,413
python
zh
code
0
github-code
7
[ { "api_name": "functools.reduce", "line_number": 7, "usage_type": "call" }, { "api_name": "functools.reduce", "line_number": 27, "usage_type": "call" }, { "api_name": "math.factorial", "line_number": 46, "usage_type": "call" } ]
41986541281
from rest_framework.schemas import AutoSchema from Apps.common.services import Params, BaseService class GoogleMobility_Service(BaseService): def __init__(self): self.dropped_keys = [] self.single_keys = ['CountryName', 'CountryCode'] self.params = [ Params(name='regionCode',...
ArtemisDicoTiar/covid_data_blog
covid_api_django/Apps/Google/services.py
services.py
py
2,330
python
en
code
1
github-code
7
[ { "api_name": "Apps.common.services.BaseService", "line_number": 6, "usage_type": "name" }, { "api_name": "Apps.common.services.Params", "line_number": 12, "usage_type": "call" }, { "api_name": "Apps.common.services.Params", "line_number": 14, "usage_type": "call" }, ...
70272706784
__author__ = 'zhamilto' from tests_framework.ui_building_blocks.screen import Screen, ScreenActions from tests_framework.ve_tests.tests_conf import DeviceType import logging MAX_FOR_YOU_ASSETS = 10 MAX_ON_AIR_ASSETS = 10 MAX_FEATURE_POSTER_ASSETS = 4 OPEN_VOD_ACTION_MENU_TIME_OUT = 2.5 class TvFilter(Screen): de...
anshsaikia/GSSDeliverables-YesProject
VE-Tests/tests_framework/ui_building_blocks/K/tv_filter.py
tv_filter.py
py
12,465
python
en
code
0
github-code
7
[ { "api_name": "tests_framework.ui_building_blocks.screen.Screen", "line_number": 12, "usage_type": "name" }, { "api_name": "tests_framework.ui_building_blocks.screen.Screen.__init__", "line_number": 14, "usage_type": "call" }, { "api_name": "tests_framework.ui_building_blocks.scr...
2710868244
# coding: utf-8 """ Parser/type converter for data in Interactive Brokers' Flex XML format. https://www.interactivebrokers.com/en/software/reportguide/reportguide.htm#reportguide/activity_flex_query_reference.htm """ # stdlib imports import xml.etree.ElementTree as ET # local imports from ibflex import schemata from...
emteedubs/ibflex
ibflex/parser.py
parser.py
py
4,217
python
en
code
null
github-code
7
[ { "api_name": "xml.etree.ElementTree.ElementTree", "line_number": 22, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 22, "usage_type": "name" }, { "api_name": "ibflex.schemata.FlexQueryResponse.convert", "line_number": 29, "usage_type": "cal...
4303888850
import cv2 import matplotlib.pyplot as plt def main(): windowName="Live Webcam Video Feed Capture" cv2.namedWindow(windowName) cap = cv2.VideoCapture(0) filename='C:\\Users\\ASH\\Desktop\\New folder\\456.avi' codec= cv2.VideoWriter_fourcc('X','V','I','D') framerate=30...
ash264/OpenCV_practice
Webcam recording to file.py
Webcam recording to file.py
py
1,067
python
en
code
0
github-code
7
[ { "api_name": "cv2.namedWindow", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.VideoWriter_fourcc", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.VideoWriter...
33822915885
import hashlib import yaml import url_utils import config def tokenize_string(string): tokens = [] cur_token = "" for char in string: if char in config.settings["ALLOWED_AN_CHARS"]: cur_token += char else: if cur_token: tokens.append(cur_token) ...
timoteostewart/benson
text_utils.py
text_utils.py
py
667
python
en
code
12
github-code
7
[ { "api_name": "config.settings", "line_number": 13, "usage_type": "attribute" }, { "api_name": "url_utils.tokenize_url", "line_number": 27, "usage_type": "call" }, { "api_name": "hashlib.md5", "line_number": 28, "usage_type": "call" } ]
14197628235
# from pudb import set_trace; set_trace() from typing import List, Tuple import math class Solution1: def longestPath(self, parent: List[int], s: str) -> int: """LeetCode 2246 I am glad that this solution was almost exactly the same as the updated one last time I encountered this problem ...
FanchenBao/leetcode
2023_01_challenge/01_13_2023.py
01_13_2023.py
py
2,326
python
en
code
1
github-code
7
[ { "api_name": "typing.List", "line_number": 7, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 40, "usage_type": "name" } ]
30795291296
import os import re import uuid import logging import base64 import io import time import numpy as np import tensorflowjs as tfjs from datetime import datetime, timedelta from flask import Flask, jsonify, request from functools import wraps from base64 import encodebytes from werkzeug.security import generate_password_...
mihajlo97/etf-thesis-2022
backend/app.py
app.py
py
18,483
python
en
code
0
github-code
7
[ { "api_name": "flask.Flask", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path", "line_number": 28, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_...
14196100315
# from pudb import set_trace; set_trace() from typing import List from functools import lru_cache class Solution1: def findPaths(self, m: int, n: int, maxMove: int, startRow: int, startColumn: int) -> int: """LeetCode 576 Not very difficult. A typical DP problem. We record the number of w...
FanchenBao/leetcode
2021_06_challenge/06_24_2021.py
06_24_2021.py
py
4,542
python
en
code
1
github-code
7
[ { "api_name": "functools.lru_cache", "line_number": 81, "usage_type": "call" } ]
36720500435
# ------------------------------------------------------------- from AI_intro_project.Coordinate_and_Move \ import Coordinate, Move from random import choice import matplotlib.pyplot as plt class State(): '''a state of the game''' def __init__(self) -> None: ''' Each state ...
htnminh/AI-intro-project
AI_intro_project/State.py
State.py
py
9,158
python
en
code
4
github-code
7
[ { "api_name": "AI_intro_project.Coordinate_and_Move.Coordinate", "line_number": 55, "usage_type": "call" }, { "api_name": "AI_intro_project._Utilities._Utilities", "line_number": 88, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 108, "...
2644804534
import numpy as np import matplotlib as mlp mlp.use('TkAgg') import matplotlib.pyplot as plt x = np.arange(0, 6, 0.1) y1 = np.sin(x) y2 = np.cos(x) # graph plt.plot(x, y1, label="sin") plt.plot(x, y2, linestyle="--", label="cos") plt.xlabel("x") plt.xlabel("y") plt.title("sin & cos") plt.legend() plt.show()
brightparagon/learn-machine-learning
python-numpy-to-cnn/7-matplotlib-cos.py
7-matplotlib-cos.py
py
311
python
en
code
2
github-code
7
[ { "api_name": "matplotlib.use", "line_number": 3, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.cos", "line_number": 8, ...
35826575782
import pandas as pd import numpy as np from sklearn.preprocessing import StandardScaler, OneHotEncoder from sklearn.compose import ColumnTransformer from xgboost import XGBClassifier import logging from typing import List, Tuple, Dict import pickle logger = logging.getLogger(__name__) def load_data(data_file: str) ...
Gefte/API-for-Data-Science
models/pipeline_model.py
pipeline_model.py
py
6,019
python
en
code
2
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 25, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 14, "usage_type": "attribute" }, { "api_name": "pandas.DataFr...
40626049571
import os from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(here, 'README.md')) as f: README = f.read() with open(os.path.join(here, 'CHANGES.md')) as f: CHANGES = f.read() requires = [ 'numpy', 'scipy', 'matplotlib', 'pyyaml'...
trmznt/fatools
setup.py
setup.py
py
1,031
python
en
code
11
github-code
7
[ { "api_name": "os.path.abspath", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path.join", "line_nu...
72845170782
# coding=utf-8 # Copyright (c) 2019 NVIDIA CORPORATION. All rights reserved. # Copyright 2018 The Google AI Language Team Authors and The HugginFace Inc. team. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a cop...
Ascend/ModelZoo-PyTorch
ACL_PyTorch/contrib/nlp/tinybert/TinyBERT_preprocess_data.py
TinyBERT_preprocess_data.py
py
12,032
python
en
code
31
github-code
7
[ { "api_name": "io.open", "line_number": 79, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 80, "usage_type": "call" }, { "api_name": "sys.version_info", "line_number": 83, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_num...
43058549463
# -*- coding: utf-8 -*- # @Time : 2019/8/21 9:00 # @Author : Youpeng Li # @Site : # @File : 0179_largestNumber.py # @Software: PyCharm ''' 179. Largest Number Given a list of non negative integers, arrange them such that they form the largest number. Example 1: Input: [10,2] Output: "210" ...
YoupengLi/leetcode-sorting
Solutions/0179_largestNumber.py
0179_largestNumber.py
py
1,586
python
en
code
1
github-code
7
[ { "api_name": "functools.cmp_to_key", "line_number": 44, "usage_type": "call" } ]
22901244140
import os from casacore.tables import table import numpy as np import pylab from numpy import ma import sys import warnings import time import math import argparse class CovWeights: def __init__(self,MSName,ntsol=1,SaveDataProducts=0,uvcut=[0,2000],gainfile=None,phaseonly=False,nfreqsol=1,norm=False): if M...
ebonnassieux/Scripts
QualityWeightsLOFAR.py
QualityWeightsLOFAR.py
py
16,489
python
en
code
3
github-code
7
[ { "api_name": "casacore.tables.table", "line_number": 29, "usage_type": "call" }, { "api_name": "casacore.tables.table", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 41, "usage_type": "call" }, { "api_name": "warnings.filt...
26775597336
from django.shortcuts import render, redirect, render_to_response from django.views.generic import TemplateView, View from django.http import HttpResponse, HttpResponseRedirect from django.views.generic.edit import UpdateView from .forms import EventForm from .models import Event from django.contrib.auth.models import ...
skkk98/HelpAtEase
Ngo/views.py
views.py
py
3,411
python
en
code
1
github-code
7
[ { "api_name": "models.Event.objects.get", "line_number": 12, "usage_type": "call" }, { "api_name": "models.Event.objects", "line_number": 12, "usage_type": "attribute" }, { "api_name": "models.Event", "line_number": 12, "usage_type": "name" }, { "api_name": "forms...
11436652498
import numpy as np import matplotlib.pyplot as plt import pint ureg = pint.UnitRegistry() def mass_cylinder(diam, length, rolls): # one sheet of A4 paper weighs 5g m = 5 * ureg.g # area of one sheet of A4 is a = 210 * 297 * ureg.Quantity("mm^2") rho = m / a cylinder_area = diam * np.pi * leng...
jasper-day/Notes
Class_Notes/2B_Eng_Design/euler_beam_paper.py
euler_beam_paper.py
py
1,989
python
en
code
0
github-code
7
[ { "api_name": "pint.UnitRegistry", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 13, "usage_type": "attribute" }, { "api_name": "numpy.arange", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.pi", "line_numb...
6020504272
import math import numpy as np from scipy import signal from scipy.interpolate import interp1d import pandas as pd import matplotlib.pyplot as plt def load_pulse(sample_rate, pulse_filename, save_filename): pulse_data = pd.read_csv(pulse_filename) start_time =20 end_time =50 start = sample_rate *...
kinemasa/ImageSensing2
skinSeparation/_plotCorrectPulse/program/plotCorrectPulse.py
plotCorrectPulse.py
py
11,797
python
en
code
0
github-code
7
[ { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 23, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 26, "usage_type": "call" }, { "api_name": "matplotlib.pyplo...
71329158302
from fastapi import APIRouter, HTTPException, Depends from typing import List from src.api import codes from src.api.errors import APIValidationError from src.auth.middleware import user_id_authorization from src.api.errors import error_response from src.organization.service import get_organization_by_id from src.serv...
krissukoco/fastapi-appointment
src/service/router.py
router.py
py
3,715
python
en
code
0
github-code
7
[ { "api_name": "fastapi.APIRouter", "line_number": 15, "usage_type": "call" }, { "api_name": "src.service.service.get_services_by_organization_id", "line_number": 19, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 17, "usage_type": "name" }, { ...
9918056128
import torch from torch.autograd import Variable import torchvision.transforms as transforms import torchvision.datasets as dsets import numpy as np class LogisticRegression(torch.nn.Module): def __init__(self, input_dim, output_dim): super(LogisticRegression, self).__init__() self.linear = torch.n...
JohnF1103/ML-OPT-project
code/DPSGD_SImple_classifier.py
DPSGD_SImple_classifier.py
py
3,184
python
en
code
1
github-code
7
[ { "api_name": "torch.nn", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.nn.Linear", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torchvision.datasets.MNIST...
32757234668
#!/usr/bin/env python #!_*_coding:utf-8_*_ import logging import inspect import os from os.path import join from os.path import exists from os.path import dirname def enc_addlog(file_name, line_no, info, log_name): if not exists(dirname(log_name)): os.makedirs(dirname(log_name)) logger = logging.getL...
sumoning/sumoning
logger_unit.py
logger_unit.py
py
1,319
python
en
code
0
github-code
7
[ { "api_name": "os.path.exists", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 13, "usage_type": "call" }, { "api_name": "os.makedirs", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.dirname", "lin...
73690583904
""" Instructions: 1) Download the expert policies from https://github.com/aravindr93/hand_dapg 2) Place the policies from dapg_policies in the current directory 3) Run this script passing in the appropriate env_name """ import d4rl import argparse import os import gym import numpy as np import pickle from mjrl.utils.g...
Farama-Foundation/D4RL
scripts/reference_scores/adroit_expert.py
adroit_expert.py
py
1,300
python
en
code
1,058
github-code
7
[ { "api_name": "argparse.ArgumentParser", "line_number": 17, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 23, "usage_type": "call" }, { "api_name": "gym.make", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.mean", "line_n...
13927603259
from __future__ import absolute_import from __future__ import division from __future__ import print_function from hanabi_learning_environment.agents.rainbow.run_experiment import ObservationStacker from pathlib import Path import time from hanabi_learning_environment.agents.rainbow.third_party.dopamine import chec...
sarahgillet/hanabi-rl-course
run_experiment_play.py
run_experiment_play.py
py
17,313
python
en
code
1
github-code
7
[ { "api_name": "gin.tf.parse_config_files_and_bindings", "line_number": 40, "usage_type": "call" }, { "api_name": "gin.tf", "line_number": 40, "usage_type": "name" }, { "api_name": "hanabi_live_bot.hanabi_client.HanabiClient", "line_number": 45, "usage_type": "name" }, ...
74143138462
from flask import * import sqlite3 app = Flask(__name__) @app.route('/') def index(): conn = sqlite3.connect('data.db') cur = conn.execute("SELECT * FROM sensors WHERE id=1") row = cur.fetchone() if int(row[1]) > 28: msg = "temperature is High" else: msg = "Normal" ...
Ashuhegde/IoT-based-Temperature-Monitoring-System
main.py
main.py
py
648
python
en
code
0
github-code
7
[ { "api_name": "sqlite3.connect", "line_number": 8, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 19, "usage_type": "call" } ]
40960303591
import copy import math import warnings import torch import torch.nn as nn from mmcv import ConfigDict from mmcv.cnn import (Linear, build_activation_layer, build_norm_layer, constant_init, xavier_init) from mmcv.ops.multi_scale_deform_attn import ( MultiScaleDeformableAttnFunction, multi_sc...
liuhang1234/PriorLane
mmseg/models/necks/transformer_util.py
transformer_util.py
py
12,430
python
en
code
0
github-code
7
[ { "api_name": "torch.nn.Module", "line_number": 19, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 19, "usage_type": "name" }, { "api_name": "torch.nn.MultiheadAttention", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.nn", ...
28464468109
from typing import Optional, List class ListNode: def __init__(self, val=0, next=None): self.val = val self.next = next class Solution: # Time Complexity: O(n) # Space Complexity: O(1) def swapPairs(self, head: Optional[ListNode]) -> Optional[ListNode]: if not head: ...
JianLiu666/StudyNote-DSA
leetcode/p00024/p00024.py
p00024.py
py
1,371
python
en
code
1
github-code
7
[ { "api_name": "typing.Optional", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 32, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 32, "usage_type": "name" } ]
38149178419
from collections import Counter num = input("Enter total number of gloves : ") print("Enter colors of array : ") arr = list(map(int,input().split())) sum = 0 n = Counter(arr) for i in n.values(): sum += (i//2) print(sum)
Anusha-Subramanyam/Assignments-DSC
Assignment1/Number-of-pairs-Gloves.py
Number-of-pairs-Gloves.py
py
226
python
en
code
0
github-code
7
[ { "api_name": "collections.Counter", "line_number": 7, "usage_type": "call" } ]
6863305429
from django.contrib.auth.decorators import login_required from django.http import HttpResponse, HttpResponseRedirect, Http404 from django.shortcuts import render from django.template import RequestContext from website.models import Order, Payment from django.contrib.auth.models import User #author SI @login_required...
IndomitableIbises/Bangazon-Sprint-3
website/views/order_view.py
order_view.py
py
1,053
python
en
code
0
github-code
7
[ { "api_name": "website.models.Order.objects.filter", "line_number": 14, "usage_type": "call" }, { "api_name": "website.models.Order.objects", "line_number": 14, "usage_type": "attribute" }, { "api_name": "website.models.Order", "line_number": 14, "usage_type": "name" },...
3614194458
import logging logger = logging.getLogger(__name__) import time from pathlib import Path from typing import List, Tuple from collections import deque from copy import deepcopy from production import utils from production.data_formats import * from production.geom import poly_bb, rasterize_poly, visible from production...
Vlad-Shcherbina/icfpc2019-tbd
production/solvers/greedy_beam.py
greedy_beam.py
py
7,493
python
en
code
0
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 2, "usage_type": "call" }, { "api_name": "production.game.Game", "line_number": 25, "usage_type": "name" }, { "api_name": "production.game.BacktrackingGame", "line_number": 25, "usage_type": "name" }, { "api_name":...
44673544619
#!/usr/bin/env python import rospy from std_msgs.msg import Int32 from geometry_msgs.msg import PoseStamped, Pose from styx_msgs.msg import TrafficLightArray, TrafficLight from styx_msgs.msg import Lane from sensor_msgs.msg import Image from cv_bridge import CvBridge from light_classification.tl_classifier import TLCla...
JoeyLI17/Lincoln_System_Integration_ROS
ros/src/tl_detector/tl_detector.py
tl_detector.py
py
9,326
python
en
code
1
github-code
7
[ { "api_name": "rospy.init_node", "line_number": 33, "usage_type": "call" }, { "api_name": "styx_msgs.msg.TrafficLight.UNKNOWN", "line_number": 42, "usage_type": "attribute" }, { "api_name": "styx_msgs.msg.TrafficLight", "line_number": 42, "usage_type": "name" }, { ...
39903878717
import base64 import json import os import random import requests import time from Crypto.Cipher import AES from Crypto.Util.Padding import pad from requests.adapters import HTTPAdapter from requests.packages.urllib3.util.retry import Retry def buildHeader(): return { 'Content-Type': 'application/json', ...
hao-Cheng-JNU/stuhealth
stuhealth.py
stuhealth.py
py
5,108
python
en
code
0
github-code
7
[ { "api_name": "random.randint", "line_number": 15, "usage_type": "call" }, { "api_name": "requests.Session", "line_number": 20, "usage_type": "call" }, { "api_name": "requests.adapters.HTTPAdapter", "line_number": 23, "usage_type": "call" }, { "api_name": "request...
24055541970
from librosa import load, stft, istft import torch import numpy as np from mir_eval.separation import bss_eval_sources from hparams import create_hparams import os import utils from models.model import Model import json from soundfile import write from tqdm import tqdm import argparse class EVAL(object): def __in...
jlqian98/mmdenselstm
evaluate.py
evaluate.py
py
3,288
python
en
code
3
github-code
7
[ { "api_name": "models.model.Model", "line_number": 19, "usage_type": "call" }, { "api_name": "os.makedirs", "line_number": 26, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path.join", "line_nu...
3236531817
import json import boto3 import uuid from boto3.dynamodb.conditions import Key, Attr def lambda_handler(event, context): #get form data: #get body of request to extract url: formData_raw = event["body"] formData = json.loads(formData_raw) username = formData['username'] dynamodb = boto3.r...
farhan0167/price-tracker
lambda_functions/amazonPriceMonitorGetItemsByUsername.py
amazonPriceMonitorGetItemsByUsername.py
py
1,238
python
en
code
0
github-code
7
[ { "api_name": "json.loads", "line_number": 11, "usage_type": "call" }, { "api_name": "boto3.resource", "line_number": 14, "usage_type": "call" }, { "api_name": "boto3.dynamodb.conditions.Attr", "line_number": 18, "usage_type": "call" }, { "api_name": "json.dumps",...
34154253944
import rasterio import pandas as pd band_id = 1 def target(raster_name): raster = rasterio.open(raster_name) band_arr = raster.read(band_id) target_elevation = [] for i in range(band_arr.shape[0]): for j in range(band_arr.shape[1]): # filter Nodata value -9999 if band_arr[i ,j] < -0....
kiwi1210/landslide_volume
plot_volchange.py
plot_volchange.py
py
2,129
python
en
code
0
github-code
7
[ { "api_name": "rasterio.open", "line_number": 6, "usage_type": "call" }, { "api_name": "pandas.options", "line_number": 38, "usage_type": "attribute" }, { "api_name": "pandas.DataFrame", "line_number": 39, "usage_type": "call" }, { "api_name": "pandas.DataFrame", ...
73509599582
import json import logging import time import typing as t import ping3 # type:ignore from . import logger from .constant import WiFiState from .helper import create_adapter, get_current_os_info from .wifi import LinuxAdapter, MacAdapter, WifiAdapter, WindowsAdapter class Netbox(object): """A class that contain...
Hellboycc/netbox
netbox/core.py
core.py
py
7,740
python
en
code
0
github-code
7
[ { "api_name": "ping3.ping", "line_number": 18, "usage_type": "attribute" }, { "api_name": "typing.Optional", "line_number": 19, "usage_type": "attribute" }, { "api_name": "wifi.WifiAdapter", "line_number": 19, "usage_type": "name" }, { "api_name": "helper.create_a...
18602640337
#!/usr/bin/env python3 import libtcodpy as libtcod from functools import reduce import re # for sub from interfaces import Carryable, Activatable, Activator, CountUp, Mappable, TurnTaker, StatusEffect, LightSource from ui import UI, HBar, Message from errors import InvalidMoveError class Item(Carryable, Activatable...
frogbotherer/DalekRL
items.py
items.py
py
22,218
python
en
code
0
github-code
7
[ { "api_name": "interfaces.Carryable", "line_number": 12, "usage_type": "name" }, { "api_name": "interfaces.Activatable", "line_number": 12, "usage_type": "name" }, { "api_name": "interfaces.Mappable", "line_number": 12, "usage_type": "name" }, { "api_name": "inter...
20517516837
# -*- coding: utf-8 -*- """ Created on Wed Nov 18 09:57:49 2020 @author: sandhya chettiar """ # Convolution & Correlation from numpy.core.defchararray import array from skimage import data import numpy as np from matplotlib import pyplot as plt # Read the image img = data.text() plt.gray() # ...
Sandhya18Chettiar/Digital-Image-Processing-Lab
Convolution&Correlation.py
Convolution&Correlation.py
py
2,090
python
en
code
0
github-code
7
[ { "api_name": "skimage.data.text", "line_number": 18, "usage_type": "call" }, { "api_name": "skimage.data", "line_number": 18, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.gray", "line_number": 19, "usage_type": "call" }, { "api_name": "matplotlib.pypl...
19262987010
import datetime from random import randint def random_with_N_digits(n): range_start = 10**(n-1) range_end = (10**n)-1 return str(randint(range_start, range_end)) def get_DateTime(): date = datetime.datetime.now() year, month, day, hour, minute, second = str(date.year), '%02d'%date.month, \ ...
chatnanibhavesh/Universal-Medical-Database
Python Files/hl7.py
hl7.py
py
557
python
en
code
0
github-code
7
[ { "api_name": "random.randint", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 10, "usage_type": "attribute" } ]
25598329660
import json from sqlalchemy import DateTime, Column, ForeignKey, Integer, String, func, or_ from sqlalchemy.orm import relationship from dlproxy.sql import Base, Url from dlproxy.view import list_serialize, ilike_escape class UrlAccess(Base): __tablename__ = 'url_access' id = Column(Integer, primary_key=Tru...
biolds/dlproxy
dlproxy/access.py
access.py
py
1,644
python
en
code
0
github-code
7
[ { "api_name": "dlproxy.sql.Base", "line_number": 10, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 12, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer", "line_number": 12, "usage_type": "argument" }, { "api_name": "sqlalchemy....
7047863695
from kafka import KafkaProducer import time import json producer = KafkaProducer(bootstrap_servers='192.168.33.50:9092') topic = 'test' i = 0 while True: i += 1 json_data = { "msg": "my kafka {}".format(i), "count": i, "create_time": time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())...
zhexiao/mnet
deploy/test/kf_producer3.py
kf_producer3.py
py
475
python
en
code
19
github-code
7
[ { "api_name": "kafka.KafkaProducer", "line_number": 5, "usage_type": "call" }, { "api_name": "time.strftime", "line_number": 14, "usage_type": "call" }, { "api_name": "time.localtime", "line_number": 14, "usage_type": "call" }, { "api_name": "json.dumps", "lin...
28519962813
#! /usr/bin/env python3 import pytest import glob import os import sys import subprocess import re import collections # tests for typing AND evaluation # change here to also include bad_def tests. ALL_FILES = glob.glob('ex/*.mu')+glob.glob('ex-types/*.mu') # our own test cases! # +glob.glob('correx/*.mu') # Path se...
BryanBoni/Compilation
TP03/Mu-evalntype/test_evaluator.py
test_evaluator.py
py
2,484
python
en
code
0
github-code
7
[ { "api_name": "glob.glob", "line_number": 12, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 19, "usage_type": "attribute" }, { "api_name": "glob.glob", "line_number": 20, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 2...
13709578846
#!/usr/bin/python3 import monkeytype from trystatic import util import sys import argparse import os import re import subprocess from collections import defaultdict sys.path.append("../") # def remove_clone_archive(path, clone_path, is_fatal): # """Remove temporary clone_archive git folder.""" # try: # ...
insilications/trystatic-clr
src/trystatic/__main__.py
__main__.py
py
5,666
python
en
code
0
github-code
7
[ { "api_name": "sys.path.append", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 23, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", ...
18166569905
from vizdoom import * import numpy as np import math from gym.core import Env from gym.spaces.discrete import Discrete from gym.spaces.box import Box from model.util import * x_bank = [-320, -120, 120] y_bank = [-320, -120, 120] class NaviEnv(Env): def __init__(self): self.game = DoomGame() self.g...
guotata1996/Doom-AI-Training
env/navienv.py
navienv.py
py
4,275
python
en
code
0
github-code
7
[ { "api_name": "gym.core.Env", "line_number": 12, "usage_type": "name" }, { "api_name": "gym.spaces.discrete.Discrete", "line_number": 32, "usage_type": "call" }, { "api_name": "gym.spaces.box.Box", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.ui...
43575731409
from appium import webdriver from appium.webdriver.extensions.android.nativekey import AndroidKey desired_caps = { 'platformName': 'Android', # 被测手机是安卓 'platformVersion': '8', # 手机安卓版本 'deviceName': 'xxx', # 设备名,安卓手机可以随意填写 'appPackage': 'tv.danmaku.bili', # 启动APP Package名称 'appActivity': '.ui.splash.SplashAc...
gschen/sctu-ds-2020
1906101019-贾佳/interest/app.py
app.py
py
1,477
python
zh
code
7
github-code
7
[ { "api_name": "appium.webdriver.Remote", "line_number": 19, "usage_type": "call" }, { "api_name": "appium.webdriver", "line_number": 19, "usage_type": "name" }, { "api_name": "appium.webdriver.extensions.android.nativekey.AndroidKey.ENTER", "line_number": 37, "usage_type"...
70072760544
# ================================================================= # # Work of the U.S. Department of Defense, Defense Digital Service. # Released as open source under the MIT License. See LICENSE file. # # ================================================================= import json import sys from django.core.man...
deptofdefense/kanga
kanga/management/commands/add-groups.py
add-groups.py
py
1,217
python
en
code
1
github-code
7
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 18, "usage_type": "name" }, { "api_name": "kanga.models.Group.objects.all", "line_number": 33, "usage_type": "call" }, { "api_name": "kanga.models.Group.objects", "line_number": 33, "usage_type": "att...
36518077991
try: import importlib.resources as pkg_resources except ImportError: # Fallback for Python < 3.7 import importlib_resources as pkg_resources import yaml from znoyder.utils import merge_dicts with pkg_resources.open_text(__package__, 'config.yml') as file: CONFIG = yaml.load(file, Loader=yaml.FullLoader...
RedHatCRE/znoyder
znoyder/config.py
config.py
py
1,046
python
en
code
7
github-code
7
[ { "api_name": "importlib_resources.open_text", "line_number": 11, "usage_type": "call" }, { "api_name": "yaml.load", "line_number": 12, "usage_type": "call" }, { "api_name": "yaml.FullLoader", "line_number": 12, "usage_type": "attribute" }, { "api_name": "importli...
70397553823
import numpy as np from rllab.core.serializable import Serializable from gym.envs.mujoco import mujoco_env from gym.spaces import Box from rllab.envs.base import Env from rllab.misc.overrides import overrides class MapConfig(Serializable): def __init__(self, xs, ys, xres, yres): Serializable.quick_init(...
justinjfu/inverse_rl
inverse_rl/envs/twod_mjc_env.py
twod_mjc_env.py
py
3,397
python
en
code
243
github-code
7
[ { "api_name": "rllab.core.serializable.Serializable", "line_number": 11, "usage_type": "name" }, { "api_name": "rllab.core.serializable.Serializable.quick_init", "line_number": 13, "usage_type": "call" }, { "api_name": "rllab.core.serializable.Serializable", "line_number": 13...
11966924066
import asyncio import DiscordUtils from discord.ext import commands from discord.ext.commands import Cog import config from db.src import db_strings from modules.leaderboard_helper import gen_leaderboard_embed, MAIN_LEADERBOARD_LIM, LEADERBOARD_SIZE LEADERBOARD_UPDATE_TIME = (60 * 60) # 60 min, or 1 hour class Le...
AdamW19/LaunchBot
cogs/leaderboard.py
leaderboard.py
py
4,320
python
en
code
0
github-code
7
[ { "api_name": "discord.ext.commands.Cog", "line_number": 14, "usage_type": "name" }, { "api_name": "asyncio.sleep", "line_number": 24, "usage_type": "call" }, { "api_name": "db.src.db_strings.GET_SETTINGS", "line_number": 28, "usage_type": "attribute" }, { "api_na...
15276562882
import keyboard import time def if_button_pressed(): possible_letter_choice = ['w', 'a', 's', 'd'] key = keyboard.get_hotkey_name() if key in possible_letter_choice: return key else: return False def get_keyboard_letter(): letter = '' key = if_button_pre...
KKandD/Roguelike
Test_code.py
Test_code.py
py
667
python
en
code
0
github-code
7
[ { "api_name": "keyboard.get_hotkey_name", "line_number": 6, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 29, "usage_type": "call" } ]
75155509663
import torch import torch.nn as nn from models.network import Network from src.utils import get_derivative class DFC(Network): def __init__(self, encoder, decoder, config) -> None: super().__init__(encoder, decoder, name="DFC") self._target_lr = config.target_lr self._alpha_di = config.a...
s-de-haan/BioplausibleAutoEncoders
models/dfc.py
dfc.py
py
4,324
python
en
code
0
github-code
7
[ { "api_name": "models.network.Network", "line_number": 8, "usage_type": "name" }, { "api_name": "torch.eye", "line_number": 56, "usage_type": "call" }, { "api_name": "torch.matmul", "line_number": 60, "usage_type": "call" }, { "api_name": "torch.cat", "line_nu...
18033151285
import io import json import os from dataclasses import dataclass from typing import Union import requests from huggingface_hub import HfApi from autotrain import logger from autotrain.dataset import AutoTrainDataset, AutoTrainDreamboothDataset from autotrain.trainers.clm.params import LLMTrainingParams from autotrai...
huggingface/autotrain-advanced
src/autotrain/backend.py
backend.py
py
15,424
python
en
code
2,291
github-code
7
[ { "api_name": "os.path.exists", "line_number": 53, "usage_type": "call" }, { "api_name": "os.path", "line_number": 53, "usage_type": "attribute" }, { "api_name": "autotrain.dataset.AutoTrainDataset", "line_number": 54, "usage_type": "call" }, { "api_name": "os.pat...
26288548627
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Author', fields=[ ('id', models.AutoField(verbo...
pazell981/quoter
apps/view_quotes/migrations/0001_initial.py
0001_initial.py
py
1,335
python
en
code
0
github-code
7
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.CreateModel", "line_number": 13, "usage_type": "call" }, ...
17247639009
import functools as _f __all__ = [ 'area', 'bbox', 'bounding_box', 'centroid', 'holes', 'len', 'parts', 'perimeter', 'segments', 'vertices'] def get_attr(df, geom_col='geometry', inplace=False, attr=None): outval = df[geom_col].apply(lambda x: x.__getattribute__(attr)) if inplace: outcol ...
stiles/notebooks
lapd-crimes-arrests/notebook/lib/python3.7/site-packages/pysal/lib/cg/ops/_accessors.py
_accessors.py
py
1,368
python
en
code
24
github-code
7
[ { "api_name": "functools.partial", "line_number": 42, "usage_type": "call" } ]
70352732063
import cv2 import numpy as np import glob CHECKBOARD = (6,9) criteria = (cv2.TermCriteria_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 0.001) object_points = [] image_points = [] # define 3d coordinate of chessboard points. chessboard is in center coordinate and camera moving around it # we consider every square in chess...
saeed5959/computer_vision
camera_calibration/python_code/main.py
main.py
py
1,391
python
en
code
0
github-code
7
[ { "api_name": "cv2.TermCriteria_EPS", "line_number": 7, "usage_type": "attribute" }, { "api_name": "cv2.TERM_CRITERIA_MAX_ITER", "line_number": 7, "usage_type": "attribute" }, { "api_name": "numpy.zeros", "line_number": 14, "usage_type": "call" }, { "api_name": "n...
74116291744
import logging as log import time import streamlit as st from screens import display_upload_screen, display_download_screen import json import numpy as np from common.utils import ( rabbit_connect_and_make_channel, is_production, pg_connect_and_make_cursor, insert_into_sessions, insert_into_schedul...
domcermak/neural_style_transfer
upload_app/__init__.py
__init__.py
py
4,115
python
en
code
0
github-code
7
[ { "api_name": "streamlit.session_state", "line_number": 19, "usage_type": "attribute" }, { "api_name": "common.utils.rabbit_connect_and_make_channel", "line_number": 20, "usage_type": "call" }, { "api_name": "streamlit.session_state", "line_number": 23, "usage_type": "att...
19185076535
from typing import List # assume all rows are of equal length # and feature scale each column to be in the range 0 - 1 def normalize_by_feature_scaling(dataset: List[List[float]]) -> None: for col_num in range(len(dataset[0])): column: List[float] = [row[col_num] for row in dataset] maximum = max(...
rwang5688/ml_rwang5688
cs/fsnn/normalization.py
normalization.py
py
503
python
en
code
0
github-code
7
[ { "api_name": "typing.List", "line_number": 6, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 8, "usage_type": "name" } ]
37910809296
import requests import time import math import pytz import sys import pandas as pd import openpyxl import json import os from datetime import datetime, timedelta from dateutil.parser import parse as parseDate from bs4 import BeautifulSoup from .valid_filename import slugify import email from io import StringIO class ...
rajesh-sec/insightappsec
lib/insightappsec.py
insightappsec.py
py
19,346
python
en
code
0
github-code
7
[ { "api_name": "requests.request", "line_number": 83, "usage_type": "call" }, { "api_name": "math.ceil", "line_number": 85, "usage_type": "call" }, { "api_name": "time.time", "line_number": 85, "usage_type": "call" }, { "api_name": "pytz.timezone", "line_number...
27765619619
from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import threading from googlecloudsdk.core import log from googlecloudsdk.core.util import keyboard_interrupt import six class MashHandler(object): """MashHandler only invokes its base handler once. On...
twistedpair/google-cloud-sdk
google-cloud-sdk/lib/googlecloudsdk/command_lib/cloudbuild/execution.py
execution.py
py
2,960
python
en
code
55
github-code
7
[ { "api_name": "threading.Lock", "line_number": 21, "usage_type": "call" }, { "api_name": "googlecloudsdk.core.util.keyboard_interrupt.HandleInterrupt", "line_number": 35, "usage_type": "call" }, { "api_name": "googlecloudsdk.core.util.keyboard_interrupt", "line_number": 35, ...
9819949046
import pandas teploty = pandas.read_csv("temperature.csv") import pytemperature import matplotlib.pyplot as plt # na stupně Celsia teploty["AvgTemperatureC"] = pytemperature.f2c(teploty["AvgTemperature"]) mihelto = teploty[(teploty["City"] == "Miami Beach") | (teploty["City"] == "Helsinki") | (teploty["City"] == "Tok...
KristynaSodomkova/python-012021
7/ukoly7/ukol35.py
ukol35.py
py
585
python
en
code
0
github-code
7
[ { "api_name": "pandas.read_csv", "line_number": 2, "usage_type": "call" }, { "api_name": "pytemperature.f2c", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.show", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pyp...
41210487189
# External imports import datetime import pytz import time # Internal imports from soup import Soup, SoupParser from game import GameState from lines import LineGenerator class Scraper: # Key assumptions: # 1) Games can't move backward in time. # If we have a in-memory game object that is final a...
sbconlon/mlb-scraper
scraper.py
scraper.py
py
15,025
python
en
code
0
github-code
7
[ { "api_name": "game.start_time", "line_number": 81, "usage_type": "attribute" }, { "api_name": "game.GameState.new_game_id", "line_number": 83, "usage_type": "call" }, { "api_name": "game.GameState", "line_number": 83, "usage_type": "name" }, { "api_name": "game.G...
27528138349
import logging from django.shortcuts import render from django.contrib.auth.decorators import login_required from django.contrib.auth import get_user_model from .models import (AccountProjectModel, AccountModel, AccountPermissionsModel, AccountDevicesModel, AccountParameterModel, AccountTagOPCMode...
bridgecrew-perf6/AgavaDeploying
agava/app/account/views.py
views.py
py
12,050
python
en
code
0
github-code
7
[ { "api_name": "models.AccountModel.users.get", "line_number": 17, "usage_type": "call" }, { "api_name": "models.AccountModel.users", "line_number": 17, "usage_type": "attribute" }, { "api_name": "models.AccountModel", "line_number": 17, "usage_type": "name" }, { "...
23221685154
from sklearn.datasets import load_iris import pandas as pd from sklearn.neighbors import KNeighborsClassifier from sklearn.model_selection import train_test_split from sklearn import metrics import pickle def train_model(): # import data iris = load_iris() # Split dataset into X and y X = iris.data ...
GraphtyLove/API-SIMPLE-DEMO
training/train.py
train.py
py
1,013
python
en
code
0
github-code
7
[ { "api_name": "sklearn.datasets.load_iris", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 18, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 19, "usage_type": "call" }, { "api_name": "sklearn....
977867938
from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from pydantic import BaseModel from escpos import * from fastapi.responses import JSONResponse from typing import Optional app = FastAPI() origins = ['*'] p = printer.Serial("COM5") app.add_middleware( CORSMiddleware, ...
exyt-team/local-print
print-server.py
print-server.py
py
1,550
python
en
code
0
github-code
7
[ { "api_name": "fastapi.FastAPI", "line_number": 8, "usage_type": "call" }, { "api_name": "fastapi.middleware.cors.CORSMiddleware", "line_number": 14, "usage_type": "argument" }, { "api_name": "pydantic.BaseModel", "line_number": 21, "usage_type": "name" }, { "api_...
16091135379
import numpy as np from collections import defaultdict from lib.ep_libutil import exec_timer, ep_rtcfg from postproc.provider import DataProvider, pack from lib.ep_libutil import combine_2_spec, combine_2_emis, combine_model_emis, combine_model_spec import lib.ep_logging log = lib.ep_logging.Logger(__name__) class Em...
FUME-dev/fume
client/postproc/emissprovider.py
emissprovider.py
py
26,406
python
en
code
3
github-code
7
[ { "api_name": "lib.ep_libutil.ep_logging.Logger", "line_number": 7, "usage_type": "call" }, { "api_name": "lib.ep_libutil.ep_logging", "line_number": 7, "usage_type": "attribute" }, { "api_name": "lib.ep_libutil", "line_number": 7, "usage_type": "name" }, { "api_n...
28534367905
import configparser from typing import Optional from pathlib import Path class GitRepository: """ A git repository """ worktree: Path = None gitdir: Path = None conf: configparser.ConfigParser = None def __init__(self, path, force=False): self.worktree: Path = path self.g...
danthelion/gitx
lib/repo.py
repo.py
py
3,631
python
en
code
0
github-code
7
[ { "api_name": "pathlib.Path", "line_number": 11, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 12, "usage_type": "name" }, { "api_name": "configparser.ConfigParser", "line_number": 13, "usage_type": "attribute" }, { "api_name": "pathlib.Path...
16797015443
import time import requests import json #第一步读取八行包内容 # 以下为固定内容 # POST /wisdomprovider/router? HTTP/1.1 # Content-Length: 373 # Host: wisdom.tskjxy.com.cn # Connection: Keep-Alive # Accept-Encoding: gzip # content-type: application/x-www-form-urlencoded;charset=utf8 class Openua: config = "123" def __init__(self...
li-longana/qianghong
python/fs.py
fs.py
py
2,716
python
en
code
0
github-code
7
[ { "api_name": "time.time", "line_number": 21, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 27, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 42, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 43...
46109722313
from flask import Flask from flask_login import LoginManager from flask_sqlalchemy import SQLAlchemy import MySQLdb HOST = 'localhost' USER = 'root' PASSWORD = '' DATABASE = 'ultimate_meal_planner' app = Flask(__name__) app.config['SECRET_KEY'] = 'THIS IS THE BEST KEY I EVER HAD' #mysql = MySQLdb.connect(HOST, USER...
KIMARINELSON77109/database-project
app/__init__.py
__init__.py
py
924
python
en
code
1
github-code
7
[ { "api_name": "flask.Flask", "line_number": 13, "usage_type": "call" }, { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 19, "usage_type": "call" }, { "api_name": "flask_login.LoginManager", "line_number": 22, "usage_type": "call" } ]
15926348664
from flask import Flask, request from flask_restful import Resource, Api, reqparse from sqlalchemy import create_engine from charm.toolbox.pairinggroup import PairingGroup,G1,G2, ZR from flask_jsonpify import jsonify from kryptlib.ElGamalImpl import ElGamal from kryptlib.AGHOBlind import AGHOBlind connectionA = create...
AndreaKap/AGHO_Blind_kryptlib
BackendVoteAPI.py
BackendVoteAPI.py
py
17,268
python
en
code
0
github-code
7
[ { "api_name": "sqlalchemy.create_engine", "line_number": 9, "usage_type": "call" }, { "api_name": "sqlalchemy.create_engine", "line_number": 10, "usage_type": "call" }, { "api_name": "sqlalchemy.create_engine", "line_number": 11, "usage_type": "call" }, { "api_nam...
22941919628
import os,os.path from PIL import Image valid_images = [".jpg",".gif",".png",".tga"] img_dir = input("Enter image folder path: ") pdf_name = input("Enter pdf name: ") pdf_path = os.path.join(img_dir,pdf_name+".pdf") imagelist=[] path=[] i=0 for f in os.listdir(img_dir): ext = os.path.splitext(f)[1] ...
Kuttralanathan-K/Image2Pdf
img2pdf.py
img2pdf.py
py
1,263
python
en
code
0
github-code
7
[ { "api_name": "os.path.join", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.splitext", "line_numbe...
72705605662
from django.db import models import uuid from django.db.models.deletion import DO_NOTHING from django.db.models.fields import DateTimeField, DecimalField from users.models import User from cloudinary.models import CloudinaryField # Create your models here. class Account_type(models.Model): id = models.UUIDField( ...
yjrandom/Moolah-Matters
backend/account/models.py
models.py
py
3,017
python
en
code
0
github-code
7
[ { "api_name": "django.db.models.Model", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 9, "usage_type": "name" }, { "api_name": "django.db.models.UUIDField", "line_number": 10, "usage_type": "call" }, { "api_name": ...
21051191313
import datetime date_and_prod = { str(datetime.date(2022, 12, 1)): 'banana apple bread', str(datetime.date(2022, 12, 2)): 'milk snikers tea', str(datetime.date(2022, 12, 3)): 'meat cheese actimel', str(datetime.date(2022, 12, 4)): 'meat apple', str(datetime.date(2022, 12, 5)): 'tea sugar', ...
maxim-shestakov/myProjects
Проект по программированию.py
Проект по программированию.py
py
8,433
python
ru
code
0
github-code
7
[ { "api_name": "datetime.date", "line_number": 4, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 5, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 6, "usage_type": "call" }, { "api_name": "datetime.date", "line_numb...
23494066485
import json from multiprocessing import Pool import requests from . import celery from .libs.db import get_db from .libs.models import Model, Order, User from .libs.utils import submit_data, submit_train_task, error_response @celery.task def infer_task(url, data_sql, model_params, attributes, unique_id, order_id): ...
tanzeyy/fate_demo
server/application/tasks.py
tasks.py
py
5,414
python
en
code
1
github-code
7
[ { "api_name": "libs.db.get_db", "line_number": 15, "usage_type": "call" }, { "api_name": "libs.models.Order", "line_number": 16, "usage_type": "argument" }, { "api_name": "libs.models.Order.id", "line_number": 16, "usage_type": "attribute" }, { "api_name": "json.l...
72437738463
from datetime import datetime import sys, os from os import path from services import helper from services.batch_processor import BatchProcessor from services.logging import get_logger import pytz logger = get_logger() def extract_event(item): return item.get('_source') def execute_api_request(item): # lo...
andersoncontreira/file-batch-processor-python
main.py
main.py
py
2,979
python
en
code
0
github-code
7
[ { "api_name": "services.logging.get_logger", "line_number": 10, "usage_type": "call" }, { "api_name": "services.helper.datetime_format_for_lifecycle", "line_number": 20, "usage_type": "call" }, { "api_name": "services.helper", "line_number": 20, "usage_type": "name" }, ...
19881660016
# Importing the libraries import numpy as np import matplotlib.pyplot as plt import pandas as pd # Importing the dataset Dataset = pd.read_csv("lasvegas_tripadvisor.csv",header = 0) # check if the dataset contains missing values Dataset.isnull().any().any() # see the statistics and columns description of dataset Dat...
singh-utkarsh/tripAdvisorAnalysis
task-1.py
task-1.py
py
6,265
python
en
code
0
github-code
7
[ { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.median", "line_number": 44, "usage_type": "call" }, { "api_name": "pandas.get_dummies", "line_number": 49, "usage_type": "call" }, { "api_name": "sklearn.model_selectio...
3132732729
from decouple import Config, RepositoryEnv from unittest import TestCase from os.path import join, dirname from users import UsersTests API_URL: str = "http://localhost:8000" class APITestCase(TestCase): def setUp(self): APITestCase._prepare_db() self._users_tests = UsersTests(API_URL) @sta...
avigailrosenfeld/videos_backend
tests/api_test.py
api_test.py
py
656
python
en
code
0
github-code
7
[ { "api_name": "unittest.TestCase", "line_number": 10, "usage_type": "name" }, { "api_name": "users.UsersTests", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path.dirname", ...
6630418678
import pytesseract from pytesseract import Output import matplotlib.pyplot as plt import cv2 img = cv2.imread('./images/100.jpg') d = pytesseract.image_to_data(img, output_type=Output.DICT) n_boxes = len(d['level']) for i in range(n_boxes): (x, y, w, h) = (d['left'][i], d['top'][i], d['width'][i], d['height'][i]...
niteesh2268/Text-Recognition
YOLO/lib.py
lib.py
py
748
python
en
code
0
github-code
7
[ { "api_name": "cv2.imread", "line_number": 6, "usage_type": "call" }, { "api_name": "pytesseract.image_to_data", "line_number": 8, "usage_type": "call" }, { "api_name": "pytesseract.Output.DICT", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pytess...
71570527903
import itertools from datetime import datetime from flask import ( jsonify, request, current_app, Blueprint ) from sqlalchemy.exc import IntegrityError from sqlalchemy.orm.exc import NoResultFound from app.dao import notifications_dao from app.dao.dao_utils import dao_rollback from app.dao.api_key_dao...
govau/notify
api/app/service/rest.py
rest.py
py
34,710
python
en
code
17
github-code
7
[ { "api_name": "flask.Blueprint", "line_number": 120, "usage_type": "call" }, { "api_name": "app.errors.register_errors", "line_number": 122, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_number": 131, "usage_type": "call" }, { "api_name": "flask.cur...
70057163425
#1. Use getGeocodeLocation to get the latitude and longitude coordinates of the location string. #2. Use foursquare API to find a nearby restaurant with the latitude, longitude, and mealType strings. #HINT: format for url will be something like https://api.foursquare.com/v2/venues/search?client_id=CLIENT_ID&client_se...
el-dani-cortes/coursera_projects
working_published_APIs/findARestaurant.py
findARestaurant.py
py
3,838
python
en
code
0
github-code
7
[ { "api_name": "dotenv.dotenv_values", "line_number": 17, "usage_type": "call" }, { "api_name": "geocode.getGeocodeLocation", "line_number": 32, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 44, "usage_type": "call" }, { "api_name": "requests...
14432223139
from __future__ import annotations import typing import plotly import pandas as pd # pylint: disable=wrong-import-position if typing.TYPE_CHECKING: import BaseOpts import PlotUtilsPlotly import Utils import BaseDB from BaseLog import log_error, log_info from Plotting import plotmissionsingle @plotmissionsin...
iop-apl-uw/basestation3
Plotting/MissionIntSensors.py
MissionIntSensors.py
py
5,408
python
en
code
2
github-code
7
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 10, "usage_type": "attribute" }, { "api_name": "BaseOpts.BaseOptions", "line_number": 23, "usage_type": "attribute" }, { "api_name": "BaseLog.log_info", "line_number": 30, "usage_type": "call" }, { "api_name": "...
72865686622
from __future__ import division from typing import Iterator, Optional import torch from torch.utils.data import Dataset from torch.utils.data import DistributedSampler as _DistributedSampler from mmseg.core.utils import sync_random_seed from mmseg.utils import get_device class DistributedSampler(_DistributedSampler...
Ascend/ModelZoo-PyTorch
PyTorch/contrib/cv/semantic_segmentation/MMseg-swin/mmseg/datasets/samplers/distributed_sampler.py
distributed_sampler.py
py
2,927
python
en
code
31
github-code
7
[ { "api_name": "torch.utils.data.DistributedSampler", "line_number": 12, "usage_type": "name" }, { "api_name": "torch.utils.data.Dataset", "line_number": 30, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 31, "usage_type": "name" }, { "api_...
9617687943
from flask import Flask, request app = Flask(__name__) @app.route('/') @app.route('/hello') def hello(): return "Hello" if __name__ == "__main__": service_name = 'hello' service_port = 5000 consul_service = ConsulService() consul_service.setup(service_name, service_port, request.host) app.r...
milhcbt/microservice-training
demo08/hello/hello.py
hello.py
py
370
python
en
code
2
github-code
7
[ { "api_name": "flask.Flask", "line_number": 3, "usage_type": "call" }, { "api_name": "flask.request.host", "line_number": 15, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 15, "usage_type": "name" } ]
18907177926
""" Jumbotron Calibration. Figures out how the markers found by artoolkit map to the jumbotron screen. """ from __future__ import print_function import logging import math import operator from PIL import Image, ImageDraw from PIL.ExifTags import TAGS import artoolkit from vectypes import Mat4, Vec3 # ---------------...
mitmedialab/Junkyard-Jumbotron
python/calibrate.py
calibrate.py
py
12,062
python
en
code
200
github-code
7
[ { "api_name": "math.atan2", "line_number": 23, "usage_type": "call" }, { "api_name": "vectypes.Mat4.new_translate", "line_number": 24, "usage_type": "call" }, { "api_name": "vectypes.Mat4", "line_number": 24, "usage_type": "name" }, { "api_name": "vectypes.Mat4.ne...
12231057863
import os from flask import Flask, request, redirect, render_template from lib.database_connection import get_flask_database_connection from lib.album_repository import AlbumRepository from lib.album import Album from lib.artist_repository import ArtistRepository from lib.artist import Artist # Create a new Flask app a...
ilhaam-start/music_web_app_html
app.py
app.py
py
3,046
python
en
code
0
github-code
7
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "lib.database_connection.get_flask_database_connection", "line_number": 16, "usage_type": "call" }, { "api_name": "lib.album_repository.AlbumRepository", "line_number": 17, "usage_type": ...
71633617503
from django.contrib.auth import login, logout from django.contrib.auth.decorators import login_required from django.core.exceptions import NON_FIELD_ERRORS from django.http import HttpResponseRedirect, Http404 from django.shortcuts import render, redirect from users.forms import RegistrationForm, LoginForm, SettingsFo...
Gliger13/auction_site
auction/users/views.py
views.py
py
3,548
python
en
code
1
github-code
7
[ { "api_name": "users.forms.RegistrationForm", "line_number": 13, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 14, "usage_type": "call" }, { "api_name": "users.forms.RegistrationForm", "line_number": 16, "usage_type": "call" }, { ...
24954079981
from forex_python.converter import CurrencyRates import requests def convert_brl_btc(amount): c = CurrencyRates() bitcoin_api_url = 'https://api.coinbase.com/v2/prices/spot?currency=USD' response = requests.get(bitcoin_api_url) response_json = response.json() usd_blr = c.get_rate('USD', 'BRL') ...
JoaoZati/django_devpro
base/bitcoin.py
bitcoin.py
py
516
python
en
code
0
github-code
7
[ { "api_name": "forex_python.converter.CurrencyRates", "line_number": 6, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 9, "usage_type": "call" } ]
40246557964
from odoo import models, fields, api from odoo.exceptions import UserError import logging _logger = logging.getLogger(__name__) class LinkPickingPurchase(models.TransientModel): _name = 'link.picking.purchase' def _default_picking(self): return self.env['stock.picking'].browse(self._context.get('active_id')) ...
mesiboku/omni_gh
omni_goodheart_stock_po_link/wizard/link_picking_purchase_view.py
link_picking_purchase_view.py
py
1,178
python
en
code
0
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "odoo.models.TransientModel", "line_number": 8, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 8, "usage_type": "name" }, { "api_name": "odoo.field...
24331404305
from pymongo import MongoClient from pprint import pprint from bson.json_util import loads import json import datetime client = MongoClient() db = client.pegasus teachers = db.teachers classes = db.classes counters = db.counters def create_teacher(name): teacher_ID = counters.find_one().get("teachers") # Get mo...
JosephYusufov/Pegasus
backend/teacher.py
teacher.py
py
2,048
python
en
code
0
github-code
7
[ { "api_name": "pymongo.MongoClient", "line_number": 8, "usage_type": "call" } ]
45920472598
from os import path, getcwd, chdir, pardir, walk, mkdir, sep, listdir from functools import reduce import xml.dom.minidom as minidom import json import fnmatch def findBlockId(xml_file, searchId): """Parsen der Database nach bestimmten Informationen""" # Definition WorkingDirectory = Current Directory wor...
syedemz/AdminShell2
DATABASE_EXTERN/external_database_functions.py
external_database_functions.py
py
9,842
python
en
code
0
github-code
7
[ { "api_name": "os.getcwd", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "name" }, { "api_name": "xml.dom.minidom.parse", "line_numb...
42886192950
from typing import List class Solution: def criticalConnections(self, n: int, connections: List[List[int]]) -> List[List[int]]: graph = [[] for _ in range(n)] low = [0 for _ in range(n)] visited = [False for _ in range(n)] for x, y in connections: graph[x].append(y) ...
hyeonjun/AlgorithmTest
leetcode/1192_Critical_Connections_in_a_Network.py
1192_Critical_Connections_in_a_Network.py
py
838
python
en
code
1
github-code
7
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" } ]
15564371414
import numpy as np import cv2 import matplotlib.pyplot as plt # Define a class to receive the characteristics of each line detection class Line(): def __init__(self): # was the line detected in the last iteration? self.detected = False # x values of the last n fits of the line ...
nachoSO/CarND-Advanced-Lane-Lines-master
line_finding.py
line_finding.py
py
9,315
python
en
code
0
github-code
7
[ { "api_name": "numpy.array", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.int", "line_number": 35, ...
32075518731
#!/usr/bin/env python3 # Start by getting signal metrics import logging import logging.handlers import os import platform import sys import tailer from parse import * from tmo_monitor.gateway.model import GatewayModel from tmo_monitor.configuration import Configuration from tmo_monitor.gateway.arcadyan import CubeContr...
highvolt-dev/tmo-monitor
bin/tmo-monitor.py
tmo-monitor.py
py
7,858
python
en
code
85
github-code
7
[ { "api_name": "tmo_monitor.configuration.Configuration", "line_number": 19, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 23, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 24, "usage_type": "attribute" }, { "api_...
40416584705
import cv2 import librosa import numpy as np from moviepy.video.io.VideoFileClip import VideoFileClip from moviepy.editor import AudioFileClip from PIL import Image global_save_path = '.\\Frame\\' def saveFrames(pathToVideo, frame_number, num_frames_to_save, save_path=global_save_path): cap = cv2.VideoCaptu...
OLoloms/Working_with_video_file_frames
cut_download.py
cut_download.py
py
2,392
python
en
code
0
github-code
7
[ { "api_name": "cv2.VideoCapture", "line_number": 17, "usage_type": "call" }, { "api_name": "cv2.CAP_PROP_POS_FRAMES", "line_number": 20, "usage_type": "attribute" }, { "api_name": "moviepy.video.io.VideoFileClip.VideoFileClip", "line_number": 23, "usage_type": "call" },...
3132678929
from celery import Celery import subprocess celery_app = Celery('tasks', broker='redis://localhost:6379/0', backend='redis://localhost:6379/0') @celery_app.task def take_thumbnail(video_input_path: str, img_output_path: str) -> None: try: proc = subprocess.Popen(['ffmpeg', '-i', video...
avigailrosenfeld/videos_backend
async_tasks/tasks.py
tasks.py
py
848
python
en
code
0
github-code
7
[ { "api_name": "celery.Celery", "line_number": 4, "usage_type": "call" }, { "api_name": "subprocess.Popen", "line_number": 11, "usage_type": "call" }, { "api_name": "subprocess.PIPE", "line_number": 12, "usage_type": "attribute" }, { "api_name": "subprocess.CalledP...