class_docstr: Factory for instances of :class:`interactive`.
  
  This class is needed to support options like::
  
      >>> @interact.options(manual=True)
      ... def greeting(text="World"):
      ...     print("Hello {}".format(text))
  
  Parameters
  ----------
  cls : class
      The subclass of :class:`interactive` to construct.
  options : dict
      A dict of options used to construct the interactive
      function. By default, this is returned by
      ``cls.default_options()``.
  kwargs : dict
      A dict of **kwargs to use for widgets.
docstr: Make the given function interactive by adding and displaying
  the corresponding :class:`interactive` widget.
  
  Expects the first argument to be a function. Parameters to this
  function are widget abbreviations passed in as keyword arguments
  (``**kwargs``). Can be used as a decorator (see examples).
  
  Returns
  -------
  f : __interact_f with interactive widget attached to it.
  
  Parameters
  ----------
  __interact_f : function
      The function to which the interactive widgets are tied. The `**kwargs`
      should match the function signature. Passed to :func:`interactive()`
  **kwargs : various, optional
      An interactive widget is created for each keyword argument that is a
      valid widget abbreviation. Passed to :func:`interactive()`
  
  Examples
  --------
  Render an interactive text field that shows the greeting with the passed in
  text::
  
      # 1. Using interact as a function
      def greeting(text="World"):
          print("Hello {}".format(text))
      interact(greeting, text="Jupyter Widgets")
  
      # 2. Using interact as a decorator
      @interact
      def greeting(text="World"):
          print("Hello {}".format(text))
  
      # 3. Using interact as a decorator with named parameters
      @interact(text="Jupyter Widgets")
      def greeting(text="World"):
          print("Hello {}".format(text))
  
  Render an interactive slider widget and prints square of number::
  
      # 1. Using interact as a function
      def square(num=1):
          print("{} squared is {}".format(num, num*num))
      interact(square, num=5)
  
      # 2. Using interact as a decorator
      @interact
      def square(num=2):
          print("{} squared is {}".format(num, num*num))
  
      # 3. Using interact as a decorator with named parameters
      @interact(num=5)
      def square(num=2):
          print("{} squared is {}".format(num, num*num))
