<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _register(self, assignment):
 # type: (Assignment) -> None """ Registers an Assignment in _positive or _negative. """

        name = assignment.dependency.name
        old_positive = self._positive.get(name)
        if old_positive is not None:
            self._positive[name] = old_positive.intersect(assignment)

            return

        ref = assignment.dependency.name
        negative_by_ref = self._negative.get(name)
        old_negative = None if negative_by_ref is None else negative_by_ref.get(ref)
        if old_negative is None:
            term = assignment
        else:
            term = assignment.intersect(old_negative)

        if term.is_positive():
            if name in self._negative:
                del self._negative[name]

            self._positive[name] = term
        else:
            if name not in self._negative:
                self._negative[name] = {}

            self._negative[name][ref] = term