def METHOD_NAME(
    proj, name, category, stype, realisation
):  # pragma: no cover
    args = {}
    args["name"] = name
    if stype == "horizons":
        if name not in proj.horizons:
            raise ValueError(f"Name {name} is not within Horizons")
        if category not in proj.horizons.representations:
            raise ValueError(f"Category {category} is not within Horizons categories")
        try:
            rox = proj.horizons[name][category].get_grid(realisation)
            args.update(_roxapi_horizon_to_xtgeo(rox))
        except KeyError as kwe:
            logger.error(kwe)
    elif stype == "zones":
        if name not in proj.zones:
            raise ValueError(f"Name {name} is not within Zones")
        if category not in proj.zones.representations:
            raise ValueError(f"Category {category} is not within Zones categories")
        try:
            rox = proj.zones[name][category].get_grid(realisation)
            args.update(_roxapi_horizon_to_xtgeo(rox))
        except KeyError as kwe:
            logger.error(kwe)
    elif stype in ("clipboard", "general2d_data"):
        styperef = getattr(proj, stype)
        if category:
            if "|" in category:
                folders = category.split("|")
            else:
                folders = category.split("/")
            rox = styperef.folders[folders]
        else:
            rox = styperef
        roxsurf = rox[name].get_grid(realisation)
        args.update(_roxapi_horizon_to_xtgeo(roxsurf))
    elif stype == "trends":
        if name not in proj.trends.surfaces:
            logger.info("Name %s is not present in trends", name)
            raise ValueError(f"Name {name} is not within Trends")
        rox = proj.trends.surfaces[name]
        roxsurf = rox.get_grid(realisation)
        args.update(_roxapi_horizon_to_xtgeo(roxsurf))
    else:
        raise ValueError(f"Invalid stype given: {stype}")  # should never reach here
    return args