class_docstr: Object that handles all magic-related functionality for IPython.
      
class_docstr_tok: ["Object","that","handles","all","magic-related","functionality","for","IPython","."]
docstr: Expose a standalone function as magic function for IPython.
  
  This will create an IPython magic (line, cell or both) from a
  standalone function.  The functions should have the following
  signatures:
  
  * For line magics: `def f(line)`
  * For cell magics: `def f(line, cell)`
  * For a function that does both: `def f(line, cell=None)`
  
  In the latter case, the function will be called with `cell==None` when
  invoked as `%f`, and with cell as a string when invoked as `%%f`.
  
  Parameters
  ----------
  func : callable
      Function to be registered as a magic.
  magic_kind : str
      Kind of magic, one of 'line', 'cell' or 'line_cell'
  magic_name : optional str
      If given, the name the magic will have in the IPython namespace.  By
      default, the name of the function itself is used.
docstr_tok: ["Expose","a","standalone","function","as","magic","function","for","IPython",".","This","will","create","an","IPython","magic","(","line",",","cell","or","both",")","from","a","standalone","function",".","The","functions","should","have","the","following","signatures",":","*","For","line","magics",":","`","def","f","(","line",")","`","*","For","cell","magics",":","`","def","f","(","line",",","cell",")","`","*","For","a","function","that","does","both",":","`","def","f","(","line",",","cell=None",")","`","In","the","latter","case",",","the","function","will","be","called","with","`","cell==None","`","when","invoked","as","`","%","f","`",",","and","with","cell","as","a","string","when","invoked","as","`","%","%","f","`",".","Parameters","--","--","--","--","--","func",":","callable","Function","to","be","registered","as","a","magic",".","magic_kind",":","str","Kind","of","magic",",","one","of","'line","'",",","'cell","'","or","'line_cell'","magic_name",":","optional","str","If","given",",","the","name","the","magic","will","have","in","the","IPython","namespace",".","By","default",",","the","name","of","the","function","itself","is","used","."]
code: def register_function(self, func, magic_kind="line", magic_name=None):
      """Expose a standalone function as magic function for IPython.
  
      This will create an IPython magic (line, cell or both) from a
      standalone function.  The functions should have the following
      signatures:
  
      * For line magics: `def f(line)`
      * For cell magics: `def f(line, cell)`
      * For a function that does both: `def f(line, cell=None)`
  
      In the latter case, the function will be called with `cell==None` when
      invoked as `%f`, and with cell as a string when invoked as `%%f`.
  
      Parameters
      ----------
      func : callable
          Function to be registered as a magic.
      magic_kind : str
          Kind of magic, one of 'line', 'cell' or 'line_cell'
      magic_name : optional str
          If given, the name the magic will have in the IPython namespace.  By
          default, the name of the function itself is used.
      """
  
      # Create the new method in the user_magics and register it in the
      # global table
      validate_type(magic_kind)
      magic_name = func.__name__ if magic_name is None else magic_name
      setattr(self.user_magics, magic_name, func)
      record_magic(self.magics, magic_kind, magic_name, func)
  
imports: import os
  import re
  import sys
  from getopt import getopt, GetoptError
  from traitlets.config.configurable import Configurable
  from .None import oinspect
  from .error import UsageError
  from .inputtransformer2 import ESC_MAGIC, ESC_MAGIC2
  from ..utils.ipstruct import Struct
  from ..utils.process import arg_split
  from ..utils.text import dedent
  from traitlets import Bool, Dict, Instance, observe
  from logging import error
label_desc: Use image node_id 8 for calling the MagicsManager obj's underlying member method code with example usage: obj.register_function(func, magic_kind, magic_name) without return types