code: def gmpy_bitcount(n):
      """Calculate bit size of the nonnegative integer n."""
      if n:
          return MPZ(n).numdigits(2)
      else:
          return 0
  
imports: import math
  from bisect import bisect
  from .backend import xrange
  from .backend import BACKEND, gmpy, sage, sage_utils, MPZ, MPZ_ONE, MPZ_ZERO
label_desc: Use image node_id 6 for calling a global function with example usage: gmpy_bitcount(n) and returns: MPZ, int