# Path: pycoral/utils/edgetpu.py
# _EDGETPU_SHARED_LIB = {
#   'Linux': 'libedgetpu.so.1',
#   'Darwin': 'libedgetpu.1.dylib',
#   'Windows': 'edgetpu.dll'
# }[platform.system()]
# def load_edgetpu_delegate(options=None):
# def make_interpreter(model_path_or_content, device=None, delegate=None):
# def _is_valid_ctypes_input(input_data):
# def _gst_buffer_map(buffer):
# def _check_input_size(input_size, expected_input_size):
# def run_inference(interpreter, input_data):
# class _GstMapInfo(ctypes.Structure):
# 
# Path: tests/test_utils.py
# _TEST_DATA_DIR = ''
#   _TEST_DATA_DIR = args.test_data_dir
# def get_test_tmpdir():
# def test_data_path(path, *paths):
# def test_image(path, *paths):
# def temporary_file(suffix=None):
# def generate_random_input(seed, n):
# def prepare_images(image_list, directory, shape):
# def area(box):
# def iou(box_a, box_b):
# def prepare_data_set_from_directory(path, test_ratio, fixed_order):
# def coral_test_main():


import ctypes
import ctypes.util
import io
import numpy as np
import unittest
  import gi
from pycoral.utils import edgetpu
from tests import test_utils
  from gi.repository import Gst
      ('maxsize', ctypes.c_size_t),  # gsize maxsize
      ('user_data', ctypes.c_void_p * 4),  # gpointer user_data[4]
      ('_gst_reserved', ctypes.c_void_p * 4)
  ]  # GST_PADDING


_libgst = None
try:
  # pylint:disable=g-import-not-at-top
  gi.require_version('Gst', '1.0')
  _libgst = ctypes.CDLL(ctypes.util.find_library('gstreamer-1.0'))
  _libgst.gst_buffer_map.argtypes = [
      ctypes.c_void_p,
      ctypes.POINTER(_GstMapInfo), ctypes.c_int
  ]
  _libgst.gst_buffer_map.restype = ctypes.c_int
  _libgst.gst_buffer_unmap.argtypes = [
      ctypes.c_void_p, ctypes.POINTER(_GstMapInfo)
  ]
  _libgst.gst_buffer_unmap.restype = None
  Gst.init(None)
except (ImportError, ValueError, OSError):
  pass


def read_file(filename):
  with open(filename, mode='rb') as f:
    return f.read()



# Path: pycoral/utils/edgetpu.py
# _EDGETPU_SHARED_LIB = {
#   'Linux': 'libedgetpu.so.1',
#   'Darwin': 'libedgetpu.1.dylib',
#   'Windows': 'edgetpu.dll'
# }[platform.system()]
# def load_edgetpu_delegate(options=None):
# def make_interpreter(model_path_or_content, device=None, delegate=None):
# def _is_valid_ctypes_input(input_data):
# def _gst_buffer_map(buffer):
# def _check_input_size(input_size, expected_input_size):
# def run_inference(interpreter, input_data):
# class _GstMapInfo(ctypes.Structure):
# 
# Path: tests/test_utils.py
# _TEST_DATA_DIR = ''
#   _TEST_DATA_DIR = args.test_data_dir
# def get_test_tmpdir():
# def test_data_path(path, *paths):
# def test_image(path, *paths):
# def temporary_file(suffix=None):
# def generate_random_input(seed, n):
# def prepare_images(image_list, directory, shape):
# def area(box):
# def iou(box_a, box_b):
# def prepare_data_set_from_directory(path, test_ratio, fixed_order):
# def coral_test_main():


# Path: tests/edgetpu_utils_test.py
import ctypes
import ctypes.util
import io
import numpy as np
import unittest
  import gi
from pycoral.utils import edgetpu
from tests import test_utils
  from gi.repository import Gst

      ('maxsize', ctypes.c_size_t),  # gsize maxsize
      ('user_data', ctypes.c_void_p * 4),  # gpointer user_data[4]
      ('_gst_reserved', ctypes.c_void_p * 4)
  ]  # GST_PADDING


_libgst = None
try:
  # pylint:disable=g-import-not-at-top
  gi.require_version('Gst', '1.0')
  _libgst = ctypes.CDLL(ctypes.util.find_library('gstreamer-1.0'))
  _libgst.gst_buffer_map.argtypes = [
      ctypes.c_void_p,
      ctypes.POINTER(_GstMapInfo), ctypes.c_int
  ]
  _libgst.gst_buffer_map.restype = ctypes.c_int
  _libgst.gst_buffer_unmap.argtypes = [
      ctypes.c_void_p, ctypes.POINTER(_GstMapInfo)
  ]
  _libgst.gst_buffer_unmap.restype = None
  Gst.init(None)
except (ImportError, ValueError, OSError):
  pass


def read_file(filename):
  with open(filename, mode='rb') as f:
    return f.read()



def required_input_array_size(interpreter):