code: def generate_password(self):
          
  
          if self.password_failed:
              self.logger.warning("Skipping resetting password since last attempt failed")
              return
  
          # Set a random password so it's available via cci org info
          command = sarge.shell_format(
              "sfdx force:user:password:generate -u {0}", self.username
          )
          self.logger.info(
              "Generating scratch org user password with command {}".format(command)
          )
          p = sarge.Command(
              command,
              stdout=sarge.Capture(buffer_size=-1),
              stderr=sarge.Capture(buffer_size=-1),
              shell=True,
          )
          p.run()
  
          stderr = io.TextIOWrapper(p.stderr).readlines()
          stdout = io.TextIOWrapper(p.stdout).readlines()
  
          if p.returncode:
              self.config["password_failed"] = True
              # Don't throw an exception because of failure creating the
              # password, just notify in a log message
              self.logger.warning(
                  "Failed to set password: \n{}\n{}".format(
                      "\n".join(stdout), "\n".join(stderr)
                  )
              )
docs: Generates an org password with the sfdx utility.