original_docstring: A decorator for a function-based PTransform.
  
    Experimental; no backwards-compatibility guarantees.
  
    Args:
      fn: A function implementing a custom PTransform.
  
    Returns:
      A CallablePTransform instance wrapping the function-based PTransform.
  
    This wrapper provides an alternative, simpler way to define a PTransform.
    The standard method is to subclass from PTransform and override the expand()
    method. An equivalent effect can be obtained by defining a function that
    an input PCollection and additional optional arguments and returns a
    resulting PCollection. For example::
  
      @ptransform_fn
      def CustomMapper(pcoll, mapfn):
        return pcoll | ParDo(mapfn)
  
    The equivalent approach using PTransform subclassing::
  
      class CustomMapper(PTransform):
  
        def __init__(self, mapfn):
          super(CustomMapper, self).__init__()
          self.mapfn = mapfn
  
        def expand(self, pcoll):
          return pcoll | ParDo(self.mapfn)
  
    With either method the custom PTransform can be used in pipelines as if
    it were one of the "native" PTransforms::
  
      result_pcoll = input_pcoll | 'Label' >> CustomMapper(somefn)
  
    Note that for both solutions the underlying implementation of the pipe
    operator (i.e., `|`) will inject the pcoll argument in its proper place
    (first argument if no label was specified and second argument otherwise).
    
docstring: A decorator for a function-based PTransform.
  Experimental; no backwards-compatibility guarantees.
docstring_tokens: A decorator for a function - based PTransform . Experimental ; no backwards - compatibility guarantees .
code: def ptransform_fn(fn):
    """A decorator for a function-based PTransform.
  
    Experimental; no backwards-compatibility guarantees.
  
    Args:
      fn: A function implementing a custom PTransform.
  
    Returns:
      A CallablePTransform instance wrapping the function-based PTransform.
  
    This wrapper provides an alternative, simpler way to define a PTransform.
    The standard method is to subclass from PTransform and override the expand()
    method. An equivalent effect can be obtained by defining a function that
    an input PCollection and additional optional arguments and returns a
    resulting PCollection. For example::
  
      @ptransform_fn
      def CustomMapper(pcoll, mapfn):
        return pcoll | ParDo(mapfn)
  
    The equivalent approach using PTransform subclassing::
  
      class CustomMapper(PTransform):
  
        def __init__(self, mapfn):
          super(CustomMapper, self).__init__()
          self.mapfn = mapfn
  
        def expand(self, pcoll):
          return pcoll | ParDo(self.mapfn)
  
    With either method the custom PTransform can be used in pipelines as if
    it were one of the "native" PTransforms::
  
      result_pcoll = input_pcoll | 'Label' >> CustomMapper(somefn)
  
    Note that for both solutions the underlying implementation of the pipe
    operator (i.e., `|`) will inject the pcoll argument in its proper place
    (first argument if no label was specified and second argument otherwise).
    """
    # TODO(robertwb): Consider removing staticmethod to allow for self parameter.
  
    def callable_ptransform_factory(*args, **kwargs):
      return _PTransformFnPTransform(fn, *args, **kwargs)
    return callable_ptransform_factory
code_tokens: def ptransform_fn ( fn ) : def callable_ptransform_factory ( * args , ** kwargs ) : return _PTransformFnPTransform ( fn , * args , ** kwargs ) return callable_ptransform_factory
short_docstring: A decorator for a function-based PTransform.
short_docstring_tokens: A decorator for a function - based PTransform .
comment: """A decorator for a function-based PTransform.
  
    Experimental; no backwards-compatibility guarantees.
  
    Args:
      fn: A function implementing a custom PTransform.
  
    Returns:
      A CallablePTransform instance wrapping the function-based PTransform.
  
    This wrapper provides an alternative, simpler way to define a PTransform.
    The standard method is to subclass from PTransform and override the expand()
    method. An equivalent effect can be obtained by defining a function that
    an input PCollection and additional optional arguments and returns a
    resulting PCollection. For example::
  
      @ptransform_fn
      def CustomMapper(pcoll, mapfn):
        return pcoll | ParDo(mapfn)
  
    The equivalent approach using PTransform subclassing::
  
      class CustomMapper(PTransform):
  
        def __init__(self, mapfn):
          super(CustomMapper, self).__init__()
          self.mapfn = mapfn
  
        def expand(self, pcoll):
          return pcoll | ParDo(self.mapfn)
  
    With either method the custom PTransform can be used in pipelines as if
    it were one of the "native" PTransforms::
  
      result_pcoll = input_pcoll | 'Label' >> CustomMapper(somefn)
  
    Note that for both solutions the underlying implementation of the pipe
    operator (i.e., `|`) will inject the pcoll argument in its proper place
    (first argument if no label was specified and second argument otherwise).
    """$SEP$# TODO(robertwb): Consider removing staticmethod to allow for self parameter.