parameters: (ptype, method_name)
docstring: r"""
      Quick check to see if this method exists, if it does not exist we raise a convenient flag.
docstring_summary: r"""
      Quick check to see if this method exists, if it does not exist we raise a convenient flag.
docstring_tokens: r Quick check to see if this method exists if it does not exist we raise a convenient flag .
function: def _method_exists(ptype, method_name):
      r"""
      Quick check to see if this method exists, if it does not exist we raise a convenient flag.
      """
      if method_name not in procedures[ptype].keys():
          alternatives = ""
          alt_method_name = p4util.text.find_approximate_string_matches(method_name,
                                                                  procedures[ptype].keys(), 2)
          if len(alt_method_name) > 0:
              alternatives = " Did you mean? %s" % (" ".join(alt_method_name))
          Cptype = ptype[0].upper() + ptype[1:]
          raise ValidationError('%s method "%s" is not available.%s' % (Cptype, method_name, alternatives))
function_tokens: def _method_exists ( ptype , method_name ) : if method_name not in procedures [ ptype ] . keys ( ) : alternatives = "" alt_method_name = p4util . text . find_approximate_string_matches ( method_name , procedures [ ptype ] . keys ( ) , 2 ) if len ( alt_method_name ) > 0 : alternatives = " Did you mean? %s" % ( " " . join ( alt_method_name ) ) Cptype = ptype [ 0 ] . upper ( ) + ptype [ 1 : ] raise ValidationError ( '%s method "%s" is not available.%s' % ( Cptype , method_name , alternatives ) )