<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def sign(self, data):
 """ Create url-safe signed token. :param data: Data to sign :type data: object """

        try:
            jsonstr = json.dumps(data, separators=(',', ':'))

        except TypeError as e:
            raise DataSignError(e.args[0])

        else:
            signature = self._create_signature(jsonstr)
            return self._b64encode(jsonstr + '.' + signature)