def return_merged_clips(data):
 def max(a, b):
  "It returns the max of the two given numbers.\n\n        It won't take into account the zero values.\n        "
  if ((not a) and (not b)):
   return None
  if (not a):
   return b
  if (not b):
   return a
  if (a >= b):
   return a
  else:
   return b
 def min(a, b):
  "It returns the min of the two given numbers.\n\n        It won't take into account the zero values.\n        "
  if ((not a) and (not b)):
   return None
  if (not a):
   return b
  if (not b):
   return a
  if (a <= b):
   return a
  else:
   return b
 left = max(data['clip_adapter_left'], data['clip_qual_left'])
 right = min(data['clip_adapter_right'], data['clip_qual_right'])
 if (left is None):
  left = 1
 if (right is None):
  right = data['number_of_bases']
 return (left, right)

def return_merged_clips ( data ) : def max ( a , b ) : if ( ( not a ) and ( not b ) ) : return None if ( not a ) : return b if ( not b ) : return a if ( a >= b ) : return a else : return b def min ( a , b ) : if ( ( not a ) and ( not b ) ) : return None if ( not a ) : return b if ( not b ) : return a if ( a <= b ) : return a else : return b left = max ( data [ 'clip_adapter_left' ] , data [ 'clip_qual_left' ] ) right = min ( data [ 'clip_adapter_right' ] , data [ 'clip_qual_right' ] ) if ( left is None ) : left = 1 if ( right is None ) : right = data [ 'number_of_bases' ] return ( left , right )
it returns the left and right positions to clip .