code: def nonnegative_float(s):
      
      err_msg = "must be either positive or zero, not %r" % s
      try:
          value = float(s)
      except ValueError:
          raise argparse.ArgumentTypeError(err_msg)
      if value < 0:
          raise argparse.ArgumentTypeError(err_msg)
      return value
docs: Ensure argument is a positive real number or zero and return it as float.
  
      To be used as type in argparse arguments.