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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
31151671330 | import glob
import cv2
import numpy as np
import matplotlib.pyplot as plt
# import tensorflow as tf
# 获取上级目录
image_dirs='F:\python\codes\gamma-AI\\pictures for assessment'
# 获取当前目录下所有文件
image_paths=glob.glob(image_dirs+'\*')
# 给定阈值范围
threshold=300
for image_path in image_paths:
image=cv2.imread(im... | TKrobinpan/Ambiguity-and-Similarity-of-pictures | 清晰度.py | 清晰度.py | py | 1,227 | python | en | code | 5 | github-code | 97 | [
{
"api_name": "glob.glob",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_numb... |
26318965324 | """Command models to execute a Thermocycler profile."""
from __future__ import annotations
from typing import List, Optional, TYPE_CHECKING
from typing_extensions import Literal, Type
from pydantic import BaseModel, Field
from opentrons.hardware_control.modules.types import ThermocyclerStep
from ..command import Abs... | Opentrons/opentrons | api/src/opentrons/protocol_engine/commands/thermocycler/run_profile.py | run_profile.py | py | 3,810 | python | en | code | 363 | github-code | 97 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing_extensions.Literal",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "pyd... |
38857321638 |
from twisted.trial import unittest
from twisted.internet import defer
from foolscap.test.common import HelperTarget, MakeTubsMixin
from foolscap.eventual import flushEventualQueue
class ConnectToSelf(MakeTubsMixin, unittest.TestCase):
def setUp(self):
self.makeTubs(1)
def tearDown(self):
d =... | warner/foolscap | src/foolscap/test/test_loopback.py | test_loopback.py | py | 1,144 | python | en | code | 50 | github-code | 97 | [
{
"api_name": "foolscap.test.common.MakeTubsMixin",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "twisted.trial.unittest.TestCase",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "twisted.trial.unittest",
"line_number": 8,
"usage_type": "name"
}... |
14451772123 | '''
Functions to evaluate an XGBoost classification model for train/validation purposes.
'''
from sklearn.metrics import confusion_matrix
from sklearn import datasets
from sklearn.metrics import roc_auc_score, roc_curve
from sklearn.model_selection import train_test_split
from sklearn.metrics import precision_score, re... | pbovard63/Predicting_Hong_Kong_Horse_Racing_Finishes | Python_Functions/xgboost_evaluator.py | xgboost_evaluator.py | py | 5,872 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "seaborn.heatmap",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "sklearn.me... |
7002524593 | from collections import deque
N, K = map(int, input().split())
def check():
q = deque()
q.append((N, 0))
v = [0]*100001
v[N] = 1
while q:
x, t = q.popleft()
if x == K:
return t
if x+1 < 100001 and v[x+1] == 0:
q.append((x+1, t+1))
v[x + 1]... | JayMaro/APS_study | BeakJoon/혼자 공부/1697. 숨바꼭질.py | 1697. 숨바꼭질.py | py | 539 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "collections.deque",
"line_number": 5,
"usage_type": "call"
}
] |
36741504819 | #!/usr/bin/env python3
import os
import shutil
import sys
import argparse
import subprocess
CLEAR = '\x1b[0m'
RED = '\x1b[1;34;0m'
YELLOW = '\x1b[1;33;0m'
GREEN = '\x1b[1;32;0m'
WHITE = '\x1b[1;37;0m'
def parse_cmd_arguments():
""" Get the necessary metadata to complete the KAF."""
parser = argparse.Argumen... | josubg/semeval2010 | script/reevaluate_original_task.py | reevaluate_original_task.py | py | 7,527 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "subprocess.Popen",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line_number": 69,
"usage_type": "attribute"
},
{
"api_name": "shutil.... |
25672259684 | import requests
app_id = 'e210e241'
app_key = "4402047b5562828b52faeee6403f08d3"
language = "en-gb"
def get_def(word_id):
url = "https://od-api.oxforddictionaries.com:443/api/v2/entries/" + language + "/" + word_id.lower()
r = requests.get(url, headers={"app_id": app_id, "app_key": app_key})
... | GrandProgrammer/TGBoT | OxfordLookUp.py | OxfordLookUp.py | py | 1,908 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
}
] |
31150780940 | import time
from telethon import TelegramClient
from modules.parseTxtFile import parseTxtFile
from modules.sender import sender
api_id = 'app_id'
api_hash = "app_hash"
database_filename = 'users_db'
what_to_hide = 'chat'
sending_delay = 30
max_messages = 40
message = '''
Your message content
'''.replace('\n', '', 1)
... | toglz/telegram-inivisible-sender | app.py | app.py | py | 1,021 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "modules.parseTxtFile.parseTxtFile",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "telethon.TelegramClient",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "modules.sender.sender",
"line_number": 30,
"usage_type": "call"
},
{
"a... |
10719698320 | from django.urls import path, include
from rest_framework import routers
from bank_branches import views
router = routers.DefaultRouter()
router.register(r'banks', views.BankViewSet, views.BranchViewSet)
router.register(r'branches', views.BranchViewSet)
urlpatterns = [
path('', include(router.urls)),
path('a... | vikash212000yadav/Task2 | bank_branches/urls.py | urls.py | py | 392 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "rest_framework.routers.DefaultRouter",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "rest_framework.routers",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "bank_branches.views.BankViewSet",
"line_number": 7,
"usage_type": "attribute"
... |
25483384027 | import cv2 as cv
import numpy as np
import urllib.request
# change to your ESP32-CAM ip
url = 'http://192.168.10.187/cam-lo.jpg' #hi or lo
winName = 'CAM'
cv.namedWindow("winName")
while 1:
imgResponse = urllib.request.urlopen(url)
imgNp=np.array(bytearray(imgResponse.read()),dtype=np.uint8)
img=cv.imdecod... | ThepokKung/face_recognition | esp32.py | esp32.py | py | 439 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "cv2.namedWindow",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "urllib.request.request.urlopen",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_na... |
40250418871 | #! -*- coding: utf-8 -*-
import fasttext
vector_size=128
word_ngrams=3
words_file='data/comments_w2v_train.txt'
cbow_file='model/word2vec_cbow_'+str(vector_size)
w2v_model = fasttext.cbow(words_file, cbow_file, lr=0.1,dim=vector_size,min_count=2,word_ngrams=word_ngrams,minn=1,maxn=15,ws=3,silent=0,epoch=50,bucke... | qxde01/sentiment_classify | fasttext_train.py | fasttext_train.py | py | 1,777 | python | en | code | 41 | github-code | 97 | [
{
"api_name": "fasttext.cbow",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "fasttext.skipgram",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "fasttext.supervised",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "fasttext.supervise... |
31737932620 | """Scraper for the Arris S33 modem info page"""
from __future__ import annotations
import hmac
import time
from collections.abc import Iterable
from typing import Optional
import httpx
from attrs import define, field, frozen
from yarl import URL
from ispee.console import CONSOLE
from ispee.exception import ModemScra... | t-mart/ispee | src/ispee/s33.py | s33.py | py | 13,935 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "httpx.AsyncClient",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "collections.abc.Iterable",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "attrs.frozen",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "collections.a... |
14424600393 | from __future__ import print_function
from collections import Counter
import sys
def missing(a, b):
count = Counter(b)
count.subtract(Counter(a))
return sorted(list(filter(lambda x: count[x] > 0, count)))
def main():
lines = [ [int(b) for b in x.strip().split()] for x in sys.stdin.readlines()[1::2] ][... | shanesatterfield/hacker-rank | Python/Algorithms/Search/Missing_Numbers/python_missing_numbers/__main__.py | __main__.py | py | 391 | python | en | code | 102 | github-code | 97 | [
{
"api_name": "collections.Counter",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.stdin.readlines",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.stdin",... |
11916000501 | import csv
from contextlib import closing
from tempfile import NamedTemporaryFile
from airflow.hooks.S3_hook import S3Hook
from airflow.models import BaseOperator
from airflow.plugins_manager import AirflowPlugin
from airflow.utils.decorators import apply_defaults
import pyodbc
from airflow.hooks.dbapi_hook import DbAp... | Fluxo-Resultados/airflow-plugins | plugins/mssql_utils.py | mssql_utils.py | py | 14,233 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "airflow.hooks.dbapi_hook.DbApiHook",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "pyodbc.connect",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "airflow.models.BaseOperator",
"line_number": 55,
"usage_type": "name"
},
{
"api... |
1538542755 | import pygame
import numpy as np
pygame.init()
class SpriteButton:
def __init__(self, x, y, width, height, gpx=1, gpy=1, texture=pygame.transform.scale(pygame.image.load("images/costyl.png"), (100, 100))):
super().__init__()
self.x = x
self.y = y
self.game_pos_x = gpx
self... | SaveliyZalogin/CrossZerosGame | mainapp.py | mainapp.py | py | 6,190 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pygame.init",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pygame.transform.scale",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pygame.transform",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.lo... |
74972112640 | #collections.namedtuple()
#Basically, namedtuples are easy to create, lightweight object types.
#They turn tuples into convenient containers for simple tasks.
#With namedtuples, you don’t have to use integer indices for accessing members of a tuple.
# Enter your code here. Read input from STDIN. Print output to STDOU... | lalitssonawane/Hacker-Rank-code-solution | Hacker-rank-practice/collections.namedtuple().py | collections.namedtuple().py | py | 652 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "collections.namedtuple",
"line_number": 15,
"usage_type": "call"
}
] |
22235709371 | from fastapi import Header
from app.utils.exceptions import SuccessefulResponse
from app.utils.general import get_session, object_to_json, delete_object
from app.utils.auth_helpers import get_user_by_jwt
class AccountRequests:
def __init__(self, engine, debug):
self.engine = engine
self.debug... | luciluci666/FourRum | backend/app/endpoints/account.py | account.py | py | 957 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "fastapi.Header",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "app.utils.general.get_session",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "app.utils.auth_helpers.get_user_by_jwt",
"line_number": 15,
"usage_type": "call"
},
{
... |
5990393262 | from allennlp.common import Params
import numpy as np
from numpy.testing import assert_allclose
import pytest
from contexteval.common.custom_test_case import CustomTestCase
from contexteval.contextualizers import PrecomputedContextualizer
from contexteval.data.dataset_readers import Conll2003NERDatasetReader
class T... | nelson-liu/contextual-repr-analysis | tests/data/dataset_readers/conll2003_ner_test.py | conll2003_ner_test.py | py | 6,534 | python | en | code | 211 | github-code | 97 | [
{
"api_name": "contexteval.common.custom_test_case.CustomTestCase.FIXTURES_ROOT",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "contexteval.common.custom_test_case.CustomTestCase",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "contexteval.common.custo... |
16277445494 | #!/usr/bin/env python3
from flask_classful import FlaskView
from flask import request, abort, jsonify
from flask_jwt_simple import jwt_required, get_jwt_identity
from marshmallow.exceptions import ValidationError
import sqlalchemy.exc
from utils import json_required
from schemas import UserSchema
from model import db... | marcsello/simple-user-service | user_service/views/users_view.py | users_view.py | py | 2,145 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask_classful.FlaskView",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "schemas.UserSchema",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "model.db.session",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "mod... |
26769429987 | from collections import defaultdict
import cython
from joblib import Parallel, delayed
import multiprocessing as mp
import numpy as np
from packaging import version
import pandas as pd
import scipy.stats as stats
import sklearn
from sklearn.utils import check_array, check_random_state, check_X_y
from typing import List... | yling1105/Subgroup-analysis-for-HTE | uplift_forest_customed.py | uplift_forest_customed.py | py | 18,271 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "packaging.version.parse",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "packaging.version",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "sklearn.__version__",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "nu... |
7284433862 | import unittest
import unittest.mock
import datetime
import sqlite3
import rps
import captcha
import flask
import os
import shutil
import time
import PIL
import PIL.Image
import tempfile
import xml.etree.ElementTree as ET
import functools
class FlaskTemplateMocker:
def __enter__(self):
self.original_render... | SadaleNet/RockPaperScissorsTournament | app/test_rps.py | test_rps.py | py | 12,457 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "flask.render_template",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "flask.render_template",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "unittest.mock.Mock",
"line_number": 20,
"usage_type": "call"
},
{
"api_name... |
74314785600 | """
Launcher for universe / worldstate server.
"""
import functools
from absl import app as base_app
from absl import flags, logging
import bson
import flask
import grpc
from db import connect
from db.models import server_auth, ship, user
from lib import flask_utils
from util import error
flags.DEFINE_integer('port'... | Huntrr/spb | universe/server.py | server.py | py | 2,380 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "absl.flags.DEFINE_integer",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "absl.flags",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "absl.flags.FLAGS",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "absl.flags... |
6741955050 | import sys
from collections import deque
# sys.stdin = open("input.txt", "r")
INF = 1000001
dx, dy = [0, 1, 0, -1], [1, 0, -1, 0]
n, m = map(int, input().split())
island = [list(map(int, input().split())) for _ in range(n)]
dp = [[INF for _ in range(11)] for _ in range(11)]
f = [i for i in range(8)]
heap = [... | lcy8417/backjoon-online-judge_python | 17472.py | 17472.py | py | 2,541 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "collections.deque",
"line_number": 33,
"usage_type": "call"
}
] |
29792083506 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'standared mudule'
from copy import deepcopy
__author__ = 'Tree'
import numpy
from numpy import *
import numpy as np
from sklearn.manifold import TSNE
from sklearn.datasets import load_iris
from sklearn.decomposition import PCA
import matplotlib.pyplot as plt
def trans... | theDyingofLight/regionLabelCluster | trans_query_graph.py | trans_query_graph.py | py | 4,696 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "copy.deepcopy",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 142,
"usage_type": "call"
},
{
"api_name": "sklearn.manifold.TSNE",
"line_number": 143,
"usage_type": "call"
},
{
"api_name": "numpy.hstack",
... |
6906249491 | # Huffman
import heapq
from collections import defaultdict
class Tree(object):
def __init__(self, left=None, right=None):
self.id = None
self.child = defaultdict(list)
if left!= None and right != None:
self.weight = left.weight + right.weight
for id in left.id:
... | sijoonlee/algorithm_study | Algorithm_Coursera/Greedy/Assignment3/solution_1.py | solution_1.py | py | 2,587 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "collections.defaultdict",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "heapq.heapify",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "heapq.heappop",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "heapq.heappop",
... |
6867674809 | """ License
PKX-IconGen.Python - Python code for PKX-IconGen to interact with Blender
Copyright (C) 2021-2022 Samuel Caron/mikeyX#4697
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 F... | mikeyX101/PKX-IconGen | PKX-IconGen.Python/data/light.py | light.py | py | 1,691 | python | en | code | 6 | github-code | 97 | [
{
"api_name": "enum.IntEnum",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "color.Color",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 41,
"usage_type": "name"
},
{
"api_name": "color.Color.parse_obj",
... |
33197922126 | from django.shortcuts import render, get_object_or_404, redirect
from django.conf import settings
from django.views.decorators.http import require_http_methods
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.auth import update_session_auth_hash
from djan... | ytsapras/robonet_site | events/views.py | views.py | py | 119,407 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "scripts.local_conf.get_conf",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "scripts.local_conf.get_conf",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"line_number": 62,
"usage_type": "call"
},
{
"api_name"... |
30642190758 | from django.contrib.auth import get_user_model
from django.shortcuts import get_object_or_404
from rest_framework import filters, mixins, permissions, viewsets
from rest_framework.pagination import LimitOffsetPagination
from .permissions import AuthorOrReadOnly
from api.serializers import (CommentSerializer, FollowSer... | BolatbekA/api_final_yatube | yatube_api/api/views.py | views.py | py | 1,993 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "rest_framework.viewsets.ModelViewSet",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.viewsets",
"line_number": 14,
"usage_type": "... |
41969148638 | import csv
from datetime import datetime
from dateutil import parser
from os import listdir, path
from os.path import isfile, join
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from core.models import Reestr, Airports
class Command(BaseCommand):
help = 'Expo... | buugaaga/pobeda | core/management/commands/export.py | export.py | py | 2,594 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "dateutil.parser.add_argument",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "dateutil.parser",
"line_number": 18,
"usage_type": "name"
},
{
... |
70110407998 | from loguru import logger
from git import Repo
from git import RemoteProgress
# class MyProgressPrinter(RemoteProgress):
# def update(self, op_code, cur_count, max_count=None, message=''):
# print(op_code, cur_count, max_count, cur_count / (max_count or 100.0), message or "NO MESSAGE")
repo = Repo("d:/03... | dengmingcong/nacos-jmeter | test/test_gitpython.py | test_gitpython.py | py | 1,030 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "git.Repo",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "loguru.logger.error",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "loguru.logger",
"line_number": 20,
"usage_type": "name"
}
] |
37153532077 | import sys
import itertools
ADD = 1
MUL = 2
IN = 3
OUT = 4
JMPT = 5
JMPF = 6
LESS = 7
EQU = 8
HALT = 99
POS = 0
IMM = 1
class amp(object):
def __init__(self, code, input):
self.code = code.copy()
self.ip = 0
self.input = input.copy()
self.terminated = Fals... | VisionistInc/advent-of-code-2019 | shaw/07/sol.py | sol.py | py | 5,614 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "sys.exit",
"line_number": 102,
"usage_type": "call"
},
{
"api_name": "itertools.permutations",
"line_number": 115,
"usage_type": "call"
},
{
"api_name": "itertools.permutations",
"line_number": 150,
"usage_type": "call"
}
] |
35791060610 | from datetime import datetime
import os
from uuid import UUID
os.environ['SARDES_PYTEST'] = 'True'
# ---- Third party imports
import pandas as pd
import pytest
from qtpy.QtWidgets import QMessageBox
# ---- Local imports
from sardes.widgets.tableviews import MSEC_MIN_PROGRESS_DISPLAY
# ==============================... | cgq-qgc/rsesq-sardes | sardes/tables/tests/test_table_sonde_installations.py | test_table_sonde_installations.py | py | 9,179 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.environ",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "sardes.widgets.tableviews.MSEC_MIN_PROGRESS_DISPLAY",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "pytest.fixture",
"line_number": 18,
"usage_type": "attribute"
},
{... |
21364488393 | # Importação das bibliotecas
import streamlit as st
import sys
sys.path.append('parts')
sys.path.append('images')
sys.path.append('data')
from parts.inicio import inicio_func
from parts.about import about_func
from parts.cenipa import cenipa_func
from parts.filtro import filtro_func
st.set_page_config(page_title="Mult... | thiagolopes97/streamlit_apps | app.py | app.py | py | 1,227 | python | pt | code | 0 | github-code | 97 | [
{
"api_name": "sys.path.append",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_numbe... |
40597851166 | from workflow_engine.strategies import InputConfigMixin, ExecutionStrategy
from at_em_imaging_workflow.render_strategy_utils import RenderStrategyUtils
from at_em_imaging_workflow.models import ChunkAssignment
from rendermodules.pointmatch.schemas import TilePairClientParameters
from at_em_imaging_workflow.two_d_stack... | AllenInstitute/em_imaging_workflow | at_em_imaging_workflow/strategies/rough/create_rough_pairs_strategy.py | create_rough_pairs_strategy.py | py | 2,385 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "workflow_engine.strategies.InputConfigMixin",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "workflow_engine.strategies.ExecutionStrategy",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type... |
7228678266 |
import datetime
import re
import pytz
tz = pytz.timezone('Asia/Shanghai')
import uuid
import os
import pandas as pd
def load_modify_ads(ads):
tmp_ads = dict()
if 'ad_id' in ads:
tmp_ads['ad_id']= ads['ad_id']
if 'pt' in ads:
tmp_ads['pt'] = ads['pt']
tmp_ads['type'] = None
... | Sandbar/GA | genetic_standard/common_genetic.py | common_genetic.py | py | 3,494 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pytz.timezone",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_... |
38101165275 | from multiprocessing import Process as pcs
from multiprocessing import Queue
from pysl import Config,os_enter,easy_request
import os,config_make,time,sys
from pprint import pprint
Q_Order=Queue(maxsize=5)
try:
config_make.make_cfg()
except:
Warning('configs make failed')
cfg=Config('./configs.json')
pprint(c... | Astesias/baidu_18_competition | Tasker.py | Tasker.py | py | 2,532 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "multiprocessing.Queue",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "config_make.make_cfg",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pysl.Config",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pprint.pprint",
... |
23170032444 | import requests
from datetime import datetime
config = [
{ 'name' : 'temp', 'public' : 'q5X5m25pp8FYYgZ0EQld' },
{ 'name' : 'pi', 'public' : 'MGw10nX37ZSbA2A463Xo' },
]
base_url = 'https://data.sparkfun.com/output/'
from_time = '2015-07-19T12:00'
from_time_dt = datetime.strptime(from_time, '%Y-%m-%dT%H:%M')
... | mattvenn/arduinosketchbook | hardwareTests/esp-temp/count_results.py | count_results.py | py | 708 | python | en | code | 11 | github-code | 97 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "da... |
74766205439 | # -*- coding: utf-8 -*-
# @Time : 2021/3/7
# @Author : lorineluo
from email.header import Header
from email.mime.text import MIMEText
from email.utils import parseaddr, formataddr
import smtplib
import time
from email.header import Header
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMult... | cafebabeCoder/qutils | email_utils.py | email_utils.py | py | 2,826 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "time.strftime",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "time.localtime",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "email.utils.parseaddr",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "email.utils.format... |
20610516281 | import datetime
import json
import os
import requests
from rest_framework import status
from rest_framework.generics import ListAPIView
from rest_framework.response import Response
from django.core import serializers
from annual_reports.models import IncomeStatement
from annual_reports.serializers import IncomeStatem... | aljazsustar/cat | api/annual_reports/views.py | views.py | py | 4,623 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "rest_framework.generics.ListAPIView",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "annual_reports.serializers.IncomeStatementSerializer",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "annual_reports.models.IncomeStatement.objects.all",
... |
28439126439 | import json
import time
from jpl_ta1.api_handler import LwllApiHandler
from jpl_ta1.model_wrapper import ModelWrapper
from typing import List, Any
from datetime import datetime
from jpl_ta1.logger import get_module_logger
class Session:
def __init__(self, environment: str, dataset_config: str, task_id: str, api_... | jpl-lwll/jpl_ta1 | jpl_ta1/session.py | session.py | py | 7,262 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "jpl_ta1.api_handler.LwllApiHandler",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "jpl_ta1.logger.get_module_logger",
"line_number": 21,
"usage_type": "call"
},
{
"ap... |
33197561666 | from django.core.management.base import BaseCommand
from events.models import Event, Tap, EventName, Field, Operator, SingleModel
from django.core.exceptions import ObjectDoesNotExist
from os import path
from astropy.time import Time
class Command(BaseCommand):
args = ''
help = ''
def add_arguments(self, ... | ytsapras/robonet_site | events/management/commands/archive_tap.py | archive_tap.py | py | 5,231 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "events.models.EventName.objects.filter",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "events.models.EventName.objects",
"line_number": 15,
"usage... |
40054783238 | from typing import Annotated
from fastapi import FastAPI, WebSocket, WebSocketDisconnect, Depends, Cookie
from fastapi.middleware.cors import CORSMiddleware
from .services import get_chatbot_maker
app = FastAPI()
app.add_middleware(
CORSMiddleware,
allow_origins=["http://localhost:3000"],
allow_credenti... | wykswr/AnyLLM | server/app/main.py | main.py | py | 1,375 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "fastapi.middleware.cors.CORSMiddleware",
"line_number": 11,
"usage_type": "argument"
},
{
"api_name": "typing.Annotated",
"line_number": 20,
"usage_type": "name"
},
{
"api_na... |
16647834323 | import requests
from bs4 import BeautifulSoup
import pandas as pd
url = "https://www.numbeo.com/cost-of-living/rankings_by_country.jsp"
page = requests.get(url)
soup = BeautifulSoup(page.text, 'lxml')
table = soup.find('table', id = 't2')
head = []
for i in table.find_all('th'):
head.append(i.text)
print(head)
da... | qZiss/H-athon | extract.py | extract.py | py | 603 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pandas.read_json",
... |
16140960270 | import torch
import torch.nn as nn
import torch.nn.functional as F
from modeling.sync_batchnorm.batchnorm import SynchronizedBatchNorm2d
class Decoder(nn.Module):
def __init__(self, n_class, BatchNorm):
super(Decoder, self).__init__()
eps = 1e-5
momentum = 0.1
self._conv = nn.Seque... | HankKung/Auto-Dynamic-DeepLab | modeling/decoder.py | decoder.py | py | 1,355 | python | en | code | 9 | github-code | 97 | [
{
"api_name": "torch.nn.Module",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_... |
2013255121 | import matplotlib.pyplot as plt
import random
import numpy as np
# function to calculate total
def total(a):
c = [a[0]]
for j in range(1, 10):
k = c[j - 1] + a[j]
c.append(k)
return c
india = []
england = []
# Generating random scores
for i in range(0, 10):
n = ra... | YashNatani29/Ml | lab 1/Cric_plot.py | Cric_plot.py | py | 955 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "random.randint",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
... |
29182467669 | """Datetime utilities."""
import numpy as np
import pandas as pd
from vectorbt.utils import checks
DatetimeTypes = (pd.DatetimeIndex, pd.TimedeltaIndex, pd.PeriodIndex)
def freq_delta(freq):
"""Return delta of frequency."""
if isinstance(freq, str) and not freq[0].isdigit():
# Otherwise "ValueError... | eo1989/VectorBTanalysis | .venv/lib/python3.8/site-packages/vectorbt/utils/datetime.py | datetime.py | py | 620 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pandas.DatetimeIndex",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pandas.TimedeltaIndex",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pandas.PeriodIndex",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_nam... |
28455288041 | """Parameter space exploration tool.
See the documentation at https://github.com/amorison/parspace
"""
from itertools import product
class ParSpace:
"""Parameter space explorer.
Example:
>>> @ParSpace(asp=[0.5, 1, 2],
>>> density=[1, 10])
>>> def launch_simu(asp, density):... | amorison/parspace | parspace.py | parspace.py | py | 1,287 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "itertools.product",
"line_number": 32,
"usage_type": "call"
}
] |
41080985873 | # -*- coding: utf-8 -*-
"""
Created on Tue Aug 11 20:27:50 2020
@author: renli
"""
# recursive
def getUmbrellas(V, deno):
from functools import lru_cache
deno=tuple(deno)
@lru_cache(maxsize=None)
def f(requirement,size):
if requirement==0:
return 0
elif requi... | LitaiRenGit/FullTime-coding-test | Umbrellas.py | Umbrellas.py | py | 1,021 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "functools.lru_cache",
"line_number": 12,
"usage_type": "call"
}
] |
24101060278 | import json
import zlib
import copy
from pipeflow import Task
class TaskProtocal(Task):
__slots__ = ['_info']
def __init__(self, task):
assert isinstance(task, (Task, dict)), "task should be a instance of Task or dict"
if isinstance(task, Task):
_data = task.get_raw_data()
... | everAwayne/amzc | util/task_protocal.py | task_protocal.py | py | 1,549 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pipeflow.Task",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "pipeflow.Task",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "pipeflow.Task",
"line_number": 11,
"usage_type": "argument"
},
{
"api_name": "json.loads",
"line_n... |
4505096226 | # -*- coding: utf-8 -*-
import cv2
def mouse_callback(event, x, y, flags, param):
if event == cv2.EVENT_LBUTTONDOWN:
print(f"Selected coordinates: ({x}, {y})")
image = cv2.imread("image.jpg")
cv2.namedWindow("Image")
cv2.setMouseCallback("Image", mouse_callback)
while True:
cv2.imshow("Image", image)... | KentaNishi/PythonScript | select_coordinate.py | select_coordinate.py | py | 401 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "cv2.EVENT_LBUTTONDOWN",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "cv2.imread",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.namedWindow",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.setMouseCallba... |
19887667632 | import matplotlib
import numpy as np
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['ps.fonttype'] = 42
from matplotlib import pyplot as plt
from cnns.nnlib.robustness.utils import to_fft_magnitude
import torch
from cnns.nnlib.utils.object import Object
from cnns.nnlib.datasets.ucr.ucr_example import fif... | adam-dziedzic/bandlimited-cnns | cnns/graphs/fft_visualize/original1D.py | original1D.py | py | 3,971 | python | en | code | 17 | github-code | 97 | [
{
"api_name": "matplotlib.rcParams",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 31,
"usage_type": "call"
},
{
"api_name... |
12724676450 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
#Python2.x除法保留2位小数
# from __future__ import division
# from __future__ import print_function
# from __future__ import unicode_literals
from sqlalchemy import Column,create_engine,Integer,DateTime
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import... | chuxuan909/Tornado | DataStatistics/core/DataGo.py | DataGo.py | py | 14,691 | python | zh | code | 1 | github-code | 97 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 84,
"usage_type": "call"
},
{
"api_name": "config.conf_database.get_arg",
"line_number": 84,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.create_engine",
"line_number": 85,
"usage_type": "call"
},
{
"ap... |
14998778241 | from functools import reduce
# Lambda
square = lambda x: x ** 2
# Lambda with map
numbers = [1, 2, 3, 4, 5]
squares = list(map(lambda x: x ** 2, numbers))
# Lambda with filter
values = [2, 65, 67, 78, 98]
peers = list(filter(lambda x: x % 2 == 0, values))
peers_list_comprehension = [x for x in values if x % 2 == 0]... | luissantaospina/python | advanced/lambda_comprehension.py | lambda_comprehension.py | py | 434 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "functools.reduce",
"line_number": 18,
"usage_type": "call"
}
] |
9035707206 | from flask import Flask
app = Flask(__name__)
@app.route("/")
def home():
html = f"<h3>Final Capstone project</h3>"
return html.format(format)
if __name__ == "__main__":
app.run(host='0.0.0.0', port=80, debug=True) # specify port=80
| Rexben001/final-project | app.py | app.py | py | 249 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 3,
"usage_type": "call"
}
] |
18755933486 | from termcolor import cprint
import requests
import threading
import re
import json
from tqdm import *
from colorama import Fore
# 全都用tqdm.write(url)打印 能够打印在进度条上方,并将进度条下移一行。
# 存在漏洞可能得需要红色,使用 tqdm.write(Fore.RED + url) 打印则有颜色
# 打印一些错误需要灰色 使用 tqdm.write(Fore.WHITE + url)
# 打印漏洞结果 使用 tqdm.write(Fore.BLACK + u... | 0x727/ShuiZe_0x727 | Plugins/Vul/CMS/Solr.py | Solr.py | py | 5,068 | python | en | code | 3,283 | github-code | 97 | [
{
"api_name": "threading.Thread",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "threading.Thread.__init__",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": ... |
15928883320 | import os
import django
from django.conf import settings
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "eyes1000.settings")
django.setup()
from django.core.files import File
from django.core.files.storage import FileSystemStorage
from pet.models import PetLost, PetFound, PetMaterial, PET_TYPE, GENDER_CHOICE
f... | reasonsolo/eyes_django | import_data.py | import_data.py | py | 4,288 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "os.environ.setdefault",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "django.setup",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pet.models.GENDER_CHO... |
15528111025 | from pyspark import RDD
from pyspark.sql import Row
from pyspark.sql import SparkSession
from evaluation import RegressionEvaluator
from recommendation import ALS
spark = SparkSession \
.builder \
.appName("recommend") \
.config("spark.serializer", "org.apache.spark.serializer.KryoSerializer") \
.conf... | keyuquan/PythonProject | c08_recommend/InterestALSPredictMain.py | InterestALSPredictMain.py | py | 1,520 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "pyspark.sql.SparkSession.builder.appName",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pyspark.sql.SparkSession",
"line_number": 8,
"usage_type": "... |
33716683247 | import inspect
import joblib
import numpy as np
import pandas as pd
from ..core.portfolio import Portfolio
from ..utils import mabc
# =============================================================================
# BASE
# =============================================================================
class Portfoli... | quatrope/garpar | garpar/datasets/base.py | base.py | py | 5,683 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "utils.mabc.ModelABC",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "utils.mabc",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "inspect.signature",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "utils.mabc.abst... |
28904216759 | # -*- coding: utf-8 -*-
import logging
import numpy as np
from keras import backend as K
from keras.engine import Layer, InputSpec
from keras.layers import Flatten
from keras import initializers, regularizers, constraints
import tensorflow as tf
logger = logging.getLogger(__name__)
def _softmax(x, axis):
''' ... | linhx13/pyarc | pyarc/nlp/keras_nlp/old_layers.py | old_layers.py | py | 9,185 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "keras.backend.backend",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "keras.backend",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "tensorflow.nn.s... |
8237124261 | import os
import time
import argparse
import inspect
import json
import torch
from pathlib import Path
from torch.nn import functional as F
from dataclasses import dataclass
from utils.registry import Model, Dataset
from models import GPT2, ButterflyGPT
from contextlib import nullcontext
@dataclass
class TrainingCon... | lentinic/Athena | generate.py | generate.py | py | 4,191 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "dataclasses.dataclass",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "torch.load",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "utils.registry... |
859341923 | import os
import os.path as osp
import torch
import numpy as np
from PIL import Image
from torch.utils.data import Dataset
from torchvision import transforms
class DatasetLoader(Dataset):
def __init__(self, setname, args=None):
DATASET_DIR = os.path.join(args.data_dir, 'FC100/')
if setname == '... | icoz69/DeepEMD | Models/dataloader/fc100/sampling/fc100.py | fc100.py | py | 2,275 | python | en | code | 531 | github-code | 97 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
... |
1663286123 | import time
from kafka import KafkaConsumer
SERVER = ['121.196.16.204:9091','121.196.16.204:9092','121.196.16.204:9093']
TOPIC = 'rpa-message'
print(("kafka server is {},topic is [{}]".format(SERVER, TOPIC)))
consumer = KafkaConsumer(
TOPIC,
bootstrap_servers=SERVER,
group_id='rpa-worker',
auto_offset_... | yuanhai11/spider | Other/spider_all/零申报/kafka消费太多重复信息.py | kafka消费太多重复信息.py | py | 624 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "kafka.KafkaConsumer",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 26,
"usage_type": "call"
}
] |
34388776974 | from time import time
import hashlib
import json
from urllib.parse import urlparse
import requests
class Blockchain:
# Constructor
def __init__(self):
self.chain = [] # Normally a linked list, but we're lazy. So.
self.nodes = set() # Address book of neighbor nodes
self.current_transa... | sharmavins23/Blockchain-Example-Python | blockchain.py | blockchain.py | py | 5,684 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "urllib.parse.urlparse",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 81,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_n... |
27204572500 | from sklearn.model_selection import train_test_split
from data_ingestion import data_loader
from data_preprocessing import preprocessing,clustering
from best_model_finder import tuner
from file_operations import file_methods
from application_logging import logger
class trainModel:
def __init(self):
... | 11abdellah11/Fault_detection_using_sensor_data | trainingModel.py | trainingModel.py | py | 4,086 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "application_logging.logger.App_logger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "application_logging.logger",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "data_ingestion.data_loader.Data_Getter",
"line_number": 20,
"usage_type"... |
34260673879 | from ..utils import inch_to_base_unit, create_polygon, create_base_object
from ..coord import min_x_coord, max_x_coord, min_y_coord, max_y_coord
MINIMUM_BAY = inch_to_base_unit(12.0)
WIRE_SPACE = inch_to_base_unit(1.0)
WIRE_WIDTH = inch_to_base_unit(0.1)
# BUILDING_LAYER is a constant for the input layer name
BUILDI... | erfan7emz/ElectricalWiringRoutes | electrical_routing_joist_bay_lines.py | electrical_routing_joist_bay_lines.py | py | 4,307 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "utils.inch_to_base_unit",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "utils.inch_to_base_unit",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "utils.inch_to_base_unit",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "... |
4189228437 | import cv2
import os
def start_capture():
cwd = os.getcwd()
cam = cv2.VideoCapture(0)
cv2.namedWindow("Calibration Window")
img_counter = 0
while True:
ret, frame = cam.read()
cv2.imshow("Calibration Window", frame)
if not ret:
break
k... | yupm/Computer-Vision-with-3DoF-estimation | imagecapture.py | imagecapture.py | py | 756 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.getcwd",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.namedWindow",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number... |
3284011082 | # -*- coding: utf-8 -*-
import pytest
import os
from betfair import betfair
from tests.utils import response_fixture_factory
@pytest.fixture
def client():
return betfair.Betfair(app_key='test', cert_file='path/to/cert')
@pytest.fixture
def logged_in_client(client):
client = betfair.Betfair(app_key='test'... | jmcarp/betfair.py | tests/conftest.py | conftest.py | py | 1,933 | python | en | code | 102 | github-code | 97 | [
{
"api_name": "betfair.betfair.Betfair",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "betfair.betfair",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "pytest.fixture",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "betfair.b... |
19208870303 | from collections import OrderedDict
from ydk.types import Entity, EntityPath, Identity, Enum, YType, YLeaf, YLeafList, YList, LeafDataList, Bits, Empty, Decimal64
from ydk.filters import YFilter
from ydk.errors import YError, YModelError
from ydk.errors.error_handler import handle_type_error as _handle_type_error
cl... | sjjufw/ACI | cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_asr9k_fab_cfg.py | Cisco_IOS_XR_asr9k_fab_cfg.py | py | 3,243 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "ydk.types.Enum",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "ydk.types.Enum.YLeaf",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "ydk.types.Enum",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "ydk.types.Entity",
... |
1806838007 |
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import azureml
from azureml.core import Workspace, Run
from azureml.core import Workspace
from azureml.core.model import Model
import os
import pickle
from sklearn.externals import joblib
from utils import load_data
from sklearn.met... | ashutoshsing/Project-Major-1 | test.py | test.py | py | 1,843 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "azureml.core",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "azureml.core.Workspace.from_config",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "azureml.core.Workspace",
"line_number": 19,
"usage_type": "name"
},
{
"api_n... |
20093345033 | from typing import List
import numpy as np
def sample_array(arr, rate):
arr = np.array(arr)
if rate < 1:
rate = int(1 / rate)
num_samples = rate - 1
sampled = np.hstack(
[
np.linspace(arr[i], arr[i + 1], num_samples + 2, endpoint=False)[1:]
fo... | brianfitzgerald/stability-animation-utils | beat_utils.py | beat_utils.py | py | 2,303 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.array",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.hstack",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.hstack",
"line_number... |
2940436209 | import os
import re
from pathlib import Path
import bson
import pandas as pd
from bs4 import BeautifulSoup as bs
from git import Repo
from loguru import logger
from markdownify import markdownify
from tqdm import tqdm
def main():
# https://podatki.gov.si/dataset/osnovni-podatki-o-predpisih-rs
vpliva_na = pd.... | nraw/git_laws | main.py | main.py | py | 3,216 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pandas.read_csv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "bson.decode_all",
... |
41782656282 | from enum import IntEnum
from itertools import takewhile
import datetime
class Part(IntEnum):
X = 1
A = 2
B = 3
C = 4
D = 5
def max_num(self):
if self == Part.X:
return 11
else:
return 4
def to_x_num(self):
if (self == Part.X):
... | plrnvld/AOCDayTwentyThree | main.py | main.py | py | 15,854 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "enum.IntEnum",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "enum.IntEnum",
"line_number": 51,
"usage_type": "name"
},
{
"api_name": "itertools.takewhile",
"line_number": 260,
"usage_type": "call"
},
{
"api_name": "itertools.takewhile",
... |
26896734316 | from django.contrib.auth.decorators import login_required
from django.core.exceptions import ObjectDoesNotExist
from django.shortcuts import render, redirect, get_object_or_404
# from django.http import HttpResponse
from store.models import Product, Variation
from .models import Cart, CartItem
# Create your views he... | richardkhillah/shop-rk | cart/views.py | views.py | py | 7,996 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "models.Cart.objects.get",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "models.Cart.objects",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "models.Cart",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "models.C... |
6998077984 | import pdb, dateutil, random
from datetime import datetime, timedelta
from models.activity import Activity
from models.location import Location
from models.member import Member
import repositories.activity_repo as act_repo
import repositories.location_repo as loc_repo
import repositories.member_repo as member_repo
# ... | AK-UGlas/fit-me-in | console.py | console.py | py | 2,236 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "repositories.location_repo.delete_all",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "repositories.location_repo",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "repositories.member_repo.delete_all",
"line_number": 13,
"usage_type": "... |
24653110230 | '''
Author : Na Rae Baek
Author email : naris27@dgu.ac.kr
Github : https://github.com/ban2aru
License : MIT license
Modified Year-Month : 2022-04
Description : test.py
The main code for testing ResNet using Pytorch
'''
from .utils import get_test_dataloader
import torch
import time
def test(args, model)... | BAN2ARU/Pytorch-ResNet | Util/test.py | test.py | py | 1,681 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "utils.get_test_dataloader",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.load",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.no_grad",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "time.strftime",
... |
42201943928 | #!/usr/bin/env python3
import sqlite3
import math
import pprint
import logging
import typing as t
import sys, getopt
import re
import os
import json
from enum import IntEnum, auto
def die(msg):
print(msg, file=sys.stderr)
sys.exit(1)
class sqltype(IntEnum):
INTEGER = auto()
REAL = auto()
TEXT = auto()
def __s... | koeppl/sqlplot | sqlplot.py | sqlplot.py | py | 21,201 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "sys.stderr",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "enum.IntEnum",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "enum.auto",
"line_number": ... |
12775813268 | """Check prediction entropy and dice score correlation"""
# %%
import os
import yaml
import matplotlib.pyplot as plt
import seaborn as sns
import torch
# enable lib loading even if not installed as a pip package or in PYTHONPATH
# also convenient for relative paths in example config files
from pathlib import Path
o... | aksg87/adpkd-segmentation-pytorch | notebooks/mask_entropy_dice_metric_relations.py | mask_entropy_dice_metric_relations.py | py | 1,625 | python | en | code | 11 | github-code | 97 | [
{
"api_name": "os.chdir",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "seaborn.set",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "yaml.load",
"line_number": 27,
... |
20412233770 | import sys
import json
import pathlib
import asyncio
import logging
from jsmin import jsmin
from aiohttp import web
from terrain import alert
from terrain.exception_log import ExceptionLog
from terrain.session_id_store import SessionIDStore
from terrain.alert import Level
from terrain.pager_duty_key_store import PagerD... | aquanauts/terrain | terrain/app.py | app.py | py | 7,416 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "json.loads",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "terrain.alert.Level.ERROR",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "terrain.alert.Level",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "aiohttp... |
32242280768 | from django.contrib import admin
from django.urls import path
from .views import AlbumList, AlbumReviewList, AlbumDetail, AlbumReviewDetail, AlbumReviewLikeCreate, AlbumLikeCreate
urlpatterns = [
path('album', AlbumList.as_view()),
path('album/<int:pk>', AlbumDetail.as_view()),
path('album/<int:pk>/review... | vorfanik/django_API | api_music/music/urls.py | urls.py | py | 548 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "views.AlbumList.as_view",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "views.AlbumList",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.urls.pat... |
33937034563 | from django.db import models
from django.conf import settings
from django.db.models import Q
from chat.managers.chat import (
ThreadManager, MessageManager
)
class Thread(models.Model):
first = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE, related_name='chat_thread_first')
second = ... | Sanditya2510/chat-backend | chat/models/chat.py | chat.py | py | 990 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "django.db.models.Model",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.db.models.ForeignKey",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": ... |
6154789835 | import argparse
from mmcv import Config
from mmcv.cnn import get_model_complexity_info
from mmcv.cnn.utils.flops_counter import flops_to_string, params_to_string
#from mmseg.models import build_segmentor
import torch
from isegm.model.modeling.segformer.segformer_model import SegFormer
from isegm.model.is_segformer_mo... | alibaba/ClickSEG | scripts/count_flops.py | count_flops.py | py | 4,800 | python | en | code | 32 | github-code | 97 | [
{
"api_name": "isegm.model.modeling.segformer.segformer_model.SegFormer",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "isegm.model.modeling.deeplab_v3.DeepLabV3Plus",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.nn.BatchNorm2d",
"line_number": ... |
41722454122 | from django.urls import path
from . import views
urlpatterns = [
path("", views.index, name="index"),
path("new-user/", views.new_user, name="new-user"),
path("<int:user_id>/add-task/", views.add_task, name="add-task"),
path("<int:user_id>/tasks/", views.tasks, name="tasks"),
path("delete-task/<in... | gmcgur01/todo | backend/api/urls.py | urls.py | py | 448 | python | en | code | 0 | github-code | 97 | [
{
"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",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
71478536318 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import re
import os
from html2text import html2text, read_file, clean_utf8, clean_whitespace
from subprocess import Popen, PIPE
import langid
magic_numer = "df6fa1abb58549287111ba8d776733e9"
def original_url(html):
m = re.search(r"<!-- Mirrored from ([^>]+... | christianbuck/mtma_bitext | baseline/extract_foreign_text.py | extract_foreign_text.py | py | 5,713 | python | en | code | 7 | github-code | 97 | [
{
"api_name": "re.search",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "subprocess.Popen",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "langid.classify",
"lin... |
18400756683 | import discord
from discord.ext import commands
import asyncio
TOKEN = 'MTA4OTIzNDU4Nzc2MDIwMTg2OA.GCo0CE.Na00qY5B1tIaG0xZHKQjF_eqElD1HxxsqlcLqw'
ROLE_ID = 1088818348042752131
intents = discord.Intents.default()
intents.members = True
intents.guilds = True
client = commands.Bot(command_prefix='!', intents=intents... | nodesshablya/Shablya_bot | main.py | main.py | py | 572 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "discord.Intents.default",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "discord.Intents",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands.Bot",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": ... |
1048182658 | import os
import os.path
import copy
from collections import OrderedDict
from decimal import *
import distutils.dir_util
import json
import threading
import boto3
import botocore
import time
from pipetree import settings
from pipetree.utils import attach_config_to_object
from pipetree.exceptions import ArtifactMissing... | pipetree/pipetree | pipetree/backend.py | backend.py | py | 27,143 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "copy.copy",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pipetree.utils.attach_config_to_object",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 128,
"usage_type": "call"
},
{
"api_name": "os.p... |
71049095038 | import pyautogui as auto
import pygame
import pygame_widgets as pw
from pygame_widgets.slider import Slider
import random
import numpy
from collections import namedtuple
import sys
DISPLAY_WIDTH = 700
DISPLAY_HEIGHT = 600
class game:
def __init__(self):
self.width = DISPLAY_WIDTH
self.height = D... | adrian-azan/CoreKeeper-AutoFisher | main.py | main.py | py | 6,011 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "pygame.display.set_mode",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.set_caption",
"line_number": 20,
"usage_type": "call"
},
{
"api_name":... |
22313673722 | import copy
import datetime
import json
import os
import uuid
from enum import Enum
from typing import Union, Optional, Dict
from . import GLOBAL_LOGGER
from .MarketUtils import TradeSide, TradeData
LOGGER = GLOBAL_LOGGER.getChild(os.path.basename(os.path.splitext(__file__)[0]))
__all__ = ['OrderState', 'OrderType', ... | BolunHan/Krypton | Krypton/Res/ToolKit/TradeUtils.py | TradeUtils.py | py | 20,335 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.path.basename",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.splitext",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "enum.Enum",
"line_... |
37406432510 | import yt_dlp
import discord
from discord.ext import commands
import asyncio
import logging
import os
from delete import delete_files
home_directory = os.environ['HOME_DIRECTORY']
token = os.environ['DISCORD_TOKEN']
intents = discord.Intents().all()
client = discord.Client(intents=intents)
handler = loggin... | BrendanWagoner/music_discord_bot | main.py | main.py | py | 7,654 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "discord.Intents",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "discord.Client",
"... |
6936070829 | #https://www.acmicpc.net/problem/14940
#14940번-쉬운 최단거리
from collections import deque
import sys
input = sys.stdin.readline
n,m = map(int,input().split())
graph = [list(map(int,input().split())) for _ in range(n)]
visited = [[-1]*m for _ in range(n)]
dx = [-1,1,0,0]
dy = [0,0,-1,1]
for i in range(n):
for j in rang... | yeinshin/Python_Algorithm | baekjoon/baekjoon_14940.py | baekjoon_14940.py | py | 811 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sys.stdin",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 16,
"usage_type": "call"
}
] |
70423658878 | # -*- coding: utf-8 -*-
# !/usr/bin/env python
# @Time : 2018/10/22 15:46
# @Author : xhh
# @Desc :
# @File : full_file_word.py
# @Software: PyCharm
import os
import numpy
import jieba
import jieba.posseg as pseg
import string
from sklearn import feature_extraction
from sklearn.feature_extraction... | XHHz/keyword | keyworld/full_file_word.py | full_file_word.py | py | 3,976 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "time.clock",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 40,... |
27556090939 | """ Attempt at replacing eigen() with scipy's eig()
Doesn't appear to work (e.g. with water-gas or pbm-copper)
I think errors develop over time in eig()
"""
from numpy import amax, array, column_stack, concatenate, diag, dot, eye, \
sqrt, zeros
from scipy.linalg import eig, inv, solve
from gpr.misc.structu... | haranjackson/phd | code/python/experimental/riemann_eig.py | riemann_eig.py | py | 5,397 | python | en | code | 23 | github-code | 97 | [
{
"api_name": "gpr.misc.structures.State",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "gpr.vars.eos.total_energy",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "gpr.misc.structures.State",
"line_number": 69,
"usage_type": "call"
},
{
"api... |
1068166663 | """
Controller for admin
"""
from __future__ import absolute_import
import hashlib
from django.conf import settings
from django.shortcuts import render, redirect
from django.http import HttpResponse, HttpResponseForbidden
from django.db.models import Q, Sum, Count
from django.db.models.loading import get_model
from dj... | garviand/Bazaarboy | Bazaarboy/src/controllers/admin/admin.py | admin.py | py | 6,109 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "django.shortcuts.redirect",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "admin.models",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "django.db.models.Q",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "django.db.m... |
21282906033 | from django.conf.urls import url, include
from rest_framework_nested import routers
from paranuara_api import views
router = routers.DefaultRouter()
router.register(r'companies', views.CompanyViewSet)
router.register(r'people', views.PersonViewSet)
friends_router = routers.NestedSimpleRouter(router, r'people', looku... | jarvis-cochrane/paranuara | paranuara_api/urls.py | urls.py | py | 490 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "rest_framework_nested.routers.DefaultRouter",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "rest_framework_nested.routers",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "paranuara_api.views.CompanyViewSet",
"line_number": 7,
"usage_typ... |
7436620648 | import os
from celery import Celery
from celery.schedules import crontab
from django.conf import settings
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'djangoProject.settings')
app = Celery('djangoProject')
app.config_from_object(settings, namespace='CELERY')
app.conf.beat_schedule = {
'collect-articles-ever... | ohmarinseries/finance-news-API | djangoProject/celery.py | celery.py | py | 453 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.environ.setdefault",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "celery.Celery",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.conf.settings... |
20216549639 | #!/usr/bin/env python3
import gi
from tkinter import *
from tkinter import ttk
from tkinter import font
from picamera import PiCamera
import time
import datetime
import sys
global camera
global endTime1
global endTime2
global endTime3
global endTime4
global timerLength
global startTime1
global startTime2
global startT... | shatteredsword/pi-jumbotron | main.py | main.py | py | 2,046 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "datetime.datetime.now",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "datetime.timedelta",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "time.... |
1961066391 | import pandas as pd
# 划分验证集,保存格式 text[\t]label
from sklearn.model_selection import train_test_split
# 自定义数据集
import os
import codecs
import csv
from paddlehub.dataset.base_nlp_dataset import BaseNLPDataset
def prepare_data():
# 转换编码
def re_encode(path):
with open(path, 'r', encoding='GB2312', error... | GT-AcerZhang/paddlepaddleutils | ernie_finetune/fine_tune.py | fine_tune.py | py | 3,654 | python | en | code | null | github-code | 97 | [
{
"api_name": "pandas.read_csv",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 40,
"usage_type": "call"
},
{
"api_name... |
70695096958 | import json
import random
import unittest
from cloudscope.config import settings
from cloudscope.results.metrics import *
from cloudscope.simulation.network import Message
from cloudscope.utils.serialize import JSONEncoder
from cloudscope.utils.statistics import OnlineVariance
from collections import namedtuple, defau... | bbengfort/cloudscope | tests/test_results/test_metrics.py | test_metrics.py | py | 12,768 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "collections.namedtuple",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "... |
75061614399 | from abc import ABC, abstractmethod
import requests
from src.vacancy import Vacancy
from datetime import datetime
class JobSite(ABC):
@abstractmethod
def get_vacancies_list(self):
pass
@abstractmethod
def creation_objects(self, response):
pass
class HeadHunter(JobSite):
def __... | MaksimPakhomov22/Parse_Vacancies | src/hh.py | hh.py | py | 2,049 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "abc.ABC",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_... |
32166629847 | # coding: utf-8
"""
Operations
The Operations API contains all the Azure Video Indexer APIs, like Upload video, Get insights and more, as well as authorization operations to get access tokens for calling the other operations. For Azure Resource Manager (ARM)-based accounts, some REST APIs like generating an a... | tomconte/videoindexer-samples-python | videoindexer/videoindexer/models/video_insights_statistics.py | video_insights_statistics.py | py | 7,955 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "six.iteritems",
"line_number": 174,
"usage_type": "call"
},
{
"api_name": "pprint.pformat",
"line_number": 199,
"usage_type": "call"
}
] |
35462684236 | import glob
import joblib
def create_metadata():
result = {}
for i, path in enumerate(sorted(glob.glob("images/*.jpg"))):
result[i] = path
joblib.dump(result, "metadata.job.xz", compress=3)
if __name__ == "__main__":
create_metadata()
| koshian2/Reframe-Visualization | metadata.py | metadata.py | py | 261 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "glob.glob",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "joblib.dump",
"line_number": 8,
"usage_type": "call"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.