def map(self, ID_s,<EOL>FROM=None,<EOL>TO=None,<EOL>target_as_set=False,<EOL>no_match_sub=None):
def io_mode(ID_s):<EOL><INDENT>'''<STR_LIT>'''<EOL>unlist_return = False<EOL>list_of_lists = False<EOL>if isinstance(ID_s, str):<EOL><INDENT>ID_s = [ID_s]<EOL>unlist_return = True<EOL><DEDENT>elif isinstance(ID_s, list):<EOL><INDENT>if len(ID_s) > <NUM_LIT:0> and isinstance(ID_s[<NUM_LIT:0>], list):<EOL><INDENT>list_of_lists = True<EOL><DEDENT><DEDENT>return ID_s, unlist_return, list_of_lists<EOL><DEDENT>if FROM == TO:<EOL><INDENT>return ID_s<EOL><DEDENT>ID_s, unlist_return, list_of_lists = io_mode(ID_s)<EOL>if list_of_lists:<EOL><INDENT>mapped_ids = [self.map(ID, FROM, TO, target_as_set, no_match_sub) for ID in ID_s]<EOL><DEDENT>else:<EOL><INDENT>mapped_ids = self._map(ID_s, FROM, TO, target_as_set, no_match_sub)<EOL><DEDENT>if unlist_return:<EOL><INDENT>return mapped_ids[<NUM_LIT:0>]<EOL><DEDENT>return Mapping(ID_s, mapped_ids)<EOL>
The main method of this class and the essence of the package.
It allows to "map" stuff.

Args:

    ID_s: Nested lists with strings as leafs (plain strings also possible)
    FROM (str): Origin key for the mapping (default: main key)
    TO (str): Destination key for the mapping (default: main key)
    target_as_set (bool): Whether to summarize the output as a set (removes duplicates)
    no_match_sub: Object representing the status of an ID not being able to be matched
                  (default: None)

Returns:

    Mapping: a mapping object capturing the result of the mapping request