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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
74627185960 | # Imports
import csv
import cv2
import cv2.aruco as aruco
import numpy as np
import math
import os
import shlex
import subprocess
import tempfile
import olympe
from olympe.messages.ardrone3.Piloting import TakeOff, Landing
from olympe.messages.ardrone3.Piloting import moveBy
from olympe.messages.ardrone3.PilotingStat... | brld/e17 | Anafi/fullcycle.py | fullcycle.py | py | 6,461 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "olympe.Drone",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "tempfile.mkdtemp",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
69958011241 | import sys
from collections import deque
sys.setrecursionlimit = 10 ** 9
N, M = map(int, input().split())
V = {i: [] for i in range(1,N+1)}
for _ in range(M):
a, b = map(int, input().split())
V[a].append(b)
INF = float('inf')
def get_cycle(s):
H = deque()
seen = {i: False for i in range(1,N... | ayatough/AtCoder | ABC142/F.py | F.py | py | 1,575 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sys.setrecursionlimit",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 12,
"usage_type": "call"
}
] |
35593682223 | from __future__ import print_function
import glob
import math
import os
from IPython import display
from matplotlib import cm
from matplotlib import gridspec
from matplotlib import pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from sklearn import metrics
import tensorflow as tf
from tenso... | Baileyswu/google-tensorflow-tutor | digit_recognition/train.py | train.py | py | 5,497 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "tensorflow.feature_column.numeric_column",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "tensorflow.feature_column",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "input_fn.create_predict_input_fn",
"line_number": 61,
"usage_type... |
3686701767 | """The data models used in RASCIL:
"""
__all__ = [
"Configuration",
"GainTable",
"PointingTable",
"Image",
"GridData",
"ConvolutionFunction",
"Skycomponent",
"SkyModel",
"BlockVisibility",
"FlagTable",
"QA",
"ScienceDataModel",
]
import logging
import warnings
import ... | NLESC-quantum/rascil | rascil/data_models/memory_data_models.py | memory_data_models.py | py | 59,358 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "warnings.simplefilter",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "astropy.wcs.FITSFixedWarning",
"line_number": 39,
"usage_type": "argument"
},
{
"api_name": "warnings.simplefilter",
"line_number": 40,
"usage_type": "call"
},
{
"api_... |
36354376662 | def time_data():
import requests
time_api = 'https://www.timeapi.io/api/Time/current/zone?timeZone=Europe/Dublin'
time = requests.get(time_api)
response = time.status_code
if response != 200:
raise ValueError("url not reached.")
time_data = time.json()
#print(time_data)
times... | JasonBallantyne/BestBus | django_graphQL/bus_routes/apis/time_data.py | time_data.py | py | 366 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 5,
"usage_type": "call"
}
] |
684285334 | import json
import os
import time
from firebase import firebase
import requests
from shutil import copyfile
from termcolor import cprint
from pyfiglet import figlet_format
from question import Question
firebase = firebase.FirebaseApplication('https://quizzapp-299a2.firebaseio.com/', None)
def load_quiz_info(quiz_fil... | SudiLillian/Test-App | actions.py | actions.py | py | 7,823 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "firebase.firebase",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "firebase.firebase.FirebaseApplication",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "qu... |
28122282645 |
from typing import Tuple
from math import ceil
def get_landing_zone() -> Tuple[Tuple[int, int], Tuple[int, int]]:
with open("Day17/input.txt", 'r') as f:
for line in f.read().splitlines():
zones = line.split("target area: ")[1].split(", ")
zones = tuple(tuple(map(lambda x: int(x),... | AaronElijah/AdventOfCode2021 | Day17/solution1.py | solution1.py | py | 570 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "typing.Tuple",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "math.ceil",
"line_number": 17,
"usage_type": "call"
}
] |
6330640970 | from typing import List
from smapi.database import datasource
from smapi.database import schemas
from smapi.routers.auth import get_current_user
from fastapi import APIRouter, Depends
router = APIRouter(
prefix="/tags",
tags=["Tags"]
)
@router.get("/{id}", response_model=schemas.Preview.Tag)
async def get_ta... | IgorJakovljevic/CoDiS-SurveyTool | SocialMediaServer/smapi/routers/tags.py | tags.py | py | 1,927 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "smapi.database.schemas.Preview",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "smapi.database.schemas",
"line_number": 14,
"usage_type": "name"
},
{
"api_n... |
1860745977 | from flask import Blueprint, render_template, request, session, redirect, url_for
from src.models.alerts.alert import Alert
from src.models.items.item import Item
from src.models.users.decorators import requires_login
alert_blueprint = Blueprint('alerts', __name__)
@alert_blueprint.route('/')
def index():
retur... | erik-appelblad/price-alert-web-app | src/models/alerts/views.py | views.py | py | 2,069 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask.Blueprint",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "flask.request.... |
73324498281 | #Conditional Statements - if
name=input("Enter Name:")
if name=="Suresh" :
print("Hello Suresh Good Morning")
print("How are you!!!")
#Conditional Statements - if else
name=input("Enter Name:")
if name=="Suresh" :
print("Hello Suresh Good Morning")
else:
print("Hello Guest Good Moring")
print("How are you!... | JagadeeshwaranM/Data_Engineering_Simplified | 01 - Data Engineering Basics/Python/10_Looping.py | 10_Looping.py | py | 2,113 | python | en | code | 620 | github-code | 18 | [
{
"api_name": "pdb.set_trace",
"line_number": 49,
"usage_type": "call"
}
] |
29225742066 | from django.db import models
from django.contrib.auth.models import User
from django.utils.translation import ugettext as _
from userena.models import UserenaBaseProfile
from django.core.validators import RegexValidator
class MyProfile(UserenaBaseProfile):
user = models.OneToOneField(User, unique=True,
... | gordio/smk-resume-test | accounts/models.py | models.py | py | 784 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "userena.models.UserenaBaseProfile",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.db.models.OneToOneField",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.models.User",
"line_number": 9,
"usage_type": "argumen... |
9194380093 | from django.contrib import admin
from django.urls import path
from .views import (
api_list_customer,
api_list_salesrecords,
api_list_salesreps,
api_show_customer,
api_show_salesrep,
)
urlpatterns = [
path('admin/', admin.site.urls),
path("salesreps/", api_list_salesreps, name = "list_sa... | yeseniaramirez14/stay-classic | sales/api/sales_rest/urls.py | urls.py | py | 633 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.urls.path",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "... |
17088782270 | import copy
import quopri
# ---------abstract classes----------------
import sqlite3
from patterns.behavioral import ConsoleWriter, Subject
from patterns.unit_of_work import DomainObj
class User:
def __init__(self, name):
self.name = name
class Teacher(User):
pass
class Student(User, DomainObj):... | Oleg-Lo/oleglo_py_web_app | patterns/creational.py | creational.py | py | 6,592 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "patterns.unit_of_work.DomainObj",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "copy.deepcopy",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "patterns.behavioral.Subject",
"line_number": 48,
"usage_type": "name"
},
{
"api_nam... |
27224261110 | from PyQt5.QtWidgets import QMainWindow, QLabel, QVBoxLayout, QWidget
from PyQt5.QtGui import QPixmap
from PyQt5.QtCore import Qt
import requests
class WeatherApp(QMainWindow):
def __init__(self, data):
super().__init__()
self.setWindowTitle("Weather Forecast")
self.setGeometry(100, 100, 4... | mariam-diab/city-weather-API | weather_app.py | weather_app.py | py | 2,424 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QVBoxLayout",
"line_number": 15,
"usage_type": "call"
},
{
"ap... |
141943673 | # -*- coding: utf-8 -*-
from cobradb.models import *
from cobradb import settings
from cobradb.model_dumping import dump_model
from cobradb import parse
from cobradb.util import (increment_id, check_pseudoreaction, load_tsv,
get_or_create_data_source, format_formula, scrub_name,
... | SBRG/cobradb | cobradb/model_loading.py | model_loading.py | py | 47,847 | python | en | code | 21 | github-code | 18 | [
{
"api_name": "os.listdir",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "cobradb.settings.data_directory",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "cobradb.... |
6553052779 | from collections import deque
n = int(input())
arr = [int(x) for x in range(1, 10)]
q = deque(arr)
dp = [0]
"""
basic_arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
max_number = 9876543210
만들 수 있는 가짓 수 = 2**10 -1 = 1023개(모든 부분 집합 - 공집합)
1023개를 넘는 n이 들어오면 -1로 다 튕겨내면 된다.
temp 값의 마지막 값만을 계속 비교해야 하는 것을 놓쳤었다.
그래서 중간에 100, 200이 dp... | timetobye/BOJ_Solution | problem_solve_result/1038.py | 1038.py | py | 816 | python | ko | code | 2 | github-code | 18 | [
{
"api_name": "collections.deque",
"line_number": 6,
"usage_type": "call"
}
] |
41676907409 | import cv2
from matplotlib import pyplot as plt
class MyOpenCv:
def __init__(self):
self.file_path = "image.jpg"
self.image = cv2.imread(self.file_path)
def get_image(self, file_path="image.jpg"):
if file_path is None:
file_path = self.file_path
image = cv2.imread(... | secxndary/PMMP_Labs_7sem | PMMP_Lab1/main.py | main.py | py | 4,267 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "cv2.imread",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.imwrite",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_number": 31,
... |
3998236116 | #!/usr/bin/env python
"""Run specified faults in the provided CSV file."""
from __future__ import print_function
import sys
import os
import numpy
import matplotlib.pyplot as plt
import batch
import clawpack.geoclaw.dtopotools as dtopotools
# def calculate_1parameter_quadrature(param_range):
# r"""Calculates... | mandli/tohoku-pc | run_faults.py | run_faults.py | py | 7,300 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "batch.Job",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "clawpack.geoclaw.dtopotools.UCSBFault",
"line_number": 97,
"usage_type": "call"
},
{
"api_name": "clawpack.geoclaw.dtopotools",
"line_number": 97,
"usage_type": "name"
},
{
"... |
41907940840 | import argparse
import os, shutil
import csv
def process_path(path):
if len(path) > 1:
if path[-1:] == os.sep:
return path
else:
return path + os.sep
else:
return ''
def get_file_name(csv_dir):
for d, dirs, files in os.walk(csv_dir):
f... | multi-os-engine/art | test/MOEArtTest/art_tests_csv_report.py | art_tests_csv_report.py | py | 2,181 | python | en | code | 6 | github-code | 18 | [
{
"api_name": "os.sep",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.sep",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.walk",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 18,
... |
26846735749 | import functools
import requests
import psutil
from collections import Counter
def memory(f):
def internal(*args, **kwargs):
process = psutil.Process()
memory_usage_before = process.memory_info().rss
print(f'Usage memory before {memory_usage_before}')
f(*args, **kwargs)
mem... | AlinaKovban/hillel_python_pro | homework_1_decorators/homework_1_decorators.py | homework_1_decorators.py | py | 1,409 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "psutil.Process",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "functools.wraps",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "requests.get",
... |
21482012260 | from utils import get_connection, insert_data
from youtube_video import *
import pandas as pd
import os
USER = os.environ["db_user"]
PWD = os.environ["db_password"]
HOST = os.environ["db_host"]
PORT = os.environ["db_port"]
DATABASE = os.environ["database"]
YOUTUBE_API_KEY = os.environ["youtube_api_key"]
RAPID_API_KEY ... | eeliuqin/Youtube-Trending-Videos-Pipeline-and-Analysis | lambda_function.py | lambda_function.py | py | 5,244 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.environ",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_n... |
40202295235 | import pyttsx3
import pywhatkit
import speech_recognition as sr
import datetime
import wikipedia
# import pyjokes
# speech recognition basically this is going to listen for voice input using the python speech recognition library.
listener = sr.Recognizer()
engine = pyttsx3.init()# initializes python text to speach ... | InoAlexander/SmartSpeakerSpiderThing | main.py | main.py | py | 3,102 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "speech_recognition.Recognizer",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pyttsx3.init",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "speech_recognition.Microphone",
"line_number": 28,
"usage_type": "call"
},
{
"api_name"... |
40949528645 | #!/usr/bin/python
#coding:utf-8
import wx
class MiniFrame(wx.MiniFrame):
def __init__(self):
wx.MiniFrame.__init__(self, None, -1, 'Mini Frame', size=(300,100), style=wx.DEFAULT_FRAME_STYLE | wx.THICK_FRAME)
panel = wx.Panel(self, -1, size=(300,100))
button = wx.Button(panel, -1, 'Close Me', pos=(15, 15))
se... | xuguangmin/Programming-for-study | wxpythonInAction/part2_基本的wxPython/_8把窗口部件放入框架中/8.9_创建一个小型框架.py | 8.9_创建一个小型框架.py | py | 602 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "wx.MiniFrame",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "wx.MiniFrame.__init__",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "wx.MiniFrame",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "wx.DEFAULT_FRA... |
7020808889 | # -*- encoding: utf-8 -*-
'''
@Author : {Yixu}
@Contact : {xiyu111@mail.ustc.edu.cn}
@Software: PyCharm
@File : run_main.py.py
@Time : 2021/9/20 14:24
'''
import argparse
import logging
import mini_spider
import log #导入日志模块
if __name__ == '__main__':
'''
主程序,程序入口
'''
log.init_log('./log_data/m... | MasterXiYu/mini_spider | python_coder/run_main.py | run_main.py | py | 1,375 | python | zh | code | 0 | github-code | 18 | [
{
"api_name": "log.init_log",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "mini_spider.MiniSpi... |
29858459581 | import torch
import numpy as np
import pandas as pd
from transformers import AutoTokenizer, T5EncoderModel
if __name__ == "__main__":
print('getting embedding of product names using t5-small')
df = pd.read_csv('data/label_df.csv', index_col=0)
with open('data/images_downloaded.txt', 'r') as f:
line... | FernandoDanielArroyo/OpenFoodFacts | embedding_label.py | embedding_label.py | py | 1,387 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.read_csv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "transformers.AutoTokenizer.from_pretrained",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "transformers.AutoTokenizer",
"line_number": 13,
"usage_type": "name"
},
{
... |
23906444529 | from fas import fas_api
from fas import fas_client
from json import dumps
import polars as pl
from sys import argv
def s0():
# show total US consumption for corn: between 2018 and 2023
res = fas_client.get_commodity_data("ZC", 2018, 2023)
if res:
df = pl.f... | toobrien/usda_api | fas_samples.py | fas_samples.py | py | 2,841 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "fas.fas_client.get_commodity_data",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "fas.fas_client",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "polars.from_dict",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pol... |
7466426217 | from fastargs import get_current_config
from fastargs.decorators import param
from fastargs import Param, Section
from fastargs.validation import And, OneOf
from argparse import ArgumentParser
import numpy as np
Section('trainer').params(
multiple=Param(int, 'multiple', required=True),
)
def main(*_, index, logdi... | MadryLab/datamodels | examples/minimal/train_minimal.py | train_minimal.py | py | 770 | python | en | code | 15 | github-code | 18 | [
{
"api_name": "fastargs.Section",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "fastargs.Param",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_numb... |
35422770389 | from django.contrib import admin
from .models import Restraunt, Branch, Menu, Dish, Category, FoodItem
# Register your models here.
class BranchAdmin(admin.ModelAdmin):
list_display = [
'name',
'area',
'city',
'country',
'state',
'pinCode',
'isOpen'
]
... | shubham2803/my_restaurant | src/home/admin.py | admin.py | py | 1,089 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 19,
"usage_type": "attribute"
... |
7477202357 | from torch.utils.data import DataLoader
from src.constants.consts import PAD, DATA, TARGET
from src.data.make_dataset import read_datasets
from src.utils.dataset_utils import make_text_dataloader
from tests.utils.fixtures import preprocessed_dataset_file
def test_text_dataloader(preprocessed_dataset_file):
batch... | made-ml-in-prod-2021/wunder9l | ml_project/tests/train/test_dataloaders.py | test_dataloaders.py | py | 1,000 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "src.data.make_dataset.read_datasets",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tests.utils.fixtures.preprocessed_dataset_file",
"line_number": 15,
"usage_type": "argument"
},
{
"api_name": "src.utils.dataset_utils.make_text_dataloader",
"line_n... |
34022614548 | import logging
from typing import Dict, Any, List, Optional
from ix.agents.models import Agent
from ix.chains.callbacks import IxHandler
from langchain import BasePromptTemplate
from ix.chat.models import Chat
from langchain.callbacks.manager import (
AsyncCallbackManagerForChainRun,
CallbackManagerForChainRu... | kreneskyp/ix | ix/chains/agent_interaction.py | agent_interaction.py | py | 3,862 | python | en | code | 809 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "ix.chat.models.Chat",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"l... |
35068758318 | import pandas as pd
import numpy as np
from gensim import corpora, models, similarities
from collections import Counter
import nltk
stpwds = set(nltk.corpus.stopwords.words("english"))
node_information = pd.read_csv('./Data/node_information.csv',names=['id','year','title','author','journal','abstract'])
titles = lis... | ZJCODE/Data_Competition | Link Prediction/extract_title_abstract_feature.py | extract_title_abstract_feature.py | py | 3,146 | python | en | code | 18 | github-code | 18 | [
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "nltk.corpus",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.Data... |
36288689454 | import torch
import pytorch_lightning as pl
from pytorch_lightning import LightningModule
import torch.nn.functional as F
from torch.utils.data import DataLoader
import numpy as np
import pyformulas as pf
from .utils import ZiCDataset
import matplotlib.pyplot as plt
class VAEBase(LightningModule):
def __init__(s... | ryanliu30/ZiNet | VAE_CNN/VAEbase.py | VAEbase.py | py | 5,821 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pytorch_lightning.LightningModule",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "pyformulas.screen",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "utils.ZiCDataset",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "... |
18434492339 | # -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import numpy as np
import math
import torch.autograd as autograd
from ...utils.nn import get_rnn_hidden_state
from .. import FF
from ..variational_dropout import Variati... | anon0001/adv_rec | MMT/nmtpytorch/layers/decoders/conditional.py | conditional.py | py | 23,289 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "torch.nn.Module",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "torch.nn",
"line_number": 49,
"usage_type": "argument"
},
{
"api_name": "torch.nn.Embedding",
"... |
36551897807 | import os
from PIL import Image, ImageDraw, ImageFont
im = Image.open(f"lesson_013/python_snippets/post_card.jpg")
print(im.format, im.size, im.mode)
w, h = im.size
resized_im = im.resize((w//2, h//2))
print(resized_im.format, resized_im.size, resized_im.mode)
draw = ImageDraw.Draw(resized_im)
path = os.path.join('... | mishandri/Python_Base_SkillBox | lesson_013/python_snippets/05_PIL_sample.py | 05_PIL_sample.py | py | 668 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "PIL.Image.open",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "PIL.ImageDraw.Draw",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "PIL.ImageDraw",
"line_n... |
19697536199 | from openpyxl import load_workbook,Workbook
from openpyxl.styles import Font,Alignment
class cl:
grade = 0 #年级
name = ''
total = 0 #总计
unfi = 0 #未完成
per = 0 #完成率
def __init__(self,n,t):
self.name = n
self.total = t
def __lt__(self,others):
return self.per < oth... | chaoswindabc/qndxxtj | qndxx.py | qndxx.py | py | 3,521 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "openpyxl.load_workbook",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "openpyxl.load_workbook",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "openpyxl.load_workbook",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "... |
13823557956 | # Script will convert existing log files from Splunk to GrayLog
# Imports
import os
import time
import yaml
import splunklib.results as results
import splunklib.client as client
import requests as requests
# Base configuration
# Splunk search info
HOST = "Splunk" # Splunk server
PORT = 8089 # Splunk REST API port
U... | ImRaptor/SplunkToGray | SplunkToGray.py | SplunkToGray.py | py | 2,255 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "os.name",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "os.path.isdir",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "os.mkdir",
"line_number":... |
5038375650 | from flask import Blueprint, request,jsonify
from flask import render_template,redirect,request,url_for,session,flash,escape
import sendgrid
import os
from flask_login import LoginManager,login_required,current_user,login_user,logout_user
from models.user import User
from models.image import Image
from rqueue import q
... | Kingmercy-Rayne/Nextagram | instagram_api/blueprints/images/views.py | views.py | py | 1,150 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask.Blueprint",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.request.args.get",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "flask.request.args",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "flask.... |
39041934043 | from collections import Counter
N = int(input())
n_list = []
for i in range(N):
n_list.append(int(input()))
n_list.sort()
print(round(sum(n_list)/N))
print(n_list[int((N-1)/2)])
cnt = Counter(n_list).most_common(2)
if len(n_list) > 1:
if cnt[0][1] == cnt [1][1]:
print(cnt[1][0])
else: print(cnt[0... | NewP1/Baekjoon_sol | Class2/Baekjoon_2108.py | Baekjoon_2108.py | py | 386 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "collections.Counter",
"line_number": 12,
"usage_type": "call"
}
] |
20018767764 | from flask import Flask,request,flash,render_template
from flask_mail import Mail,Message
app =Flask(__name__)
app.secret_key="123"
@app.route("/",methods=["POST","GET"])
def mail():
if request.method=="POST":
fmail=request.form.get('fmail')
tmail = request.form.get('tmail')
fpwd = req... | sathyainfotech/Send-Mail | Mail/app.py | app.py | py | 951 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "flask.request.form.g... |
23708640839 | import csv
import codecs
import pprint
import re
import xml.etree.cElementTree as ET
import cerberus
import schema
OSM_PATH = "dubai_abu-dhabi.osm"
NODES_PATH = "nodes.csv"
NODE_TAGS_PATH = "nodes_tags.csv"
WAYS_PATH = "ways.csv"
WAY_NODES_PATH = "ways_nodes.csv"
WAY_TAGS_PATH = "ways_tags.csv"
LOWER_COLON = re.co... | muraleo/Dubai_data_analysis | osm_project.py | osm_project.py | py | 7,908 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "re.compile",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "schema.schema",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "xml.etree.cElementTree.iterp... |
43546831321 | from django.conf import settings
from django.contrib.sites.models import Site
def globals(request):
data = {}
data.update({
'CURRENT_SITE': Site.objects.get_current(),
'DEFAULT_FROM_EMAIL': settings.DEFAULT_FROM_EMAIL,
'SUPPORT_EMAIL': settings.SUPPORT_EMAIL,
'GOOGLE_ANALYTICS_... | codeadict/ecomarket | apps/main/context_processors.py | context_processors.py | py | 834 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "django.contrib.sites.models.Site.objects.get_current",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.contrib.sites.models.Site.objects",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.sites.models.Site",
"line_num... |
23683432844 | """
This file will contain the stuff necessary for creating the roster and uploading the submissions.
"""
from fullGSapi.api.login_tokens import LoginTokens
import getpass
import os
import csv
from tqdm import tqdm
gs_roster_loc = "files/input/gs_roster.csv"
canvas_roster_loc = "files/input/canvas_roster.csv" # Curren... | 61c-teach/TotalCoursePointsFE | local_setup.py | local_setup.py | py | 8,634 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "sys.argv",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "fullGSapi.api.login_tokens.LoginTokens",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "fullGSapi.api.login_tokens.LoginTokens.load",
"line_number": 37,
"usage_type": "call... |
74429340199 | import os
from flask import Flask, render_template, redirect, request, url_for
from flask_sqlalchemy import SQLAlchemy
from datetime import datetime
import pytz
app = Flask(__name__)
#ファイルのパス
base_dir = os.path.dirname(__file__)
# sqliteのファイル保存先を指定
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + os.path.join(... | yukisakakima/logical-tapes | flaskr/app.py | app.py | py | 3,579 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_numb... |
22623481314 | import traceback
from time import sleep
from selenium import webdriver
from selenium.webdriver.common.by import By
import unittest
from logger import Logger
class WebKitFeatureStatusTest(unittest.TestCase):
def setUp(self):
log.logger.info('seba start...')
self.driver = webdriver.Safari()
def... | ccliuyang/quantest | Spider/seba_v2.0.py | seba_v2.0.py | py | 2,156 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "unittest.TestCase",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver.Safari",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "ti... |
3547967775 | import urllib.request
import urllib.parse
from bs4 import BeautifulSoup
import pandas as pd
import openpyxl
import firebase_admin
from firebase_admin import credentials
from firebase_admin import db
cred = credentials.Certificate('react-with-firebase-f9b6e-firebase-adminsdk-nqjsb-0b44051b21.json')
firebase_admin.init... | Lee-Eun-Ju98/hanium_project | crawling.py | crawling.py | py | 3,515 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "firebase_admin.credentials.Certificate",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "firebase_admin.credentials",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "firebase_admin.initialize_app",
"line_number": 12,
"usage_type": "call"... |
73811692520 | import json
import logging
import logging.handlers
import os
import os.path
import socketserver as SocketServer
import threading
from types import TracebackType
from typing import TYPE_CHECKING, Any, Optional, Type
from toil.lib.misc import get_public_ip
from toil.statsAndLogging import set_log_level
if TYPE_CHECKING... | DataBiosphere/toil | src/toil/realtimeLogger.py | realtimeLogger.py | py | 9,026 | python | en | code | 856 | github-code | 18 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "socketserver.BaseRequestHandler",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_n... |
7355565865 | from requests import post
from urllib.parse import urlencode as ncode
from headerz import headerz as hdd
import re,html,sys
def header():
raw ="""
POST /javascript-obfuscator.php HTTP/1.1
Host: beautifytools.com
User-Agent: Mozilla/5.0 (Android 9; Mobile; rv:68.0) Gecko/68.0 Firefox/68.0
Accept: text/html... | karjok/js-encoder | js-obfuscate.py | js-obfuscate.py | py | 1,738 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "headerz.headerz",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "urllib.parse.urlencode",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "re.search",
... |
37555555719 | import torch
import torch.nn as nn
import torch.optim as optim
import torchvision.utils as vutils
from torch.autograd import Variable
import torch.nn.functional as F
import models.sgan as sgan
def weights_init(m):
classname = m.__class__.__name__
if classname.find('Conv') != -1:
m.weight.data.normal_... | progradeep/gan-pytorch | SGAN/trainer.py | trainer.py | py | 6,202 | python | en | code | 11 | github-code | 18 | [
{
"api_name": "models.sgan._netG",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "models.sgan",
"line_number": 50,
"usage_type": "name"
},
{
"api_name": "torch.load",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "models.sgan._netD",
"lin... |
70922503079 | import customtkinter as ctk
from customtkinter import filedialog
from tkinter import IntVar
from PIL import Image
import hashlib
from pathlib import Path
from datetime import datetime
from time import time, sleep
import requests
# Domain Name for Web Requests
domainName = "https://ransom-detect.cyclic.cloud/"
# domai... | prathameshdk02/Signature-Based-Ransomware-Detection | frontend/src/interface/ui.py | ui.py | py | 27,704 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "customtkinter.set_appearance_mode",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "customtkinter.set_default_color_theme",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "customtkinter.CTk",
"line_number": 33,
"usage_type": "call"
},
... |
9849817250 | from bs4 import BeautifulSoup as bs
from urllib import request
from functools import lru_cache
from transformers import pipeline
import data
import requests
import unicodedata
import re
import spacy
# Loading spacy
nlp = spacy.load("en_core_web_sm")
# Class representing a recipe
class Recipe:
# Class representing ... | nathanheidacker/conversational_agent | src/recipe.py | recipe.py | py | 17,414 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "spacy.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "data.cooking_methods",
"line_number": 62,
"usage_type": "attribute"
},
{
"api_name": "data.all_ingredients",
"line_number": 65,
"usage_type": "attribute"
},
{
"api_name": "data.t... |
7967960676 | import io
import logging
import os
import fontTools
import fontTools.ttLib
import ufoLib2
import vttLib
logger = logging.Logger(__name__)
def dump_to_file(font: fontTools.ttLib.TTFont, path: os.PathLike) -> None:
"""Dump relevant VTT data to a file.
Relevant are:
- TSI1 holds the assembly code
- T... | daltonmaag/vttLib | src/vttLib/transfer.py | transfer.py | py | 4,194 | python | en | code | 22 | github-code | 18 | [
{
"api_name": "logging.Logger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "fontTools.ttLib",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.PathLike",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "vttLib.VTTLibArg... |
34151707825 | # -*- coding: UTF-8 -*-
from io import BytesIO
from PIL import Image, ImageDraw, ImageFont
'''Use Python 3.9+'''
TEMPLATE_PATH = '../chat_bot/files/Билет.jpg'
FONT_PATH = '../chat_bot/files/calibri.ttf'
FONT_SIZE = 25
BLACK = (0, 0, 0, 255)
DEPARTURE_CITY_OFFSET = (147, 130)
ARRIVAL_CITY_OFFSET = (120, 182)
DEPARTU... | sergeytompson/Fly-online | utils/generate_ticket.py | generate_ticket.py | py | 2,157 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "PIL.Image.open",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "PIL.ImageFont.truetype",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "PIL.ImageFont",
"... |
5161741746 | from django.conf import settings
from django.contrib.auth import get_user_model
from django.middleware.csrf import get_token
"""
Middleware to set the default user for the development environment
* In order to prevent dealing with users authentication during frontend development all request will get the default user
"... | Arison7/MessagerApi | main/middleware.py | middleware.py | py | 1,408 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "django.conf.settings.DEBUG",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 16,
"usage_type": "call"
},
... |
14771677973 | """
$ python3 path/to/test_rest.py
"""
import requests
def test_request(console_message, method, uri, request_body={}):
print(console_message)
response = requests_dot_method(method, uri, request_body)
print(response.status_code)
print(response.headers)
print(response.json())
print()
return... | clever-wildcard/springboot-gradle-docker-aws | test_rest.py | test_rest.py | py | 1,795 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "requests.post",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "requests.put",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "requests.delete",
"line_n... |
32761483542 | import datetime
from flask import request, redirect, url_for, render_template, flash, Blueprint, current_app as app
from .forms import RSVPForm, RSVPFreeForm
from .models import RSVP, Invite, db
from .utils import rsvp_notify
rsvp = Blueprint('rsvp', __name__, template_folder='templates', static_folder='static')
@r... | jhalcrow/ournewballandchain | ournewballandchain/rsvp.py | rsvp.py | py | 1,811 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "flask.Blueprint",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.request.args.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.request.args",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "flask.r... |
40045261104 | from __future__ import annotations
import argparse
import pathlib
LOGLEVELS = ["HEADLESS", "CRITICAL", "ERROR", "WARNING", "INFO", "DEBUG"]
DEFAULT_LOGLEVEL = "INFO"
FILTERS = ["py", "dyn"]
class Options(argparse.Namespace):
"""Class for options for running a conversion like from the command line"""
def __... | infeeeee/dyn2py | dyn2py/options.py | options.py | py | 3,377 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "argparse.Namespace",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "pathlib.P... |
18698491555 | import requests
from take_audio import recognize_wav_file
if __name__ == '__main__':
default = '/home/hungshing/FastData/ezTalk/users/msn9110/voice_data/uploads/sentence-t2/我不想吃義大利麵/20220525-155634.wav'
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--path', '-p', type=str, d... | msn9110/ezTalk-server | sender2.py | sender2.py | py | 867 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "take_audio.recognize_wav_file",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 24,
"usage_type": "call"
}
] |
21628894330 | # Maciej Sikora
# Github id: maciek04786
#
# This is a rain alert app, which tells you whether it will rain today,
# based on coordinates given in weather_parameters, it uses open weather
# map api, registration is free
import requests
weather_parameters = {
"lat": 50.394050,
"lon": -3.516020,
"appid": "Y... | ShReYaGaRG021/shreya_hacktoberfest | Python/rain_alert.py | rain_alert.py | py | 876 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 17,
"usage_type": "call"
}
] |
23909406394 | #Imports
from PIL import Image
class RescaleImage(object):
'''
Rescales the image to a given size.
'''
def __init__(self, output_size):
'''
Arguments:
output_size (tuple or int): Desired output size. If tuple, output is
matched to output_size... | Adarsh-Patel2004/Python_Project | CS29006_SW_Lab_Spr2023/Python_DS_Assignment_Question_02/my_package/data/transforms/rescale.py | rescale.py | py | 1,416 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "PIL.Image.open",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 33,
"usage_type": "name"
}
] |
38983789618 | import socket
from http import HTTPStatus
HOST_AND_PORT = ("127.0.0.1", 20000)
def server_start(host_and_port=HOST_AND_PORT):
with socket.socket() as server_socket:
server_socket.bind(host_and_port)
server_socket.listen()
print(f"Server started on {host_and_port}")
while True:
... | gulf98/Echo-server | echo_server.py | echo_server.py | py | 1,848 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "socket.socket",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "http.HTTPStatus",
"line_number": 59,
"usage_type": "name"
},
{
"api_name": "http.HTTPStatus",
"line_number": 61,
"usage_type": "call"
}
] |
36966475229 | import jax
import jax.numpy as jnp
def autocorr(chains, n_lags=20):
# estimate mean of each param
means = chains.mean(axis=[0, 1])
# single param, single lag
def acf(y, mean, lag):
a = y[n_lags:]
b = jnp.roll(y, lag)[n_lags:]
cov_ab = ((a - mean) * (b - mean)).mean()
c... | martin-marek/bsc-project | core/metrics.py | metrics.py | py | 2,128 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "jax.numpy.roll",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "jax.numpy",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "jax.numpy.sqrt",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "jax.numpy",
"line_number"... |
74838235880 | """
A module to compute bigwig coverage over a set of regions (bed).
"""
import os
import sys
from itertools import repeat
from tempfile import NamedTemporaryFile
import billiard as multiprocessing
import numpy as np
import pyBigWig
from pybedtools import BedTool
import pygtftk
from pygtftk.utils import GTFtkError
f... | dputhier/pygtftk | pygtftk/bwig/bw_coverage.py | bw_coverage.py | py | 17,568 | python | en | code | 37 | github-code | 18 | [
{
"api_name": "billiard.Manager",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "pygtftk.utils",
"line_number": 56,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "os.path",
"lin... |
36456983854 | #!/usr/bin/env python3
""""
scraper_monthly_rendextracts.py
Organizes the month range and then calls extractFromWithinAFundoReport.py month to month
"""
import datetime
from dateutil.relativedelta import relativedelta
import settings as sett
# from models.extractFromWithinAFundoReport import WithinFundoExtractScraper... | alclass/Beans_Counter_Proj_SwDv | scrapers/bbfi/scraper_monthly_rendextracts.py | scraper_monthly_rendextracts.py | py | 2,374 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "datetime.date",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "datetime.date",
"l... |
40798070959 | from os import path, getcwd
import json
from . import env
from . import backend_config
from .component import is_workspaced
from .component import resolve_variable_opts
from .dependencies import get_cascades
from ...commands.types.target import parse_target
commands_no_vars = [
'output',
'fmt',
'valid... | cicdenv/cicdenv | lib/cicdctl/utils/terraform/driver.py | driver.py | py | 4,991 | python | en | code | 8 | github-code | 18 | [
{
"api_name": "os.getcwd",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "os.getcwd",
"line_number": 44,
... |
5202266590 | #!/usr/bin/python3
'''
run a set of commands in a given order,
given information about how many free slots
the host has for such processes and how many
slots each process takes.
'''
import os
import sys
import getopt
from subprocess import Popen
import logging
import time
import smtplib
import email.mime.text
import js... | wikimedia/operations-dumps | xmldumps-backup/dumpscheduler.py | dumpscheduler.py | py | 27,774 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 103,
"usage_type": "call"
},
{
"api_name": "os.rename",
"line_number": 105,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_n... |
40635974170 | import csv
import os
import shutil
import tempfile
from model.integrityentry import IntegrityEntry
class IntegrityFile:
FIELD_NAMES = [
IntegrityEntry.FILE_PATH,
IntegrityEntry.FILE_SIZE,
IntegrityEntry.FILE_MODTIME,
IntegrityEntry.DATE_CHECKED
]
def __init__(self, file_... | thunderflip/flac-collection-integrity-checker | model/integrityfile.py | integrityfile.py | py | 2,931 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "model.integrityentry.IntegrityEntry.FILE_PATH",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "model.integrityentry.IntegrityEntry",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "model.integrityentry.IntegrityEntry.FILE_SIZE",
"line_... |
70114494761 | #
# https://leetcode.com/problems/populating-next-right-pointers-in-each-node/
#
# You are given a perfect binary tree where all leaves are on the same level,
# and every parent has two children. The binary tree has the following definition:
#
# struct Node {
# int val;
# Node *left;
# Node *right;... | CountChu/LeetCodePython | learn_09_binary_tree/problems/0116-next-right-pointers.py | 0116-next-right-pointers.py | py | 1,199 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pdb.set_trace",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "sys.modules",
"line_number": 49,
"usage_type": "attribute"
}
] |
3561385495 | import webapp2
import jinja2
import time
import json
from post import Post
from user import User
from google.appengine.api import users
from datetime import datetime
env = jinja2.Environment(loader=jinja2.FileSystemLoader('templates'))
class MainHandler(webapp2.RequestHandler):
def get(self):
template =... | RyTaus/punr | main.py | main.py | py | 6,246 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "jinja2.Environment",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "jinja2.FileSystemLoader",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "webapp2.RequestHandler",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name":... |
15691631241 | import pandas as pd
import numpy as np
from sklearn.model_selection import KFold
from sklearn.metrics.pairwise import haversine_distances
import copy
# function that splits the lsms data according to a list of validation ids:
def sample_cross_section(lsms_df, random_seed=None):
cross_section_df = lsms_df.groupby(... | nateso/predicting_poverty | analysis/analysis_utils/spatial_CV.py | spatial_CV.py | py | 7,386 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sklearn.model_selection.KFold",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "numpy.r... |
4741359473 | from dataclasses import dataclass
import typing
import kornia
from PIL import Image
import torch
from torchvision import transforms
import pkg.dataset
@dataclass
class ImageTransformer(object):
img_size: typing.Tuple[int, int]
dataset_stats: pkg.dataset.DatasetStats
def __post_init__(self):
sel... | tanimutomo/hidden | pkg/transform.py | transform.py | py | 1,927 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "typing.Tuple",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "pkg.dataset.dataset",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "pkg.dataset",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "torchvision.tr... |
28994431578 | # -*- coding: utf-8 -*-
from bokeh.plotting import figure, show
def draw_graph(x, y):
# create a new plot with a title and axis labels
p = figure(title="Simple line example", x_axis_label='x', y_axis_label='y')
# add a line renderer with legend and line thickness to the plot
p.line(x, y, name=... | mohamedmoniem93/Yard-crane | visualize.py | visualize.py | py | 483 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "bokeh.plotting.figure",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "bokeh.plotting.show",
"line_number": 11,
"usage_type": "call"
}
] |
30645771545 | from twilio import rest
# Your Account Sid and Auth Token form twilio.com/user/account
account_sid = "AC7138e23293a48e12392dc7f483956873"
auth_token = "1653d56be5c4a5ccbbf7237ad62d4b39"
client = rest.TwilioRestClient(account_sid, auth_token)
message = client.sms.message.create(
body ="hi somendra how are you",
to =... | somendraraj/free_sms | sms.py | sms.py | py | 448 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "twilio.rest.TwilioRestClient",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "twilio.rest",
"line_number": 6,
"usage_type": "name"
}
] |
33540520988 | #!/usr/bin/env python3
"""
Low Rank Adaption (LoRA) Model related stuffs.
author: jy
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
from collections import OrderedDict
class Model(nn.Module):
"""
A simple LoRA model.
"""
def __init__(self,
d_model:int = 512,
... | JackSSK/FateZ | fatez/model/adapter/lora.py | lora.py | py | 1,311 | python | en | code | 4 | github-code | 18 | [
{
"api_name": "torch.nn.Module",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "collections.OrderedDict",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "torch.nn.Linear... |
19993481935 | """Advent of Code 2021, Day 01: https://adventofcode.com/2021/day/1"""
from io import StringIO
from itertools import islice, tee
from pathlib import Path
from typing import Iterable, Iterator, TextIO, Tuple, TypeVar
import pytest
from advent_of_code.base import Solution
T = TypeVar("T")
class AocSolution(Solution[... | brad-eisenhauer/advent-of-code | src/advent_of_code/aoc2021/aoc01.py | aoc01.py | py | 1,966 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "typing.TypeVar",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "advent_of_code.base.Solution",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "typing.TextIO",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "typing.Iter... |
3648011492 | import sqlite3
import os
db_path = "./banco/emails.db"
class BancoDeDados:
def __init__(self):
self.connexao = sqlite3.Connection(db_path)
self.cursor = self.connexao.cursor()
def createTable(self):
query = """
CREATE TABLE IF NOT EXISTS emails_d... | M-Robot35/PYTHON-delet_emails_span | banco/bd_connexao.py | bd_connexao.py | py | 4,417 | python | pt | code | 0 | github-code | 18 | [
{
"api_name": "sqlite3.Connection",
"line_number": 8,
"usage_type": "call"
}
] |
22566776192 | import json
import bcrypt
from fastapi import UploadFile
from app.database.connect import Mongo
from app.database.schema import UserSchema
from app.middleware.token_validator import token_decode
from app.model import UserToken, ProductRegister
from app.repository.Product import Product
from app.repository.User import... | ohdowon064/fleapto-api | app/utils/data_utils.py | data_utils.py | py | 8,796 | python | ko | code | 0 | github-code | 18 | [
{
"api_name": "app.database.connect.Mongo.get_db",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "app.database.connect.Mongo",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "bcrypt.hashpw",
"line_number": 53,
"usage_type": "call"
},
{
"api_na... |
27111049599 | import time
import datetime
import telebot
import telegram_send
import random
import datos
bot_token = ''
bot = telebot.TeleBot(token = bot_token)
#Cry func
def llorar2(msj):
"""
ARGS: msj is a str
RETURNS: llorar is a bool in case of finding any word in dict 'datos'
"""
llorar = False
for q... | germandouce/Telegram-bot-1-public | tlgrmbot.py | tlgrmbot.py | py | 1,965 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "telebot.TeleBot",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datos.quejas.values",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "datos.quejas",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "datos.preguntas... |
7227094230 | # -*- coding:utf-8 -*-
import itertools
if __name__ == "__main__":
N, M, R = map(int, input().split())
r = list(map(int, input().split()))
d = [[0 for x in range(N)] for y in range(N)]
ans = float("inf")
for y in range(N):
for x in range(N):
d[y][x] = 0 if x == y else float('inf... | Lischero/Atcoder | ABC073/q4.py | q4.py | py | 1,068 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "itertools.permutations",
"line_number": 27,
"usage_type": "call"
}
] |
30433008689 | ## -*- coding: utf-8 -*-
#"""
#Created on Thu Jan 23 17:28:54 2014
#@author: cesar zamora
#"""
import numpy as np
from matplotlib.collections import LineCollection
import matplotlib.pyplot as plt
#---------------------------------------------------------------------------------------------
# ... | czammar/eit_thesis | src/polygon.py | polygon.py | py | 3,020 | python | es | code | 0 | github-code | 18 | [
{
"api_name": "numpy.array",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "numpy.cos",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "numpy.sin",
"line_number": 57... |
28047218020 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Plotting gr3 format file in a Map Background.
This scripts reads a gr3 format file and plot it using maptplotlib.
Author: Jamal Uddin Khan
Date : 17-05-2017
"""
import timeit
import sys
starttime = timeit.default_timer()
from mpl_toolkits.basemap import Basemap
impor... | jamal919/pycaz | scripts/plot_maxelev.py | plot_maxelev.py | py | 2,412 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "timeit.default_timer",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.fromstring",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.genfromtxt",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.genfromt... |
4001714284 | import functools
from tensorflow.dtensor.python import api as d_api
from tensorflow.dtensor.python import config as d_config
from tensorflow.dtensor.python import d_variable
from tensorflow.dtensor.python import input_util
from tensorflow.dtensor.python import layout
from tensorflow.python.data.experimental.ops import... | tensorflow/tensorflow | tensorflow/python/distribute/experimental/dtensor_strategy_extended.py | dtensor_strategy_extended.py | py | 10,966 | python | en | code | 178,918 | github-code | 18 | [
{
"api_name": "tensorflow.python.distribute.distribute_lib.StrategyExtendedV2",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.python.distribute.distribute_lib",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "tensorflow.dtensor.python.config.... |
18050465251 | import requests
from bs4 import BeautifulSoup
import csv
# List of news websites to scrape
urls = ['https://www.bbc.com/news', 'https://www.nytimes.com/', 'https://www.reuters.com/']
# Create an empty list to store the data
articles = []
# Loop through each URL
for url in urls:
# Send a GET request to the URL an... | ElyasMoshirpanahi/TopicClassification | scraper.py | scraper.py | py | 1,449 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 41,
"usage_type": "call"
}
] |
20302899010 | from django.db import migrations
def add_group(apps, _schema_editor):
Group = apps.get_model("auth", "Group")
Group.objects.create(name="Grade publisher", pk=3)
class Migration(migrations.Migration):
dependencies = [
('grades', '0001_initial'),
]
operations = [
migrations.RunPy... | e-valuation/EvaP | evap/grades/migrations/0002_initial_data.py | 0002_initial_data.py | py | 343 | python | en | code | 93 | github-code | 18 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.RunPython",
"line_number": 16,
"usage_type": "call"
},
{
... |
581352316 | from .common import *
def populate_env(env, dirs):
env["CC"] = 'clang'
ldflags = [
"-Wl,-rpath,{prefix}/lib",
"-L{prefix}/lib",
]
env["LDFLAGS"] = " ".join(ldflags).format(prefix=dirs.prefix)
cflags = [
"-L{prefix}/lib",
"-I{prefix}/include",
"-I{prefix}/incl... | UtahDave/Mayflower | mayflower/build/darwin.py | darwin.py | py | 2,074 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 81,
"usage_type": "call"
}
] |
27353886737 | import logging
import time
import uuid
import pylsl as lsl
from pupil_labs.invisible_lsl_relay.channels import (
pi_event_channels,
pi_extract_from_sample,
pi_gaze_channels,
)
VERSION = "1.0"
logger = logging.getLogger(__name__)
class PupilInvisibleOutlet:
def __init__(
self, channel_func,... | GazeIntelligence/GazeReplay | pupil_invisible/invisible_lsl_relay/outlets.py | outlets.py | py | 2,735 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pupil_labs.invisible_lsl_relay.channels.pi_gaze_channels",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "pylsl.cf_double64",
"line_number": 46,
"usage_type": "attribut... |
37778096723 | import pandas as pd
import numpy as np
import scipy as sc
from scipy import interpolate
import ReadDustMap as dust
def colorFunction(g,Teff,wavelength):
X = np.array(g['teff50'])
Y = np.array(g['ratio_'+str(wavelength)+'A'])
function = sc.interpolate.interp1d(X,Y, fill_value = 'extrapolate')
return f... | KatiaMich/ISRF_UV | FluxCalculator.py | FluxCalculator.py | py | 2,251 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.array",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "scipy.interpolate.interp1d",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "scipy.interpolate",... |
18835364207 | from django.urls import path
from . import views
urlpatterns = [
path('', views.JobListView.as_view(), name='services-home'),
path('technician/<str:username>', views.UserJobListView.as_view(), name='technician-jobs'),
path('job/by_title/', views.TitleJobListView.as_view(), name='title-jobs'),
pa... | pavellyapustin/it-support | services/urls.py | urls.py | py | 778 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
74216364521 | from rest_framework.viewsets import ModelViewSet, GenericViewSet
from rest_framework import permissions, generics, status
from rest_framework.decorators import action
from rest_framework.response import Response
from core.models import Department, CheckIn, Employee, Message
from core.api.serializer import Departme... | ZBreno/ManagerBack | core/api/viewsets.py | viewsets.py | py | 11,038 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "rest_framework.viewsets.ModelViewSet",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "core.models.Department.objects.all",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "core.models.Department.objects",
"line_number": 13,
"usage_type":... |
42517166565 | import numpy as np
import cv2
import boto3
import copy
import numpy as np
from os import listdir
from os.path import isfile, join
def getFaces(img):
face_cascade = cv2.CascadeClassifier('classifiers/haarcascade_frontalface_alt2.xml')
profile_cascade = cv2.CascadeClassifier('classifiers/haarcascade_profile.xm... | jzulua70/ojoDeDios | localProcessing.py | localProcessing.py | py | 2,232 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "cv2.CascadeClassifier",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.CascadeClassifier",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BG... |
36610163213 | import numpy as np
import pytest
from sklearn.utils.estimator_checks import parametrize_with_checks
import random_tree_models.decisiontree as dtree
import random_tree_models.gradientboostedtrees as gbt
import random_tree_models.xgboost as xgboost
class TestXGBoostTemplate:
model = xgboost.XGBoostTemplate()
... | eschmidt42/random-tree-models | tests/test_xgboost.py | test_xgboost.py | py | 5,434 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "random_tree_models.xgboost.XGBoostTemplate",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "random_tree_models.xgboost",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "pytest.xfail",
"line_number": 20,
"usage_type": "call"
},
{
... |
11221550476 | # python 3.6 and more
# FastAPI service for docker
#
# example:
# (build --build_arg WORKERS=5 --build-arg FASTAPI_PORT=8000 -t ASR2Format .)
# docker run -p 8000:8000 --rm ASR2Format
# or local start with uvicorn: uvicorn main:app
fastapi_description = '''
Сервис преобразования распознанных ответов на зад... | mineevburyat/wordtoanyAPI | main.py | main.py | py | 12,516 | python | ru | code | 0 | github-code | 18 | [
{
"api_name": "sys.exit",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "api_settings.Settings",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "functools.lru_cache",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "app_logger.Setting... |
9462850071 | import os
from logging import Logger
from typing import Union, Tuple, Sequence, Optional
import lightgbm as lgb
import matplotlib.pyplot as plt
import numpy as np
import optuna
import pandas as pd
from lightgbm import early_stopping, log_evaluation
from sklearn.metrics import mean_squared_error
from sklearn.model_sele... | AndreaFalanti/popnas | src/predictors/models/lgbm_predictor.py | lgbm_predictor.py | py | 8,545 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "predictor.Predictor",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "logging.Logger",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
... |
74599359401 | """ Batch class for radial regime regression. """
import random
import numpy as np
import scipy as sc
from sklearn.ensemble import IsolationForest
from . import radial_batch_tools as bt
from .decorators import init_components
from ..batchflow import Batch, action, inbatch_parallel, any_action_failed, FilesIndex, R
... | analysiscenter/radial | radial/core/radial_batch.py | radial_batch.py | py | 20,816 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "batchflow.Batch",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "batchflow.any_action_failed",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "batchflow.act... |
27438909567 | import json
import sys
import time
import math
import traceback
import pandas as pd
import PyQt6.QtGui as QtGui
from PyQt6.QtGui import QIcon
from PyQt6.QtWidgets import QApplication, QCheckBox, QHBoxLayout, QLabel, QMainWindow, QSpinBox, QPushButton, QScrollArea, QVBoxLayout, QWidget, QLineEdit, QTableWidget, QTableWi... | Roser-ZY/CsvViewer | view.py | view.py | py | 47,413 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "PyQt6.QtCore.QThread",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "PyQt6.QtCore.QThread",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "PyQt6.QtCore.pyqtSignal",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "PyQ... |
31443501899 | from datetime import timedelta
from airflow.models import Variable
def get_default_dag_args():
owner_name = Variable.get('owner')
return {
'owner': owner_name,
'depends_on_past': False,
'start_date': "2015-09-30T16:41:54+00:00",
'retries': 5,
'retry_delay': timedelta(minutes=5),
}
| terrorizer1980/stellar-etl-airflow | dags/stellar_etl_airflow/default.py | default.py | py | 311 | python | en | code | null | github-code | 18 | [
{
"api_name": "airflow.models.Variable.get",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "airflow.models.Variable",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "datetime.timedelta",
"line_number": 11,
"usage_type": "call"
}
] |
3387277861 | import socket
import struct
import json
sock=socket.socket()
sock.connect(('127.0.0.1',8080))
while True:
msg=input('>>:').strip()
if not msg: continue # 如果输入是空这进入下次循环
str_len=len(msg)
data = {'size': str_len}
json_str=json.dumps(data)
# 发送报头
json_len = struct.pack('i', len(json_str))
s... | awuxina/www | 网络编程和并发/练习/通客户端.py | 通客户端.py | py | 493 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "socket.socket",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "struct.pack",
"line_number": 13,
"usage_type": "call"
}
] |
18647155760 | from django.urls import path, include
from rest_framework.routers import SimpleRouter
from highm_server.custom_lookup_type_router import CustomLookupTypeRouter
from .views_for_student import (
LessonViewSet,
)
from .views_for_teacher import (
TeacherLessonViewSet,
GroupStatementViewSet,
LessonResultVie... | Romez1990/highm-server | lessons/urls.py | urls.py | py | 1,048 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "highm_server.custom_lookup_type_router.CustomLookupTypeRouter",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "views_for_student.LessonViewSet",
"line_number": 15,
"usage_type": "argument"
},
{
"api_name": "rest_framework.routers.SimpleRouter",
"line... |
28708866561 | # -*- coding: utf-8 -*-
from skimage import io
import numpy as np
centers = np.load('codebook_tiger.npy')
c_image = io.imread('compressed_tiger.png')
image = np.zeros((c_image.shape[0],c_image.shape[1],3),dtype=np.uint8 )
for i in range(c_image.shape[0]):
for j in range(c_image.shape[1]):
... | abhijeet3922/Image-compression-with-Kmeans-clustering | image_decompress.py | image_decompress.py | py | 442 | python | en | code | 21 | github-code | 18 | [
{
"api_name": "numpy.load",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "skimage.io.imread",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "skimage.io",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "numpy.zeros",
"line_number":... |
42179759789 |
import PySimpleGUI as sg
import os
import subprocess
import platform
pf = platform.system()
if 'Darwin' != pf:
print(f"あなたが使用しているOSは {pf} ですが,\nこれはMac専用のプログラムのため何もせず終了します.")
input("\n続行するにはなにかキーを押してください.")
exit(0)
# PySimpleGUIの確認
freeze_output = subprocess.run("pip3 freeze", capture_output=True, text=T... | physics11688/miscellaneous | initial_ settingsM.py | initial_ settingsM.py | py | 10,957 | python | ja | code | 1 | github-code | 18 | [
{
"api_name": "platform.system",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "subprocess.run",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "subprocess.run",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_n... |
11193087750 | from torch.utils.data import Dataset,DataLoader
import skimage
import numpy as np
import imageio
import os
import matplotlib
import matplotlib.colors
import skimage.transform
import random
import torchvision
import torch
import torchvision.transforms as transforms
import cv2
import matplotlib.pyplot as plt... | The1912/CMANet | Dataset/dataset.py | dataset.py | py | 16,329 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "os.listdir",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.