(examples, filename)
Adds attribute with file location to each string variable
    Used for relative filenames stored in string variables (e.g. pictures)
    TODO: we should consider a cleaner solution (special variable type, ...)
Adds attribute with file location to each string variable
    Used for relative filenames stored in string variables (e.g. pictures)
    TODO: we should consider a cleaner solution (special variable type, ...)
Adds attribute with file location to each string variable Used for relative filenames stored in string variables ( e . g . pictures ) TODO : we should consider a cleaner solution ( special variable type ... )
def add_origin(examples, filename):
    """
    Adds attribute with file location to each string variable
    Used for relative filenames stored in string variables (e.g. pictures)
    TODO: we should consider a cleaner solution (special variable type, ...)
    """
    if not filename:
        return
    strings = [var
               for var in examples.domain.variables + examples.domain.metas
               if var.is_string]
    dir_name, _ = os.path.split(filename)
    for var in strings:
        if "type" in var.attributes and "origin" not in var.attributes:
            var.attributes["origin"] = dir_name
def add_origin ( examples , filename ) : if not filename : return strings = [ var for var in examples . domain . variables + examples . domain . metas if var . is_string ] dir_name , _ = os . path . split ( filename ) for var in strings : if "type" in var . attributes and "origin" not in var . attributes : var . attributes [ "origin" ] = dir_name