def init(flats_list, constraint):
    """
    Create a flatisfy key containing a dict of metadata fetched by flatisfy for
    each flat in the list. Also perform some basic transform on flat objects to
    prepare for the metadata fetching.

    :param flats_list: A list of flats dict.
    :param constraint: The constraint that the ``flats_list`` should satisfy.
    :return: The updated list
    """
    for flat in flats_list:
        # Init flatisfy key
        if "flatisfy" not in flat:
            flat["flatisfy"] = {}
        if "constraint" not in flat["flatisfy"]:
            flat["flatisfy"]["constraint"] = constraint
        # Move url key to urls
        if "urls" not in flat:
            if "url" in flat:
                flat["urls"] = [flat["url"]]
            else:
                flat["urls"] = []
        # Create merged_ids key
        if "merged_ids" not in flat:
            flat["merged_ids"] = [flat["id"]]

    return flats_list