code: def get_fans(shape):
      if not isinstance(shape, tuple):
          raise ValueError(
              "shape must be tuple. Actual type: {}".format(type(shape))
          )
  
      if len(shape) < 2:
          raise ValueError(
              "shape must be of length >= 2. Actual shape: {}".format(
                  shape
              )
          )
  
      receptive_field_size = utils.size_of_shape(shape[2:])
      fan_in = shape[1] * receptive_field_size
      fan_out = shape[0] * receptive_field_size
      return fan_in, fan_out
  
file_path: chainer/chainer/initializer.py
imports: import typing
  from chainer import types
  from chainer import utils
label_desc: Use image node_id 1 for calling a global function with example usage: get_fans(shape) and returns: fan_in,  fan_out