<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_default(eng, algorithms=0xFFFF):
 """ Sets specified engine as default for all algorithms, supported by it For compatibility with 0.2.x if string is passed instead of engine, attempts to load engine with this id """

    if not isinstance(eng,Engine):
        eng=Engine(eng)
    global default
    libcrypto.ENGINE_set_default(eng.ptr, c_int(algorithms))
    default = eng