class_docstr: A directed acyclic graph pipeline.
  
  This Pipeline can be given an arbitrary graph composed of Pipeline instances
  and will run all of those pipelines feeding outputs to inputs. See README.md
  for details.
  
  Use DAGPipeline to compose multiple smaller pipelines together.
class_docstr_tok: ["A","directed","acyclic","graph","pipeline",".","This","Pipeline","can","be","given","an","arbitrary","graph","composed","of","Pipeline","instances","and","will","run","all","of","those","pipelines","feeding","outputs","to","inputs",".","See","README.md","for","details",".","Use","DAGPipeline","to","compose","multiple","smaller","pipelines","together","."]
docstr: Joins many lists or dicts of outputs into a single list or dict.
  
  This function also validates that the outputs are correct for the given
  Pipeline.
  
  If `outputs` is a list of lists, the lists are concated and the type of
  each object must match `unit.output_type`.
  
  If `output` is a list of dicts (mapping string names to lists), each
  key has its lists concated across all the dicts. The keys and types
  are validated against `unit.output_type`.
  
  Args:
    outputs: A list of lists, or list of dicts which map string names to
        lists.
    unit: A Pipeline which every output in `outputs` will be validated
        against. `unit` must produce the outputs it says it will produce.
  
  Returns:
    If `outputs` is a list of lists, a single list of outputs.
    If `outputs` is a list of dicts, a single dictionary mapping string names
    to lists of outputs.
  
  Raises:
    InvalidTransformOutputError: If anything in `outputs` does not match
    the type signature given by `unit.output_type`.
docstr_tok: ["Joins","many","lists","or","dicts","of","outputs","into","a","single","list","or","dict",".","This","function","also","validates","that","the","outputs","are","correct","for","the","given","Pipeline",".","If","`","outputs","`","is","a","list","of","lists",",","the","lists","are","concated","and","the","type","of","each","object","must","match","`","unit.output_type","`",".","If","`","output","`","is","a","list","of","dicts","(","mapping","string","names","to","lists",")",",","each","key","has","its","lists","concated","across","all","the","dicts",".","The","keys","and","types","are","validated","against","`","unit.output_type","`",".","Args",":","outputs",":","A","list","of","lists",",","or","list","of","dicts","which","map","string","names","to","lists",".","unit",":","A","Pipeline","which","every","output","in","`","outputs","`","will","be","validated","against",".","`","unit","`","must","produce","the","outputs","it","says","it","will","produce",".","Returns",":","If","`","outputs","`","is","a","list","of","lists",",","a","single","list","of","outputs",".","If","`","outputs","`","is","a","list","of","dicts",",","a","single","dictionary","mapping","string","names","to","lists","of","outputs",".","Raises",":","InvalidTransformOutputError",":","If","anything","in","`","outputs","`","does","not","match","the","type","signature","given","by","`","unit.output_type","`","."]
code: def _join_lists_or_dicts(self, outputs, unit):
      """Joins many lists or dicts of outputs into a single list or dict.
  
      This function also validates that the outputs are correct for the given
      Pipeline.
  
      If `outputs` is a list of lists, the lists are concated and the type of
      each object must match `unit.output_type`.
  
      If `output` is a list of dicts (mapping string names to lists), each
      key has its lists concated across all the dicts. The keys and types
      are validated against `unit.output_type`.
  
      Args:
        outputs: A list of lists, or list of dicts which map string names to
            lists.
        unit: A Pipeline which every output in `outputs` will be validated
            against. `unit` must produce the outputs it says it will produce.
  
      Returns:
        If `outputs` is a list of lists, a single list of outputs.
        If `outputs` is a list of dicts, a single dictionary mapping string names
        to lists of outputs.
  
      Raises:
        InvalidTransformOutputError: If anything in `outputs` does not match
        the type signature given by `unit.output_type`.
      """
      if not outputs:
          return []
      if isinstance(unit.output_type, dict):
          concated = dict((key, []) for key in unit.output_type.keys())
          for d in outputs:
              if not isinstance(d, dict):
                  raise InvalidTransformOutputError(
                      "Expected dictionary output for %s with output type %s but "
                      "instead got type %s"
                      % (unit, unit.output_type, type(d))
                  )
              if set(d.keys()) != set(unit.output_type.keys()):
                  raise InvalidTransformOutputError(
                      "Got dictionary output with incorrect keys for %s. Got %s. "
                      "Expected %s"
                      % (unit, d.keys(), unit.output_type.keys())
                  )
              for k, val in d.items():
                  if not isinstance(val, list):
                      raise InvalidTransformOutputError(
                          "DagOutput from %s for key %s is not a list."
                          % (unit, k)
                      )
                  if not _all_are_type(val, unit.output_type[k]):
                      raise InvalidTransformOutputError(
                          "Some outputs from %s for key %s are not of expected type %s. "
                          "Got types %s"
                          % (
                              unit,
                              k,
                              unit.output_type[k],
                              [type(inst) for inst in val],
                          )
                      )
                  concated[k] += val
      else:
          concated = []
          for l in outputs:
              if not isinstance(l, list):
                  raise InvalidTransformOutputError(
                      "Expected list output for %s with outpu type %s but instead got "
                      "type %s" % (unit, unit.output_type, type(l))
                  )
              if not _all_are_type(l, unit.output_type):
                  raise InvalidTransformOutputError(
                      "Some outputs from %s are not of expected type %s. Got types %s"
                      % (
                          unit,
                          unit.output_type,
                          [type(inst) for inst in l],
                      )
                  )
              concated += l
      return concated
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import itertools
  from magenta.pipelines import pipeline
  import six
label_desc: Use image node_id 9 for calling the DAGPipeline obj's underlying member method code with example usage: obj._join_lists_or_dicts(outputs, unit) and returns: concated, list