class_docstr: This class implements rational numbers.
  
  In the two-argument form of the constructor, Fraction(8, 6) will
  produce a rational number equivalent to 4/3. Both arguments must
  be Rational. The numerator defaults to 0 and the denominator
  defaults to 1 so that Fraction(3) == 3 and Fraction() == 0.
  
  Fractions can also be constructed from:
  
    - numeric strings similar to those accepted by the
      float constructor (for example, '-2.3' or '1e10')
  
    - strings of the form '123/456'
  
    - float and Decimal instances
  
    - other Rational instances (including integers)
class_docstr_tok: ["This","class","implements","rational","numbers",".","In","the","two-argument","form","of","the","constructor",",","Fraction","(","8",",","6",")","will","produce","a","rational","number","equivalent","to","4\/3",".","Both","arguments","must","be","Rational",".","The","numerator","defaults","to","0","and","the","denominator","defaults","to","1","so","that","Fraction","(","3",")","==","3","and","Fraction","(",")","==","0",".","Fractions","can","also","be","constructed","from",":","-","numeric","strings","similar","to","those","accepted","by","the","float","constructor","(","for","example",",","'-2.3","'","or","'1e10","'",")","-","strings","of","the","form","'123\/456'","-","float","and","Decimal","instances","-","other","Rational","instances","(","including","integers",")"]
docstr: Helper method for __format__.
  
  Handles fill, alignment, signs, and thousands separators in the
  case of no presentation type.
code: def _format_general(self, match):
      """Helper method for __format__.
  
      Handles fill, alignment, signs, and thousands separators in the
      case of no presentation type.
      """
      # Validate and parse the format specifier.
      fill = match["fill"] or " "
      align = match["align"] or ">"
      pos_sign = "" if match["sign"] == "-" else match["sign"]
      alternate_form = bool(match["alt"])
      minimumwidth = int(match["minimumwidth"] or "0")
      thousands_sep = match["thousands_sep"] or ""
  
      # Determine the body and sign representation.
      n, d = self._numerator, self._denominator
      if d > 1 or alternate_form:
          body = f"{abs(n):{thousands_sep}}/{d:{thousands_sep}}"
      else:
          body = f"{abs(n):{thousands_sep}}"
      sign = "-" if n < 0 else pos_sign
  
      # Pad with fill character if necessary and return.
      padding = fill * (minimumwidth - len(sign) - len(body))
      if align == ">":
          return padding + sign + body
      elif align == "<":
          return sign + body + padding
      elif align == "^":
          half = len(padding) // 2
          return padding[:half] + sign + body + padding[half:]
      else:  # align == "="
          return sign + padding + body
  
imports: from decimal import Decimal
  import functools
  import math
  import numbers
  import operator
  import re
  import sys
label_desc: Use image node_id 12 for calling the Fraction obj's underlying member method code with example usage: obj._format_general(match) and returns: unknown, unknown, unknown, unknown