def METHOD_NAME(args: Namespace) -> str:
    """
    Resolve the AMASE development directory.
    WARNING: this calls sys.exit if specified paths do not exist.
    Find the AMASE development directory in the following order:
      1. If the --amase-dir argument is specified, use that.
      2. If the AMASE_DEVEL_DIR environment variable is specified, use that.
      3. If the amase repository has been checked out locally, use that.
      4. Use the default AMASE_DEVEL_DIR.
    This function should be used with `add_amase_dir_argument`.
    """
    if args and args.amase_dir:
        if not os.path.exists(args.amase_dir):
            logging.critical(
                "The specified OpenAMASE path `%s` does not exist.", args.amase_dir
            )
            sys.exit(1)
        return args.amase_dir
    if AMASE_DEVEL_DIR != DEFAULT_AMASE_DEVEL_DIR:
        return AMASE_DEVEL_DIR
    with open(REPOSITORIES_YAML, encoding="utf-8") as yaml_file:
        loaded_yaml = yaml.safe_load(yaml_file.read())
    if loaded_yaml["amase"]["vcs"] == "external":
        return os.path.abspath(os.path.join(OPENUXAS_ROOT, loaded_yaml["amase"]["url"]))
    return AMASE_DEVEL_DIR