def _get_coords_by_index(self, coords_array, index):
        """
        where index can either by an integer or a list of integers (returns some of masses)
        coords_array should be a single array (xs, ys, or zs)
        """
        if hasattr(index, '__iter__'):
            # then we want the center-of-mass coordinates
            # TODO: clean this up
            return np.average([_value(coords_array[i]) for i in index],
                              weights=[self._get_mass_by_index(i) for i in index])
        else:
            return coords_array[index]
def _get_coords_by_index ( self , coords_array , index ) : if hasattr ( index , '__iter__' ) : return np . average ( [ _value ( coords_array [ i ] ) for i in index ] , weights = [ self . _get_mass_by_index ( i ) for i in index ] ) else : return coords_array [ index ]
where index can either by an integer or a list of integers (returns some of masses)
        coords_array should be a single array (xs, ys, or zs)