# Path: mlat/profile.py
# def trackcpu(f, **kwargs):
# def dump_cpu_profiles(tofile=None):
# def trackcpu(f, name=None, **kwargs):
#     def cpu_measurement_wrapper(*args, **kwargs):
# def dump_cpu_profiles(tofile=sys.stderr):
# 
# Path: mlat/server/kalman.py
# class KalmanState(object):
# class KalmanStateCV(KalmanState):
# class KalmanStateCA(KalmanState):
#     def __init__(self, icao):
#     def _reset(self):
#     def observation_function_without_altitude(self, state, *, positions):
#     def observation_function_with_altitude(self, state, *, positions):
#     def _update_derived(self):
#     def update(self, position_time, measurements, altitude, altitude_error,
#                leastsquares_position, leastsquares_cov, distinct, dof):
#     def set_initial_state(self, leastsquares_position, leastsquares_cov):
#     def transition_function(self, state, *, dt):
#     def transition_covariance(self, dt):
#     def set_initial_state(self, leastsquares_position, leastsquares_cov):
#     def transition_function(self, state, *, dt):
#     def transition_covariance(self, dt):
#     def set_initial_state(self, leastsquares_position, leastsquares_cov):
#     def transition_function(self, state, *, dt):
#     def transition_covariance(self, dt):
#         C = numpy.array([[-math.sin(lon_r), math.cos(lon_r), 0],
#                          [math.sin(-lat_r) * math.cos(lon_r), math.sin(-lat_r) * math.sin(lon_r), math.cos(-lat_r)],
#                          [math.cos(-lat_r) * math.cos(lon_r), math.cos(-lat_r) * math.sin(lon_r), -math.sin(-lat_r)]])


import asyncio
from mlat import profile
from mlat.server import kalman
        self.partition_count = partition[1]

    def in_local_partition(self, icao):
        if self.partition_count == 1:
            return True

        # mix the address a bit
        h = icao
        h = (((h >> 16) ^ h) * 0x45d9f3b) & 0xFFFFFFFF
        h = (((h >> 16) ^ h) * 0x45d9f3b) & 0xFFFFFFFF
        h = ((h >> 16) ^ h)
        return bool((h % self.partition_count) == self.partition_id)

    def add(self, receiver, icao_set):
        for icao in icao_set:
            ac = self.aircraft.get(icao)
            if ac is None:
                ac = self.aircraft[icao] = TrackedAircraft(icao, self.in_local_partition(icao))

            ac.tracking.add(receiver)
            receiver.tracking.add(ac)

    def remove(self, receiver, icao_set):
        for icao in icao_set:
            ac = self.aircraft.get(icao)
            if not ac:
                continue

            ac.tracking.discard(receiver)
            ac.successful_mlat.discard(receiver)

# Path: mlat/profile.py
# def trackcpu(f, **kwargs):
# def dump_cpu_profiles(tofile=None):
# def trackcpu(f, name=None, **kwargs):
#     def cpu_measurement_wrapper(*args, **kwargs):
# def dump_cpu_profiles(tofile=sys.stderr):
# 
# Path: mlat/server/kalman.py
# class KalmanState(object):
# class KalmanStateCV(KalmanState):
# class KalmanStateCA(KalmanState):
#     def __init__(self, icao):
#     def _reset(self):
#     def observation_function_without_altitude(self, state, *, positions):
#     def observation_function_with_altitude(self, state, *, positions):
#     def _update_derived(self):
#     def update(self, position_time, measurements, altitude, altitude_error,
#                leastsquares_position, leastsquares_cov, distinct, dof):
#     def set_initial_state(self, leastsquares_position, leastsquares_cov):
#     def transition_function(self, state, *, dt):
#     def transition_covariance(self, dt):
#     def set_initial_state(self, leastsquares_position, leastsquares_cov):
#     def transition_function(self, state, *, dt):
#     def transition_covariance(self, dt):
#     def set_initial_state(self, leastsquares_position, leastsquares_cov):
#     def transition_function(self, state, *, dt):
#     def transition_covariance(self, dt):
#         C = numpy.array([[-math.sin(lon_r), math.cos(lon_r), 0],
#                          [math.sin(-lat_r) * math.cos(lon_r), math.sin(-lat_r) * math.sin(lon_r), math.cos(-lat_r)],
#                          [math.cos(-lat_r) * math.cos(lon_r), math.cos(-lat_r) * math.sin(lon_r), -math.sin(-lat_r)]])


# Path: mlat/server/tracker.py
import asyncio
from mlat import profile
from mlat.server import kalman

        self.partition_count = partition[1]

    def in_local_partition(self, icao):
        if self.partition_count == 1:
            return True

        # mix the address a bit
        h = icao
        h = (((h >> 16) ^ h) * 0x45d9f3b) & 0xFFFFFFFF
        h = (((h >> 16) ^ h) * 0x45d9f3b) & 0xFFFFFFFF
        h = ((h >> 16) ^ h)
        return bool((h % self.partition_count) == self.partition_id)

    def add(self, receiver, icao_set):
        for icao in icao_set:
            ac = self.aircraft.get(icao)
            if ac is None:
                ac = self.aircraft[icao] = TrackedAircraft(icao, self.in_local_partition(icao))

            ac.tracking.add(receiver)
            receiver.tracking.add(ac)

    def remove(self, receiver, icao_set):
        for icao in icao_set:
            ac = self.aircraft.get(icao)
            if not ac:
                continue

            ac.tracking.discard(receiver)
            ac.successful_mlat.discard(receiver)

            receiver.tracking.discard(ac)