<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def update(self, title, rulegroups):
 """Updates this segment."""

        body = {
            "Title": title,
            "RuleGroups": rulegroups}
        response = self._put("/segments/%s.json" %
                             self.segment_id, json.dumps(body))