Add a new mandate request to tree
484059
public function addCreateMandateRequest(string $payerNr, AccountNumber $account, IdInterface $id): void
    {
        $this->mandates[] = new Record(
            'CreateMandateRequest',
            $this->payeeBgNode,
            new Number(0, $payerNr, 'PayerNumber'),
            new Obj(0, $account, 'Account'),
            new Obj(0, $id, 'StateId'),
            new Text(0, str_pad('', 24))
        );
    }
541559
public function addChildAction(ServerRequestInterface $request, Tree $tree): ResponseInterface
    {
        $xref = $request->get('xref', '');

        $individual = Individual::getInstance($xref, $tree);

        Auth::checkIndividualAccess($individual, true);

        $PEDI = $request->get('PEDI', '');

        $this->glevels = $request->get('glevels', []);
        $this->tag     = $request->get('tag', []);
        $this->text    = $request->get('text', []);
        $this->islink  = $request->get('islink', []);

        // Create a family
        if ($individual->sex() === 'F') {
            $gedcom = "0 @@ FAM\n1 WIFE @" . $individual->xref() . '@';
        } else {
            $gedcom = "0 @@ FAM\n1 HUSB @" . $individual->xref() . '@';
        }
        $family = $tree->createFamily($gedcom);

        // Link the parent to the family
        $individual->createFact('1 FAMS @' . $family->xref() . '@', true);

        // Create a child
        $this->splitSource(); // separate SOUR record from the rest

        $gedcom = '0 @@ INDI';
        $gedcom .= $this->addNewName($request, $tree);
        $gedcom .= $this->addNewSex($request);
        $gedcom .= "\n" . GedcomCodePedi::createNewFamcPedi($PEDI, $family->xref());
        if (preg_match_all('/([A-Z0-9_]+)/', $tree->getPreference('QUICK_REQUIRED_FACTS'), $matches)) {
            foreach ($matches[1] as $match) {
                $gedcom .= $this->addNewFact($request, $tree, $match);
            }
        }
        if ((bool) $request->get('SOUR_INDI')) {
            $gedcom = $this->handleUpdates($gedcom);
        } else {
            $gedcom = $this->updateRest($gedcom);
        }

        $child = $tree->createIndividual($gedcom);

        // Link the family to the child
        $family->createFact('1 CHIL @' . $child->xref() . '@', true);

        if ($request->get('goto') === 'new') {
            return redirect($child->url());
        }

        return redirect($individual->url());
    }
584482
public function addSpouseAction(ServerRequestInterface $request, Tree $tree): ResponseInterface
    {
        $xref = $request->get('xref', '');

        $family = Family::getInstance($xref, $tree);

        Auth::checkFamilyAccess($family, true);

        $this->glevels = $request->get('glevels', []);
        $this->tag     = $request->get('tag', []);
        $this->text    = $request->get('text', []);
        $this->islink  = $request->get('islink', []);

        // Create the new spouse
        $this->splitSource(); // separate SOUR record from the rest

        $gedrec = '0 @@ INDI';
        $gedrec .= $this->addNewName($request, $tree);
        $gedrec .= $this->addNewSex($request);
        if (preg_match_all('/([A-Z0-9_]+)/', $tree->getPreference('QUICK_REQUIRED_FACTS'), $matches)) {
            foreach ($matches[1] as $match) {
                $gedrec .= $this->addNewFact($request, $tree, $match);
            }
        }

        if ((bool) $request->get('SOUR_INDI')) {
            $gedrec = $this->handleUpdates($gedrec);
        } else {
            $gedrec = $this->updateRest($gedrec);
        }
        $gedrec .= "\n1 FAMS @" . $family->xref() . '@';
        $spouse = $tree->createIndividual($gedrec);

        // Update the existing family - add marriage, etc
        if ($family->facts(['HUSB'])->first() instanceof Fact) {
            $family->createFact('1 WIFE @' . $spouse->xref() . '@', true);
        } else {
            $family->createFact('1 HUSB @' . $spouse->xref() . '@', true);
        }
        $famrec = '';
        if (preg_match_all('/([A-Z0-9_]+)/', $tree->getPreference('QUICK_REQUIRED_FAMFACTS'), $matches)) {
            foreach ($matches[1] as $match) {
                $famrec .= $this->addNewFact($request, $tree, $match);
            }
        }
        if ((bool) $request->get('SOUR_FAM')) {
            $famrec = $this->handleUpdates($famrec);
        } else {
            $famrec = $this->updateRest($famrec);
        }
        $family->createFact(trim($famrec), true); // trim leading \n

        if ($request->get('goto') === 'new') {
            return redirect($spouse->url());
        }

        return redirect($family->url());
    }
