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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
13857053749 | from operator import truediv
import tensorflow as tf
from tensorflow.keras import backend as K
from tensorflow.keras.utils import get_custom_objects
from tensorflow.keras.layers import Conv1D,Conv2D, Conv3D, Flatten, Dense, Reshape, Lambda
from tensorflow.keras.layers import Dropout, Input,dot,Activation,MaxPool1D... | henulx/HDECGCN-Framework | HRACPCNN.py | HRACPCNN.py | py | 20,118 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "tensorflow.compat.v1.disable_eager_execution",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "tensorflow.compat",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.compat.v1.ConfigProto",
"line_number": 19,
"usage_type": "... |
27940252845 | import random
from kfp import components, dsl
from kfp.components import InputPath, OutputPath
from kfp.components import func_to_container_op
from typing import NamedTuple
def train_data_load(
output_dataset_train_data: OutputPath('Dataset')
):
import tensorflow as tf
import pandas as pd
import ... | matildalab-private/kfp_example | fashion_mnist/train_prediction.py | train_prediction.py | py | 6,745 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "kfp.components.OutputPath",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "pandas.DataFrame",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pick... |
30715904956 | import traceback
from http import HTTPStatus
from flask import request, abort, jsonify
from .constants import REQ_ARG_PAGE, REQ_ARG_PER_PAGE, REQ_ARG_PAGINATION, REQ_ARG_TYPE, ENTITY_TYPE
from .app_cfg import max_items_per_page
def get_request_arg(arg: str, default: int) -> int:
"""
Get a positive integer a... | ibuttimer/full-stack-trivia | backend/flaskr/util/misc.py | misc.py | py | 5,259 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.request.args.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "flask.request.args",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "flask.ab... |
34728957249 | from django.shortcuts import render, redirect
from .models import Device, VirtualDevice, Permissions, TrafficData, Device
from django.contrib.auth.decorators import login_required
from django.contrib.auth import authenticate, login
from django.contrib.auth.forms import UserCreationForm
from .forms import DeviceFor... | Lema25/SmartTraffic_Control | smarttraffic/traffic/views.py | views.py | py | 5,227 | python | es | code | 0 | github-code | 1 | [
{
"api_name": "models.Device.objects.all",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "models.Device.objects",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "models.Device",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "mo... |
10425974706 | import logging
import math
import os
import pickle
import random
import signal
import sys
import uuid
from time import sleep
from threading import Thread
import rpyc
from rpyc.utils.server import ThreadedServer
from utils import LOG_DIR
from conf import block_size, replication_factor, minions_conf
MASTER_PORT = 213... | lyu-xg/PyDFS | pydfs/master.py | master.py | py | 7,721 | python | en | code | null | github-code | 1 | [
{
"api_name": "pickle.dump",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "conf.block_size",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "conf.replication_factor",
"l... |
18481392221 | """
Define helpful logging functions.
"""
# STD
from collections import defaultdict
from functools import wraps
from genericpath import isfile
from os import listdir
from os.path import join
from typing import Optional, List, Callable
import os
# EXT
import numpy as np
import torch
# PROJECT
from src.utils.types imp... | Kaleidophon/tenacious-toucan | src/utils/log.py | log.py | py | 8,806 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.Callable",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "torch.Tensor",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "functools.wraps",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "typing.Callable",
... |
4020893724 | from Modulos.Modulo_System import(
Command_Run
)
#from Modulos.Modulo_Text import(
# Text_Read
#)
from Modulos.Modulo_Files import(
Files_List
)
from Modulos import Modulo_Util_Debian as Util_Debian
from Modulos.Modulo_Language import get_text as Lang
from Interface import Modulo_Util_Qt as Util_Qt
from pa... | CocoMarck/Linux_PrepararSistema | Script_Preparar-OS_Qt.py | Script_Preparar-OS_Qt.py | py | 21,971 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "Interface.Modulo_Util_Qt.Dialog_Command_Run",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "Interface.Modulo_Util_Qt",
"line_number": 45,
"usage_type": "name"
},
{
"api_name": "PyQt6.QtWidgets.QWidget",
"line_number": 52,
"usage_type": "name"
... |
32179622727 | import datetime
from shifts import models
def prepare_prune_worker_shift(before):
d = (datetime.date.today() - before).days
assert d >= 7
beforeisoyear, beforeisoweek, beforeweekday = before.isocalendar()
assert beforeweekday == 0
beforeisoyearweek = 100 * beforeisoyear + beforeisoweek
(
... | Mortal/shiftplanner | shifts/prune.py | prune.py | py | 829 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "datetime.date.today",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "shifts.models.prepare_update_worker_shift_aggregate_count",
"line_number": 17,
"usage_type": "call"
... |
29608590768 | import json
def parse(path):
with open(path, 'r') as f:
lines = f.readlines()
lines = [line.strip().split(' ') for line in lines]
frame = []
S_index = []
for line_index, line in enumerate(lines):
line_array = []
for i in range(0, len(line), 2):
k, v = line[i].s... | rsmit3/hackaton-team-5 | parse_txt.py | parse_txt.py | py | 832 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "json.dumps",
"line_number": 36,
"usage_type": "call"
}
] |
34145590490 | # Run this script as `root user`. This is the only script that should ever be run as root user.
# Creats the first IAM admin that can add additional IAM users/roles/groups/etc..
try:
import boto3
except ImportError:
print(f'Error: boto3 is required. Please install.')
print(f'Try: pip install boto3')
def crea... | jim-hill-r/gmby6 | core/infra/provision/start.py | start.py | py | 1,020 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "boto3.client",
"line_number": 17,
"usage_type": "call"
}
] |
19031139452 | from abc import ABC
import numpy as np
from sklearn.model_selection import TimeSeriesSplit
from sklearn.utils import indexable
from sklearn.utils.validation import _num_samples
class SlidingTimeSeriesSplit(TimeSeriesSplit, ABC):
def __init__(self, n_splits: int, gap: int = 0):
super().__init__(n_splits... | vcerqueira/blog | src/cv_extensions/sliding_tss.py | sliding_tss.py | py | 1,953 | python | en | code | 15 | github-code | 1 | [
{
"api_name": "sklearn.model_selection.TimeSeriesSplit",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "abc.ABC",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "sklearn.utils.indexable",
"line_number": 22,
"usage_type": "call"
},
{
"api_name"... |
15938992699 | #! venv/bin/python3
# -*- coding: UTF-8 -*-
import queue
from multiprocessing.managers import BaseManager
class QueueServer:
def __init__(self, ip='0.0.0.0', port=3000, authkey='lzw520'):
self._queue = queue.Queue()
self._ip = ip
self._port = port
self._authkey = authkey
... | dz85/DXDSTest | producer_consumer/queue_server.py | queue_server.py | py | 1,071 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "queue.Queue",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "multiprocessing.managers.BaseManager.register",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "multiprocessing.managers.BaseManager",
"line_number": 18,
"usage_type": "name"
... |
38612986384 | import state
import math
import collections
def label(graph):
GOAL_NUM = 5
goalTables = [
(i,obj)
for i,obj in enumerate(graph.nodes)
if obj[state.ObjType.Table] > .5
and obj[len(state.ObjType) + state.ObjAttrs.goal] > .5
]
tables = [
(i,obj)
for i,obj in enumerate(graph.nodes)
if obj[state.ObjType.... | lukeshimanuki/qqq | heuristic.py | heuristic.py | py | 1,226 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "state.ObjType",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "state.ObjType",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "state.ObjAttrs",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "state.ObjTy... |
36902006495 | '''
Descripttion:
version:
Author: LiQiang
Date: 2021-04-08 21:37:49
LastEditTime: 2021-04-09 19:34:00
'''
"""
主函数,用来提取关键词 、及主题句子
"""
import textRank
##########生成词云所用的库##########
import matplotlib.pyplot as plt
import PIL.Image as Image
import jieba
import numpy as np
import os
from wordcloud import ... | MarsCube/TextRank-1 | main_two_cloud.py | main_two_cloud.py | py | 4,182 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "textRank.TextRank",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "jieba.cut",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_nu... |
33330576982 | from flask import Flask, render_template
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
from io import BytesIO
import base64
from bs4 import BeautifulSoup
import requests
#don't change this
matplotlib.use('Agg')
app = Flask(__name__) #do not change this
#insert the scrapping here
url_get = req... | kopikepu/Capstone_Webscrapping | app.py | app.py | py | 3,043 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "matplotlib.use",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line... |
71059419553 | from django.contrib import admin
from .models import Service, AppointmentRequest, Appointment, EmailVerificationCode, Config
@admin.register(Service)
class ServiceAdmin(admin.ModelAdmin):
list_display = ('name', 'duration', 'price', 'created_at', 'updated_at',)
search_fields = ('name',)
list_filter = ('d... | adamspd/django-appointment | appointment/admin.py | admin.py | py | 1,201 | python | en | code | 11 | github-code | 1 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.register",
"line_number": 6,
"usage_type": "call"
},
{
... |
17223706930 | import multiprocessing
from multiprocessing import Pool
import time
# def spawn(num):
# print('Spawned!{}'.format(num))
# if __name__ == '__main__':
# s1 = time.time()
# for i in range(500):
# p = multiprocessing.Process(target=spawn,args=(i,))
# p.start()
# #p.join()
# e1 = time.time()
# s2 = time.time()
#... | Chaitanya-Varun/PythonConcepts | MultiProcessing.py | MultiProcessing.py | py | 645 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "multiprocessing.Pool",
"line_number": 27,
"usage_type": "call"
}
] |
26635775008 | """backend/main.py."""
from typing import Optional
from fastapi import FastAPI
from fastapi.responses import StreamingResponse
from maze_generator import ALPHA, DISCOUNT, EPSILON, NUM_EPISODES, MazeGenerator
from pydantic import BaseModel, validator
# Initialize FastAPI app
app = FastAPI(
title="DungeonMazeGenera... | mariaafara/DungeonMapGenerator | serving/api_main.py | api_main.py | py | 2,456 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "maze_generator.ALP... |
11648173695 | #!/usr/bin/python -tt
""""
created on 17th March 2018
@author: Abhishek Chattopadhyay
FName: addTest
"""
from __future__ import print_function
import os
import sys
import datetime
import xml.etree.ElementTree as ET
BASEDIR = '.'
_template = BASEDIR + '/xml/templates/testtemplate.xml'
optDir = BASEDIR + '/xml/optio... | abhishekchattopadhyay/Octopus | automation/scripts/addTest.py | addTest.py | py | 10,993 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "datetime.datetime.now",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 55,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.now",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "da... |
31636907161 | import os
import json
from S3utility.s3_notification_info import parse_activity_data
from provider.storage_provider import storage_context
from provider import digest_provider, download_helper
import provider.utils as utils
from activity.objects import Activity
"""
DepositDigestIngestAssets.py activity
"""
class act... | elifesciences/elife-bot | activity/activity_DepositDigestIngestAssets.py | activity_DepositDigestIngestAssets.py | py | 4,579 | python | en | code | 19 | github-code | 1 | [
{
"api_name": "activity.objects.Activity",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
... |
29687300166 | #!/usr/bin/env python3
#
# An HTTP server that's a message board.
# PRG(Post-Redirect-Get) design pattern : HTTP application의 매우 자주 사용되는 패턴임
# 실행 순서
# 1. localhost:8000/ 접속하면 do_GET을 call => html form내용이 화면에 보여짐
# ==> web browser에서 server를 call할 때 method의 default값은 GET 방식임
# 2. textarea에 데이터 입력하고 submit button누르면 do... | Leftddr/web_programming | Standard Web Library/1. Standard Web Library/5_MessageboardPartThree/MessageboardPartThree.py | MessageboardPartThree.py | py | 3,066 | python | ko | code | 0 | github-code | 1 | [
{
"api_name": "http.server.BaseHTTPRequestHandler",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "urllib.parse.parse_qs",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "http.server.HTTPServer",
"line_number": 75,
"usage_type": "call"
}
] |
798865698 | import utils
def get_relaunch_hits(tasks, args):
knowledge = utils.get_knowledge_file(args)
round_num = utils.get_round(args)
one_assignment_tasks, two_assignment_tasks = [], []
for task in tasks:
image_name = task['url']
if image_name not in knowledge:
two_assignment_tasks... | ShubhangDesai/visual-genome-test-curation | stage2/initial_launch.py | initial_launch.py | py | 1,722 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "utils.get_knowledge_file",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "utils.get_round",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "utils.get_hits_from_tasks",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "util... |
39334745659 | from flask import Flask, jsonify, render_template, request
import numpy as np
import pandas as pd
import sklearn as sk
import pickle
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.naive_bayes import MultinomialNB, GaussianNB
from sklearn.model_selection import train_test_split
app = Flask(__n... | bharathprakash321/ML-Review-Detector | app.py | app.py | py | 1,480 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"... |
21220358291 | from distutils.errors import CompileError
from traceback import print_tb
from matplotlib import pyplot as plt
from sklearn.model_selection import train_test_split
import torch
import transformers
from torch.utils.data import Dataset, DataLoader, RandomSampler, SequentialSampler
from transformers import BertConfig, Bert... | Rolo123y/fnc-1-MSCI598 | fnc-bert-eval.py | fnc-bert-eval.py | py | 7,680 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "transformers.logging.set_verbosity_error",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "transformers.logging",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "torch.utils.data.Dataset",
"line_number": 43,
"usage_type": "name"
}... |
35885711050 | import socket
import subprocess
from datetime import datetime
# Clear the terminal screen
subprocess.call('clear', shell=True)
# Prompt the user to enter the target IP address or hostname
target = input("Enter the target IP address or hostname: ")
# Function to perform the port scanning
def port_scan(target):
tr... | Toothless5143/Port-Scanny | port-scanny.py | port-scanny.py | py | 1,303 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "subprocess.call",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "socket.gethostbyname",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "datetime.da... |
18596317269 | import numpy as np
import seaborn as sn
from sklearn.naive_bayes import GaussianNB
from sklearn import metrics
from matplotlib import pyplot
import pandas as pd
from sklearn.feature_selection import SelectKBest
from sklearn.feature_selection import chi2
import data_operations
import constants
def naiv... | Cryoscopic-E/Data-mining-coursework1 | scripts/research_question.py | research_question.py | py | 3,150 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "data_operations.split_sets",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sklearn.naive_bayes.GaussianNB",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.accuracy_score",
"line_number": 23,
"usage_type": "call"
},
... |
25253660991 | import requests
import json
import time
import queue
import threading
proxy_list = []
def get_proxies():
url = "https://proxylist.geonode.com/api/proxy-list?limit=500&page=1&sort_by=lastChecked&sort_type=desc&speed=fast&protocols=socks4%2Csocks5"
response = requests.get(url)
response_status = response.st... | milan-sony/foxy | foxytest.py | foxytest.py | py | 3,006 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 34,
... |
31892002549 | import torch
from transfer import TransferNet
from utils import load_image
import torchvision.transforms as transforms
from torchvision.utils import save_image
# path
content_path = "content/chicago.jpg"
style_path = "styles/wave.jpg"
save_dir = ""
weight_path = "saved_weights/fst_wave.pth"
device = torch.device('cuda... | callmewenhao/FastStyleTransfer | predict.py | predict.py | py | 869 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.device",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "torchvision.tran... |
36795692494 | import sqlite3
import bcrypt
import time
import datetime
import math
# User(UserNumber, Name, Surname, Email_address, Password)
# UserNumber TEXT NOT NULL
# Password TEXT NOT NULL
# Email TEXT NOT NULL
# User_Type CHAR(1)
# Name TEXT NOT NULL
# PRIMARY KEY(UserNumber)
# Admin(UserNumber)
# UserN... | ardaa/CS281 | database.py | database.py | py | 19,973 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sqlite3.connect",
"line_number": 108,
"usage_type": "call"
},
{
"api_name": "bcrypt.hashpw",
"line_number": 148,
"usage_type": "call"
},
{
"api_name": "bcrypt.gensalt",
"line_number": 148,
"usage_type": "call"
},
{
"api_name": "bcrypt.checkpw",
... |
24870777060 | #!/usr/bin/env python
"""Script that inserts NIfTI/JSON files into the database"""
import os
import sys
import lib.exitcode
import lib.utilities
from lib.lorisgetopt import LorisGetOpt
from lib.dcm2bids_imaging_pipeline_lib.nifti_insertion_pipeline import NiftiInsertionPipeline
__license__ = "GPLv3"
sys.path.appen... | aces/Loris-MRI | python/run_nifti_insertion.py | run_nifti_insertion.py | py | 5,231 | python | en | code | 10 | github-code | 1 | [
{
"api_name": "sys.path.append",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "lib.lorisgetopt.LorisGetOpt",
"line_number": 100,
"usage_type": "call"
},
{
"api_name": "os.path.ba... |
7214790078 | import sys
sys.stdin = open('불_input.txt')
from collections import deque
dx = [-1,1,0,0]
dy = [0,0,-1,1]
def bfs() :
while q2 :
x,y = q2.popleft()
for i in range(4):
nx = x + dx[i]
ny = y + dy[i]
if 0 <= nx < h and 0 <= ny < w and fire[nx][ny] == 0 :
... | HyunSeok0328/Algo | 불.py | 불.py | py | 1,398 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.stdin",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 39,
"usage_type": "call"
}
] |
28238218682 | # -*- coding: utf-8 -*-
"""
This module contains any functions directly related to ROI operations and queries.
"""
import sys
import os.path
import math
import lib
import roi
import numpy as np
import logging
from HMR_RS_LoggerAdapter import HMR_RS_LoggerAdapter
base_logger = logging.getLogger("hmrlib." + os.path.ba... | mcbanjomike/Scripts-RayStation-4.7.2 | hmrlib/poi.py | poi.py | py | 25,576 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.path.basename",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.path",
... |
4709157122 | import easydict
from generator import KoGPT2IdeaGenerator
if __name__ == "__main__":
args = easydict.EasyDict({
'gpus' : 1,
'model_params' : 'model_chp/model_-last.ckpt'
})
evaluator = KoGPT2IdeaGenerator(args)
result = evaluator.generate("내구성")
print(result)
| madcamp-final/KoGPT2_generation | idea_generation/test.py | test.py | py | 304 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "easydict.EasyDict",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "generator.KoGPT2IdeaGenerator",
"line_number": 10,
"usage_type": "call"
}
] |
23869569915 | # -*- coding: utf-8 -*-
import logging
from datetime import date
from os import path
import xlsxwriter
from envios import Envio
from helpers import add_util_days, mailer, to_money
from pagamentos import Pagamento
from plataformas import PlataformaABC
logger = logging.getLogger(__name__)
CWD = path.dirname(path.absp... | rennancockles/LojaIntegrada_Scripts | lojaintegrada_scripts/commands/pedidos_pagos.py | pedidos_pagos.py | py | 9,362 | python | pt | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "os.path.abspath",
"line... |
8967238816 | import warnings
import pandas as pd
import numpy as np
from sklearn.metrics import mean_squared_error, mean_absolute_error, r2_score
from sklearn.model_selection import train_test_split
from sklearn.linear_model import ElasticNet
from urllib.parse import urlparse
import mlflow.sklearn
from mlflow.models.signature impo... | shippedbrain/shipped-brain-api | examples/elastic_net/train_and_log.py | train_and_log.py | py | 3,589 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "logging.basicConfig",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "logging.WARN",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
... |
17957990942 | """
Module for parsing segmented HamNoSys transcriptions.
"""
from pysign.data import HAMNOSYS
import attr
from tabulate import tabulate
def ascify(text, sep='.'):
return '.'.join(
HAMNOSYS.get(char, {"Name": '<'+char+'>'})["Name"] for char in
text).replace('.asciispace.', ' ')
def parse_... | lingpy/pysign | src/pysign/parse.py | parse.py | py | 34,106 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pysign.data.HAMNOSYS.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pysign.data.HAMNOSYS",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "attr.ib",
"line_number": 744,
"usage_type": "call"
},
{
"api_name": "attr.ib",
... |
27948279806 | import requests
from datetime import datetime
import os
GENDER = "male"
WEIGHT_KG = 70
HEIGHT_CM = 5.1
AGE = 20
APP_ID = "a824f715"
API_KEY = "e448d4180759e718cbd58d59be69abc2"
exercise_endpoint = "https://trackapi.nutritionix.com/v2/natural/exercise"
sheet_endpoint = "https://api.sheety.co/4bbf6252f12ebc8107aab6bbe... | Fidelis-7/100-days-of-coding-in-python | 100-Days/Day_38/main.py | main.py | py | 1,611 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "requests.post",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "datetime.dateti... |
5182513730 | import numpy
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import Dropout
from keras.layers import Flatten
from keras.layers.convolutional import Conv2D
from keras.layers.convolutional import MaxPooling2D
from keras.utils import np_utils
from keras... | olliesguy/Machine-Learning | Neural Networks/Convolutional NN/largerConvolutionalNNwithKeras.py | largerConvolutionalNNwithKeras.py | py | 2,867 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "keras.backend.set_image_dim_ordering",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "keras.backend",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "numpy.random.seed",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "... |
1795182435 | import json
import time
import network
try:
with open('wlan.json') as f:
wlan_config = json.load(f)
hostname = wlan_config['HOSTNAME']
wlan_credentials = wlan_config['WLAN_CREDENTIALS']
assert len(wlan_credentials) > 0
except OSError:
raise Exception('wlan config does not exist, but is man... | dtn7/dtn7zero | micropython-lib/wlan.py | wlan.py | py | 3,021 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "json.load",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "network.WLAN",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "network.STA_IF",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "time.sleep_us",
"line_n... |
13857013396 | from inspect import _empty
from discord import player
from discord.ext import commands
import random
import traceback
class Connectx(commands.Cog):
def __init__(self, config, bot: commands.Bot):
self.bot = bot
self.config = config
self.game_list = {}
self.predefined_emoji_l... | JeppeLovstad/Discord-Meme-Delivery-Bot | BotModules/connectx.py | connectx.py | py | 6,037 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "discord.ext.commands.Bot",
"line_number": 8,
"usage_type": "attribute"
},
{
"api... |
43641338998 | #########################
# data_processing.py #
#########################
# Implements DataGenerator and batch sampling
# functionality for MAML. Originally based on
# functionality in CS330 Homework 2, Fall 2020.
# Written by Will Geoghegan for CS330
# final project, Fall 2020. Based on work by
# CS330 course staff.... | wdg3/regularized-meta-learning | src/data_processing.py | data_processing.py | py | 5,371 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "os.path.isdir",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "pyarrow.feather.read_feather",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "pyarrow.feath... |
41331723652 | # coding=utf-8
import random
import re
from django.db import models, transaction
from django.db.models import Count, Q
from django.contrib.auth.models import User
from django.conf import settings
from django.db.models.signals import post_save, post_delete
from django.dispatch import receiver
import django.utils.htt... | entropia/no-bot-is-perfect | nbip_server/nbip/models.py | models.py | py | 20,182 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.db.models.PositiveSmallIntegerField",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "django.db.models.SubfieldBase",
"line_number": 45,
"usage_type": "attrib... |
73539569312 | import argparse
import csv
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("firstCol", help = "Number of the first column to match", type=int)
parser.add_argument("secondCol", help = "Number of the second column to match, multiple content", type=int)
parser.add_argument("-b", "... | EuphoricThinking/encyklopedia_lekow | encyklopedia_leków/rodzielCsv.py | rodzielCsv.py | py | 1,603 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 42,
"usage_type": "call"
}
] |
2616990888 | import json
import logging
from twitterauth.session import Session
from twitterauth.test import APITestCase
from twitterauth.configs import settings
from twitterauth.utils import helper
from twitterauth.utils import payload
LOGGER = logging.getLogger('twitter')
grant_type_missing_err_msg = 'Missing required parameter... | rohitkadam19/API-Automation | twitter_app_auth/tests/api/test_input_validation.py | test_input_validation.py | py | 3,892 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "twitterauth.test.APITestCase",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "twitterauth.session.Session",
"line_number": 20,
"usage_type": "call"
},
{
"api_na... |
6950578278 | import warnings
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import Tensor
from torch._jit_internal import Optional, Tuple
from torch.nn import grad # noqa: F401
from torch.nn.functional import linear
from torch.nn.modules.linear import _LinearWithBias
from torch.nn.parameter import P... | Flawless1202/Non-AR-Spatial-Temporal-Transformer | nast/models/utils/spatial_temporal_tensor_attention.py | spatial_temporal_tensor_attention.py | py | 16,739 | python | en | code | 73 | github-code | 1 | [
{
"api_name": "torch.Tensor",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "torch.Tensor",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "torch.Tensor",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "torch.Tensor",
"line_numbe... |
6403461688 | from traceback import print_tb
import telebot
from telebot import types
import MySQLdb
from datetime import datetime
from telebot.types import ReplyKeyboardRemove
# DB & Bot connection
db = MySQLdb.connect("localhost", "root", "1", "db_bikes") or die(
"could not connect to database")
bot = telebot.TeleBot('530455... | oneku16/Digital_Campus | bot/bot.py | bot.py | py | 3,542 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "MySQLdb.connect",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "telebot.TeleBot",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "telebot.types.ReplyKeyboardMarkup",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "tel... |
4743048609 | import requests
from twilio.rest import Client
import os
import time
url = 'http://api.vk.com/method/'
token = os.environ['sms_token']
account_sid = os.environ['account_sid']
auth_token = os.environ['auth_token']
def get_json(user_id):
method = url + 'users.get'
data = {
'user_ids': user_id,
'... | zYoma/api_01_sms | main.py | main.py | py | 1,002 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.environ",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line... |
28410999980 | from django.conf import settings
from django.conf.urls import include, url # noqa
from django.contrib import admin
from django.views.generic import TemplateView
import django_js_reverse.views
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^jsreverse/$', django_js_reverse.views.urls_js, name='js_rev... | pamella/pokebattle | pokebattle/urls.py | urls.py | py | 857 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "django.conf.urls.url",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 10,
"usage_type": "name"
},
{
"api_name... |
12780521041 | import logging
from fastapi import FastAPI, UploadFile
from fastapi.middleware.cors import CORSMiddleware
import pandas as pd
from .convert import xlsx_to_jvfdtm
logging.basicConfig(level=logging.DEBUG)
app = FastAPI()
app.add_middleware(
CORSMiddleware,
allow_origins=[
"http://localhost:8080"
... | luminousai/rosetta | server/src/app.py | app.py | py | 591 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.basicConfig",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "fastapi.FastAPI",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "fastapi.middle... |
71395832033 | from datetime import datetime
from ninja import FilterSchema, Schema
from pydantic import Field, validator
class CourseIn(Schema):
title: str
description: str
slug: str
language: str
requirements: str
what_you_will_learn: str
level: str
categories: list[int] | None
instructors: li... | gabrielustosa/educa | educa/apps/course/schema.py | schema.py | py | 2,173 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "ninja.Schema",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "ninja.Schema",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "datetime.datetime",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "datetime.datetime",
"l... |
73374112673 | from http import HTTPStatus
import django.test
import django.urls
__all__ = []
class StaticURLTests(django.test.TestCase):
def test_homepage_endpoint(self):
response = django.test.Client().get(
django.urls.reverse("homepage:home"),
)
self.assertEqual(response.status_code, HT... | xtern0o/educational_django_project_yandex | lyceum/homepage/tests.py | tests.py | py | 623 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "django.test.test",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "django.test",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.test.test.Client",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.test... |
25744704351 | import datetime
import os
import platform
class Clock:
def __init__(self):
self._stopwatch_counter_num = 10800
self._running = None
self._alarm_minute = None
self._alarm_hour = None
self._seconds = None
self._minutes = None
self._hour = None
self._a... | bailerG/clock_python_app | main.py | main.py | py | 2,054 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "datetime.datetime.now",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.now",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "da... |
43816202446 | import numpy as np
from collections import defaultdict
from scipy import sparse
def trans_matrice(L,D,vois):
I,J,V=[],[],[]
for i in range(len(L)):
for l in vois[L[i]]:
j=D[l]
if j>=0:
I.append(i)
J.append(j)
V.append(1./len(vois[... | LeoReg/UniversalExplorationDynamics | Fig3/Percolation_exact_enum.py | Percolation_exact_enum.py | py | 1,605 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "numpy.array",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "scipy.sparse.csc_matrix",
"li... |
19815836754 | # -*- coding: utf-8 -*-
from django.conf import settings
from django.utils.encoding import force_text
from django.utils.timezone import get_current_timezone_name
from cms.cache import _get_cache_version, _set_cache_version, _clean_key, _get_cache_key
from cms.utils import get_cms_setting
def _placeholder_cache_key(pl... | farhan711/DjangoCMS | cms/cache/placeholder.py | placeholder.py | py | 2,388 | python | en | code | 7 | github-code | 1 | [
{
"api_name": "cms.utils.get_cms_setting",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.USE_TZ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 11,
"usage_type": "name"
},
{
"a... |
74359950112 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2020/11/9 0:05
# @Author : SELF-T-YY
# @Site :
# @File : classical_sample_ambiguous_shortestPath.py
# @Software: PyCharm
import json
import networkx as nx
import sys
import numpy
fileWritePath = r'../data_forSystem/ieee_visC/IV_ambiguousBetweennessDa... | ShenXilong2000/newSystem | python/classical_sample_ambiguous_shortestPath.py | classical_sample_ambiguous_shortestPath.py | py | 3,102 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "json.load",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "networkx.Graph",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "networkx.single_target_shortest_path_length",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "... |
25021705065 | #mengimport library yang digunakan
from keras.models import load_model
from PIL import Image
from matplotlib import pyplot as plt
import numpy as np
#Membaca gambar menggunakan library PIL, pembaca juga
#dapat menggunakan library lain, seperti OpenCV
gambar1= Image.open("dataset/mnist/testing/0/img_108.jpg")
... | ardianumam/Data-Mining-and-Big-Data-Analytics-Book | edisi2/10.5.2 Menggunakan Model yang telah ditraining.py | 10.5.2 Menggunakan Model yang telah ditraining.py | py | 1,272 | python | id | code | 26 | github-code | 1 | [
{
"api_name": "PIL.Image.open",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": ... |
6933911036 | import os
import json
import pytz
import logging
from flask_socketio import SocketIO, emit
from flask import (Flask, render_template, request, jsonify)
from pymongo import MongoClient
from threading import Thread, Event
from datetime import datetime
from convxai.utils import *
logging.basicConfig(format='%(asctime)s ... | huashen218/convxai | convxai/services/web_service/web_server.py | web_server.py | py | 6,524 | python | en | code | 9 | github-code | 1 | [
{
"api_name": "logging.basicConfig",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "flask.Flask",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask_socketio.Sock... |
19471220856 | """
@file
@brief Data aggregation for timeseries.
"""
import datetime
import pandas
from pandas.tseries.frequencies import to_offset
def _get_column_name(df, name='agg'):
"""
Returns a unique column name not in the existing dataframe.
@param df dataframe
@param name prefix
@retu... | sdpython/mlinsights | mlinsights/timeseries/agg.py | agg.py | py | 3,224 | python | en | code | 65 | github-code | 1 | [
{
"api_name": "pandas.DataFrame",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "pandas.tseries.frequencies.to_offset",
"line_number": 49,
"usage_type": "call"
},
{
"api_name":... |
640941004 | import json
import pytz
import datetime
def lambda_handler(event, context):
tempvar2=[]
timezones = pytz.common_timezones
#timezones = pytz.all_timezones
for timezone in timezones:
tempvar = timezone[0:2]
if tempvar == 'US':
tempvar2.append(timezone)
return {
'st... | yogeshturerao/deploymentsapis | timezone/timezone.py | timezone.py | py | 382 | python | fa | code | 0 | github-code | 1 | [
{
"api_name": "pytz.common_timezones",
"line_number": 7,
"usage_type": "attribute"
}
] |
72383077154 | import torch
import torch.nn as nn
import torch.nn.functional as F
# Parts of these codes are from: https://github.com/Linfeng-Tang/SeAFusion
class Sobelxy(nn.Module):
def __init__(self):
super(Sobelxy, self).__init__()
kernelx = [[-1, 0, 1],
[-2, 0, 2],
[-1, 0... | GeoVectorMatrix/Dif-Fusion | models/fs_loss.py | fs_loss.py | py | 2,182 | python | en | code | 33 | github-code | 1 | [
{
"api_name": "torch.nn.Module",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torch.FloatTensor",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.FloatTensor",
... |
20939299113 | # ========================
# Panda3d - panda3d_gpu.py
# ========================
# Panda3d imports.
from panda3d.core import NodePath, ClockObject, Filename, Texture
from panda3d.core import Shader, ShaderAttrib, PNMImage
from panda3d.core import LVector3i
'''# Local imports.
from etc import _path'''
# Basic Timer ... | svfgit/solex | gpu/panda3d_gpu.py | panda3d_gpu.py | py | 7,117 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "panda3d.core.ClockObject",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "panda3d.core.LVector3i",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "panda3d.core.Texture.FRgba8",
"line_number": 40,
"usage_type": "attribute"
},
{
"... |
24965986916 | import io
import pandas as pd
import requests
from mage_ai.data_preparation.shared.secrets import get_secret_value
if 'data_loader' not in globals():
from mage_ai.data_preparation.decorators import data_loader
if 'test' not in globals():
from mage_ai.data_preparation.decorators import test
@data_loader
def lo... | WillowyBoat2388/football-analytics | data_loaders/teams_id.py | teams_id.py | py | 1,368 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "mage_ai.data_preparation.shared.secrets.get_secret_value",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 35,
"usage_type": "call"
},
{... |
36865815414 | #!/usr/bin/env python
# coding: utf-8
# In[174]:
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import GridSearchCV
from itertools import combinations
# ###... | TataAndBigData/AICORE_project_1_submission | Wine_project_Tanya.py | Wine_project_Tanya.py | py | 24,410 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "matplotlib... |
14592252085 | from rest_framework import viewsets, mixins
from rest_framework.response import Response
from .models import AssignmentGroup, Assignment, StudentAssignment
from .serializers import (AssignmentGroupSerializer,
AssignmentSerializer, StudentAssignmentSerializer)
from .policies import (AssignmentG... | benhchoi/coursemanager | coursemanager/assignments/api.py | api.py | py | 2,830 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "rest_framework.viewsets.ModelViewSet",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.viewsets",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "serializers.AssignmentGroupSerializer",
"line_number": 11,
"usage_type"... |
72382523234 | from django.db import models
import auto_prefetch
from django_resized import ResizedImageField
from folio.utils.media import MediaHelper
from folio.utils.choices import PortfolioChoices
from folio.utils.models import NameBaseModel, ExperienceAndSchoolModel
from django.utils.text import slugify
from django.urls import ... | Gentility01/my-folio1 | core/models.py | models.py | py | 5,589 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "folio.utils.models.ExperienceAndSchoolModel",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "django.db.models",
"line_number": 17,
"usage_type": "name"
},
... |
12888400882 | import asyncio
import websockets
import soundfile as sf
import numpy as np
# Initialize a counter for file naming
file_counter = 0
connected_clients = set()
async def register_client(websocket):
connected_clients.add(websocket)
async def unregister_client(websocket):
connected_clients.remove(websocket)
asyn... | Tuzteno/Ozzu | ws/ws.py | ws.py | py | 2,072 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.frombuffer",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "soundfile.SoundFile",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "websockets.ConnectionClosedOK",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name"... |
34139755887 | import os
import sys
sys.path.append("Mask_RCNN")
from mrcnn.model import MaskRCNN
from mrcnn import utils
from data import Data
from waldo_config import Waldoconfig
if __name__ == '__main__':
config = Waldoconfig()
config.display()
model = MaskRCNN(mode="training", config=config,
... | alseambusher/deepwaldo | train.py | train.py | py | 1,130 | python | en | code | 8 | github-code | 1 | [
{
"api_name": "sys.path.append",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "waldo_config.Waldoconfig",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "mrcnn.model.Mask... |
42014273667 |
import zipfile
from functools import partial
import re
from collections import OrderedDict, Counter, defaultdict
import shutil
import os
from pprint import pprint
import datetime
import subprocess
import sys
from pathlib import Path
import mistune
from book_section import (CHAPTER, PART, SUBCHAPTER, TOC,
... | JoseBlanca/md2epub | epub_creation.py | epub_creation.py | py | 37,754 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "pathlib.Path",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line... |
17414099922 | from PySide2.QtWidgets import QAction, QApplication, QMessageBox, QInputDialog
from PySide2.QtCore import Qt
from PySide2.QtGui import QIcon
from PySide2.QtWidgets import QWidget, QMainWindow, QLabel, QApplication, QFileDialog
from model.Workspace import Workspace
from model.Chapter import Chapter
from model.Book impor... | dovvla/multimedia-book | MuMijA/actions/NewBookAction.py | NewBookAction.py | py | 2,130 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PySide2.QtWidgets.QAction",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "PySide2.QtGui.QIcon",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "PySide2.QtWidgets.QApplication.instance",
"line_number": 31,
"usage_type": "call"
},
{
... |
761243358 | import allure
import pytest
from pages.cart_page import CartPage
from pages.home_page import HomePage
from pages.login_page import LoginPage
from utils.locators import LoginPageLocators, CartPageLocators, HomePageLocators
from utils.logger import _step
@pytest.mark.usefixtures('setup', 'website_setup')
cl... | BoxingP/selenium-auto-test | lambda/test_website/tests/test_scenarios_with_login.py | test_scenarios_with_login.py | py | 4,013 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pages.home_page.HomePage",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pages.login_page.LoginPage",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "utils.locators.LoginPageLocators.login_title",
"line_number": 27,
"usage_type": "attr... |
26725677323 | from typing import List
import random
from . import aiplayer, game_config, move, randomai, ship, player
class SearchDestroyAi(aiplayer.AIPlayer):
def __init__(self, player_num: int, config: game_config.GameConfig, other_players: List["Player"], type):
super().__init__(player_num, config, other_players, ty... | ChoBro1/BattleShip | BattleShip/src/searchdestroyai.py | searchdestroyai.py | py | 5,246 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.List",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "random.choice",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 116,
"usage_type": "call"
}
] |
42599399772 | #!/usr/bin/env python
# encoding: utf-8
import os
"""
@author: wenjiaGuo
@version: ??
@contact: 601152819@qq.com
@software: PyCharm
@file: 8.收集整个网站数据.py
@time: 2017/10/5 20:50
"""
# 如何创建一个爬虫来收集页面标题、正文的第一个段落,
# 以及编辑页面的链接(如果有的话)这些信息。
from urllib.request import urlopen
from bs4 import BeautifulSoup
import re
page = set(... | guowenjia/scrapingAndClear | 8.收集整个网站数据.py | 8.收集整个网站数据.py | py | 1,153 | python | zh | code | 0 | github-code | 1 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 31,
"usage_type": "call"
}
] |
24657826075 | from enum import IntEnum
from .graph import Edge, Graph, Node
from .heap import EdgeHeap
class Color(IntEnum):
WHITE = 0
GRAY = 1
BLACK = 2
class KruskalsAlgorithm:
# get all the edges of a graph
# sort them
# check if they do not make a cycle
#
def __init__(self, G: Graph, s: int, t:... | Hemal-Mamtora/CSCE629_algo_project | src/kruskals.py | kruskals.py | py | 3,570 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "enum.IntEnum",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "graph.Graph",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "heap.EdgeHeap",
"line_number": 28,
"usage_type": "call"
}
] |
13829989656 | import collections
import itertools
import time
import random
from typing import Optional
import streamlit as st
import numpy as np
import pyaudio
from pydub import AudioSegment, silence
from audio_io import AudioIO
from audioplots import *
from containers import *
from layout import *
ctx = {
# names match py... | phoneticsushi/muesli | streamlit_app.py | streamlit_app.py | py | 4,603 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pyaudio.paInt16",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "random.randint",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "streamlit.balloons",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "streamlit.sess... |
41179644496 | from binance.client import Client
from yaspin import yaspin
import os.path
from datetime import datetime
import pickle
import pandas as pd
import backtrader as bt
class databutler():
def __init__(self,directory):
#binance client without keys for data acquisition
self.binanceClient = Client("", "")... | webclinic017/coni_standard_backtest | Databutler.py | Databutler.py | py | 3,689 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "binance.client.Client",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "yaspin.yaspin",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.fromtimestamp",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "d... |
21141530709 | """
Player for solitaire.
Created on 19.10.2018
@author: Ruslan Dolovanyuk
"""
import enum
import checker
from constants import Colors
import pygame
Actions = enum.Enum('Actions', 'ChangeZoneUp ChangeZoneDown ChangeRowUp ChangeRowDown ChangeCardUp ChangeCardDown Take Drop')
class Player:
"""Player class ... | DollaR84/solitaire | player.py | player.py | py | 10,168 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "enum.Enum",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "constants.Colors.BLUE",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "constants.Colors",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "pygame.draw.rec... |
22088012589 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name='BraketLab',
version='1.8.0',
author="Audun Skau Hansen",
author_email="audunsh4@gmail.com",
description="Educational tool for learning quantum theory with Jupyter Notebooks",
... | audunsh/braketlab | setup.py | setup.py | py | 742 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "setuptools.setup",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 16,
"usage_type": "call"
}
] |
22385044991 | ######################################################################
# Author: IK3D -- Issanou Kamardine
# License: GPL v3
######################################################################
bl_info = {
"na... | IIK3D/Blender-Scriptes-management | Scripts_Management.py | Scripts_Management.py | py | 15,086 | python | en | code | 6 | github-code | 1 | [
{
"api_name": "bpy.types",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "bpy.props.StringProperty",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "bpy.props",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "bpy.types",
... |
72116070115 | """
Class for computing various metrics on a data set with a BayesNet Node object.
"""
import logging
import numpy as np
from .cpd.ogive import OgiveCPD
EPSILON = 1e-16
MAP_ACCURACY_KEY = 'map_accuracy'
AUC_KEY = 'auc'
LOGLI_KEY = 'logli'
D_PRIME_KEY = 'd_prime'
NAIVE_KEY = 'naive'
METRICS_KEYS = {NAIVE_KEY, LOGLI_... | Knewton/edm2016 | rnn_prof/irt/metrics.py | metrics.py | py | 11,126 | python | en | code | 58 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "cpd.ogive.OgiveCPD",
"line_number": 32,
"usage_type": "argument"
},
{
"api_name": "numpy.all",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "numpy.isfinite",
... |
71912287073 | import argparse
import subprocess
import decode
import os
import sys
def full_executable_path(invoked):
# From https://bugs.python.org/issue8557
# https://bugs.python.org/issue8557
# with subprocess.open, c:\windows\system32\curl.exe has precedence on the PATH environment variable for Windows 10
... | CAST-Extend/com.castsoftware.aip.datamart | utilities/curl.py | curl.py | py | 2,519 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "os.path.dirname",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_nu... |
43032086095 | """
The Python script to test if the web page displays "Hello World"
"""
import urllib3
from bs4 import BeautifulSoup
def test_hello_world():
http = urllib3.PoolManager()
response = http.request("GET", "http://localhost")
soup = BeautifulSoup(response.data, "html.parser")
assert soup.h1.text.strip() ... | CSEC380-Group16/csec380-project | tests/test_act2.py | test_act2.py | py | 388 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "urllib3.PoolManager",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 11,
"usage_type": "call"
}
] |
15461259378 | """ Debug GAN, generator and discriminator and save the models """
import os
import sys
import logging
import matplotlib.pyplot as plt
from constants import default_list
# Logger import
from dataset import logData
from make_models import logMod
from class_GAN import logGAN
# Debug import
from unbiased_metrics impo... | Dario-Maglio/EM-shower-simulator-with-NN | em_shower_simulator/debug.py | debug.py | py | 4,726 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.join",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "constants.default_list",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "logging.StreamHandle... |
23808525747 | import sys
import json
import urllib.error
import argparse
from datetime import datetime as dt
from urllib.request import urlopen, urlretrieve
from threading import Thread
from cuter import *
sys.path.append('..')
from Database import *
class DownloadImage:
def __init__(self, image_info):
self.id = ima... | sandbenders/ProphecyApparatus | scrap_reddit/scrap_reddit.py | scrap_reddit.py | py | 4,101 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.path.append",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "urllib.error.request.build_opener",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "urlli... |
26575927806 | import sys
from sqlalchemy import create_engine
import pandas as pd
import numpy as np
import pickle
from sklearn.model_selection import train_test_split
from sklearn.pipeline import Pipeline
from sklearn.feature_extraction.text import CountVectorizer, TfidfTransformer
from sklearn.multioutput import MultiOutputClassi... | atomopa/udacity_data_scientist_project2 | models/train_classifier.py | train_classifier.py | py | 4,960 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "pandas.read_sql",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "nltk.tokenize.word_tokenize",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "... |
20850779363 | import numpy as np
import cv2
import mss
import os
LABELS_PATH = os.path.dirname(__file__) + '/coco.names'
LABELS = open(LABELS_PATH).read().strip().split("\n")
COLORS = np.random.randint(0, 255, size=(len(LABELS), 3), dtype="uint8")
class Frame:
def __init__(self, source='webcam', screen_size=(800, 640)):
... | SarperYurttas/objectDetectionWithYOLO | object_detection/utils.py | utils.py | py | 1,013 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.dirname",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.randint",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"li... |
23353872700 | # -*-coding:utf-8 -*-
"""
Created on 2016-7-5
@author: Danny
DannyWork Project
"""
import socket
import threading
import time
import logging
import argparse
from utils import close_socket, parse_ping_data, reply_ping_data, get_python_version, start_data_transfer, \
PING_SENDING_START, TRANSFER_PREPARE, TRANSFER_... | manyunkai/dreverse | slave.py | slave.py | py | 7,337 | python | en | code | 7 | github-code | 1 | [
{
"api_name": "utils.get_python_version",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "logging.INFO",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "logg... |
31900102139 | # -*- coding: utf-8 -*-
"""
@File : pathSum.py
@Author : wenhao
@Time : 2023/2/1 11:58
@LC :
"""
from Tree import TreeNode
from typing import List
class Solution:
def pathSum(self, root: TreeNode, target: int) -> List[List[int]]:
ans = []
if root is None:
return ans
... | callmewenhao/leetcode | offer/二叉树/pathSum.py | pathSum.py | py | 840 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "Tree.TreeNode",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "Tree.TreeNode",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 14,
"usage_type": "name"
}
] |
71377869154 | import wx
from wx.lib.newevent import NewCommandEvent
import wx.lib.agw.cubecolourdialog as colordialog
from .constants import TEXT_COLOR
from .icons import ICON_BRUSH_CHECKERBOARD
button_cmd_event, EVT_COLORPICKER_BUTTON = NewCommandEvent()
class ColorPickerButton(wx.Control):
"""
Color picker widget for ... | GimelStudio/gswidgetkit | gswidgetkit/color_picker.py | color_picker.py | py | 4,863 | python | en | code | 9 | github-code | 1 | [
{
"api_name": "wx.lib.newevent.NewCommandEvent",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "wx.Control",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "wx.ID_ANY",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "wx.Defa... |
13140445812 | #!/usr/bin/env python3
import scapy.all as scapy
import time
import sys
import argparse
def get_arguments():
parser = argparse.ArgumentParser()
parser.add_argument('-t', '-target', dest='target_ip', help='Target IP')
parser.add_argument('-s', '-spoof', dest='spoof_ip', help='Spoof IP')
opti... | userbarbu/hk4ing-tools | arp_spoof.py | arp_spoof.py | py | 1,851 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "scapy.all.ARP",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "scapy.all",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "scapy.all.Ether",
... |
21143693469 | """
Watch global hotkeys.
Created on 15.01.2017
@author: Ruslan Dolovanyuk
"""
import logging
import keyboard
class Hotkeys:
"""Class watch globals hotkeys."""
def __init__(self, config, generals):
"""Initialize class Hotkeys."""
self.log = logging.getLogger()
self.log.info('init... | DollaR84/SARA | hotkeys.py | hotkeys.py | py | 936 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "keyboard.add_hotkey",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "keyboard.clear_all_hotkeys",
"line_number": 33,
"usage_type": "call"
}
] |
19466941066 | # -*- coding: utf-8 -*-
"""
@file
@brief Module *code_beatrix*.
.. faqref::
:title: Pourquoi Python?
`Python <https://www.python.org/>`_
est un langage de programmation très répandu aujourd'hui
qui fut choisi à l'`ENSAE <http://www.ensae.fr/ensae/fr/>`_ en
2005 pour remplacer le `C++ <https://fr.w... | sdpython/code_beatrix | src/code_beatrix/__init__.py | __init__.py | py | 3,006 | python | fr | code | 1 | github-code | 1 | [
{
"api_name": "os.path.abspath",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number"... |
20522260254 | import pytest
def test_ctypes_cdll_unknown_dll(pyi_builder, capfd):
with pytest.raises(pytest.fail.Exception, match="Running exe .* failed"):
pyi_builder.test_source(
"""
import ctypes
ctypes.cdll.LoadLibrary('non-existing-2017')
"""
)
out, err =... | pyinstaller/pyinstaller | tests/functional/test_runtime.py | test_runtime.py | py | 386 | python | en | code | 10,769 | github-code | 1 | [
{
"api_name": "pytest.raises",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pytest.fail",
"line_number": 5,
"usage_type": "attribute"
}
] |
5411922401 | import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.autograd import Variable
import numpy as np
from baselines.common.schedules import LinearSchedule
from baselines import logger
from model import NoisyDistDuelingConv, NoisyDistDuelingMLP, NoisyDuelingConv, No... | dai-dao/Rainbow-Net-Pytorch | test_atari.py | test_atari.py | py | 6,772 | python | en | code | 6 | github-code | 1 | [
{
"api_name": "torch.FloatTensor",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "torch.LongTensor",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "torch.cuda",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "torch.cu... |
21003159623 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('organizations', '0008_address_timezone'),
]
operations = [
migrations.AddField(
model_name='organization',
... | getcircle/services | organizations/migrations/0009_organization_image_url.py | 0009_organization_image_url.py | py | 424 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AddField",
"line_number": 14,
"usage_type": "call"
},
{
... |
21521899393 | from typing import List
class Solution:
def containsDuplicate(self, nums: List[int]) -> bool:
number_set = set()
for n in nums:
if n not in number_set:
number_set.add(n)
else:
return True
return False
solution = Solution()
answer =... | yihsuanhung/leetcode | 217. Contains Duplicate/main.py | main.py | py | 373 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
}
] |
73710667555 | #!/usr/bin/env python
# Run as:
# python plot_TC_vmax.py $TC_name/ID/year
# python plot_TC_vmax.py FlorenceAL062018
#
import numpy as np
import os, sys, datetime, time, subprocess
import re, csv, glob
import multiprocessing, itertools, collections
import scipy, ncepy
import matplotlib
import matplotlib.image as imag... | LoganDawson-NOAA/MEG | TC_plotting/plot_TC_vmax.py | plot_TC_vmax.py | py | 8,760 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "matplotlib.use",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_numb... |
32805233512 | # *** coding: utf-8 ***
#@Time : 2020/11/28 10:03
#@Author : xueqing.wu
#@Email : wuxueqing@126.com
#@File : apiOrder.py
import settings
from settings import IP,HEADERS
from tools.logger import GetLogger
logger = GetLogger().get_logger()
class ApiOrder():
def __init__(self):
logger.info('开始获取下单接口的U... | aadorable/mtx1212 | api/apiOrder.py | apiOrder.py | py | 1,153 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "tools.logger.GetLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "settings.IP",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "settings.HEADERS",
"line_number": 34,
"usage_type": "argument"
},
{
"api_name": "settings.HEAD... |
10556332205 | """
History
AUTHOR: JOE ROCCA
"""
from __future__ import print_function
import httplib
import json
from random import randint
from datetime import datetime
import calendar
# --------------- MAIN FUNCTIONS ----------------------
def lambda_handler(event, context):
""" Route the incoming request based on type (Lau... | joerocca/AmazonEchoHistorySkill | HistoryAlexaSkill.py | HistoryAlexaSkill.py | py | 8,308 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 161,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 161,
"usage_type": "name"
},
{
"api_name": "httplib.HTTPConnection",
"line_number": 216,
"usage_type": "call"
},
{
"api_name":... |
26890413015 | # Import the modules
import numpy as np
import matplotlib.pyplot as plt
import pickle
from DDPG import DDPG
from sklearn.ensemble import GradientBoostingRegressor
from env import Environment
import numpy as np
import scipy.stats as stats
# Define the parameters
MAX_EPISODES = 1000 # The maximum number of ep... | CodeAlpha7/8803-SMR | Distillation/newGBDT.py | newGBDT.py | py | 6,457 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "DDPG.DDPG",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "env.Environment",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.log",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "env.reset",
"line_number": 28... |
29166855011 | import numpy as np
import pyqtgraph
from pyqtgraph.Qt import QtGui
from app.misc._miss_plot import MissPlotItem
from osu_analysis import StdScoreData
class HitOffsetGraph(QtGui.QWidget):
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent)
# Main graph
self.__graph = p... | abraker-osu/osu_aim_tool | app/views/_offset_graph.py | _offset_graph.py | py | 7,745 | python | en | code | 7 | github-code | 1 | [
{
"api_name": "pyqtgraph.Qt.QtGui.QWidget",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pyqtgraph.Qt.QtGui",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "pyqtgraph.Qt.QtGui.QWidget.__init__",
"line_number": 13,
"usage_type": "call"
},
{... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.