def map_stone_type_to_python_type(ns, data_type, override_dict=None):<EOL>
override_dict = override_dict or {}<EOL>if is_string_type(data_type):<EOL><INDENT>string_override = override_dict.get(String, None)<EOL>if string_override:<EOL><INDENT>return string_override(ns, data_type, override_dict)<EOL><DEDENT>return '<STR_LIT:str>'<EOL><DEDENT>elif is_bytes_type(data_type):<EOL><INDENT>return '<STR_LIT>'<EOL><DEDENT>elif is_boolean_type(data_type):<EOL><INDENT>return '<STR_LIT:bool>'<EOL><DEDENT>elif is_float_type(data_type):<EOL><INDENT>return '<STR_LIT:float>'<EOL><DEDENT>elif is_integer_type(data_type):<EOL><INDENT>return '<STR_LIT:int>'<EOL><DEDENT>elif is_void_type(data_type):<EOL><INDENT>return '<STR_LIT:None>'<EOL><DEDENT>elif is_timestamp_type(data_type):<EOL><INDENT>timestamp_override = override_dict.get(Timestamp, None)<EOL>if timestamp_override:<EOL><INDENT>return timestamp_override(ns, data_type, override_dict)<EOL><DEDENT>return '<STR_LIT>'<EOL><DEDENT>elif is_alias(data_type):<EOL><INDENT>alias_type = cast(Alias, data_type)<EOL>return map_stone_type_to_python_type(ns, alias_type.data_type, override_dict)<EOL><DEDENT>elif is_user_defined_type(data_type):<EOL><INDENT>user_defined_type = cast(UserDefined, data_type)<EOL>class_name = class_name_for_data_type(user_defined_type)<EOL>if user_defined_type.namespace.name != ns.name:<EOL><INDENT>return '<STR_LIT>'.format(<EOL>fmt_namespace(user_defined_type.namespace.name), class_name)<EOL><DEDENT>else:<EOL><INDENT>return class_name<EOL><DEDENT><DEDENT>elif is_list_type(data_type):<EOL><INDENT>list_type = cast(List, data_type)<EOL>if List in override_dict:<EOL><INDENT>return override_dict[List](ns, list_type.data_type, override_dict)<EOL><DEDENT>return '<STR_LIT>'.format(<EOL>map_stone_type_to_python_type(ns, list_type.data_type, override_dict)<EOL>)<EOL><DEDENT>elif is_map_type(data_type):<EOL><INDENT>map_type = cast(Map, data_type)<EOL>if Map in override_dict:<EOL><INDENT>return override_dict[Map](<EOL>ns,<EOL>data_type,<EOL>override_dict<EOL>)<EOL><DEDENT>return '<STR_LIT>'.format(<EOL>map_stone_type_to_python_type(ns, map_type.key_data_type, override_dict),<EOL>map_stone_type_to_python_type(ns, map_type.value_data_type, override_dict)<EOL>)<EOL><DEDENT>elif is_nullable_type(data_type):<EOL><INDENT>nullable_type = cast(Nullable, data_type)<EOL>if Nullable in override_dict:<EOL><INDENT>return override_dict[Nullable](ns, nullable_type.data_type, override_dict)<EOL><DEDENT>return '<STR_LIT>'.format(<EOL>map_stone_type_to_python_type(ns, nullable_type.data_type, override_dict)<EOL>)<EOL><DEDENT>else:<EOL><INDENT>raise TypeError('<STR_LIT>' % data_type)<EOL><DEDENT>
Args:
    override_dict: lets you override the default behavior for a given type by hooking into
        a callback. (Currently only hooked up for stone's List and Nullable)