121648
protected function supplementRequestWithDefaults()
    {
        parent::supplementRequestWithDefaults();

        // set or expand with default options
        $this->request->setOptions(array_merge(
            $this->request['options'] ?: [],
            $this->defaults['options'] ?: []
        ));
    }
438584
def extended(self, new_leaves: List[bytes]):
        """"""
        new_tree = self.__copy__()
        new_tree.extend(new_leaves)
        return new_tree
70056
def add_constituency_tree(self,my_tree):
        
        if self.constituency_layer is None:
            self.constituency_layer = Cconstituency()
            self.root.append(self.constituency_layer.get_node())
        self.constituency_layer.add_tree(my_tree)
1265140
function _buildDependencyTreeOf(node) {
		var requireStatements = getRequireStatements(getCode(node.path))
		if (requireStatements.length == 0) {
			return leaves.push(node)
		}
		each(requireStatements, function(requireStatement) {
			var childNode = []
			childNode.path = resolve.requireStatement(requireStatement, node.path)
			childNode.parent = node
			node.push(childNode)
			_buildDependencyTreeOf(childNode)
		})
		node.waitingForNumChildren = node.length
	}
1017314
def update_command(args):
    """"""
    updated = update_requirements_file(
        args.requirements_file, args.skip_packages)

    if updated:
        print('Updated requirements in {}:'.format(args.requirements_file))

        for item in updated:
            print(' * {} from {} to {}.'.format(*item))
    else:
        print('All dependencies in {} are up-to-date.'.format(
            args.requirements_file))
399418
function makeRequire(id, path) {
  var expr = callExpression(identifier('require'), [literal(path)]);
  return makeDeclaration(id, expr);
}
235605
public function addFact(ServerRequestInterface $request, Tree $tree): ResponseInterface
    {
        $xref = $request->get('xref', '');
        $fact = $request->get('fact', '');

        $record = GedcomRecord::getInstance($xref, $tree);
        Auth::checkRecordAccess($record, true);

        $title = $record->fullName() . ' - ' . GedcomTag::getLabel($fact, $record);

        return $this->viewResponse('edit/add-fact', [
            'fact'   => $fact,
            'record' => $record,
            'title'  => $title,
            'tree'   => $tree,
        ]);
    }
