def CanMergeMultipleLines(lines, last_was_merged=False):
 indent_amt = (lines[0].depth * style.Get('INDENT_WIDTH'))
 if ((len(lines) == 1) or (indent_amt > style.Get('COLUMN_LIMIT'))):
  return False
 if ((len(lines) >= 3) and (lines[2].depth >= lines[1].depth) and (lines[0].depth != lines[2].depth)):
  return False
 if (lines[0].first.value in _CLASS_OR_FUNC):
  return False
 limit = (style.Get('COLUMN_LIMIT') - indent_amt)
 if (lines[0].last.total_length < limit):
  limit -= lines[0].last.total_length
  if (lines[0].first.value == 'if'):
   return _CanMergeLineIntoIfStatement(lines, limit)
  if (last_was_merged and (lines[0].first.value in {'elif', 'else'})):
   return _CanMergeLineIntoIfStatement(lines, limit)
 return False

def CanMergeMultipleLines ( lines , last_was_merged = False ) : indent_amt = ( lines [ 0 ] . depth * style . Get ( 'INDENT_WIDTH' ) ) if ( ( len ( lines ) == 1 ) or ( indent_amt > style . Get ( 'COLUMN_LIMIT' ) ) ) : return False if ( ( len ( lines ) >= 3 ) and ( lines [ 2 ] . depth >= lines [ 1 ] . depth ) and ( lines [ 0 ] . depth != lines [ 2 ] . depth ) ) : return False if ( lines [ 0 ] . first . value in _CLASS_OR_FUNC ) : return False limit = ( style . Get ( 'COLUMN_LIMIT' ) - indent_amt ) if ( lines [ 0 ] . last . total_length < limit ) : limit -= lines [ 0 ] . last . total_length if ( lines [ 0 ] . first . value == 'if' ) : return _CanMergeLineIntoIfStatement ( lines , limit ) if ( last_was_merged and ( lines [ 0 ] . first . value in { 'elif' , 'else' } ) ) : return _CanMergeLineIntoIfStatement ( lines , limit ) return False
determine if multiple lines can be joined into one .