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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
35500635090 | # -*- coding: utf-8 -*-
"""
Created on Thu Feb 3 12:53:26 2022
@author: hujo8
"""
import cv2 as cv
from PIL import Image
import numpy as np
from scipy import ndimage
from scipy.ndimage import gaussian_filter
import matplotlib.pyplot as plt
from skimage.segmentation import mark_boundaries, find_boundarie... | Andrewblumensen/Advanced-Image-Analysis | 1 Week/Quiz1.py | Quiz1.py | py | 1,989 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "cv2.imread",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.meshgrid",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number"... |
72907035254 | import sys
import pygame
from pygame.constants import K_s, QUIT, KEYDOWN
pygame.init()
SCR_RECT = pygame.Rect(0, 0, 900, 600)
screen = pygame.display.set_mode(SCR_RECT.size)
pygame.display.set_caption("1234")
font = pygame.font.SysFont("cardamon", 18)
DEAD, ALIVE, MARKED, NON_MARKED, NEW_ALIVE, DIED... | cxy-251/the-first-repo | lifeGame/000MyLife.py | 000MyLife.py | py | 5,670 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pygame.init",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pygame.Rect",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"li... |
74627706612 | from data import load_data
import sys
from gender_model import train_gender_model
from age_model import train_age_model
# Settings
image_folder = "../dataset"
dataset = "../data/full_dataset.csv"
gender_model_save = 'models/gender_final.h5'
age_model_save = 'models/age_final.h5'
img_shape = (96, 96, 1)
no_images = 0
... | Monsters-Inc/faces | model_training/train_model.py | train_model.py | py | 2,618 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "sys.argv",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "data.load_data",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "gender_model.train_gender_... |
23837217420 | """
Preprocessor and data importer from Pair Reports data. This assumes the database has been created with the proper
models and the data exist in the project directory in /ubc-pair-grade-data.
"""
from app import create_app
from config import Config
from app.models import PAIRReportsGrade as PRG, TableauDashboardGrad... | DonneyF/ubcgrades | scripts/db_compute_course_v2_stats.py | db_compute_course_v2_stats.py | py | 5,737 | python | en | code | 27 | github-code | 21 | [
{
"api_name": "app.models.TableauDashboardV2Grade.query.filter",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "app.models.TableauDashboardV2Grade.query",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "app.models.TableauDashboardV2Grade",
"line_numb... |
27827240706 | from django.shortcuts import redirect, render
from .models import Room
from django.contrib.auth.models import User
from .forms import RoomForm
# Create your views here.
def room_index(request):
# print("Attempting -- \t\t \nChat.views.Create_Room: \t")
users = User.objects.exclude(username=request.user.username... | kevdouglass/websockets_redis_local_chat | chat/views.py | views.py | py | 2,091 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.contrib.auth.models.User.objects.exclude",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.models.User.objects",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.auth.models.User",
"line_number": 8... |
14700487155 | import os
import collections
def read_reverse(filename):
f = open(filename)
f.seek(0, 2)
last_position = f.tell()
while True:
line = f.readline()
current_position = f.tell()
i = 1
while current_position == last_position:
if len(line) == current_position:
... | openjason/automail | read_reverse.py | read_reverse.py | py | 1,186 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "collections.deque",
"line_number": 33,
"usage_type": "call"
}
] |
7986500102 | from uuid import uuid4
def sum_of_string(string: str) -> int:
char_answer = 0
for i in string:
char_answer += ord(i)
string = str(char_answer)
string = str(sum(map(int, list(string))))
answer = 0
for i in string:
answer += int(i)
return answer
def check_key... | StrangeArcturus/discord-spam-bot | keygen.py | keygen.py | py | 746 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "uuid.uuid4",
"line_number": 22,
"usage_type": "call"
}
] |
9366983899 | import helper
windowSize = 14
for line in helper.get_input(6):
markerIndex = 0
for i in range(len(line) - windowSize):
distinctChars = set(line[i:(windowSize+i)])
if (len(distinctChars) == windowSize):
markerIndex = i + windowSize
break
print("first marker after {} ... | KohlhaseJ/adventofcode2022 | src/day-6--turning-trouble.py | day-6--turning-trouble.py | py | 352 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "helper.get_input",
"line_number": 5,
"usage_type": "call"
}
] |
36333480690 | #!/usr/bin/env python
#!-*-coding:utf-8 -*-
#!@time :2018/6/18 21:09
#!@Author :SINGLE
#!@File :test.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2018年6月9日下午7:15:28
# @Author : single
# @Version :
# @desc :
# import os
'a test doc'
__author__ = 'SINGLE'
from collections import Iterable
from... | xytysingle/AnnotationTool | test/test_.py | test_.py | py | 8,424 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "collections.Iterable",
"line_number": 90,
"usage_type": "argument"
},
{
"api_name": "functools.wraps",
"line_number": 186,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 237,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
69957384692 | import smtplib
import os
import time
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.base import MIMEBase
from email import encoders
# set up the SMTP server
def send_email(file_path):
s = smtplib.SMTP(host='smtp-mail.outlook.com', port=587)
s.starttls()
... | akashsaluja/dhvani | email_sender.py | email_sender.py | py | 1,391 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "smtplib.SMTP",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "email.mime.multipart",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "email.mime.multipar... |
73034855413 | # Authors: Eric Larson <larson.eric.d@gmail.com>
#
# License: BSD (3-clause)
from functools import partial
import numpy as np
from scipy import linalg, fftpack
from .io.pick import pick_types, pick_channels
from .io.constants import FIFF
from .forward import (_magnetic_dipole_field_vec, _create_meg_coils,
... | LiuFang816/SALSTM_py_data | python/mne-tools_mne-python/mne-python-master/mne/chpi.py | chpi.py | py | 28,513 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "utils._check_fname",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "numpy.isnan",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "utils._check_fname",
... |
13433093835 | import tabula
import pandas as pd
import json
import re
def getDayData(df, index):
data = (df.iloc[index, :]).values
time = df.columns.values[1:]
result = []
for i in range(1, len(data)):
if not pd.isnull(data[i]): # check if data is null before adding
ele = data[i].replace("... | A-M-Amine/scraping-USTHB-Schedules | ScheduleExtraction.py | ScheduleExtraction.py | py | 3,399 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "pandas.isnull",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "re.S",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "re.search",
"line_number": 26,
... |
73394134134 | import json
import more_itertools as mit
import os
import emoji
import copy
import argparse
from transformers import BertTokenizer
from utils import get_device, get_token_rationale, add_tokens_to_tokenizer
# Reconstruct dataset
def get_dataset_for_explain(data_dir, tokenizer, method):
with open(data_dir, 'r') as... | alatteaday/mrp_hate-speech-detection | explain_result.py | explain_result.py | py | 9,830 | python | en | code | 8 | github-code | 21 | [
{
"api_name": "json.load",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "emoji.demojize",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "utils.get_token_rationale",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
... |
73565301173 | from widget.tab_widget import TabWidget
from dialog.diagram_name_dialog import DiagramNameDialog
from PyQt5.QtCore import QPoint
from PyQt5.QtWidgets import QMenu, QApplication
from gfx.language_gfx_view import LanguageGfxView
from gfx.logical_rule_view import LogicalRuleView
class LanguageViewTabs(TabWidget):
def... | enjoysmath/abstract-spacecraft | widget/language_view_tabs.py | language_view_tabs.py | py | 2,010 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "widget.tab_widget.TabWidget",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "dialog.diagram_name_dialog",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "dialog.diagram_name_dialog.DiagramNameDialog",
"line_number": 13,
"usage_type": "ca... |
73295450292 | """
# Yes24 웹 베스트샐러 문류별 링크 추출 #
yes24의 분류 각각의 책 내용 크롤링은 편하나
링크는 규칙성을 발견하지 못해 수작업을 하다 빡쳐서 만들어봤다
"""
import re
import requests
import pandas as pd
from bs4 import BeautifulSoup
"""
고영익 조원님의 코드를 조금이라도 유심히 봤다면 내 인생에 5시간을 허비하지 않았.. 크흡
yes24 베스트 셀러 중 소분류 링크의 CategoryNumber는 총 12개의 숫자로 이루어 져있다.
XXX XXX XXX XXX 이렇게 4개 섹션으로 ... | discrea/Book_Category_LSTM_DNN | yes24/yes24_crawling_address_info_2.py | yes24_crawling_address_info_2.py | py | 6,931 | python | ko | code | 0 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_nu... |
74364001972 | from django.urls import path
from rest_api.views import lista_alumnos, detalle_alumno, lista_cursos, lista_profesores, lista_asistencias
urlpatterns = [
path('alumnos/', lista_alumnos, name="Lista de Alumnos"),
path('alumnos/<int:idAlumno>/', detalle_alumno, name="Detalle Alumno"),
path('cursos/', lista_... | Valuchio/API_MOVIL | TestApi_Django/rest_api/urls.py | urls.py | py | 499 | python | es | code | 0 | github-code | 21 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "rest_api.views.lista_alumnos",
"line_number": 5,
"usage_type": "argument"
},
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "rest_... |
71672602612 | import os
import sys
import getopt
import subprocess
import warnings
from traceback import print_exc
import re
import csv
import time
import pickle
import utilities
from parameters import *
def get_video_frame_counts(video_file_names):
"""
Run FFprobe frame count queries for recorded video segments.
:par... | barbourww/I24-video-ingest | query_frames.py | query_frames.py | py | 17,269 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "subprocess.run",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "traceback.print_exc",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "utilities.get... |
72862958132 | import os
import cv2
import matplotlib.pyplot as plt
import numpy as np
import scipy.fftpack
import scipy.ndimage
from skimage.restoration import unwrap_phase
def testImage(pitch=20, dim0=1000, dim1=1250, imgName='fringe_test.png'):
"""Generate and save a test fringe image
pitch: period of cosine functio... | yaor42/Fringe-Analyzer | utility/FringeAnalysisFunctions.py | FringeAnalysisFunctions.py | py | 6,884 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "numpy.arange",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "numpy.empty",
"line_number":... |
2700838497 | #!/usr/bin/env python
#
# Author: Qiming Sun <osirpt.sun@gmail.com>
#
'''
Exact density fitting with Gaussian and planewaves
Ref:
'''
import time
import copy
import tempfile
import numpy
import scipy.linalg
import h5py
from pyscf import lib
from pyscf import gto
from pyscf.lib import logger
from pyscf.gto import ATOM... | sunchong137/pyscf_2017 | df/mdf.py | mdf.py | py | 16,126 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "copy.copy",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pyscf.gto.PTR_ENV_START",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "pyscf.gto",
"line_number": 45,
"usage_type": "name"
},
{
"api_name": "numpy.sqrt",
"li... |
9951972727 | import sys
import json
import requests
import pickle
from selenium import webdriver
from bs4 import BeautifulSoup
import xml.etree.ElementTree as xml
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
driver = '../geckodriver'
addToCart = 'https://www.nike.cl/checkout/cart/add?sku={}&qty=1&seller=1&... | Lautarotetamusa/DarkSupply | shockdrops/restock.py | restock.py | py | 5,977 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "bs4.BeautifulSoup",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "json.dumps",
... |
10524915825 | from rest_framework import generics
from transaction.models import Transaction
from transaction.serializers import TransactionSerializer
class TransactionAPIView(generics.ListCreateAPIView):
queryset = Transaction.objects.all()
serializer_class = TransactionSerializer
def create(self, request, *args, **... | tsybulevskij/s4u-test-assignment | transaction/views.py | views.py | py | 476 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "rest_framework.generics.ListCreateAPIView",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.generics",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "transaction.models.Transaction.objects.all",
"line_number": 8,
"usag... |
27604269293 | import os
import random
from semaphore import Bot, ChatContext
async def docker(ctx: ChatContext) -> None:
if 'known_receiver' in ctx.data:
emoji = ['❤️', '🔥', '👍', '💩', '🐰']
await ctx.message.reply(random.choice(emoji), reaction=True)
else:
ctx.data['known_receiver'] = True
... | lwesterhof/semaphore | docker/bot.py | bot.py | py | 890 | python | en | code | 123 | github-code | 21 | [
{
"api_name": "semaphore.ChatContext",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "random.choice",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "semaphore.Bot",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.environ",
"li... |
34567294033 | import sys
sys.path.append("..")
import os
import numpy as np
import pandas as pd
import tensorflow as tf
from tensorflow.keras.models import load_model
from scriptify import scriptify
from data_preprocessing import get_data
from netcal.scaling import TemperatureScaling
from rs.smoothed_model import SmoothedModel
from... | ccimrie/DeepDECS | case_studies/DNN/code/confusion_matrices.py | confusion_matrices.py | py | 6,762 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.path.append",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_n... |
35004957036 | from src.modules.xlsxTools import getMessage
import requests as r
import wikipedia
import random
def agro(text):
phrases = [ \
f'Как говорил мой дед: "Любишь кататься - катись на хуй, {text}".',
f"Да, я могу допускать ошибки в тексте. Но какие же они пиздатые, что так и ебут тебя в... | chameleon-lizard/MoyshaBot | src/modules/otherTools.py | otherTools.py | py | 5,143 | python | ru | code | 0 | github-code | 21 | [
{
"api_name": "random.choice",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line... |
31790565651 | """
author : Lee Sang Min
github : https://github.com/sangm1n
e-mail : dltkd96als@naver.com
title : 큐
description : Queue
"""
from collections import deque
import sys
input = sys.stdin.readline
q = deque()
N = int(input())
for _ in range(N):
instruct = list(input().split())
if len(instruct) == 2:
q... | sangm1n/problem-solving | BOJ/10845.py | 10845.py | py | 731 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.stdin",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 14,
"usage_type": "call"
}
] |
17981582553 | import json
import requests
from requests.auth import HTTPBasicAuth
BASE_URL = 'https://api.zoop.ws/v1'
TOKEN = None
MARKETPLACE_ID = None
def validate_response(zoopy_response):
if zoopy_response.status_code in [200, 201, 204, 304]:
return zoopy_response.json()
else:
return error(zoopy_respo... | franklindias/zoopy-test | zoopy/utils/handler_request.py | handler_request.py | py | 1,775 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "requests.auth.HTTPBasicAuth",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "requests.delete",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "requests.pos... |
33098384478 | import json
import pandas as pd
import bson
from bson import json_util
#from csv_to_json import json_manipulation
import pymongo
def db_connection():
try:
client = pymongo.MongoClient('mongodb://localhost:27017')
database = client['invoize-uat']
return database
except:
return No... | max-011013/TestRepo | final script/childaccountadd.py | childaccountadd.py | py | 6,009 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "bson.ObjectId",
"l... |
41411261796 | import os
import re
import json
import shutil
from xml.dom import minidom
from dateutil.parser import parse as parse_date
EMPTY = ''
SPACE = ' '
NEWLINE = '\n'
REGEX_UNNECESSARY_NEWLINE = r'(?<=[a-zA-Z ,.])([\r\n])(?!([0-9-]|Inclusion|Exclusion))'
REGEX_UNNECESSARY_NEWLINE2 = r'[a-zA-Z0-9,.\(\)]+\n +[a-zA-Z,.\(\)]'
R... | uw-bionlp/clinical-trials-gov-data | scripts/parse.py | parse.py | py | 6,305 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "os.path.exists",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "shutil.rmtree",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
"line_num... |
21500207293 | import serial
import string
import csv
from datetime import datetime, timezone
ser = serial.Serial('/dev/ttyACM0',9600)
HEADER = ['time', 'rotation', 'velocity']
#what should be sent to ser = velocity and the "steps" from the optical encoder (delimited by a / )
def getData(csvFile):
fileWriter = csv.writer(csvF... | ivy-nguyen18/desk-cycle | SerialSensor.py | SerialSensor.py | py | 886 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "serial.Serial",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
... |
40976036116 | import socket
import cv2
import zmq
import base64
import numpy as np
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM,)
server.bind(("192.168.1.102", 1234))
server.listen()
print("Server is start and listening")
capture = cv2.VideoCapture(0)
while True:
ret, im = capture.read()
im = cv2.resize(im,... | Yarik9001/SoftProteus | Soft/UnitTests/Test_Communication/test_cam/ser.py | ser.py | py | 462 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "socket.socket",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_STREAM",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "cv2.VideoCaptu... |
17413564842 | """
Our goal is to solve the one-dimensional, time-independent Schrodinger
equation wave function for an electron in a harmonic (i.e., quadratic) potential
Note that in theory the wavefunction goes all the way out to x = ±∞, but you can
get good answers by using a large but finite interval. Try using x = −10a to +10a,... | LarsGerhard/Week3Projects | Quantum Oscillator.py | Quantum Oscillator.py | py | 2,638 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.array",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "scipy.integrate.odeint",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"... |
25927482004 | from contextlib import contextmanager
from logging import getLogger
from typing import TYPE_CHECKING, Dict, List
from fastapi import FastAPI
from pkg_resources import iter_entry_points
from anyblok.config import Configuration
from anyblok.registry import Registry
from anyblok_fastapi.common import get_registry_for
i... | AnyBlok/AnyBlok_FastAPI | anyblok_fastapi/fastapi.py | fastapi.py | py | 4,882 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "anyblok.registry.Registry",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "typi... |
73913285813 | from unittest import TestCase, mock, main
from io import StringIO
import os
import handlers
# Helper function to get most recently printed line
def get_last_line(out):
return out.getvalue().strip().splitlines()[-1]
# Helper function for FileNotFoundError tests
def remove_file_or_directory_if_exists(filename):
... | egrfly/git-exception-testing-challenge | test_handlers.py | test_handlers.py | py | 6,899 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.remove",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.rmdir",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "unittest.TestCase",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "unittest.TestCase",
"line_nu... |
35394611432 | import re
import bs4
import requests
from uniborg.util import admin_cmd
from telebot import CMD_HELP
langi = "en"
@telebot.on(admin_cmd(pattern="imdb (.*)"))
@telebot.on(sudo_cmd(pattern="imdb (.*)", allow_sudo=True))
async def imdb(e):
abcd = await eor(e, "`Searching for the movie...`")
try:
movie... | xditya/TeleBot | telebot/plugins/imdb.py | imdb.py | py | 3,999 | python | en | code | 197 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"... |
31632412396 | #! /usr/bin/env python
# Author: Izaak Neutelings (Februari, 2020)
# Description: Standalone to dump gen particle information
# Instructions: Install nanoAOD-tools and run
# python dumpLHE.py
# Sources:
# https://github.com/cms-nanoAOD/nanoAOD-tools#nanoaod-tools
# https://github.com/cms-nanoAOD/nanoAOD-tools/tre... | cms-tau-pog/TauFW | PicoProducer/python/processors/dumpGen.py | dumpGen.py | py | 4,554 | python | en | code | 5 | github-code | 21 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "PhysicsTools.NanoAODTools.postprocessing.framework.eventloop.Module",
"line_number": 56,
"usage_type": "name"
},
{
"api_name": "PhysicsTools.NanoAODTools.postprocessing.framework.da... |
25535627017 | import pandas as pd
import numpy as np
from sklearn.metrics import mean_absolute_error, mean_squared_error
import seaborn as sns
import plotly.express as px
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split
pd.options.display.float_f... | cryptomilk2021/100-predict-earnings | Simple_Linear_Regression.py | Simple_Linear_Regression.py | py | 1,706 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.options",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sklearn.model_se... |
31599831294 | import os
import argparse
import requests
from dotenv import load_dotenv
from datetime import date, timedelta
from file_operations import get_file_extension_from_url, save_remote_image
def save_apods_with_descriptions(apods):
for index, image in enumerate(apods, 1):
url = image['url']
extension = ... | mavel-x/space_pics | fetch_nasa_apods.py | fetch_nasa_apods.py | py | 2,706 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "file_operations.get_file_extension_from_url",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "file_operations.save_remote_image",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 27,
"usage_type": "call"
},... |
25716021100 | import asyncio
import websockets
import threading
import data_generator
import zmq
import pika
import time
import random
import json
import uuid
number_of_threads = 3
def encoder(obj):
if isinstance(obj, uuid.UUID):
# if the obj is uuid, we simply return the value of uuid
return obj.hex
retur... | LiLatee/Engineering_Thesis | data_provider/data_provider.py | data_provider.py | py | 3,173 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "uuid.UUID",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "json.JSONEncoder.default",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "json.JSONEncoder",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "json.lo... |
27651338915 | import os
import PySimpleGUI as sg
class DesligarPc:
def iniciar(self):
layout = [
[sg.Text('Escolha uma opção de tempo para desligar o computador.')],
[sg.Button('30 minutos.')],
[sg.Button('1 hora.')],
[sg.Button('2 horas.')],
[sg.Button('Cance... | RogerSantosO/desligarwin | Desligar PC.py | Desligar PC.py | py | 1,163 | python | pt | code | 0 | github-code | 21 | [
{
"api_name": "PySimpleGUI.Text",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "PySimpleGUI.Button",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "PySimpleGUI.Button",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "PySimpleGUI.Butt... |
31241213766 | print(" [Colors.py] Importing discord & other modules...", end="")
import discord
from discord.ext import commands
from asyncio import sleep
from re import compile
cleanup_delay = 1200 # seconds
print("done!")
def role_has_users(role):
if role.name.startswith("[#"):
people_with_role = [x.name for x in... | SapiensAnatis/spaghetti-bot | modules/Colors.py | Colors.py | py | 8,090 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "asyncio.sleep",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "asyncio.sleep",
"line_number": 87,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 106,
"usage_type": "call"
},
{
"api_name": "asyncio.sleep",
"line_num... |
4106621562 | #!/usr/bin/python3
from flask import Flask
from flask import request
from flask import redirect
from flask import url_for
from flask import session
from flask import render_template
app = Flask(__name__)
app.secret_key= "random random RANDOM!"
groups = [{"hostname": "hostA","ip": "192.168.30.22", "fqdn": "hostA.loc... | CAPITALLETTERMAN/mycode | flaskapi/jinjachallenge01.py | jinjachallenge01.py | py | 1,499 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.request.args.get",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "flask.request.args",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "flask.requ... |
10600225067 | import cv2
import numpy as np
import copy
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
img = cv2.imread("ab.jpg")
original = copy.deepcopy(img)
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
faces = face_cascade.detectMultiScale(gray, 1.3, 5)
for(x,y,w,h) in faces:
cv2.rectangle(img... | human-divanshu/talks | opencv/code/demo13.py | demo13.py | py | 678 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "cv2.CascadeClassifier",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_... |
42318684967 | #!/usr/bin/env python3
# rssupdatepnut
# v0.3.4 for Python 3.5
# Import RSS feed parser:
import feedparser
# Import date parser, parse:
import dateutil.parser
# Import JSON module:
import json
# Import os, used to check if files exist:
import os
# Import @33MHz and @thrrgilag's library for interacting with pnut.i... | bazbt3/rssupdatepnut | rssupdatepnut.py | rssupdatepnut.py | py | 2,991 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "feedparser.parse",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number"... |
74391522613 | from fastapi import APIRouter, status
from .schema import CreatePedidoSchema, GetPedidoSchema
from .usecase import GetAllPedidosUseCase, GetOnePedidoUseCase, RegisterPedidoUseCase, DelOnePedidoUseCase, UpdateStatePedidoUseCase
router = APIRouter()
@router.get("/", status_code=status.HTTP_200_OK, response_model=GetPe... | BrandoWilhan/delivery-api | app/modules/pedido/router.py | router.py | py | 1,159 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "usecase.GetAllPedidosUseCase",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "fastapi.status.HTTP_200_OK",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_... |
41786861200 | from utils.misc import *
import math
# Config
#from agent.DoubleQLearner import Agent
from agent.SocialNQLearner import Agent
from agent.ExperienceReplay import ReplayBuffer
from config.hyperparams import *
from environment.DatabaseEnvironment import Environment
import matplotlib.pyplot as plt
import threading
import ... | JPedroRBelo/SocialDQN | test_from_database.py | test_from_database.py | py | 6,744 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentTypeError",
"line_number": 36,
"usage_type": "call"
},
{
"api_na... |
30324959504 | from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.shortcuts import render, redirect
from Student.models import Student, City, Course
# Create your views here.
@login_required
def home(request):
return redirect('displaystudent')
@login_required
def ... | GanjiDinesh/loginsystem | Student/views.py | views.py | py | 1,797 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.shortcuts.redirect",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.decorators.login_required",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.shortcuts.render",
"line_number": 15,
"usage_type": "call"
... |
10353218682 | import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestRegressor
from sklearn.metrics import mean_squared_error,r2_score
from sklearn.datasets import load_diabetes, load_boston
import streamlit as st
from model import build_model
#----------------------------... | kumarshankar/Auto_ML_app | app.py | app.py | py | 4,538 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "streamlit.set_page_config",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "streamlit.write",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "streamlit.sidebar.header",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "st... |
32444076858 | from armory2.armory_main.models import (
BaseDomain,
Domain,
IPAddress,
Port,
CIDR,
Vulnerability,
CVE,
)
from armory2.armory_main.included.utilities.nmap import import_nmap
from netaddr import IPNetwork
from armory2.armory_main.included.ModuleTemplate import ToolTemplate
import datetime
i... | ryanmrestivo/red-team | Information-Gathering/armory/armory2/armory_main/included/modules/Nmap.py | Nmap.py | py | 16,598 | python | en | code | 91 | github-code | 21 | [
{
"api_name": "sys.version_info",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "armory2.armory_main.included.ModuleTemplate.ToolTemplate",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "armory2.armory_main.models.Domain.objects.get_or_create",
"lin... |
13371799321 | import logging
import os
import subprocess
import urllib.request
import zipfile
from pathlib import Path
from typing import List
from urllib.parse import urlparse
from tqdm import tqdm
logger = logging.getLogger(__name__)
available_legacy_metrics = {
# WMT20 Models
"emnlp20-comet-rank": "https://unbabel-exp... | Unbabel/COMET | comet/models/download_utils.py | download_utils.py | py | 8,029 | python | en | code | 324 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pathlib.Path.home",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "os.path.basename",
... |
32188952055 | """
Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: MIT-0
AWS Disclaimer.
(c) 2019 Amazon Web Services, Inc. or its affiliates. All Rights Reserved.
This AWS Content is provided subject to the terms of the AWS Customer
Agreement available at https://aws.amazon.... | fedaabd/Supporting-Data-Residency-by-Extending-Control-Tower-Governance-to-Nonsupported-Region-2022 | index.py | index.py | py | 7,470 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "boto3.client",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "boto3.resource",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "urllib3.PoolManager",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"lin... |
47394515994 | from django import forms
from authentication.models import User, SecurityQuestion
from core.models import Account
class UserCreateForm(forms.ModelForm):
class Meta:
model = User
fields = ('email', 'ci', 'name', 'last_name', 'is_superuser',
'is_active', 'is_staff', 'role', 'level'... | JySa65/insopesca | authentication/forms.py | forms.py | py | 2,952 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "authentication.models.User",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "core... |
17072330099 | import discord, math, re
from discord.ext import commands
from discord import Embed
from pygicord import Paginator
def syntax(command):
cmd_and_aliases = "|".join([str(command), *command.aliases])
params = []
for key, value in command.params.items():
if key not in ("self", "ctx"):
para... | Cinnamon1212/CyberSecDiscordBot | lib/cogs/help.py | help.py | py | 8,741 | python | en | code | 8 | github-code | 21 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "discord.Embed",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "disc... |
14919517890 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, absolute_import, division
__docformat__ = "restructuredtext en"
# disable: accessing protected members, too many methods
# pylint: disable=W0212,R0904
from hamcrest import is_
from hamcrest import none
from hamcrest import is_not
fr... | OpenNTI/nti.store | src/nti/store/payments/stripe/processor/tests/test_purchase.py | test_purchase.py | py | 9,558 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "hamcrest.is_not",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "unittest.TestCase",
"line_number": 56,
"usage_type": "attribute"
},
{
"api_name": "nti.store.payments.stripe.processor.tests.StripeProcessorTestLayer",
"line_number": 58,
"usage_typ... |
42467242904 | import pygame, sys
from pygame.locals import *
import time
from player import Player
from ghost import Ghost
from window import Window
from map import Map
# returns array consisting of the possible movements the player can make
def collide(surface, x, y):
hitmap = Map(surface)
rgbgrid, rectgrid = hitmap.rgbgr... | ilaishai/pacman | main.py | main.py | py | 2,986 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "map.Map",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pygame.init",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"lin... |
21745898612 | from pypgorm.database import Database
from config import db
if __name__ == '__main__':
Database.connect(**db)
fp = open('pgsql/t_user.sql', 'r', encoding='utf-8')
sql = fp.read()
Database.execute(sql)
fp.close()
| oldjun/PyPgORM | tests/pg_table_create.py | pg_table_create.py | py | 237 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "pypgorm.database.Database.connect",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pypgorm.database.Database",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "config.db",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "py... |
34142790421 | import nltk
import config
import json
# gets noun phrases
def get_noun_phrases(document):
data = []
sentences = nltk.sent_tokenize(document)
sentences = [nltk.word_tokenize(sent) for sent in sentences]
sentences = [nltk.pos_tag(sent) for sent in sentences][0]
grammar = "NP: {<JJ>*<NN|NNP|CD>*}"
... | alseambusher/calls_analyser | lib/parser.py | parser.py | py | 5,296 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "nltk.sent_tokenize",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "nltk.word_tokenize",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "nltk.pos_tag",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "nltk.RegexpParser",... |
73358225011 | """
Feature extracted are as described in section 5.2 in my dissertation.
The procedure is outlined in section 4.2 in my dissertation.
"""
from collections import Counter, defaultdict
from math import sqrt
import config
from preprocessing.transforms import transform_trees, inverse_transform_trees
from tqdm import tqdm... | GavinPHR/Spectral-Parser | spectral_parser/training/feature_extraction.py | feature_extraction.py | py | 3,475 | python | en | code | 8 | github-code | 21 | [
{
"api_name": "preprocessing.transforms.inverse_transform_trees",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "config.train",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "collections.defaultdict",
"line_number": 51,
"usage_type": "call"
},... |
31348665907 | import os
from collections import defaultdict
punct = u".,?![]{}();:\"'=$<>\\/|%^&#`"
# Load in the list of stop words.
stopfn = os.path.join(os.path.dirname(os.path.abspath(__file__)), u"stops.txt")
stops = [line.strip() for line in open(stopfn)]
def tokenize_document(txt, vocab=None):
tokens = [t.lower().str... | dfm/arxiv-analysis | arxiv/text_utils.py | text_utils.py | py | 569 | python | en | code | 20 | github-code | 21 | [
{
"api_name": "os.path.join",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_nu... |
25762431674 | """carrental URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-bas... | eughrat/Django_car_rental_app | carrental/cars/urls.py | urls.py | py | 1,366 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "django.urls.path",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "views.car_view",
"line_number": 25,
"usage_type": "argument"
},
{
"api_name": "django.urls.path",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "views.BookingVie... |
6986255800 | import time
import itertools
import subprocess
letters = 'abcdefghijklmnopqrstuvwxyz'
vowels = 'aeiou'
consonants = 'bcdfghjklmnpqrstvwxyz'
digits = '0123456789'
alphanumerics = letters + digits
two_letter_words = [line.rstrip('\n') for line in open('two_letter_words.txt')]
three_letter_words = [line.rstrip('\n') for ... | immaxchen/DomainNameFinder | DomainNameFinder.py | DomainNameFinder.py | py | 1,044 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "itertools.product",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "subprocess.Popen",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "subprocess.DE... |
8048719893 | import json
import os
import pickle
from dotmap import DotMap
def persist_to_file(file_name):
def decorator(original_func):
try:
cache = pickle.load(open(file_name, 'rb'))
except:
cache = {}
def new_func(*args, **kwargs):
key = pickle.dumps([args, kwar... | mfornet/blockchain-scripts-python | near_rpc/utils.py | utils.py | py | 1,108 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "pickle.load",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pickle.dumps",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pickle.dump",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number"... |
28497951850 | import os
import sys
from collections import namedtuple
import numpy as np
import torch
from gpytorch import lazy
base_dir = os.path.join(os.getcwd(), '..')
sys.path.append(base_dir)
from src.fair import forward
from src.fair.tools import step_I, step_kernel
from src.fair.ancil import get_gas_params, get_thermal_para... | shahineb/FaIRGP | notebooks/utils.py | utils.py | py | 7,324 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "os.path.join",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"line_number":... |
24018835544 | import pandas as pd
import numpy as np
import pickle
from torch.autograd import Variable
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from fraud_model import FraudModel
RANDOM_SEED = 4... | syllogy/graphsignal | examples/offline/fraud_detection_train.py | fraud_detection_train.py | py | 1,995 | python | en | code | null | github-code | 21 | [
{
"api_name": "pandas.read_csv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.value_counts",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.StandardScaler",
"line_number": 29,
"usage_type": "call"
},
{
"api_name... |
18690983977 | # 卷积神经二维互相关运算
from mxnet import autograd, nd
from mxnet.gluon import nn
def corr2d(x, k):
h, w = k.shape
y = nd.zeros((x.shape[0] - h + 1, x.shape[1] - w + 1))
for i in range(y.shape[0]):
for j in range(y.shape[1]):
y[i, j] = (x[i: i + h, j: j + w] * k).sum()
return y
# 自定义二维卷积... | ProgramTraveler/DeepLearning | Convolution_Neural_Network/Correlation_Operation.py | Correlation_Operation.py | py | 2,382 | python | zh | code | 1 | github-code | 21 | [
{
"api_name": "mxnet.nd.zeros",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "mxnet.nd",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "mxnet.gluon.nn.Block",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "mxnet.gluon.nn",
... |
1909526575 | import os
import shutil
from PIL import Image
import imagehash
from pymongo import MongoClient
from hash_util import genHash
# Connect to MongoDB
client = MongoClient("mongodb://localhost:27017/")
db = client["Automation_img"]
collection = db["images"]
# Path to the directory containing images
image_dir ... | SherlockOm/Automated-maize-disease | db_handler.py | db_handler.py | py | 1,750 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "hash_util.genHash",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line... |
33300987208 | from tic_tac_toe import *
from tic_tac_toe.game import Game
from tic_tac_toe.game_logic import Game_logic
from tic_tac_toe.helper_fun import board, check_win, check_draw,scoreboard
import pytest
from termcolor import colored
from tic_tac_toe.minmax import findBestMove
# @pytest.mark.skip()
def test_win_horezental():
... | Errors401/tic-tac-toe | tests/version-1/test_functions.py | test_functions.py | py | 1,549 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "tic_tac_toe.game_logic.Game_logic",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "tic_tac_toe.helper_fun.check_win",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "tic_tac_toe.game_logic.Game_logic",
"line_number": 21,
"usage_type": "... |
40429691645 | from bs4 import BeautifulSoup
import pandas as pd
import requests
import time
import itertools
years = [year for year in range(2002, 2023, 1)]
print(years)
album_list = []
# for year in years:
# response = requests.get(f'https://www.billboard.com/charts/year-end/{year}/top-billboard-200-albums/')
# soup = Bea... | Daniel-Bassett/lyrics_analysis | data-scraping/album_scraper.py | album_scraper.py | py | 1,370 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "time.sleep",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"lin... |
21442361704 | from django.shortcuts import render
from django.http import HttpResponse, HttpResponseNotAllowed, HttpResponseBadRequest, JsonResponse
from django.views.decorators.csrf import csrf_exempt
from users.models import Profile
from sensors.models import Board, Sensor, RawData
from django.core.exceptions import ObjectDoesNotE... | shanhaiying/smart-kitchen | sensors/views.py | views.py | py | 5,375 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.http.HttpResponseNotAllowed",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sensors.models.Sensor.PARAM_TO_INDEX",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "sensors.models.Sensor",
"line_number": 23,
"usage_type": "na... |
73026401973 | """The :mod:`evaluate` module defines the :func:`evaluate` function and
:class:`GridSearch` class """
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from collections import defaultdict
import time
import os
import numpy as np
from six import iteritems
from... | LiuFang816/SALSTM_py_data | python/NicolasHug_Surprise/Surprise-master/surprise/evaluate.py | evaluate.py | py | 10,563 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "os.path.expanduser",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 75,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_nu... |
10648120694 | from time import time
import keras
import tensorflow as tf
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation
from keras.optimizers import SGD
from keras.callbacks import TensorBoard
from keras.utils import multi_gpu_model
#from keras.layers import Lambda, concatenate
#from keras im... | Pablocg0/ContaminationForecast | src/NNSystem/neuralNetworKeras.py | neuralNetworKeras.py | py | 1,436 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "keras.models.Sequential",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "keras.layers.Dense",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "keras.layers.Dense",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "keras.l... |
22939984233 | '''
@File: smtInfringementAuditsApi.py
@time:2021/8/23
@Author:quanliu
@Desc:侵权审核接口服务类
'''
from apps.AllSystemData.DasSystem.das_api.publicCommonUrlSevice import PublicCommonUrlServiceClass
import json
from apps.AllSystemData.DasSystem.das_api.dasSystem_interface_param import DasApiInputParam
from apps.Common_Config.op... | lhh5036/interface | apps/AllSystemData/DasSystem/das_api/myData_manage/smtInfringementAuditsApi.py | smtInfringementAuditsApi.py | py | 3,383 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.current_app.logger.info",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "flask.current_app.logger",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "flask.current_app",
"line_number": 19,
"usage_type": "name"
},
{
"api... |
36122052076 | #!/usr/bin/env python
"""
Functions for converting string "£{pounds}-{pence}" to int of pounds * 100 + pence
"""
from typing import Tuple
from src.denominations import DENOM
__author__ = "Usman Ahmad"
__version__ = "1.0.1"
def cnvt_str_int(str_val: str) -> Tuple[int, str]:
"""
:param str_val:
:return:
... | polardesert/coin-machine | src/input_funcs.py | input_funcs.py | py | 1,207 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "src.denominations.DENOM.keys",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "src.denominations.DENOM",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 13,
"usage_type": "name"
}
] |
11415324749 | import datetime
import sqlite3
from flask import Flask
from flask_restplus import reqparse
from werkzeug.utils import cached_property
from flask_restplus import Api, Resource, fields
from werkzeug.contrib.fixers import ProxyFix
DB_PATH = './tdo.db'
NOTSTARTED = 'not Started'
INPROGRESS = 'in Progress'
FINISHED = 'f... | SachinKrishan/leankloud | p1-todo/todo.py | todo.py | py | 5,486 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "werkzeug.contrib.fixers.ProxyFix",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "flask_restplus.Api",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "flask... |
23900537416 | import logging
from typing import Callable
from openapi_pydantic import Info, OpenAPI, Operation, PathItem, Response
from openapi_pydantic.compat import PYDANTIC_V2
def test_readme_example() -> None:
open_api_1 = readme_example_1()
assert open_api_1
dump_json = getattr(open_api_1, "model_dump_json" if PY... | mike-oakley/openapi-pydantic | tests/test_example.py | test_example.py | py | 1,939 | python | en | code | 17 | github-code | 21 | [
{
"api_name": "openapi_pydantic.compat.PYDANTIC_V2",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "logging.debug",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "openapi_pydantic.OpenAPI",
"line_number": 25,
"usage_type": "call"
},
{
"api_na... |
33936518453 | import random
from itertools import chain, repeat
import re
import pytest
import asyncio
import redis
from redis import asyncio as aioredis
from .utility import *
from .instance import DflyInstanceFactory
from . import dfly_args
import pymemcache
import logging
from .proxy import Proxy
ADMIN_PORT = 1211
DISCONNECT_CR... | dragonflydb/dragonfly | tests/dragonfly/replication_test.py | replication_test.py | py | 57,387 | python | en | code | 21,632 | github-code | 21 | [
{
"api_name": "asyncio.create_task",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "asyncio.sleep",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "asyncio.gather",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "asyncio.create_task"... |
26867887092 | import requests,bs4,re
share_market=requests.get('https://merolagani.com/LatestMarket.aspx')
share_market.raise_for_status()
soup=bs4.BeautifulSoup(share_market.text,'html.parser')
share_table=soup.table
share_body=share_table.tbody
share_rows=set(share_body.contents)
share_rows.remove('\n')
share_rows=list(share_rows)... | Prajwal-Sagar-Sharma/Python-learning-and-projects | sharemarket.py | sharemarket.py | py | 672 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 15,
"usage_type": "call"
}
] |
37946073735 | import pyttsx3
P4R4W = pyttsx3.init()
rate = P4R4W.getProperty("rate")
volume = P4R4W.getProperty("volume")
voices = P4R4W.getProperty("voices")
P4R4W.setProperty("rate",150)
P4R4W.setProperty("volume", 200)
P4R4W.setProperty("voice", voices[1].id)
P4R4W.say("Subscribe My Channel" )
#My Channel Link: https://w... | Paraw212/Text-To-Speech | Voice Changer.py | Voice Changer.py | py | 421 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pyttsx3.init",
"line_number": 4,
"usage_type": "call"
}
] |
46476327534 | import time
import zmq
context = zmq.Context()
filter = "coords"
socket = context.socket(zmq.SUB)
socket.connect("tcp://127.0.0.1:5556")
socket.setsockopt_string(zmq.SUBSCRIBE, '')
print("Subscribing to topic: \"coords\"")
while True:
message = socket.recv_pyobj()
print("x: %f, y: %f, z: %f" % (message[1], m... | onguntoglu/ENcopter | listener.py | listener.py | py | 366 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "zmq.Context",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "zmq.SUB",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "zmq.SUBSCRIBE",
"line_number": 8,
"usage_type": "attribute"
}
] |
30670759003 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 16 13:12:09 2022
@author: iambalakrishnan
"""
import pandas as pd
df = pd.read_csv('https://raw.githubusercontent.com/iambalakrishnan/Stock-Sentiment-Analysis/main/Data.csv',
encoding="ISO-8859-1")
df.head()
train = df[df['Date'... | iambalakrishnan/Stock-Sentiment-Analysis | Predict stock price movement.py | Predict stock price movement.py | py | 1,925 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.read_csv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sklearn.feature_extraction.text.CountVectorizer",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "sklearn.ensemble.RandomForestClassifier",
"line_number": 50,
"usage_type"... |
32472225191 | #!/usr/bin/python3
'''
Smart worker will do predict among week days and do train on weekends
Smart worker will be launched 7 PM every day, but because it may be delayed by previous build,
so we are not sure exact time it starts. However, smart worker will decide prediction or training
by when it really starts.
'''
im... | pohunghuang-nctu/STOCK_PRICE_CNN | smart_worker.py | smart_worker.py | py | 6,056 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pytz.timezone",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "datetime.... |
6350060036 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def convert_defaults(apps, schema_editor):
PlayerDB = apps.get_model("players", "PlayerDB")
for player in PlayerDB.objects.filter(db_typeclass_path="src.players.player.Player"):
player.db_typeclass... | whitehorse-io/encarnia | evennia/evennia/players/migrations/0002_move_defaults.py | 0002_move_defaults.py | py | 562 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.RunPython",
"line_number": 19,
"usage_type": "call"
},
... |
13359352691 | import logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)
import argparse
import boto3
from botocore.waiter import SingleWaiterConfig, Waiter
delegated_account=""
excluded_regions=[]
parser = argparse.ArgumentParser()
parser.add_argument("--delegated_account", "-delegate", help="Delegated Account, ty... | aws-samples/aws-iam-permissions-guardrails | access-analyzer/enablement/create-org-analyzer-stack-set.py | create-org-analyzer-stack-set.py | py | 3,093 | python | en | code | 118 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "botocore.wa... |
42828084803 | import bluetooth
import traceback
app_port = 5577
class BlueChatter:
@staticmethod
def send_message(text: str, mac: str):
sock = bluetooth.BluetoothSocket(bluetooth.RFCOMM)
sock.connect((mac, app_port))
print('connecting to another pair')
try:
sock.send(text)
... | PatrickVibild/BlueChat | blue_chatter.py | blue_chatter.py | py | 408 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "bluetooth.BluetoothSocket",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "bluetooth.RFCOMM",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "traceback.print_exc",
"line_number": 17,
"usage_type": "call"
}
] |
18855652233 | """
(c) 2020 Ruslan Guseinov (ruslan.guseinov@ist.ac.at), IST Austria
Konstantinos Gavriil, TU WienProvided under MIT License
Train and use MDN
"""
import os
import os.path as path
import json
import pickle
import random
import time
from tensorflow.keras.models import Model, load_model
from tensorflow.keras.la... | russelmann/cold-glass-acm | cgb_model/panel_predictor.py | panel_predictor.py | py | 10,833 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "time.time",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 77,
... |
43167874927 | import unittest
from pyrsistent import pmap
from lib.formatter.src._formatter import format_dict_as_grid
from modules.confusion_table.src._confusion_table import ConfusionTable
from modules.confusion_table.src._confusion_table_generator import generate_confusion_table
class IntegrationTest(unittest.TestCase):
... | RamonAranda/ConfusionMatrix | test/integration.py | integration.py | py | 2,255 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "unittest.TestCase",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "modules.confusion_table.src._confusion_table.ConfusionTable",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "lib.formatter.src._formatter.format_dict_as_grid",
"line_n... |
8486867097 | # -*- coding: utf-8 -*-
import h5py
import argparse
import numpy as np
from service.vggnet import VGGNet
import os
import sys
from os.path import dirname
BASE_DIR = dirname(os.path.abspath(__file__))
sys.path.append(BASE_DIR)
def get_imlist(path):
return [os.path.join(path,f) for f in os.listdir(path) if f.endswi... | liyaodev/image-retrieval | index.py | index.py | py | 1,653 | python | en | code | 102 | github-code | 21 | [
{
"api_name": "os.path.dirname",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"l... |
12584815787 | import MySQLdb
import json
import time
from watson_developer_cloud import NaturalLanguageUnderstandingV1
from watson_developer_cloud.natural_language_understanding_v1 import Features, SentimentOptions, EmotionOptions, KeywordsOptions
def initDB():
conn = MySQLdb.connect(host='localhost', port=3306, user='root', p... | ilgwonPark2/SystemAnalysisDesign | data_processing/processing.py | processing.py | py | 6,474 | python | en | code | 6 | github-code | 21 | [
{
"api_name": "MySQLdb.connect",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "watson_developer_cloud.NaturalLanguageUnderstandingV1",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "watson_developer_cloud.natural_language_understanding_v1.Features",
"lin... |
16022821396 | import time
from watchdog.observers import Observer
from watchdog.events import PatternMatchingEventHandler
# periph = '/dev/ttyACM0'
# baudrate = 9600
# ser = serial.Serial(periph, baudrate)
PATHTOBEOBSERVED = '/Users/jojom/Documents/robotic_project/patrouilleur_web/python'
class Test():
def __init__(self):
... | plopsdev/patrouilleur_web | python/command_observer.py | command_observer.py | py | 1,141 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "watchdog.events.PatternMatchingEventHandler",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "watchdog.observers.Observer",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 44,
"usage_type": "call"
}
] |
898713167 | # -*- coding: utf-8 -*-
from sys import exit
from os import path
from array import array
from logging import getLogger, StreamHandler, Formatter, DEBUG
from . import cli
from . import load_transforms
from .visualizer import Visualizer
from threading import Lock
logger = getLogger(__name__)
handler = StreamHandler()... | keik/audiotrans | audiotrans/core.py | core.py | py | 3,919 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.StreamHandler",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.Formatter",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.DEB... |
71393449333 | from turtle import end_fill
from selenium.webdriver.common.by import By
from selenium import webdriver
import time
import tkinter as tk #tkinter=tk
import ttkbootstrap as ttk
from ttkbootstrap.constants import *
def EeclassWebCrawler():
PYTH = "chromedriver.exe" #chromedriver的档案路径
driver = webdriver.Chrome(PY... | CyberAvocado/EeclassWebCrawler | EeclassWebCrawler1.4.py | EeclassWebCrawler1.4.py | py | 4,332 | python | zh | code | 0 | github-code | 21 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "time.sleep",
... |
36195930236 | import bisect
import numpy as np
import matplotlib.pyplot as plt
import matplotlib, os, cv2
import matplotlib.cm as cm
from PIL import Image
import torch.nn.functional as F
import torch
def _compute_conf_thresh(data):
dataset_name = data['dataset_name'][0].lower()
if dataset_name == 'scannet':
thr = 5... | TruongKhang/TopicFM | src/utils/plotting.py | plotting.py | py | 12,456 | python | en | code | 87 | github-code | 21 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.tight_layout",
"line_number": 37,
"usage_type": "call"
},
{
"api_n... |
36746191345 |
import numpy as np
import os
from scipy.misc import imread, imresize
import matplotlib.pyplot as plt
print ("PACKAGES LOADED")
#Print Current Folder
cwd = os.getcwd()
print("Current folder is %s" %(cwd))
#print Function
def print_typeshape(img):
print("Type is %s" %(type(img)))
print("Shape is %s" %(img.sha... | seungjae6874/Deeplearning | image.py | image.py | py | 2,186 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.getcwd",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "scipy.misc.imread",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot... |
74320697014 | from jinja2 import Environment as JinjaEnvironment
from jinja2 import PackageLoader as JinjaPackageLoader
from ...plugin import Plugin
class XmlPlugin(Plugin):
@staticmethod
def get_name():
return 'xml'
@staticmethod
def get_output_file_extension():
return 'xml'
def __init__(sel... | HeadHaus/frakky | frakky/plugin/default/xml/xml_plugin.py | xml_plugin.py | py | 742 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "plugin.Plugin",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "jinja2.Environment",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "jinja2.PackageLoader",
"line_number": 19,
"usage_type": "call"
}
] |
12700214090 | import numpy as np
import random
import math
import torch
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
import torch.nn.functional as F
import matplotlib.pyplot as plt
class ReplayMemory:
"""
Class for storing the reinforcement learning agent's past experience.
"""
... | amanb2000/Mind_over_Music | cortex_experiments/singleModulatorReinforcementAgent.py | singleModulatorReinforcementAgent.py | py | 6,565 | python | en | code | 7 | github-code | 21 | [
{
"api_name": "random.sample",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "torch.nn.Module.__init__"... |
69894947254 | #!/usr/bin/env python
# 3rd Party Packages
import sys
import argparse
# ROS Packages
import rospy
import roslib
from mavros_msgs.msg import HomePosition
from mavros_msgs.srv import CommandHome
from pygeodesy import GeoidKarney
from uav_rosplan.interface import UAVActionInterface
from uav_rosplan.preflightcheck import... | ferdianjovan/uav_rosplan | scripts/flight_test.py | flight_test.py | py | 4,337 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pygeodesy.GeoidKarney",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "roslib.packages.get_pkg_dir",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "roslib.packages",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name":... |
14758168910 | # Подключаем библиотеку
import telebot
# Здесь нужно вставить токен, который дал BotFather при регистрации
# Пример: token = '2007628239:AAEF4ZVqLiRKG7j49EC4vaRwXjJ6DN6xng8'
token = '5915311196:AAEj036sM4vVsQMHgJ9n6x_9INGE_TUk5c4' # <<< Ваш токен
# В этой строчке мы заводим бота и даем ему запомнить токен
bot = tele... | Kyo473/Python_bot | hello.py | hello.py | py | 855 | python | ru | code | 0 | github-code | 21 | [
{
"api_name": "telebot.TeleBot",
"line_number": 9,
"usage_type": "call"
}
] |
533435382 | import os
import warnings
warnings.filterwarnings(action="ignore")
from data import loading
from argparse import ArgumentParser
parser = ArgumentParser()
parser.add_argument("-a", "--atype", type=str)
args = parser.parse_args()
if __name__ == "__main__":
FLAGS = args
atype = FLAGS.atype if FLAGS.atype e... | delojmkt/data_loader | main.py | main.py | py | 585 | python | ko | code | 0 | github-code | 21 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "data.loading",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "data.load... |
2078706058 | import matplotlib.pyplot as plt
from matplotlib import ticker
import numpy as np
import pandas as pd
def plot_interpolated_ts(raw_data, clean_data):
fig2 , ax2 = plt.subplots()
fig2.subplots_adjust(right=0.85)
ax2Q=ax2
ax2T=ax2Q.twinx()
ax2C=ax2Q.twinx()
ax2T.spines.right.set_position(("axe... | ArlexMR/Hysteresis-Analysis | src/plots.py | plots.py | py | 2,930 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "numpy.nanmax",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "numpy.nanmax"... |
35026455335 | import jwt
from flask import jsonify, request
import urls.basic_urls as bu
from models import Car, app, db, Rent, User
from schema import RentSchema
@app.route("/rent", methods=['POST'])
def create_rent():
auth_token = request.args.get('access_token')
try:
keys = bu.decode_auth_token(auth_token)
... | ViraMaximets/REST-API-Flask | urls/rent_urls.py | rent_urls.py | py | 2,896 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.request.args.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.request.args",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "urls.bas... |
74991350131 | import os
from urllib.parse import quote
from gi.repository import Gtk
from quodlibet import _, print_d, print_w, app
from quodlibet import qltk
from quodlibet import util
from quodlibet.errorreport import errorhook
from quodlibet.formats import AudioFileError
from quodlibet.qltk import Icons
from quodlibet.util impo... | quodlibet/quodlibet | quodlibet/qltk/lyrics.py | lyrics.py | py | 4,543 | python | en | code | 1,306 | github-code | 21 | [
{
"api_name": "gi.repository.Gtk.VBox",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "gi.repository.Gtk",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "gi.repository.Gtk.TextView",
"line_number": 19,
"usage_type": "call"
},
{
"api_name... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.