code: def get_phase(n_samples, des_mask, asc_mask):
      '''Get the directional phase sign for each sample in depths
  
      Args
      ----
      n_samples: int
          Length of output phase array
      des_mask: numpy.ndarray, shape (n,)
          Boolean mask of values where animal is descending
      asc_mask: numpy.ndarray, shape(n,)
          Boolean mask of values where animal is ascending
  
      Returns
      -------
      phase: numpy.ndarray, shape (n,)
          Signed integer array values representing animal's dive phase
  
          *Phases*:
  
          *  0: neither ascending/descending
          *  1: ascending
          * -1: descending.
      '''
      import numpy
  
      phase = numpy.zeros(n_samples, dtype=int)
      phase[asc_mask] =  1
      phase[des_mask] = -1
  
      return phasf get_phase(n_samples, des_mask, asc_mask):
      '''Get the directional phase sign for each sample in depths
  
      Args
      ----
      n_samples: int
          Length of output phase array
      des_mask: numpy.ndarray, shape (n,)
          Boolean mask of values where animal is descending
      asc_mask: numpy.ndarray, shape(n,)
          Boolean mask of values where animal is ascending
  
      Returns
      -------
      phase: numpy.ndarray, shape (n,)
          Signed integer array values representing animal's dive phase
  
          *Phases*:
  
          *  0: neither ascending/descending
          *  1: ascending
          * -1: descending.
      '''
      import numpy
  
      phase = numpy.zeros(n_samples, dtype=int)
      phase[asc_mask] =  1
      phase[des_mask] = -1
  
      return phase
docs: Get the directional phase sign for each sample in depths
  
      Args
      ----
      n_samples: int
          Length of output phase array
      des_mask: numpy.ndarray, shape (n,)
          Boolean mask of values where animal is descending
      asc_mask: numpy.ndarray, shape(n,)
          Boolean mask of values where animal is ascending
  
      Returns
      -------
      phase: numpy.ndarray, shape (n,)
          Signed integer array values representing animal's dive phase
  
          *Phases*:
  
          *  0: neither ascending/descending
          *  1: ascending
          * -1: descending.