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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
74835193187 | from itertools import combinations
def solution(nums):
answer = -1
comb = list(combinations(nums,3))
sum_comb = [sum(c) for c in comb]
prime = len(sum_comb)
for num in sum_comb:
for i in range(2, num):
if(num % i == 0):
prime -= 1
break
... | algorithm-studying/daily | 2022_01_06/1_python_안서연.py | 1_python_안서연.py | py | 358 | python | en | code | 1 | github-code | 70 | [
{
"api_name": "itertools.combinations",
"line_number": 6,
"usage_type": "call"
}
] |
20117742471 | import datetime
import email
import re
import time
import os
from email.header import decode_header, make_header
from imaplib import ParseFlags
class Message():
def __init__(self, mailbox, uid):
self.uid = uid
self.mailbox = mailbox
self.gmail = mailbox.gmail if mailbox else None
... | charlierguo/gmail | gmail/message.py | message.py | py | 8,001 | python | en | code | 1,742 | github-code | 71 | [
{
"api_name": "imaplib.ParseFlags",
"line_number": 121,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 125,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 126,
"usage_type": "call"
},
{
"api_name": "email.header.decode_header"... |
41896754487 | #coding=utf-8
'''
Created on 2015年5月28日
'''
from common.errors import BaseError
__author__ = 'chenjian'
class BaseException(Exception):
'''
异常类
'''
def __init__(self, code, **kwargs):
'''
Constructor
'''
self.code = code
self.message = BaseError.get_message(code)... | tuomao/tornaodo_interface_model | util/exception.py | exception.py | py | 899 | python | zh | code | 1 | github-code | 70 | [
{
"api_name": "common.errors.BaseError.get_message",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "common.errors.BaseError",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "common.errors.BaseError.ERROR_COMMON_REQUEST_PARAM_INVALID",
"line_number": 29,
... |
11243728358 | from django.shortcuts import render
from blog.models import Books
def home(request):
""" Использование Django шаблонов. Метод обрабатывает запрос `/` """
# Объект который будет передан в шаблон
context = {
'message': 'Добро пожаловать',
'left': 'сообщение слева',
'right': 'сообще... | nstrashevskii/first_django_blog | part_1/views.py | views.py | py | 650 | python | ru | code | 0 | github-code | 70 | [
{
"api_name": "blog.models.Books.objects.all",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "blog.models.Books.objects",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "blog.models.Books",
"line_number": 13,
"usage_type": "name"
},
{
"ap... |
32732502919 | #!/usr/bin/python
import json, sys, zmq
from optparse import OptionParser
class terminal_colors:
red = '\033[31m'
green = '\033[32m'
yellow = '\033[33m'
blue = '\033[34m'
cyan = '\033[36m'
bright_red = '\033[91m'
bright_green = '\033[92m'
bold = '\033[1m'
faint = '\033[2m'
e... | tingbot/tbprocessd | tbtail.py | tbtail.py | py | 1,226 | python | en | code | 2 | github-code | 70 | [
{
"api_name": "optparse.OptionParser",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "zmq.Context",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "zmq.SUB",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "zmq.SUBSCRIBE",
"l... |
73010507745 | from django.shortcuts import render, get_object_or_404
from drf_yasg import openapi
from drf_yasg.utils import swagger_auto_schema
from rest_framework import generics
from rest_framework.decorators import action
from .errors import MissingQueryParameterException
from .models import Banks, Branches
from .serializers im... | AnubhavUjjawal/fyle-backend-test | bank_service/views.py | views.py | py | 1,838 | python | en | code | 1 | github-code | 70 | [
{
"api_name": "rest_framework.generics.ListAPIView",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.generics",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "serializers.BranchSerializer",
"line_number": 13,
"usage_type": "name"
... |
73095271266 | import cv2 #导入 Opencv
import os
import numpy as np
import matplotlib.pyplot as plt
from skimage import color # require skimage
import torchvision.transforms as transforms
import torch
from scipy import stats
# a = torch.randint(size=(1, 3, 6, 6), high=10)
# b = a[:, 1, :, :]
# print(a, b)
img_f... | GangPingZ/pytorch-CycleGAN-and-pix2pix-master | ZGP/颜色直方图/直方图.py | 直方图.py | py | 2,495 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "cv2.imread",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2RGB",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "skimage.color.rgb2lab"... |
22542183065 | from tqdm import tqdm
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.utils.data import DataLoader
from utils import TrainSet
from AdaIN import StyleTransferNet
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--content... | ziwei-jiang/AdaIN-Style-Transfer-PyTorch | train.py | train.py | py | 3,186 | python | en | code | 10 | github-code | 71 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "utils.TrainSet",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "torch.utils.data.DataLoader",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "to... |
27504635977 | #Tomes, Christopher
#Cal Poly Pomona CS4650
#update_data.py
#This program will make a prediction on which stocks to buy and sell.
#
import requests
import json
import os
#Grab api key from folder
def read_api_key_file(filename):
with open(filename, 'r') as file:
api_key = file.readline().strip()
return ... | Ctomes/Project_5_Stocks | update_data.py | update_data.py | py | 1,345 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "requests.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "json.dump",
"line_number":... |
9318511507 | #add requests
import requests
import re
from bs4 import BeautifulSoup
import json
import csv
pagenum = 9500
cat = ['[好雷]','[普雷]','[負雷]']
sup = []
nom = []
min = []
def extract(pagenum):
response = requests.get("https://www.ptt.cc/bbs/movie/index" + str(pagenum) + ".html")
soup = BeautifulSoup(response.text, "html.... | LinVince/WeHelp | week-3/movie.py | movie.py | py | 982 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 15,
"usage_type": "call"
}
] |
16792536696 | import atexit
from collections import namedtuple, defaultdict
import datetime
import os
import subprocess
import feedgenerator
from jinja2 import Environment, FileSystemLoader, select_autoescape
import watchdog
import watchdog.events
import watchdog.observers
WEBSITE_URL = 'https://www.moderndescartes.com'
# Where t... | brilee/modern-descartes-v2 | make.py | make.py | py | 5,690 | python | en | code | 1 | github-code | 70 | [
{
"api_name": "jinja2.Environment",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "jinja2.FileSystemLoader",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "jinja2.select_autoescape",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "c... |
35517454454 | # -*- coding: utf-8 -*-
__author__ = "yangtao"
import sys
import datetime
import os
from PySide2 import QtWidgets
from PySide2 import QtGui
class Unpack_Widget(QtWidgets.QDialog):
def __init__(self, parent=None):
super(Unpack_Widget, self).__init__(parent=parent)
self.setWindowTitle("释放")
... | Tody190/file_packaging_tool | ui/main_ui.py | main_ui.py | py | 5,340 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "PySide2.QtWidgets.QDialog",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "PySide2.QtWidgets",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "PySide2.QtWidgets.QLineEdit",
"line_number": 21,
"usage_type": "call"
},
{
"api_... |
40868717185 | import numpy
import numpy as np
import logging, os
import pandas as pd
import plotly.graph_objects as go
from tabulate import tabulate
import plotly.express as px
# import EntropicFOMs
from EntropicFOMs.SyntheticData import *
from EntropicFOMs.ObjFunctions import *
import numpy.random as nprand
import numpy.linalg as n... | gurbuzbalaban/risk_averse_momentum | EntropicsFOMs/sFoms.py | sFoms.py | py | 50,936 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "logging.basicConfig",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"... |
38972662776 | import asyncio
import logging
from functools import wraps
from typing import Generator, Tuple
from fastapi import HTTPException
from google.auth.exceptions import InvalidValue, MalformedError
from google.auth.transport import requests
from google.oauth2 import id_token
from requests import status_codes
from app.confi... | streamchaser/streamchaser | backend/app/util.py | util.py | py | 1,552 | python | en | code | 52 | github-code | 70 | [
{
"api_name": "logging.INFO",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "logging.FileHandler",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "logging.StreamHandler",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "typing.Tu... |
28707757197 | import re
import os
import csv
from itertools import islice
import numpy as np
def parse_inputs(filename, label_dict):
"""Read input file and convert into inputs, labels for training
Args:
filename: text file - has content format as
image_path, x1, x2, y1, y2, label1
image_path, x1... | datlife/cargan | cargan/utils/parser.py | parser.py | py | 4,865 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "csv.reader",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "itertools.islice",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.stack",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number... |
26414045226 | import ctypes
import time
import pandas as pd # 가져온 채팅내용 DF로 쓸거라서
import win32api
import win32con
import win32gui
from pywinauto import clipboard # 채팅창내용 가져오기 위해
# 카톡창 이름
# kakao_opentalk_name = '♥ 디아블로2레저렉션 대장방 ♥'
kakao_opentalk_name = '이인우'
# 체크할 커맨드
# chat_command = '계약번호'
chat_command = 'ㅋ'
PBYTE256 = ctypes.c... | NyamNyamee/python_api_test_1 | app/katalkCrawler2.py | katalkCrawler2.py | py | 7,868 | python | ko | code | 0 | github-code | 70 | [
{
"api_name": "ctypes.c_ubyte",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "ctypes.WinDLL",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "win32api.PostMessage",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "win32gui.... |
2234947958 | from collections import defaultdict
from typing import Dict
from typing import List
from typing import Optional
from typing import Set
from adventofcode.tools.input import read_puzzle_input
def parse_puzzle_input(puzzle_input: List[str]) -> Dict[str, Set[str]]:
network = defaultdict(set)
for line in puzzle_i... | simon-keith/adventofcode | adventofcode/aoc2021/day12.py | day12.py | py | 1,478 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "typing.List",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "collections.defaultdict",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "typing.Dict",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.Set",
"lin... |
24160086258 | """Customized ProcessPoolExecutor."""
import concurrent.futures
import concurrent.futures.process
import multiprocessing
def _process_worker(initializer, call_queue, result_queue):
"""Runs initializer before _process_worker to set signal handlers."""
initializer()
concurrent.futures.process._process_worke... | nvdv/atq | atq/executor.py | executor.py | py | 1,102 | python | en | code | 89 | github-code | 71 | [
{
"api_name": "concurrent.futures.futures.process._process_worker",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "concurrent.futures.futures",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "concurrent.futures",
"line_number": 10,
"usage_type": ... |
33550235937 | import sys
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QApplication, QWidget, QDialog
from PyQt5.QtWidgets import QPushButton, QVBoxLayout, QHBoxLayout, QGridLayout, QGroupBox, QScrollArea, QPlainTextEdit
from PyQt5.QtWidgets import QDesktopWidget, QMenu, QAction
from PyQt5.QtGui import QIcon, QPixmap
clas... | amgtier/ESDrawer | src/load_mva.py | load_mva.py | py | 1,704 | python | en | code | 1 | github-code | 70 | [
{
"api_name": "PyQt5.QtWidgets.QDialog",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QVBoxLayout",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QHBoxLayout",
"line_number": 24,
"usage_type": "call"
},
{
"ap... |
6915031626 | import argparse
import cv2
parser = argparse.ArgumentParser()
parser.add_argument("-i", "--image", default="phantom.jpg",
help="path to input image")
args = vars(parser.parse_args())
image = cv2.imread(args["image"])
cv2.imshow("RGB", image)
for (name, channel) in zip(("B", "G", "R"), cv2.split(i... | khoalevi/notebook | opencv/image_processing/color_spaces.py | color_spaces.py | py | 919 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.split",
"line_num... |
72800302628 | import requests
import yaml
import json
import time
TARGET_URL = "https://sudomaze.dev"
BASE_URL = "https://www.googleapis.com/pagespeedonline/v5/runPagespeed"
PATHS = ['/']#,'/about','/notes','/projects','/cv','/site']
CATEGORIES = ["accessibility", "best-practices", "performance", "pwa", "seo"]
# get the dynamic pa... | ma7dev/__sudomaze.github.io | test/PageSpeedInsights.py | PageSpeedInsights.py | py | 1,408 | python | en | code | 2 | github-code | 70 | [
{
"api_name": "time.time",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "yaml.load",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "yaml.FullLoader",
"line_number": 19... |
30085403059 | # -*- coding: utf-8 -*-
"""
Created on Sat Jul 11 20:03:36 2020
@author: Meihaonan
"""
import os
import paddle
import numpy as np
import paddle.fluid as fluid
from multiprocessing import cpu_count
import matplotlib.pyplot as plt
def to_image(L): #将1*2400连续胎心率数据点转化成120*2400胎心率曲线图
image=np.... | AsureSkur/FetalDetect | fetaldetect.py | fetaldetect.py | py | 7,930 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "numpy.zeros",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.int",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "numpy.loadtxt",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_nu... |
38879454271 | import io
import os
import json
import traceback
import urllib.parse
import boto3
import copy
import botocore.response as br
import requests
import base64 as b64
from datetime import datetime, tzinfo,timezone,timedelta
#from boto3.dynamodb.conditions import Key
#from boto3.dynamodb.conditions import Attr
#clients
s3 ... | SAP-samples/btp-aws-ppe-detection-ehs | Code/AWS/Lambda/AnomalyDetection/detectAnomalies.py | detectAnomalies.py | py | 4,159 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "boto3.client",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "urllib.parse.parse.unquote_plus",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "urllib.pars... |
10934625917 | from PIL import Image
import piexif
import logging
logger = logging.getLogger('app_api')
def rotate_image(img_path):
with Image.open(img_path) as im:
img = im.copy()
if "exif" in img.info:
exif_dict = piexif.load(img.info["exif"])
if piexif.ImageIFD.Orientation in exif_dict["0th"]:... | Dathmar/vintageLove | products/image_generation.py | image_generation.py | py | 1,847 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "piexif.load",
"line_num... |
39599868475 | from common.code.ParameterSetting import ParameterSetting
from common.code.extract_data import Extract_dataProcess
from common.log_common.log_util import Logger
from common.request_common.Requests_util import Request
"""api 的api_response字段值获取"""
class Api_response:
@classmethod
def casedata_api_response(cls,... | ZhiXianSheng1/ApiTest_ | common/code/Case_Api_response.py | Case_Api_response.py | py | 1,430 | python | en | code | 1 | github-code | 70 | [
{
"api_name": "common.log_common.log_util.Logger.my_log",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "common.log_common.log_util.Logger",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "common.request_common.Requests_util.Request.get",
"line_number": 1... |
26785147022 | """
This module implements a SRS File Reader.
"""
import re
import datetime
from collections import OrderedDict
import numpy as np
import astropy.io.ascii
import astropy.units as u
from astropy.table import Column, MaskedColumn, QTable, vstack
__all__ = ['read_srs']
def read_srs(filepath):
"""
Parse a SRS ... | sunpy/sunpy | sunpy/io/special/srs.py | srs.py | py | 11,386 | python | en | code | 828 | github-code | 70 | [
{
"api_name": "astropy.io.ascii.io.ascii.read",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "astropy.io.ascii.io",
"line_number": 51,
"usage_type": "attribute"
},
{
"api_name": "astropy.io.ascii",
"line_number": 51,
"usage_type": "name"
},
{
"api_name... |
34134740737 | ####################################################################
# WARNING #
####################################################################
# This code is provided "AS IS" without warranty of any kind. #
# Use of this code in any form acknowledges ... | zorrobyte/esp32-universal-diesel-heater-controller | lib/networking.py | networking.py | py | 6,438 | python | en | code | 7 | github-code | 70 | [
{
"api_name": "network.WLAN",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "network.STA_IF",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "umqtt.simple.MQTTClient",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "hardwareConf... |
1868610302 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import torch
import torch.nn as nn
import numpy as np
class TextGenerationModel(nn.Module):
def __init__(self, batch_size, seq_length, vocabulary_size,
lstm_num_hidden=256, lstm_num_lay... | MikeyQiu/UvADL | assignment_2/2_recurrentnns_gnns/code/release/Part 2/model.py | model.py | py | 4,277 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "torch.nn.Module",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "torch.nn.Embedding",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line... |
16071164704 | from rest_framework import serializers, status
from rest_framework.decorators import action
from rest_framework.request import Request
from rest_framework.response import Response
from rest_framework.viewsets import ModelViewSet
from common.api_helpers.exceptions import BadRequest
from common.insight_log import Entity... | grafana/oncall | engine/common/ordered_model/viewset.py | viewset.py | py | 2,024 | python | en | code | 3,019 | github-code | 71 | [
{
"api_name": "rest_framework.viewsets.ModelViewSet",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "rest_framework.request.Request",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "common.api_helpers.exceptions.BadRequest",
"line_number": 23,
"usage_... |
11475708769 | #!/usr/bin/env pythonw
"""myapp1.pyw: Create an instance of Ui_Form.
"""
# pylint: disable=no-name-in-module
import sys
from PyQt5.QtWidgets import (QApplication, QWidget)
# pyuic5.bat myform.ui > ui_myform.py
from ui_myform import Ui_Form
def main():
"""Main loop."""
app = QApplication(sys.argv)
window ... | showa-yojyo/notebook | doc/source/_sample/pyqt5/myapp1.pyw | myapp1.pyw | pyw | 458 | python | en | code | 18 | github-code | 71 | [
{
"api_name": "PyQt5.QtWidgets.QApplication",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "ui... |
31624583308 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
@Project :LeetCodePthonVersion
@File :82. 删除排序链表中的重复元素 II.py
@Author :HuntingGame
@Date :2022-10-20 8:42
C'est la vie!!! enjoy ur day :D
'''
from typing import Optional
# Definition for singly-linked list.
class ListNode:
def __init__(self, val=0, next=None):
... | enternityFan/LeetCodePythonVersion | 链表/82. 删除排序链表中的重复元素 II.py | 82. 删除排序链表中的重复元素 II.py | py | 1,548 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "typing.Optional",
"line_number": 19,
"usage_type": "name"
}
] |
33872974154 | from src.simulation.module_planner import PlannerModule
from src.simulation.environment import RearrangeTHOREnvironment
from typing import Any, Dict
import numpy as np
from sklearn.metrics.cluster import adjusted_rand_score, rand_score
def rand_metrics(assignments, gt_assignments):
gt_labels = []
for i, c in... | allenai/CSR | src/simulation/metrics.py | metrics.py | py | 6,890 | python | en | code | 57 | github-code | 70 | [
{
"api_name": "sklearn.metrics.cluster.rand_score",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.cluster.adjusted_rand_score",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "src.simulation.environment.RearrangeTHOREnvironment",
"line_nu... |
36381681524 | from random import randint, randrange
import pygame
import time
import timeit
BLACK = (0,0,0)
GREY = (127, 127, 127)
WHITE = (255, 255, 255)
RED = (255, 0, 0)
pygame.init()
display_width = 800
display_height = 600
game_display = pygame.display.set_mode((display_width, display_height))
clock = pygame.time.Clock()
... | RasmusSpangsberg/Minesweeper_bot | minesweeper_bot.py | minesweeper_bot.py | py | 12,479 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "pygame.init",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "pygame.time.C... |
9053110908 | ##
## Developed for the University of Nottingham G52GRP module
##
## Written by: Marcus Whybrow (mxw18u)
## Group: gp09-drm
##
from django.conf.urls.defaults import *
from django.conf import settings
from django.views.generic.simple import direct_to_template
from django.contrib import admin
admin.autodiscover()
ur... | marcuswhybrow/autolib | autolib/urls.py | urls.py | py | 1,250 | python | en | code | 2 | github-code | 71 | [
{
"api_name": "django.contrib.admin.autodiscover",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "django.views.generic.simple.direct_to_template",
"line_number": 22,
"usage_type": ... |
43329776857 | #TODO: TRY USING SINE WAVE AS CARRIER WAVE AND THEN IMAGE VALUES AS MODULATOR, SO DO FM SYNTHESIS
import cv2 as cv
import statistics
import wave
import struct
import math
import sys, getopt
from scipy.signal import savgol_filter
input_filename = None
output_filename = None
border_width = 10
border_color = 287
blur_si... | WheatleyTheCore/DataToSounds | imageToSound.py | imageToSound.py | py | 3,365 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "getopt.getopt",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "getopt.GetoptError",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"l... |
72977977190 | import aspose.words as aw
from tools import *
from bs4 import BeautifulSoup as bs
doc = aw.Document("qwe (1).docx")
doc.save("Output.md")
with open("Output.md", 'r', encoding='utf-8') as file1:
with HTMLRenderer() as renderer:
doc = Document(file1)
rendered = renderer.render(doc)
lst = par... | EugeneSvetov/API_MindMap | jjj.py | jjj.py | py | 457 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "aspose.words.Document",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "aspose.words",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 12,
"usage_type": "call"
}
] |
9751047371 | from __future__ import absolute_import, unicode_literals
import argparse
import os
import haas
from .loader import Loader
from .plugin_context import PluginContext
from .plugin_manager import PluginManager
from .result import ResultCollector
from .utils import configure_logging
def create_argument_parser():
"""... | scalative/haas | haas/haas_application.py | haas_application.py | py | 4,931 | python | en | code | 8 | github-code | 71 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "haas.__version__",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "argparse.Argu... |
17764791395 | import pymongo
from io import BytesIO
import pandas as pd
from minio import Minio
client = Minio('127.0.0.1:9000',
access_key='minioadmin',
secret_key='minioadmin',
secure=False)
clientMongo = pymongo.MongoClient("mongodb://localhost:27017")
db = clientMongo["dbBigDataku... | rifqiyus/Bigdata_Pert14 | data-mongo.py | data-mongo.py | py | 553 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "minio.Minio",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
... |
22489259987 | import torch
import torch.nn as nn
import torch.optim as optim
from torch.distributions import Normal
from filters.bayes_filter import Generator
DEVICE = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
class SimpleFilter(nn.Module):
def __init__(self, seq_length, x_dim, u_dim, z_dim, u_max, sys):
... | tessavdheiden/joint_model | filters/simple_filter.py | simple_filter.py | py | 7,449 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "torch.device",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Module",
... |
26031879714 | from mitreattack.stix20 import MitreAttackData
def main():
mitre_attack_data = MitreAttackData("enterprise-attack.json")
subtechniques = mitre_attack_data.get_subtechniques(remove_revoked_deprecated=True)
print(f"Retrieved {len(subtechniques)} ATT&CK sub-techniques.")
if __name__ == "__main__":
ma... | mitre-attack/mitreattack-python | examples/get_all_subtechniques.py | get_all_subtechniques.py | py | 325 | python | en | code | 293 | github-code | 71 | [
{
"api_name": "mitreattack.stix20.MitreAttackData",
"line_number": 5,
"usage_type": "call"
}
] |
25797712435 | import logging
from pandas_ta import rsi
from pandas_ta.momentum import cci
from .abc_strategy import ABCStrategy
from ..indicator.utils import TradeType
log = logging.getLogger(__name__)
class RSICCIStrategy(ABCStrategy):
strategy_name = "rsi cci"
def __init__(self, symbol: str, trade_short_order=True):
... | unclebean/konjac2 | konjac2/strategy/rsi_cci_strategy.py | rsi_cci_strategy.py | py | 2,899 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "abc_strategy.ABCStrategy",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "abc_strategy.ABCStrategy.__init__",
"line_number": 16,
"usage_type": "call"
},
{
"api_n... |
70442498471 | import sys
from PyQt5.QtWidgets import QApplication, QMessageBox, QMainWindow, QAction
class Ui_MainWindow(QMainWindow):
def __init__(self):
QMainWindow.__init__(self)
def setupUI(self):
self.setGeometry(500, 300, 700, 700)
self.setWindowTitle("window")
finish = QAction(... | cmlttnts/makara_gui | dene.py | dene.py | py | 1,059 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QMainWindow.__init__",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 9,
"usage_type": "name"
},
... |
2406037426 | """Computation of reductions on vectors."""
__copyright__ = "Copyright (C) 2009 Andreas Kloeckner"
__license__ = """
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, includin... | inducer/pycuda | pycuda/reduction.py | reduction.py | py | 15,323 | python | en | code | 1,650 | github-code | 71 | [
{
"api_name": "pycuda.compiler.SourceModule",
"line_number": 157,
"usage_type": "call"
},
{
"api_name": "pycuda.tools.get_arg_type",
"line_number": 207,
"usage_type": "call"
},
{
"api_name": "numpy.dtype",
"line_number": 227,
"usage_type": "call"
},
{
"api_name": ... |
33195535237 | from django.shortcuts import render,redirect
from django.contrib.auth.decorators import login_required
from carts.models import CartItem
from .forms import OrderForm
from .models import Order
from greatkart.settings import TAX_RATE
import datetime
# Create your views here.
@login_required(login_url='login')
def pa... | rezadsa/GreatKart | orders/views.py | views.py | py | 3,105 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "carts.models.CartItem.objects.filter",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "carts.models.CartItem.objects",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "carts.models.CartItem",
"line_number": 18,
"usage_type": "name"
... |
8695523638 | import os
import numpy as np
from scipy.interpolate import splprep, splev
from pathlib import Path
import matplotlib.pyplot as plt
from matplotlib.pyplot import cm
import matplotlib.patches as mpatches
from DarkNews import const
from DarkNews import plot_tools as pt
from ToyAnalysis import analysis
from ToyAnalysis ... | mhostert/DarkNews-generator | examples/ToyAnalysis/plot_tools.py | plot_tools.py | py | 28,097 | python | en | code | 8 | github-code | 70 | [
{
"api_name": "ToyAnalysis.toy_logger.info",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "ToyAnalysis.toy_logger",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.pa... |
73425270311 | import sys
from migen import *
from litex_boards.platforms import xilinx_kc705
from litex.build.generic_platform import *
from litex.build.xilinx import VivadoProgrammer
from litex.soc.cores.clock import *
from litex.soc.integration.soc_core import *
from litex.soc.integration.builder import *
from liteeth.phy imp... | enjoy-digital/usb3_pipe | kc705.py | kc705.py | py | 7,459 | python | en | code | 167 | github-code | 71 | [
{
"api_name": "liteeth.phy.LiteEthPHY",
"line_number": 88,
"usage_type": "call"
},
{
"api_name": "usb3_pipe.K7USB3SerDes",
"line_number": 95,
"usage_type": "call"
},
{
"api_name": "usb3_pipe.USB3PIPE",
"line_number": 106,
"usage_type": "call"
},
{
"api_name": "usb... |
7133381653 | from dataPipelines.gc_scrapy.gc_scrapy.GCSpider import GCSpider
from dataPipelines.gc_scrapy.gc_scrapy.items import DocItem
import json
import re
bill_version_re = re.compile(r'\((.*)\)')
class LegislationSpider(GCSpider):
name = "legislation_pubs"
cac_login_required = False
start_urls = [
"htt... | cox-j/gamechanger | deploy/build/gamechanger-crawlers/dataPipelines/gc_scrapy/gc_scrapy/spiders/legislation_spider.py | legislation_spider.py | py | 6,416 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "re.compile",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "dataPipelines.gc_scrapy.gc_scrapy.GCSpider.GCSpider",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "json.loads",
"line_number": 39,
"usage_type": "call"
},
{
"api_name... |
29943650872 | # -*- coding: utf-8 -*-
import os
import sys
import pprint
from PyQt5.QtWidgets import QApplication, QMainWindow, QHBoxLayout, QTableWidgetItem, QPushButton, QMessageBox,QShortcut
from PyQt5 import QtCore, QtGui, QtWidgets
from GuiLib.TreeTab.treeTab import TreeTab
from core.menusys.menuSys import MenuSys
from core.i... | LX-sys/LookM | core/mainui.py | mainui.py | py | 20,948 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "os.getcwd",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_numbe... |
22382060731 | # Richard Algra | exam-exercise | 'Degiro notifier'
"""
This script repeatedly checks if there are any trigger-points in the data from 'DN_database.csv',
If specific conditions are met, this script will use a Telegram bot to notify the user.
"""
# Resources
import telebot
import config # settings and personal data.
im... | Aethryste/Degiro_notifier | telegram_bot.py | telegram_bot.py | py | 6,294 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "telebot.TeleBot",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "config.API_KEY",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "schedule.every",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "schedule.every",
... |
2507302480 | from factory import db
class StockLocations(db.Model):
location_id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(100), nullable=False, unique=True) # Unique location name
is_flexible = db.Column(db.Boolean, default=True) # By default, it's flexible
is_occupied = db.Column(db.Bo... | RamiSillanpaa/Inventory_Manager | models/locations.py | locations.py | py | 544 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "factory.db.Model",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "factory.db",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "factory.db.Column",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "factory.db",
"lin... |
29065352463 | import argparse
import os
def parse_args():
parser = argparse.ArgumentParser(description="Runs a task processing task")
parser.add_argument(
"-m",
"--master",
dest="master",
default=os.environ.get("MESOS", "127.0.0.1:5050"),
help="mesos master address",
)
pars... | Yelp/task_processing | examples/common.py | common.py | py | 856 | python | en | code | 23 | github-code | 71 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 12,
"usage_type": "attribute"
}
] |
7803487459 | #first_sanic
from sanic import Sanic
from sanic.response import json
app = Sanic(name = "first_api")
@app.route("/")
async def test(request):
return json({"hello" : "Sir"})
if __name__ == "__main__":
app.run(host="127.0.0.1", port=8000) | WebTech987/Sanic_learning | file0.py | file0.py | py | 247 | python | en | code | 2 | github-code | 71 | [
{
"api_name": "sanic.Sanic",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sanic.response.json",
"line_number": 9,
"usage_type": "call"
}
] |
70355731751 | from gcsl.algo import buffer, networks
from gcsl.envs.env_utils import DiscretizedActionEnv
from gym.spaces import Box, Discrete
import numpy as np
"""
Main function defined up top. Helpers below.
"""
def get_params(env, env_params):
env = discretize_environment(env, env_params)
policy = default_markov_policy... | dibyaghosh/gcsl | gcsl/algo/variants.py | variants.py | py | 2,477 | python | en | code | 72 | github-code | 71 | [
{
"api_name": "gcsl.algo.buffer.ReplayBuffer",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "gcsl.algo.buffer",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "gcsl.algo.buffer.ReplayBuffer",
"line_number": 20,
"usage_type": "call"
},
{
"api_... |
27381971801 | import os
import random
import shutil
from tqdm import tqdm
import cv2
random.seed(359244)
DIM = 700
SRC = os.path.join('/home','jupyter','shiptype')
modes = ['train','valid','test']
n = 850
n_modes = [550, 150, 150]
mode_paths = []
for m in modes:
mode_path = os.path.join(SRC, m)
mode_paths.append(mod... | CapAI/misc | tmp/merging/cla_shiptype_datasplit.py | cla_shiptype_datasplit.py | py | 1,479 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "random.seed",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number"... |
5635659405 | from pyspark.sql import SparkSession
import pyspark.sql.functions as F
spark = (SparkSession
.builder
.appName("Analyzing the vocabulary of Pride and Prejudice.")
.getOrCreate())
sc = spark.sparkContext
sc.setLogLevel("ERROR")
# Ex. 3.3
count = (
spark.read.text("data/gutenberg_books/... | Homeomorphistic/spark-basics | ex_3.py | ex_3.py | py | 1,649 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "pyspark.sql.SparkSession.builder.appName",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "pyspark.sql.SparkSession",
"line_number": 4,
"usage_type": "... |
35896521194 | import tensorflow
import os
import sys
import random
import math
import numpy as np
import imgaug
import argparse
import skimage.io
import matplotlib
import matplotlib.pyplot as plt
from datetime import datetime
import pickle
from types import MethodType
from PIL import Image
# Submodule Libraries
CITI_ROOT = os.path.... | Jeff-AB/Instance-Segmentation-Project | experiment.py | experiment.py | py | 13,191 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "os.path.abspath",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numb... |
71684511589 | import logging
import mlflow
import pandas as pd
from components.component_train_model import ModelTraining
from sklearn.base import ClassifierMixin
from zenml.client import Client
from zenml import step
from .config import ModelNameConfig
from zenml.integrations.mlflow.steps.mlflow_registry import mlflow_register_mod... | TPQuentin/MLOps_Health_Insurance | steps/step_train_model.py | step_train_model.py | py | 1,888 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "zenml.client.Client",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "pandas.Series",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "config.M... |
25034914701 | import sys
import psycopg2
import psycopg2.pool
import yaml
import argparse
import yaml.scanner
from threading import Thread
from betmaster.redis import RedisQueue
from betmaster.utils import check_positive, check_conf, get_configuration
NAMESPACE = 'betmaster'
DSN = 'dbname={database} user={user} password={password} ... | mainden7/betmaster | src/betmaster/worker.py | worker.py | py | 4,076 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "betmaster.utils.check_positive",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "betmaster.utils.check_conf",
"line_number": 23,
"usage_type": "name"
},
{
... |
9669804169 | import setuptools
with open("README.md", "r") as file:
long_description = file.read()
setuptools.setup(
name="mkignore",
version="0.1.5",
author="Emanuel Claesson",
author_email="emanuel.claesson@gmail.com",
description="Generate .gitignore files from templates",
long_description=long_de... | EClaesson/mkignore | setup.py | setup.py | py | 804 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "setuptools.setup",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 17,
"usage_type": "call"
}
] |
72413239590 | import copy
import numpy as np
import torch
from Sever.utils.sever_methods import SeverMethod
from utils.utils import row_into_parameters
class qffeAVGSever(SeverMethod):
NAME = 'qffeAVGSever'
def __init__(self, args, cfg):
super(qffeAVGSever, self).__init__(args, cfg)
def sever_update(self, **k... | WenkeHuang/MarsFL | Sever/qffeAVGSever.py | qffeAVGSever.py | py | 1,524 | python | en | code | 17 | github-code | 71 | [
{
"api_name": "Sever.utils.sever_methods.SeverMethod",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "copy.deepcopy",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "torch.... |
29996345226 | import os
import json
import pickle
from datetime import datetime
from IPython.display import display, HTML
import numpy as np
import pandas as pd
def copy_directory(src, dest):
"""
Copy files or directorys from source to destination
src (str) : path to files or directorys that will be copied
dest (... | Computational-Finance-Laboratory/An-Adaptive-Order-Execution-for-VWAP-tracking | Backend/utils/Utils.py | Utils.py | py | 2,810 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "os.path.basename",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
11155789757 | import os
import xml.etree.ElementTree as ET
import requests
# Define a list to store the URLs
url_list = []
# Get the path to the directory of the script
script_dir = os.path.dirname(os.path.abspath(__file__))
# Specify the file path where you want to save and check the URLs
output_file_path = os.path.join(script_d... | mehmetba/investment-arbitration-research | jsmndi_sitemap.py | jsmndi_sitemap.py | py | 2,045 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "os.path.dirname",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_nu... |
8085525983 | # https://leetcode.com/problems/group-anagrams/
from typing import List
from collections import defaultdict
class Solution:
def groupAnagrams(self, strs: List[str]) -> List[List[str]]:
d = defaultdict(lambda: [])
for i in strs:
d[''.join(sorted(i))].append(i)
result = []
... | lilaboc/leetcode | 49.py | 49.py | py | 481 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "typing.List",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "collections.defaultdict",
"line_number": 8,
"usage_type": "call"
}
] |
5153565771 | #!/usr/bin/python env
# -*- coding: utf-8 -*-
import sys,os,re
from fabric.connection import Connection
import patchwork.transfers
import patchwork.info
from fabric.transfer import *
import time,yaml,invoke,pysnooper
import xml.etree.cElementTree as ET
from patchwork.files import exists
# from fabric.decorato... | johnny369369/deploy_tomcat | commit_svn_code/deployment.py | deployment.py | py | 21,123 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "sys.exit",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "pysnooper.snoop",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "yaml.load",
"line_number": 67,
... |
30748224435 | from __future__ import print_function
from app import app
from flask import render_template, jsonify, request
import datetime
import pickle
import os.path
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
from typing imp... | KushaalManchella/team_23_server | app/routes.py | routes.py | py | 5,671 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "os.path.path.exists",
"line_number": 140,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 140,
"usage_type": "attribute"
},
{
"api_name": "os.path",
"line_number": 140,
"usage_type": "name"
},
{
"api_name": "pickle.load",
"l... |
26250638682 | if __name__ == "__main__" and __package__ is None:
from sys import path
from os.path import dirname as dir
path.append(dir(path[0]))
import asyncio
import kasaplugs
import goveesensors
import logging
log = logging.getLogger(__name__)
async def discover_all(plugsvc=None):
plugs = await kasaplugs.disco... | kylehodgson/thermo | plugins/discover.py | discover.py | py | 598 | python | en | code | 2 | github-code | 71 | [
{
"api_name": "sys.path.append",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_n... |
34755536268 | #!/usr/bin/env python
# encoding: utf-8
from collections import deque
class Node:
def __init__(self, value=None):
self.ch = value
self.transitions = []
self.fail = None
self.output = []
class Ac_automaton:
def __init__(self, dictionary):
self.root = self.buildAc(dicti... | jssuoyii/ac_automaton | ac_automaton.py | ac_automaton.py | py | 2,375 | python | en | code | 2 | github-code | 71 | [
{
"api_name": "collections.deque",
"line_number": 36,
"usage_type": "call"
}
] |
34614311362 | import redis
import gevent
import subprocess
#
# Redis Sentinel Client
#
class RedisSentinelClient(object):
def __init__(self, sentinel_info, services, master_change_event_handler,
logger):
self._sentinel_info = sentinel_info
self._services = services
self._master_change_... | vdatla/contrail-controller | src/opserver/redis_sentinel_client.py | redis_sentinel_client.py | py | 8,410 | python | en | code | null | github-code | 71 | [
{
"api_name": "gevent.spawn",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "redis.StrictRedis",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "redis.exceptions",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "redis.exceptions... |
6325617508 | import pyrebase
config = {
"apiKey": "AIzaSyDJQ46f0iVp_ldrx5Y_AgZ5HWtyI9dfYd8",
"authDomain": "lbswater.firebaseapp.com",
"databaseURL": "https://lbswater.firebaseio.com",
"projectId": "lbswater",
"storageBucket": "lbswater.appspot.com",
"messagingSenderId": "1065042380223"
};
"""
{
/* Visi... | juyee1698/watergovernance | water/pyrebase_settings.py | pyrebase_settings.py | py | 892 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "pyrebase.initialize_app",
"line_number": 20,
"usage_type": "call"
}
] |
73113773348 | from collections import Counter
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
c = Counter(A)
c4 = [k for k in c if c[k] >= 4]
c2 = [k for k in c if c[k] >= 2]
ans = 0
if len(c4) > 0:
ans = max(ans, c4[0] ** 2)
if len(c2) > 1:
ans = max(ans, c2[0] * c2[1])
print(ans)
| yb173/atcoder-playground | abc/abc071/c/abc071_c.py | abc071_c.py | py | 310 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "collections.Counter",
"line_number": 7,
"usage_type": "call"
}
] |
32150005052 | '''
phone = input("Phone: ")
output = ""
digits_mapping = {
"1": "One",
"2": "Two",
"3": "Three",
"4": "Four"
}
for ch in phone:
output += digits_mapping.get(ch,"!") + " "
print(output)
'''
'''
def greet_user(name):
print(f"Hi {name}!")
print("Welcome aboard")
print("Start")
greet_user(inp... | daniloiiveroy/MyPythonTraining | 99-PythonExercises/app.py | app.py | py | 937 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "pathlib.Path",
"line_number": 56,
"usage_type": "call"
}
] |
26123312730 | '''
메뉴 리뉴얼
https://programmers.co.kr/learn/courses/30/lessons/72411
'''
from itertools import combinations
from collections import Counter
def solution(orders, course):
answer = []
for n in course:
temp_list = []
for order in orders:
temp_order = list(combinations(sorted(order... | CodeNinja1126/practiceCode | codingTesting/KaKao_blind_test/2021/메뉴 리뉴얼.py | 메뉴 리뉴얼.py | py | 922 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "itertools.combinations",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 20,
"usage_type": "call"
}
] |
38298559390 | import pygame
from pygame.sprite import Sprite
from random import randint
class Alien(Sprite):
"""A class to represent a single alien in the fleet"""
def __init__(self, game_settings, game_surfaces, screen):
"""Initialize the alien and its starting position."""
super(Alien, self).__init__()
... | PimMiii/Kingdom_Invaders | alien.py | alien.py | py | 1,821 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "pygame.sprite.Sprite",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "random.randint",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 34,
"usage_type": "call"
}
] |
33681117988 | import sys
from functools import lru_cache
verbose = False
def printv(*args, **kwargs):
if verbose:
print(*args, **kwargs)
def load_input(f):
with open(f, 'r') as fd:
return sorted([int(x) for x in fd.read().strip().split('\n')])
def part1(l):
diffcounts = [0]*5
for ii in range(len(l)... | ryanneph/Advent-of-Code | 2020/10/main.py | main.py | py | 1,415 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "functools.lru_cache",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 43,
"usage_type": "attribute"
}
] |
3428517098 | from flask import Flask, jsonify
from flask_restful import Api
from flask_swagger import swagger
from flask_swagger_ui import get_swaggerui_blueprint
from app.db import initialize_db
from flask_cors import CORS
# Declare the flask app and wrap it in Api
app = Flask(__name__)
CORS(app)
api = Api(app)
from app import ... | RisKiki/todo-api | app/__init__.py | __init__.py | py | 1,525 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "app.db",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "app.db",
"line_number": 10,
... |
377390071 | from pyrosetta import *
init()
from pyrosetta.rosetta.protocols.simple_moves import *
from pyrosetta.rosetta.protocols.moves import *
from pyrosetta.rosetta.protocols.minimization_packing import *
import argparse
parser = argparse.ArgumentParser(description='Program')
parser.add_argument('-in', '--Input_FASTA_File',... | jferrie3/AbInitioVO-and-FastFloppyTail | Analysis_Scripts/IDR_Grafting.py | IDR_Grafting.py | py | 4,781 | python | en | code | 4 | github-code | 71 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pyrosetta.rosetta.utility.vector1_unsigned_long",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "pyrosetta.rosetta",
"line_number": 57,
"usage_type": "attribute"
... |
70576795749 | import requests
from collections import defaultdict
from client_constants import REQUEST_HEADERS, SUCCESS, RESPONSE_KEYS
# solos k/d in data['stats'][season]['kd']['valueDec']
# solos matches in data['stats'][season]['matches']['valueInt']
# duos k/d in data['stats'][][season]['valueDec']
# duos matches in data['stats... | Derling/Fortnite-Tracker-Bot | fort_client.py | fort_client.py | py | 1,276 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "requests.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "client_constants.REQUEST_HEADERS",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "client_constants.SUCCESS",
"line_number": 19,
"usage_type": "name"
},
{
"api_name":... |
31391965649 | # Import python packages
from tqdm import tqdm
import numpy as onp
import jax.numpy as np
from jax import jacfwd
from matplotlib import cm
# Import TFC classes
from tfc import mtfc
from tfc.utils import egrad
from tfc.utils.Latex import table
# Constants and switches:
nVec = [5,10,15,20,25,30]
mVec = [5,10,15,20,25]
... | leakec/tfc | examples/Carl_Leake_Dissertation/Chapter_3/Example_3_2_spectral_method.py | Example_3_2_spectral_method.py | py | 2,449 | python | en | code | 26 | github-code | 71 | [
{
"api_name": "jax.numpy.array",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "jax.numpy",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "jax.numpy.array",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "jax.numpy",
"line_numbe... |
28098267683 | """This module contains a number of functions for processing Yelp reviews and engineering features from them:
nlp_preprocess_review, create_nlp_features, get_pos, get_pos_dist, get_local_sentiment, service_complaint"""
import numpy as np
from collections import Counter
from sklearn.feature_extraction.text import Tfidf... | Marchette/YelpHelp | yelphelp/nlp_tools.py | nlp_tools.py | py | 5,497 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "nltk.tokenize.RegexpTokenizer",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "nltk.stem.wordnet.WordNetLemmatizer",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 25,
"usage_type": "call"
... |
33534569386 | import pygame
import constants
def handle_bullets(yellow_bullets, red_bullets, yellow, red, YELLOW_HIT, RED_HIT):
for bullet in yellow_bullets:
bullet.x += constants.BULLET_VEL
if red.colliderect(bullet):
pygame.event.post(pygame.event.Event(RED_HIT))
yellow_bullets.remove(... | henriquejaques/space_invaders | projectiles.py | projectiles.py | py | 689 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "constants.BULLET_VEL",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pygame.event.post",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pygame.event",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pygame.eve... |
72329269030 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri May 27 16:07:02 2022
@author: jimmyfitpatrick
general simulation encomapssing
-asymmetric + symmetric scattering
-uniform non-instantaneous injection
-arbitrary form of diffusion coefficient
-focused transport (if requested)
"""
import numpy as np
im... | jcfitzpatrick12/transport_model | util/main_simulation.py | main_simulation.py | py | 26,679 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "numpy.abs",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "numpy.power",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "numpy.abs",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "numpy.power",
"line_number": 77,
... |
11488566973 |
import torch
from time import strftime
import os, sys, time
from argparse import ArgumentParser
import flask
from flask import send_file
from src.utils.preprocess import CropAndExtract
from src.test_audio2coeff import Audio2Coeff
from src.facerender.animate import AnimateFromCoeff
from src.generate_batch import get_... | deybvagm/SadTalkerChallenge | api.py | api.py | py | 8,948 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 60,
"usage_type": "attribute"
},
{
"api_name": "time.strftime",
... |
33991062384 | from app import app, db
from flask import render_template, request,flash, session
from .models import User, Tweets
from .utils import ip_logging
import datetime
@app.route('/')
def index():
x_real_ip = request.environ.get('HTTP_X_Real_IP')
remote_ip = x_real_ip or request.remote_addr
timestamp = '{:%Y-%m-... | Pektech/twit_test | app/routes.py | routes.py | py | 1,267 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "flask.request.environ.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.request.environ",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "fl... |
14838676735 | from django.shortcuts import render
from django.http import JsonResponse, HttpResponseRedirect
from django.core.paginator import Paginator
from django.views.decorators.csrf import csrf_exempt
from .models import Product, ProductVariation
from datetime import datetime, timedelta
import pandas as pd
import random
from op... | sidsrivastavasks/Excel-Parser-Django | assignment-src/excelparser/views.py | views.py | py | 4,664 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "django.http.HttpResponseRedirect",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "models.Product.objects.all",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "models.Product.objects",
"line_number": 20,
"usage_type": "attribute"
},
... |
7673942532 | import sys, os
from PyQt5 import QtWidgets, uic
from PyQt5.QtWidgets import *
from PyQt5 import QtGui
from PyQt5.QtGui import QPixmap #for images
from PyQt5.QtGui import QFont #for font size
## back-end code ##########################################
import datetime
from forex_python.converter import Currenc... | CIDcoding/Currency-Calculator | CurrencyCalculator - v1.4.py | CurrencyCalculator - v1.4.py | py | 12,722 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "PyQt5.uic.loadUi",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "PyQ... |
32290127149 | from wsgiref.simple_server import make_server
from pyramid.config import Configurator
from pyramid.response import Response
from pyramid.renderers import JSONP
import olap.rest.pyramid as orest
import olap.interfaces as oi
import olap.xmla.xmla as xmla
import cornice
@orest.restify()
class ExposeAll(orest.OLAPREST):
... | may-day/olap | rest/example/mini.py | mini.py | py | 1,923 | python | en | code | 60 | github-code | 71 | [
{
"api_name": "olap.rest.pyramid.OLAPREST",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "olap.rest.pyramid",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "olap.rest.pyramid.restify",
"line_number": 10,
"usage_type": "call"
},
{
"api_n... |
86284803864 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from astropy import units
from astropy.io import fits
import numpy as np
import pytest
from sofia_redux.scan.configuration.configuration import Configuration
from sofia_redux.scan.custom.hawc_plus.info.detector_array import \
HawcPlusDetectorArrayInf... | SOFIA-USRA/sofia_redux | sofia_redux/scan/custom/hawc_plus/info/tests/test_detector_array.py | test_detector_array.py | py | 8,990 | python | en | code | 9 | github-code | 71 | [
{
"api_name": "astropy.units.Unit",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "astropy.units",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "astropy.units.Unit",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "astropy.units",
... |
28451149960 | from collections import defaultdict
from flask_wtf import FlaskForm
from meetthings.util import get_validators
from wtforms import (
StringField,
BooleanField,
IntegerField,
DateTimeField,
FormField,
)
FIELD_MAPPING = {
'string': StringField,
'boolean': BooleanField,
'integer': IntegerF... | noisebridge/meetthings | meetthings/form_factory.py | form_factory.py | py | 3,063 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "wtforms.StringField",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "wtforms.BooleanField",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "wtforms.IntegerField",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "wtforms... |
37882795857 | import matplotlib.pyplot as plt
def nboxplot(df, cols, title):
"""
Boxplot of features.
Parameters:
df: Dataframe.
cols: Columns within dataframe containing data to be plotted.
Returns:
Boxplot figure.
"""
plt.figure(figsize=(15, 3))
boxplot = plt.boxplot... | tadelloro/Hard_Drive_Failure_Prediction | funcs_hrddrv.py | funcs_hrddrv.py | py | 2,233 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.boxplot",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "... |
11114070458 | from django.shortcuts import render
from api import models
from publicFunc import Response
from publicFunc import account
from django.http import JsonResponse
from django.views.decorators.csrf import csrf_exempt, csrf_protect
import time
import datetime
from publicFunc.condition_com import conditionCom
from api.forms.a... | itcastpeng/ProjectManagerment- | api/views_dir/action.py | action.py | py | 6,939 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "publicFunc.Response.ResponseObj",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "publicFunc.Response",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "api.forms.action.SelectForm",
"line_number": 21,
"usage_type": "call"
},
{
"a... |
38902373107 | import scipy
import numpy as np
from sklearn.cluster import KMeans
from scipy.sparse import csr_matrix, coo_matrix, spdiags, issparse
EPS = np.finfo(np.float32).eps
def check_symmetric(m, tol=1e-8):
if issparse(m):
if m.shape[0] != m.shape[1]:
raise ValueError('m must be a square matrix')
if not is... | microsoft/graph-partition-neural-network-samples | gpnn/utils/spectral_graph_partition.py | spectral_graph_partition.py | py | 4,112 | python | en | code | 92 | github-code | 71 | [
{
"api_name": "numpy.finfo",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "scipy.sparse.issparse",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "scipy.sparse.coo_m... |
20117457509 | import socket
import random
from Crypto import Random
from Crypto.Cipher import AES
sock = socket.socket()
sock.bind(('', 9090))
sock.listen(1)
conn, addr = sock.accept()
p = random.getrandbits(256)
g = random.getrandbits(256)
sessionkey = Random.new().read(32) # 256 bit
conn.send(str(p).encode())
conn.send(str(g).... | SergeyZinkovich/diffie-hellman | server.py | server.py | py | 688 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "socket.socket",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "random.getrandbits",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "random.getrandbits",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "Crypto.Random.new"... |
3042133657 | import datetime as dt
import discord
from discord.ext import commands
picture = "https://cdn.discordapp.com/attachments/751919923260817502/858958993102733312/agarz.webp"
class Info(commands.Cog):
def __init__(self, client):
self.client = client
@commands.command(name='Info', help='Display info on a... | pharmacies/DiscordInfoCommand | cogs/info.py | info.py | py | 2,927 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "discord.Member",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "... |
36393724843 | from django import froms
from django.forms import widgets
from .models import Site
class SiteFrom(forms.ModelForm):
class Meta:
model = Site
exclude = ('created_at',)
widgets = {
'url': forms.URLInput(attrs={'class': 'form-control', 'placeholder': 'Enter the website url'}),
... | FHSAF/hh-repository | wppApp/forms.py | forms.py | py | 439 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "models.Site",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.forms.widgets",
"line_number": 10,
"usage_type": "name"
}
] |
71137934950 | from rest_framework.test import APIClient, APITestCase
from rest_framework import status
from django.contrib.auth import get_user_model
from django.urls import reverse
from decimal import Decimal
from core.models import Recipe, Tag, Ingredient
from recipe_app.serializers import RecipeSerializer, RecipeDetailSerializer... | josevictorp81/recipeapi | recipe_app/tests/test_recipe_api.py | test_recipe_api.py | py | 14,143 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "django.urls.reverse",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "decimal.Decimal",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "core.models.Recipe.objects.create",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": ... |
42811731282 | """Simulate pseudo HDL written in Python."""
from collections import namedtuple
from inspect import currentframe
from .vcd_info import _VcdInfo
class Signal:
def __init__(self, value, n=1):
"""
Create a signal object and set the initial value.
To dump a multi-bit signal, specify the number... | nanamake/pseudo_hdl | pseudo_hdl/simulator.py | simulator.py | py | 9,257 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "inspect.currentframe",
"line_number": 172,
"usage_type": "call"
},
{
"api_name": "vcd_info._VcdInfo",
"line_number": 180,
"usage_type": "argument"
},
{
"api_name": "vcd_info.filename",
"line_number": 218,
"usage_type": "attribute"
},
{
"api_name": "... |
25486684060 | from . import Base, engine
from typing import List
from typing import Optional
from datetime import datetime, date
from sqlalchemy import Integer, String, ForeignKey, Uuid, Date, DateTime
from sqlalchemy.orm import DeclarativeBase
from sqlalchemy.orm import Mapped
from sqlalchemy.orm import mapped_column
from sqlalch... | alphatw221/carlet_scraper | db/tire_rack/car.py | car.py | py | 2,351 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "sqlalchemy.orm.Mapped",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.orm.mapped_column",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.Mapped",
"line_number": 25,
"usage_type": "name"
},
{
"api_name... |
35666550590 | from flask import (Blueprint, abort, flash, jsonify, redirect, render_template,
request, url_for)
from sqlalchemy.orm.exc import NoResultFound
from . import db
from .models import Daily, Event, Home
try:
import RPi.GPIO as GPIO
except Exception as e:
print(f"\n[ERROR] {e}\n")
pass
impo... | npolgado/Home-Automation | raspi/website/views.py | views.py | py | 15,381 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "openai.api_key",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "os.getenv",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "flask.Blueprint",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "time.monotonic",
"l... |
30481292959 | import falcon
import logging
import sys
import os
sys.path.append('pyconfhoard')
sys.path.append('pyconfhoard/rest')
import datastore
import discover
api = application = falcon.API()
datastore_file_path = 'datastore'
if 'DATASTORE:' in sys.argv[-1]:
datastore_file_path = sys.argv[-1].split(':')[1]
if 'PYCONF_DAT... | allena29/brewerslabng | brewerslabng-pyconfhoard/rest/server.py | server.py | py | 894 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "sys.path.append",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_numbe... |
2647155673 | from swagger_server.controllers import staticglobaldb
from swagger_server.services.finance import finance_data
import pandas_market_calendars as mcal
import pandas as pd
import datetime
"""
desc: Handles the periodic insert of Stock values into the database
author: Daniel Ebert
date: 2020-11-09
"""
... | LucaMueller1/PyStockMarketGame | BackEnd/swagger_server/services/schedule_service.py | schedule_service.py | py | 2,185 | python | en | code | 7 | github-code | 71 | [
{
"api_name": "datetime.datetime.now",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "swagger_server.controllers.staticglobaldb.dbconn.get_all_stocks_distinct_in_transactions",
"line... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.