<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def create_weight(self, weight, date=None):
 """Submit a new weight record. :param weight: The weight, in kilograms. :param date: The date the weight was recorded. If not specified, the current date will be used. """

        url = self._build_url('my', 'body', 'weight')
        data = {'weightInKilograms': weight}
        if date:
            if not date.is_aware():
                raise ValueError("provided date is not timezone aware")
            data.update(date=date.isoformat())
        headers = {'Content-Type': 'application/json; charset=utf8'}
        r = self.session.post(url, data=json.dumps(data), headers=headers)
        r.raise_for_status()
        return r