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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
35636565941 | import arviz as az
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pymc as pm
import pytensor
import pytensor.tensor as pt
print(f"Running on PyMC v{pm.__version__}")
def my_model(theta, x):
m, c = theta
return m * x + c
def my_loglike(theta, x, data, sigma):
model = my_model... | HOLL95/General_electrochemistry | heuristics/testing_pymc.py | testing_pymc.py | py | 3,438 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "pymc.__version__",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "numpy.sum",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pytensor.tensor.Op",
"l... |
19562145539 | """ This is a modified version of
https://github.com/ifeherva/optimizer-benchmark/blob/master/optimizers/__init__.py """
import argparse
import torch.optim as optim
import math
from .coolmom_pytorch import Coolmomentum
__all__ = ['parse_optimizer', 'supported_optimizers']
optimizer_defaults = {
'coolmom... | borbysh/coolmomentum | optimizers/__init__.py | __init__.py | py | 2,377 | python | en | code | 7 | github-code | 1 | [
{
"api_name": "coolmom_pytorch.Coolmomentum",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "math.ceil",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "argparse.Action",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "argparse.... |
10989384624 | import sys
from towhee.runtime import register, pipe, ops, accelerate, AutoConfig, AutoPipes
from towhee.data_loader import DataLoader
from towhee.serve.triton import triton_client
from towhee.utils.lazy_import import LazyImport
# Legacy towhee._types
from towhee import types
_types = types # pylint: disable=protect... | towhee-io/towhee | towhee/__init__.py | __init__.py | py | 5,238 | python | en | code | 2,843 | github-code | 1 | [
{
"api_name": "towhee.types",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "sys.modules",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "towhee.utils.lazy_import.LazyImport",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tow... |
18057701170 | import tensorflow as tf
from tf_agents.networks import network
from tf_agents.agents.dqn import dqn_agent
from tf_agents.environments import tf_py_environment
from tf_agents.policies import random_tf_policy
from tf_agents.replay_buffers import tf_uniform_replay_buffer
from tf_agents.trajectories import trajectory
from... | emla2805/rl-sudoku | train.py | train.py | py | 5,909 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "utils.load_dataset",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sudoku_env.SudokuEnvironment",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "tf_agents.environments.tf_py_environment.TFPyEnvironment",
"line_number": 18,
"usage_type... |
32023888041 | import pandas as pd
import plotly as py
import numpy as np
from plotly.graph_objs import *
from os import path
trace1 = Choropleth(
z=['1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1'],
showlegend=True,
autocolorscale=False,
colorscale=[[0, 'rgb(255,255,255)'], [1, '#a0db8e']],
hoverinfo='text... | nshahr/Data-Visualization | ngas-ovr-map.py | ngas-ovr-map.py | py | 3,195 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "plotly.offline.plot",
"line_number": 114,
"usage_type": "call"
},
{
"api_name": "plotly.offline",
"line_number": 114,
"usage_type": "attribute"
},
{
"api_name": "os.path.basename",
"line_number": 114,
"usage_type": "call"
},
{
"api_name": "os.path",... |
19659832895 | import math
import logging
from datetime import datetime
from drive_controller import DrivingController
# 제한 속도
SPEED_LIMIT = 100
logging.basicConfig(filename='{}.log'.format(datetime.now().strftime('%Y-%m-%d-%H-%M')), level=logging.DEBUG)
class DrivingClient(DrivingController):
def __init__(self):
# =... | holy-water/self-driving | driving_client.py | driving_client.py | py | 6,808 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.basicConfig",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "logging.D... |
20029740083 | from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
class SignupForm(UserCreationForm):
email = forms.EmailField(label="Email address",
help_text="A valid email address is required.",
error_messages={'invalid':"Please supply a... | crcsmnky/opensciencedata | webapp/users/forms.py | forms.py | py | 908 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "django.contrib.auth.forms.UserCreationForm",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.forms.EmailField",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.forms",
"line_number": 6,
"usage_type": "name"
},
{
"api_... |
29455914344 | # Import the necessary modules.
import tkinter as tk
import tkinter.messagebox
import pyaudio
import wave
import os
import threading
class RecAUD:
def __init__(self,topic_names ,chunk=3024, frmat=pyaudio.paInt16, channels=2, rate=44100):
# Start Tkinter and set Title
self.topic_names = topic_names
... | duchung19399/voice-recording | record.py | record.py | py | 7,351 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pyaudio.paInt16",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "tkinter.Tk",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pyaudio.PyAudio",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "tkinter.Frame",
"... |
11481471531 | #! /usr/bin/python2.7
# -*- coding: utf-8 -*-
import re
try:
import jpype
except ImportError:
pass
from .. import jvm
from .. import utils
__all__ = ['Kkma']
class Kkma():
"""Wrapper for `Kkma <http://kkma.snu.ac.kr>`_.
Kkma is a morphological analyzer and natural language processing system writt... | kanghyojun/konlpy | konlpy/tag/_kkma.py | _kkma.py | py | 2,284 | python | en | code | null | github-code | 1 | [
{
"api_name": "jpype.isJVMStarted",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "jpype.JPackage",
"line_number": 73,
"usage_type": "call"
}
] |
8692823944 | import mysql.connector
import cv2
import pyttsx3
import pickle
import PySimpleGUI as sg
import time
"""
This is the gui program for face recognition.
verify() should be used with a subprocess and the childConn is one end of the pipe.
If unable to recognize face for a period longer than TIMEOUT, the program will termin... | hongming-wong/COMP3278-Group-Project | back-end/faces_gui.py | faces_gui.py | py | 5,134 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "mysql.connector.connector.connect",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "mysql.connector.connector",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "mysql.connector",
"line_number": 18,
"usage_type": "name"
},
{
"... |
15393129745 | from itertools import product
from useful_functions import converged
# import Gurobi but don't crash if it wasn't loaded
import warnings
warnings.formatwarning = lambda msg, *args: "warning: " + str(msg) + "\n"
try:
import gurobipy as G
except ImportError:
warnings.warn("Gurobi is required to solve MDPs by linear p... | btwied/MDP_interdiction | exact_solvers.py | exact_solvers.py | py | 5,531 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "warnings.formatwarning",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "warnings.warn",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "gurobipy.Model",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "itertools.pro... |
72799928675 | import django.forms as forms
from django_utils.form_helpers import DivForm, FormValidator, RecaptchaForm
import django_utils.form_widgets as form_widgets
def build_flag_form(actions, reasons):
"""
Generates a DivForm to be used for submitting content flags.
"""
base_fields = {'action' : forms.Choice... | genghisu/eruditio | eruditio/shared_apps/django_moderation/forms.py | forms.py | py | 958 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.forms.ChoiceField",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.forms",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.forms.ChoiceField",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django... |
30277225234 | #!/usr/bin/env python
from __future__ import absolute_import
import cProfile
import logging
import sys
import time
import rosgraph
import roslaunch
import rospy
from pyros import PyrosROS
roscore_process = None
# BROKEN ?? start roscore beofre running this...
# if not rosgraph.masterapi.is_online():
# # Trying... | pyros-dev/pyros | tests/test_pyros/profile_pyros_ros.py | profile_pyros_ros.py | py | 3,954 | python | en | code | 24 | github-code | 1 | [
{
"api_name": "rosgraph.masterapi.is_online",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "rosgraph.masterapi",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "roslaunch.scriptapi.ROSLaunch",
"line_number": 34,
"usage_type": "call"
},
{
... |
11645362565 | # -*- coding: utf-8 -*-
import scrapy
import sqlite3
from ..items import IndexarticlesItem
class IndexarticleSpider(scrapy.Spider):
name = 'indexarticle'
allowed_domains = ['index.hu']
conn = sqlite3.connect(r'C:\Users\Athan\OneDrive\Documents\Dissertation\Python\webscraperorigo\url.db')
curr = conn.cu... | AJszabo/dissertation | indexarticles/indexarticles/spiders/indexarticle.py | indexarticle.py | py | 2,149 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "scrapy.Spider",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "sqlite3.connect",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "items.IndexarticlesItem",
"line_number": 39,
"usage_type": "call"
}
] |
29004478715 | # %% [markdown]
# # Question 2.
# Implement the Principal Component Analysis algorithm for reducing the dimensionality of the points
# given in the datasets: https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.
# data. Each point of this dataset is a 4-dimensional vector (d = 4) given in the first colum... | debonil/ml-assignments | Assignment3/M21AIE225_PA1_2.py | M21AIE225_PA1_2.py | py | 9,673 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "seaborn.set",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.norm",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"line_number": 53,
"usage_type": "name"
},
{
"api_name": "numpy.average",
"line_... |
28986345346 | from django.shortcuts import render, redirect
from django.views.decorators.clickjacking import xframe_options_exempt
import json
import sys
if '/God' not in sys.path:
sys.path.append('/God')
import Twitter
import Github
import datetime
import NatureLang
import Sitemap
repo = "twitter_network"
information_page... | minegishirei/flamevalue | trashbox/django3/app/fanstatic/twitter_views.py | twitter_views.py | py | 5,034 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "Github.seach_page_list",
... |
27577939256 | from django.contrib.auth.decorators import login_required
from django.shortcuts import render
from tickets.models import Ticket
@login_required
def dashboard(request):
#from django.apps.apps import get_model
#t = get_model('openticketing', 'Ticket')
from django.db import connection
with connection.cur... | majidasadish/OpenTicketing | OpenTicketing/tickets/app_views/pages/dashboard.py | dashboard.py | py | 826 | python | en | code | null | github-code | 1 | [
{
"api_name": "django.db.connection.cursor",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.db.connection",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "tickets.models.Ticket.objects.filter",
"line_number": 17,
"usage_type": "call"
},
{
... |
11020158140 | from django.shortcuts import render
from app01 import models
from utils import mypage
# Create your views here.
def book_list(request):
# 查找到所有的书籍
books = models.Book.objects.all()
# 拿到总数据量
total_count = books.count()
# 从url拿到page参数
current_page = request.GET.get("page", None)
page_obj ... | xyw324/DemoPaging | app01/views.py | views.py | py | 674 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "app01.models.Book.objects.all",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "app01.models.Book",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "app01.models",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "uti... |
8818476440 | import cv2, math
from math import *
import numpy as np
import sys
from decimal import *
sys.path.append("../")
from libs.configs import cfgs
IMG_LOW = 1100
black = (0,0,0)
red = (0, 0, 255)
def convert_rect_origin(rect):
if rect[4] == 90 or rect[4] == -90:
new_rect = [rect[0],rect[1],rect[3],rect[2], 0]
... | anegawa/book_detection | tools/test.py | test.py | py | 7,650 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.path.append",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "libs.configs.cfgs.STRIDE_NUM",
"line_number": 70,
"usage_type": "attribute"
},
{
"api_name": "libs.co... |
31064789985 | #!/usr/bin/env python
import os
import sys
import pdb
import numpy as np
from scipy.interpolate import interp1d
from scipy.constants import pi
from matplotlib import pyplot as plt
from matplotlib.ticker import FormatStrFormatter
from astropy.constants import h, k_B, c, G
from astropy import units as u
from astropy.co... | avantyghem/Cluster | Cluster.py | Cluster.py | py | 5,318 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "astropy.table.Table.read",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "astropy.table.Table",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "astropy.constants.c",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "astr... |
23550603160 | import logging
import os
import time
from pathlib import Path
import tomllib
IS_DEVELOPMENT = bool(os.environ.get("DEVELOPMENT", False))
parsed_toml = tomllib.load(open("config.toml", "rb"))
SECRET_KEY = parsed_toml.get("SECRET_KEY", "S$cR3t_K3y")
API_HOST = parsed_toml.get("API_HOST")
API_PORT = int(parsed_toml.get... | GetWVKeys/wv_cdm_api | api/config.py | config.py | py | 1,107 | python | en | code | 32 | github-code | 1 | [
{
"api_name": "os.environ.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "tomllib.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_nu... |
25163443774 | import time
import pyautogui
from pykeyboard import PyKeyboard
from pymouse import PyMouse
from positions import POSITION
from roles import Role
from scenes.common import CommonScene
from tools import loading, locate
# 场景3:游戏界面
class GameScene(CommonScene):
@staticmethod
def goto_association():
"""
... | huiyaoren/genshin_test_tools | scenes/game.py | game.py | py | 7,704 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "scenes.common.CommonScene",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "pykeyboard.PyKeyboard",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "time.sleep... |
5071621268 |
# coding:utf-8
# 卷积核尺寸,卷积核个数,池化层尺寸,全连接层的节点数,学习率,权重,偏置
import copy
import random
import time
import matplotlib.pyplot as plt
import numpy as np
from public.public_function import *
from public.cnn_single_keras_tensorflow import *
# from multi_part.first_part import *
from keras.models import load_mod... | githubzhch/ensemble-learning-grf | _2_multi_moead/multi_moead_cluster.py | multi_moead_cluster.py | py | 19,841 | python | zh | code | 0 | github-code | 1 | [
{
"api_name": "numpy.argmax",
"line_number": 92,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 118,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 124,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 131... |
22653630816 | from PIL import Image
import os
import codecs
include_extension = ['bmp']
def P2A(image, name):
x,y = image.size
print(f"x={x},y={y}\n")
file = codecs.open(name, 'w', 'utf-8')
for i in range(x):
for j in range(y):
r,g,b = image.getpixel((i,j))
file.write(f"{r},{g},{b},"... | Dalminham/CV_Processing | General_format/Evaluation/Pic2Array.py | Pic2Array.py | py | 728 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "codecs.open",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": ... |
36500206584 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 5 15:07:43 2020
@author: Pooya Poolad
A poisson event generator.
"""
try:
import numpy as np
import numpy.random as rnd
#import matplotlib.pyplot as plt
from numba import jit,cuda
from numba.cuda.random import create_xoroshiro12... | ppoolad/MonteCarlo_ToF | Utility/event_generator.py | event_generator.py | py | 4,924 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "sys.path.append",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
2158776369 | import torch
import open_clip
from pathlib import Path
import pandas as pd
from PIL import Image
model, _, preprocess = open_clip.create_model_and_transforms('ViT-B-32', pretrained='laion400m_e32')
def vectorize(img):
with torch.no_grad():
image = preprocess(img).unsqueeze(0)
vec = model.encode_im... | wyttnik/SimilarImageSearchNeuron | base_creation.py | base_creation.py | py | 733 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "open_clip.create_model_and_transforms",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.no_grad",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pathl... |
25009901167 | # -*- coding: utf-8 -*-
from fastapi import APIRouter, Path
from .controllers import PostCtrl
post_router = APIRouter(prefix='/posts')
@post_router.get('', summary="获取文章列表")
async def get_posts_list(page: int = 1, per_page: int = 10):
pagination = PostCtrl().get_posts_paginate(page=page, per_page=per_page)
... | zxins/fast-lofter | services/post/apis.py | apis.py | py | 816 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "controllers.PostCtrl",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "fastapi.Path",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "controllers.PostCt... |
6135984234 | import sympy
def perturbed_quants(terms, order):
ep = sympy.symbols('epsilon', real=True)
replacements = []
new_vars = []
for term in terms:
raw = str(term)
expanded = [ raw+'%d'%expand for expand in range(order+1)]
symbs = sympy.symbols(' '.join(expanded), real=True)
to... | wolfram74/worked_problems | docs/summer_19/week_2019_07_08/scratch2.py | scratch2.py | py | 1,660 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sympy.symbols",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sympy.symbols",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sympy.symbols",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sympy.symbols",
"line_nu... |
1656456443 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2021/9/8 12:39
# @Author : JJkinging
# @File : utils.py
from torch.utils.data import Dataset, DataLoader
from data.code.predict.test_utils import load_vocab, collate_to_max_length
class CCFDataset(Dataset):
def __init__(self, filename, intent_filename... | SCU-JJkinging/CCIR-Cup | data/code/scripts/dataset.py | dataset.py | py | 4,968 | python | en | code | 22 | github-code | 1 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "data.code.predict.test_utils.load_vocab",
"line_number": 112,
"usage_type": "call"
},
{
"api_name": "data.code.predict.test_utils.load_vocab",
"line_number": 113,
"usage_ty... |
40378963481 | from locust import HttpUser, task
from urllib3.exceptions import InsecureRequestWarning
import urllib3
urllib3.disable_warnings(InsecureRequestWarning)
__version__ = "1"
params = {}
params["all"] = {
"types[0]": "software-catalog",
}
params["all_components"] = {
"types[0]": "software-catalog",
"filters... | redhat-performance/backstage-performance | scenarios/search-catalog.py | search-catalog.py | py | 1,228 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "urllib3.disable_warnings",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "urllib3.exceptions.InsecureRequestWarning",
"line_number": 5,
"usage_type": "argument"
},
{
"api_name": "locust.HttpUser",
"line_number": 34,
"usage_type": "name"
},
{
... |
736500735 | import bs4
import requests
import json
from io import StringIO
import gzip
import csv
import codecs
from bs4 import BeautifulSoup
import sys
import io
import StringIO
reload(sys)
sys.setdefaultencoding('utf-8')
linker = []
myTopics = ["football","basketball","nba","mls","nfl","nhl","cricket","soccer"]
def GetRecord... | SouravBihani/Large-Scale-Text-Processing | Data/Common Crawl/Utilities/CCDataExtract.py | CCDataExtract.py | py | 3,095 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "sys.setdefaultencoding",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "requests.get",
"li... |
74525949792 | import argparse
import collections
import glob
import json
import math
import numpy as np
import random
from ordered_set import OrderedSet
import os
import pickle
import shutil
from sklearn.metrics import average_precision_score
import sys
import termcolor
import time
import torch
import torch.nn as nn
... | acproject/GNNs | NAACL/backoffnet.py | backoffnet.py | py | 38,944 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "sys.stderr",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "collections.namedtuple",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 102,
"usage_type": "call"
},
{
"api_name": "order... |
16136952400 | from bson import ObjectId
from fastapi import HTTPException
from starlette import status
from app.api.dto.user import User
from app.repository.entity.user_entity import UserEntity
from app.repository.user_repository import UserRepository
from app.util.logger import logger
class UserDBService:
def __init__(self, ... | amosproj/amos2023ws01-ticket-chat-ai | Backend/app/service/user_db_service.py | user_db_service.py | py | 2,331 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "app.repository.user_repository.UserRepository",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "app.repository.entity.user_entity.UserEntity",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "app.util.logger.logger.info",
"line_number": 16,
... |
23044885851 | '''
Module untuk membantu dalam 'menjawab' query/request user
Reinaldo Antolis / 13519015
Jeane Mikha / 13519116
Josep Marcello / 13519164
27 April 2021
'''
from datetime import datetime, timedelta
from matching import boyer_moore
import re
def extract_date(msg: str) -> 'list[datetime]':
'''
Fungsi untuk m... | jspmarc/BotWangy | src/response.py | response.py | py | 18,205 | python | id | code | 0 | github-code | 1 | [
{
"api_name": "re.findall",
"line_number": 89,
"usage_type": "call"
},
{
"api_name": "re.IGNORECASE",
"line_number": 89,
"usage_type": "attribute"
},
{
"api_name": "re.findall",
"line_number": 96,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number... |
15226484150 | import time
import os, sys
import traceback
import socket
import hmac
import hashlib
import mensagem_pb2
import threading
from random import randint
import logging
logging.basicConfig(level=logging.INFO, format='%(levelname)s:%(threadName)s:%(message)s')
from random import (
choice, randint
)
from string import (
... | VictorSCosta/Python-Protobuf-example-client-server | servidor.py | servidor.py | py | 2,582 | python | pt | code | 0 | github-code | 1 | [
{
"api_name": "logging.basicConfig",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "mensagem_pb2.Mensagem",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "communica... |
42272258033 | from astropy.utils.data import get_pkg_data_filename
from ..catalogues import Catalogue
from ..lr import LRMatch
def set_catalogues():
mocfile = get_pkg_data_filename('data/testcat_moc_1.moc')
pcat_datafile = get_pkg_data_filename('data/testcat_moc_1.fits')
pcat = Catalogue(pcat_datafile, area=mocfi... | ruizca/astromatch | astromatch/tests/test_lr.py | test_lr.py | py | 1,769 | python | en | code | 5 | github-code | 1 | [
{
"api_name": "astropy.utils.data.get_pkg_data_filename",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "astropy.utils.data.get_pkg_data_filename",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "catalogues.Catalogue",
"line_number": 11,
"usage_type": ... |
40818797234 |
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
import time
driver=webdriver.Chrome()
driver.implicitly_wait(5)
driver.maximize_window()
driver .get ("https://tr.wikipedia.org/wiki/Anasayfa")
seçkin_madde_alanı=driver.find_element(By.ID,"mp-tf... | htcAK/selen-um | çalışma_sayfam.py | çalışma_sayfam.py | py | 608 | python | tr | code | 0 | github-code | 1 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.common.by.By.ID",
"line_number": 11,
"usage_type": "attribute"
},
{
... |
3581159598 | from flask import Flask, render_template, request, redirect, url_for
from flask_sqlalchemy import SQLAlchemy
#for rendering templates with flask
#First letter must be uppercase
app = Flask(__name__) #The name of the application name or package
#app.config['SQLALCHEMY_DATABASE_URI']= 'postgresql+psycopg2://postgres:Aluc... | kevinnarvaes/fav-quotes-flaskapp | quotes.py | quotes.py | py | 1,787 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "flask.re... |
27823076441 | import cv2
class ShapeDetection():
def __init__(self):
self.corners = []
self.is_displaying = False
"""
Trouve les contours du plus grand quadrilatère sur l'image envoyée
"""
def detect_from_picture(self, img):
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
_, thre... | GregoryMoutote/issou_project | Calibration/ShapeDetection.py | ShapeDetection.py | py | 1,667 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "cv2.cvtColor",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "cv2.threshold",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.THRESH_BINARY"... |
20994349960 | import inspect
import tokenize
from indenter import Indenter
import pylatex
from .utilities import is_list_or_set
from .traits import TraitRegistry, Trait
newlines = "\n\n"
def content_report(fidia_trait_registry):
# type: (TraitRegistry) -> str
assert isinstance(fidia_trait_registry, TraitRegistry)
... | astrogreen/fidia | fidia/reports.py | reports.py | py | 15,595 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "traits.TraitRegistry",
"line_number": 16,
"usage_type": "argument"
},
{
"api_name": "traits.TraitRegistry",
"line_number": 59,
"usage_type": "argument"
},
{
"api_name": "traits.TraitRegistry",
"line_number": 118,
"usage_type": "argument"
},
{
"api_n... |
73111180834 | # -*- coding: utf-8 -*-
import scrapy
import time
from scrapy.http import Request
from loguru import logger
from SafetyInformation.items import SafeInfoItem
from SafetyInformation.settings import SLEEP_TIME, TOTAL_PAGES
class SecUnSpider(scrapy.Spider):
name = 'sec_un'
allowed_domains = ['sec-un.org']
st... | Silentsoul04/SafetyInformation | SafetyInformation/spiders/sec_un.py | sec_un.py | py | 2,029 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "scrapy.Spider",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "loguru.logger.info",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "loguru.logger",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "SafetyInformation... |
41032364306 | import os
import jinja2
import yaml
from pathlib import Path
env = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)),
autoescape=jinja2.select_autoescape(
enabled_extensions=("html", "xml"), default_for_string=True
),
)
if __name__ == "__main__":
sdk_metadata = Pat... | awsdocs/aws-doc-sdk-examples | .tools/images/render-blurbs.py | render-blurbs.py | py | 689 | python | en | code | 8,378 | github-code | 1 | [
{
"api_name": "jinja2.Environment",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "jinja2.FileSystemLoader",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
27421766026 | #!/usr/bin/env python3
# coding: utf-8
# In[2]:
import numpy as np
import keras
class DataGenerator(keras.utils.Sequence):
def __init__(self, input_texts, target_texts, input_token_index, target_token_index, max_encoder_seq_length, max_decoder_seq_length, num_encoder_tokens, num_decoder_tokens, batch_size, shuf... | GirayEryilmaz/University-Projects | cmpe597/project/seq2seq.py | seq2seq.py | py | 10,255 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "keras.utils",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "numpy.floor",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "numpy.random.shuffle",
... |
15609782422 | import json
class NLG:
# get text by action from config file
def __init__(self,
json_path):
self.json_path=json_path
self.get_json_infor()
def get_json_infor(self):
# get config file
f = open(self.json_path, encoding='utf-8')
file=json.load(f)
... | foowaa/bert-dst | nlg.py | nlg.py | py | 635 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "json.load",
"line_number": 15,
"usage_type": "call"
}
] |
24248168494 | from collections import defaultdict
class TrieNode:
def __init__(self):
self.is_word = False
self.children = defaultdict(TrieNode)
class WordDictionary:
def __init__(self):
self.root = TrieNode()
def add_word(self, word):
cur_node = self.root
for ch in word:
... | ekinrf/ProgPuzzles | Cache/python/word_dict.py | word_dict.py | py | 968 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "collections.defaultdict",
"line_number": 7,
"usage_type": "call"
}
] |
18187474839 | import pytest
from forest.components import tiles
@pytest.mark.parametrize(
"name,expect",
[
(
tiles.OPEN_STREET_MAP,
"https://c.tile.openstreetmap.org/{Z}/{X}/{Y}.png",
),
(
tiles.STAMEN_TERRAIN,
"http://tile.stamen.com/terrain-backgroun... | MetOffice/forest | test/test_components_tiles.py | test_components_tiles.py | py | 2,153 | python | en | code | 38 | github-code | 1 | [
{
"api_name": "forest.components.tiles.background_url",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "forest.components.tiles",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 5,
"usage_type": "call"
},
{
... |
16895758445 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Description: Analyze the reopening type of a user since the beginning of his
# work to now.
# Usage:
# $ python analyze_reopening_reason.py tms-production {user login}
import erppeek
from operator import itemgetter
from collections import OrderedDict
import os
import re... | TinPlusIT05/tms | erppeek/analyze_reopening_reason.py | analyze_reopening_reason.py | py | 6,456 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "trobz.log.init_logger",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "trobz.log.logger",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "os.EX_USAGE",
... |
2715646635 | import os,glob
from Bio import SeqIO
import statistics
import numpy as np
from Bio.Seq import Seq
input_bs_file = '/scratch/users/anniz44/genomes/donor_species/vcf_round2/BS/binding_results_ccpA.txt'
ref_BS = '/scratch/users/anniz44/genomes/donor_species/vcf_round2/BS/ccpA_BS_RegPrecise_difflength.fa'
vcf_folder = '/s... | caozhichongchong/snp_finder | snp_finder/scripts/compareBSold.py | compareBSold.py | py | 11,703 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "Bio.SeqIO.parse",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "Bio.SeqIO",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "Bio.SeqIO.parse",
"line_number": 97,
"usage_type": "call"
},
{
"api_name": "Bio.SeqIO",
"line_numbe... |
34841985760 | # Binary Tree Right Side View: https://leetcode.com/problems/binary-tree-right-side-view/
# Given the root of a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.
# Initial solution is pretty simple you just do a depth level traversal... | KevinKnott/Coding-Review | Month 01/Week 01/Day 06/a.py | a.py | py | 2,545 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "collections.deque",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 58,
"usage_type": "call"
}
] |
27401851860 | import pytest
from cognite.pygen.utils.text import to_pascal, to_snake
@pytest.mark.parametrize(
"word, singularize, pluralize, expected",
[
("Actress", True, False, "Actress"),
("BestLeadingActress", True, False, "BestLeadingActress"),
("Actress", False, True, "Actresses"),
],
)
... | cognitedata/pygen | tests/test_unit/test_generator/test_utils/test_text.py | test_text.py | py | 942 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "cognite.pygen.utils.text.to_pascal",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_nam... |
35575043040 | from django.shortcuts import render
from rest_framework.views import APIView
from rest_framework.response import Response
from .models import Article, Lesson, NewUser, Tutorial, Chapter, Book
from .serializers import (ArticleSerializer,
RegisterSerializer,
LoginSeri... | devanshsharma416/ReactDjangoApplication | UserModel/views.py | views.py | py | 8,063 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "django.shortcuts.render",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "rest_framework.generics.CreateAPIView",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.generics",
"line_number": 31,
"usage_type": "name"
},... |
71994365793 | from django.urls import path
from .views import *
from . import views
app_name='eventos'
urlpatterns = [
path('calendario-dinamico/', Calendario.as_view(), name='calendario-dinamico'),
path('evento/',MostrarEvento.as_view(), name='detalle-evento'),
path('evento/<int:pk>/asistencias',ConfirmarAsistencia.as... | lucasppperalta/ONG-WEB-BLOG-INFORMATORIO2 | eventos/urls.py | urls.py | py | 1,195 | python | es | code | 0 | github-code | 1 | [
{
"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",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
20994653930 | # Increase the chances that this code will work in both Python 2 and Python 3 (however, this is written for Python 3!!!)
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import shutil
from typing import *
from astropy.io import fits
from tdfdr import aaorun
import loggin... | astrogreen/obs_techniques_workshop | data_reducer.py | data_reducer.py | py | 5,514 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.WARNING",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"... |
15973346603 | # module
import multiprocessing
import pandas as pd
import time
# custom utils
import utils_c
def get_asm_img(file_name):
root_path = '../'
colnames = ['asm_img_' + str(i+1) for i in range(1000)]
feature_list = {'hash': file_name}
for v in colnames:
feature_list[v] = 0
file_path = root... | SONG-WONHO/DataChallenge2018 | module/module_asm_to_img/main.py | main.py | py | 1,639 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "utils_c.make_result_dir",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "utils_c.get_file_list",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Pool",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "ti... |
36861387593 | """Models for storing VCF variant statistics information."""
import enum
import hashlib
import math
import pathlib
import typing
import attr
import cattr
import json
from logzero import logger
import vcfpy
_TGenotype = typing.TypeVar("Genotype")
class Genotype(enum.Enum):
#: Reference homozygous.
REF = "0... | holtgrewe/clin-qc-tk | qctk/models/vcf.py | vcf.py | py | 5,860 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.TypeVar",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "enum.Enum",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "attr.evolve",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "attr.evolve",
"line_num... |
674845764 | import sys
if sys.version_info.major == 2:
import mock
else:
from unittest import mock
import json
import numpy as np
import random
import string
import tensorflow as tf
from grpc._cython import cygrpc
from nose.tools import assert_equal
from nose.tools import assert_is_instance
from nose.tools import assert... | maibrahim2016/background_removal | src/models/tests/test_segmenter.py | test_segmenter.py | py | 10,993 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.version_info",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "nose.tools.assert_true",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "nose.tools.assert_equal",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "r... |
28796011783 | """
Nが200,000もある
2つを選ぶと10**10となり間に合わない
Nの時間計算量で求める必要がある
"""
from collections import Counter
N = int(input())
A = list(map(int, input().split()))
C = Counter(A)
ans = 0
for combi in [(100,400), (200,300)]:
l, r = combi
ans += C[l] * C[r]
print(ans) | bun913/math_and_algorithm | 018/main.py | main.py | py | 323 | python | ja | code | 0 | github-code | 1 | [
{
"api_name": "collections.Counter",
"line_number": 10,
"usage_type": "call"
}
] |
73214463715 | import os
import json
import torch
from simpletransformers.question_answering import QuestionAnsweringModel
from evaluate import in_eval
def create_parentDir(path, exist_ok=True):
head, tail = os.path.split(path)
os.makedirs(head, exist_ok=exist_ok)
def read_data(train_file, dev_file, test_file=None):
tra... | TingFree/WDA | bert_qa.py | bert_qa.py | py | 4,038 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.split",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 12... |
72357043233 | # This script creates the color-color and rms plots used in state separation
# This is quite messy because of the different ways the rms and coco files are defined
import os
import numpy as np
from matplotlib import pyplot as plt
from math import exp
from math import sqrt
import matplotlib
import matplotlib.patches ... | jkuut/dyn-pow-method | colcol_rms.py | colcol_rms.py | py | 8,867 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.array",
"line_number": 96,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 97,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 98,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": ... |
23411365980 | #!/usr/bin/python3
"""Program to automatically type strings in application windows upon
authenticating with a RFID or NFC UID. Useful for example to enter your master
password in Mozilla Firefox or Mozilla Thunderbird, which don't integrate with
any third-party keyring manager.
To add a rule for automatic typing, invo... | richardevcom/PAMPy-NFC | bin/scripts/ppnfc_autotype.py | ppnfc_autotype.py | py | 17,131 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "os.stat",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 89,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 120,
"usage_type": "call"
},
{
"api_name": "secrets.token_bytes",
"line_number":... |
37120203160 | from typing import List
import timm
import torch
import torch.distributed as dist
import torch.nn as nn
import torch.nn.functional as F
from detectron2.layers import ShapeSpec
from detectron2.modeling import Backbone
from detectron2.modeling.backbone.fpn import LastLevelMaxPool
__all__ = ["BiFPN"]
def get_world_siz... | zetyquickly/DensePoseFnL | fpn.py | fpn.py | py | 5,990 | python | en | code | 113 | github-code | 1 | [
{
"api_name": "torch.distributed.is_available",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.distributed",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "torch.distributed.is_initialized",
"line_number": 18,
"usage_type": "call"
},
{
... |
72316114274 | from lxml import html
from lxml.etree import XPath
TBODY_XPATH = XPath('//table[@class="observations"]/tbody')
OBSERVATION_XPATH = XPath('./td//text()[normalize-space()]')
DETAILS_XPATH = XPath('./td/div/table/tbody/tr/td//text()')
def _clean_cell(value):
"""
Removes dashes and strips whitespace from the gi... | zsiciarz/pyaavso | pyaavso/parsers/webobs.py | webobs.py | py | 1,906 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "lxml.etree.XPath",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "lxml.etree.XPath",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "lxml.etree.XPath",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "lxml.html.fromstring"... |
73113782435 | import math
from sys import stdin
from collections import defaultdict
class exist_negative_cycle(Exception):
pass
inf = float('inf')
# ベルマンフォード
# O(E + V)
def bellman_ford(g, size, start=0):
d = [inf] * size
d[start] = 0
for _ in range(size):
for u in g:
for v, d in g[u]:
... | elzup/algo-py | graph/bellmanford.py | bellmanford.py | py | 836 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "collections.defaultdict",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "math.isinf",
"line_number": 38,
"usage_type": "call"
}
] |
72083112354 | from tkinter import filedialog as fd
from tkinter import messagebox
from PIL import Image
import customtkinter as ctk
import requests
from io import BytesIO
from PIL import Image
import os
def select_file():
filetypes = (
('All files', '*.*'),
('text files', '*.txt'),
)
file_path = fd.ask... | gumartinslopes/TI-VI | interface/utils/file_handle.py | file_handle.py | py | 2,691 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "tkinter.filedialog.askopenfilenames",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "tkinter.filedialog",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": ... |
74732843554 | import configparser
from tkinter import ttk
import datetime
from datetime import timedelta
import tkinter as tk
import os
from distutils.dir_util import copy_tree
from datepicker import Datepicker
# import win32print
class Data(tk.Frame):
def __init__(self, parent, controller):
tk.Frame.__init__(self, par... | AleLuzzi/PyInsta | data.py | data.py | py | 2,921 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "tkinter.Frame",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "tkinter.Frame.__init__",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tkinter.Frame",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "datetime... |
40894999462 | from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from selenium.webdriver.firefox.webdriver import WebDriver
from django.conf import settings
import os
SCREEN_DUMP_LOCATION = os.path.join(settings.BASE_DIR, "screendumps")
class StatusViewsTests(StaticLiveServerTestCase):
@classmethod
de... | why-pengo/sprinkler | status/tests/status_views_test.py | status_views_test.py | py | 829 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.join",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings.BASE_DIR",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.conf... |
22288570912 | import torch
import torch.nn.functional as F
from torch.distributed.tensor.parallel import (
PairwiseParallel,
parallelize_module,
)
from torch.distributed._tensor import DeviceMesh, distribute_tensor, DTensor
from torch.distributed._tensor.placement_types import _Partial, Replicate, Shard
from torch.testing._... | llv22/pytorch-macOS-cuda | test/distributed/_tensor/test_dtensor.py | test_dtensor.py | py | 17,654 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "torch.nn",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Linear",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.ReLU",
"line... |
1908888817 | import torch
import torch.nn.functional as F
import math
"""
DISCLAIMER: most of these functions were implemented by me (Vaclav Vavra)
during the MPV course in the Spring semester of 2020, mostly with the help
of the provided template.
"""
def get_gausskernel_size(sigma, force_odd = True):
ksize = 2 * math.ceil(si... | vicsyl/extreme_two_view_matching_research | image_processing.py | image_processing.py | py | 3,933 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "math.ceil",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.Tensor",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "torch.linspace",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "torch.Tensor",
"line_n... |
15870050682 | import gym
import sys
import itertools
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
from queue import Queue
from agent import Agent
def is_int(string):
try: return int(string) > 0
except: return False
def process(state):
batch = []
for frame in state:
image = Image.... | gareth618/car-race | main.py | main.py | py | 3,389 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PIL.Image.fromarray",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_num... |
25376879137 | import psutil
from opentelemetry import metrics
from opentelemetry.sdk.metrics import MeterProvider, ValueObserver
from opentelemetry.sdk.metrics.export import ConsoleMetricsExporter
metrics.set_meter_provider(MeterProvider())
meter = metrics.get_meter(__name__)
metrics.get_meter_provider().start_pipeline(meter, Cons... | NathanielRN/clone-opentelemetry-python | docs/examples/basic_meter/observer.py | observer.py | py | 1,140 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "opentelemetry.metrics.set_meter_provider",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "opentelemetry.metrics",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "opentelemetry.sdk.metrics.MeterProvider",
"line_number": 7,
"usage_type": "c... |
70742294433 | # Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html
# useful for handling different item types with a single interface
import os
import re
import time
from os.path import dirname, basename, join
from u... | huangweiwei99/scrapy | robertocavallihomeinteriors/robertocavallihomeinteriors/pipelines.py | pipelines.py | py | 3,291 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.join",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 3... |
10379903084 | from selenium import webdriver
from selenium.webdriver.common.by import By
import urllib.parse
from flask import Flask,jsonify, request
from flask_restful import Api, Resource
import time
app = Flask(__name__)
api = Api(app)
PATH = ".chromedriver.exe"
def get_first_image_url_from_google(delay, search_term):
wd... | Chaitanyarai899/Video-Rendering-Service-backend | scraper.py | scraper.py | py | 1,384 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask_restful.Api",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "selenium.webdr... |
7351651718 | # -*- coding:utf-8 -*-
from flask import Blueprint, render_template, session, request, redirect, flash, url_for, jsonify
from flask_login import login_user, login_required, logout_user, current_user
from app.email import send_confirm_email, send_reset_email
from app.message.models import Message, Pri_letter
from app.me... | NilsGuo/0tinn | app/member/views.py | views.py | py | 6,733 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Blueprint",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "app.util.helper.mark_online",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "flask.request.remote_addr",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_na... |
10711671633 | import pandas as pd
import pandas.testing as tm
import numpy as np
from numpy import loadtxt
from sklearn.cluster import KMeans
from sklearn.preprocessing import LabelEncoder
from sklearn.preprocessing import MinMaxScaler
import xgboost
from xgboost import XGBClassifier
import hashlib
import json
from time import time
... | eelay234/blockchain | progress/Web3/June/fraud_detection_using_kmeans.py | fraud_detection_using_kmeans.py | py | 9,159 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"... |
30331506653 | import os
import datetime
import shutil
import sys
import pathlib
p = pathlib.Path(__file__).resolve().parent
p = p.parent.joinpath("pysrc")
sys.path.insert(0, str(p))
from service import delete_some
"""删除文件测试"""
conf = "D:/"
disk = "E:/"
dst_folder = f"{disk}LT-VIDEO-SS91456-北京蓝天多维"
def get_free():
"""剩余空间"... | soda92/NVRTool | test/delete_file_test_d.py | delete_file_test_d.py | py | 1,539 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pathlib.Path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.path.insert",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "shutil.disk_usage",
"li... |
1272262655 | import torch
import librosa
import numpy as np
import matplotlib.pyplot as plt
from specAugment.spec_augment_pytorch import spec_augment
# Borrowed from: https://github.com/DemisEom/SpecAugment
if __name__ == "__main__":
# Get example mel
audio, sampling_rate = librosa.load(librosa.util.example_audio_file(),... | HudsonHuang/yata | yata/spectaug.py | spectaug.py | py | 1,119 | python | en | code | 6 | github-code | 1 | [
{
"api_name": "librosa.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "librosa.util.example_audio_file",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "librosa.util",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "libros... |
42214197070 | import os
import chardet
folder_path = 'txt_data'
stopwords_files = ['baidu_stopwords.txt']
stopwords_list = ["的", "了", "在", "是", "我", "有", "和", "就",
"不", "人", "都", "一", "一个", "上", "也", "很", "到", "说", "要", "去", "你", "会", "着", "没有", "看", "好", "自己", "这",
"罢", "这", '在', '又', '在', '得',... | 9aLucky/DL_NLP_2022_HW | HW4/preprocessor.py | preprocessor.py | py | 2,312 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "os.sep",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.sep",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "chardet.detect",
"line_number": 49,
"usage_type": "call"
}
] |
36448088007 | import sys
import logging
FORMAT = '%(levelname) - %(asctime)s -AutoClicker %(message)s'
FORMAT = ("%(levelname) %(message)s")
FORMAT = ("%(asctime)s %(name)s %(levelname)s %(message)s")
logger = logging.getLogger('otog')
logger.setLevel(logging.DEBUG)
formatter = logging.Formatter(FORMAT)
console = logging.Stre... | cnhy-nero-diskard/AutoClicker_quizlet | test_debug.py | test_debug.py | py | 767 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "logging.Formatter",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.StreamHa... |
8251155538 | import pandas as pd
from bs4 import BeautifulSoup
import requests
df = pd.read_csv('Lists/2015_jeju_test.tsv', sep='\t',encoding='utf8')
def search(keyword1,keyword2,keyword3, category, city, name):
sd= "20150101"
ed= "20191231"
query= keyword1 +"+"+ "%7c" + "+" +keyword2 + "+" + "%7c"+ "+" +keyword3 + ... | vyvydkf628/PythonWebCrawler | count blogs/countBlogs.py | countBlogs.py | py | 3,757 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 30,
"usage_type": "call"
}
] |
3758809888 | from notion.client import NotionClient
from notion.collection import NotionDate
from datetime import datetime, timedelta
from math import ceil
class todo_list_mgr:
def __init__(self, client, page_to_update):
assert(isinstance(client, NotionClient))
self.target_view = client.get_collection_view(pa... | hanbo1990/notion_automation | todo_list_mgr.py | todo_list_mgr.py | py | 3,813 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "notion.client.NotionClient",
"line_number": 10,
"usage_type": "argument"
},
{
"api_name": "datetime.datetime.now",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 15,
"usage_type": "name"
},
{
"api_name":... |
3565853497 | from PyQt5 import QtCore, QtWidgets, QtGui
from sys import exit
import os
import time
import csv
from multiprocessing import Process, Pipe, Queue
import datetime
import BACModbus
from setup import read_setup
from jbdMain import JBD
from ampy import Ui_MainWindow
import serial
import logging # logging
import modbus_tk_a... | cwkowalski/ASI_AmpyDisplay | main.py | main.py | py | 123,655 | python | en | code | 10 | github-code | 1 | [
{
"api_name": "PyQt5.QtCore.QThread",
"line_number": 80,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtCore",
"line_number": 80,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCore.pyqtSignal",
"line_number": 81,
"usage_type": "call"
},
{
"api_name": "PyQt5.... |
32244067237 | # Python 3.6
"""
Peak handle functions.
Maintainer: Shpakov Konstantin
Link: https://github.com/shpakovkv/SignalProcess
"""
from __future__ import print_function
import matplotlib
import matplotlib.pyplot as pyplot
import os
import sys
import numpy
import bisect
import argparse
import numpy as np
import scipy.int... | shpakovkv/SignalProcess | scripts/PeakProcess.py | PeakProcess.py | py | 37,640 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "arg_parser.get_input_files_args_parser",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "arg_parser.get_mult_del_args_parser",
"line_number": 59,
"usage_type": "ca... |
1538871246 | import logging
import numpy as np
from src.Utils.Types.VolType import VolType
__author__ = 'frank.ma'
logger = logging.getLogger(__name__)
class SABRModel(object):
def __init__(self, t: float, alpha: float, beta: float, nu: float, rho: float):
self.t = t
self.alpha = alpha
self.beta = ... | frankma/Finance | src/SABRModel/SABRModel.py | SABRModel.py | py | 2,640 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.full",
"line... |
3356348223 | # Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html
from sqlalchemy.orm import sessionmaker
from scrapy.exceptions import DropItem
from minimalist_scrapy.models import (
Quote, Author, Tag, db_conne... | pace-noge/minimalist-scrapy | minimalist_scrapy/pipelines.py | pipelines.py | py | 2,995 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "minimalist_scrapy.models.db_connect",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "minimalist_scrapy.models.create_table",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.sessionmaker",
"line_number": 30,
"usage_type": ... |
9625126741 | import uuid
import json
import logging
import sqlite3
import threading
import time
from datetime import datetime
from .const import (LIST_TYPE_CHANNEL_BRAND,
LIST_MODEL_DEVICE_BRAND, NAME_TYPE_CHANNEL, TYPE_DEVICE)
from .config import DATABASE
LOGGER = logging.getLogger("Database")
DB_VERSION = 0x00... | minhtan58/HomeGate | dbsync.py | dbsync.py | py | 64,592 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "config.DATABASE",
"line_number": 20,
"usage_type": "argument"
},
{
"api_name": "threading.Lock"... |
26104190475 | # coding: utf-8
from __future__ import absolute_import
from flask import json
from six import BytesIO
from swagger_server.models.image import Image # noqa: E501
from swagger_server.models.image_id_body import ImageIdBody # noqa: E501
from swagger_server.test import BaseTestCase
class TestImageController(BaseTest... | JakubKuderski/Programowanie_Zespolowe | server/swagger_server/test/test_image_controller.py | test_image_controller.py | py | 2,607 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "swagger_server.test.BaseTestCase",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "swagger_server.models.image_id_body.ImageIdBody",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "flask.json.dumps",
"line_number": 58,
"usage_type": "cal... |
71807437474 | import argparse
import datetime
import json
import sys
import time
import colorama
import requests
session = requests.Session()
def get_changes(auth_creds, query):
auth = requests.auth.HTTPDigestAuth(*auth_creds)
result = session.get('https://review.openstack.org/a/changes/',
params... | gibizer/gerrit-review-dashboard | dashboard.py | dashboard.py | py | 5,084 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.Session",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "requests.auth.HTTPDigestAuth",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "requests.auth",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "json... |
32807094996 | import torch
from YOLOX.yolox.data.data_augment import preproc
from YOLOX.yolox.data.datasets import COCO_CLASSES
from YOLOX.yolox.exp.build import get_exp_by_name
from YOLOX.yolox.utils import postprocess
from utils.visualize import vis
class Detector():
def __init__(self, model='yolox-m', ckpt='自己训练的yolox检测模... | Leonlww/YOLOX_DeepSort_stu | objdetector.py | objdetector.py | py | 1,985 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "torch.device",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.device",
... |
18991897731 | from genericpath import exists
import aiohttp
from aiohttp import web
from aiohttp.client_exceptions import ClientConnectionError
import asyncio
import pprint
import traceback
import time
async def reverse_proxprox_websocket(ws_proxying, ws_client, connection_id):
from proxy import msg_pack
#print("PROXPROX")
... | sjdv1982/cloudless | reverse_proxy.py | reverse_proxy.py | py | 6,042 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "aiohttp.WSMsgType",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "aiohttp.WSMsgType",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "pprint.pformat",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "proxy.ms... |
31502391023 | #!/usr/bin/python3
from helpers import session
from helpers import cookies
from helpers import form
import json
import cgi
import os
import datetime
print("Content-Type: text/html")
def simple_message(message):
print("")
print(message)
print("<br>")
print('Redirecting you back in 5 seconds...<meta http-equiv="ref... | abir-taheer/silver-potato | process_submission.py | process_submission.py | py | 1,439 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "helpers.session.is_signed_in",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "helpers.session",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "json.loads",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "helpers.form.... |
13883453328 | #This script lists all *.txt files in the folder that you choose (assuming that they are the Slim output files).
#The script creates 2 output files- one for counts and one for frequency.
#How to run:
#python get_sfs_from_full_output_general_reps.py -input_folder /path/to/intput/folder -output_folder /path/to/output -ou... | paruljohri/Perspective_Statistical_Inference | CalculateStatisticsTestSet/get_sfs_from_full_output_general_reps.py | get_sfs_from_full_output_general_reps.py | py | 4,176 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 80,
"usage_type": "call"
}
] |
14374176573 | import os
from flask import Flask, render_template, request
from plot import plot_graph
from download import options, download, set_download_config
from shell import reboot_stable_diffusion, set_shell_config
import json
app = Flask(__name__)
CONFIG_PATH = '../../config/config.json'
HOST = {'host': 'localhost', 'port'... | chun92/my_home_server_manager | src/web/app.py | app.py | py | 1,480 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number":... |
31899827759 | # -*- coding: utf-8 -*-
"""
@File : T3.py
@Author : wenhao
@Time : 2023/4/9 10:27
@LC :
"""
import bisect
from typing import List
from collections import Counter
from bisect import bisect_left
# 最大化最小值 == 二分答案
# 二分 mx
# 尽量多的选下标对 使得选出来的对数 >= p
# 如果下标不影响答案 那么可以排序
# 贪心 如果前两个数可以选 那么必选
#
class Solution:
... | callmewenhao/leetcode | contests/weekly-contest-340/T3.py | T3.py | py | 1,601 | python | zh | code | 0 | github-code | 1 | [
{
"api_name": "typing.List",
"line_number": 22,
"usage_type": "name"
}
] |
23468598421 | # MS MARCO Document: Script for plotting leaderboard over time scatter plots
import datetime
import matplotlib.dates as mdates
import matplotlib.pyplot as plt
plt.switch_backend('agg')
import pandas as pd
df = pd.read_csv('../leaderboard/leaderboard.csv', parse_dates=['date'])
# Plot all the runs
ax = df.plot(x='d... | Whem2020/MSMARCO-Document-Ranking-Archive | analysis/plot_leaderboard_over_time.py | plot_leaderboard_over_time.py | py | 947 | python | en | code | null | github-code | 1 | [
{
"api_name": "matplotlib.pyplot.switch_backend",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matp... |
36412878597 | import cv2
import os
import glob
import argparse
import time
parser = argparse.ArgumentParser()
parser.add_argument("--video_dir", type=str,
help="Dataset directory", default='/home/park/0808_capture/video/trade_tower/')
parser.add_argument("--video_result_dir", type=str,
hel... | chansoopark98/Tensorflow-Keras-Semantic-Segmentation | data_augmentation/capture_from_video.py | capture_from_video.py | py | 1,663 | python | en | code | 12 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "glob.glob",
"lin... |
26807469463 | #!/usr/bin/env python3
import requests
import socket
from utils import logger
moviePage_url = 'https://trailers.apple.com/'
movieSearch_url = 'https://trailers.apple.com/trailers/home/scripts/quickfind.php'
log = logger.get_log(__name__)
class Apple():
def __init__(self, min_resolution, max_resolution):
... | jsaddiction/TrailerTech | providers/apple.py | apple.py | py | 4,381 | python | en | code | 10 | github-code | 1 | [
{
"api_name": "utils.logger.get_log",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "utils.logger",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "requests.compat.urljoin",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "requests.comp... |
73948967712 | """Import the compiled Python for .Net module"""
import clr
import sys
print()
print ('clr version = {}'.format(str(clr.__version__)))
"""Import the Keysight automated test app remote library DLL"""
sys.path.append(r'C:\ProgramData\Keysight\DigitalTestApps\Remote Toolkit\Version 6.3\Tools')
clr.AddReference("Keysight... | GuyMcBride/TxCompliancePythonExample | simple.py | simple.py | py | 745 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "clr.__version__",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "clr.AddReference",
... |
17519684943 | from collections import defaultdict
import pandas as pd
import datetime
from lode.utilities.util import parse_date
from itertools import izip
def create_date_limited_sql(master_table, dates=None,
begin_date=None, end_date=None,
date_col="trading_date", range_bre... | NigelCleland/lode | lode/database/query_builders.py | query_builders.py | py | 10,563 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "lode.utilities.util.parse_date",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "lode.utilities.util.parse_date",
"line_number": 90,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 93,
"usage_type": "call"
},
{
... |
5103258436 | from datetime import date
atual = date.today().year
totalmenor = 0
totalmaior = 0
for ano in range(1, 8):
pessoa = int(input('Em que ano a {}ª nasceu? '.format(ano)))
idade = atual - pessoa
print('Essa pessoa tem {} anos.'.format(idade))
if idade < 21:
totalmenor += + 1
else:
totalma... | RaphaelHenriqueOS/Exercicios_Guanabara | Desafio054.py | Desafio054.py | py | 446 | python | pt | code | 0 | github-code | 1 | [
{
"api_name": "datetime.date.today",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 2,
"usage_type": "name"
}
] |
12622362396 | import face_recognition
from PIL import Image, ImageDraw
# This is an example of running face recognition on a single image
# and drawing a box around each person that was identified.
# Load a sample picture and learn how to recognize it.
neutral_image = face_recognition.load_image_file("neutral.jpg")
neutral_face_en... | VishalPatnaik/Facial-Emotion-Detection | expressions.py | expressions.py | py | 3,370 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "face_recognition.load_image_file",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "face_recognition.face_encodings",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "face_recognition.load_image_file",
"line_number": 12,
"usage_type": "call"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.