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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
13513023950 | import logging; logging.basicConfig(level=logging.INFO)
import sys
import asyncio, os, json, time
from datetime import datetime
from webapp.www.handlers import cookie2user, COOKIE_NAME
from aiohttp import web #aiohttp.web 会自动创建 Request 实例
#Environment是Jinja2中的一个核心类,它的实例用来保存配置、全局对象,以及从本地文件系统或其它位置加载模板。
#FileSystemLoader... | liangfei2016x/webapp | webapp/www/app.py | app.py | py | 9,185 | python | zh | code | 0 | github-code | 97 | [
{
"api_name": "logging.basicConfig",
"line_number": 1,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 1,
"usage_type": "attribute"
},
{
"api_name": "logging.info",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"... |
575775619 | import gparse
import os
import seaborn as sns
import numpy as np
from matplotlib import pyplot as plt
from glob import glob
sns.set_context('talk')
sns.set_style('white')
temp_dirs = sorted([dir for dir in os.listdir() if dir.endswith('K')])
temps = [int(t[:-1]) for t in temp_dirs]
top_dir = os.getcwd()
avgs = []
st... | SeanMcGrath/McGrath396Data | gaussian/cellobiose/scripts/avg_dist_plot.py | avg_dist_plot.py | py | 954 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "seaborn.set_context",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "seaborn.set_style",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_... |
71681887998 | # -*- coding: utf-8 -*-
"""
Created on Thu Jan 13 21:09:50 2022
@author: dschaffner
"""
import scipy.io as spio
import matplotlib.pylab as plt
import numpy as np
import os
directory='C:\\Users\\dschaffner\\Dropbox\\Data\\BMPL\\BMX\\2022\\03172022\\'
#shots that should be skipped
#43, 71, 72, 73, 76, 80, 82, 87
#89, 9... | dschaffner/BMPL | InDevelopment/shot_scanner.py | shot_scanner.py | py | 2,596 | python | en | code | 5 | github-code | 97 | [
{
"api_name": "matplotlib.pylab.rc",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "matplotlib.pylab",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "matplotlib.pylab.rc",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "matplotlib.p... |
40415595551 | #!/usr/bin/env python
# ! -*- coding:utf-8 -*-
import sys
import oss2
import random
import os
import tablib
import time
import json
from urllib.parse import quote
from aliyunsdkcore.client import AcsClient
from aliyunsdkmts.request.v20140618 import SubmitJobsRequest
#阿里云的账户、密码和bucket
access_key_id =''
... | franktans/AliyunUpload | 阿里云python脚本上传并转码视频.py | 阿里云python脚本上传并转码视频.py | py | 4,260 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "tablib.Dataset",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sys.stdout.flush",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "oss2.Auth",
"line... |
29275229591 | """Disable work start date action handler"""
from datetime import timedelta
from api.actions.base import ActionFactory
from api.models import db
from api.models.event import Event
from .common import find_configuration, find_event_date
class SetEventDate(ActionFactory): # pylint: disable=too-few-public... | bcgov/EPIC.track | epictrack-api/src/api/actions/set_event_date.py | set_event_date.py | py | 1,275 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "api.actions.base.ActionFactory",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "api.models.event.Event",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "common.find_configuration",
"line_number": 20,
"usage_type": "call"
},
{
"a... |
24750568851 | #Для отображение цены в той же единице, что и указано
from decimal import Decimal
from django.conf import settings
from topikstore.models import Products
class Cart(object):
def __init__(self, request):
'''Инициализация корзины'''
self.session = request.session
cart = self.session.ge... | khrushchovaolga/django-web-store | netstore/cart/cart.py | cart.py | py | 2,751 | python | ru | code | 0 | github-code | 97 | [
{
"api_name": "django.conf.settings.CART_SESSION_ID",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "django.conf.settings.CART_SESSION_ID",
"line_number": 16,
"usage_type": "a... |
74986917117 | from django import forms
from django.db import connection
search_path = "SET search_path to THECIMS"
def dictfetchall(cursor):
"Return all rows from a cursor as a dict"
columns = [col[0] for col in cursor.description]
return [
dict(zip(columns, row))
for row in cursor.fetchall()
]
def... | kartikadipra/c03-basdat | koleksi/forms.py | forms.py | py | 1,059 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.db.connection.cursor",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.db.connection",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "django.forms.Form",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name"... |
18494277188 | from time import sleep
import threading
from proxy.entity.entitybasics import Entities as Entitytypes
from proxy.entity.entitybasics import Objects as Objecttypes
# noinspection PyPep8Naming
class EntityControl(object):
"""
.. code:: python
def __init__(self, mcserver)
..
This class is acce... | benbaptist/minecraft-wrapper | wrapper/proxy/entity/entitycontrol.py | entitycontrol.py | py | 10,930 | python | en | code | 73 | github-code | 97 | [
{
"api_name": "proxy.entity.entitybasics",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "proxy.entity.entitybasics.Entities",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "proxy.entity.entitybasics.Objects",
"line_number": 48,
"usage_type": "call"
... |
33370698137 | import metrics
import numpy as np
from os import listdir
from tensorflow import keras
from numpy import ndarray, zeros, ones, where
from typing import Tuple, List
from PIL import Image
from utils import save_ndarray_as_image, upscale_image_pixels
def remove_alpha_channel(image:ndarray) -> ndarray:
return image[:, ... | Drayton80/DL-HistoricalMapSegmentation | test.py | test.py | py | 7,063 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.ndarray",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "numpy.ndarray",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "numpy.uint16",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.uint16",
"line_num... |
3632836913 | #from numba import jit, cuda
import numpy as np
import os
import matplotlib.pyplot as plt
import sfs
import scipy
import tqdm
import argparse
from data_lib import params_linear_2D
from data_lib import soundfield_generation as sg
#import scikit-image as skimage
#from scikit-image.metrics import structural_sim... | RobertoAlessandri/MZ_DLPM | generate_TEST__data_linear_array.py | generate_TEST__data_linear_array.py | py | 10,881 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "data_lib.params_linear_2D.idx_lr_gd_y",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "data_lib.params_linear_2D",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 27,
"usage_type": "call"
... |
71733541438 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from statsmodels.formula.api import ols
churn = pd.read_csv('data/26/churn.csv')
fish = pd.read_csv('data/26/fish.csv')
ad_conversion = pd.read_csv('data/26/ad_conversion.csv')
sp500_yearly_returns = pd.read_csv('data/26/sp500... | Aranaur/DataCamp-Data-Scientist-with-Python | 26 - Introduction to Regression with statsmodels in Python.py | 26 - Introduction to Regression with statsmodels in Python.py | py | 24,041 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "pandas.read_csv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"l... |
14883608499 | from flask_restful import Resource
from candidatos.modelos.modelos import db, CandidatoSchema, Candidato
from flask import request
from flask_jwt_extended import jwt_required, create_access_token
from datetime import datetime
from celery import Celery
celery_app = Celery(__name__, broker='redis://127.0.0.1:6379/0')
ca... | andreslc9/ABC-Jobs_MISW4202-JWT-202314-Grupo10 | candidatos/vistas/commands/vistas.py | vistas.py | py | 1,075 | python | es | code | 0 | github-code | 97 | [
{
"api_name": "celery.Celery",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "candidatos.modelos.modelos.CandidatoSchema",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask_restful.Resource",
"line_number": 11,
"usage_type": "name"
},
{
"api... |
13600661419 | import sys
import openpyxl
import os
from openpyxl import Workbook
from datetime import date
import pandas as pd
def main():
sales_csv = get_sales_csv()
orders_directory = create_orders_directory(sales_csv)
process_sales_data(sales_csv, orders_directory)
# Get path of sales data CSV file from ... | memoha/COMP593-LAB3 | ScriptingLab3meghamohan.py | ScriptingLab3meghamohan.py | py | 3,743 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sys.argv",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_numbe... |
35299543730 | from tkinter import *
import threading
from tkinter import messagebox
import psutil
from PIL import ImageTk,Image
from scapy.all import Ether, ARP, srp, sniff, conf
from tkinter.ttk import *
# Create the root window
# with specified size and title
root = Tk()
root.configure(background="#0e0d30")
root.title("Minimal... | kuladeepmantri/InternProjects | Detection of ARP spoofing and Promiscuous Mode/Project/project.py | project.py | py | 7,333 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "PIL.ImageTk.PhotoImage",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "PIL.ImageTk",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "threading.Event",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "psutil.net_if_addr... |
38820309873 | import m4m_sync
from sqlalchemy.exc import InternalError, IntegrityError
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.orm import joinedload
from sqlalchemy import func
from server.database.models import (
Object,
Controller,
Sensor,
User,
UserInfo,
UserSocialTokens,
)
from server.errors import ... | M4MController/cloud-web | server/database/managers.py | managers.py | py | 9,582 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "sqlalchemy.exc.IntegrityError",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "server.errors.ObjectExistsError",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.exc.InternalError",
"line_number": 41,
"usage_type": "name"
},... |
1502537142 | """
Data-loading classes.
"""
import h5py
import torch
import torch.utils.data as data
import threading as thread
import queue
import numpy as np
from random import randint, shuffle
# ===== ===== Queue-based Multiprocessing HDF5 Loader class ===== =====
from utils.worker_fns import ecoli_worker_fn, bucket_worker_fn
cl... | paultsw/wavenet-speech | utils/loaders.py | loaders.py | py | 10,287 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "h5py.File",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "queue.Queue",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "queue.Queue",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "threading.Lock",
"line_number":... |
16606540048 | from utils.utils import *
from pipeline.training.train_alexnet_mnist_debug import *
import pipeline.training.train_smallnet_mnist as mn
def train_alexnet_mnist_0001(config_data, tab_level=0, verbose=0):
print('train_alexnet_mnist_0001().')
from pipeline.data.load_data import load_mnist_0001
from utils.loss import c... | ericotjo001/explainable_ai | fcalc/pipeline/training/train_alexnet_mnist.py | train_alexnet_mnist.py | py | 3,584 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "pipeline.data.load_data.load_mnist_0001",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pipeline.training.train_smallnet_mnist.setup_training_tools_0001",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pipeline.training.train_smallnet_mnist",... |
8817747272 | from flask import render_template, flash, Blueprint, redirect,url_for
from app.models.hotel import Hotel
from flask_login import current_user
from app.manage_property.forms import ManageForm
manage_blueprint = Blueprint("manage_property",
__name__,
template_fol... | Kastagnus/Hotel_project | app/manage_property/views.py | views.py | py | 1,612 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Blueprint",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "app.manage_property.forms.ManageForm",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "app.models.hotel.Hotel.query.filter_by",
"line_number": 16,
"usage_type": "call"
},... |
9758354231 | from duty.objects import dp, SignalEvent, __version__
from duty.utils import ment_user, format_response
import time
@dp.signal_event_register('инфо', 'инфа', 'info')
def sinfo(event: SignalEvent) -> str:
if event.msg['from_id'] not in event.db.trusted_users:
message_id = event.send(event.responses['not_in_... | Gelarik/USHTO | duty/callback_signals/signals/info.py | info.py | py | 776 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "duty.objects.SignalEvent",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "duty.utils.format_response",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "duty.obj... |
70798595198 | """added phone number
Revision ID: 6114f633fefd
Revises: 03c901835d1c
Create Date: 2022-07-11 15:26:00.045673
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '6114f633fefd'
down_revision = '03c901835d1c'
branch_labels = None
depends_on = None
def upgrade() ->... | Kerwat/fastapi-project | alembic/versions/6114f633fefd_added_phone_number.py | 6114f633fefd_added_phone_number.py | py | 994 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "alembic.op.add_column",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.String"... |
35669846488 | import torch
import numpy as np
from PIL import Image
import os, random, math
import sys
sys.path.append(os.path.abspath(os.path.join(__file__, "..", "..")))
from black_box_tool import get_84_transform
sys.path.append(os.path.abspath(os.path.join(__file__, "..", "..")))
def save_image_batch(imgs, output, col=No... | Egg-Hu/BiDf-MKD | synthesis/_utils.py | _utils.py | py | 5,823 | python | en | code | 9 | github-code | 97 | [
{
"api_name": "sys.path.append",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
74939639360 | import os
import requests
from dotenv import load_dotenv
from flask import Blueprint, request, jsonify
api = Blueprint('api', __name__, url_prefix='/api')
# .env ファイルから API キーを取得
load_dotenv()
X_API_KEY = os.getenv('API_KEY')
base_url = 'https://publicapi.taittsuu.com/publicapi/v0.1'
headers = {'content-type': 'app... | nerianighthawk/taittsuu-server-composer | taittsuu_server/api.py | api.py | py | 3,949 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Blueprint",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "dotenv.load_dotenv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.request.args",
... |
44961109176 | import click
import pandas as pd
from tqdm import tqdm
from ..apply import predict_separator
from ..io import (
append_column_to_hdf5,
append_predictions_cta,
read_telescope_data_chunked,
drop_prediction_column,
drop_prediction_groups,
load_model,
)
from ..configuration import AICTConfig
from .... | fact-project/aict-tools | aict_tools/scripts/apply_separation_model.py | apply_separation_model.py | py | 3,668 | python | en | code | 6 | github-code | 97 | [
{
"api_name": "logging.setup_logging",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "configuration.AICTConfig.from_yaml",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "configuration.AICTConfig",
"line_number": 47,
"usage_type": "name"
},
{
... |
37924502263 | import unittest
from em.bot import get_bot
from em.mmapi import send_message
class TestMattermostAPI(unittest.TestCase):
bot = get_bot()
def test_send_message(self):
user_id = 'jxs5xm3b37djjfqohbtp4urpho'
message = "I've matched token123@nix.co.il with your account.\n" \
"N... | phntom/email-manager | tests/mmapi.py | mmapi.py | py | 1,073 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "unittest.TestCase",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "em.bot.get_bot",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "em.mmapi.send_message",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "unittest.ma... |
25089293690 | import pdb
import torch
from torch import nn
import numpy as np
import math
import sys
from common.nn import SharedMLP, SharedMLPDO,MLP
from common.nn import LinearBNReLU
from safnet.models.pn2 import pn2ssg
from safnet.ops.group_points import group_points
from safnet.ops.ball_query import ball_query
from common.nn.f... | lqzhao/SAFNet | safnet/models/safnet_3d_late_fusion_attention_linear_mapping.py | safnet_3d_late_fusion_attention_linear_mapping.py | py | 17,774 | python | en | code | 21 | github-code | 97 | [
{
"api_name": "torch.nn.Module",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "common.nn.SharedMLP",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "torch.sum",
"li... |
32125319516 | import os
import cv2
import random
import argparse
import numpy as np
import pandas as pd
import tensorflow as tf
from keras.models import load_model
IMAGESIZE = 80
DATADIR = './datasets/test'
MODELDIR = './models'
# Path to 'Train' folder containing folders of pics for each letter (A, B, C, D, etc.)
CATEGORIES = [
... | jbentleyh/ASL-Machine-Learning-Toolkit | test.py | test.py | py | 2,808 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "os.path.isdir",
... |
38731467294 | # https://atcoder.jp/contests/abc302/tasks/abc302_c
from itertools import permutations
from typing import List, Set, Tuple
N, M = [int(x) for x in input().split()]
S = [input() for _ in range(N)]
def solve(N: int, M: int, S: List[str]):
ns: Set[Tuple[int, int]] = set()
for i in range(N):
for j in ra... | hirosuzuki/atcoder2023 | abc302/abc302_c.py | abc302_c.py | py | 665 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "typing.List",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.Set",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "itertools.permutations",
"lin... |
40095638959 | from tools import tracktools
from argparse import ArgumentParser
def get_args():
parser = ArgumentParser()
parser.add_argument('--tracks', type=str, required=True, help='Path to tracks.json')
parser.add_argument('--mode', type=str, required=True, choices=['entrance', 'cash-desk'],
... | j4y33/Smart_Counting_Retail | scripts/tracks_to_traffic.py | tracks_to_traffic.py | py | 830 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "tools.tracktools.TracksFilter",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "tools.tracktools",
"line_number": 18,
"usage_type": "name"
}
] |
71058986878 | # Auther: Alan
"""
"""
import tensorflow as tf
import random
import os
import scipy.io as sio
# import matplotlib.pyplot as plt # plt
import matplotlib.image as mpimg # mpimg
import numpy as np
# import Image
import math
from PIL import Image
class Car:
def __init__(self):
print("init")
def weight_va... | Junshuai-Song/DeepLearning | 5Project/car_search/Car.py | Car.py | py | 35,421 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "tensorflow.truncated_normal",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tensorflow.Variable",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "tensorflow.constant",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "t... |
37003099291 | from selenium import webdriver
import time
browser = webdriver.Chrome()
browser.get('http://www.baidu.com/')
browser.find_element_by_id('kw').send_keys('骑士')
browser.find_element_by_id('su').click()
time.sleep(5)
# 后退
browser.back()
browser.save_screenshot('./download/baidu_back.png')
time.s... | Wuhuaxing2017/spider_notes | day07/code/4-selenium-backforward.py | 4-selenium-backforward.py | py | 472 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "time.sleep",
... |
17753187597 | from . import views
from django.urls import path
from django.views.generic.base import TemplateView
app_name = 'registration'
urlpatterns = [
path('register/', views.RegisterView.as_view(), name='register'),
path(
'created/',
TemplateView.as_view(template_name='registration/user_created.html')... | Offener-Kanal-Merseburg-Querfurt/ok_tools | registration/urls.py | urls.py | py | 855 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.views.generic.base.TemplateView.as_view",
"line_number": 11,
"usage_type": "call"
},
{
"ap... |
32053588061 | import Set2Library as S2
import codecs
from Crypto.Cipher import AES
file = open("Challenge10Txt.txt","r")
Lines = file.readlines()
string = b""
for line in Lines:
line = bytes(line[0:-1],encoding="utf-8")
string = string + line
string = codecs.decode(string,'base64')
#this tests if decryption... | mrhamm/CryptographyChallenges | Set2/Challenge10.py | Challenge10.py | py | 878 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "codecs.decode",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "Set2Library.AES_CBC_Decrypt",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "Set2Library.AES_CBC_Encrypt",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": ... |
5429143510 | import sys
from PyQt5.QtWidgets import QApplication,QWidget,QLabel,QPushButton,QLineEdit,QRadioButton,QCheckBox,QCommandLinkButton,QAction,QMenu,QToolButton,QToolTip
from PyQt5.QtGui import *
from PyQt5.QtCore import Qt,QObject,QPoint,pyqtSignal
from resource.caculator_ui import Ui_Form
class Caculator(QObject):
... | ChineseHuang/Tea_identify_sys | venv/Include/TEA/caculator_pane.py | caculator_pane.py | py | 4,144 | python | zh | code | 0 | github-code | 97 | [
{
"api_name": "PyQt5.QtCore.QObject",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCore.pyqtSignal",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 85,
"usage_type": "name"
},
{
"api_name": "r... |
5994640734 | import pymysql as MySQLdb
from datetime import datetime
import time
con178_6 = ''
cursor178_6 = ''
def fechaConexaoCRUD():
global con178_6
global cursor178_6
try:
cursor178_6.close()
con178_6.close()
#print('\nConexao Mysql 178.38.178.6 fechada com sucesso!!!\n')
except:... | thiagorocha2021/controle_patrimonio_A3 | app/model/conectorSql.py | conectorSql.py | py | 1,565 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pymysql.connect",
"line_number": 30,
"usage_type": "call"
}
] |
73841199040 | from snake import Game
import numpy as np
import sys
import os
import time
import pygame
FIELD_STATES = 2
FILE = "last_qtable_0"
def get_discrete_vals(q_table, observation):
"""
Parameters
----------
q_table
observation
Returns
-------
list: q-values
"""
index = discrete_sta... | GrzegorzKrug/Snake_Q-learning | src/q-learning/record_game.py | record_game.py | py | 2,072 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.sign",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "numpy.sign",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "snake.Game",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "snake.Game",
"line_number": 64,
... |
9758367681 | import json
import requests
import traceback
from flask import request, jsonify
from typing import Union
from duty import app
from duty.objects import Chat, db
from duty.utils import Message
from microvk import VkApi, VkApiResponseException
from logger import get_writer
logger = get_writer('Модуль удаленного управл... | Gelarik/USHTO | duty/icad_listener.py | icad_listener.py | py | 3,349 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "logger.get_writer",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "duty.objects.db.installed",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "duty.objects.db",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "micr... |
5487317447 | from django.shortcuts import render,HttpResponse,redirect
from school.models import school,news,teacher
from django.views.generic import ListView,DetailView,UpdateView
from django.views.generic.edit import CreateView
from django.urls import reverse
from account.models import user
from django.views.generic.edit import F... | shiraz-ahmed/techi_educators | dashboard/views.py | views.py | py | 8,015 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.contrib.auth.mixins.LoginRequiredMixin",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "django.views.generic.DetailView",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "school.models.school",
"line_number": 18,
"usage_type": "na... |
13336422802 | from django.core.management.base import BaseCommand, CommandError
from django.core import files
from stories2.models import Publication, Story, Category, StoryImage
from stories2.feeds import parsers
class CommandLogger:
"Roughly emulates a Logger API, emitting in the style of Django management commands"
def _... | cproctor/palyapp_server | stories2/management/commands/sync.py | sync.py | py | 4,247 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "stories2.models.Publication.objects.filter",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "stories2.models.Publication.objects",
"line_number": 27,
... |
39814351037 | # %%
import math
import pandas as pd
import numpy as np
import xarray as xr
import xcdat as xc
from sklearn.metrics import mean_squared_error, mean_absolute_error
from scipy.stats import pearsonr
# %%
mrb_mask = xr.open_dataset(r'D:\ET\DataCollect\Runoff\GRDC\mrb_sel_shp\mrb_mask.nc')
mrb_id = pd.read_csv(r... | FQMei/HG-Land-ET | HG-Land/basin-scale_validation.py | basin-scale_validation.py | py | 4,915 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "xarray.open_dataset",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "xcdat.open_mfdataset",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.DataF... |
72621753280 | from __future__ import absolute_import
from __future__ import print_function
from typing import Text, Dict
import logging
import argparse
import pickle
from google.protobuf.json_format import ParseDict
from ml_eda.proto import analysis_entity_pb2
Analysis = analysis_entity_pb2.Analysis
def load_analysis_result(re... | GoogleCloudPlatform/professional-services | tools/ml-auto-eda/ml_eda/result_loader.py | result_loader.py | py | 1,805 | python | en | code | 2,602 | github-code | 97 | [
{
"api_name": "ml_eda.proto.analysis_entity_pb2.Analysis",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "ml_eda.proto.analysis_entity_pb2",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "typing.Text",
"line_number": 16,
"usage_type": "name"
}... |
43078149555 | """
Quiz game
- Reading from a file
- JSON library
"""
import json
import random
print("Welcome to the quiz game!\n")
with open("questions.json") as json_file:
questions = json.load(json_file)
score = 0
while len(questions) != 0:
question = random.choice(list(questions.keys()))
answer = input(f"\n{q... | sixfwa/python-beginner-projects | quiz.py | quiz.py | py | 453 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "json.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 17,
"usage_type": "call"
}
] |
31967828166 | import requests
import sys
import os
url = 'http://localhost:8181'
cnt = 0
err_cnt = 0
err = False
def assertEqual(actual, expected, itemName=None):
global err
if actual != expected:
if not err:
sys.stdout.write('\033[31mNG\033[0m\n')
if itemName is not None:
sys.stderr... | usatie/webserv | tests/python/test_server_response.py | test_server_response.py | py | 12,874 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sys.stdout.write",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "sys.stderr.write",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.stderr",
"l... |
20452971130 | import pytest
@pytest.mark.parametrize(
'raw_signature,expected',
(
('balanceOf(address who)', 'balanceOf(address)'),
('balanceOf( address who )', 'balanceOf(address)'),
('balanceOf( address who )', 'balanceOf(address)'),
('transfer(address who, uint amount)', 'transfer(address... | pipermerriam/ethereum-function-signature-registry | tests/web/registry/test_signature_import_from_raw_text_signature.py | test_signature_import_from_raw_text_signature.py | py | 921 | python | en | code | 201 | github-code | 97 | [
{
"api_name": "pytest.mark.parametrize",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pytest... |
2037365627 | import pytest
from lrctoolbox import SyncedLyrics
artist = "Pritam, Arijit Singh"
title = "Shayad"
album = "Love Aaj Kal"
lyricist = "Irshad Kamil"
uri = "spotify:track:foobarbazqux"
length = "200000"
re_name = "LRCMaker"
version = "1.0.0"
author = "DrB"
synced_lyrics_lines = [
"[00:00.00]Foo bar",
"[00:05.00... | Dr-Blank/lrctoolbox | tests/conftest.py | conftest.py | py | 1,154 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pytest.fixture",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "pytest.fixture",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "lrctoolbox.Syn... |
4449216942 | from BeautifulSoup import BeautifulSoup
from selenium import webdriver
import time
dict_group = {}
data_total_page = 0
urls = {'culture':"https://www.douban.com/group/explore/culture"
,'travel':"https://www.douban.com/group/explore/travel"
,'ent':"https://www.douban.com/group/explore/ent"
,'fashion':"https://www.douba... | m978718484/django | douban/douban.py | douban.py | py | 1,375 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "time.sleep",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Firefox",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "BeautifulSou... |
19044296061 | import tensorflow as tf
from network.silknet import LoadInterface
from network.silknet.FolderDataReader import FolderDataReader
from interface import implements
import configparser as cp
import gzip
import pickle
import os
from tensorflow.contrib.ndlstm.python import lstm2d as lstm2d_lib
import numpy as np
import cv2
i... | shahrukhqasim/TIES | python/table_parse_2d/parser_2d.py | parser_2d.py | py | 10,509 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "tensorflow.contrib",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "interface.implements",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "network.silknet.LoadInterface",
"line_number": 17,
"usage_type": "argument"
},
{
"ap... |
23919501497 | #!/usr/bin/env python3
# coding=utf-8
# © 2019 Mastergatto
# This code is covered under GPLv2+, see COPYING
#####################
###############
## VARIABLES ##
###############
if __name__ == "__main__":
import os, platform
# Set the current directory to that of this file.
os.chdir(os.path.dirname(os.path... | Mastergatto/gom64p | gom64p/main.py | main.py | py | 5,179 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "os.chdir",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_nu... |
73505243518 | import json
import logging
import polars as pl
import boto3
logger = logging.Logger(__name__)
logger.setLevel(logging.INFO)
sh = logging.StreamHandler()
sh.setFormatter(logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s'))
logger.addHandler(sh)
def messages_to_df(messages: list) -> pl.DataFram... | stefvra/openaq-project | src/openaqtools/sqs.py | sqs.py | py | 2,272 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "logging.Logger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "logging.StreamHandler",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.Formatter... |
7429053596 | from urllib.parse import urlencode
from luqum.parser import parser
import luqum
from flask import Flask, request, redirect, render_template, abort
application = Flask(__name__)
@application.route('/search/activity/')
@application.route('/search/activity')
def activity_search():
'''
Returns a redirect to the... | codeforIATI/datastore-redirects | app.py | app.py | py | 8,894 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask.request.args.items",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "flask.request.args",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "flask.req... |
5679009534 | from numpy import ones, power
from .utils import BandedContinuum, Continuum, dry_air_number_density, P0, radiation_term, \
Spectrum, subgrid_bounds, T0
class CarbonDioxideContinuum(BandedContinuum):
def __init__(self):
self.bands = [CarbonDioxideHartmannContinuum(self.path),]
class C... | GRIPS-code/pyLBL | pyLBL/mt_ckd/carbon_dioxide.py | carbon_dioxide.py | py | 1,551 | python | en | code | 6 | github-code | 97 | [
{
"api_name": "utils.BandedContinuum",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "utils.Continuum",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "utils.Spectrum",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "utils.Spectrum",
... |
21150773272 | import pandas as pd
import string
from nltk.corpus import stopwords
def count_punctuation(df):
# Counts the number of punctuations in the text
count = lambda l1, l2: sum([1 for x in l1 if x in l2])
df['count_punct'] = df.motivation.apply(lambda s: count(s, string.punctuation))
df.to_csv(r'..\data\proc... | ShNadi/study_motivation | src/metadata.py | metadata.py | py | 930 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "string.punctuation",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords",
"line_number": 15,
"usage_type": "name"
},
{
"api_name... |
37214700068 | import pytest
from mock import patch
from payit import Transaction, TransactionError, GatewayNetworkError
from payit.gateways import ZarinpalGateway
from tests.mockup.zarinpal_gateway import get_side_effect
config = {
"merchant": "534534534532225234234",
"description": "",
"callback_url": "http://local... | meyt/payit | tests/test_gateway_zarinpal.py | test_gateway_zarinpal.py | py | 2,454 | python | en | code | 14 | github-code | 97 | [
{
"api_name": "mock.patch",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "tests.mockup.zarinpal_gateway.get_side_effect",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "payit.gateways.ZarinpalGateway",
"line_number": 25,
"usage_type": "call"
},
... |
74373358078 | from collections import deque
seats = [x for x in input().split(", ")]
first_sequence = deque([int(num) for num in input().split(", ")])
second_sequence = deque([int(num) for num in input().split(", ")])
seat_matches = []
rotation = 0
while True:
if len(seat_matches) == 3 or rotation == 10:
break
fi... | HristianBalevski/Python-Advanced | 10.Exam Preparation/12.Exam 18 August 2022/01.Stewards.py | 01.Stewards.py | py | 986 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "collections.deque",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 5,
"usage_type": "call"
}
] |
7542490900 | #!/usr/bin/env python3
""" An evaluation script for MNASNet. """
import os
import typing
import collections
import torch
import torchvision.models as models
import numpy
import tqdm
import imagenet
import metrics
import log
IMAGENET_DIR = os.path.expanduser("~/datasets/imagenet")
def eval(model_name: str) -> None... | 1e100/mnasnet_trainer | eval.py | eval.py | py | 1,879 | python | en | code | 7 | github-code | 97 | [
{
"api_name": "os.path.expanduser",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "torchvision.models.mnasnet0_5",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "torchvi... |
34710455245 | import json
import boto3
import os
import requests
import openai
BUCKET_NAME='minutes-prod-contents'
s3 = boto3.resource('s3')
def main(event, context):
print('🔥')
print(event)
fname = "/tmp/leothefootball"
openai.api_key = get_parameter()
event_object = event['Records'][0]['s3']['object']['k... | kenshuhori/minutes_serverless | transcriber.py | transcriber.py | py | 1,302 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "boto3.resource",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "openai.api_key",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "openai.Audio.transcribe",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "openai.Aud... |
42628992189 | # -*- coding: utf-8 -*-
import numpy as np
import pickle as pkl
import matplotlib.pyplot as plt
#data = pkl.load(file("TME6_lettres.pkl","rb"))
with open('TME6_lettres.pkl', 'rb') as f:
data = pkl.load(f, encoding='latin1')
X = np.array(data.get('letters')) # récupération des données sur les lettres
Y = np.array... | samutamm/MAPSI | TME6/tme6B.py | tme6B.py | py | 5,131 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pickle.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 15,
... |
5599468933 | # blender CAM collision.py (c) 2012 Vilem Novak
#
# ***** BEGIN GPL LICENSE BLOCK *****
#
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option)... | vilemduha/blendercam | scripts/addons/cam/collision.py | collision.py | py | 15,801 | python | en | code | 413 | github-code | 97 | [
{
"api_name": "bpy.context",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "bpy.ops.mesh.primitive_cylinder_add",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "bpy.ops",
"line_number": 47,
"usage_type": "attribute"
},
{
"api_name": "bpy... |
3168045260 | from django.shortcuts import render
#getting the Http Responce on template
from django.http import HttpResponse
from .forms import StudnetRegisterForm,UserForm
from django.views import generic
from .models import StudentRegister
from django.urls import reverse_lazy
#filtering Student Objects
from .filters import Se... | chinnikrish36/RegisterForm | students/views.py | views.py | py | 1,737 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.views.generic.TemplateView",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "django.views.generic",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "forms.StudnetRegisterForm",
"line_number": 20,
"usage_type": "name"
},
{
... |
30257935011 | import json
import os
import shlex
import shutil
from subprocess import list2cmdline
import click
from .github import Github
# default paths
objection_path = os.path.join(os.path.expanduser('~'), '.objection')
gadget_versions = os.path.join(objection_path, 'gadget_versions')
def list2posix_cmdline(seq):
"""
... | sensepost/objection | objection/utils/patchers/base.py | base.py | py | 3,641 | python | en | code | 6,568 | github-code | 97 | [
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.expanduser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line... |
20497490626 | from django.conf.urls import url
from django.views.generic import TemplateView
from . import views
print(views)
urlpatterns = [
# ex: /polls/
url(r'^$', views.indexView.as_view(), name = 'index'),
#url(r'^polls/$', views.index, name='index'),
# ex: /polls/5/
url(r'^polls/(?P<question_id>[0-9]+)/$', views.d... | devilhtc/django-do-trial | polls/urls.py | urls.py | py | 558 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.... |
40393373453 | import spidev, time
spi = spidev.SpiDev()
spi.open(0, 0)
def analog_read(channel):
r = spi.xfer2([1, (8 + channel) << 4, 0])
adc_out = ((r[1]&3) << 8) + r[2]
return adc_out
while True:
adc_arus = analog_read(0)
adc_tegangan = analog_read(1)
adc_resistansi = analog_read(2)
#Pengu... | rajaiblis/Multimeter-Raspi | avometer_tampil_terminal.py | avometer_tampil_terminal.py | py | 1,094 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "spidev.SpiDev",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 32,
"usage_type": "call"
}
] |
2573474561 | #!/usr/bin/env python3
from argparse import ArgumentParser
import os
import pandas as pd
import seaborn as sns
def plot_empirical_cdf(df, field):
df = df.copy()
df["cancer"] = df["cancer"].map(lambda x: "Case" if x else "Control")
df = df.rename(columns={"cancer": "group"})
g = sns.FacetGrid(df, hue... | josepablocam/pdac-diag-model | time_and_code_distributions.py | time_and_code_distributions.py | py | 2,199 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "seaborn.FacetGrid",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "seaborn.distplot",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "panda... |
21936955321 | import torch
import torchvision
import torchvision.transforms as transforms
import numpy as np
batch_size = 128
# transforms
transforms = transforms.Compose([
transforms.RandAugment(),
transforms.ToTensor(),
transforms.Normalize((0.5,), (0.5,)),
])
train_dataset = torchvision.datasets.MNIST(root='./data... | Jayh625/MS-AI-School | Python/0811/noise_view_image.py | noise_view_image.py | py | 1,505 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "torchvision.transforms",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.Compose",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms.RandAugment",
"line_number": 10,
"usage_type": "call"
},
{... |
12869581338 | import numpy as np
import matplotlib.pyplot as plt
# Source: https://www.youtube.com/watch?v=35fzyblVdmA&ab_channel=ComputationalScientist
class Coordinate:
def __init__(self, x, y):
self.x = x
self.y = y
@staticmethod
def get_distance(a:int, b:int) -> float:
return np.sqrt(... | Xalt8/ACO | sa.py | sa.py | py | 2,678 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.sqrt",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.abs",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.random.uniform",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_nu... |
11049070036 | from builtins import zip
import matplotlib
matplotlib.use("Agg")
import numpy as np
import unittest
import lsst.sims.maf.metrics as metrics
import lsst.utils.tests
class TestSimpleMetrics(unittest.TestCase):
def setUp(self):
dv = np.arange(0, 10, .5)
dv2 = np.arange(-10, 10.25, .5)
self.d... | lsst-sims/legacy_sims_maf | tests/testSimpleMetrics.py | testSimpleMetrics.py | py | 7,472 | python | en | code | 13 | github-code | 97 | [
{
"api_name": "matplotlib.use",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "unittest.TestCase",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "numpy.arange",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
... |
74899645437 | import datetime
import numbers
import time
class UnboundField(object):
"""
Uninitialized version of all field objects, which records in what order
it was initialized. This is primarily used to ensure each time a new
Model instance is initialized a new field object is created, rather
... | chrismendoza/PyORM | pyorm/field.py | field.py | py | 4,196 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "datetime.datetime.fromtimestamp",
"line_number": 112,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 112,
"usage_type": "attribute"
},
{
"api_name": "numbers.Integral",
"line_number": 122,
"usage_type": "attribute"
},
{
"a... |
24529943162 | #!/user/bin/env python
# encoding: utf-8
"""
@author: zwnong
@project: HogwartsSDE17
@file: base_page.py
@time: 2021/3/9 21:52
"""
import os
from time import sleep
import yaml
from appium.webdriver.common.mobileby import MobileBy
from appium.webdriver.webdriver import WebDriver
from selenium.common.exceptions import N... | zwnong/ui_framework | base/base_page.py | base_page.py | py | 8,966 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "appium.webdriver.webdriver.WebDriver",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.support.wait.WebDriverWait",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "decorator.handle_black_list.handle_black",
"line_number": ... |
40393365383 | from Tkinter import *
import spidev, time
spi = spidev.SpiDev()
spi.open(0, 0)
def analog_read(channel):
r = spi.xfer2([1, (8 + channel) << 4, 0])
adc = ((r[1]&3) << 8) + r[2]
return adc
class App:
def __init__(self, master):
self.master = master
frame = Frame(master)
... | rajaiblis/Multimeter-Raspi | amperemeter_tampil_interface.py | amperemeter_tampil_interface.py | py | 1,124 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "spidev.SpiDev",
"line_number": 3,
"usage_type": "call"
}
] |
7352724931 | import requests
import dateutil.parser
import time
from bs4 import BeautifulSoup
from datetime import datetime
from urllib.request import urlopen, Request
from urllib.parse import urlparse
####################################
######## NEWS SCRAPER UTILS ########
####################################
MONTH_DICT = {'J... | grilhami/Reputation-Economics-IBM-Intern-Project | scraper/utils.py | utils.py | py | 3,349 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.Session",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "requests.adapters.HTTPAdapter",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "requests.adapters",
"line_number": 60,
"usage_type": "attribute"
},
{
"api_name": ... |
27695295750 | import altair as alt
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
from shared import app, data_raw
state_choice = data_raw.state.unique()
state_choice.sort()
company_size_choice = data_raw.no_employees.uniqu... | UBC-MDS/dsci-532_group08 | src/company_support.py | company_support.py | py | 9,063 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "shared.data_raw.state.unique",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "shared.data_raw.state",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "shared.data_raw",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "... |
32847700235 | import os
import json
import pytest
import gzip
import numpy as np
from panqec.error_models import PauliErrorModel
from panqec.codes import Toric2DCode
from panqec.decoders import BeliefPropagationOSDDecoder
from panqec.simulation import (
read_input_json, run_once, DirectSimulation, expand_input_ranges, run_file,
... | panqec/panqec | tests/test_simulation.py | test_simulation.py | py | 6,190 | python | en | code | 51 | github-code | 97 | [
{
"api_name": "os.path.dirname",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line... |
28843444282 | import requests
import logging
import json
from datetime import datetime
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO)
def publish_to_zenodo(zenodo_url, recid, token, files, version = None):
''' Publish files to zenodo repository.
:param zenodo_url: "https://sandbox.zenodo.... | ODonoghueLab/Aquaria-Tagger | tagtrials/zenodo.py | zenodo.py | py | 3,457 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
... |
25240006327 | import pandas as pd
import seaborn as sns
import numpy as np
import streamlit as st
import matplotlib.pyplot as plt
st.title("Analyse de l'évolution des performances mécanique par continent")
df = pd.read_csv('https://raw.githubusercontent.com/murpi/wilddata/master/quests/cars.csv')
# supprimer '.' et espaces de la ... | Augustin-Chab/Odyssey_streamlit | Streamlit.py | Streamlit.py | py | 3,215 | python | fr | code | 0 | github-code | 97 | [
{
"api_name": "streamlit.title",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "streamlit.subheader",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.f... |
1015633606 | from django.contrib import admin
# Register your models here.
from .models import UserProfile
class UserProfileAdmin(admin.ModelAdmin):
list_display = ("user",
"organisation_name",
"timestamp",)
list_filter = ("user",
"organisation_name",
... | codertjay/PropertyManagement | users/admin.py | admin.py | py | 426 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.site.register",
"line_number": 17,
"usage_type": "call"
},... |
7960659517 | from flet import AlertDialog, TextButton, RoundedRectangleBorder, MainAxisAlignment, Text
class ConfirmDialog(AlertDialog):
"""Creates an AlertDialog that, if "yes" clicked, executes the function passed as a parameter.
Args:
function (method): method to be executed
title (string): title of the... | HelioCard/App-With-Flet | ConfirmDialog.py | ConfirmDialog.py | py | 1,123 | python | en | code | 6 | github-code | 97 | [
{
"api_name": "flet.AlertDialog",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "flet.Text",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flet.Text",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "flet.TextButton",
"line_numbe... |
29305478644 | import torch
import numpy as np
import scipy.io as scio
from ..builder import DATASETS
from .utils import TimeSeriesShiftAugmentation
# import external modules
import os
import sys
sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))),
... | CharonWangg/LearningCausalDiscovery | run/tools/src/data/dataset/dream3.py | dream3.py | py | 3,366 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "sys.path.append",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
26328999024 | """Can Driver tests."""
from typing import AsyncGenerator
import pytest
from can import Bus, Message
from opentrons_shared_data.errors.exceptions import CANBusBusError
from opentrons_hardware.drivers.can_bus import CanDriver, ArbitrationId, CanMessage
@pytest.fixture
def bus_channel() -> str:
"""The virtual can... | Opentrons/opentrons | hardware/tests/opentrons_hardware/drivers/can_bus/test_driver.py | test_driver.py | py | 2,856 | python | en | code | 363 | github-code | 97 | [
{
"api_name": "pytest.fixture",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "can.Bus",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "pytest.fixture",
"li... |
255641359 | import datetime
import sys
import discord
from discord.ext import commands
from sqlalchemy.exc import DBAPIError
from sqlalchemy.sql import func
from sweeperbot.cogs.utils import time
from sweeperbot.cogs.utils.timer import Timer
from sweeperbot.db import models
from sweeperbot.utilities.helpers import set_sentry_sco... | glanyx/segachan | sweeperbot/cogs/misc/reminder.py | reminder.py | py | 10,950 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "discord.errors",
"line_number": 57,
"usage_type": "attribute"
},
{
"api_name":... |
24808656706 | import pygame
from pygame.sprite import Sprite
from pygame.math import Vector2
class Boss(Sprite):
"""Класс, представляющий одного боса."""
def __init__(self, ai_game):
#"""Инициализирует боса и задает его начальную позицию."""
super().__init__()
self.screen = ai_game.screen
se... | ilwich/Alien-Inovision-from-Ilwich | boss.py | boss.py | py | 5,853 | python | ru | code | 0 | github-code | 97 | [
{
"api_name": "pygame.sprite.Sprite",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "pygame.mixer.Sound",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pygame.mixer",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "pygame.image... |
13487095082 | import requests
from bs4 import BeautifulSoup
class Parse_weather():
def get_data(self):
result = requests.get('https://yandex.ru/pogoda/saint-petersburg')
self.soup = BeautifulSoup(result.text, 'html.parser')
div = self.soup.findAll('div')
soup = self.soup
div = soup.find( ... | Monoramen/ya_weather_parser | parser_ya_w.py | parser_ya_w.py | py | 1,653 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 7,
"usage_type": "call"
}
] |
31788136166 | import requests
import bs4
KEYWORDS = ['дизайн', 'фото', 'web', 'python', 'программирование']
HEADERS = {'Accept': 'text/html,application/xhtml+xml,'
'application/xml;q=0.9,image/avif,'
'image/webp,image/apng,'
'*/*;q=0.8,application/signed-exchange;'
... | juliauzbemb/WebParser | main.py | main.py | py | 3,392 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 54,
"usage_type": "call"
}
] |
70651883200 | import requests
from html import unescape
from question_model import Question
# Option 1
# question_data = requests.get("https://opentdb.com/api.php?amount=10&type=boolean")
def extract_questions():
parameter = {
"amount": 10,
"type": "boolean"
}
question_data = requests.get("https://ope... | PapaYaw-Boampong/Quiz_Trivia_Game | data.py | data.py | py | 841 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "question_model.Question",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "html.unescape",
"line_number": 28,
"usage_type": "call"
}
] |
29136003301 | # Импортируем необходимые компоненты
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
from settings import TG_TOKEN
from handlers import *
import logging
logging.basicConfig(format='%(asctime)s - %(levelname)s - %(message)s',
level=logging.INFO,
filename... | anatol1k/TelegramBot | bot.py | bot.py | py | 1,085 | python | ru | code | 0 | github-code | 97 | [
{
"api_name": "logging.basicConfig",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "telegram.ext.Updater",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "settings.TG_... |
11279293717 | import codecs
import sys
import xml.etree.ElementTree as ET
from bs4 import BeautifulSoup, Tag
weeks = [int(w) for w in sys.argv[1:]]
file = codecs.open("./temp/index.html", "r", "utf-8")
soup = BeautifulSoup(file.read(), 'html.parser')
accordianfile = codecs.open("./templates/accordian.html", "r", "utf-8")
accord... | jemmy-z/cs61a-v3 | assets/scripts/accordian.py | accordian.py | py | 2,359 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sys.argv",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "codecs.open",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "codecs.open",
"line_nu... |
74909750718 | import spacy
import logging
acidity_logger = logging.getLogger(__name__)
try:
# Acidity Model
model_dir = "models_acidity/wines_acidity/model-best"
nlp_acidity = spacy.load(model_dir)
except Exception as e:
acidity_logger.critical('ACIDTY MODEL: {}'.format(str(e)))
else:
acidity_logger.info('SUCCE... | anirudhmunj/wyldvin-api-heroku-demo | acidity.py | acidity.py | py | 1,052 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "spacy.load",
"line_number": 9,
"usage_type": "call"
}
] |
12114896491 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.welcome, name='welcome'),
url(r'^accounts/register/$', views.register, name='register'),
url(r'^accounts/register/complete/$', views.registration_complete, name='registration_complete'),
url(r'^accounts/login/$', 'd... | kubapok/django-socialnetwork-app | mysite/socialnetwork/urls.py | urls.py | py | 927 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.co... |
22111934394 | """
https://leetcode.com/problems/my-calendar-iii/
this tree only return overlapping count
so only need the update function
"""
from sortedcontainers import SortedDict
class SegmentTreeNode:
def __init__(self, start=0, end=0, count=0, left=None, right=None) -> None:
self.start = start
self.end =... | kangxie-colorado/leetcode-and-notes | previous_run/318.732.myCalIII.py | 318.732.myCalIII.py | py | 11,910 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sortedcontainers.SortedDict",
"line_number": 283,
"usage_type": "call"
}
] |
1208312970 | #-*-encoding:utf-8-*-
"""
Django settings for StudentEvaluation project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this... | baoan008/StudentEvaluation | StudentEvaluation/settings.py | settings.py | py | 9,011 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sys.setdefaultencoding",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
... |
20847516034 | import json, os
from datetime import date, datetime
from itertools import chain
from django.core.urlresolvers import reverse
from recordlib import RecordParser
from dateutil.parser import parse
APP_BASE_DIR = os.path.dirname(__file__)
COLLECT_LOG_FILE = os.path.join(APP_BASE_DIR, 'logs/collect.log')
MAX_COLLECT_LENGT... | zwolf21/StockAdmin | orderutils/utils.py | utils.py | py | 4,575 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.path.dirname",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": ... |
5308346446 | import sqlalchemy
import pandas as pd
from app.etl.DataSources.IDataSource import IDataSource
from app.etl.DataSources.Database.EDatabase import DatabaseType
class Database(IDataSource):
def __init__(self, type,connection_string) -> None:
# super().__init__(type)
if(type==DatabaseType.MSSQL):
... | rhazem13/ETLV2 | app/etl/DataSources/Database/Database.py | Database.py | py | 1,124 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "app.etl.DataSources.IDataSource.IDataSource",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "app.etl.DataSources.Database.EDatabase.DatabaseType.MSSQL",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "app.etl.DataSources.Database.EDatabase.... |
72857724160 | from rest_framework.response import Response
from rest_framework.views import APIView
from .serializer import *
from django.db.models import Q
import datetime
import re
from collections import Counter
# 定义全局变量
user_list = None
con_list = None
# 使用APIView
class UserView(APIView):
def get(self, request, format=No... | zsl18344191079/opinion_monitor | monitor/views.py | views.py | py | 5,478 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "rest_framework.views.APIView",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_nam... |
14830838849 | #!/usr/bin/python
from ansible_runner import Runner, RunnerConfig
import yaml
import os
import sys
import time
pwd = os.getcwd()
skip_tags = ','.join(sys.argv[1:])
# load Ansible "extra-vars"
with open('kafka2crdb.vars.yaml', 'r') as f:
ev = yaml.safe_load(f)
ev['deployment_id'] = 'k2crdb'
# First, provision... | fabiog1901/kafka2cockroachdb | play.py | play.py | py | 2,536 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "os.getcwd",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "yaml.safe_load",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "ansible_runner.RunnerConfig",
... |
25163319840 | from fastapi import FastAPI
app = FastAPI()
fake_database = {
1: {"name": "Ramesh", "age": 25},
2: {"name": "Suresh", "age": 30},
3: {"name": "Rohan", "age": 35},
4: {"name": "Rakesh", "age": 40},
5: {"name": "Anajan", "age": 45},
}
@app.get("/")
def getitems():
"""
Function: getItems
... | HeartBlack/fake-json-fast-api | main.py | main.py | py | 2,240 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 3,
"usage_type": "call"
}
] |
13033176413 | from __future__ import print_function
import errno
import os
import platform
import subprocess
import sys
import unittest
import mock
import tox_pyenv
try:
unicode
except NameError:
unicode = str
def touni(s, enc='utf8', err='strict'):
if isinstance(s, bytes):
return s.decode(enc, err)
els... | tox-dev/tox-pyenv | test_tox_pyenv.py | test_tox_pyenv.py | py | 3,808 | python | en | code | 127 | github-code | 97 | [
{
"api_name": "unittest.TestCase",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "errno.ENOENT",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "mock.patch.object",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "mock.patch... |
36948594509 | import numpy as np
import cv2
import urllib
#cap = cv2.VideoCapture('vtest.avi')
cap = cv2.VideoCapture(0)
cap.set(cv2.cv.CV_CAP_PROP_FRAME_WIDTH, 640)
cap.set(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT, 480)
kernel = cv2.getStructuringElement(cv2.MORPH_ELLIPSE,(3,3))
#fgbg = cv2.createBackgroundSubtractorMOG()
fgbg = cv2.Bac... | UncoolAsianDad/pytracking | bg.py | bg.py | py | 1,069 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.cv",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "cv2.cv",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "cv2.getStructuringElement",
... |
7737472942 | from django.urls import path
from . import views
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('', views.notes, name="notes"),
path('create/', views.notes_view_list, name="notes_list"),
path('delete/', views.notes_... | romankc17/bmc_project | backend/notes/urls.py | urls.py | py | 1,344 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
20645927521 | import os
import re
from typing import List, Optional, Tuple, Union
import click
import dnnlib
import numpy as np
import PIL.Image
import torch
from tqdm import tqdm
import legacy
from camera_utils import LookAtPoseSampler, FOV_to_intrinsics
from torch_utils import misc
from training.triplane import TriPlaneGenerato... | SizheAn/PanoHead | calc_mbs.py | calc_mbs.py | py | 7,768 | python | en | code | 1,716 | github-code | 97 | [
{
"api_name": "typing.Union",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "re.compile",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms.functional... |
26370788175 | import numpy as np
import torch
import torch.nn as nn
from PIL import Image
import medmnist
from medmnist import INFO, Evaluator
import medmnist_loader
from medmnist_loader import get_loader
import matplotlib.pyplot as plt
def load_medmnsit_data(data_flag="chestmnist"):
"""
Load the medmnist data for the giv... | erikhelmut/neural-cellular-automata | src/helper.py | helper.py | py | 7,326 | python | en | code | 5 | github-code | 97 | [
{
"api_name": "medmnist.INFO",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "medmnist_loader.get_loader",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 58,
"usage_type": "attribute"
},
{
"api_name... |
3023928430 | # This is a sample Python script.
# Press Shift+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
import itertools
import nltk.corpus
import nltk
from nltk import trigrams
from nltk.text import Text
import random
import o... | NasosTsionas/Sentence_generator | sentenceGenFiles/Sentence_generator.py | Sentence_generator.py | py | 6,385 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "nltk.ngrams",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "nltk.ngrams",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "nltk.word_tokenize",
"line_num... |
40326892839 | from django.urls import path
from Libraryapp import views
urlpatterns = [
path('',views.login_fun,name='log'),
path('logdata',views.logdata_fun),
path('Admin_reg',views.Admin_Reg_page),
path('readdata',views.Regdata_fun),
path('adminhome',views.Adminhome_fun,name='Ahome'),
path('St... | RajasekharReddy1499/Lms | Library_Management_project/Libraryapp/urls.py | urls.py | py | 1,539 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "Libraryapp.views.login_fun",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "Libraryapp.views",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.