<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_tag(self, key, *, case_sensitive=True):
 """Return a tag by key, if found Args: key (str):
 Name/key of the tag to locate case_sensitive (bool):
 Should tag keys be treated case-sensitive (default: true) Returns: `Tag`,`None` """

        key = key if case_sensitive else key.lower()
        for tag in self.resource.tags:
            if not case_sensitive:
                if tag.key.lower() == key:
                    return tag
            elif key == tag.key:
                return tag

        return None