A weird display, cause we need it to fit in that 180px column on
 FileSet show, and have no real UI to link to for files/versions :(
 rubocop:disable Metrics/MethodLength
355559
def render_failed_compact
        safe_join(
          ["<p><strong>Failed checks:</strong></p>".html_safe] +
          failing_checks.collect do |log|
            safe_join(
              [
                "<p>".html_safe,
                "ChecksumAuditLog id: #{log.id}; ",
                content_tag("a", "file", href: "#{Hydra::PCDM::File.translate_id_to_uri.call(log.file_id)}/fcr:metadata") + "; ",
                content_tag("a", "checked_uri", href: "#{log.checked_uri}/fcr:metadata") + "; ",
                "date: #{log.created_at}; ",
                "expected_result: #{log.expected_result}",
                "</p>".html_safe
              ]
            )
          end
        )
      end
363690
def generate_grid_css
      # loads up erb template to evaluate custom widths
      css = ERB::new(File.path_to_string(CustomLayout::CSS_ERB_FILE))
    
      # bind it to this instance
      css.result(binding)
    end
461664
def display_help
      require 'canis/core/util/textutils'
      filename = CANIS_DOCPATH + "index.txt"
      stylesheet = CANIS_DOCPATH + "style_help.yml"
      # defarr contains default help
      if File.exists?(filename)
        defarr = File.open(filename,'r').read.split("\n")
        # convert help file into styles for use by tmux
        # quick dirty converter for the moment
        defarr = Canis::TextUtils::help2tmux defarr
      else
        arr = []
        arr << "  Could not find help file for application "
        arr << "    "
        arr << "Most applications provide the following keys, unless overriden:"
        arr << "    "
        arr << "    F10         -  exit application "
        arr << "    C-q         -  exit application "
        arr << "    ? (or M-?)  -  current widget key bindings  "
        arr << "    "
        arr << "    Alt-x       -  select commands  "
        arr << "    : (or M-:)  -  select commands  "
        arr << "    "
        defarr = arr
      end
      defhelp = true
      if @help_text
        defhelp = false
        arr = @help_text
        arr = arr.split("\n") if arr.is_a? String
        arr = Canis::TextUtils::help2tmux arr # FIXME can this happen automatically if it is help format
      else
        arr = defarr
      end
      #w = arr.max_by(&:length).length
      h = FFI::NCurses.LINES - 4
      w = FFI::NCurses.COLS - 10
      wbkgd = get_color($reversecolor, :black, :cyan)

      require 'canis/core/util/viewer'
      # this was the old layout that centered with a border, but was a slight bit confusing since the bg was the same
      # as the lower window.
      _layout = [h, w, 2, 4]
      sh = Ncurses.LINES-1
      sc = Ncurses.COLS-0
      # this is the new layout that is much like bline's command list. no border, a thick app header on top
      #  and no side margin
      #  Suppressing border means that title will not be updated on app_header, we have to do so FIXME
      _layout = [ h, sc, sh - h, 0]
      doc = TextDocument.new :text => arr, :content_type => :tmux, :stylesheet => stylesheet
      Canis::Viewer.view(doc, :layout => _layout, :close_key => KEY_F10, :title => "[ Help ]", :print_footer => true,
                        :app_header => true ) do |t, items|
        # would have liked it to be 'md' or :help
        #t.content_type = :tmux
        #t.stylesheet   = stylesheet
        t.suppress_borders = true
        t.print_footer = false
        t.bgcolor = :black
        t.bgcolor = 16
        t.color = :white
        ah = items[:header]
        t.bind(:PROPERTY_CHANGE) { |eve|
          # title is not a property, so we check if text has changed and then look for title.
          if eve.property_name == :text
            #$log.debug "  PROP NAME IS #{eve.property_name} , title is #{t.title} "
            ah.text_center = t.title
          end
        }
        #t.text_patterns[:link] = Regexp.new(/\[[^\]]\]/)
        t.text_patterns[:link] = Regexp.new(/\[\w+\]/)
        t.bind_key(KEY_TAB, "goto link") { t.next_regex(:link) }
        # FIXME bgcolor add only works if numberm not symbol
        t.bind_key(?a, "increment bgcolor") { t.bgcolor += 1 ; t.bgcolor = 1 if t.bgcolor > 256; 
                                      $log.debug " HELP BGCOLOR is #{t.bgcolor} ";
                                      t.clear_pad; t.render_all }
        t.bind(:PRESS){|eve| 
          link = nil
          s = eve.word_under_cursor
          if is_link?(t, s)
            link = get_link(t, s)
          end
          #alert "word under cursor is #{eve.word_under_cursor}, link is #{link}"
          if link
            arr = read_help_file link
            if arr
              doc = TextDocument.new :text => arr, :content_type => :tmux, :stylesheet => stylesheet, :title => link
              #t.add_content arr, :title => link
              t.add_content doc
              #items[:header].text_center = "[#{link}]" 
              t.buffer_last
            else
              alert "No help file for #{link}"
            end
          else
          end
        }

        # help was provided, so default help is provided in second buffer
        unless defhelp
          doc = TextDocument.new :text => defarr, :content_type => :tmux, :stylesheet => stylesheet, :title => " General Help "
          #t.add_content defarr, :title => ' General Help ', :stylesheet => stylesheet, :content_type => :tmux
          t.add_content doc
        end
      end
    end
921533
static public function display()
    {
        Sorter::sort(Listing::$files);
        $content = '<!DOCTYPE html>';
        $content .= sprintf('
<html xmlns="http://www.w3.org/1999/xhtml" lang="%s">', Translation::getCanonicalLocale());
        $content .= '
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>' . sprintf(Translation::trans('index_of'), Main::getDir()) . '</title>';
        $content .= static::getStyle();
        $content .= '
    </head>
    <body>';
        $content .= static::getTitle();
        $content .= '
        <table align="center">';
        $content .= static::getHeader();
        foreach (Listing::$files as $file) {
            $content .= static::getRow($file);
        }
        $content .= static::getFooter();
        $content .= '
        </table>';
        $content .= '
    </body>
</html>';
        die($content);
    }
114367
def big_dataframe_setup():   # pragma: no cover
    """"""
    pd.set_option('display.max_colwidth', sys.maxsize)
    pd.set_option('max_colwidth', sys.maxsize)
    # height has been deprecated.
    # pd.set_option('display.height', sys.maxsize)
    pd.set_option('display.max_rows', sys.maxsize)
    pd.set_option('display.width', sys.maxsize)
    pd.set_option('display.colheader_justify', 'center')
    pd.set_option('display.column_space', sys.maxsize)
    pd.set_option('display.max_seq_items', sys.maxsize)
    pd.set_option('display.expand_frame_repr', True)
134168
def show_item_v3(h):
    
    st = rar3_type(h.type)
    xprint("%s: hdrlen=%d datlen=%d", st, h.header_size, h.add_size)
    if h.type in (rf.RAR_BLOCK_FILE, rf.RAR_BLOCK_SUB):
        if h.host_os == rf.RAR_OS_UNIX:
            s_mode = "0%o" % h.mode
        else:
            s_mode = "0x%x" % h.mode
        xprint("  flags=0x%04x:%s", h.flags, get_file_flags(h.flags))
        if h.host_os >= 0 and h.host_os < len(os_list):
            s_os = os_list[h.host_os]
        else:
            s_os = "?"
        xprint("  os=%d:%s ver=%d mode=%s meth=%c cmp=%d dec=%d vol=%d",
               h.host_os, s_os,
               h.extract_version, s_mode, h.compress_type,
               h.compress_size, h.file_size, h.volume)
        ucrc = (h.CRC + (1 << 32)) & ((1 << 32) - 1)
        xprint("  crc=0x%08x (%d) date_time=%s", ucrc, h.CRC, fmt_time(h.date_time))
        xprint("  name=%s", h.filename)
        if h.mtime:
            xprint("  mtime=%s", fmt_time(h.mtime))
        if h.ctime:
            xprint("  ctime=%s", fmt_time(h.ctime))
        if h.atime:
            xprint("  atime=%s", fmt_time(h.atime))
        if h.arctime:
            xprint("  arctime=%s", fmt_time(h.arctime))
    elif h.type == rf.RAR_BLOCK_MAIN:
        xprint("  flags=0x%04x:%s", h.flags, render_flags(h.flags, main_bits))
    elif h.type == rf.RAR_BLOCK_ENDARC:
        xprint("  flags=0x%04x:%s", h.flags, render_flags(h.flags, endarc_bits))
    elif h.type == rf.RAR_BLOCK_MARK:
        xprint("  flags=0x%04x:", h.flags)
    else:
        xprint("  flags=0x%04x:%s", h.flags, render_flags(h.flags, generic_bits))

    if h.comment is not None:
        cm = repr(h.comment)
        if cm[0] == 'u':
            cm = cm[1:]
        xprint("  comment=%s", cm)
1146534
void showFilesConfiguration() {

        // Message to communicate the resolved configuration:
        String message;
        if (filesUrl != null) {
            String reload = filesReloadable ? "reloadable" : "non-reloadable";
            message = "Files will be served from: " + filesUrl + " (" + reload + ")";
        } else {
            message = "No static files will be served.";
        }
        log.info("Files: {}", message);
    }
737680
def show
      @image = Picturesque::Image.find(params)
      @file = @image.process(params.slice(:size, :quality, :format))

      setup_canonical_link

      expires_in 3.years, public: @file
      send_file @file.path, disposition: Picturesque::Image::DISPOSITION
    end
866510
def less_display():
    
    # here's some magic. We want the nice paging from 'less', so we write
    # the output to a file and use subprocess to run 'less' on the file.
    # But the file might have sensitive data, so open it in 0600 mode.
    _, filename = tempfile.mkstemp()
    mode = stat.S_IRUSR | stat.S_IWUSR
    outfile = None
    outfile = os.fdopen(os.open(filename, os.O_WRONLY | os.O_CREAT, mode), "wb")
    try:
        yield SmartBuffer(outfile)
        outfile.flush()
        subprocess.call(["less", "-FXR", filename])
    finally:
        if outfile is not None:
            outfile.close()
        if os.path.exists(filename):
            os.unlink(filename)
170242
def display_image
      return nil unless ::FileSet.exists?(id) && solr_document.image? && current_ability.can?(:read, id)
      # @todo this is slow, find a better way (perhaps index iiif url):
      original_file = ::FileSet.find(id).original_file

      url = Hyrax.config.iiif_image_url_builder.call(
        original_file.id,
        request.base_url,
        Hyrax.config.iiif_image_size_default
      )
      # @see https://github.com/samvera-labs/iiif_manifest
      IIIFManifest::DisplayImage.new(url,
                                     width: 640,
                                     height: 480,
                                     iiif_endpoint: iiif_endpoint(original_file.id))
    end
403494
def columnize(items, width=None, file=sys.stdout):
    
    if not items:
        return
    if width is None:
        width = shutil.get_terminal_size()[0] if file is sys.stdout else 80
    items = [rendering.vtmlrender(x) for x in items]
    maxcol = max(items, key=len)
    colsize = len(maxcol) + 2
    cols = width // colsize
    if cols < 2:
        for x in items:
            print(x, file=file)
        return
    lines = math.ceil(len(items) / cols)
    for i in range(lines):
        row = items[i:None:lines]
        print(*[x.ljust(colsize) for x in row], sep='', file=file)
220024
def layouts(*args)
      args.concat(%i[fast unsort small large]) if args.map(&:to_s).include?('all')
      args = args.map(&:to_s).join('|')
      res = ''
      res += fastbin.map(&:inspect).join if args.include?('fast')
      res += unsorted_bin.inspect if args.include?('unsort')
      res += smallbin.map(&:inspect).join if args.include?('small')
      res
    end
788232
def format_for_columns(pkgs, options):
    
    running_outdated = options.outdated
    # Adjust the header for the `pip list --outdated` case.
    if running_outdated:
        header = ["Package", "Version", "Latest", "Type"]
    else:
        header = ["Package", "Version"]

    data = []
    if options.verbose >= 1 or any(dist_is_editable(x) for x in pkgs):
        header.append("Location")
    if options.verbose >= 1:
        header.append("Installer")

    for proj in pkgs:
        # if we're working on the 'outdated' list, separate out the
        # latest_version and type
        row = [proj.project_name, proj.version]

        if running_outdated:
            row.append(proj.latest_version)
            row.append(proj.latest_filetype)

        if options.verbose >= 1 or dist_is_editable(proj):
            row.append(proj.location)
        if options.verbose >= 1:
            row.append(get_installer(proj))

        data.append(row)

    return data, header
402504
def for_display(self):
        
        skip = ""
        if self.skip:
            skip = " [SKIP]"
        result = "{step_num}: {path}{skip}".format(
            step_num=self.step_num, path=self.path, skip=skip
        )
        description = self.task_config.get("description")
        if description:
            result += ": {}".format(description)
        return result
132005
def display_motd
      if ::File.exists?("/var/run/motd.dynamic")
        # Ubuntu 14.04+ motd location
        puts ::File.read("/var/run/motd.dynamic")
      elsif ::File.exists?("/var/run/motd")
        # Ubuntu 12.04 motd location
        puts ::File.read("/var/run/motd")
      elsif ::File.exists?("/etc/motd")
        # Legacy (CentOS 6 style)
        puts ::File.read("/etc/motd")
      end
    rescue 
      nil
    end
1132508
function displayMetrics(file) {
    var prefix = '';

    var code = fs.readFileSync(file, 'utf-8');

    // We remove any shebang at the start of the file since that isn't valid
    // Javascript and will trip up the parser.

    code = code.replace(/^#!.*\n/, '');

    var metrics = complexity(code);

    // Walk the metrics structure and add each member to the table rows.

    function walk(data, name) {
        // Fade out anonymous functions.

        if (name.indexOf('anon@') === 0) {
            name = name.grey;
        }

        rows.push([ prefix + name, data.ecc, data.arity, data.codeLines, data.commentLines, Math.round(100 * data.commentLines / data.codeLines) ]);

        // Add two spaces to the prefix before the next depth, to illustrate
        // the hierarchy in the table.

        prefix += '  ';
        _.each(data.children, walk);
        prefix = prefix.slice(0,prefix.length-2);
    }
    walk(metrics, path.basename(file).blue.bold);
}
660676
public function displayInfo()
    {
        $s = "File Size: %u\n"
            ."Chunk Size: %u\n"
            ."fmt Subchunk Size: %u\n"
            ."Extended fmt Size: %u\n"
            ."fact Subchunk Size: %u\n"
            ."Data Offset: %u\n"
            ."Data Size: %u\n"
            ."Audio Format: %s\n"
            ."Audio SubFormat: %s\n"
            ."Channels: %u\n"
            ."Channel Mask: 0x%s\n"
            ."Sample Rate: %u\n"
            ."Bits Per Sample: %u\n"
            ."Valid Bits Per Sample: %u\n"
            ."Sample Block Size: %u\n"
            ."Number of Sample Blocks: %u\n"
            ."Byte Rate: %uBps\n";

        $s = sprintf($s, $this->getActualSize(),
                         $this->getChunkSize(),
                         $this->getFmtChunkSize(),
                         $this->getFmtExtendedSize(),
                         $this->getFactChunkSize(),
                         $this->getDataOffset(),
                         $this->getDataSize(),
                         $this->getAudioFormat() == self::WAVE_FORMAT_PCM ? 'PCM' : ($this->getAudioFormat() == self::WAVE_FORMAT_IEEE_FLOAT ? 'IEEE FLOAT' : 'EXTENSIBLE'),
                         $this->getAudioSubFormat() == self::WAVE_SUBFORMAT_PCM ? 'PCM' : 'IEEE FLOAT',
                         $this->getNumChannels(),
                         dechex($this->getChannelMask()),
                         $this->getSampleRate(),
                         $this->getBitsPerSample(),
                         $this->getValidBitsPerSample(),
                         $this->getBlockAlign(),
                         $this->getNumBlocks(),
                         $this->getByteRate());

        if (php_sapi_name() == 'cli') {
            return $s;
        } else {
            return nl2br($s);
        }
    }