addLink adds the inheritance link between role: name1 and role: name2.
aka role: name1 inherits role: name2.
domain is a prefix to the roles.
14614
@Override
    public void addLink(String name1, String name2, String... domain) {
        if (domain.length == 1) {
            name1 = domain[0] + "::" + name1;
            name2 = domain[0] + "::" + name2;
        } else if (domain.length > 1) {
            throw new Error("error: domain should be 1 parameter");
        }

        Role role1 = createRole(name1);
        Role role2 = createRole(name2);
        role1.addRole(role2);
    }
679414
protected void addAttributes(final boolean _inherited,
                                 final Attribute... _attributes)
        throws CacheReloadException
    {
        for (final Attribute attribute : _attributes) {
            if (!this.attributes.containsKey(attribute.getName())) {
                Type.LOG.trace("adding Attribute:'{}' to type: '{}'", attribute.getName(), getName());
                // evaluate for type attribute
                if (attribute.getAttributeType().getClassRepr().equals(TypeType.class)) {
                    this.typeAttributeName = attribute.getName();
                } else if (attribute.getAttributeType().getClassRepr().equals(StatusType.class) && !_inherited) {
                    // evaluate for status, an inherited attribute will not
                    // overwrite the original attribute
                    this.statusAttributeName = attribute.getName();
                } else if (attribute.getAttributeType().getClassRepr().equals(CompanyLinkType.class)
                                || attribute.getAttributeType().getClassRepr().equals(ConsortiumLinkType.class)) {
                    // evaluate for company
                    this.companyAttributeName = attribute.getName();
                } else if (attribute.getAttributeType().getClassRepr().equals(GroupLinkType.class)) {
                    // evaluate for group
                    this.groupAttributeName = attribute.getName();
                }
                this.attributes.put(attribute.getName(), attribute);
                if (attribute.getTable() != null) {
                    this.tables.add(attribute.getTable());
                    attribute.getTable().addType(getId());
                    if (getMainTable() == null) {
                        setMainTable(attribute.getTable());
                    }
                }
                setDirty();
            }
        }
    }
26187
public function addParentRole(Role $parentRole)
    {
        if (!$this->hasParentRole($parentRole)) {
            $parentRoleIdentifier = $parentRole->getIdentifier();
            $this->parentRoles[$parentRoleIdentifier] = $parentRole;
        }
    }
691069
function linkto(parentState, longname, name) {

    if (!!longname && longname !== '') {
        return '<a ui-sref="jsdoc.' + parentState + "({anchor:'" + longname.replace('module:', '') + "'})" + '">' + name + '</a>';
    }
    return '<a ui-sref="jsdoc.' + parentState + '">' + name + '</a>';
    
}
150266
def role_and_interface_to_relations(role, interface_name):
    
    _metadata = metadata()
    results = []
    for relation_name, relation in _metadata.get(role, {}).items():
        if relation['interface'] == interface_name:
            results.append(relation_name)
    return results
1053375
private function getLinkRoleDescription( $role, $roleType, $roleTitle )
	{
		$href = parse_url( $role['href'] );
		$basename = basename( $href['path'] );
		$roleTypes = $this->getRoleTypes( $role['href'] );
		if ( $roleTypes === false )
		{
			$this->log()->warning( "A role type cannot be found for '$basename'" );
			return false;
		}

		if ( ! isset( $roleTypes[ $roleType ] ) )
		{
			$this->log()->warning( "The role type corresponding to href '$basename' does not include one used on a $roleTitle.'" );
			return false;
		}

		$linkRoleType = $roleTypes[ $roleType ];
		if ( ! isset( $linkRoleType[ $role['roleUri'] ] ) )
		{
			$fragment = isset( $href['fragment'] ) ? $href['fragment'] : "";
			$this->log()->warning( "The $roleTitle of the role type corresponding to href '$basename' does not include an Id with fragment '$fragment'." );
			return false;
		}

		$link = $linkRoleType[ $role['roleUri'] ];
		return isset( $link['definition'] ) ? trim( $link['definition'] ) : $role['roleUri'];
	}
323916
public function addRole($name)
    {
        $namespaceUri = $this->dom->lookupNamespaceUri($this->dom->namespaceURI);

        $roleNode = $this->dom->createElementNS($namespaceUri, 'Role');
        $roleNode->setAttribute('name', $name);

        $instancesNode = $this->dom->createElementNS($namespaceUri, 'Instances');
        $instancesNode->setAttribute('count', '2');

        $configurationSettings = $this->dom->createElementNS($namespaceUri, 'ConfigurationSettings');

        $roleNode->appendChild($instancesNode);
        $roleNode->appendChild($configurationSettings);

        $this->dom->documentElement->appendChild($roleNode);

        $this->save();
    }
