code: def flip_reference_axis_if_antiparallel(
          p, reference_axis, start_index=0, end_index=-1):
      
      p_vector = polypeptide_vector(
          p, start_index=start_index, end_index=end_index)
      if is_acute(p_vector,
                  reference_axis[end_index] - reference_axis[start_index]):
          reference_axis = numpy.flipud(reference_axis)
      return reference_axis
docs: Flips reference axis if direction opposes the direction of the `Polymer`.
  
      Notes
      -----
      If the angle between the vector for the Polymer and the vector
      for the reference_axis is > 90 degrees, then the reference axis
      is reversed. This is useful to run before running
      polymer_to_reference_axis_distances, crick_angles, or alpha_angles.
      For more information on the start and end indices, see chain_vector.
  
      Parameters
      ----------
      p : ampal.Polymer
          Reference `Polymer`.
      reference_axis : list(numpy.array or tuple or list)
          Length of reference_axis must equal length of the Polymer.
          Each element of reference_axis represents a point in R^3.
      start_index : int, optional
          Default is 0 (start at the N-terminus of the Polymer)
      end_index : int, optional
          Default is -1 (start at the C-terminus of the Polymer)
  
      Returns
      -------
      reference_axis : list(numpy.array or tuple or list)