def extract_dependencies(reg, assignments):
 return sorted([k for (k, v) in assignments.items() if (v == reg)])

def extract_dependencies ( reg , assignments ) : return sorted ( [ k for ( k , v ) in assignments . items ( ) if ( v == reg ) ] )
return a list of all registers which directly depend on the specified register .