peer_vdc is an array of vdc and service
 only one peer_vdc is allowed per service
 ex: ['switch', 'myservice']
333020
def peer_vdc=(parray)
      if parray.empty?
        @set_args[:state] = 'no'
        current_peer_vdc = peer_vdc
        @set_args[:vdc] = current_peer_vdc[0]
        @set_args[:service] = current_peer_vdc[1]
        config_set('itd_service', 'peer_vdc', @set_args) unless
        current_peer_vdc[0].nil? || current_peer_vdc[1].nil?
      else
        @set_args[:state] = ''
        @set_args[:vdc] = parray[0]
        @set_args[:service] = parray[1]
        config_set('itd_service', 'peer_vdc', @set_args)
      end
      set_args_keys_default
    end
1148952
function(name, zoneLetter, cf, vpc, routeTable) {
  var self = this;

  self.isPublic         = false;

  base.Base.call(this, cf, 'EC2::Subnet', name);
  self.addProperty('VpcId', vpc.ref());

  self.zone = self.addProperty('AvailabilityZone', vpc.az(zoneLetter));

  self.cidrBlock = function(cidr) {
    self.cidr = vpc.mkSubnetCidrBlock(cidr);
    return self.addProperty('CidrBlock', self.cidr);
  };

  self.mapPublicIpOnLaunch = function(value) {
    if (arguments.length === 0) { value = true; }
    return self.addProperty('MapPublicIpOnLaunch', !!value);
  };

  var assocName = name+'RouteTableAssociation';
  cf.data.Resources[assocName] = subnet.makeSubnetRouteTableAssociation(assocName, cf, self, routeTable);

  //self.output(name+"CidrBlock", self.getAtt("CidrBlock"), "Subnet "+name+"CIDR block");   /* Do not know why CidrBlock is not available */
}
157055
public static vpath[] get(nitro_service service) throws Exception{
		vpath obj = new vpath();
		vpath[] response = (vpath[])obj.get_resources(service);
		return response;
	}
1112427
function ourAddresses (peerInfo) {
  const ourPeerId = peerInfo.id.toB58String()
  return peerInfo.multiaddrs.toArray()
    .reduce((ourAddrs, addr) => {
      const peerId = addr.getPeerId()
      addr = addr.toString()
      const otherAddr = peerId
        ? addr.slice(0, addr.lastIndexOf(`/ipfs/${peerId}`))
        : `${addr}/ipfs/${ourPeerId}`
      return ourAddrs.concat([addr, otherAddr])
    }, [])
    .filter(a => Boolean(a))
    .concat(`/ipfs/${ourPeerId}`)
}
424233
def vgcsUplinkGrant():
    """"""
    a = TpPd(pd=0x6)
    b = MessageType(mesType=0x9)  # 00001001
    c = RrCause()
    d = RequestReference()
    e = TimingAdvance()
    packet = a / b / c / d / e
    return packet
