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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
31551435271 | import numpy as np
import yaml
import matplotlib.pyplot as plt
file = 'D:/Projects/PhaseTransistor/Data/Simulation/Phonon/4_D3BJ_FD_vdw/phonon/eigenvectors/band.yaml'
def ReadPhonopyData(band_yaml):
with open(band_yaml) as f:
data = yaml.load(f, Loader=yaml.FullLoader)
return data
def Rear... | MajestyV/VASPWheels | GetVibrationalDisplacement.py | GetVibrationalDisplacement.py | py | 1,160 | python | en | code | 5 | github-code | 1 | [
{
"api_name": "yaml.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "yaml.FullLoader",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_numb... |
74718384033 | import datetime
import queue
import logging
import signal
import time
import threading
import tkinter as tk
from tkinter.scrolledtext import ScrolledText
from tkinter import ttk, VERTICAL, HORIZONTAL, N, S, E, W
logger = logging.getLogger(__name__)
class Clock(threading.Thread):
"""Class to display the time eve... | beenje/tkinter-logging-text-widget | main.py | main.py | py | 6,751 | python | en | code | 52 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "threading.Event",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "datetime.date... |
2325246930 | import os
import shutil
from flask import request, jsonify
from flask_restful import Resource
from flask_uploads import UploadNotAllowed
from db import db
from libs import image_helper
from models.category import CategoryModel
from models.subcategory import SubCategoryModel
from models.provider import ProviderModel, ... | Emir99/city-service | resources/provider.py | provider.py | py | 9,338 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "schemas.provider.ProviderSchema",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "schemas.provider.ProviderSchema",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "schemas.provider.ProviderLanguageSchema",
"line_number": 18,
"usage_type"... |
15026539313 | import pyrealsense2 as rs
# Import Numpy for easy array manipulation
import numpy as np
# Import OpenCV for easy image rendering
import cv2
# Create a pipeline
pipeline = rs.pipeline()
# Create a config and configure the pipeline to stream
# different resolutions of color and depth streams
config = rs.config()
# Ge... | bub3690/greencamp_vision | realsense/depth_color_align.py | depth_color_align.py | py | 3,833 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "pyrealsense2.pipeline",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pyrealsense2.config",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pyrealsense2.pipeline_wrapper",
"line_number": 15,
"usage_type": "call"
},
{
"api_name":... |
32017383453 | """Base Template For the API"""
import cherrypy
from api.base import APIBase
from libs.scraper import Scraper
@cherrypy.expose
class APIScraperSearchMovie(APIBase):
"""Base Template For the API"""
def GET(self, **kwargs) -> str:
"""POST Function"""
if "name" not in kwargs:
retur... | GaryTheBrown/Tackem | api/scraper/search_movie.py | search_movie.py | py | 762 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "api.base.APIBase",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "libs.scraper.Scraper.search_for_movie",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "libs.scraper.Scraper",
"line_number": 24,
"usage_type": "name"
},
{
"api_na... |
12340533789 | from flask import Blueprint, request, url_for, jsonify
from PIL import Image
from delete_processed_images.views import delete_images
import numpy as np
gray_to_binary = Blueprint('gray_to_binary', __name__, template_folder='templates')
@gray_to_binary.route('/gray_to_binary', methods=['GET', 'POST'])
def im2bw():
... | Narcissimillus/appweb-edimg | gray_to_binary/views.py | views.py | py | 1,469 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Blueprint",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "delete_process... |
36286082579 | # Impordime vajalikud moodulid
import pygame
import sys
pygame.init() # alustame pygame mooduli
# Seadistame värvid
red = [255, 0, 0]
green = [0, 255, 0]
blue = [0, 0, 255]
pink = [255, 153, 255]
lGreen = [153, 255, 153]
lBlue = [153, 204, 255]
# Seadistame ekraani seaded
screenX = 640
screenY = 480
... | TorrenTamm/Tarkvaraarenduse-projekt | Tamm_yl5/Tamm_yl5.py | Tamm_yl5.py | py | 2,548 | python | et | code | 0 | github-code | 1 | [
{
"api_name": "pygame.init",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "pygame.display... |
73725948512 | import requests, dateutil.parser
from bs4 import BeautifulSoup
from datetime import datetime
#send email function
def sendEmail(title):
requests.post(
"https://api.eu.mailgun.net/v3/YOUR-DOMAIN/messages",
auth=("api", "YOUR-API-KEY"),
data={"from": "YOUR-NAME <YOUR-EMAIL-ADDRESS>",
"to": [... | adamxszabo/eloqua-announcements | eloqua-announcements.py | eloqua-announcements.py | py | 1,480 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.post",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "dateutil.parser.parser.pa... |
72263104354 |
import sys
import pygame
import keyboard
from pygame.locals import *
from time import sleep
pygame.init()
deadband = 0.1
keepPlaying = True
print("example4")
# pygame.init()
pygame.display.set_caption('game base')
screen = pygame.display.set_mode((500, 500), 0, 32)
clock = pygame.time.Clock()
#
# pygame.joystick.... | Aragon-Robotics-Team/test-materov-2021 | GUI/joystick.py | joystick.py | py | 5,378 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pygame.init",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_caption",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "pygame.dis... |
19773722015 | import logging
import os
import sys
from abc import ABC
from typing import TextIO
from kivy import metrics
from kivy.app import App
from kivy.base import EventLoop
from kivy.config import Config
from kivy.core.window import Window
from kivy.lang import Builder
from kivy.metrics import dp
from kivy.resources import res... | n2qzshce/ham-radio-sync | src/ui/app_window.py | app_window.py | py | 16,444 | python | en | code | 9 | github-code | 1 | [
{
"api_name": "kivy.config.Config.set",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "kivy.config.Config",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "kivy.uix.textinput.TextInput",
"line_number": 31,
"usage_type": "name"
},
{
"api_name":... |
39354409559 | from sqlalchemy import func, desc, select, and_, distinct
from module_7.myconf.models import Grade, Teacher, Student, Group, Subject
from module_7.myconf.db import session
def select_01():
result = (
session.query(
Student.id,
Student.fullname,
func.round(func.avg(Grad... | KarinaNester/GoIT_homework_ | module_7/hw/query.py | query.py | py | 2,476 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "module_7.myconf.models.Grade",
"line_number": 14,
"usage_type": "argument"
},
{
"api_name": "module_7.myconf.models.Student",
"line_number": 13,
"usage_type": "argument"
},
{
"api_name": "module_7.myconf.db.session.query",
"line_number": 9,
"usage_type": "c... |
10576811082 | import json
from flask import Flask,render_template,request
import gspread
from oauth2client.service_account import ServiceAccountCredentials
import requests
app = Flask(__name__)
url = "https://devapi.endato.com/PersonSearch"
scope = ['https://www.googleapis.com/auth/spreadsheets',
'https://www.googleapis.co... | arunthakur007/Flask_Api | main.py | main.py | py | 3,450 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "oauth2client.service_account.ServiceAccountCredentials.from_json_keyfile_name",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "oauth2client.service_account.ServiceAccountCredentials",... |
29728137134 | """
This creates Figure 2.
"""
import numpy as np
from statsmodels.multivariate.pca import PCA
from .common import subplotLabel, getSetup
from ..tensor import perform_CMTF, calcR2X, tensor_degFreedom
from ..dataImport import createCube
from ..impute import flatten_to_mat
from matplotlib.ticker import ScalarFormatter
... | meyer-lab/systemsSerology | syserol/figures/figure2.py | figure2.py | py | 2,785 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "common.getSetup",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_numb... |
13094457575 | import torch
import torch.nn as nn
def calc_iou(a, b):
area = (b[:, 2] - b[:, 0]) * (b[:, 3] - b[:, 1])
iw = torch.min(torch.unsqueeze(a[:, 3], dim=1), b[:, 2]) - torch.max(torch.unsqueeze(a[:, 1], 1), b[:, 0])
ih = torch.min(torch.unsqueeze(a[:, 2], dim=1), b[:, 3]) - torch.max(torch.unsqueeze(a[:, 0], 1)... | sugarocket/object-detection-retinanet | nets/retinanet_training.py | retinanet_training.py | py | 10,231 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "torch.min",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "torch.unsqueeze",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "torch.max",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "torch.min",
"line_number": 7,
... |
15885760206 | from typing import Dict, Optional
import torch
import torch.nn as nn
from vc_tts_template.fastspeech2.fastspeech2 import FastSpeech2
from vc_tts_template.fastspeech2wContexts.context_encoder import ConversationalContextEncoder
from vc_tts_template.fastspeech2wContexts.prosody_model import PEProsodyEncoder
from vc_tts... | YutoNishimura-v2/vc_tts_template | vc_tts_template/fastspeech2wContexts/fastspeech2wContextswPEProsody.py | fastspeech2wContextswPEProsody.py | py | 12,920 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "vc_tts_template.fastspeech2.fastspeech2.FastSpeech2",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 45,
"usage_type": "name"
},
{
... |
73599315234 | import os
import shutil
import unittest
import uuid
import pyodbc
from ..pyodbc_helpers import *
class Test_pyodbc(unittest.TestCase):
@classmethod
def setUpClass(cls):
shutil.rmtree(cls.fix_tmproot())
@staticmethod
def fix_tmproot():
return os.path.realpath(os.path.j... | ivangeorgiev/gems | legacy/src/pyodbc_helpers/tests/test_pyodbc.py | test_pyodbc.py | py | 1,803 | python | en | code | 14 | github-code | 1 | [
{
"api_name": "unittest.TestCase",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "shutil.rmtree",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.realpath",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"l... |
9639292454 | import base64
import json
import rsa
import sympy
from fastapi import APIRouter, Depends, HTTPException, WebSocket, Header
from sqlalchemy import select
from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy.orm import joinedload
from starlette import status
from starlette.responses import Response
from starl... | coplant/di-secured-chat | src/chat/router.py | router.py | py | 14,181 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "src.chat.schemas.RequestSchema",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "src.auth.models.User",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": ... |
5269804326 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^$question_one/$', views.question_one, name='question_one'),
url(r'^question_two/$',views.question_two, name='question_two'),
url(r'^question_three/$', views.question_three, name = 'question_three'),
... | blondiebytes/Learn-It-Girl-Project | TravelMetrics/mysite/travelmetrics/urls.py | urls.py | py | 321 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.co... |
31265768032 | #!/usr/bin/env python
import os, sys
import argparse
import toml
import asteval
from collections import namedtuple
import math
import numpy as np
import lmfit
from scipy.linalg import norm
import h5py
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plot
from pbpl import common
from pbpl import compt... | ucla-pbpl/pbpl-compton | pbpl/compton/calc_energy_scale.py | calc_energy_scale.py | py | 4,897 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "matplotlib.use",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "argparse.RawDescriptionHelpFormatter",
"line_number": 23,
"usage_type": "attribute"
},
{
"... |
9658243428 | # -*- coding: utf-8 -*-
import os
import telebot
import time
import random
import threading
from emoji import emojize
from telebot import types
from pymongo import MongoClient
import traceback
token = os.environ['TELEGRAM_TOKEN']
bot = telebot.TeleBot(token)
client=MongoClient(os.environ['database'])
db=client.futur... | egor5q/futuremessages | bot.py | bot.py | py | 5,881 | python | ru | code | 0 | github-code | 1 | [
{
"api_name": "os.environ",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "telebot.TeleBot",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.environ",
... |
6202228261 | from django.conf.urls import url
from django.urls import path,include
from blog import views
urlpatterns =[
url(r'^about/$',views.AboutView.as_view(),name = "about"),
url(r'^$',views.PostListView.as_view(), name ="post_list"),
url(r'^posts/(?P<pk>\d+)$', views.PostDetailView.as_view(),name = "post_detail")... | AttalaKheireddine/bloggo | bloggo/blog/urls.py | urls.py | py | 1,032 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "blog.views.AboutView.as_view",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "blog.views.AboutView",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name... |
1782776232 | import sympy
import random
def gcd(a, b): # greatest common divisor
if b == 0:
return a
else:
return gcd(b, a % b)
def euler_func(n): # Euler's totient function
count = 0
for number in range(n):
if gcd(number, n) == 1:
count += 1
return count
def check(roo... | Timofey21/cryptography | Elgamal.py | Elgamal.py | py | 1,436 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "random.randint",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "sympy.prime",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_... |
15023496745 | #!/usr/bin/env python3
#./call.py -f data.txt -u http://192.168.1.145:8080 -e dpm
from argparse import ArgumentParser
from time import sleep
import requests
import sys
import json
parser = ArgumentParser()
parser.add_argument("-f", "--file", dest="file",
help="Line separated file of qrcode value"... | syjer/alf.io-PI-test | call.py | call.py | py | 1,318 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number... |
75061513312 | import requests
import xml.etree.ElementTree as ET
from bs4 import BeautifulSoup
import json
def get_rail_data():
parsed_data = []
url = 'http://api.irishrail.ie/realtime/realtime.asmx/getStationDataBsoupCodeXML_WithNumMins?StationCode=ENFLD&NumMins=90&format=xml'
data = requests.get(url)
data = data... | benedictmc/CS402 | Question 5/get_rail.py | get_rail.py | py | 1,123 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_numb... |
39412984487 | import requests
class YaUploader:
def __init__(self, token: str):
self.token = token
def upload_file(self, loadfile, savefile, replace=False):
"""Загрузка файла.
savefile: Путь к файлу на Диске
loadfile: Путь к загружаемому файлу"""
headers = {'Content-Type': '... | Thunderouse/HW_YandexDisk | main.py | main.py | py | 1,165 | python | ru | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "requests.put",
"line_number": 17,
"usage_type": "call"
}
] |
18359330872 | #!/usr/bin/python3
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from time import sleep
browser = webdriver.Firefox(executable_path='/home/ashika/selenium/geckodriver')
browser.set_window_size(900,900)
browser.set_window_position(0,0)
sleep(1)
browser.get("https://en.wikipedia.org/wiki/... | Ashikav/demo-repo | demo.py | demo.py | py | 543 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "selenium.webdriver.Firefox",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "time.sleep",
... |
2549773164 | #!/usr/bin/env python3
import torch
import horovod.torch as hvd
torch.backends.cudnn.benchmark=True
# Initialize Horovod
hvd.init()
# Pin GPU to be used to process local rank (one GPU per process)
torch.cuda.set_device(hvd.local_rank())
import argparse
import sys
import torch
import logging
import time
import math
i... | Yidi299/yy_moco | val_fc.py | val_fc.py | py | 3,706 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.backends",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "horovod.torch.init",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "horovod.torch",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "torch.cuda.set_devi... |
7178934887 | """This module contains the likes API."""
from flask_jwt_extended import (
get_jwt_identity,
jwt_required,
)
from flask_restful import (
marshal_with,
reqparse,
Resource,
)
from sqlalchemy.exc import IntegrityError
from . import db_client
from .fields import quote_fields, quotes_fields
from .utils... | bertdida/devquotes-flask | devquotes/routes/like.py | like.py | py | 2,152 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "flask_restful.Resource",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "flask_restful.reqparse.RequestParser",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "flask_restful.reqparse",
"line_number": 28,
"usage_type": "name"
},
{
... |
38273906592 | from typing import List
class Solution:
def merge(self, nums1: List[int], m: int, nums2: List[int], n: int) -> None:
"""
Do not return anything, modify nums1 in-place instead.
"""
p1 = m - 1
p2 = n - 1
tail = n + m - 1
while p1 >= 0 or p2 >= 0:
i... | qiaocco/learn-data-structure | 刷题/88.py | 88.py | py | 818 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
}
] |
34477334741 | #!/usr/bin/env python3
import logging
import functools
import rpyc
import threading
import random
import time
THREAD_SAFE = True # Toggles thread safe and unsafe behavior
def synchronize(lock):
""" Decorator that invokes the lock acquire call before a function call and releases after """
def sync_func(func... | tomerfiliba-org/rpyc | demos/sharing/server.py | server.py | py | 2,375 | python | en | code | 1,454 | github-code | 1 | [
{
"api_name": "functools.wraps",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "threading.Lock",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_... |
17960395799 | import numpy as np
from scipy.integrate import solve_ivp
from utilities import *
import shelve
nInfectiousStates = [5, 6, 7, 8, 9, 10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 1000]
tauR = 21
threshold = 0.0
maxRate = 1
timeToMaxRate = 4
n = 10000
R0 = 3
tmax = 100
initialFractionInfected = 0.01
time_SIR = list()
tim... | nwlandry/time-dependent-infectiousness | Theory/run_peak_difference.py | run_peak_difference.py | py | 2,372 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "numpy.linspace",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": ... |
41898501447 | import matplotlib.pyplot as plt
import numpy as np
from load_store import db_indicies as dbi
def plot_data(shard_dict, x_units, y_scale, show=False, append_to_title=""):
"""
Plot each shard in the shard dict.
Parameters
----------
shards: dict
Dictionary containing shards
x_unit... | chrisleet/selenite | selenite/visualize/plot_data.py | plot_data.py | py | 4,618 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.title",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "ma... |
30401371332 | # -*- coding: utf-8 -*-
"""
Created on Wed Jul 13 19:04:50 2016
@author: jack
DESCRIPTION
-----
This script is for generating color background patterns for bidirectional
S-BOS
INSTRUCTIONS TO USE
-----
options can be set in the code. the width and height, as well as the
wavelegth and waveform in both directions ca... | jonathanrgross/Background-Oriented-Schlieren | generate_background/generate_plaid_background.py | generate_plaid_background.py | py | 4,594 | python | en | code | 6 | github-code | 1 | [
{
"api_name": "numpy.linspace",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "scipy.signal.square",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "scipy.signal",
"... |
19514666953 | import tensorflow as tf
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Input, Conv2D, MaxPooling2D, UpSampling2D, Conv2DTranspose, Concatenate
from tensorflow.keras.losses import MeanSquaredError, MeanAbsoluteError
from tensorflow.nn import max_pool_with_argmax
import tensorflow_addons a... | pomtojoer/DeepCFD-TF | models.py | models.py | py | 6,947 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "tensorflow.keras.layers.Input",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.layers.Conv2D",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.layers.Conv2D",
"line_number": 19,
"usage_type": "call"
}... |
25271283090 | import numpy as np
import os
import wrapp_mct_photon_propagation as mctw
import subprocess as sp
import tempfile
import json
import matplotlib.pyplot as plt
import matplotlib.colors as colors
import plenopy as pl
out_dir = os.path.join('examples', 'small_camera_lens_psf')
os.makedirs(out_dir, exist_ok=True)
# scener... | cherenkov-plenoscope/starter_kit | obsolete_examples/small_camera_lens_psf.py | small_camera_lens_psf.py | py | 9,318 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 5... |
11223446905 | from hevc_predictor import Predictor
import numpy as np
from tqdm import tqdm
import random
import cv2
def offline_augmenter(odp_batch=None, output_path = None, mode_data=False):
"""
Computes structural similarity and mse metrics to return X best augmentation patches.
specify X as multiplier.
... | Goluck-Konuko/hevc_data_augmenter | hevc_augmenter/augmenter.py | augmenter.py | py | 3,347 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "tqdm.tqdm",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "cv2.IMREAD_GRAYSCALE",
"line_n... |
70297287074 | import glob
import pandas as pd
from tqdm import tqdm
from collections import defaultdict
from gensim.models import Word2Vec
import numpy as np
type_transform = {"clicks": 0, "carts": 1, "orders": 2}
IS_TRAIN = True
IS_Last_Month = True
def load_data(path):
dfs = []
# 只导入训练数据
for e, chunk_file in enumera... | niejianfei/Kaggle_OTTO_Multi-Objective_Recommender_System | preprocess/deepwalk_prepare.py | deepwalk_prepare.py | py | 4,265 | python | en | code | 10 | github-code | 1 | [
{
"api_name": "glob.glob",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.read_parquet",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",... |
2525113933 | import json
import requests
from django.shortcuts import render, get_object_or_404
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required
from django.views.decorators.csrf import csrf_exempt
from django.contrib.auth.models import User
from django.db import ... | rcorrei4/cs50w-ibdb | books/views.py | views.py | py | 17,098 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "models.Book.objects.all",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "models.Book.objects",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "models.Book",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "models.B... |
19117157583 | from gridworld import *
import simulateController as Simulator
import copy
import compute_all_vis
import cv2
# mapname = 'BeliefTestEvasion'
mapname = 'BelieEvasionTwenty'
filename = 'figures/'+mapname+'.png'
image = cv2.imread(filename, cv2.IMREAD_GRAYSCALE)
image = cv2.resize(image,dsize=(15,15),interpolation=cv2.IN... | GTLIDAR/safe-nav-locomotion | task_planner/Bipedal_Locomotion_Task_Planner/safe-nav-loco/Block_sim.py | Block_sim.py | py | 3,814 | python | en | code | 21 | github-code | 1 | [
{
"api_name": "cv2.imread",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.IMREAD_GRAYSCALE",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "cv2.resize",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.INTER_AREA",
... |
1842114863 | from bs4 import BeautifulSoup
import requests
import pandas as pd
import numpy as np
def get_title(soup):
try:
# Outer Tag Object
title = soup.find("h1", attrs={"class":'DrugHeader__title-content___2ZaPo'})
# Inner NavigatableString Object
title_value = title.text
... | jhachirag7/Mediscan | prescribtion_system/mgscrap.py | mgscrap.py | py | 2,475 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"... |
41279707209 | import sys
from PyQt5.QtWidgets import QMainWindow, QApplication
from PyQt5.QtGui import QIcon
from PyQt5.QtCore import QUrl
from PyQt5.QtWebEngineWidgets import QWebEngineView, QWebEnginePage
class Window(QMainWindow):
def __init__(self):
super().__init__()
self.setWindowTitle("YouTube")
... | Precious13ui/SDYA | main.py | main.py | py | 889 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtGui.QIcon",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWebEngineWidgets.QWebEngineView",
"line_number": 15,
"usage_type": "call"
},
{
... |
71861361633 | import nonebot
from nonebot import on_command, on_message
# from nonebot.adapters import Bot, Event
from nonebot.plugin import Plugin
from typing import Dict, List, Tuple, Set, Union
import datetime
from .my_config import Config
from ... import kit
from ...kit.nb import message as mskit
global_config = nonebot.get... | AntiLeaf/CirnoBot | src/plugins/wymz/__init__.py | __init__.py | py | 2,072 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "nonebot.get_driver",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "my_config.Config.parse_obj",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "my_config.Config",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "kit.nb... |
17243696411 | import sys
sys.path.insert(0, "/home/adriano/projeto_mestrado/modules")
import numpy as np
import pickle
from PIL import Image
# This is a sample Python script.
import vessel_analysis as va
if __name__ == '__main__':
imag = 'Experiment #1 (adults set #1)_20x_batch1 - Superfical layers@45-Image 4-20X'
#i... | AdrianoCarvalh0/texture_codes | modules/Vessel_Analysis/main.py | main.py | py | 1,482 | python | pt | code | 0 | github-code | 1 | [
{
"api_name": "sys.path.insert",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "vessel_analysis.retorna_paths",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.array... |
10049156994 | from flask import Flask, render_template_string
app = Flask(__name__)
app.config['JSON_AS_ASCII'] = False
def filtered(template):
blacklist = ["self.__dict__","url_for","config","getitems","../","process"]
for b in blacklist:
if b in template:
template=template.replace(b,"")
return template
@app... | okayu1230z/simple_ssti | src/app.py | app.py | py | 660 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "flask.render_template_string",
"line_number": 28,
"usage_type": "call"
}
] |
12037648038 | import json
__all__ = ['base_publish_json']
def base_publish_json(request_dict):
"""
Building client publish json of base protocol
base protocol: MQTT(1), CoAP(2), WebSocket(6)
"""
# build publish payload
publish_payload = {
'data_type': 'request',
'task_id': request_dict['ta... | actorcloud/ActorCloud | server/actor_libs/emqx/publish/protocol/base.py | base.py | py | 661 | python | en | code | 181 | github-code | 1 | [
{
"api_name": "json.dumps",
"line_number": 23,
"usage_type": "call"
}
] |
37460030953 | #!/usr/bin/python3
__version__ = '0.0.1' # Time-stamp: <2021-01-15T17:44:23Z>
## Language: Japanese/UTF-8
"""「大バクチ」の正規分布+マイナスのレヴィ分布のためのパラメータを計算しておく。"""
##
## License:
##
## Public Domain
## (Since this small code is close to be mathematically trivial.)
##
## Author:
##
## JRF
## http://jrf.coco... | JRF-2018/simbd | generate_normal_levy_csv.py | generate_normal_levy_csv.py | py | 2,426 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "argparse.Namespace",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "numpy.random.normal",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "numpy.... |
24618522486 | """
This module contains machine learning model class
"""
import os
import sys
from datetime import datetime, timedelta
import numpy as np
import pandas as pd
import tensorflow as tf
import tensorflow.keras.backend as K
from tensorflow.keras.callbacks import (
CSVLogger,
EarlyStopping,
History,
ModelCh... | aleksei-mashlakov/parking-forecast | src/PMV4Cast/ml_model.py | ml_model.py | py | 7,462 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "tensorflow.random.set_seed",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "tensorflow.random",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "random.seed",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "numpy.r... |
1070827302 | from tenacity import retry, stop_after_attempt, wait_fixed
from aio_pika import Message, connect_robust
from aio_pika.abc import AbstractIncomingMessage
import json
import aiosqlite
from config import Settings
from loguru import logger
class RemoteDictRpcServer:
def __init__(self):
self.channel = None
... | jaksklo/RemoteDictionary | src/rpc_server.py | rpc_server.py | py | 4,799 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "config.Settings",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "aio_pika.connect_robust",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "loguru.logger.info",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "loguru.log... |
3561958374 | #!/usr/bin/python3.6
#-*- coding: utf-8 -*-
"""
@Time : 2023/3/23 9:41
@Author : panrhenry
"""
import time
from playwright.sync_api import sync_playwright as playwright
pw = playwright().start()
chrom = pw.chromium.launch(headless=False)
context = chrom.new_context() # 需要创建一个 context
page = context.new_page() ... | panrhenry/py_pro_1 | pachong/getNovel_new_39/111.py | 111.py | py | 1,875 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "playwright.sync_api.sync_playwright",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "time.sleep"... |
10686339907 | from abc import ABCMeta, abstractmethod
from typing import Dict, Any, Optional, List
import torch
from ...core.helpers import Namespace
from ...core.logger import LOGGER as logging
from ...core.observers import EventManager
from ...core.exceptions import CheckpointNotFound
class AbstractNetwork(torch.nn.Module, me... | elix-tech/kmol | src/kmol/model/architectures/abstract_network.py | abstract_network.py | py | 4,940 | python | en | code | 33 | github-code | 1 | [
{
"api_name": "torch.nn",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "abc.ABCMeta",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_... |
101243705 | import sqlite3
from lib.User import User
from lib.utils.Format import Format
class Profile:
def __init__(self, loggedInUser: User):
self.profileId = None
self.loggedInUser = loggedInUser
def getProfileId(self):
return self.profileId
def create(self):
con = sqlite3.connect... | 01sebar/incollege | lib/Profile.py | Profile.py | py | 2,229 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "lib.User.User",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "sqlite3.connect",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "lib.utils.Format.Format"... |
26692181436 | __author__ = "Matthias Rost, Alexander Elvers (mrost / aelvers <AT> inet.tu-berlin.de)"
import abc
import enum
import os
import pickle
import random
class AlgorithmIdentifier:
def __init__(self, key, properties=None):
self.key = AlgorithmType(key)
self.properties = properties
self._hash =... | submodular-middlebox-depoyment/submodular-middlebox-deployment | src/experiments/abstract_experiment_manager.py | abstract_experiment_manager.py | py | 5,747 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "enum.Enum",
"line_number": 55,
"usage_type": "attribute"
},
{
"api_name": "abc.ABC",
"line_number": 61,
"usage_type": "attribute"
},
{
"api_name": "abc.abstractmethod",
"line_number": 86,
"usage_type": "attribute"
},
{
"api_name": "abc.abstractmetho... |
428880409 | import logging
from flask import Blueprint, render_template, request, flash, redirect
from webapp.config import VALID_VALUES, REGRESSION_VALUES
from webapp.utils.dataframe_util import get_enriched_dataframe, prepare_data
from webapp.utils.enrich_sunspots import get_results_for_best_classifier
from webapp.utils.trends_u... | bystrovpavelgit/solar_trends_prediction | webapp/stat/views.py | views.py | py | 3,581 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "flask.Blueprint",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.warning",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.flash",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "webapp.config.VALID_VALUE... |
21733301111 | """Модуль для схемы записи истории."""
from dataclasses import dataclass
from datetime import datetime
@dataclass
class HistoryDTO:
"""."""
before: int
after: int
changes: int
datetime_utc: datetime
@classmethod
def from_alchemy(cls, record):
"""Метод создания схемы.
Arg... | YanaShurinova/shift_credit_card | authorization/src/app/dto/history.py | history.py | py | 653 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "datetime.datetime",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 6,
"usage_type": "name"
}
] |
26130539033 | import telegram
import os
import sys
import json
#set bot token in enrionmental variable 'outlet_bot_token' before using
TOKEN = os.environ.get('outlet_bot_token')
BOT = telegram.Bot(token=TOKEN)
CHAT_IDS_PATHNAME = 'data/chat_ids.json'
def read_chat_ids(pathname):
try:
with open(pathname, 'r') as json_f... | vaarnio/OutletScraper | notifications.py | notifications.py | py | 2,223 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.environ.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "telegram.Bot",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number... |
19892176264 | from typing import Optional, Union
from fretboard.core.collections import StrEnum
from fretboard.data_structures import CircularArray
from fretboard.music_theory.interval import (
AscMelodicMinorScaleIntervals,
DescMelodicMinorScaleIntervals,
HarmonicMinorScaleIntervals,
Interval,
MajorScaleInterva... | pavlotkk/fretboard | fretboard/music_theory/scale.py | scale.py | py | 6,310 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "fretboard.core.collections.StrEnum",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "fretboard.music_theory.note.Note",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "fretboard.music_theory.note.Note",
"line_number": 44,
"usage_type": "... |
71015603555 | # Title: 숫자 카드 2
# Link: https://www.acmicpc.net/problem/10816
import sys
from collections import defaultdict
sys.setrecursionlimit(10 ** 6)
read_single_int = lambda: int(sys.stdin.readline().strip())
read_list_int = lambda: list(map(int, sys.stdin.readline().strip().split(' ')))
def solution(n: in... | yskang/AlgorithmPractice | baekjoon/python/number_card_2_10816.py | number_card_2_10816.py | py | 755 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "sys.setrecursionlimit",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.stdin.readline",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "sys.stdin.read... |
34549216828 | import numpy as np
import neuralnet as nl
import load_mnist as lm
np.random.seed(21)
dataset = lm.load_mnist()
x_train = dataset['x_train']
y_train = dataset['y_train']
x_test = dataset['x_test']
y_test = dataset['y_test']
img = np.zeros(28 * 28 * 10).reshape(10, 784)
img_test = np.zeros(28 * 28 * 10).res... | xyw0025/AI2020f | HW3/learn.py | learn.py | py | 1,782 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.random.seed",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "load_mnist.load_mnist",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
... |
32113324994 | from ciphers.Cipher import Cipher
from collections import Counter
from utils.const import ENGLISH_IOC
class BitwiseXOR(Cipher):
@classmethod
def encrypt(cls, text, key):
text = text.encode('ascii')
key = key.encode('ascii')
return cls._hexify_encryption_matrix(
[
... | piotrjedrzejczak/cryptography | src/ciphers/BitwiseXOR.py | BitwiseXOR.py | py | 2,667 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "ciphers.Cipher.Cipher",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "collections.Counter",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "utils.const.ENGLISH_IOC",
"line_number": 50,
"usage_type": "name"
},
{
"api_name": "util... |
15870540092 | import torch
import torch.nn as nn
import torch.nn.functional as F
def DoubleConv(in_channel, out_channel):
conv = nn.Sequential(
nn.Conv2d(in_channel, out_channel, kernel_size = 3),
nn.ReLU(inplace = True),
nn.Conv2d(out_channel, out_channel, kernel_size = 3),
nn.ReLU(inplace = True)
)
return conv
def cr... | FlagArihant2000/unet | models/parts.py | parts.py | py | 548 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "torch.nn.Sequential",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number... |
10063185169 | from abc import abstractmethod
import numpy as np
from keras.layers import Conv2D, Dense, Flatten
from keras.models import Sequential
class GA:
def __init__(self, x_train, y_train, x_test, y_test, epochs):
# 初始化参数
self.x_train = x_train
self.y_train = y_train
self.x_test = x_test
... | HavEWinTao/BIT-CS | 人工智能基础/3/Ga.py | Ga.py | py | 4,844 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "numpy.random.shuffle",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "keras.models.Sequential",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "keras.... |
43963555187 | from uncertainties.unumpy import *
from uncertainties import ufloat
from inspect import getsourcefile
import os.path as path, sys
current_dir = path.dirname(path.abspath(getsourcefile(lambda:0)))
sys.path.insert(0, current_dir[:current_dir.rfind(path.sep)])
from AP import *
from uncertainties import unumpy
def calc... | brouwerb/AP3 | OPA/aufg4.py | aufg4.py | py | 1,352 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.dirname",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "os.path.abspath",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "inspect.getsourcefile",
"lin... |
6188821386 | from flask import request, Flask, render_template, redirect, url_for
import os
from MathEquation import roomtypePrediction
import time
app = Flask(__name__,
static_url_path='',
static_folder='static')
@app.route('/')
def index():
return render_template('tool.html')
@app.route('/tool.h... | OierGman/FlaskAPI-SDLC | app.py | app.py | py | 1,631 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.redirect",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "flask.request.method"... |
413523110 | # pylint: disable=W0621,C0114,C0116,W0212,W0613
import pathlib
from typing import Optional
import pytest
from dae.utils.regions import Region
from dae.testing import setup_pedigree, setup_vcf, \
vcf_study
from dae.testing.foobar_import import foobar_gpf
from dae.genotype_storage.genotype_storage import GenotypeSt... | iossifovlab/gpf | dae/tests/integration/study_query_variants/test_f1_omission.py | test_f1_omission.py | py | 6,567 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "pytest.TempPathFactory",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "dae.genotype_storage.genotype_storage.GenotypeStorage",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "dae.testing.foobar_import.foobar_gpf",
"line_number": 21,
... |
14526624335 | import folium, io, sys, json
from PyQt5.QtWidgets import (
QApplication,
QLabel,
QLineEdit,
QPushButton,
QVBoxLayout,
QWidget,
QHBoxLayout
)
from PyQt5.QtWebEngineWidgets import QWebEngineView # pip install PyQtWebEngine
"""
Folium in PyQt5
"""
class MyApp(QWidget):
... | CameraTrack/backend | test.py | test.py | py | 4,751 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QHBoxLayout",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QVBoxLayout",
"line_number": 31,
"usage_type": "call"
},
{
"a... |
9244456948 | import torch
import torch.nn as nn
import os
class B2_VGG(nn.Module):
# VGG16 with two branches
# pooling layer at the front of block
def __init__(self):
super(B2_VGG, self).__init__()
conv1 = nn.Sequential()
conv1.add_module('conv1_1', nn.Conv2d(3, 64, 3, 1, 1))
conv1.add_... | dragonlee258079/DMT | B2_VGG.py | B2_VGG.py | py | 4,700 | python | en | code | 8 | 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.nn.Sequential",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_... |
17716038891 | """Analysis for meniscus.
Attributes:
BOUNDS (dict): Upper bounds for quantitative values.
"""
import itertools
import os
import warnings
import numpy as np
import pandas as pd
import scipy.ndimage as sni
from dosma.core.device import get_array_module
from dosma.core.med_volume import MedicalVolume
from dosma.c... | ad12/DOSMA | dosma/tissues/meniscus.py | meniscus.py | py | 14,454 | python | en | code | 49 | github-code | 1 | [
{
"api_name": "dosma.core.quant_vals.QuantitativeValueType.T2",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "dosma.core.quant_vals.QuantitativeValueType",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "dosma.core.quant_vals.QuantitativeValueType.T1_RH... |
11101433884 | import openpyxl
# Carregar o arquivo
workbook = openpyxl.load_workbook('<FILE_NAME>.xlsx')
# Selecionar a planilha ativa
sheet = workbook.active
headers = []
for cell in sheet[2]:
headers.append(cell.value)
# Iterar sobre as linhas a partir da terceira linha
data = []
for row in sheet.iter_rows(min_row=3, value... | EduardoFelixNeto/Conversor_excel_to_xliff | main.py | main.py | py | 1,155 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "openpyxl.load_workbook",
"line_number": 4,
"usage_type": "call"
}
] |
73270903715 | from ast import Raise
from optparse import Option
from typing import List, Dict, Protocol, Tuple, Optional
from config.constant import PROJECT_ROOT
from dataclasses import dataclass, field
from abc import ABC, abstractmethod, abstractproperty
from config.exceptions import ScrapeConfigError
from config.config_test impor... | johnalbert-dot-py/JScrapeON | jscrapeon_parser/config_parser.py | config_parser.py | py | 3,329 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "abc.ABC",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "config.constant",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "dataclasses.field",
"line_num... |
26486178646 | import tweepy
import re
import apiKey
######## Get Tweets and Clean
def get_all_tweets(screen_name):
# authorize twitter, initialize tweepy
auth = tweepy.OAuthHandler(apiKey.twitter_customer, apiKey.twitter_customer_secret)
auth.set_access_token(apiKey.twitter_token, apiKey.twitter_secret)
api = tweepy.AP... | shanpy/aiCompetition | get_tweets.py | get_tweets.py | py | 2,874 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "tweepy.OAuthHandler",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "apiKey.twitter_customer",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "apiKey.twitter_customer_secret",
"line_number": 8,
"usage_type": "attribute"
},
{
... |
32656021823 | """Differentiate between type of service token
Revision ID: ddd3db82f370
Revises: 0e6ac85397af
Create Date: 2023-03-21 13:50:34.046658
"""
from alembic import op
from sqlalchemy import text
# revision identifiers, used by Alembic.
revision = 'ddd3db82f370'
down_revision = '0e6ac85397af'
branch_labels = None
depends_... | SURFscz/SBS | server/migrations/versions/ddd3db82f370_differentiate_between_type_of_service_.py | ddd3db82f370_differentiate_between_type_of_service_.py | py | 2,331 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "sqlalchemy.text",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "alembic.op.get_bind",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.text",
... |
32345652310 |
from ast import arg
from cmath import inf
from notears.locally_connected import LocallyConnected
from notears.lbfgsb_scipy import LBFGSBScipy
from plot_utils import *
import torch
import torch.nn as nn
import numpy as np
import torch.nn.functional as F
from notears.loss_func import *
from plot_utils import *
import no... | anzhang314/ReScore | adaptive_model/baseModel.py | baseModel.py | py | 40,511 | python | en | code | 10 | github-code | 1 | [
{
"api_name": "torch.nn.Module",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
5235426120 | from PIL import Image
from io import BytesIO
from all_data import all_data
def open_image(filename):
return Image.open(filename)
def convert_bytes(bytes_stream):
return Image.open(BytesIO(bytes_stream)).convert("RGBA")
def combine(image_name, file_id, other_image):
image_data = all_data["images"][imag... | TurboGoose/turbo_bot | image_module.py | image_module.py | py | 1,148 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PIL.Image.open",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": ... |
15531056887 | """
Created on Thu Dec 1 06:33:09 2016
@author: sushma
"""
import pickle
from collections import Counter
def main():
finalfile=open("summary.txt","w")
clusterinput = open("clusterinput.pkl","rb")
users=pickle.load(clusterinput)
classifyinput = open("classifyinput.pkl","rb")
messagedata=pickle.load(classify... | smahade4/Online-Social-Network-Analysis | Gender classification and community prediction using twitter/summarize.py | summarize.py | py | 1,984 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "pickle.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_n... |
36812771219 | import argparse
import os
import re
import shutil
parser = argparse.ArgumentParser(
description="Converts a VHDL circuit that uses the default UsbPort implementation (via JTAG) into one that can use the VPI+GHDL one."
)
# TODO: generate a new Makefile / update the old one with the new files
# python3 usb_port_vp... | roby2014/virtual-board-vhdl | UsbPort/script/usb_port_vpi_ghdl.py | usb_port_vpi_ghdl.py | py | 5,151 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 83,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
... |
3243282065 | import pickle as pkl
import numpy as np
import torch.utils.data as data
from data import common
class SatData(data.Dataset):
def __init__(self, args, train=True):
self.args = args
self.train = train
self.scale = args.scale if train else args.scale_test
with open('./dataset/info.... | miracleyoo/Meta-SSSR-Pytorch-Publish | data/sat_data.py | sat_data.py | py | 2,624 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.utils.data",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "data.common.dotdict",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "data... |
24452600516 | # -*- coding:utf-8 -*-
import random
import requests
from scrapy.selector import Selector
class GetIP(object):
def __init__(self):
self.IP_list = []
self._crawl_ip()
def _crawl_ip(self):
useragent = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36' \
... | Linsublime/scrapyspider | scrapy_spider/utils/crawlxiciIP.py | crawlxiciIP.py | py | 1,566 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "scrapy.selector.Selector",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "random.sample",
... |
21055488185 | from __future__ import absolute_import
import atexit
import contextlib
import sys
import requests
import requests.packages.urllib3 as urllib3
from requests.adapters import DEFAULT_POOLBLOCK, HTTPAdapter
from requests.packages.urllib3.poolmanager import PoolManager
from requests.packages.urllib3.util.retry import Retr... | franzinc/agraph-python | src/franz/miniclient/backends/requests.py | requests.py | py | 8,252 | python | en | code | 34 | github-code | 1 | [
{
"api_name": "requests.packages.urllib3.util.retry.Retry",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sys.version_info",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "requests.adapters.HTTPAdapter",
"line_number": 36,
"usage_type": "name"
... |
43788011167 | import requests
import json
word = ' Busca-cep '
print(f'{word:=^30}')
usercep = str(input('Informe seu CEP: '))
api = requests.get(f'https://viacep.com.br/ws/{usercep}/json/')
#cepdata = json.loads(api.text)
print(api.text) | Guribeiro/python | api/busca-cep.py | busca-cep.py | py | 229 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
}
] |
70410826594 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Jul 27 18:13:13 2019
@author: nwu
"""
import requests
import copy
from secret import headers
from datetime import datetime, timedelta
from time import sleep
from math import exp
class ZoomAPIException(Exception):
def __init__(self, response):
... | 50wu/Project | zoomQOS/zoomQos.py | zoomQos.py | py | 5,737 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "copy.deepcopy",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "secret.headers",
"line_n... |
34036384470 | from twilio.rest import Client
class TwilioService:
client = None
def __init__(self):
account_sid = 'AC1db0e8cfbae1e3b9b5834772c0ef8d6c'
auth_token = '7f70419841a1632045d657089acd65c1'
self.client = Client(account_sid, auth_token)
def send_message(self, message,e_recepient_phone_n... | mutuaMkennedy/homey | contact/services/twilio_service.py | twilio_service.py | py | 598 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "twilio.rest.Client",
"line_number": 9,
"usage_type": "call"
}
] |
163369334 | #! /usr/bin/env python
"""Toolbox for imbalanced dataset in machine learning."""
import codecs
import os
from setuptools import find_packages, setup
# get __version__ from _version.py
ver_file = os.path.join('imblearn', '_version.py')
with open(ver_file) as f:
exec(f.read())
DISTNAME = 'imbalanced-learn'
DESCRI... | jem0101/BigSwag-SQA2022-AUBURN | TestOrchestrator4ML-main/resources/Data/supervised/GITHUB_REPOS/scikit-learn-contrib@imbalanced-learn/setup.py | setup.py | py | 2,284 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "os.path.join",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "codecs.open",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "setuptools.setup",
"line_nu... |
21035711313 | """
Checks for configuration option values
"""
import collections.abc
import grp
import os
import pwd
import re
import socket
import textwrap
import typing
from typing import Sequence, Type, Union
import netaddr
from pyroute2.iproute import IPRoute
from .base import (
Check,
ConfigOptionError,
OptionCheck... | agdsn/hades | src/hades/config/check.py | check.py | py | 12,235 | python | en | code | 7 | github-code | 1 | [
{
"api_name": "base.Check",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "base.OptionCheckError",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "base.Check",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "base.OptionCheckError",
... |
14476654720 | import datetime
from django.core.management.base import NoArgsCommand
from django.template import Context, loader
from localtv import models
from localtv import util
class Command(NoArgsCommand):
def handle_noargs(self, **kwargs):
self.send_email(datetime.timedelta(hours=24),
'to... | natea/Miro-Community | localtv/submit_video/management/commands/review_status_email.py | review_status_email.py | py | 1,589 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "django.core.management.base.NoArgsCommand",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "datetime.timedelta",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.date.today",
"line_number": 15,
"usage_type": "call"
},
{
"a... |
24862884689 | import datetime
class Usuario:
def __init__(self, id, nombre, apellido, telefono, username, email, contrasena, avatar):
self.id = id
self.nombre = nombre
self.apellido = apellido
self.telefono = telefono
self.username = username
self.email = email
self.contras... | robertojulian/comision-6 | desafio8.py | desafio8.py | py | 20,842 | python | es | code | 1 | github-code | 1 | [
{
"api_name": "datetime.date.today",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "datetime.date.today",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "datetime.d... |
26998236363 | import os
import sys
import json
import shutil
import tempfile
import re
import glob
import traceback
import pyodbc
import requests
import datetime
import calendar
import sqlalchemy
from dateutil import relativedelta
import pandas as pd
pd.set_option('display.max_columns', None)
BC_PERMIT_DB_NORTH_P... | smHooper/vistats | py/retrieve_data.py | retrieve_data.py | py | 26,376 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.set_option",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pandas.Series",
"line_number": 95,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 102,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_n... |
35655245303 | from win32com.client import Dispatch
import requests
import json
def speak(str):
talk = Dispatch("SAPI.SpVoice")
talk.Speak(str)
if __name__ == '__main__':
speak("Hello, welcome to newstoday.com. I am your news anchor")
speak(" top news for today from are ")
print("Hello, welcome to ... | Kaushal-Dhungel/newsreader | newsreader.py | newsreader.py | py | 2,081 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "win32com.client.Dispatch",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 29,
"usage_type": "call"
}
] |
24893217036 | # -*- coding:utf-8 -*-
# @Author: james
# @Date: 2019/1/7
# @File: base.py
# @Software: PyCharm
import json
import scrapy
from scrapy import Request, FormRequest
from lxml import etree
from WaiBaoSpider.utils.csvWriter import CSVDumper
from WaiBaoSpider.utils.base import unicode_body, deal_ntr
import os
class BeiJin... | jamesfyp/WaiBaoSpider | WaiBaoSpider/spiders/beijing.py | beijing.py | py | 4,102 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "scrapy.Spider",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numbe... |
13043081088 | import pytest
from iotile.core.hw.debug import SparseMemory
from iotile.core.exceptions import ArgumentError
@pytest.fixture(scope='function')
def single_segment():
mem = SparseMemory()
mem.add_segment(0, bytearray(range(0, 256)))
return mem
@pytest.fixture
def multi_segment(scope='function'):
mem =... | iotile/coretools | iotilecore/test/test_debug/test_sparsememory.py | test_sparsememory.py | py | 1,673 | python | en | code | 14 | github-code | 1 | [
{
"api_name": "iotile.core.hw.debug.SparseMemory",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "iotile.core.hw.debug.SparseMemory",
"line_number": 15,
"usage_type": "call"
},
{
"... |
38463610858 | import base64
import cv2
import numpy as np
input_name = 'temp.bin'
output_name = 'temp.jpg'
with open(input_name, 'rb') as f:
f = f.read()
img = base64.standard_b64decode(f)
img = cv2.imdecode(np.frombuffer(img, dtype=np.uint8), -1)
cv2.imwrite(output_name, img)
| ZombaSY/util-collection | file converter/blob_to_img_writer.py | blob_to_img_writer.py | py | 282 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "base64.standard_b64decode",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.imdecode",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.frombuffer",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",... |
14821631079 | import pygame
import sys
pygame.init()
pygame.mixer.init()
pygame.mixer.music.load("music.mp3")
pygame.mixer.music.play(-1)
Width = 1280
Height = 720
screen = pygame.display.set_mode((Width, Height))
pygame.display.set_caption("Pong V2")
white = (255, 255, 255)
black = (0, 0, 0)
clock = pygame.time.Clock()
paddl... | Pigiotyreal/Pong-V2 | src/main.py | main.py | py | 3,014 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pygame.init",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pygame.mixer.init",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.mixer",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "pygame.mixer.music.load"... |
23930974543 | import os
import streamlit as st
import requests
from dotenv import load_dotenv
st.set_page_config(
page_title="advotis – Strafbarkeit prüfen",
page_icon="assets/advotis_icon.png",
layout="centered",
)
st.sidebar.image("assets/advotis_logo.png")
def category_to_result_text(category: str) -> str | None:... | matzewolf/LegalLovesTechHackathon | pages/1_⚖️_Strafbarkeit_prüfen.py | 1_⚖️_Strafbarkeit_prüfen.py | py | 7,720 | python | de | code | 0 | github-code | 1 | [
{
"api_name": "streamlit.set_page_config",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "streamlit.sidebar.image",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "streamlit.sidebar",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name"... |
33703956955 | from typing import List
import pytest
import networkx as nx
from networkx.exception import NetworkXNoPath
from src.domain.wordchainservice import WordChainService
@pytest.mark.parametrize(
"start_word,end_word,expected_chain",
[
("spin", "spot", ["spin", "spit", "spot"]),
("hide", "sort", ["h... | gileslloyd/word-chain | tests/unit/domain/test_wordchainservice.py | test_wordchainservice.py | py | 860 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "networkx.Graph",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "typing.List",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "src.domain.wordchainservice.WordChainService",
"line_number": 19,
"usage_type": "call"
},
{
"api_... |
74769733793 | '''
You are given an array people where people[i] is the weight of the ith person, and an infinite number of boats where each boat can carry a maximum weight of limit.
Each boat carries at most two people at the same time, provided the sum of the weight of those people is at most limit.
(Her tekne aynı anda en fazla ... | bulentsiyah/data-preprocessing_cv-skills | leetcode/b/boats-to-save-people.py | boats-to-save-people.py | py | 1,624 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "typing.List",
"line_number": 32,
"usage_type": "name"
}
] |
17052614858 |
import sys
from car import Car
from board import Board
from helper import load_json
class Game:
"""
The class represent the Game object, each game initializes with
his Board object that the game will be played on him.
The class handles A full session of the RUSH HOUR game by getting user
input e... | OmerFerster/Introduction-to-CS | Exercise 8/game.py | game.py | py | 3,460 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "board.Board",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "helper.load_json",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 75,
"usage_type": "attribute"
},
{
"api_name": "board.cell_list",
"lin... |
3630655417 | """
This module contains all the paths for the wiredrive app.
Name: Michael Feigen
Date Completed: 7/31/2018
"""
from django.urls import path
from . import views
urlpatterns = [
path('', views.IndexView.as_view(), name='wiredrive'),
path('form/', views.getName, name='get_name'),
path('list/', ... | michaelfeigen/portal | wiredrive/urls.py | urls.py | py | 466 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.urls.path",... |
3480209277 | from . import models
from django.conf.urls import url
from stark.service import v1
import json
from django.db.models import Q
from utils import message
from xxxxxx import XXX
from django.utils.safestring import mark_safe
from django.shortcuts import HttpResponse, redirect, render
from django.utils.safestring import ma... | frank12a/Gemma- | crm/stark.py | stark.py | py | 24,228 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "stark.service.v1.StarkConfig",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "stark.service.v1",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "stark.service.v1.StarkConfig",
"line_number": 36,
"usage_type": "attribute"
},
{
... |
3178025434 | import mxnet as mx
import numpy as np
import cv2
from test_utils.predict import predict
def pred(image, net, step, ctx):#step为样本选取间隔
h, w, channel = image.shape
image = image.astype('float32')
size = int(step *0.75) #取样本中size尺寸为最终预测尺寸
margin = int((step - size) / 2)
inhang = int(np.ceil(h/size))
... | scrssys/semantic_segment_RSImage | temp/predict_from_xuhuimin.py | predict_from_xuhuimin.py | py | 1,308 | python | en | code | 49 | github-code | 1 | [
{
"api_name": "numpy.ceil",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.ceil",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 23... |
34063507829 | import os
import time
import numpy as np
import pymysql
import cv2
if __name__ == '__main__':
host = 'localhost'
user = 'root'
password = '880510'
db = 'fx'
sql_select = "SELECT * FROM fileTmpTest2 where file_name like '%\\_3\\_%'"
sql_delete = "DELETE FROM fileTmpTest2 WHERE file_n... | 314257smcag2/okteto | sanan/分选图像判定/detect3.py | detect3.py | py | 4,561 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pymysql.connect",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "time.strftime",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "time.localtime",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_n... |
39492874795 | """Inferrer"""
from PIL import Image
import torch
import numpy as np
import matplotlib.pyplot as plt
import cv2
from utils.load import load_yaml
from model import get_model
from dataloader.transform import DataTransform
class Inferrer():
"""SSDでの予測と画像の表示をまとめて行うクラス"""
def __init__(self, configfile):
... | noji0101/object-detection-app | executor/inferrer.py | inferrer.py | py | 7,262 | python | ja | code | 0 | github-code | 1 | [
{
"api_name": "utils.load.load_yaml",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "model.get_model",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.load",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "dataloader.transform.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.