<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _query(self, action, qobj):
 """ returns wikidata query string """

        if action == 'labels':
            return qobj.labels(self._pop_entities())
        elif action == 'wikidata':
            return qobj.wikidata(self.params.get('title'),
                                 self.params.get('wikibase'))