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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
856254777 | #!/usr/bin/env python
from pyhesity import *
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-v', '--vip', type=str, default='helios.cohesity.com')
parser.add_argument('-u', '--username', type=str, default='helios')
parser.add_argument('-d', '--domain', type=str, default='local')
parser.add_ar... | bseltz-cohesity/scripts | python/firewallTool/firewallTool.py | firewallTool.py | py | 4,351 | python | en | code | 85 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 6,
"usage_type": "call"
}
] |
30067750251 | import numpy as np
import matplotlib.pyplot as plt
from sklearn.decomposition import PCA
import pandas as pd
# Definición de funciones de activación y su derivada
def sigmoid(x):
return 1 / (1 + np.exp(-x))
def sigmoid_derivative(x):
return x * (1 - x)
# Clase para la red neuronal
class NeuralNetwork:
de... | Kenayman/Perceptron-simple | Ejercicio4.py | Ejercicio4.py | py | 4,365 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.exp",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.random.rand",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.rand",
... |
6926982149 | import json
import os
import boto3
import time
def lambda_handler(event, context):
#Parse event
if type(event['body']) == str:
body = json.loads(event['body'])
data = body['data']
command = body['command']
else:
body = event['body']
data = body['data']
co... | metalstormbass/Terraform-Cloud-Goof | lambda_code/main.py | main.py | py | 1,102 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "json.loads",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.popen",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 23,
... |
23966932572 | #
# Process WRF solution file
#
# written by Eliot Quon (eliot.quon@nrel.gov)
#
from __future__ import print_function
import sys, os
import numpy as np
#from netCDF4 import Dataset
from netCDF4 import Dataset, MFDataset
try:
import xarray
except ImportError:
have_xarray = False
else:
print('xarray reader av... | NWTC/datatools | WRF/solution.py | solution.py | py | 4,452 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "os.path.isfile",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "netCDF4.Dataset",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "xarray.open_mfdataset",
... |
74768116583 | from collections import namedtuple
from datetime import date
import json
from django.shortcuts import reverse
from django.template import loader
from djaveAPI.find_models import publishable_model_from_name
from djaveAPI.paged_results import construct_paged_results
from djaveAPI.to_json import TYPE
from djaveAPI.widget... | dasmith2/djaveAPI | djaveAPI/docs.py | docs.py | py | 6,615 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "djaveAPI.find_models.publishable_model_from_name",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "django.template.loader.get_template",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "django.template.loader",
"line_number": 19,
"usage_t... |
36420895419 | #!/usr/bin/env python
# coding: utf-8
# # KSHEMA S
#
# TCS iON INTERNSHIP
# RIO-125:HR Salary Dashboard - Train the Dataset and Predict Salary
# # Problem statement
# This project aims to sanitize the data, analysis and predict if an employee's salary is higher or lower than $50K/year depends on certain attributes ... | Kshema85/TCS-iON--KSHEMA-HR-Salary-prediction | model1.py | model1.py | py | 12,261 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.nan",
"line_number": 126,
"usage_type": "attribute"
},
{
"api_name": "numpy.nan",
... |
14126041012 | from re import split
from itertools import zip_longest
from more_itertools import windowed
from pyperclip import copy as ctrl_C
Lboth = []
for filename in ["input/in22_test.txt", "input/in22_real.txt"]:
with open(filename,"r") as infile:
gridstr,inststr = infile.read().split('\n\n')
gridLR = [list(filter(lambda p... | arguhuh/AoC | 2022/code22.py | code22.py | py | 4,619 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "itertools.zip_longest",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "re.split",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "more_itertools.windowed",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "more_itertools... |
27073968555 | from itertools import count
from geopy.distance import geodesic
from datetime import timedelta, datetime
import json
import sys
import random
time_format = '%Y-%m-%d %H:%M:%S'
default_start = datetime.strptime('2020-01-01 00:00:00', time_format)
default_end = datetime.strptime('2020-06-30 23:59:59', time_format)
myica... | guillaumemichel/aircraft-privacy-simulator | structures.py | structures.py | py | 12,932 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": ... |
23214835305 | # -*- coding: utf-8 -*-
import json
import re
from datetime import date
import dryscrape
from bs4 import BeautifulSoup
# Заголовки столбцов таблицы
titles = [
'Биржевой инструмент', # 0
'Предл.', # 1
'Спрос', # 2
'Ср.вз. цена', # 3
'Объем договоров', # 4
'Кол - во дог.', # 5
'НПЗ' # 6
]
... | rbikbov/test_python_bot | bot.py | bot.py | py | 9,250 | python | ru | code | 0 | github-code | 36 | [
{
"api_name": "re.sub",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "datetime.date.today",
"line_number": 175,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number":... |
24438494857 | # Some functions for the Mojang API
# import requests
import requests
import datetime
import json
class MinecraftUUIDError(ValueError):
pass
class MinecraftUsernameError(ValueError):
pass
class Player:
# Essential variables
username = None
uuid = None
alias = None
# Vars to be used i... | joshuaSmith2021/chamosbot-gassistant | mojang.py | mojang.py | py | 2,392 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "json.decoder",
"line_numb... |
30079500269 | import QRTicketing
import cv2
def Decode(str):
a='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
cipherstr=''
for i in str:
k=a.index(i)
cipherstr+=a[((k - 5)%26)]
return str
cap = cv2.VideoCapture(0)
detector = cv2.QRCodeDetector()
while True:
_, img = cap.read()
data, bbox, _ = detector.detectA... | PreethiPreetz-30/Ticketless-Entry---QR | ScanTicket.py | ScanTicket.py | py | 593 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.QRCodeDetector",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"lin... |
25166244861 | import re
from django import forms
from crispy_forms.helper import FormHelper
from content.src.reg_expressions import RegExpressions
from content.models import Content, Video
from product.models import Product
class StyleMixin:
"""Класс добавляющий форматирование форм crispy-forms"""
def __init__(self, *ar... | NewterraV/content_selling_platform | content/forms.py | forms.py | py | 13,160 | python | ru | code | 0 | github-code | 36 | [
{
"api_name": "crispy_forms.helper.FormHelper",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "product.models.Product.objects.filter",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "product.models.Product.objects",
"line_number": 25,
"usage_type": "a... |
31065164595 |
from ..utils import Object
class UpdateMessageEdited(Object):
"""
A message was edited. Changes in the message content will come in a separate updateMessageContent
Attributes:
ID (:obj:`str`): ``UpdateMessageEdited``
Args:
chat_id (:obj:`int`):
Chat identifier
... | iTeam-co/pytglib | pytglib/api/types/update_message_edited.py | update_message_edited.py | py | 1,307 | python | en | code | 20 | github-code | 36 | [
{
"api_name": "utils.Object",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "utils.Object.read",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "utils.Object",
"line_number": 43,
"usage_type": "name"
}
] |
11576039211 | from socket import *
from datetime import datetime
serverPort = 8080
serverSocket = socket(AF_INET, SOCK_DGRAM)
#atribui a porta ao socket criado
serverSocket.bind(('', serverPort))
print("The server is ready to receive")
while True:
#recebe a mensagem do cliente em bytes
message, clientAddress = serverSocket.r... | srpantoja/Redes_trabalhos | python/UDPServer.py | UDPServer.py | py | 593 | python | pt | code | 0 | github-code | 36 | [
{
"api_name": "datetime.datetime.now",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 12,
"usage_type": "name"
}
] |
34357549837 | import argparse
import modelsim_utils
import time
parser = argparse.ArgumentParser()
parser.add_argument('-d', '--do_file_name' , default = 'run_cmd.do')
parser.add_argument('-r', '--run_to_pane_shift_sleep_sec', default = 4) # 7
parser.add_argument('-t','--true_or_false_flag_example', action='store_tr... | Brandon-Valley/examples | python/script_arg_parse.py | script_arg_parse.py | py | 496 | python | zh | code | 0 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "modelsim_utils.auto_run",
"line_number": 14,
"usage_type": "call"
}
] |
22108118261 | #!/usr/bin/env python
# coding: utf-8
# Loading the libraries
import requests
from bs4 import BeautifulSoup
import time
import random
from tqdm.notebook import tqdm as tqdm
# Part a
page_url = "https://www.barnesandnoble.com/b/books/_/N-1fZ29Z8q8?Nrpp=40&page=1"
headers = {"user-agent": "Mozilla/5.0 (Windows NT 10.0... | jeetp465/Web-Scraping | Barnes and Noble Scraping.py | Barnes and Noble Scraping.py | py | 1,841 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "random.randint",
"lin... |
8838127682 | """Models for Blogly."""
from flask_sqlalchemy import SQLAlchemy
import datetime
db = SQLAlchemy()
DEFAULT_IMAGE_URL = "https://cdn2.iconfinder.com/data/icons/avatars-99/62/avatar-370-456322-512.png"
def connect_db(app):
"""Connect to database."""
db.app = app
db.init_app(app)
class User(db.Model):
... | kabdrau/Blogly-application | models.py | models.py | py | 2,622 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 45,
"usage_type": "attribute"
}
] |
15870462971 | import os
import sys
import time
import torch
import torch.nn.functional as F
from sklearn.metrics import mean_squared_error
from graphrepr.evaluate import test_model
from graphrepr.savingutils import save_configs, save_history, LoggerWrapper
from graphrepr.config import parse_model_config, parse_representation_config,... | gmum/graph-representations | scripts/main_dmpnn.py | main_dmpnn.py | py | 8,394 | python | en | code | 18 | github-code | 36 | [
{
"api_name": "sys.argv",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "os.path.basename",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numb... |
2457622473 |
# This Python code reproduces the upper and low panel of Fig. 6 in Clay et. al. (2008).
#Save the voltage nd time series csv files as v1.csv for the standard HH model (top panel of fig.6 and v2.csv for the revised model (bottom panel for of fig. 6)
from neuron import h
import numpy as np
import matplotlib.pyplot ... | ModelDBRepository/189922 | clay_mohit.py | clay_mohit.py | py | 3,447 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "neuron.h.finitialize",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "neuron.h",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "neuron.h.fcurrent",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "neuron.h",
"line_... |
39755602271 | # @Author : tony
# @Date : 2021/5/2
# @Title : epjb2009 paper practice
# @Dec : deal with the dataset
import networkx as nx
# deal with the INT dataset
def readINT(dataUrl):
G = nx.read_gml(dataUrl)
list = dict()
edge_list = []
for id, label in enumerate(G.nodes()):
list[int(label)] = in... | DDMXIE/LinkPrediction | practice/dataTransform.py | dataTransform.py | py | 2,178 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "networkx.read_gml",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "networkx.read_gml",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "networkx.read_gml",
"line_number": 36,
"usage_type": "call"
}
] |
24739226033 | from fastapi import APIRouter
from app.api.segmentation import doc_parser, paddle
from app.core.config import settings
from app.schemas.doc_parser import ImageInput, ImageOutput
router = APIRouter(prefix="/segment", tags=["segment"])
@router.post("/detect-image")
async def doc_parser_api(*, img_in: ImageInput):
... | rednam-ntn/dosa | server/app/api/__init__.py | __init__.py | py | 933 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "app.schemas.doc_parser.ImageInput",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "app.api.segmentation.doc_parser.detect_image",
"line_number": 13,
"usage_type": "call"... |
7392241864 |
import argparse
from . import board
from . import constants
from . import solver
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("board", nargs="?")
parser.add_argument("-m", "--manual", default=False, action="store_true")
return parser.parse_args()
def main():
args = ... | MattCCS/SudokuSolver | sudoku.py | sudoku.py | py | 698 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
}
] |
42300807705 | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
url = ''
driver = webdriver.Chrome()
driver.get(url)
element_founder = driver.find_element_by_name('q')
element_founder.send_keys('selenium')
element_founder.send_keys(Keys.RETURN)
results = driver.find_elements_by_css_selector... | seriybeliy11/parsers | sel_parser.py | sel_parser.py | py | 380 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.common.keys.Keys.RETURN",
"line_number": 10,
"usage_type": "attribute"
},... |
74050008424 | import json
import uuid
import websocket
import time
import threading
from parlai.core.params import ParlaiParser
# the socket callback functions operate asynchronously.
# upon exit of a chat, we do not want the user to view any additional messages from the server.
# alas, it is necessary to send two messages ([DONE],... | facebookresearch/ParlAI | parlai/chat_service/services/terminal_chat/client.py | client.py | py | 3,446 | python | en | code | 10,365 | github-code | 36 | [
{
"api_name": "uuid.uuid4",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 88,
... |
5571273421 | from django.contrib import admin
from django.contrib.admin.options import TabularInline
from apps.info_section_app.models import SimilarLike, SimilarDislike, SimilarTitle, \
Favorite, RelatedTitle
class SimilarLikeAdminInLine(TabularInline):
extra = 1
model = SimilarLike
class SimilarDislikeAdminInlin... | urmatovnaa/Manga-universe | apps/info_section_app/admin.py | admin.py | py | 592 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.contrib.admin.options.TabularInline",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "apps.info_section_app.models.SimilarLike",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.options.TabularInline",
"line_number"... |
35918965719 | import contextlib
import hashlib
import httplib
import socket
import tempfile
import urllib2
try:
from PIL import Image as PILImage
except ImportError:
import Image as PILImage # noqa
from django.conf import settings
from django.core.files import File
from django.db import transaction
from comics.aggregator... | macanhhuy/comics | comics/aggregator/downloader.py | downloader.py | py | 5,379 | python | en | code | null | github-code | 36 | [
{
"api_name": "comics.core.models.Release",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "django.db.transaction.commit_on_success",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "django.db.transaction",
"line_number": 41,
"usage_type": "name"
... |
6394496653 | # Copyright (c) 2023 Graphcore Ltd. All rights reserved.
# The functional definition in this file was ported to Python
# from XCFun, which is Copyright Ulf Ekström and contributors 2009-2020
# and provided under the Mozilla Public License (v2.0)
# see also:
# - https://github.com/dftlibs/xcfun
# - https://git... | graphcore-research/pyscf-ipu | pyscf_ipu/exchange_correlation/b88.py | b88.py | py | 999 | python | en | code | 31 | github-code | 36 | [
{
"api_name": "numpy.pi",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "jax.numpy.log",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "jax.numpy",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "jax.numpy.exp",
"line_numbe... |
11193542891 | """ клиентская часть """
import sys
import json
import time
import re
import logging
import logs.config_client_log
from lib.variables import ACTION, PRESENCE, TIME, USER, ACCOUNT_NAME, RESPONSE, AUTH, ALERT, MSG, ERR200, ERR400, \
CLIENT_LISTEN, LISTEN, SENDER, MSG, MSG_TEXT, ERROR
from lib.utils import create_soc... | ESarmanov/client_server_app_Python_GeekBrains | Lesson_7_Sarmanov_EF/client.py | client.py | py | 8,345 | python | ru | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "lib.variables.ACTION",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "lib.variables.MSG",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "lib.variable... |
20928709222 | #!/usr/bin/env python
# coding: utf-8
# In[6]:
import time
import json
import pandas as pd
import re
import logging
from datetime import date, datetime, timedelta
from selenium import webdriver
from selenium.webdriver.firefox.service import Service
from selenium.webdriver.common.by import By
from webdriver_manager.c... | shivanianand/NaukriDataAnalysis | Scraping_final.py | Scraping_final.py | py | 4,365 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "selenium.webdriver.ChromeOptions",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 19,
"usage_type": "call"
},
{
"api... |
25489916263 | import pytest
import pytest_spec.basic as basic
class TestErrors:
def test_zero(parameter_list):
with pytest.raises(ZeroDivisionError) as e:
basic.division_by_zero(1)
assert e.type == ZeroDivisionError
assert e.typename == "ZeroDivisionError"
assert str(e.value) == "div... | atu4403/pytest_spec | tests/basic/test_basic.py | test_basic.py | py | 865 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pytest.raises",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pytest_spec.basic.division_by_zero",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pytest_spec.basic",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "pytes... |
2182128872 | import logging
import threading
import numpy as np
import pandas as pd
from timeit import default_timer as timer
from datetime import datetime, timedelta, timezone
from time import sleep
import time
import matplotlib.pyplot as mpl
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection i... | 5ymph0en1x/SyDOM | utils/predictor.py | predictor.py | py | 21,887 | python | en | code | 82 | github-code | 36 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "logging... |
2285653529 | #Item 1 #############################################################################################################
import hashlib
from random import randint
def cadastrar(nome,senha):
senhaReal = senha
senhaHash = (hashlib.md5(senhaReal.encode('utf-8')).hexdigest())
with open("UsuariosCadastrados.t... | Williamsbsa/Quebra-de-Hash-MD5-Python | QuebradeHashMd5.py | QuebradeHashMd5.py | py | 5,406 | python | pt | code | 0 | github-code | 36 | [
{
"api_name": "hashlib.md5",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "hashlib.md5",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
... |
35001315098 | from ipywidgets import Box, HBox, VBox, FloatSlider, FloatProgress, Label, Layout
s1 = FloatSlider(description='Apple', min=-5, max=5, step=0.01, value=0, layout=Layout(width='90%'))
s2 = FloatSlider(description='Horse', min=-5, max=5, step=0.01, value=0, layout=Layout(width='90%'))
s3 = FloatSlider(description='Flower... | CaptainProton42/MNISTFromScratch | media/softmax_widget.py | softmax_widget.py | py | 1,890 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "ipywidgets.FloatSlider",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "ipywidgets.Layout",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "ipywidgets.FloatSlider",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "ipywidge... |
34455554450 | # -*- coding: utf8 -*-
from django.db import models
class Timer(models.Model):
""" Модель таймера """
start_time = models.DateTimeField(
verbose_name="Время начала",
null=True,
blank=True
)
end_time = models.DateTimeField(
verbose_name="Время конца",
null=True,... | Aplles/project_tracker | models_app/models/timer/models.py | models.py | py | 1,025 | python | ru | code | 0 | github-code | 36 | [
{
"api_name": "django.db.models.Model",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.db.models.DateTimeField",
"line_number": 8,
"usage_type": "call"
},
{
"api_name... |
3156449566 | #!/usr/bin/python3
# Script responsible for removing extra tags of nightly images
# QUAY_ACCESS_TOKEN is needed to set as environment variable before executing script
# The access token is used for authentication against the quay api.
import os
import json
import requests
from dateutil.relativedelta import *
from date... | kiegroup/kogito-pipelines | tools/clean-nightly-tags.py | clean-nightly-tags.py | py | 3,786 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "os.environ",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "requests.delete",
"line_n... |
25482260523 | import cv2
import time
import mediapipe as mp
cap = cv2.VideoCapture(1)
mp_hands = mp.solutions.hands
hands = mp_hands.Hands() #hands.py ctrl+left mouse
mp_draw = mp.solutions.drawing_utils
new_frame_time = 0
prev_frame_time = 0
while True:
ret, frame = cap.read()
new_frame_time = time.time()
fps = 1... | atuad7535/Volume_Control_Using_Hand_Gesture | Hand_Tracking.py | Hand_Tracking.py | py | 1,333 | python | en | code | 7 | github-code | 36 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "mediapipe.solutions",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "mediapipe.solutions",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "time.... |
74353872105 | import re
import phonenumbers
from django import forms
from django.utils.translation import ugettext_lazy as _
from kavenegar import *
from sentry import http
from sentry.plugins.bases.notify import NotificationPlugin
import sentry_kavenegar
DEFAULT_REGION = 'IR'
MAX_SMS_LENGTH = 160
def validate_phone(phone):
... | amirasaran/sentry-kavenegar | sentry_kavenegar/models.py | models.py | py | 4,522 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "phonenumbers.parse",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "phonenumbers.NumberParseException",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "phonenumbers.is_possible_number",
"line_number": 22,
"usage_type": "call"
},
... |
6673487305 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Test config.py module."""
# STDLIB
import os
# THIRD-PARTY
import numpy as np
import pytest
# SYNPHOT
from synphot.config import conf as synconf
from synphot.utils import generate_wavelengths
# LOCAL
from stsynphot import config
from stsynphot.stio ... | spacetelescope/stsynphot_refactor | stsynphot/tests/test_config.py | test_config.py | py | 2,785 | python | en | code | 11 | github-code | 36 | [
{
"api_name": "stsynphot.config.overwrite_synphot_config",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "stsynphot.config",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "stsynphot.config.conf",
"line_number": 24,
"usage_type": "attribute"
},
{
... |
10724474044 | import xmltodict
import json
# Loading and parsing the xml file.
with open (r'q1.xml', "r") as xml_file:
xml_data = xml_file.read()
print(xml_data)
# Convert xml to json
json_data = json.dumps(xmltodict.parse(xml_data), indent=4)
print(json_data)
with open("output.json", "w") as json_file:
json_fil... | JonathanDabre/ip_ut2 | UT-2/xml/q4.py | q4.py | py | 338 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "json.dumps",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "xmltodict.parse",
"line_number": 10,
"usage_type": "call"
}
] |
958022852 | #!/usr/bin/env python3
"""An Implement of an autoencoder with pytorch.
This is the template code for 2020 NIAC https://naic.pcl.ac.cn/.
The code is based on the sample code with tensorflow for 2020 NIAC and it can only run with GPUS.
Note:
1.This file is used for designing the structure of encoder and decoder.
... | China-ChallengeHub/oppo_0.71 | trainer2.py | trainer2.py | py | 7,400 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "pickle.dump",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pickle.HIGHEST_PROTOCOL",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "pickle.load",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "torch.backends",... |
40858491511 | #!/usr/bin/env python
import sys
import fitsio
import healpy
import numpy as np
import scipy as sp
import argparse
import matplotlib.pyplot as plt
from scipy.interpolate import interp1d
from picca.data import forest
from picca.data import delta
from picca import io
if __name__ == '__main__':
parser = argparse... | vserret/picca | tutorials/picca_plotSpec.py | picca_plotSpec.py | py | 8,731 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentDefaultsHelpFormatter",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "picca.data.forest.lmin",
"line_number": 82,
"usage_type": "attribute"... |
70593996584 | import math
import os
from itertools import count, cycle
import json
#MUST BE INSTALLED VIA PIP
import tkinter
from tkinter import *
from tkinter import messagebox
from PIL import Image, ImageTk
#-------------------------------------------------------------------------------
#!--- VARS FOR QUESTY STUFF
# goat gifs
... | introvertices/Task-list | main.py | main.py | py | 8,432 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "json.load",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "math.ceil",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "tkinter.Label",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image.open",
"line_num... |
36771601568 | ## dammit-turnip
## Version: 0.1
## Author: Adam Lenart
## Main file that interacts with the user
## standard imports
import argparse
## 3rd parth imports
from PIL import Image
## own modules
from src import dialog_action
from src import processor
###################################################################... | adamlenart/dammit-turnip | make_circle.py | make_circle.py | py | 5,417 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 58,
"usage_type": "name"
},
{
"api_name": "src.processor.circle... |
41907884718 | import time
import cv2
import mediapipe as mp
mp_face_detection = mp.solutions.face_detection
import os
os.environ['OPENCV_FFMPEG_CAPTURE_OPTIONS'] = 'rtsp_transport;udp'
class face_detection:
def __init__(self):
self.URL = "rtsp://192.168.0.22:8554/"
self.cap = cv2.VideoCapture(0, cv2.CAP_DSHOW)
self.image = ... | CSID-DGU/2022-2-SCS4031-EZ_SW | FaceDetection.py | FaceDetection.py | py | 1,175 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "mediapipe.solutions",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.CAP_DSHOW... |
34118610496 | import os
from flask import Flask
import ghhops_server as hs
import rhino3dm
import pymaxwell5 as pym
app = Flask(__name__) #flask
hops = hs.Hops(app) #flask
#hops = hs.Hops() #http
@hops.component(
"/maxwell",
name="Maxwell",
description="render",
icon="C://Users//archi//Dropbox//course//maxwell.p... | seghier/maxwell | venv/maxwell.py | maxwell.py | py | 1,679 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "ghhops_server.Hops",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "ghhops_server.HopsBoolean",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "ghhops_server... |
8446001098 | import unittest
import pytest
from cupy_backends.cuda import stream as stream_module
import cupy
from cupy import _core
from cupy import testing
# TODO(leofang): test PTDS in this file
class DummyObjectWithCudaArrayInterface(object):
def __init__(self, a, ver=3):
self.a = a
self.ver = ver
... | cupy/cupy | tests/cupy_tests/core_tests/test_ndarray_cuda_array_interface.py | test_ndarray_cuda_array_interface.py | py | 10,691 | python | en | code | 7,341 | github-code | 36 | [
{
"api_name": "cupy.cuda.get_current_stream",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "cupy.cuda",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "unittest.TestCase",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "cu... |
74207679783 | import random
from ltl.spot2ba import Automaton
import ltl.worlds.craft_world as craft
from collections import defaultdict
# TODO: add `grass` and `toolshed` back
GRAMMAR = """
BinOp -> 'and' | 'or'
UOp -> 'do not' | 'you should not'
Not -> 'not'
Item -> 'apple' | 'orange' | 'pear'
Landmark -> 'f... | czlwang/ltl-environment-dev | ltl/language/generator.py | generator.py | py | 8,694 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "collections.defaultdict",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "ltl.worlds.craft_world.Cookbook",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "ltl.worlds.craft_world",
"line_number": 69,
"usage_type": "name"
},
{
"ap... |
448222125 | from __future__ import print_function
from pyspark.sql import functions as F
from pyspark.sql.functions import mean, min, max, variance, lag, count, col
from pyspark import sql
from pyspark import SparkContext, SparkConf
from pyspark.sql.types import ArrayType, StringType, IntegerType, DoubleType, LongType, FloatType
f... | avilin66/Pyspark_codes | EUW_CUSTOMER_LOCATION_WEATHER_DATA.py | EUW_CUSTOMER_LOCATION_WEATHER_DATA.py | py | 5,260 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "sys.argv",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number... |
3540344939 | import requests
from requests.auth import HTTPBasicAuth
import json
from decouple import config
url = "https://climate.jira.com/rest/api/2/issue"
auth = HTTPBasicAuth(
"brandon.hoffman@climate.com",
f"{config('JIRA_API_KEY')}"
)
headers = {
"Accept": "application/json",
"Content-Type": "application... | branhoff/jira-gpt-enhancer | backend/create_issue.py | create_issue.py | py | 811 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.auth.HTTPBasicAuth",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "decouple.config",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "requests.reques... |
22124651099 | import json
from channels.generic.websocket import AsyncWebsocketConsumer
from channels.db import database_sync_to_async
from .models import Message
from userauth.models import User
from .models import Conversation
class ChatConsumer(AsyncWebsocketConsumer):
def __init__(self, *args, **kwargs):
super().__i... | codynego/ChaCha | chat/consumers.py | consumers.py | py | 3,576 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "channels.generic.websocket.AsyncWebsocketConsumer",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "json.loads",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "models.Conversation.objects.get",
"line_number": 75,
"usage_type": "call"
}... |
30330065701 | import numpy as np
import os
import argparse
import h5py
import sys
from spad_tools.listFiles import listFiles
from spad_tools.array2tiff import array2tiff, array2RGBtiff
from spad_tools.getFCSinfo import getFileInfo
from libttp import ttp
"""
This set of functions allows to read a binary file containing SPAD measurem... | VicidominiLab/libspadffs | spad_fcs/meas_to_count.py | meas_to_count.py | py | 12,651 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.uint16",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "numpy.fromfile",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.reshape",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "numpy.bitwise_and",
... |
13367936976 | from dotenv import load_dotenv
from os import getenv
from model import load_embeddings_model
from csv import DictReader
from ast import literal_eval
from langchain.schema.document import Document
from langchain.vectorstores import FAISS
def _load_books() -> list:
"""
Load the books from a csv file and organize... | AethersHaven/Bookie | embed.py | embed.py | py | 2,661 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "csv.DictReader",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "ast.literal_eval",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "ast.literal_eval",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "ast.literal_eval",
... |
74352476903 | # -*- coding: utf-8 -*-
"""
-------------------------------------------------------------------------------
GUFY - Copyright (c) 2019, Fabian Balzer
Distributed under the terms of the GNU General Public License v3.0.
The full license is in the file LICENSE.txt, distributed with this software.
----------------... | Fabian-Balzer/GUFY | GUFY/simgui_modules/checkBoxes.py | checkBoxes.py | py | 8,443 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "PyQt5.QtWidgets.QCheckBox",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 22,
"usage_type": "name"
}
] |
9195714863 | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from math import sqrt
def wn_conv1d(*args, **kwargs):
return nn.utils.weight_norm(nn.Conv1d(*args, **kwargs))
def wn_conv_transpose1d(*args, **kwargs):
return nn.utils.weight_norm(nn.ConvTranspose1d(*args, **kwargs))
de... | kklemon/text-gan-experiments | legacy/vq_vae_text/vq_vae_text/modules.py | modules.py | py | 10,464 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.nn.utils.weight_norm",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torch.nn.utils",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv... |
42154810648 | # 무인도 여행 BFS
from collections import deque
dirs = [(0, 1), (0, -1), (-1, 0), (1, 0)]
score = 0
def bfs(maps, visited, x, y):
global score
queue = deque()
queue.append((x, y))
visited[x][y] = 0
score = int(maps[x][y])
while queue:
x, y = queue.popleft()
for d in dirs:
... | FeelingXD/algorithm | programers/154540-2.py | 154540-2.py | py | 1,279 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "collections.deque",
"line_number": 9,
"usage_type": "call"
}
] |
2876716401 | from argparse import ArgumentParser
from config_parser import get_config
import os
import yaml
import matplotlib.pyplot as plt
import time
import torch
from torch import nn, optim
import wandb
from typing import Callable, Tuple
from utils.loss import LabelSmoothingLoss
from utils.opt import get_optimizer, get_adversa... | GregTheHunInDk/Robust_KWT | adv_pretrain.py | adv_pretrain.py | py | 16,336 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.join",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number... |
9791587429 | from django.shortcuts import render, redirect
from django.http import HttpResponse, JsonResponse
from django.views.decorators.csrf import csrf_exempt
from rest_framework.parsers import JSONParser
from task.models import Task, TaskImage
from apiApp.serializers import TaskSerializer, TaskImageSerializer
from rest_framewo... | osmangony01/DJango_task_RestAPI | apiApp/views.py | views.py | py | 2,133 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.http.HttpResponse",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "rest_framework.views.APIView",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "task.models",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "tas... |
42683425330 | from flask import Flask, Response, render_template
import os
from record_sound import RecordingVoice
import json
import pyaudio
from array import array
import time
import shutil
import numpy as np
from datetime import datetime
WAVE_PATH = 'data/waves'
app = Flask(__name__)
if not os.path.isdir(WAVE_PATH):
os.mak... | Maryia-M/MSI_Project | app.py | app.py | py | 2,460 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number... |
70727262185 | import boto3
import logging
import os
logger = logging.getLogger()
logger.setLevel(logging.INFO)
def str2bool(value):
return value.lower() in ("True",True,"False",False)
def lambda_handler(event, context):
torun = event['torun']
if torun == "true":
awsregion = os.environ['AWS_REGION']
... | AlphaITSystems/dbrefresh | awssoldb-orchestrator-pkg-cloudformation/functions/awssoldb-CreateInstance.py | awssoldb-CreateInstance.py | py | 7,794 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "boto3.client",
... |
74307652262 | import numpy as np
import pandas as pd
import sklearn as skl
import matplotlib.pyplot as plt
plt.close('all')
import warnings
warnings.filterwarnings('ignore')
from sklearn.model_selection import train_test_split
from sklearn.model_selection import StratifiedKFold
from sklearn.model_selection import cross_val_predict
f... | elizabethwyss/EECS731MajorLeagues | src/src.py | src.py | py | 2,127 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "matplotlib.pyplot.close",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "warnings.filterwarnings",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pandas... |
21365549144 | import torch
import numpy as np
from dptb.dataprocess.processor import Processor
from dptb.nnet.nntb import NNTB
from dptb.nnsktb.sknet import SKNet
from dptb.sktb.skIntegrals import SKIntegrals
from dptb.sktb.struct_skhs import SKHSLists
from dptb.hamiltonian.hamil_eig_sk_crt import HamilEig
from dptb.utils.constants... | deepmodeling/DeePTB | dptb/nnops/nnapi.py | nnapi.py | py | 12,168 | python | en | code | 21 | github-code | 36 | [
{
"api_name": "abc.ABC",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
... |
20250127196 | # -*- coding: utf-8 -*-
# Не работали русские буквы
import sys
sys.path.append("/Users/a18826700/Library/Python/3.9/lib/python/site-packages")
import requests
import time
import datetime
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
import math
import random
import telebot
from... | sashka0264/data-science | 00_PYTHON/pynder.py | pynder.py | py | 7,214 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "sys.path.append",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "telebot.TeleBot",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_nu... |
24065781906 | import pytest
from tests.utils import asyncio_patch, AsyncioMagicMock
from gns3server.controller.gns3vm import GNS3VM
from gns3server.controller.gns3vm.gns3_vm_error import GNS3VMError
@pytest.fixture
def dummy_engine():
engine = AsyncioMagicMock()
engine.running = False
engine.ip_address = "vm.local"
... | vieyahn/docker-cisco-lab | gns3server/tests/controller/test_gns3vm.py | test_gns3vm.py | py | 2,760 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "tests.utils.AsyncioMagicMock",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "gns3server.controller.gns3vm.GNS3VM",
"line_number": 22,
"usage_type": "call"
},
{
... |
42578020211 | ''' This module contains functions and classes responsible for
writing solutions into different outputs (files, screen, GUI, etc).
Warning:
if new methods for writing output are added, they MUST
follow the rule: data must be added
sequentially, row after row, column after column.
'''
i... | araith/pyDEA | pyDEA/core/data_processing/write_data.py | write_data.py | py | 30,938 | python | en | code | 38 | github-code | 36 | [
{
"api_name": "pulp.LpStatusOptimal",
"line_number": 127,
"usage_type": "attribute"
},
{
"api_name": "pulp.LpStatus",
"line_number": 135,
"usage_type": "attribute"
},
{
"api_name": "pulp.LpStatusOptimal",
"line_number": 187,
"usage_type": "attribute"
},
{
"api_nam... |
27022624529 | import re
from itertools import zip_longest
from parso.python import tree
from jedi import debug
from jedi.inference.utils import PushBackIterator
from jedi.inference import analysis
from jedi.inference.lazy_value import LazyKnownValue, LazyKnownValues, \
LazyTreeValue, get_merged_lazy_value
from jedi.inference.n... | davidhalter/jedi | jedi/inference/arguments.py | arguments.py | py | 12,218 | python | en | code | 5,554 | github-code | 36 | [
{
"api_name": "jedi.inference.base_value.NO_VALUES",
"line_number": 58,
"usage_type": "name"
},
{
"api_name": "jedi.inference.utils.PushBackIterator",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "jedi.inference.base_value.ValueSet",
"line_number": 80,
"usage_... |
74436410985 | # -*- coding: utf-8 -*-
# Data preparation at one-second level for Ph.D thesis
# @author: Andres L. Suarez-Cetrulo
import glob
import time
import logging
import yaml
import subprocess
import os
import pandas as pd
import numpy as np
import datetime
# Global attributes
SLASH = os.path.sep
EQUIVALENCE = {
's': 1,
... | cetrulin/Quant-Quote-Data-Preprocessing | src/2_testing.py | 2_testing.py | py | 16,897 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "logging.DEBUG",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "time.strptime",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "logging.debug",
"li... |
75075550182 | import torch
import numpy as np
from ..utils.decode import _nms, _topk, _topk_channel, _transpose_and_gather_feat
def multi_pose_decode(heat, wh, kps, reg=None, hm_hp=None, hp_offset=None, K=100):
batch, cat, height, width = heat.size()
num_joints = kps.shape[1] // 2
# heat = torch.sigmoid(heat)
# pe... | tteepe/CenterNet-pytorch-lightning | CenterNet/decode/multi_pose.py | multi_pose.py | py | 4,647 | python | en | code | 58 | github-code | 36 | [
{
"api_name": "utils.decode._nms",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "utils.decode._topk",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "utils.decode._transpose_and_gather_feat",
"line_number": 15,
"usage_type": "call"
},
{
"api_... |
31324284158 | #!/usr/bin/python3
import sqlite3
from itertools import chain
conn = sqlite3.connect('vexdb.db')
curs = conn.cursor()
sql = 'INSERT INTO IRType(id, btype, nbits) VALUES (?,?,?)'
first=True
value=0;
with open('irtypes.lst') as f:
for line in f:
line = line.rstrip()
if first:
# Ity_INV... | EmmetCaulfield/valgrind | arinx/hacking/insert-irtypes.py | insert-irtypes.py | py | 664 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sqlite3.connect",
"line_number": 6,
"usage_type": "call"
}
] |
42229482357 | import torch
import torchvision.ops as tv
input_tensor = torch.rand(1000, 4)
scores = torch.rand(1000, 59)
#print(input_tensor)
#print(scores[1])
def NMS_cal(input_tensor, scores):
NMS_group = []
for i in range(59):
confidscore, _ = torch.max(scores, dim=1)
catargmax = torch.argmax(scores, di... | RasmusNylander/guacamole | filter_for_mAP.py | filter_for_mAP.py | py | 605 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.rand",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "torch.rand",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "torch.max",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.argmax",
"line_number": 14,
... |
11519350312 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from functools import wraps
import logging
from numbers import Number
from time import time
from types import FunctionType
from lab import B
from plum import Dispatcher, Self, Referentiable
__all__ = []
_dispatch = Dispatcher(... | pb593/stheno | stheno/util.py | util.py | py | 1,175 | python | en | code | null | github-code | 36 | [
{
"api_name": "plum.Dispatcher",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "lab.B.Numeric",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "lab.B",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "lab.B.rank",
"line_numbe... |
32006328277 | import Chat
import nltk
from nltk.corpus import wordnet as wn
#nltk.download()
#!/usr/bin/python
def getSynonyms(words):
synonyms = []
for word in words:
for s in wn.synsets(word):
for l in s.lemmas():
synonyms.append(l.name())
return set(synonyms)
# findPersonKeywo... | Ryanlys/310_A2 | PersonOrLocation.py | PersonOrLocation.py | py | 4,273 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "nltk.corpus.wordnet.synsets",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.wordnet",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "Chat.getBranch",
"line_number": 91,
"usage_type": "call"
}
] |
36156312492 | # coding:utf-8
"""
@author:hanmy
@file:ParaEsti_N.py
@time:2019/04/24
"""
import numpy as np
import matplotlib.pyplot as plt
from gmm import GMM
# 计算steps次参数估计的权重值的均值和方差
def pi_N(N, pi, mean_1, cov_1, mean_2, cov_2, steps):
gmm = GMM(N, pi, mean_1, cov_1, mean_2, cov_2)
pi_steps = np.zeros(shape=steps)
# ... | hanmy1021/NLP | gmm/ParaEsti_N.py | ParaEsti_N.py | py | 2,130 | python | en | code | 6 | github-code | 36 | [
{
"api_name": "gmm.GMM",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "gmm.dataset",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "gmm.EM",
"line_number": 24,
"... |
21131384578 | """Django Models for tracking the configuration compliance per feature and device."""
import json
import logging
from deepdiff import DeepDiff
from django.core.exceptions import ValidationError
from django.db import models
from django.utils.module_loading import import_string
from hier_config import Host as HierConfi... | nautobot/nautobot-plugin-golden-config | nautobot_golden_config/models.py | models.py | py | 27,885 | python | en | code | 91 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "nautobot_golden_config.choices.RemediationTypeChoice.TYPE_CUSTOM",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "nautobot_golden_config.choices.RemediationTypeChoice",
... |
75186130022 | import argparse
import logging
import multiprocessing as mp
import os
import pytz
import shutil
from datetime import datetime
from lego_prover.env.chromas import ChromaBridge
from lego_prover.evolver import Evolver
from lego_prover.prover import Prover
import lego_prover.utils as U
from openai_key import *
parser = a... | wiio12/LEGO-Prover | run_multiprocess.py | run_multiprocess.py | py | 6,373 | python | en | code | 9 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 47,
"usage_type": "attribute"
},
{
"api_name": "shutil.rmtree",
... |
12626750581 | # Python standard library
import sys
sys.path.append('./../pyqtgraph')
# Scipy
import matplotlib.backends.backend_qt4agg
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from matplotlib.patches import Polygon
from mpl_toolkits.basemap import Basemap
import numpy as np
# PyQt
import PyQt4.QtCore
import PyQt4... | tphinkle/sea_ice | qt_app/view/view.py | view.py | py | 14,067 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.path.append",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.backends.backend_qt4agg.backends",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_... |
14312689350 | from django.urls import path
from .views import *
urlpatterns = [
path('test/', test, name="test"),
# HttpResponse--------------------------------------------------------------------
path('test-1/', TestViewClass_1.as_view(), name="TestViewClass_1"),
path('test-2/', TestViewClass_2.as_view(), name="Tes... | rakib1515hassan/Class-Base-View-Project | viewtest/urls.py | urls.py | py | 3,041 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
15476948155 | from __future__ import division, print_function, absolute_import
import pytest
from faker.providers import BaseProvider
from hypothesis import given
from hypothesis.strategytests import strategy_test_suite
from hypothesis.internal.debug import minimal
from hypothesis.extra.fakefactory import fake_factory
class Kitt... | LyleH/hypothesis-python_1 | tests/fakefactory/test_fake_factory.py | test_fake_factory.py | py | 2,163 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "faker.providers.BaseProvider",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "hypothesis.given",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "hypothesis.extra.fakefactory.fake_factory",
"line_number": 18,
"usage_type": "call"
},
... |
72692460583 | #!/usr/bin/env python3
# pyre-strict
import asyncio
import logging
import sys
from typing import Any, Union
import click
__version__ = "0.6.9"
LOG: logging.Logger = logging.getLogger(__name__)
def _handle_debug(
ctx: Union[click.core.Context, None],
param: Union[click.core.Option, click.core.Parameter, No... | cooperlees/base_clis | py/base_cli.py | base_cli.py | py | 1,315 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "logging.Logger",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "typing.Union",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "click.core",
"... |
27551438109 | #!/usr/bin/env python3
import argparse
import dgl
import numpy as np
import pandas as pd
import pickle as pkl
import torch
import torch.nn.functional as F
import ipdb
from gnn.link_prediction import LinkPredictor, compute_lp_loss
from gnn.node_classification import NodeClassifier, NodeClassifierConv
# if torch.cuda... | EpistasisLab/qsar-gnn | main.py | main.py | py | 13,805 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "torch.tensor",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "torch.ones",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "torch.ones",
"line_number... |
74579468262 | from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter, URLRouter
import landing_page.routing
application = ProtocolTypeRouter({
# (http->django views is added by default)
'websocket': AuthMiddlewareStack(
URLRouter(
landing_page.routing.websoc... | gitsh1t/vetrina_test | sitotest/routing.py | routing.py | py | 422 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "channels.routing.ProtocolTypeRouter",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "channels.auth.AuthMiddlewareStack",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "channels.routing.URLRouter",
"line_number": 8,
"usage_type": "call"
... |
29466618583 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from pron91pkg import httputil
from bs4 import BeautifulSoup
from pron91pkg import disk
import requests
import shutil
import os
import time
from pron91pkg.FakeHeader import FakeHeader
# 1.get title
#2.get html5 m3u8
#3.download ts files from m3u8
#4.merge m3u8 to one fil... | Crazyalllife/pron91 | yezmw/yezmw.py | yezmw.py | py | 5,298 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "pron91pkg.disk.mkdir",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pron91pkg.disk",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "pron91pkg.httputil.fetchContent",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "p... |
34036888232 |
# Задание №7
import json
with open("lesson_5_hw_77.json", "w") as j_file:
with open("lesson_5_hw_7.txt", "r") as f_o:
subjects = {}
middle = {}
k, o = 0, 0
line = f_o.read().split("\n")
for i in line:
i = i.split()
profit = int(i[2]) - int(i[3])
... | TBidnik/python | practicum.py | practicum.py | py | 556 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "json.dump",
"line_number": 21,
"usage_type": "call"
}
] |
33902538934 | #!/usr/bin/python
# -*- coding: utf-8 -*-
""" @brief Precision and Recall
@ref https://en.wikipedia.org/wiki/Precision_and_recall
Modified from https://github.com/lyst/lightfm and https://github.com/jfkirk/tensorrec
@author <ariel kalingking> akalingking@gmail.com """
import numpy as np
import p... | akalingking/RecSys | metrics.py | metrics.py | py | 1,793 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "numpy.ndarray",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "pandas.DataFrame",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "scipy.sparse.coo_matrix",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "scip... |
36992033529 | import os
import sys
from PIL import Image
from scene.cameras import Camera
from typing import NamedTuple
from scene.colmap_loader import read_extrinsics_text, read_intrinsics_text, qvec2rotmat, \
read_extrinsics_binary, read_intrinsics_binary, read_points3D_binary, read_points3D_text
from scene.hyper_loader impor... | hustvl/4DGaussians | scene/dataset_readers.py | dataset_readers.py | py | 23,816 | python | en | code | 995 | github-code | 36 | [
{
"api_name": "typing.NamedTuple",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
... |
13448911430 | import logging
import cv2
import numpy
from inquire.detection.ButtonState import ButtonState
from inquire.detection.RecognizedElement import RecognizedElement
try:
from robot.api.logger import info
robot_logger = True
except ImportError:
robot_logger = False
logging.basicConfig(level=logging.INFO)
... | Diyomee/Inquire | src/inquire/detection/TextElement.py | TextElement.py | py | 3,930 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.basicConfig",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "inquire.detection.RecognizedElement.RecognizedElement",
"line_number": 18,
"usage_type": "name"
}... |
18665423985 | """
Calculate L and T velocities from LL and LT backwalls.
Raises
------
IndefiniteVelocityError
Output
------
conf.d/30_block_velocities.yaml
velocity_L.png
velocity_T.png
"""
import logging
import numpy as np
import matplotlib.pyplot as plt
import arim
import arim.ray
from arim.im.das import lanczos_interpolation... | nbud/arimtoolkit | arimtoolkit/measure_velocities_from_timetraces.py | measure_velocities_from_timetraces.py | py | 6,801 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.basicConfig",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "logging.getLo... |
30333812871 | import cv2
import numpy as np
img1 = cv2.imread('pratica02/cameraman.tif', cv2.IMREAD_UNCHANGED)
img2 = cv2.imread('pratica02/morangos.tif', cv2.IMREAD_UNCHANGED)
imgCinza = cv2.cvtColor(img2, cv2.COLOR_BGR2GRAY)
# python exibe em BGR => B=0 G=1 R=2
red2 = (img2[:, :, 2])
blue2 = (img2[:, :, 0])
green2 = (img2[:, :,... | Vicinius/digital-image-processing | pratica02/rgb-to-grayscale.py | rgb-to-grayscale.py | py | 1,072 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "cv2.imread",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.IMREAD_UNCHANGED",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "cv2.imread",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.IMREAD_UNCHANGED",
... |
74050045544 | from parlai.core.params import ParlaiParser
from parlai.agents.repeat_label.repeat_label import RepeatLabelAgent
from parlai.core.worlds import create_task
from parlai.utils.conversations import Conversations
from parlai.utils.misc import TimeLogger
import random
import tempfile
def setup_args():
"""
Set up c... | facebookresearch/ParlAI | parlai/crowdsourcing/tasks/acute_eval/dump_task_to_acute_format.py | dump_task_to_acute_format.py | py | 3,809 | python | en | code | 10,365 | github-code | 36 | [
{
"api_name": "parlai.core.params.ParlaiParser",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "parlai.agents.repeat_label.repeat_label.RepeatLabelAgent",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "parlai.core.worlds.create_task",
"line_number": 56,
... |
13495728190 | from flask import Flask
from flask_restful import Api
from helpers.crossdomain import *
from messenger_webhook import MessengerWebhook
application = Flask(__name__, template_folder='template', static_url_path='/static')
application.config.from_object(__name__)
application.config['SECRET_KEY'] = '1ex13eu103me91i-sdf'
a... | joshwolff1/cs238-final-project | application.py | application.py | py | 717 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask_restful.Api",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "messenger_webhook.MessengerWebhook",
"line_number": 13,
"usage_type": "argument"
}
] |
40086649970 |
import os
import bpy
from mathutils import Vector
import numpy as np
import sys
sys.path.append('.')
from blender import BlenderWrapper
class BlenderHelper(BlenderWrapper):
def __init__(self):
super().__init__()
self.set_transparent_background()
self.set_image_size(1800, 1090)
##... | luca-morreale/blender_rendering3d | source/blender_helper.py | blender_helper.py | py | 5,728 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.path.append",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "blender.BlenderWrapper",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "mathutils.Vector",... |
17093369252 | import itertools
N, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
if (M != 0):
cd = [list(map(int, input().split())) for _ in range(M)]
else:
cd = list(list())
groups = list(list())
for i in range(1, N + 1):
conn_list = [item for item in cd if item[0... | kmdkuk/myAtCoder | acr106/b/main.py | main.py | py | 1,414 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "itertools.chain.from_iterable",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "itertools.chain",
"line_number": 16,
"usage_type": "attribute"
}
] |
31705158569 | from hx711 import HX711
from time import sleep, strftime
from datetime import datetime, timedelta
from datetime import timezone
from output import Output
import numpy
import os
import logging
fileRW = Output()
logger = logging.getLogger(__name__)
class sensor:
def __init__(self):
# Sets up scales
... | tech4nature/HogPi | app/weight.py | weight.py | py | 4,254 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "output.Output",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "hx711.HX711",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"lin... |
11543344946 | from flask import Flask, render_template, request,jsonify
from flask_cors import CORS,cross_origin
import requests
from bs4 import BeautifulSoup as bs
from urllib.request import urlopen
import logging
import pymongo
logging.basicConfig(filename="scrapper.log" , level=logging.INFO)
app = Flask(__name__)
@app.route("/"... | nnamanagarwal/data_science_project | new_pw_eng_scrap/app.py | app.py | py | 4,203 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.basicConfig",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "flask.Flask",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.render_template... |
468491372 | import torch
from torch import nn
from torch.utils.data import Dataset, DataLoader
from ...base import device
class RandomDataset(Dataset):
def __init__(self, size, length):
self.len = length
self.data = torch.randn(length, size)
def __getitem__(self, index):
return self.data[index]
... | cdgyp/sparsity | codes/scripts/distributed/toy.py | toy.py | py | 1,620 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "torch.randn",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.utils.data.DataLoader",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch... |
32468298278 | from django.conf.urls import url
from django.views.decorators.csrf import csrf_exempt
from rest_framework.routers import DefaultRouter
from users import views
from .views import UserViewSet, custom_auth_token
router = DefaultRouter()
router.register(r'users', UserViewSet)
urlpatterns = router.urls
urlpatterns += [
... | faradzh/medilix | medilix/users/urls.py | urls.py | py | 1,545 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "rest_framework.routers.DefaultRouter",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "views.UserViewSet",
"line_number": 8,
"usage_type": "argument"
},
{
"api_name": "django.conf.urls.url",
"line_number": 13,
"usage_type": "call"
},
{
"api... |
30981798805 | #!/usr/bin/env python
# <bitbar.title>Countdown</bitbar.title>
# <bitbar.version>v2.0</bitbar.version>
# <bitbar.author>Pere Albujer</bitbar.author>
# <bitbar.author.github>P4R</bitbar.author.github>
# <bitbar.desc>Shows countdown of established date.</bitbar.desc>
# <bitbar.image>https://cloud.githubusercontent.com/a... | damncabbage/dotfiles | macOS/BitBar/Plugins/Time/countdown.1s.py | countdown.1s.py | py | 3,243 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "sys.argv",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 50,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.now",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",... |
22041191064 | from matplotlib import pyplot as plt
import scipy.stats as spstats
from loomio import *
from socialchoice import *
from timeseries import *
legend_fontsize = 7
formats = ['.-', 's-']
markersizes = [9, 5]
class NetDelib(object):
def __init__(self):
self.plot_mean = False
def plot_errorbar(s... | elplatt/Exp-Net-Delib | experiments/NetDelib-002/analysis/netdelib.py | netdelib.py | py | 9,150 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "matplotlib.pyplot.errorbar",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.xticks",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": ... |
26661454366 | import datetime
import http
import json
import sys
import time
from http.client import HTTPSConnection
import discord
from discord.ext import commands, tasks
import settings
def current_time_string():
return datetime.datetime.utcfromtimestamp(time.time()).strftime('%H:%M:%S')
class TwitchCog(commands.Cog, nam... | gr3ger/pyGaBot | twitch_cog.py | twitch_cog.py | py | 7,835 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "datetime.datetime.utcfromtimestamp",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "time.time",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "d... |
37360523175 | import glob
import re
import traceback
from pathlib import Path
from typing import List, Union
import fitz
import utils
from constants import cmd_output_path
from loguru import logger
def convert_to_image_pdf(doc_path: Union[str, List[str]], dpi: int = 300, page_range: str = "all", output_path: str = None):
try:
... | kevin2li/PDF-Guru | thirdparty/convert.py | convert.py | py | 11,219 | python | en | code | 941 | github-code | 36 | [
{
"api_name": "typing.Union",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "glob.glob",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 23,... |
11671695671 | import argparse
class CommonArgParser(argparse.ArgumentParser):
def __init__(self):
super(CommonArgParser, self).__init__()
self.add_argument('--model_name', default='TransE',
choices=['TransE', 'TransE_l1', 'TransE_l2', 'TransR',
'RESCAL... | menjarleev/dgl-ke | python/dglke/util/argparser/common_argparser.py | common_argparser.py | py | 11,343 | python | en | code | null | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 2,
"usage_type": "attribute"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.