def _cmidrule(colindex, dataset_width):
 rule = '\\cmidrule(%s){%d-%d}'
 if (colindex == 1):
  return (rule % ('r', colindex, colindex))
 if (colindex == dataset_width):
  return (rule % ('l', colindex, colindex))
 return (rule % ('lr', colindex, colindex))

def _cmidrule ( colindex , dataset_width ) : rule = '\\cmidrule(%s){%d-%d}' if ( colindex == 1 ) : return ( rule % ( 'r' , colindex , colindex ) ) if ( colindex == dataset_width ) : return ( rule % ( 'l' , colindex , colindex ) ) return ( rule % ( 'lr' , colindex , colindex ) )
generates the cmidrule for a single column with appropriate trimming based on the column position .