<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _dqtoi(self, dq):
 """Convert dotquad or hextet to long."""

        # hex notation
        if dq.startswith('0x'):
            return self._dqtoi_hex(dq)

        # IPv6
        if ':' in dq:
            return self._dqtoi_ipv6(dq)
        elif len(dq) == 32:
            # Assume full heximal notation
            self.v = 6
            return int(dq, 16)

        # IPv4
        if '.' in dq:
            return self._dqtoi_ipv4(dq)

        raise ValueError('Invalid address input')