def METHOD_NAME(self, context, test_result=None):
    """Use context and optional test result to get set of tests to skip.
    :param context: temp context
    :param test_result: optional test result
    :return: set of tests to skip for the line based on contexts
    """
    nosec_tests_to_skip = set()
    base_tests = (
        self.nosec_lines.get(test_result.lineno, None)
        if test_result
        else None
    )
    context_tests = utils.get_nosec(self.nosec_lines, context)
    # if both are none there were no comments
    # this is explicitly different from being empty.
    # empty set indicates blanket nosec comment without
    # individual test names or ids
    if base_tests is None and context_tests is None:
        nosec_tests_to_skip = None
    # combine tests from current line and context line
    if base_tests is not None:
        nosec_tests_to_skip.update(base_tests)
    if context_tests is not None:
        nosec_tests_to_skip.update(context_tests)
    return nosec_tests_to_skip