682077
function processVpid(host,path,api_key,vpid) {
	var query = nitro.newQuery();
	query.add(api.fVersionsPid,vpid,true);
	if (partner_pid != '') {
		query.add(api.fVersionsPartnerPid,partner_pid);
	}
	else {
		if (pending) {
			query.add(api.fVersionsAvailability,'P30D');
		}
		else {
			query.add(api.fVersionsAvailabilityAvailable);
		}
	}
	if (embargoed) {
		query.add(api.xProgrammesEmbargoed,embargoed);
	}
	nitro.make_request(host,api.nitroVersions,api_key,query,{},function(obj){
		for (var i in obj.nitro.results.items) {
			var item = obj.nitro.results.items[i];
			var pid = item.version_of.pid;
			processPid(host,path,api_key,pid)
		}
	});
}
537882
public java.util.List<String> getVpcPeeringConnectionIds() {
        if (vpcPeeringConnectionIds == null) {
            vpcPeeringConnectionIds = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return vpcPeeringConnectionIds;
    }
839941
def list_dvs(kwargs=None, call=None):
    '''
    
    '''
    if call != 'function':
        raise SaltCloudSystemExit(
            'The list_dvs function must be called with '
            '-f or --function.'
        )

    return {'Distributed Virtual Switches': salt.utils.vmware.list_dvs(_get_si())}
1172984
function createPeerInstance(id)
    {
        var peer              = new ConnectaPeer(id,stunUrls);
        peer.onIceCandidate   = gotIceCandidate;
        peer.onDescription    = createdDescription;
        peer.onRemoteStream   = gotRemoteStream;
        peer.onConnected      = onPeerConnected;
        peer.onMessage        = onPeerMessage;
        peer.onBytesMessage   = onBytesMessage;
        peer.onConnectionFail = onPeerFailed;
        peer.onClosed         = onPeerClose;
        peer.onError          = onPeerError;
        peer.onChannelState   = onPeerState;
        scope.peers[id]       = peer;
        
        peer.init();

        return peer;
    }
1104445
def _get_dvs(service_instance, dvs_name):
    '''
    
    '''
    switches = list_dvs(service_instance)
    if dvs_name in switches:
        inventory = get_inventory(service_instance)
        container = inventory.viewManager.CreateContainerView(inventory.rootFolder, [vim.DistributedVirtualSwitch], True)
        for item in container.view:
            if item.name == dvs_name:
                return item

    return None
893537
function onClientJoinedRoom(id)
    {
        if(scope._servConn.useRTC)
        {
            if(scope.hasWebRTCSupport())
            {
                var peer = getOrCreatePeer(id);
                peer.createOffer();
            }
            else
            {
                scope._servConn.sendRTCState(false,id);
            }
        }
        scope.dispatchEvent("clientJoinedRoom",id);
    }
694632
function Peer (opts) {
  var self = this
  if (!(self instanceof Peer)) return new Peer(opts)

  self._id = randombytes(4).toString('hex').slice(0, 7)
  self._debug('new peer %o', opts)

  opts = Object.assign({
    allowHalfOpen: false
  }, opts)

  stream.Duplex.call(self, opts)

  self.channelName = opts.initiator
    ? opts.channelName || randombytes(20).toString('hex')
    : null

  self.initiator = opts.initiator || false
  self.channelConfig = opts.channelConfig || Peer.channelConfig
  self.config = Object.assign({}, Peer.config, opts.config)
  self.offerOptions = opts.offerOptions || {}
  self.answerOptions = opts.answerOptions || {}
  self.sdpTransform = opts.sdpTransform || function (sdp) { return sdp }
  self.streams = opts.streams || (opts.stream ? [opts.stream] : []) // support old "stream" option
  self.trickle = opts.trickle !== undefined ? opts.trickle : true
  self.allowHalfTrickle = opts.allowHalfTrickle !== undefined ? opts.allowHalfTrickle : false
  self.iceCompleteTimeout = opts.iceCompleteTimeout || ICECOMPLETE_TIMEOUT

  self.destroyed = false
  self.connected = false

  self.remoteAddress = undefined
  self.remoteFamily = undefined
  self.remotePort = undefined
  self.localAddress = undefined
  self.localFamily = undefined
  self.localPort = undefined

  self._wrtc = (opts.wrtc && typeof opts.wrtc === 'object')
    ? opts.wrtc
    : getBrowserRTC()

  if (!self._wrtc) {
    if (typeof window === 'undefined') {
      throw makeError('No WebRTC support: Specify `opts.wrtc` option in this environment', 'ERR_WEBRTC_SUPPORT')
    } else {
      throw makeError('No WebRTC support: Not a supported browser', 'ERR_WEBRTC_SUPPORT')
    }
  }

  self._pcReady = false
  self._channelReady = false
  self._iceComplete = false // ice candidate trickle done (got null candidate)
  self._iceCompleteTimer = null // send an offer/answer anyway after some timeout
  self._channel = null
  self._pendingCandidates = []

  self._isNegotiating = !self.initiator // is this peer waiting for negotiation to complete?
  self._batchedNegotiation = false // batch synchronous negotiations
  self._queuedNegotiation = false // is there a queued negotiation request?
  self._sendersAwaitingStable = []
  self._senderMap = new Map()
  self._firstStable = true
  self._closingInterval = null

  self._remoteTracks = []
  self._remoteStreams = []

  self._chunk = null
  self._cb = null
  self._interval = null

  try {
    self._pc = new (self._wrtc.RTCPeerConnection)(self.config)
  } catch (err) {
    self.destroy(err)
  }

  // We prefer feature detection whenever possible, but sometimes that's not
  // possible for certain implementations.
  self._isReactNativeWebrtc = typeof self._pc._peerConnectionId === 'number'

  self._pc.oniceconnectionstatechange = function () {
    self._onIceStateChange()
  }
  self._pc.onicegatheringstatechange = function () {
    self._onIceStateChange()
  }
  self._pc.onsignalingstatechange = function () {
    self._onSignalingStateChange()
  }
  self._pc.onicecandidate = function (event) {
    self._onIceCandidate(event)
  }

  // Other spec events, unused by this implementation:
  // - onconnectionstatechange
  // - onicecandidateerror
  // - onfingerprintfailure
  // - onnegotiationneeded

  if (self.initiator) {
    self._setupData({
      channel: self._pc.createDataChannel(self.channelName, self.channelConfig)
    })
  } else {
    self._pc.ondatachannel = function (event) {
      self._setupData(event)
    }
  }

  if (self.streams) {
    self.streams.forEach(function (stream) {
      self.addStream(stream)
    })
  }
  self._pc.ontrack = function (event) {
    self._onTrack(event)
  }

  if (self.initiator) {
    self._needsNegotiation()
  }

  self._onFinishBound = function () {
    self._onFinish()
  }
  self.once('finish', self._onFinishBound)
}
769917
def vbd_list(name=None, call=None):
    '''
    

    '''
    if call == 'function':
        raise SaltCloudSystemExit(
            'This function must be called with -a, --action argument.'
        )
    if name is None:
        return 'A name kwarg is rquired'
    ret = {}
    data = {}
    session = _get_session()
    vms = session.xenapi.VM.get_by_name_label(name)
    if len(vms) == 1:
        vm = vms[0]
        vbds = session.xenapi.VM.get_VBDs(vm)
        if vbds is not None:
            x = 0
            for vbd in vbds:
                vbd_record = session.xenapi.VBD.get_record(vbd)
                data['vbd-{}'.format(x)] = vbd_record
                x += 1
    ret = data
    return ret
1122774
def partition_services(self, **args):
        
        rule = args.copy()
        assert 'source' in rule and 'dest' in rule
        #assert 'srcprobability' in rule and 'dstprobability' in rule
        assert rule['source'] != "" and rule['dest'] != ""
        #check if the two services are connected
        assert rule['dest'] in self.app.get_dependencies(rule['source'])

        rule['errorcode'] = rule.pop('errorcode', -1) or -1
        rule['abortprobability'] = rule.pop('srcprobability', 1) or 1
        self.abort_requests(**rule)

        rule['abortprobability'] = rule.pop('dstprobability', 1) or 1
        temp = rule['source']
        rule['source'] = rule['dest']
        rule['dest'] = temp
        self.abort_requests(**rule)
560098
function pushDeviceFilterByUsers() {
    var users = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        users[_i - 0] = arguments[_i];
    }
    if (users.length <= 0) {
        return {
            type: 'null',
            fieldName: 'user',
            isNull: true
        };
    }
    else if (users.length === 1) {
        return {
            type: 'string',
            fieldName: 'user',
            value: domain.uuidOf(users[0])
        };
    }
    else {
        var uuids = users.map(function (user) { return domain.uuidOf(user); });
        return {
            type: 'stringEnum',
            fieldName: 'user',
            values: uuids
        };
    }
}
1037901
def _read_services(self):
        
        # The double slash in the XPath is deliberate, as services can be
        # listed in two places (Section 2.3 of uPNP device architecture v1.1)
        for node in self._findall('device//serviceList/service'):
            findtext = partial(node.findtext, namespaces=self._root_xml.nsmap)
            svc = Service(
                self,
                self._url_base,
                findtext('serviceType'),
                findtext('serviceId'),
                findtext('controlURL'),
                findtext('SCPDURL'),
                findtext('eventSubURL')
            )
            self._log.debug(
                '%s: Service %r at %r', self.device_name, svc.service_type, svc.scpd_url)
            self.services.append(svc)
            self.service_map[svc.name] = svc
36222
function onRTCFallback(from,data,isArray)
    {
        var peer = getPeerByRTCId(from);
        
        if(peer)
        {
            if(isArray == true)
            {
                data = sliceArray(data,0,data.length-2);// data.slice(0,data.length-2);
            }
            scope.dispatchEvent("peerMessage",{message:data,id:peer.id,rtc:peer.rtcId,array:isArray,fallback:true});
        }
    }