def get_attributes(attrs):
    """return attributes string for input dict
    format: key="value" key="value"...
    spaces will be stripped
    """
    line = ''
    for i,j in attrs.items():
        s = ''
        # Caution! take care when value is list
        if isinstance(j,list):
            for k in j: s += k + ' '
            s = s.strip()
        else:
            s = j
        line += '%s="%s" ' % (i,s)
    return line.strip()