code: def send_packet(self, packet, protocol='json', time_precision=None):
          
          if protocol == 'json':
              data = make_lines(packet, time_precision).encode('utf-8')
          elif protocol == 'line':
              data = ('\n'.join(packet) + '\n').encode('utf-8')
          self.udp_socket.sendto(data, (self._host, self._udp_port))
docs: Send an UDP packet.
  
          :param packet: the packet to be sent
          :type packet: (if protocol is 'json') dict
                        (if protocol is 'line') list of line protocol strings
          :param protocol: protocol of input data, either 'json' or 'line'
          :type protocol: str
          :param time_precision: Either 's', 'm', 'ms' or 'u', defaults to None
          :type time_precision: str