def discretize(self, contact_id=<NUM_LIT:0>, accuracy=<NUM_LIT>, dt=<NUM_LIT>):
if not self.event_points:<EOL><INDENT>return []<EOL><DEDENT>events = []<EOL>action_dt = accuracy / self.speed<EOL>dt = dt or action_dt<EOL>ep0 = self.event_points[<NUM_LIT:0>]<EOL>for _ in range(int(ep0[<NUM_LIT:0>] / dt)):<EOL><INDENT>events.append(['<STR_LIT:s>', dt])<EOL><DEDENT>events.append(['<STR_LIT:d>', ep0[<NUM_LIT:1>], contact_id])<EOL>for i, ep in enumerate(self.event_points[<NUM_LIT:1>:]):<EOL><INDENT>prev_ts = self.event_points[i][<NUM_LIT:0>]<EOL>curr_ts = ep[<NUM_LIT:0>]<EOL>p0 = self.event_points[i][<NUM_LIT:1>]<EOL>p1 = ep[<NUM_LIT:1>]<EOL>if p0 == p1:<EOL><INDENT>for _ in range(int((curr_ts - prev_ts) / dt)):<EOL><INDENT>events.append(['<STR_LIT:s>', dt])<EOL><DEDENT><DEDENT>else:<EOL><INDENT>dpoints = track_sampling([p0, p1], accuracy)<EOL>for p in dpoints:<EOL><INDENT>events.append(['<STR_LIT:m>', p, contact_id])<EOL>for _ in range(int(action_dt / dt)):<EOL><INDENT>events.append(['<STR_LIT:s>', dt])<EOL><DEDENT><DEDENT><DEDENT><DEDENT>events.append(['<STR_LIT:u>', contact_id])<EOL>return events<EOL>
Sample this motion track into discretized motion events.

Args:
    contact_id: contact point id
    accuracy: motion minimum difference in space
    dt: sample time difference