code: def long_has_args(opt, longopts):
      possibilities = [o for o in longopts if o.startswith(opt)]
      if not possibilities:
          raise GetoptError(_("option --%s not recognized") % opt, opt)
      # Is there an exact match?
      if opt in possibilities:
          return False, opt
      elif opt + "=" in possibilities:
          return True, opt
      # No exact match, so better be unique.
      if len(possibilities) > 1:
          # XXX since possibilities contains all valid continuations, might be
          # nice to work them into the error msg
          raise GetoptError(
              _("option --%s not a unique prefix") % opt, opt
          )
      assert len(possibilities) == 1
      unique_match = possibilities[0]
      has_arg = unique_match.endswith("=")
      if has_arg:
          unique_match = unique_match[:-1]
      return has_arg, unique_match
  
file_path: catboost/contrib/tools/python3/src/Lib/getopt.py
imports: import os
label_desc: Use image node_id 4 for calling a global function with example usage: long_has_args(opt, longopts) and returns: has_arg,  unique_match, False,  opt, True,  opt