def METHOD_NAME(value):
    res = "["
    if value.relation:
        res += ":" + value.relation
    if value.properties:
        props = ', '.join(key+': '+str(val)
                          for key, val in value.properties.items())
        if value.relation:
            res += " "
        res += '{' + props + '}'
    res += ']'
    value = res
    return value