parameters: (dataset)
return_statement: return flag
docstring: Utility function to find the case where repeat is used before batch.
  
          Args:
               dataset (Dataset): Dataset to be checked.
  
          Returns:
              bool, whether repeat is used before batch.
docstring_summary: Utility function to find the case where repeat is used before batch.
docstring_tokens: Utility function to find the case where repeat is used before batch .
function: def _is_ancestor_of_repeat(dataset):
          """
          Utility function to find the case where repeat is used before batch.
  
          Args:
               dataset (Dataset): Dataset to be checked.
  
          Returns:
              bool, whether repeat is used before batch.
          """
          if isinstance(dataset, RepeatDataset):
              return True
          flag = False
          for input_dataset in dataset.children:
              flag = flag | BatchDataset._is_ancestor_of_repeat(input_dataset)
          return flag
function_tokens: def _is_ancestor_of_repeat ( dataset ) : if isinstance ( dataset , RepeatDataset ) : return True flag = False for input_dataset in dataset . children : flag = flag | BatchDataset . _is_ancestor_of_repeat ( input_dataset ) return flag