Underline a given text
518615
def underline(self, text, indent=4):
        """"""
        length = len(text)
        indentation = (' ' * indent)
        return indentation + text + '\n' + indentation + ('-' * length)
370018
def stylize(txt, bold=False, underline=False):
    

    setting = ''
    setting += _SET_BOLD if bold is True else ''
    setting += _SET_UNDERLINE if underline is True else ''
    return setting + str(txt) + _STYLE_RESET
959997
def wrap(width: 78, indent: 0, indent_after: false, segments: false)
    if segments
      text = Text.wrap_segments(@lines[@line], width: width, indent: indent, indent_after: indent_after)
    else
      text = Text.wrap(@lines[@line], width: width, indent: indent, indent_after: indent_after)
    end
    @lines.delete_at(@line)
    @line -= 1
    text.split("\n").each {|line| self.next(line) }
    return self
  end
977530
public static String toUnderline(String value) {
        StringBuilder result = new StringBuilder();
        if (value != null && value.length() > 0) {
            result.append(value.substring(0, 1).toLowerCase());
            for (int i = 1; i < value.length(); i++) {
                String s = value.substring(i, i + 1);
                if (s.equals(s.toUpperCase())) {
                    result.append("_");
                    result.append(s.toLowerCase());
                } else {
                    result.append(s);
                }
            }
        }
        return result.toString();
    }
1253387
public static function underline2hump($str) {

        $str = trim($str);
        if ( strpos($str, "_") === false ) return $str;

        $arr = explode("_", $str);
        $__str = $arr[0];
        for( $i = 1; $i < count($arr); $i++ ) {
            $__str .= ucfirst($arr[$i]);
        }
        return $__str;
    }
418952
def indent(text, indent=2, width=128):
    
    return "\n".join(
        textwrap.wrap(text,
                      width=width,
                      initial_indent=" " * indent,
                      subsequent_indent=" " * indent))
1356689
def margin(text):
    
    """
    lines = str(text).split('\n')
    return '\n'.join('  {}  '.format(l) for l in lines)
114171
def indentsize(line):
    """"""
    expline = string.expandtabs(line)
    return len(expline) - len(string.lstrip(expline))
1217074
def wrap(self, text, width=None, indent=None):
        
        width = width if width is not None else self.options.wrap_length
        indent = indent if indent is not None else self.indentation
        initial_indent = self.initial_indentation
        return textwrap.fill(text, width=width,
                             initial_indent=initial_indent,
                             subsequent_indent=indent)
385508
def underline_color_attribute(styles={})
      return nil if styles.nil?
      value = styles[:underline_color]
      return nil unless value && value.is_a?(UIColor)
      value
    end
1001058
def line(self, text=''):
        ''''''
        self.out.write(text)
        self.out.write('\n')
822384
function _underline(
    t,              // :: Type
    propPath,       // :: PropPath
    formatType3     // :: Type -> Array String -> String -> String
  ) {
    return formatType3 (t) (propPath) (t.format (_, function(k) {
      return K (_underline (t.types[k],
                            Z.concat (propPath, [k]),
                            formatType3));
    }));
  }
468502
function underline(
    typeInfo,               // :: TypeInfo
    underlineConstraint,    // :: String -> TypeClass -> String -> String
    formatType5
    // :: Integer -> (String -> String) -> Type -> PropPath -> String -> String
  ) {
    var st = typeInfo.types.reduce (function(st, t, index) {
      var formatType4 = formatType5 (index);
      function f(g) {
        return function(type) {
          return B (B (B (when (type.type === FUNCTION)
                               (parenthesize (_)))))
                   (formatType4 (g));
        };
      }
      st.carets.push (_underline (t, [], W (f (r ('^')))));
      st.numbers.push (_underline (t, [], W (f (function(s) {
        return label (show (st.counter += 1)) (s);
      }))));
      return st;
    }, {carets: [], numbers: [], counter: 0});

    return typeSignature (typeInfo) + '\n' +
           _ (typeInfo.name + ' :: ') +
              constraintsRepr (typeInfo.constraints, _, underlineConstraint) +
              joinWith (_ (' -> '), st.carets) + '\n' +
           _ (typeInfo.name + ' :: ') +
              constraintsRepr (typeInfo.constraints, _, K (K (_))) +
              joinWith (_ (' -> '), st.numbers) + '\n';
  }
1300123
def OnCellFontUnderline(self, event):
        """"""

        with undo.group(_("Underline")):
            self.grid.actions.toggle_attr("underline")

        self.grid.ForceRefresh()

        self.grid.update_attribute_toolbar()

        event.Skip()
566670
def _LineWrap(text, width):
    
    return reduce(lambda line, word, width=width: '%s%s%s' %
                  (line,
                   ' \n'[(len(line) - line.rfind('\n') - 1 +
                         len(word.split('\n', 1)[0]) >= width)],
                   word),
                  text.split(' ')
                 )
1071904
def underscore(text):
    """"""
    return UNDERSCORE[1].sub(r'\1_\2', UNDERSCORE[0].sub(r'\1_\2', text)).lower()
644643
def format_h3(s, format="text", indents=0):
    

    _CHAR = "~"
    if format.startswith("text"):
        return format_underline(s, _CHAR, indents)
    elif format.startswith("markdown"):
        return ["### {}".format(s)]
    elif format.startswith("rest"):
        return format_underline(s, _CHAR, 0)