@param int $max_lines

@return array
557680
public function get($max_lines = 0)
    {
        //if $max_lines is set to 0, then get all the data

        $data = [];

        if ($max_lines > 0) {
            $line_count = 0;
        } else {
            $line_count = -1;
        } // so loop limit is ignored

        while ($line_count < $max_lines && false !== ($row = fgetcsv($this->fp, $this->length, $this->delimiter))) {
            if ($this->parse_header) {
                $row_new = null;
                foreach ($this->header as $i => $heading_i) {
                    $row_new[$heading_i] = $row[$i];
                }
                $data[] = $row_new;
            } else {
                $data[] = $row;
            }

            if ($max_lines > 0) {
                ++$line_count;
            }
        }

        if (1 === $max_lines && isset($data[0])) {
            return $data[0];
        }

        return $data;
    }
352251
public static function headersFromLines($lines)
    {
        $headers = [];

        foreach ($lines as $line) {
            $parts = explode(':', $line, 2);
            $headers[trim($parts[0])][] = isset($parts[1])
                ? trim($parts[1])
                : null;
        }

        return $headers;
    }
1269063
protected static function _getCodeLines( $fileName, $line, $maxLines, $html = false )
    {
        $line--;

        if ( $line <= 0 || false === ( $_source = @file( $fileName ) ) )
        {
            return null;
        }

        $_result = null;
        $_window = intval( $maxLines / 2 );

        $_start = ( 0 > ( $line - $_window ) ? 0 : ( $line - $_window ) );

        /**
         * Set starting line to pass to syntax highlighter. If $maxLines is odd, we lose a half a line. The modulo corrects for that.
         */
        static::$_startLine = $_start + ( $maxLines % 2 );

        while ( $_start <= ( $line + $_window ) )
        {
            if ( !isset( $_source[$_start] ) )
            {
                break;
            }

            $_line = str_replace(
                array("\r", "\n", "\t", PHP_EOL),
                array(null, null, '    ', null),
                $_source[$_start++]
            );

            if ( false === $html )
            {
                $_result .= $_line . PHP_EOL;
            }
            else
            {
                $_result .= $_line . '<br />';
            }
        }

        return $_result;
    }
1019070
public function getUseLines()
    {
        $lines = [];

        $lines = array_merge($lines, $this->getUseLinesSymfony2Part());

        $lines[] = 'use Doctrine\ORM\Mapping as ORM;';

        $useArrayCollection = false;

        foreach ($this->getEntity()->getAttributes() as $attr) {
            if (null !== $attr->getForeign() && 'array' === $attr->getType()) {
                $useArrayCollection = true;
                break;
            }
        }

        if ($useArrayCollection) {
            $lines[] = 'use Doctrine\\Common\\Collections\\ArrayCollection;';
        }


        $lines = array_merge($lines, $this->getUseLinesUserAdditionsPart());

        return $lines;
    }
1100203
private function getParamChunksFromLine($line)
    {
        $paramChunks = explode(' ', $line);
        $paramChunks = array_filter($paramChunks, function($val) {
            return $val !== '';
        });
        unset($paramChunks[0]);
        
        return $paramChunks;
    }
1134482
protected float[] findLimitsTwoLines() {
        boolean repeat = false;
        for (;;) {
            if (repeat && currentLeading == 0)
                return null;
            repeat = true;
            float x1[] = findLimitsOneLine();
            if (lineStatus == LINE_STATUS_OFFLIMITS)
                return null;
            yLine -= currentLeading;
            if (lineStatus == LINE_STATUS_NOLINE) {
                continue;
            }
            float x2[] = findLimitsOneLine();
            if (lineStatus == LINE_STATUS_OFFLIMITS)
                return null;
            if (lineStatus == LINE_STATUS_NOLINE) {
                yLine -= currentLeading;
                continue;
            }
            if (x1[0] >= x2[1] || x2[0] >= x1[1])
                continue;
            return new float[]{x1[0], x1[1], x2[0], x2[1]};
        }
    }
