code: def get_interfaces(impls):
      
      if impls is None:
          return None
  
      elif isinstance(impls, OrderMixin):
          result = OrderedDict()
          for name in impls.order:
              result[name] = impls[name].interface
          return result
  
      elif isinstance(impls, Mapping):
          return {name: impls[name].interface for name in impls}
  
      elif isinstance(impls, Sequence):
          return [impl.interface for impl in impls]
  
      else:
          return impls.interface
docs: Get interfaces from their implementations.