Compress a row of ASCII hexadecimal data.

@param string $row
@param string $lastRow
@return string
167503
protected function compress(string $row, ?string $lastRow): string
    {
        if ($row === $lastRow) {
            return ':';
        }

        $row = $this->compressTrailingZerosOrOnes($row);
        $row = $this->compressRepeatingCharacters($row);

        return $row;
    }
1073744
public function &LastRow($DatasetType = FALSE) {
      $Result = &$this->Result($DatasetType);
      if (count($Result) == 0)
         return $this->_EOF;

      return $Result[count($Result) - 1];
   }
717930
private function getFilteredRow($row)
    {
        $newRow = array();

        foreach ($row as $column => $value) {
            if (in_array($column, $this->columns)) {
                $newRow[$column] = $value;
            }
        }

        return $newRow;
    }
174239
protected static function transformRow($row)
    {
        foreach ($row as $key => $value) {
            if ($value instanceof DateTime) {
                $row[$key] = $value->format('Y-m-d H:i:s');
            } else {
                if (is_object($value)) {
                    $row[$key] = (string) $value;
                } else {
                    $row[$key] = $value;
                }
            }
        }

        return $row;
    }
1043081
protected function calculateRowHeight($row)
    {
        $rowsPerCell = array_map(function ($size, $columnWidth) {
            if (is_array($columnWidth)) {
                $rows = 0;
                foreach ($columnWidth as $width) {
                    $rows += ceil($width / ($size - 2));
                }

                return $rows;
            }

            return ceil($columnWidth / ($size - 2));
        }, $this->_columnWidths, array_map(function ($val) {
            if (is_array($val)) {
                $encodings = array_fill(0, count($val), $this->app->encoding);
                return array_map('mb_strwidth', $val, $encodings);
            }

            return mb_strwidth($val, $this->app->encoding);
        }, $row)
        );

        return max($rowsPerCell);
    }
855764
public function getColumnValue(Row $row)
	{
		$value = parent::getColumnValue($row);

		if (!($value instanceof DateTime)) {
			/**
			 * Try to convert string to DateTime object
			 */
			try {
				$date = DateTimeHelper::tryConvertToDateTime($value);

				return $date->format($this->format);
			} catch (DataGridDateTimeHelperException $e) {
				/**
				 * Otherwise just return raw string
				 */
				return $value;
			}
		}

		return $value->format($this->format);
	}
741545
public function marshal($row)
    {
        foreach ($this->_props as $key=>$prop) {
            if (isset($row[$key])) {
                $row[$key] = $prop->type->marshal($row[$key]);
            }
        }

        return $row;
    }
551968
protected function sanitiseRow($table, $row)
    {
        $data = [];

        foreach ($this->keys[$table] as $key) {
            $data[$key] = isset($row[$key]) ? $row[$key] : null;
        }

        return $data;
    }
524792
public function getSubmitMessage($row)
    {
        $message = '';
        if ($this->getFormField()->getFieldLabel()) {
            $message .= $this->getFormField()->getFieldLabel().': ';
        }
        $t = strtotime($row->{$this->getFormField()->getName()});
        $message .= date($this->getData()->trlKwf('Y-m-d'), $t);
        return $message;
    }
493685
public function prepareData($row)
    {
        if (!$row) {
            return $row;
        }

        if (!is_array($row)) {
            $row = $this->serializer->serialize($row, 'array', SerializationContext::create()->setSerializeNull(true));
        }

        foreach ($row as $key => $value) {
            if ($value instanceof \DateTime) {
                $row[$key] = $value->format(\DateTime::RFC3339);
            } elseif (is_bool($value)) {
                $row[$key] = true === $value ? 1 : 0;
            } elseif (is_array($value) || is_object($value)) {
                $row[$key] = json_encode($value);
            }
        }

        return $row;
    }
1000291
public function getRow(int $row) : BufferedSQLResultRow {
		if (\array_key_exists($row, $this->rows)) {
			return $this->rows[$row];
		} else {
			throw new \OutOfBoundsException('Row ' . $row . ' does not exist in SQL result');
		}
	}
903591
public function col_note($row) {
        if ($this->is_downloading()) {
            return $row->note;
        } else {
            return format_text($row->note, FORMAT_MOODLE);
        }
    }
580806
public static Span exact(CharSequence row) {
    Objects.requireNonNull(row);
    return exact(Bytes.of(row));
  }
260558
public function row($r, $last = false)
	{
		$this->_strategy->output($this->beginRow());
		
		$values = array_values($r);
		$valuesl = count($values);
		
		for ( $i = 0 ; $i < $valuesl ; $i++ )
			$this->column($values[$i], $i+1 == $valuesl);
		
		$this->_strategy->output($this->endRow() . ($last ? '' : $this->rowSeparator()));
	}
35539
protected function cleanupRow($row)
    {
        foreach ($row as $key => $column) {
            if ($this->isQuoted($column)) {
                $column = $this->unescape($this->unquote($column));
            }
            if ($this->isSerialized($column)) {
                $column = $this->unserialize($column);
            }
            if ('N;' === $column) {
                $column = null;
            }
            $row[$key] = $column;
        }

        return $row;
    }
223215
private function buildFile($row)
    {
        $file = new File(
            new FileId($row['id']),
            new FileName($row['name'] . '.' . $row['extension']),
            new FileMimeType($row['mime_type'])
        );

        $createdOn = new \DateTimeImmutable($row['created_on']);
        $updatedOn = new \DateTimeImmutable($row['updated_on']);

        $file = $this->set($file, 'createdOn', $createdOn);
        $file = $this->set($file, 'updatedOn', $updatedOn);

        return $file;
    }
397430
private function write(array $row)
    {
        if ($this->encodingFrom !== null && $this->encodingTo !== null) {
            foreach ($row as $k => $v) {
                $row[$k] = iconv($this->encodingFrom, $this->encodingTo, $v);
            }
        }

        return fputcsv($this->handle, $row, $this->delimiter, $this->enclosure, $this->escape);
    }