class_docstr: Base class for modules.
  
  Args:
      device (string): Device name
          (<span style="color:#00C000"><b>default</b></span>: inherit value of parent module).
      l2_regularization (float >= 0.0): Scalar controlling L2 regularization
          (<span style="color:#00C000"><b>default</b></span>: inherit value of parent module).
      name (string): <span style="color:#0000C0"><b>internal use</b></span>.
code: def get_module_class_and_args(
      *,
      name,
      module=None,
      modules=None,
      default_module=None,
      disable_first_arg=False,
      **kwargs,
  ):
      # name
      if not isinstance(name, str):
          raise TensorforceError.type(
              name="Module.add_module",
              argument="name",
              dtype=type(name),
          )
      # modules
      if modules is not None and not isinstance(modules, dict):
          raise TensorforceError.type(
              name="Module.add_module",
              argument="modules",
              dtype=type(modules),
          )
  
      # default_module
      if (
          default_module is not None
          and default_module not in modules
          and not issubclass(default_module, Module)
      ):
          raise TensorforceError.value(
              name="Module.add_module",
              argument="default_module",
              value=default_module,
          )
  
      # disable_first_arg
      if not isinstance(disable_first_arg, bool):
          raise TensorforceError.type(
              name="Module.add_module",
              argument="disable_first_arg",
              dtype=type(disable_first_arg),
          )
  
      # module
      if isinstance(module, dict):
          # Dictionary module specification (type either given via 'type' or 'default_module')
          util.deep_disjoint_update(target=kwargs, source=module)
          module = kwargs.pop("type", default_module)
          return Module.get_module_class_and_args(
              name=name,
              module=module,
              modules=modules,
              default_module=default_module,
              disable_first_arg=True,
              **kwargs,
          )
  
      elif isinstance(module, str):
          if os.path.isfile(module):
              # JSON file module specification
              with open(module, "r") as fp:
                  module = json.load(fp=fp)
              return Module.get_module_class_and_args(
                  name=name,
                  module=module,
                  modules=modules,
                  default_module=default_module,
                  disable_first_arg=True,
                  **kwargs,
              )
  
          elif modules is not None and module in modules:
              # Keyword module specification
              return Module.get_module_class_and_args(
                  name=name,
                  module=modules[module],
                  modules=modules,
                  default_module=default_module,
                  disable_first_arg=True,
                  **kwargs,
              )
  
          else:
              # Library module specification
              assert modules is not None
              parent_class = next(iter(modules.values()))
              while (
                  len(parent_class.mro()) >= 4
                  and parent_class.mro()[1] != Module
              ):
                  parent_class = parent_class.mro()[1]
              _module = util.try_import_module(
                  module=module, parent_class=parent_class
              )
              if _module is not None:
                  return Module.get_module_class_and_args(
                      name=name,
                      module=_module,
                      modules=modules,
                      default_module=default_module,
                      disable_first_arg=True,
                      **kwargs,
                  )
  
              if "default" in modules or default_module is not None:
                  # Default module specification
                  if "_first_arg" in kwargs:
                      raise TensorforceError.invalid(
                          name="Module.add_module",
                          argument="_first_arg",
                      )
                  if module is not None:
                      if disable_first_arg:
                          raise TensorforceError.value(
                              name="Module.add_module",
                              argument="module",
                              value=module,
                          )
                      kwargs["_first_arg"] = module
                  if default_module is None:
                      default_module = modules["default"]
                  return Module.get_module_class_and_args(
                      name=name,
                      module=default_module,
                      modules=modules,
                      **kwargs,
                  )
  
              else:
                  raise TensorforceError.value(
                      name="Module.add_module",
                      argument="module",
                      value=module,
                  )
  
      elif (
          not callable(module)
          or isinstance(module, tf.keras.Model)
          or (
              isinstance(module, type)
              and issubclass(module, tf.keras.Model)
          )
      ) and ("default" in modules or default_module is not None):
          # Default module specification
          if "_first_arg" in kwargs:
              raise TensorforceError.invalid(
                  name="Module.add_module", argument="_first_arg"
              )
          if module is not None:
              kwargs["_first_arg"] = module
          if default_module is None:
              default_module = modules["default"]
          return Module.get_module_class_and_args(
              name=name,
              module=default_module,
              modules=modules,
              **kwargs,
          )
  
      elif callable(module):
          if "_first_arg" in kwargs:
              args = (kwargs.pop("_first_arg"),)
          else:
              args = ()
          kwargs["name"] = name
          return module, args, kwargs
  
      else:
          raise TensorforceError.value(
              name="Module.add_module", argument="module", value=module
          )
  
imports: import functools
  import json
  import os
  import re
  import numpy
  import tensorflow
  from tensorforce import TensorforceError, util
  import tensorforce.core
  from tensorforce.core import SignatureDict, TensorSpec, tf_util, VariableDict
label_desc: Use image node_id 18 for calling the Module obj's underlying member method code with example usage: obj.get_module_class_and_args() and returns: Module, Module, Module, Module, module,  args,  kwargs, Module, Module