Set the author information in the json.

@param array $json    The json data.
@param array $authors The authors to set in the json.

@return array The updated json array.
554537
protected function setAuthors($json, $authors)
    {
        $json['authors'] = [];
        foreach ($authors as $author) {
            list($name, $email) = \explode(' <', $author);

            $config = [
                'name'     => \trim($name),
                'email'    => \trim(\substr($email, 0, -1))
            ];

            if ($this->config->hasMetadata($author, 'homepage')) {
                $config['homepage'] = $this->config->getMetadata($author, 'homepage');
            }

            $config['role'] = $this->config->getMetadata($author, 'role') ?: 'Developer';

            $json['authors'][] = $config;
        }

        return $json;
    }
570121
public function setJSON($json)
    {
        global $CFG;
        $PDOX = $this->launch->pdox;

        $stmt = $PDOX->queryDie(
            "UPDATE {$CFG->dbprefix}lti_result SET json = :json, updated_at = NOW()
                WHERE result_id = :RID",
            array(
                ':json' => $json,
                ':RID' => $this->id)
        );
    }
77301
public static function create(array $json)
    {
        $createMessageResponse = new CreateMessageResponse();
        $createMessageResponse->setStatusCode($json['status_code']);
        $createMessageResponse->setStatusMessage($json['status_message']);

        // If a 'response' is provided
        if (array_key_exists('response', $json) && isset($json['response'])) {
            $createMessageResponseResponse = new CreateMessageResponseResponse();

            // If 'Messages' are provided
            if (array_key_exists('Messages', $json['response'])) {
                $createMessageResponseResponse->setMessages($json['response']['Messages']);
            }

            $createMessageResponse->setResponse($createMessageResponseResponse);
        }

        return $createMessageResponse;
    }
886127
public function validate($tables, $json)
    {

        /** @var \LaravelRocket\Generator\Validators\BaseRule[] $tableRules */
        $tableRules = [
            new TableName(),
            new PrimaryKeyName(),
        ];

        /** @var \LaravelRocket\Generator\Validators\BaseRule[] $columnRules */
        $columnRules = [
            new ColumnName(),
            new AvoidLongVarChar(),
            new AvoidDateTime(),
            new GenderWithVarChar(),
        ];

        $success = true;
        $errors  = [];

        foreach ($tables as $table) {
            foreach ($tableRules as $rule) {
                list($ruleSuccess, $ruleErrors) = $rule->validate(['table' => $table]);
                if (!$ruleSuccess) {
                    $success = false;
                }
                $errors = array_merge($errors, $ruleErrors);
            }

            foreach ($table->getColumns() as $column) {
                foreach ($columnRules as $rule) {
                    list($ruleSuccess, $ruleErrors) = $rule->validate(['table' => $table, 'column' => $column]);
                    if (!$ruleSuccess) {
                        $success = false;
                    }
                    $errors = array_merge($errors, $ruleErrors);
                }
            }
        }

        return [$success, $errors];
    }
688880
public function setAuthor($author)
    {
        if (!is_null($author) && !$author instanceof ComActivitiesActivityObjectInterface) {
            throw new InvalidArgumentException('Invalid author type.');
        }

        $this->author = $author;
        return $this;
    }
112214
public function setAuthors($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->authors = $arr;

        return $this;
    }
514627
public static function create(array $json)
    {
        $setBadgeResponse = new SetBadgeResponse();
        $setBadgeResponse->setStatusCode($json['status_code']);
        $setBadgeResponse->setStatusMessage($json['status_message']);

        return $setBadgeResponse;
    }
549423
public function post(array $guests): array
    {
        $options = ['json' => ['guests' => $guests]];

        /** @var JsonStream $stream */
        $stream = $this->client
            ->post(KintoneApi::generateUrl('guests.json'), $options)
            ->getBody();

        return $stream->jsonSerialize();
    }
999130
public static function jsonDeserialize(array $json): DocumentSerializationInterface
    {
        $managerClass = $json['document_serialization']['manager_class'];
        $data = (array) $json['document_serialization']['data'];

        return new self($managerClass, $data);
    }
