<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def fetch_credential(self, credential=None, profile=None):
 """Fetch credential from credentials file. Args: credential (str):
 Credential to fetch. profile (str):
 Credentials profile. Defaults to ``'default'``. Returns: str, None: Fetched credential or ``None``. """

        q = self.db.get(self.query.profile == profile)
        if q is not None:
            return q.get(credential)