class_docstr: MetaflowTask prepares a Flow instance for execution of a single step.
class_docstr_tok: ["MetaflowTask","prepares","a","Flow","instance","for","execution","of","a","single","step","."]
code: def _init_parameters(self, parameter_ds, passdown=True):
      cls = self.flow.__class__
  
      def _set_cls_var(_, __):
          raise AttributeError(
              "Flow level attributes and Parameters are not modifiable"
          )
  
      def set_as_parameter(name, value):
          if callable(value):
              setattr(
                  cls, name, property(fget=value, fset=_set_cls_var)
              )
          else:
              setattr(
                  cls,
                  name,
                  property(
                      fget=lambda _, val=value: val, fset=_set_cls_var
                  ),
              )
  
      # overwrite Parameters in the flow object
      all_vars = []
      for var, param in self.flow._get_parameters():
          # make the parameter a read-only property
          # note x=x binds the current value of x to the closure
          def property_setter(
              _,
              param=param,
              var=var,
              parameter_ds=parameter_ds,
          ):
              v = param.load_parameter(parameter_ds[var])
              # Reset the parameter to just return the value now that we have loaded it
              set_as_parameter(var, v)
              return v
  
          set_as_parameter(var, property_setter)
          all_vars.append(var)
  
      param_only_vars = list(all_vars)
      # make class-level values read-only to be more consistent across steps in a flow
      # they are also only persisted once, so we similarly pass them down if
      # required
      for var in dir(cls):
          if (
              var[0] == "_"
              or var in cls._NON_PARAMETERS
              or var in all_vars
          ):
              continue
          val = getattr(cls, var)
          # Exclude methods, properties and other classes
          if isinstance(
              val, (MethodType, FunctionType, property, type)
          ):
              continue
          set_as_parameter(var, val)
          all_vars.append(var)
  
      # We also passdown _graph_info through the entire graph
      set_as_parameter(
          "_graph_info",
          lambda _, parameter_ds=parameter_ds: parameter_ds[
              "_graph_info"
          ],
      )
      all_vars.append("_graph_info")
  
      if passdown:
          self.flow._datastore.passdown_partial(parameter_ds, all_vars)
      return param_only_vars
  
imports: from __future__ import print_function
  from io import BytesIO
  import math
  import sys
  import os
  import time
  from types import MethodType, FunctionType
  from metaflow.datastore.exceptions import DataException
  from .metaflow_config import MAX_ATTEMPTS
  from .metadata import MetaDatum
  from .mflog import TASK_LOG_SOURCE
  from .datastore import Inputs, TaskDataStoreSet
  from .exception import MetaflowInternalError, MetaflowDataMissing, MetaflowExceptionWrapper
  from .unbounded_foreach import UBF_CONTROL
  from .util import all_equal, get_username, resolve_identity, unicode_type
  from .current import current
  from metaflow.tracing import get_trace_id
  from collections import namedtuple
label_desc: Use image node_id 3 for calling the MetaflowTask obj's underlying member method code with example usage: obj._init_parameters(parameter_ds, passdown) and returns: param_only_vars, v