code: def from_float(x, prec=53, rnd=round_fast):
      """Create a raw mpf from a Python float, rounding if necessary.
      If prec >= 53, the result is guaranteed to represent exactly the
      same number as the input. If prec is not specified, use prec=53.
      """
      # frexp only raises an exception for nan on some platforms
      if x != x:
          return fnan
      # in Python2.5 math.frexp gives an exception for float infinity
      # in Python2.6 it returns (float infinity, 0)
      try:
          m, e = math.frexp(x)
      except:
          if x == math_float_inf:
              return finf
          if x == -math_float_inf:
              return fninf
          return fnan
      if x == math_float_inf:
          return finf
      if x == -math_float_inf:
          return fninf
      return from_man_exp(int(m * (1 << 53)), e - 53, prec, rnd)
  
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 19 for calling a global function with example usage: from_float(x, prec, rnd) and returns: from_man_exp, fnan, finf, fninf, fnan, finf, fninf