docs: def filter_match_kwargs(kwargs, children=False):
      """
      Filters out kwargs for Match construction
  
      :param kwargs:
      :type kwargs: dict
      :param children:
      :type children: Flag to filter children matches
      :return: A filtered dict
      :rtype: dict
      """
      kwargs = kwargs.copy()
      for key in ('pattern', 'start', 'end', 'parent', 'formatter', 'value'):
          if key in kwargs:
              del kwargs[key]
      if children:
          for key in ('name',):
              if key in kwargs:
                  del kwargs[key]
      return kwargs