1107134
protected function getInvoiceLines()
    {
        $itemLines = $this->getItemLines();
        $itemLines = $this->addLineType($itemLines, static::LineType_OrderItem);

        $totalLines = $this->getTotalLines();

        $result = array_merge($itemLines, $totalLines);
        return $result;
    }
1349762
def get_line_info(tree, max_lines=None):
    
    line_gen = indented_tree_line_generator(tree, max_lines=max_lines)
    line_gen_result = list(zip(*line_gen))
    if line_gen_result:
        return line_gen_result
    else:
        return [], [], []
279833
private static function getDays(int $maxDays = 31): array
    {
        $days = [-1 => static::getConstant('TXT_DATETIME_DD', 'TXT_DATETIME_DD')];
        for ($i = 1; $i <= $maxDays; $i++) {
            $days[$i] = \sprintf('%02s', $i);
        }
        return $days;
    }
219413
public function getOutputLines($stripBlankLines = false)
    {
        if ($stripBlankLines) {
            $output = array();
            foreach ($this->outputLines as $line) {
                if ('' !== $line) {
                    $output[] = $line;
                }
            }

            return $output;
        }

        return $this->outputLines;
    }
795578
def maxline(filename, use_cache_only=False):
    """"""
    if filename not in file2file_remap_lines:
        return size(filename, use_cache_only)
    max_lineno = -1
    remap_line_entry = file2file_remap_lines.get(filename)
    if not remap_line_entry:
        return size(filename, use_cache_only)
    for t in remap_line_entry.from_to_pairs:
        max_lineno = max(max_lineno, t[1])
    if max_lineno == -1:
        return size(filename, use_cache_only)
    else:
        return max_lineno
7820
def split_lines(source, maxline=79):
    
    result = []
    extend = result.extend
    append = result.append
    line = []
    multiline = False
    count = 0
    find = str.find
    for item in source:
        index = find(item, '\n')
        if index:
            line.append(item)
            multiline = index > 0
            count += len(item)
        else:
            if line:
                if count <= maxline or multiline:
                    extend(line)
                else:
                    wrap_line(line, maxline, result)
                count = 0
                multiline = False
                line = []
            append(item)
    return result
311039
def get_unaligned_lines(self):
    """"""
    sys.stderr.write("error unimplemented get_unaligned_lines\n")
    sys.exit()
    return [self._lines[x-1] for x in self._unaligned]
159659
protected static function fixLastLine(array $lines, array $all): array
    {
        $last = end($all);
        $lastLine = end($lines);
        if ($lastLine !== false && $last !== $lastLine && rtrim($lastLine) === $last) {
            $lines[key($lines)] = $last;
        }
        return $lines;
    }
996889
public function mostRecentOrdersAction($max = 20)
    {
        $em = $this->getDoctrine()->getManager();

        /** @var ProductOrderRepository $productOrderRepo */
        $productOrderRepo = $em->getRepository('AmulenShopBundle:ProductOrder');
        $orders = $productOrderRepo->recentOrders($max);

        return [
            'orders' => $orders,
        ];
    }
848114
protected function deduplicate($lines) {
$unique = array();
$comments = array();

foreach($lines as $line) {
if (strpos($line, '/*') === 0) {
$comments[] = $line;
continue;
}
if (!in_array($line, $unique)) {
$unique[] = $line;
}
array_splice($unique, array_search($line, $unique), 0, $comments);
$comments = array();
}
return array_merge($unique, $comments);
}
922549
public function getRulers($line = 10)
    {
        if ($line == 0) {
            return [];
        }
        $data = [0];
        $percent = ($this->panel->duration / 100);
        $row = $this->panel->duration / $line;
        $precision = $row > 100 ? -2 : -1;
        for ($i = 1; $i < $line; $i++) {
            $ms = round($i * $row, $precision);
            $data[$ms] = $ms / $percent;
        }
        return $data;
    }