class_docstr: Factory mixin.
  
  Provides a `make` method that searches for an appropriate subclass to
  instantiate given a key. Subclasses inheriting from a class that has Factory
  mixed in can expose themselves for instantiation through this method by
  setting the class attribute named `key` to an appropriate value.
class_docstr_tok: ["Factory","mixin",".","Provides","a","`","make","`","method","that","searches","for","an","appropriate","subclass","to","instantiate","given","a","key",".","Subclasses","inheriting","from","a","class","that","has","Factory","mixed","in","can","expose","themselves","for","instantiation","through","this","method","by","setting","the","class","attribute","named","`","key","`","to","an","appropriate","value","."]
docstr: Instantiate a subclass of `cls`.
  
  Args:
    key: the key identifying the subclass.
    *args: passed on to the subclass constructor.
    **kwargs: passed on to the subclass constructor.
  
  Returns:
    An instantiation of the subclass that has the given key.
  
  Raises:
    KeyError: if key is not a child subclass of cls.
docstr_tok: ["Instantiate","a","subclass","of","`","cls","`",".","Args",":","key",":","the","key","identifying","the","subclass",".","*","args",":","passed","on","to","the","subclass","constructor",".","*","*","kwargs",":","passed","on","to","the","subclass","constructor",".","Returns",":","An","instantiation","of","the","subclass","that","has","the","given","key",".","Raises",":","KeyError",":","if","key","is","not","a","child","subclass","of","cls","."]
code: def make(cls, key, *args, **kwargs):
      """Instantiate a subclass of `cls`.
  
      Args:
        key: the key identifying the subclass.
        *args: passed on to the subclass constructor.
        **kwargs: passed on to the subclass constructor.
  
      Returns:
        An instantiation of the subclass that has the given key.
  
      Raises:
        KeyError: if key is not a child subclass of cls.
      """
      for subklass in deepsubclasses(cls):
          if subklass.key == key:
              return subklass(*args, **kwargs)
  
      raise KeyError("unknown %s subclass key %s" % (cls, key))
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import contextlib
  import datetime
  import numbers
  import pdb
  import tempfile
  import time
  import numpy
  import tensorflow.compat.v1
label_desc: Use image node_id 1 for calling the Factory obj's underlying member method code with example usage: obj.make(cls, key) and returns: subklass