class_docstr: Magics that control various autoX behaviors.
docstr: Make functions callable without having to type parentheses.
  
  Usage:
  
     %autocall [mode]
  
  The mode can be one of: 0->Off, 1->Smart, 2->Full.  If not given, the
  value is toggled on and off (remembering the previous state).
  
  In more detail, these values mean:
  
  0 -> fully disabled
  
  1 -> active, but do not apply if there are no arguments on the line.
  
  In this mode, you get::
  
    In [1]: callable
    Out[1]: <built-in function callable>
  
    In [2]: callable 'hello'
    ------> callable('hello')
    Out[2]: False
  
  2 -> Active always.  Even if no arguments are present, the callable
  object is called::
  
    In [2]: float
    ------> float()
    Out[2]: 0.0
  
  Note that even with autocall off, you can still use '/' at the start of
  a line to treat the first argument on the command line as a function
  and add parentheses to it::
  
    In [8]: /str 43
    ------> str(43)
    Out[8]: '43'
  
  # all-random (note for auto-testing)
code: def autocall(self, parameter_s=""):
      """Make functions callable without having to type parentheses.
  
      Usage:
  
         %autocall [mode]
  
      The mode can be one of: 0->Off, 1->Smart, 2->Full.  If not given, the
      value is toggled on and off (remembering the previous state).
  
      In more detail, these values mean:
  
      0 -> fully disabled
  
      1 -> active, but do not apply if there are no arguments on the line.
  
      In this mode, you get::
  
        In [1]: callable
        Out[1]: <built-in function callable>
  
        In [2]: callable 'hello'
        ------> callable('hello')
        Out[2]: False
  
      2 -> Active always.  Even if no arguments are present, the callable
      object is called::
  
        In [2]: float
        ------> float()
        Out[2]: 0.0
  
      Note that even with autocall off, you can still use '/' at the start of
      a line to treat the first argument on the command line as a function
      and add parentheses to it::
  
        In [8]: /str 43
        ------> str(43)
        Out[8]: '43'
  
      # all-random (note for auto-testing)
      """
  
      if parameter_s:
          arg = int(parameter_s)
      else:
          arg = "toggle"
  
      if not arg in (0, 1, 2, "toggle"):
          error("Valid modes: (0->Off, 1->Smart, 2->Full")
          return
  
      if arg in (0, 1, 2):
          self.shell.autocall = arg
      else:  # toggle
          if self.shell.autocall:
              self._magic_state.autocall_save = self.shell.autocall
              self.shell.autocall = 0
          else:
              try:
                  self.shell.autocall = self._magic_state.autocall_save
              except AttributeError:
                  self.shell.autocall = (
                      self._magic_state.autocall_save
                  ) = 1
  
      print(
          "Automatic calling is:",
          ["OFF", "Smart", "Full"][self.shell.autocall],
      )
  
file_path: catboost/contrib/python/ipython/py2/IPython/core/magics/auto.py
imports: from __future__ import print_function
  from __future__ import absolute_import
  from IPython.core.magic import Bunch, Magics, magics_class, line_magic
  from IPython.testing.skipdoctest import skip_doctest
  from logging import error
label_desc: Use image node_id 3 for calling the AutoMagics obj's underlying member method code with example usage: obj.autocall(parameter_s) without return types