thinking about the methods involvedwe can see that moving or deleting node behaves in similar wayregardless of whether or not it is file or folder node copyinghoweverhas to do recursive copy for folder nodeswhile copying file node is trivial operation to take advantage of the similar operationswe can extract some of the common methods into parent class let' take that discarded component interface and change it to base classclass componentdef __init__(selfname)self name name def move(selfnew_path)new_folder =get_path(new_pathdel self parent children[self namenew_folder children[self nameself self parent new_folder def delete(self)del self parent children[self nameclass folder(component)def __init__(selfname)super(__init__(nameself children {def add_child(selfchild)pass def copy(selfnew_path)pass class file(component)def __init__(selfnamecontents)super(__init__(nameself contents contents def copy(selfnew_path)pass root folder(''def get_path(path)