parameters: (lines: typing.List[str], offset: int, registration_processor: RegistrationProcessor)
return_statement: return offset + 1
docstring: Process one or more lines that contain a kernel registration.
      Merge lines if split over multiple, and call registration_processor.process_registration with the original lines
      and the registration information.
      :return: Offset for first line that was not consumed.
docstring_summary: Process one or more lines that contain a kernel registration.
      Merge lines if split over multiple, and call registration_processor.process_registration with the original lines
      and the registration information.
      :return: Offset for first line that was not consumed.
docstring_tokens: Process one or more lines that contain a kernel registration . Merge lines if split over multiple and call registration_processor . process_registration with the original lines and the registration information . : return : Offset for first line that was not consumed .
function: def _process_lines(lines: typing.List[str], offset: int, registration_processor: RegistrationProcessor):
      '''
      Process one or more lines that contain a kernel registration.
      Merge lines if split over multiple, and call registration_processor.process_registration with the original lines
      and the registration information.
      :return: Offset for first line that was not consumed.
      '''
  
      onnx_op = 'ONNX_OPERATOR_KERNEL_CLASS_NAME'
      onnx_op_len = len(onnx_op)
      onnx_typed_op = 'ONNX_OPERATOR_TYPED_KERNEL_CLASS_NAME'
      onnx_typed_op_len = len(onnx_typed_op)
      onnx_versioned_op = 'ONNX_OPERATOR_VERSIONED_KERNEL_CLASS_NAME'
      onnx_versioned_op_len = len(onnx_versioned_op)
      onnx_versioned_typed_op = 'ONNX_OPERATOR_VERSIONED_TYPED_KERNEL_CLASS_NAME'
      onnx_versioned_typed_op_len = len(onnx_versioned_typed_op)
      end_marks = tuple([');', ')>', ')>,', ')>,};', ')>};'])
  
      end_mark = ''
      lines_to_process = []
  
      # merge line if split over multiple.
      # original lines will be in lines_to_process. merged and stripped line will be in code_line
      while True:
          lines_to_process.append(lines[offset])
          stripped = lines[offset].strip()
          line_end = False
  
          for mark in end_marks:
              if stripped.endswith(mark):
                  end_mark = mark
                  line_end = True
                  break
  
          if line_end:
              break
  
          offset += 1
          if offset > len(lines):
              log.error('Past end of input lines looking for line terminator.')
              sys.exit(-1)
  
      code_line = ''.join([line.strip() for line in lines_to_process])
  
      if onnx_op in code_line:
          # e.g. BuildKernelCreateInfo<ONNX_OPERATOR_KERNEL_CLASS_NAME(
          #          kCpuExecutionProvider, kOnnxDomain, 7, Cos)>,
          trim_at = code_line.index(onnx_op) + onnx_op_len + 1
          *_, domain, start_version, op_type = \
              [arg.strip() for arg in code_line[trim_at: -len(end_mark)].split(',')]
  
          registration_processor.process_registration(lines_to_process, domain, op_type,
                                                      int(start_version), None, None)
  
      elif onnx_typed_op in code_line:
          # e.g. BuildKernelCreateInfo<ONNX_OPERATOR_TYPED_KERNEL_CLASS_NAME(
          #          kCpuExecutionProvider, kOnnxDomain, 7, double, Sin)>,
          trim_at = code_line.index(onnx_typed_op) + onnx_typed_op_len + 1
          *_, domain, start_version, type, op_type = \
              [arg.strip() for arg in code_line[trim_at: -len(end_mark)].split(',')]
          registration_processor.process_registration(lines_to_process, domain, op_type,
                                                      int(start_version), None, type)
  
      elif onnx_versioned_op in code_line:
          # e.g. BuildKernelCreateInfo<ONNX_OPERATOR_VERSIONED_KERNEL_CLASS_NAME(
          #          kCpuExecutionProvider, kOnnxDomain, 1, 10, Hardmax)>,
          trim_at = code_line.index(onnx_versioned_op) + onnx_versioned_op_len + 1
          *_, domain, start_version, end_version, op_type = \
              [arg.strip() for arg in code_line[trim_at: -len(end_mark)].split(',')]
          registration_processor.process_registration(lines_to_process, domain, op_type,
                                                      int(start_version), int(end_version), None)
  
      elif onnx_versioned_typed_op in code_line:
          # e.g. BuildKernelCreateInfo<ONNX_OPERATOR_VERSIONED_TYPED_KERNEL_CLASS_NAME(
          #          kCpuExecutionProvider, kOnnxDomain, 1, 10, float, LogSoftmax)>,
          trim_at = code_line.index(onnx_versioned_typed_op) + onnx_versioned_typed_op_len + 1
          *_, domain, start_version, end_version, type, op_type = \
              [arg.strip() for arg in code_line[trim_at: -len(end_mark)].split(',')]
          registration_processor.process_registration(lines_to_process, domain, op_type,
                                                      int(start_version), int(end_version), type)
  
      else:
          log.warning("Ignoring unhandled kernel registration variant: {}".format(code_line))
          for line in lines_to_process:
              registration_processor.process_other_line(line)
  
      return offset + 1
