def locate_folder(folders, target):
    """
    Search for a target folder in the folders list and return the name and id.
    """
    if type(folders) == list:
        folder = [f for f in folders if f['name'] == target]
    elif type(folders) == dict and folders.get('folders', False):
        folder = [f for f in folders['folders'] if f['name'] == target]
    else:
        return False
    if len(folder) > 0:
        return folder
    else:
        return False