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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
72561962559 | # Criando o banco de Dados
import tkinter as tk
import sqlite3
import pandas as pd
# Conexão com o banco de dados
conexao = sqlite3.connect('clientes.db')
con = conexao.cursor()
# Criando a tabela no banco
con.execute(''' CREATE TABLE clientes(
nome text,
sobrenome text,
email text,
telefone... | everaldobass/cursos-python3 | hastag-python/banco.py | banco.py | py | 414 | python | pt | code | 0 | github-code | 97 | [
{
"api_name": "sqlite3.connect",
"line_number": 7,
"usage_type": "call"
}
] |
38299391461 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import json
import subprocess
from string import maketrans
from PySide.QtGui import QApplication, QFileDialog, QSystemTrayIcon, QMenu, QIcon, QPixmap
class LastDirectory(object):
LAST_DIRECTORY = 'last_directory'
CONFIG_FILE ... | Ingener74/Algoritms-Patterns-Tests | apps/python/select_file.pyw | select_file.pyw | pyw | 4,665 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "json.load",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_numb... |
28297253152 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 2020/4/13 17:16
# @Author : ShadowY
# @File : get_juejin_info.py
# @Software : PyCharm
# @Version : 1.0
# @Description: 获取掘金后端信息
import requests
import json
import pymongo
header = {
'User-Agent': 'Mozilla/5.0 (Windows NT 6.2; WOW64) App... | ShadowYIG/SpiderCollection | unit6/get_juejin_info.py | get_juejin_info.py | py | 2,504 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "requests.post",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "pymongo.MongoClient",
"line_n... |
21053457137 | import os
from utils import log
import requests
from pyquery import PyQuery as pq
"""
时光网TOP100爬虫
这个爬虫可以爬 10 个页面, 把所有 TOP100 电影都爬出来
并且加入了缓存页面功能
不用重复请求了(网络请求很 浪费时间)
这样做有两个好处
1, 增加新内容(比如增加评论人数)的时候不用重复请求网络
2, 出错的时候有原始数据对照
把封面给下载下来 并保存在image文件夹中
"""
class Model(object):
def __repr__(self):
name = s... | yangdaquan/pachong | 时光网Top100 爬虫/pachong.py | pachong.py | py | 3,817 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.path.join",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 48,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number":... |
2198461576 | #!/usr/bin/env python3
#coding=utf-8
import time
from functools import partial
from threading import Thread
def randoutput():
while True:
print(time.time())
time.sleep(3)
th = Thread(target=randoutput,daemon=True)
th.start()
#cmd=''
#while cmd != 'exit':
# cmd = input('sub>>> ')
# print(cm... | calllivecn/testing | subprocess_py/sub.py | sub.py | py | 393 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "time.time",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "functools.partial",
"line_n... |
37361071037 | import pygame
import numpy as np
class GameOfLife:
def __init__(self, width, height, cell_size, predictive_function):
self.width = width
self.height = height
self.cell_size = cell_size
self.grid = np.random.choice([0, 1], (height, width))
self.predictive_function = predictiv... | qemqemqem/spiking | game_of_life.py | game_of_life.py | py | 2,514 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.random.choice",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros_like",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
... |
6571250260 | from __future__ import print_function
import mock
import pytest
import sys
from sigopt.run_context import allow_state_update, RunContext
@pytest.mark.parametrize('new_state,old_state,expected', [
('completed', 'active', True),
('failed', 'active', True),
('completed', 'completed', False),
('failed', 'complet... | Kamran151199/sigopt-python | test/runs/test_context.py | test_context.py | py | 5,007 | python | en | code | null | github-code | 97 | [
{
"api_name": "sigopt.run_context.allow_state_update",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_... |
41328140390 | import logging
# HOST = "http://localhost"
HOST = "https://wiseagent.wise-xai.com"
# PORT = 8000
PORT = 443
WISEMQ_API_SERVER = HOST + ":" + str(PORT)
ERROR_CODES = [400, 401, 403, 406]
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.... | Wise-XAI/WiseMQ-SDK | wisemq/server/utils/config.py | config.py | py | 341 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "logging.basicConfig",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
}
] |
1758520145 | """Test for the PostProc object."""
__author__ = "Thomas Bédrine"
import numpy as np
import pytest
from requests.exceptions import ReadTimeout
from ratelimit import limits, sleep_and_retry
from astropy.utils.data import download_file
from vip_hci.objects import PostProc, PPResult, Dataset
from vip_hci.fits import o... | vortex-exoplanet/VIP | tests/post_3_10/test_objects_postproc.py | test_objects_postproc.py | py | 4,510 | python | en | code | 67 | github-code | 97 | [
{
"api_name": "astropy.utils.data.download_file",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "requests.exceptions.ReadTimeout",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "ratelimit.sleep_and_retry",
"line_number": 17,
"usage_type": "name"
},... |
41825007642 | from django.conf.urls import include, url
from django.views.decorators.csrf import csrf_exempt
from rest_framework.routers import DefaultRouter
from rest_framework.authtoken.views import obtain_auth_token
from .views import CircleViewSet, UserViewSet, RestaurantViewSet, ReviewViewSet, FoodieViewSet, PollViewSet, Vote... | benkimo6i/food_compass | api/urls.py | urls.py | py | 1,081 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "rest_framework.routers.DefaultRouter",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "views.UserViewSet",
"line_number": 10,
"usage_type": "argument"
},
{
"api_name": "views.RestaurantViewSet",
"line_number": 11,
"usage_type": "argument"
},
{
... |
41271029001 | import time
import threading
from tkinter import Tk, Button, Label, mainloop
from playsound import playsound
# To do:
# - Add a progress bar or a visible clock
# - Add customize work period (seconds) and relax period (seconds)
# - Add customize start time
# - Add start/stop/reset button
# - Add sound effects
# Need 2 m... | leson238/hiit_clock | hiit_clock.py | hiit_clock.py | py | 1,875 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "time.time",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "playsound.playsound",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_... |
14827941683 | from .detector import Detector
import dlib
import face_recognition
import face_recognition_models
import numpy as np
import cv2
import os
import logging
logging.basicConfig(level = logging.INFO,format = '%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)
TMP_DIR = ".... | caryl1989/CNStream | apps/faceswap/interface/faceswap.py | faceswap.py | py | 11,140 | python | en | code | null | github-code | 97 | [
{
"api_name": "logging.basicConfig",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.array",
... |
24885512701 | from .common import Extractor, Message
from .. import text
import datetime
BASE_PATTERN = (
r"(?:https?://)?"
r"(danbooru|hijiribe|sonohara|safebooru)"
r"\.donmai\.us"
)
class DanbooruExtractor(Extractor):
"""Base class for danbooru extractors"""
basecategory = "booru"
category = "danbooru"
... | prodbydaniel245/gallery-dl | gallery_dl/extractor/danbooru.py | danbooru.py | py | 7,200 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "common.Extractor",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "common.Message.Directory",
"line_number": 68,
"usage_type": "attribute"
},
{
"api_name": "common.Message",
"line_number": 68,
"usage_type": "name"
},
{
"api_name": "common.... |
74397342400 | import csv
from datetime import datetime, date, timedelta
#funzione che va a scrivere i dati nel file csv match
def selectValueMatch(row, writer):
if (row['match_num'] == '' or row['tourney_id'] ==''):
print("MISS VALUE IN MATCH_NUM O IN TOURNEY_ID")
row.update({'match_id': row['match_num']+ row['to... | FedericoCanepuzzi/Laboratory_of_Data_Science | src/LDS_Part1_16/split.py | split.py | py | 11,198 | python | it | code | 0 | github-code | 97 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 49,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 50,
"usage_type": "call"
},
{
"api_name"... |
42793157508 | from config.dbconfig import pg_config
import psycopg2
class CreditCardDAO:
def __init__(self):
connection_url = "dbname=%s user=%s host=%s password=%s" % (pg_config['dbname'],
pg_config['user'],
... | jrsm1/disaster-site-resource-locator | dao/CreditCardDAO.py | CreditCardDAO.py | py | 5,796 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "config.dbconfig.pg_config",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "config.dbconfig.pg_config",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "config.dbconfig.pg_config",
"line_number": 10,
"usage_type": "name"
},
{
"api_n... |
73045015998 | from django.shortcuts import render
from customer.models import Customer
from customer.forms import CustomerForm
from django.shortcuts import redirect
from product.models import Product
from useradmin.models import Useradmin
from product.forms import ProductForm
from buyproduct.models import Buyproduct
from buyproduct.... | kaushal289/securityproject | useradmin/views.py | views.py | py | 4,760 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "customer.models.Customer.objects.all",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "customer.models.Customer.objects",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "customer.models.Customer",
"line_number": 26,
"usage_type": "n... |
24405670539 | #!/usr/bin/env python
#only for the predictions error, without comparisons (ground truth) and no publication on RVIZ
import rospy
from std_msgs.msg import String
from visualization_msgs.msg import MarkerArray
import torch
import time
import matplotlib.pyplot as plt
import threading
# from matplotlib.animation import F... | leob03/human_motion_forecasting | scripts/HRI_main_test_error.py | HRI_main_test_error.py | py | 7,377 | python | en | code | 5 | github-code | 97 | [
{
"api_name": "sys.path.append",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "matplotlib.p... |
36942092700 | import os
from shutil import copyfile
import ffmpeg
from pathlib import Path
import re
def encoder(elem, dir_name):
extension = ''.join(elem.split('.')[-1])
file_path_no_extension = ''.join(elem.split(extension)[0])
file_name_no_path = ''.join(elem.split('/')[-1])
file_path_no_name = ''.join(elem.spli... | mugenoesis/Deemix-auto-albums-downloader | FileEncoding.py | FileEncoding.py | py | 2,911 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "ffmpeg.probe",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "shutil.copyfile",
"line_nu... |
38798781856 | import os
import argparse
import logging
import re
from pprint import pprint
class HackAssembler:
output_file_path = ""
variable_address_base = 16 #hard-coded
variable_address_offset = 0
lable_offset = 0
symbol_table = {
"R0": 0,
"R1": 1,
"R2": 2,
"R3": 3,
... | zwh42/nand2tetris | nand2tetris/projects/06/HackAssembler.py | HackAssembler.py | py | 7,534 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 108,
"usage_type": "call"
},
{
"api_name": "logging.StreamHandler",
"line_number": 109,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 111,
"usage_type": "attribute"
},
{
"api_name": "re.comp... |
3388864630 | # Worker to be used for analysis of CIS, Cs and LAS
# - Christopher Tunnell, 2009 <tunnell@hep.uchicago.edu>
# - Brian Martin, 2009 <brian.thomas.martin@cern.ch>
# - Seb Viret, 2009 (viret@in2p3.fr)
# - Mikhail Makouski, 2009 <makouski@cern.ch>
# - Marco van Woerden, 2011 (mwoerden@gmail.com)
# - Joshua Montgomery, 201... | JackyMYL/Tile-CIS-group | TUCS/workers/Use.py | Use.py | py | 35,378 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sys.version_info",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "sys.version_info",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sys.path"... |
26559050517 | import os
import random
import pandas
from django.test import TestCase
from stockportfolio.api import rec_utils
from stockportfolio.api.models import Portfolio, Stock, User, UserSettings
from stockportfolio.settings.base import BASE_DIR
class RecUtilsTestCase(TestCase):
"""Tests the rec_utils modules"""
@c... | Stock-Portfolio-Risk-Analyzer/spr-web | stockportfolio/api/test/test_rec_utils.py | test_rec_utils.py | py | 7,506 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "django.test.TestCase",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "stockportfolio.api.models.User.objects.create_user",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "stockportfolio.api.models.User.objects",
"line_number": 23,
"usag... |
10135104877 | import os
import tempfile
import pytest
from loguru import logger
from pathlib import Path
from flask_jwt_extended import create_access_token, create_refresh_token
from online_store.app import create_app
from online_store.backend.models.database import db, get_db
try:
with open(Path(__file__).parent / 'data.sql... | Liam-Deacon/online-store-rest-api | test/conftest.py | conftest.py | py | 1,922 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "pathlib.Path",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "loguru.logger.warning",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "loguru.logger",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "tempfile.mkstemp",
... |
40811170856 | import argparse
import pytorch_lightning as pl
from torch.utils.data import DataLoader, random_split
from dataset import QueryTableDataset, triple_collate_function
from table_bert import TableBertModel
class QueryTableDataModule(pl.LightningDataModule):
def __init__(self, params):
super().__init__()
... | songhyunje/AdhocTableSearch | data_module.py | data_module.py | py | 2,629 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "pytorch_lightning.LightningDataModule",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "table_bert.TableBertModel.from_pretrained",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "table_bert.TableBertModel",
"line_number": 15,
"usag... |
27705609211 | import telebot
from deductions import circle, square, rectangle, right_triangle, degrees, diagonals
# getting a token from a text file
file = open('token.txt', 'r', encoding='utf-8')
token = file.read()
file.close()
bot = telebot.TeleBot(token)
# start
@bot.message_handler(content_types=['text'])
@bot.message_handle... | Platon-Izm/bot | bot.py | bot.py | py | 2,393 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "telebot.TeleBot",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "telebot.types.ReplyKeyboardMarkup",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "telebot.types",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "d... |
29318266902 | import tensorflow as tf
from configparser import ConfigParser
class TfModels(object):
"""
A class that represents tensorflow models.
"""
def __init__(self):
self.config = ConfigParser()
def cnn_model(self,num_classes):
"""
Convolutional Neural Netwo... | jdharanms/MachineLearning | TensorflowModels.py | TensorflowModels.py | py | 4,423 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tensorflow.placeholder",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "tensorflow.float32",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name... |
28792261614 | import boto3
from pprint import pprint
import pandas as pd
# Describe FSx
def describe_FSx():
session = boto3.session.Session(profile_name ='default',region_name ="eu-east-1")
client = boto3.client('fsx')
for allfsx in client.describe_file_systems()['FileSystems']:
try:
# pprint(allfsx)... | vibhavsomani1991/fsx-ONTAP | fs-ONTAP.py | fs-ONTAP.py | py | 3,990 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "boto3.session.Session",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "boto3.session",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "boto3.client",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",... |
43459674952 | from dataclasses import fields
from django import forms
from .models import MemoryPlace
class MemoryPlaceForm(forms.ModelForm):
class Meta:
model = MemoryPlace
widgets = {
'name': forms.TextInput(attrs={'class': 'form-control'}),
'comment': forms.Textarea(attrs={'class': 'f... | KienTruong123/Memories | memories/core/forms.py | forms.py | py | 611 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "models.MemoryPlace",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.forms... |
17400759858 | '''Содержит иерархию классов L{Runner} и функцию L{main}
При запуске из командной строки запускает функцию L{main}.'''
import datetime
import getopt
from heapq import heappop, heappush
import locale
import sys
try:
from parsedatetime import parsedatetime
from parsedatetime import parsedatetime_consts... | earshinov/rempy | rempy/Runner.py | Runner.py | py | 9,584 | python | ru | code | 1 | github-code | 97 | [
{
"api_name": "locale.getdefaultlocale",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "parsedatetime.parsedatetime.Calendar",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "parsedatetime.parsedatetime",
"line_number": 15,
"usage_type": "name"
},
... |
37753923979 | import pathlib
import timewarp.error
import timewarp.service.boot
class SystemDBoot(timewarp.service.boot.Loader):
"""systemd-boot boot loader."""
def __init__(
self, mount_point: pathlib.Path,
boot_on_root: bool = False) -> None:
super().__init__(mount_point)
self._p... | branchonequal/timewarp | src/timewarp/service/boot/loader/systemdboot.py | systemdboot.py | py | 2,721 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "timewarp.error.service",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "timewarp.error",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "timewarp.e... |
74303572480 | # -*- coding: utf-8 -*-
from builtins import str
from nplab.instrument.visa_instrument import VisaInstrument
import re
import time
from visa import VisaIOError
import os
import json
import numpy as np
class SP2750(VisaInstrument):
""" Monochromator class
ftp://ftp.princetoninstruments.com/public/manuals/Acto... | nanophotonics/nplab | nplab/instrument/spectrometer/Acton.py | Acton.py | py | 8,040 | python | en | code | 35 | github-code | 97 | [
{
"api_name": "nplab.instrument.visa_instrument.VisaInstrument",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "builtins.str",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 72,
"usage_type": "call"
},
{
"api_name"... |
37842925281 | import pybullet as p
import numpy as np
from scipy.spatial.transform import Rotation
import xml.dom.minidom as xml
import os
from .active_obj import ActiveObject
from .end_effector import Gripper,Suction
class Robot(ActiveObject):
def __init__(self,scene,**kwargs):
if 'reset_joint_poses' not in kwargs: k... | sltruman/practical-tools | practools/robot.py | robot.py | py | 23,452 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "active_obj.ActiveObject",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "pybullet.setJointMotorControlArray",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "pybullet.POSITION_CONTROL",
"line_number": 46,
"usage_type": "attribute"
},
... |
1158671669 | # coding=utf-8
import base64
if __name__=="__main__":
result_list = []
with open('in.txt', 'rb') as in_file:
with open('result.txt', 'w') as out_file:
for item in in_file:
out_file.write(base64.b64encode(item).decode() + '\n')
| PolluxAvenger/SomeScript | file_base64.py | file_base64.py | py | 275 | python | en | code | 11 | github-code | 97 | [
{
"api_name": "base64.b64encode",
"line_number": 12,
"usage_type": "call"
}
] |
28542726449 | import os
import cv2
import torch
import numpy as np
from PIL import Image
from advt.defence.defence import Defend
class TV(Defend):
"""
TV: Total Variance
"""
def __init__(self, model, device, test_dir, niters=30):
"""
Initialize the TV class.
Args:
model: torch mo... | WindFantasy98/ADVT | advt/defence/total_variance_minimization.py | total_variance_minimization.py | py | 4,435 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "advt.defence.defence.Defend",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "os.listdir",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.path",
"lin... |
42182963253 | import pytest
import numpy as np
from model.elements import make_chromosome, make_individual, make_population, Individual
@pytest.fixture
def lists():
first_list = np.array([0, 0, 0, 0, 1, 1, 1, 1])
second_list = np.array([1, 1, 1, 1, 0, 0, 0, 0])
third_list = np.array([1, 0, 1, 0, 1, 0, 1, 0])
ones_... | kpv15/genetic_algorithm | test/fixtures.py | fixtures.py | py | 3,414 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.array",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 1... |
7367675869 | #
# sparkTest.py -- word count example to test installation
#
from pyspark import SparkContext
sc = SparkContext(appName="PythonWordCount")
#lines = sc.textFile("file:///home/code/climatology-gaussianInterp/README.md", 8)
lines = sc.textFile("file:///usr/share/dict/words", 128)
counts = lines.flatMap(lambda x: x.spli... | dataplumber/nexus | climatology/clim/sparkTest.py | sparkTest.py | py | 510 | python | en | code | 20 | github-code | 97 | [
{
"api_name": "pyspark.SparkContext",
"line_number": 7,
"usage_type": "call"
}
] |
17838447153 | import aiohttp
from fastapi import APIRouter, Body
from ..schemas import STTResponse, STTRequest, TranslateRequest, TranslateResponse, \
ObjectDetectionRequest, ObjectDetectionResponse
from .helpers import extract_text, google_speech_to_text, google_object_detection, google_translate
router = APIRouter()... | siva3io/siva-prod-docsandapi | internal_apis/google_api/api/v1.py | v1.py | py | 2,355 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "schemas.ObjectDetectionRequest",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "fastapi.Body",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "helpers.... |
11772123207 | # -*- coding: utf-8 -*-
# test/get_temp.py
def main():
import serial
import sys
import datetime
argvs = sys.argv
if len(argvs) < 2:
print('argument must be 2')
port = '/dev/ttyUSB0'
else:
port = argvs[1]
ser = serial.Serial(port, 38400, timeout=10) # 10s-timeout b... | nogut0123/sensor | 1_script/get_temp.py | get_temp.py | py | 1,457 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sys.argv",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "serial.Serial",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
... |
14276612689 | from __future__ import print_function
from torch.utils.data import Dataset
import os
import numpy as np
from tqdm import tqdm
import pickle
import time
import cv2
import random
class Preprocess(object):
def __init__(self, format_size=112):
super(Preprocess, self).__init__()
self.format_size = fo... | chaffeechenyefei/mlu_video | FaceRecog/datasets/triplet.py | triplet.py | py | 7,648 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "cv2.resize",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "cv2.cvtColor",
"line_numb... |
42415564822 | import json
import multiprocessing as mp
import numpy as np
import scipy as sp
import os
import pickle
import pandas as pd
import pkg_resources
import time
import copy
from sklearn.model_selection import train_test_split
import tensorly as tl
import signal
from scipy.stats import mode
from contextlib import contextmana... | releaunifreiburg/DeepPipe | src/deeppipe_api/experiments/baselines/tensoroboe/auto_learner.py | auto_learner.py | py | 55,558 | python | en | code | 12 | github-code | 97 | [
{
"api_name": "scipy.stats.mode",
"line_number": 94,
"usage_type": "name"
},
{
"api_name": "scipy.stats.mode",
"line_number": 100,
"usage_type": "name"
},
{
"api_name": "scipy.stats.mode",
"line_number": 106,
"usage_type": "name"
},
{
"api_name": "scipy.stats.mode... |
72912862078 | import datetime
from aiohttp import request
import twitchio
from twitchio.ext import commands
import os
import dotenv
import json
with open("config.json") as config_file:
config = json.load(config_file)
dotenv.load_dotenv()
class Bot(commands.Bot):
def __init__(self):
super().__init__(
... | DoobDev/DoobMe | bot.py | bot.py | py | 3,946 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "json.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "dotenv.load_dotenv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "twitchio.ext.commands.Bot",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "twitchio.... |
29182265919 | """Functions for working with index/columns."""
import numpy as np
import pandas as pd
from collections.abc import Iterable
from vectorbt import defaults
from vectorbt.utils import checks
def get_index(arg, axis):
"""Get index of `arg` by `axis`."""
checks.assert_type(arg, (pd.Series, pd.DataFrame))
che... | eo1989/VectorBTanalysis | .venv/lib/python3.8/site-packages/vectorbt/base/index_fns.py | index_fns.py | py | 9,896 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "vectorbt.utils.checks.assert_type",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "vectorbt.utils.checks",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "pandas.Series",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_na... |
29268469621 | import time
import PIL.Image
from ultralytics import YOLO
# Load a model
model = YOLO("model_weight/yolov8_pretrained_model/yolov8n.pt")
# train the model
model.train(data='config/QueenBees.yaml', epochs=500, batch=7, workers=4, patience=150, visualize=True,
augment=True) # train the model
# single tes... | BruceYounggit/Queenbee_Detect | finetune_training.py | finetune_training.py | py | 737 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "ultralytics.YOLO",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "PIL.Image.Image.fromarray",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "PIL.Image.Image",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "PIL.Im... |
40832236201 | # tools.py
# module for data processing
import pandas as pd
import numpy as np
import os
import matplotlib as plt
import string
from stop_words import get_stop_words
import nltk
import ssl
from sklearn.feature_extraction.text import CountVectorizer
import re
class tools:
# Entrypoint for tools. Unique Identifier ... | patrickcanny/EECS738_Toxicity_Classification | src/tools.py | tools.py | py | 4,378 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pandas.read_csv",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "string.punctuation.replace",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "string.punctuation",
"line_number": 64,
"usage_type": "attribute"
},
{
"api_name": "re... |
4873289976 | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
import json
import codecs
import time
import mySpiders.utils.log as logging
from mySpiders.utils.hash import toMd5
from mySpide... | flybird1971/spider | mySpiders/pipelines.py | pipelines.py | py | 8,014 | python | en | code | 10 | github-code | 97 | [
{
"api_name": "codecs.open",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "codecs.open",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 41... |
31301176193 | import asyncio
import logging
from concurrent.futures.thread import ThreadPoolExecutor
from aiohttp import web
import caller_utils.caller_configuration as conf
from caller_utils.sms.twilio_sms import sms_twilio
logging.basicConfig(format=conf.get_log_formatter())
async def sms_sender_async(message, phone_number):
... | jcfdeb/py-phone-caller | src/caller_sms/caller_sms.py | caller_sms.py | py | 2,077 | python | en | code | 6 | github-code | 97 | [
{
"api_name": "logging.basicConfig",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "caller_utils.caller_configuration.get_log_formatter",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "caller_utils.caller_configuration",
"line_number": 10,
"usage_typ... |
606611120 | # This file contains functions that provide angle operations
from shapely.geometry import Point
import numpy as np
from math import pi
def angle_3_pts(point1, point2, point3):
angle1 = angle_2_pts(point2, point1)
angle2 = angle_2_pts(point2, point3)
return angle2 - angle1
def angle_2_pts(point1, point2)... | LostInZoom/cartagen4py | cartagen4py/utils/geometry/angle.py | angle.py | py | 2,160 | python | en | code | 7 | github-code | 97 | [
{
"api_name": "numpy.arctan2",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "math.pi",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "math.pi",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "shapely.geometry.Point",
"line_numb... |
30621916224 | from dataclasses import dataclass, field
import numpy as np
from model.objects.reader import Reader
from model.objects.tag import Tag
from model.radio.radio import dbm2w, w2dbm, signal2noise, free_space_path_loss, \
ber_over_awgn, db2lin, lin2db
THERMAL_NOISE = -110 # dBm
SPEED_OF_LIGHT = 299792458
@dataclass... | ipu69/uav-rfid-sim | src/model/objects/channel.py | channel.py | py | 7,094 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "dataclasses.dataclass",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "dat... |
74248583997 | from Analyze.AnalyzeModel import *
from Analyze.Filters import *
from Drivers.HistogramModelDriver import *
import numpy as np
import numba
import random
class ImageModelDriver:
# -------------------------------
# Лекция 1
# -------------------------------
@staticmethod
def multi_shift(data: SPD... | Loupehope/spbstu-processing-data | Drivers/ImageModelDriver.py | ImageModelDriver.py | py | 23,721 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.array",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "numpy.max",
"line_number... |
229841650 | #!/usr/env/bin python
import argparse
def get_arguments():
parser = argparse.ArgumentParser()
parser.add_argument("-i", "--interface", dest="interface", help="Interface to sniff on")
args = parser.parse_args()
if not args.interface:
parser.error("No interface provided, use --help")
# elif n... | maxicorbs/Python_Scripts | cli_args/argparse.py | argparse.py | py | 459 | python | uk | code | 0 | github-code | 97 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 5,
"usage_type": "call"
}
] |
40027915442 | from django.contrib import messages
from django.db.models.loading import get_model
from django.http import Http404
from django.shortcuts import redirect, render, render_to_response, get_object_or_404
from django.utils.translation import ugettext_lazy as _
from app import constants as c
from .forms import CreateGameFor... | alligatortower/toast | app/views.py | views.py | py | 13,055 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "forms.FindGameForm",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "forms.CreateGameForm",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "forms... |
43269066895 | # -*- coding: utf-8 -*-
from collections import OrderedDict
from datetime import datetime, timedelta
from fiqs.exceptions import MissingParameterException
from fiqs.fields import Field
from fiqs.models import Model
class Metric(object):
def is_field_agg(self):
return NotImplemented
def is_doc_count... | pmourlanne/fiqs | fiqs/aggregations.py | aggregations.py | py | 13,864 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "fiqs.fields.Field",
"line_number": 24,
"usage_type": "argument"
},
{
"api_name": "fiqs.exceptions.MissingParameterException",
"line_number": 107,
"usage_type": "call"
},
{
"api_name": "fiqs.exceptions.MissingParameterException",
"line_number": 110,
"usage_t... |
31969087091 | from abc import ABC, abstractmethod
from typing import Any, Callable
class ClassFeature:
def __init__(
self, player: Any, func: Callable[[None], None], name: str, level: int
):
self.player = player
self.func = func
self.name = name
self.level = level
def __call__(s... | VernonRoche/D-D-Discord-Bot | Source/Class_System/ClassFeature.py | ClassFeature.py | py | 549 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "typing.Any",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "typing.Callable",
"line_number": 7,
"usage_type": "name"
}
] |
11159206706 | import os
import time
import argparse
import volthaMngr
import preprovisioning
import discovery
import authentication
import dhcp
import unicast
import logging
DEFAULT_LOG_DIR = '/tmp/voltha_test_results'
DEFAULT_SIMTYPE = 'ponsim'
logging.basicConfig(level=logging.INFO)
def dir_init(log_dir=DEFAULT_LOG_DIR, voltha_... | opencord/voltha | tests/atests/common/auto_test.py | auto_test.py | py | 3,100 | python | en | code | 77 | github-code | 97 | [
{
"api_name": "logging.basicConfig",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "logging.info",
... |
17494070622 | import os
from collections import abc
from collections import OrderedDict
import inspect
import json
import tensorflow as tf
import numpy as np
from tensorflow.python.keras import callbacks as cbks
from tensorflow.python.keras.engine import training_utils as keras_train_utils
from sklearn.model_selection import train_... | vlad-user/deep-tempering | deep_tempering/training_utils.py | training_utils.py | py | 18,302 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tensorflow.compat.v1.keras.backen... |
72399325439 | from flask import Flask, render_template
import main_script
import threading
app = Flask(__name__)
@app.route('/record', methods=['POST'])
def main():
# definitions = []
# thread = threading.Thread(target=main_script.main, args=[])
# thread.start()
definitions = main_script.main()
return render_t... | jambran/elite_speak | app.py | app.py | py | 450 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "main_script.main",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.render_templa... |
10193717236 | from django.db import models
from tinymce import HTMLField
# Create your models here.
class About(models.Model):
title = models.CharField(max_length=250, verbose_name='Заголовок')
text = HTMLField(verbose_name='Текст')
class Meta:
verbose_name = 'О компании'
verbose_name_plural... | AsuraBot/klinika | staticpages/models.py | models.py | py | 427 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.db.models.Model",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "... |
38007956819 | # coding: utf-8
from ptrlib.util.encoding import *
from ptrlib.console.color import Color
from abc import ABCMeta, abstractmethod
import re
import sys
import threading
import time
from logging import getLogger
logger = getLogger(__name__)
class Tube(metaclass=ABCMeta):
def __init__(self):
self.buf = b''
... | 0x6b7966/ptrlib | ptrlib/pwn/tube.py | tube.py | py | 7,874 | python | en | code | null | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "abc.ABCMeta",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",... |
13190934146 | #!/usr/bin/env python3
import click
import logging
from conf import DEFAULT_LOGGER
from lib import set_logger
_LOGGER = logging.getLogger(DEFAULT_LOGGER)
_help = """
Execute DB migration based on the {version}.py file located in the migration folder.\
Users can manage version history for DB migration.\n
Example usa... | cloudforet-io/db-migration | src/migrate.py | migrate.py | py | 1,310 | python | en | code | 7 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "conf.DEFAULT_LOGGER",
"line_number": 8,
"usage_type": "argument"
},
{
"api_name": "lib.set_logger",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "click.command"... |
28811844812 | import numpy as np
import matplotlib.pyplot as plt
import magpylib as magpy
numSegments = 20
def createCoilMultiplex(idx,dxs,dys,deltaX,deltaY,topOrBot):
# create a Magpylib collection of Loop Sources that form a coil
# coil = magpy.Collection()
trajectory = []
radius = 5
firstPoint = 1
for i ... | skywo1f/Lets_do_it_live | gradientDescentGolay.py | gradientDescentGolay.py | py | 5,646 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "numpy.sin",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "numpy.cos",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 19,
... |
11967847607 | """Performance metrics loggers
This module contains all data collectors that record events while simulations
are being executed and compute performance metrics.
Currently implemented data collectors allow users to measure cache hit ratio,
latency, path stretch and link load.
To create a new data collector, it is suf... | icarus-sim/icarus | icarus/execution/collectors.py | collectors.py | py | 19,072 | python | en | code | 62 | github-code | 97 | [
{
"api_name": "icarus.util.inheritdoc",
"line_number": 192,
"usage_type": "call"
},
{
"api_name": "icarus.util.inheritdoc",
"line_number": 197,
"usage_type": "call"
},
{
"api_name": "icarus.util.inheritdoc",
"line_number": 202,
"usage_type": "call"
},
{
"api_name"... |
3532852264 | from django.shortcuts import render, redirect
from django.http import HttpResponse, HttpResponseBadRequest
from django.views.decorators.csrf import csrf_exempt
from .models import *
from common.models import *
import random
from django.contrib.auth import login, authenticate, logout
from django.core.exceptions import P... | venkatesh-sivaraman/fireroad-server | recommend/views.py | views.py | py | 2,842 | python | en | code | 13 | github-code | 97 | [
{
"api_name": "django.http.HttpResponse",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "django.http.HttpResponse",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "json.dum... |
9180598760 | '''Classify - train or use a classifier'''
import bisect
import hashlib
import h5py
import logging
import numpy as np
import os
import pickle
from sklearn.ensemble import ExtraTreesClassifier
from sklearn.decomposition import PCA as RandomizedPCA
import tempfile
import cellprofiler.module as cpm
import cellprofiler.i... | Scotchman0/CellProfiler_Ubuntu_Installer | classify.py | classify.py | py | 37,514 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "cellprofiler.module.Module",
"line_number": 57,
"usage_type": "attribute"
},
{
"api_name": "cellprofiler.module",
"line_number": 57,
"usage_type": "name"
},
{
"api_name": ... |
27922850925 | from argparse import ArgumentParser, Namespace
from concurrent.futures import ThreadPoolExecutor
from contextlib import nullcontext, redirect_stderr, redirect_stdout
from io import StringIO
from multiprocessing import cpu_count
from pathlib import Path
from subprocess import DEVNULL, STDOUT, CalledProcessError, run
fro... | solomankabir123/coq-nvim-test | coq/__main__.py | __main__.py | py | 4,423 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sys.version_info",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "sys.stderr",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sys.exit",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"l... |
675830164 | from tkinter import *
from tkinter.simpledialog import askinteger
from tkinter import filedialog
from PIL import ImageTk, Image
class Bitmap:
def __init__(self, filename):
self.filename = filename
self.file_header = {}
self.dib_header = {}
self.buffer = []
with open(filenam... | xuhongxu96/Image-Processing-Course | ximage/ximage.py | ximage.py | py | 5,487 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "PIL.ImageTk.PhotoImage",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "PIL.ImageTk",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "PIL.Image.frombuffer",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
... |
74245127998 | import json
from pprint import pprint
with open('swjson.json') as data_file:
data = json.load(data_file)
contador=0
print("Ahora listará las naves que aparezcan en el episodio que quieras")
episodio=input("Introduzca el número del episodio: ")
listapelis=[]
for pelicula in data ["results"]:
for titulo in pel... | Alexlp1092/LM1718 | P3JSON/SW/sw5.py | sw5.py | py | 703 | python | es | code | 0 | github-code | 97 | [
{
"api_name": "json.load",
"line_number": 4,
"usage_type": "call"
}
] |
22934178626 | """
File: shapes/examples/lunar_horizon_calculator.py
Author: Neil Bassett
Date: 20 April 2021
Description: Example showing how to use the LunarHorizonCalculator
class.
"""
from shapes import LunarHorizonCalculator
import matplotlib.pyplot as plt
schrodinger_coordinates = (132.4, -75.0)
lunar_horizon_cal... | npbassett/shapes | examples/lunar_horizon_calculator.py | lunar_horizon_calculator.py | py | 682 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "shapes.LunarHorizonCalculator",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 19,
"usage_type": "name"
},
{
"api_na... |
18433063578 | import logging
import sys
from clbundler.config import global_config
from clbundler.commandparser import CommandParser
from clbundler import cli
from clbundler import exceptions
def main():
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
ch = logging.StreamHandler(sys.stdout)
ch.setLevel(l... | peterlama/CLbundler | clbundler/__init__.py | __init__.py | py | 627 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "logging.StreamHandler",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.stdout"... |
12278157972 |
import cv2
import numpy as np
from matplotlib import pyplot as plt
#img = cv2.imread('SimpleImageDataset/building05.jpg') #reads in an imageas BGR by default
img = cv2.imread('checkered2.png')
gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
#harris corner detection (rotation invariant)
#https://opencv-python-tutroals.re... | ddengster/cpp_python_dumpster | PythonCV/cv_feature.py | cv_feature.py | py | 1,879 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "cv2.imread",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "numpy.float32",
"lin... |
1993074745 | from tkinter import ttk
import tkinter as tk
import customtkinter
from PIL import Image
import os
import cv2
import dlib
from moviepy.editor import VideoFileClip
from ExtractImage import extract_frames
import cv2
def getDuration(video_path):
clip = VideoFileClip(video_path)
duration = clip.duration
clip.cl... | johnjoemer/Thesis_Tool | PreProcessing.py | PreProcessing.py | py | 4,949 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "moviepy.editor.VideoFileClip",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs"... |
8355414360 | import numpy as np
import time
import logging
from preprocess import *
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import GridSearchCV, KFold
from tensorflow.keras.layers import Dense, SimpleRNN, LSTM, Dropout, Input
from tensorflow.keras.models import Sequential
from tensorflow.ker... | pezluna/AI_001 | code/learn.py | learn.py | py | 6,177 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "kerastuner.HyperModel",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "tensorflow.keras.models.Sequential",
"line_number": 25,
"usage_type": "call"
},
{
"api_na... |
38554290402 | from pygame.math import Vector2 as V2
from pygame.math import Vector3 as V3
import pygame
import pygame.gfxdraw as gfx
import thorpy
##from stlreader import Object3D
from core3d import Object3D
from light import Light
from camera import Camera
#opti: utiliser les dist au carre. Pygame vs math vs manuel
#si la techniq... | YannThorimbert/pygame3D | maintest.py | maintest.py | py | 4,580 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pygame.math.Vector3",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pygame.math.Vector3",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pygame.math.Vector3",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "light.Lig... |
71713217920 | import openai
root_path = 'C:\\OpenAI\\'
key_file_path = f'{root_path}SECRET_KEY.txt'
key_file = open(key_file_path, "r", encoding='utf-8')
key = key_file.read()
print(f'key={key}')
openai.api_key = key
while True:
completion = openai.Completion.create(
model="text-davinci-003",
prompt=input("You: "... | donna41827/OpenAi | Project/hello.py | hello.py | py | 368 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "openai.api_key",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "openai.Completion.create",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "openai.Completion",
"line_number": 11,
"usage_type": "attribute"
}
] |
72828210240 | __author__ = "Frédéric BISSON"
__copyright__ = "Copyright 2022, Frédéric BISSON"
__credits__ = ["Frédéric BISSON"]
__license__ = "mit"
__maintainer__ = "Frédéric BISSON"
__email__ = "zigazou@protonmail.com"
from logging import getLogger
from ..token.PDFNumber import PDFNumber
from ..token.PDFListOpen import PDFListOp... | Zigazou/dietpdf | src/dietpdf/processor/PDFProcessor.py | PDFProcessor.py | py | 10,330 | python | en | code | 7 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "TokenProcessor.TokenProcessor",
"line_number": 47,
"usage_type": "name"
},
{
"api_name": "pdf.PDF.PDF",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "item.PDFR... |
39653072006 | import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
# Datos de prueba
x = np.array([1.19, 0.33, 0.26, 0.35, 0.45, 0.85, 0.43, 1.48, 0.28, 1.12, 0.18, 1.85, 0.21, 0.17, 0.44, 0.26, 0.33, 0.18, 0.10, 0.92, 0.10, 1.06, 0.39, 0.28, 0.33])
#y = np.array([6.7, 6.1, 2.3, 5.7, 2.9, 7.5, 3.7... | BCastagninoRossi/TP1_Fisica1 | leyDeEscala.py | leyDeEscala.py | py | 3,208 | python | es | code | 0 | github-code | 97 | [
{
"api_name": "numpy.array",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.full",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "scipy.optimize.curve_fit",
"line... |
44206531890 | import requests
import re
import time
import winsound
from bs4 import BeautifulSoup
# def main():
# recursion(1)
with requests.Session() as s:
root_url = "https://www.bowerypresents.com/info/events/get?scope=all&page=1&rows=99&venues=new-york-metro"
lxml = s.get(root_url).text
soup = Bea... | Crebbits/BoweryPresents-Scraper | BoweryScraper.py | BoweryScraper.py | py | 1,816 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.Session",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 27,
"usage_type": "call"
}
] |
42011838901 | import pandas as pd
import sys
import os
sys.path.append(os.getcwd())
import config.constants as constants
from sklearn.utils import resample
def rebalance_dataset(df, feature_col, unique_id_col):
balanced_df = pd.DataFrame()
max_count = df.groupby(feature_col).count()[unique_id_col].max()
max_label = df... | georgep26/640_final_project | preprocessing/rebalance.py | rebalance.py | py | 936 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sys.path.append",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_num... |
26997219192 | import sqlite3 as lite
con = lite.connect('data.db')
with con:
cur = con.cursor()
cur.execute("CREATE TABLE categorias(id INTEGER PRIMARY KEY AUTOINCREMENT, nome TEXT)")
#Criando tabela de receitas
with con:
cur = con.cursor()
cur.execute("CREATE TABLE receitas(id INTEGER PRIMARY KEY AUTOINCREMENT, c... | ViniciusNCorrea98/personal_finance | schemaSQLite.py | schemaSQLite.py | py | 557 | python | pt | code | 0 | github-code | 97 | [
{
"api_name": "sqlite3.connect",
"line_number": 3,
"usage_type": "call"
}
] |
33317078291 | import pandas as pd
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--no', type=str)
args = parser.parse_args()
output = 'test/data/output_' + args.no + '.csv'
json = 'test/data/json_' + args.no + '.csv'
df = pd.read_csv('test/data/output.csv', sep=';', header=None)
df.iloc[:, :-1].to_csv(ou... | smalltdog/ltgpos | test/split_output.py | split_output.py | py | 408 | python | tr | code | 0 | github-code | 97 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
}
] |
71977148479 | from dataclasses import dataclass, field
import numpy as np
import random
from tqdm import tqdm
import torch
from typing import List, Tuple
import gzip
import pickle
from data_utils.dataset import TokenizedDataset, SentenceDropDataset
from data_utils.sentence import Sentence
from data_utils.example import ExampleWith... | xjtuwgt/sdexample | data_utils/findcat.py | findcat.py | py | 10,960 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "data_utils.sentence.Sentence",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "data_utils.example.ExampleWithSentences",
"line_number": 23,
"usage_type": "name"
},... |
34944388489 | from unittest import mock
from unittest.mock import MagicMock
from unittest.mock import Mock
from unittest.mock import patch
from glanceclient import exc as glance_exceptions
import jsonschema
from trove.common import clients
from trove.common import exception
from trove.configuration import models as config_models
f... | openstack/trove | trove/tests/unittests/extensions/mgmt/datastores/test_service.py | test_service.py | py | 14,108 | python | en | code | 288 | github-code | 97 | [
{
"api_name": "trove.tests.unittests.trove_testtools.TestCase",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "trove.tests.unittests.trove_testtools",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "trove.tests.unittests.util.util.init_db",
"line_num... |
23731107352 | import json
def read(file_name):
with open(file_name) as json_data:
file_content = json.load(json_data)
temporalData = []
for r in file_content:
rule = []
for p in range(len(r)-1):
rule.append(set(r[p]))
rule.append(r[-1])
temporalData.append(rule)
fi... | ivan-paz/setRulex | writeReadjson.py | writeReadjson.py | py | 1,190 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "json.load",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 36,
"... |
40778048884 | from __future__ import division
import re
import sys
# beta library. supports more configurations that are still being tested.
from google.cloud import speech_v1p1beta1 as speech
from google.oauth2 import service_account
import pyaudio
from six.moves import queue
# read the Google_STT_File.py before. it is much mo... | Mozartt/Mozartt | STT_Providres/Google_STT_Microphone.py | Google_STT_Microphone.py | py | 5,341 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "google.oauth2.service_account.Credentials.from_service_account_file",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "google.oauth2.service_account.Credentials",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "google.oauth2.service_account"... |
3821559158 | import os
from unittest import TestCase
import numpy as num
import pymc3 as pm
import theano.tensor as tt
from beat.backend import NumpyChain, TextChain, check_multitrace, load_multitrace
class TestBackend(TestCase):
def setUp(self):
self.data_keys = ["Data", "A", "F", "D", "B", "Hood", "like"]
... | hvasbath/beat | test/test_backend.py | test_backend.py | py | 5,947 | python | en | code | 120 | github-code | 97 | [
{
"api_name": "unittest.TestCase",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "numpy.ones",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.power",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.eye",
"line_number... |
70828312960 | from .. import om
from .default_table import DefaultTable
from PyQt5 import Qt
class PointListPickerTableModel(om.signaling_list.DragDropModelBehavior, om.signaling_list.PropertyTableModel):
pass
class PointListPickerTable(DefaultTable):
def __init__(self, point_list_picker, model=None, parent=None):
... | erikhvatum/RisWidget | ris_widget/qwidgets/point_list_picker_table.py | point_list_picker_table.py | py | 3,327 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "default_table.DefaultTable",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "PyQt5.Qt.QItemSelectionModel",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.Qt",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "... |
25169294245 | """fix dates
Revision ID: b73363ca9f31
Revises: 069d53cf594f
Create Date: 2020-12-13 12:53:43.610801
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'b73363ca9f31'
down_revision = '069d53cf594f'
branch_labels = None
depends_on = None
def upgrade():
# ### ... | 7552-2020C2-grupo5/bookings-microservice | booking_microservice/migrations/versions/b73363ca9f31_fix_dates.py | b73363ca9f31_fix_dates.py | py | 1,339 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "alembic.op.batch_alter_table",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.DATETIME",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sqlalchem... |
19224789723 | #! /usr/bin/env python
# Example app
import os
import dash_core_components as dcc
import dash_html_components as html
from dash import Dash
from dash.dependencies import Input, Output
from flask import Flask, session
from dash_google_auth import GoogleOAuth
# configure app
server = Flask(__name__)
app = Dash(
... | lchapo/dash-google-auth | app.py | app.py | py | 1,841 | python | en | code | 61 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "dash.Dash",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": ... |
17276266700 | # -*- coding: utf-8 -*-
"""
Created on Tue Jan 14 15:56:57 2020
@author: AdminIT
"""
from sklearn.ensemble import RandomForestClassifier
clf = RandomForestClassifier(random_state=0)
X = [[ 1, 2, 3],[11, 12, 13]]
y = [0, 1] # classes of each sample
clf.fit(X, y) | seenu-g/Experiments | py_examples/untitled0.py | untitled0.py | py | 267 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "sklearn.ensemble.RandomForestClassifier",
"line_number": 10,
"usage_type": "call"
}
] |
7685367636 | import pandas as pd
from typing import NamedTuple, Union, Dict, Tuple, List
from rich.table import Table
def current_cluster_names(cluster_names: Dict[int, str]) -> List[str]:
return list(sorted(cluster_names.values()))
def get_sorted_cluster_ids(df: pd.DataFrame, cluster_column: str) -> List[str]:
return s... | pmbaumgartner/clabel | src/clabel/data_utils.py | data_utils.py | py | 3,561 | python | en | code | 29 | github-code | 97 | [
{
"api_name": "typing.Dict",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "pandas.DataFrame",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "typing.List",
"line_n... |
24939552109 | """
用于回测的交易的类
auther: YUANJIE
"""
import numpy as np
from datetime import timedelta, datetime
import pymongo
import pandas as pd
from pprint import pprint
class TradeRecordByTimes(object):
# 单次的交易记录
def __init__(self):
self.tt = None # 交易时间
self.dt = None # 交易日期,根据self.tt直接算出
self.t... | Yuan-Jie-1986/BackTestSystem3 | lib/simulator_test/simlib/tObject.py | tObject.py | py | 12,520 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "numpy.nan",
"line_number": 92,
"usage_type": "attribute"
},
{
"api_name": "numpy.nan",
"line_number": 94,
"usage_type": "attribute"
},
{
"api_name": "numpy.nan",
"line_number": 96,
"usage_type": "attribute"
},
{
"api_name": "numpy.nan",
"line_nu... |
8063557346 | #!/usr/bin/env python
from __future__ import absolute_import, division, print_function
import os
import time
import numpy as np
import tflearn
import tensorflow as tf
from numba import cuda
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '0'
from tensorflow.python.client import device_lib
def print_gpu_info():
for device i... | SixQuant/tensorflow-macos-gpu | tensorflow-gpu-04-cnn-gpu.py | tensorflow-gpu-04-cnn-gpu.py | py | 2,079 | python | en | code | 19 | github-code | 97 | [
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.python.client.device_lib.list_local_devices",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "tensorflow.python.client.device_lib",
"line_number": 15,
"usage_ty... |
5990398642 | from allennlp.common import Params
import numpy as np
from numpy.testing import assert_allclose
import pytest
from contexteval.common.custom_test_case import CustomTestCase
from contexteval.contextualizers import PrecomputedContextualizer
from contexteval.data.dataset_readers import ConllXPOSDatasetReader
class Test... | nelson-liu/contextual-repr-analysis | tests/data/dataset_readers/conllx_pos_test.py | conllx_pos_test.py | py | 6,440 | python | en | code | 211 | github-code | 97 | [
{
"api_name": "contexteval.common.custom_test_case.CustomTestCase.FIXTURES_ROOT",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "contexteval.common.custom_test_case.CustomTestCase",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "contexteval.common.custo... |
36267992147 | import pygame
from pygame import Rect
from pygame.sprite import Sprite
class Bullet(Sprite):
def __init__(self,game, isUp = True):
super().__init__()
self.settings = game.settings
self.screen = game.screen
self.isUp = isUp
if isUp == True:
self.boat = game.boats... | MaksBarahs/2playersgame | bullet.py | bullet.py | py | 1,096 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pygame.sprite.Sprite",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "pygame.image.load",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.... |
71716801919 | import pygame, config
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GL.shaders import *
from pygame.constants import HWSURFACE, OPENGL, DOUBLEBUF
from sprite import Sprite
_shader_registry=dict()
def init_gl_viewport( viewport=(800,600),
display_flags=HWSURFACE | OPENGL | DOUBLE... | aukeman/pygame_rockets | utils/gl_utilities.py | gl_utilities.py | py | 4,540 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pygame.constants.HWSURFACE",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "pygame.constants.OPENGL",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "pygame.constants.DOUBLEBUF",
"line_number": 13,
"usage_type": "name"
},
{
"api... |
2243325442 | from api.model.order_model import Order
from flask import json
from datetime import datetime
from api.model import db
from api.service import cart_service
def get_all():
return Order.query.all()
def get_by_id(id):
return Order.query.get(id)
def create_from(cart_code):
with db.session.begin():
... | gtadashii/impacta-commerce-api | api/service/order_service.py | order_service.py | py | 986 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "api.model.order_model.Order.query.all",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "api.model.order_model.Order.query",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "api.model.order_model.Order",
"line_number": 9,
"usage_type": ... |
6040481026 | import collections
import datetime
import itertools
from typing import Final
from django.shortcuts import render
from rest_framework.permissions import AllowAny
from rest_framework.request import Request
from rest_framework.views import APIView
from api.models import Diary, Post
class Statistic(APIView):
permis... | snitchyang/life-logger | api/views/statistic.py | statistic.py | py | 3,453 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "rest_framework.views.APIView",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "rest_framework.permissions.AllowAny",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "rest_framework.request.Request",
"line_number": 17,
"usage_type": "name"... |
3583534593 | import argparse
from PCM import PCM
from header import Header, ChannelModeInfo
from main_data import MainData
from side_info import SideInfo
from utils.bit import byte2str
class MP3File(object):
"""
MP3File : look for frames and break them up into headers and data, meanwhile decoding then into PCM.
"""
... | vincentX3/pydemp3 | mp3.py | mp3.py | py | 6,980 | python | en | code | 7 | github-code | 97 | [
{
"api_name": "PCM.PCM",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "utils.bit.byte2str",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "header.Header",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "header.protection",
"lin... |
42373038653 | import os
import logging
from virttest.libvirt_xml import vm_xml
from autotest.client.shared import error
from virttest import utils_libvirtd, virsh
from virttest.utils_test.libvirt import cpus_parser
try:
from virttest.staging import utils_cgroup
except ImportError:
# TODO: Obsoleted path used prior autotest... | will-Do/tp-libvirt_v2v | libvirt/tests/src/virsh_cmd/domain/virsh_emulatorpin.py | virsh_emulatorpin.py | py | 8,300 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "autotest.client.shared.utils_cgroup.resolve_task_cgroup_path",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "autotest.client.shared.utils_cgroup",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 27,
"usage... |
4399575594 | from djitellopy import Tello
import tensorflow as tf
from enum import Enum, auto
import numpy as np
import math
import cv2
import torch
import time
# x1 (pixels) y1 (pixels) x2 (pixels) y2 (pixels) confidence class
# tensor([[4.13370e+02, 2.51479e+02, 6.40000e+02, 4.80000e+02, 2.58489e-01, 0.00000... | TomorrowIppo/LockheedMatin | 3rd_qualification/main_dir/main_test.py | main_test.py | py | 29,992 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "torch.hub.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.hub",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "time.time",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_numbe... |
74665297279 | import requests
from zipfile import ZipFile
import unicodedata
import os
import re
from process_cornell import create_training_files
def maybe_download_and_read_file(url, filename):
""" Download and unzip training data
Args:
url: data url
filename: zip filename
Returns:
Training... | ChunML/NLP | chatbot/data_utils.py | data_utils.py | py | 1,431 | python | en | code | 96 | github-code | 97 | [
{
"api_name": "os.path.exists",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "requests.Session",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "zipfile.ZipFile",
"l... |
21736768252 | from itertools import groupby
def func(alist):
def ctr_ele(el):
if len(el)>1: return [len(el), el[0]]
else: return el[0]
return [ctr_ele(list(group)) for key, group in groupby(alist)]
n_list = [1,1,2,3,4,4,5, 1]
print("Original list:")
print(n_list)
print("\nList reflecting the... | priyanka-yadav-drc/Python_training | List/76.py | 76.py | py | 394 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "itertools.groupby",
"line_number": 6,
"usage_type": "call"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.