<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def format_for_prodigy(self, X, meta, placename, return_feature_subset=False):
 """ Given a feature matrix, geonames data, and the original query, construct a prodigy task. Make meta nicely readable: "A town in Germany" Parameters X: matrix vector of features for ranking. Output of features_for_rank() meta: list of dictionaries other place information. Output of features_for_rank(). Used to provide information like "city in Germany" to the coding task. placename: str The extracted place name from text Returns -------- task_list: list of dicts Tasks ready to be written to JSONL and use in Prodigy. Each potential match includes a text description to the annotator can pick the right one. """


        all_tasks = []

        sorted_X, sorted_meta = self.ranker(X, meta)
        sorted_meta = sorted_meta[:4]
        sorted_X = sorted_X[:4]
        for n, i in enumerate(sorted_meta):
            feature_code = i['feature_code']
            try:
                fc = self._code_to_text[feature_code]
            except KeyError:
                fc = ''
            text = ''.join(['"', i['place_name'], '"',
                            ", a ", fc,
                            " in ", i['country_code3'],
                            ", id: ", i['geonameid']])
            d = {"id" : n + 1, "text" : text}
            all_tasks.append(d)

        if return_feature_subset:
            return (all_tasks, sorted_meta, sorted_X)
        else:
            return all_tasks