<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _find_connection(self, topic):
 """Attempt to find a connection id corresponding with a topic The device is found by assuming the topic ends in <slug>/[control|data]/channel Args: topic (string):
 The topic we received a message on Returns: int: The internal connect id (device slug) associated with this topic """


        parts = topic.split('/')
        if len(parts) < 3:
            return None

        slug = parts[-3]
        return slug