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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
71271940848 | import os
from copy import deepcopy
import streamlit as st
from langchain.chains import ConversationChain
from langchain.chains.question_answering import load_qa_chain
from langchain.chat_models import ChatOpenAI
from langchain.docstore.document import Document
from langchain.memory import ConversationSummaryBufferMe... | prcore/assistant | chat.py | chat.py | py | 4,098 | python | en | code | 26 | github-code | 2 | [
{
"api_name": "streamlit.session_state",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "copy.deepcopy",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "streamlit.session_state",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name"... |
23095818429 | """empty message
Revision ID: 231baef6ed8c
Revises: 11cfc69fd369
Create Date: 2023-05-23 00:17:38.643626
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '231baef6ed8c'
down_revision = '11cfc69fd369'
branch_labels = None
depends_on = None
def upgrade():
# ... | TiNiZa16388/SFND_01_fyyr | projects/01_fyyur/starter_code/migrations/versions/231baef6ed8c_.py | 231baef6ed8c_.py | py | 798 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "alembic.op.batch_alter_table",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.... |
41155265322 | import scrapy
import re
from moocscrapy.items import MoocscrapyItem
class GuokrSpider(scrapy.Spider):
name = "guokr"
allowed_domains = ["guokr.com"]
start_urls = [
"http://mooc.guokr.com/course/"
]
def parse(self, response):
for sel in response.xpath('//li[@class="course"]'):
item = MoocscrapyItem()
it... | lukangping/moocsearch | moocscrapy/moocscrapy/spiders/guokr_spider.py | guokr_spider.py | py | 638 | python | en | code | 1 | github-code | 2 | [
{
"api_name": "scrapy.Spider",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "moocscrapy.items.MoocscrapyItem",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 20,
"usage_type": "call"
}
] |
11156178108 | import json
import os
import pandas as pd
def process_json_file(file_path, output_path, output_num):
with open(file_path, "r", encoding="utf8") as f:
data = json.load(f)
df = pd.json_normalize(data)
# Excel sınırını aşıyorsa, output_num parametresine göre dosya ismi oluştur
if len(df) > 1048... | DURUK-Mehmet/Is_Yeri_Kodlar | json-to-xlsx.py | json-to-xlsx.py | py | 1,544 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "json.load",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.json_normalize",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.splitext",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_n... |
74906677807 | import sys
import os
from datetime import datetime
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5 import uic, QtCore, QtWidgets
from modelos.tabla_inventario import ModeloPrincipal
from modelos.proveedores import ModeloProveedor
from modelos.tabla_cliente import ModeloClie... | DanielSajvin/Proyecto_basedatos | View/ventana_menu.py | ventana_menu.py | py | 13,294 | python | es | code | 0 | github-code | 2 | [
{
"api_name": "modelos.tabla_inventario.ModeloPrincipal",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "modelos.proveedores.ModeloProveedor",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "modelos.tabla_cliente.ModeloCliente",
"line_number": 23,
"us... |
71708335753 | import queue
from collections import deque
lines = []
maze = []
with open('zad12_demo.txt') as f:
# with open('zad12_input.txt') as f:
for line in f:
maze.append([i for i in line.strip("\n")])
for m in maze:
print(m)
def passable(nr, nc, old_r, old_c, maze):
if(maze[nr][nc] == maze[old_r][old_c]):
return Tru... | Hovac/AOC2022 | task_12/zad12.py | zad12.py | py | 1,499 | python | en | code | 0 | github-code | 27 | [
{
"api_name": "collections.deque",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "queue.appendleft",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "queue.pop",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "queue.appendleft",
"... |
32402080561 | from PyQt5.QtWidgets import QMainWindow, QWidget, QVBoxLayout, QGridLayout, QGroupBox
from PyQt5.QtWidgets import QLabel, QPushButton, QLineEdit
from datetime import datetime
import unicodedata
import CurrencyConverter.internal.AppConfigurations as conf
from CurrencyConverter.internal.ConversionRateFetcher import Co... | basti42/CurrencyConverter | internal/CurrencyConverterApp.py | CurrencyConverterApp.py | py | 10,110 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "CurrencyConverter.internal.AppConfigurations.LEFTOFFSET",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "CurrencyConverter.internal.AppConfigurations",
"line... |
20147357939 | #data analysis (arrays, built-in functions)
import numpy as np
import pickle
import tensorflow as tf
from utils import bag_of_words, tokenize, stem, preprocess, stopword, get_wordnet_pos, lemmatizer
file = open('vocab.pkl', 'rb')
# dump information to that file
all_words = pickle.load(file)
#load model
model = tf.k... | Junaid-Zulfiqar/SM-SemanticAnalysis | Tensorflow/inference_sentiment_analysis.py | inference_sentiment_analysis.py | py | 986 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "pickle.load",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.models.load_model",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "... |
32126699882 | # -*- coding: utf-8 -*-
# @Author : lantary
# @Email : lantary-w@qq.com
# @Blog : https://lantary.cn
import os
import sys
import yaml
import click
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(BASE_DIR)
from core.JianShu import JianShu
def read_config():
current_p... | lantary-w/ScribbleSync | core/main.py | main.py | py | 974 | python | en | code | 1 | github-code | 2 | [
{
"api_name": "os.path.dirname",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"l... |
36167131071 | import time
import phonenumbers
import pycountry
from appium import webdriver as appDriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from config import config
from phonenumbers.phonenumberutil i... | Parth-khunt-vibrantcoders/automation_9 | public/backend_automation/Parth_Khunt_701613/comviva/brand/app/viber.py | viber.py | py | 2,609 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "config.config.udid",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "config.config",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "appium.webdriver.Remote",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "appium.... |
24468157076 | import sys
import argparse
from pyfiglet import Figlet
from random import randint
def main():
parser = argparse.ArgumentParser()
parser.add_argument("-f", "--format", help="set the format")
try:
args = parser.parse_args()
except SystemExit:
print("Invalid usage")
sys.exit(1)
... | SadiJunior/cs50 | week6/problems/figlet/figlet.py | figlet.py | py | 740 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pyfiglet.Figlet",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "random.randint",
... |
7799297523 | import numpy as np
import math
import scipy.special
class NeuralNetWork:
def __init__(self, input_nodes, hid_nodes, output_nodes, learn_rate):
self.num_input_nodes = input_nodes
self.num_hid_nodes = hid_nodes
self.num_output_nodes = output_nodes
self.learn_rate = learn_rate
... | trqminh/handwritten-digit-recognition | neuralNetwork.py | neuralNetwork.py | py | 2,030 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "numpy.random.normal",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "math.pow",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.random.normal",
... |
71712537648 | import pandas as pd
import numpy as np
from sklearn.model_selection import cross_val_score
from sklearn.tree import DecisionTreeRegressor
import matplotlib.pyplot as plt
train_data = pd.read_csv('train.csv', encoding='big5')
data = train_data.iloc[:, 3:]
data[data == 'NR'] = 0
data = pd.DataFrame(data)
new_data = d... | emotional2020/ML-notes | hw1_data/hw.py | hw.py | py | 1,845 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "pandas.read_csv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sklearn.tree.DecisionTr... |
14934944853 | # -*- coding: utf-8 -*-
import codecs, os, sys, json
from optparse import OptionParser
# Convert the txt queries file to json format.
def queries():
queries = []
with codecs.open(os.path.join("mesh", "data", "queries.tsv"), "r", encoding="utf-8") as fin:
content = fin.readlines()
for line in content:
spl_lin... | PAJEAN/diseases_segmentation | formatting.py | formatting.py | py | 3,290 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "codecs.open",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "codecs.open",
"line_number": 1... |
32306478043 | import bq_utils
import json
import os
from ruamel.yaml import YAML
from ruamel.yaml.scalarstring import walk_tree
yaml = YAML()
yaml.default_flow_style = False
SCOPES = ['https://www.googleapis.com/auth/cloud-platform', 'https://www.googleapis.com/auth/bigquery']
# bq cli project - costs
project = 'project'
table_... | Michal-Milik/utils_bq | examples/create_vw_base_on_table_list.py | create_vw_base_on_table_list.py | py | 1,520 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "ruamel.yaml.YAML",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "bq_utils.get_bq_cli",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "bq_utils.build_table_vi... |
34811586187 | """
Initializable iterators take inputs. These inputs are fed into
the initialization operator as a feed_dict.
"""
import tensorflow as tf
from termcolor import cprint
with tf.Session() as sess:
max_value = tf.placeholder(tf.int64, shape=[])
dataset = tf.data.Dataset.range(max_value)
it = dataset.make_init... | geyang/tensorflow_data_loading | initializable_data_loader.py | initializable_data_loader.py | py | 883 | python | en | code | 3 | github-code | 2 | [
{
"api_name": "tensorflow.Session",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "tensorflow.placeholder",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "tensorflow.int64",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "tensorfl... |
19402359748 | import wavelet_lvm as wl
import matplotlib.pyplot as plt
import numpy as np
file = 'dane_2f/M170614_161008.lvm'
data = np.loadtxt('dane_2f/M170614_161008.lvm')[:, 1:]
encoded = wl.encode_file(file)
decoded = wl.decode_binary(encoded)
for chan in range(decoded.shape[1]):
plt.plot(data[:, chan], label='original')... | tomaszjonak/msc-thesis | implementacja/sync/compressors/wavelet/test_transmission2.py | test_transmission2.py | py | 497 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "numpy.loadtxt",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "wavelet_lvm.encode_file",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "wavelet_lvm.decode_binary",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotl... |
17029091020 | import logging
import os
import uuid
from django.conf import settings
from django.core.paginator import Paginator
from django.http import HttpResponse, HttpResponseForbidden
from django.shortcuts import get_object_or_404
from django.shortcuts import render
from django.utils import timezone
from django.views.decorators... | aleksey31111/blogOlga | olgaDjangoBlog_9_01_2023/djangoblog/blog/views.py | views.py | py | 13,835 | python | ru | code | 0 | github-code | 2 | [
{
"api_name": "logging.getLogger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "django.views.generic.list.ListView",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "django.conf.settings.PAGINATE_BY",
"line_number": 34,
"usage_type": "attribute"
},... |
22832416403 | from selenium import webdriver
from selenium.webdriver.common.by import By
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.support.ui import Select
import time
driver = webdriver.Chrome(ChromeDriverManager().install())
driver.implicitly_wait(10)
driver.get('https://www.orangehrm.com/... | adhikaripradeep/SeleniumPython | SeleniumSessions/DropDownHandle.py | DropDownHandle.py | py | 1,784 | python | en | code | 1 | github-code | 2 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "webdriver_manager.chrome.ChromeDriverManager",
"line_number": 8,
"usage_type": "call"
},
{... |
26589875656 | '''Create data class with review'''
import random
class Sentiment:
NEGATIVE = "NEGATIVE"
NEUTRAL = "NEUTRAL"
POSITIVE = "POSITIVE"
class Review:
def __init__(self, text, score):
self.text = text
self.score = score
self.sentiment = self.get_sentiment()
def get... | ChristopherSwindell/Python_Learning_Codes | Learn_SciKit.py | Learn_SciKit.py | py | 6,074 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "random.shuffle",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "sk... |
14964658591 | from django.conf.urls import url
from .views import (
LoginAPIView, RegistrationAPIView, CustomUserAPIView
)
urlpatterns = [
# url(r'^user/?$', UserRetrieveUpdateAPIView.as_view()),
url(r'^users/registration?$', RegistrationAPIView.as_view()),
url(r'^users/login?$', LoginAPIView.as_view()),
url(r'... | mahfuz110244/django-rest-framework | jwt-token-authentication/api/authentication/urls.py | urls.py | py | 368 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "django.conf.urls.url",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "views.RegistrationAPIView.as_view",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "views.RegistrationAPIView",
"line_number": 9,
"usage_type": "name"
},
{
"api... |
17322239330 | #!/usr/bin/env python
import argparse
import buildfarm.repo
import sys
def parse_options():
parser = argparse.ArgumentParser(description="List all packages available in the repos for each arch. Filter on substring if provided")
parser.add_argument("rosdistro",
help='The ros distro. e... | ros-infrastructure/buildfarm | scripts/count_ros_packages.py | count_ros_packages.py | py | 1,311 | python | en | code | 6 | github-code | 2 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "buildfarm.repo.repo.count_packages",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "buildfarm.repo.repo",
"line_number": 30,
"usage_type": "attribute"
},
{
... |
14971327097 | from multiprocessing import Process, Lock
#Anna Litvinenko
#IP-53
#1.10 A=B*MIN(C)*(MA*MD+MD)
#2.10 MK=MA*(MA*MZ)+TRANS(MB)
#3.10 O=SORT(R+S)*(MT*MP)
import threading
N = 3
#введение вектора
def readVect():
vector = []
for i in range(N):
vector.append(1)
return vector
#введение матрицы
def readMatr... | AnnaLitv/Parallel_Programming | Python/lab7.py | lab7.py | py | 4,563 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "multiprocessing.Lock",
"line_number": 176,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Process",
"line_number": 177,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Process",
"line_number": 178,
"usage_type": "call"
},
{
"api_name"... |
18528069398 | """
Execute table data transfer operations between two databases Postgres
and MSSQL. These functions are building blocks of Operators that copy
data following full and incremental strategies.
"""
from datetime import datetime
from typing import Dict
from airflow.hooks.base import BaseHook
from fastetl.custom_functio... | gestaogovbr/FastETL | fastetl/hooks/db_to_db_hook.py | db_to_db_hook.py | py | 2,236 | python | en | code | 44 | github-code | 2 | [
{
"api_name": "airflow.hooks.base.BaseHook",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "fastetl.custom_fu... |
42953850347 | from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.common.by import By
import pandas as pd
import re
video_trend = []
channel_name = []
op = webdriver.ChromeOptions()
op.add_argument('headless')
driver =... | zackariadaoudi/YouTube-Scraper | Channels_scraper.py | Channels_scraper.py | py | 1,959 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "selenium.webdriver.ChromeOptions",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 13,
"usage_type": "call"
},
{
"api... |
1134731058 | import os
import gettext
import platform
from pathlib import Path
if platform.system() == "Windows":
from text_unidecode import unidecode
else:
from unidecode import unidecode
from yuki_iptv.m3u import M3UParser
from yuki_iptv.xspf import parse_xspf
from yuki_iptv.qt6compat import qaction
from yuki_iptv.qt im... | yuki-iptv/yuki-iptv | usr/lib/yuki-iptv/yuki_iptv/m3u_editor.py | m3u_editor.py | py | 15,065 | python | en | code | 40 | github-code | 2 | [
{
"api_name": "platform.system",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "yuki_iptv.qt.get_qt_library",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "gettext.gettext",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.en... |
4503743729 | from datetime import date
import numpy as np
from matplotlib import cm
import matplotlib.pyplot as plt
import csv
from celluloid import Camera
import pandas as pandasForSortingCSV
NUM_STEPS = 150
TRESHOLD = 47
Data = ['./output/landscape_exportInfo.csv','./output/moatGauss_exportInfo.csv', '.\output\grid_exportInfo.c... | mcenek/cognitiveABM | Examples/HillClimberABMExample/animate.py | animate.py | py | 4,328 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "pandas.read_csv",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "csv.QUOTE_NONNUMERIC",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "csv.DictReader",... |
23260043104 | import telebot
import re
import config
from Model import Model
URL = "https://api.telegram.org/bot%s/" % config.BOT_TOKEN
bot = telebot.TeleBot(config.BOT_TOKEN)
db = Model()
@bot.message_handler(commands=['help'])
def help(message): # Название функции не играет никакой роли, в принципе
bot.send_message(message.... | TashaSl/to_exam_with_Telegram | main.py | main.py | py | 2,981 | python | ru | code | 0 | github-code | 2 | [
{
"api_name": "config.BOT_TOKEN",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "telebot.TeleBot",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "config.BOT_TOKEN",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "Model.Model"... |
27602875852 | from xml.dom import minidom
import pandas as pd
from lxml import etree
import logging
import requests
from bs4 import BeautifulSoup
def read_xlsx(input_file):
"""
This function takes a name of input Excel file,
reads it and puts data to DataFrame df and file_name.
"""
logging.info('Loading... | Dilara0880/generateXML | main.py | main.py | py | 3,522 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "logging.info",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pandas.read_excel",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.read_excel",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "requests.get",
"... |
33338531511 | import coembedding
from utils import *
import networkx as nx
from blast_tools import BlastParser
from typing import Any, Callable, Dict, List, NewType, Tuple, Set
Graph = NewType('nx Graph', nx.Graph)
Hit = NewType('Hit object defined in blast_tools.py', Callable)
def meets_threshold(hit: Hit, query_coverage: float, ... | v0rtex20k/MUNDO | src/core_src/landmark_selection.py | landmark_selection.py | py | 2,905 | python | en | code | 1 | github-code | 2 | [
{
"api_name": "typing.NewType",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "networkx.Graph",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "typing.NewType",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "typing.Callable",
... |
16333801343 | from django.http import HttpResponseRedirect
from django.shortcuts import render, get_object_or_404, redirect
from .models import Group, PM, Project, Student, TimeSlot
def show_time_slots(request, project_id, user_id, error_id=None):
student = get_object_or_404(Student, id=user_id)
project = get_object_or_40... | nekto007/project-automation | projectautomation/views.py | views.py | py | 1,760 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "django.shortcuts.get_object_or_404",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "models.Student",
"line_number": 8,
"usage_type": "argument"
},
{
"api_name": "django.shortcuts.get_object_or_404",
"line_number": 9,
"usage_type": "call"
},
{
... |
28614487931 | #coding:utf8
'''
akshare的A股历史数据
A 股数据是从新浪财经获取的数据, 历史数据按日频率更新
限量: 单次返回具体某个 A 上市公司的所有历史行情数据
'''
import akshare as ak
import pandas as pd
import time
import os
import pickle
import requests
from akshare.stock.cons import (zh_sina_a_stock_hfq_url,
zh_sina_a_s... | Micats/SinaQuote | QuoteCenter/quotes/history.py | history.py | py | 12,829 | python | en | code | 2 | github-code | 2 | [
{
"api_name": "sys.path.append",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "utils.ylog.add_file_1",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "utils.ylog",
... |
27166732795 | import collections
class TrieNode(object):
def __init__(self):
"""
Initialize your data structure here.
"""
self.childNode = collections.defaultdict(TrieNode)
self.isEnd = False
class Trie(object):
def __init__(self):
self.root = TrieNode()
def insert(self,... | xdreamseeker/Till | lt/prefixTree.py | prefixTree.py | py | 1,586 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "collections.defaultdict",
"line_number": 7,
"usage_type": "call"
}
] |
17961321282 | """
The Menu Bar task will be listed at the bottom of the screen
this menu will provide the ability to create new tasks and switch
to other screens for example, the timer screen and the statistics
screen.
"""
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
from kivy.utils im... | pesegal/tasktracker | tasktracker/menubar.py | menubar.py | py | 5,663 | python | en | code | 1 | github-code | 2 | [
{
"api_name": "kivy.uix.boxlayout.BoxLayout",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "mixins.Broadcast",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "themes.themes.Themeable",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": ... |
22044485733 | import os
import re
from pathlib import Path
from . import config
from .runner import runner
def setup():
"""Extract tRNAScan covariance models as separate files."""
base = os.path.join("usr", "lib", "tRNAscan-SE", "models")
cm_dbs = {
"TRNAinf-arch-iso": "A",
"TRNAinf-bact-iso": "B",
... | RNAcentral/R2DT | utils/gtrnadb.py | gtrnadb.py | py | 7,411 | python | en | code | 53 | github-code | 2 | [
{
"api_name": "os.path.join",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_numbe... |
41838345099 | '''
现实任务中通常是利用有限个测试样例来绘制 ROC ,此时仅能获得有
限个(真正例率,假正例 )坐标对,无法产生图 的光滑 ROC 曲线, 只能
绘制出所示的近似 ROC 曲线.绘图过程如下:
给定 m+ 个正例和个反例,根据学习器预测结果对样例进排序,然后把分类阔值设最大,
即把所样例均预测为反例,此时真正例率和假正例率均为 坐标
标记一个点然后,将分类阈值依次设为每个样例的预测值,即依次将每个样例
划分为正例.设前一个标记点坐标为(x,y) ,若为真正例,则对应标记点的
坐标为 (X ,y+(1/m+)) ;当前若为假正例,则对应标记点的坐标为 (X+1/m- ,y) ,
然后用线段连接相邻点即ROC曲线
'''
impo... | skingford/learn-python | spider/spider-peewee/roc/roc.py | roc.py | py | 1,806 | python | zh | code | 0 | github-code | 2 | [
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.xlabel",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "mat... |
16893889014 | # Tableau 어제 기준 국내 박스오피스 테이블 생성용 데이터 csv파일 생성 (관객수 데이터 str)
import re
from bs4 import BeautifulSoup
import requests
import pandas as pd
from datetime import date, timedelta
# OPEN API 파라미터 입력을 위한 datetime -> str
yesterday = date.today()-timedelta(1)
yesterday_keyword = str(yesterday).replace('-', '')
# 영화진흥위원회_영화박스오피... | anydevil0812/BoxOffice | movie_boxoffice_table.py | movie_boxoffice_table.py | py | 2,438 | python | ko | code | 0 | github-code | 2 | [
{
"api_name": "datetime.date.today",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "datetime.timedelta",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "requests.get",
... |
38109905564 | """ A multithreaded image file loader. """
import os # built-in library
import time # built-in library
import threading # built-in library
import urllib.request # built-in library
import tempfile # built-in library
import traceback ... | toaarnio/glview | glview/imageprovider.py | imageprovider.py | py | 8,698 | python | en | code | 2 | github-code | 2 | [
{
"api_name": "threading.Thread",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "imsize.read",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "psutil.virtual_memory",
"l... |
9904281698 | import json
from Structures.record import Record
from Structures.user import User
from Structures.organization import Organization
class Peoplechain(object):
users = []
unconfirmed_records = []
organizations = []
def __init__(self, remote_chain_data=None):
if remote_chain_data is None:
... | the07/PC5 | Node/Structures/peoplechain.py | peoplechain.py | py | 4,633 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "Structures.user.User.from_json",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "Structures.user.User",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "json.loads",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "Struct... |
43616943422 | ##
from bs4 import BeautifulSoup
import requests,logging
import acqua.aqueduct as aq
import pandas as pd,re
import acqua.parametri as parm
gestore = "GestAcquaAlessandria"
aq.setEnv('Piemonte//'+gestore)
#
useThisDictionary = parm.crea_dizionario('Metadata/SynParametri.csv')
parametersAdmitted = parm.getParametersAdmit... | figuriamoci/Acqua | Piemonte/GestAcquaAlessandria/4-DataReportCollection.py | 4-DataReportCollection.py | py | 1,619 | python | en | code | 1 | github-code | 2 | [
{
"api_name": "acqua.aqueduct.setEnv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "acqua.aqueduct",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "acqua.parametri.crea_dizionario",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "ac... |
38883334278 |
from rsa import sign, newkeys
import hashlib
import json
ok, ck = newkeys(64)
# print(ok.e, ok.n)
ok_e = 65537
ok_n = 13803477786977214143
# ok (e, n)
ok = str(ok_e) + ' ' + str(ok_n)
data = {'OK': ok,
'code': 0,
'phone': '+79515204457'}
data = json.dumps(data, sort_keys=True)
data = ... | ShamilyanOksana/Blockchain | hash_rsa.py | hash_rsa.py | py | 424 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "rsa.newkeys",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "hashlib.sha256",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "rsa.sign",
"line_number": 22... |
24144310668 | #사용자 정의 클래스
from Util.Util import Util
from Layer.MultiClassNetWork import *
#외부 프레임워크
import tensorflow as tf
from sklearn.model_selection import train_test_split
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, SimpleRNN, LSTM
from tensorflow.keras.preprocessing import... | SungPyo-LEE/SouthSEA_SST_PREDICT_MODEL | Main/Main_use_RNN.py | Main_use_RNN.py | py | 6,066 | python | ko | code | 0 | github-code | 2 | [
{
"api_name": "Util.Util.Util",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.utils.to_categorical",
"line_number": 85,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras",
"line_number": 85,
"usage_type": "attribute"
},
{
"api_na... |
23939483310 | from datetime import datetime
from typing import cast
from discord import (
Member,
Guild,
HTTPException,
Status,
Interaction,
AppCommandType,
Embed,
)
from discord.app_commands import describe, context_menu
from discord.app_commands import guild_only as ac_guild_only
from discord.ext.comma... | regulad/PepperCord | src/extensions/features/statuswatch.py | statuswatch.py | py | 7,898 | python | en | code | 2 | github-code | 2 | [
{
"api_name": "discord.Interaction",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "discord.Member",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "utils.bots.CustomContext",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "utils.bot... |
73605317832 | import pandas as pd
import random
from datetime import datetime, timedelta
from json import dumps
from kafka import KafkaProducer
from time import sleep
# Kafka broker address and topic names definition
SERVER_URI = "<KAFKA BROKER URI>"
SERVER_PORT = "<KAFKA BROKER PORT>"
RAW_DATA_TOPIC = "raw_data"
LAB_DATA_TOPIC = ... | ZipBomb/kafka-tfm | kafka/producer/measure_producer.py | measure_producer.py | py | 2,677 | python | en | code | 2 | github-code | 27 | [
{
"api_name": "kafka.KafkaProducer",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line... |
22315046259 | # run django for standalone DB and the main bot
if __name__ == "__main__":
import os
import django
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'db.config.settings')
django.setup()
from django.conf import settings
from bot.conf import bot_conf
from bot.launch import run
initial_ex... | ponpondev/francis-discord-bot | run.py | run.py | py | 689 | python | en | code | 0 | github-code | 27 | [
{
"api_name": "os.environ.setdefault",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.setup",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "bot.conf.bot_conf.DEB... |
24926683629 | # _*_ coding:utf-8 _*_
# Leo70kg
from __future__ import division
from WindPy import w
import pandas as pd
import numpy as np
from Database import Util
import datetime
from FutureOption import VolCal
from QuoteBase import QuoteBase
from OptionPricing import BsModel
import time
from scipy.optimize import curv... | Leo70kg/MultiFactorModel | Work/OptionQuote/QuoteOutput.py | QuoteOutput.py | py | 18,435 | python | zh | code | 1 | github-code | 2 | [
{
"api_name": "FutureOption.VolCal",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.minimum",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "scipy.optimize.curve_fit",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "numpy.arra... |
7807133815 | # -*- coding: utf-8 -*-
import scrapy
from scr1.items import item163
from scrapy.selector import Selector
class baidu(scrapy.Spider):
name = "163"
#allowed_domains = ["news.baidu.com"]
start_urls = ['http://news.163.com/special/0001386F/rank_news.html']
def parse(self, response):
#sel = Se... | abbaangel/scrapy | scr1/scr1/spiders/163.py | 163.py | py | 1,139 | python | en | code | 0 | github-code | 27 | [
{
"api_name": "scrapy.Spider",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "scr1.items.item163",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "scrapy.Request",
"line_number": 23,
"usage_type": "call"
}
] |
7277956932 | from collections import deque
import sys
n, m = map(int, sys.stdin.readline().split())
man = deque()
res = []
for i in range(1,n+1):
man.append(i)
while man:
for i in range(m):
if i == m-1:
out = man.popleft()
res.append(out)
else:
out = man.popleft()
... | rlagusgh0223/Algorithm | 1212/1158, 요세푸스.py | 1158, 요세푸스.py | py | 490 | python | en | code | 2 | github-code | 27 | [
{
"api_name": "sys.stdin.readline",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 4,
"usage_type": "call"
}
] |
43670219300 | # Creating a custom encoder while skipping the keys that are not serializable.
import json
from datetime import datetime
class CustomEncoder1(json.JSONEncoder):
def __init__(self, *args, **kwargs):
super().__init__(skipkeys=True,
allow_nan=False,
indent='-... | Narayan-21/PDD-3-4 | Custom_Encoder.py | Custom_Encoder.py | py | 1,355 | python | en | code | 0 | github-code | 27 | [
{
"api_name": "json.JSONEncoder",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime",
"line_number": 13,
"usage_type": "argument"
},
{
"api_name": "datetime.datetime.utcnow",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "d... |
16706245620 | import requests
import datetime
from bs4 import BeautifulSoup
import pandas as pd
import numpy as np
import matcher.sites.william_hill as william_hill
from matcher.exceptions import MatcherError
import matcher.sites.betfair as betfair
enabled_sites = {"William Hill": william_hill}
def get_extra_place_races():
d... | tom-pollak/each-way-matcher | matcher/sites/scrape_extra_places.py | scrape_extra_places.py | py | 6,442 | python | en | code | 10 | github-code | 27 | [
{
"api_name": "matcher.sites.william_hill",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name"... |
6310019618 | import sqlite3
import hwlib.device as devlib
import hwlib.block as blocklib
import hwlib.adp as adplib
import hwlib.hcdc.llenums as llenums
import ops.generic_op as genoplib
import ops.op as oplib
import base64
import json
import numpy as np
from enum import Enum
CREATE_DATA_TABLE = '''
CREATE TABLE IF NOT EXISTS pr... | sarachour/legno-compiler | runtime/models/database.py | database.py | py | 5,275 | python | en | code | 26 | github-code | 27 | [
{
"api_name": "enum.Enum",
"line_number": 53,
"usage_type": "name"
},
{
"api_name": "sqlite3.connect",
"line_number": 62,
"usage_type": "call"
}
] |
13932479017 | #!/bin/env python3
import socket
import os
import threading
import logging
from Config import CONFIG
CONFIG = CONFIG['INPUT_SERVER']
logger = logging.getLogger('INPUT_SERVER')
class InputServer(threading.Thread):
"Unix socket server for interaction with the user"
def __init__(self, Widget):
threadi... | ludat/lueng | src/InputServer.py | InputServer.py | py | 6,017 | python | en | code | 3 | github-code | 27 | [
{
"api_name": "Config.CONFIG",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "threading.Thread... |
18474735007 | # -*- coding: utf-8 -*-
import json
import os
import KBEngine
import Const
from KBEDebug import *
def onInit(isReload):
"""
KBEngine method.
当引擎启动后初始化完所有的脚本后这个接口被调用
"""
DEBUG_MSG('onInit::isReload:%s' % isReload)
# 加载游戏配置
load_game_config()
def onGlobalData(key, value):
"""
KBE... | Bobcatsoap/jy-server | cell/kbemain.py | kbemain.py | py | 2,717 | python | en | code | 1 | github-code | 27 | [
{
"api_name": "os.path.dirname",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 71,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_num... |
28577110805 | """
Script for asynchronously computing classifications for DescriptorElements
in a DescriptorSet specified via a list of UUIDs. Results are output to a
CSV file in the format:
uuid, label1_confidence, label2_confidence, ...
CSV columns labels are output to the given CSV header file path. Label
columns will be in... | nasa-jpl-memex/SMQTK | python/smqtk/bin/compute_classifications.py | compute_classifications.py | py | 6,363 | python | en | code | 1 | github-code | 27 | [
{
"api_name": "smqtk.utils.configuration.make_default_config",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "smqtk.algorithms.Classifier.get_impls",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "smqtk.algorithms.Classifier",
"line_number": 54,
"usa... |
42670485995 | """
name: save_sticker
create_time: 2023/5/17
author: Ethan
Description: 用于保存微信表情包
"""
from threading import Thread
import uuid
import requests
from lxml import etree
"""
https://mp.weixin.qq.com/s?__biz=MzIxMzQ4NjUxNQ==&mid=2247678844&idx=3&sn=d626f59f2c8c4e3fb3adb8626443c6e1&chksm=97ba65a0a0cdecb6240478826ca96438d52... | stayhungry134/SpiderVerse | wechat/save_sticker.py | save_sticker.py | py | 1,418 | python | en | code | 0 | github-code | 27 | [
{
"api_name": "requests.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "lxml.etree.HTML",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_numb... |
42979696117 | import numpy as np
from perm_LQUBO.form_new_LQUBO import NewLQUBO
from perm_LQUBO.select_perm import Select
from dimod import SimulatedAnnealingSampler
from tabu import TabuSampler
from dwave.system.samplers import DWaveSampler
from dwave.system.composites import EmbeddingComposite
import time
class Solver:
"""
... | seangholson/lqubo | perm_LQUBO/solvers/New_LQUBO_solver.py | New_LQUBO_solver.py | py | 4,779 | python | en | code | 1 | github-code | 27 | [
{
"api_name": "dwave.system.composites.EmbeddingComposite",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "dwave.system.samplers.DWaveSampler",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "dimod.SimulatedAnnealingSampler",
"line_number": 55,
"usage... |
39977443605 | import db_api as db
from prettytable import PrettyTable
import sys
class DBManager:
# (start, end)
def get_period_of_sem(self, semester, year):
if semester == '1':
return (str(year + "-09-01"), str(year + "-12-31"))
elif semester == '2':
return (str(year + "-02-01"), str... | shmitkokirill/SoftArchitecture | queries/db_manager.py | db_manager.py | py | 8,585 | python | en | code | 0 | github-code | 27 | [
{
"api_name": "db_api.Postgres",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "db_api.Elastic",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "db_api.Neo",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "db_api.Redis",
"line_nu... |
37640347398 | from flask import request, jsonify
from dao.products import *
from commons.response import *
import redis
def create_product_route():
data = request.json
name = data['name']
description = data['description']
price = data['price']
inventory = data['inventory']
return cr... | SVK1996/golden-gate | api/products.py | products.py | py | 1,958 | python | en | code | 0 | github-code | 27 | [
{
"api_name": "flask.request.json",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "flask.request.args.get",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "flask.requ... |
27515348790 | import asyncio
import sys
import pet911
import requests
#import kafkaJobQueue
kafkaRestAddr = sys.argv[1]
targetDir = sys.argv[2]
async def work():
#queue = kafkaJobQueue.JobQueueProducer(kafkaAddr, "kashtanka_crawled_pet_cards", "postPet911Once.py")
card = pet911.GetPetCard(targetDir)
uid = card['uid']
... | LostPetInitiative/Kashtanka | code/postPet911Once.py | postPet911Once.py | py | 684 | python | en | code | 0 | github-code | 27 | [
{
"api_name": "sys.argv",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pet911.GetPetCard",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line... |
8717803405 | import argparse
import os
import random
import time
from distutils.util import strtobool
import gymnasium as gym
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from torch.distributions.categorical import Categorical
from torch.utils.tensorboard import SummaryWriter
def parse_argum... | Balssh/Thesis | wandblike_implementation.py | wandblike_implementation.py | py | 16,534 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.basename",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "distutils.util.... |
13238902538 | # -*- coding: utf-8 -*-
# @Time : 2022/3/9 17:11
# @Author : TuDaCheng
# @File : TextCNN.py
import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
class Config(object):
"""模型配置参数"""
def __init__(self, embedding):
self.model_name = "TextCNN"
self.train_path = "./... | TuDaCheng/method_1_agriculture_classification | models/TextCNN.py | TextCNN.py | py | 3,039 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "torch.device",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "torch.tensor",
... |
9599919283 | import os
import shutil
import sqlite3
from os import listdir
import syntax
from PyQt5 import QtWidgets, QtGui
from PyQt5.Qt import *
# интерфейс окна справочника
class GuideWindow(QMainWindow):
def setupUi(self, MainWindow, username):
self.username = username
MainWindow.setObjectName("MainWindow"... | ItNya/PythonGuide | main.py | main.py | py | 10,304 | python | ru | code | 0 | github-code | 27 | [
{
"api_name": "PyQt5.QtGui.QIcon",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtGui",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets... |
5487372067 | import peewee as pw
db = pw.SqliteDatabase('database.db')
def initialize():
Author.create_table(fail_silently=True)
Book.create_table(fail_silently=True)
AuthorBook.create_table(fail_silently=True)
class BaseModel(pw.Model):
class Meta:
database = db
class Author(BaseModel):
first_na... | Lada-Levchenko/003-be-addo-flask-rest-library | models.py | models.py | py | 669 | python | en | code | 0 | github-code | 27 | [
{
"api_name": "peewee.SqliteDatabase",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "peewee.Model",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "peewee.CharField",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "peewee.CharFi... |
32542579263 | import cv2
import dlib
import numpy as np
# Initialize Dlib's face detector and facial landmarks predictor
detector = dlib.get_frontal_face_detector()
predictor = dlib.shape_predictor(r'.\shape_predictor_68_face_landmarks.dat')
# Function to calculate the EAR (Eye Aspect Ratio)
def eye_aspect_ratio(eye):
eye = [n... | LuisCMoreira/facialTracking | blinkCounter.py | blinkCounter.py | py | 2,582 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "dlib.get_frontal_face_detector",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "dlib.shape_predictor",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.l... |
71935035567 | """Implements Controller class."""
import asyncio
import logging
import sys
import functools
import inspect
from collections import defaultdict
from .event import load_event, dump_event
from .pktview import pktview_from_list
from .connection import Connection
from .run_server import run_server
from . import exception ... | byllyfish/zof | zof/controller.py | controller.py | py | 24,705 | python | en | code | 5 | github-code | 2 | [
{
"api_name": "logging.getLogger",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "asyncio.ensure_future",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "run_s... |
2148939071 | from copy import deepcopy
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import init
from torchvision.models.detection.faster_rcnn import FastRCNNPredictor
from torchvision.models.detection.roi_heads import RoIHeads
from torchvision.models.detection.rpn import AnchorGenerator, RegionP... | serend1p1ty/SeqNet | models/seqnet.py | seqnet.py | py | 21,957 | python | en | code | 229 | github-code | 2 | [
{
"api_name": "torch.nn.Module",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "models.resnet.build_resnet",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "torchvision.... |
26174566794 | import cv2
import numpy as np
import os.path as osp
import torch
from albumentations.pytorch import ToTensor
from seismic.data.utils import rle2mask
class TrainDataset():
def __init__(self, image_dir, train, transform, has_mask=True):
self.image_dir = image_dir
self.train = train
self.tra... | Miffka/seismic-challenge | seismic/data/dataset.py | dataset.py | py | 1,709 | python | en | code | 0 | github-code | 27 | [
{
"api_name": "numpy.unique",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.path.join",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "os.path",
"line_... |
40635226699 | from robot.api.deco import library, keyword
import json
@library
class Gerador_Dados_Invalidos:
def __init__(self):
self.modelo = {}
self.massa_de_dados = []
@keyword
def Definir_Modelo(self, modelo):
self.modelo = modelo
@keyword
def Gerar_Massa_De_Dados_... | PFrek/RoboTron_Pedro_Favoreto_Projeto_Final | support/fixtures/Gerador_Dados_Invalidos.py | Gerador_Dados_Invalidos.py | py | 1,159 | python | pt | code | 0 | github-code | 27 | [
{
"api_name": "robot.api.deco.keyword",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "robot.api.deco.keyword",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "robot.api.deco.keyword",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "... |
37303349654 | from typing import List
import construct
from .opcode import Opcode
from .character_enum_packets import CombatClass, Race, Gender
from .headers import ClientHeader, ServerHeader, is_large_server_packet
from wlink.utility.construct import PackEnum
CMSG_WHOIS = construct.Struct(
"header" / ClientHeader(Opcode.CMSG... | Ostoic/wlink | src/wlink/world/packets/b12340/whois_packets.py | whois_packets.py | py | 3,393 | python | en | code | 0 | github-code | 27 | [
{
"api_name": "construct.Struct",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "headers.ClientHeader",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "opcode.Opcode.CMSG_WHOIS",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "o... |
40118052433 | from typing import Callable, Union
import numpy as np
from collections import deque
from model import Model
from baselines.common.vec_env.dummy_vec_env import DummyVecEnv
TimeVarying = Callable[[int], float]
def const_fn(val):
return lambda _: val
def sf01(arr):
"""
swap and then flatten axes 0 an... | eric-heiden/embed_onpolicy | sampler.py | sampler.py | py | 10,812 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "typing.Callable",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "baselines.common.vec_env.dummy_vec_env.DummyVecEnv",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 29,
"usage_type": "name"
},
{
"a... |
18701897355 | import math
import os
import sys
from typing import Iterable
import torch
import util.misc as utils
from datasets.coco_eval import CocoEvaluator
from datasets.panoptic_eval import PanopticEvaluator
import pdb
from util import box_ops
def train_one_epoch(model: torch.nn.Module, criterion: torch.nn.Module,
... | gaopengcuhk/Stable-Pix2Seq | engine.py | engine.py | py | 8,019 | python | en | code | 224 | github-code | 27 | [
{
"api_name": "torch.nn",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "typing.Iterable",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "torch.optim",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "torch.device",
"li... |
71282505352 | from flask import render_template
from app import app, db_manager
from tools.auth import login_required
@app.route('/recipes/<int:recipe_id>', methods=['GET'])
@login_required
def view_recipe(recipe_id):
"""
View details of a specific recipe.
Args:
recipe_id (int): The unique identifier of the re... | parciffal/psychic-octo-couscous | api/recipes_view/recipes_view.py | recipes_view.py | py | 1,422 | python | en | code | 0 | github-code | 27 | [
{
"api_name": "app.db_manager.fetchone",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "app.db_manager",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "app.db_manager.fetchone",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "app.db... |
2145544535 | #pip install opencv-python
#Pip install imagiz
# Server.py
import imagiz
import cv2
import multiprocessing
import os
import signal
def start_server():
server=imagiz.Server(port=7070) # Starting server instance on port 7070
while True:
message=server.receive() # Recieve incoming frame forever with Wh... | SikkeyHuang/Video | Original/imagiz_server.py | imagiz_server.py | py | 2,962 | python | en | code | 0 | github-code | 27 | [
{
"api_name": "imagiz.Server",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.imdecode",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"line_number"... |
37004786478 | # ABC155C - Poll
# URL:https://atcoder.jp/contests/abc155/tasks/abc155_c
# 日付: 2020/11/24
# ---------- 思ったこと / 気づいたこと ----------
#
# ------------------- 方針 --------------------
# まずは数える: collectionsのcounter
# 最大値を取るものをゲットしてソートして出力
# ------------------- 解答 --------------------
#code:python
from collections import Co... | shimmee/competitive-programming | AtCoder/Practice/ABC-C埋め/abc155C.py | abc155C.py | py | 1,538 | python | ja | code | 0 | github-code | 27 | [
{
"api_name": "collections.Counter",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 41,
"usage_type": "call"
}
] |
18218348416 | '''
Author: Mika Erdmann
This script contains the inverse Pyoo Model that implements the optimization of the only parameter pm_welf (p_t) by minimizing the difference to the EA_inverse.get_vm_opt() result.
'''
from geneal.genetic_algorithms import ContinuousGenAlgSolver
import matplotlib.pyplot as plt
from pymoo.term... | mikaerdmann/ramsey | EA_inversePyoo.py | EA_inversePyoo.py | py | 7,175 | python | en | code | 0 | github-code | 27 | [
{
"api_name": "pymoo.core.problem.ElementwiseProblem",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "numpy.zeros",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "inverse_... |
4522156686 | from rest_framework import serializers, viewsets
from apps.game.models import Game
from rest_framework.filters import SearchFilter, OrderingFilter
class GameSerializer(serializers.ModelSerializer):
class Meta:
model = Game
fields = '__all__'
class GameViewSet(viewsets.ModelViewSet):
serializ... | mjoyshuvo/GogamesTask | apps/game/views.py | views.py | py | 632 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "apps.game.models.Game",
"line_number": 8,
"usage_type": "name"
... |
72730291272 | import aiohttp
import asyncio
import json
import sys
import logging
import inspect
import weakref
from random import randint as random_integer
log = logging.getLogger(__name__)
from .errors import HTTPException, Forbidden, NotFound, LoginFailure, GatewayNotFound
from . import utils, __version__
@asyncio.coroutine
de... | Aurous/Magic-Discord-Bot | discord/http.py | http.py | py | 17,324 | python | en | code | 2 | github-code | 27 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "asyncio.coroutine",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "inspect.currentfr... |
37444079374 | import psycopg2
conn = psycopg2.connect(database='postgres', user= 'postgres', password='')
def create_table():
with conn.cursor() as cur:
cur.execute("""
CREATE TABLE IF NOT EXISTS clients(
id SERIAL PRIMARY KEY,
name VARCHAR(40),
surname VARCHAR... | artkos2/netilogy_bd | BD.py | BD.py | py | 4,236 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "psycopg2.connect",
"line_number": 3,
"usage_type": "call"
}
] |
5167633035 | from sklearn.tree import DecisionTreeRegressor
from code.adaboost import AdaBoostRegressor
if __name__ == "__main__":
dataset = [[[0], [1], [2], [3], [4], [5], [6], [7], [8], [9]],
[5.56, 5.70, 5.91, 6.40, 6.80, 7.05, 8.90, 8.70, 9.00, 9.05]]
seg = AdaBoostRegressor(dataset[0], dataset[1], Dec... | ChangxingJiang/Data-Mining-HandBook | R01_《统计学习方法》啃书辅助/第8章_提升算法/回归问题的提升树算法(原生Python+例8.2).py | 回归问题的提升树算法(原生Python+例8.2).py | py | 476 | python | en | code | 32 | github-code | 2 | [
{
"api_name": "code.adaboost.AdaBoostRegressor",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sklearn.tree.DecisionTreeRegressor",
"line_number": 9,
"usage_type": "call"
}
] |
72575563245 | import json
import os
from glob import glob
from pprint import pprint
import pandas as pd
from relbert import evaluate_classification
pretty_name = {
"part_whole": "Meronym",
"class_inclusion": "Hypernym",
"attribute": "Attribute",
"contrast": "Antonym",
"similar": "Synonym",
'random': 'Rando... | asahi417/relbert | examples/journal/ablation_exclusion/exclusion_test.py | exclusion_test.py | py | 3,156 | python | en | code | 40 | github-code | 2 | [
{
"api_name": "os.path.exists",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number":... |
30905004182 | import spacy
import pandas as pd
from torchtext.legacy.data import Field, BucketIterator, TabularDataset
from sklearn.model_selection import train_test_split
import torch
train_statement = pd.read_json("data/train_statement.json")
test_statement = pd.read_json("data/test_statement.json")
def tokenize_text(text):
... | dennis0914/fedanal | main.py | main.py | py | 1,032 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "pandas.read_json",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pandas.read_json",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "spacy.load",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torchtext.legacy.data.Fiel... |
71541257968 | from django.urls import path
from . import views
urlpatterns = [
# API overview
path('', views.ApiOverview, name='home'),
# Employee endpoints
path('employee/', views.get_all_employees, name='get-all-employees'),
path('employee/add', views.add_employee, name='add-employee'),
path('employee/<int... | FreeSoulsDotBat/django-rest-framework | igsSoftwareManager/app/urls.py | urls.py | py | 1,011 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"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",
... |
35545391471 | import json
myfilepath = "./configdata/routetable_gate.json"
myjsondata = {}
myjsondata = json.load(open(myfilepath, 'r', encoding="utf8"))
print(len(myjsondata))
for mykey,myvalue in myjsondata.items():
print(mykey,myvalue)
s1=str(myvalue)
s1=s1.replace("{}","127.0.0.1")
print(s1) | highjump0615/RemoteConfigApp | TEST1234567890.py | TEST1234567890.py | py | 307 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "json.load",
"line_number": 4,
"usage_type": "call"
}
] |
25278409358 | import streamlit as st
import pandas as pd
import folium
import geopandas
from streamlit_folium import st_folium
from google.cloud import bigquery
import os
os.environ["GOOGLE_APPLICATION_CREDENTIALS"]="creds/serenity-gbq-4f1a4edba243.json"
client = bigquery.Client()
@st.cache
def load_data():
# QUERY = (
#... | jonhealy1/serenity-gbq | app.py | app.py | py | 2,215 | python | en | code | 0 | github-code | 27 | [
{
"api_name": "os.environ",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "google.cloud.bigquery.Client",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "google.cloud.bigquery",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "st... |
4410134665 | from datetime import datetime, timedelta
from six.moves.urllib.parse import unquote
import uuid
import boto
import phonenumbers
from phonenumbers.phonenumberutil import NumberParseException
import mimetypes
import hashlib
from django.contrib.contenttypes.fields import GenericForeignKey, GenericRelation
from django.cont... | eventure-interactive/eventure_django | core/models.py | models.py | py | 23,595 | python | en | code | 0 | github-code | 27 | [
{
"api_name": "logging.getLogger",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.models.BaseUserManager",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "django.contrib.gis.db.models.Manager",
"line_number": 70,
"usage_type": "att... |
7601063350 | # -*- coding: utf-8 -*-
"""
Created on Tue Dec 10 23:35:05 2019
@author: Admin
"""
import numpy as np
from sklearn.linear_model import LinearRegression
from sklearn.preprocessing import PolynomialFeatures
import random
clf = LinearRegression()
tran = PolynomialFeatures() # 用多项式生成多个特征
def ransac(data,model,epochs,n... | Guoweixiong/A-new-start | week2/ransac.py | ransac.py | py | 4,155 | python | en | code | 1 | github-code | 2 | [
{
"api_name": "sklearn.linear_model.LinearRegression",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.PolynomialFeatures",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.inf",
"line_number": 26,
"usage_type": "attribute"
... |
37170702824 | from typing import List
class Solution:
def totalStrength(self, strength: List[int]) -> int:
totalStrength = 0
j = len(strength)
for i in range(len(strength)):
totalStrength += strength[i] * strength[i]
while j > i+1:
totalStrength += min(strength[i:j]) * sum(strength[i:... | Thanhtinh06/baitapbigo | Blue_Bai4_Stack/twoSum2281Leetcode.py | twoSum2281Leetcode.py | py | 488 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "typing.List",
"line_number": 4,
"usage_type": "name"
}
] |
39767467518 | import config as cfg
import sys
import os
import utils
import json
import db_worker
import smsApi
import sql_templates
import time
import triggers_workers
from datetime import datetime, timedelta
import logging as log
import log_parser
from pathlib import Path
from transliterate import translit
triggers = []
def in... | dzirtt/portDown-monitor | app/trigger.py | trigger.py | py | 4,330 | python | en | code | 1 | github-code | 2 | [
{
"api_name": "triggers_workers.stdOutTrigger",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "triggers_workers.telegramTrigger",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "db_worker.checkAndInitTable",
"line_number": 31,
"usage_type": "call"
}... |
19646221693 | # from crypt import methods
from flask import Flask, render_template, request, Response, redirect, url_for
import pandas as pd
from detection import *
app = Flask(__name__)
VIDEO = VideoStreaming()
COUNTER = ObjectDetection()
@app.route('/')
def home():
return render_template('index.html')
@app.... | alifanadhira/ProctrON | app.py | app.py | py | 1,525 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.Response",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "flask.render_template... |
71967834286 | from typing import List
class Solution:
def rearrangeBarcodes(self, barcodes: List[int]) -> List[int]:
if len(barcodes) <= 2:
return barcodes
barcodes.sort()
res = []
half = len(barcodes) // 2
flag = len(barcodes) % 2
for i in range(half):
re... | JustinLee32/cai_niao_shua_ti | 按题号/1054 距离相等的条形码.py | 1054 距离相等的条形码.py | py | 701 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
}
] |
32555069106 | import pygame
import random
pygame.init()
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
GREEN = (0, 255, 0)
RED = (255, 0, 0)
FPS = 20
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 800
PIXEL_SIZE = 20
LINE_WIDTH = 1
DIRECTION = {
pygame.K_UP: 'UP',
pygame.K_DOWN: 'DOWN',
pygame.K_LEFT: 'LEFT',
pygame.K_RIGHT: 'RIG... | jeonghyunL/snake-game | snakegame.py | snakegame.py | py | 4,147 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "pygame.init",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pygame.K_UP",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "pygame.K_DOWN",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "pygame.K_LEFT",
"l... |
36697981396 | import redis
redis_url = "redis://127.0.0.1:6379"
server = redis.StrictRedis.from_url(redis_url, decode_responses=True)
bf = server.cf()
# redis key
key = "test"
expansion = 2
# 去重数据量 2**18
capacity = 18
bucket_size =2
if not server.exists(key):
print(bf.create(key, capacity, expansion=expansion, bu... | kanadeblisst/scrapy_redis_cf | tests/redisbloom.py | redisbloom.py | py | 619 | python | en | code | 0 | github-code | 27 | [
{
"api_name": "redis.StrictRedis.from_url",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "redis.StrictRedis",
"line_number": 4,
"usage_type": "attribute"
}
] |
34098147170 | from discord.ext import commands
import discord
from replit import db
class Scheduler(commands.Cog):
"""Scheduler"""
def __init__(self, bot):
self.bot = bot
@commands.command(name="add_agenda", help="Adiciona os horários (horas cheias) Ex: !add_agenda 9 12 15 18")
async def add... | gilmargr/BrawlBot | commands/scheduler.py | scheduler.py | py | 2,344 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "replit.db.keys",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "repli... |
22739598114 | from collections import deque
def solution(s):
left = ['{','[','(']
right = ['}',']',')']
l = len(s)
if l%2==1:
return 0
answer = 0
for a in range(l): # rotate
q = deque(s)
q.rotate(-a)
for b in range(l-1): # 올바른지 확인
if q[b] in left and not q[b].... | NayoungLee-de/algorithm | 프로그래머스/구현/괄호 회전하기.py | 괄호 회전하기.py | py | 643 | python | en | code | 0 | github-code | 27 | [
{
"api_name": "collections.deque",
"line_number": 12,
"usage_type": "call"
}
] |
71553658606 | import requests
def shorten_link(full_link, link_name):
api_key = "e615943c8b5ad81231687f43e3c4b7d920f67"
base_url = 'https://cutt.ly/api/api.php'
payload = {'key': api_key, 'short': full_link, 'name' : link_name}
request = requests.get(base_url, params=payload)
data = request.json()
print(''... | VishalVaghela2046/GWM--PYTHON | Task-3 Url Shortner/urlShot.py | urlShot.py | py | 666 | python | en | code | 1 | github-code | 2 | [
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
}
] |
30748844221 | import math
from torch_geometric.nn import TransformerConv
import torch.nn.functional as F
from torch_geometric.utils import softmax
class MyTransformerConv(TransformerConv):
def message(self, query_i, key_j, value_j,
edge_attr, index, ptr,
size_i):
if self.lin_edge is n... | roberthoenig/GraphCLIP | models/MyTransformerConv.py | MyTransformerConv.py | py | 945 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "torch_geometric.nn.TransformerConv",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "math.sqrt",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch_geometric.utils.softmax",
"line_number": 21,
"usage_type": "call"
},
{
"api_nam... |
22896341809 | """
Definition of custom filter
"""
from django import template
register = template.Library()
@register.filter
def lookup(d, key):
"""Get a value according to the key or an item indexing"""
return d[key]
| huayunfly/repo | py/Timesheet/app/templatetags/lookup.py | lookup.py | py | 216 | python | en | code | 0 | github-code | 27 | [
{
"api_name": "django.template.Library",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 7,
"usage_type": "name"
}
] |
12402872388 | from typing import Optional, TypeVar, Sequence, Union, Callable
T = TypeVar("T")
def type(
cls: Optional[T],
*,
name: Optional[str],
is_input: bool = False,
is_interface: bool = False,
description: Optional[str] = None,
directives: Optional[Sequence[object]] = (),
extend: bool = False,... | patrick91/rusty-docs | src/fixtures/strawberry_type.py | strawberry_type.py | py | 1,483 | python | en | code | 3 | github-code | 27 | [
{
"api_name": "typing.TypeVar",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "typing.Optional",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"li... |
44036397991 | """ cards/views.py """
from django.shortcuts import render
from django.http import HttpResponse, HttpResponseBadRequest
from cards.models import *
import random
def menu(request): # request is an obj containing info about the sent HTTP request
# will be used to track user's progress while working through flas... | ajrobbins04/mathFlashcards | cards/views.py | views.py | py | 3,654 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "django.shortcuts.render",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.http.HttpResponseBadRequest",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 48,
"usage_type": "call"
},
{
... |
11813807873 | from glob import glob
from os.path import basename, splitext
import setuptools
with open('README.md', 'r') as fh:
long_description = fh.read()
setuptools.setup(
name='galts-trade-api',
version='0.2.0',
license='Mozilla Public License 2.0',
author='Sergey Nevmerzhitsky',
author_email='sergey.n... | galtsos/trade-api-python | setup.py | setup.py | py | 1,371 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "setuptools.setup",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path.splitext",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path.bas... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.