code: def clean_protocol(self, protocol):
          
          if protocol is not None:
              try:
                  return self.PROTOCOL_MAP[protocol]
              except KeyError:
                  self._handle_malformation(
                      '"{protocol}" is not a recognised protocol'.format(
                          protocol=protocol
                      )
                  )
docs: A lot of measurement types make use of a protocol value, so we handle
          that here.