code: def get_percentage(config, key, required=True, default=None):
      if required:
          value = config.get(key)
      else:
          value = config.get(key, default)
          if value is None:
              return
      try:
          if isinstance(value, six.string_types):
              value = value.strip()
              if value.endswith("%"):
                  # "50%" => 0.5
                  return float(value.strip("%")) / 100.0
              # "50" => 50
  
          value = float(value)
          if value < 1:
              # 0.5 => 50% => 0.5
              return value
  
          # 50 => 0.5, 10.5 => 0.105
          return value / 100.0
  
      except ValueError as e:
          raise ValueError("Config: failed parsing %s: %s" % (key, e))
  
file_path: clearml/clearml/utilities/config.py
imports: from __future__ import division
  import json
  import six
  import pyparsing
  from .dicts import hocon_quote_key, hocon_unquote_key
  from .pyhocon import ConfigFactory, HOCONConverter
  from ..storage.util import parse_size
label_desc: Use image node_id 2 for calling a global function with example usage: get_percentage(config, key, required, default) and returns: unknown, value, unknown