code: func (daemon *Daemon) reducePsContainer(container *container.Snapshot, ctx *listContext, reducer containerReducer) (*types.Container, error) {
  	// filter containers to return
  	switch includeContainerInList(container, ctx) {
  	case excludeContainer:
  		return nil, nil
  	case stopIteration:
  		return nil, errStopIteration
  	}
  
  	// transform internal container struct into api structs
  	newC, err := reducer(container, ctx)
  	if err != nil {
  		return nil, err
  	}
  
  	// release lock because size calculation is slow
  	if ctx.Size {
  		sizeRw, sizeRootFs := daemon.imageService.GetContainerLayerSize(newC.ID)
  		newC.SizeRw = sizeRw
  		newC.SizeRootFs = sizeRootFs
  	}
  	return newC, nil
  }
docs: // reducePsContainer is the basic representation for a container as expected by the ps command.