返回对应的channel path
548094
public static String getChannel(Long pipelineId) {
        // 根据channelId , pipelineId构造path
        return MessageFormat.format(ArbitrateConstants.NODE_CHANNEL_FORMAT, getChannelId(pipelineId));
    }
180219
def Channel(n):
    

    rv = channels.get(n, None)
    if rv is None:
        rv = ChannelImpl(n)
        channels[n] = rv

    return rv
1085175
function (channels) {
            var that = this,
                panels = [];

            // Multiple channels may come as comma-delimited
            if (typeof channels === 'string') {
                channels = channels.split(',');
            }

            $.each(channels, function (index, channel_name_key) {
                // We may have a channel key so split it off
                var spli = channel_name_key.trim().split(' '),
                    channel_name = spli[0],
                    channel_key = spli[1] || '';

                // Trim any whitespace off the name
                channel_name = channel_name.trim();

                // Add channel_prefix in front of the first channel if missing
                if (that.get('channel_prefix').indexOf(channel_name[0]) === -1) {
                    // Could be many prefixes but '#' is highly likely the required one
                    channel_name = '#' + channel_name;
                }

                // Check if we have the panel already. If not, create it
                channel = that.panels.getByName(channel_name);
                if (!channel) {
                    channel = new _kiwi.model.Channel({name: channel_name, network: that, key: channel_key||undefined});
                    that.panels.add(channel);
                }

                panels.push(channel);

                that.gateway.join(channel_name, channel_key);
            });


            return panels;
        }
999975
function getRelativePath (from, to) {
  // 去除相同部分
  var i = 0
  while (from[i] === to[i]) {
    i++
  }
  from = from.substr(i)
  to = to.substr(i)
  // 加上..或.
  var l = from.split(/\/|\\/).length - 1
  var s = ''
  if (l) {
    while (l--) {
      s += '../'
    }
  } else {
    s = './'
  }
  return s + to
}
859879
function getRoute(exportFuncs, cb, ctrlpath, curCtrlname) {
  ctrlpath = ctrlpath || [];

  // 如果当前设置了不是路由，则直接返回
  if (exportFuncs.__controller__ === false) {
    return;
  }

  let totalCtrlname = curCtrlname ? ctrlpath.concat([curCtrlname]) : ctrlpath;

  // 只允许3级路由层级
  if (ctrlpath.length > 3) {
    debug(`嵌套路由对象层级不能超过3级：${totalCtrlname.join('/')}`);
    return;
  }

  // 如果是一个方法就直接执行cb
  if (typeof exportFuncs === 'function') {
    cb(exportFuncs, totalCtrlname);
  } else {
    // 否则进行循环递归查询
    for (let ctrlname in exportFuncs) {
      if (!exportFuncs.hasOwnProperty(ctrlname)) {
        continue
      }

      getRoute(exportFuncs[ctrlname], cb, totalCtrlname, ctrlname);
    }
  }
}
674431
private void configureSSL(SocketChannel ch) {
        final ChannelPipeline p = ch.pipeline();
        // 先通过 SSL/TLS 协商版本
        p.addLast(sslCtx.newHandler(ch.alloc()));
        // 根据版本加载不同的 ChannelHandler
        p.addLast(new ApplicationProtocolNegotiationHandler(ApplicationProtocolNames.HTTP_1_1) {
            @Override
            protected void configurePipeline(ChannelHandlerContext ctx, String protocol) throws Exception {
                if (ApplicationProtocolNames.HTTP_2.equals(protocol)) {
                    ctx.pipeline().addLast(bizGroup, "Http2ChannelHandler",
                        new Http2ChannelHandlerBuilder(serverHandler).build());
                    return;
                }

                if (ApplicationProtocolNames.HTTP_1_1.equals(protocol)) {
                    ctx.pipeline().addLast("HttpServerCodec", new HttpServerCodec());
                    ctx.pipeline().addLast("HttpObjectAggregator", new HttpObjectAggregator(maxHttpContentLength));
                    ctx.pipeline().addLast(bizGroup, "Http1ChannelHandler",
                        new Http1ServerChannelHandler(serverHandler));
                    return;
                }

                throw new IllegalStateException("unknown protocol: " + protocol);
            }
        });
    }
