code: def mkCompoundFilter(parts):
      
      # Separate into a list of callables and a list of filter objects
      transformers = []
      filters = []
      for subfilter in parts:
          try:
              subfilter = list(subfilter)
          except TypeError:
              # If it's not an iterable
              if hasattr(subfilter, 'getServiceEndpoints'):
                  # It's a full filter
                  filters.append(subfilter)
              elif hasattr(subfilter, 'fromBasicServiceEndpoint'):
                  # It's an endpoint object, so put its endpoint
                  # conversion attribute into the list of endpoint
                  # transformers
                  transformers.append(subfilter.fromBasicServiceEndpoint)
              elif isinstance(subfilter, collections.Callable):
                  # It's a simple callable, so add it to the list of
                  # endpoint transformers
                  transformers.append(subfilter)
              else:
                  raise filter_type_error
          else:
              filters.append(mkCompoundFilter(subfilter))
  
      if transformers:
          filters.append(TransformFilterMaker(transformers))
  
      if len(filters) == 1:
          return filters[0]
      else:
          return CompoundFilter(filters)
docs: Create a filter out of a list of filter-like things
  
      Used by mkFilter
  
      @param parts: list of filter, endpoint, callable or list of any of these