<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def ensemble_center(self, site_list, indices, cartesian=True):
 """ Finds the center of an ensemble of sites selected from a list of sites. Helper method for the find_adsorption_sites algorithm. Args: site_list (list of sites):
 list of sites indices (list of ints):
 list of ints from which to select sites from site list cartesian (bool):
 whether to get average fractional or cartesian coordinate """

        if cartesian:
            return np.average([site_list[i].coords for i in indices],
                              axis=0)
        else:
            return np.average([site_list[i].frac_coords for i in indices],
                              axis=0)