human
I wrote the below code

    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)

What's a good function header?

Here's a good function header?
assistant
#Here's a good function header.

def hb_read(path_or_open_file):