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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
41228768427 | from django.contrib.auth.models import User, Group
from restaurant.restaurantApp.menu.models import Menu
from restaurant.restaurantApp.restaurant.models import Restaurant
from restaurant.restaurantApp.utils.seed_test_db import SeedTestDB
from rest_framework.test import APITestCase
from restaurant.test_entities import... | Karen-Avdalyan/menu-voting-assessment | tests/test_db.py | test_db.py | py | 3,215 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "rest_framework.test.APITestCase",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "restaurant.restaurantApp.utils.seed_test_db.SeedTestDB.createAll",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "restaurant.restaurantApp.utils.seed_test_db.Seed... |
17824124748 | """
IMDbID,
Title, Title_words_no, Title_length,
January, February, March, April, May, June, July, August, September, October, November, December,
Monday, Tuesday, Wednesday, Thursday Friday, Saturday, Sunday,
Runtime,
Action, Adventure, Animation, Comedy, Crime, Drama, Fantasy, Historical, Horror, Magical, Romance, Th... | alexandra-tudor/predict_movie_success | src/dataset/create_sample_dataset.py | create_sample_dataset.py | py | 4,064 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.DataFrame",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "src.db.movie_mongo.getCursor",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "time.strptime",
... |
26732075889 | from rest_framework import viewsets, filters, status
from rest_framework.response import Response
from .models import Poll, Choice, Vote
from .serializers import PollSerializer, VoteSerializer, VoteConfirmationSerializer
from django.core.mail import send_mail
from rest_framework.decorators import action
from rest_frame... | alaaamady/polls-api | api/views.py | views.py | py | 2,988 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "environ.Env",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "environ.Env.read_env",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "environ.Env",
"line... |
23808955108 | import argparse
import pathlib
import sys
import subprocess
import sounddevice as sd
from concurrent.futures.thread import ThreadPoolExecutor
import soundfile as sf
import numpy as np
import queue
import datetime
from time import sleep
import concurrent.futures
import os
assert np
import shutil
# specifies the numb... | tkuye/autolisten | autolisten.py | autolisten.py | py | 25,449 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pathlib.Path",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.now",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 47,
"usage_type": "attribute"
},
{
"api_name": "os.mkd... |
36556994224 | # -*- coding: utf-8 -*-
"""
Created on Sun Sep 16 10:19:43 2018
@author: TOSHIBA
"""
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 5 11:06:05 2018
@author: TOSHIBA
"""
"The process of training cascade learning and calculate mutual information"
#========================================================... | DorisxinDU/Information-Cascade | Synthetic datasets/Cascade structure/training_and_3_method_information.py | training_and_3_method_information.py | py | 23,409 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "tensorflow.ConfigProto",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tensorflow.Session",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "scipy.io.loadmat",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "scipy.io",... |
22852022575 |
## 例子例子
# """
# 接口返回信息:
# {code:"201",data:["2021-03-03 19:23"]}
# #显示服务器实时时间
# """
from flask import Flask, jsonify
from config.configs import AUTH_key
import time
# """
# 插件注册
def register_plugin(app):
@app.route(AUTH_key+'/uploader',methods=['GET','POST'])
def upload_file_1():
if request.method == '... | liuchangfgv/RabbitCloudPrinter | server/print_really/plugins/api_old_func_uploader.py | api_old_func_uploader.py | py | 3,284 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "time.strftime",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "time.localtime",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "config.configs.AUTH_key",
"line_number": 22,
"usage_type": "name"
}
] |
28982575705 | import os
import json
import requests
import gzip
from argparse import ArgumentParser
from datetime import datetime
from collections import defaultdict
from typing import List
from multiprocessing.pool import ThreadPool
STORAGE_API_AT = 'https://www.googleapis.com/storage/v1/b/fpga-tool-perf/o'
TESTRES_PREFIX = 'artif... | SymbiFlow/fpga-tool-perf-results | fetch_meta.py | fetch_meta.py | py | 8,502 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 55,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.strptime",
... |
24908879963 | from setuptools import setup, find_packages
install_requires = [
"redis==5.0.1",
"typing_extensions==4.8.0",
"pydantic==2.4.2",
"pydantic_core==2.10.1",
"elasticsearch==8.10.0",
"flask==3.0.0",
"flask-socketio==5.3.6",
"pytest==7.4.2",
"kazoo==2.9.0"
]
setup(
name='noauth',
... | ChrisMckerracher/noauth | setup.py | setup.py | py | 481 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "setuptools.setup",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 18,
"usage_type": "call"
}
] |
29566063519 | import re
from utils.output import ListOutput, ListOutputItem
GREP_PLUGIN_RE = re.compile('\] (.*?).grep\(uri=".*"\) took (.*?)s to run')
def get_grep_plugin_performance(scan_log_filename, scan):
scan.seek(0)
grep_plugin_times = {}
for line in scan:
match = GREP_PLUGIN_RE.search(line)
... | sravani-m/Web-Application-Security-Framework | tools/w3af/w3af/core/controllers/profiling/scan_log_analysis/data/grep_plugin_performance.py | grep_plugin_performance.py | py | 1,137 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "re.compile",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "utils.output.ListOutput",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "utils.output.ListOutputItem",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "utils.o... |
25884734045 | #!/usr/bin/env python
# _*_ coding:utf-8 _*_
# encoding=utf-8
'''
利用jieba提取高频词并生成图云
'''
import jieba
import jieba.analyse
import codecs
from wordcloud import WordCloud, STOPWORDS, ImageColorGenerator
from collections import Counter
import matplotlib.pyplot as plt
from scipy.misc import imread
def generatet_wordcloud(... | Hitchcock717/electronic_microscope_prediction | 高频词挖掘/freqword_extraction.py | freqword_extraction.py | py | 2,428 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "scipy.misc.imread",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "wordcloud.ImageColorGenerator",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "wordcloud.WordCloud",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "w... |
1222614843 | #! /usr/bin/env python
"""
@author: David Diaz Vico
@license: MIT
"""
import argparse
from sacred.observers import FileStorageObserver
from skdatasets import fetch
from skdatasets.utils.estimator import json2estimator
from skdatasets.utils.experiment import experiment
def main(
dataset=fetch, estimator=json2es... | daviddiazvico/scikit-datasets | skdatasets/tests/utils/run.py | run.py | py | 1,180 | python | en | code | 16 | github-code | 7 | [
{
"api_name": "skdatasets.fetch",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "skdatasets.utils.estimator.json2estimator",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "sacred.observers.FileStorageObserver",
"line_number": 17,
"usage_type": "call"... |
13299116977 | # Created by zhai at 2018/1/12
# Email: zsp1197@163.com
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from Tools import *
from BeeTools import *
import os
path = '/home/uftp/hubei/ori'
users_list = os.listdir(path)
has_meter=False
has_normal=False
for user in users_list:
user_path=os.path... | zsp1197/NILM_fightingMAN | readData/aggregate_and_see.py | aggregate_and_see.py | py | 1,582 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "os.listdir",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": ... |
3614221358 | import logging
logger = logging.getLogger(__name__)
import json
import zlib
from zipfile import ZipFile
import re
from production import db
from production import utils
def main():
logging.basicConfig(
level=logging.INFO,
format='%(levelname).1s %(module)10.10s:%(lineno)-4d %(message)s')
con... | Vlad-Shcherbina/icfpc2019-tbd | production/upload_tasks.py | upload_tasks.py | py | 1,995 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "production.db.... |
21441510408 |
from typing import List
# 높이를 입력받아 비 온 후 얼마나 많은 물이 쌓일 수 있는지 계산하라.
inputValue = [0,1,0,2,1,0,1,3,2,1,2,1]
# inputValue = [1,2,1,2,3,1,0,2]
# => 6
def trap(self, height: List[int]) -> int:
if not height:
return 0
volume = 0
# 인덱스
left, right = 0, len(height) - 1
# 최대 길이 = 현재 위치 길이
... | luckyhyom/algolithms | python-algorith-interview/data-structure/linear/array/trapping.py | trapping.py | py | 2,183 | python | ko | code | 0 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 33,
"usage_type": "name"
}
] |
8091118325 | from controller.reroute import reset
from spoofer.spoof import spoofed
from utils.debug import dbg, WARNING, SUCCESS, INFO
def spoofer_reset():
if len(spoofed) > 0:
dbg("Resetting routing..", WARNING)
for item in spoofed:
src = spoofed[item]['info'][0]
dest = spoofed[item]... | isecvirus/pH | spoofer/reset.py | reset.py | py | 581 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "spoofer.spoof.spoofed",
"line_number": 7,
"usage_type": "argument"
},
{
"api_name": "utils.debug.dbg",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "utils.debug.WARNING",
"line_number": 8,
"usage_type": "argument"
},
{
"api_name": "spoofe... |
40442535224 | # @title: Memory management on the device
# @author: Shaurya
from numba import vectorize
import numpy as np
from time import perf_counter
# timeit
def timeit(f):
def decorate(*args,**kwargs):
start=perf_counter()
result=f(*args,**kwargs)
end=perf_counter()
try:
print(f... | abyssnlp/numba-gpu | 3. memory_management.py | 3. memory_management.py | py | 1,580 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "time.perf_counter",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "time.perf_counter",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numba.vectorize",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
... |
12460619825 | import csv
import sys
from bs4 import BeautifulSoup
import urllib,urllib2
import geopy,geopy.distance
from optparse import OptionParser
#get_html return the html code of a given page with adresse: url
def get_html(url):
request = urllib2.Request(url)
request.add_header('User-Agent','Mozilla/4.0 (compatible;... | simoncarrignon/trieste-lens | script/getGeoLoc.py | getGeoLoc.py | py | 2,017 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "urllib2.Request",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "urllib2.urlopen",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "optparse.OptionParser",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "csv.reader",
... |
24019076326 | from django.shortcuts import render
import tensorflow as tf
from numpy import *
import base64
from PIL import Image, ImageFilter
from django.http import JsonResponse
import pandas as pd
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import Dropout
... | PJMessi/Nepali-character-recognition-application | main_app/views.py | views.py | py | 9,595 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "pandas.read_csv",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.utils.normalize",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "tens... |
20074586909 | import socket
import protocols
import json
import getopt
import sys
class Client:
MIN_PLAYERS = 1
MAX_PLAYERS = 4
MIN_STAGES = 1
MAX_STAGES = 10
NO_NAME = ""
DEFAULT_IP = '127.0.0.1'
DEFAULT_PORT = 8080
def __init__(self, number_of_players, number_of_stages, player_name, server_hostna... | admurillo/LAN-Multiplayer-game | client.py | client.py | py | 10,917 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "socket.socket",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_STREAM",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "protocols.J... |
35065547933 | import mock
import pytest
from paasta_tools import firewall_logging
@mock.patch.object(firewall_logging, "lookup_service_instance_by_ip")
def test_syslog_to_paasta_log(mock_lookup_service_instance_by_ip, mock_log):
syslog_data = fake_syslog_data("my-hostname", SRC="1.2.3.4")
mock_lookup_service_instance_by_i... | Yelp/paasta | tests/test_firewall_logging.py | test_firewall_logging.py | py | 5,282 | python | en | code | 1,652 | github-code | 7 | [
{
"api_name": "paasta_tools.firewall_logging.syslog_to_paasta_log",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "paasta_tools.firewall_logging",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "mock.call",
"line_number": 15,
"usage_type": "call"
},... |
42119365468 | from kivy.uix.screenmanager import Screen
from kivy.lang import Builder
from kivymd.app import MDApp
from kivymd.uix.toolbar import MDToolbar
from kivymd.icon_definitions import md_icons
from kivymd.uix.button import MDFillRoundFlatButton
from kivymd.uix.label import MDLabel
from kivymd.uix.textfield.textfield import ... | Rodd8/PythonProjects | app KivyMD/main.py | main.py | py | 3,273 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "kivymd.app.MDApp",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "kivy.uix.screenmanager.Screen",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "kivymd.uix.toolbar.MDToolbar",
"line_number": 50,
"usage_type": "call"
},
{
"api_n... |
72844919902 | import os
import argparse
from tqdm import tqdm
from PIL import Image
def prepreprocess(src_path, result_path, upscale_factor):
src_path_list = os.listdir(src_path)
for file_name in tqdm(src_path_list):
image = Image.open(os.path.join(src_path, file_name)).convert('RGB')
image_w, image_h = im... | Ascend/ModelZoo-PyTorch | ACL_PyTorch/contrib/cv/quality_enhancement/SRGAN/srgan_prepreprocess.py | srgan_prepreprocess.py | py | 1,311 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "os.listdir",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 11,... |
35354765921 | import streamlit as st
import time
import numpy as np
import pandas as pd
def yes_or_no_q(question):
'''질문에 대한 답을 리턴해줍니다.'''
answer = st.radio(question, ['네', '아니요'])
if answer == '네':
return 1
elif answer == '아니요':
return 0
def question(placeholder):
# 초기 설정
base_df =... | sangwookWoo/ML_project_predict_heart_disease | questions.py | questions.py | py | 9,143 | python | ko | code | 0 | github-code | 7 | [
{
"api_name": "streamlit.radio",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "streamlit.number_input",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "streamlit.numb... |
8825076700 | #The complete source code for mplwidget.py is:
# Python Qt4 bindings for GUI objects
from PyQt5 import QtGui, QtCore, QtWidgets
# import the Qt4Agg FigureCanvas object, that binds Figure to
# Qt4Agg backend. It also inherits from QWidget
import matplotlib as MPL
MPL.use("Qt5Agg")
from matplotlib.backends.backend_qt5agg... | MiRichter/OptiSim | ui/mplwidget.py | mplwidget.py | py | 4,398 | python | en | code | 13 | github-code | 7 | [
{
"api_name": "matplotlib.use",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 26,
"usage_type": "attribute"
}... |
28930830777 | import click
import json
from ranx import Run
import os
@click.command()
@click.argument("run_path")
@click.argument("testset")
def main(run_path, testset):
print("RUN???")
with open(testset) as f:
bioasq_testset ={q_data["id"]:q_data for q_data in json.load(f)["questions"] }
run = Run.from_fi... | ieeta-pt/BioASQ_11B | phaseA/second_stage/bioasq_format_converter.py | bioasq_format_converter.py | py | 1,461 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "json.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "ranx.Run.from_file",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "ranx.Run",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
"line_num... |
6414207390 | import sys
from pathlib import Path
from core import HandleFile as fileHandler
from core import TextHighlighter as txt
import core.VAM as VAM
import core.FirstSolver as firstSolver
import core.DataClasses as dataClass
def run(filePath: str):
validateFilePath = Path(filePath)
if validateFilePath.is_file():
... | banczok/PW | AiSD/IndividualProject/SolutionFinder.py | SolutionFinder.py | py | 2,363 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pathlib.Path",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "core.HandleFile.handleFile",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "core.HandleFile",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "core.TextHigh... |
40681022558 | from datetime import datetime
import cv2
import torch
import numpy as np
import time
def score_frame(frame):
"""
Takes a single frame as input, and scores the frame using yolo5 model.
:param frame: input frame in numpy/list/tuple format.
:return: Labels and Coordinates of objects detected by model in t... | TuanMaiz/Kafka_Obj_Detection | Example/single_cam.py | single_cam.py | py | 3,815 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "cv2.rectangle",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "cv2.putText",
... |
25436889248 | import json
from http.server import BaseHTTPRequestHandler, HTTPServer
class RequestHandler(BaseHTTPRequestHandler):
def _send_response(self, message):
self.send_response(200)
self.send_header('Content-type', 'text/html')
self.end_headers()
self.wfile.write(bytes(message, "utf8"))
... | Mr3ch0/info_gather | info_gather.py | info_gather.py | py | 879 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "http.server.BaseHTTPRequestHandler",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "json.loads",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "http.server.H... |
4225921825 | #!/usr/bin/env python3
import os
import json
import argparse
import subprocess as sp
# A set of category folder names in current sample viewer.
# Only run the checks when a file path is within one of these category folders.
categories = {
'analysis',
'display_information',
'editing',
'feature_layers',... | Esri/arcgis-maps-sdk-java-samples | .github/scripts/ci/readme_metadata_style_check/entry.py | entry.py | py | 4,531 | python | en | code | 103 | github-code | 7 | [
{
"api_name": "subprocess.call",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "subprocess.call",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "subprocess.call",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "json.load",
"line... |
72868309022 | import os
import os.path as osp
import logging
from collections import OrderedDict
import json
import os
NPU_CALCULATE_DEVICE = 0
if os.getenv('NPU_CALCULATE_DEVICE') and str.isdigit(os.getenv('NPU_CALCULATE_DEVICE')):
NPU_CALCULATE_DEVICE = int(os.getenv('NPU_CALCULATE_DEVICE'))
def parse(opt_path, is_train=True... | Ascend/ModelZoo-PyTorch | PyTorch/dev/cv/image_classification/AdaFM-Net_ID1101_for_PyTorch/codes/options/options.py | options.py | py | 4,714 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "os.getenv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_numb... |
71837266784 | # -*- coding: utf-8 -*-
"""
Created on Sun Mar 6 11:09:54 2022
@author: kevin
"""
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 5 11:19:31 2022
@author: kevin
"""
from pywebio.input import *
from pywebio.output import *
from pywebio.pin import *
from pywebio import start_server
import queue
fr... | kevinfu1717/AidLuxSmartAssistant | scripts/frontend.py | frontend.py | py | 1,599 | python | en | code | 4 | github-code | 7 | [
{
"api_name": "requests.post",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "header.queryUrl",
"line_number": 33,
"usage_type": "argument"
},
{
"api_name": "json.loads",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "pywebio.start_server",
... |
14206112353 | import numpy as np
from utils import IoU
'''
Compute average precision given each result of prediction and the confidence
Parameters:
prediction: a list of dictionary.
for example [{'TP':True, 'confidence':0.65}, {'TP':False, 'confidence':0.4}]
set TP to True if the pr... | Ao-Lee/AveragePrecision | ap.py | ap.py | py | 5,476 | python | en | code | 81 | github-code | 7 | [
{
"api_name": "numpy.array",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.int",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "numpy.int",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "numpy.cumsum",
"line_nu... |
34218009634 | # -*- coding: utf-8 -*-
from typing import List
from module.baseState import BaseState
from module.battleStates.stateBattle import StateBattle
from module.constant.state import State
from module.facilityStates.stateArmorShop import StateArmorShop
from module.facilityStates.stateBarbar import StateBarbar
from module.fa... | aburi6800/Python-OnyxOfBlack | source/module/stateStack.py | stateStack.py | py | 7,586 | python | ja | code | 4 | github-code | 7 | [
{
"api_name": "module.constant.state.State.TITLE",
"line_number": 51,
"usage_type": "attribute"
},
{
"api_name": "module.constant.state.State",
"line_number": 51,
"usage_type": "name"
},
{
"api_name": "module.constant.state.State.MAKECHARACTER",
"line_number": 52,
"usage_... |
43322298589 | import logging
logger = logging.getLogger('django')
from django.core.exceptions import ObjectDoesNotExist
from django.utils.decorators import method_decorator
from lxml import etree
from django_quickbooks import get_realm_session_model, get_realm_model, get_qbd_task_model
from django_quickbooks.core.session_manager ... | Naruto0829/django-quickbooks | django_quickbooks/session_manager.py | session_manager.py | py | 5,881 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "django_quickbooks.get_realm_model",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django_quickbooks.get_realm_session_model",
"line_number": 15,
"usage_type": "call"
... |
35720310076 | import pygame
class Personagem:
def __init__(self, x=0, y=0, tam=40, cor=(0, 255, 0)):
self.x = x
self.y = y
self.tam = tam
self. cor = cor
def rect(self):
return pygame.Rect(self.x, self.y, self.tam, self.tam)
def inicio():
global tela
tela = pygame.display.set... | jsbueno/cpbr12 | inicio.py | inicio.py | py | 1,638 | python | pt | code | 2 | github-code | 7 | [
{
"api_name": "pygame.Rect",
"line_number": 10,
"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.draw.r... |
5197961396 | #!/usr/bin/python3 -u
# -*- coding: utf-8 -*-
############################################################################
# lighting.py #
# (c) https://github.com/thomaspfeiffer-git/raspberry, 2017 #
###########################################... | thomaspfeiffer-git/raspberry | shelf/lighting.py | lighting.py | py | 10,987 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "sys.path.append",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "flask.Flask",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "enum.Enum",
"line_numbe... |
12453690333 | from django.contrib.auth.decorators import login_required
from django.contrib.auth import login, authenticate
from django.views.generic import CreateView
from django.contrib.auth.forms import AuthenticationForm
from django.contrib import messages
from django.shortcuts import render, redirect
from .form import User, Cus... | eizikr/EasyShop | account/views.py | views.py | py | 5,939 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "django.views.generic.CreateView",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "form.User",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "form.CustomerSignUpform",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "for... |
72156161184 | #!/usr/bin/env python
import argparse # optparse is deprecated
from itertools import islice # slicing for iterators
def word_matches(h, ref):
return sum(1 for w in h if w in ref)
def main():
parser = argparse.ArgumentParser(description='Evaluate translation hypotheses.')
parser.add_argument('-i', '--inp... | anoopsarkar/nlp-class-hw-archive | evaluator/default.py | default.py | py | 1,390 | python | en | code | 6 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "itertools.islice",
"line_number": 24,
"usage_type": "call"
}
] |
27986097489 | import pandas as pd
from binance import Client
from datetime import datetime, timedelta
from typing import List
key = "0256KLUp4O9fNv7eSq0cuj0d947WQT8vMBwNS5GzZQ7r1YFzKLqtJjlikIvNUCjr"
secret_key = "TIzrASsXyGEX8Ww3TWlac1739begTcxKZV690pSRowDvI0shEy5YdsNAXwzQYHad"
client = Client(key, secret_key)
class BinanceDownl... | ToughStyle/drl-trading-tianshou | processor/binancedownloader.py | binancedownloader.py | py | 2,230 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "binance.Client",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "pandas.concat",
"line_... |
14469683925 |
import numpy as np
import matplotlib.pyplot as plt
# 梯度下降法
def gradient_descent_method():
# 导入数据
points = np.genfromtxt('data.csv', delimiter=',')
# 模型的超参数,可以调整
# 步长
alpha = 0.0001
# 起始点
initial_w = 0
initial_b = 0
# 迭代次数
num_iter = 10
w, b, cost_list = grad_desc(poi... | w-Bro/machine_learning | line_regression/gradient_descent_method.py | gradient_descent_method.py | py | 2,496 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.genfromtxt",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "matplotlib.p... |
45382693178 |
from sklearn.linear_model import LinearRegression
from sklearn.preprocessing import PolynomialFeatures
import numpy as np
import pickle
def getOptimalNN(n_input, n_samples, n_classes = 1, classification = False, alpha = 5, n_layers = 1):
"""
source: https://stats.stackexchange.com/questions/181/how-to-choose... | inotin/mywebsite | ds/miluogo/models.py | models.py | py | 2,273 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sklearn.preprocessing.PolynomialFeatures",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.PolynomialFeatures",
"line_number": 47,
"usage_type": "call"
... |
21009157380 | import torch
from torch import nn
from torch.optim import SGD
from torch.utils.data import DataLoader, Dataset
import nni
from nni.nas.evaluator import FunctionalEvaluator
from nni.nas.evaluator.pytorch import Classification
from nni.nas.experiment import *
from nni.nas.experiment.config import *
from nni.nas.strategy... | microsoft/nni | test/ut/nas/experiment/test_experiment.py | test_experiment.py | py | 3,284 | python | en | code | 13,409 | github-code | 7 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "torch.randn",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.randint",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.utils.data.D... |
15597571397 | import sqlite3
import sys
from tabulate import tabulate
def print_data_in_rows(data, active=True):
data = list(data)
if data:
print(
"\n{active} записи:\n".format(active="Активные" if active else "Неактивные")
)
print(tabulate(data))
def get_data_by_key_value(db_name, ke... | natenka/pyneng-answers | answers/25_db/task_25_4/get_data.py | get_data.py | py | 1,738 | python | en | code | 21 | github-code | 7 | [
{
"api_name": "tabulate.tabulate",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"lin... |
31737759786 | import logging
import math
from src.election.evaluation.evaluation_protocol import EvaluationProtocol
from src.election.evaluation.simple_winner_evaluation import \
SimpleWinnerEvaluation
log = logging.getLogger(__name__)
class SeatDistributionProtocol(EvaluationProtocol):
""" Protocol for public and secret... | JulianLiedtke/ordinos | src/election/evaluation/seat_distribution.py | seat_distribution.py | py | 6,726 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "src.election.evaluation.evaluation_protocol.EvaluationProtocol",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "math.ceil",
"line_number": 66,
"usage_type": "call"
},
... |
33117183566 | import numpy as np
import tensorflow as tf
from keras.models import load_model, Model
from keras.layers import Input, Dense, Conv2D, Flatten, BatchNormalization, LeakyReLU, add
from keras.optimizers import SGD
from keras import regularizers
from code import cnn_setup
def softmax_cross_entropy_with_logits(y_true, y_... | heikoschmidle/skat-zero | code/model/residual_nn.py | residual_nn.py | py | 5,063 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "tensorflow.zeros",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "tensorflow.shape",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "tensorflow.float32",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.... |
630484025 | # Definition for a binary tree node.
from typing import List
class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
class Solution:
"""
Time complexity: O(n)
Space complexity: O(n) - as stack used holds number of e... | kalyansikdar/LeetCode | Binary Tree/BinaryTreeInorderTraversal.py | BinaryTreeInorderTraversal.py | py | 970 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 20,
"usage_type": "name"
}
] |
30397615238 | from flask import Flask, request, jsonify
import script
from script import Sentiment
import time, json, datetime, os
app = Flask(__name__)
obj = script.Sentiment()
@app.route('/')
def home():
return "Smart Bot"
@app.route('/api/smart-bot/v1', methods = ["POST"])
def getApi():
if request.method == "POST":
try:
... | 1akshat/Smart_Reply_Bot | app.py | app.py | py | 738 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "script.Sentiment",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
... |
11605834669 | from flask import Flask, request, jsonify
import re
import string
import requests
from bs4 import BeautifulSoup
from sklearn.feature_extraction.text import CountVectorizer, TfidfTransformer
import joblib
import numpy as np
app = Flask(__name__)
# load the model
clf = joblib.load('models/voting_model.pkl')
def remove... | Victoraq/FakeNewsClassification | server/project/__init__.py | __init__.py | py | 1,023 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "joblib.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask.request.get_json",
"line... |
10219029467 | import json
import requests
from utils import get_data
def get_user_id(emp_no: str) -> str:
data = get_data()
url = data.get('EMP_ID_URL')
payload = {
"command": "TY-GR-002",
"params": {
"empShortId": emp_no
}
}
headers = {
'Content-Type': 'applicatio... | lustime/somescripts | my_util.py | my_util.py | py | 782 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "utils.get_data",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "requests.request",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_numb... |
29154611816 | import torch
from torch import nn
from monai.networks.nets import SwinUNETR
from nnunetv2.utilities.plans_handling.plans_handler import PlansManager, ConfigurationManager
from nnunetv2.training.nnUNetTrainer.variants.mdl_group_variants.nnUNetTrainer_ClearML import nnUNetTrainer_ClearML
class SwinUNETR_Local(nn.Modu... | EytanKats/nnunet | nnunetv2/training/nnUNetTrainer/variants/mdl_group_variants/nnUNetTrainer_SwinUNETR.py | nnUNetTrainer_SwinUNETR.py | py | 2,860 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.nn.Module",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "monai.networks.nets.SwinUNETR",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "nnunetv2.... |
15776819490 | import numpy as np
import matplotlib.pyplot as plt
class DynamicPlot():
def __init__(self, x_data, major_grid, minor_grid):
# create plot
plt.ion()
self.ax = plt.gca()
self.line, = self.ax.plot(x_data, np.zeros(len(x_data)))
self.autoscale = True
# Enable m... | yonseimemslab/AIseminar | 머신러닝 공부/LG_current_detection/science-basement-135af4dbf964e0ba4233d69e99c3a694083fe1f4/capacitance/dynamic_plot.py | dynamic_plot.py | py | 2,366 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "matplotlib.pyplot.ion",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.gca",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib... |
7334910908 | # All rights reserved by forest fairy.
# You cannot modify or share anything without sacrifice.
# If you don't agree, keep calm and don't look at code bellow!
__author__ = "VirtualV <https://github.com/virtualvfix>"
__date__ = "12/24/2017 1:29 PM"
from config import CONFIG
from libs.core.template import NAME
from .co... | VirtualVFix/AndroidTestFramework | src/libs/cmd/implement/factory.py | factory.py | py | 6,196 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "constants.EMULATOR_SERIAL_LIST",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "exceptions.ImplementationNotFoundError",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "libs.core.template.NAME.safe_substitute",
"line_number": 31,
"usage... |
38358234312 | # encoding=utf-8
# gensim modules
from gensim import utils
from gensim.models.doc2vec import TaggedDocument
from gensim.models import Doc2Vec
from random import shuffle
import numpy
import pickle
import time
import logging
import sys
print('loading doc2vec module')
start_time = time.time()
log = ... | feizhihui/Transfer-ICD-Coding | utils/doc2vec.py | doc2vec.py | py | 2,158 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "time.time",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "logging.StreamHandler"... |
16049927122 | from .forms import PredictForm
from django.shortcuts import render,redirect
from django.http import HttpResponseRedirect
import pandas as pd
import pickle
# variabel untuk menyimpan hasil prediksi default 0
RESULT=0
def predict_list_view(request):
'''Fungsi untuk menampilkan hasil prediksi oleh Machine Learning... | artso17/olxdjangoproject | project/apps/views.py | views.py | py | 1,326 | python | id | code | 0 | github-code | 7 | [
{
"api_name": "django.shortcuts.render",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "forms.PredictForm",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "pickle.load",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "pandas.DataFram... |
14124089015 | #!/usr/bin/env python
import matplotlib.pyplot as plt
import scipy as sp
import scipy.signal as signal
from nyquist import *
from nyquist import _FftSize
from filters import *
N = 63
Q = 4
alpha = 0.5
N_fft = _FftSize(Q)
# Design nyquist filter
hh = Nyquist(N, Q, alpha)
n = sp.linspace(-sp.ceil(N/2), sp.floor(N/2), N... | fstop22/nyquist_filters | nyquist_vs_raisedcosine.py | nyquist_vs_raisedcosine.py | py | 1,943 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "nyquist._FftSize",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "scipy.linspace",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "scipy.ceil",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "scipy.floor",
"line_nu... |
74007339744 | """
Utility functions for processing data.
"""
import os
import h5py
import numpy as np
import math
import glob
from time import strftime, gmtime
def list_files():
filepath = os.path.join("data")
files = glob.glob(os.path.join(filepath, "*.hdf5"))
files = sorted(files, key=lambda f: os.stat(f).st_mtime)
... | tmigimatsu/robotic-priors | python/data.py | data.py | py | 9,821 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "glob.glob",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number":... |
22042340735 | #coding=utf8
import sqlite3
# 若无该数据库, 则创建Sqlite数据库并打开
# 若有, 则直接打开数据库
conn = sqlite3.connect('test.db')
# 获取该数据库的游标
cursor = conn.cursor()
# 执行一条SQL语句, 创建user表:
cursor.execute('CREATE TABLE User (ID INTEGER Primary KEY, Name TEXT, Age INTEGER)')
# 关闭Cursor:
cursor.close()
# 提交事务:
conn.commit()
# 关闭Connection:
con... | adan-shaw/debugging_cpp | AI人工智能/cpython基础/pydb数据库/sqlite/CreateDatabase.py | CreateDatabase.py | py | 432 | python | zh | code | 2 | github-code | 7 | [
{
"api_name": "sqlite3.connect",
"line_number": 7,
"usage_type": "call"
}
] |
29893119099 | import requests
def main():
for i in range(100000, 1000000):
try :
r = requests.get("https://wsdc.nitw.ac.in/student/assets/upload/thumbs/{}.jpg".format(i))
if 'html' in r.headers['content-type'] :
raise Exception('Roll Number Doesn\'t exist')
print("=> D... | dhruvramani/NITW-Facemash | src/downloader.py | downloader.py | py | 621 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 6,
"usage_type": "call"
}
] |
6657157283 | from pathlib import Path
import sys
import cv2
import depthai as dai
import numpy as np
# 首先获取模型
mobilenet_path = str((Path(__file__).parent / Path('models/mobilenet.blob')).resolve().absolute())
if len(sys.argv) > 1:
mobilenet_path = sys.argv[1]
# 开始定义管道
pipeline = dai.Pipeline()
# 创建左右灰度相机流
left = pipeline.cr... | househear/cmpt001 | 3_19.py | 3_19.py | py | 6,083 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "pathlib.Path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "depthai.Pipeline",
"line_n... |
71548738145 | import glm
from OpenGL.GL import *
class Camera:
def __init__(self, xmin=-1, xmax=1, ymin=-1, ymax=1):
self.xmin = xmin
self.xmax = xmax
self.ymin = ymin
self.ymax = ymax
def GetProjMatrix (self):
vp = glGetInteger(GL_VIEWPORT)
w = vp[2]
h = vp[3]
dx = self.xmax - self.xmin
dy ... | ArthurMograbi/proj1compgraf | camera.py | camera.py | py | 756 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "glm.ortho",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "glm.mat4",
"line_number": 32,
"usage_type": "call"
}
] |
5822611675 | import pprint
import execjs
import requests
url = 'https://vipapi.qimingpian.cn/DataList/productListVip'
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36'
}
data1 = {
'time_interval': '',
'tag': '',
'tag_type': '... | xiaoxu123195/Reptile_Collection | 逆向/企名科技/call.py | call.py | py | 808 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.post",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "execjs.compile",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pprint.pprint",
"line_number": 34,
"usage_type": "call"
}
] |
6258125370 | """"
Building a Text Classification System using TextBlob
https://textblob.readthedocs.io/en/dev/classifiers.html
"""
from textblob.classifiers import NaiveBayesClassifier
class PosOrNeg:
def __init__(self):
self.train = [
('y', 'pos'),
('yes','pos'),
('yea','po... | chantallexandra/questionbot | server/utilities/yes_no_trainer.py | yes_no_trainer.py | py | 1,660 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "textblob.classifiers.NaiveBayesClassifier",
"line_number": 41,
"usage_type": "call"
}
] |
24190044658 | import re
import argparse
from sys import argv
from datetime import datetime, timedelta
from subprocess import Popen, PIPE
import tkinter as tk
from tkinter import messagebox as mbox
from venv import create
import validators
from typing import Any, Tuple, Dict, Union
import logging
from pathlib impor... | haganenoneko/VTuberClippingResources | scripts/download.py | download.py | py | 10,632 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "pathlib.Path.cwd",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "logging.basicConfig",
... |
20465707433 | from Managers import HeaderManager, MongoManager, ProxyManager
from Config import Config
import requests
from requests.exceptions import RequestException
from pyquery import PyQuery as pq
import urllib3
from urllib3.exceptions import InsecureRequestWarning
import re
import datetime
import time
import json
class Sched... | Mustafa974/DataWarehouse | MovieSpiderLite-hlt/Scheduler.py | Scheduler.py | py | 34,621 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "Managers.MongoManager.DBManager",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "Managers.MongoManager",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "Managers.ProxyManager.Proxy",
"line_number": 26,
"usage_type": "call"
},
{
... |
21389544990 | import re
from typing import Literal
import sqlalchemy as sa
from accounting import db
from accounting.models import Account, JournalEntryLineItem
from accounting.utils.options import options, Recurring
class DescriptionAccount:
"""An account for a description tag."""
def __init__(self, account: Account, f... | imacat/mia-accounting | src/accounting/journal_entry/utils/description_editor.py | description_editor.py | py | 12,367 | python | en | code | 7 | github-code | 7 | [
{
"api_name": "accounting.models.Account",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "accounting.models.Account",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "accounting.models.Account",
"line_number": 78,
"usage_type": "name"
},
{
"api... |
73509330464 | """
Basic parser for mls standings/schedule
6 September 2015
V 1.1a
"""
import sys
import urllib.request
import datetime
sys.path.append('/beautifulsoup4-4.1.0')
from bs4 import BeautifulSoup
# opens the url and parses it into beautifulsoup
def ParseStandingsData(website):
# feed it the url
url = urllib.request.... | alex-daniels/Standings-Web-Scraper | scraper1_0.py | scraper1_0.py | py | 7,023 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.path.append",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "urllib.request.request.urlopen",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "urllib.r... |
1079143838 | # coding=utf-8
from json import dumps
from django.core.serializers.json import DjangoJSONEncoder
# Constantes Errores
ERROR_LOGIN_REQUERIDO = 'ERROR_LOGIN_REQUERIDO'
ERROR_LOGOUT_FALLIDO = 'ERROR_LOGOUT_FALLIDO'
ERROR_NO_TIENE_PERMISOS = 'ERROR_NO_TIENE_PERMISOS'
ERROR_DE_SISTEMA = 'ERROR_DE_SISTEMA'
ERROR_METODO_IN... | facundocianciop/Proyecto-Final | backend/proyectoRiego/riegoInteligente/views/supportClases/error_handler.py | error_handler.py | py | 11,488 | python | es | code | 0 | github-code | 7 | [
{
"api_name": "json.dumps",
"line_number": 183,
"usage_type": "call"
},
{
"api_name": "django.core.serializers.json.DjangoJSONEncoder",
"line_number": 183,
"usage_type": "name"
}
] |
41050862589 | from common.model_manager.payment_manager import PaymentManager
from common.model_manager.utils import get_amount
from common.msg_service.wechat_msg_send import MerchantMessageSender
from common.voice_synthesis.baidu import get_baidu_token
from ws_service.utils import PublishToRedisChannel
def send_pay_success_wechat... | yiyuhao/FukuanUnion | payserver/merchant/utils.py | utils.py | py | 1,226 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "common.model_manager.payment_manager.PaymentManager",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "common.msg_service.wechat_msg_send.MerchantMessageSender",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "common.model_manager.utils.get_amoun... |
3981998156 | import numpy as np
import random
import pandas as pd
import torch
import nengo
from scipy.stats import entropy, skew, kurtosis, normaltest
def get_state(player, game, agent, dim=0, turn_basis=None, coin_basis=None, turn_exp=None, coin_exp=None, representation="one-hot"):
t = len(game.investor_give) if player=='invest... | psipeter/trust-game | utils.py | utils.py | py | 3,167 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "numpy.zeros",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.FloatTensor",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.FloatTensor",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"li... |
7148066194 | import pygame
import sys
# Initialize Pygame and create a window
pygame.init()
screen_width, screen_height = 600, 500
screen = pygame.display.set_mode((screen_width, screen_height))
pygame.display.set_caption("Mario")
# Load the images of Mario running
plyer_image = [pygame.image.load('Bilder/oben.png').convert_alpha... | fwelpo3/Game-Project | Start/Pygame.py | Pygame.py | py | 5,296 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pygame.init",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.s... |
40823164843 | import numpy as np
from scipy.spatial import Delaunay
from scipy.spatial import Voronoi
import math
from itertools import compress
from matplotlib.patches import Polygon
from matplotlib.collections import PatchCollection
import matplotlib.pyplot as plt
from matplotlib import cm
number_of_points = 1000
area_... | arian-arab/Voronoi_Clustering_Python | voronoi_clustering.py | voronoi_clustering.py | py | 5,702 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "numpy.abs",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.dot",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.roll",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "scipy.spatial.Delaunay",
"line_num... |
40540800840 | # -*- coding: utf-8 -*-
from __future__ import division
from annotation.models import Document, Label, Score
from annotation.models import NBC_class_count, NBC_word_count_given_class, NBC_vocabulary
from django.db.models import F, FloatField, Sum, IntegerField
from nltk import word_tokenize
from math import log, exp
... | eugenso/annotationApp | annotation/classifier.py | classifier.py | py | 7,613 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "annotation.models.NBC_class_count.objects.get_or_create",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "annotation.models.NBC_class_count.objects",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "annotation.models.NBC_class_count",
"l... |
40310127954 | # -*- coding: utf-8 -*-
import string, time, subprocess
from flask import request
from datetime import datetime
from library.common import Common
from configparser import ConfigParser
from library.config_parser import configSectionParser
class VesselVPN(Common):
# INITIALIZE
def __init__(self):... | gbf-labs/rh-vessel-vpn-api | controllers/ovpn/vessel_vpn.py | vessel_vpn.py | py | 3,386 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "library.common.Common",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "configparser.ConfigParser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "library.config_parser.configSectionParser",
"line_number": 21,
"usage_type": "call"
},
... |
38841073227 | import asyncio
import datetime
import discord
from discord.ext import commands, tasks
from ee250_final.user import User
import io
import json
import logging
import os
import paho.mqtt.client as mqtt
from PIL import Image
import schedule
import threading
import time
logging.basicConfig(level=logging.INFO)
class Comma... | emilyxzhou/catana | ee250_final/discord_pub.py | discord_pub.py | py | 5,310 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "logging.basicConfig",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands.Cog",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "d... |
12350050161 | from django.contrib import admin
from django.urls import path
from messagesApi import views
urlpatterns = [
path("admin/", admin.site.urls),
path('',views.api),
path("login/", views.loginUser,name='login'),
path("logout/", views.logoutUser),
path("getusers/",views.getAllUsers),
path("getMessage... | eyalbi/MessagesApi | messagesApi/urls.py | urls.py | py | 549 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "dja... |
40263671656 | import os
import json
from tqdm import tqdm,trange
from udicOpenData.stopwords import *
import numpy as np
def getContent(allFileList):
content_list = []
for files in tqdm(allFileList):
with open(path + files,"r",encoding='UTF-8') as f:
jf = json.load(f)
articles_list = jf['ar... | seanbbear/SocialNetwork_Assignment | hw5/get_content.py | get_content.py | py | 1,488 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "tqdm.tqdm",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 39,
... |
35010421854 | from django.conf.urls import url
from . import views
urlpatterns = [
# Main project workflow urls
url(r'^project/create$',
views.ProjectViewSet.as_view({'post': 'create'}),
name='project-create',
),
url(r'^project/list$',
views.ProjectViewSet.as_view({'get': 'list'}),
... | DanielKalinin/galamart_tracker_django | project_manager/urls.py | urls.py | py | 3,054 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.... |
41497655303 | from http import HTTPStatus
from flask import abort, flash, redirect, render_template
from . import app
from .error_handlers import ModelValidationError
from .forms import URLMapForm
from .models import URLMap
@app.route('/', methods=['GET', 'POST'])
def index_view():
form = URLMapForm()
if not form.validat... | yonvik/yacut | yacut/views.py | views.py | py | 1,074 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "forms.URLMapForm",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "models.URLMap.create_on_validation",
"line_number": 19,
"usage_type": "call"
},
{
"api_nam... |
73213269344 | import os
import sys
from PyQt5 import QtWidgets, QtGui
class RenameFilesWindow(QtWidgets.QMainWindow):
def __init__(self):
super().__init__()
self.setWindowTitle('Bulk File Rename Tool')
self.setGeometry(100, 100, 500, 300)
self.initUI()
def initUI(self):
... | Hotmansifu/Bulk-Rename-Tool | main.py | main.py | py | 2,721 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QLabel",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": ... |
26850785680 | """
Run from project root as
nohup pipenv run python -m hathitrust_loader.batch dev &
Where dev is environment name (like GOLDEN_KEY in Bookshare)
"""
import logging
import csv
import sys
import os
from hathitrust_shared import metadata, metadata_constants, record_handling, config
BATCH_SIZE = 100
FILE_NAME = 'data_... | uvalib/emma-index | emma-metadata-scanners/hathitrust_loader/batch.py | batch.py | py | 2,247 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.argv",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number... |
23059596513 | from scrapy import Spider
from core.db_utils import create_db_objects
from core.utils import (get_list_of_products, get_pagination, get_price,
get_random_user_agent)
from db.connect import get_session
from db.tables import stroyudacha_products
from scrapy import Request
from scrapy.http.response... | xodiumx/parser | src/crawls/services/stroyudacha_base.py | stroyudacha_base.py | py | 5,718 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "scrapy.Spider",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "db.connect.get_session",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "scrapy.http.response.html.HtmlResponse",
"line_number": 30,
"usage_type": "name"
},
{
"api_n... |
33480804315 | import math
import urllib.request
import os
import glob
import subprocess
import shutil
from tile_convert import bbox_to_xyz, tile_edges
from osgeo import gdal
import sys
import time
def create_dir(dir_path):
if not os.path.exists(dir_path):
os.makedirs(dir_path)
print("Done")
#updated
def download_tile(x, ... | JKKoffi/housing_density_calculation | download_satellite_images/OSM-tiles-downloader/tiles_to_tiff.py | tiles_to_tiff.py | py | 3,151 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.path.exists",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "urllib.request.request.urlret... |
13784968785 | # -*- coding: utf-8 -*-
"""
Created on Thu Sep 22 20:59:39 2016
"""
import file_reader;
import preprocessor;
import tokenizer;
import probability_calculator;
import perplexity;
input_path_is_correct = 0;
#n_gram = int( input("\n\nEnter n for n-gram: "));
n_gram = 2;
all_folders_to_train = ["atheism","autos","graphi... | Poojaravishankar10/Projects | Ngram/NLP_assignment_1_code_part2 2/topic_classification.py | topic_classification.py | py | 5,352 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "file_reader.list_all_text_files",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "file_reader.read_file",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "preprocessor.preprocess",
"line_number": 47,
"usage_type": "call"
},
{
"api... |
13142852339 | from tkinter import*
from tkinter import ttk
from tkinter import filedialog
from tkinter import messagebox
from pygame import mixer
import thinkdsp
import thinkplot
import numpy as np
from scipy.interpolate import interp1d
import matplotlib.pyplot as plt
from scipy.fftpack import fft
from scipy.io import wavfile
from... | Shabdha/ProfanityReplacement | Shabdha_gui_v1.py | Shabdha_gui_v1.py | py | 5,761 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "pygame.mixer.init",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pygame.mixer",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "tkinter.filedialog.askopenfilename",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "tki... |
20511883977 | '''
Use S3Hook to list keys in the S3 bucket.
Check if the keyname datetime is current to make sure new file arrives on time.
'''
from airflow import DAG
from airflow.operators.bash import BashOperator
from airflow.sensors.s3_key_sensor import S3KeySensor
from airflow.hooks.S3_hook import S3Hook
from datetime import d... | SimonFans/Airflow | S3Hook_UseCase.py | S3Hook_UseCase.py | py | 3,904 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "datetime.datetime",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "airflow.DAG",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.no... |
18915909666 | import json
import re
from sos.report.plugins import Plugin, IndependentPlugin, PluginOpt
class Process(Plugin, IndependentPlugin):
short_desc = 'process information'
plugin_name = 'process'
profiles = ('system',)
option_list = [
PluginOpt('lsof', default=True, desc='collect info on all op... | sosreport/sos | sos/report/plugins/process.py | process.py | py | 3,873 | python | en | code | 470 | github-code | 7 | [
{
"api_name": "sos.report.plugins.Plugin",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "sos.report.plugins.IndependentPlugin",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "sos.report.plugins.PluginOpt",
"line_number": 15,
"usage_type": "call"
},
... |
6553971718 | ##
##
import attr
import os
CLOUD_KEY = "gcp"
def get_auth_directory():
return os.path.join(os.environ['HOME'], '.config', 'gcloud')
def get_default_credentials():
if 'GOOGLE_APPLICATION_CREDENTIALS' in os.environ:
return os.environ.get('GOOGLE_APPLICATION_CREDENTIALS')
else:
return os... | mminichino/couch-formation-core | couchformation/gcp/driver/constants.py | constants.py | py | 2,992 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.path.join",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_numb... |
33601477772 | from rest_framework import permissions
class UpdateOwnProfile(permissions.BasePermission):
"""" Allow user to edit their own profile """
def has_object_permission(self, request, view, obj):
if request.method in permissions.SAFE_METHODS :
# print(obj.id ,"idddddddddddddddddddddd////////")
... | mohamed493/profile-rest-api | profiles_api/permissions.py | permissions.py | py | 960 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "rest_framework.permissions.BasePermission",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.permissions",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "rest_framework.permissions.SAFE_METHODS",
"line_number": 7,
"usag... |
8563175761 | from django.shortcuts import render
from .models import *
from light_monitoring.graphGenerator import *
from .API import emissionsCalc, energyPrices
from .forms import SettingsForm
from django.views.generic import TemplateView
from django.http import HttpResponseRedirect
from django.urls import reverse
def filament(re... | kinghos/Filament | Filament/light_monitoring/views.py | views.py | py | 5,838 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "API.energyPrices.getEnergyCosts",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "API.energyPrices",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "API.emissionsCalc.getEmissionsRate",
"line_number": 28,
"usage_type": "call"
},
{
... |
13165356782 | #!/usr/bin/env python
"""
This script reads the apt cache and writes in-toto material provenance
to stdout in JSON format or argv[1] when provided.
"""
from __future__ import print_function
import apt.cache
import json
import sys
cache = apt.cache.Cache()
in_toto_data = list()
for pkg_name in cache.keys():
pkg ... | PowerDNS/pdns-builder | helpers/generate-deb-provenance.py | generate-deb-provenance.py | py | 1,084 | python | en | code | 15 | github-code | 7 | [
{
"api_name": "apt.cache.cache.Cache",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "apt.cache.cache",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "apt.cache",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "sys.argv",
"... |
70433909023 | import csv
import datetime
import itertools
import json
import os
import optparse
import urllib.request
TESTING = True
DEFAULT_DATE = (datetime.date.today() - datetime.timedelta(days=2)).isoformat()
def get_stations(filename='stations.txt'):
with open(filename, 'r') as f:
stations = json.load(f)
re... | jamesp/rainfall-data | src/rainfall.py | rainfall.py | py | 5,279 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "datetime.date.today",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "datetime.timedelta",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "json.load",... |
86345094782 | import trimesh
from pytorch3d.renderer import (
BlendParams, blending, look_at_view_transform, FoVOrthographicCameras,
PointLights, RasterizationSettings, PointsRasterizationSettings,
PointsRenderer, AlphaCompositor, PointsRasterizer, MeshRenderer,
MeshRasterizer, SoftPhongShader, SoftSilhouetteShader, ... | TingtingLiao/CAR | lib/common/render.py | render.py | py | 13,932 | python | en | code | 87 | github-code | 7 | [
{
"api_name": "torch.nn",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "pytorch3d.renderer.BlendParams",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pytorch3d.renderer.blending.softmax_rgb_blend",
"line_number": 34,
"usage_type": "call"
},... |
41662337097 | ## -*- coding: utf8 -*-
#!/usr/bin/python
# 日志类.
import logging
logging.basicConfig(level = logging.INFO)
import midmif_supporter
import gis_supporter
import grid_supporter
import const_param as cp
import map_matching_supporter as mm
import highway_map as hhm
import math
# 操作的主文件.
# # test main (20171205)
# 读取输... | redrockhorse/python | palmgo3.5/smart_highway/main_func.py | main_func.py | py | 3,620 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "logging.basicConfig",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "highway_map.map_obj",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "const_param.i... |
10752031450 | import logging
from time import time_ns
import requests
from app.bootstrap import Bootstrap, bootstrap
from app.config import settings
from app.controllers import main_router
from app.schemas import StatefunTimeCreateRequest
from fastapi import FastAPI
logger = logging.getLogger()
app = FastAPI()
app.include_router(... | mdaffad/benchmark-springhead | app_statefun/app/main.py | main.py | py | 1,529 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "app.bootstrap",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "fastapi.FastAPI",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "app.bootstrap.include... |
71032435424 | import os
from datetime import timedelta
from .core import DEBUG, INSTALLED_APPS, MIDDLEWARE, SECRET_KEY
# Celery
if 'BROKER_URL' in os.environ or 'REDIS_CONNECTION' in os.environ:
CELERY_BROKER_URL = BROKER_URL = os.environ.get('BROKER_URL', os.environ.get("REDIS_CONNECTION") + "1")
CELERY_RETRY_TIMEOUT = i... | bogdandm/tests_online | tests_online/tests_online/settings/tools.py | tools.py | py | 2,697 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.environ",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"lin... |
16772294491 | from rest_framework import generics, mixins, status, viewsets
from rest_framework.exceptions import NotFound
from rest_framework.permissions import (
AllowAny, IsAuthenticated, IsAuthenticatedOrReadOnly, IsAdminUser
)
from rest_framework.response import Response
from rest_framework.views import APIView
from .model... | raulojeda22/data-structures-django-react | backend/structure/apps/algorithms/views.py | views.py | py | 5,492 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "rest_framework.viewsets.ModelViewSet",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.viewsets",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "models.Algorithm.objects.all",
"line_number": 15,
"usage_type": "call"
... |
73213223904 | import requests
import sys
import base64
import json
import os
def encode_image(image_url):
with open(image_url, "rb") as image_file:
return base64.b64encode(image_file.read()).decode("utf-8")
def main():
if len(sys.argv) is not 2:
print("Insufficient Arguments")
return
API_KEY... | holtskinner/NeuralNetworks | google.py | google.py | py | 1,345 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "base64.b64encode",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_n... |
15008052609 | from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib import messages
from django.shortcuts import render, redirect
from django.core.cache import cache
from django.views import View
from math_exercises.exercises import *
from math_exercises.forms import *
from sitepanel.models import Kids
clas... | MichalSiwak/KidsMath | math_exercises/views.py | views.py | py | 4,371 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.views.View",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.shortcuts.render",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "d... |
5671027636 | """This module provides all classes that manipulate the database for received events
It provides methods to insert/delete/update columns on the database depending on
which event was received by the `update` method on `WebhookDataWriter` and passed to
`update` on `DataProcessor`.
"""
import sqlalchemy
from sqlalchemy.... | mconf/mconf-aggr | mconf_aggr/webhook/database_handler.py | database_handler.py | py | 45,499 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "mconf_aggr.webhook.database.DatabaseConnector.get_session_scope",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "mconf_aggr.webhook.database.DatabaseConnector",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "mconf_aggr.logger.get_logger",
... |
8755249679 | from utils.download_utils import maybe_download
import pandas as pd
COL_USER = "UserId"
COL_ITEM = "MovieId"
COL_RATING = "Rating"
COL_PREDICTION = "Rating"
COL_TIMESTAMP = "Timestamp"
def main(opt):
filepath = maybe_download(opt.data_url, opt.data_path)
data = pd.read_csv(filepath, sep="\t", names=[COL_USER, ... | weigelb1988/recommenders | src/data/download/download.py | download.py | py | 635 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "utils.download_utils.maybe_download",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 11,
"usage_type": "call"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.