Grab the `i`th submission, with the title field formatted to fit inside
        of a window of width `n`
354057
def get(self, index, n_cols=70):
        

        if index < -1:
            raise IndexError

        elif index == -1:
            data = self._submission_data
            data['split_title'] = self.wrap_text(data['title'], width=n_cols-2)
            data['split_text'] = self.wrap_text(data['text'], width=n_cols-2)
            data['n_rows'] = len(data['split_title'] + data['split_text']) + 5
            data['h_offset'] = 0

        else:
            data = self._comment_data[index]
            indent_level = min(data['level'], self.max_indent_level)
            data['h_offset'] = indent_level * self.indent_size

            if data['type'] == 'Comment':
                width = min(n_cols - data['h_offset'], self._max_comment_cols)
                data['split_body'] = self.wrap_text(data['body'], width=width)
                data['n_rows'] = len(data['split_body']) + 1
            else:
                data['n_rows'] = 1

        return data
74726
def fill_form_field(self, field_name, field_value):
        
        self.browser.execute_script(
            "document.getElementsByName(\"" + str(
                field_name) + "\")[0].value = \"" + str(field_value) + "\"")
919287
def h1(title, line=OVERLINE):
    
    width = utils.term.width
    printy(bold(title.center(width)).as_utf8)
    printy(bold((line * width)[:width]).as_utf8)
1193072
function () {
			this.writeDebug('_formEventHandler');
			var _this = this;
			// ASP.net or regular submission?
			if (this.settings.noForm === true) {
				$(document).on('click.'+pluginName, '.' + this.settings.formContainer + ' button', function (e) {
					_this.processForm(e);
				});
				$(document).on('keydown.'+pluginName, function (e) {
					if (e.keyCode === 13 && $('#' + _this.settings.addressID).is(':focus')) {
						_this.processForm(e);
					}
				});
			}
			else {
				$(document).on('submit.'+pluginName, '#' + this.settings.formID, function (e) {
					_this.processForm(e);
				});
			}

			// Reset button trigger
			if ($('.bh-sl-reset').length && $('#' + this.settings.mapID).length) {
				$(document).on('click.' + pluginName, '.bh-sl-reset', function () {
					_this.mapReload();
				});
			}
		}
1227159
def version_title_header_element(feature, parent):
    """"""
    _ = feature, parent  # NOQA
    header = version_title_header['string_format']
    return header.capitalize()
367277
def decorateSubHeader(title, columnWidths, options):
    
    title = title.lower()
    if title != options.sortCategory:
        s = "| %*s%*s%*s%*s%*s " % (
            columnWidths.getWidth(title, "min"), "min",
            columnWidths.getWidth(title, "med"), "med",
            columnWidths.getWidth(title, "ave"), "ave",
            columnWidths.getWidth(title, "max"), "max",
            columnWidths.getWidth(title, "total"), "total")
        return s
    else:
        s = "| "
        for field, width in [("min", columnWidths.getWidth(title, "min")),
                             ("med", columnWidths.getWidth(title, "med")),
                             ("ave", columnWidths.getWidth(title, "ave")),
                             ("max", columnWidths.getWidth(title, "max")),
                             ("total", columnWidths.getWidth(title, "total"))]:
            if options.sortField == field:
                s += "%*s*" % (width - 1, field)
            else:
                s += "%*s" % (width, field)
        s += " "
        return s