526357
public void setAuthors(FSArray v) {
    if (Header_Type.featOkTst && ((Header_Type)jcasType).casFeat_authors == null)
      jcasType.jcas.throwFeatMissing("authors", "de.julielab.jules.types.Header");
    jcasType.ll_cas.ll_setRefValue(addr, ((Header_Type)jcasType).casFeatCode_authors, jcasType.ll_cas.ll_getFSRef(v));}
1132630
protected function parse_json( $json ) {

		$data = json_decode( $json, true );

		if ( ! is_array( $data ) ) {
			$data = array();
		}

		return $data;
	}
220206
public static function set_Json( $json, $inputValidate )
    {
        if( $json instanceof Json ) {
            return $json;
        } elseif( null === $json ) {
            return null;
        } elseif ( !is_string($json) ) {
            return Json::makeFromObject( $json );
        }

        return new Json( $json, $inputValidate );
    }
395416
protected function jsonResponse($json)
    {
        $this->set('json', $json);
        $this->viewBuilder()->setLayout(false);
        $this->addCorsHeaders();
        $this->response = $this->response->withType('json');
    }
1156454
def authors_json(soup):
    """"""
    authors_json_data = []
    contributors_data = contributors(soup, "full")
    author_contributions_data = author_contributions(soup, None)
    author_competing_interests_data = competing_interests(soup, None)
    author_correspondence_data = full_correspondence(soup)
    authors_non_byline_data = authors_non_byline(soup)
    equal_contributions_map = map_equal_contributions(contributors_data)
    present_address_data = present_addresses(soup)
    foot_notes_data = other_foot_notes(soup)

    # First line authors builds basic structure
    for contributor in contributors_data:
        author_json = None
        if contributor["type"] == "author" and contributor.get("collab"):
            author_json = author_group(contributor, author_contributions_data,
                                       author_correspondence_data, author_competing_interests_data,
                                       equal_contributions_map, present_address_data,
                                       foot_notes_data)
        elif contributor.get("on-behalf-of"):
            author_json = author_on_behalf_of(contributor)
        elif contributor["type"] == "author" and not contributor.get("group-author-key"):
            author_json = author_person(contributor, author_contributions_data,
                                        author_correspondence_data, author_competing_interests_data,
                                        equal_contributions_map, present_address_data, foot_notes_data)

        if author_json:
            authors_json_data.append(author_json)

    # Second, add byline author data
    collab_map = collab_to_group_author_key_map(contributors_data)
    for contributor in [elem for elem in contributors_data if elem.get("group-author-key") and not elem.get("collab")]:
        for group_author in [elem for elem in authors_json_data if elem.get('type') == 'group']:
            group_author_key = None
            if group_author["name"] in collab_map:
                group_author_key = collab_map[group_author["name"]]
            if contributor.get("group-author-key") == group_author_key:
                author_json = author_person(contributor, author_contributions_data,
                                            author_correspondence_data, author_competing_interests_data,
                                            equal_contributions_map, present_address_data, foot_notes_data)
                if contributor.get("sub-group"):
                    if "groups" not in group_author:
                        group_author["groups"] = OrderedDict()
                    if contributor.get("sub-group") not in group_author["groups"]:
                        group_author["groups"][contributor.get("sub-group")] = []
                    group_author["groups"][contributor.get("sub-group")].append(author_json)
                else:
                    if "people" not in group_author:
                        group_author["people"] = []
                    group_author["people"].append(author_json)

    authors_json_data_rewritten = elifetools.json_rewrite.rewrite_json("authors_json", soup, authors_json_data)
    return authors_json_data_rewritten
1339685
public function index()
    {
        return json()->setMeta($this->meta)->withPagination(
            $this->model->with('books')->latest()->paginate(5),
            new AuthorTransformer
        );
    }
311619
public function setAuthor($author)
    {
        if (!empty($author)) {
            Yii::$app->view->registerMetaTag(['name' => 'author', 'content' => $author], 'author');
        }
        return $this;
    }
454302
def author_name_from_json(author_json):
    ""
    author_name = None
    if author_json.get('type'):
        if author_json.get('type') == 'group' and author_json.get('name'):
            author_name = author_json.get('name')
        elif author_json.get('type') == 'person' and author_json.get('name'):
            if author_json.get('name').get('preferred'):
                author_name = author_json.get('name').get('preferred')
    return author_name