original_docstring: A deferred formatter action.
  
      Calling this method performs the actual formatting and returns the outcomes.
  
      Returns:
        A tuple of <paths, previous_mtimes, errors> which describes the outcomes.
      
docstring: A deferred formatter action.
  Calling this method performs the actual formatting and returns the outcomes.
docstring_tokens: A deferred formatter action . Calling this method performs the actual formatting and returns the outcomes .
code: def Action(
      self, paths: List[pathlib.Path], cached_mtimes: List[int]
    ) -> base_formatter.FormatAction:
      """A deferred formatter action.
  
      Calling this method performs the actual formatting and returns the outcomes.
  
      Returns:
        A tuple of <paths, previous_mtimes, errors> which describes the outcomes.
      """
      try:
        self.RunManyWithLog(paths)
      except self.FormatError as e:
        # Because multiple files have been processed, and a failure may be caused
        # by any one (or multiple) of them, we perform a divide-and-conquer on
        # error to isolate only the files that cannot be formatted. This maximises
        # the amount of work that can be usefully performed in a single pass of
        # the formatter.
        #
        # For example, let's say we have a batch of four Python files to process:
        #
        #     a.py
        #     b.py
        #     c.py
        #     d.py  # contains a syntax error which cannot be formatted.
        #
        # When this method is called, RunMany() is called first with all four
        # files, raising an error. We then partition the paths into two groups,
        # [a.py, b.py], and [c.py, d.py], where the first group now succeeds and
        # the second group. Further subdividing the second group causes c.py to
        # now be formatted succesfully, isolating the error at d.py. In this case,
        # [a.py, b.py, c.py] would all be returned as succesfully modified paths,
        # and the error from running d.py in isolation would be returned.
        #
        # Depending on the implementation of RunMany(), this may cause a file to
        # be redundantly formatted up to Log(n) - 1 times, if a "failing" run
        # still formats the valid files.
        if len(paths) == 1:
          return [], [], [e]
        else:
          app.Log(
            2, "EXCEPT on %s with %s files", type(self).__name__, len(paths)
          )
          mid = len(paths) // 2
          left = self.Action(paths[:mid], cached_mtimes[:mid])
          right = self.Action(paths[mid:], cached_mtimes[mid:])
          return tuple(l + r for l, r in zip(left, right))
      return paths, cached_mtimes, []
code_tokens: def Action ( self , paths : List [ pathlib . Path ] , cached_mtimes : List [ int ] ) -> base_formatter . FormatAction : try : self . RunManyWithLog ( paths ) except self . FormatError as e : if len ( paths ) == 1 : return [ ] , [ ] , [ e ] else : app . Log ( 2 , "EXCEPT on %s with %s files" , type ( self ) . __name__ , len ( paths ) ) mid = len ( paths ) // 2 left = self . Action ( paths [ : mid ] , cached_mtimes [ : mid ] ) right = self . Action ( paths [ mid : ] , cached_mtimes [ mid : ] ) return tuple ( l + r for l , r in zip ( left , right ) ) return paths , cached_mtimes , [ ]
short_docstring: A deferred formatter action.
short_docstring_tokens: A deferred formatter action .
comment: """A deferred formatter action.
  
      Calling this method performs the actual formatting and returns the outcomes.
  
      Returns:
        A tuple of <paths, previous_mtimes, errors> which describes the outcomes.
      """$SEP$# Because multiple files have been processed, and a failure may be caused$SEP$# by any one (or multiple) of them, we perform a divide-and-conquer on$SEP$# error to isolate only the files that cannot be formatted. This maximises$SEP$# the amount of work that can be usefully performed in a single pass of$SEP$# the formatter.$SEP$#$SEP$# For example, let's say we have a batch of four Python files to process:$SEP$#$SEP$#     a.py$SEP$#     b.py$SEP$#     c.py$SEP$#     d.py  # contains a syntax error which cannot be formatted.$SEP$#$SEP$# When this method is called, RunMany() is called first with all four$SEP$# files, raising an error. We then partition the paths into two groups,$SEP$# [a.py, b.py], and [c.py, d.py], where the first group now succeeds and$SEP$# the second group. Further subdividing the second group causes c.py to$SEP$# now be formatted succesfully, isolating the error at d.py. In this case,$SEP$# [a.py, b.py, c.py] would all be returned as succesfully modified paths,$SEP$# and the error from running d.py in isolation would be returned.$SEP$#$SEP$# Depending on the implementation of RunMany(), this may cause a file to$SEP$# be redundantly formatted up to Log(n) - 1 times, if a "failing" run$SEP$# still formats the valid files.