docs: def change_pin(ctx, pin, new_pin):
      """
      Change the PIN code.
  
      The PIN must be between 6 and 8 characters long, and supports any type of
      alphanumeric characters. For cross-platform compatibility,
      numeric digits are recommended.
      """
  
      controller = ctx.obj['controller']
  
      if not pin:
          pin = _prompt_pin(ctx, prompt='Enter your current PIN')
      if not new_pin:
          new_pin = click.prompt(
              'Enter your new PIN', default='', hide_input=True,
              show_default=False, confirmation_prompt=True, err=True)
  
      if not _valid_pin_length(pin):
          ctx.fail('Current PIN must be between 6 and 8 characters long.')
  
      if not _valid_pin_length(new_pin):
          ctx.fail('New PIN must be between 6 and 8 characters long.')
  
      try:
          controller.change_pin(pin, new_pin)
          click.echo('New PIN set.')
  
      except AuthenticationBlocked as e:
          logger.debug('PIN is blocked.', exc_info=e)
          ctx.fail('PIN is blocked.')
  
      except WrongPin as e:
          logger.debug(
              'Failed to change PIN, %d tries left', e.tries_left, exc_info=e)
          ctx.fail('PIN change failed - %d tries left.' % e.tries_left)