806711
function client (root) {
	return {

		tasks: {

			// Create a new task
			create: function (task, done) {
				post(root + 'tasks', task, done);
			},

			// Get all tasks
			get: function (query, done) {
				get(root + 'tasks', query, done);
			},

			// Get results for all tasks
			results: function (query, done) {
				get(root + 'tasks/results', query, done);
			}

		},

		task: function (id) {
			return {

				// Get a task
				get: function (query, done) {
					get(root + 'tasks/' + id, query, done);
				},

				// Edit a task
				edit: function (edits, done) {
					patch(root + 'tasks/' + id, edits, done);
				},

				// Remove a task
				remove: function (done) {
					del(root + 'tasks/' + id, null, done);
				},

				// Run a task
				run: function (done) {
					post(root + 'tasks/' + id + '/run', null, done);
				},

				// Get results for a task
				results: function (query, done) {
					get(root + 'tasks/' + id + '/results', query, done);
				},

				result: function (rid) {
					return {

						// Get a result
						get: function (query, done) {
							get(root + 'tasks/' + id + '/results/' + rid, query, done);
						}

					};
				}

			};
		}

	};
}
1198975
function Request(args) {
  if (false === (this instanceof Request)) throw new Error('new operator required');
  if (typeof args == 'string') {
    var quickType = args;
    args = {};
    args.type = quickType;
  }
  args = args || {};
  this.type = args.type || null;
  if (args.value) // todo spec as optional param
    this.value = args.value;
  if (!this.type || typeof this.type != 'string') throw new Error('Request type required');
  switch (this.type) {
    case 'Command':
      this.command = args.command || null;
      if (!(this.command instanceof Command)) throw new Error('command object required');
      break;
  }
}
164924
function addTaskToFluence(task, done) {
        if (done) {
            done = "1"
        } else {
            done = "0"
        }
        const query = `INSERT INTO ${todoTable} VALUES ('${task}', ${done})`;
        session.request(query).result().then((r) => {
            console.log("task inserted")
        })
    }
711256
def extend(self, api, route="", base_url="", http=True, cli=True, **kwargs):
        """"""
        api = API(api)

        if http and hasattr(api, '_http'):
            self.http.extend(api.http, route, base_url, **kwargs)

        if cli and hasattr(api, '_cli'):
            self.cli.extend(api.cli, **kwargs)

        for directive in getattr(api, '_directives', {}).values():
            self.add_directive(directive)

        for startup_handler in (api.startup_handlers or ()):
            self.add_startup_handler(startup_handler)
706259
private void insertAction(final Element subTree, final QName attName, final Action action) {
        if (subTree == null || action == null) {
            return;
        }

        final LinkedList<Element> queue = new LinkedList<>();

        // Skip the sub-tree root because it has been added already.
        NodeList children = subTree.getChildNodes();
        for (int i = 0; i < children.getLength(); i++) {
            if (children.item(i).getNodeType() == Node.ELEMENT_NODE) {
                queue.offer((Element)children.item(i));
            }
        }

        while (!queue.isEmpty()) {
            final Element node = queue.poll();
            children = node.getChildNodes();
            for (int i = 0; i < children.getLength(); i++) {
                if (children.item(i).getNodeType() == Node.ELEMENT_NODE) {
                    queue.offer((Element)children.item(i));
                }
            }
            if (SUBJECTSCHEME_SUBJECTDEF.matches(node)) {
                final String key = node.getAttribute(ATTRIBUTE_NAME_KEYS);
                if (key != null && !key.trim().isEmpty()) {
                    final FilterKey k = new FilterKey(attName, key);
                    if (!filterMap.containsKey(k)) {
                        filterMap.put(k, action);
                    }
                }
            }
        }
    }
576866
function (opt, handler) {

			var recquire_t = require('aureooms-node-recursive-require');
			var extend = require('node.extend');

			var dflt = {
				name: undefined,
				src: undefined,
				exports: undefined,
				base: 0,
				index: 'index.js',
				intro: 'intro.js',
				outro: 'outro.js',
				rec: false,
				flat: true,
				debug: false
			};

			opt = extend({}, dflt, opt);

			if (opt.name) opt.name = opt.name.replace(/-/g, '');

			var recquire = recquire_t(opt);

			recquire(opt.src, opt.exports, -opt.base, handler);
		}
999237
private void addPostParams(final Request request) {
        if (assetVersions != null) {
            for (String prop : assetVersions) {
                request.addPostParam("AssetVersions", prop);
            }
        }

        if (functionVersions != null) {
            for (String prop : functionVersions) {
                request.addPostParam("FunctionVersions", prop);
            }
        }

        if (dependencies != null) {
            request.addPostParam("Dependencies", dependencies);
        }
    }