Returns this as capabilities.  This does not copy the settings.  Further changes will be
reflected in the capabilities.

@return Capabilities for Opera with these settings
341232
public Capabilities toCapabilities() {
    DesiredCapabilities capabilities = DesiredCapabilities.opera();

    for (CapabilityInstance option : options.values()) {
      if (option.getValue() == null) {
        continue;
      }

      capabilities.setCapability(option.getCapability(), option.getValue());
    }

    return capabilities.merge(surplusCapabilities);
  }
1079415
public FeatureState copy() {
        FeatureState copy = new FeatureState(feature);
        copy.setEnabled(this.enabled);
        copy.setStrategyId(this.strategyId);
        for (Entry<String, String> entry : this.parameters.entrySet()) {
            copy.setParameter(entry.getKey(), entry.getValue());
        }
        return copy;
    }
804555
public java.util.List<CapacityReservation> getCapacityReservations() {
        if (capacityReservations == null) {
            capacityReservations = new com.amazonaws.internal.SdkInternalList<CapacityReservation>();
        }
        return capacityReservations;
    }
987058
public AppiumServiceBuilder withCapabilities(DesiredCapabilities capabilities) {
        if (this.capabilities == null) {
            this.capabilities = capabilities;
        } else {
            DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
            desiredCapabilities.merge(this.capabilities).merge(capabilities);
            this.capabilities = desiredCapabilities;
        }
        return this;
    }
324944
public function getAll()
    {
        $all = array();
        foreach (self::$virtual_capabilities as $name => $class) {
            $all[$name] = $this->get($name);
        }
        return $all;
    }
1052367
def capabilities(self):
        
        response = self.get(PATH_CAPABILITIES)
        return _load_atom(response, MATCH_ENTRY_CONTENT).capabilities
970803
public JSONObject toJson() throws IOException, JSONException {
    JSONObject json = new JSONObject();

    for (CapabilityInstance option : options.values()) {
      Object value = option.getValue();

      if (value == null) {
        continue;
      }

      if (value instanceof OperaProfile) {
        value = ((OperaProfile) value).toJson();
      } else if (value instanceof OperaArguments && ((OperaArguments) value).size() > 0) {
        value = ((OperaArguments) value).toJson();
      } else if (value instanceof Boolean) {
        value = (Boolean) value ? 1 : 0;
      } else {
        value = String.valueOf(value);
      }

      json.put(option.getIdentifier(), value);
    }

    return json;
  }
291763
def to_capabilities(self):
        
        capabilities = ChromeOptions.to_capabilities(self)
        capabilities.update(self._caps)
        opera_options = capabilities[self.KEY]

        if self.android_package_name:
            opera_options["androidPackage"] = self.android_package_name
        if self.android_device_socket:
            opera_options["androidDeviceSocket"] = self.android_device_socket
        if self.android_command_line_file:
            opera_options["androidCommandLineFile"] = \
                self.android_command_line_file
        return capabilities
1070737
def has_capabilities(self, *cap_names):
		
		for name in cap_names:
			if name not in self.__class_capabilities__:
				return False
		return True
638482
def has_capabilities(self, *caps):
		
		for cap in caps:
			if isinstance(cap, WNetworkClientCapabilities) is True:
				cap = cap.value
			if WCapabilitiesHolder.has_capabilities(self, cap) is False:
				return False
		return True
224877
public Configuration getConfiguration() {
		final Configuration conf = new Configuration();
		for (Map.Entry<String, String> entry : data.entrySet()) {
			conf.setString(entry.getKey(), entry.getValue());
		}
		return conf;
	}
