def contexts_match(
    item_context,       # type: str
    part_code_context,  # type: str
):
    # type: (...) -> bool

    if part_code_context == "1":
        return True if part_code_context == item_context else False

    item_context = item_context.split('.')
    part_code_context = part_code_context.split('.')
    item_context = [x for x in item_context if x not in ['', '1']]
    part_code_context = [x for x in part_code_context if x not in ['', '1']]
    context_result = []
    for part_code_slice in part_code_context:
        for idx, item_slice in enumerate(item_context):
            if item_slice == part_code_slice:
                item_context = item_context[idx:]
                context_result.append(item_slice)
                break

    return len(part_code_context) == len(context_result)
