Get the charm icon.

        @param charm_id The ID of the charm.
        @param channel Optional channel name.
550951
def charm_icon(self, charm_id, channel=None):
        '''
        '''
        url = self.charm_icon_url(charm_id, channel=channel)
        response = self._get(url)
        return response.content
689566
def get_preference_communication_channel_id(self, user_id, notification, communication_channel_id):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - user_id
        """ID"""
        path["user_id"] = user_id

        # REQUIRED - PATH - communication_channel_id
        """ID"""
        path["communication_channel_id"] = communication_channel_id

        # REQUIRED - PATH - notification
        """ID"""
        path["notification"] = notification

        self.logger.debug("GET /api/v1/users/{user_id}/communication_channels/{communication_channel_id}/notification_preferences/{notification} with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("GET", "/api/v1/users/{user_id}/communication_channels/{communication_channel_id}/notification_preferences/{notification}".format(**path), data=data, params=params, single_item=True)
67087
public StoredServerChannel getChannel(Sha256Hash id) {
        lock.lock();
        try {
            return mapChannels.get(id);
        } finally {
            lock.unlock();
        }
    }
723148
def publish(self, channel_id):
        
        payload = {
            "channel_id":channel_id,
        }
        response = config.SESSION.post(config.publish_channel_url(), data=json.dumps(payload))
        response.raise_for_status()
223032
async def addCharm(self, charm, series):
        
        # We don't add local charms because they've already been added
        # by self._handle_local_charms
        if charm.startswith('local:'):
            return charm

        entity_id = await self.charmstore.entityId(charm)
        log.debug('Adding %s', entity_id)
        await self.client_facade.AddCharm(None, entity_id)
        return entity_id
1273644
def get_or_create_direct_channel(cls, initiator_key, receiver_key):
        
        existing = cls.objects.OR().filter(
            code_name='%s_%s' % (initiator_key, receiver_key)).filter(
            code_name='%s_%s' % (receiver_key, initiator_key))
        receiver_name = UserModel.objects.get(receiver_key).full_name
        if existing:
            channel = existing[0]
        else:
            channel_name = '%s_%s' % (initiator_key, receiver_key)
            channel = cls(is_direct=True, code_name=channel_name, typ=10).blocking_save()
        with BlockSave(Subscriber):
            Subscriber.objects.get_or_create(channel=channel,
                                             user_id=initiator_key,
                                             name=receiver_name)
            Subscriber.objects.get_or_create(channel=channel,
                                             user_id=receiver_key,
                                             name=UserModel.objects.get(initiator_key).full_name)
        return channel, receiver_name
997077
def system_channel(self):
        
        channel_id = self._system_channel_id
        return channel_id and self._channels.get(channel_id)
1204744
def __get_channel(self):
        ""
        if self.__config.get(WebDriverManager.ENABLE_THREADING_SUPPORT, False):
            channel = current_thread().ident
        else:
            channel = 0

        return channel
816875
public static ConfigurableChannel of(Channel channel) {
    Assert.isTrue(channel instanceof ConfigurableChannel, "The channel {} was not created by Lyra", channel);
    return (ConfigurableChannel) channel;
  }
775301
@Override
    public synchronized ChannelData getChannel(String channelName) {
        ChannelData channel = null;
        if (null != channelName) {
            channel = this.channelDataMap.get(channelName);
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "getChannel: " + channelName + " found=" + (null != channel));
        }
        return channel;
    }
733383
public static synchronized Channel getChannel() throws IOException {
        if (devnull < 0) {
            devnull = open0("/dev/null", O_RDWR);
        }

        // If we don't have the channel try to create it
        if (!haveChannel) {
            channel = createChannel();
            haveChannel = true;
        }

        // if there is a channel then do the security check before
        // returning it.
        if (channel != null) {
            checkAccess(channel);
        }
        return channel;
    }
1209871
@TargetApi(Build.VERSION_CODES.O)
  public static void setDefaultChannelId(Context context, String channelId) {
    DefaultChannelId = channelId;
    if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.N_MR1) {
      // do nothing for Android versions before Ore
      return;
    }

    try {
      NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
      CharSequence name = context.getPackageName();
      String description = "PushNotification";
      int importance = NotificationManager.IMPORTANCE_DEFAULT;
      android.app.NotificationChannel channel = new android.app.NotificationChannel(channelId, name, importance);
      channel.setDescription(description);
      notificationManager.createNotificationChannel(channel);
    } catch (Exception ex) {
      LOGGER.w("failed to create NotificationChannel, then perhaps PushNotification doesn't work well on Android O and newer version.");
    }
  }
1300948
def history(self, channel_name, **kwargs):
        
        channel_id = self.get_channel_id(channel_name)
        self.params.update({'channel': channel_id})
        if kwargs:
            self.params.update(kwargs)
        return FromUrl('https://slack.com/api/channels.history', self._requests)(data=self.params).get()
740920
public Channel getChannel(String channelName) throws ChannelFinderException {
		try {
			return wrappedSubmit(new FindByChannelName(channelName));
		} catch (ChannelFinderException e) {
			if (e.getStatus().equals(ClientResponse.Status.NOT_FOUND)) {
				return null;
			} else {
				throw e;
			}
		}

	}
85842
public ChannelWrapper getChannel(String nodeGroup, NodeType nodeType, String identity) {
        List<ChannelWrapper> channelWrappers = getChannels(nodeGroup, nodeType);
        if (channelWrappers != null && channelWrappers.size() != 0) {
            for (ChannelWrapper channelWrapper : channelWrappers) {
                if (channelWrapper.getIdentity().equals(identity)) {
                    return channelWrapper;
                }
            }
        }
        return null;
    }
504546
def channel(self, channel_id=None):
        
        if channel_id in self.channels:
            return self.channels[channel_id]

        return Channel(self, channel_id)
1295938
def set_channel_created(self, channel_link, channel_id):
        
        self.channel_link = channel_link
        self.channel_id = channel_id
        self.__record_progress(Status.PUBLISH_CHANNEL if config.PUBLISH else Status.DONE)