def _expand_var(self, in_string, available_variables):
instances = self._get_instances(in_string)<EOL>for instance in instances:<EOL><INDENT>for name, value in available_variables.items():<EOL><INDENT>variable_string = self._get_variable_string(name)<EOL>if instance == variable_string:<EOL><INDENT>in_string = in_string.replace(variable_string, value)<EOL><DEDENT><DEDENT><DEDENT>return in_string<EOL>
Expand variable to its corresponding value in_string

        :param string variable: variable name
        :param value: value to replace with
        :param string in_string: the string to replace in