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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
18920342482 | """Module containing cached JSON schemas."""
from __future__ import annotations
import json
import logging
import re
import typing
from typing import TYPE_CHECKING
import jsonschema
import yaml
from jsonschema.exceptions import ValidationError
from ansiblelint.loaders import yaml_load_safe
from ansiblelint.schemas._... | ansible/ansible-lint | src/ansiblelint/schemas/main.py | main.py | py | 3,535 | python | en | code | 3,198 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "jsonschema.ValidationError",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name":... |
16552182195 | import xml.etree.ElementTree as ET
import pickle
import os
from os import listdir, getcwd
from os.path import join
import shutil
import random
classes0 = ['Abyssinian', 'Bengal', 'Birman', 'Bombay', 'British', 'Egyptian', 'Maine', 'Persian', 'Ragdoll', 'Russian', 'Siamese', 'Sphynx', 'american', 'basset', 'beagle', 'bo... | ideaRunner/yolo-pet | pet_label.py | pet_label.py | py | 4,548 | python | en | code | 19 | github-code | 6 | [
{
"api_name": "xml.etree.ElementTree.parse",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "os.getcwd",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "os.path.e... |
13182715051 | import cv2
import os
# import numpy as np
from skimage.measure import compare_ssim
def remove_simillar_image_by_ssim(path):
img_list = os.listdir(path)
img_list.sort()
save_list = []
count_num = 0
for i in range(len(img_list)):
try:
img = cv2.imread(os.path.join(pa... | callmefish/CSCE636ActionRecognition | delete_similar.py | delete_similar.py | py | 2,603 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "os.listdir",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
... |
11427134898 | from __future__ import annotations
import math
import pathlib
import shutil
from typing import Callable
from tqdm.auto import tqdm
import pandas as pd
import transformers
import peft
import wandb
import torch
import torch.utils.data
import warnings
import audiocap.models
class PredictionLogger(transformers.Trainer... | prompteus/audio-captioning | audiocap/callbacks.py | callbacks.py | py | 6,987 | python | en | code | 10 | github-code | 6 | [
{
"api_name": "transformers.TrainerCallback",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "torch.utils",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "typing.Callable",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "pa... |
42104360380 | #!flask/bin/python
import json
from flask import Flask, jsonify, abort, request, make_response, url_for
# import uuid
from board import Board
app = Flask(__name__)
@app.route('/')
def index():
return "Hello, World!"
used_rooms = {0, 1, 2, 4, 5, 6, 3, 10, 9}
# mappings = {0:'6035844c-8aea-49c3-9e1e-67615c1c12b8... | NishitHada/ZeroCross | server.py | server.py | py | 4,158 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "board.Board",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": ... |
19047498781 | from airflow import DAG
from airflow.operators.python_operator import PythonOperator
from datetime import datetime, timedelta
from algorithm import test
default_args = {
"owner": "airflow",
"depends_on_past": False,
"start_date": datetime(2015, 6, 1),
"email": ["airflow@airflow.com"],
"email_on_fai... | klaus82/airflow-ml | dags/k-means.py | k-means.py | py | 927 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "datetime.datetime",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "airflow.DAG",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
... |
2535383007 | import aiohttp
async def mystBin_upload(output: str, *, content_type: str = "application/json") -> str:
data = bytes(output, 'utf-8')
async with aiohttp.ClientSession() as cs:
async with cs.post('https://mystb.in/documents', data=data) as r:
res = await r.json(content_type=content_type)
... | Rickaym/kwe-sai-sai-music | bot/utils/cloud.py | cloud.py | py | 385 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "aiohttp.ClientSession",
"line_number": 6,
"usage_type": "call"
}
] |
33686868761 | # imports
import sys
import re
from lxml import etree
from printColors import bcolors
def compare(e1, e2):
return compareElements(e1, e2, "/*[1]", 0)
def compareElements(e1, e2, xpath, position):
#print "xpath: "+xpath
#print e1.tag + " : " +e2.tag
e1Qname = etree.QName(e1.tag);
e2Qname = etree.Q... | jnorrellv8/OSCAL | build/ci-cd/python/xmlComparison.py | xmlComparison.py | py | 2,854 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "lxml.etree.QName",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "lxml.etree.QName",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
"line_n... |
32627893774 | from typing import Callable, Dict
from idom import component, html
from nl2pandas.jupyter_interface.styles.styles import plain_button_style
@component
def button(
handle_click: Callable = None,
label: str = '',
button_type: str = "button",
value: str = "",
style: Dict = None,... | SmoKSmoKk/Memory-NLI | src/nl2pandas/jupyter_interface/components/controls.py | controls.py | py | 1,512 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.Callable",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "nl2pandas.jupyter_interface.styles.styles.plain_button_style",
"line_number": 26,
"usage_type": "call"
},
... |
10111068539 | import numpy as np
import pandas as pd
import xgboost as xgb
from sklearn import metrics
from matplotlib import pyplot
import matplotlib.pylab as plt
from matplotlib.pylab import rcParams
rcParams['figure.figsize'] = 12, 4
def xgboost_fit(alg, dtrain, dtest, ytrain, ytest, predictors, target, weight=None, verbose=0, ... | adriamoya/health_hackathon_2018 | models/xgboost_model.py | xgboost_model.py | py | 2,224 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "matplotlib.pylab.rcParams",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "xgboost.DMatrix",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "xgboost.cv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.a... |
3706719232 | from abc import ABC, abstractclassmethod
from django.http.response import HttpResponseRedirect
from django.urls.base import resolve
class BaseMiddleware(ABC):
def _init_(self, get_response, ls_urls_no_validadas, app_name, url_redireccion):
self.get_response = get_response
self.ls_urls_no_validada... | JMVasquezR/AdminECP | nucleo/middleware.py | middleware.py | py | 1,040 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "abc.ABC",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.urls.base.resolve",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.http.response.HttpResponseRedirect",
"line_number": 25,
"usage_type": "call"
},
{
"api_nam... |
25208887220 | import asyncio
from subprocess import Popen
from .srtypes import SrDeviceState, SrBlankState
from uuid import uuid4
from os.path import exists as pth_exists
import json
import shortuuid
import io
from struct import unpack
from itertools import count
from logging import getLogger
from tempfile import TemporaryDirectory
... | drdbrr/webrok | pysigrok/srprocmng.py | srprocmng.py | py | 10,770 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "asyncio.Protocol",
"line_number": 48,
"usage_type": "attribute"
},
{
"api_name": "itertools.count",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "asyncio.Queue... |
21246138044 | import numpy as np
import pandas as pd
from sklearn.compose import ColumnTransformer
from sklearn.impute import SimpleImputer
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import OneHotEncoder
from sklearn.preprocessing import MinMaxScaler
from entities.feature_params import FeatureParams
... | made-ml-in-prod-2021/alexshevchuk7 | ml_project/build_features.py | build_features.py | py | 2,229 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.DataFrame",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "pandas.Series",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame... |
24993886351 | import time
import re
import os
import mx.DateTime
import base64
from tools.translate import _
import tools
from osv import fields,osv,orm
from osv.orm import except_orm
class document_file(osv.osv):
_inherit = "ir.attachment"
_columns = {
'email_notification_ids':fields.one2many('document.emai... | factorlibre/openerp-extra-6.1 | document_change/document_change_mailgate.py | document_change_mailgate.py | py | 2,669 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "osv.osv.osv",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "osv.osv",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "osv.fields.one2many",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "osv.fields",
"line_n... |
7214907050 | import torch
import torch.nn as nn
import torch.optim as optim
#
import numpy as np
import timeit
#https://pytorch.org/tutorials/intermediate/model_parallel_tutorial.html
#minimagen: https://github.com/AssemblyAI-Examples/MinImagen
print("model parallel example")
class ToyModel(nn.Module):
def __init__(self):
... | Zefyrus94/GAN_test | model_parallel.py | model_parallel.py | py | 2,896 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
70184934268 | import numpy as np
import pandas as pd
from sklearn.preprocessing import RobustScaler
import os
os.environ['KMP_DUPLICATE_LIB_OK']='True'
from xgboost import XGBRegressor
from sklearn.metrics import mean_absolute_error
from sklearn.metrics import r2_score
df = pd.read_csv('final_dataset/train.csv')
#Separazi... | danmontesi/CarSpeedPrediction-BIP | xgboost-buono.py | xgboost-buono.py | py | 3,385 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"l... |
43344703133 | import json
__author__ = 'Boris Tsema'
from zope.interface import Interface, implementer
from gorynych.common.application import EventPollingService
from gorynych.chat.domain.model import MessageFactory
CREATE_CHATROOM = """
INSERT INTO
chatrooms(chatroom_name)
VALUES(%s)
"""
class IChatService... | DmitryLoki/gorynych | gorynych/chat/application.py | application.py | py | 4,690 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "zope.interface.Interface",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "gorynych.common.application.EventPollingService",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "gorynych.chat.domain.model.MessageFactory",
"line_number": 47,
"... |
5423463895 | '''
@author:KongWeiKun
@file: get_data.py
@time: 18-1-2 下午1:08
@contact: 836242657@qq.com
'''
import codecs
import csv
import json
import random
import requests
import time
from starbucks.config import *
headers={
'Accept':'application/json, text/plain, */*',
'Accept-Encoding':'gzip, deflate, br',
'Accept-Language':'... | Winniekun/spider | starbucks/get_data.py | get_data.py | py | 4,000 | python | en | code | 139 | github-code | 6 | [
{
"api_name": "requests.post",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "codecs.open",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": ... |
70622684987 | import logging
import os
from contextlib import contextmanager
from pathlib import Path
import pandas as pd
logger = logging.getLogger("benchmark")
@contextmanager
def set_cwd(path: Path):
"""
Sets the cwd within the context and resets it afterwards
Adapted from https://dev.to/teckert/changing-director... | yetinam/pyocto | benchmark/benchmark/wrappers/util.py | util.py | py | 1,642 | python | en | code | 14 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_numbe... |
14673830404 | import re
import os
import shutil
from bs4 import BeautifulSoup
import requests
from tqdm import tqdm
import preproc_and_sentiment_analyzer
# Mimicking a browser request
headers = {"User-Agent": "Mozilla/5.0"}
# Creating dict for removing restricted char from potential filenames to be created
remove_punctuation_map =... | Marc-A87/sa_from_web_scrapping | dl_scrapper.py | dl_scrapper.py | py | 6,759 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.getcwd",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "shutil.rmtree",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.mkdir",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 74,
... |
1854188929 | """
This module has been updated to use AWS SSM Parameter Store.
This not only allows for configuration updates but also stores secrets in an encrypted state.
"""
import requests
import json
import boto3
ssm = boto3.client('ssm', region_name="us-east-1")
#Tokens and IDs
google_oauth_id = None
google_refres... | amlopez29/APIDemo | nest_tokens.py | nest_tokens.py | py | 1,695 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "boto3.client",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 37,
"usage_type": "call"
}
] |
40446411117 | from ray.rllib.utils import try_import_tf, try_import_tfp
from ray.rllib.utils.tf_ops import make_tf_callable
# python libraries
import os
import numpy as np
# tensorflow
tf = try_import_tf()
tfp = try_import_tfp()
if type(tf) == tuple:
tf = tf[0]
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
######################... | tud-amr/AC-LCP | layers/modules.py | modules.py | py | 4,354 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "ray.rllib.utils.try_import_tf",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "ray.rllib.utils.try_import_tfp",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 16,
"usage_type": "attribute"
}
] |
8014496058 | import math
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.checkpoint as checkpoint
from timm.models.layers import DropPath, to_2tuple, trunc_normal_
class NNet(nn.Module):
def __init__(self, in_features, hidden_features=None, out_features=None, act_layer=... | sander-ali/NTIRE_Team01_SAKSRNet | models/team01_SAKSRNet.py | team01_SAKSRNet.py | py | 27,199 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "torch.nn.GELU",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line... |
43807684520 | from unittest import TestCase
import machine
import os
import json
class TestTM(TestCase):
def test_load(self):
M = machine.TM(os.path.join("..", "configs", "ex_821.tm"))
with self.assertRaises(machine.InvalidCharacterInTape):
M.load(machine.TMTape("abc"))
self.assertIsNone(M.l... | andrewburcroff/Turing-Machine | machine/test_TM.py | test_TM.py | py | 3,233 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "unittest.TestCase",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "machine.TM",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8... |
30789779105 | from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from os import path
from flask_login import LoginManager
db = SQLAlchemy()
def create_app():
app = Flask(__name__)
app.config['SECRET_KEY'] = 'cf559170bf7a85a6f3f7e4dcfdb5bc11'
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///todo... | shib1111111/Grocery-Store-App | Grocery_Store/application/__init__.py | __init__.py | py | 1,447 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "user_views.user_views",
"line_number": 20,
"usage_type": "argument"
},
{
"api_name": "admin... |
70284082109 | #-*- coding: utf-8 -*-
import tensorflow as tf
import numpy as np
import skimage
from tqdm import trange
import datetime
import tensorflow.contrib.slim as slim
import os
import cv2
import re
import time
import scipy.misc
from tensorflow.contrib.tensorboard.plugins import projector
import scipy
import nets_frontalizatio... | FoolishBrown/GAN | synthesis.py | synthesis.py | py | 7,653 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "sys.path.insert",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.app",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
... |
538405022 | from rest_framework import serializers
from docstore.models import Document
class DocumentSerializer(serializers.ModelSerializer):
created_by = serializers.ReadOnlyField(source="created_by.username")
updated_by = serializers.ReadOnlyField(source="updated_by.username")
file = serializers.FileField(require... | Muhammad-Akhlaq/Shared-Document-Store-Assignment | docstore/serializers/document_serializer.py | document_serializer.py | py | 1,241 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.ReadOnlyField",
"line_number": 7,
"us... |
825395736 | import os
import shutil
import random
import trimesh
import numpy as np
from sklearn.decomposition import PCA, SparsePCA
from sklearn.manifold import TSNE
import matplotlib.pyplot as plt
import torch
from eval_r_precision import *
from load_data import get_shapenet_full_names, load_clip_feats, load_shape_embed_feats
f... | FreddieRao/TextCondRobotFetch | language2shape/openai_clip/eval/analysis.py | analysis.py | py | 14,396 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "load_data.get_shapenet_full_names",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "load_data.load_clip_feats",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.argsort",
"line_number": 37,
"usage_type": "call"
},
{
"api_nam... |
32182026334 | from Framework.VisualizationBaseObject import *
from Framework.BoundingBox import BoundingBox
from skimage.filters import threshold_otsu
import Framework.Tools.glm as glm
import os
from pathlib import Path
pathname = os.path.dirname(__file__)
parent_path = str(Path(pathname).parents[0])
class Volume(VisualizationBase... | GonzaloSabat/phybers | phybers/src/utils/fibervis/Framework/Volume.py | Volume.py | py | 8,192 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.dirname",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "Framework.Tools.glm.scaleMatri... |
16205836512 | from typing import Any
from xdsl.dialects import cf
from xdsl.interpreter import (
Interpreter,
InterpreterFunctions,
Successor,
impl_terminator,
register_impls,
)
@register_impls
class CfFunctions(InterpreterFunctions):
@impl_terminator(cf.Branch)
def run_br(self, interpreter: Interprete... | xdslproject/xdsl | xdsl/interpreters/cf.py | cf.py | py | 884 | python | en | code | 133 | github-code | 6 | [
{
"api_name": "xdsl.interpreter.InterpreterFunctions",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "xdsl.interpreter.Interpreter",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "xdsl.dialects.cf.Branch",
"line_number": 16,
"usage_type": "attribute"... |
27679552800 | ################################################################################
#Import Modules
################################################################################
import getopt
import os
import shutil
import re
import datetime
import sys
import numpy as np
import datetime as dt
import subprocess as subp
... | comet-licsar/licsar_proc | python/LiCSAR_lib/coreg_lib_debug.py | coreg_lib_debug.py | py | 63,297 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "os.path.exists",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "os.mkdir",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number"... |
71313553787 | import os
import cv2
if os.path.isfile("voc_annotation.txt"):
os.remove("voc_annotation.txt")
def predefined_classes():
i = 0
count = 0
arr={}
for line in open('../data/predefined_classes.txt','r').readlines():
arr[str(i)]=line.strip()
i+=1
return arr
def makexml(txtPath):
files = os.listdir(txtPath)
if ... | leekwunfung817/AI-Project-PscalVOC-and-Yolo-CarRecognition | YoloFileTxtToVocAnnotation.py | YoloFileTxtToVocAnnotation.py | py | 2,001 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.isfile",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "os.remove",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 17... |
25669366915 | from django.shortcuts import render
from bs4 import BeautifulSoup
import requests
hack = 'https://thehackernews.com/'
secnews= 'https://www.itnews.com.au/technology/security'
inf = 'https://www.infosecurity-magazine.com/news/'
hn_list=[]
secnews_list = []
inf_list = []
def get_hack():
r = requests.get(hack).te... | ITprogDM/AgregatorNews | AgregatorNews/news/news_app/views.py | views.py | py | 1,734 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"... |
23381833953 | #########################################################################################
# Imports
#########################################################################################
import platform
import click
from hardshell import __name__, __version__
from hardshell.scanner.scanner import scanner
from hard... | tomburge/hardshell | hardshell/utils/startup.py | startup.py | py | 4,005 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "hardshell.utils.core.startup_banner",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "click.echo",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "click.style",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "hardshell.... |
3975170469 | # -*- coding: utf-8 -*-
from data.transform import *
# from data.transform import Onehot
import numpy as np
import scipy.io as sio
import torch.utils.data as data
from PIL import Image
from torch.utils.data.dataloader import DataLoader
import os
import sys
import pickle
def load_data_gist(path, train=True):
"... | ray0809/pytorch | retrieval/DeepHash/DPSH_PyTorch/data/cifar10.py | cifar10.py | py | 7,598 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "scipy.io.loadmat",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "scipy.io",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "torch.utils.data",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "numpy.int",
"line_numb... |
33666675043 | import urwid
import heapq
import time
import select
import jupyter_client
import nbformat
import logging
import zmq
import zmq_loop.urwid_zmq_event_loop
class JCEventLoop(urwid.SelectEventLoop, metaclass=urwid.MetaSignals):
"""
A `urwid.SelectEventLoop` with loop modified to call signals if a message is avail... | mosiman/jupytui | JupytuiWidgets.py | JupytuiWidgets.py | py | 12,124 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "urwid.SelectEventLoop",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "urwid.MetaSignals",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "zmq.Poller",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "zmq.suga... |
25451770012 | import json
ad=input("ad: ")
soyad=input("soyad: ")
dct={
"ad":ad,
"soyad":soyad
}
file=open("sample.json","r") #sample.json fayli ile elaqe qururug r ile oxuma meqsedin seciriy
x=file.read() #bu metod fayil icindeki melumati goturub, sora x deyisenine yukledim
getXfromJson=json.loads(x) #jsondaki x-i p... | khayalsv/PragmatechFoundationProject | Algorithms/Python/data.py | data.py | py | 866 | python | tr | code | 0 | github-code | 6 | [
{
"api_name": "json.loads",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 19,
"usage_type": "call"
}
] |
70968362749 | import os
import sys
import numpy as np
import pandas as pd
import math
import random
import sklearn
from Test.PY.Lgc import lgc
def read_filename(path, fileType): # 读取文件夹的文件
pathDir = os.listdir(path)
file_path = []
for dir in pathDir:
if os.path.splitext(dir)[1] == fileType: # 筛选txt文件
... | Cqerliu/Eukaryotic-essential-genes | PY/Prediction.py | Prediction.py | py | 7,747 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.listdir",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.splitext",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_num... |
38169396103 | import feedparser
HoneyPotFeed = feedparser.parse("https://www.projecthoneypot.org/list_of_ips.php?rss=1")
def ProjectHoneyPot(ip):
for entry in HoneyPotFeed.entries:
print(entry.title)
if entry.title == ip:
return entry.summary
return "IP not found in Project Honey Pot" | lukasolsen/EmailAnalyser | server/base/modules/ProjectHoneyPot.py | ProjectHoneyPot.py | py | 309 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "feedparser.parse",
"line_number": 3,
"usage_type": "call"
}
] |
36107193634 | import torch
import torch.nn as nn
import network.helper as helper
import network.norm as norm
import network.resnet as resnet
import network.basic_block as bb
import network.hand_module_net as handnet
import network.unprojection as unproj
from network.base_net import BaseNet
def create_hpe_net(opt, gpu_... | KAIST-HCIL/DeepFisheyeNet | network/hand_pose_net.py | hand_pose_net.py | py | 9,812 | python | en | code | 27 | github-code | 6 | [
{
"api_name": "network.unprojection.create_unprojection_net_generator",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "network.unprojection",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "network.helper.init_net",
"line_number": 22,
"usage_type": "c... |
7265947070 | import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
from pylab import *
mpl.rcParams['font.sans-serif'] = ['SimHei']
fileNameStr = './20201215.csv' # 读取最后一天的疫情数据
df = pd.read_csv(fileNameStr, encoding='utf-8')
df['total'] = df['total'].astype(np.int)
df.sort_values('total', inplace=True, asce... | Seizzzz/DailyCodes | Course 202009/Python/final/f.py | f.py | py | 902 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.int",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.title",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "matplotlib.pypl... |
43104136545 | from dataclasses import dataclass
from io import BytesIO
from typing import Any, Optional
import PIL
from PIL import Image as Im
from chalk.shapes.shape import Shape
from chalk.transform import P2, BoundingBox, origin
from chalk.types import Diagram
def from_pil(
im: Im,
alpha: float = 1.0,
) -> Any:
im... | chalk-diagrams/chalk | chalk/shapes/image.py | image.py | py | 1,538 | python | en | code | 230 | github-code | 6 | [
{
"api_name": "PIL.Image",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "cairo.Format",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "cairo.FORMAT_ARGB32",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "cairo.ImageSurfa... |
72531662269 | # pylint: disable=redefined-outer-name
# pylint: disable=unused-argument
# pylint: disable=unused-variable
# pylint: disable=too-many-arguments
import re
from collections.abc import Iterator
from random import randint
from typing import Any
import pytest
from aioresponses import aioresponses
from aioresponses.core im... | ITISFoundation/osparc-deployment-agent | tests/unit/conftest.py | conftest.py | py | 5,509 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "pytest.fixture",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "typing.Any",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "faker.Faker",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "random.randint",
"line_numb... |
39483192060 | import discord, platform, asyncio, random
import json, requests, subprocess, os
from threading import Timer
#RUN WITH SUDO.
#REMOVE ALL R/W/X ACCESS.
client = discord.Client()
token = "NTE5NTgyNjcxMTM1ODM0MTEy.Duhbjw.p3u0N1t89FY74uVq3L6P8bLPHic"
@client.event
async def on_ready():
print('Beep Boop. Conn... | Himanshukr000/CTF-DOCKERS | X-MAS-CTF-2018/docker-web/mechagnome/files/mecha.py | mecha.py | py | 4,751 | python | en | code | 25 | github-code | 6 | [
{
"api_name": "discord.Client",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "discord.Game",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.setgid",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "os.setuid",
"line_number": 4... |
71560088508 | import pandas as pd
import matplotlib.pyplot as plt
from sklearn.preprocessing import StandardScaler
def getTFData(path = "dataset", sets = [1], rulfrac = False, maxrul = None, rulmethod = 'linear'):
"""
Function for loading the NASA Turbofan Dataset. Selected datasets are concatenated. If rulfrac
s... | qm2021-jrohrbec/turbofan | functions.py | functions.py | py | 5,605 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_table",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pandas.read_table",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pandas.read_table",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pandas.read_tab... |
21320858125 | from pathlib import Path
import shutil
import os
try:
import wandb
except Exception as ex:
print(f"Info: wandb not found, proceeding without wandb")
def init_wandb(debug=False):
if not debug:
wandb.init(
project="latenciaga",
sync_tensorboard=True
)
def try_uploa... | Obs01ete/kaggle_latenciaga | src/wandb_support.py | wandb_support.py | py | 674 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "wandb.init",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_nu... |
71756941949 | """
Author: Luca Giancardo
Date: 2017-09-28
Version: 1.0
"""
# import libraries
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
import numpy as np
import skimage as sk
import skimage.io as skio
import skimage.transform as sktr
import skimage.filters as skfl
import skimage.feature as skft
imp... | chinmaymokashicm/bmi_6331 | module_3/assign03.py | assign03.py | py | 2,263 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.use",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.sin",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "numpy.fft.fft",
"line_numbe... |
72532360829 | from dataclasses import dataclass, field
from pathlib import Path
import aioprocessing
from aioprocessing.queues import AioQueue
from fastapi import FastAPI
from ..mounted_fs import MountedVolumes
@dataclass
class OutputsContext:
outputs_path: Path
# _PortKeysEventHandler (generates) -> EventFilter (receiv... | ITISFoundation/osparc-simcore | services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/outputs/_context.py | _context.py | py | 2,073 | python | en | code | 35 | github-code | 6 | [
{
"api_name": "pathlib.Path",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "aioprocessing.queues.AioQueue",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "dataclasses.field",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "aioproce... |
30358440301 | from traits.api import Any, observe
from pyface.timer.api import do_later
from .editor import Editor
from .history_control import HistoryControl
# -------------------------------------------------------------------------
# '_HistoryEditor' class:
# ------------------------------------------------------------------... | enthought/traitsui | traitsui/wx/history_editor.py | history_editor.py | py | 3,010 | python | en | code | 290 | github-code | 6 | [
{
"api_name": "editor.Editor",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "traits.api.Any",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "history_control.HistoryControl",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "pyface.ti... |
72157986748 | #! /usr/bin/env python
"""
CLI for generating saturation plots.
"""
import os
import sys
import re
import math
import glob
import multiprocessing
import random
import argparse
import datetime
import logging
from pymsbayes.utils.argparse_utils import arg_is_dir, arg_is_config
_program_info = {
'name': os.path.ba... | joaks1/PyMsBayes | scripts/dmc_saturation_plot.py | dmc_saturation_plot.py | py | 10,175 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "os.path.basename",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "pymsbayes.utils... |
22469434329 | from unittest.mock import MagicMock
import pytest
from belvo import resources
def test_invoices_create(api_session):
invoices = resources.Invoices(api_session)
invoices.session.post = MagicMock()
invoices.create("fake-link-uuid", "2019-10-01", "2019-11-30", "INFLOW", attach_xml=True)
invoices.sessi... | belvo-finance/belvo-python | tests/unit/test_invoices.py | test_invoices.py | py | 940 | python | en | code | 15 | github-code | 6 | [
{
"api_name": "belvo.resources.Invoices",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "belvo.resources",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "unittest.mock.MagicMock",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "belvo.... |
23866359446 | from collections import OrderedDict
import six
from fparser.two import Fortran2003
from fparser.two.utils import walk, BlockBase, StmtBase
from psyclone.errors import InternalError, GenerationError
from psyclone.psyir.nodes import UnaryOperation, BinaryOperation, \
NaryOperation, Schedule, CodeBlock, IfBlock, Refer... | Otter-Taskification/PSyclone | src/psyclone/psyir/frontend/fparser2.py | fparser2.py | py | 186,252 | python | en | code | null | github-code | 6 | [
{
"api_name": "fparser.two.Fortran2003.Intrinsic_Name",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "fparser.two.Fortran2003",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "psyclone.psyir.symbols.ScalarType.Intrinsic",
"line_number": 26,
"usa... |
29002274109 | from httpx import get, TimeoutException
import time, nonebot, datetime
from nonebot.adapters.onebot.v11 import Bot, Message
from nonebot.log import logger
from AZbot.plugins.json_utils import JsonUtils as ju
from AZbot.plugins.utils import send_forward_msg_type
from AZbot.plugins._error import report_error, error_han... | ACGN-Alliance/Azurlane-helper-bot | AZbot/plugins/server_status/util.py | util.py | py | 4,812 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "AZbot.plugins.config.cfg",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "AZbot.plugins._error.report_error",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "httpx.get",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "... |
72531704509 | # pylint: disable=redefined-outer-name
# pylint: disable=unused-argument
# pylint: disable=unused-variable
# pylint: disable=too-many-arguments
from _common import assert_handler_signature_against_model
from fastapi import APIRouter, status
from models_library.api_schemas_long_running_tasks.tasks import TaskGet
from ... | ITISFoundation/osparc-simcore | api/specs/web-server/_projects_nodes.py | _projects_nodes.py | py | 4,293 | python | en | code | 35 | github-code | 6 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "simcore_service_webserver._meta.API_VTAG",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "models_library.api_schemas_webserver.projects_nodes.NodeCreate",
"line_number": 47... |
72003796987 | import osmnx as ox
import pandas as pd
import networkx as nx
import numpy as np
import random
import math
from tqdm import tqdm
from menucl import main_menu1,menu2
import time
import shutil
import os,sys
import folium
import csv
from folium.features import DivIcon
import folium.plugins as plugins
import codecs
import ... | BaSma99/Generating_Tasks_Using_Crowd_Sensim | ZFMTasks.py | ZFMTasks.py | py | 34,867 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "osmnx.config",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 101,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line... |
13904727231 | ## One device Strategy.
# This is typically used to deliberately test your code on a single device.
# This can be used before switching to a different strategy that distributes across multiple devices
import tensorflow as tf
import tensorflow_hub as hub
import tensorflow_datasets as tfds
# resize the image and nor... | anilkumarchebrolu/tensorflow_advanced_techniques_specialization | course2_custom-distributed-training-with-tensorflow/Week4/C2W4_Lab_4_one-device-strategy.py | C2W4_Lab_4_one-device-strategy.py | py | 3,052 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tensorflow.image.resize",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tensorflow.image",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "tensorflow_hub.KerasLayer",
"line_number": 20,
"usage_type": "call"
},
{
"api_name"... |
27292195444 | #!/usr/bin/python
# -*- coding:utf-8 -*-
import numpy as np
from sklearn.datasets import make_moons
import matplotlib.pyplot as plt
from sklearn.linear_model import LogisticRegressionCV
np.random.seed(10)
x, y = make_moons(200, noise=0.20)
# plt.scatter(x[:, 0], x[:, 1], s=40, c=y, cmap=plt.cm.Spectral)
def plot_d... | WangXiaoCao/TF-Tutorial | mnist/test/test3.py | test3.py | py | 1,472 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.random.seed",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "sklearn.datasets.make_moons",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.m... |
42666357871 | import time
from timeit import default_timer
import logging
logger = logging.getLogger(__file__)
from collections import OrderedDict
def time():
""" returns the time. used instead of time.time for rapid portability"""
return default_timer()
def get_unique_name_list_from_class_list(cls_list):
"""
retur... | ograsdijk/StemLab | stemlab/pyrpl_utils.py | pyrpl_utils.py | py | 3,086 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "timeit.default_timer",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.Filter",
"line_number": 69,
"usage_type": "attribute"
},
{
"api_name": "collections.... |
7254783501 | import os
import gzip
import shutil
import glob
import sys
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.metrics import log_loss, roc_auc_score
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelEncoder, MinMaxScaler
import torch
from deepctr_torch.inputs... | gajagajago/gpack | models/recommendation/deepfm/main.py | main.py | py | 5,729 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.LabelEncoder",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.MinMaxScaler",
"line_number": 57,
"usage_type": "call"
... |
32461732469 | # Import the modules for the GUI
from PyQt5.QtWidgets import *
from PyQt5 import uic
# Imports the moduels for the SMTP intergration
import smtplib
from email import encoders
from email.mime.text import MIMEText
from email.mime.base import MIMEBase
from email.mime.multipart import MIMEMultipart
# Main Code
class MailCl... | markandpreston1/The-Hall-of-Projects-for-Markandpreston | GUI Mail Client/gui-mail-client.py | gui-mail-client.py | py | 3,971 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "PyQt5.uic.loadUi",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "PyQt5.uic",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "smtplib.SMTP",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "email.mime.multipart.MIMEMult... |
18262852606 | from flask import Flask
from flask import request
import json
import pymysql
app = Flask(__name__)
# MySQL database configuration
db_config = {
'user': 'admin',
'password': 'almasfiza',
'host': 'aahshaikh-db-instance.cmorsks1yj0b.us-east-1.rds.amazonaws.com',
'database': 'a3',
'cursorclass': pym... | almasfiza/cloud5409 | A3/app.py | app.py | py | 2,783 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pymysql.cursors",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "flask.request.get_json",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "flask.request"... |
27125358888 | import logging
import logging.config
from db.client import db_create_close, r
logging.config.fileConfig('/opt/TopPatch/conf/logging.config')
logger = logging.getLogger('rvnotifications')
class MonitoringNotificationHandler():
def __init__(self, agentid=None, plugin='rv',
oper_type='install', thre... | SteelHouseLabs/vFense | tp/src/db/monitornotificationhandler.py | monitornotificationhandler.py | py | 2,201 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "logging.config.fileConfig",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "logging.config",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "db.clien... |
21470782586 | import datetime
import os
import PIL.Image as Image
import PIL.ImageDraw as ImageDraw
import PIL.ImageFont as ImageFont
import qrcode
from PIL import Image as Image
# 生成文件夹
def mkdir(path):
folder = os.path.exists(path)
if not folder: # 判断是否存在文件夹如果不存在则创建为文件夹
os.makedirs(path) # makedirs 创建文件时如果路径不... | YueYongDev/ise_qr_generate | main.py | main.py | py | 4,095 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.exists",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "qrcode.QRCode",
"line_num... |
72167833149 | import time
import threading
from pynput.mouse import Button, Controller, Listener
left_button = Button.left
start_stop_button = Button.right
exit_button = Button.middle
skip_button = (350, 950)
reason_button = (430, 750)
submit_button = (1400, 880)
class ClickMouse(threading.Thread):
def __init__(s... | Harry-kp/Chegg_autoskip_question | autoskip_chegg_question.py | autoskip_chegg_question.py | py | 1,825 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "pynput.mouse.Button.left",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "pynput.mouse.Button",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "pynput.mouse.Button.right",
"line_number": 6,
"usage_type": "attribute"
},
{
"api... |
43217794381 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Dec 23 21:06:13 2022
@author: msa
"""
import sys
import numpy as np
from scipy.spatial.distance import cdist
from sklearn.datasets import load_digits
from sklearn.decomposition import PCA
import matplotlib.pyplot as plt
costs = []
def kmeans(x,k, no_of_... | MohamedSidiAbdallard/KMeans | KmeansR.py | KmeansR.py | py | 1,294 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.random.choice",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "scipy.spatial.distance.cdist",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "nu... |
36990984998 | # -*- coding: utf-8 -*-
"""
http://packages.python.org/Flask-OAuth/
"""
import logging
from datetime import datetime
from flask import request, session, redirect, url_for, flash
from flask.ext.oauth import OAuth
from flask.ext.login import login_user, current_user
from tweetmatch import app
from tweetmatch.models impo... | Queens-Hacks/tweetmatch | tweetmatch/twitter.py | twitter.py | py | 6,125 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "flask.ext.oauth.OAuth",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "tweetmatch.app.config",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "tweetmatch.app",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "tweet... |
28713744708 | import torch
from torch.utils.data import DataLoader
from torch.utils.data import Dataset
from torchvision import transforms
import args
# from config_file import domain_adaptation_configs as configs
import os
import numpy as np
class Load_Dataset(Dataset):
# Initialize your data, download, etc.
def __init__... | mohamedr002/SLARDA | Autorgressive_Adaptation/dataloader/dataloader.py | dataloader.py | py | 3,325 | python | en | code | 23 | github-code | 6 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "torch.FloatTensor",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "torch.FloatTensor",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "torchvis... |
39079630119 | import tkinter as tk
import tkinter.scrolledtext as scrolledtext
import tkinter.messagebox as mb
import sqlite3
import sys
from LocationDB import get_database_location
from CreateTable import create_table
from AddStudents import adauga_student
from DisplayDB import afiseaza_studenti
import os
class MainPa... | ISebastianStefan/Facial-Recognition-App | DisplayPage.py | DisplayPage.py | py | 7,902 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "tkinter.Frame",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tkinter.Button",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "tkinter.scrolledtext.ScrolledText",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "tkinte... |
29761133986 | #!/usr/bin/env python3
# -- coding: utf-8 --
import rospy
from oculus_sub import oculus_sub
import numpy as np
from scipy.spatial.transform import Rotation as R
# IKpy imports
from ikpy.utils import plot
from ikpy import chain
# msg
from std_msgs.msg import Float32MultiArray
def head_control(head_position):
he... | wonjaegang/TrackDesign2022 | src/inverse_kinematics.py | inverse_kinematics.py | py | 3,656 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "scipy.spatial.transform.Rotation.from_quat",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "scipy.spatial.transform.Rotation",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "ikpy.chain.Chain.from_urdf_file",
"line_number": 25,
"usage_t... |
22035884268 | #!/usr/bin/env python
import matplotlib
matplotlib.use('Agg')
import numpy as np
import pylab
jacobiData = pylab.loadtxt(open("residual-jacobi.txt"), delimiter='\t', usecols=(2,3))
gsData = pylab.loadtxt(open("residual-gs.txt"), delimiter='\t', usecols=(2,3))
iterationJacobi = jacobiData[:,0]
residualJacobi = jacobi... | moislam1221/GPU_Project | residualPlot.py | residualPlot.py | py | 784 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.use",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pylab.loadtxt",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pylab.loadtxt",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pylab.figure",
"line_numb... |
25005012190 | import cv2
import imutils
import pytesseract
from database import update_table
def rec_img(path):
try:
pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files\Tesseract-OCR\tesseract.exe'
image = cv2.imread(path)
image = imutils.resize(image, width=300 )
gray_image = cv2.cvtColor(image, cv2.COLOR_B... | Preethan17/SPARK | recognition_system.py | recognition_system.py | py | 1,446 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "pytesseract.pytesseract",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "cv2.imread",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "imutils.resize",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
... |
22124067853 | import os
import re
from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer, TfidfTransformer
import pandas as pd
from collections import OrderedDict
from operator import getitem
def datakeywords():
#for each year
#get tfidf
#sort tfidf scores
#print out top terms per year
... | mcwatera/WWTBHT | wwtbht/pages/scripts/datakeywords.py | datakeywords.py | py | 2,847 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.abspath",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line... |
42237926839 | from flask import Flask, render_template, request, redirect
from user import User
app = Flask(__name__)
app.secret_key = "worcesterschire"
@app.route('/')
def index():
return redirect('/users')
@app.route('/users')
def users():
return render_template("all_users.html", users = User.get_all())
@... | MariaMcBride/Coding-Dojo_Full-Stack-Bootcamp | 2-Python/flask_mysql/crud/users_crud/server.py | server.py | py | 1,418 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask.redirect",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "user.User.get_all",
... |
20172354557 | from flask import Flask, render_template, request
from src.logger.logger import set_up_logger
from src.node_relationship.node_edge import get_node_edge
import random
import yaml
__name__ = '__main__'
logger = set_up_logger(__name__)
app = Flask(__name__)
f = open('./config.yml')
config = yaml.load(f)
@app.route("/"... | raylyh/rmbi-capstone-mirror | app.py | app.py | py | 1,027 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "src.logger.logger.set_up_logger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "yaml.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.request.me... |
10785569896 | import os
import logging
from typing import Any
from fastapi import FastAPI, Body
import boto3
AWS_ACCESS_KEY_ID = os.environ['AWS_ACCESS_KEY_ID']
AWS_SECRET_ACCESS_KEY = os.environ['AWS_SECRET_ACCESS_KEY']
API_GATEWAY_ENDPOINT = os.environ['API_GATEWAY_ENDPOINT']
class ConnectionManager:
def __init__(self):
... | iml1111/FastAPI-Simple-Chat | with-apigateway/main.py | main.py | py | 2,082 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "os.environ",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "boto3.client",
"line... |
10059425 | import sqlite3
import pandas as pd
conn = sqlite3.connect("tesla_financials.db")
c = conn.cursor()
def backup_tables(current_name, backup_name):
query = f"ALTER TABLE {current_name} RENAME TO {backup_name}"
return c.execute(query)
backup_tables("BalanceS", "BalanceS_backup")
backup_tables("IncomeS", "Income... | mehmetbuyukgumus/Tesla-Financial-Statement-Analysis | analysis/functions.py | functions.py | py | 1,080 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sqlite3.connect",
"line_number": 4,
"usage_type": "call"
}
] |
30562791598 | import numpy as np
import pandas as pd
from scipy.stats import norm
from typing import Dict,Callable,Union,List
def boot(
data:Union[np.ndarray,pd.DataFrame],
statistic:Callable,
r:int,
**kwargs) -> Dict:
'''
Generate `r` bootstrap replicates of a statistic applied to data.
... | syerramilli/msia420-w2023-lab | week2/boot_utils.py | boot_utils.py | py | 3,378 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.Union",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "numpy.ndarray",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pandas.DataFrame",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "typing.Callable",
... |
75009943226 | #!/usr/bin/python
import os
import __init__
import logging
import Pyro4
from containerTracker import ContainerTracker
from configure import Configure
__init__._check_every_thing_("master")
log = logging.getLogger("RMDocker.Pyro4NameServer")
class Pyro4NameServer:
##default host name for NameServer
hos... | yncxcw/big-c | PyDockerMonitor/pyro4NameServer.py | pyro4NameServer.py | py | 2,617 | python | en | code | 18 | github-code | 6 | [
{
"api_name": "__init__._check_every_thing_",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "configure.Configure",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "co... |
46058886226 | # -*- coding: utf-8 -*-
from django.shortcuts import render, get_object_or_404
from django.contrib.auth import get_user_model
from django.contrib import messages
from django.utils.translation import gettext as _
from djconfig import config
from spirit.core.utils.http import safe_redirect
from spirit.core.utils.views... | nitely/Spirit | spirit/user/admin/views.py | views.py | py | 2,177 | python | en | code | 1,153 | github-code | 6 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.get_object_or_404",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "forms.UserForm",
"line_number": 22,
"usage_type": "call"
},
{
... |
20935448380 | """Main entrypoint for the app."""
import logging
import os
import pickle
from pathlib import Path
from typing import Optional
from fastapi import FastAPI, Request, WebSocket, WebSocketDisconnect
from fastapi.templating import Jinja2Templates
from langchain.memory.buffer import ConversationBufferMemory
from langchain.... | zenocode-org/parolla-chat | main.py | main.py | py | 6,197 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "fastapi.templating.Jinja2Templates",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "typing.Optional",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "la... |
70674890429 | import webapp2
import logging
class UserHandler(webapp2.RequestHandler):
def admin(self):
""" Admin interface
"""
user = users.get_current_user()
if user:
if users.is_current_user_admin():
self.response.headers['Content-Type'] = 'text/plain'
... | karmadonov/0xblog | site/handlers.py | handlers.py | py | 1,188 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "webapp2.RequestHandler",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "logging.warning",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "logging.warning",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "logging.wa... |
32158569471 | import pandas as pd
import numpy as np
import requests
from requests import get
from bs4 import BeautifulSoup
import re
import time
import json
import datetime
from tqdm import tqdm
from colorama import Fore
class IMDB_soup_scraper:
def __init__(self, limit_pages_to_100=True, results_save_path=None):
"""C... | dkoterwa/imdb_scraper | soup/scraper_imdb_soup.py | scraper_imdb_soup.py | py | 6,452 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_numbe... |
16068579377 | from __future__ import unicode_literals
from streamlink_cli.utils import NamedPipe
from streamlink_cli.output import PlayerOutput
from streamlink import Streamlink
from cache import SynchronisedCache as Cache
import time
import os
from functools import partial
from itertools import chain
from player_base import PlayerB... | unusualcomputers/space_window | code/streamer.py | streamer.py | py | 4,403 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logger.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "player_base.PlayerBase",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "player_base.PlayerBase.__init__",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pla... |
19573399200 |
import os
import csv
path_to_htmlfiles = os.getcwd() + "\\Data Bern" #get path to where csv are stored
html_list = os.listdir(path_to_htmlfiles) #list all the html that are in the folder
filepath_list = [path_to_htmlfiles + "\\" + html_file for html_file in html_list] #get list of filepaths
from bs4 import Beauti... | SWPFlow/floodwater_law_coding | write_html_laws_to_csv_bern.py | write_html_laws_to_csv_bern.py | py | 4,725 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.getcwd",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 8... |
24312498590 | import bs4
import requests
import re
from fake_useragent import UserAgent
import os
import json
ua = UserAgent()
fishDataPath = '/home/victor/Projects/FishJawnDBData'
#inital wiki page with list of marine life in NYC/Jersey area
fishWikiUrl = 'https://en.wikipedia.org/wiki/Marine_life_of_New_York%E2%80%93New_Jerse... | Vguerrero42/FishJawnScraper | scraper.py | scraper.py | py | 2,343 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "fake_useragent.UserAgent",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "requests.get",
"lin... |
1567106748 | import time
import requests
from telegram import Bot, Update, InlineKeyboardMarkup, InlineKeyboardButton
from telegram.ext import CallbackQueryHandler, ConversationHandler
from board.main import active_boards, handle_active_board
from properties import server_host
CLARIFICATION = range(1)
def get_clarify_finishe... | EvansShamChan/task-manager-bot | board/finish.py | finish.py | py | 2,218 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "telegram.InlineKeyboardButton",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "telegram.InlineKeyboardButton",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "telegram.InlineKeyboardMarkup",
"line_number": 22,
"usage_type": "call"
},
... |
12733057335 | import logging
from pkg.auth import jwt
from pkg.db.datastore import data_store
from pkg.db.mongo import MongoStore
from pkg.openapi import types
logger = logging.getLogger('api.v1.app_specs')
def import_appspecs_recursive():
# TODO: Rely on the Helm postinstall / init_container / Job for this
return
# T... | nds-org/workbench-apiserver-python | api/v1/app_specs.py | app_specs.py | py | 8,570 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pkg.openapi.types.validate_instance",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pkg.openapi.types",
"line_number": 27,
"usage_type": "name"
},
{
"api_name":... |
27241747191 | import matplotlib.pyplot as plt
range_5000 = list(range(501))
cube_5000 = [x**3 for x in range_5000]
plt.figure(figsize=(10, 6))
plt.plot(cube_5000, c='blue', linewidth=10)
plt.title('First 5 number\'s cube', fontsize=26)
plt.xlabel('Numbers', fontsize=14)
plt.ylabel('Cubes', fontsize=14)
plt.tick_params(axis='both',... | mbrad26/Data-Vizualization | Recap/recap_1.py | recap_1.py | py | 360 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplo... |
73076323707 | import json
import os
import sys
from typing import Any, Dict, Optional
from bot import app_vars, utils
from bot.config.models import ConfigModel
from bot.migrators import config_migrator
import portalocker
config_data_type = Dict[str, Any]
def save_default_file() -> None:
with open(utils.get_abs_path("config_... | gumerov-amir/TTMediaBot | bot/config/__init__.py | __init__.py | py | 1,998 | python | en | code | 52 | github-code | 6 | [
{
"api_name": "typing.Dict",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "bot.utils.get_abs_path",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "bot.utils",
"line_n... |
21142599945 | import os
import signal
import sys
from time import time
import numpy as np
import tensorflow as tf
from matplotlib import pyplot as plt # noqa
from tensorflow.python.client import timeline
import datahandler
from nets.convlayers import InPlaneSplit
from nets.utils import (build_default_minimizer, get_act_fn_by_name... | tsoernes/dca | dca/nets/net.py | net.py | py | 15,022 | python | en | code | 14 | github-code | 6 | [
{
"api_name": "os.environ",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "nets.utils.get_act_fn_by_name",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "nets.utils.get_init_by_name",
"line_number": 42,
"usage_type": "call"
},
{
"api_nam... |
74977717947 | import csv
import re
import logging
from dipper.sources.Source import Source
from dipper.models.assoc.G2PAssoc import G2PAssoc
from dipper.models.Reference import Reference
from dipper.models.Genotype import Genotype
from dipper.models.Model import Model
LOG = logging.getLogger(__name__)
class MMRRC(Source):
"... | monarch-initiative/dipper | dipper/sources/MMRRC.py | MMRRC.py | py | 18,309 | python | en | code | 53 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "dipper.sources.Source.Source",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "dipper.models.Model.Model",
"line_number": 135,
"usage_type": "call"
},
{
"api_nam... |
14222892317 | import os
import paho.mqtt.client as PahoMQTT
import json
import time
from MyMQTT import *
import requests
class PostValueThingspeak:
def __init__(self, ClientID, broker, host, port):
self.clientID = ClientID
self.broker = broker
self.host = host
self.port = port
self.initia... | giulia-pall/polito-programming-iot | ADAPTOR/Thingspeak.py | Thingspeak.py | py | 4,262 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "time.sleep",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": ... |
43958534300 | from copy import deepcopy
from enum import Enum, auto
TURN_WEIGHT = 1
HEURISTIC_WEIGHT = 1
class NodeTypeInitiator:
def __init__(self, type, is_from_init=True):
self.type = type
self.is_from_init = is_from_init
def __str__(self):
return f'NodeType.{self.type}.value'
class NodeType(En... | asianhaydenxd/pathfinder | pathfinder.py | pathfinder.py | py | 8,510 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "enum.Enum",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "enum.auto",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "enum.auto",
"line_number": 26,
... |
5159120238 | import boto3
import os
import logging
import json
from difflib import SequenceMatcher
def get_title(json_content):
title_possibilities = []
for key in json_content:
similarity = SequenceMatcher(None, key, "title").ratio()
if similarity >= 0.8:
title_possibilities.append({ 'key': key, 'similarity':... | GonzaH/chapter-aws-mim | functions/getFixedFileContent.py | getFixedFileContent.py | py | 1,220 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "difflib.SequenceMatcher",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.error",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.environ",
... |
43201401561 | """Basic tests for the Ruby base container images."""
import pytest
from pytest_container.runtime import LOCALHOST
from bci_tester.data import OS_VERSION
from bci_tester.data import RUBY_CONTAINERS
CONTAINER_IMAGES = RUBY_CONTAINERS
_NON_X86_64_OR_AARCH64_SKIP = pytest.mark.skipif(
LOCALHOST.system_info.arch i... | SUSE/BCI-tests | tests/test_ruby.py | test_ruby.py | py | 3,818 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "bci_tester.data.RUBY_CONTAINERS",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "pytest.mark.skipif",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "py... |
43895550565 |
from django.contrib import admin
from django.urls import path,include
from mainapp import views
from mainapp.views import *
from rest_framework.routers import DefaultRouter
router= DefaultRouter()
router.register("school", SchoolViewSet, basename="user")
router.register("student", StudentViewSet, basename ="student... | ahkahsiv/Task_1 | Task/Task/urls.py | urls.py | py | 654 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "rest_framework.routers.DefaultRouter",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 14,
"usage_type": "attribute"
},
{
... |
27978223389 | from pathlib import Path
import nbformat
import pytest
import yaml
from markdown_it.utils import read_fixture_file
from myst_parser.docutils_renderer import make_document
from myst_parser.main import MdParserConfig
from myst_parser.sphinx_renderer import mock_sphinx_env
from myst_nb.parser import nb_to_tokens, tokens... | andrewellis55/MyST-NB | tests/test_nb_render.py | test_nb_render.py | py | 1,737 | python | en | code | null | github-code | 6 | [
{
"api_name": "pathlib.Path",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "yaml.safe_load",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "nbformat.from_dict",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "myst_nb.parser.nb_to_t... |
24370172186 | import unittest
import matplotlib.pyplot as plt
class TestCCDProjection(unittest.TestCase):
def test_ccd_projection(self):
from src.dataio import GridIO, FlowIO
from src.create_particles import Particle, LaserSheet, CreateParticles
from src.ccd_projection import CCDProjection
# Re... | kalagotla/syPIV | test/test_ccd_projection.py | test_ccd_projection.py | py | 2,359 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "unittest.TestCase",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "src.dataio.GridIO",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "src.dataio.FlowIO",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "src.create_... |
73618669949 | from app import db
from marshmallow import Schema, fields
class InventoryItem(db.Model):
__tablename__ = 'inventory_items'
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(100), nullable=False)
quantity = db.Column(db.Integer, nullable=False)
price = db.Column(db.Float, nulla... | Sergen1993/SergenTasdivarT2A2 | models/inventory_item.py | inventory_item.py | py | 813 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "app.db.Model",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "app.db",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "app.db.Column",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "app.db",
"line_number": 6,
... |
14610077515 | import unittest
from code.base_class.method import methodConfig
from code.lib.comet_listeners import CometMethodHandler
from code.lib.notifier import ClassificationNotification
from code.stage_1_code.Method_MLP import Method_MLP
from unittest.mock import MagicMock
import torch
from comet_ml import Experiment
from torc... | alejandroarmas/some-dl-models | code/tests/test_metric_refactor.py | test_metric_refactor.py | py | 2,217 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "unittest.TestCase",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "torch.device",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torchmetrics.MetricCollection",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "tor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.