in usort/util.py [0:0]
def with_dots(x: cst.CSTNode) -> str:
"""
Helper to make it easier to use an Attribute or Name.
"""
if isinstance(x, cst.Attribute):
return ".".join([with_dots(x.value), with_dots(x.attr)])
elif isinstance(x, cst.Name):
return x.value
else:
raise TypeError(f"Can't with_dots on {type(x)}")