def dumps(self, activity):
        self.check_type(activity)
        # keep the milliseconds
        activity_time = '%.6f' % datetime_to_epoch(activity.time)
        parts = [activity.actor_id, activity.verb.id,
                 activity.object_id, activity.target_id or 0]
        extra_context = activity.extra_context.copy()
        pickle_string = ''
        if extra_context:
            pickle_string = pickle.dumps(activity.extra_context)
            if six.PY3:
                pickle_string = pickle_string.decode('latin1')
        parts += [activity_time, pickle_string]
        serialized_activity = ','.join(map(str, parts))
        return serialized_activity
dataset/ETHPy150Open tschellenbach/Stream-Framework/stream_framework/serializers/activity_serializer.py/ActivitySerializer.dumps/original