code: def format_bar(self):
      if self.length_known:
          bar_length = int(self.pct * self.width)
          bar = self.fill_char * bar_length
          bar += self.empty_char * (self.width - bar_length)
      elif self.finished:
          bar = self.fill_char * self.width
      else:
          bar = list(self.empty_char * (self.width or 1))
          if self.time_per_iteration != 0:
              bar[
                  int(
                      (
                          math.cos(self.pos * self.time_per_iteration)
                          / 2.0
                          + 0.5
                      )
                      * self.width
                  )
              ] = self.fill_char
          bar = "".join(bar)
      return bar
  
imports: import contextlib
  import math
  import os
  import sys
  import time
  from ._compat import _default_text_stdout
  from ._compat import CYGWIN
  from ._compat import get_best_encoding
  from ._compat import int_types
  from ._compat import isatty
  from ._compat import open_stream
  from ._compat import range_type
  from ._compat import strip_ansi
  from ._compat import term_len
  from ._compat import WIN
  from .exceptions import ClickException
  from .utils import echo
label_desc: Use image node_id 14 for calling the ProgressBar obj's underlying member method code with example usage: obj.format_bar() and returns: bar