def METHOD_NAME(schema, output, class_names, slot_names):
    sv = SchemaView(schema)
    def n2f(n: str) -> Callable:
        if n.startswith("camel"):
            return camelcase
        elif n.startswith("lcamel") or n.startswith("lowerpascal"):
            return lcamelcase
        elif n.startswith("snake") or n.startswith("under"):
            return underscore
        elif n.startswith("upper"):
            return lambda x: x.upper()
        elif n.startswith("lower"):
            return lambda x: x.lower()
        else:
            raise NotImplementedError(f"Function: {n}")
    rename_map = {}
    if class_names:
        rename_map[ClassDefinition] = n2f(class_names)
    if slot_names:
        rename_map[SlotDefinition] = n2f(slot_names)
    if not rename_map.keys():
        raise ValueError("No transformations specified")
    renamer = SchemaRenamer(rename_function_map=rename_map)
    rschema = renamer.rename_elements(sv.schema)
    ystr = schema_as_yaml_dump(rschema)
    if output:
        with open(output, "w", encoding="UTF-8") as stream:
            stream.write(ystr)
    else:
        print(ystr)