<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_by_name(self, name):
 """Retrieves a resource by its name. Args: name: Resource name. Returns: Resource object or None if resource does not exist. """

        result = self.get_by("name", name)

        if result:
            data = result[0]
            new_resource = self.new(self._connection, data)
        else:
            new_resource = None

        return new_resource