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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
36049807319 | import traceback
from asyncio import sleep
from logging import getLogger
from typing import Dict, List
from aiohttp import ClientSession
from common.enums import EmailResult
from email_client.integrations.web.abstract import AbstractWebClient
logger = getLogger(__name__)
class WebClient(AbstractWebClient):
de... | MFrackowiak/sc_r_mailmarketing | email_client/integrations/web/client.py | client.py | py | 1,584 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "email_client.integrations.web.abstract.AbstractWebClient",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "aiohttp.ClientSession",
"line_number": 19,
"usage_type": "name... |
15227915962 | '''
Tag Frequency Analysis
Author: Audrey Yang
Date: October 23, 2022
'''
import nltk
from nltk.corpus import brown
tagged_words_uni = brown.tagged_words(categories="news", tagset = "universal")
tagged_words_brown = brown.tagged_words(categories="news",)
ttable = nltk.FreqDist()
# get the frequency of e... | vagorsol/computational-linguistics | Assignment 4/tag_analysis.py | tag_analysis.py | py | 4,188 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "nltk.corpus.brown.tagged_words",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.brown",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "nltk.corpus.brown.tagged_words",
"line_number": 11,
"usage_type": "call"
},
{
"a... |
34604241513 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import os
from math import sqrt
import cv2
import imutils
import random
from nltk import flatten
def get_neighborhood(data, features, y1, y2, image, dictionary):
feature_in_layer = []
for name in features:
globals()[n... | elahesalari/Porosity_Prediction_DED_Additive_Manufacturing | Data_Processing/Get points on pbject.py | Get points on pbject.py | py | 3,264 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "numpy.array",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.unique",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.min",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.max",
"line_number": 20,... |
36364117589 | import os
import re
import openpyxl.drawing.image
from openpyxl import *
from openpyxl.drawing.image import Image
import OpenEXR
class ExcelCreater:
def __init__(self):
self.wb = Workbook()
self.ws = self.wb.active
self.ws.title = 'Shot'
self._input_path = None
self._ou... | shotgrid-starter/crazy_fork | dev_hj/python/execl_created/excel_creater_mix.py | excel_creater_mix.py | py | 8,542 | python | en | code | null | github-code | 36 | [
{
"api_name": "os.walk",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "OpenEXR.InputFile",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": "OpenEXR.InputFile",
"line_nu... |
5257479378 | from bs4 import BeautifulSoup
from lxml import etree
from collections import defaultdict
skipping_th = ["<th>Strecke</th>", "<th>Zeit</th>", "<th>Punkte</th>", "<th>Details</th>", "<th>Stadt</th>", "<th>Monat</th>"]
def chunks(lst, n):
n = max(1, n)
return list((lst[i:i+n] for i in range(0, len(lst), n)))
... | ESBUINBOO/swimMember | backend/app/bs4_handler/bs4_handler.py | bs4_handler.py | py | 1,917 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "bs4.BeautifulSoup",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 38,
"usage_type": "call"
}
] |
23972756418 | #!/usr/bin/env python
# coding: utf-8
from selenium.webdriver import Chrome
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.options import Options
import time
import pymysq... | shandongbd/lagou-boss-zhilian-data | zhilian_yun.py | zhilian_yun.py | py | 8,531 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "selenium.webdriver.chrome.options.Options",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "pymysql.connect",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 60,
"usage_type": "call"
},
{
... |
24722163523 | #!/usr/bin/env python3
# wykys 2020
# databáze konverzací pro generování korpusu
from sqlalchemy import create_engine, text, func
from sqlalchemy.orm import sessionmaker
from sqlalchemy.orm import relationship, backref
from sqlalchemy.ext.declarative import as_declarative, declared_attr, declarative_base
from sqlalche... | wykys/chateen | src/chateen/database/database.py | database.py | py | 1,911 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.pool.StaticPool",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "database_models.BaseModel.metadata.create_all",
"line_number": 27,
"usage_type": "cal... |
814974039 | import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.animation as animation
fig = plt.figure()
ax=fig.add_subplot(projection='3d')
line, = ax.plot([], [], [])
ax.set_xlim(-1,1)
ax.set_ylim(-1,1)
ax.set_zlim(0,3)
n_points = 1001
tf = 3
f = 1
fps = int(np.ceil(n_p... | mattwilliams06/AppliedControlSystems2 | animated_spiral.py | animated_spiral.py | py | 835 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "numpy.ceil",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
... |
10139864507 | import bpy
import os
import random
from os.path import isfile
output_fname_tpl = os.getenv('FRAME_FNAME','frame%06d')
def frame_done(n):
return isfile(output_fname_tpl % n + ".png")
def frames_todo():
all_frames = range(bpy.context.scene.frame_start, bpy.context.scene.frame_end+1)
return [n for n in all_frames... | emanaev/render-test | blender/script.py | script.py | py | 869 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "os.getenv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "bpy.context",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "bpy.context.scene.frame_set",... |
17497506686 | import json
import random
def calculate_prf(n_golds, n_preds, n_inters):
p = (n_inters * 1.0 / n_preds) * 100 if n_preds != 0 else 0
r = (n_inters * 1.0 / n_golds) * 100 if n_golds != 0 else 0
f = 2.0 * p * r / (p + r) if (p + r) != 0 else 0
p = round(p, 2)
r = round(r, 2)
f = round(f, 2)
... | JorgenWan/NestedNER | scripts/eval_dif_len_ner.py | eval_dif_len_ner.py | py | 2,516 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "json.load",
"line_number": 18,
"usage_type": "call"
}
] |
40567890811 | import numpy as np
import torch
def calculate_tp(pred_boxes, pred_scores, gt_boxes, gt_difficult, iou_thresh = 0.5):
"""
calculate tp/fp for all predicted bboxes for one class of one image.
对于匹配到同一gt的不同bboxes,让score最高tp = 1,其它的tp = 0
Args:
pred_boxes: Tensor[N, 4], 某张图片中某类别的全部预测... | BIGcucumber/FEFD-yolov5 | Helmet detection based on YOLOV5/utils/get_ap.py | get_ap.py | py | 5,476 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.zeros_like",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 81,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": "numpy.argsort",
"line_nu... |
2923880165 | import pandas as pd
import time
import sys
import numpy as np
import os
import torch
import torchvision
from numpy import sqrt
import math
from torch import nn
import latticeglass
from args import args
from resmade import MADE
from utils import (
clear_checkpoint,
clear_log,
get_last_checkpoint_step,
ig... | SCiarella/patchy_transformer | main.py | main.py | py | 21,956 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "time.time",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "utils.init_out_dir",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "args.args.clear_checkpoint",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "args.arg... |
73130978664 | from tempfile import mkdtemp
import multiprocessing
import environ
# ENVIRON
# ==============================================================================
env = environ.Env()
DEBUG = env.bool("DEBUG")
FORWARDED_ALLOW_IPS = env.str("GUNICORN_FORWARDED_ALLOW_IPS")
PROXY_ALLOW_IPS = env.str("GUNICORN_PROXY_ALLOW_IP... | by-Exist/django-skeleton | backend/gunicorn.conf.py | gunicorn.conf.py | py | 8,837 | python | ko | code | 0 | github-code | 36 | [
{
"api_name": "environ.Env",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "tempfile.mkdtemp",
"line_number": 113,
"usage_type": "call"
},
{
"api_name": "multiprocessing.cpu_count",
"line_number": 135,
"usage_type": "call"
}
] |
16662100384 | from typing import Optional
from pythongame.core.ability_effects import register_ability_effect, AbilityWasUsedSuccessfully, AbilityResult
from pythongame.core.buff_effects import get_buff_effect, AbstractBuffEffect, register_buff_effect, \
StatModifyingBuffEffect
from pythongame.core.common import AbilityType, Mi... | gx-55/pygame-for-5725 | pythongame/game_data/abilities/ability_stealth.py | ability_stealth.py | py | 4,293 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "pythongame.core.common.AbilityType.STEALTH",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "pythongame.core.common.AbilityType",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "pythongame.core.common.BuffType.STEALTHING",
"line_number"... |
17262201723 | import requests
import json
class Geolocation:
def __init__(self, ip_address):
'''
Initializes url with user inputted IP address.
args: (str) IP address
return: none
'''
self.url = f'https://geolocation-db.com/jsonp/{ip_address}'
def get(self):
'''
Requests and pulls API through URL ... | bucs110a0spring22/final-exam-fujikashimada | IPGeolocationAPI.py | IPGeolocationAPI.py | py | 782 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 23,
"usage_type": "call"
}
] |
6217946633 | """
Export an object that will handle all the communication with the Walabot.
"""
import json
import select
import socket
from threading import Thread
from tinydb import Query
from DBHandler import DBHandler as TinyDB
from config import DB_PATH, UTF_FORMAT, ROOM_FIELD, NUMBER_OF_PEOPLE_FIELD, ROOMS_DATA_TABLE, MAX_P... | Walabot-Projects/Walabot-MeetingRoom | server/FreeRoomsServer.py | FreeRoomsServer.py | py | 6,324 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "socket.socket",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "DBHandler.DBHandler",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "config.DB_PATH",
"line_number": 50,
"usage_type": "argument"
},
{
"api_name": "config.ROOMS_DAT... |
8393586286 | import json
import re
from collections import Counter
import matplotlib.pyplot as plt
import pandas as pd
import requests
from nltk.corpus import stopwords
df = pd.read_csv("./misc/chanlog.csv")
def fetch_emotes(url: str, id: str) -> str:
try:
resp = requests.get(f"{url}{id}")
json = resp.json()... | smehlhoff/twitch-chat-election | top_words.py | top_words.py | py | 1,876 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "requests.exceptions",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "nltk.corpus.sto... |
17579834132 | from __future__ import annotations
import os
from pathlib import Path
from typing import Any
ALLOWED_HOSTS: list[str] = []
BASE_DIR = Path(__file__).resolve().parent
DEBUG_ENV = os.environ.get("DEBUG")
DEBUG = DEBUG_ENV == "True"
DATABASE_NAME = ":memory:" if not DEBUG else BASE_DIR / "db.sqlite3"
DATABASES: dict... | valberg/django-view-decorator | tests/settings.py | settings.py | py | 1,235 | python | en | code | 45 | github-code | 36 | [
{
"api_name": "pathlib.Path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "typing.Any",
"line_num... |
7548657447 | from lina import lina
import argparse
import os
def reverse(dispersed_dir, output_file, original_size):
filenames = os.listdir(dispersed_dir)
filenames.sort()
dispersed_data_list = []
for filename in filenames:
f = open(dispersed_dir + "/" + filename, "rb")
dispersed_data_list.append(""... | TakutoYoshikai/mist-dispersion | mist_dispersion/mist_dispersion.py | mist_dispersion.py | py | 2,069 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.listdir",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "lina.lina.message_to_binary",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "lina.lina",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "lina.lina.split",
... |
21201257329 | # -*- coding: utf-8 -*-
from libs.base_strategy import Strategy
from collections import deque
import time
import math
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.dates as mdates
import matplotlib.pyplot as plt
class MyStrategy(Strategy):
#-------------------------------... | PP-lib/BFS | BFS-X/strategy/mm_volume2.py | mm_volume2.py | py | 9,867 | python | ja | code | 2 | github-code | 36 | [
{
"api_name": "matplotlib.use",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "libs.base_strategy.Strategy",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "time.time",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "collections.deque... |
11604375733 | import configparser
COMMENT_PREFIX = ";#*"
COMMENT_KEY = "__COMMENTS__"
class TABConfigParser(configparser.RawConfigParser):
"""
This class is used to override the Python built-in ConfigParser, because
TA builder needs to support:
1. Read/write .conf files with comments
2. Additional comment pref... | splunk/addonfactory-splunk-conf-parser-lib | addonfactory_splunk_conf_parser_lib.py | addonfactory_splunk_conf_parser_lib.py | py | 7,985 | python | en | code | 6 | github-code | 36 | [
{
"api_name": "configparser.RawConfigParser",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "configparser.DEFAULTSECT",
"line_number": 77,
"usage_type": "name"
},
{
"api_name": "configparser.SectionProxy",
"line_number": 83,
"usage_type": "call"
},
{
... |
29963289578 | """demo1 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-based v... | yahiaelpronc/Django_Project | Project/crowdFund/urls.py | urls.py | py | 2,261 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.urls.path",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.include",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "django.url... |
31474181781 | #!/home/apollo/anaconda3/bin/python3
#-*- coding: utf-8 -*-
#******************************************************************************
# Author : jtx
# Create : 2020-03-31 19:05
# Last modified: 2020-04-09 14:18
# Filename : company_kbp.py
# Description : 企业清洗库转移到企业知识库,处理:产业/产业领域标签添加、企业标签schema添加
... | RogerJTX/KbpPipeline_ExpertSystem | conference/conference_relation.py | conference_relation.py | py | 12,777 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "logging.basicConfig",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path.dirna... |
73706222505 | from django.urls import path
from .views import addVehiculo, registroView, loginView, listarVehiculo, logoutView
from . import views
# from . import views <-- do the same of line above
urlpatterns = [
path('add/', addVehiculo, name='addVehiculo'),
# path('vehiculo/add/', addVehiculo, name='addVehiculo'),
... | daus2020/dj_cars | vehiculo/urls.py | urls.py | py | 761 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "views.addVehiculo",
"line_number": 8,
"usage_type": "argument"
},
{
"api_name": "django.urls.path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "views.listarVeh... |
43162877389 | # 用卷积神经网络训练cifar10数据集:
# 搭建一个一层卷积 两层全连接的网络:
# 使用6个5*5的卷积核,过一个步长为2且大小为2*2的池化核,过128个神经元的全连接层,
# 因label是10分类,过10个神经元的全连接层。
# 1) 5*5 conv, filters=6 2)2*2 pool, strides=2 3)Dense 128 4)Dense 10
# C:(核:6*5*5, 步长:1, 填充:same)
# B:(Yes)
# A:(relu)
# P:(max, 核:2*2, 步长:2, 填充:same)
# D:(0.2)
# Flatten
... | Demonya/tensorflow_basic | P5/P5.10:卷积神经网络搭建示例.py | P5.10:卷积神经网络搭建示例.py | py | 3,454 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "tensorflow.keras",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.keras.models.Model",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "tensorflow.keras.layers.Conv2D",
"line_number": 33,
"usage_type": "call"
},
{
... |
9186533792 | """Contains pathfinding and maze generation algorithms"""
# Handles how much C++ the the program should use
from src.pathfinding.cpp_or_py import use_square_h
if use_square_h:
from src.pathfinding.cpp.modules import Square
else:
from src.pathfinding.py.square import Square
from lib.timer import sleep
from th... | ShanaryS/algorithm-visualizer | src/pathfinding/py/algorithms.py | algorithms.py | py | 24,976 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "src.pathfinding.cpp_or_py.use_square_h",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "dataclasses.field",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "dataclasses.field",
"line_number": 24,
"usage_type": "call"
},
{
"api_nam... |
28309754653 | #!/usr/bin/env python
"""
Springboard compiler
:author: Athanasios Anastasiou
:date: Mar 2022
"""
import os
import pyparsing
import click
import urllib
class SpringboardError(Exception):
pass
class SymbolRedefined(SpringboardError):
pass
class SymbolUndefined(SpringboardError):
pass
class CircularD... | aanastasiou/springboard | sbc.py | sbc.py | py | 8,586 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "os.getcwd",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "os.path.split",
"line_number": 81,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 81,
"usage_type": "attribute"
},
{
"api_name": "os.chdir",
"line_number": 83... |
27024295019 | import openai
openai.api_base = 'http://localhost:1234/v1'
openai.api_key = ''
# 'Llama2 Chat' prompt format:
prefix = "[INST]"
suffix = "[/INST]"
def get_completion(prompt, temperature=0.0):
formatted_prompt = f"{prefix}{prompt}{suffix}"
response = openai.ChatCompletion.create(
model... | lmstudio-ai/examples | Poor-Man's_Vector-Database/chat.py | chat.py | py | 497 | python | en | code | 139 | github-code | 36 | [
{
"api_name": "openai.api_base",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "openai.api_key",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "openai.ChatCompletion.create",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "o... |
72811988585 | from dotenv import load_dotenv
load_dotenv(override=True)
import os
appOAuthServer=os.getenv('OAUTH_SERVER')
appOAuthCredential=os.getenv('OAUTH_CRED')
appOAuthRedirectUrl=os.getenv('OAUTH_REDIRECT_URL')
import hvac
vault=hvac.Client(
url=os.getenv('VAULT_ADDR'),
token=os.getenv('VAULT_TOKEN')
)
import u... | CiscoDevNet/webex-vault-samples | people_me_flask.py | people_me_flask.py | py | 1,736 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 7,... |
72721076263 | from django.conf.urls import url, include
from rest_framework import routers
from .views import (UserViewSet, GroupViewSet, GenderList, GenderDetail, CountryList, CountryDetail, LanguageList,
LanguageDetail, CredentialList, CredentialDetail, PersonList, PersonDetail, CategoryList,
... | fortena/GakktuServer | gakktu/urls.py | urls.py | py | 2,163 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "rest_framework.routers.DefaultRouter",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "rest_framework.routers",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "views.UserViewSet",
"line_number": 8,
"usage_type": "argument"
},
{
"ap... |
5407159052 | from django.urls import path
from . import views
from django.conf import settings
from django.conf.urls.static import static
urlpatterns=[
path('' , views.dashboard , name='dashboard'),
path('teachers', views.teachers, name ='teachers'),
path('students', views.students, name='students'),
path('staff', ... | eliki-hue/school_DBMS | myschool/urls.py | urls.py | py | 701 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"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",
... |
75051245544 | from argparse import ArgumentParser
from json import dump, dumps, load, loads
from logging import INFO, basicConfig, getLogger
from subprocess import run
from emoji import emojize
from telegram import InlineKeyboardButton, InlineKeyboardMarkup, Update
from telegram.ext import (CallbackContext, CallbackQueryHandler,
... | GarikFirst/PyParkingBot | parking_bot.py | parking_bot.py | py | 15,861 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "telegram.Update",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "telegram.ext.CallbackContext",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "telegram.Update",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "telegram... |
72607798505 | #!/usr/bin/env python3
import rospy
import datetime
import sys, os
from rosgraph_msgs.msg import Log
rospy.init_node('NECST_logger')
###config
save_to = '/home/amigos/log'
try:
file_name = sys.argv[1]
except:
file_name = ''
###
def save_file_conf():
today = datetime.date.today()
year = today.year
... | nanten2/necst-ros | scripts/record/ROS_save_logger.py | ROS_save_logger.py | py | 1,525 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "rospy.init_node",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "datetime.date.today",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.date",
... |
37915846775 | # %%
from pathlib import Path
import csv
import matplotlib.pyplot as plt
from datetime import datetime
path = Path("weather_data/en_climate_daily_ON_6158355_2023_P1D.csv")
lines = path.read_text().splitlines()
reader = csv.reader(lines)
header_row = next(reader)
# Extract the percipitation.
dates, percips = [], []
... | hharpreetk/python-toronto-weather-data-viz | percip_visual.py | percip_visual.py | py | 1,060 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pathlib.Path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",... |
26612458702 | import logging
from django.conf import settings
class ShowDatabaseQueries(logging.Filter):
def filter(self, record):
return settings.DATABASE_DEBUG
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'filters': {
'require_debug_false': {
'()': 'django.utils.log.Re... | codecraft63/django-base | settings/system/logging.py | logging.py | py | 2,031 | python | hi | code | 0 | github-code | 36 | [
{
"api_name": "logging.Filter",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings.DATABASE_DEBUG",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 7,
"usage_type": "name"
}
] |
18336730125 | import json
from functions import get_access_token, get_animal_types, get_animals_by_type, \
get_animals_dataset, print_babies_adults, print_animal_types, \
digit_check, string_check, string_check_1, add_animal, info_about_pet
with open('data.json') as infile:
dataset = j... | evnng/Animal-Project | main_programm.py | main_programm.py | py | 3,472 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "json.load",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "functions.digit_check",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "functions.print_animal_types",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "functions... |
38037219571 | import logging
import re
class ColorUtil:
@staticmethod
def ShadeColor(hexColor, percent):
try:
hexNum = int(hexColor[1:], 16)
t = 0 if percent < 0 else 255
p = percent * -1 if percent < 0 else percent
R = hexNum >> 16
G = hexNum >> 8 & 0x00... | bhavesh-jadav/Power-BI-Theme-Generator | src/main/python/Util.py | Util.py | py | 1,158 | python | en | code | 8 | github-code | 36 | [
{
"api_name": "logging.error",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "logging.exception",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 38,
"usage_type": "call"
}
] |
18216820693 | import pygame
class Bullet(pygame.sprite.Sprite):
def __init__(self, gun):
pygame.sprite.Sprite.__init__(self)
self.image=pygame.Surface((10,10))
self.rect=self.image.get_rect()
self.image.fill((255,0,0))
self.rect.centerx=gun.rect.centerx
self.rect.centery=... | Vladimirk229/My-projects | pythongame/pythongame/bullet.py | bullet.py | py | 410 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pygame.sprite",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "pygame.sprite.Sprite.__init__",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.sprite",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "pyga... |
3458590367 | import numpy as np
from typing import List
#本质:元素的左上角元素都相同
class Solution:
def isToeplitzMatrix(self, matrix: List[List[int]]) -> bool:
if not matrix or not matrix[0]:
return True
m, n = len(matrix), len(matrix[0])
for i in range(m):
for j in range(n):
... | pi408637535/Algorithm | com/study/algorithm/daily/766. Toeplitz Matrix.py | 766. Toeplitz Matrix.py | py | 728 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "typing.List",
"line_number": 7,
"usage_type": "name"
}
] |
15492848684 | """pip/setuptools packaging
Based off https://github.com/pypa/sampleproject/blob/master/setup.py
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path, remove
import shutil
from malboxes._version import __v... | GoSecure/malboxes | setup.py | setup.py | py | 4,016 | python | en | code | 1,015 | github-code | 36 | [
{
"api_name": "os.path.abspath",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "shutil.copy",
"line_numbe... |
3381408882 | from rest_framework import serializers
from .models import PetModel, FA
from datetime import date,datetime,timedelta
from django.utils import timezone
class PetSerial(serializers.ModelSerializer):
class Meta:
model=PetModel
fields=(
"Category",
"Name",
"Sex",
"BirthDt",
"City",
"Departement",
... | tapaloeil/PetAdmin | Pet/serializers.py | serializers.py | py | 1,218 | python | en | code | 0 | github-code | 36 | [
{
"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": "models.PetModel",
"line_number": 8,
"usage_type": "name"
},
... |
43823710793 | import json
from collections import Counter
from template import *
relation_ground_truth_count = json.load(open("../../data/relation_count.json"))
for relation in relation_list[:1]:
result_data = []
with open(f"./data/alias/query_result/{relation}.json", "r") as f:
for line in f:
json_obj ... | bigdante/nell162 | backup/verification/chatgpt_gen_yes_no/check_gen.py | check_gen.py | py | 2,169 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "json.load",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 42,
"usage_type": "call"
}
] |
15169034619 | """
This module contains functions for creating transformer models that operate on grid-like inputs.
Functions:
- grid_transformer: returns a callable transformer model constructor that can operate on grid-like inputs.
"""
from typing import Optional, Tuple, Callable, Union
import core_tools.ops as K
import tensorfl... | jakubkwiatkowski/compositional_transformer | grid_transformer/tokenizer.py | tokenizer.py | py | 4,891 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "typing.Optional",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line... |
11693199631 | from allauth.account.forms import SignupForm
from django import forms as d_forms
from django.contrib.auth import forms, get_user_model
from django.contrib.auth.forms import UserChangeForm, UserCreationForm
from django.contrib.auth.models import Group
from django.core.exceptions import ObjectDoesNotExist, ValidationErro... | decorouz/elearningforfarmers | users/forms.py | forms.py | py | 2,176 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.forms.UserCreationForm",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "django.forms.EmailField",
"line_number": 13,
"usage_type": "... |
70175969705 | import datetime
from pandas_datareader import data as pdr
import queue
import threading
from pprint import pprint
def pullHistoricalData(holdings, benchmarks, start_date, end_date):
def assign_data_to_ticker(holdings, benchmarks, data):
for ticker in list(holdings.keys()):
holdings[ticker]['hi... | lamothe-hub/gsif-portfolio-risk-platform | gsif/dashboards/calculations/dataAccess.py | dataAccess.py | py | 4,579 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "pandas_datareader.data.get_data_yahoo",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pandas_datareader.data",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "datetime.timedelta",
"line_number": 30,
"usage_type": "call"
},
{
"a... |
34477179356 | # -*- coding: utf-8 -*-
"""
Created on Sun Jul 23 15:48:44 2023
@author: shikh
"""
import streamlit as st
import main_gp as gp
st.set_option('deprecation.showPyplotGlobalUse', False)
#gp.GaussianEngine(1,0.014,230,1,"C")
#gp.plot()
st.title("Air dispersion simulation")
st.text("Using Gaussian plume model")
def main... | shikhar58/Air-dispersion-model | run_file.py | run_file.py | py | 1,280 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "streamlit.set_option",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "streamlit.title",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "streamlit.text",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "streamlit.title",... |
73631480103 | import argparse
import random
import sys
from game import *
class OpeningBook():
"""
Very, very simple opening book to give the bot some direction.
"""
def __init__(self, game):
self.game = game
def findMove(self):
"""
. . .
/ \
. |wG1| .
\ /
. . ... | tylerxprice/hive-framework | randy.py | randy.py | py | 4,060 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "random.randrange",
"line_number": 132,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 145,
"usage_type": "call"
},
{
"api_name": "sys.stdout.write",
"line_number": 166,
"usage_type": "call"
},
{
"api_name": "sys.stdo... |
42090960900 | from pathlib import Path
import mmcv
from mmcls.apis import inference_model
from mmdet.apis import inference_detector
from mmseg.apis import inference_segmentor
from mmrazor.apis import init_mmcls_model, init_mmdet_model, init_mmseg_model
def _sync_bn2bn(config: mmcv.Config) -> None:
def dfs(cfg_dict) -> None:... | Gumpest/AvatarKD | tests/test_apis/test_inference.py | test_inference.py | py | 3,065 | python | en | code | 6 | github-code | 36 | [
{
"api_name": "mmcv.Config",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "mmcv.Config.fromfile",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "mmcv.Config",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "mmrazor.apis.i... |
29557419686 | import pytest
from brownie import chain, RewardsManager, reverts
from math import floor
from utils.config import network_name
from os.path import exists
import json
rewards_period = 3600 * 24 * 7
rewards_amount = 5_000 * 10**18
def test_acceptance(
ldo_token,
stranger,
rewards_contract,
helpers,
... | lidofinance/curve-rewards-manager | tests/test_acceptance.py | test_acceptance.py | py | 4,186 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "utils.config.network_name",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pytest.skip",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "utils.config.net... |
16048365956 | # -*- coding: UTF-8 -*-
"""
Name: gui_app.py
Porpose: bootstrap for Vidtuber app.
Compatibility: Python3, wxPython Phoenix
Author: Gianluca Pernigotto <jeanlucperni@gmail.com>
Copyleft - 2023 Gianluca Pernigotto <jeanlucperni@gmail.com>
license: GPL3
Rev: March.17.2023
Code checker: flake8, pylint
This file is part of... | jeanslack/Vidtuber | vidtuber/gui_app.py | gui_app.py | py | 9,442 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "builtins.__dict__",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "wx.GetTranslation",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "wx.App",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "vidtuber.vd... |
28861454822 | #!/usr/local/bin/python
# -*- coding: utf-8 -*-
from techism.models import Event, EventTag, Location, Organization, OrganizationTag, Setting, TweetedEvent
from django.contrib import admin
import reversion
class EventInline(admin.TabularInline):
model = Event
fields = ['title', 'date_time_begin', 'date_time_en... | techism/techism | techism/admin.py | admin.py | py | 2,057 | python | en | code | 7 | github-code | 36 | [
{
"api_name": "django.contrib.admin.TabularInline",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "techism.models.Event",
"line_number": 9,
"usage_type": "name"
},
{
"ap... |
73137395944 | # simulate_one_group.py
# Benjamin Crestel, 2020-12-22
import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import norm
from simulations import simulate_normal
def simulate_one_group(number_samples: int, mean: float = 100.0, std: float = 15.0):
"""
Generate samples of IQ tests and plot
:... | bcrestel/coursera_statisticalinferences | src/simulate_one_group.py | simulate_one_group.py | py | 1,114 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "simulations.simulate_normal",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 27,
"usage_type": "name"
},
{
"api_name... |
41396486126 | """A module for implementing communication tasks."""
from typing import Optional, Tuple
import numpy as np
from communication_tasks import monotones
from utils.utils import matrix_is_rowstochastic, sample_random_row_stochastic_matrix
class CommunicationMatrix:
"""A class which defines all relevant features of c... | oskarikerppo/communication-tasks | communication_tasks/communication_matrices.py | communication_matrices.py | py | 2,247 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.ndarray",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "utils.utils.matrix_is_rowstochastic",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "typing.Optional",
"line_number": 19,
"usage_type": "name"
},
{
"api_name":... |
73302038824 |
import pymongo
import csv
from csv import writer
from pymongo import MongoClient
import pandas as pd
# Conexão
try:
myclient = pymongo.MongoClient(
"mongodb+srv://teste:teste123@cluster0.1ylmc4y.mongodb.net/test")
mydb = myclient["prova2"]
print("\nConectado com sucesso\n")
except... | LuWroblewski/FaculdadePython | prova2Banco/crud1.py | crud1.py | py | 5,222 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "csv.DictReader",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "csv.DictReader",
"l... |
73880579625 | #
# This file is part of Pytricia.
# Joel Sommers <jsommers@colgate.edu>
#
# Pytricia is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later v... | jsommers/pytricia | testload.py | testload.py | py | 2,625 | python | en | code | 203 | github-code | 36 | [
{
"api_name": "unittest.TestCase",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "pytricia.PyTricia",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "gzip.GzipFile",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "gzip.GzipFile"... |
27649483225 | from django.shortcuts import render
from .models import ProductInBasket
from django.http import JsonResponse
from ordering.views import is_user_registered
def show_basket(request):
session_key = request.session.session_key
if is_user_registered(session_key): # Перевірка, чи є користувач зареєстрованим
... | akarumeis/CoffeMania | basket/views.py | views.py | py | 3,932 | python | uk | code | 1 | github-code | 36 | [
{
"api_name": "ordering.views.is_user_registered",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "ordering.views.is_user_registered",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "models.ProductInBasket.objects.filter",
"line_number": 10,
"usage_type"... |
31065339378 | ### Shuffle Cog ###
### Imports ###
# General
import json
# Library
import nextcord
from nextcord.ext import commands
from tinydb import TinyDB, Query
from utils import embeds
# Internal
from utils.content import ShuffleContent
from utils.embeds import embed_shuffle, embed_invalid_shuffle, embed_shuffle_records, em... | dbchristenson/meji | cogs/shuffle.py | shuffle.py | py | 11,298 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "tinydb.TinyDB",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "tinydb.Query",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "nextcord.ui",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "nextcord.ui",
"line_n... |
40967086967 | from django import forms
from django.forms import extras
from .models import *
class registered_user_form(forms.ModelForm):
username = forms.CharField(max_length=30)
password = forms.CharField(max_length=30)
date_of_birth = forms.DateField(widget=extras.SelectDateWidget(years=range(1900,2017)))
class ... | dsunchu/431W | congo/database/forms.py | forms.py | py | 5,910 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.forms.CharField",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.f... |
74509507304 | # -*- coding: utf-8 -*-
"""
Created on Fri Jun 25 10:59:09 2021
@author: gw
"""
from tkinter import *
from tkinter.tix import Tk,Control,ComboBox #升级的组合控件包
from tkinter.messagebox import showinfo,showwarning,showerror #各种消息提示框
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg #画布
from matplotlib.figure ... | 1135063213/Machine_Learning_GDAL_Interface | 神经网络_GDAL_tkinter.py | 神经网络_GDAL_tkinter.py | py | 13,873 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "tkinter.tix.Tk",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "matplotlib.font_manager.FontProperties",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "num... |
9738142506 | from django.urls import path
from . import views
app_name = 'todolist'
urlpatterns = [
path('home/', views.home, name="主页"),
path('about/', views.about, name="关于"),
path('edit/<每一件事_id>', views.edit, name="编辑"),
path('delete/<每一件事_id>', views.delete, name="删除"),
path('cross/<每一件事_id>', views.cross,... | AIM-1993/To_Do_List | Django_Projects/to_do_list/todolist/urls.py | urls.py | py | 379 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
31062259395 |
from ..utils import Object
class ToggleMessageSenderIsBlocked(Object):
"""
Changes the block state of a message sender. Currently, only users and supergroup chats can be blocked
Attributes:
ID (:obj:`str`): ``ToggleMessageSenderIsBlocked``
Args:
sender_id (:class:`telegram.api.typ... | iTeam-co/pytglib | pytglib/api/functions/toggle_message_sender_is_blocked.py | toggle_message_sender_is_blocked.py | py | 1,026 | python | en | code | 20 | github-code | 36 | [
{
"api_name": "utils.Object",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "utils.Object.read",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "utils.Object",
"line_number": 34,
"usage_type": "name"
}
] |
23165828885 | import csv
from flask import render_template,request,redirect
from app import app
from app.forms import SubmitForm
@app.route('/')
@app.route('/index',methods=['GET','POST'])
def index():
form=SubmitForm()
if request.method == "POST":
abc=request.form['query']
print(abc)
csv_file=o... | jain-abhi007/Fake-news-detection | app/routes.py | routes.py | py | 478 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "app.forms.SubmitForm",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "flask.re... |
42388719525 | from peewee import *
from datetime import datetime
from flaskblog import db, login_manager
from flask_login import UserMixin
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from flask import current_app
@login_manager.user_loader
def load_user(user_id):
return User.get_by_id(int(user_id))
... | Braindead3/vladislav_blog | flaskblog/models.py | models.py | py | 1,778 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flaskblog.login_manager.user_loader",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "flaskblog.login_manager",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "flaskblog.db",
"line_number": 18,
"usage_type": "name"
},
{
"api_n... |
73970127144 | from twilio import twiml
from twilio.rest import TwilioRestClient
f = open('.key.txt', "r")
key = f.readlines()
f.close()
MSG_HELP = "Valid commands:\n/find - find random partner\n/leave - leave current chat\n/share - share your phone number with partner\n/fun - more fun commands!"
MSG_FUN = "Fun fun! :D\n/count - s... | imondrag/project-kitten | server_files/twiliocomms.py | twiliocomms.py | py | 2,867 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "twilio.rest.TwilioRestClient",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "twilio.twiml.Response",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "twilio.twiml",
"line_number": 56,
"usage_type": "name"
}
] |
33203889383 | import folium
from geopy.geocoders import Nominatim
film_studio_cities = ['Los Angeles', 'Rome', 'Wellington', 'Saint-Denis', 'Mumbai', 'Ouarzazate', 'Berlin']
film_studio = ['Hollywood', 'Cinecitta', 'Weta', 'La Cité du Cinéma', 'Bollywood', ' Atlas', 'Filmpark Babelsberg']
locations = list()
lst = list()
titl... | lurak/web-map | map.py | map.py | py | 2,246 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "folium.Map",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "folium.FeatureGroup",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "folium.FeatureGroup",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "geopy.geocoders.No... |
73973980585 | import numpy as np
import transforms3d as t3d
from scipy.linalg import expm, sinm, cosm
class SE3(object):
"""
3d rigid transform.
"""
def __init__(self, R, t):
self.R = R
self.t = t
def matrix(self):
m = np.eye(4)
m[:3, :3] = self.R
m[:3, 3] = self.t
... | shanmo/OrcVIO | python_scripts/object_map_eval/se3.py | se3.py | py | 9,254 | python | en | code | 20 | github-code | 36 | [
{
"api_name": "numpy.eye",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.empty",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.norm",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"line_numb... |
41245528707 | import numpy as np
import torch.nn
from transformers import LukeTokenizer, LukeForEntityClassification, LukeConfig, TrainingArguments, Trainer, AutoTokenizer
from transformers import DataCollatorForTokenClassification, DataCollatorWithPadding
from tqdm import trange
from datasets import ClassLabel, load_dataset
import ... | joseMalaquias/tese | Agosto/OpenEntity/evaluate_simple.py | evaluate_simple.py | py | 3,520 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.basicConfig",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.cuda.empty_cache",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch... |
29442744987 | from brownie import network, accounts, config, MockV3Aggregator
from web3 import Web3
DECIMALS = 8
STARTING_PRICE = 200000000000
# you can see all env of brownie by running "brownie networks list" in terminal
LOCAL_BLOCKCHAIN_ENVIRONMENT = ["development", "ganache-local"]
FORKED_LOCAL_ENVIRONMENT = ["mainnet-fork"]
... | PremMehta01/web3_brownie_fundMe | scripts/helpful_scripts.py | helpful_scripts.py | py | 1,163 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "brownie.network.show_active",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "brownie.network",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "brownie.network.show_active",
"line_number": 18,
"usage_type": "call"
},
{
"api_name"... |
439277880 | """Used to call an external NLP API for a given text input """
# Library imports
import cProfile
import pstats
import logging
import os
import PyPDF2 as pypdf
import nltk
from nltk.sentiment import SentimentIntensityAnalyzer
import src.Internal_API.db_connector as db_connector
# Setup logging for text analysis module
... | CMander02/SmartNewsAnalyzer | src/ExternalAPI/text_analysis.py | text_analysis.py | py | 3,192 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "logging.StreamHandler",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "logging.DE... |
11686474471 |
import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim import lr_scheduler
from torch.autograd import Variable
import numpy as np
import torchvision
from torchvision import datasets, models, transforms
import matplotlib.pyplot as plt
import time
import os
import copy
from torch.utils.data impo... | Tea-Script/HandwritingRecognition | datasets.py | datasets.py | py | 9,114 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "matplotlib.pyplot.ion",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "skimage.transform.resize",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "skim... |
35225497072 | import logging
import pathlib
import sys
from helloworld.errors import OutputFileExists
_logger = logging.getLogger(__name__)
def write_message(message, output_file, clobber=False):
if output_file != '-':
# only overwrite output_file if --clobber specified.
if pathlib.Path(output_file).exists() ... | KeithMnemonic/python-helloworld | helloworld/scripts/cli_utils.py | cli_utils.py | py | 1,155 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "helloworld.errors.OutputFileExists",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.... |
24288468105 | # -*- coding: utf-8 -*-
"""
Created on Sat Oct 16 17:56:41 2021
@author: s2073467
"""
import os
import scipy.io
import matplotlib.pyplot as plt
import scipy.signal
import voltron_ROI as ROI
import pandas as pd
import numpy as np
from airPLS import airPLS
#%% Load triggered mode data
'''triggered: lo... | MattNolanLab/SPAD_in_vivo | SPAD_ex_vivo_analysis/Spike_trigger.py | Spike_trigger.py | py | 6,758 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "scipy.io.io.loadmat",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "scipy.io.io",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "scipy.io",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"lin... |
42232863780 | # -*- coding:utf-8 -*-
import mysql.connector
from mysql.connector import Error
from ConfigParser import ConfigParser
from Errors import Errors
from datetime import datetime
class DbConnector():
def __init__(self):
pass
def getConnection(self):
conn=None
dbconfig=self._... | FelixMailwriter/VendService | DAL/DBConnector.py | DBConnector.py | py | 9,921 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "mysql.connector.connector.connect",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "mysql.connector.connector",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "mysql.connector",
"line_number": 19,
"usage_type": "name"
},
{
"... |
37319866519 | import pickle
import json
import numpy as np
import pygame
import cv2
import copy
from overcooked_ai_py.env import OverCookedEnv
from overcooked_ai_py.mdp.overcooked_mdp import OvercookedState
from overcooked_ai_py.visualization.state_visualizer import StateVisualizer
from overcooked_ai_py.mdp.overcooked_mdp import Re... | bic4907/Overcooked-AI | test/visualize_dataframe.py | visualize_dataframe.py | py | 2,684 | python | en | code | 19 | github-code | 36 | [
{
"api_name": "pickle.load",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "overcooked_ai_py.env.OverCookedEnv",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "replay_buf... |
27022438847 | """JSON loaders."""
from flask import request
from .errors import MarshmallowErrors
def marshmallow_loader(schema_class):
"""Marshmallow loader for JSON requests."""
def json_loader():
request_json = request.get_json()
context = {}
pid_data = request.view_args.get('pid_value')
... | slint/cookiecutter-invenio-datamodel | {{cookiecutter.project_shortname}}/{{cookiecutter.package_name}}/loaders/json.py | json.py | py | 714 | python | en | code | null | github-code | 36 | [
{
"api_name": "flask.request.get_json",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.request",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "flask.request.view_args.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flas... |
22602819959 | import numpy as np
import matplotlib.pyplot as plt
import os
from glob import glob
import json
def plot_item(key='train_loss'):
sub_dirs = glob("./logs/*/", recursive=False)
plt.figure(figsize=(6, 4))
plt.xticks(range(21))
for sub_dir in sub_dirs:
_ = sub_dir[sub_dir.index('_')+1:]
net... | Gariscat/HouseX | plot.py | plot.py | py | 935 | python | en | code | 18 | github-code | 36 | [
{
"api_name": "glob.glob",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot... |
8361752991 |
import os
import requests
from os.path import join, dirname
from dotenv import load_dotenv
dotenv_path = join(dirname(__file__), '.env')
load_dotenv(dotenv_path)
# variables loaded in from .env file
COC_TOKEN = os.environ.get("COC_TOKEN")
headers = {
'Accept': 'application/json',
'authorization': 'Bearer ' ... | dougscohen/ClashStash | clash.py | clash.py | py | 5,842 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.join",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "dotenv.load_dotenv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"li... |
24398908749 | from flask import Flask, jsonify
from flask_restful import Api
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_cors import CORS
from sqlalchemy import or_ , cast
from sqlalchemy.dialects.postgresql import TEXT
url = open("databaseuri.txt", "r").read().rstrip()
app = Flas... | CarsenKennedy/EU4-flask-api | app.py | app.py | py | 4,707 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask_restful.Api",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlc... |
27574117500 | import libpysal as lps
import geopandas as gpd
import csv
state = "ok"
file = ("./ok_boundary.json")
shp = gpd.read_file(file)
rW = lps.weights.Rook.from_dataframe(shp, idVariable="GEOID")
outputName = state + "_neighbors.csv"
header = ['id','NEIGHBORS']
with open(outputName, 'w', newline='') as csv_out:
write... | kenchin3/CSE416_Warriors | client/preprocessing/neighbors.py | neighbors.py | py | 682 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "geopandas.read_file",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "libpysal.weights.Rook.from_dataframe",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "libpysal.weights",
"line_number": 10,
"usage_type": "attribute"
},
{
"api... |
32144801473 | from typing import List, Any
from sqlalchemy.orm import Session
from api import schemas, models, crud
from api.votes import schemas as votes_schemas
def get_votes_from_game_id(db: Session, game_id: int) -> List[Any]:
return db.query(models.Vote).filter(models.Vote.game_id == game_id).all()
def add_vote(db: Sess... | cyborggeneraal/weerwolven | api/votes/crud.py | crud.py | py | 722 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "sqlalchemy.orm.Session",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "api.models.Vote",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "api.models",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.List",
... |
37087106292 | from torch.utils import data
from get_data import get_data
import torch
BATCH_SIZE = 4
[items, attributes, df] = get_data()
NUM_ITEMS = len(items)
NUM_ATTRIBUTES = len(attributes)
features = torch.tensor(to_categorical(range(NUM_ITEMS)), dtype=torch.float32)
targets = torch.tensor(df.values, dtype=torch.float32)
... | Pocket-titan/rogers_mcclelland_pytorch | dataset.py | dataset.py | py | 966 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "get_data.get_data",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.tensor",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.float32",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "torch.tensor",
"... |
1990226900 | from collections import deque, OrderedDict
import numpy as np
import dm_env
from dm_control.mujoco.engine import Camera
def xyz2pixels(xyz, cam_mat):
""" Project 3D locations to pixel locations using the camera matrix """
xyzs = np.ones((xyz.shape[0], xyz.shape[1]+1))
xyzs[:, :xyz.shape[1]] = xyz
xs... | rinuboney/FPAC | dm_wrappers.py | dm_wrappers.py | py | 8,725 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.ones",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "dm_env.Environment",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "collections.OrderedDic... |
74962694182 | import datetime
import qrcode
from django.core.mail import send_mail
from django.utils.crypto import get_random_string
from rest_framework import status
from rest_framework.generics import get_object_or_404
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework impo... | theshag1/Instagram | user/views.py | views.py | py | 14,038 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "rest_framework.views.APIView",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "user.models.User.objects.filter",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "user.models.User.objects",
"line_number": 34,
"usage_type": "attribute"
},... |
6432501039 | import json,time
from collections import Iterable
from django.utils.timezone import datetime
from django.conf import settings
from django.core.paginator import Paginator
from django.http import JsonResponse
from django.views.generic import View
from Hellocial_0_1.settings import logger
from apps.products.models import ... | eashme/Django-backend | Hello_Server/apps/scripts/views.py | views.py | py | 16,481 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "utils.mixin.OperatorAuthorityView",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "Hellocial_0_1.settings.logger.debug",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "Hellocial_0_1.settings.logger",
"line_number": 35,
"usage_type": "n... |
28555405451 | import time
import sys
import math
from dronekit import connect, VehicleMode, LocationGlobalRelative, Command
from vehicle_additional import get_bearing, get_distance_metres, get_location_metres
from pymavlink import mavutil
from pid import PID
from wingman import Wingman
import argparse
parser = argparse.ArgumentPar... | liangz678/arduplane_formation_flying | mission_follow.py | mission_follow.py | py | 1,486 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "dronekit.connect",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "dronekit.connect",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "wingman.Win... |
35836541266 | # @Date : 22:38 05/01/2020
# @Author : ClassicalPi
# @FileName: Data_Analysis.py
# @Software: PyCharm
import numpy as np
from pyecharts.charts import Map,Geo
from pyecharts import options
import pandas as pd
import nltk
import re
import os
import matplotlib.pyplot as plt
import string
import json
import openpyxl
... | QiaoLin-MA/Sentiment_Analysis | Sentiment_Analysis/Code/Data_Analysis.py | Data_Analysis.py | py | 12,007 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.chdir",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "openpyxl.load_workbook",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "openpyxl.load_workbook",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "openpyxl.load_... |
7194793169 | from collections import defaultdict
from typing import List, TypeVar, Generic, Dict, Optional
from mapfmclient import Problem
from src.data.agent import Agent
from src.data.vertex import Vertex
A = TypeVar("A", bound=Agent)
class Grid(Generic[A]):
def __init__(self, problem: Problem):
self.width: int =... | RobbinBaauw/CBMxSOC | src/grid.py | grid.py | py | 950 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "typing.TypeVar",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "src.data.agent.Agent",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.Generic",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "mapfmclient.Problem"... |
12149713993 | from asyncio import current_task
from typing import AsyncGenerator, Any
from sqlalchemy.ext.asyncio import create_async_engine, async_sessionmaker, async_scoped_session, AsyncSession
from core.config import settings
class DataBaseHelper:
def __init__(self, url: str, echo: bool) -> None:
self.engine = cr... | Norgius/microshop | core/models/db_helper.py | db_helper.py | py | 1,060 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sqlalchemy.ext.asyncio.create_async_engine",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.ext.asyncio.async_sessionmaker",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.ext.asyncio.async_scoped_session",
"line_numb... |
14352296820 | import unittest
import mock
import networkx
from kiva.testing import KivaTestAssistant
from graphcanvas.graph_container import GraphContainer
from graphcanvas.graph_node_component import GraphNodeComponent
from graphcanvas.graph_view import graph_from_dict
class TestGraphContainer(KivaTestAssistant, unittest.TestC... | enthought/graphcanvas | graphcanvas/tests/test_graph_container.py | test_graph_container.py | py | 8,263 | python | en | code | 25 | github-code | 36 | [
{
"api_name": "kiva.testing.KivaTestAssistant",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "unittest.TestCase",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "graphcanvas.graph_view.graph_from_dict",
"line_number": 19,
"usage_type": "call"
... |
9221143434 | import requests, os
from flask import Flask, jsonify, render_template, request
app = Flask(__name__)
apikey = os.getenv("API_KEY")
@app.route("/")
def index():
return render_template("index.html")
@app.route("/convert", methods=["POST"])
def convert():
# Query for currency exchange rate
symbol = requ... | Yoimer/cs50-lecture-folders | lecture5/convert/application.py | application.py | py | 876 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.request.form.get",
... |
32160839259 | """
Multiple WAD Injector
checks for a settings file and:
- Clones OOTR repo if not already present
- Then prints a link to it if gz gui is not already present
- Then requests a settings string if not present
- Then Requests the number of seeds to generate, if not present
Then loops and generates the roms, follow... | castlez/MultiWadOOTR | main.py | main.py | py | 4,857 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "json.loads",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 36,
... |
40364787807 | import os
import tempfile
import requests
from testbot.configs import worker_config, server_url
from testbot.util import md5sum
class APIError(Exception):
pass
def get_auth_param():
return worker_config['name'], worker_config['password']
def report_started(submission_id: int, work_id: str, hostname: str... | tjumyk/submit-testbot | testbot/api.py | api.py | py | 3,017 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "testbot.configs.worker_config",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "requests.put",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "testbot.configs.server_url",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": ... |
5096598714 | from FastExpression import *
from backtesting import Backtest, Strategy
from backtesting.lib import crossover
from backtesting.test import SMA
import math
import pandas as pd
class SmaCross(Strategy):
n1 = 10
n2 = 20
def init(self):
close = self.data.Close
self.sma1 = self.I(SMA, close, sel... | quangtiennnn/cryptoprediction | QuantAnalysis.py | QuantAnalysis.py | py | 2,022 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "backtesting.Strategy",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "backtesting.test.SMA",
"line_number": 13,
"usage_type": "argument"
},
{
"api_name": "backtesting.test.SMA",
"line_number": 14,
"usage_type": "argument"
},
{
"api_name": ... |
36579110550 | #!/usr/bin/env python3
# coding: utf-8
import re
from PIL import Image, ImageDraw
import yaml, sys, subprocess
def draw_arc(draw: ImageDraw.ImageDraw, target, offset=(0,0), scale=1.0):
# check
# calc
x0 = (target['center']['x'] - target['radius']) * scale + offset[0]
x1 = (target['center']['x'] + target['radius']... | takumi4424/takumi4424 | generate_icon.py | generate_icon.py | py | 1,441 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "PIL.ImageDraw.ImageDraw",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "PIL.ImageDraw",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "PIL.ImageDraw.ImageDraw",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": ... |
29266081838 | import cv2
from model import FacialExpressionModel
import numpy as np
import threading, time
import queue
import logging
import sys
from memory_profiler import profile
logging.basicConfig(level=logging.DEBUG,
format='(%(threadName)-9s) %(message)s',)
BUFFER_SIZE = 700
qbuffer = queue.... | nuralabuga/facial-expression-recognition--with--multithreads | camera_multithread_ram.py | camera_multithread_ram.py | py | 3,226 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.basicConfig",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "queue.Queue",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "threading.Thread",... |
15973885303 | #!/usr/bin/python3
#endereço do compilador para usar o executável
#import dos módulos:
import tkinter as tk
from tkinter import ttk
import serial
import numpy as np
Polynomial = np.polynomial.Polynomial
import math
import matplotlib.pyplot as plt
#---------------------
#Variáveis globais:
global portaUSB
portaUSB = ""... | abbarreto/Beer-Lambert | GuiLambertv1.py | GuiLambertv1.py | py | 23,636 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.polynomial",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "serial.Serial",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "tkinter.StringVar",
"line_number": 205,
"usage_type": "call"
},
{
"api_name": "tkinter.StringV... |
74352223463 | # -*- coding: utf-8 -*-
"""
Created on Fri Feb 18 13:40:36 2022
maybe needed:
%load_ext autoreload
%autoreload 2
@author: fabian_balzer
"""
# %%
import argparse
import input_scripts.availability_plots as av
import input_scripts.filter_coverage_plot as fc
import input_scripts.separation_plots as sep
import output_... | Fabian-Balzer/sel-4hi-q | old/master_plots.py | master_plots.py | py | 4,507 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "util.my_tools.LOGGER.info",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "util.my_tools.LOGGER",
"line_number": 50,
"usage_type": "attribute"
},
{
"api_n... |
74024990185 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from typing import NoReturn
import streamlit as st
def page_title_area(title: str) -> NoReturn:
"""
标题栏内容
:param title: 标题名称
:return: None
"""
col1, _, _, col4 = st.columns(4)
title_container = st.container()
with title_container:
w... | zhaoqianjie/imageAI-streamlit | streamlit_gallery/views/object_detection/header.py | header.py | py | 400 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "streamlit.columns",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "streamlit.container",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "streamlit.title",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "streamlit.divid... |
21544899518 | import pytest
from autots.models import NeuralCDE
from autots.tests import helpers
from autots.utils import make_time_series_problem
def setup_ncde_problem(static_dim=None, use_initial=True):
# Simple problem
input_dim = 4
output_dim = 1
data, labels = make_time_series_problem(
n_channels=inp... | jambo6/autots | autots/tests/models/test_ncde.py | test_ncde.py | py | 1,063 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "autots.utils.make_time_series_problem",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "autots.models.NeuralCDE",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "autots.tests.helpers.training_loop",
"line_number": 39,
"usage_type": "call... |
34088049341 | import scrapy
class QuotesSpider(scrapy.Spider):
name = "quotes"
def start_requests(self):
#start_urls
urls = [
'https://quotes.toscrape.com/page/1/',
'https://quotes.toscrape.com/page/2/'
]
for url in urls:
yield scrapy.Request(url=url, c... | nikku179201/Scrapy_Project | MyScrapyProject/spiders/test.py | test.py | py | 1,154 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "scrapy.Spider",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "scrapy.Request",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "scrapy.Request",
"line_number": 37,
"usage_type": "call"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.