Returns an absolute path to a block by the specified name

@param {string=} [name]
@param {(number|string)=} [skip]
@returns {!Promise<(string|Array<string>|{path: (string|Array<string>), lvl: number}|null)>}
508429
async function block(name = '', skip = 0) {
	const
		baseRoot = path.join(sourceDirs[0], config.blockDir);

	if (!name) {
		return baseRoot;
	}

	const
		baseExt = path.extname(name),
		advExt = baseExt ? '' : 'index.js';

	let
		r = sourceDirs,
		ctx;

	if (Sugar.Object.isString(skip)) {
		ctx = skip;
		skip = 0;
	}

	if (config.superRgxp.test(name)) {
		if (!ctx) {
			throw Error('Context for block is not defined');
		}

		name = name.replace(config.superRgxp, '');
		r = r.slice(1);

		for (let i = 0; i < r.length; i++) {
			if (isPathInside(ctx, r[i])) {
				r = r.slice(i + 1);
				break;
			}
		}
	}

	const
		wrap = (path, lvl) => skip ? {path, from: lvl + 1} : path;

	for (let i = skip; i < r.length; i++) {
		if (i && baseExt && ignore[i - 1].has(baseExt)) {
			continue;
		}

		const
			root = r[i],
			file = path.join(name, advExt).replace(/\.logic$/, `.${types[i]}`);

		if (!glob.hasMagic(file) && fs.existsSync(path.join(root, file))) {
			return wrap(path.join(root, baseExt ? file : name), i);
		}

		const
			components = `/**/${file}`,
			virtualComponents = !baseExt && `/**/${name}.index.js`,
			mask = [path.join(root, components)].concat(virtualComponents ? path.join(root, virtualComponents) : []);

		let src;
		await $C(vinyl.src(mask, {read: false})).one.forEach((el, i, data, o) => {
			src = el.path;
			o.cursor.destroy();
		});

		if (src) {
			return wrap(advExt ? path.dirname(src) : src, i);
		}
	}

	return baseExt || skip ? null : path.join(baseRoot, name);
}
1202672
function path($name, $null_on_failure = false) {
		if ( ! isset($this->registeredpaths[$name])) {
			if ($null_on_failure) {
				return null;
			}
			else { // panic
				throw new Panic("There is no path registered for $name.");
			}
		}
		else { //
			return $this->registeredpaths[$name];
		}
	}
1184327
function (sControlName) {
				return APIInfo.getIndexJsonPromise().then(function (aData) {
					function findSymbol (a) {
						return a.some(function (o) {
							var bFound = o.name === sControlName;
							if (!bFound && o.nodes) {
								return findSymbol(o.nodes);
							}
							return bFound;
						});
					}
					return findSymbol(aData);
				});
			}
1036897
function (sName) {
			var iIndex = sName.indexOf("/");

			if (iIndex >= 0) {
				// consider only the first path segment
				sName = sName.slice(0, iIndex);
			}
			// now we have a qualified name, drop the last segment (the name)
			iIndex = sName.lastIndexOf(".");

			return iIndex < 0 ? "" : sName.slice(0, iIndex);
		}
693705
def build_path_to(script_name = nil, *args)
    args.compact!
    query = args.pop if args.last.kind_of?(Hash)
    path  = map_path_to(script_name, *args)
    path << "?" << Rack::Utils::build_query(query) if query
    path
  end
451267
public function getBlock($name)
    {
        return !empty($this->block[$name]) ? $this->block[$name] : null;
    }
338636
public synchronized String requestBlock(String name) {
        if (blocks.isEmpty()) {
            return "exit";
        }

        remainingBlocks.decrementAndGet();
        return blocks.poll().createResponse();
    }
1063148
def get_index_by_name(self, name):
        """"""
        for i in range(self.n_blocks):
            if self.get_block_name(i) == name:
                return i
        raise KeyError('Block name ({}) not found'.format(name))
