def METHOD_NAME(self, type_, autogen_context):
    if type_.__module__ == __name__:
        autogen_context.imports.add(
            "from %s import custom_dialect_types" % (__name__,)
        )
        is_external = True
    else:
        is_external = False
    if is_external and hasattr(
        self, "_render_%s_type" % type_.__visit_name__
    ):
        meth = getattr(self, "_render_%s_type" % type_.__visit_name__)
        return meth(type_, autogen_context)
    if is_external:
        return "%s.%r" % ("custom_dialect_types", type_)
    else:
        return None