160905
function makeViewportGetter_(dimension, inner, client) {
  if (testMQ('(min-' + dimension + ':' + window[inner] + 'px)')) {
    return function getWindowDimension_() {
      return window[inner];
    };
  } else {
    var docElem = document.documentElement;
    return function getDocumentDimension_() {
      return docElem[client];
    };
  }
}
905831
function (title, fields, cmd) {
            var t = this,
                prefix = t.o.prefix,
                lg = t.lang,
                html = '';

            $.each(fields, function (fieldName, field) {
                var l = field.label || fieldName,
                    n = field.name || fieldName,
                    a = field.attributes || {};

                var attr = Object.keys(a).map(function (prop) {
                    return prop + '="' + a[prop] + '"';
                }).join(' ');

                html += '<label><input type="' + (field.type || 'text') + '" name="' + n + '"' +
                    (field.type === 'checkbox' && field.value ? ' checked="checked"' : ' value="' + (field.value || '').replace(/"/g, '&quot;')) +
                    '"' + attr + '><span class="' + prefix + 'input-infos"><span>' +
                    (lg[l] ? lg[l] : l) +
                    '</span></span></label>';
            });

            return t.openModal(title, html)
                .on(CONFIRM_EVENT, function () {
                    var $form = $('form', $(this)),
                        valid = true,
                        values = {};

                    $.each(fields, function (fieldName, field) {
                        var n = field.name || fieldName;

                        var $field = $('input[name="' + n + '"]', $form),
                            inputType = $field.attr('type');

                        switch (inputType.toLowerCase()) {
                            case 'checkbox':
                                values[n] = $field.is(':checked');
                                break;
                            case 'radio':
                                values[n] = $field.filter(':checked').val();
                                break;
                            default:
                                values[n] = $.trim($field.val());
                                break;
                        }
                        // Validate value
                        if (field.required && values[n] === '') {
                            valid = false;
                            t.addErrorOnModalField($field, t.lang.required);
                        } else if (field.pattern && !field.pattern.test(values[n])) {
                            valid = false;
                            t.addErrorOnModalField($field, field.patternError);
                        }
                    });

                    if (valid) {
                        t.restoreRange();

                        if (cmd(values, fields)) {
                            t.syncCode();
                            t.$c.trigger('tbwchange');
                            t.closeModal();
                            $(this).off(CONFIRM_EVENT);
                        }
                    }
                })
                .one(CANCEL_EVENT, function () {
                    $(this).off(CONFIRM_EVENT);
                    t.closeModal();
                });
        }
849882
function(i) {
            var $draggee = this.$draggee.eq(i),
                $draggeeHelper = $draggee.clone().addClass('draghelper');

            if (this.settings.copyDraggeeInputValuesToHelper) {
                Garnish.copyInputValues($draggee, $draggeeHelper);
            }

            // Remove any name= attributes so radio buttons don't lose their values
            $draggeeHelper.find('[name]').attr('name', '');

            $draggeeHelper.css({
                width: $draggee.width() + 1, // Prevent the brower from wrapping text if the width was actually a fraction of a pixel larger
                height: $draggee.height(),
                margin: 0
            });

            if (this.settings.helper) {
                if (typeof this.settings.helper === 'function') {
                    $draggeeHelper = this.settings.helper($draggeeHelper);
                }
                else {
                    $draggeeHelper = $(this.settings.helper).append($draggeeHelper);
                }
            }

            $draggeeHelper.appendTo(Garnish.$bod);

            var helperPos = this._getHelperTarget(i);

            $draggeeHelper.css({
                position: 'absolute',
                top: helperPos.top,
                left: helperPos.left,
                zIndex: this.settings.helperBaseZindex + this.$draggee.length - i,
                opacity: this.settings.helperOpacity
            });

            this.helperPositions[i] = {
                top: helperPos.top,
                left: helperPos.left
            };

            this.helpers.push($draggeeHelper);
        }
862940
def get_title():
    ''' 
    '''
    MAX_LEN = 256
    buffer_ = create_unicode_buffer(MAX_LEN)
    kernel32.GetConsoleTitleW(buffer_, MAX_LEN)
    log.debug('%s', buffer_.value)
    return buffer_.value
130028
def get_title(desc, default=None):
    """"""
    if not desc:
        return default
    lines = desc.strip('\n').split('\n')
    if not lines:
        return default
    return lines[0].lstrip('# ').rstrip(' ')
1302778
function(strTitle) {
        var tDiv = Dom.getElementsByClassName(YAHOO.widget.CalendarGroup.CSS_2UPTITLE, "div", this.oDomContainer)[0] || document.createElement("div");
        tDiv.className = YAHOO.widget.CalendarGroup.CSS_2UPTITLE;
        tDiv.innerHTML = strTitle;
        this.oDomContainer.insertBefore(tDiv, this.oDomContainer.firstChild);
    
        Dom.addClass(this.oDomContainer, this.Style.CSS_WITH_TITLE);
    
        return tDiv;
    }
580964
function defaultWrapper(_){
                        switch (_){
                            case 'title': return {
                                enable: false,
                                text: 'Write Your Title',
                                className: 'h4',
                                css: {
                                    width: scope.options.chart.width + 'px',
                                    textAlign: 'center'
                                }
                            };
                            case 'subtitle': return {
                                enable: false,
                                text: 'Write Your Subtitle',
                                css: {
                                    width: scope.options.chart.width + 'px',
                                    textAlign: 'center'
                                }
                            };
                            case 'caption': return {
                                enable: false,
                                text: 'Figure 1. Write Your Caption text.',
                                css: {
                                    width: scope.options.chart.width + 'px',
                                    textAlign: 'center'
                                }
                            };
                        }
                    }
591957
def submit(value, options={}, &block)
      after_text = @template.capture(&block) if block_given?
      
      # Add specific bootstrap class
      options[:class] ||= ''
      options[:class] += ' btn'
      unless options[:class] =~ /btn-/
        options[:class] += ' btn-primary' 
      end

      # Set the script to change the text
      if change_to_text = options.delete(:change_to_text)
        options[:class] += ' change_to_text'
        options[:onclick] ||= ''
        options[:onclick] = "$(this).closest('.submit').hide();$(this).closest('.submit').after($('<div class=submit>#{change_to_text}</div>'))"
      end

      @template.render(:partial => "#{BootstrapBuilder.config.template_folder}/submit", :locals  => {
        :builder => self,
        :field => super(value, options),
        :after_text => after_text,
        :change_to_text => change_to_text
      })
    end
423561
def assist_with(submission)
      @rules
        .select { |it| it.matches?(submission) }
        .map { |it| it.message_for(submission.attemps_count) }
    end
346946
def post_submission(self):
        
        # Check that the subreddit can be submitted to
        name = self.content.name
        if '+' in name or name in ('/r/all', '/r/front', '/r/me', '/u/saved'):
            self.term.show_notification("Can't post to {0}".format(name))
            return

        submission_info = docs.SUBMISSION_FILE.format(name=name)
        with self.term.open_editor(submission_info) as text:
            if not text:
                self.term.show_notification('Canceled')
                return
            elif '\n' not in text:
                self.term.show_notification('Missing body')
                return

            title, content = text.split('\n', 1)
            with self.term.loader('Posting', delay=0):
                submission = self.reddit.submit(name, title, text=content,
                                                raise_captcha_exception=True)
                # Give reddit time to process the submission
                time.sleep(2.0)
            if self.term.loader.exception:
                raise TemporaryFileError()

        if not self.term.loader.exception:
            # Open the newly created submission
            self.selected_page = self.open_submission_page(submission=submission)
1201168
function () {
        var document = Aria.$window.document;
        reportHolder = document.createElement('iframe');
        var block = document.createElement('iframe');
        reportHolder.scrolling = 'no';
        reportHolder.frameBorder = 'no';

        document.body.appendChild(reportHolder);
        reportHolder.doc = reportHolder.contentDocument || reportHolder.contentWindow.document;
        reportHolder.doc.write('<html><head></head><body></body></html>');
        reportHolder.doc.close();

        logHolder = reportHolder.doc.createElement('div');
        var close = reportHolder.doc.createElement('a');

        reportHolder.resize = function () {
            if (reportHolder) {
                var body = reportHolder.doc.body;
                style(reportHolder, {
                    width : body.scrollWidth,
                    height : body.scrollHeight
                });
            }
        };
        resizeInterval = setInterval(reportHolder.resize, 100);

        style(reportHolder, {
            position : 'fixed',
            top : 10,
            right : 10,
            zIndex : 10000,
            background : 'white',
            padding : 2,
            border : 'solid 2px #aaa',
            width : 250,
            height : 60,
            borderRadius : 4,
            boxShadow : '0 0 8px #eee'
        });
        style(reportHolder.doc.body, {
            'font' : '12px Helvetica,Arials,sans-serif',
            color : '#444'
        });
        style(logHolder, {
            whiteSpace : 'nowrap'
        });

        close.innerHTML = '&#215;';
        style(close, {
            position : 'absolute',
            top : 0,
            right : 0,
            textDecoration : 'none',
            fontWeight : 'bold',
            cursor : 'pointer',
            color : 'red',
            fontSize : '1.3em',
            lineHeight : 8
        });
        close.onclick = function () {
            close.onclick = null;
            clearInterval(resizeInterval);
            close = null;
            block.parentNode.removeChild(block);
            return closeReport();
        };

        style(block, {
            height : Aria.$window.screen.height * 2,
            width : Aria.$window.screen.width,
            position : 'absolute',
            top : 0,
            left : 0,
            visible : 'hidden',
            display : 'none',
            zIndex : 0
        });
        document.body.appendChild(block);

        reportHolder.doc.body.appendChild(close);
        reportHolder.doc.body.appendChild(logHolder);
    }