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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
23792866200 | import glob
import os
import argparse
import cv2 as cv
import numpy as np
from center_combined import center_combined
from config import get_config
from fix_color import scanner_refl_fix, cctiff
from white_balance import white_balance
from shrink_and_clip import shrink_and_clip
from srgb_and_corners import srgb_and_co... | jparanada/magic-hand | magic_hand/magic_hand.py | magic_hand.py | py | 5,845 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "os.path.basename",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
22553123393 | import torch
from torch.autograd import Variable
import numpy as np
def subsequent_mask(size):
"Mask out subsequent positions."
attn_shape = (1, size, size)
subsequent_mask = np.triu(np.ones(attn_shape), k=1).astype('uint8')
return torch.from_numpy(subsequent_mask) == 0
def make_std_mask(tgt, pad):
... | makeesyai/makeesy-deep-learning | self_attention/test_subsequent_masking.py | test_subsequent_masking.py | py | 902 | python | en | code | 16 | github-code | 71 | [
{
"api_name": "numpy.triu",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.from_numpy",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torch.autograd.Variable",
"l... |
24619557092 | from datetime import date, datetime, timedelta
from django.conf import settings
from django.core.management.base import BaseCommand
from kitsune.kpi.management import utils
from kitsune.kpi.models import (
SEARCH_CLICKS_METRIC_CODE,
SEARCH_SEARCHES_METRIC_CODE,
Metric,
MetricKind,
)
from kitsune.sumo ... | mozilla/kitsune | kitsune/kpi/management/commands/update_search_ctr_metric.py | update_search_ctr_metric.py | py | 2,127 | python | en | code | 1,209 | github-code | 71 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "django.conf.settings.STAGE",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 20,
"usage_type": "name"
... |
15139746914 | # -*- coding: utf-8 -*-
import collections
import json
import logging
import os
import pprint
import re
import time
from concurrent import futures
import click
#import grpc
import yaml
from nvidia_deepops import Progress, utils
from nvidia_deepops.docker import DockerClient, NGCRegistry, DGXRegistry
from . import r... | NVIDIA/ngc-container-replicator | replicator/ngc_replicator/ngc_replicator.py | ngc_replicator.py | py | 17,234 | python | en | code | 25 | github-code | 71 | [
{
"api_name": "nvidia_deepops.utils.get_logger",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "nvidia_deepops.utils",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "logging.INFO",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name":... |
41337285786 | from flask_app import app
from flask import render_template,redirect,request,session,flash
from flask_app.models import recipe, user
@app.route('/create/recipe')
def create_recipe():
if 'user_id' in session:
return render_template('createRecipe.html')
return redirect('/home')
@app.route('/... | Brian-Lester/Python | flask_mysql/belt_review/recipes/flask_app/controllers/recipe_controller.py | recipe_controller.py | py | 2,386 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "flask.session",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "flask.render_template",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.redirect",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask_app.app.route"... |
70347013990 | from flask import abort, jsonify
def gcd_euclides(a, b):
try:
conversionA = int(a)
conversionB = int(b)
except ValueError:
return abort(400, "Error! los valores deben ser enteros")
if type(conversionA) == int and type(conversionB) == int:
if conversionB == 0:
re... | franmassello/flaskTest | functions/gcd_euclides.py | gcd_euclides.py | py | 499 | python | es | code | 0 | github-code | 71 | [
{
"api_name": "flask.abort",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.abort",
"line_number": 16,
"usage_type": "call"
}
] |
16784862242 | import os
import numpy as np
from sklearn.neighbors import NearestNeighbors
import csv
class Searcher:
def __init__(self, index_path):
self.index_path = index_path
def search(self, query_features, neighbors):
results = {}
feature_list = []
img_ids_all = []
with open(s... | oskarcokl/CBIR-multiple | cnn/searcher.py | searcher.py | py | 978 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "csv.reader",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sklearn.neighbors.NearestNeighbors",
"line_number": 26,
"usage_type": "call"
}
] |
42072309458 | import numpy as np
import scipy.misc
from keras.models import model_from_json
from matplotlib import pyplot as plt
import os
import subprocess
import time
class CNN_Model:
'''Creates an instance of Convolution Neutral Network classification model'''
def __init__(self):
self.num_to_abc = {0: 'A', 1:'B', 2:'... | ashishbb/BaxterPlaysScrabble | Classification.py | Classification.py | py | 1,304 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "keras.models.model_from_json",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.transpose",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "scipy.misc.misc.imresize",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": ... |
73573785188 | import streamlit as st
import pandas as pd
import numpy as np
# import matplotlib.pyplot as plt
def showthis():
# Title
st.title("Exploring Streamlit Capabilities")
if not st.checkbox(":green[Go 2 next feature]",key='1'):
return
# Header
st.header("Text and Markdown")
if not st.check... | code4NN/streamlit-intro | Module 1/0_overview.py | 0_overview.py | py | 3,315 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "streamlit.title",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "streamlit.checkbox",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "streamlit.header",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "streamlit.checkbox... |
71273284069 | import yaml, random, time, os
import numpy as np
import pandas as pd
import torch
import torch.optim as optim
from dataloader import get_dataloader_bert
from transformers import BertForSequenceClassification, BertTokenizer, AdamW, get_linear_schedule_with_warmup
if torch.cuda.is_available():
torch.backends.... | Anjali-Poornima666/Funniess_Estimation_NLP | train_bert.py | train_bert.py | py | 6,720 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.backends",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "random.seed... |
41954056880 | from __future__ import annotations
import dataclasses
import gzip
import json
from dataclasses import dataclass
from datetime import date, datetime
from typing import (
Any,
Type,
TypeVar,
Union,
get_args,
get_origin,
get_type_hints,
)
T = TypeVar("T", bound="Deserializable")
@dataclass
... | Tuyixiang/WDK-Pro-League | backend/game_data/io.py | io.py | py | 4,284 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "typing.TypeVar",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "typing.Any",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "typing.get_origin",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "typing.Union",
"line_... |
40232976044 | from tkinter import *
import tkinter as tk
from tkinter import ttk
import doctors_page
import layout
from PIL import Image, ImageTk
from threading import Timer
class main_page_layout(layout.main_layout):
def __init__(self):
super().__init__()
self.top_mainpage_frame=Frame(self.top_overlay_frame, ... | karticksriram92/class_based | main_page.py | main_page.py | py | 5,610 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "layout.main_layout",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "doctors_page.show_top_frame",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "doctors_page.show_side_frame",
"line_number": 87,
"usage_type": "call"
},
{
"... |
11893107912 | #Klasa przechwouje wszystkie sloty i sygnały w aplikacji
#Moduły wbudowane
import os
from PyQt5.QtWidgets import *
from PyQt5 import *
import sys
from PyQt5.QtCore import pyqtSignal
from PyQt5.QtCore import QThread
#Moduły aplikacji
from forms import blank_window
#klasa odpowiadająca za główny ekran, czyli za forms... | imbirowycz/CarPi | classes/SlotsAndSignals.py | SlotsAndSignals.py | py | 37,022 | python | pl | code | 0 | github-code | 71 | [
{
"api_name": "forms.main_window.Ui_MainWindow",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "forms.main_window",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "os.system",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "form... |
12864961773 | import numpy as np
import cv2
import colorsys
# import copy
from help import NMS
def _create_unique_color_float(tag, hue_step=0.41):
h, v = (tag * hue_step) % 1, 1. - (int(tag * hue_step) % 4) / 5.
r, g, b = colorsys.hsv_to_rgb(h, 1., v)
return r, g, b
def _create_unique_color_uchar(tag, hu... | michelleweii/Natural-scene-text-detection | helper/post_processing.py | post_processing.py | py | 14,954 | python | en | code | 2 | github-code | 71 | [
{
"api_name": "colorsys.hsv_to_rgb",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.rectangle",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "cv2.boundingRect",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "cv2.boundingRect",... |
28358051747 | import sys
from tqdm import tqdm
import time
import wikipedia
def progress_bar(url, output_file):
# Writing the urk to the argument file
with open(output_file, 'a') as file:
file.write(url + "\n")
for _ in tqdm( range(100), desc="Extracting Url..."):
time.sleep(0.01)
def main():
term = sys.argv[1]
url = wi... | nit2rawidle/Wikisearch | wiki.py | wiki.py | py | 582 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "tqdm.tqdm",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "wikipedia.page",
"line_number"... |
752981319 | """
📌 Вспоминаем задачу 3 из прошлого семинара. Мы сформировали
текстовый файл с псевдо именами и произведением чисел.
📌 Напишите функцию, которая создаёт из созданного ранее
файла новый с данными в формате JSON.
📌 Имена пишите с большой буквы.
📌 Каждую пару сохраняйте с новой строки.
"""
_... | AnkaZatcepina/GB_Python_Homework | course_02_python_intermediate/lesson_08_serialization/task_1_txt_to_json.py | task_1_txt_to_json.py | py | 1,104 | python | ru | code | 0 | github-code | 71 | [
{
"api_name": "json.dump",
"line_number": 22,
"usage_type": "call"
}
] |
20817287724 | from flask import Flask, request, jsonify
from PIL import Image
from traceback import format_exc
from cv_utils import image_has_face
from flask_cors import cross_origin
app = Flask(__name__)
@app.post("/verify-presence")
@cross_origin()
def verify_presence():
try:
file = request.files.get('photo')
... | wallrony/reconhecimento-facial-web | server/server.py | server.py | py | 544 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.request.files.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.request.files",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "flask.req... |
12231929639 | import json
# Load the original JSON data from "pos_0.png.json"
with open('pos_0.png.json', 'r') as json_file:
original_data = json.load(json_file)
# Initialize dictionaries to store the formatted data
annotation_objects = {}
annotation_attributes = {}
# Loop through objects in the original data
for obj in origi... | Rifat429/assesment_quantigo.ai | formatter_script.py | formatter_script.py | py | 1,835 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "json.load",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 53,
"usage_type": "call"
}
] |
1664662578 | from django.conf.urls import url
from first_app import views
#for template tagging
app_name = 'first_app'
urlpatterns = [
url('^datab/$', views.dbdb, name = 'dbdb'),
url(r'^formpage/$', views.form_view, name = 'formm'),
url(r'^relative/$', views.relative, name = 'relative'),
url(r'^register/$', views.... | cHILlPill420/startingDjango | first_app/urls.py | urls.py | py | 581 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "first_app.views.dbdb",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "first_app.views",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.co... |
25572371316 | #db 처리 ,연결 , 해제 , 검색어 가져오기 , 데이터 삽 입
import pymysql as my
class DBHelper:
'''
멤버변수 : 커넥션
'''
conn = None
'''
생성자
'''
def __init__(self):
self.db_init()
'''
멤버함수
'''
def db_init(self):
self.conn = my.connect(
host='localhost',
... | anytime0222/py | DBManager.py | DBManager.py | py | 1,618 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "pymysql.connect",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pymysql.cursors",
"line_number": 25,
"usage_type": "attribute"
}
] |
10602139160 | import json
from hashlib import sha1
from io import StringIO
from dateutil.parser import parse as dateutil_parse
from django.conf import settings
from django.core.exceptions import ValidationError
from django.core.files.base import ContentFile
from django.core.files.storage import default_storage
from django.db.utils i... | omni5cience/HSReplay.net | hsreplaynet/games/processing.py | processing.py | py | 26,217 | python | en | code | null | github-code | 71 | [
{
"api_name": "hsreplaynet.utils.log.info",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "hsreplaynet.utils.log",
"line_number": 70,
"usage_type": "name"
},
{
"api_name": "hsreplay.document.HSReplayDocument.from_parser",
"line_number": 75,
"usage_type": "call"... |
23923027323 | import blenderbim.bim.helper
from bpy.types import Panel, UIList
from blenderbim.bim.ifc import IfcStore
from blenderbim.bim.module.resource.data import ResourceData
class BIM_PT_resources(Panel):
bl_label = "Resources"
bl_idname = "BIM_PT_resources"
bl_space_type = "PROPERTIES"
bl_region_type = "WIND... | IfcOpenShell/IfcOpenShell | src/blenderbim/blenderbim/bim/module/resource/ui.py | ui.py | py | 19,426 | python | en | code | 1,412 | github-code | 71 | [
{
"api_name": "bpy.types.Panel",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "blenderbim.bim.ifc.IfcStore.get_file",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "blenderbim.bim.ifc.IfcStore",
"line_number": 18,
"usage_type": "name"
},
{
"a... |
39390309335 | import math
from pyaudio import PyAudio
BITRATE = 8000 #number of frames per second
FREQUENCIES = {
"C4": 261.63, #C4 in Hz
"C#4": 277.18, #C sharp
"D4": 293.66,
"D#4": 311.13,
"E4": 329.63,
"F4": 349.23,
"F#4": 369.99,
"G4": 392.00,
"G#4": 415.30,
"A4": 440.00,
"A#... | snleo/py-music | play.py | play.py | py | 1,427 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "math.sin",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "math.pi",
"line_number": 52,
"usage_type": "attribute"
},
{
"api_name": "pyaudio.PyAudio",
"line_number": 54,
"usage_type": "call"
}
] |
74839456229 | import functools
import sys
import traceback
from contextlib import contextmanager
import pytest
from pytestqt.utils import get_marker
@contextmanager
def capture_exceptions():
"""
Context manager that captures exceptions that happen insides its context,
and returns them as a list of (type, value, traceb... | pytest-dev/pytest-qt | src/pytestqt/exceptions.py | exceptions.py | py | 3,265 | python | en | code | 366 | github-code | 71 | [
{
"api_name": "contextlib.contextmanager",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "sys.stderr.write",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "sys.stderr",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "sys.except... |
29996342536 | from datetime import datetime, time, timedelta
from dateutil.relativedelta import relativedelta
import pandas as pd
import os
import re
import pickle
import time
def calculate_best_side(row, side):
"""
Calculate best price and volume of specific side
row (series): bid or offer series
side (str): side ... | Computational-Finance-Laboratory/An-Adaptive-Order-Execution-for-VWAP-tracking | Backend/utils/DataProcessor.py | DataProcessor.py | py | 10,845 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "dateutil.relativedelta.relativedelta",
"line_number": 120,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 244,
"usage_type": "call"
},
{
"api_name": "time.strftime",
"line_number": 278,
"usage_type": "call"
},
{
"api_name... |
21057884015 | from django.urls import path
from . import views
urlpatterns = [
path('payment-details/',views.PaymentList,name='payment-details'),
path('payment-details/<int:pk>/',views.PaymentDetail,name='payment-detail'),
path('add-payment/',views.addPayment,name='add-payment'),
path('delete-payment/<int:pk>/',view... | Mohana-20112000/OnlineBusBooking | OnlinebusBooking/PaymentDetails/urls.py | urls.py | py | 362 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
15099862285 | # -*- coding: utf-8 -*-
# Created by iFantastic on 2019/3-教程/18
# 创建一个日志器logger并设置其日志级别为DEBUG
import logging
logging = logging.getLogger('simple_logger')
logging.setLevel(logging.DEBUG)
# 创建一个流处理器handler并设置其日志级别为DEBUG
handler = logging.StreamHandler(sys.stdout)
handler.setLevle(logging.DEBUG)
# 创建一个格式器form... | guozeping/Learn-Python | 2-进阶/日志/应用/使用python实现日志.py | 使用python实现日志.py | py | 480 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "logging.getLogger",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "logging.setLevel",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "logging.StreamHand... |
11764886281 | from datetime import date
from calendar import monthrange
from re import search
from glob import glob
from os import remove
from os import path as osPath
class dateCheckUtil:
def __init__(self, today_date=date.today(), last_n = 5):
self.today_date = today_date
self.last_n = last_n
def is_satur... | b-thebest/python-data-backup-task | filter_backup.py | filter_backup.py | py | 2,278 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "datetime.date.today",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "datetime.date.weekday",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.date",... |
31270805266 | import itertools
import os.path as osp
from typing import Optional, Sequence, Union
import gin
import jax
import numpy as np
from absl import logging
from dycheck.utils import common, image, io, struct, types
from . import base
from .functional import get_prender_image
@gin.configurable(denylist=["engine"])
class ... | KAIR-BAIR/dycheck | dycheck/core/tasks/cross_view.py | cross_view.py | py | 4,817 | python | en | code | 154 | github-code | 71 | [
{
"api_name": "dycheck.utils.types.EngineType",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "dycheck.utils.types",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "... |
15147615260 | import sys
sys.path.insert(1,'../src')
import os
import gzip
import numpy as np
import random
import cv2
from PIL import Image
from numpy import asarray
from numpy.random import RandomState
#
# image = np.array(Image.open('true.png'))
# image = Image.fromarray(image)
# image.show() # before rotation
# image = image.r... | KEHUIYAO/physics_motion_net | MovingMnistPlus_imputation/moving_mnist.py | moving_mnist.py | py | 7,392 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "sys.path.insert",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.RandomState",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "numpy.random.Ran... |
44239499707 | import math
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
def exponential_smoothing(alpha, s):
s2 = np.zeros(s.shape)
s2[0] = s[0]
for i in range(1, len(s2)):
s2[i] = alpha*s[i]+(1-alpha)*s2[i-1]
return s2
def es(list_actual_value):
alpha = .70
actual_value_... | gavin-kang/AiPlatform | statistical_analysis/exponential_smoothing.py | exponential_smoothing.py | py | 1,753 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "numpy.zeros",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"li... |
26917691343 | import os
import requests
import re
import yaml
import json
import time
import random
import uuid
def is_file(path):
return os.path.isfile(path)
def load_config_yaml(path='config/config.yaml', mode='WAI', err=True):
if not is_file(path):
if err:
raise Exception(f'{path}文件不存在')
r... | pscly/myend | flask_s/utils/core.py | core.py | py | 3,570 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "os.path.isfile",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "yaml.safe_load",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_numb... |
23927481963 | import pytest
import test.bootstrap
import ifcopenshell.api
import ifcopenshell.util.brick as subject
class TestGetBrickTypeIFC4(test.bootstrap.IFC4):
def test_run(self):
element = self.file.createIfcAirTerminalBox()
assert subject.get_brick_type(element) == "https://brickschema.org/schema/Brick#T... | IfcOpenShell/IfcOpenShell | src/ifcopenshell-python/test/util/test_brick.py | test_brick.py | py | 1,127 | python | en | code | 1,412 | github-code | 71 | [
{
"api_name": "test.bootstrap.bootstrap",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "test.bootstrap",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "ifcopenshell.util.brick.get_brick_type",
"line_number": 10,
"usage_type": "call"
},
{
... |
72763812711 | """ General utilities. """
import os
import shutil
import torch
import random
import torch.nn.init as init
import warnings
import torch.backends.cudnn as cudnn
def init_weights(m, init_type='normal', gain=0.02):
""" Randomly initialize a module's weights.
Args:
m (nn.Module): The module to initializ... | doulujiyao/dafc | utils/utils.py | utils.py | py | 6,433 | python | en | code | 7 | github-code | 71 | [
{
"api_name": "torch.nn.init.normal_",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "torch.nn.init",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "torch.nn.init.xavier_normal_",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "torc... |
6811399319 | import pygame
import sys
import pygame.font
# Adam.z et Rawad
# Initialisation de Pygame
pygame.init()
# Définition de la taille de la fenêtre
largeur, hauteur = 800, 600
fenetre = pygame.display.set_mode((largeur, hauteur))
pygame.display.set_caption("Jeu du Labyrinthe")
# Définition des couleurs
rouge = (255, 0, 0)... | AdamZouhairii/jeu-du-lab | jeux_du_labyrinthe.py | jeux_du_labyrinthe.py | py | 8,282 | python | fr | code | 0 | github-code | 71 | [
{
"api_name": "pygame.init",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pygame.display... |
72768372071 | import datetime
import numpy as np
import pkg_resources
import pandas as pd
from .base import BaseConnection, BaseReader
from tensorflow.keras.callbacks import Callback
class ExperimentNamer:
'''Class methods for naming experiments.'''
def __init__(self):
'''Get a list of experiment names.'''
... | beeCwright/ml_experiments | src/ml_experiments/manager.py | manager.py | py | 4,565 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "pkg_resources.resource_filename",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.random.choice",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "n... |
22645226211 | import xml.etree.ElementTree as ET
import os
import shutil
import xmltodict
from zipfile import ZipFile
import tableau_utilities.tableau_file.tableau_file_objects as tfo
from tableau_utilities.general.funcs import transform_tableau_object
class TableauFileError(Exception):
""" A minimum viable exception. """
... | hoverinc/tableau-utilities | tableau_utilities/tableau_file/tableau_file.py | tableau_file.py | py | 14,545 | python | en | code | 4 | github-code | 71 | [
{
"api_name": "os.path.abspath",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numb... |
41685048993 | import os
import pprint
import shlex
import subprocess
from collections import OrderedDict
from contextlib import contextmanager
from ruamel.yaml import YAML
from cookiecutter.utils import rmtree
yaml = YAML()
dir_path = os.path.dirname(os.path.realpath(__file__))
travis_config_samples_path = os.path.join(dir_path, "... | romnn/cookiecutter-go | tests/test_fix_travis_token.py | test_fix_travis_token.py | py | 7,318 | python | en | code | 4 | github-code | 71 | [
{
"api_name": "ruamel.yaml.YAML",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
... |
9921846410 | """
Utilities for creating built-in modules
"""
from dataclasses import field, dataclass
from immutables import Map
from typing import Callable, NoReturn, Optional, Sequence, TypeVar, Dict, Union
from . import vm_utils
from . import parser
from .types import Code, CodeFlags, Instruction, Scope, Stack, State, Value, N... | gurkult/py-gurklang | gurklang/builtin_utils.py | builtin_utils.py | py | 4,647 | python | en | code | 8 | github-code | 71 | [
{
"api_name": "typing.TypeVar",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "types.Stack",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "types.Stack",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.Callable",
"line_nu... |
28682091833 | import os
import json
import requests
# load the API token
API_TOKEN = os.getenv('RW_API_KEY')
# input dataset API ID of which you want to edit widget
dataset_id = ''
# the headers for all requests in this script
headers = {'Authorization': 'Bearer ' + API_TOKEN, 'Content-Type': 'application/json'}
# input the AP... | resource-watch/data-team-tools | advanced_widget_writer/advanced_chart_widget_edit.py | advanced_chart_widget_edit.py | py | 886 | python | en | code | 2 | github-code | 71 | [
{
"api_name": "os.getenv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "requests.patch",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 27,
"usage_type": "call"
}
] |
30918240511 | import numpy as np
import cv2
YOLO_input_size = 448
classes = ["aeroplane", "bicycle", "bird", "boat", "bottle", "bus", "car", "cat", "chair",
"cow", "diningtable", "dog", "horse", "motorbike", "person", "pottedplant",
"sheep", "sofa", "train","tvmonitor"]
class Box:
... | Ao-Lee/Vehicle-Verification | AlignDataBase/align/base/detect.py | detect.py | py | 8,547 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "numpy.zeros",
"line_number": 102,
"usage_type": "call"
},
{
"api_name": "numpy.abs",
"line_number": 126,
"usage_type": "call"
},
{
"api_name": "numpy.abs",
"line_number": 127,
"usage_type": "call"
},
{
"api_name": "numpy.abs",
"line_number": 161... |
41276948907 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author(s):
# Christian Kliche <chk@ebp.de>
# Panu Lahtinen <panu.lahtinen@fmi.fi>
# 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 ve... | khunger/dwd_extensions | dwd_extensions/tools/dataset_processors.py | dataset_processors.py | py | 6,295 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "logging.getLogger",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "urlparse.urlparse",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "mpop.projector.get_area_def",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "datet... |
34969278289 | """
MGF is a simple human-readable format for MS/MS data. It
allows storing MS/MS peak lists and exprimental parameters.
This module provides :class:`MGFLoader`, a :class:`~.RandomAccessScanSource`
implementation.
The parser is based on :mod:`pyteomics.mgf`.
"""
import os
from pyteomics import mgf
from pyteomics.aux... | mobiusklein/ms_deisotope | src/ms_deisotope/data_source/mgf.py | mgf.py | py | 17,046 | python | en | code | 24 | github-code | 71 | [
{
"api_name": "pyteomics.mgf.IndexedMGF",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "pyteomics.mgf",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "scan.ScanFileMetadataBase",
"line_number": 49,
"usage_type": "name"
},
{
"api_name": ... |
11912855201 | from django.core.management import BaseCommand
from catalog.models import Category, Product
class Command(BaseCommand):
def handle(self, *args, **options):
category_list = [
{'name': 'auto', 'description': 'vehicle'},
{'name': 'food', 'description': 'essen'}
]
cate... | AliakseiMatsiuk/19.2_Django | catalog/management/commands/fill.py | fill.py | py | 1,100 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "django.core.management.BaseCommand",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "catalog.models.Category",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "catalog.models.Category.objects.bulk_create",
"line_number": 17,
"usage_type": ... |
38608635873 | import sys
import pathlib
import moviepy.editor as mpy
#Initialize fade in and out lengths in seconds. Adjust these to preference.
fadein_dur = 2
fadeout_dur = 2
# grab and initialize the argument directories
first_arg = sys.argv[1]
second_arg = sys.argv[2]
third_arg = sys.argv[3]
music_dir = pathlib.Path(first_arg)... | jeffanberg/AVMerger | av_merger.py | av_merger.py | py | 1,631 | python | en | code | 2 | github-code | 71 | [
{
"api_name": "sys.argv",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_nu... |
29828776966 | from typing import Iterable, Any, Optional
__all__ = ("get",)
def get(iterable: Iterable[Any], **kwargs) -> Optional[Any]:
"""
Returns the first object that matches the kwargs arguments.
Used in caching.
:param Iterable iterable: The iterable.
:param kwargs: The key arguments.
:return: The ... | adam757521/ksp.py | ksp/utils.py | utils.py | py | 543 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "typing.Iterable",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 7,
"usage_type": "name"
}
] |
33072478494 | # run-demo.py
# simple example of gst-switch python api
# pass the path to the binaries:
#
import argparse
import time
import subprocess
from gstswitch.helpers import PreviewSinks
from gstswitch.server import Server
from gstswitch.helpers import TestSources
def wait(secs):
print("sleeping {} secconds...".form... | KKcorps/Gst-Files | run-demo/run-demo.py | run-demo.py | py | 1,288 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "time.sleep",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "gstswitch.server.Server",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "gstswitch.helpers.TestSources",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "subp... |
9661462483 | from pyrogram import Client, Filters, InlineKeyboardMarkup, InlineKeyboardButton
from ..config import Config
from ..screenshotbot import ScreenShotBot
UPDATES_CHANNEL = 'MediQBank'
from pyrogram.errors.exceptions.bad_request_400 import UserNotParticipant, UsernameNotOccupied, ChatAdminRequired, PeerIdInvalid
@Screen... | buidanhbinh/Screenshot-Bot | bot/plugins/start.py | start.py | py | 2,769 | python | en | code | null | github-code | 71 | [
{
"api_name": "pyrogram.errors.exceptions.bad_request_400.UserNotParticipant",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "pyrogram.InlineKeyboardMarkup",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pyrogram.InlineKeyboardButton",
"line_number": 32... |
11313227207 | import abc
import argparse
import os
from typing import Any, Union
class BaseOptions(abc.ABC):
def __init__(self):
"""Instanciate a BaseOptions object by reading and parsing programm parameters
"""
self.parser = argparse.ArgumentParser()
self.read_parameters()
self.gather_... | Juanki0396/TFG | src/options/base_options.py | base_options.py | py | 3,394 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "abc.ABC",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "typing.Any",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
... |
33886079755 | from collections import defaultdict
from odoo import models
class EventRegistration(models.Model):
_inherit = 'event.registration'
def _get_lead_grouping(self, rules, rule_to_new_regs):
""" Override to support sale-order based grouping and update.
When checking for groups for rules, we sear... | odoo/odoo | addons/event_crm_sale/models/event_registration.py | event_registration.py | py | 2,265 | python | en | code | 31,745 | github-code | 71 | [
{
"api_name": "odoo.models.Model",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "odoo.models",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "collections.defaultdict",
"line_number": 33,
"usage_type": "call"
}
] |
34097172312 | from shapely import Polygon
import trimesh
pts = ((100, 100), (400, 100), (400, 400), (100, 400))
hole = ((150, 150), (350, 150), (350, 350), (150, 350))
p = Polygon(pts, [hole])
mesh = trimesh.creation.extrude_polygon(p, 100)
#mesh = trimesh.primitives.Extrusion(p, height=100)
other = mesh.copy()
other.apply_translat... | villares/sketch-a-day | 2023/sketch_2023_02_18/sketch_2023_02_18.py | sketch_2023_02_18.py | py | 1,206 | python | en | code | 193 | github-code | 71 | [
{
"api_name": "shapely.Polygon",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "trimesh.creation.extrude_polygon",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "trimesh.creation",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "p... |
20830907194 | from uuid import UUID
from typing import List, Optional
from app.models import ContactPerson, Organization
from app.schemas.contact_person import ContactPersonCreate, ContactPersonUpdate
from fastapi.encoders import jsonable_encoder
from sqlalchemy import and_, select
from sqlalchemy.ext.asyncio import AsyncSession
... | wallseat/MIREA_data-manipulation-software | practice7-8/app/crud/contact_person.py | contact_person.py | py | 3,167 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "sqlalchemy.ext.asyncio.AsyncSession",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "app.models.Organization",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.select",
"line_number": 21,
"usage_type": "call"
},
{
"api... |
40702978315 | from torch.optim import lr_scheduler
import torch.nn.init as init
import math
def get_scheduler(optimizer, hyperparameters, iterations=-1):
if 'lr_policy' not in hyperparameters or hyperparameters['lr_policy'] == 'constant':
scheduler = None # constant scheduler
elif hyperparameters['lr_policy'] == 's... | mengweiren/q-space-conditioned-dwi-synthesis | utils/torchutils.py | torchutils.py | py | 1,615 | python | en | code | 11 | github-code | 71 | [
{
"api_name": "torch.optim.lr_scheduler.StepLR",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torch.optim.lr_scheduler",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "torch.nn.init.normal_",
"line_number": 23,
"usage_type": "call"
},
{
"ap... |
26765025675 | import pygame, json
from catan import NUMBER_FONT, BLACK
import pygame
import json
class Timer:
"""
A Timer class to keep track of time and display it on a screen.
Args:
screen (Surface): The surface to render the time on.
Attributes:
screen (Surface): The surface to render the tim... | rashidalmarri21/Catan-Group-38 | catan/timer.py | timer.py | py | 3,025 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "catan.NUMBER_FONT.render",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "catan.BLACK",
"line_number": 75,
"usage_type": "argument"
},
{
"api_name": "catan.NUMBER_FONT",
"line_number": 75,
"usage_type": "name"
},
{
"api_name": "json.dump"... |
19419631066 | """Файл содержит класс DataBaseInterface который объединяет методы для работы с базой данных"""
import json
import sqlite3
from datetime import datetime
from const import DB_NAME
class DataBaseInterface:
"""
Класс для работы с базой данных.
"""
def __init__(self):
"""
1. Создаётся с... | dim272/gen_docs | database.py | database.py | py | 7,552 | python | ru | code | 0 | github-code | 71 | [
{
"api_name": "sqlite3.connect",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "const.DB_NAME",
"line_number": 20,
"usage_type": "argument"
},
{
"api_name": "datetime.datetime.now",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "datetime.date... |
435547775 | #!/usr/bin/env python3
import os
import re
import time
import pytest
import shutil
import hashlib
import platform
from pathlib import Path
import threading
import subprocess
import random
import string
import tempfile
from refuse.high import fuse_exit
import autoortho_fuse
import aostats
from aoconfig import CFG
im... | 206airmail/autoortho | autoortho/test_autoortho.py | test_autoortho.py | py | 8,551 | python | en | code | null | github-code | 71 | [
{
"api_name": "logging.getLogger",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "autoortho_fuse.AutoOrtho",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "autoorth... |
9600227319 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Generated by Django 1.11.7 on 2017-12-06 20:27
from django.db import migrations, models
class Migration(migrations... | mozilla-services/tecken | tecken/download/migrations/0004_auto_20171206_2027.py | 0004_auto_20171206_2027.py | py | 783 | python | en | code | 27 | github-code | 71 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AlterField",
"line_number": 16,
"usage_type": "call"
},
... |
12015693809 | import traceback
import sys
import time
import os.path
sys.path.append('../PTTCrawlerLibrary')
import PTT
import MagicianTerminatorCondition
import json
from time import gmtime, strftime
print('Magician Terminator')
Board = 'Wanted'
Retry = True
# If you want to automatically login define Account.txt
# {'ID':'YourID',... | Truth1987/MagicianTerminator | MagicianTerminator.py | MagicianTerminator.py | py | 7,515 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "sys.path.append",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "time.strftime",
"line_numbe... |
24584721593 | import collections
class Solution:
def minDeletions(self, s: str) -> int:
letter_count = collections.Counter(s)
used = set()
res = 0
for letter, freq in letter_count.items():
while freq > 0 and freq in used:
freq -= 1
res += 1
... | brandoneng000/LeetCode | medium/1647.py | 1647.py | py | 1,716 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "collections.Counter",
"line_number": 5,
"usage_type": "call"
}
] |
6721930007 | from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label
from kivy.properties import ObjectProperty
from kivy.uix.popup import Popup
from kivy.uix.floatlayout import FloatLayout
import time
array = [-1]*9
print(array[1])
symbol = 'x'
def change():
global symbol
if s... | rs221b/kivy-tic-tac-toe | main.py | main.py | py | 2,534 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "kivy.uix.popup.Popup",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "kivy.uix.label.Label",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "kivy.uix.gridlayout.GridLayout",
"line_number": 66,
"usage_type": "name"
},
{
"api_name... |
5376034237 | # -*- coding: utf-8 -*-
"""
Collection of the core functions needed to communicate with the geoserver.
The geoserver is operated by the Deutscher Wetterdienst (DWD).
https://maps.dwd.de
"""
import urllib.parse
import requests
DEFAULT_WFS_VERSION = "2.0.0"
DEFAULT_WFS_REQUEST = "GetFeature"
DEFAULT_WFS_OUTPUTFORMA... | stephan192/dwdwfsapi | dwdwfsapi/core.py | core.py | py | 1,557 | python | en | code | 5 | github-code | 71 | [
{
"api_name": "urllib.parse.parse.quote",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "urllib.parse.parse",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "urllib.parse",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "request... |
4181910868 | import json
from flask import (Flask, redirect, url_for,
request, session, render_template)
from requests_oauthlib import OAuth2Session
import requests
from urllib import parse
from datetime import datetime
import configuration as cfg
import utils
app = Flask(__name__)
app.secret_key = "keep this secret"
@app.... | wgong/py4kids | lesson-65-auth/oauth2/globus/oauth2_login.py | oauth2_login.py | py | 2,797 | python | en | code | 17 | github-code | 71 | [
{
"api_name": "flask.Flask",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests_oauthlib.OAuth2Session",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "configuration.CONFIG",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": ... |
24320940277 | #! /usr/bin/env python3
import subprocess
import time
from datetime import datetime, timedelta
from itertools import product
def docker_compose(name, *args):
cmd = ["docker-compose", "-f", f"cfg/{name}.yml", "--project-directory", "."]
cmd.extend(args)
print(cmd)
return cmd
def benchmark(num, name):... | ratorx/continuity | benchmark/benchmark.py | benchmark.py | py | 2,613 | python | en | code | 2 | github-code | 71 | [
{
"api_name": "subprocess.check_call",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "subprocess.check_call",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "dat... |
1447265030 | from rest_framework import serializers
from .models import User
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = User
fields = ('pk', 'username', 'profile_pic', 'first_name',
'last_name',
'bio',
'course',
... | patricechaula/infomate-backend | users/serializers.py | serializers.py | py | 406 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "models.User",
"line_number": 6,
"usage_type": "name"
}
] |
809471412 | import datetime
from django.contrib.auth.models import Group
from django.db.models import Q, Sum, Count
from common.commands import ExportCommand
from orders.models import Order
from users.models import User
class Command(ExportCommand):
help = "Saves buyers in csv format for shopify import"
def get_querys... | stanwood/traidoo-api | users/management/commands/export_buyers.py | export_buyers.py | py | 2,221 | python | en | code | 3 | github-code | 71 | [
{
"api_name": "common.commands.ExportCommand",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.db.models.Q",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "orders.models.Order.STATUSES.get_value",
"line_number": 15,
"usage_type": "call"
},
... |
70613863270 | # -*- coding: utf-8 -*-
import logging
import random
from base import RemoteBot
from engine.game_types import GameGetInfo
logger = logging.getLogger(__name__)
class RemotePlayersBot(RemoteBot):
def __init__(self, game):
super(RemotePlayersBot, self).__init__(game)
self.remote_scenary = self.ge... | Cheater-84/ZOMBIE-FARMER | remote/players.py | players.py | py | 4,561 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "base.RemoteBot",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "engine.game_types.GameGetInfo",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "random.... |
2424472088 | import os
import logging
import tempfile
import subprocess
from vbdiar.kaldi import nnet3bin_path
from vbdiar.kaldi.utils import write_txt_matrix, read_txt_vectors
logger = logging.getLogger(__name__)
class KaldiXVectorExtraction(object):
def __init__(self, nnet, binary_path=nnet3bin_path, use_gpu=False,
... | Jamiroquai88/VBDiarization | vbdiar/kaldi/kaldi_xvector_extraction.py | kaldi_xvector_extraction.py | py | 3,217 | python | en | code | 94 | github-code | 71 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "vbdiar.kaldi.nnet3bin_path",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
12235518012 | import pandas as pd
import numpy as np
from configs import *
import matplotlib.pyplot as plt
# Make numpy easier to read
np.set_printoptions(precision=3, suppress=True)
import tensorflow as tf
from tensorflow.keras import layers
def load_data(filepath: str, num_labels: int) -> (np.array, np.array):
'''
Load... | domstonehill/fmnist_practice | fmnist.py | fmnist.py | py | 3,340 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "numpy.set_printoptions",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "tensorflow.one_hot"... |
41475602806 | """Calculate time mean statistics using data_analysis.TimeDomStats."""
import iris
import iris.quickplot as qplt
import matplotlib.pyplot as plt
import data_analysis as da
BASEDIR='/gpfs/afm/matthews/data/'
#VAR_NAME='vwnd'; LEVEL=850; SOURCE='erainterim_plev_6h'#; TDOMAINID='jan7912'
VAR_NAME='swpd'; LEVEL='all'; ... | adrianjmatthews/python-iris | mean.py | mean.py | py | 1,228 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "data_analysis.TimeDomStats",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "iris.quickplot.plot",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "iris.quickplot",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "matplot... |
23487096585 | #!/usr/bin/env python
# coding: utf-8
import pandas as pd
import numpy as np
import pickle
import matplotlib.pyplot as plt
import pyreadstat
import statsmodels.formula.api as smf
from sklearn.metrics import roc_auc_score, roc_curve
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import classif... | kagocchi28/ANN-code-for-NEDS-syncope-2022 | Emergency_model.py | Emergency_model.py | py | 11,386 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "tensorflow.__version__",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "pandas.__version__",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "numpy.__version__",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_na... |
26871501352 |
from rest_framework import generics
from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework import status
from .tools import mysmtp
from .models import Producto
from drf_yasg.utils import swagger_auto_schema
from drf_yasg import openapi
from django.shortcuts impo... | jescolabcn/iati | productos/views.py | views.py | py | 8,271 | python | es | code | 0 | github-code | 71 | [
{
"api_name": "rest_framework.generics.ListAPIView",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.generics",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "models.Producto.objects.filter",
"line_number": 26,
"usage_type": "call"... |
15928995607 | import logging
import sys
from migen.build.xilinx.programmer import XC3SProg
import ledblaster
from ledblaster.gateware.platforms.rv901t import Platform, hub75e
from ledblaster.gateware.targets.rv901t import Target
logger = logging.getLogger(__name__)
class ANSIColorFormatter(logging.Formatter):
LOG_COLORS = ... | q3k/ledblaster | ledblaster/cli.py | cli.py | py | 1,472 | python | en | code | 3 | github-code | 71 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.Formatter",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "logging.StreamHandler",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "sys.st... |
7071344866 | from pynput.keyboard import Listener , Key
import logging
path = "C:\\Users\\User\\Desktop\\keylogger"
logging.basicConfig(filename=(f"{path}\\logfile.txt"), \
level= logging.DEBUG , format= '%(asctime)s : %(message)s')
def keypress(Key):
logging.info(str(Key))
with Listener(on_pres... | ethicalpanther26/Keylogger | klogger.py | klogger.py | py | 367 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "logging.basicConfig",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "logging.info",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pynput.keyboard.Key"... |
6267190894 | # -*- coding: utf-8 -*-
"""
Created on Mon Apr 27 10:13:06 2020
@author: pisnm
"""
from datetime import datetime
import json as json
from tools_param import *
# =============================================================================
#
# ================================================================... | sillyTig3r94/Tokyo | tool_analysis.py | tool_analysis.py | py | 7,135 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "datetime.datetime.now",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "datetim... |
70657638950 | # -*- coding: utf-8 -*-
import logging
'''
教程:
http://www.jianshu.com/p/feb86c06c4f4
http://python.jobbole.com/81666/
日志级别:DEBUG, INFO, WARNING, ERROR, CRITICAL
几个比较重要的概念: Logger, Handler, Formatter, Filter
Logger 记录器, 保留了应用程序代码能直接使用的借口
Handler 处理器, 将(记录器产生的)日志记录发送至合适的目的地
Filter 过滤器,提供了更好的粒度控制,它可以决定输出哪些日志记录
Formatt... | enzocxt/snippets | python/python_log.py | python_log.py | py | 5,747 | python | zh | code | 0 | github-code | 71 | [
{
"api_name": "logging.getLogger",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "logging.ERROR",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "logging.basicConfig",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "logging.DEBU... |
22606735090 | from confluent_kafka import Consumer, KafkaException, Producer, KafkaError
import json
import threading
import time
KAFKA_BROKER_URL = 'localhost:9092'
KAFKA_TOPIC = 'sms-messages'
STATUS_TOPIC = 'sender-status-updates'
GROUP_ID = 'sms-sender-group'
class Sender(threading.Thread):
def __init__(self, sender_id, e... | Leelakrishna2091997/Emergency-Message-Service-Kafka | MessageProducer/sender.py | sender.py | py | 2,883 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "threading.Thread",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "confluent_kafka.Consumer",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "confluent_kafka.Producer",
"line_number": 21,
"usage_type": "call"
},
{
"api_name"... |
23347095625 | # Coding utf-8
import secrets
import random
from random import shuffle
from os import system, name
from threading import Thread
import keyword
import time
import os
# Defaults
Player = 1
war_one = {}
war_two = {}
wincards_one = []
wincards_two = []
player1list = []
player2list = []
faceCards = {
"""
.------.
|A.--. ... | luissalamanca/warcardgame | warcards.py | warcards.py | py | 20,768 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "random.shuffle",
"line_number": 149,
"usage_type": "call"
},
{
"api_name": "random.sample",
"line_number": 298,
"usage_type": "call"
},
{
"api_name": "random.sample",
"line_number": 306,
"usage_type": "call"
},
{
"api_name": "random.sample",
"li... |
3924964763 | # Problem A from https://egr.vcu.edu/media/engineering/documents/cs/VCU_HSContest_2016_Problems.pdf
import sys
from typing import TextIO
def fast_distance(list1: list[int], list2: list[int], dimensions) -> int:
# Computes a number that can be used when needed to check if distances are larger or smaller but withou... | Sheel2007/Programming-Contest | alexfProblems/VCU/2016/my_solutions/solution2016a.py | solution2016a.py | py | 1,610 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "typing.TextIO",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "sys.stdin",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "sys.stdout",
"line_number": 40,
"usage_type": "attribute"
}
] |
7368877518 | #!/usr/bin/env python3
import matplotlib.pyplot as plt
import numpy as np
def sigmoid(values):
return 1.0 / (1.0 + np.exp(-values))
skills = np.linspace(-3.0, 3.0, num=10001)
skills = 0.5 * (skills[1:] + skills[:-1])
difficulties = skills
probabilities = sigmoid(skills[:, None] - difficulties[None, :])
corre... | demmerichs/CodeJamTemplate | examples/2021/Qualification/E/generate_difficulty_function.py | generate_difficulty_function.py | py | 675 | python | en | code | 9 | github-code | 71 | [
{
"api_name": "numpy.exp",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.random.rand",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_nu... |
34723003404 | import logging
import os
import os.path
import time
import numpy as np
from PyQt4 import QtCore, QtGui
import tulpenmanie.exchange
logger = logging.getLogger(__name__)
class DepthProxy(QtCore.QObject):
refreshed_signal = QtCore.pyqtSignal(np.ndarray)
def __init__(self, market_uuid, exchange_name,
... | woeisme/tulpenmanie | tulpenmanie/data/depth.py | depth.py | py | 3,097 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "PyQt4.QtCore.QObject",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "PyQt4.QtCore",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "PyQt4.QtCore... |
21305493133 | import requests, json
import re
def _GET_HEADERS_FROM_TOKEN(token):
headers = {
"Authorization": "Bearer " + token,
"Content-Type": "application/json",
"Notion-Version": "2021-05-13"
}
return headers
def _GET_FIRST_MATCH(pattern, string):
pattern = re.compile(... | rysabh/easy-notion-py | previous files/notion_api 3.py | notion_api 3.py | py | 6,887 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "re.compile",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 52,
... |
34941286144 | # -*- coding: utf-8 -*-
import base64
SCRIPT_SETS = {
"search_host_files": "config_query/job_scripts/search_host_files",
"backup_host_files": "config_query/job_scripts/backup_host_files",
}
def get_script_base64(script_name, params=""):
"""
获取对应脚本的base64编码
"""
with open(SCRIPT_SETS[script_nam... | wheel-w/bk-conf-query | config_query/job_scripts/base.py | base.py | py | 552 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "base64.b64encode",
"line_number": 17,
"usage_type": "call"
}
] |
33026124512 | from webcamsettings import WebCamSettings
import pyvirtualcam
import cv2 as cv2
import threading
class VirtualWebcam():
def __init__(self, webCamSettings: WebCamSettings):
self.__webCamSettings = webCamSettings
self.__cam = None
self.__stopAllThreads = False
self.__webcamThread = ... | banujan59/VirtualWebcam | virtualwebcam.py | virtualwebcam.py | py | 2,893 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "webcamsettings.WebCamSettings",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "threading.Thread",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "cv2.CA... |
27031058792 | import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import argparse
import os
import joblib
parser = argparse.ArgumentParser()
parser.add_argument("--imgst_dir",default='mimgst',type=str)
parser.add_argument("--dataset",default='voc',choices=['voc','coco','kitti'],type=str,help=... | inspire-group/DetectorGuard | misc/plot_clean.py | plot_clean.py | py | 5,189 | python | en | code | 13 | github-code | 71 | [
{
"api_name": "matplotlib.use",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.rc",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path.join",
... |
31392191609 | from tfc import utfc
from tfc.utils import TFCDictRobust, egrad, NllsClass, MakePlot
import numpy as onp
import jax.numpy as np
from jax import vmap, jacfwd, jit, lax
import tqdm
import pickle
from scipy.optimize import fsolve
from time import process_time as timer
## TEST PARAMETERS: ******************************... | leakec/tfc | examples/Hunter_Johnston_Dissertation/Chapter_6/Example_6_2/Spec_EOL.py | Spec_EOL.py | py | 3,789 | python | en | code | 26 | github-code | 71 | [
{
"api_name": "jax.numpy.finfo",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "jax.numpy",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "tfc.utfc",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "tfc.utfc",
"line_number": 32,
... |
29661394592 | import PyPDF2
import sys
pdf = 'Lecture_Schedule2.pdf'
sys.stdout = open('output.txt','wt')
pFObject = open(pdf, 'rb')
pdfR = PyPDF2.PdfFileReader(pFObject)
c = pdfR.numPages
for i in range(c):
page = pdfR.getPage(i)
print(page.extractText())
| rangaran/AutoPlanner | hackathon/pdftextconverter.py | pdftextconverter.py | py | 261 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "sys.stdout",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "PyPDF2.PdfFileReader",
"line_number": 6,
"usage_type": "call"
}
] |
27449227264 | import argparse
import os
from tqdm import tqdm
import pickle
import time
from utils import build_graph, Data, split_validation
from model import *
def seed_everything(seed):
torch.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
torch.backends.cudnn.deterministic = True
torch.backends.cudnn.benchmar... | iamjiang/sequence-based-recommendation | TAGNN/main.py | main.py | py | 7,820 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "os.environ",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_... |
71912011750 | import re
import sys
import time
from Bio import SeqIO
import os
import argparse
#This script takes a bed file with cds information and creates a bed file with only cds regions
# Use this to get CDS sequence using bedtools getfasta
ap = argparse.ArgumentParser(description='This script takes a bed file with cds info... | GenomeRIK/tama | tama_go/orf_nmd_predictions/tama_bed_extract_cds.py | tama_bed_extract_cds.py | py | 10,196 | python | en | code | 107 | github-code | 71 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 168,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 189,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_numb... |
11490498393 | import uvicorn
from fastapi import FastAPI
from starlette.middleware.cors import CORSMiddleware
import config
from routes import auth, student, attendance
app = FastAPI()
origins = ['http://localhost:3000', 'http://192.168.178.23:3000'] # add your front-end ip:port here
app.add_middleware(
CORSMiddleware,
... | dilshankarunarathne/automated-attendance-marking-system-backend | main.py | main.py | py | 717 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "starlette.middleware.cors.CORSMiddleware",
"line_number": 13,
"usage_type": "argument"
},
{
"api_name": "routes.auth.router",
"line_number": 20,
"usage_type": "attribute"
},
{
... |
22438257696 | import numpy as np
from scipy.signal import savgol_filter
if __name__ == '__main__':
import sys
from os import path
sys.path.append( path.dirname(path.dirname( path.abspath(__file__) ) ))
from lib.OpenChromFile import FileOpenClass
from lib.Smoother import Moving_average, data_Bunching
from lib import Air... | pangws1211/ChromatographAPI | lib/ChromAPI.py | ChromAPI.py | py | 7,091 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "sys.path.append",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
70623422950 | import requests
import json
from flask import Flask, render_template, session, request, redirect, url_for, flash
import forms
from flask_session import Session
from flask_bootstrap import Bootstrap4
import msal
import app_config
import lorem
from werkzeug.middleware.proxy_fix import ProxyFix
from datetime import dateti... | duonghuuphuc/msgraph-sendmail-python | app.py | app.py | py | 7,769 | python | en | code | 2 | github-code | 71 | [
{
"api_name": "flask.Flask",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "app_config.SECRET_KEY",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "flask_session.Session",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "flask_bo... |
14047687529 | # coding:utf-8
"""
Filename: utils.py
Author: @DvdNss
Created on 11/15/2021
"""
import json
import os
def dict_to_json(args_dict: dict, filename: str) -> str:
"""
Saves a dictionnary as a json file.
:param args_dict: model dictionnary
:param filename: json file name
"""
assert filename[-5:... | DvdNss/MT5ForEverything | source/utils.py | utils.py | py | 617 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "os.makedirs",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "json.dump",
"line_number... |
43739065645 | from transformers import AutoModel, AutoTokenizer
import torch
import torch.nn.functional as F
from sklearn.metrics import mean_squared_error
from tqdm import tqdm
import numpy as np
import pandas as pd
import os,gc,re,warnings
import sys
from cuml.svm import SVR
import cuml
#Fetching data from folds
dftr = pd.read... | DARK-art108/feedback-prize-english-language | model/functional.py | functional.py | py | 7,620 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "pandas.read_csv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.sum",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "torch.clamp",
"line_num... |
1621961704 | import os
import requests
import logging
import time
from datetime import datetime
import json
from bs4 import BeautifulSoup
import re
import pandas as pd
from tqdm import tqdm
# Player Goalkeeping
player_keepers = [
"nationality", "squad", "age", "birth_year",
"games_gk", "games_starts_gk", "minutes_gk", "g... | Fournierp/FPL | scraping/fbref.py | fbref.py | py | 29,378 | python | en | code | 9 | github-code | 71 | [
{
"api_name": "os.path.exists",
"line_number": 117,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 117,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 118,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_n... |
71142978790 | from collections import defaultdict
import sys
input = sys.stdin.readline
from bisect import bisect
n, x = map(int, input().split())
arr = list(map(int, input().split()))
arr = [[v, i] for i, v in enumerate(arr)]
arr.sort()
arr_v = [arr[i][0] for i in range(n)]
def solve(arr, arr_v, n, x):
d = defa... | Azim-Islam/Problem-Solving-DSA | USACO.GUIDE/SILVER/CSES_1641.py | CSES_1641.py | py | 731 | python | en | code | 4 | github-code | 71 | [
{
"api_name": "sys.stdin",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "collections.defaultdict",
"line_number": 14,
"usage_type": "call"
}
] |
7138199436 | import cv2
import os
class FaceExtractor:
def __init__(self):
# Load the input image
self.input_image_path = 'ClassUpload/SwimTeam.jpeg'
self.input_image = cv2.imread(self.input_image_path)
if self.input_image is None:
print('Error: could not load image')
exi... | dadada629/Attendance-Robot | FaceExtractor.py | FaceExtractor.py | py | 1,174 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "cv2.imread",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.CascadeClassifier",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_nu... |
9751348828 | from datetime import datetime
from pathlib import Path
from pandas import DataFrame
from src.repository import BarsRepo
from src.utils.candlestick_chart import save_chart
def save_snapshot_for_gap(gap, bars_df: DataFrame, bars_before: int, bars_after: int, path: str):
gap_index = bars_df[bars_df['datetime_at'] ... | JameStitel/Price-gaps-in-the-stock-market-empirical | src/C_chart_creator.py | C_chart_creator.py | py | 1,193 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "pandas.DataFrame",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "src.utils.candlestick_chart.save_chart",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "src.repository.BarsRepo",
"line_number": 16,
"usage_type": "name"
},
{
"a... |
40076130216 | import os
import numpy as np
import tensorflow as tf
from skimage.io import imread
from skimage.transform import resize
import math
import cv2
class Batch_Create(tf.keras.utils.Sequence):
def __init__(self, x_set, y_set, batch_size):
self.x, self.y = x_set, y_set
self.batch_size = batch_size
... | sangheonEN/segmentation_tf_v1_fcn | data_load.py | data_load.py | py | 3,182 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "tensorflow.keras",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "math.ceil",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_numb... |
70415952230 | """
This file defines actions, i.e. functions the URLs are mapped into
The @action(path) decorator exposed the function at URL:
http://127.0.0.1:8000/{app_name}/{path}
If app_name == '_default' then simply
http://127.0.0.1:8000/{path}
If path == 'index' it can be omitted:
http://127.0.0.1:8000/
The pa... | niecoope/cse183hw4 | controllers.py | controllers.py | py | 3,961 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "py4web.utils.url_signer.URLSigner",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "common.session",
"line_number": 37,
"usage_type": "argument"
},
{
"api_name": "models.get_user_email",
"line_number": 42,
"usage_type": "call"
},
{
"api_na... |
35982665753 | import PySimpleGUIWeb as sg
import pyautogui
input_file = open('input.txt', 'w')
input = ""
sg.theme('Material1')
gender_choices = ('Bitte auswählen', 'männlich', 'weiblich', 'divers')
day_choices = ('Bitte auswählen', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,... | melurke/PySimpleGUI | main.py | main.py | py | 3,685 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "PySimpleGUIWeb.theme",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "PySimpleGUIWeb.Text",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "PySimpleGUIWeb.Text",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "PySimpleG... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.