<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_device_activity(self, type_p):
 """Gets the current activity type of given devices or device groups. in type_p of type :class:`DeviceType` return activity of type :class:`DeviceActivity` raises :class:`OleErrorInvalidarg` Invalid device type. """

        if not isinstance(type_p, list):
            raise TypeError("type_p can only be an instance of type list")
        for a in type_p[:10]:
            if not isinstance(a, DeviceType):
                raise TypeError(
                        "array can only contain objects of type DeviceType")
        activity = self._call("getDeviceActivity",
                     in_p=[type_p])
        activity = [DeviceActivity(a) for a in activity]
        return activity