def format_contains(self, format_string, names):
<EOL>if isinstance(names, list):<EOL><INDENT>key = str(names)<EOL><DEDENT>else:<EOL><INDENT>key = names<EOL>names = [names]<EOL><DEDENT>try:<EOL><INDENT>return self._format_placeholders_cache[format_string][key]<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT>if format_string not in self._format_placeholders:<EOL><INDENT>placeholders = self._formatter.get_placeholders(format_string)<EOL>self._format_placeholders[format_string] = placeholders<EOL><DEDENT>else:<EOL><INDENT>placeholders = self._format_placeholders[format_string]<EOL><DEDENT>if format_string not in self._format_placeholders_cache:<EOL><INDENT>self._format_placeholders_cache[format_string] = {}<EOL><DEDENT>for name in names:<EOL><INDENT>for placeholder in placeholders:<EOL><INDENT>if fnmatch(placeholder, name):<EOL><INDENT>self._format_placeholders_cache[format_string][key] = True<EOL>return True<EOL><DEDENT><DEDENT><DEDENT>self._format_placeholders_cache[format_string][key] = False<EOL>return False<EOL>
Determines if ``format_string`` contains a placeholder string ``names``
or a list of placeholders ``names``.

``names`` is tested against placeholders using fnmatch so the following
patterns can be used:

.. code-block:: none

    * 	    matches everything
    ? 	    matches any single character
    [seq] 	matches any character in seq
    [!seq] 	matches any character not in seq

This is useful because a simple test like
``'{placeholder}' in format_string``
will fail if the format string contains placeholder formatting
eg ``'{placeholder:.2f}'``