original_docstring: 
          Transform the dataframe using the function provided
  
          If a given function is not supported by pandas dataframe, the transform would be a no-op
  
          Parameters
          ----------
          df: Union[pandas.DataFrame, dask.dataframe.core.DataFrame]
  
          Returns
          -------
          tuple(transformed_df, is_transformed)
              transformed_df is same type as the input
              is_transformed, bool
                  True if the transformation function coulfunction_args_d be applied
          
docstring: Transform the dataframe using the function provided
  If a given function is not supported by pandas dataframe, the transform would be a no-op
  
  Parameters
  
  
  
  Returns
  
  tuple(transformed_df, is_transformed)
  transformed_df is same type as the input
  is_transformed, bool
  True if the transformation function coulfunction_args_d be applied
docstring_tokens: Transform the dataframe using the function provided If a given function is not supported by pandas dataframe the transform would be a no - op Parameters Returns tuple ( transformed_df is_transformed ) transformed_df is same type as the input is_transformed bool True if the transformation function coulfunction_args_d be applied
code: def _transform(self, df):
          """
          Transform the dataframe using the function provided
  
          If a given function is not supported by pandas dataframe, the transform would be a no-op
  
          Parameters
          ----------
          df: Union[pandas.DataFrame, dask.dataframe.core.DataFrame]
  
          Returns
          -------
          tuple(transformed_df, is_transformed)
              transformed_df is same type as the input
              is_transformed, bool
                  True if the transformation function coulfunction_args_d be applied
          """
          # add a dummy target column
          drop_target = False
          if self.target_name is not None and self.target_name not in df.columns:
              drop_target = True
              df = df.assign(**{self.target_name: self.target_sample_val})
  
          # check if pandas dataframe has this function
          if hasattr(df, self.function_name_):
              function = getattr(df, self.function_name_)
  
          # if pandas dataframe does not have this function, it is possible that the function being accessed is
          # similar to dask.dataframe.core.DataFrame.map_partitions that takes python function as the first
          # argument and applies the function on each partition. The same effect can be achieved using pipe
          elif (
              isinstance(df, pd.DataFrame)
              and len(self.function_args_) > 0
              and callable(self.function_args_[0])
          ):
              function = getattr(df, "pipe")
          else:
              # this method cannot be applied on pandas dataframe
              return df, False
  
          function_args = self.function_args_
          result = function(*function_args, **self.function_kwargs_)
          if drop_target:
              result = result.drop(self.target_name, axis=1)
          return result, True
code_tokens: def _transform ( self , df ) : drop_target = False if self . target_name is not None and self . target_name not in df . columns : drop_target = True df = df . assign ( ** { self . target_name : self . target_sample_val } ) if hasattr ( df , self . function_name_ ) : function = getattr ( df , self . function_name_ ) elif ( isinstance ( df , pd . DataFrame ) and len ( self . function_args_ ) > 0 and callable ( self . function_args_ [ 0 ] ) ) : function = getattr ( df , "pipe" ) else : return df , False function_args = self . function_args_ result = function ( * function_args , ** self . function_kwargs_ ) if drop_target : result = result . drop ( self . target_name , axis = 1 ) return result , True
short_docstring: Transform the dataframe using the function provided
  If a given function is not supported by pandas dataframe, the transform would be a no-op
short_docstring_tokens: Transform the dataframe using the function provided If a given function is not supported by pandas dataframe the transform would be a no - op
comment: """
          Transform the dataframe using the function provided
  
          If a given function is not supported by pandas dataframe, the transform would be a no-op
  
          Parameters
          ----------
          df: Union[pandas.DataFrame, dask.dataframe.core.DataFrame]
  
          Returns
          -------
          tuple(transformed_df, is_transformed)
              transformed_df is same type as the input
              is_transformed, bool
                  True if the transformation function coulfunction_args_d be applied
          """$SEP$# add a dummy target column$SEP$# check if pandas dataframe has this function$SEP$# if pandas dataframe does not have this function, it is possible that the function being accessed is$SEP$# similar to dask.dataframe.core.DataFrame.map_partitions that takes python function as the first$SEP$# argument and applies the function on each partition. The same effect can be achieved using pipe$SEP$# this method cannot be applied on pandas dataframe