docstr_tok: ["Make","the","given","function","interactive","by","adding","and","displaying","the","corresponding",":","class",":","`","interactive","`","widget",".","Expects","the","first","argument","to","be","a","function",".","Parameters","to","this","function","are","widget","abbreviations","passed","in","as","keyword","arguments","(","``","*","*","kwargs","``",")",".","Can","be","used","as","a","decorator","(","see","examples",")",".","Returns","--","--","--","-","f",":","__interact_f","with","interactive","widget","attached","to","it",".","Parameters","--","--","--","--","--","__interact_f",":","function","The","function","to","which","the","interactive","widgets","are","tied",".","The","`","*","*","kwargs","`","should","match","the","function","signature",".","Passed","to",":","func",":","`","interactive","(",")","`","*","*","kwargs",":","various",",","optional","An","interactive","widget","is","created","for","each","keyword","argument","that","is","a","valid","widget","abbreviation",".","Passed","to",":","func",":","`","interactive","(",")","`","Examples","--","--","--","--","Render","an","interactive","text","field","that","shows","the","greeting","with","the","passed","in","text",":",":","#","1",".","Using","interact","as","a","function","def","greeting","(","text=","''","World","''",")",":","print","(","``","Hello","{","}","''",".format","(","text",")",")","interact","(","greeting",",","text=","''","Jupyter","Widgets","''",")","#","2",".","Using","interact","as","a","decorator","@","interact","def","greeting","(","text=","''","World","''",")",":","print","(","``","Hello","{","}","''",".format","(","text",")",")","#","3",".","Using","interact","as","a","decorator","with","named","parameters","@","interact","(","text=","''","Jupyter","Widgets","''",")","def","greeting","(","text=","''","World","''",")",":","print","(","``","Hello","{","}","''",".format","(","text",")",")","Render","an","interactive","slider","widget","and","prints","square","of","number",":",":","#","1",".","Using","interact","as","a","function","def","square","(","num=1",")",":","print","(","``","{","}","squared","is","{","}","''",".format","(","num",",","num","*","num",")",")","interact","(","square",",","num=5",")","#","2",".","Using","interact","as","a","decorator","@","interact","def","square","(","num=2",")",":","print","(","``","{","}","squared","is","{","}","''",".format","(","num",",","num","*","num",")",")","#","3",".","Using","interact","as","a","decorator","with","named","parameters","@","interact","(","num=5",")","def","square","(","num=2",")",":","print","(","``","{","}","squared","is","{","}","''",".format","(","num",",","num","*","num",")",")"]
code: def __call__(self, __interact_f=None, **kwargs):
      """
      Make the given function interactive by adding and displaying
      the corresponding :class:`interactive` widget.
  
      Expects the first argument to be a function. Parameters to this
      function are widget abbreviations passed in as keyword arguments
      (``**kwargs``). Can be used as a decorator (see examples).
  
      Returns
      -------
      f : __interact_f with interactive widget attached to it.
  
      Parameters
      ----------
      __interact_f : function
          The function to which the interactive widgets are tied. The `**kwargs`
          should match the function signature. Passed to :func:`interactive()`
      **kwargs : various, optional
          An interactive widget is created for each keyword argument that is a
          valid widget abbreviation. Passed to :func:`interactive()`
  
      Examples
      --------
      Render an interactive text field that shows the greeting with the passed in
      text::
  
          # 1. Using interact as a function
          def greeting(text="World"):
              print("Hello {}".format(text))
          interact(greeting, text="Jupyter Widgets")
  
          # 2. Using interact as a decorator
          @interact
          def greeting(text="World"):
              print("Hello {}".format(text))
  
          # 3. Using interact as a decorator with named parameters
          @interact(text="Jupyter Widgets")
          def greeting(text="World"):
              print("Hello {}".format(text))
  
      Render an interactive slider widget and prints square of number::
  
          # 1. Using interact as a function
          def square(num=1):
              print("{} squared is {}".format(num, num*num))
          interact(square, num=5)
  
          # 2. Using interact as a decorator
          @interact
          def square(num=2):
              print("{} squared is {}".format(num, num*num))
  
          # 3. Using interact as a decorator with named parameters
          @interact(num=5)
          def square(num=2):
              print("{} squared is {}".format(num, num*num))
      """
      # If kwargs are given, replace self by a new
      # _InteractFactory with the updated kwargs
      if kwargs:
          kw = dict(self.kwargs)
          kw.update(kwargs)
          self = type(self)(self.cls, self.opts, kw)
  
      f = __interact_f
      if f is None:
          # This branch handles the case 3
          # @interact(a=30, b=40)
          # def f(*args, **kwargs):
          #     ...
          #
          # Simply return the new factory
          return self
  
      # positional arg support in: https://gist.github.com/8851331
      # Handle the cases 1 and 2
      # 1. interact(f, **kwargs)
      # 2. @interact
      #    def f(*args, **kwargs):
      #        ...
      w = self.widget(f)
      try:
          f.widget = w
      except AttributeError:
          # some things (instancemethods) can't have attributes attached,
          # so wrap in a lambda
          f = lambda *args, **kwargs: __interact_f(*args, **kwargs)
          f.widget = w
      show_inline_matplotlib_plots()
      display(w)
      return f
  
imports: from collections.abc import Iterable, Mapping
  from inspect import signature, Parameter
  from inspect import getcallargs
  from inspect import getfullargspec
  import sys
  from IPython import get_ipython
  from .None import Widget, ValueWidget, Text, FloatSlider, IntSlider, Checkbox, Dropdown, VBox, Button, DOMWidget, Output
  from IPython.display import display, clear_output
  from traitlets import HasTraits, Any, Unicode, observe
  from numbers import Real, Integral
  from warnings import warn
label_desc: Use image node_id 3 for calling the _InteractFactory obj's underlying member method code with example usage: obj.__call__(__interact_f) and returns: f, self