Parse raw data.

@param  string  $raw

@return array
558927
private static function parseRawData($raw)
    {
        $pattern = '/\['.REGEX_DATE_PATTERN.' '.REGEX_TIME_PATTERN.'\].*/';
        preg_match_all($pattern, $raw, $headings);
        $data    = preg_split($pattern, $raw);

        if ($data[0] < 1) {
            $trash = array_shift($data);
            unset($trash);
        }

        return [$headings, $data];
    }
115820
protected function parseArray($data)
    {
        $pattern = '/(\[[^\[\]]*\])/';

        set_error_handler([__CLASS__, 'handleError']);

        while (true) {
            if (!preg_match($pattern, $data, $matches) > 0) {
                break;
            }

            $stringMatches = trim($matches[0]);

            $items = explode(',', $stringMatches);

            $currentData = $this->filterItems($items);


            $data = str_replace($stringMatches, serialize($currentData), $data);
        }

        $result = unserialize($data);

        restore_error_handler();

        return $result;
    }
817378
private function parse(array $data)
    {
        $result = array();

        foreach ($data as $index => $array) {
            if ($this->serializer->isSerialized($array[ConstProviderInterface::CACHE_PARAM_VALUE])) {
                $array[ConstProviderInterface::CACHE_PARAM_VALUE] = $this->serializer->unserialize($array[ConstProviderInterface::CACHE_PARAM_VALUE]);
            }

            $result[$array[ConstProviderInterface::CACHE_PARAM_KEY]] = array(
                ConstProviderInterface::CACHE_PARAM_VALUE => $array[ConstProviderInterface::CACHE_PARAM_VALUE], 
                ConstProviderInterface::CACHE_PARAM_TTL => $array[ConstProviderInterface::CACHE_PARAM_TTL], 
                ConstProviderInterface::CACHE_PARAM_CREATED_ON => $array[ConstProviderInterface::CACHE_PARAM_CREATED_ON]
            );
        }

        return $result;
    }
161607
public function retrieveAll($raw = false)
    {
        if ($cache = $this->loadCache()) {
            if (!$raw) {
                $results = [];
                foreach ($cache as $key => $value) {
                    $results[$key] = unserialize($value['data']);
                }
                return $results;
            } else {
                return $cache;
            }
        }
        return null;
    }
300800
public function parse($rawData) {
        $rawData = trim($rawData);

        $start = substr($rawData, 0, 4);
        if ($start === '<!--') {
            $stop = '-->';
        } elseif (substr($start, 0, 2) === '/*') {
            $start = '/*';
            $stop = '*/';
        } else {
            return [];
        }

        $meta = trim(substr($rawData, strlen($start), strpos($rawData, $stop) - (strlen($stop) + 1)));
        try {
            $meta = Yaml::parse($meta);//$this->parsePhileFormat($meta);
            $meta = ($meta === null) ? [] : $this->convertKeys($meta);
        } catch (ParseException $e) {
            printf("Unable to parse the YAML string: %s<br>", $e->getMessage());
        }
        return $meta;
    }
1320320
public function load($raw)
    {
        foreach (LogParser::parse($raw) as $entry) {
            list($level, $header, $stack) = array_values($entry);

            $this->push(new LogEntry($level, $header, $stack));
        }

        return $this;
    }
211208
public function decode($data): array
    {
        $headerVar = $this->getHeaderField();
        $bodyVar = $this->getBodyField();
        $rawVar = $this->getRawField();

        // Define empty content
        $content = [
            $headerVar => [],
            $bodyVar => ''
        ];

        $headerRegex = "/^---\n(.+?)\n---\n{0,}(.*)$/uis";

        // Normalize line endings to Unix style.
        $data = preg_replace("/(\r\n|\r)/", "\n", $data);

        // Parse header.
        preg_match($headerRegex, ltrim($data), $matches);
        if(empty($matches)) {
            $content[$bodyVar] = $data;
        } else {
            // Normalize frontmatter.
            $frontmatter = preg_replace("/\n\t/", "\n    ", $matches[1]);
            if ($rawVar) {
                $content[$rawVar] = $frontmatter;
            }
            $content[$headerVar] = $this->getHeaderFormatter()->decode($frontmatter);
            $content[$bodyVar] = $matches[2];
        }

        return $content;
    }
