parameters: (element, map)
return_statement: return element
docstring: If |element| then remap it through |map|. If |element| is iterable then
    each item will be remapped. Any elements not found will be removed.
docstring_summary: If |element| then remap it through |map|. If |element| is iterable then
    each item will be remapped. Any elements not found will be removed.
docstring_tokens: If |element| then remap it through |map| . If |element| is iterable then each item will be remapped . Any elements not found will be removed .
function: def _DoRemapping(element, map):
    """If |element| then remap it through |map|. If |element| is iterable then
    each item will be remapped. Any elements not found will be removed."""
    if map is not None and element is not None:
      if not callable(map):
        map = map.get # Assume it's a dict, otherwise a callable to do the remap.
      if isinstance(element, list) or isinstance(element, tuple):
        element = filter(None, [map(elem) for elem in element])
      else:
        element = map(element)
    return element
function_tokens: def _DoRemapping ( element , map ) : if map is not None and element is not None : if not callable ( map ) : map = map . get # Assume it's a dict, otherwise a callable to do the remap. if isinstance ( element , list ) or isinstance ( element , tuple ) : element = filter ( None , [ map ( elem ) for elem in element ] ) else : element = map ( element ) return element