code: def _do_create_action(act, kw):
      
  
      if isinstance(act, ActionBase):
          return act
  
      if is_String(act):
          var=SCons.Util.get_environment_var(act)
          if var:
              # This looks like a string that is purely an Environment
              # variable reference, like "$FOO" or "${FOO}".  We do
              # something special here...we lazily evaluate the contents
              # of that Environment variable, so a user could put something
              # like a function or a CommandGenerator in that variable
              # instead of a string.
              return LazyAction(var, kw)
          commands = str(act).split('\n')
          if len(commands) == 1:
              return CommandAction(commands[0], **kw)
          # The list of string commands may include a LazyAction, so we
          # reprocess them via _do_create_list_action.
          return _do_create_list_action(commands, kw)
  
      if is_List(act):
          return CommandAction(act, **kw)
  
      if callable(act):
          try:
              gen = kw['generator']
              del kw['generator']
          except KeyError:
              gen = 0
          if gen:
              action_type = CommandGeneratorAction
          else:
              action_type = FunctionAction
          return action_type(act, kw)
  
      # Catch a common error case with a nice message:
      if isinstance(act, int) or isinstance(act, float):
          raise TypeError("Don't know how to create an Action from a number (%s)"%act)
      # Else fail silently (???)
      return None
docs: This is the actual "implementation" for the
      Action factory method, below.  This handles the
      fact that passing lists to Action() itself has
      different semantics than passing lists as elements
      of lists.
  
      The former will create a ListAction, the latter
      will create a CommandAction by converting the inner
      list elements to strings.