docs: def iter_elements(element_function, parent_to_parse, **kwargs):
      """
      Applies element_function to each of the sub-elements in parent_to_parse.
      The passed in function must take at least one element, and an optional
      list of kwargs which are relevant to each of the elements in the list:
          def elem_func(each_elem, **kwargs)
      """
  
      parent = get_element(parent_to_parse)
  
      if not hasattr(element_function, '__call__'):
          return parent
  
      for child in ([] if parent is None else parent):
          element_function(child, **kwargs)
  
      return parent