Generate the path to the visualization for bundles.

        @param charm_id The ID of the bundle.
        @param channel Optional channel name.
        @return The url to the visualization.
482955
def bundle_visualization_url(self, bundle_id, channel=None):
        '''
        '''
        url = '{}/{}/diagram.svg'.format(self.url, _get_path(bundle_id))
        return _add_channel(url, channel)
956980
def get_charm_url(self):
        
        if self.rank_id <= 4: return self.RANK_CHARMS[0]
        if self.rank_id <= 8: return self.RANK_CHARMS[1]
        if self.rank_id <= 12: return self.RANK_CHARMS[2]
        if self.rank_id <= 16: return self.RANK_CHARMS[3]
        if self.rank_id <= 19: return self.RANK_CHARMS[4]
        return self.RANK_CHARMS[5]
184067
public function channel($channel_id = null)
    {
        if (isset($this->channels[$channel_id])) {
            return $this->channels[$channel_id];
        }

        $channel_id = $channel_id ? $channel_id : $this->get_free_channel_id();
        $ch = new AMQPChannel($this->connection, $channel_id, true, $this->channel_rpc_timeout);
        $this->channels[$channel_id] = $ch;

        return $ch;
    }
388827
def url(self, key, includeToken=None):
        
        if self._token and (includeToken or self._showSecrets):
            delim = '&' if '?' in key else '?'
            return '%s%s%sX-Plex-Token=%s' % (self._baseurl, key, delim, self._token)
        return '%s%s' % (self._baseurl, key)
893896
def channels_voice_availability_show(self, id, **kwargs):
        ""
        api_path = "/api/v2/channels/voice/availabilities/{id}.json"
        api_path = api_path.format(id=id)
        return self.call(api_path, **kwargs)
236174
def show_notification(cls, channel_id, *args, **kwargs):
        
        app = AndroidApplication.instance()
        builder = Notification.Builder(app, channel_id)
        builder.update(*args, **kwargs)
        return builder.show()
117826
def config(self, charm_id, channel=None):
        '''
        '''
        url = '{}/{}/meta/charm-config'.format(self.url, _get_path(charm_id))
        data = self._get(_add_channel(url, channel))
        return data.json()
1246466
def broadcast_url(self, broadcast_id=None, stop=False, layout=False):
        
        url = self.api_url + '/v2/project/' + self.api_key + '/broadcast'

        if broadcast_id:
            url = url + '/' + broadcast_id
        if stop:
            url = url + '/stop'
        if layout:
            url = url + '/layout'
        return url
67087
public StoredServerChannel getChannel(Sha256Hash id) {
        lock.lock();
        try {
            return mapChannels.get(id);
        } finally {
            lock.unlock();
        }
    }
1284297
@GET
    @Produces("application/json")
    public GenericEntity<List<ChannelInformation>> listChannels() {
        try {
            return new GenericEntity<List<ChannelInformation>>(channelService.listChannels()) {
            };
        } catch (Exception e) {
            log.error("GET channels listChannels: error: {}", e.getMessage(), e);
            throw new WebApplicationException(Status.INTERNAL_SERVER_ERROR);
        }
    }
1149342
def get_channel(self, subscription_channel, **observer_params):
        """"""
        keys = subscription_channel.get_routing_keys()
        # watch keys are unique sets of keys that we will attempt to extract from inbound items
        self.watch_keys.add(frozenset({k_v[0] for key in keys for k_v in key}))
        self.create_route(subscription_channel, keys)
        subscription_channel._configure(self, self.connect_api, observer_params)
        return subscription_channel
1008379
function getChannel(auth, youtube, channelID, callback) {
  youtube.channels.list( // Call the Youtube API
    {
      auth: auth,
      part: "snippet, statistics",
      order: "date",
      id: channelID,
      maxResults: 1 // Integer 0-50, default 5
    },
    function(err, res) {
      if (err) {
        console.log("The API returned an error: " + err);
      } else {
        if (res.data.items[0] !== undefined) { // Check if a result was found
          var formatedChannel = formatChannelJson(res.data.items[0]) // Format the recieved JSON object
          callback(formatedChannel);
        } else {
            callback([]);
        }
      }
    }
  );
}
687289
def bcdc_package_show(package):
    
    params = {"id": package}
    r = requests.get(bcdata.BCDC_API_URL + "package_show", params=params)
    if r.status_code != 200:
        raise ValueError("{d} is not present in DataBC API list".format(d=package))
    return r.json()["result"]
973501
def get_channel(device, ch_name, channel_dict, loader, resource_dict):
    
    channel_dict = get_bases(channel_dict, loader)

    r_ids = resource_dict.get('channel_ids', {}).get(ch_name, [])
    ids = r_ids if r_ids else channel_dict.get('ids', {})

    can_select = False if channel_dict.get('can_select') == 'False' else True
    channels = Channels(device, ids, can_select)

    update_component(ch_name, channels, channel_dict)

    return channels
209896
public Number getStreamIdForChannelId(int channelId) {
        if (channelId < 4) {
            return 0;
        }
        Number streamId = Math.floor(((channelId - 4) / 5.0d) + 1);
        if (log.isTraceEnabled()) {
            log.trace("Stream id: {} requested for channel id: {}", streamId, channelId);
        }
        return streamId;
    }
641763
def get_channel_id(self):
        
        soup = BeautifulSoup(
            self.get_channel_page(), "lxml"
        )  # parser for source page
        channel_id = soup.find_all(
            "span",
            {
                "class": "channel-header-subscription-button-container"
            }
        )  # get all good spans
        channel_id = channel_id[0].find_all("button")[
            0]  # get button in first span
        channel_id = channel_id["data-channel-external-id"]  # get id
        return channel_id
532471
def create_channel(self, channel):
        

        data = {'channels': channel}
        return super(ApiInterfaceRequest, self).post('api/v3/channel/', data)