'Identify the contents of `buf`'

def from_buffer(self, buf):

    with self.lock:
        try:
            return magic_buffer(self.cookie, buf)
        except MagicException as e:
            return self._handle509Bug(e)
