<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def retrieve_cluster(self, df, cluster_no):
 """ Extracts the cluster at the given index from the input dataframe :param df: the dataframe that contains the clusters :param cluster_no: the cluster number :return: returns the extracted cluster """

        if self.is_pyclustering_instance(self.model):
            clusters = self.model.get_clusters()
            mask = []
            for i in range(0, df.shape[0]):
                mask.append(i in clusters[cluster_no])
        else:
            mask = self.model.labels_ == cluster_no  # a boolean mask
        return df[mask]