parameters: (a)
docstring: Find the indices of the first and last unmasked values.
  
      Expects a 1-D `MaskedArray`, returns None if all values are masked.
  
      Parameters
      ----------
      a : array_like
          Input 1-D `MaskedArray`
  
      Returns
      -------
      edges : ndarray or None
          The indices of first and last non-masked value in the array.
          Returns None if all values are masked.
  
      See Also
      --------
      flatnotmasked_contiguous, notmasked_contiguous, notmasked_edges
      clump_masked, clump_unmasked
  
      Notes
      -----
      Only accepts 1-D arrays.
  
      Examples
      --------
      >>> a = np.ma.arange(10)
      >>> np.ma.flatnotmasked_edges(a)
      array([0, 9])
  
      >>> mask = (a < 3) | (a > 8) | (a == 5)
      >>> a[mask] = np.ma.masked
      >>> np.array(a[~a.mask])
      array([3, 4, 6, 7, 8])
  
      >>> np.ma.flatnotmasked_edges(a)
      array([3, 8])
  
      >>> a[:] = np.ma.masked
      >>> print(np.ma.flatnotmasked_edges(a))
      None
docstring_summary: Find the indices of the first and last unmasked values.
docstring_tokens: Find the indices of the first and last unmasked values .
function: def flatnotmasked_edges(a):
      """
      Find the indices of the first and last unmasked values.
  
      Expects a 1-D `MaskedArray`, returns None if all values are masked.
  
      Parameters
      ----------
      a : array_like
          Input 1-D `MaskedArray`
  
      Returns
      -------
      edges : ndarray or None
          The indices of first and last non-masked value in the array.
          Returns None if all values are masked.
  
      See Also
      --------
      flatnotmasked_contiguous, notmasked_contiguous, notmasked_edges
      clump_masked, clump_unmasked
  
      Notes
      -----
      Only accepts 1-D arrays.
  
      Examples
      --------
      >>> a = np.ma.arange(10)
      >>> np.ma.flatnotmasked_edges(a)
      array([0, 9])
  
      >>> mask = (a < 3) | (a > 8) | (a == 5)
      >>> a[mask] = np.ma.masked
      >>> np.array(a[~a.mask])
      array([3, 4, 6, 7, 8])
  
      >>> np.ma.flatnotmasked_edges(a)
      array([3, 8])
  
      >>> a[:] = np.ma.masked
      >>> print(np.ma.flatnotmasked_edges(a))
      None
  
      """
      m = getmask(a)
      if m is nomask or not np.any(m):
          return np.array([0, a.size - 1])
      unmasked = np.flatnonzero(~m)
      if len(unmasked) > 0:
          return unmasked[[0, -1]]
      else:
          return None
function_tokens: def flatnotmasked_edges ( a ) : m = getmask ( a ) if m is nomask or not np . any ( m ) : return np . array ( [ 0 , a . size - 1 ] ) unmasked = np . flatnonzero ( ~ m ) if len ( unmasked ) > 0 : return unmasked [ [ 0 , - 1 ] ] else : return None