def set(self, value, *keys):
        """
        Sets the dict of the information as read from the yaml file. To access
        the file safely, you can use the keys in the order of the access.
        Example: set("{'project':{'fg82':[i0-i10]}}", "provisioner","policy")
        will set the value of config["provisioner"]["policy"] in the yaml file if
        it does not exists an error will be printing that the value does not
        exists.  Alternatively you can use the . notation e.g.
        set("{'project':{'fg82':[i0-i10]}}", "provisioner.policy")
        """
        element = self

        if keys is None:
            return self

        if '.' in keys[0]:
            keys = keys[0].split(".")

        nested_str = ''.join(["['{0}']".format(x) for x in keys])
        # Safely evaluate an expression to see if it is one of the Python
        # literal structures: strings, numbers, tuples, lists, dicts, booleans,
        # and None. Quoted string will be used if it is none of these types.
        try:
            ast.literal_eval(str(value))
            converted = str(value)
        except ValueError:
            converted = "'" + str(value) + "'"
        exec("self" + nested_str + "=" + converted)
        return element
def set ( self , value , * keys ) : element = self if keys is None : return self if '.' in keys [ 0 ] : keys = keys [ 0 ] . split ( "." ) nested_str = '' . join ( [ "['{0}']" . format ( x ) for x in keys ] ) try : ast . literal_eval ( str ( value ) ) converted = str ( value ) except ValueError : converted = "'" + str ( value ) + "'" exec ( "self" + nested_str + "=" + converted ) return element
Sets the dict of the information as read from the yaml file. To access
        the file safely, you can use the keys in the order of the access.
        Example: set("{'project':{'fg82':[i0-i10]}}", "provisioner","policy")
        will set the value of config["provisioner"]["policy"] in the yaml file if
        it does not exists an error will be printing that the value does not
        exists.  Alternatively you can use the . notation e.g.
        set("{'project':{'fg82':[i0-i10]}}", "provisioner.policy")