<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def scope_in(ctx):
 """ - build new scope on the top of stack - and current scope will wait for it result :param ctx: :return: """

    logger.debug('# scope_in')
    logger.debug(ctx)
    ctx = ctx.clone()

    compiled_story = None
    if not ctx.is_empty_stack():
        compiled_story = ctx.get_child_story()
        logger.debug('# child')
        logger.debug(compiled_story)
        # we match child story loop once by message
        # what should prevent multiple matching by the same message
        ctx.matched = True
        ctx.message = modify_stack_in_message(ctx.message,
                                              lambda stack: stack[:-1] + [{
                                                  'data': matchers.serialize(callable.WaitForReturn()),
                                                  'step': stack[-1]['step'],
                                                  'topic': stack[-1]['topic']
                                              }])

    try:
        if not compiled_story and ctx.is_scope_level_part():
            compiled_story = ctx.get_current_story_part()
    except story_context.MissedStoryPart:
        pass

    if not compiled_story:
        compiled_story = ctx.compiled_story()

    logger.debug('# [>] going deeper')
    ctx.message = modify_stack_in_message(ctx.message,
                                          lambda stack: stack + [
                                              stack_utils.build_empty_stack_item(compiled_story.topic)])
    logger.debug(ctx)
    return ctx