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
71935445663
import datetime import hashlib import http.client import os.path import textwrap import unittest from unittest import mock # pylint: disable=wrong-import-order, import-error from dulwich.objects import Tree # pylint: enable=wrong-import-order, import-error from cros.factory.hwid.service.appengine import git_util from...
arccode/factory
py/hwid/service/appengine/git_util_test.py
git_util_test.py
py
10,430
python
en
code
3
github-code
7
[ { "api_name": "unittest.TestCase", "line_number": 18, "usage_type": "attribute" }, { "api_name": "cros.factory.hwid.service.appengine.git_util.MemoryRepo", "line_number": 26, "usage_type": "call" }, { "api_name": "cros.factory.hwid.service.appengine.git_util", "line_number": ...
20107622704
import numpy as np import io import logging import time from pydub import AudioSegment from voice_assistant_basic import VoiceAssistantBasic import telegram_bot import fire class VoiceAssistantTelegram(VoiceAssistantBasic): """ The VoiceAssistantTelegram class extends VoiceAssistantBasic and provides a Te...
analyst20172018/voice_assistant
voice_assistant/voice_assistant_telegram.py
voice_assistant_telegram.py
py
6,915
python
en
code
0
github-code
7
[ { "api_name": "voice_assistant_basic.VoiceAssistantBasic", "line_number": 11, "usage_type": "name" }, { "api_name": "logging.DEBUG", "line_number": 31, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 35, "usage_type": "call" }, { "ap...
70496903582
"""============================================================================= Train a deep CCA model. =============================================================================""" import argparse import time import torch import torch.utils.data from torch import optim import cuda from data import loader fr...
KaiqianZhang/dpcca_v8
scripts/traindcca.py
traindcca.py
py
4,125
python
en
code
1
github-code
7
[ { "api_name": "torch.mm", "line_number": 22, "usage_type": "attribute" }, { "api_name": "cuda.device", "line_number": 23, "usage_type": "call" }, { "api_name": "time.time", "line_number": 31, "usage_type": "call" }, { "api_name": "pprint.set_logfiles", "line_n...
38196078423
from django.shortcuts import render from .models import Entry def main(request): if request.user.is_staff: is_admin = True else: is_admin = False return render(request, 'pages/main.html', {'is_admin': is_admin}) def table(request): entries = Entry.objects.all() if request.user.is...
dayterr/wordformsdb
wordformsdb/pages/views.py
views.py
py
478
python
en
code
0
github-code
7
[ { "api_name": "django.shortcuts.render", "line_number": 11, "usage_type": "call" }, { "api_name": "models.Entry.objects.all", "line_number": 14, "usage_type": "call" }, { "api_name": "models.Entry.objects", "line_number": 14, "usage_type": "attribute" }, { "api_na...
42444169455
from collections import OrderedDict def main(): #A list of sport teams with wins and loses sportTeams = [("Rovals", (10, 12)), ("Dragons", (20, 12)), ("Cats", (3, 12)), ("Blakes", (31, 10)), ("Rockets", (10, 9))] sortedTeams = sorted(sportTeams, key=lambda t: t[1][0], reverse=True) ...
indikaimk/learn_python
advanced/ordered_dict.py
ordered_dict.py
py
880
python
en
code
0
github-code
7
[ { "api_name": "collections.OrderedDict", "line_number": 10, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 24, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 25, "usage_type": "call" } ]
13111640120
#~*~ coding: utf-8 ~*~ from django.shortcuts import render, redirect from django.contrib.auth.decorators import login_required from django.contrib.auth import authenticate, login, logout from django.contrib.auth.models import User from virtenviro.registration.models import UserProfile from virtenviro.registration.forms...
Schturmfogel/virtenviro
virtenviro/registration/views.py
views.py
py
2,404
python
en
code
0
github-code
7
[ { "api_name": "django.contrib.auth.models.User", "line_number": 12, "usage_type": "call" }, { "api_name": "virtenviro.registration.models.UserProfile", "line_number": 13, "usage_type": "call" }, { "api_name": "virtenviro.registration.forms.UserForm", "line_number": 15, "u...
5615680799
import random import sys from pynput.keyboard import Key, Controller import chess import time import re from urllib.request import urlopen #from moves import get_best_move from moves import get_best_move from ctypes import * ## C STUFF so_file = "./board.so" c_funcs = CDLL(so_file) c_funcs.hax.restype = c_funcs.hax...
tormobr/li_fish
lichess/scraper.py
scraper.py
py
2,520
python
en
code
0
github-code
7
[ { "api_name": "pynput.keyboard.Controller", "line_number": 22, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 24, "usage_type": "attribute" }, { "api_name": "chess.Board", "line_number": 27, "usage_type": "call" }, { "api_name": "time.sleep", ...
1414611048
from langchain.text_splitter import RecursiveCharacterTextSplitter from langchain.document_loaders import PyPDFLoader from langchain.document_loaders import ReadTheDocsLoader from langchain.document_loaders import Docx2txtLoader from langchain.document_loaders import UnstructuredWordDocumentLoader from langchain.embedd...
faizan1041/doc-understanding-gpt-langchain
local_vector_store.py
local_vector_store.py
py
2,029
python
en
code
1
github-code
7
[ { "api_name": "hashlib.md5", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_numb...
8124199948
import numpy import os import sys import csv import scipy.io import pickle import time import datetime import glob import numpy import cv2 from sklearn.cluster import KMeans ### def BGR2HSV(image): image_hsv = cv2.cvtColor(image, cv2.COLOR_BGR2HSV) * 1. image_hsv[:,:,0] /= 180. image_hsv[:,:,1] /= 255. ...
satoshi-kosugi/crowd-powered
datasetAcquisition.py
datasetAcquisition.py
py
3,582
python
en
code
2
github-code
7
[ { "api_name": "cv2.cvtColor", "line_number": 17, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2HSV", "line_number": 17, "usage_type": "attribute" }, { "api_name": "cv2.cvtColor", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.uint8", "l...
10042395997
''' Nombre: Jonathan Granillo Robledo Grupo: 21 Fecha:25/02/2021 Descripción: la computadora aprendera a diferenciar entre un iphone 12 y un samsung s21 ultra ''' import requests # This function will pass your text to the machine learning model # and return the top result with the highest confidence def clasificar(tex...
jonathan966/poo-1720110004
semana6/smartphone.py
smartphone.py
py
1,140
python
en
code
0
github-code
7
[ { "api_name": "requests.get", "line_number": 15, "usage_type": "call" } ]
9317849786
from __future__ import absolute_import import inspect import os import psutil from collections import namedtuple from pikos._internal.trace_functions import TraceFunctions from pikos._internal.keep_track import KeepTrack LINE_MEMORY_RECORD = ( 'index', 'function', 'lineNo', 'RSS', 'VMS', 'line', 'filename') ...
fabianp/pikos
pikos/monitors/line_memory_monitor.py
line_memory_monitor.py
py
4,343
python
en
code
0
github-code
7
[ { "api_name": "collections.namedtuple", "line_number": 19, "usage_type": "call" }, { "api_name": "os.linesep", "line_number": 27, "usage_type": "attribute" }, { "api_name": "os.linesep", "line_number": 31, "usage_type": "attribute" }, { "api_name": "pikos._interna...
11628032545
from api.router import api_router from fastapi import FastAPI from fastapi_pagination import add_pagination def get_app() -> FastAPI: """ Get FastAPI application. This is the main constructor of an application. :return: application. """ app = FastAPI( title="🏢 Inventory Managment", ...
IMaG1337/inventory_managment
app/core/app.py
app.py
py
593
python
en
code
0
github-code
7
[ { "api_name": "fastapi.FastAPI", "line_number": 14, "usage_type": "call" }, { "api_name": "fastapi_pagination.add_pagination", "line_number": 22, "usage_type": "call" }, { "api_name": "api.router.api_router", "line_number": 23, "usage_type": "name" }, { "api_name"...
28030867157
import pyshark import argparse import sys import os from configuration import change_config_file, config_reader class Parser: def run_arguments(self): global args, parser parser = argparse.ArgumentParser(description="Check traffic") group = parser.add_mutually_exclusive_group() gro...
Geulmaster/NetworkShark
cli.py
cli.py
py
1,656
python
en
code
0
github-code
7
[ { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "configuration.config_reader", "line_number": 21, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 25, "usage_type": "attribute" }, { "api_name": "con...
11022731437
import os from flask import Flask from flask_sqlalchemy import SQLAlchemy from flask_migrate import Migrate import logging db = SQLAlchemy() migrate = Migrate() def create_app(): app = Flask(__name__) app.config["SQLALCHEMY_DATABASE_URI"] = os.environ.get("DATABASE_URL") db.init_app(app) migrate.init_...
alexrothos/project_up
app/__init__.py
__init__.py
py
878
python
en
code
0
github-code
7
[ { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 7, "usage_type": "call" }, { "api_name": "flask_migrate.Migrate", "line_number": 8, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "os.enviro...
7941228839
import cv2 from networktables import NetworkTables from grip import GripPipeline def extra_processing(pipeline): center_x = [] center_y = [] widths =[] heights = [] align = 0 for contour in pipeline.filter_contours_output: #Determines the bounding boxes around the target contours ...
Talon540/Camera-Tracking-2017
track.py
track.py
py
2,148
python
en
code
0
github-code
7
[ { "api_name": "cv2.boundingRect", "line_number": 15, "usage_type": "call" }, { "api_name": "networktables.NetworkTables.getTable", "line_number": 45, "usage_type": "call" }, { "api_name": "networktables.NetworkTables", "line_number": 45, "usage_type": "name" }, { ...
35770491964
import pandas import re import numpy as np from nltk import tokenize from nltk.corpus import stopwords import string from tensorflow.keras.preprocessing.text import Tokenizer from tensorflow.keras.preprocessing.sequence import pad_sequences import tensorflow as tf class AITA_Generator(tf.keras.utils.Sequence): d...
MalcolmMielle/AITA_tensorflow
utils/get_data.py
get_data.py
py
2,887
python
en
code
0
github-code
7
[ { "api_name": "tensorflow.keras", "line_number": 12, "usage_type": "attribute" }, { "api_name": "numpy.ceil", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.int", "line_number": 20, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", ...
22654165097
from typing import Any, Dict from theseus.base.metrics.metric_template import Metric from theseus.base.utilities.logits import logits2labels class Accuracy(Metric): """ Accuracy metric """ def __init__(self, label_type: str = "multiclass", **kwargs): super().__init__(**kwargs) self.t...
kaylode/theseus
theseus/base/metrics/accuracy.py
accuracy.py
py
1,085
python
en
code
30
github-code
7
[ { "api_name": "theseus.base.metrics.metric_template.Metric", "line_number": 7, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 18, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 18, "usage_type": "name" }, { "api_name": "the...
5576993305
from django.urls import path from .views import * from .forms import CustomAuthForm app_name = 'accounts' urlpatterns = [ path('signup/', SignupView.as_view(), name='signup'), path('signup/resend-email', ResendActivationView.as_view(), name='resend-email'), path('login/', CLoginView.as_view(authentication...
someonecoding/cod3folio
accounts/urls.py
urls.py
py
1,378
python
en
code
0
github-code
7
[ { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 10, "usage_type": "call" }, { "api_name": "forms.CustomAuthForm...
17139979734
import imp from core.base import BaseClass, exc_handler import requests from secrets import mail_host, api_key, mail_from, attach_name, cancel_message, apply_message from pprint import pprint from models.schemes import Meeting class DBNotificationController(BaseClass): def __init__(self): BaseClass.__ini...
pashkatrick/meetty
core/notification_controller.py
notification_controller.py
py
1,521
python
en
code
0
github-code
7
[ { "api_name": "core.base.BaseClass", "line_number": 9, "usage_type": "name" }, { "api_name": "core.base.BaseClass.__init__", "line_number": 12, "usage_type": "call" }, { "api_name": "core.base.BaseClass", "line_number": 12, "usage_type": "name" }, { "api_name": "s...
21345657544
import asyncio import click import urllib import wave import numpy as np from typing import Optional, List from nptyping import NDArray from pydantic import BaseSettings from metta import SourceConfig, SourceProcessor, NewMessage, time_utils class Authorization(BaseSettings): TYPE: str = "Bearer" VALUE: str...
dream3d-ai/metta-python
metta/processors/audio/url_audio_source.py
url_audio_source.py
py
2,045
python
en
code
0
github-code
7
[ { "api_name": "pydantic.BaseSettings", "line_number": 14, "usage_type": "name" }, { "api_name": "metta.SourceConfig", "line_number": 19, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 22, "usage_type": "name" }, { "api_name": "metta.Source...
27745737770
import numpy as np import sympy as sym from sympy.utilities.autowrap import ufuncify # constants # cart mass m1 = 1.0 # pole mass m2 = 0.3 # pole length l = 0.5 # gravity g = 9.81 #symbolic equations #using x=q1 theta=q2 v=q.1 omega=q.2 x = sym.Symbol("x") theta = sym.Symbol("theta") v = sym.Symbol("v") omega...
NoNotCar/LapyMiniProject
dynamics.py
dynamics.py
py
1,311
python
en
code
0
github-code
7
[ { "api_name": "sympy.Symbol", "line_number": 25, "usage_type": "call" }, { "api_name": "sympy.Symbol", "line_number": 26, "usage_type": "call" }, { "api_name": "sympy.Symbol", "line_number": 27, "usage_type": "call" }, { "api_name": "sympy.Symbol", "line_numbe...
11981331706
import asyncio from playground.network.packet import PacketType from playground.network.packet.fieldtypes import INT, BOOL import random class PlaneClient(asyncio.Protocol): def __init__(self): self.transport = None def connection_made(self, transport): print("client connected") self.t...
dansmillie/netsec
netsec_fall2017/lab_1d/client.py
client.py
py
1,285
python
en
code
0
github-code
7
[ { "api_name": "asyncio.Protocol", "line_number": 6, "usage_type": "attribute" }, { "api_name": "playground.network.packet.PacketType.Deserializer", "line_number": 13, "usage_type": "call" }, { "api_name": "playground.network.packet.PacketType", "line_number": 13, "usage_t...
12089945843
from lib import BuildTask from tempfile import NamedTemporaryFile from humanize import naturalsize class MyTask(BuildTask): def __init__(self): super().__init__(self) self.extra_parsers = [['-t', '--target']] def handler(): """do my thing""" with NamedTemporaryFile(delete_on_c...
cloud-gov/pages-cf-build-tasks
tasks/example/definition.py
definition.py
py
435
python
en
code
0
github-code
7
[ { "api_name": "lib.BuildTask", "line_number": 6, "usage_type": "name" }, { "api_name": "tempfile.NamedTemporaryFile", "line_number": 13, "usage_type": "call" }, { "api_name": "humanize.naturalsize", "line_number": 14, "usage_type": "call" } ]
23373782992
#PIPELINE GALO VERSION JON #!/usr/bin/env python # Standard library imports import os import sys import re import argparse import subprocess import pandas as pd import numpy as np def get_arguments(): parser = argparse.ArgumentParser(prog = 'snp_covid19.py', description = 'Pipeline to do variant calling with ...
JonDoe3389/sarscov2_analysis
snp_covid_final.py
snp_covid_final.py
py
34,519
python
en
code
0
github-code
7
[ { "api_name": "argparse.ArgumentParser", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 47, "usage_type": "call" }, { "api_name": "os.path", "line_number": 47, "usage_type": "attribute" }, { "api_name": "os.walk", "l...
74578323424
import copy import csv import ctypes import logging import os import smtplib import time from email.mime.application import MIMEApplication from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from email.utils import COMMASPACE, formatdate from datetime import datetime, date from os.path ...
aryankeshri/Desktop_application_catcher
tracker_email.py
tracker_email.py
py
6,363
python
en
code
0
github-code
7
[ { "api_name": "logging.FileHandler", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.Formatter", "line_number": 17, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 19, "usage_type": "call" }, { "api_name": "os.environ.ge...
73911036062
""" The read4 API is already defined for you. @param buf, a list of characters @return an integer def read4(buf): # Below is an example of how the read4 API can be called. file = File("abcdefghijk") # File is "abcdefghijk", initially file pointer (fp) points to 'a' buf = [' '] * 4 # Create buffer with eno...
cs-cordero/interview-prep
leetcode/0158_read_n_characters_given_read4_ii.py
0158_read_n_characters_given_read4_ii.py
py
1,255
python
en
code
9
github-code
7
[ { "api_name": "collections.deque", "line_number": 26, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 28, "usage_type": "name" } ]
12738698575
from flask import Flask, render_template, request from flask_wtf import FlaskForm from wtforms import StringField, SubmitField from wtforms.validators import DataRequired from requests import get import urllib.parse import languages app = Flask("Flask-2") app.config['SECRET_KEY'] = "sg16hs6h9ilm738fr5sgh54fkp0sw" cl...
IonShieldQuad/Flask-2
__main__.py
__main__.py
py
1,580
python
en
code
0
github-code
7
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "flask_wtf.FlaskForm", "line_number": 13, "usage_type": "name" }, { "api_name": "wtforms.StringField", "line_number": 14, "usage_type": "call" }, { "api_name": "wtforms.validators...
71363501663
from os import mkdir from datetime import datetime from behave.__main__ import main as behave_main from argparse import ArgumentParser parser = ArgumentParser() parser.add_argument("-t", "--tags", default=None, help="Desired tags to run, multiple tags logic not implemented now") args = parser.parse_args() tags = arg...
k37j/assigment_python
libs/runners/BehaveRunner.py
BehaveRunner.py
py
685
python
en
code
0
github-code
7
[ { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 19, "usage_type": "name" }, { "api_name": "behave...
22479288196
import numpy as np #matris işlemleri için kullanılır. from sklearn.preprocessing import LabelBinarizer #etiketleri binarize etmek için kullanılan kütüphanedir. #Labellar binarize edilir ve sonuç döndürülür. def labels(): LABELS = ["CARDBOARD", "GLASS", "METAL", "PAPER", "PLASTIC", "TRASH"] labels = np.array(LA...
SerhatTurann/TezCalismalari
hafta4/GarbageTest/Tools.py
Tools.py
py
714
python
tr
code
0
github-code
7
[ { "api_name": "numpy.array", "line_number": 8, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.LabelBinarizer", "line_number": 9, "usage_type": "call" } ]
74205759582
# 信号量 Semaphore # 互斥锁,同时只允许一个进程更改数据 # Semaphore 信号量是同时允许一定数量的线程更改数据 # from multiprocessing import Process, Semaphore import time import random def run(sem, user): sem.acquire() print('%s 进程' % user) time.sleep(random.randint(0, 3)) sem.release() if __name__ == '__main__': sem = Semaphore(3)...
labulakalia/note
python_notes/一些代码/线程进程协程/进程/sem_process.py
sem_process.py
py
763
python
zh
code
0
github-code
7
[ { "api_name": "time.sleep", "line_number": 15, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 15, "usage_type": "call" }, { "api_name": "multiprocessing.Semaphore", "line_number": 20, "usage_type": "call" }, { "api_name": "multiprocessing.P...
37524288637
import math import torch import torch.nn as nn from torch import Tensor from torch.nn.parameter import Parameter import torch.nn.functional as F class NormalizedLinear(nn.Module): r"""Normalized linear layer which was proposed by Jiaqi Wang et. al. in their technical report for LVIS workshop at ECCV 202...
zhaoyue-zephyrus/TeSTra
src/rekognition_online_action_detection/models/normalized_linear.py
normalized_linear.py
py
2,021
python
en
code
82
github-code
7
[ { "api_name": "torch.nn.Module", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 10, "usage_type": "name" }, { "api_name": "torch.Tensor", "line_number": 24, "usage_type": "name" }, { "api_name": "torch.nn.parameter.Paramet...
41849176577
# Exercise 2.5 - 1 # title : Performance of search algorithm # version : 2022.03.02. # author : kobong import random import timeit from typing import List, Tuple, TypeVar from generic_search import linear_contains, binary_contains # Datatype modification Codon = List[int] # Codon Type Alias Gene = List[Codon] #...
meticulousdev/ClassicComputerScienceProblemsInPython
Chapter02/2022/list_search_million.py
list_search_million.py
py
1,531
python
en
code
3
github-code
7
[ { "api_name": "typing.List", "line_number": 12, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 13, "usage_type": "name" }, { "api_name": "typing.TypeVar", "line_number": 16, "usage_type": "call" }, { "api_name": "typing.List", "line_number...
17577180148
from typing import List from fastapi import APIRouter, Depends from hotels.repository import RepositoryHotels, RepositoryRooms from hotels.shemas import SHotel, SRoom from datetime import date from users.permission import current_user from users.databaseseq import User from fastapi_cache.decorator import cache ...
pavelepanov/hotel_pet
src/hotels/router.py
router.py
py
1,423
python
en
code
2
github-code
7
[ { "api_name": "fastapi.APIRouter", "line_number": 17, "usage_type": "call" }, { "api_name": "users.databaseseq.User", "line_number": 25, "usage_type": "name" }, { "api_name": "fastapi.Depends", "line_number": 25, "usage_type": "call" }, { "api_name": "users.permis...
71448590303
import numpy as np import pyqtgraph as pg import h5py from pyqtgraph.dockarea import * from pyqtgraph.parametertree import Parameter, ParameterTree import json, os from scipy.spatial import distance import subprocess import skimage.measure as sm from psalgos.pypsalgos import PyAlgos # replacement for: from ImgAlgos.P...
lcls-psana/psocake
psocake/PeakFindingPanel.py
PeakFindingPanel.py
py
49,028
python
en
code
3
github-code
7
[ { "api_name": "pyqtgraph.parametertree.ParameterTree", "line_number": 21, "usage_type": "call" }, { "api_name": "pyqtgraph.parametertree.Parameter.create", "line_number": 214, "usage_type": "call" }, { "api_name": "pyqtgraph.parametertree.Parameter", "line_number": 214, "...
32680709552
from flask import Flask, render_template, redirect , session , url_for , escape , request, Markup from flask_bootstrap import Bootstrap from flask_wtf import Form, RecaptchaField from wtforms import TextField, ValidationError, SubmitField, FormField, validators from wtforms.validators import Required from iB...
jamesjara/jinja-flask-python-rpc-bitcoin
app/wallet.py
wallet.py
py
2,988
python
en
code
1
github-code
7
[ { "api_name": "flask_wtf.Form", "line_number": 10, "usage_type": "name" }, { "api_name": "wtforms.TextField", "line_number": 11, "usage_type": "call" }, { "api_name": "wtforms.validators.Required", "line_number": 11, "usage_type": "call" }, { "api_name": "wtforms....
36513152694
from dataclasses import dataclass import numpy as np from server.service.strategy.base import BaseStrategy @dataclass class RoundRobinStrategy(BaseStrategy): @staticmethod def create_weight_list(size: int) -> list[float]: weight_list = [0 for _ in range(size)] weight_list[0] = 1 retu...
EtienneTurc/IChooseYou
server/service/strategy/round_robin.py
round_robin.py
py
3,063
python
en
code
4
github-code
7
[ { "api_name": "server.service.strategy.base.BaseStrategy", "line_number": 9, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 42, "usage_type": "call" }, { "api_name": "nump...
21516496846
from . import models from django import forms from allauth.account.forms import SignupForm from django.contrib.auth.models import User, Group from django.core.exceptions import ValidationError from Include import validators from crispy_forms.helper import FormHelper from crispy_forms.layout import Layout, Fieldset, B...
ezekielreginio/Job-Management-System-SkillFind-
public_html/app_employer_dashboard/forms.py
forms.py
py
15,457
python
en
code
0
github-code
7
[ { "api_name": "django.forms.DateInput", "line_number": 14, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 14, "usage_type": "name" }, { "api_name": "django.forms.ModelForm", "line_number": 18, "usage_type": "attribute" }, { "api_name": "...
36837617808
from django.shortcuts import render from .models import * from .forms import * from django.http import HttpResponse from django.template import Template, Context, loader import datetime from AppUsuarios.forms import UsuarioForm from django.contrib.auth.forms import AuthenticationForm, UserCreationForm from django.contr...
JulianSVD/TrabajoFinal
AppUsuarios/views.py
views.py
py
3,931
python
es
code
0
github-code
7
[ { "api_name": "AppUsuarios.forms.UsuarioForm", "line_number": 26, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 30, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 32, "usage_type": "call" }, { "api...
20689362049
from pynput import keyboard import clipboard import threading import globals import time import sys import datetime from GUI import DBList class ClipboardListener(threading.Thread): __CTRL = False __COPY = False __CTRL_Time = None __COPY_Time = None __clipboard_item = None __ftrigger = None...
bbuyukyuksel/CaptureTranslate
ClipboardListener.py
ClipboardListener.py
py
4,454
python
en
code
1
github-code
7
[ { "api_name": "threading.Thread", "line_number": 11, "usage_type": "attribute" }, { "api_name": "threading.Event", "line_number": 24, "usage_type": "call" }, { "api_name": "time.time", "line_number": 29, "usage_type": "call" }, { "api_name": "time.time", "line...
19840672490
import re from django.shortcuts import render from .models import * from django.contrib import messages from .forms import StudentForm def studentDisplay(request): results = EventRegister.objects.all() return render(request,"index.html",{"EventRegister":results}) def studentEdit(request,id): getStudent...
Ridd18/Django-CRUD
College/College/views.py
views.py
py
1,893
python
en
code
0
github-code
7
[ { "api_name": "django.shortcuts.render", "line_number": 11, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 15, "usage_type": "call" }, { "api_name": "forms.StudentForm", "line_number": 19, "usage_type": "call" }, { "api_name": "dja...
24915752855
#query2 from pyhive import hive import json import sys input = sys.argv[1] conn=hive.Connection(host='10.128.0.3', username='zhihuiw328',port='10000', database='default') cur = conn.cursor() query2 = 'SELECT s.clicks_num FROM (SELECT cleaned_term, sum(clicks_value) as clicks_num FROM (SELECT cleaned_term, map_values(...
kexinz8/ddl-fighters
HW4 code/query2.py
query2.py
py
642
python
en
code
0
github-code
7
[ { "api_name": "sys.argv", "line_number": 6, "usage_type": "attribute" }, { "api_name": "pyhive.hive.Connection", "line_number": 7, "usage_type": "call" }, { "api_name": "pyhive.hive", "line_number": 7, "usage_type": "name" }, { "api_name": "json.dumps", "line_...
10496430189
import requests import pandas as pd import json archivo_paises =(pd.read_csv("Ejercicio-3/all.csv")) archivo_capitales =(pd.read_csv("Ejercicio-3/country-list.csv")) pais_seleccionado = input("Ingrese un país o paises separados por coma ") pais_array = str(pais_seleccionado).split(", ") def obtener_ISO(pais): #obte...
MicaelaBerrutti/4-Desafio-Fundamentos-de-Programacion
Ejercicio-3/app.py
app.py
py
2,881
python
es
code
0
github-code
7
[ { "api_name": "pandas.read_csv", "line_number": 5, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 6, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 38, "usage_type": "call" }, { "api_name": "json.loads", "line_num...
18035585740
import numpy import scipy.stats import matplotlib.pyplot as plt import Functions.LogisticRegression as LR # import dataset and load def load_data(f1, f2, numFeat): dataList = [] labelList = [] file1 = open(f1, "r") file2 = open(f2, "r") #read features for each line and create numpy array for...
fabiogrillo/HTRU2_Pulsar_Detection
Code/Functions/functions.py
functions.py
py
11,323
python
en
code
0
github-code
7
[ { "api_name": "numpy.array", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.hstack", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number...
4075448612
"""Please Not Another Compiler Compiler -- LR parser generator library. """ from collections import namedtuple from operator import methodcaller from functools import partial import sys import re _str_type = globals().get("basestring", str) def identity(x): """Identity functions, useful as semantic action for ru...
stephanh42/pnacc
pnacc.py
pnacc.py
py
18,957
python
en
code
1
github-code
7
[ { "api_name": "collections.namedtuple", "line_number": 30, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 41, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 62, "usage_type": "call" }, { "api_name": "...
39700345246
import sys; from datetime import datetime; import time; __author__ = "Phlyper"; hosts = {"host":{"all":[], "one":""}, "alias":{"all":[], "one":""}}; def main(): global hosts; print("Le Shell de VHost"); print(sys.argv); # step 1 localhost = input("saisir l\'adresse de localhost?\n"); if not len(localhost): ...
phlyper/abr
vhost.py
vhost.py
py
3,598
python
en
code
1
github-code
7
[ { "api_name": "sys.argv", "line_number": 11, "usage_type": "attribute" }, { "api_name": "json.dumps", "line_number": 117, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 121, "usage_type": "call" }, { "api_name": "datetime.datetime", ...
5188054134
import requests import zipfile from typing import Union def dl_sheet(**kwargs) -> Union[int, str]: '''kwargs: download_file_name, destination_folder, url''' download_file_name = kwargs.pop('dl_file_name', 'xd_quest.zip') destination_folder = kwargs.pop('folder', 'xd quest') url = kwargs.pop('url', 'ht...
akorzunin/anime_challenge
src/dl_sheet.py
dl_sheet.py
py
768
python
en
code
0
github-code
7
[ { "api_name": "requests.get", "line_number": 11, "usage_type": "call" }, { "api_name": "zipfile.ZipFile", "line_number": 16, "usage_type": "call" }, { "api_name": "typing.Union", "line_number": 6, "usage_type": "name" } ]
21640790892
from pulumi_kubernetes.helm.v2 import Chart, LocalChartOpts from yaml import load, dump mesh = Chart( "istio", LocalChartOpts( path="./istio-1.1.3/install/kubernetes/helm/istio/", namespace="istio-system", values=dump("./istio-1.1.3/install/kubernetes/helm/istio/values.yaml") ) )
paulwilljones/pulumi-k8s-py-helm-istio
__main__.py
__main__.py
py
318
python
en
code
0
github-code
7
[ { "api_name": "pulumi_kubernetes.helm.v2.Chart", "line_number": 4, "usage_type": "call" }, { "api_name": "pulumi_kubernetes.helm.v2.LocalChartOpts", "line_number": 6, "usage_type": "call" }, { "api_name": "yaml.dump", "line_number": 9, "usage_type": "call" } ]
31000331170
from flask import Flask, render_template, redirect from flask_pymongo import PyMongo import pymongo import scrape_mars #Create an instance of Flask app = Flask(__name__) #Use PyMongo to establish Mongo connection conn ='mongodb://localhost:27017' client = pymongo.MongoClient(conn) db = client.mars_data_db collecti...
Mayomh11/Mission-to-Mars
marsapp.py
marsapp.py
py
1,284
python
en
code
0
github-code
7
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 26, "usage_type": "call" }, { "api_name": "scrape_mars.scra...
36766190234
import hydra import matplotlib.pyplot as plt import pandas as pd import os from omegaconf import DictConfig import torch from fab.target_distributions.gmm import GMM from experiments.load_model_for_eval import load_model from fab.utils.plotting import plot_contours, plot_marginal_pair PATH = os.getcwd() def setup_...
lollcat/fab-torch
experiments/gmm/evaluation.py
evaluation.py
py
4,812
python
en
code
28
github-code
7
[ { "api_name": "os.getcwd", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.manual_seed", "line_number": 18, "usage_type": "call" }, { "api_name": "fab.target_distributions.gmm.GMM", "line_number": 19, "usage_type": "call" }, { "api_name": "omegacon...
1083875454
"""main file of A2C and PPO implementation for atari""" import os import numpy as np import tensorflow as tf import yaml from absl import app, flags from tqdm import tqdm import utils from a2c import A2C from envs import make_vec_envs from ppo import PPO FLAGS = flags.FLAGS flags.DEFINE_integer('seed', 42, 'Fixed r...
LiubovSobolevskaya/tf2-a2c-ppo
main.py
main.py
py
3,857
python
en
code
9
github-code
7
[ { "api_name": "absl.flags.FLAGS", "line_number": 15, "usage_type": "attribute" }, { "api_name": "absl.flags", "line_number": 15, "usage_type": "name" }, { "api_name": "absl.flags.DEFINE_integer", "line_number": 17, "usage_type": "call" }, { "api_name": "absl.flags...
35170823776
import random from datetime import date, datetime, timedelta import Solver.db as db from Solver.varios import getVariableList def calcularVariables(miFecha = date.today()): try: records = db.getVariablesData() for row in records: variableId = row[0] variableDescripcion = r...
akouvach/indicadores
Solver/solver.py
solver.py
py
5,578
python
es
code
0
github-code
7
[ { "api_name": "datetime.date.today", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 8, "usage_type": "name" }, { "api_name": "Solver.db.getVariablesData", "line_number": 10, "usage_type": "call" }, { "api_name": "Solver.db"...
28786434356
"""credentials_verification Revision ID: 9f65f22e0366 Revises: c2f70be930c9 Create Date: 2020-11-28 22:37:09.789863 """ import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision = '9f65f22e0366' down_revision = 'c2f70be930c9' branch_labels = None depends_on = None def upgrade...
Addovej/spotiplays
src/migrations/versions/9f65f22e0366_credentials_verification.py
9f65f22e0366_credentials_verification.py
py
699
python
en
code
0
github-code
7
[ { "api_name": "alembic.op.add_column", "line_number": 20, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 20, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 20, "usage_type": "call" }, { "api_name": "sqlalchemy.JSON", ...
22352771965
# coding: utf-8 # # Copyright 2022 Hengran Zhang # Author: Hengran Zhang # from sklearn.metrics import classification_report, f1_score, recall_score, precision_score,accuracy_score from sklearn.metrics import confusion_matrix def eva_classifier(list_t_in, list_p_in, labels=None, mask=None, average=None): ...
cofe-ai/CORT
src/evaluation.py
evaluation.py
py
1,649
python
en
code
4
github-code
7
[ { "api_name": "sklearn.metrics.confusion_matrix", "line_number": 20, "usage_type": "call" }, { "api_name": "sklearn.metrics.accuracy_score", "line_number": 21, "usage_type": "call" }, { "api_name": "sklearn.metrics.recall_score", "line_number": 22, "usage_type": "call" ...
74224007584
from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware app = FastAPI() app.add_middleware( CORSMiddleware, allow_origins=["*"], # Allows all origins allow_credentials=True, allow_methods=["*"], # Allows all methods allow_headers=["*"], # Allows all headers ) @app.post(...
gmanchon/fastapi
post.py
post.py
py
583
python
en
code
0
github-code
7
[ { "api_name": "fastapi.FastAPI", "line_number": 4, "usage_type": "call" }, { "api_name": "fastapi.middleware.cors.CORSMiddleware", "line_number": 7, "usage_type": "argument" } ]
41106472809
import requests import bs4 import pandas import re import os import threading SEARCHPAGE = 'http://www.naiglobal.com/about-nai' def webdl(url): """Downloads web-page (using requests rather than urllib) """ print('Downloading...') r = requests.get(url) try: r.raise_for_status() return ...
goobyme/Small_Scripts
Primitve_Scrapers/Old Scrapers/NAI Scraper.py
NAI Scraper.py
py
3,030
python
en
code
0
github-code
7
[ { "api_name": "requests.get", "line_number": 14, "usage_type": "call" }, { "api_name": "requests.HTTPError", "line_number": 18, "usage_type": "attribute" }, { "api_name": "re.compile", "line_number": 26, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", ...
25384428927
from python_speech_features import fbank import scipy.io.wavfile as wav import numpy as np import sys import os def get_list_path_wav(dir): """Đọc đường dẫn tất cả file wav trong thư mục dir""" list_path = [] for root, dirs, files in os.walk(dir): for file in files: if file.endswith("....
hoangtubk/Speech-Recognition
FFT.py
FFT.py
py
1,307
python
en
code
0
github-code
7
[ { "api_name": "os.walk", "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": "attribute" }, { "api_name": "os.path.basename", "line_number...
1833914648
import os import pathlib import tempfile from unittest import TestCase from uuid import uuid4 import pandas as pd import polars as pl from jinja2 import Template from pydantic import ValidationError from focus_converter.configs.base_config import ConversionPlan, LookupConversionArgs from focus_converter.conversion_fu...
finopsfoundation/focus_converters
focus_converter_base/tests/converter_functions/test_lookup_function.py
test_lookup_function.py
py
7,517
python
en
code
6
github-code
7
[ { "api_name": "jinja2.Template", "line_number": 39, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_number": 43, "usage_type": "name" }, { "api_name": "tempfile.TemporaryDirectory", "line_number": 45, "usage_type": "call" }, { "api_name": "os.path...
4700879046
from io import open from math import * import pickle class Personaje: Personaje = {}; def __init__(self,nombre: str,vida:float,ataque:float,defensa:float,alcance:float): if(vida > 0 and ataque > 0 and defensa > 0 and alcance > 0): self.Personaje = {"nombre":nombre,"vida":trunc(vida),"ataque"...
felipenico/Exercises-Python
Exercise_handleFile3/squad.py
squad.py
py
2,170
python
es
code
0
github-code
7
[ { "api_name": "io.open", "line_number": 50, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 53, "usage_type": "call" }, { "api_name": "io.open", "line_number": 60, "usage_type": "call" }, { "api_name": "pickle.dump", "line_number": 61, ...
21938939675
#Updated for Selenium's 4.3 update (removal of 'find_element_by') import gspread, time import csv from oauth2client.service_account import ServiceAccountCredentials from selenium import webdriver from selenium.webdriver.common.keys import Keys #much of this is commented out due to test attempts that I tried. Each at...
JacobVorstenbosch/QA-Portfolio
ImportFromItchio/InputData.py
InputData.py
py
5,425
python
en
code
1
github-code
7
[ { "api_name": "oauth2client.service_account.ServiceAccountCredentials.from_json_keyfile_name", "line_number": 16, "usage_type": "call" }, { "api_name": "oauth2client.service_account.ServiceAccountCredentials", "line_number": 16, "usage_type": "name" }, { "api_name": "gspread.auth...
316894677
import os import sys from PyQt6 import QtCore, QtWidgets, QtGui, QtWebEngineWidgets from PyQt6.QtCore import QSize from PyQt6.QtGui import QDesktopServices, QAction, QIcon from PyQt6.QtWebEngineCore import QWebEngineSettings from PyQt6.QtWidgets import QToolBar ROOT_URL = 'http://127.0.0.1:5000/' def init_gui(applic...
renesugar/bija
bija/gui.py
gui.py
py
3,560
python
en
code
null
github-code
7
[ { "api_name": "PyQt6.QtWidgets.QApplication", "line_number": 21, "usage_type": "call" }, { "api_name": "PyQt6.QtWidgets", "line_number": 21, "usage_type": "name" }, { "api_name": "sys.argv", "line_number": 21, "usage_type": "attribute" }, { "api_name": "PyQt6.QtCo...
20091993809
from subscribers.models import Subscriber from telegram_bot.commands import static_text import telegram from django.conf import settings from telegram_bot.models import User from telegram import MessageEntity def get_profile_by_phone_number(phone): ps = Subscriber.objects.filter(phone=phone) text = '' pr...
alenworld/django_telegram_bot
telegram_bot/utils/misc.py
misc.py
py
2,518
python
en
code
2
github-code
7
[ { "api_name": "subscribers.models.Subscriber.objects.filter", "line_number": 11, "usage_type": "call" }, { "api_name": "subscribers.models.Subscriber.objects", "line_number": 11, "usage_type": "attribute" }, { "api_name": "subscribers.models.Subscriber", "line_number": 11, ...
22789805653
from django.conf import settings from django.test import TestCase from django.utils import translation from common.tests import SaleAdsTestMixin from common.tests.utils.composite_languages_setting_test_mixin import ( CompositeLanguagesSettingTestMixin, ) class LocaleMiddlewareTest( SaleAdsTestMixin, Composit...
mikhkhann/sale-ads
src/sale_ads/apps/languages/tests/test_middleware.py
test_middleware.py
py
1,053
python
en
code
0
github-code
7
[ { "api_name": "common.tests.SaleAdsTestMixin", "line_number": 12, "usage_type": "name" }, { "api_name": "common.tests.utils.composite_languages_setting_test_mixin.CompositeLanguagesSettingTestMixin", "line_number": 12, "usage_type": "name" }, { "api_name": "django.test.TestCase",...
19630812077
""" @author: magician @date: 2019/12/13 @file: generator_demo.py """ from itertools import islice def index_words(text): """ index_words :param text: :return: """ result = [] if text: result.append(0) for index, letter in enumerate(text): if letter == ' ': ...
ftconan/python3
effective_python/function/generator_func.py
generator_func.py
py
1,247
python
en
code
1
github-code
7
[ { "api_name": "itertools.islice", "line_number": 64, "usage_type": "call" } ]
24518937659
#!../.interrogatorio/bin/python3 print('Content-type:text/html\n\n') import os import cgi, cgitb cgitb.enable() if os.environ['REQUEST_METHOD'] == 'POST': form = cgi.FieldStorage() if not os.path.isfile('./interrogar-ud/credenciais.txt'): with open('./interrogar-ud/credenciais.txt', 'w') as f: f.write('') wit...
alvelvis/Interrogat-rio
www/cgi-bin/autenticar-interrogatorio.py
autenticar-interrogatorio.py
py
828
python
pt
code
0
github-code
7
[ { "api_name": "cgitb.enable", "line_number": 6, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 8, "usage_type": "attribute" }, { "api_name": "cgi.FieldStorage", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.isfile", "line...
74522951263
import urlparse from sentry.web.helpers import render_to_string from sentry.interfaces import Interface from django.utils.translation import ugettext as _ class CFMLHttp(Interface): display_score = 1050 score = 850 attrs = ('url_path', 'method', 'form', 'url', 'query_string', 'cookies', 'session...
jmacul2/sentry-cfml
sentry_cfml/interfaces.py
interfaces.py
py
3,130
python
en
code
1
github-code
7
[ { "api_name": "sentry.interfaces.Interface", "line_number": 7, "usage_type": "name" }, { "api_name": "urlparse.urlsplit", "line_number": 21, "usage_type": "call" }, { "api_name": "sentry.web.helpers.render_to_string", "line_number": 52, "usage_type": "call" }, { "...
72349513183
import json from typing import Callable import requests from w3lib.url import urljoin from zacoby import exceptions, global_logger class Response: def __init__(self, response, **kwargs): self._response = response # self.json = response.json() # self.response_data = response.content.decod...
Zadigo/zacoby
remote.py
remote.py
py
5,412
python
en
code
1
github-code
7
[ { "api_name": "typing.Callable", "line_number": 59, "usage_type": "name" }, { "api_name": "zacoby.global_logger.info", "line_number": 73, "usage_type": "call" }, { "api_name": "zacoby.global_logger", "line_number": 73, "usage_type": "name" }, { "api_name": "w3lib....
31680659069
# M. P. Hayes UCECE import numpy as np import scipy.signal as signal from ipywidgets import interact, interactive, fixed, interact from .lib.signal_plot import signal_plot, dtft_plot, spectrum_modes def ma_lpf_dtft_plot(M=10, fs=100, fmax=50, mode='magnitude', log_frequency=False): N = 100 ...
mph-/dsp-notebooks
intro/demos/ma_lpf_dtft_demo1.py
ma_lpf_dtft_demo1.py
py
884
python
en
code
3
github-code
7
[ { "api_name": "numpy.arange", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 16, "usage_type": "call" }, { "api_name": "scipy.signal.lfilter", "line_...
7651408329
import pytest import connexion from s3_io.s3io_api import create_app flask_app = create_app() #flask_app.add_api('api/s3io-api.yaml', arguments={'title': 'Swarm s3'}) @pytest.fixture(scope='module') def client(): with flask_app.app.test_client() as c: yield c def test_health(client): response = cli...
viaacode/s3-io
tests/test_api.py
test_api.py
py
382
python
en
code
0
github-code
7
[ { "api_name": "s3_io.s3io_api.create_app", "line_number": 4, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 9, "usage_type": "call" } ]
4860794165
import cv2 import numpy as np img = cv2.imread('14.jpg') imggray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) ret, thresh = cv2.threshold(imggray, 127, 255, 0) contours, _ = cv2.findContours(thresh, cv2.RETR_TREE,cv2.CHAIN_APPROX_SIMPLE) mask = np.zeros(imggray.shape, np.uint8) img = cv2.drawContours(img, [contours[0...
lieweiAGI/liewei-agi-code-part1
13 opencv(四)/test02.py
test02.py
py
474
python
en
code
2
github-code
7
[ { "api_name": "cv2.imread", "line_number": 3, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 4, "usage_type": "attribute" }, { "api_name": "cv2.threshold", "lin...
5708994300
from clapp.forms import flash_errors from flask import Blueprint, render_template, current_app, \ request, url_for from flask.ext.login import login_required from flask.ext.security import current_user from werkzeug.local import LocalProxy from .. import forms from .. import rltime from .. import utils from .....
ryanolson/running-log
running_log/groups/views.py
views.py
py
1,605
python
en
code
1
github-code
7
[ { "api_name": "werkzeug.local.LocalProxy", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.current_app.extensions", "line_number": 13, "usage_type": "attribute" }, { "api_name": "flask.current_app", "line_number": 13, "usage_type": "name" }, { "api...
9857767752
from telegram import InlineKeyboardButton, InlineKeyboardMarkup from telegram.ext import (Updater, CommandHandler, CallbackQueryHandler, ConversationHandler, Filters, MessageHandler) import logging import redis_db as r import moltin from functools import partial import os STORE, PRODUCT, CON...
killthebee/Online-shop-tg-bot
shop-bot.py
shop-bot.py
py
10,752
python
en
code
1
github-code
7
[ { "api_name": "moltin.fetch_products", "line_number": 16, "usage_type": "call" }, { "api_name": "telegram.InlineKeyboardButton", "line_number": 19, "usage_type": "call" }, { "api_name": "telegram.InlineKeyboardMarkup", "line_number": 21, "usage_type": "call" }, { ...
24378032616
from peewee import * from gestionar_obra import GestionarObra import datetime sqlite_db = GestionarObra().conectar_db() # función que mapea y crea las tablas de la base de datos en donde se cargará el dataset limpio. class BaseModel(Model): class Meta: database = sqlite_db # -----------------------------Tab...
ozunacristian/IFTS18
modelo_orm.py
modelo_orm.py
py
13,106
python
es
code
0
github-code
7
[ { "api_name": "gestionar_obra.GestionarObra", "line_number": 5, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 82, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 83, "usage_type": "call" }, { "api_name": "gestionar_obr...
9678538434
import sqlalchemy as sa from sqlalchemy.dialects.postgresql import array from sqlalchemy.dialects.postgresql import JSONB from osgende.common.sqlalchemy import Truncate class RelationHierarchy: """Table describing the relation hierarchies of the OSM relations table. 'subset' can be used to limit the relat...
waymarkedtrails/osgende
osgende/relations/hierarchy.py
hierarchy.py
py
3,526
python
en
code
7
github-code
7
[ { "api_name": "sqlalchemy.Table", "line_number": 21, "usage_type": "call" }, { "api_name": "sqlalchemy.Column", "line_number": 22, "usage_type": "call" }, { "api_name": "sqlalchemy.BigInteger", "line_number": 22, "usage_type": "attribute" }, { "api_name": "sqlalch...
29027657330
import copy from enum import Enum from typing import Optional, Mapping, List, Sequence, Union, Dict, Any from .config import Config from .data import ChartData from .exception import ConfigurationError, ParamError from .resource import is_list_resource class Processor: """ Processor filters and mutates chart...
RangelReale/helmion
helmion/chart.py
chart.py
py
11,298
python
en
code
0
github-code
7
[ { "api_name": "data.ChartData", "line_number": 15, "usage_type": "name" }, { "api_name": "data.ChartData", "line_number": 25, "usage_type": "name" }, { "api_name": "data.ChartData", "line_number": 34, "usage_type": "name" }, { "api_name": "typing.Sequence", "l...
42793759170
from flask import Flask, request, jsonify, make_response from flask import jsonify from flask_cors import CORS from flask import request from flask_sqlalchemy import SQLAlchemy from sqlalchemy import create_engine app = Flask(__name__) CORS(app) cors = CORS(app, resource={ r"/*":{ "origins":"*...
DeanVanGreunen/assessment2
backend/app.py
app.py
py
1,369
python
en
code
0
github-code
7
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 10, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 11, "usage_type": "call" }, { "api_name": "flask_sqlalchemy.SQLAlchem...
14955594822
import os import sys import random import orbital import numpy as np import astropy from timeout import timeout,TimeoutError to = int( os.getenv("TIMEOUT",120)) def str_to_vec( str_in ): vec = np.fromstring( str_in , dtype=float, count=-1 , sep=',') if( vec.size != 3 ): raise "Vector doesnt have 3 e...
cromulencellc/hackasat-qualifier-2022
matters_of_state/challenge/challenge.py
challenge.py
py
2,510
python
en
code
15
github-code
7
[ { "api_name": "os.getenv", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.fromstring", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.power", "line_number":...
73185282142
import requests import time import board import busio import adafruit_dht import adafruit_ads1x15.ads1115 as ADS from adafruit_ads1x15.analog_in import AnalogIn import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) GPIO.cleanup() #create the I2C bus i2c = busio.I2C(board.SCL, board.SDA) #create the A...
cyber-tooth/AtmoSpace
sensorData.py
sensorData.py
py
1,148
python
en
code
1
github-code
7
[ { "api_name": "RPi.GPIO.setmode", "line_number": 9, "usage_type": "call" }, { "api_name": "RPi.GPIO", "line_number": 9, "usage_type": "name" }, { "api_name": "RPi.GPIO.BCM", "line_number": 9, "usage_type": "attribute" }, { "api_name": "RPi.GPIO.setwarnings", "...
39670994717
import random import numpy as np import seaborn as sns import matplotlib.pyplot as plt c = 13/24 a = [] b = [] q = 0 for i in range(1000): a_temp = np.array([random.uniform(0, 2/3) for i in range(100)]).mean() b_temp = np.array([random.uniform(1/2, 1) for i in range(100)]).mean() a.append(a_temp) b.a...
Darinochka/ml_tinkoff_2021
exam/4_task/visualization.py
visualization.py
py
515
python
en
code
1
github-code
7
[ { "api_name": "numpy.array", "line_number": 12, "usage_type": "call" }, { "api_name": "random.uniform", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 13, "usage_type": "call" }, { "api_name": "random.uniform", "line_num...
11244675356
"""Wrappers for intergating imitation reward function.""" import gym import gym_panda from gym_panda.wrapper_env.VAE import VAE import torch import numpy as np import copy import pickle class collectDemonsWrapper(gym.Wrapper): """ Wrapper used to collect demonstrations.""" def __init__(self, env): gym....
jiaj15/pdenv
gym_panda/wrapper_env/wrapper.py
wrapper.py
py
5,949
python
en
code
0
github-code
7
[ { "api_name": "gym.Wrapper", "line_number": 10, "usage_type": "attribute" }, { "api_name": "gym.Wrapper.__init__", "line_number": 13, "usage_type": "call" }, { "api_name": "gym.Wrapper", "line_number": 13, "usage_type": "attribute" }, { "api_name": "numpy.random.u...
70867131105
import sys import pdb import matplotlib.pyplot as plt import matplotlib.colors as colors import matplotlib.cm as cmx import numpy as np kernels = [] data = [] if len(sys.argv) != 2: print("Execute as :\npython {} {}".format(sys.argv[0],"filename.txt")) exit(1) with open(sys.argv[1]) as f: for lineNum,line ...
kunalghosh/KernelMethods
Assignment6/src/report/plot.py
plot.py
py
2,017
python
en
code
0
github-code
7
[ { "api_name": "sys.argv", "line_number": 10, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 11, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 13, "usage_type": "attribute" }, { "api_name": "numpy.asarray", "line_n...
27593881942
"""This script downloads and post-processes the rime-cantonese data as JSON files.""" import collections import io import json import logging import os import tempfile import zipfile from pycantonese.jyutping.parse_jyutping import parse_jyutping from pycantonese.util import _split_chars_with_alphanum try: impor...
jacksonllee/pycantonese
src/pycantonese/data/rime_cantonese/download_and_postprocess.py
download_and_postprocess.py
py
8,629
python
en
code
302
github-code
7
[ { "api_name": "os.path.abspath", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path", "line_number": 27, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 27, "usage_type": "call" }, { "api_name": "collections.namedtuple",...
34335460356
import argparse import create_subnet import create_router import users_utility import random NAME = 'Name' CIDR = 'Subnet' PROVIDER = 'Provider' USERNAME = 'Username' EXTERNAL = 'External' def create_linked_network(domain, project, network): ln = [] print('create_linked_network(domain: {}, project: {}, network: {...
GGonryun/OpenStack-Classroom-Builder
resources/create_network.py
create_network.py
py
3,957
python
en
code
1
github-code
7
[ { "api_name": "create_subnet.create_subnet", "line_number": 24, "usage_type": "call" }, { "api_name": "create_subnet.create_subnet", "line_number": 27, "usage_type": "call" }, { "api_name": "create_router.create_router", "line_number": 30, "usage_type": "call" }, { ...
18915218336
import json import os from sos.options import SoSOptions PRESETS_PATH = "/etc/sos/presets.d" #: Constants for on-disk preset fields DESC = "desc" NOTE = "note" OPTS = "args" class PresetDefaults(): """Preset command line defaults to allow for quick reference to sets of commonly used options :param nam...
sosreport/sos
sos/presets/__init__.py
__init__.py
py
3,601
python
en
code
470
github-code
7
[ { "api_name": "sos.options.SoSOptions", "line_number": 37, "usage_type": "call" }, { "api_name": "sos.options.SoSOptions", "line_number": 56, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 80, "usage_type": "call" }, { "api_name": "os.path"...
73734396064
from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render, redirect, get_object_or_404 from django.urls import reverse, reverse_lazy import datetime from .models import Project, Assignment, Reminder from .forms import CreateProjectForm, CreateAssignmentForm, CreateReminderForm ...
Been-H/planner_app
planner_app/planner_app/planner/views.py
views.py
py
4,401
python
en
code
1
github-code
7
[ { "api_name": "models.Project.objects.filter", "line_number": 10, "usage_type": "call" }, { "api_name": "models.Project.objects", "line_number": 10, "usage_type": "attribute" }, { "api_name": "models.Project", "line_number": 10, "usage_type": "name" }, { "api_name...
71125118942
# Adapted from https://github.com/libAtoms/silicon-testing-framework import numpy as np import spglib def prep(at, symprec=1.0e-5): dataset = spglib.get_symmetry_dataset(at, symprec=symprec) rotations = dataset['rotations'].copy() translations = dataset['translations'].copy() symm_map=[] scaled_p...
felixmusil/mlip_workshop2021
tools/symmetrize.py
symmetrize.py
py
1,968
python
en
code
0
github-code
7
[ { "api_name": "spglib.get_symmetry_dataset", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.dot", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.round", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.argmin", "...
24570330107
from langchain.schema import AgentAction, AgentFinish def parse_output(message: str): FINAL_ANSWER_ACTION = "<final_answer>" includes_answer = FINAL_ANSWER_ACTION in message if includes_answer: answer = message.split(FINAL_ANSWER_ACTION)[1].strip() if "</final_answer>" in answer: ...
langchain-ai/langchain
templates/solo-performance-prompting-agent/solo_performance_prompting_agent/parser.py
parser.py
py
813
python
en
code
68,990
github-code
7
[ { "api_name": "langchain.schema.AgentFinish", "line_number": 11, "usage_type": "call" }, { "api_name": "langchain.schema.AgentAction", "line_number": 18, "usage_type": "call" } ]
10509659606
import tensorflow as tf import numpy as np import math import os import sys from itertools import permutations BASE_DIR = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.dirname(BASE_DIR)) sys.path.append(os.path.join(BASE_DIR, '../utils')) sys.path.append(os.path.join(BASE_DIR, '../models')) sys.pat...
bettyruntianwang/csc413-final-project
dgcnn/part_seg/part_seg_model.py
part_seg_model.py
py
8,315
python
en
code
0
github-code
7
[ { "api_name": "os.path.dirname", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.path.append", "line...
593690145
from triqs.operators import * from triqs.gf import * from h5 import * from triqs.atom_diag import * from triqs.utility.comparison_tests import * import numpy as np from itertools import product save_h5 = False fops = [(s,o) for s,o in product(('up','dn'),list(range(3)))] def make_hamiltonian(mu, U, J, b, t): h =...
TRIQS/triqs
test/python/atom_diag/atom_diag.py
atom_diag.py
py
3,055
python
en
code
121
github-code
7
[ { "api_name": "itertools.product", "line_number": 11, "usage_type": "call" }, { "api_name": "itertools.product", "line_number": 22, "usage_type": "call" }, { "api_name": "itertools.product", "line_number": 25, "usage_type": "call" }, { "api_name": "itertools.produ...
72865690462
import torch import torch.nn as nn from mmcv.cnn import ConvModule from mmcv.runner import BaseModule from mmseg.ops import resize from ..builder import BACKBONES, build_backbone from ..decode_heads.psp_head import PPM @BACKBONES.register_module() class ICNet(BaseModule): """ICNet for Real-Time Semantic Segmenta...
Ascend/ModelZoo-PyTorch
PyTorch/contrib/cv/semantic_segmentation/MMseg-swin/mmseg/models/backbones/icnet.py
icnet.py
py
5,839
python
en
code
31
github-code
7
[ { "api_name": "mmcv.runner.BaseModule", "line_number": 12, "usage_type": "name" }, { "api_name": "builder.build_backbone", "line_number": 68, "usage_type": "call" }, { "api_name": "torch.nn.MaxPool2d", "line_number": 72, "usage_type": "call" }, { "api_name": "torc...
43910068821
import re import gc import numpy as np import multiprocessing from multiprocessing import Pool class TreeDrivenEncoder: """ TreeDrivenEncoder algorithm. OOP is beautiful """ def __init__(self): self.all_conditions = None def fit(self, trees): self.all_conditions = [] ...
unnir/DeepTLF
src/tde.py
tde.py
py
1,818
python
en
code
13
github-code
7
[ { "api_name": "re.sub", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 39, "usage_type": "call" }, { "api_name": "multiprocessing.Pool", "line_number": 40, "usage_type": "call" }, { "api_name": "multiprocessing.cpu_count", ...
25451003675
# -*- coding: utf-8 -*- """ Created on Wed Jan 5 01:51:13 2022 @author: Luke """ def pr_fullpull(ticker, export=True): # gets all press releases of input ticker and outputs to raw data file # stored in hotshot finance type shit\ticker_releasedata\raw # development was done under "News Lagtime Exploitatio...
cukelarter/Stock-Market-News-Analysis
pr_fullpull.py
pr_fullpull.py
py
4,812
python
en
code
0
github-code
7
[ { "api_name": "selenium.webdriver.Edge", "line_number": 21, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 21, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 35, "usage_type": "call" }, { "api_name": "selenium.webdri...
9371084827
""" handler ~~~~~~~ 相关 handlers """ import json import random import logging from raven.contrib.tornado import SentryMixin from tornado.web import RequestHandler from mwtk_utils import tornado_handy_utils as thu from mwtk_utils import obj_json_dumps, to_str from .models import FieldsMap, ShopBulkData __all_...
viwenLai/sharing-shop
westsnow/handler.py
handler.py
py
3,943
python
en
code
0
github-code
7
[ { "api_name": "raven.contrib.tornado.SentryMixin", "line_number": 23, "usage_type": "name" }, { "api_name": "tornado.web.RequestHandler", "line_number": 23, "usage_type": "name" }, { "api_name": "models.ShopBulkData.select", "line_number": 36, "usage_type": "call" }, ...
24559863317
import logging from typing import Any, List, Mapping, Optional import requests from langchain_core.callbacks import CallbackManagerForLLMRun from langchain_core.language_models.llms import LLM from langchain_community.llms.utils import enforce_stop_tokens logger = logging.getLogger(__name__) class ChatGLM(LLM): ...
langchain-ai/langchain
libs/community/langchain_community/llms/chatglm.py
chatglm.py
py
3,969
python
en
code
68,990
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "langchain_core.language_models.llms.LLM", "line_number": 13, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 30, "usage_type": "name" }, { "api_nam...
43748744285
import time start = time.time() from django.shortcuts import render from . forms import MyForm from rest_framework import viewsets from rest_framework.decorators import api_view from django.core import serializers from rest_framework.response import Response from rest_framework import status from django.http import Jso...
mocktarissa/graduation
MyAPI/views.py
views.py
py
4,911
python
en
code
0
github-code
7
[ { "api_name": "time.time", "line_number": 2, "usage_type": "call" }, { "api_name": "rest_framework.viewsets.ModelViewSet", "line_number": 27, "usage_type": "attribute" }, { "api_name": "rest_framework.viewsets", "line_number": 27, "usage_type": "name" }, { "api_na...
4077124477
""" For the main page, we process the POST request. Returning a working link. """ from http import HTTPStatus from flask import flash, redirect, render_template from . import app, db from .constants import INDEX_HTML from .forms import URLForm from .models import URLMap from .utils import get_unique_short_id @app....
SemenovY/yacut
yacut/views.py
views.py
py
1,433
python
en
code
0
github-code
7
[ { "api_name": "forms.URLForm", "line_number": 25, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 27, "usage_type": "call" }, { "api_name": "constants.INDEX_HTML", "line_number": 27, "usage_type": "argument" }, { "api_name": "models.U...
39854517366
from django.http import JsonResponse from .models import WatchShop, Watch from watchshopapp.serializers import WatchShopSerializer, WatchsSerializer def client_get_watchshops(request): watchshops = WatchShopSerializer( WatchShop.objects.all().order_by('-id'), many=True, context={'request':...
Nixer/watchshop
watchshopapp/apis.py
apis.py
py
664
python
en
code
0
github-code
7
[ { "api_name": "watchshopapp.serializers.WatchShopSerializer", "line_number": 7, "usage_type": "call" }, { "api_name": "models.WatchShop.objects.all", "line_number": 8, "usage_type": "call" }, { "api_name": "models.WatchShop.objects", "line_number": 8, "usage_type": "attri...
28024680157
from flask import Flask, request, jsonify, render_template import tensorflow as tf import numpy as np import keras import json from keras.preprocessing.text import tokenizer_from_json, Tokenizer from keras.preprocessing.sequence import pad_sequences from keras.models import load_model import io import nltk nltk.downlo...
ngoquanghuy99/nevermore
app.py
app.py
py
3,773
python
en
code
9
github-code
7
[ { "api_name": "nltk.download", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 18, "usage_type": "call" }, { "api_name": "json.load", "line_number": 25, "usage_type": "call" }, { "api_name": "keras.preprocessing.text.tokenize...
73348808864
from analyzer import Analyzer, AnalyzerManager, plotable, CorruptAnalyzer from dataio import File, Globbler import os import numpy as np import matplotlib.pyplot as plt import matplotlib.image as mpimg from scipy.signal import argrelmax import pandas as pd import subprocess import sys try: import seaborn as sns ...
dulte/FrictionProject
analysis/friction.py
friction.py
py
14,964
python
en
code
0
github-code
7
[ { "api_name": "seaborn.set", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 34, "usage_type": "call" }, { "api_name": "os.path", "line_number": 34, "usage_type": "attribute" }, { "api_name": "os.path.split", "line_numbe...
38967196562
import sys from collections import deque input = sys.stdin.readline M, N = map(int, input().split()) maze = [] for i in range(N): maze.append(list(map(int, list(input().rstrip())))) # 상 하 좌 우 mx = [-1, 1, 0, 0] my = [0, 0, -1, 1] q = deque() q.append((0, 0)) INF = float('inf') # 가로 : M, 세로 : N dist = [[INF] * (...
MSA-FullStack-Developer/Study-Algorithm
seokho/algorithm/dfs_bfs/sol1261.py
sol1261.py
py
807
python
en
code
4
github-code
7
[ { "api_name": "sys.stdin", "line_number": 4, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 15, "usage_type": "call" } ]
20295312080
import pandas as pd import streamlit as st import graphviz st.title("Streamlit DAG Maker") st.write("Funcs available: [foo, bar, confuser]") df = pd.DataFrame( [['foo', 'bar'], ['foo', 'confuser']], columns=["Source", "Target"], ) edited_df = st.experimental_data_editor( df, use_container_width=True...
otosense/plunk
plunk/sb/front_demo/user_story1/apps/streamlit_dag_maker2.py
streamlit_dag_maker2.py
py
559
python
en
code
1
github-code
7
[ { "api_name": "streamlit.title", "line_number": 5, "usage_type": "call" }, { "api_name": "streamlit.write", "line_number": 7, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 9, "usage_type": "call" }, { "api_name": "streamlit.experimental_...