adds the line to the while maintaining the data's sort order

 @param [String] line to add to the file, it should not have it's own line ending.
 @return [Nil] always returns nil to match standard #puts method
321396
def sorted_puts(line)
      if line == nil || line.size == 0
        raise ArgumentError, 'Line cannot be blank!'
      end
      if line.index($/)
        raise ArgumentError, "Cannot `puts` a line with extra line endings. Make sure the line does not contain `#{$/.inspect}`"
      end

      matched, idx = binary_seek(line)

      if matched
        # an exact match was found, nothing to do
      else
        if idx == nil
          # append to end of file
          self.seek(0, IO::SEEK_END)
          puts(line)
        else
          self.seek(cached_positions[idx][0], IO::SEEK_SET)
          do_at_current_position{puts(line)}
        end
        update_cached_position(idx, line)
      end
      nil
    end
110766
def newright(name, line=nil, file=nil)
    add_right( Right.new(name, line, file) )
  end
950065
def insert_line(self, line):
        """"""
        if self.current_block is not None:
            self.current_block.append(line)
        else:
            self.header.append(line)
327722
def add_lines(self, lines):
        '''
        

        '''
        import numpy as np
        if not lines:
            return

        v_lines = np.vstack([l.v for l in lines])
        v_index_offset = np.cumsum([0] + [len(l.v) for l in lines])
        e_lines = np.vstack([l.e + v_index_offset[i] for i, l in enumerate(lines)])
        num_body_verts = self.v.shape[0]
        self.v = np.vstack([self.v, v_lines])
        self.e = e_lines + num_body_verts
1053601
public void addLine(String line) {
        try {
            writer.append(line);
            writer.newLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
16430
private void appendLine(final String timeStampStr, final int indentLevel, final String line,
            final StringBuilder buf) {
        buf.append(timeStampStr);
        buf.append('\t');
        buf.append(ClassGraph.class.getSimpleName());
        buf.append('\t');
        final int numDashes = 2 * (indentLevel - 1);
        for (int i = 0; i < numDashes; i++) {
            buf.append('-');
        }
        if (numDashes > 0) {
            buf.append(' ');
        }
        buf.append(line);
        buf.append('\n');
    }
420053
protected function addLine($line)
	{
		$ignoreLen = 0;

		if (!isset($this->table))
		{
			$this->table = [];

			// Make the table start at the first non-space character
			preg_match('/^ */', $line, $m);
			$ignoreLen = strlen($m[0]);
			$line      = substr($line, $ignoreLen);
		}

		// Overwrite the outermost pipes
		$line = preg_replace('/^( *)\\|/', '$1 ', $line);
		$line = preg_replace('/\\|( *)$/', ' $1', $line);

		$this->table['rows'][] = ['line' => $line, 'pos' => $this->pos + $ignoreLen];
	}
572428
def lines
      @value.inject(0) do |s, e|
        next s + e.count("\n") if e.is_a?(String)
        next s
      end
    end
1099980
def add_branch(steps, source_line, ruby_code = nil)
      branches << Branch.new(steps, source_line, ruby_code)
    end
1061239
def put_current_line(self, prefix=''):
        
        return '%s#line %i "%s"\n' % (prefix, self.lex.lineno, os.path.basename(self.filestack[-1][0]))
226063
def add(self, indent, line):
        
        if isinstance(line, str):
            list.append(self, indent*4*' ' + line)
        else:
            for subline in line:
                list.append(self, indent*4*' ' + subline)
365401
def check_line(file, line)
      prints << Danger::FileLog.new(file, line.number) if @print && !line.content.match(PRINT_REGEXP).nil?
      nslogs << Danger::FileLog.new(file, line.number) if @nslog && !line.content.match(NSLOG_REGEXP).nil?
    end
1241546
def add_comment(self, line):
        
        if not isinstance(self.last_item, Comment):
            comment = Comment(self._structure)
            self._structure.append(comment)
        self.last_item.add_line(line)
        return self
356454
def push_line(self, line):
        
        self.lineno -= 1
        self._buffer.append(line + b'\n')
474945
def add_parsed_line(parsed_line)
      value_hash = parsed_line[:line_definition].convert_captured_values(parsed_line[:captures], self)
      value_hash[:line_type] = parsed_line[:line_definition].name
      value_hash[:lineno] = parsed_line[:lineno]
      value_hash[:source] = parsed_line[:source]
      value_hash[:compound] = parsed_line[:line_definition].compound
      add_line_hash(value_hash)
    end
166453
function(line, index, lines) {
        var hasPipe = /^\s*\|\>/;
        var nextLine = lines[index + 1] || '';

        if (line.match(hasPipe)|| !nextLine.match(hasPipe)) {
          return line;
        }
        // handle wrapping returned values
        else if (line.match(/^\s*return/)) { // starts with return
          return line.replace(/^return (.+)/, function($0, $1) {
              return 'return _.chain(' + $1 +')';
          });
        }
        // handle wrapping assignments eg, foo = [1, 2, 3]
        else if (line.match(/^\s*[\w$]+\s+\=\s+/)) { // starts with `foo =`
          return line.replace(/(^\s*[\w$]+\s+\=\s+)(.+)/, function($0, $1, $2) {
              return $1 + '_.chain(' + $2 +')';
          });
        }
        else if (!!line.trim()) {
          return '_.chain(' + line + ')';
        }
        else {
          return line;
        }
    }
460349
def put_current_line(self, prefix='', suffix=''):
        
        return '%s#line %i "%s"%s' % (prefix, self.lex.lineno, self.filestack[-1][0], suffix)