Helper name for getting a channel's id from its name
963798
def channel_name_to_id(self, channel_name, force_lookup=False):
        
        if force_lookup or not self.channel_name_id_map:
            channels = self.channels_list()['channels']
            self.channel_name_id_map = {channel['name']: channel['id'] for channel in channels}
        channel = channel_name.startswith('#') and channel_name[1:] or channel_name
        return self.channel_name_id_map.get(channel)
1209928
def _get_id(self):
        """"""
        return ''.join(map(str,
                           filter(is_not_None,
                                  [self.Prefix, self.Name])))
63287
def get_source_name(self, src_id):
        """"""
        len_out = _ffi.new('unsigned int *')
        rv = rustcall(_lib.lsm_view_get_source_name,
                      self._get_ptr(), src_id, len_out)
        if rv:
            return decode_rust_str(rv, len_out[0])
888670
def youtube_id(self):
        """"""
        if not self.video_embed:
            return ''
        m = re.search(r'/embed/([A-Za-z0-9\-=_]*)', self.video_embed)
        if m:
            return m.group(1)
        return ''
717804
def get_name(self):
        """"""
        if self.given_name is None:
            # Name according to host
            if self.hostname is None:
                name = _("Console")
            else:
                name = self.hostname
            # Adding id to name
            client_id = self.id_['int_id'] + u'/' + self.id_['str_id']
            name = name + u' ' + client_id
        elif self.given_name in ["Pylab", "SymPy", "Cython"]:
            client_id = self.id_['int_id'] + u'/' + self.id_['str_id']
            name = self.given_name + u' ' + client_id
        else:
            name = self.given_name + u'/' + self.id_['str_id']
        return name
222488
def build_channel(namespace, name, user_ids):
    
    ids = ','.join(map(str, user_ids))
    return "{0}:{1}#{2}".format(namespace, name, ids)
351106
def __getChannelId(self):

        

        if not self.search_params.get("channelId"):
            return

        api_fixed_url = "https://www.googleapis.com/youtube/v3/channels?part=id&maxResults=1&fields=items%2Fid&"
        url = api_fixed_url + urlencode({"key": self.api_key, "forUsername": self.search_params["channelId"]})
        get = requests.get(url).json()

        try:
            self.search_params["channelId"] = get['items'][0]['id']
            return # got it

        except IndexError:
            pass # try searching now...

        api_fixed_url = "https://www.googleapis.com/youtube/v3/search?part=snippet&type=channel&fields=items%2Fid&"
        url = api_fixed_url + urlencode({"key": self.api_key, "q": self.search_params['channelId']})
        get = requests.get(url).json()

        try:
            self.search_params["channelId"] = get['items'][0]['id']['channelId']

        except IndexError:
            del self.search_params["channelId"]
960124
def channels_info(self, room_id=None, channel=None, **kwargs):
        """"""
        if room_id:
            return self.__call_api_get('channels.info', roomId=room_id, kwargs=kwargs)
        elif channel:
            return self.__call_api_get('channels.info', roomName=channel, kwargs=kwargs)
        else:
            raise RocketMissingParamException('roomId or channel required')
397678
def get_channel_by_channel_id(self, channel_id):
        
        self._validate_uuid(channel_id)

        url = "/notification/v1/channel/{}".format(channel_id)

        response = NWS_DAO().getURL(url, self._read_headers)

        if response.status != 200:
            raise DataFailureException(url, response.status, response.data)

        data = json.loads(response.data)
        return self._channel_from_json(data.get("Channel"))
409557
def get_id(self, name, recurse=True):
        
        self._dlog("getting id '{}'".format(name))
        var = self._search("vars", name, recurse)
        return var
1043761
def get_subscriptions_by_channel_id_and_subscriber_id(
            self, channel_id, subscriber_id):
        
        return self.search_subscriptions(
            channel_id=channel_id, subscriber_id=subscriber_id)
178815
def get_dm_channel(self, userid):
        '''
        '''

        dm_open = self.slack_client.api_call('im.open', user=userid)
        return dm_open['channel']['id']
194406
def channel_names(fn, usecols=None):
    """"""

    with open(fn, 'rb') as fo:
        names = dbfreader(fo).next()

    return usecols and [names[i] for i in usecols] or names
1054015
def get_node_name_from_id(node_id, nodes):
        
        node_name = ''
        for node in nodes:
            if node['id'] == node_id:
                node_name = node['properties']['name']
                break
        return node_name
1306618
private EventChannelStruct getEventChannelStruct(String channelName) {
        if (channel_map.containsKey(channelName)) {
            return channel_map.get(channelName);
        }
        //  Check with other TangoHosts using possibleTangoHosts as header
        int index = channelName.indexOf("//");
        if (index>0) {
            index = channelName.indexOf('/', index+2); //  "//".length()
            for (String possibleTangoHost : possibleTangoHosts) {
                String key = possibleTangoHost + channelName.substring(index);
                if (channel_map.containsKey(key))
                    return channel_map.get(key);
            }
        }
        return null;
    }
1314913
def get_channel(self, name):
        
        name = quote(name, '')
        path = Client.urls['channels_by_name'] % name
        chan = self._call(path, 'GET')
        return chan
1100100
def get_name(model_id):
    
    name = _names.get(model_id)
    if name is None:
        name = 'id = %s (no name)' % str(model_id)
    return name