Appends on existing instance links

        Returns:
            instance_links: A dictionary containing all the instance links in LINKS and not in pipeline_config
343488
def retrieve_instance_links(self):
        
        instance_links = {}
        self.log.debug("LINKS IS %s", LINKS)
        for key, value in LINKS.items():
            if value not in self.pipeline_config['instance_links'].values():
                instance_links[key] = value
        return instance_links
245123
def _pair_samples_with_pipelines(run_info_yaml, config):
    
    samples = config_utils.load_config(run_info_yaml)
    if isinstance(samples, dict):
        resources = samples.pop("resources")
        samples = samples["details"]
    else:
        resources = {}
    ready_samples = []
    for sample in samples:
        if "files" in sample:
            del sample["files"]
        # add any resources to this item to recalculate global configuration
        usample = copy.deepcopy(sample)
        usample.pop("algorithm", None)
        if "resources" not in usample:
            usample["resources"] = {}
        for prog, pkvs in resources.items():
            if prog not in usample["resources"]:
                usample["resources"][prog] = {}
            if pkvs is not None:
                for key, val in pkvs.items():
                    usample["resources"][prog][key] = val
        config = config_utils.update_w_custom(config, usample)
        sample["resources"] = {}
        ready_samples.append(sample)
    paired = [(x, _get_pipeline(x)) for x in ready_samples]
    d = defaultdict(list)
    for x in paired:
        d[x[1]].append([x[0]])
    return d, config
1111746
def addInternalLink(self, link):
        '''
        
        '''
        if isinstance(link, InternalLink):
            self.internalLinks.append(link)
        else:
            raise InternalLinkError( 
                'link Type should be InternalLink, not %s' % type(link))
64351
def links(self):
        
        if not self._responses:
            return None
        if 'Link' in self._responses[-1].headers:
            links = []
            for l in headers.parse_link(self._responses[-1].headers['Link']):
                link = {'target': l.target}
                link.update({k: v for (k, v) in l.parameters})
                links.append(link)
            return links
364597
def all_base_links(rel_to=None):
    """"""
    links = [
        base_link('get-releases'),
        base_link('service'),
        server_link('get-servers'),
        server_link('add-server'),
        replica_set_link('add-replica-set'),
        replica_set_link('get-replica-sets'),
        sharded_cluster_link('add-sharded-cluster'),
        sharded_cluster_link('get-sharded-clusters')
    ]
    for link in links:
        if link['rel'] == rel_to:
            link['rel'] = 'self'
    return links
33875
def append_paths(sprocket, paths) # :nodoc:
      paths or return
      paths.each do |path|
        append_path sprocket, path
      end
    end
1165653
def get_data_link(self, instance, link):
        
        response = self.get_proto('/links/{}/{}'.format(instance, link))
        message = yamcsManagement_pb2.LinkInfo()
        message.ParseFromString(response.content)
        return Link(message)
549942
def Append(self, **kw):
        
        kw = copy_non_reserved_keywords(kw)
        for key, val in kw.items():
            # It would be easier on the eyes to write this using
            # "continue" statements whenever we finish processing an item,
            # but Python 1.5.2 apparently doesn't let you use "continue"
            # within try:-except: blocks, so we have to nest our code.
            try:
                if key == 'CPPDEFINES' and SCons.Util.is_String(self._dict[key]):
                    self._dict[key] = [self._dict[key]]
                orig = self._dict[key]
            except KeyError:
                # No existing variable in the environment, so just set
                # it to the new value.
                if key == 'CPPDEFINES' and SCons.Util.is_String(val):
                    self._dict[key] = [val]
                else:
                    self._dict[key] = val
            else:
                try:
                    # Check if the original looks like a dictionary.
                    # If it is, we can't just try adding the value because
                    # dictionaries don't have __add__() methods, and
                    # things like UserList will incorrectly coerce the
                    # original dict to a list (which we don't want).
                    update_dict = orig.update
                except AttributeError:
                    try:
                        # Most straightforward:  just try to add them
                        # together.  This will work in most cases, when the
                        # original and new values are of compatible types.
                        self._dict[key] = orig + val
                    except (KeyError, TypeError):
                        try:
                            # Check if the original is a list.
                            add_to_orig = orig.append
                        except AttributeError:
                            # The original isn't a list, but the new
                            # value is (by process of elimination),
                            # so insert the original in the new value
                            # (if there's one to insert) and replace
                            # the variable with it.
                            if orig:
                                val.insert(0, orig)
                            self._dict[key] = val
                        else:
                            # The original is a list, so append the new
                            # value to it (if there's a value to append).
                            if val:
                                add_to_orig(val)
                else:
                    # The original looks like a dictionary, so update it
                    # based on what we think the value looks like.
                    if SCons.Util.is_List(val):
                        if key == 'CPPDEFINES':
                            tmp = []
                            for (k, v) in orig.items():
                                if v is not None:
                                    tmp.append((k, v))
                                else:
                                    tmp.append((k,))
                            orig = tmp
                            orig += val
                            self._dict[key] = orig
                        else:
                            for v in val:
                                orig[v] = None
                    else:
                        try:
                            update_dict(val)
                        except (AttributeError, TypeError, ValueError):
                            if SCons.Util.is_Dict(val):
                                for k, v in val.items():
                                    orig[k] = v
                            else:
                                orig[val] = None
        self.scanner_map_delete(kw)
123297
def absolute_links(self) -> _Links:
        

        def gen():
            for link in self.links:
                yield self._make_absolute(link)

        return set(gen())
