code: def _kernel(kernel_spec):
    
    if isinstance(kernel_spec, tf.compat.integral_types):
      return [kernel_spec, kernel_spec]
    elif len(kernel_spec) == 1:
      return [kernel_spec[0], kernel_spec[0]]
    else:
      assert len(kernel_spec) == 2
      return kernel_spec
docs: Expands the kernel spec into a length 2 list.
  
    Args:
      kernel_spec: An integer or a length 1 or 2 sequence that is expanded to a
        list.
    Returns:
      A length 2 list.