990698
public String[] getOptions() {
    Vector<String>	result;
    String[]      	options;
    int           	i;

    result = new Vector<String>();

    result.add("-B");
    result.add(MOAUtils.toCommandLine(m_ActualClassifier));

    options = super.getOptions();
    for (i = 0; i < options.length; i++)
      result.add(options[i]);

    return result.toArray(new String[result.size()]);
  }

  /**
   * Sets the MOA classifier to use.
   *
   * @param value the classifier to use
   */
  public void setClassifier(ClassOption value) {
  	m_Classifier       = value;
  	m_ActualClassifier = (Classifier) MOAUtils.fromOption(m_Classifier);
  }

  /**
   * Returns the current MOA classifier in use.
   *
   * @return the classifier in use
   */
  public ClassOption getClassifier() {
  	return m_Classifier;
  }

  /**
   * Returns the tooltip displayed in the GUI.
   *
   * @return the tooltip
   */
  public String classifierTipText() {
  	return "The MOA classifier to use.";
  }

  /**
   * Returns the Capabilities of this classifier. Maximally permissive
   * capabilities are allowed by default. MOA doesn't specify what
   *
   * @return            the capabilities of this object
   * @see               Capabilities
   */
  public Capabilities getCapabilities() {
    Capabilities result = new Capabilities(this);

    // attributes
    result.enable(Capability.NOMINAL_ATTRIBUTES);
    result.enable(Capability.NUMERIC_ATTRIBUTES);
    result.enable(Capability.MISSING_VALUES);

    // class
    result.enable(Capability.NOMINAL_CLASS);
    result.enable(Capability.MISSING_CLASS_VALUES);

    result.setMinimumNumberInstances(0);

    return result;
  }

  /**
   * Generates a classifier.
   *
   * @param data set of instances serving as training data
   * @throws Exception if the classifier has not been
   * generated successfully
   */
  public void buildClassifier(Instances data) throws Exception {


        this.instanceConverter = new WekaToSamoaInstanceConverter();
  	getCapabilities().testWithFail(data);

  	data = new Instances(data);
  	data.deleteWithMissingClass();

  	m_ActualClassifier.resetLearning();
  	for (int i = 0; i < data.numInstances(); i++)
  		updateClassifier(data.instance(i));
        
  }

  /**
   * Updates a classifier using the given instance.
   *
   * @param instance the instance to included
   * @throws Exception if instance could not be incorporated
   * successfully
   */
  public void updateClassifier(Instance instance) throws Exception {
		m_ActualClassifier.trainOnInstance(instanceConverter.samoaInstance(instance));
  }

  /**
   * Predicts the class memberships for a given instance. If
   * an instance is unclassified, the returned array elements
   * must be all zero. If the class is numeric, the array
   * must consist of only one element, which contains the
   * predicted value.
   *
   * @param instance the instance to be classified
   * @return an array containing the estimated membership
   * probabilities of the test instance in each class
   * or the numeric prediction
   * @throws Exception if distribution could not be
   * computed successfully
   */
  public double[] distributionForInstance(Instance instance) throws Exception {
  	double[]	result;

  	result = m_ActualClassifier.getVotesForInstance(instanceConverter.samoaInstance(instance));
        // ensure that the array has as many elements as there are
        // class values!
        if (result.length < instance.numClasses()) {
          double[] newResult = new double[instance.numClasses()];
          System.arraycopy(result, 0, newResult, 0, result.length);
          result = newResult;
        }

  	try {
  		Utils.normalize(result);
  	}
  	catch (Exception e) {
  		result = new double[instance.numClasses()];
  	}

  	return result;
  }

  /**
   * Returns the revision string.
   *
   * @return the revision
   */
  public String getRevision() {
    return RevisionUtils.extract("$Revision$");
  }

  /**
   * Returns a string representation of the model.
   *
   * @return the string representation
   */
  public String toString() {
  	StringBuilder		result;

  	result = new StringBuilder();
  	m_ActualClassifier.getDescription(result, 0);

  	return result.toString();
  }

  /**
   * Main method for testing this class.
   *
   * @param args the options
   */
  public static void main(String [] args) {
    runClassifier(new MOA(), args);
  }
}
340437
private static Capabilities dropCapabilities(Capabilities capabilities) {
    if (capabilities == null) {
      return new ImmutableCapabilities();
    }

    MutableCapabilities caps;

    if (isLegacy(capabilities)) {
      final Set<String> toRemove = Sets.newHashSet(BINARY, PROFILE);
      caps = new MutableCapabilities(
          Maps.filterKeys(capabilities.asMap(), key -> !toRemove.contains(key)));
    } else {
      caps = new MutableCapabilities(capabilities);
    }

    // Ensure that the proxy is in a state fit to be sent to the extension
    Proxy proxy = Proxy.extractFrom(capabilities);
    if (proxy != null) {
      caps.setCapability(PROXY, proxy);
    }

    return caps;
  }
988607
def get_capabilities(self):
        
        d = {}

        ext = self._layer.GetExtent()       # @TODO if a filter is on this may give different results
        llbb = [round(float(v), 4) for v in ext]

        d['LatLongBoundingBox'] = box(llbb[0], llbb[2], llbb[1], llbb[3])
        d['Name']               = self._file.split('/')[-1].split('.')[0]

        return d
725051
public function capability()
    {
        $response = $this->requestAndResponse('CAPABILITY');

        if (!$response) {
            return $response;
        }

        $capabilities = array();
        foreach ($response as $line) {
            $capabilities = array_merge($capabilities, $line);
        }
        return $capabilities;
    }
497994
public function resourceSupports()
    {
        $this->supportedTypes = array_merge(func_get_args(), $this->supportedTypes);
        $this->canClientAcceptThisResponse();

        return $this;
    }
517586
public function getInjectablePropertiesBySetter() {
    	if ($this->injectablePropertiesBySetter === null) {
    		$this->injectablePropertiesBySetter = MoufReflectionClass::staticGetInjectablePropertiesBySetter($this);
    	}
    	return $this->injectablePropertiesBySetter;
    }