code: def expand_idx_mimetype(type_):
      
      if isinstance(type_, unicode_type):
          match = __IDX_PATTERN.match(type_)
          return __IDX_MAPPING.get(match.group(1), type_) if match else type_
      else:
          return type_
docs: Returns long equivalent of type_, if available, otherwise type_ itself. Does not raise exceptions