def read_file(filename):
    if is_str(filename):
        if filename.endswith('.json'):
            try:
                filename = os.path.basename(filename)
                if os.path.isfile(filename):
                    if os.access(filename, os.R_OK):
                        with open(filename, 'rb') as f:
                            return json.load(f)
                    else:
                        raise PermissionError("You don't have                             permissions to access this file")
                else:
                    raise FileNotFoundError('File Not Found')
            except FileNotFoundError:
                raise FileNotFoundError('File Not Found')
        else:
            raise AttributeError('File should have ".json" extension')
    else:
        raise AttributeError('No Filename provided')
def read_file(filename):
    if is_str(filename):
        if filename.endswith('.json'):
            try:
                filename = os.path.basename(filename)
                if os.path.isfile(filename):
                    if os.access(filename, os.R_OK):
                        with open(filename, 'rb') as f:
                            return json.load(f)
                    else:
                        raise PermissionError("You don't have                             permissions to access this file")
                else:
                    raise FileNotFoundError('File Not Found')
            except FileNotFoundError:
                raise FileNotFoundError('File Not Found')
        else:
            raise AttributeError('File should have ".json" extension')
    else:
        raise AttributeError('No Filename provided')