code: def identify_fans(shape):
      """
      Identify fans from shape.
  
      Parameters
      ----------
      shape : tuple or list
  
      Returns
      -------
      tuple
          Tuple that contains :math:`fan_{in}` and :math:`fan_{out}`.
      """
      n_dimensions = len(shape)
  
      if n_dimensions == 0:
          raise ValueError(
              "Cannot apply initializer when shape is unknown"
          )
  
      elif n_dimensions == 1:
          fan_in, fan_out = shape[0], 1
  
      elif n_dimensions == 2:
          fan_in, fan_out = shape
  
      else:
          # By default we assume that weights with more than 2 dimensions
          # are generated for convolutional layers.
          receptive_field = np.prod(shape[:-2]).item(0)
          fan_in = shape[-2] * receptive_field
          fan_out = shape[-1] * receptive_field
  
      return fan_in, fan_out
  
imports: import abc
  import six
  import numpy
  import tensorflow
  from neupy.core.docs import SharedDocsABCMeta
label_desc: Use image node_id 1 for calling a global function with example usage: identify_fans(shape) and returns: fan_in,  fan_out