human
Complete this python program:
def hb_read(path_or_open_file):
assistant
#Here is the Python code you requested.

    """Read HB-format file.
    Parameters
    path_or_open_file : path-like or file-like
    If a file-like object, it is used as-is. Otherwise it is opened
    before reading.
    Returns
    data : scipy.sparse.csc_matrix instance
    The data read from the HB file as a sparse matrix.
    Notes
    At the moment not the full Harwell-Boeing format is supported. Supported
    features are:
    - assembled, non-symmetric, real matrices
    - integer for pointer/indices
    - exponential format for float values, and int format
    """
    def _get_matrix(fid):
        hb = HBFile(fid)
        return hb.read_matrix()
    if hasattr(path_or_open_file, 'read'):
        return _get_matrix(path_or_open_file)
    else:
        with open(path_or_open_file) as f:
            return _get_matrix(f)