code: def fmt_type_name(data_type, inside_namespace=None):
      
      if is_user_defined_type(data_type) or is_alias(data_type):
          if data_type.namespace == inside_namespace:
              return data_type.name
          else:
              return '%s.%s' % (data_type.namespace.name, data_type.name)
      else:
          fmted_type = _base_type_table.get(data_type.__class__, 'Object')
          if is_list_type(data_type):
              fmted_type += '<' + fmt_type(data_type.data_type, inside_namespace) + '>'
          return fmted_type
docs: Produces a TypeScript type name for the given data type.
      inside_namespace should be set to the namespace that the reference
      occurs in, or None if this parameter is not relevant.