parameters: (pvalue, **options)
return_statement: return _to_pobject(pvalue)
docstring: 对于给定的PCollection/PTable，聚合为PObject，PObject的内容为list/dict
  
      Args:
          pvalue (PCollection/PTable): 输入
          **options:  可配置选项
  
      Returns:
          PObject: 聚合后的list/dict
  
      >>> from bigflow import transforms
      >>> a = _pipeline.parallelize([1, 1, 2, 3])
      >>> transforms.to_pobject(a).get()
      [1, 1, 2, 3]
  
      >>> from bigflow import transforms
      >>> b = _pipeline.parallelize({'e': 'f', 'g': 'h'})
      >>> transforms.to_pobject(b).get()
      {'e': 'f', 'g': 'h'}
docstring_summary: 对于给定的PCollection/PTable，聚合为PObject，PObject的内容为list/dict
docstring_tokens: 对于给定的PCollection / PTable，聚合为PObject，PObject的内容为list / dict
function: def to_pobject(pvalue, **options):
      """
      对于给定的PCollection/PTable，聚合为PObject，PObject的内容为list/dict
  
      Args:
          pvalue (PCollection/PTable): 输入
          **options:  可配置选项
  
      Returns:
          PObject: 聚合后的list/dict
  
      >>> from bigflow import transforms
      >>> a = _pipeline.parallelize([1, 1, 2, 3])
      >>> transforms.to_pobject(a).get()
      [1, 1, 2, 3]
  
      >>> from bigflow import transforms
      >>> b = _pipeline.parallelize({'e': 'f', 'g': 'h'})
      >>> transforms.to_pobject(b).get()
      {'e': 'f', 'g': 'h'}
  
      """
  
      from bigflow import pobject
      from bigflow import pcollection
      from bigflow import ptable
  
      def _to_pobject(item):
          if isinstance(item, pobject.PObject):
              return item
          elif isinstance(item, pcollection.PCollection):
              return to_list_pobject(item)
          elif isinstance(item, ptable.PTable):
              return to_list_pobject(item.apply_values(lambda x: _to_pobject(x)) \
                                     .flatten()) \
                                     .map(lambda x: dict(x))
          else:
              raise ValueError("to_pobject only applied on PCollections/PObject/PTable")
  
      return _to_pobject(pvalue)
function_tokens: def to_pobject ( pvalue , * * options ) : from bigflow import pobject from bigflow import pcollection from bigflow import ptable def _to_pobject ( item ) : if isinstance ( item , pobject . PObject ) : return item elif isinstance ( item , pcollection . PCollection ) : return to_list_pobject ( item ) elif isinstance ( item , ptable . PTable ) : return to_list_pobject ( item . apply_values ( lambda x : _to_pobject ( x ) ) . flatten ( ) ) . map ( lambda x : dict ( x ) ) else : raise ValueError ( "to_pobject only applied on PCollections/PObject/PTable" ) return _to_pobject ( pvalue )