<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_jp(self, extractor_processor, sub_output=None):
 """Tries to get name from ExtractorProcessor to filter on first. Otherwise falls back to filtering based on its metadata"""

        if sub_output is None and extractor_processor.output_field is None:
            raise ValueError(
                "ExtractorProcessors input paths cannot be unioned across fields.  Please specify either a sub_output or use a single scalar output_field")
        if extractor_processor.get_output_jsonpath_with_name(sub_output) is not None:
            return extractor_processor.get_output_jsonpath_with_name(sub_output)
        else:
            return extractor_processor.get_output_jsonpath(sub_output)