Create a mediated transfer using channel.
769563
def send_lockedtransfer(
        transfer_description: TransferDescriptionWithSecretState,
        channel_state: NettingChannelState,
        message_identifier: MessageID,
        block_number: BlockNumber,
) -> SendLockedTransfer:
    
    assert channel_state.token_network_identifier == transfer_description.token_network_identifier

    lock_expiration = get_initial_lock_expiration(
        block_number,
        channel_state.reveal_timeout,
    )

    # The payment amount and the fee amount must be included in the locked
    # amount, as a guarantee to the mediator that the fee will be claimable
    # on-chain.
    total_amount = PaymentWithFeeAmount(
        transfer_description.amount + transfer_description.allocated_fee,
    )

    lockedtransfer_event = channel.send_lockedtransfer(
        channel_state=channel_state,
        initiator=transfer_description.initiator,
        target=transfer_description.target,
        amount=total_amount,
        message_identifier=message_identifier,
        payment_identifier=transfer_description.payment_identifier,
        expiration=lock_expiration,
        secrethash=transfer_description.secrethash,
    )
    return lockedtransfer_event
452990
def on_channel_open(self, channel):
        
        self.in_channel.exchange_declare(exchange='input_exc', type='topic', durable=True)
        channel.queue_declare(callback=self.on_input_queue_declare, queue=self.INPUT_QUEUE_NAME)
1201126
async def join(self, ctx, *, channel: discord.VoiceChannel):
        """"""

        if ctx.voice_client is not None:
            return await ctx.voice_client.move_to(channel)

        await channel.connect()
1324862
@Override
    public Channel createChannel(String ccid, String trackingId) {

        try {
            // The controller has to assign the channel to a bounce proxy
            // instance.
            ControlledBounceProxyInformation bpInfo = strategy.calculateBounceProxy(ccid);

            URI channelLocation = bpFacade.createChannel(bpInfo, ccid, trackingId);

            Channel channel = new Channel(bpInfo, ccid, channelLocation);

            channelDirectory.addChannel(channel);
            bounceProxyDirectory.updateChannelAssignment(ccid, bpInfo);

            return channel;

        } catch (Exception e) {
            log.error("Could not create channel on bounce proxy: channel {}, error: {}", ccid, e.getMessage());
            throw new JoynrRuntimeException("Error creating channel on bounce proxy", e);
        }
    }
1353517
def wrap_create_channel(create_channel_func, tracer=None):
    """"""
    def call(*args, **kwargs):
        channel = create_channel_func(*args, **kwargs)

        try:
            target = kwargs.get('target')
            tracer_interceptor = OpenCensusClientInterceptor(tracer, target)
            intercepted_channel = grpc.intercept_channel(
                channel, tracer_interceptor)
            return intercepted_channel  # pragma: NO COVER
        except Exception:
            log.warning(
                'Failed to wrap create_channel, '
                'clientlibs grpc calls not traced.')
            return channel
    return call
315073
def new_mapper(agent):
    """"""
    recp = recipient.Broadcast(MappingUpdatesPoster.protocol_id, 'lobby')
    return agent.initiate_protocol(MappingUpdatesPoster, recp)
152132
def move_chosen_subscribers(self):
        
        from_channel = Channel.objects.get(self.current.task_data['chosen_channels'][0])
        to_channel = Channel.objects.get(self.current.task_data['target_channel_key'])

        with BlockSave(Subscriber, query_dict={'channel_id': to_channel.key}):
            for subscriber in Subscriber.objects.filter(
                    key__in=self.current.task_data['chosen_subscribers']):
                subscriber.channel = to_channel
                subscriber.save()

        if self.current.task_data['new_channel']:
            self.copy_and_move_messages(from_channel, to_channel)

        self.current.task_data[
            'msg'] = _(u"Chosen subscribers and messages of them migrated from '%s' channel to "
                       u"'%s' channel successfully.") % (from_channel.name, to_channel.name)
193622
def create_message(self, channel_id, text):
        

        baseurl = self.rest_baseurl + \
            '/channels/{}/messages'.format(channel_id)
        requests.post(baseurl,
                      headers=self.headers,
                      data=json.dumps({'content': text}))
884850
def channels_open(self, room_id, **kwargs):
        """"""
        return self.__call_api_post('channels.open', roomId=room_id, kwargs=kwargs)
1203230
def join(self, channel):
        
        
        if channel not in self.channels:
            channel.users.add(self.nick)
            self.channels.append(channel)
1162622
def _create_channel(self, channel):
        
        super()._create_channel(channel)
        if 'EXCEPTS' in self._isupport:
            self.channels[channel]['exceptlist'] = None
        if 'INVEX' in self._isupport:
            self.channels[channel]['inviteexceptlist'] = None
1253420
def bind_to_channel(self):
        
        if self.channel.code_name != self.user.prv_exchange:
            channel = self._connect_mq()
            channel.exchange_bind(source=self.channel.code_name, destination=self.user.prv_exchange)
1177841
def create_new_channel(self):
        

        self.current.task_data['new_channel'] = True
        _form = NewChannelForm(Channel(), current=self.current)
        _form.title = _(u"Specify Features of New Channel to Create")
        _form.forward = fields.Button(_(u"Create"), flow="find_target_channel")
        self.form_out(_form)
1318063
def subscribe(self, client, channel_name):
        """"""
        if channel_name not in self.channels:
            self.channels[channel_name] = channel = Channel(channel_name)
            channel.start()

        self.channels[channel_name].subscribe(client)
507954
private synchronized void createChannel(String channel) {
        if (!channelExists(channel)) {
            Queue queue = new Queue(channel, true, false, true);
            admin.declareQueue(queue);
            Binding binding = new Binding(channel, DestinationType.QUEUE, exchange.getName(), channel + ".#", null);
            admin.declareBinding(binding);
        }
    }
148644
def create_channel(self, width, height):
        
        if self.channel_mode is None:
            return self.create(width, height)
        return Image.new(self.channel_mode, (width, height))
776618
def publish(self, channel: str, value: Any):
        
        self._r.publish(channel, str(value))