Get groups from message.

@param string $before segment before groups
@param string $start  first segment of group
@param string $end    last segment of group
@param string $after  segment after groups

@return false|array
325101
public function readGroups(string $before, string $start, string $end, string $after)
    {
        // init
        $groups = [];
        $group = [];
        $position = 'before_search';

        foreach ($this->parsedfile as $edi_row) {
            // search before group segment
            if ($position == 'before_search' && $edi_row[0] == $before) {
                $position = 'before_is';
                continue;
            }

            if ($position == 'before_search') {
                continue;
            }

            if ($position == 'before_is' && $edi_row[0] == $before) {
                continue;
            }

            // after before search start
            if ($position == 'before_is' && $edi_row[0] == $start) {
                $position = 'group_is';
                $group[] = $edi_row;
                continue;
            }

            // if after before segment no start segment, search again before segment
            if ($position == 'before_is') {
                $position = 'before_search';
                continue;
            }

            // get group element
            if ($position == 'group_is' && $edi_row[0] != $end) {
                $group[] = $edi_row;
                continue;
            }

            // found end of group
            if ($position == 'group_is' && $edi_row[0] == $end) {
                $position = 'group_finish';
                $group[] = $edi_row;
                $groups[] = $group;
                $group = [];
                continue;
            }

            // next group start
            if ($position == 'group_finish' && $edi_row[0] == $start) {
                $group[] = $edi_row;
                $position = 'group_is';
                continue;
            }

            // finish
            if ($position == 'group_finish' && $edi_row[0] == $after) {
                break;
            }

            $this->errors[] = 'Reading group ' . $before . '/' . $start . '/' . $end . '/' . $after
                              . '. Error on position: ' . $position;

            return false;
        }

        return $groups;
    }
166802
public function getSchoolAdminsAsync($limit = null, $starting_after = null, $ending_before = null)
    {
        return $this->getSchoolAdminsAsyncWithHttpInfo($limit, $starting_after, $ending_before)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }
690125
public function all($includingRead = false, $participating = false, DateTime $since = null, DateTime $before = null)
    {
        $parameters = [
            'all' => $includingRead,
            'participating' => $participating,
        ];

        if ($since !== null) {
            $parameters['since'] = $since->format(DateTime::ISO8601);
        }

        if ($before !== null) {
            $parameters['before'] = $before->format(DateTime::ISO8601);
        }

        return $this->get('/notifications', $parameters);
    }
613675
public function getrange($key, $start, $end) {
        return $this->returnCommand(['GETRANGE'], $key, [$key, $start, $end]);
    }
569794
public function getHtmlErrorCode($pos, $before=30, $after=40)
    {
        return substr($this->_html, $pos-$before, $before+$after);
    }
767138
public function overlaps(\DateTime $start, \DateTime $end) {
    $overlaps = FALSE;

    if ($this->dateIsEarlier($start) &&
      ($this->dateIsInRange($end) || $this->dateIsLater($end))) {
      $overlaps = TRUE;
    } elseif ($this->dateIsInRange($start) &&
      ($this->dateIsInRange($end) || $this->dateIsLater($end))) {
      $overlaps = TRUE;
    }

    return $overlaps;
  }
1236106
public function getRangeUrls($start,$end){

        $urls = Array();

        if($end > $this->totalPages){
            $end = $this->totalPages;
        }//if

        if($start < 1){
            $start = 1;
        }//if

        for($i = $start; $i <= $end; $i++){
            $urls[] = $this->getPageUrl($i);
        }//for

        return $urls;
       
    }
1024825
public function slice( $start, $end ) {
		if ( $start < 0 || ! is_int( $start ) ) {
			throw new InvalidArgumentException( 'Start must be a non-negative integer' );
		}

		if ( $end < 0 || ! is_int( $end ) ) {
			throw new InvalidArgumentException( 'End must be a positive integer' );
		}

		if ( $start > $end ) {
			throw new InvalidArgumentException( 'End must be greater than start' );
		}

		if ( $end > $this->count() + 1 ) {
			throw new InvalidArgumentException( 'End must be less than the count of the items in the Collection' );
		}

		$length = $end - $start + 1;

		return $this->new_from_trusted( array_slice( $this->elements, $start, $length ) );
	}
