Read data from the specified file.
    :param filename_or_file_object: filename of the file or an opened :class:`file` buffer to that file
    :type filename_or_file_object: basestring|file
    :return:

def from_file(filename_or_file_object):
    """
    Read data from the specified file.
    :param filename_or_file_object: filename of the file or an opened :class:`file` buffer to that file
    :type filename_or_file_object: basestring|file
    :return:
    """
    if isinstance(filename_or_file_object, basestring):
        file_ = open(filename_or_file_object, 'r')
        we_opened = True
    else:
        we_opened = False
        file_ = filename_or_file_object

    try:
        data = load(file_.read())
    finally:
        if we_opened:
            file_.close()

    return data