def search_names(name_data, target):
    """
    Given a name_data dict that stores baby name information and a target string,
    returns a list of all names in the dict that contain the target string. This
    function should be case-insensitive with respect to the target string.

    Input:
        name_data (dict): a dict containing baby name data organized by name
        target (str): a string to look for in the names contained within name_data

    Returns:
        matching_names (List[str]): a list of all names from name_data that contain
                                    the target string

    """
    target_names = []                       # An empty list to store names with target.
    for name in name_data:                  # Check every name in dict 'name_data'.
        target = target.lower()             # Set 'target' into lowercase.
        lower_name = name.lower()           # Set 'name' into lowercase.
        if target in lower_name:            # Search names with target in dict 'name_data'.
            target_names.append(name)       # Then, append names with target to list 'target_names'.
    return target_names                     # Return list 'target_names'.