<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_assistant(filename):
 """Imports a module from filename as a string, returns the contained Assistant object"""


    agent_name = os.path.splitext(filename)[0]

    try:
        agent_module = import_with_3(
            agent_name, os.path.join(os.getcwd(), filename))

    except ImportError:
        agent_module = import_with_2(
            agent_name, os.path.join(os.getcwd(), filename))

    for name, obj in agent_module.__dict__.items():
        if isinstance(obj, Assistant):
            return obj