<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_credentials(self, scan_id, target):
 """ Get a scan's credential list. It return dictionary with the corresponding credential for a given target. """

        if target:
            for item in self.scans_table[scan_id]['targets']:
                if target == item[0]:
                    return item[2]