<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def build_vec(self):
 """build call validity vector for each device"""

        for item in all_calls:
            self.__dict__[item] = []

        for dev in self.devices:
            for item in all_calls:
                if self.system.__dict__[dev].n == 0:
                    val = False
                else:
                    val = self.system.__dict__[dev].calls.get(item, False)
                self.__dict__[item].append(val)