30354
def linkify_s_by_plug(self):
        
        for module in self:
            new_modules = []
            for related in getattr(module, 'modules', []):
                related = related.strip()
                if not related:
                    continue
                o_related = self.find_by_name(related)
                if o_related is not None:
                    new_modules.append(o_related.uuid)
                else:
                    self.add_error("the module '%s' for the module '%s' is unknown!"
                                   % (related, module.get_name()))
            module.modules = new_modules
562420
def promote_pipeline(conf, args):
    """"""
    src = conf.config['instances'][args.src_instance]
    src_url = api.build_pipeline_url(build_instance_url(src))
    src_auth = tuple([conf.creds['instances'][args.src_instance]['user'], conf.creds['instances'][args.src_instance]['pass']])
    verify_ssl = src.get('verify_ssl', True)
    export_json = api.export_pipeline(src_url, args.src_pipeline_id, src_auth, verify_ssl)

    # Import the pipeline to the destination
    dest = conf.config['instances'][args.dest_instance]
    dest_url = api.build_pipeline_url(build_instance_url(dest))
    dest_auth = tuple([conf.creds['instances'][args.dest_instance]['user'], conf.creds['instances'][args.dest_instance]['pass']])
    dest_pipeline_id = args.dest_pipeline_id
    if dest_pipeline_id and api.pipeline_status(dest_url, dest_pipeline_id, dest_auth, verify_ssl)['status'] != api.STATUS_STOPPED:
        api.stop_pipeline(dest_url, dest_pipeline_id, dest_auth, verify_ssl)
    else:
        # No destination pipeline id was provided, must be a new pipeline.
        create_json = api.create_pipeline(dest_url, dest_auth, export_json, verify_ssl)
        dest_pipeline_id = create_json['info']['pipelineId']

    result = api.import_pipeline(dest_url, dest_pipeline_id, dest_auth, export_json, verify_ssl, overwrite=True)

    # Start the imported pipeline
    if args.start_dest:
        api.start_pipeline(dest_url, dest_pipeline_id, dest_auth, verify_ssl)

    return result
187615
def append(self, key, value=None, dir=False, ttl=None, timeout=None):
        
        return self.adapter.append(key, value, dir=dir, ttl=ttl,
                                   timeout=timeout)
494589
def _add_links(self, links, key="href", proxy_key="proxyURL", endpoints=None):
        
        if endpoints is None:
            endpoints = ["likes", "replies", "shares", "self", "followers",
                         "following", "lists", "favorites", "members"]

        if links.get("links"):
            for endpoint in links['links']:
                # It would seem occasionally the links["links"][endpoint] is
                # just a string (what would be the href value). I don't know
                # why, it's likely a bug in pump.io but for now we'll support
                # this too.
                if isinstance(links['links'][endpoint], dict):
                    self._add_link(endpoint, links['links'][endpoint]["href"])
                else:
                    self._add_link(endpoint, links["links"][endpoint])

        for endpoint in endpoints:
            if links.get(endpoint, None) is None:
                continue

            if "pump_io" in links[endpoint]:
                self._add_link(endpoint, links[endpoint]["pump_io"][proxy_key])
            elif "url" in links[endpoint]:
                self._add_link(endpoint, links[endpoint]["url"])
            else:
                self._add_link(endpoint, links[endpoint][key])

        return self.links
1019287
def update_link(self):
        
        name = repr(self)
        if not name:
            return self
        l = self.__class__._get_links()
        to_be_changed = list()
        if name in l:

            for wal in l[name]:
                if wal.ref_obj and self is not wal():
                    to_be_changed.append((wal.ref_obj, wal.attr))

        for o, a in to_be_changed:
            setattr(o, a, self)

        self.clean_up_link_dict()
        return self
1113869
def iter_links(self):
        
        for x in range(self.width):
            for y in range(self.height):
                for link in Links:
                    if (x, y, link) in self:
                        yield (x, y, link)
760294
def create_back_links(env):
    
    if env.needs_workflow['backlink_creation']:
        return

    needs = env.needs_all_needs
    for key, need in needs.items():
        for link in need["links"]:
            link_main = link.split('.')[0]
            try:
                link_part = link.split('.')[1]
            except IndexError:
                link_part = None

            if link_main in needs:
                if key not in needs[link_main]["links_back"]:
                    needs[link_main]["links_back"].append(key)

                # Handling of links to need_parts inside a need
                if link_part is not None:
                    if link_part in needs[link_main]['parts']:
                        if 'links_back' not in needs[link_main]['parts'][link_part].keys():
                            needs[link_main]['parts'][link_part]['links_back'] = []
                        needs[link_main]['parts'][link_part]['links_back'].append(key)

    env.needs_workflow['backlink_creation'] = True
1231357
private static List<UberData> mergeDeclaredLinksIntoAffordanceLinks(List<UberData> affordanceBasedLinks,
			List<UberData> links) {

		return affordanceBasedLinks.stream() //
				.flatMap(affordance -> links.stream() //
						.filter(link -> link.getUrl().equals(affordance.getUrl())) //
						.map(link -> {

							if (link.getAction() == affordance.getAction()) {

								List<LinkRelation> rels = new ArrayList<>(link.getRel());
								rels.addAll(affordance.getRel());

								return affordance.withName(rels.get(0).value()) //
										.withRel(rels);
							} else {
								return affordance;
							}
						}))
				.collect(Collectors.toList());
	}