code: def from_npfloat(x, prec=113, rnd=round_fast):
      """Create a raw mpf from a numpy float, rounding if necessary.
      If prec >= 113, the result is guaranteed to represent exactly the
      same number as the input. If prec is not specified, use prec=113.
      """
      y = float(x)
      if x == y:  # ldexp overflows for float16
          return from_float(y, prec, rnd)
      import numpy as np
  
      if np.isfinite(x):
          m, e = np.frexp(x)
          return from_man_exp(
              int(np.ldexp(m, 113)), int(e - 113), prec, rnd
          )
      if np.isposinf(x):
          return finf
      if np.isneginf(x):
          return fninf
      return fnan
  
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 20 for calling a global function with example usage: from_npfloat(x, prec, rnd) and returns: fnan, from_float, from_man_exp, finf, fninf