def _pipe_segment_with_colons(align, colwidth):
 w = colwidth
 if (align in [u'right', u'decimal']):
  return ((u'-' * (w - 1)) + u':')
 elif (align == u'center'):
  return ((u':' + (u'-' * (w - 2))) + u':')
 elif (align == u'left'):
  return (u':' + (u'-' * (w - 1)))
 else:
  return (u'-' * w)

def _pipe_segment_with_colons ( align , colwidth ) : w = colwidth if ( align in [ u'right' , u'decimal' ] ) : return ( ( u'-' * ( w - 1 ) ) + u':' ) elif ( align == u'center' ) : return ( ( u':' + ( u'-' * ( w - 2 ) ) ) + u':' ) elif ( align == u'left' ) : return ( u':' + ( u'-' * ( w - 1 ) ) ) else : return ( u'-' * w )
return a segment of a horizontal line with optional colons which indicate columns alignment .