Set data from readme.txt.
Prefer changelog from CHANGES.md.

@param array $readme Array of parsed readme.txt data.

@return bool
336754
protected function set_readme_info( $readme ) {
		foreach ( (array) $this->type->sections as $section => $value ) {
			if ( 'description' === $section ) {
				continue;
			}
			$readme['sections'][ $section ] = $value;
		}

		$readme['remaining_content'] = ! empty( $readme['remaining_content'] ) ? $readme['remaining_content'] : null;
		if ( empty( $readme['sections']['other_notes'] ) ) {
			unset( $readme['sections']['other_notes'] );
		} else {
			$readme['sections']['other_notes'] .= $readme['remaining_content'];
		}
		unset( $readme['sections']['screenshots'], $readme['sections']['installation'] );
		$readme['sections']       = ! empty( $readme['sections'] ) ? $readme['sections'] : [];
		$this->type->sections     = array_merge( (array) $this->type->sections, (array) $readme['sections'] );
		$this->type->tested       = isset( $readme['tested'] ) ? $readme['tested'] : null;
		$this->type->requires     = isset( $readme['requires'] ) ? $readme['requires'] : null;
		$this->type->requires_php = isset( $readme['requires_php'] ) ? $readme['requires_php'] : null;
		$this->type->donate_link  = isset( $readme['donate_link'] ) ? $readme['donate_link'] : null;
		$this->type->contributors = isset( $readme['contributors'] ) ? $readme['contributors'] : null;

		return true;
	}
446241
def readme_template(readme_template_file):
    """"""
    if not readme_template_file:
        click.secho(dtool_config.utils.get_readme_template_fpath(
            CONFIG_PATH,
        ))
    else:
        click.secho(dtool_config.utils.set_readme_template_fpath(
            CONFIG_PATH,
            readme_template_file
        ))
403536
public static function setConfigName($configName)
    {
        if (self::$configName != $configName)
        {
            self::$mimeTypes = [];
        }
        self::$configName = $configName;
    }
233030
public function set(array $data)
    {
        $this->data = [];
        $this->replace = false;

        foreach ($data as $key => $value) {
            $this->add($key, $value);
        }
    }
934827
public function setReadPreference($readPreference, array $tags = null)
    {
        $this->initialize();
        if (isset($tags)) {
            return $this->riakClient->setReadPreference($readPreference, $tags);
        }

        return $this->riakClient->setReadPreference($readPreference);
    }
314406
public function setMetadata($mailbox, $entries)
    {
        if (!is_array($entries) || empty($entries)) {
            $this->setError(self::ERROR_COMMAND, "Wrong argument for SETMETADATA command");
            return false;
        }

        foreach ($entries as $name => $value) {
            $entries[$name] = $this->escape($name) . ' ' . $this->escape($value, true);
        }

        $entries = implode(' ', $entries);
        $result = $this->execute('SETMETADATA', array(
            $this->escape($mailbox), '(' . $entries . ')'),
            self::COMMAND_NORESPONSE);

        return ($result == self::ERROR_OK);
    }
522161
def update_readme(self, content):
        """"""
        logger.debug("Updating readme")
        key = self.get_readme_key()

        # Back up old README content.
        backup_content = self.get_readme_content()
        backup_key = key + "-{}".format(
            timestamp(datetime.datetime.now())
        )
        logger.debug("README.yml backup key: {}".format(backup_key))
        self.put_text(backup_key, backup_content)

        self.put_text(key, content)
1036452
public function setMime($mime)
    {
        if (!empty($mime)) {
            $this->setContentType(
                Mime::getFullMime($mime)
            );
        }

        return $this;
    }
1197959
public function setPhrase($phrase) {
		if(!$this->setModified('phrase', $phrase)->isModified()) {
			return $this;
		}
		$this->phrase = $phrase;
		return $this;
	}
777801
protected function setMetadata(array $metadata)
    {
        if ($metadata && $this->supportsMetadata()) {
            $this->filesystem->getAdapter()->setMetadata($this->key, $metadata);

            return true;
        }

        return false;
    }
225839
private function setMetadata(array $metadata)
    {
        foreach($metadata as $key => &$partial) {
            $this->assertArrayOrScalar($partial, $key);
        }

        $this->metadata = new ArrayReader($metadata);
    }
1367304
public function setFilemtime($file, $filemtime)
    {
        $this->readMetadataFile();

        $this->metadata[$file]['mt'] = $filemtime;

        return $this;
    }
514946
public function setText($data)
    {
        if (empty($data)) {
            throw new Exception('You must not call MimeMailParser::setText with an empty string parameter');
        }

        if (substr($data, -1) != "\n") {
            $data = $data.PHP_EOL;
        }

        $this->resource = mailparse_msg_create();
        // does not parse incrementally, fast memory hog might explode
        mailparse_msg_parse($this->resource, $data);
        $this->data = $data;
        $this->parse();

        return $this;
    }
1364742
public function setModel($m)
    {
        if (is_string($m)) {
            $m = 'Model_'.$m;
        }
        $this->model = $this->add($m);

        return $this->model;
    }
209526
public function setCache(array $data)
    {
        $handle = $this->handle;

        $rows = $handle->query('SELECT created FROM `' . $this->config['table'].'`');

        if (!$rows || $rows->rowCount() === 0) {

            $this->write($handle, $data);
        } else {

            foreach ($rows as $row) {

                if ((time()-strtotime($row['created'])) >
                    $this->config['expiration_time']) {

                    $this->write($handle, $data);
                }
            }
        }

        return $this;
    }
220319
public function setReadPreference($readPreference, array $tags = null)
    {
        if (isset($tags)) {
            return $this->mongoDB->setReadPreference($readPreference, $tags);
        }

        return $this->mongoDB->setReadPreference($readPreference);
    }
123215
public function set(string $key, array $data): bool
    {
        if (! $this->isCreate()) {
            throw new Exception\RuntimeException('Memory table have not been create');
        }
        return $this->getTable()->set($key, $data);
    }