<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def handle_path(backend_inst, path, **kwargs):
 """ Handle a path. Called by `get()` when provided a path. This function will prefer the backend's `handle_path()` if one is provided Otherwise, it will open the given path then use `handle_fobj()`. """

    if callable(getattr(backend_inst, 'handle_path', None)):
        # Prefer handle_path() if present.
        LOGGER.debug("using handle_path")
        return backend_inst.handle_path(path)

    elif callable(getattr(backend_inst, 'handle_fobj', None)):
        # Fallback to handle_fobj(). No warning here since the performance hit
        # is minimal.
        LOGGER.debug("using handle_fobj")
        with open(path, 'rb') as f:
            return backend_inst.handle_fobj(f)

    else:
        raise AssertionError(
            'Backend %s has no _get functions' % backend_inst.__name__)