963697
public synchronized Channel getRunningChannel(String inputChannelName, Chain chain) {
        if (inputChannelName == null || chain == null) {
            return null;
        }

        Channel channel = null;
        // Ensure the chain is running.
        if (null != this.chainRunningMap.get(chain.getName())) {
            ChannelData[] channels = chain.getChannelsData();
            for (int index = 0; index < channels.length; index++) {
                if (channels[index].getExternalName().equals(inputChannelName)) {
                    channel = chain.getChannels()[index];
                    break;
                }
            }
        }
        return channel;
    }
1307321
def channel_view(x:Tensor)->Tensor:
    ""
    return x.transpose(0,1).contiguous().view(x.shape[1],-1)
599316
def caller_path(steps=1):
    """"""
    frame = sys._getframe(steps + 1)

    try:
        path = os.path.dirname(frame.f_code.co_filename)
    finally:
        del frame

    if not path:
        path = os.getcwd()

    return os.path.realpath(path)
205969
def cmd(send, msg, args):
    
    parser = arguments.ArgParser(args['config'])
    parser.add_argument('channel', nargs='+', action=arguments.ChanParser)
    try:
        cmdargs = parser.parse_args(msg)
    except arguments.ArgumentException as e:
        send(str(e))
        return
    for chan in cmdargs.channels:
        args['handler'].do_part(chan, args['nick'], args['target'], args['type'], send, args['handler'].connection)
18305
async def async_determine_channel(channel):
    '''
    
    '''
    from fuzzywuzzy import process
    channel_data = await async_get_channels()
    if not channel_data:
        _LOGGER.error('No channel data. Cannot determine requested channel.')
        return
    channels = [c for c in channel_data.get('data', {}).keys()]
    if channel in channels:
        return channel
    else:
        res = process.extractOne(channel, channels)[0]
        _LOGGER.debug('No direct match found for %s. Resort to guesswork.'
                      'Guessed %s', channel, res)
        return res
990787
def channel_parameters(parameter_prefix, channel_names, configuration_entry):
    

    if configuration_entry in (True, False):
        return ([], [parameter_prefix])[configuration_entry]

    parameters = []
    if isinstance(configuration_entry, dict):
        for name in set(channel_names).intersection(configuration_entry):
            if configuration_entry[name] is True:
                parameters.append(parameter_prefix + "_" + name)
    else:
        raise TypeError("incorrect type")

    return parameters
1111046
def notification_channel_descriptor_path(cls, project, channel_descriptor):
        """"""
        return google.api_core.path_template.expand(
            "projects/{project}/notificationChannelDescriptors/{channel_descriptor}",
            project=project,
            channel_descriptor=channel_descriptor,
        )
605334
@Override
	protected final void initChannel(Channel ch) throws Exception {
		ChannelPipeline pipeline=ch.pipeline();
		if (sslCtx != null) {
			pipeline.addLast(sslCtx.newHandler(ch.alloc(),host,port));
        }
		pipeline.addLast(new HttpClientCodec());
		pipeline.addLast(new ChunkedWriteHandler());
		pipeline.addLast(new HttpObjectAggregator(64*1024));
		pipeline.addLast(new WebSocketClientProtocolHandler(WebSocketClientHandshakerFactory.newHandshaker(webSocketURL, WebSocketVersion.V13, subprotocol, false, new DefaultHttpHeaders())));
        pipeline.addLast(new WebSocketConnectedClientHandler());//连接成功监听handler
	}
504546
def channel(self, channel_id=None):
        
        if channel_id in self.channels:
            return self.channels[channel_id]

        return Channel(self, channel_id)
627104
public Channel getChannel(int channelId) {
        Channel channel = channels.putIfAbsent(channelId, new Channel(this, channelId));
        if (channel == null) {
            channel = channels.get(channelId);
        }
        return channel;
    }
934336
public static String getRemedyRoot(Long channelId, Long pipelineId) {
        // 根据channelId , pipelineId构造path
        return MessageFormat.format(ArbitrateConstants.NODE_REMEDY_ROOT,
            String.valueOf(channelId),
            String.valueOf(pipelineId));
    }