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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
26869257903 | import time
import traceback
import utils.constants as Constants
from actuators.actuator import Actuator
import logging
logger = logging.getLogger("mqtt-nao-interface.actuators.behavior.behavior")
class BehaviorActuator(Actuator):
""" An actuator of behaviors stored in Nao's memory"""
def __init__(self, nao... | dellannadavide/MQTT-Nao-Interface | actuators/behavior/behavior.py | behavior.py | py | 4,312 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "actuators.actuator.Actuator",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "utils.constants.NAO_SERVICE_MEMORY",
"line_number": 14,
"usage_type": "attribute"
},
{
... |
26683669423 | import open3d as o3d # prevent loading error
import sys
import json
import logging
import torch
from easydict import EasyDict as edict
from lib.all_data_loaders import make_data_loader
from config import get_config
from lib.lfgc_trainer import LFGCTrainer
from lib.oa_trainer import OATrainer
from lib.twodim_trainer... | chrischoy/HighDimConvNets | train.py | train.py | py | 2,537 | python | en | code | 37 | github-code | 7 | [
{
"api_name": "logging.StreamHandler",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "logging.INFO"... |
27140864371 | import itertools as it
import numpy as np
import copy
class BoardState(object):
NOBODY = 0
X = 1
O = 2
DRAW = 3
def __init__(self, board_size, win_len):
assert board_size >= 3
assert win_len >= 3
assert win_len <= board_size
self.field = None
self.current_... | menshikh-iv/gomoku-rl | gomoku_env.py | gomoku_env.py | py | 4,029 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.zeros",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "itertools.chain.from_iterable",... |
45158366008 | #!/usr/bin/env python3
import re
import sys
import time
import statistics
from typing import List, Match, Optional
from copy import copy, deepcopy
from collections import defaultdict
from itertools import repeat
from functools import partial
#from advent import sirange, srange, nddict
import pprint
import math
#from a... | Princemachiavelli/advent-of-code | 2022/10.py | 10.py | py | 2,693 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.argv",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "pprint.PrettyPrinter",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_... |
70896634463 | #!/Users/esteban/venv/bin/python
#
# Author: kyng-codeops
# Date: 2019/12/02
# Updated: 2019/12/09
# Version: 1.0
from datetime import datetime
import piexif
import argparse
import sys
import glob
def set_exif_datetime(file, yr, m, d, hr, mn, sec):
filename = file
try:
exif_dict = piexif.load... | kyng-codeops/exif_tool | exif_tool.py | exif_tool.py | py | 4,243 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "piexif.load",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "piexif.ExifIFD",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "piexif.dump",
"... |
39766866316 | from django.contrib.auth import get_user_model
from django.core.urlresolvers import reverse
from django.db import models
from django import forms
from django.shortcuts import get_object_or_404
from decorators import cached_property
class UserEmailForm(forms.ModelForm):
class Meta:
fields = ('email',)
model ... | chriscauley/lablackey | lablackey/forms.py | forms.py | py | 4,462 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 12,
"usage_type": "call"
},
{
"api_nam... |
71935648543 | import json
import logging
import os
import shutil
import tempfile
import time
import unittest
import xmlrpc.client
import zipfile
from cros.factory.device import device_utils
from cros.factory.test.pytests.offline_test.shell import common
from cros.factory.test import server_proxy
from cros.factory.test import sessio... | arccode/factory | py/test/pytests/offline_test/shell/fetch_log.py | fetch_log.py | py | 4,645 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "unittest.TestCase",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "cros.factory.utils.arg_utils.Arg",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "cros.factory.utils.arg_utils.Arg",
"line_number": 37,
"usage_type": "call"
},
... |
7352202230 | import matplotlib.pyplot as plt
import numpy as np
abscissa = np.arange(20)
plt.gca().set_prop_cycle('color', ['red', 'green', 'blue', 'black'])
class MyLine:
def __init__(self, *args,**options):
if len(args) == 2:
if (type(args[0]) == tuple and type(args[1]) == tuple) or "2pts" in options.va... | JaredTully/C200jttully | Assignment11/lineclass.py | lineclass.py | py | 2,019 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.arange",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.gca",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.p... |
13451720826 | import os
from shutil import copy
import json
PACKAGE_RELEASE_NUMBER = None
if not os.path.exists("xdsmjs/dist"):
os.makedirs("xdsmjs/dist")
# copy assets
copy("../dist/xdsmjs.js", "xdsmjs/dist/")
copy("../fontello.css", "xdsmjs/dist/")
copy("../xdsmjs.css", "xdsmjs/dist/")
# change version
version = "0.0.0"
wi... | whatsopt/XDSMjs | py_xdsmjs/make_pyxdsmjs.py | make_pyxdsmjs.py | py | 688 | python | en | code | 12 | github-code | 7 | [
{
"api_name": "os.path.exists",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "shutil.copy",
"line_number":... |
12912537225 | import odoorpc
import progressbar
odoo = odoorpc.ODOO(timeout=4000000000)
odoo.login('soluziono', 'admin', 'S0l4z10n0')
ilines = odoo.env['account.invoice.line'].search([(
'quantity_unsigned', '<=', 0)])
lines = odoo.env['account.invoice.line'].browse(ilines)
count = 0
with progressbar.ProgressBar(max_value=len(lin... | luistriana28/Scripts | qty_unsigned.py | qty_unsigned.py | py | 780 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "odoorpc.ODOO",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "progressbar.ProgressBar",
"line_number": 9,
"usage_type": "call"
}
] |
29923115286 | #
# cv.py
# Computer Vision Utilities
#
import cv2
# OpenCV utilities
# Captures and Returns a grayscale frame from the camera
# Rescales the frame for the given scale
# Return frame is represented as a numpy array
capture = None
def capture_frame(scale=0.5):
global capture
if capture == None: capture = cv2.Vi... | mrzzy/MLCourseStarterPack | session_2/dabnet/cv.py | cv.py | py | 1,157 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "cv2.resize",
... |
28099970471 | import itertools
import shutil
from collections import defaultdict
from pathlib import Path
from typing import Sequence
from io import StringIO
import colorama as clr
from natsort import natsorted
from attrs import frozen
import pcleaner.structures as st
import pcleaner.helpers as hp
@frozen
class OCRAnalytic:
... | VoxelCubes/PanelCleaner | pcleaner/analytics.py | analytics.py | py | 17,878 | python | en | code | 80 | github-code | 7 | [
{
"api_name": "typing.Sequence",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "typing.Sequence",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "attrs.frozen",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "shutil.get_terminal_size... |
19575874353 | """
author - N@vindu
Input - voice files from (https://drive.google.com/drive/folders/1HdE6trrwraLuS7pvPTrTg9aiBzSlJb-4?usp=sharing) save in to root file
"""
import librosa
import librosa.display
import pandas as pd
import numpy as np
from tqdm import tqdm
from os import walk
import pickle
mypath1="./voice/HEALTHY... | mrRobot-95/Voice-classification-with-machine-learn | Voice_analyse_model.py | Voice_analyse_model.py | py | 7,327 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.walk",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame.from_dict",
"line_number": 143,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 143,
"usage_type": "attribute"
},
{
"api_name": "scipy.io.w... |
16681001173 | import pytest
import shutil
import os
import sys
import uuid
from subprocess import check_call
# Append current directory to system path in order to import testconfig
sys.path.append(".")
import testconfig as tcf
from utils import assert_taql, untar_ms
"""
Tests for applying the beam model.
Script can be invoked in... | lofar-astron/DP3 | steps/test/integration/tDemix.py | tDemix.py | py | 4,753 | python | en | code | 14 | github-code | 7 | [
{
"api_name": "sys.path.append",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": 4... |
39392111750 | #Script containing the necessary functions to preprocess the images (224x224) and the labels -- First Version - no pairs (master)
# Dataset : wget -q https://www.dropbox.com/s/5zarkyny7ywc2fv/PROXEMICS.zip
# FUNCTIONS:
# -label_preprocessing
# -img_preprocessing
import numpy as np
import scipy.io
import cv2
import os
... | AVAuco/proxemicsnet | dataset/preprocessingDataset.py | preprocessingDataset.py | py | 7,402 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "scipy.io.io.loadmat",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "scipy.io.io",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "scipy.io",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line... |
20353346224 | #!/usr/bin/env python3
#from stravaio import strava_oauth2
import gpxpy.gpx
import gpxpy
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
gpx_file = open('Crystal_Mountain_first_time.gpx', 'r')
gpx = gpxpy.parse(gpx_file)
lats = []
longs = []
elevs = []
velocities = [0]
def difference(x1, x2, y... | mdwelsh/skimapper | skimapper.py | skimapper.py | py | 966 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "gpxpy.parse",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style.use",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "... |
27780979519 | import argparse
from googlecloudsdk.calliope import actions
from googlecloudsdk.calliope import base
from googlecloudsdk.core import log
from googlecloudsdk.core import properties
from googlecloudsdk.core import resolvers
from googlecloudsdk.core import resources as cloud_resources
from googlecloudsdk.third_party.apis... | twistedpair/google-cloud-sdk | google-cloud-sdk/lib/googlecloudsdk/surface/dataflow/__init__.py | __init__.py | py | 2,534 | python | en | code | 55 | github-code | 7 | [
{
"api_name": "googlecloudsdk.calliope.base.Group",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "googlecloudsdk.calliope.base",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "argparse.SUPPRESS",
"line_number": 37,
"usage_type": "attribute"
}... |
9719431818 | """General utility functions for manipulating emotion metrics data.
"""
import logging
_LOG = logging.getLogger('affective_reward.webapp.feelnet')
def get_emotion_dict(emo_metrics):
"""Returns a dictionary in which keys are emotions and values are confidences.
Args:
emo_metrics: A list of dictionaries, whi... | magenta/magenta-demos | appengine/server/utils.py | utils.py | py | 2,381 | python | en | code | 1,281 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
}
] |
35136542503 | from os import getenv
from aiogram import F, Router
from aiogram.types import Message, CallbackQuery
from aiogram.types import FSInputFile
from bot.database.methods.get import *
from bot.handlers.user.utils import deadline_message
from bot.keyboards.admin.reply import *
from bot.keyboards.admin.inline import *
from... | MarselNet86/XRT | bot/handlers/admin/panel.py | panel.py | py | 2,780 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "aiogram.Router",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "aiogram.types.Message",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "aiogram.F.from_user.id... |
30412628034 | from PyQt5.QtWidgets import QFileDialog, QErrorMessage, QMessageBox
from gpxplotter import read_gpx_file, create_folium_map, add_segment_to_map, add_all_tiles
import folium
import decodeScript
import io
import tempfile
import os
def loadFile(self):
global df, gpx
filename = QFileDialog.getOpenFileName(self, "O... | Carnuntum/fit-gpx-file-viewer | btnMethods.py | btnMethods.py | py | 2,606 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "PyQt5.QtWidgets.QFileDialog.getOpenFileName",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QFileDialog",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "decodeScript.makeDataFrames",
"line_number": 16,
"usage_type": "c... |
9916681393 | import json
import os
import shutil
from pathlib import Path
import pytest
from em_workflows.file_path import FilePath
@pytest.fixture
def mock_reuse_zarr(monkeypatch):
"""
Reuses zarr generated from bioformats2raw
One of the most expensive operation in tests is using bf2raw command
This test assumes ... | niaid/image_portal_workflows | test/test_czi.py | test_czi.py | py | 5,032 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "em_workflows.file_path.FilePath",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "em_workflows.utils.neuroglancer.bioformats_gen_zarr",
"line_number": 24,
"usage_type": "call... |
33272832500 | from super_gradients.training import Trainer
from super_gradients.training import dataloaders
from super_gradients.training.dataloaders.dataloaders import (
coco_detection_yolo_format_train,
coco_detection_yolo_format_val
)
from super_gradients.training import models
from super_gradients.training.losses import... | nasheshin01/RubiksCubeDetector | YoloTrainPart/yolo_nas_train.py | yolo_nas_train.py | py | 4,489 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "super_gradients.training.dataloaders.dataloaders.coco_detection_yolo_format_train",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "super_gradients.training.dataloaders.dataloaders.coco_detection_yolo_format_val",
"line_number": 64,
"usage_type": "call"
},
{
... |
23174287356 | from typing import Union, List, Dict
from pathlib import Path
from enum import Enum
import tensorflow as tf
from zipfile import ZipFile
from csbdeep.utils import save_json
from ..models.n2v_config import N2VConfig
class Extensions(Enum):
BIOIMAGE_EXT = ".bioimage.io.zip"
KERAS_EXT = ".h5"
TF_EXT = ".zip... | juglab/n2v | n2v/utils/export_utils.py | export_utils.py | py | 5,399 | python | en | code | 348 | github-code | 7 | [
{
"api_name": "enum.Enum",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 38,
... |
31391801481 | import dataclasses
import datetime
import logging
from typing import Callable, Dict, Iterable, List, Optional, Tuple, cast
from snowflake.sqlalchemy import snowdialect
from sqlalchemy import create_engine, inspect
from sqlalchemy.sql import sqltypes
from datahub.emitter.mce_builder import make_dataset_urn_with_platfo... | pablochen/datahub-custom | metadata-ingestion/src/datahub/ingestion/source/snowflake/snowflake_profiler.py | snowflake_profiler.py | py | 9,409 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "snowflake.sqlalchemy.snowdialect.ischema_names",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "snowflake.sqlalchemy.snowdialect",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.sql.sqltypes.NullType",
"line_number": 27,
... |
37025729419 | from django.shortcuts import render as django_render, redirect
from django.core.urlresolvers import reverse
from django.utils.http import urlencode
from django.core.files.base import ContentFile
import io
from PIL import Image, ExifTags
class render(object):
"""
Decorator that allows a view function to just ... | DevFamily99/villages-django | general/util.py | util.py | py | 4,217 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.shortcuts.render",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "django.core.urlresolvers.reverse",
"line_number": 88,
"usage_type": "call"
},
{
... |
34221477045 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from scipy.optimize import curve_fit
from math import pi
sns.set_style(style='white')
data1 = pd.read_csv("../data/obd_non_data.csv")
data2 = pd.read_csv("../data/obd_0043_data.csv")
data3 = pd.read_csv("../data/obd_433_data.... | KariEriksen/VMC | plot/one_body_plot.py | one_body_plot.py | py | 1,248 | python | en | code | 4 | github-code | 7 | [
{
"api_name": "seaborn.set_style",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
... |
10102885883 | from enum import IntEnum
from typing import Annotated, Literal, TypeAlias
from attrs import frozen
try:
from enum import ReprEnum as Enum
except ImportError:
from enum import Enum
@frozen
class ScalarMarker:
signed: bool
width: Literal[8, 16, 32, 64]
Uint8 = Annotated[int, ScalarMarker(False, 8)]
... | pocketzworld/flattrs | src/flattrs/types.py | types.py | py | 1,413 | python | en | code | 9 | github-code | 7 | [
{
"api_name": "typing.Literal",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "attrs.frozen",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.Annotated",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "typing.Annotated",
"... |
9103779527 | import re
from setuptools import setup, find_packages
def get_reqs():
reqs = []
for line in open("requirements.txt", "r").readlines():
reqs.append(line)
return reqs
def get_property(prop, project):
result = re.search(
r'{}\s*=\s*[\'"]([^\'"]*)[\'"]'.format(prop),
open(project +... | richardson-t/starsign | setup.py | setup.py | py | 680 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "re.search",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "setuptools.setup",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 22,
"usage_type": "call"
}
] |
38274871212 | from bs4 import BeautifulSoup
import requests
import json
import mysql.connector
from patagoniaWriter import Writer
# Solicita el source code de la pagina ingresada y lo retorna como texto en la variable $source
# En este caso se encontro el modulo embebido en la pagina de cotizaciones, diretctamente retorna la tabla ... | Nachichuri/divisame | scrapers/patagonia/main.py | main.py | py | 1,078 | python | es | code | 0 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "patagoniaWriter.Writer",
"line_number": 33,
"usage_type": "call"
}
] |
15564374104 | import numpy as np
import cv2
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import pickle
import warp as w
import camera_cal as cc
import line_finding as lf
from line_finding import Line
import preprocess as pre
import os
from moviepy.editor import VideoFileClip
from IPython.display import HTML
from... | nachoSO/CarND-Advanced-Lane-Lines-master | main.py | main.py | py | 2,604 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "camera_cal.calibrate_image",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "preprocess.threshold_pipeline",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "warp.perspective_transform",
"line_number": 32,
"usage_type": "call"
},
{
... |
34161298999 | import sys
from confluent_kafka import Producer
# command
# python .\producer_take_arguments.py localhost:9092 quickstart-events my-key my-value
def produce_message(bootstrap_servers, topic, key, value):
producer_config = {
'bootstrap.servers': bootstrap_servers,
'client.id': 'python-producer'
... | muhenan/python-kafka | python-kafka/producer_take_arguments.py | producer_take_arguments.py | py | 1,019 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "confluent_kafka.Producer",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_... |
42216458266 | # oxit staff view
import traceback
from rest_framework.response import Response
from rest_framework import status
from rest_framework.views import APIView
from management.models.APIObject import APIObject
from management.serializers.StaffSerializer import StaffSerializer, StaffPageableSerializer
from pms.models impor... | furkanyalcindag/oxit-patientManagementSystem | management/views/StaffView.py | StaffView.py | py | 5,266 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "rest_framework.views.APIView",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "pms.models.Profile.objects.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pms.models.Profile.objects",
"line_number": 17,
"usage_type": "attribute"
}... |
71868465504 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import imagekit.models.fields
import pythonbeach.core.models
class Migration(migrations.Migration):
dependencies = [
('core', '0002_auto_20150714_0122'),
]
operations = [
migrations.... | dunderlabs/pythonbeach | pythonbeach/core/migrations/0003_auto_20150714_1958.py | 0003_auto_20150714_1958.py | py | 1,004 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.RemoveField",
"line_number": 16,
"usage_type": "call"
},
... |
17079476252 | """
File name: test_noFuelPlant
Date created: 28/11/2018
Feature: #Enter feature description here
"""
from unittest import TestCase
from pytest import approx
from elecsim.plants.plant_type.non_fuel_plant import NonFuelPlant
__author__ = "Alexander Kell"
__copyright__ = "Copyright 2018, Alexander Kell"
__license__ ... | alexanderkell/elecsim | test/test_plants/test_plants/test_noFuelPlant.py | test_noFuelPlant.py | py | 2,109 | python | en | code | 36 | github-code | 7 | [
{
"api_name": "unittest.TestCase",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "elecsim.plants.plant_type.non_fuel_plant.NonFuelPlant",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "pytest.approx",
"line_number": 39,
"usage_type": "call"
}
] |
1930752106 | import requests
import json
api_request=requests.get("https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest?start=1&limit=5&convert=USD&CMC_PRO_API_KEY=6c0f5764-4356-4ba4-8e23-b52996b63242")
api=json.loads(api_request.content)
coins=[
{
"symbol":"BTC",
"amount_owned":2,
"price... | sidharthcp48/test | calculating profit and loss.py | calculating profit and loss.py | py | 1,480 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 4,
"usage_type": "call"
}
] |
29580194088 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('teachers', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='materias',
old_name... | guilouro/escola | teachers/migrations/0002_auto_20150127_1128.py | 0002_auto_20150127_1128.py | py | 380 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.RenameField",
"line_number": 14,
"usage_type": "call"
},
... |
18474356927 | """Common Utils."""
import time
from datetime import datetime, timedelta, date
from typing import List, Dict, Any
from marshmallow import ValidationError
from tbutilslib.config.constants import (TB_DATE_FORMAT,
START_TIME, END_TIME,
FULL... | letspython3x/tbutilslib | src/tbutilslib/utils/common.py | common.py | py | 5,944 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "tbutilslib.config.constants.TB_DATE_FORMAT",
"line_number": 13,
"usage_type": "argument"
},
{
"api_name": "datetime.datetime.today",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 13,
"usage_type": "name"
},
... |
32786426693 | # A basic web server using sockets
import socket
import http.client
import json
PORT = 8092
MAX_OPEN_REQUESTS = 5
def process_client(clientsocket):
headers = {'User-Agent': 'http-client'}
conn = http.client.HTTPSConnection("api.fda.gov")
conn.request("GET", "/drug/label.json?limit=10", None, headers)
r1 = con... | paulamontes119/openfda | openfda-3/server_web_,modified.py | server_web_,modified.py | py | 2,117 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "http.client.client.HTTPSConnection",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "http.client.client",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "http.client",
"line_number": 15,
"usage_type": "name"
},
{
"api_name":... |
19576700093 | import commands
from tornado.queues import PriorityQueue
def test_prqueue_insert():
q = PriorityQueue()
my_std_command1 = commands.StandardCommad({'pin' : 5 , 'dt' : 0.2})
q.put(my_std_command1)
my_std_command2 = commands.StandardCommad({'pin' : 6 , 'dt' : 0.3})
q.put(my_std_command2)
... | acorbe/pyIoTents | tests.py | tests.py | py | 1,014 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "tornado.queues.PriorityQueue",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "commands.StandardCommad",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "commands.StandardCommad",
"line_number": 13,
"usage_type": "call"
},
{
"api_n... |
39038930742 | #coding:utf-8
import urllib.request
from bs4 import BeautifulSoup
import nltk
from nltk.corpus import stopwords
response=urllib.request.urlopen('http://php.net/')
html=response.read()
soup=BeautifulSoup(html,'html5lib')
text=soup.get_text(strip=True)
tokens=text.split()
#去掉停用词
sr = stopwords.words('english')
cle... | NothinkingGao/nltk-record | nltk-lession1.py | nltk-lession1.py | py | 526 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "urllib.request.request.urlopen",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "urllib.request",
"line_number": 7,
"usage_type": "name"
},
{
"api_name":... |
7335252538 | # All rights reserved by forest fairy.
# You cannot modify or share anything without sacrifice.
# If you don't agree, keep calm and don't look at code bellow!
__author__ = "VirtualV <https://github.com/virtualvfix>"
__date__ = "$Apr 29, 2015 12:04:19 PM$"
import re
from .base import Base
from config import CONFIG
fro... | VirtualVFix/AndroidTestFramework | src/libs/device/shell/temperature.py | temperature.py | py | 6,794 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "base.Base",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "libs.core.logger.getLogger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "config.CONFIG.propertyByDevice",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "c... |
27412403877 | #!/usr/bin/env python
import settings # Importing required modules
import cv2 # OpenCV # For face emotion detection
from fer import FER # https://pypi.org/project/fer/
import matplotlib.pyplot as plt # MatPlotLib for pl... | RammySekham/img-speech-txt-analytics | video_analytics.py | video_analytics.py | py | 7,440 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "settings.video_file",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "moviepy.editor.VideoFileClip",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 34,
"usage_type": "call"
},
{
"api_name":... |
25910708686 | from sklearn.ensemble import IsolationForest
import plotly.express as px
def extract_outliers(data,cons_columns,col_name,contamination= 0.02):
isf = IsolationForest(n_estimators = 100, random_state = 42, contamination =contamination)
preds = isf.fit_predict(data[cons_columns])
#extract outliers from the d... | ahmedtarek1325/Day-BCG_PowerCompany_churn | utilities/outliers_utility.py | outliers_utility.py | py | 1,512 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sklearn.ensemble.IsolationForest",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "plotly.express.scatter",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "plotly.express",
"line_number": 33,
"usage_type": "name"
}
] |
35223596290 | from pwn import *
from Crypto.Util.number import getPrime, isPrime, bytes_to_long, long_to_bytes
# from cryptoFunc import *
flag1 = b'CNS{Aka_BIT_f1ipp1N9_atTaCk!}'
JOB_TITLE = 'Grand Disciplinary Officer'
NAME = 'Azar'
def recv_to_send_guess(p) :
p.recvuntil(b'choice: ')
p.sendline('1'.encode())
p.recvun... | ChengChengChu/HomeWorks | CNS/hw1/b08201054/code/code8_1.py | code8_1.py | py | 9,096 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "Crypto.Util.number.long_to_bytes",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "Crypto.Util.number.bytes_to_long",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "Crypto.Util.number.bytes_to_long",
"line_number": 41,
"usage_type": "ca... |
24564234567 | import re
from typing import Union
from langchain_core.agents import AgentAction, AgentFinish
from langchain_core.exceptions import OutputParserException
from langchain.agents.agent import AgentOutputParser
class ReActOutputParser(AgentOutputParser):
"""Output parser for the ReAct agent."""
def parse(self,... | langchain-ai/langchain | libs/langchain/langchain/agents/react/output_parser.py | output_parser.py | py | 1,231 | python | en | code | 68,990 | github-code | 7 | [
{
"api_name": "langchain.agents.agent.AgentOutputParser",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "langchain_core.exceptions.OutputParserException",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 21,
"usage_type": "ca... |
7775317653 | from chainer import cuda
from chainer import gradient_check
import numpy
import pytest
from chainer_chemistry.links.readout.megnet_readout import MEGNetReadout
max_node_num = 6
max_edge_num = 10
# This value is the same as the atom and pair feature dimension
in_channels = 10
global_feature_dim = 5
out_dim = 4
batch_... | chainer/chainer-chemistry | tests/links_tests/readout_tests/test_megnet_readout.py | test_megnet_readout.py | py | 2,054 | python | en | code | 587 | github-code | 7 | [
{
"api_name": "chainer_chemistry.links.readout.megnet_readout.MEGNetReadout",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.seed",
"line_number": 25,
"usage_type": "ca... |
9156051605 | import pandas as pd
import numpy as np
# from google.cloud import translate
from googletrans import Translator
import nltk
nltk.download('wordnet')
nltk.download('wordnet')
nltk.download('popular')
# from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
from gensim.models import Word2Vec
from nltk.corpus... | aninatroya/ABSA_Tweets | src/preprocess.py | preprocess.py | py | 18,930 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "nltk.download",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "nltk.download",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "nltk.download",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "configparser.ConfigParser",
... |
9225483255 | import datetime
from typing import List, Optional, Tuple
from fastapi import Depends, HTTPException, status
from sqlalchemy.orm import Session
from db_config import create_session
from models import RecordModel
from schemas.record_schemas import (OperationType, RecordBase,
RecordCr... | romaha57/fastapi_finance_calculator | services/operations.py | operations.py | py | 5,533 | python | ru | code | 0 | github-code | 7 | [
{
"api_name": "sqlalchemy.orm.Session",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "fastapi.Depends",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "db_config.create_session",
"line_number": 16,
"usage_type": "argument"
},
{
"api_name": "m... |
3693355781 | import pytest
import requests
import logging
from im_swagger_spy import http_spy
from im_swagger_spy.syncdb import HttpMethodModel, UsedHttpMethodModel, ReportInfo
logger = logging.getLogger(__name__)
@pytest.fixture(autouse=True)
def clear_db(request: pytest.FixtureRequest):
logger.info(f'Cleaning database be... | dasshit/im-swagger-spy | conftest.py | conftest.py | py | 1,120 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pytest.FixtureRequest",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "im_swagger_spy.syncdb.HttpMethodModel",
"line_number": 16,
"usage_type": "name"
},
{
... |
72427770463 | import streamlit as st
import svm
import datasets
import plots
import random
import sklearn
RANDOM_SEED = 147
LR_VALS = [1e-1, 1e-2, 1e-3, 1e-4, 1e-5, 1e-6, 1e-7, 1e-8]
X_train = None
X_test = None
y_train = None
y_test = None
train_acc = None
test_acc = None
fig_class = None
ax_class = None
fig_learn = None
ax_learn... | Svhugani/SVM | main_app.py | main_app.py | py | 4,478 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "random.randint",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "datasets.get_blobs",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "datasets.get_circles",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "sklearn.prepro... |
74229272862 |
""" This Python script helps making a connection to GCP IoT core via MQTT protocol.
Used JWT for device authentication. Post connection the device publishes 100 messages
to the topic created at rate of 1 msg/sec and then stops.
"""
import argparse
import datetime
import os
import time
import jwt
import paho.mqtt.c... | ChidhvilasTammireddy/Iot-egen | iot_data_pipeline.py | iot_data_pipeline.py | py | 6,821 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "datetime.datetime.utcnow",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.utcnow",
"line_number": 34,
"usage_type": "call"
},
{
"api_name... |
20200422330 | import torch
import numpy as np
class Fusion_TranslationLoss(torch.nn.Module):
def __init__(self, config, reduction="none"):
super(Fusion_TranslationLoss, self).__init__()
self.sensors = config.DATA.input
self.grid_weight = config.LOSS.grid_weight
self.fixed_fusion_net = config.F... | eriksandstroem/SenFuNet | utils/loss.py | loss.py | py | 21,901 | python | en | code | 11 | github-code | 7 | [
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.L1Loss",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.MSELoss",
"li... |
739162806 | import numpy as np
import cv2
import yaml
import os
from os.path import isfile
import pandas as pd
import base64
import json
from collections import namedtuple
def expand2square(img, bg_color=None):
"""
画像が正方形になるように画素を追加して拡張する.
Parameters
----------
img : numpy.ndarray
正方形にしたい画像.
bg_c... | sUeharaE4/shift_modify_detector | src/util.py | util.py | py | 14,190 | python | ja | code | 1 | github-code | 7 | [
{
"api_name": "cv2.copyMakeBorder",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "cv2.BORDER_CONSTANT",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "cv2.copyMakeBorder",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "cv2.BO... |
13014956139 | #!/usr/bin/python3
"""
this module adds a function
"""
import json
import requests
def recurse(subreddit, hot_list=[]):
""" this function queries reddit for 10 hot posts of given subreddit """
reddit = 'https://www.reddit.com/r/{}/hot.json'.format(subreddit)
u_head = {'User-Agent': 'Stacipoo'}
red_req... | StaciAF/holberton-system_engineering-devops | 0x16-api_advanced/2-recurse.py | 2-recurse.py | py | 658 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
}
] |
13444527679 | # encoding: utf-8
'''
@author: Jeremiah
@file: Utils.py
@time: 2018/6/28 13:57
@desc:
'''
import datetime
from re import sub
from html.parser import unescape
from urllib.parse import quote, unquote
from re import split
def htmlParser(string):
return unescape(string)
def urlEncode(string):
ret... | kirovj/py-tool | Utils.py | Utils.py | py | 1,119 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "html.parser.unescape",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "urllib.parse.quote",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "urllib.parse.unquote",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "datetime... |
74505442143 | import os, pytest, dotenv, ssl
from threading import Thread
from todo_app.data.todo_items import create_test_db, delete_test_db
from todo_app import app
from selenium import webdriver
from selenium.webdriver.support.ui import Select
@pytest.fixture(scope='module')
def app_with_temp_board():
file_path = dotenv.fi... | JoeBawn/DevOps-Course-Starter | todo_app/Selenium_Tests/test_Selenium.py | test_Selenium.py | py | 1,840 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "dotenv.find_dotenv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "dotenv.load_dotenv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "todo_app.data.todo_items.create_test_db",
"line_number": 14,
"usage_type": "call"
},
{
"api... |
22195242933 | import pandas as pd
import matplotlib.pyplot as plt
from sklearn.preprocessing import Normalizer
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
from sklearn.tree import DecisionTreeClassifier
from sklearn.metrics import confusion_matrix,ConfusionMatrixDisplay
from ... | asadTariq666/Python_work | newSchoolersAssignment/4.2.py | 4.2.py | py | 2,817 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "warnings.simplefilter",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.StandardScaler",
"line_number": 47,
"usage_type": "call"
},
{
"api_na... |
13906091330 | from cmoc import QuickList, Prepare
import MySQLdb
from json import load
from time import sleep
from random import shuffle
with open("/var/rc24/File-Maker/Channels/Check_Mii_Out_Channel/config.json", "r") as f:
config = load(f)
db = MySQLdb.connect("localhost", config["dbuser"], config["dbpass"], "rc24_cmoc")
cur... | RiiConnect24/File-Maker | Channels/Check_Mii_Out_Channel/popular.py | popular.py | py | 1,979 | python | en | code | 65 | github-code | 7 | [
{
"api_name": "json.load",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "MySQLdb.connect",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "random.shuffle",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "cmoc.QuickList",
"line_nu... |
8323340589 | from django.conf.urls import url
from COVID import views
from django.conf.urls.static import static
from django.conf import settings
# 1.在应用中进行urls配置的时候;
# (1)严格匹配开头和结尾
urlpatterns = [
url(r'^base$', views.base), # base
url(r'^$', views.index), # index
url(r'^... | Jessieqin001/COVID19-Navigation | COVID/urls.py | urls.py | py | 826 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.conf.urls.url",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "COVID.views.base",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "COVID.views",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.conf.ur... |
15730578535 | import telepot
import time
import urllib3
from telepot.namedtuple import InlineKeyboardMarkup, InlineKeyboardButton
# You can leave this bit out if you're using a paid PythonAnywhere account
proxy_url = "http://proxy.server:3128"
telepot.api._pools = {
'default': urllib3.ProxyManager(proxy_url=proxy_url, num_pool... | NG-MEIXI-MAISIE/Telegrambot-Formulabot | formulabot.py | formulabot.py | py | 5,233 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "telepot.api",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "urllib3.ProxyManager",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "telepot.api",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "urllib3.ProxyMa... |
72859826782 | from __future__ import print_function, absolute_import
import torch
AVAI_SCH = ['single_step', 'multi_step', 'cosine']
def build_lr_scheduler(
optimizer, lr_scheduler='single_step', stepsize=1, gamma=0.1, max_epoch=1
):
"""A function wrapper for building a learning rate scheduler.
Args:
optimize... | Ascend/ModelZoo-PyTorch | PyTorch/contrib/cv/classification/OSNet/torchreid/optim/lr_scheduler.py | lr_scheduler.py | py | 2,461 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "torch.optim.lr_scheduler.StepLR",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "torch.optim",
"line_number": 48,
"usage_type": "attribute"
},
{
"api_name": "torch.optim.lr_scheduler.MultiStepLR",
"line_number": 59,
"usage_type": "call"
},
{
... |
18430289290 | import pandas as pd
import os
from sqlalchemy import create_engine
oracle_engine = create_engine("oracle://windfile:windfile@172.20.65.11:1521/wind")
sql = """select substr(a.s_info_windcode,1,6), a.entry_dt,a.remove_dt,b.Industriesname
from AShareSWIndustriesClass a,
AShareIndustriesCode b
where substr(a... | wanhanwan/FactorLib | scripts/update_sw_level_2_excel.py | update_sw_level_2_excel.py | py | 714 | python | en | code | 6 | github-code | 7 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.sep",
"li... |
4386369571 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import rdflib
from rdflib import namespace
from rdfformat.generator import constants
from rdfformat.generator import rdf_helper
from rdfformat.generator import rdflib_states_handler
from rdfformat.generator im... | google/digitalbuildings | tools/rdf_generator/rdfformat/tests/rdflib_states_handler_test.py | rdflib_states_handler_test.py | py | 1,973 | python | en | code | 329 | github-code | 7 | [
{
"api_name": "absl.testing.absltest.TestCase",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "absl.testing.absltest",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "rdfformat.generator.rdf_helper.ReadFile",
"line_number": 21,
"usage_type": "cal... |
72867361502 | import torch
import torch.nn as nn
import torch.nn.functional as F
__all__ = ['SubNet', 'TextSubNet']
class SubNet(nn.Module):
'''
The subnetwork that is used in TFN for video and audio in the pre-fusion stage
'''
def __init__(self, in_size, hidden_size, dropout):
'''
Args:
... | Ascend/ModelZoo-PyTorch | PyTorch/contrib/others/MMSA_ID2979_for_PyTorch/models/subNets/FeatureNets.py | FeatureNets.py | py | 2,379 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "torch.nn.Module",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "torch.nn.BatchNorm1d",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line... |
2972753103 | from typing import Any, List
from fastapi import APIRouter, Body, Depends, HTTPException
from fastapi.encoders import jsonable_encoder
from pydantic.networks import EmailStr
from sqlalchemy.orm import Session
import crud, models, schemas
from api import deps
from core.config import settings
router = APIRouter()
@r... | kei49/WODMaster | fastapi/app/api/api_v1/endpoints/strength_score/user_sod.py | user_sod.py | py | 1,798 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.Session",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "schemas.user",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "fastapi.De... |
37606225982 | from api import getSongData,getSongId,getImg
from create_pdf import create_pdf
import figs
import mail
import argparse
def get_args(argv=None):
parser = argparse.ArgumentParser(description="Song analysis")
parser.add_argument("-s", "--song", type=str, help="Song you want to search")
parser.add_argument("-... | MaurizioMartin/data-analysis-pipeline | main.py | main.py | py | 1,771 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "api.getSongData",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "api.getSongId",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "figs.import_hist... |
15569509410 | from fake_useragent import UserAgent
import requests
ua = UserAgent()
link = 'https://www.consumerreports.org/cro/a-to-z-index/products/index.htm'
data = requests.get(link,headers={'user-agent' : ua.chrome}, timeout = 3).text
with open('consumer.txt', 'w',encoding='UTF-8') as file:
file.write(data)
| UsamaMashood/consumer.com_scraping | extrect_data.py | extrect_data.py | py | 311 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "fake_useragent.UserAgent",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 7,
"usage_type": "call"
}
] |
74898328543 | ### 파일 업로드 하는 방법 ###
import streamlit as st
from PIL import Image
import pandas as pd
import os
# 디렉토리 정보와 파일을 알려주면 해당 디렉토리에 파일을 저장하는 함수를 만들겁니다.
def save_upload_file(directory, file) :
# 1. 디렉토리가 있는지 확인 후 없으면 만든다.
if not os.path.exists(directory) :
os.makedirs(directory)
# 2. 디렉토리가 있으니, 파일을 저장.
... | gahye0530/streamlit_day1 | app8.py | app8.py | py | 2,159 | python | ko | code | 0 | github-code | 7 | [
{
"api_name": "os.path.exists",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_numb... |
18452979436 |
import numpy as np
import cv2
from gaze_tracking import GazeTracking
gaze = GazeTracking()
# 얼굴 검출기
face_detector = gaze._face_detector
# 학습된 68개 landmarks 모델
predictor = gaze._predictor
# 이미지 불러오기
test_image = cv2.imread('image.jpg')
# # 흑백 전환
# image_cvt = cv2.cvtColor(test_image, cv2.COLOR_BGR2GRAY)
"""
FaceD... | from940/EyeTracking_jayeong | face_detector.py | face_detector.py | py | 993 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "gaze_tracking.GazeTracking",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.rectangle",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"... |
3962345015 | import logging
from datetime import datetime
from typing import Iterator, List
from uuid import UUID
import pytz
from crm_pilates.domain.scheduling.classroom import Classroom
from crm_pilates.domain.scheduling.classroom_repository import ClassroomRepository
from crm_pilates.domain.scheduling.date_time_comparator impo... | bbougon/crm-pilates | crm_pilates/infrastructure/repository/memory/memory_classroom_repositories.py | memory_classroom_repositories.py | py | 2,726 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "crm_pilates.domain.scheduling.classroom_repository.ClassroomRepository",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "crm_pilates.infrastructure.repository.memory.memory_repository.MemoryRepository",
"line_number": 17,
"usage_type": "name"
},
{
"api_na... |
36255157490 | from django.http import HttpResponse
from django.template import loader
from django.template.loader import render_to_string
from julia import Julia
from mandelbrot import Mandelbrot
from burningship import BurningShip
from demo import Demo
from fracgif import FracGIF
from perlin import Perlin
from blur import Blur
from... | spicyShoyo/pyfrac | frac/views.py | views.py | py | 5,479 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "julia.Julia",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "mandelbrot.Mandelbrot",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "demo.Demo",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "burningship.BurningShip",... |
29873355668 | import os
import sys
import json
import requests
from dotenv import load_dotenv
load_dotenv()
sys.path.append("../")
from application import db
from application.models import Breed
"""
Seeds the "breed" table of the database.
@Graders, let us know if you need API keys.
"""
THE_DOG_API_KEY = os.getenv("THE_DOG_API_K... | Oceanwall/FindADogForMe | backend/seeding/breeds_seeding.py | breeds_seeding.py | py | 4,250 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.getenv",
"line_n... |
261165951 | """Tour d'un tournoi."""
import datetime
NUMBER_ROUNDS = 4
class Round:
"""Tour d'un tournoi."""
def __init__(self, name_tournament, name_round, pairs_players=[], startdatetime=None, matchs_round=[], values_list=[]):
"""Initialise le nom du tournoi, la date, les paires de joueurs et les matchs.""... | Sandrineriou/Centre-echec | models/round.py | round.py | py | 5,426 | python | fr | code | 0 | github-code | 7 | [
{
"api_name": "datetime.datetime.now",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 61,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.now",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "da... |
10537412396 | from django.conf import settings
from django.contrib.auth.models import User
from django.db.models import Count
from django.db.models import Q
from django.shortcuts import get_object_or_404
from django.core.exceptions import PermissionDenied
from rest_framework import mixins
from rest_framework import status
from rest_... | GitMateIO/gitmate-2 | gitmate_config/views.py | views.py | py | 10,339 | python | en | code | 6 | github-code | 7 | [
{
"api_name": "rest_framework.viewsets.GenericViewSet",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "rest_framework.mixins.ListModelMixin",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.mixins",
"line_number": 33,
"usage_type":... |
26455293658 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import numpy.random as nprand
import tensorflow as tf
import cv2 as cv
import argparse
import sys
import tempfile
import csv
import glob
import pandas as pd
import random
from tensorflow.cont... | gautamsreekumar/basketball_recognition | basketball_cnn.py | basketball_cnn.py | py | 6,969 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "glob.glob",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 29,
... |
73879127904 | """
Modulo Ejemplo
Este modulo sera un ejmplo para que se use como base,
para el dearrollo futuro de otros modulos.
NOTA:
No debes importara ninguna cuestion relaciona con _bottle_.
"""
import datetime as dt
def example_helper_function(*args, **kwargs):
"""
Ejemplo de documentacion para funcion
`ex... | Cedric415/storage-api | modules/example.py | example.py | py | 1,585 | python | es | code | 0 | github-code | 7 | [
{
"api_name": "datetime.datetime.fromisoformat",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 58,
"usage_type": "attribute"
}
] |
4109816195 | import functools
import time
import torch
import torchvision
from .utils import MetricLogger, to_device
from .coco_utils import get_coco_api_from_dataset
from .coco_eval import CocoEvaluator
@torch.no_grad()
def evaluate(model, data_loader, device):
n_threads = torch.get_num_threads()
torch.set_num_threads(... | mondrasovic/context_rcnn | src/eval.py | eval.py | py | 2,595 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "torch.get_num_threads",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.set_num_threads",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.device",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "utils.Metric... |
75155060703 | from collections import UserList
from typing import Iterable, List, Union
from .errors import LengthError
class CSRCList(UserList):
'''
A list of Contributing Source Identifiers (CSRCs). CSRCs are stored as
integers. The list size and CSRC values are validated in accordance with
RFC 3550. The list siz... | bbc/rd-apmm-python-lib-rtp | rtp/csrcList.py | csrcList.py | py | 2,530 | python | en | code | 12 | github-code | 7 | [
{
"api_name": "collections.UserList",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "errors.LengthError",
... |
39514291453 | """
Dataloader for processing vimeo videos into training data
"""
import cv2
import os
import numpy as np
from imageio import imread, imwrite
import torch
from torch.utils.data import Dataset
from datasets import hdr_transforms
from utils import utils
from utils import image_utils as iutils
np.random.seed(0)
class ... | haesoochung/LAN-HDR | datasets/syn_vimeo_dataset.py | syn_vimeo_dataset.py | py | 9,098 | python | en | code | 6 | github-code | 7 | [
{
"api_name": "numpy.random.seed",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "torch.utils.data.Dataset",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "utils.ut... |
37041073180 | from __future__ import print_function
import argparse
import cv2
import numpy as np
from display_image2 import display_image
def smoothing_image(img, type='mean', ksize = 3):
# 영상 평활화
if(type == 'mean'):
dst = cv2.blur(img, (ksize,ksize))
elif(type == 'Gaussian'):
dst = cv2.Gauss... | Sonny-Kor/Python-cv2 | filtering_image.py | filtering_image.py | py | 1,942 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "cv2.blur",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.GaussianBlur",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.medianBlur",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.Sobel",
"line_number... |
17435196474 | #!/usr/bin/env python3
import psutil
import socket
import report_email
import os
def check_localhost():
return socket.gethostbyname('localhost')!='127.0.0.1'
def check_cpu():
return psutil.cpu_percent()>80
def check_available_memory():
THRESHOLD = 500 * 1024 * 1024
mem = psutil.virtual_memory()
r... | HungOm/python-ex-collections | sysmanagement/finl_course/ex-4/healthcheck.py | healthcheck.py | py | 1,633 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "socket.gethostbyname",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "psutil.cpu_percent",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "psutil.virtual_memory",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "psutil.d... |
11258348483 | from Application.Api.MovieManager import MovieManager
from Application.Trakt.TraktManager import TraktManager
from Application.Bot.Commands.BotCommandBase import BotCommandBase
from Application.Api.Domain.Movie import Movie
from Application.Api.Domain.PlexUser import PlexUser
import discord
class ApproveCommand(BotCo... | nkonstantakos/trakt-discord-bot | Application/Bot/Commands/ApproveCommand.py | ApproveCommand.py | py | 2,219 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "Application.Bot.Commands.BotCommandBase.BotCommandBase",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "discord.Client",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "Application.Api.MovieManager.MovieManager",
"line_number": 10,
... |
72206978144 | from setuptools import setup, find_packages
from codecs import open
from os import path
__version__ = '0.0.2'
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='... | danalsan/softtoken | setup.py | setup.py | py | 2,112 | python | en | code | 11 | github-code | 7 | [
{
"api_name": "os.path.abspath",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "codecs.open",
"line_number":... |
10816464928 | """
This module contains all messaging related classes
"""
import json
import time
from PyQt5.QtCore import pyqtSignal, QThread
from domain.model import Measurement
class MessageConsumerBase(QThread):
LOG_TAG = "[MessageConsumerBase] "
SIGNAL_NEW_MEASUREMENT = pyqtSignal(Measurement)
def __init__(self)... | hgross/echolocation | EcholocationVisualization/msg/messaging.py | messaging.py | py | 2,672 | python | en | code | 10 | github-code | 7 | [
{
"api_name": "PyQt5.QtCore.QThread",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCore.pyqtSignal",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "domain.model.Measurement",
"line_number": 14,
"usage_type": "argument"
},
{
"api_nam... |
30971596679 | """ Implementation and verification of the proof of work. """
import logging
from datetime import timedelta
from typing import Optional
from datetime import datetime
from .block import Block
from .config import *
__all__ = ['GENESIS_TARGET', 'ProofOfWork']
class ProofOfWork:
"""
Allows performing (and a... | ChaAC-FAU/labchain | src/proof_of_work.py | proof_of_work.py | py | 1,569 | python | en | code | 11 | github-code | 7 | [
{
"api_name": "datetime.datetime.now",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 45,
"usage_type": "name"
}
] |
28056467889 | import json
import os
from ..cubes import TrainableCube, PredictorCube
from ..cubes import PatternMatcher
from ..cubes import Max, CubeLabel
from ..cubes import EditDistanceMatcher
from ..models import LogisticIntentClassifier
from ..utils.functions import sorted_labels
from collections import defaultdict
class Ge... | spoof/deepcubes | deepcubes/models/vera_live_dialog.py | vera_live_dialog.py | py | 6,584 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "cubes.TrainableCube",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "cubes.PredictorCube",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "cubes.EditDistanceMatcher",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.... |
14560132550 | import argparse
from argparse import RawTextHelpFormatter
import cv2
import fb_stitcher.core as core
import fb_stitcher.helpers as helpers
import os
def process_images(args):
# checks if filenames are valid
name_l = os.path.splitext(os.path.basename(args.left))[0]
name_r = os.path.splitext(os.path.basena... | BioroboticsLab/bb_fb_stitcher | fb_stitcher/scripts/bb_sel_stitcher.py | bb_sel_stitcher.py | py | 2,304 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.path.splitext",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.basename",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.splitext",
... |
7403782922 | #!/usr/bin/env python3
from cProfile import label
from curses import raw
import statistics
import pprint
import numpy as np
import matplotlib.pyplot as plt
from sortedcontainers import SortedDict
def parse_line(line):
cols = line.strip().split(' ')
return {
'input': int(cols[3]),
'solution': c... | johnjq/kbs-embeddings-2022 | experiments/analyze_results_for_benchmark_instances.py | analyze_results_for_benchmark_instances.py | py | 2,284 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "matplotlib.pyplot.clf",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.rc",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "matplotl... |
22815174952 | import pytest
import unittest
import json
import os
from pylivecoinwatch import LiveCoinWatchAPI
# from requests.exceptions import HTTPError
# Enter a valid api key to test
api_key = os.environ["LCW_API_KEY"]
# api_key = "YOUR_API_KEY"
class TestWrapper(unittest.TestCase):
def setUp(self):
self.lcw = L... | reneleogp/pylivecoinwatch | tests/test_api.py | test_api.py | py | 5,768 | python | en | code | 10 | github-code | 7 | [
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "unittest.TestCase",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "pylivecoinwatch.LiveCoinWatchAPI",
"line_number": 17,
"usage_type": "call"
},
{
"api_name"... |
9465156879 | import requests
class Form:
def __init__(self, API_TOKEN, FORM_ID):
self.API_TOKEN = API_TOKEN
self.FORM_ID = FORM_ID
url = f'https://api.typeform.com/forms/{self.FORM_ID}/responses'
headers = {'Authorization': f'Bearer {self.API_TOKEN}'}
try:
self.__response = ... | HackerManPeter/auto-response | form.py | form.py | py | 3,175 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "requests.exceptions",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "requests.exception... |
12294829837 | import time
import numpy as np
import atomize.general_modules.general_functions as general
import atomize.device_modules.Lakeshore_335 as ls
import sys
import telebot
import datetime
bot = telebot.TeleBot('')
xs = []
ys = []
i = 0;
ls335 = ls.Lakeshore_335()
if len(sys.argv) > 1:
test_flag = sys.argv[1]
el... | Anatoly1010/Atomize | atomize/tests/devices_tests/ask_LS335_bot.py | ask_LS335_bot.py | py | 809 | python | en | code | 16 | github-code | 7 | [
{
"api_name": "telebot.TeleBot",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "atomize.device_modules.Lakeshore_335.Lakeshore_335",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "atomize.device_modules.Lakeshore_335",
"line_number": 16,
"usage_type":... |
17102389672 | import tkinter as tk
from datetime import datetime
from PIL import Image, ImageTk
from io import BytesIO
from tkhtmlview import HTMLLabel
from urllib.request import Request, urlopen
import requests
from flask import request
from six.moves import urllib
import urllib
from time import sleep
import tkinter as tk
from pan... | putridar/esg-dashboard | Scripts/Dashboard.py | Dashboard.py | py | 17,547 | python | en | code | 12 | github-code | 7 | [
{
"api_name": "ssl._create_default_https_context",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "ssl._create_unverified_context",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 32,
"usage_type": "attribute"
},... |
40986958801 | import itertools
class Solution(object):
def validSquare(self, p1, p2, p3, p4):
"""
:type p1: List[int]
:type p2: List[int]
:type p3: List[int]
:type p4: List[int]
:rtype: bool
"""
ls = [p1,p2,p3,p4]
fd = False
def dis(p1,p2):
... | wherby/code | questions/000001/q593.py | q593.py | py | 694 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "itertools.permutations",
"line_number": 15,
"usage_type": "call"
}
] |
1396587959 | # -*- coding: utf-8 -*-
import codecs
import frida
import sys
import threading
#device = frida.get_remote_device()
device = frida.get_device_manager().enumerate_devices()[-1]
print(device)
pending = []
sessions = []
scripts = []
event = threading.Event()
jscode = """
Java.perform(function () {
... | Lemniscate317/HookMultiProcess | testProcess2.py | testProcess2.py | py | 1,982 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "frida.get_device_manager",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "threading.Event",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "threading.Event",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "sys.stdin.rea... |
41548453315 | from keras.datasets import mnist
import numpy as np
import tensorflow
from matplotlib import pyplot
from sklearn.cluster import KMeans
from sklearn.metrics import mean_squared_error
# Load the data to be used for the Plot and Kmeans clustering
(train_X, train_y), (test_X, test_y) = mnist.load_data()
train_dat... | kyle-yang27/pythonProject3 | pythonProject3/k-nn.py | k-nn.py | py | 5,434 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "keras.datasets.mnist.load_data",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "keras.datasets.mnist",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "sklearn.cluster.KMeans",
"line_number": 32,
"usage_type": "call"
},
{
"api_name... |
9198473059 | from __future__ import annotations
import json
from enum import Enum
from pathlib import Path
from urllib.parse import urlencode
from urllib.request import Request, urlopen
class TranslateType(str, Enum):
FSA_NT = "fsaNT"
SHORT_SNT = "shortSnt"
VOICETRA_NT = "voicetraNT"
PAT_ETC = "patETC"
LAWS_N... | MIDORIBIN/mt-auto-minhon-mlt | src/mt_auto_minhon_mlt/tranlator.py | tranlator.py | py | 4,394 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "enum.Enum",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "urllib.request.Request",
"line_n... |
18826012502 | #!/usr/bin/env python
from cosc343world import Creature, World
import numpy as np
import time
import random
import matplotlib.pyplot as plt
import math
# To keep track for the plot
avgFitnessOverTime = []
avgTurnsOverTime = []
numWinnersOverTime = []
lastPopulation = []
oldAvgFitness = 0
numGenerationsSinceSwitch = 0
... | JonathanGrant/GeneticAlgorithm | worldwinner.py | worldwinner.py | py | 14,403 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "random.randint",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "random.randint",
"li... |
44131743798 | from dataclasses import dataclass, field
import numpy as np
import torch
from torchsim.core.graph.slot_container import MemoryBlocks, Inputs
from torchsim.core.graph.unit import Unit
from torchsim.core.graph.worker_node_base import WorkerNodeBase
from torchsim.core.memory.tensor_creator import TensorCreator
from torc... | GoodAI/torchsim | torchsim/core/nodes/weighted_avg_node.py | weighted_avg_node.py | py | 6,467 | python | en | code | 9 | github-code | 7 | [
{
"api_name": "torchsim.core.models.expert_params.ParamsBase",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "dataclasses.field",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 17,
"usage_type": "name"
},
{
... |
41748043241 | import logging
logging.basicConfig(filename="list.log",level = logging.DEBUG,format=("%(name)s %(levelname)s %(asctime)s %(message)s"))
class list:
def __init__(self, l):
self.l = l
def reverse_list(self,l):
"""this function helps in reversing the whole list"""
try:
... | vaishnaviabbugari/ineuron_tasks | logging and exception tasks/list task/list.py | list.py | py | 3,319 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "logging.basicConfig",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "logging.info",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.error",
... |
74637153824 | # Makes an array of images for the Arduino sketch lightshow the persistence of vision wand.
# Each image is an array of unsigned LONGs that record on/off of each pixel in a COLUMN
import numpy as np
import cv2
import numpy as np
import os
#Get a list of all the BMP files in the current directory
def file_list(director... | OnMyWayBackHome/rotaviz | make_array_for_arduino.py | make_array_for_arduino.py | py | 1,501 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.listdir",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.transpose",
"line_number": 25,
"usage_type": "call"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.