original_docstring: 
      Return the amount of padding (or clipping) on the left and
      right part of maxcol columns to satisfy the following:
  
      align_type -- 'left', 'center', 'right', 'relative'
      align_amount -- a percentage when align_type=='relative'
      width_type -- 'fixed', 'relative', 'clip'
      width_amount -- a percentage when width_type=='relative'
          otherwise equal to the width of the widget
      min_width -- a desired minimum width for the widget or None
      left -- a fixed number of columns to pad on the left
      right -- a fixed number of columns to pad on the right
  
      >>> clrp = calculate_left_right_padding
      >>> clrp(15, 'left', 0, 'fixed', 10, None, 2, 0)
      (2, 3)
      >>> clrp(15, 'relative', 0, 'fixed', 10, None, 2, 0)
      (2, 3)
      >>> clrp(15, 'relative', 100, 'fixed', 10, None, 2, 0)
      (5, 0)
      >>> clrp(15, 'center', 0, 'fixed', 4, None, 2, 0)
      (6, 5)
      >>> clrp(15, 'left', 0, 'clip', 18, None, 0, 0)
      (0, -3)
      >>> clrp(15, 'right', 0, 'clip', 18, None, 0, -1)
      (-2, -1)
      >>> clrp(15, 'center', 0, 'fixed', 18, None, 2, 0)
      (0, 0)
      >>> clrp(20, 'left', 0, 'relative', 60, None, 0, 0)
      (0, 8)
      >>> clrp(20, 'relative', 30, 'relative', 60, None, 0, 0)
      (2, 6)
      >>> clrp(20, 'relative', 30, 'relative', 60, 14, 0, 0)
      (2, 4)
      
docstring: Return the amount of padding (or clipping) on the left and
  right part of maxcol columns to satisfy the following.
  
  
  
  
docstring_tokens: Return the amount of padding ( or clipping ) on the left and right part of maxcol columns to satisfy the following .
code: def calculate_left_right_padding(maxcol, align_type, align_amount, 
      width_type, width_amount, min_width, left, right):
      """
      Return the amount of padding (or clipping) on the left and
      right part of maxcol columns to satisfy the following:
  
      align_type -- 'left', 'center', 'right', 'relative'
      align_amount -- a percentage when align_type=='relative'
      width_type -- 'fixed', 'relative', 'clip'
      width_amount -- a percentage when width_type=='relative'
          otherwise equal to the width of the widget
      min_width -- a desired minimum width for the widget or None
      left -- a fixed number of columns to pad on the left
      right -- a fixed number of columns to pad on the right
  
      >>> clrp = calculate_left_right_padding
      >>> clrp(15, 'left', 0, 'fixed', 10, None, 2, 0)
      (2, 3)
      >>> clrp(15, 'relative', 0, 'fixed', 10, None, 2, 0)
      (2, 3)
      >>> clrp(15, 'relative', 100, 'fixed', 10, None, 2, 0)
      (5, 0)
      >>> clrp(15, 'center', 0, 'fixed', 4, None, 2, 0)
      (6, 5)
      >>> clrp(15, 'left', 0, 'clip', 18, None, 0, 0)
      (0, -3)
      >>> clrp(15, 'right', 0, 'clip', 18, None, 0, -1)
      (-2, -1)
      >>> clrp(15, 'center', 0, 'fixed', 18, None, 2, 0)
      (0, 0)
      >>> clrp(20, 'left', 0, 'relative', 60, None, 0, 0)
      (0, 8)
      >>> clrp(20, 'relative', 30, 'relative', 60, None, 0, 0)
      (2, 6)
      >>> clrp(20, 'relative', 30, 'relative', 60, 14, 0, 0)
      (2, 4)
      """
      if width_type == RELATIVE:
          maxwidth = max(maxcol - left - right, 0)
          width = int_scale(width_amount, 101, maxwidth + 1)
          if min_width is not None:
              width = max(width, min_width)
      else:
          width = width_amount
      
      standard_alignments = {LEFT:0, CENTER:50, RIGHT:100}
      align = standard_alignments.get(align_type, align_amount)
  
      # add the remainder of left/right the padding
      padding = maxcol - width - left - right
      right += int_scale(100 - align, 101, padding + 1) 
      left = maxcol - width - right
  
      # reduce padding if we are clipping an edge
      if right < 0 and left > 0:
          shift = min(left, -right)
          left -= shift
          right += shift
      elif left < 0 and right > 0:
          shift = min(right, -left)
          right -= shift
          left += shift
      
      # only clip if width_type == 'clip'
      if width_type != CLIP and (left < 0 or right < 0):
          left = max(left, 0)
          right = max(right, 0)
      
      return left, right
code_tokens: def calculate_left_right_padding ( maxcol , align_type , align_amount , width_type , width_amount , min_width , left , right ) : if width_type == RELATIVE : maxwidth = max ( maxcol - left - right , 0 ) width = int_scale ( width_amount , 101 , maxwidth + 1 ) if min_width is not None : width = max ( width , min_width ) else : width = width_amount standard_alignments = { LEFT : 0 , CENTER : 50 , RIGHT : 100 } align = standard_alignments . get ( align_type , align_amount ) padding = maxcol - width - left - right right += int_scale ( 100 - align , 101 , padding + 1 ) left = maxcol - width - right if right < 0 and left > 0 : shift = min ( left , - right ) left -= shift right += shift elif left < 0 and right > 0 : shift = min ( right , - left ) right -= shift left += shift if width_type != CLIP and ( left < 0 or right < 0 ) : left = max ( left , 0 ) right = max ( right , 0 ) return left , right
short_docstring: Return the amount of padding (or clipping) on the left and
  right part of maxcol columns to satisfy the following:
short_docstring_tokens: Return the amount of padding ( or clipping ) on the left and right part of maxcol columns to satisfy the following :
comment: """
      Return the amount of padding (or clipping) on the left and
      right part of maxcol columns to satisfy the following:
  
      align_type -- 'left', 'center', 'right', 'relative'
      align_amount -- a percentage when align_type=='relative'
      width_type -- 'fixed', 'relative', 'clip'
      width_amount -- a percentage when width_type=='relative'
          otherwise equal to the width of the widget
      min_width -- a desired minimum width for the widget or None
      left -- a fixed number of columns to pad on the left
      right -- a fixed number of columns to pad on the right
  
      >>> clrp = calculate_left_right_padding
      >>> clrp(15, 'left', 0, 'fixed', 10, None, 2, 0)
      (2, 3)
      >>> clrp(15, 'relative', 0, 'fixed', 10, None, 2, 0)
      (2, 3)
      >>> clrp(15, 'relative', 100, 'fixed', 10, None, 2, 0)
      (5, 0)
      >>> clrp(15, 'center', 0, 'fixed', 4, None, 2, 0)
      (6, 5)
      >>> clrp(15, 'left', 0, 'clip', 18, None, 0, 0)
      (0, -3)
      >>> clrp(15, 'right', 0, 'clip', 18, None, 0, -1)
      (-2, -1)
      >>> clrp(15, 'center', 0, 'fixed', 18, None, 2, 0)
      (0, 0)
      >>> clrp(20, 'left', 0, 'relative', 60, None, 0, 0)
      (0, 8)
      >>> clrp(20, 'relative', 30, 'relative', 60, None, 0, 0)
      (2, 6)
      >>> clrp(20, 'relative', 30, 'relative', 60, 14, 0, 0)
      (2, 4)
      """$SEP$# add the remainder of left/right the padding$SEP$# reduce padding if we are clipping an edge$SEP$# only clip if width_type == 'clip'