815249
private NamedOutputBlockContext findAndRemoveBlock(List<NamedOutputBlockContext> blocks, String name) {

    if(blocks == null) {
      return null;
    }

    Iterator<NamedOutputBlockContext> blockIter = blocks.iterator();
    while (blockIter.hasNext()) {
      NamedOutputBlockContext block = blockIter.next();
      String blockName = name(block);
      if(name.equals(blockName)) {
        blockIter.remove();
        return block;
      }
    }

    return null;
  }
73927
function getPath(i, j) {
    if (path[i][j] === Infinity) throw 'There is no path.';
    var intermediate = next[i][j];
    if (intermediate === undefined) return null;else return getPath(i, intermediate).concat([intermediate]).concat(getPath(intermediate, j));
  }
279289
function (node, name, expected) {
    {
      if (!isAttributeNameSafe(name)) {
        return;
      }
      if (!node.hasAttribute(name)) {
        return expected === undefined ? undefined : null;
      }
      var value = node.getAttribute(name);
      if (value === '' + expected) {
        return expected;
      }
      return value;
    }
  }
1097144
function get(name) {
    validateArgumentsLength(arguments.length, 1);
    var entries = getInternalParamsState(this).entries;
    var key = name + '';
    var i = 0;
    for (; i < entries.length; i++) if (entries[i].key === key) return entries[i].value;
    return null;
  }
629132
def path_for_name(name)
      possible_paths = [repos[name.to_s], "repos/#{name}", name].compact
      path = possible_paths.detect do |path|
        Dir[path].present?
      end
      raise BadRepoName.new(name, possible_paths) if path.nil? || path.empty?
      path
    end
28205
def path(name):
    """"""
    try:
        coll = Collection.query.filter(Collection.name == name).one()
        tr = LeftAligned(
            traverse=CollTraversalPathToRoot(coll.path_to_root().all()))
        click.echo(tr(coll))
    except NoResultFound:
        raise click.UsageError('Collection {0} not found'.format(name))
11779
function getBlockName(node, lookup, prefix) {
	let depth = prefix.length > 1 ? prefix.length : 0;

	// NB don’t walk up to root node, stay at first root child in case of
	// too deep prefix
	while (node.parent && node.parent.parent && depth--) {
		node = node.parent;
	}

	return lookup.get(node) || '';
}
537075
function (dirname) {
        return new Promise((resolve, reject) => {
            fs.mkdir(dirname, (err) => {
                if (err) {
                    reject(err);
                }
                else {
                    resolve(dirname);
                }
            });
        });
    }
845820
function (absolute) {
      var aPath, bPath, i = 0, j, resultPath = [], result = '';
      if (typeof absolute === 'string') {
        absolute = $.uri(absolute, {});
      }
      if (absolute.scheme !== this.scheme || 
          absolute.authority !== this.authority) {
        return absolute.toString();
      }
      if (absolute.path !== this.path) {
        aPath = absolute.path.split('/');
        bPath = this.path.split('/');
        if (aPath[1] !== bPath[1]) {
          result = absolute.path;
        } else {
          while (aPath[i] === bPath[i]) {
            i += 1;
          }
          j = i;
          for (; i < bPath.length - 1; i += 1) {
            resultPath.push('..');
          }
          for (; j < aPath.length; j += 1) {
            resultPath.push(aPath[j]);
          }
          result = resultPath.join('/');
        }
        result = absolute.query === undefined ? result : result + '?' + absolute.query;
        result = absolute.fragment === undefined ? result : result + '#' + absolute.fragment;
        return result;
      }
      if (absolute.query !== undefined && absolute.query !== this.query) {
        return '?' + absolute.query + (absolute.fragment === undefined ? '' : '#' + absolute.fragment);
      }
      if (absolute.fragment !== undefined && absolute.fragment !== this.fragment) {
        return '#' + absolute.fragment;
      }
      return '';
    }