<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_tool_by_name(self, nme):
 """ get the tool object by name or file """

        for t in self.lstTools:
            if 'name' in t:
                if t['name'] == nme:
                    return t
            if 'file' in t:
                if t['file'] == nme:
                    return t
        return None