code: async def sign_up(self, code, first_name, last_name='',
                        *, phone=None, phone_code_hash=None):
          
          me = await self.get_me()
          if me:
              return me
  
          if self._tos and self._tos.text:
              if self.parse_mode:
                  t = self.parse_mode.unparse(self._tos.text, self._tos.entities)
              else:
                  t = self._tos.text
              sys.stderr.write("{}\n".format(t))
              sys.stderr.flush()
  
          phone, phone_code_hash = \
              self._parse_phone_and_hash(phone, phone_code_hash)
  
          result = await self(functions.auth.SignUpRequest(
              phone_number=phone,
              phone_code_hash=phone_code_hash,
              phone_code=str(code),
              first_name=first_name,
              last_name=last_name
          ))
  
          if self._tos:
              await self(
                  functions.help.AcceptTermsOfServiceRequest(self._tos.id))
  
          return self._on_login(result.user)
docs: Signs up to Telegram if you don't have an account yet.
          You must call .send_code_request(phone) first.
  
          **By using this method you're agreeing to Telegram's
          Terms of Service. This is required and your account
          will be banned otherwise.** See https://telegram.org/tos
          and https://core.telegram.org/api/terms.
  
          Args:
              code (`str` | `int`):
                  The code sent by Telegram
  
              first_name (`str`):
                  The first name to be used by the new account.
  
              last_name (`str`, optional)
                  Optional last name.
  
              phone (`str` | `int`, optional):
                  The phone to sign up. This will be the last phone used by
                  default (you normally don't need to set this).
  
              phone_code_hash (`str`, optional):
                  The hash returned by `send_code_request`. This can be left as
                  ``None`` to use the last hash known for the phone to be used.
  
          Returns:
              The new created :tl:`User`.