class_docstr: This a wrapper object for a user-defined function that is called
  at deploy time to populate fields in a Parameter. The wrapper
  is needed to make Click show the actual value returned by the
  function instead of a function pointer in its help text. Also, this
  object curries the context argument for the function, and pretty
  prints any exceptions that occur during evaluation.
class_docstr_tok: ["This","a","wrapper","object","for","a","user-defined","function","that","is","called","at","deploy","time","to","populate","fields","in","a","Parameter",".","The","wrapper","is","needed","to","make","Click","show","the","actual","value","returned","by","the","function","instead","of","a","function","pointer","in","its","help","text",".","Also",",","this","object","curries","the","context","argument","for","the","function",",","and","pretty","prints","any","exceptions","that","occur","during","evaluation","."]
code: def __call__(self, deploy_time=False):
      # This is called in two ways:
      #  - through the normal Click default parameter evaluation: if a default
      #    value is a callable, Click will call it without any argument. In other
      #    words, deploy_time=False. This happens for a normal "run" or the "trigger"
      #    functions for step-functions for example. Anything that has the
      #    @add_custom_parameters decorator will trigger this. Once click calls this,
      #    it will then pass the resulting value to the convert() functions for the
      #    type for that Parameter.
      #  - by deploy_time_eval which is invoked to process the parameters at
      #    deploy_time and outside of click processing (ie: at that point, Click
      #    is not involved since anytime deploy_time_eval is called, no custom parameters
      #    have been added). In that situation, deploy_time will be True. Note that in
      #    this scenario, the value should be something that can be converted to JSON.
      # The deploy_time value can therefore be used to determine which type of
      # processing is requested.
      ctx = context_proto._replace(parameter_name=self.parameter_name)
      try:
          try:
              # Most user-level functions may not care about the deploy_time parameter
              # but IncludeFile does.
              val = self.fun(ctx, deploy_time)
          except TypeError:
              val = self.fun(ctx)
      except:
          raise ParameterFieldFailed(self.parameter_name, self.field)
      else:
          return self._check_type(val, deploy_time)
  
imports: import json
  from typing import Any, Callable, Dict, NamedTuple, Optional, Type, Union
  from metaflow._vendor import click
  from .util import get_username, is_stringish
  from .exception import ParameterFieldFailed, ParameterFieldTypeMismatch, MetaflowException
label_desc: Use image node_id 2 for calling the DeployTimeField obj's underlying member method code with example usage: obj.__call__(deploy_time) and returns: self