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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
34079291343 | from utils import util
import argparse
import networkx as nx
from metrics_eval import ranking_metrics
import numpy as np
import scipy
import hierarchy_stats
import pickle
import sys
def sample_related_classes(class2superclasses, valid_classes):
mod2classes = {}
with open(class2superclasses) as f:
for l... | wala/blanca | tasks/hierarchyAnalysis/correlation_eval.py | correlation_eval.py | py | 4,784 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "networkx.Graph",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "networkx.all_pairs_shortest_path",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "pickle.dump",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "pickle.HI... |
27986360711 | # python tst_py_cmd.py --gpus 6,7
# python tst_py_cmd.py --
import os
import argparse
from EXP_CONCONFIG.CONFIGS.model_DOTA_hbb_tv_config import cfgs, show_dict
from EXP_CONCONFIG.CONFIGS.model_DOTA_obb_tv_config import obb_cfgs
from EXP_CONCONFIG.CONFIGS.model_DIOR_full_config import DIOR_cfgs
from EXP_CONCONFIG.CO... | cenchaojun/mmd_rs | EXP_CONCONFIG/py_cmd.py | py_cmd.py | py | 6,994 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "EXP_CONCONFIG.CONFIGS.model_DOTA_hbb_tv_config.cfgs.update",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "EXP_CONCONFIG.CONFIGS.model_DOTA_obb_tv_config.obb_cfgs",
"line_number": 14,
"usage_type": "argument"
},
{
"api_name": "EXP_CONCONFIG.CONFIGS.mode... |
19416340817 | import os
from pathlib import Path
from datetime import timedelta
import click
import matplotlib.pyplot as plt
import matplotlib as mpl
import seaborn as sns
import pandas as pd
import numpy as np
import sqlalchemy
import requests_cache
import urbanoccupants as uo
import geopandasplotting as gpdplt
ROOT_FOLDER = Path... | timtroendle/urban-occupants-paper | scripts/plot/simulationresults.py | simulationresults.py | py | 8,912 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "pathlib.Path",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "requests_cache.install_cach... |
34682870961 | ################################################################################
# CSE 253: Programming Assignment 4
# Code snippet by Ajit Kumar, Savyasachi
# Fall 2020
################################################################################
import torch.nn as nn
import torchvision.models as models
##########... | jacky3331/Recurrent-NeuralNetwork | model_factory.py | model_factory.py | py | 7,220 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "torchvision.models.resnet50",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torchvision... |
38877971695 | import plots
from utils import Engine, get_dataset, get_empty_traits, map_calculated_scores_to_user, calculate_similarities
from plots import *
if __name__ == '__main__':
# Get and load the dataset
dataset = get_dataset(['data/dataset_2017.csv'])
# Get a random user with 20/79 scores filled. The rest are 0... | Kaediin/IPASS | main.py | main.py | py | 1,315 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "utils.get_dataset",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "utils.Engine",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "utils.get_empty_traits",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "utils.map_calcul... |
43857678125 | import pygame
# Define some colors
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
GREEN = (0, 255, 0)
RED = (255, 0, 0)
# Grid of numbers
grid = []
for row in range(10):
grid.append([])
for column in range(10):
grid[row].append(0)
pygame.init()
# Set the width and height of the screen [width, height]... | NoirEgoiste/Program-arcade-games-with-Python-and-Pygame | lesson_ex_16.py | lesson_ex_16.py | py | 1,882 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.init",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "pygame.displa... |
40787556914 | import os, requests, time
totalbots = 0
totalmembers = 0
start = input("[STARTUP] - Do you want to add multiple servers?\n")
starttime = time.time()
while(True):
serverarray = []
if start.lower() == "y":
print("[STARTUP] - Alright, activating multiple server mode!")
num = input("\n[STARTUP] - How many serve... | ksIsCute/Revolt-Bot-Adder | main.py | main.py | py | 3,242 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "time.time",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "time.sleep",
"line_number":... |
35010703840 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
from PyQt5.QtWidgets import QApplication, QMainWindow, QStatusBar, QFileDialog
from PyQt5 import QtGui, uic
qtCreatorFile = "dialog.ui"
Ui_MainWindow, QtBaseClass = uic.loadUiType(qtCreatorFile)
class LinearniSifra(QMainWindow, Ui_MainWindow):
def erro... | FAIKRYHB/LinearniSifra | main.py | main.py | py | 2,404 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "PyQt5.uic.loadUiType",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "PyQt5.uic",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWi... |
3203336952 | import discord
from discord.ext import commands
from Cogs.Utils.OD import tournaments
import os
import pickle
import asyncio
import time
import re
import operator
class Fantasy:
def __init__(self, bot):
self.bot = bot
self.bot.loop.create_task(self.match_checker())
if os.path.isfile('fan... | BenjinZA/BearBot | Cogs/fantasy.py | fantasy.py | py | 18,090 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.isfile",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "pickle.load",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_nu... |
35432665379 | __author__ = "Shiven"
import unittest
from unittest.mock import patch
from io import StringIO
from Calculator import Calculator
class TestCalculator(unittest.TestCase):
sample_input_1 = iter([3, 4]).__next__
@patch('builtins.input', sample_input_1)
def test_calculator_1(self):
cal = Calculator(... | shivendrasrivastava/codewars | kyu7/exceptions/Calculator-unittest.py | Calculator-unittest.py | py | 934 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "unittest.TestCase",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "Calculator.Calculator",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "io.StringIO",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "unittest.mock... |
26042424066 | from textwrap import dedent
import pytest
from pants.build_graph.address import Address, ResolveError
from pants.core import register
from pants.core.target_types import GenericTarget
from pants.testutil.rule_runner import RuleRunner, engine_error
from pants.version import PANTS_SEMVER
def test_get_with_version():
... | pantsbuild/pants | src/python/pants/core/aliases_test.py | aliases_test.py | py | 2,352 | python | en | code | 2,896 | github-code | 6 | [
{
"api_name": "pants.testutil.rule_runner.RuleRunner",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pants.core.register.build_file_aliases",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pants.core.register",
"line_number": 13,
"usage_type": "name... |
40411406191 | #!/usr/bin/env python3
"""
Name: system_process_memory.py
Description: NXAPI: display memory usage of system processes
This script displays cumulative memory usage for physical, virtual, and rss memory for each process name.
Some processes (e.g. bash) contain multiple entries with the same name. For these,
we sum th... | allenrobel/nxapi-netbox | scripts/system_process_memory.py | system_process_memory.py | py | 9,057 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "nxapi_netbox.args.args_cookie.ArgsCookie",
"line_number": 72,
"usage_type": "name"
},
{
"api_name": "nxapi_netbox.args.args_nxapi_tools.ArgsNxapiTools",
"line_number": 72,
"... |
13904996231 | import tensorflow as tf
import tensorflow.keras as keras
import numpy as np
import matplotlib.pyplot as plt
from IPython import display
def plot_multiple_images(images, n_cols=None):
'''visualizes fake images'''
display.clear_output(wait=False)
n_cols = n_cols or len(images)
n_rows = (len(images) - ... | anilkumarchebrolu/tensorflow_advanced_techniques_specialization | course4_generative_deep_learning_with_tensorflow/Week4/C4_W4_Lab_1_First_GAN.py | C4_W4_Lab_1_First_GAN.py | py | 5,095 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "IPython.display.clear_output",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "IPython.display",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "numpy.squeeze",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib... |
36148947750 | from modelos.cortebenders import CorteBenders
from typing import List
class No:
"""
Representação de um nó no pente de afluências.
"""
def __init__(self, afluencias: List[float]):
# Uma lista onde o ID da UHE é usada como índice
# para obter a respectiva influência
self.afluen... | rjmalves/lpoe | modelos/no.py | no.py | py | 4,272 | python | pt | code | 0 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": ... |
2732724142 | from django.test import TestCase
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt, csrf_protect
from control.middleware.user import User, login_required_layui
from control.middleware.config import RET_DATA, logger
from apple.middleware.api import... | lessknownisland/signature | apple/tests.py | tests.py | py | 1,925 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "control.middleware.user.User",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "control.middleware.config.RET_DATA.copy",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "control.middleware.config.RET_DATA",
"line_number": 22,
"usage_type"... |
74154659068 | import cv2
from glob import glob
from datetime import datetime
import numpy as np
import tensorflow as tf
# import tensorflow.keras.backend as K
import keras.backend as K
from model import Deeplabv3
from sklearn.model_selection import train_test_split
# from tensorflow.keras.models import Model
from keras.models import... | chcorophyll/deeplabv3plus | train.py | train.py | py | 5,054 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "keras.backend.clear_session",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "keras.backend",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "glob.glob",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"... |
74418329786 | import pygame
from pygame.locals import *
pygame.init()
screen = pygame.display.set_mode((640,480))
pygame.display.set_caption("Shapes!!")
red=(255,0,0)
blue = (0,0,255)
class Ball:
def __init__(self, x,y,color, radius):
self.x=x
self.y=y
self.color=color
self.radius = radius
de... | aryatyagi14/Practicing-Python | Object Oriented Programming 1.py | Object Oriented Programming 1.py | py | 901 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.init",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.s... |
38046646022 | from flask import Flask, render_template, request
import subprocess as sp
from pymongo import MongoClient
from mongopass import mongopass
app = Flask(__name__)
client = MongoClient(mongopass)
db = client.crud
myCollection = db.myColl
@app.route("/")
def my_home():
date = sp.getoutput("date /t")
return rende... | Aisulu-Tulyeujan/Flask | app.py | app.py | py | 1,393 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "mongopass.mongopass",
"line_number": 8,
"usage_type": "argument"
},
{
"api_name": "subprocess.getou... |
35819794085 | from django.contrib.auth.models import AbstractUser
from django.core.exceptions import ValidationError
from django.db import models
from .consts import SERVICE_NAME
from .enums import UserRole
class User(AbstractUser):
email = models.EmailField(
unique=True,
verbose_name="Почта",
... | MartiAndrew/api_yamdb_final | api_yamdb/user/models.py | models.py | py | 994 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.contrib.auth.models.AbstractUser",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.db.models.EmailField",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.db.models",
"line_number": 10,
"usage_type": "name"
},
{
... |
74535244028 | from datasets import MIMICIV_ARDS_Dataset
import tools
import os
class DataContainer():
'''存放数据和一些与模型无关的内容'''
def __init__(self):
self._conf = tools.GLOBAL_CONF_LOADER['analyzer']['data_container'] # 这部分是global, 对外界不可见
self.n_fold = self._conf['n_fold']
self.seed = self._conf['seed']
... | on1262/sepsisdataprocessing | analyzer/container.py | container.py | py | 880 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "tools.GLOBAL_CONF_LOADER",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "tools.GLOBAL_CONF_LOADER",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "tools.Config",
"line_number": 18,
"usage_type": "call"
}
] |
2231445332 | '''
DATA 622 - Homework 2
Joshua Sturm
10/07/2018
This script will score the classification model.
'''
import train_model
import pandas as pd
from sklearn.metrics import classification_report
import pickle
# Rename variables
X = train_model.X
y = train_model.y
test = train_model.test
X_test = train_model.X_test
y_te... | JoshuaSturm/data_622_homework_3 | score_model.py | score_model.py | py | 1,222 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "train_model.X",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "train_model.y",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "train_model.test",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "train_mod... |
69936267068 | from fastapi import APIRouter, HTTPException, Depends, security
from sqlalchemy import orm
import db.managers.users as users_manager
import schemas.users
from db.services import get_db
from schemas.users import UserCreate
router = APIRouter(prefix="/api/users")
@router.post("/")
async def create_user(
user:... | Danielto1404/bachelor-courses | python-backend/projects/digital-art/server/api/users.py | users.py | py | 1,776 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "schemas.users.UserCreate",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.orm.Session",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": ... |
3360594306 | """
백준 15828 : Router
"""
from collections import deque
N=int(input())
L=deque()
while True:
if len(L)>N:
L.pop()
A=int(input())
if A==-1:
break
if A==0:
L.popleft()
else:
L.append(A)
if not L:
print("empty")
else:
print(... | 030831/2023-Winter_Vacation_GroupStudy | 15828.py | 15828.py | py | 327 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.deque",
"line_number": 9,
"usage_type": "call"
}
] |
12483866429 | import numpy as np
import matplotlib.pyplot as plt
from EllipLdrum import EllipLdrum
a,b = 2,1
eld = EllipLdrum(a,b, lmax=65)
x,y = np.meshgrid(np.linspace(-a,a,41), np.linspace(-b,b,41))
levels = np.linspace(-1,1,21)
plt.figure(figsize=(3, 4.5))
plt.subplots_adjust(left=0.05, right=0.95, bottom=0.05, top=0.95)
i=0;... | tt-nakamura/drum | fig6.py | fig6.py | py | 878 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "EllipLdrum.EllipLdrum",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.meshgrid",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
... |
40158266319 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import db
import importlib
import config
import os
import shutil
import logs
import traceback
from meta import Meta
from options import OptionsDb, OptionsYaml, Nothing
from methods import MethodsDb, MethodsYaml
from datetime import datetime
import glob
class Worker:
... | iabsis/builder-ci | lib/worker.py | worker.py | py | 7,820 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "db.getName",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "meta.Meta",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"l... |
34228244710 | import math
from numbers import Integral
from typing import Union, Optional, List, Dict
import numpy as np
def split_array(array, num_samples):
if (num_samples is None) or (num_samples == 0):
return None, array
return array[:num_samples], array[num_samples:]
def get_optimal_stratified_split(split_siz... | AlkaidCheng/aliad | aliad/data/partition.py | partition.py | py | 13,046 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.Dict",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "numbers.Integral",
"line_number": 14,
"usage_type": "argument"
},
{
"api_name": "numpy.sum",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_numb... |
70321405307 | import subprocess
from scipy.misc import imread
import argparse
import tensorflow as tf
import os
import numpy as np
from os import listdir
class Colors:
"""
used to color terminal output for better legibility.
"""
OKBLUE = '\033[94m'
OKGREEN = '\033[32m'
WARNING = '\033[31m'
FAIL = '\033[... | lorenz-h/DataRepresentationLearning | Old Experiments/Juli/DuckieLanesV2/DL_Utilities.py | DL_Utilities.py | py | 4,558 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "subprocess.run",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "scipy.misc.imread",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "argparse.Argume... |
6814825997 | import pika, sys, os, time
from pymongo import MongoClient
import gridfs
# import module from created convert package
from convert import to_mp3
def main():
# create instance of mongodb client to get access to dbs in mongo database
client = MongoClient("host.minihube.internal", 27017)
db_videos = client.videos
db... | dawmro/testing_microservice_architectures | python/src/converter/consumer.py | consumer.py | py | 1,488 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "gridfs.GridFS",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "gridfs.GridFS",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pika.BlockingConnecti... |
38271992701 | """
================================
Standalone Cartopy Functionality
================================
This sample script illustrates how to leverage Tropycal's standalone Cartopy functionality alongside its existing data structures to make custom plots and analyses.
"""
import datetime as dt
from tropycal import trac... | tropycal/tropycal | examples/cartopy.py | cartopy.py | py | 10,897 | python | en | code | 116 | github-code | 6 | [
{
"api_name": "tropycal.tracks.TrackDataset",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "tropycal.tracks",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "cartopy.crs.PlateCarree",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "... |
25905761373 | import webbrowser
import cgi
import js
from mako.template import Template
import mysql.connector
from mysql.connector import Error
import datetime
try:
connection = mysql.connector.connect(host='localhost',
database='bincomphptest',
... | estherthefae/BincomDevelopmentCenter | script.py | script.py | py | 2,691 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "mysql.connector.connector.connect",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "mysql.connector.connector",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "mysql.connector",
"line_number": 11,
"usage_type": "name"
},
{
"... |
26509276370 | import json
import logging
from datetime import datetime
from hashlib import sha256
from typing import Optional
from src.custom_types import Tx
logger = logging.getLogger(__name__)
class Block:
def __init__(
self,
previous_hash: str,
transactions: list[Tx],
timestamp: Optional[st... | lbreede/oilrig | src/block.py | block.py | py | 2,849 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "src.custom_types.Tx",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.Optional"... |
14627893273 | # dev_cog.py
from discord.ext import commands
import discord
class DevCog(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command(name='load', hidden=True)
@commands.is_owner()
async def dev_load(self, ctx, *, cog: str):
"""Load cog. Full dot path required (ex: cogs.roll_cog)"""
s... | guardianroleplay/rollbotexe | rollbot/cogs/dev_cog.py | dev_cog.py | py | 2,556 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "discord.ext.commands.command",
"line_number": 9,
"usage_type": "call"
},
{
"api_... |
12957715309 | import os, sys
import math, copy
from astropy.table import Table # asciidata
import numpy as np
from jlu.gc.gcwork import objects
#from pysqlite2 import dbapi2 as sqlite
from sqlite3 import dbapi2 as sqlite
import pdb
tablesDir = '/u/ghezgroup/data/gc/source_list/'
database = '/u/ghezgroup/data/gc/database/stars.sqlit... | jluastro/JLU-python-code | jlu/gc/gcwork/starTables.py | starTables.py | py | 41,404 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": ... |
15849094162 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2020-10-3 13:24
# @Author : Zim
# @Site :
# @File : tmpPuzzle.py
# @Software: PyCharm
# 参考:https://mp.weixin.qq.com/s?__biz=MzA4Nzk0MjQ4NA==&mid=2651832327&idx=1&sn=ebdfdea3c46c4875b01ca9f1a9127832&chksm=8bcad43cbcbd5d2abe7b2bbcedc6b430eadad2949b... | YuziO2/AIProgramming | EX1/tmpPuzzle.py | tmpPuzzle.py | py | 10,948 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "PIL.Image.open",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "os.path.split",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 3... |
73834847229 | from cards import Card
import random
from collections import Counter
class Player:
def __init__(self, player_id):
self.player_id = player_id
self.cards = []
self.deck = []
self.coins = 2
self.actions = ['income', 'foreign_aid']
# start of method take_cards()
def tak... | StevenChang805/CoupAI | player.py | player.py | py | 2,428 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cards.Card",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"l... |
71894623549 | import json
import numpy as np
from abc import ABC, abstractmethod
__all__ = ['SurrogateModel', 'MLPPredictor']
class SurrogateModel(ABC):
def __init__(self, **kwargs):
pass
@property
@abstractmethod
def name(self):
""" name of the surrogate model """
raise NotImplementedErro... | EMI-Group/evoxbench | evoxbench/modules/surrogate_model.py | surrogate_model.py | py | 3,937 | python | en | code | 60 | github-code | 6 | [
{
"api_name": "abc.ABC",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
... |
42916917806 | import datetime
import os
import threading
import time
import cv2
import numpy
import pandas as pd
# -------------------------
from flask import jsonify, json
from imutils.video import WebcamVideoStream
datas = []
flag = True
video_flag = True
global im
global ret
global cam
local_url = "http://127.0.0.1:5000/send_i... | CentanYane/Video-Based-Intrusion-Detection-Implementation | core/Recognize.py | Recognize.py | py | 7,305 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "datetime.datetime.now",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "cv2.VideoWriter_fourcc",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "c... |
2696850187 | import os
import typing as t
from trava.logger import TravaLogger
from trava.metric import Metric
from trava.model_results import ModelResult
from trava.results_handler import ResultsHandler
from trava.scorer import Scorer
from trava.trava_tracker import Tracker
from trava.utils.tmp import open_tmp_dir
class LoggerH... | ityutin/trava | trava/ext/results_handlers/logger.py | logger.py | py | 3,702 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "trava.results_handler.ResultsHandler",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "trava.scorer.Scorer",
"line_number": 18,
"usage_type": "name"
},
{
"api_nam... |
16519272733 | #!/usr/bin/env python3
from ctypes import sizeof
from os import truncate, write
import boofuzz
import datetime
from boofuzz import blocks
#from six import print_
from fuzzConstants import HELLO_MSG_NAME, OPEN_MSG_NAME, ACK_MSG_TYPE, ERR_MSG_TYPE, OPEN_MSG_TYPE, PROC_MON_PORT
from fuzzConstants import CLOSE_MSG_SEQ_N... | solimand/fuzz-opcua-test | myOpcuaFuzzer.py | myOpcuaFuzzer.py | py | 26,071 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "struct.unpack",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "struct.error",
"line_number": 55,
"usage_type": "attribute"
},
{
"api_name": "struct.unpack",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "struct.unpack",
"li... |
29336850934 | import cv2
import mediapipe as mp
import pyautogui as pg
import autopy
cap = cv2.VideoCapture(0)
mpHands = mp.solutions.mediapipe.python.solutions.hands
hands = mpHands.Hands(min_detection_confidence=0.7)
mpDraw = mp.solutions.mediapipe.python.solutions.drawing_utils
ScreenSize = pg.size()
is_clicked = False
while Tr... | Toktomambetov-Sultan/MouseControll | min.py | min.py | py | 1,489 | python | en | code | 0 | github-code | 6 | [
{
"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": "pyaut... |
40309382521 | from django.db.models import CharField, FloatField
from django.db.models import Value
from rest_framework import status
from rest_framework.response import Response
from rest_framework.views import APIView
from .models import SalesRep, PostalCode
from .serializers import SalesRepSerializer
from nicolock.core.mixins i... | kabroncelli/Nicolock | nicolock/salesreps/rest_views.py | rest_views.py | py | 1,504 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "nicolock.core.mixins.AllowAny",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "rest_framework.views.APIView",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "models.PostalCode.objects.filter",
"line_number": 18,
"usage_type": "call"
}... |
17951969422 | import streamlit as st
import pandas as pd
#st.set_page_config(page_title="Stock Price", page_icon="chart_with_upwards_trend", layout="centered", initial_sidebar_state = "auto")
st.write("""
# NLP Question Answer
""")
Question = st.write("""
## What aspect of the shade should be considered while covering a wide windo... | niharikasaluja/StreamlitWebapp | webapp.py | webapp.py | py | 528 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "streamlit.write",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "streamlit.write",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "streamlit.text_input",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "streamlit.button",... |
17938481649 | from email.mime import image
import numpy as np
import glob
import sys
import os
import cv2
import copy
import math
from scipy.optimize import least_squares
def lamda_cal(inverse_K,Homography):
lamda=1/np.linalg.norm(np.matmul(inverse_K,Homography[:,0]))
return lamda
def extrinsic(intrinsinc_matrix,homography_list)... | khizarmohammed1997/CS_549_AutoCalibration | wrapper.py | wrapper.py | py | 7,451 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.linalg.norm",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "numpy.matmul",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.inv",
... |
1759422846 | """A setuptools based setup module."""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
setup(
name='dynamight',
version='0.1.0',
description='Dynam... | rach-sharp/dynamight | setup.py | setup.py | py | 2,113 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.abspath",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "setuptools.setup",
"line_num... |
71969327229 | import mock
import unittest
from googleapiclient import errors
from kfp_component.google.ml_engine import wait_job
CREATE_JOB_MODULE = 'kfp_component.google.ml_engine._wait_job'
COMMON_OPS_MODEL = 'kfp_component.google.ml_engine._common_ops'
@mock.patch(COMMON_OPS_MODEL + '.display.display')
@mock.patch(COMMON_OPS_MO... | kubeflow/kfp-tekton-backend | components/gcp/container/component_sdk/python/tests/google/ml_engine/test__wait_job.py | test__wait_job.py | py | 1,909 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "unittest.TestCase",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "kfp_component.google.ml_engine.wait_job",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "kfp_component.google.ml_engine.wait_job",
"line_number": 40,
"usage_type":... |
40737988221 | import os
import json
# 设置要生成文件的路径
data_root_path = './dataset'
# 所有类别的信息
class_detail = []
# 获取所有类别保存的文件夹名称,这里是[daisy,dandelion,roses,sunflowers]
class_dirs = os.listdir(data_root_path)
try:
class_dirs.remove('test.list')
class_dirs.remove('trainer.list')
class_dirs.remove('readme.json')
class_dirs.r... | Feng1909/Rubbish_detector | train.py | train.py | py | 13,989 | python | zh | code | 11 | github-code | 6 | [
{
"api_name": "os.listdir",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number"... |
2621500601 | from Ben_ding import engine, L_base, Z_base, E_al7050, YTS_al7050, poisson_al7050, dist_bottom_avg, \
I_yy_bottom_str, I_yy_four_corner_str, n_str_pos, n_str_fin_top_lst
from Aero_Tools.Wing_box_adsee import y_dist, wing_box
from Wing_Calculator import lift, comp_halfdata, trailingedgeangle, leadingedgeangle, c_r, ... | Tarekhelmy/SUSTAXI | Aero_Tools/Downwards_bending.py | Downwards_bending.py | py | 3,843 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "Wing_Calculator.comp_halfdata",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "Wing_Calculator.lift",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "Wing_Calculator.engine",
"line_number": 14,
"usage_type": "call"
},
{
"api_nam... |
10536580806 | from django.conf import settings
from django.contrib.auth import get_user_model
from django.core.management.base import BaseCommand, CommandError
from django.db.utils import IntegrityError
from allauth.account.models import EmailAddress
from authmultitoken.models import Token
from smartcambridge.models import SmartCa... | SmartCambridge/tfc_web | tfc_web/api/management/commands/setup_tfc_prod.py | setup_tfc_prod.py | py | 2,998 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "django.conf.settings.TFC_PROD_USERNAME",
"line_number": 33,
"u... |
32691700638 | # N Σ O N // Nusrets // nusr҂e ###
# Oğurlayanın anasın sikim
###
# Əkmə peysər
from telethon.errors.rpcerrorlist import YouBlockedUserError
from userbot.cmdhelp import CmdHelp
from userbot.events import register
from userbot import bot
from time import sleep as t
from telethon import events
from asyncio import sleep... | TheOksigen/2 | userbot/modules/bass.py | bass.py | py | 3,052 | python | az | code | 0 | github-code | 6 | [
{
"api_name": "telethon.events.NewMessage",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "telethon.events",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "telethon.errors... |
7960757976 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import os
import sys
import argparse
import socket
import time
import threading
try :
import Queue
except :
import queue as Queue
socket . setdefaulttimeout ( 15 )
queue = Queue . Queue ( )
def IiII1IiiIiI1 ( thread_function , args = ( ) ) :
try :
thread_function ( * a... | 20142995/portscan | portscan.py | portscan.py | py | 4,397 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "socket.setdefaulttimeout",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "queue.Queue",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "time.sleep",
... |
33721201231 | from telethon import events
from os import remove
import modules.client
client = modules.client.client
@events.register(events.NewMessage(outgoing=True, pattern=r'\.sdmd'))
async def runsdmd(event):
await event.delete()
targetcontent = await event.get_reply_message()
downloadtargetcontent = await targetco... | khdjkahkjhaskhjhdsflkjsffu/fajslajfsjflfflvakjhakhfashf | modules/selfdestruct.py | selfdestruct.py | py | 439 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "modules.client.client",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "modules.client",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "os.remove",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "telethon.events.reg... |
26086185057 | import numpy as np
import matplotlib.pyplot as plt
X, Y = np.loadtxt('imaging.txt').T[:,0:10]
Xp, Yp = np.loadtxt('imaging.txt').T
C = np.polyfit(X,Y,1,full=False)
f = np.poly1d(C)
print(f)
#plt.plot(X,Y,'o')
plt.plot(Xp,f(Xp))
plt.plot(Xp,Yp,'o-')
plt.xlabel("Focal power (dpt)")
plt.ylabel("Piezo position (um)")
p... | leiferlab/pump-probe-acquisition | TunableLens/tunablelenscalibrations/tunablelenscalibration.py | tunablelenscalibration.py | py | 379 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "numpy.loadtxt",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.polyfit",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.poly1d",
"line_numbe... |
11698434914 | #!/usr/bin/env python3
import psycopg2
DBNAME = "news"
q1 = "What are the 3 most popular articles of all time?"
query_1 = """SELECT articles.title,COUNT(*) FROM articles,log WHERE log.path
LIKE concat('%' ,articles.slug) GROUP BY articles.title
ORDER BY count DESC LIMIT 3"""
q2 = "Who are the most popular a... | ben-haas/udacity-fsnd | LogsAnalysis/logs.py | logs.py | py | 1,457 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "psycopg2.connect",
"line_number": 23,
"usage_type": "call"
}
] |
23123626124 | from django.urls import path
from recipe.views import (
index,
RecipeCreate,
RecipeUpdate,
recipe_detail,
like_recipe,
unlike_recipe,
list_of_recipes_with,
search_recipe,
delete_recipe,
rate_recipe,
)
urlpatterns = [
path('', index, name='index'),
path('add/', Recipe... | eibrahimarisoy/tasty_dishes | recipe/urls.py | urls.py | py | 948 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "recipe.views.index",
"line_number": 16,
"usage_type": "argument"
},
{
"api_name": "django.urls.path",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "recipe.views... |
23642626654 | # -*- coding:utf-8 -*-
#@Time : 2020/4/15 16:18
#@Author: Triomphe
#@File : header.py
import requests
# target='www.baidu.com , qq.com'
def header(target):
"""
:param target: 域名
:return: 字典,需要的http头信息
"""
response={}
if not target.startswith('http'):
target ='http://'+target
try:
... | TriompheL/Ratel | modules/subDomainScan/header.py | header.py | py | 842 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "requests.head",
"line_number": 18,
"usage_type": "call"
}
] |
33754234430 | #!/usr/bin/python3.8
import rospy
from rospy.client import init_node
from sensor_msgs.msg import Image
from cv_bridge import CvBridge
import cv2
def callback(data):
br = CvBridge()
rospy.loginfo("receiving video frame")
current_frame = br.imgmsg_to_cv2(data)
resized_frame = cv2.resize(current_frame, ... | dsvallespir/ros-videocar | src/rosopencv/src/cam_sub.py | cam_sub.py | py | 617 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv_bridge.CvBridge",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "rospy.loginfo",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_nu... |
6819428631 | # django stuff
from django.urls import path
from . import views
urlpatterns = [
path('', views.redirect_home, name='redirect_home'),
path('home/<str:project_id>', views.home, name='home'),
# project urls
path('project-overall/<str:project_id>', views.project_overall, name='project_overall'),
pa... | i27ae15/project-manager | main/urls.py | urls.py | py | 1,616 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
22412341768 | # 1. Launch browser.
# 2. Navigate to url 'http://automationexercise.com'
# 3. Verify that home page is visible successfully
# 4. Click on 'Products' button
# 5. Verify user is navigated to ALL PRODUCTS page successfully
# 6. The products list is visible
# 7. Click on 'View Product' of first product
# 8. User is landed... | auszynski/Automation-practise | [TC-08] Verify all products.py | [TC-08] Verify all products.py | py | 4,204 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.support.ui.WebDriverWait",
"line_number": 24,
"usage_type": "call"
},
... |
19274825233 | #!/usr/bin/env python
'''
Created on Apr 7, 2016
@author: isvoboda
'''
from __future__ import print_function
import logging
import argparse
import yaml
import cnn_image_processing as ci
LOGGER = logging.getLogger("cnn_image_processing")
def main():
'''
Entry point
Args:
argv: list of command li... | DCGM/cnn-image-processing | bin/preview.py | preview.py | py | 1,499 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "logging.... |
74178898107 | import uuid
from sklearn.model_selection import train_test_split
from keras.models import *
from keras.layers import *
import tensorflow as tf
import numpy as np
def covNetRetrain(model,X,Y,epochs,verbose,OnBad):
"""This function will retrain a given covnet model
Args:
model (Model): the model to re... | GNP50/GNP50-First-ARTIFICIAL-NEURAL-NETWORKS-AND-DEEP-LEARNING-Challenge-2022-Polimi | covnet.py | covnet.py | py | 3,278 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_nam... |
26112743475 | import logging
import os.path
import collections
from silx.gui import qt
from silx.gui.data import DataViews
from silx.gui.data.DataViews import _normalizeData
from silx.gui.utils import blockSignals
from silx.gui.data.NumpyAxesSelector import NumpyAxesSelector
__authors__ = ["V. Valls"]
__license__ = "MIT"
__date__ ... | silx-kit/silx | src/silx/gui/data/DataViewer.py | DataViewer.py | py | 20,103 | python | en | code | 106 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "silx.gui.qt.QFrame",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "silx... |
4918733765 | import random
import re
from datetime import datetime
from flask import url_for
from . import db
from .constants import (
ATTEMPTS,
REGEXP_SYMBOLS,
LENGTH_OF_ORIGINAL_URL,
LENGTH_OF_SHORT_URL,
LENGTH_OF_RANDOM_URL,
RANDOM_SYMBOLS
)
from .error_handlers import ShortValueError
NOT_FIND_SHORT_UR... | asmikhalitsyn/yacut | yacut/models.py | models.py | py | 2,764 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "constants.LENGTH_OF_ORIGINAL_URL",
"line_number": 33,
"usage_type": "argument"
},
{
"api_name": "constants.LENGTH_OF_SHORT_URL",
"line_number": 34,
"usage_type": "argument"
},
{
"api_name": "datetime.datetime.utcnow",
"line_number": 35,
"usage_type": "attri... |
73017060347 | import numpy as np
from sklearn.svm import SVC
import sklearn.ensemble
import sklearn.tree
import matplotlib.pyplot as plt
import parser
import matplotlib.patches as mpatches
TRAIN_PERCENTAGE = 90.0
ITERATIONS = 50
def svm(samples, labels):
"""
Create svm classifier and train it on the samples
:param sam... | hadareal/hackathon_iml | classifier.py | classifier.py | py | 2,940 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sklearn.svm.SVC",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.random.permutation",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "numpy.rave... |
6910259059 | import numpy as np
import pandas as pd
import copy
import scipy.stats as stats
import sympy as sym
import sympy.plotting.plot as symplot
import matplotlib.pyplot as plt # for symplot
from IPython.display import display # for latex-like display of sym's expressions
# -------------------- copy --------------------
list ... | glabka/python_basics | SomeLibraries.py | SomeLibraries.py | py | 3,751 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "copy.deepcopy",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number":... |
71846780989 | # this is a python startup script that will be run automatically
# when Nuke (https://learn.foundry.com/nuke/13.0/content/learn_nuke.html)
# is launched
import os
import datetime
import nuke
def save_record(app, action):
"""
Save a time-stamped event in the users TimeDonkey activity log.
"""
cur... | bsloan666/timedonkey | startup/menu.py | menu.py | py | 807 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "datetime.datetime.now",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "nuke.root",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.getenv",
... |
40885088183 | # coding:utf-8
import tornado.websocket
from settings.config import config
from custor.handlers.basehandler import BaseRequestHandler, BaseWebsocketHandler
from custor.decorators import login_required_json, login_required, ppeewwee
from custor.utils import get_cleaned_post_data, get_cleaned_json_data, json_result, get... | jmpews/torweb | app/user/user.py | user.py | py | 10,595 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "custor.handlers.basehandler.BaseRequestHandler",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "db.mysql_model.user.User.get",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "db.mysql_model.user.User",
"line_number": 22,
"usage_type": "... |
36961475814 | import pytest
from banone.lemma import Lemma
from tests.utils import load_test_data
class TestLemma:
@pytest.mark.parametrize(
("orth", "lemma_dict"),
[
("", {}),
("Test", None),
("Ananas", {"pos": "NN", "determiner": "eine", "color": "gelb"}),
(
... | noeddl/banone | tests/test_lemma.py | test_lemma.py | py | 3,740 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "banone.lemma.Lemma",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "banone.lemma.Lemma",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pytest.m... |
42361443639 | import openai
import os
from app.models import Article
from app import db, app
from flask import jsonify
def get_openai_secret():
return os.environ.get("OPENAI_KEY")
def get_sentiment(text):
openai.api_key = get_openai_secret()
model_engine = "gpt-3.5-turbo"
messages = []
messages.append(
... | artsaraiva/SentimentWatch | server/app/util/openai_api.py | openai_api.py | py | 1,636 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "os.environ.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "openai.api_key",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "openai.ChatCompletio... |
35881228194 | import logging
from logging import handlers
import time,os
class Logger():
#The MAP of log relationship
level_relations = {
'debug':logging.DEBUG,
'info':logging.INFO,
'warning':logging.WARNING,
'error':logging.ERROR,
'crit':logging.CRITICAL
}
# 1、设置存放日志目录,不存在则创... | EvaHdi/Pylearning | API/LOG.py | LOG.py | py | 2,627 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.DEBUG",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "logging.INFO",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "logging.WARNING",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "logging.ERROR... |
18648332301 | from django.conf import settings
from django.urls import include, path
from django.contrib import admin
from wagtail.admin import urls as wagtailadmin_urls
from wagtail.core import urls as wagtail_urls
from wagtail.documents import urls as wagtaildocs_urls
from search import views as search_views
from home import vie... | AMfalme/Rent-and-Sales-Management | francan/urls.py | urls.py | py | 2,020 | python | en | code | 0 | github-code | 6 | [
{
"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": "... |
70280914428 | import csv
import pathlib
import json
import argparse
def read_csv(path):
all_data = []
with open(path) as f1:
reader = csv.DictReader(f1)
for row in reader:
data = {}
for k, v in row.items():
try:
v = json.loads(v)
e... | esteng/ambiguous_vqa | analysis/why_analysis/dynamic_agentive.py | dynamic_agentive.py | py | 1,539 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "csv.DictReader",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "json.JSONDecodeError",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"l... |
38169398793 | import yara
class YaraManager:
def __init__(self):
self.yaraRules = [
{
"name": "Rule 1",
"description": "Rule 1 description",
"rule": "rule rule1 {strings: $a = \"rule1\" condition: $a}"
},
{
"name": "Rule ... | lukasolsen/EmailAnalyser | server/base/modules/YaraRules.py | YaraRules.py | py | 1,450 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "yara.compile",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "yara.Error",
"line_number": 39,
"usage_type": "attribute"
}
] |
14959204429 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import pytest
from yoti_python_sdk.crypto import Crypto
@pytest.mark.parametrize("invalid_token", ["", None, "some_invalid_token", True, 123])
def test_decrypting_an_invalid_toke__should_not_be_allowed(invalid_token, crypto):
with pytest.raises(Val... | getyoti/yoti-python-sdk | yoti_python_sdk/tests/test_crypto.py | test_crypto.py | py | 1,028 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "pytest.raises",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "yoti_python_sdk.... |
4816901176 | import logging
import logging.handlers
from utility import config
from utility.path_handler import PathHandler
from cmreslogging.handlers import CMRESHandler
class Logger:
logger: logging = None
def __init__(self, name: str, path: str = None, logger=None, backupCount: int = 10):
logging.raiseException... | liron7722/Utility | src/utility/logger_handler.py | logger_handler.py | py | 2,185 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.raiseExceptions",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "utility.config.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "utility.config",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "utilit... |
6283637075 | from discord.ext import commands
from discord import app_commands, Embed, Interaction
import json
import os
os.chdir('cogs/Inventory')
class inventory(commands.Cog):
def __init__(self, bot):
self.bot = bot
@app_commands.command(name='inventory', description='Get your player inventory contents')
... | RobertTaylor94/DiscordBot | cogs/Inventory/inventory.py | inventory.py | py | 3,543 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.chdir",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands.Cog",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "discord.Inte... |
25092294622 | from django.conf import settings
from django.middleware.locale import LocaleMiddleware
from django.utils import translation
class LocaleQuerystringMiddleware(LocaleMiddleware):
@staticmethod
def get_language_from_querystring(request):
language_code = request.GET.get('lang')
language_codes = t... | uktrade/directory-ui-export-readiness | core/middleware.py | middleware.py | py | 1,915 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "django.middleware.locale.LocaleMiddleware",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.utils.translation.trans_real.get_languages",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.utils.translation.trans_real",
"line_number... |
38427307809 | # -*- coding: utf-8 -*-
"""
Created on Wed Nov 2 13:57:29 2022
@author: Jeroen
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import dm4bem
#dimentions [m]
l = 6 #length of garage
breite = 3 #width of garage
hight = 2.5 #hight of garage
Sc = l ... | BlockwocheMSE/Gruppe | Group_1_Test.py | Group_1_Test.py | py | 9,418 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.DataFrame",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",... |
10002637326 |
# Python3 program to find all pairs in
# a list of integers with given sum
from itertools import combinations
def findPairs(lst, K):
res = []
for var in combinations(lst, 2):
if var[0] + var[1] == K:
res.append((var[0], var[1]))
return res
# Driver ... | FarhanTahmid/PYTHON-CODES | OLD-CODES/sums up list variables and matches up with a number.py | sums up list variables and matches up with a number.py | py | 381 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "itertools.combinations",
"line_number": 9,
"usage_type": "call"
}
] |
37117135312 | from setuptools import setup
with open("README.md", "r") as readme_file:
readme = readme_file.read()
requirements = ["requests>=2"]
setup(
name='Clockify_Bot',
version='0.0.1',
packages=['Clockify_Bot'],
url='',
license='MIT',
author='mitesh.ukate',
author_email='miteshukate@gmail.com... | miteshukate/clockify_bot | setup.py | setup.py | py | 391 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "setuptools.setup",
"line_number": 8,
"usage_type": "call"
}
] |
14452663978 | from datetime import datetime
from dateutil.relativedelta import relativedelta
from django.contrib.auth.decorators import login_required, permission_required
from django.shortcuts import render
from django.db.models import Sum
from corptools.models import CorporationWalletJournalEntry
from allianceauth.eveonline.mod... | fthomas-de/eos-tax | eos_tax/views.py | views.py | py | 2,783 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "eos_tax.models.EveSwaggerProviderWithTax",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "eos_tax.app_settings.CURRENT_MONTH",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "eos_tax.app_settings.LAST_MONTH",
"line_number": 27,
"usage_t... |
32901899972 | import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import numpy as np
#------------SAHAM TELKOMSEL-------------------
dfTlkm = pd.read_csv(
'telkomsel.csv',
index_col= False,
parse_dates=['Tanggal']
)
dfTlkm.set_index('Tanggal', inplace = True)
dfTlkm = dfTlkm.sort_index()... | HansPeterMaxwell/Analisa-Saham | analisa_saham.py | analisa_saham.py | py | 1,631 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
... |
70384816507 | import pandas as pd
import requests
def get_stock_tickers():
table = pd.read_html(
'http://en.wikipedia.org/wiki/List_of_S%26P_500_companies')[0]
tickers = table['Symbol'].tolist()
tickers.sort()
my_stocks = ['AAPL', 'TSLA', 'WFC', 'KO', 'BAC']
# print(tickers[:10])
return [ticker for... | jge162/Python-Scripts | Stock_Scrapper.py | Stock_Scrapper.py | py | 1,436 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "pandas.read_html",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 19,
"usage_type": "call"
}
] |
3439567261 | from collections import deque
class Solution(object):
def updateMatrix(self, matrix):
"""
:type matrix: List[List[int]]
:rtype: List[List[int]]
"""
m = len(matrix)
n = len(matrix[0])
res = [[sys.maxsize for j in range(n)] for j in range(m)]
q ... | cuiy0006/Algorithms | leetcode/542. 01 Matrix.py | 542. 01 Matrix.py | py | 933 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.deque",
"line_number": 12,
"usage_type": "call"
}
] |
36441536425 | # -*- coding:utf-8 -*-
"""
Author:Wei Mao
Date :2022-12-06
Email : weimao@whu.edu.cn
"""
from PySide2.QtWidgets import QApplication, QWidget
from PySide2.QtUiTools import QUiLoader
class DeMo:
def __init__(self):
# 从文件中加载UI定义
self.ui = QUiLoader().load('ui/demo5.15.ui')
self.ui.pushButt... | Weiwei-Mao/PySide2 | demo5.15.py | demo5.15.py | py | 1,177 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "PySide2.QtUiTools.QUiLoader",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "PySide2.QtWidgets.QWidget",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "PySide2.QtWidgets.QMessageBox.about",
"line_number": 32,
"usage_type": "call"
},
... |
36295859414 | import datetime
from decimal import Decimal
from sqlalchemy import (
ARRAY,
Column,
ForeignKey,
Integer,
Numeric,
String,
create_engine,
)
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
SQLALCHEMY_DATABASE_URL = "postgresql://postgres:postgr... | tonybenoy/splitunwise | src/model.py | model.py | py | 2,131 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.sessionmaker",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.ext.declarative.declarative_base",
"line_number": 20,
"usage_type": "call... |
32098060679 | import datetime
import locale
import os
from datetime import datetime
from typing import Optional, Dict, List
import discord
import pytz
import requests
from ics import Calendar
from commands.command import Command
class Cours(Command):
urls: Dict[str, str]
def __init__(self):
super().__init__(
... | MPAMF/CrousBot | commands/cours.py | cours.py | py | 3,348 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "commands.command.Command",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "os.getenv",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_... |
31602756362 | # Program Wrapper
import scarletwitch
import argparse
import collect_static
import collect_dynamic
def main():
# Argument parsing
args = get_args()
# ScarletWitch creation
device = scarletwitch.ScarletWitch(args)
if args.collect_static:
device = collect_static.StaticDataCollection(args)... | jeremylibretti/scarletwitch | app.py | app.py | py | 1,305 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "scarletwitch.ScarletWitch",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "collect_static.StaticDataCollection",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "collect_dynamic.DynamicDataCollection",
"line_number": 19,
"usage_type": "c... |
29873637853 | from googleapiclient.discovery import build
import json
import os
with open('config.json') as config_file:
config = json.load(config_file)
YOUTUBE_API_KEY = os.environ.get('YOUTUBE_API_KEY', config.get('YOUTUBE_API_KEY', ''))
def search_youtube(query):
youtube = build('youtube', 'v3', developerKey = YOUTUBE_... | IgnatEduardo/Spotify2MP3 | flaskapp/youtube_util.py | youtube_util.py | py | 645 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "googleapiclient.discovery.build... |
30331387033 | import cv2
def searchFace(FrameCharacter,faces):
for (x, y, w, h) in faces:
if((x > FrameCharacter["X0"]) and (y > FrameCharacter["Y0"])) and ((x + w <FrameCharacter["X1"] ) and (y + h<FrameCharacter["Y1"])):
#print("Center")
return "Center"
if(x < FrameCharacter["X0"]):
... | GanjelaMJ98/pythonDroidAssistant | Recognizer.py | Recognizer.py | py | 1,533 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.rectangle",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "cv2.FONT_HERSHEY_SIMPLEX",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "cv2.putText",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "cv2.LINE_AA",... |
39932239183 | # -*- coding: utf-8 -*-
"""
Math 168 Project Eddie Code Final.ipynb
"""
import pandas as pd
import math
import numpy as np
from scipy.linalg import eigh
import sklearn.preprocessing
import ast
import networkx as nx
from matplotlib import pyplot as plt
"""#General function declaration"""
def spectral_max(M, node_lis... | eddieleejw/math168-marvel-social-network | spectral modularity max/spectral-mod-max.py | spectral-mod-max.py | py | 8,396 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "scipy.linalg.eigh",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "numpy.matmul",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_nu... |
19399646609 | from typing import List
# 线段树
class NumArray:
def __init__(self, nums: List[int]):
if not len(nums):
return
self.nums = nums
self.tree = [-1] * 20
self._buildTree(self.nums, 0, len(nums) - 1, self.tree, 0)
# print(self.tree)
def _buildTree(self, arr, l, r,... | Yigang0622/LeetCode | NumArray.py | NumArray.py | py | 2,479 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 7,
"usage_type": "name"
}
] |
38658516113 | # Sahiti Kota
# 09/13/2021
from collections import deque
import sys
import time
fileName = sys.argv[1]
def BFS(startBoard):
visited = set()
fringe = deque()
fringe.append((startBoard, 0, [startBoard]))
visited.add(startBoard)
while fringe:
parent, parentSteps, parentPath = fringe.popleft(... | sahitikota/TJHSST-Artifical-Intelligence | Sliding Puzzles 1/SlidingPuzzles1_SahitiKota.py | SlidingPuzzles1_SahitiKota.py | py | 3,607 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "time.perf_counter",
"line_number": 85,
"usage_type": "call"
},
{
"api_name": "time.perf_counter",
... |
71916473468 | import pandas as pd
from threads.basicthread import BasicThread
from utils.logger import Logger
class OpenThread(BasicThread):
def __init__(self, file = None, name = "open_thread"):
super().__init__(name)
self.file = file
self.logger = Logger().get_logger()
def set_file(self, file):
... | xfz329/pk4adi_calculator | threads/openthread.py | openthread.py | py | 1,041 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "threads.basicthread.BasicThread",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "utils.logger.Logger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pa... |
74416487229 | import pymongo
from pymongo import TEXT
import csv
myclient = pymongo.MongoClient("mongodb://localhost:27017/")
# mongod --port 27017 --dbpath mongoDBlog &
# can change port number if you want, just be sure to do it both in here and the terminal!
# has a foreign key to the actual imagesdb that contains image files
s... | JeanneColeongco/ImageRepositorySearch | search.py | search.py | py | 6,234 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pymongo.TEXT",
"line_number": 44,
"usage_type": "name"
}
] |
16309579121 | import shapely
import shapely.plotting as sh_plot
from shapely.geometry import MultiLineString, MultiPoint, Polygon, Point
from shapely.ops import unary_union, polygonize
import matplotlib.pyplot as plt
import math
import numpy as np
import matplotlib as mpl
mpl.use("qt5agg")
def generate_hexagonal_grid(side_length,... | theroggy/pysnippets | pysnippets/stackoverflow_questions/circles.py | circles.py | py | 4,115 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.use",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 17,... |
21689293982 | import asyncio
from typing import Awaitable, Dict
import pytest
from pandas import DataFrame
from openwpm.mp_logger import MPLogger
from openwpm.storage.arrow_storage import CACHE_SIZE
from openwpm.storage.in_memory_storage import MemoryArrowProvider
from openwpm.storage.storage_providers import TableName
from openwp... | openwpm/OpenWPM | test/storage/test_arrow_cache.py | test_arrow_cache.py | py | 1,507 | python | en | code | 1,286 | github-code | 6 | [
{
"api_name": "openwpm.mp_logger.MPLogger",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "test.storage.test_values.dt_test_values",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "openwpm.storage.in_memory_storage.MemoryArrowProvider",
"line_number": 17,... |
5377276591 | from sys import argv
import numpy as np
import pandas as pd
from scipy.stats import logistic
from sklearn.linear_model import LogisticRegression
from amonhen import NetworkTMLE
from amonhen.utils import probability_to_odds, odds_to_probability
from beowulf import load_uniform_statin, load_random_statin, truth_values, ... | pzivich/publications-code | networkTMLE/sims/generalized_statin.py | generalized_statin.py | py | 9,533 | python | en | code | 10 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "beowulf.simulation_setup",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.random",
... |
9842205733 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision.datasets import MNIST
from torchvision.transforms import ToTensor
import numpy as np
import matplotlib.pyplot as plt
from DataHandler import DataHandler
import time
class CNN(nn.Module):
def __init__(se... | Smayan-n/Neural-Network-Pytorch | CNN.py | CNN.py | py | 4,162 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
39230471935 | from django.urls import path
from apps.views import *
urlpatterns = [
path('', login,name='login'),
path('index/',index,name='index'),
path('attendance-dashboard/<str:date>/', attendance_dashboard, name='attendance_dashboard'),
path('batch-attendance/<str:batch>/<str:date>/', batch_attendance, name='ba... | AshikThowfeeq/LTSM | apps/urls.py | urls.py | py | 433 | python | en | code | 0 | github-code | 6 | [
{
"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",
... |
36229669380 | from typing import List
'''
2469. 温度转换
https://leetcode.cn/problems/convert-the-temperature/
...离谱
《CV题解就能过》
'''
class Solution:
def convertTemperature(self, 摄氏度: float) -> List[float]:
开氏度 = 摄氏度 + 273.15
华氏度 = 摄氏度 * 1.80 + 32.00
return [开氏度, 华氏度]
解 = Solution()
print(解.convertTemperat... | z-w-wang/Leetcode-Problemlist | DailyProblem/Simulation/2469.2023-03-21.py | 2469.2023-03-21.py | py | 403 | python | zh | code | 3 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 10,
"usage_type": "name"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.