function_tokens: def _process_lines ( lines : typing . List [ str ] , offset : int , registration_processor : RegistrationProcessor ) : onnx_op = 'ONNX_OPERATOR_KERNEL_CLASS_NAME' onnx_op_len = len ( onnx_op ) onnx_typed_op = 'ONNX_OPERATOR_TYPED_KERNEL_CLASS_NAME' onnx_typed_op_len = len ( onnx_typed_op ) onnx_versioned_op = 'ONNX_OPERATOR_VERSIONED_KERNEL_CLASS_NAME' onnx_versioned_op_len = len ( onnx_versioned_op ) onnx_versioned_typed_op = 'ONNX_OPERATOR_VERSIONED_TYPED_KERNEL_CLASS_NAME' onnx_versioned_typed_op_len = len ( onnx_versioned_typed_op ) end_marks = tuple ( [ ');' , ')>' , ')>,' , ')>,};' , ')>};' ] ) end_mark = '' lines_to_process = [ ] # merge line if split over multiple. # original lines will be in lines_to_process. merged and stripped line will be in code_line while True : lines_to_process . append ( lines [ offset ] ) stripped = lines [ offset ] . strip ( ) line_end = False for mark in end_marks : if stripped . endswith ( mark ) : end_mark = mark line_end = True break if line_end : break offset += 1 if offset > len ( lines ) : log . error ( 'Past end of input lines looking for line terminator.' ) sys . exit ( - 1 ) code_line = '' . join ( [ line . strip ( ) for line in lines_to_process ] ) if onnx_op in code_line : # e.g. BuildKernelCreateInfo<ONNX_OPERATOR_KERNEL_CLASS_NAME( #          kCpuExecutionProvider, kOnnxDomain, 7, Cos)>, trim_at = code_line . index ( onnx_op ) + onnx_op_len + 1 * _ , domain , start_version , op_type = [ arg . strip ( ) for arg in code_line [ trim_at : - len ( end_mark ) ] . split ( ',' ) ] registration_processor . process_registration ( lines_to_process , domain , op_type , int ( start_version ) , None , None ) elif onnx_typed_op in code_line : # e.g. BuildKernelCreateInfo<ONNX_OPERATOR_TYPED_KERNEL_CLASS_NAME( #          kCpuExecutionProvider, kOnnxDomain, 7, double, Sin)>, trim_at = code_line . index ( onnx_typed_op ) + onnx_typed_op_len + 1 * _ , domain , start_version , type , op_type = [ arg . strip ( ) for arg in code_line [ trim_at : - len ( end_mark ) ] . split ( ',' ) ] registration_processor . process_registration ( lines_to_process , domain , op_type , int ( start_version ) , None , type ) elif onnx_versioned_op in code_line : # e.g. BuildKernelCreateInfo<ONNX_OPERATOR_VERSIONED_KERNEL_CLASS_NAME( #          kCpuExecutionProvider, kOnnxDomain, 1, 10, Hardmax)>, trim_at = code_line . index ( onnx_versioned_op ) + onnx_versioned_op_len + 1 * _ , domain , start_version , end_version , op_type = [ arg . strip ( ) for arg in code_line [ trim_at : - len ( end_mark ) ] . split ( ',' ) ] registration_processor . process_registration ( lines_to_process , domain , op_type , int ( start_version ) , int ( end_version ) , None ) elif onnx_versioned_typed_op in code_line : # e.g. BuildKernelCreateInfo<ONNX_OPERATOR_VERSIONED_TYPED_KERNEL_CLASS_NAME( #          kCpuExecutionProvider, kOnnxDomain, 1, 10, float, LogSoftmax)>, trim_at = code_line . index ( onnx_versioned_typed_op ) + onnx_versioned_typed_op_len + 1 * _ , domain , start_version , end_version , type , op_type = [ arg . strip ( ) for arg in code_line [ trim_at : - len ( end_mark ) ] . split ( ',' ) ] registration_processor . process_registration ( lines_to_process , domain , op_type , int ( start_version ) , int ( end_version ) , type ) else : log . warning ( "Ignoring unhandled kernel registration variant: {}" . format ( code_line ) ) for line in lines_to_process : registration_processor . process_other_line ( line ) return offset + 1