docs: def _inject(self, value, settings):
          """Inject ``settings`` into ``value``.
  
          Go through ``value`` looking for ``{{NAME}}`` groups and replace
          each group with the value of the named item from ``settings``.
  
          Args:
              value (str): The value to inject settings into
              settings: An object that provides the dotted access interface
  
          Returns:
              (str, bool): The new value and whether the new value is
                  different from the original value
  
          """
          assert isinstance(value, string_types), 'Expected str; got {0.__class__}'.format(value)
  
          begin, end = '{{', '}}'
  
          if begin not in value:
              return value, False
  
          new_value = value
          begin_pos, end_pos = 0, None
          len_begin, len_end = len(begin), len(end)
          len_value = len(new_value)
  
          while begin_pos < len_value:
              # Find next {{.
              begin_pos = new_value.find(begin, begin_pos)
  
              if begin_pos == -1:
                  break
  
              # Save everything before {{.
              before = new_value[:begin_pos]
  
              # Find }} after {{.
              begin_pos += len_begin
              end_pos = new_value.find(end, begin_pos)
              if end_pos == -1:
                  raise ValueError('Unmatched {begin}...{end} in {value}'.format(**locals()))
  
              # Get name between {{ and }}, ignoring leading and trailing
              # whitespace.
              name = new_value[begin_pos:end_pos]
              name = name.strip()
  
              if not name:
                  raise ValueError('Empty name in {value}'.format(**locals()))
  
              # Save everything after }}.
              after_pos = end_pos + len_end
              try:
                  after = new_value[after_pos:]
              except IndexError:
                  # Reached end of value.
                  after = ''
  
              # Retrieve string value for named setting (the "injection
              # value").
              try:
                  injection_value = settings.get_dotted(name)
              except KeyError:
                  raise KeyError('{name} not found in {settings}'.format(**locals()))
  
              if not isinstance(injection_value, string_types):
                  injection_value = self.strategy.encode_value(injection_value)
  
              # Combine before, inject value, and after to get the new
              # value.
              new_value = ''.join((before, injection_value, after))
  
              # Continue after injected value.
              begin_pos = len(before) + len(injection_value)
              len_value = len(new_value)
  
          return new_value, (new_value != value)