<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def pack(self, value, nocheck=False, major=DEFAULT_KATCP_MAJOR):
 """Return the value formatted as a KATCP parameter. Parameters value : object The value to pack. nocheck : bool, optional Whether to check that the value is valid before packing it. major : int, optional Major version of KATCP to use when interpreting types. Defaults to latest implemented KATCP version. Returns ------- packed_value : str The unescaped KATCP string representing the value. """

        if value is None:
            value = self.get_default()
        if value is None:
            raise ValueError("Cannot pack a None value.")
        if not nocheck:
            self.check(value, major)
        return self.encode(value, major)