1313089
def link_add(self, rel, href, **atts):
        
        self.link_set(rel, href, allow_duplicates=True, **atts)
894460
def _linkToParent(self, feature, parentName):
        
        parentParts = self.byFeatureName.get(parentName)
        if parentParts is None:
            raise GFF3Exception(
                "Parent feature does not exist: {}".format(parentName),
                self.fileName)
        # parent maybe disjoint
        for parentPart in parentParts:
            feature.parents.add(parentPart)
            parentPart.children.add(feature)
419674
@Override
    public void addRole(final String role) {
        CommonHelper.assertNotBlank("role", role);
        this.roles.add(role);
    }
1104194
def add(self, roles):
        
        return self._client.post(
            url=self._client.get_full_url(
                self.get_path(
                    'single', realm=self._realm_name, id=self._user_id
                )
            ),
            data=json.dumps(roles, sort_keys=True)
        )
172898
public synchronized void addRoleMapping(final String roleName) {
        HashMap<String, RoleMappingImpl> newRoles = new HashMap<String, RoleMappingImpl>(roleMappings);
        if (newRoles.containsKey(roleName) == false) {
            newRoles.put(roleName, new RoleMappingImpl(roleName));
            roleMappings = Collections.unmodifiableMap(newRoles);
        }
    }
639403
public function inherit($roles, $inherits) {

		if(true === is_string($roles)) {
			$roles = [$roles];
		}

		if(true === is_string($inherits)) {
			$inherits = [$inherits];
		}

		if(false === is_array($roles)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string or array, "%s" given', __METHOD__, gettype($roles)), E_USER_ERROR);
		}

		if(false === is_array($inherits)) {
			return trigger_error(sprintf('Argument 2 passed to %s() must be of the type string or array, "%s" given', __METHOD__, gettype($inherits)), E_USER_ERROR);
		}

		foreach($inherits as $inherit) {

			if(true === isset($this -> permissions[$inherit])) {

				foreach($this -> permissions[$inherit] as $resource => $allowed) {

					foreach($roles as $role) {
						$this -> fill($role, $resource, $allowed);
					}
				}

			}
		}

		return $this; 
	}
192616
def add_child(role, &block)
      attachment = self.children.build
      attachment.role = role
      attachment.owner = self.owner
      attachment.file_name = self.file_name
      attachment.file_type = self.file_type
      attachment.disposition = self.disposition
      attachment.cache_type = self.cache_type
      attachment.cache_max_age = self.cache_max_age
      attachment.type = self.type
      block.call(attachment)
      attachment.save!
    end
927873
function _default(base, link) {
  // Dynamic stuff:
  if (typeof link !== "string" || link.match(REGEX_DYNAMIC)) {
    return base;
  } // Link is absolute:


  if (link.match(REGEX_ABSOLUTE)) {
    try {
      const parsedBase = parseLink(base);
      const parsedLink = parseLink(link); // Both `base` and `link` are on different domains:

      if (parsedBase.domain !== parsedLink.domain) {
        return false;
      } // Absolute path from same domain:


      if (parsedLink.path) {
        return (0, _url.resolve)(base, parsedLink.path);
      } // Same domains without path:


      return (0, _url.parse)(base).href;
    } catch (err) {
      return false;
    }
  } // Relative stuff:


  return regenerateLink(base, link);
}
143825
function addRolePrivilege (access, role, privilege) {
  if (role === true || access[privilege].role === true) {
    access[privilege] = {
      role: true
    }
    return
  }

  access[privilege].role = _.union(access[privilege].role, _.concat(role))
}
431902
def add_link(self, name, desc, layout, node_1, node_2):
        

        existing_link = get_session().query(Link).filter(Link.name==name, Link.network_id==self.id).first()
        if existing_link is not None:
            raise HydraError("A link with name %s is already in network %s"%(name, self.id))

        l = Link()
        l.name        = name
        l.description = desc
        l.layout           = json.dumps(layout) if layout is not None else None
        l.node_a           = node_1
        l.node_b           = node_2

        get_session().add(l)

        self.links.append(l)

        return l