759174
public function get()
    {
        if (empty($this->raw_data)) {
            return array();
        }

        $regexp = '/(' . preg_quote(self::SEPARATOR_ELEMENT, '/')
            . '|' . preg_quote(self::SEPARATOR_ITEM, '/') . '[0-9]+' . preg_quote(self::SEPARATOR_LEVEL, '/')
            .')/';

        return preg_split($regexp, $this->raw_data);
    }
291978
protected function handleResponse($raw){
        $data = json_decode($raw,true);

        if(!empty($data["error"])){
            $reason = $data["error"]["errors"][0]["reason"];
            $msg    = $data["error"]["errors"][0]["message"];

            switch ($reason) {
                case 'keyInvalid':
                    throw new GoogleAuthException;
                    break;

                default:
                    throw new GoogleErrorException("Reason: {$reason}. Message: {$msg}.");
                    break;
            }
        }

        return $data;
    }
71800
protected function parseData($dataRaw) {
		$data = [];
		
		foreach ($dataRaw as $key => $value) {
			$data = array_replace_recursive($data, $this->parseKey($key, $value));
		}
		
		return $data;
	}
225015
protected function parseRaw($raw) {
		$info = preg_split("/\s+/", $raw, 9);
		$stat = array();

		$stat['name'] = join(" ", array_slice($info, 3, 9));
		$stat['read'] = true;
		if ($info[2] == '<DIR>')
		{
			$stat['size'] = 0;
			$stat['mime'] = 'directory';
		}
		else
		{
			$stat['size'] = $info[2];
			$stat['mime'] = $this->mimetype($stat['name']);
		}

		return $stat;
	}
1064595
protected static function rawData( $object )
    {
        if ( is_object( $object ) )
        {
            $hash = spl_object_hash( $object );

            if ( isset( self::$rawCheck[$hash] ) )
            {
                return array( '#recursion#' => $hash );
            }

            self::$rawCheck[$hash] = true;
        }

        $object = (array) $object;

        foreach ( $object as $key => $value )
        {
            if ( is_array( $value ) || is_object( $value ) )
            {
                $object[$key] = self::rawData( $value );
            }
        }

        return (object) $object;
    }
1333025
public function whereRaw($raw)
    {
        return $this->where(($raw instanceof Expr\Raw) ? $raw : new Expr\Raw($raw), null, Cmp::RAW);
    }
613397
public function convert_to_array($raw_data)
	{
		$xml = new \SimpleXMLElement($raw_data);
		$xml->registerXPathNamespace(
			self::XML_NAMESPACE,
			self::XML_NAMESPACE_URL
		);

		$data = $xml->xpath(self::XPATH_CURRENCY);
		$currencies = array();

		foreach ($data as $currency)
		{
			$currencies[ (string) $currency->attributes()->currency] = (string) $currency->attributes()->rate;
		}

		return $currencies;
	}
278648
public function decode($data)
    {
        $result = [];
        $offset = 0;
        $length = strlen($data);
        while ($offset < $length)
        {
            if (!strstr(substr($data, $offset), '|'))
            {
                return [];
            }
            $pos = strpos($data, '|', $offset);
            $num = $pos - $offset;
            $varname = substr($data, $offset, $num);
            $offset += $num + 1;
            $dataItem = unserialize(substr($data, $offset));
            $result[$varname] = $dataItem;
            $offset += strlen(serialize($dataItem));
        }
        return $result;
    }
619584
def parse_raw(self, raw):
        """"""
        if not isinstance(raw, bytes):
            raise PyVLXException("AliasArray::invalid_type_if_raw", type_raw=type(raw))
        if len(raw) != 21:
            raise PyVLXException("AliasArray::invalid_size", size=len(raw))
        nbr_of_alias = raw[0]
        if nbr_of_alias > 5:
            raise PyVLXException("AliasArray::invalid_nbr_of_alias", nbr_of_alias=nbr_of_alias)
        for i in range(0, nbr_of_alias):
            self.alias_array_.append((raw[i*4+1:i*4+3], raw[i*4+3:i*4+5]))
390399
public function raw(string $offset)
    {
        isset($this->keys[$offset])
            || Exception::unknownProperty($offset);
        if (isset($this->raw[$offset])) {
            return $this->raw[$offset];
        }
        return $this->items[$offset];
    }