code: def to_rational(s):
      """Convert a raw mpf to a rational number. Return integers (p, q)
      such that s = p/q exactly."""
      sign, man, exp, bc = s
      if sign:
          man = -man
      if bc == -1:
          raise ValueError(
              "cannot convert %s to a rational number" % man
          )
      if exp >= 0:
          return man * (1 << exp), 1
      else:
          return man, 1 << (-exp)
  
imports: import math
  from bisect import bisect
  import sys
  from .backend import MPZ, MPZ_TYPE, MPZ_ZERO, MPZ_ONE, MPZ_TWO, MPZ_FIVE, BACKEND, STRICT, HASH_MODULUS, HASH_BITS, gmpy, sage, sage_utils
  from .libintmath import giant_steps, trailtable, bctable, lshift, rshift, bitcount, trailing, sqrt_fixed, numeral, isqrt, isqrt_fast, sqrtrem, bin_to_radix
label_desc: Use image node_id 24 for calling a global function with example usage: to_rational(s) and returns: unknown,  int, man,  unknown