155268
public function getEmails($start = 0, $range = 10)
    {
        Argument::i()
            ->test(1, 'int')
            ->test(2, 'int');

        $total = $this->getEmailTotal();

        if ($total == 0) {
            return array();
        }

        if (!is_array($start)) {
            $range = $range > 0 ? $range : 1;
            $start = $start >= 0 ? $start : 0;
            $max = $total - $start;

            if ($max < 1) {
                $max = $total;
            }

            $min = $max - $range + 1;

            if ($min < 1) {
                $min = 1;
            }

            $set = $min . ':' . $max;

            if ($min == $max) {
                $set = $min;
            }
        }

        $emails = array();
        for ($i = $min; $i <= $max; $i++) {
            $emails[] = $this->getEmailFormat($this->call('RETR '.$i, true));
        }

        return $emails;
    }
580615
public function between(\DateTime $start, \DateTime $end)
    {
        // Comparing DateTime also looks at the time. So we need to make sure the time is 0,
        // but don't modify the original referenced DateTime parameters
        $start = clone $start;
        $end = clone $end;
        $start->setTime(0, 0, 0);
        $end->setTime(0, 0, 0);

        $startyear = (int) $start->format("Y");
        $endyear   = (int) $end->format("Y");
        $holidays  = array();
        for ($y = $startyear; $y <= $endyear; $y++) {
            $holidays = array_merge($holidays, $this->getHolidays($y));
        }

        return array_filter($holidays,
            function(\DateTime $dt) use ($start, $end) {
                return $dt >= $start && $dt <= $end;
            });
    }
644224
protected function prettyPrint($code, $before = 0, $after = 0)
    {
        $this->offset += $before;

        if ($this->offset < 0) {
            $this->offset = 0;
        }

        $code = str_replace(
            ['\r', '\n', '\t', '\1', '\2'],
            [
                "\n",
                '"\n"',
                str_repeat('    ', $this->offset),
                str_repeat('    ', 1),
                str_repeat('    ', 2)
            ],
            $code
        );

        $this->offset += $after;

        if ($this->offset < 0) {
            $this->offset = 0;
        }

        $code = str_replace('\\' . $this->bars[0], $this->bars[0], $code);
        $code = str_replace('\\' . $this->bars[1], $this->bars[1], $code);

        //''."\n"
        $code = str_replace(' \'\'."\n"', ' "\n"', $code);

        if ($code === '$buffer .= \'\';') {
            return '';
        }

        return $code;
    }
1312009
private function getLanguagesCountFromSessions($start, $end)
    {
        return $this->getCachedVisitors()
            ->filter(function (Visitor $visitor) use ($start, $end) {
                return $visitor->updated_at->between($start, $end) && ! is_null($visitor->language);
            })
            ->transform(function (Visitor $visitor) {
                return $visitor->language;
            })
            ->groupBy('preference')
            ->transform(function (Collection $items, $key) {
                return [
                    'name'  => $key,
                    'count' => $items->count(),
                ];
            })
            ->sortByDesc('count');
    }
384824
public function getDistrictAdminsAsync($limit = null, $starting_after = null, $ending_before = null)
    {
        return $this->getDistrictAdminsAsyncWithHttpInfo($limit, $starting_after, $ending_before)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }
358422
public function listNotifications(bool $all = false, bool $participating = false, string $since = 'now',
                                      string $before = null): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/notifications?:args', http_build_query([
            'all'           => $all,
            'participating' => $participating,
            'since'         => (new DateTime($since))->format(DateTime::ATOM),
            'before'        => (new DateTime($before))->format(DateTime::ATOM)
        ])));
    }
197623
protected function lookForChild($item, $after)
    {
        if (str_contains($after, '.')) {
            $found = [];
            $this->lookInDeep($this->items, $after, $item, $found);
            if (!empty($found)) {
                $this->items[key($found)]->childs = current($found);
                return $item;
            }
        }
        return false;
    }
1292795
public function getTermsAsync($limit = null, $starting_after = null, $ending_before = null)
    {
        return $this->getTermsAsyncWithHttpInfo($limit, $starting_after, $ending_before)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }
1316488
public function getUrlRange($start, $end)
    {
        return collect(range($start, $end))->mapWithKeys(function ($page) {
            return [$page => $this->url($page)];
        })->all();
    }