/*!
Sets 'selected' gateways. -1 means 'Any' - all 'available' gateways
becomes 'selected'.
557350
function fetchHTTPInput( $http, $base, $event )
    {
        $gatewaysVar = $base . "_event_ezpaymentgateway_gateways_" . $event->attribute( "id" );
        if ( $http->hasPostVariable( $gatewaysVar ) )
        {
            $gatewaysArray = $http->postVariable( $gatewaysVar );
            if ( in_array( '-1', $gatewaysArray ) )
            {
                $gatewaysArray = array( -1 );
            }

            $gatewaysString = implode( ',', $gatewaysArray );
            $event->setAttribute( "data_text1", $gatewaysString );
        }
    }
732930
public function setSelected(array $values)
	{
		$this->assertMultiSelect();

		$candidates = array();
		/* @var $candidates SelectOption[] */

		foreach ( $this->getOptions() as $option ) {
			if ( in_array($option->getValue(), $values) ) {
				$candidates[] = $option;
			}
		}

		return $this->selectOptions($candidates);
	}
792948
function setRoutesInState(routes) {
    const routesByName = {};
    routes.forEach(route => {
        routesByName[route.name] = route.route;
    });
    return routesByName;
}
1131166
protected function setServer()
	{
		$server = $this->config->get('gateway.zarinpal.server', 'germany');
		switch ($server) {
			case 'iran':
				$this->serverUrl = $this->iranServer;
				break;
                
			case 'test':
				$this->serverUrl = $this->sandboxServer;
				$this->gateUrl = $this->sandboxGateUrl;
				break;

			case 'germany':
			default:
				$this->serverUrl = $this->germanyServer;
				break;
		}
	}
1176039
public function setRequestIds($s){
        if (is_string($s)){
            $this->resetRequestIds();
            $this->options['ReportRequestIdList.Id.1'] = $s;
        } else if (is_array($s)){
            $this->resetRequestIds();
            $i = 1;
            foreach ($s as $x){
                $this->options['ReportRequestIdList.Id.'.$i] = $x;
                $i++;
            }
        } else {
            return false;
        }
    }
887029
def enabled_gates
      values = gate_values
      gates.select { |gate| gate.enabled?(values[gate.key]) }
    end
659225
public void setInternetGateways(java.util.Collection<InternetGateway> internetGateways) {
        if (internetGateways == null) {
            this.internetGateways = null;
            return;
        }

        this.internetGateways = new com.amazonaws.internal.SdkInternalList<InternetGateway>(internetGateways);
    }
926843
protected function setGateway($gateway = null)
    {
        $deferred = new Deferred();

        $buildParams = function ($gateway) use ($deferred) {
            $params = [
                'v'        => self::GATEWAY_VERSION,
                'encoding' => $this->encoding,
            ];

            $query         = http_build_query($params);
            $this->gateway = trim($gateway, '/').'/?'.$query;

            $deferred->resolve($this->gateway);
        };

        if (is_null($gateway)) {
            $this->http->get('gateway')->then(function ($response) use ($buildParams) {
                $buildParams($response->url);
            }, function ($e) use ($buildParams) {
                // Can't access the API server so we will use the default gateway.
                $buildParams('wss://gateway.discord.gg');
            });
        } else {
            $buildParams($gateway);
        }

        $deferred->promise()->then(function ($gateway) {
            $this->logger->info('gateway retrieved and set', ['gateway' => $gateway]);
        }, function ($e) {
            $this->logger->error('error obtaining gateway', ['e' => $e->getMessage()]);
        });

        return $deferred->promise();
    }
1314976
def set_gateway(self, gateway):
        '''
        
        '''
        self.gateway = gateway
        if (self._gemeente is not None):
            self._gemeente.set_gateway(gateway)
505139
public void setExistingAllowedPrefixesToDirectConnectGateway(java.util.Collection<RouteFilterPrefix> existingAllowedPrefixesToDirectConnectGateway) {
        if (existingAllowedPrefixesToDirectConnectGateway == null) {
            this.existingAllowedPrefixesToDirectConnectGateway = null;
            return;
        }

        this.existingAllowedPrefixesToDirectConnectGateway = new com.amazonaws.internal.SdkInternalList<RouteFilterPrefix>(
                existingAllowedPrefixesToDirectConnectGateway);
    }
628839
private function setBounds(&$segments) {
        for ($i = 0, $count = count($segments); $i < $count; ++$i) {
            if ($segments[$i]->optional && $i - 1 >= 0) {
                $optional = true;

                for ($j = $i + 1; $j < $count; ++$j) {
                    if (!$segments[$j]->optional) {
                        $optional = false;
                        break;
                    }
                }

                if ($optional) {
                    $segments[$i - 1]->preEnd = true;
                }
                else {
                    for (--$j, $jc = $i - 1; $j >= $jc; --$j) {
                        $segments[$j]->optional = false;
                    }
                }
            }

            if ($i + 1 == $count) {
                $segments[$i]->end = true;
            }
        }
    }
1311570
function set(kvs, options, cb){
  if(Object.keys(kvs).length<=0){
    if(cb) return cb(new Error('empty key and value'));
    throw new Error('empty key and value');
  }

  var fns = [];
  for(var s in this._stores){
    var store = this._stores[s];
    fns.push(store.set.bind(store, kvs, options));
  }
  if(cb){
    concurrent(fns, cb);
  }else{
    var fiber = fibext(), rbw = false;//resume before wait
    concurrent(fns, function(){
      fiber.resume.apply(fiber, arguments);
      rbw = true;
    });
    rbw || fiber.wait();
  }  
}
329262
function (mQueryOptions, aSelectPaths) {
			mQueryOptions.$select = mQueryOptions.$select || [];
			aSelectPaths.forEach(function (sPath) {
				if (mQueryOptions.$select.indexOf(sPath) < 0) {
					mQueryOptions.$select.push(sPath);
				}
			});
		}
614171
public function setDeliveryChannel($s) {
        if (is_string($s)){
            $this->options['Destination.DeliveryChannel'] = $s;
            $this->options['Subscription.Destination.DeliveryChannel'] = $s;
        } else {
            return false;
        }
    }
286202
public void setRequestedAllowedPrefixesToDirectConnectGateway(java.util.Collection<RouteFilterPrefix> requestedAllowedPrefixesToDirectConnectGateway) {
        if (requestedAllowedPrefixesToDirectConnectGateway == null) {
            this.requestedAllowedPrefixesToDirectConnectGateway = null;
            return;
        }

        this.requestedAllowedPrefixesToDirectConnectGateway = new com.amazonaws.internal.SdkInternalList<RouteFilterPrefix>(
                requestedAllowedPrefixesToDirectConnectGateway);
    }
1353181
public void setGatewayGroups(java.util.Collection<GatewayGroupSummary> gatewayGroups) {
        if (gatewayGroups == null) {
            this.gatewayGroups = null;
            return;
        }

        this.gatewayGroups = new java.util.ArrayList<GatewayGroupSummary>(gatewayGroups);
    }
204213
public void setRemoveAllowedPrefixesToDirectConnectGateway(java.util.Collection<RouteFilterPrefix> removeAllowedPrefixesToDirectConnectGateway) {
        if (removeAllowedPrefixesToDirectConnectGateway == null) {
            this.removeAllowedPrefixesToDirectConnectGateway = null;
            return;
        }

        this.removeAllowedPrefixesToDirectConnectGateway = new com.amazonaws.internal.SdkInternalList<RouteFilterPrefix>(
                removeAllowedPrefixesToDirectConnectGateway);
    }