Add a family connection. This will create a family
 if it does not exist and add a child relationship.
197474
def in_family(family)
      if self.class == Train::Platforms::Family && @name == family
        fail "Unable to add family #{@name} to itself: '#{@name}.in_family(#{family})'"
      end

      # add family to the family list
      family = Train::Platforms.family(family)
      family.children[self] = @condition

      @families[family] = @condition
      @condition = nil
      self
    end
915076
def add_node(self, node):
        """"""
        nodes = sorted(
            self.nodes(),
            key=attrgetter('creation_time'), reverse=True)

        other_nodes = [n for n in nodes if n.id != node.id]

        connecting_nodes = other_nodes[0:(self.n - 1)]

        for n in connecting_nodes:
            n.connect(whom=node)
1372094
public function addRelationshipsInParents()
    {
        $options = config('generators.settings');
        if (!$options['model']) {
            $this->info('Model files not found.');

            return;
        }

        $modelSettings = $options['model'];

        // model names
        $modelOne = $this->getModelName($this->argument('tableOne'));
        $modelTwo = $this->getModelName($this->argument('tableTwo'));

        // model path
        $modelOnePath = $modelSettings['path'] . $modelOne . '.php';
        $modelTwoPath = $modelSettings['path'] . $modelTwo . '.php';

        $this->addRelationshipInModel($modelOnePath, $modelTwo, $this->argument('tableTwo'));
        $this->addRelationshipInModel($modelTwoPath, $modelOne, $this->argument('tableOne'));
    }
814676
def add_child(self, child):
        
        if child.tag in self.contained_children:
            self.children.append(child)
        else:
            raise UNTLStructureException(
                'Invalid child "%s" for parent "%s"' % (
                    child.tag,
                    self.tag
                )
            )
388179
def add_individual(self, individual_object):
        
        ind_id = individual_object.individual_id
        self.logger.info("Adding individual {0}".format(ind_id))
        family_id = individual_object.family
        if family_id != self.family_id:
            raise PedigreeError(self.family, individual_object.individual_id,
                "Family id of individual is not the same as family id for "\
                                    "Family object!")
        else:
            self.individuals[ind_id] = individual_object
            self.logger.debug("Individual {0} added to family {1}".format(
                ind_id, family_id
            ))
        return
266157
def add_node(self, node):
        """"""
        other_nodes = [n for n in self.nodes() if n.id != node.id]
        if len(self.nodes()) > 11:
            parents = [max(other_nodes, key=attrgetter("creation_time"))]
        else:
            parents = [n for n in other_nodes if isinstance(n, Source)]

        for parent in parents:
            parent.connect(whom=node)
1350470
public void addChild(C child) {
        SharedPreferences prefs = loadSharedPreferences("children");

        List<String> objects = getChildrenList();

        Model toPut = (Model) child;

        if (objects.indexOf(toPut.getId()) != ArrayUtils.INDEX_NOT_FOUND) {
            return;
        }

        objects.add(toPut.getId());

        toPut.save();

        prefs.edit().putString(String.valueOf(getId()), StringUtils.join(objects, ",")).commit();
    }
732908
private function addFamilyAndDescendantsToCart(Family $family): void
    {
        $this->addRecordToCart($family);

        foreach ($family->spouses() as $spouse) {
            $this->addRecordToCart($spouse);
        }
        foreach ($family->children() as $child) {
            $this->addRecordToCart($child);
            foreach ($child->spouseFamilies() as $child_family) {
                $this->addFamilyAndDescendantsToCart($child_family);
            }
        }
    }
1318099
def add(self, child):
        

        if isinstance(child, Run):
            self.add_run(child)
        elif isinstance(child, Record):
            self.add_record(child)
        elif isinstance(child, EventRecord):
            self.add_event_record(child)
        elif isinstance(child, DataDisplay):
            self.add_data_display(child)
        elif isinstance(child, DataWriter):
            self.add_data_writer(child)
        elif isinstance(child, EventWriter):
            self.add_event_writer(child)
        else:
            raise ModelError('Unsupported child element')
433665
def add_child(graph, child_id, child_label, parent_id, colour):
    
    node = pydot.Node(child_id, style="filled", fillcolor=colour, label=child_label, shape="polygon", fontname=FONT)
    graph.add_node(node)
    graph.add_edge(pydot.Edge(parent_id, node))
829114
async def add_relation(self, relation1, relation2):
        
        connection = self.connection()
        app_facade = client.ApplicationFacade.from_connection(connection)

        log.debug(
            'Adding relation %s <-> %s', relation1, relation2)

        def _find_relation(*specs):
            for rel in self.relations:
                if rel.matches(*specs):
                    return rel
            return None

        try:
            result = await app_facade.AddRelation([relation1, relation2])
        except JujuAPIError as e:
            if 'relation already exists' not in e.message:
                raise
            rel = _find_relation(relation1, relation2)
            if rel:
                return rel
            raise JujuError('Relation {} {} exists but not in model'.format(
                relation1, relation2))

        specs = ['{}:{}'.format(app, data['name'])
                 for app, data in result.endpoints.items()]

        await self.block_until(lambda: _find_relation(*specs) is not None)
        return _find_relation(*specs)
1058671
async def add_relation(self, local_relation, remote_relation):
        
        if ':' not in local_relation:
            local_relation = '{}:{}'.format(self.name, local_relation)

        return await self.model.add_relation(local_relation, remote_relation)
953063
public void addRelationship(int linkType, Record recLeft, Record recRight, int ifldLeft1, int ifldRight1, int ifldLeft2, int ifldRight2, int ifldLeft3, int ifldRight3)
    {
        String fldLeft1 = recLeft.getField(ifldLeft1).getFieldName();
        String fldRight1 = recRight.getField(ifldRight1).getFieldName();
        String fldLeft2 = ifldLeft2 != -1 ? recLeft.getField(ifldLeft2).getFieldName() : null;
        String fldRight2 = ifldRight2 != -1 ? recRight.getField(ifldRight2).getFieldName() : null;
        String fldLeft3 = ifldLeft3 != -1 ? recLeft.getField(ifldLeft3).getFieldName() : null;
        String fldRight3 = ifldRight3 != -1 ? recRight.getField(ifldRight3).getFieldName() : null;
        new TableLink(this, linkType, recLeft, recRight, fldLeft1, fldRight1, fldLeft2, fldRight2, fldLeft3, fldRight3);
    }
1365493
def add(self, child, name=None, coordinates=None):
        
        if not name:
            name = str(child)

        if name in self.children_by_name:
            raise RuntimeWarning(
                'Child with name {} already in slot, use custom name'.format(
                    name))

        if coordinates:
            child._coordinates = Vector(coordinates)
        child.parent = self
        self.children_by_name[name] = child
        self.children_by_reference[child] = name
664112
def add_child(self, child):
        
        if isinstance(child, BaseCitation):
            self._children.append(child)
437360
def add(self, name, attributes):
        
        if name in self._data:
            raise RelationReferenceError(
                'Relation \'{name}\' already exists.'.format(name=name))
        self._data[name] = attributes[:]
559472
def pclink(self, parent, child):
    """"""
    if parent._children is None:
      parent._children = set()
    if child._parents is None:
      child._parents = set()
    parent._children.add(child)
    child._parents.add(parent)