_id
stringlengths
2
7
title
stringlengths
3
140
partition
stringclasses
3 values
text
stringlengths
73
34.1k
language
stringclasses
1 value
meta_information
dict
q12000
servicegroup.get
train
public static servicegroup[] get(nitro_service service, servicegroup_args args) throws Exception{ servicegroup obj = new servicegroup(); options option = new options(); option.set_args(nitro_util.object_to_string_withoutquotes(args)); servicegroup[] response = (servicegroup[])obj.get_resources(service, option); return response; }
java
{ "resource": "" }
q12001
servicegroup.get
train
public static servicegroup get(nitro_service service, String servicegroupname) throws Exception{ servicegroup obj = new servicegroup(); obj.set_servicegroupname(servicegroupname); servicegroup response = (servicegroup) obj.get_resource(service); return response; }
java
{ "resource": "" }
q12002
dnsproxyrecords.flush
train
public static base_response flush(nitro_service client) throws Exception { dnsproxyrecords flushresource = new dnsproxyrecords(); return flushresource.perform_operation(client,"flush"); }
java
{ "resource": "" }
q12003
transformpolicy_transformpolicylabel_binding.get
train
public static transformpolicy_transformpolicylabel_binding[] get(nitro_service service, String name) throws Exception{ transformpolicy_transformpolicylabel_binding obj = new transformpolicy_transformpolicylabel_binding(); obj.set_name(name); transformpolicy_transformpolicylabel_binding response[] = (transformpolicy_transformpolicylabel_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q12004
arpparam.update
train
public static base_response update(nitro_service client, arpparam resource) throws Exception { arpparam updateresource = new arpparam(); updateresource.timeout = resource.timeout; updateresource.spoofvalidation = resource.spoofvalidation; return updateresource.update_resource(client); }
java
{ "resource": "" }
q12005
arpparam.unset
train
public static base_response unset(nitro_service client, arpparam resource, String[] args) throws Exception{ arpparam unsetresource = new arpparam(); return unsetresource.unset_resource(client,args); }
java
{ "resource": "" }
q12006
arpparam.get
train
public static arpparam get(nitro_service service) throws Exception{ arpparam obj = new arpparam(); arpparam[] response = (arpparam[])obj.get_resources(service); return response[0]; }
java
{ "resource": "" }
q12007
PropertiesUtils.getInt
train
public static int getInt(Properties props, String key, int defaultValue) { String value = props.getProperty(key); if (value != null) { return Integer.parseInt(value); } else { return defaultValue; } }
java
{ "resource": "" }
q12008
PropertiesUtils.getDouble
train
public static double getDouble(Properties props, String key, double defaultValue) { String value = props.getProperty(key); if (value != null) { return Double.parseDouble(value); } else { return defaultValue; } }
java
{ "resource": "" }
q12009
PropertiesUtils.getBool
train
public static boolean getBool(Properties props, String key, boolean defaultValue) { String value = props.getProperty(key); if (value != null) { return Boolean.parseBoolean(value); } else { return defaultValue; } }
java
{ "resource": "" }
q12010
PropertiesUtils.getIntArray
train
public static int[] getIntArray(Properties props, String key) { Integer[] result = MetaClass.cast(props.getProperty(key), Integer [].class); return ArrayUtils.toPrimitive(result); }
java
{ "resource": "" }
q12011
PropertiesUtils.getDoubleArray
train
public static double[] getDoubleArray(Properties props, String key) { Double[] result = MetaClass.cast(props.getProperty(key), Double [].class); return ArrayUtils.toPrimitive(result); }
java
{ "resource": "" }
q12012
NondominatedPopulation.invertedCompare
train
public static int invertedCompare(Solution s1, Solution s2) { int flag = InvertedCompareUtils.ConstraintCompare(s1, s2); if (flag == 0) { flag = InvertedCompareUtils.ParetoObjectiveCompare(s1, s2); } return flag; }
java
{ "resource": "" }
q12013
NondominatedPopulation.add
train
@Override public boolean add(Solution solution_to_add) { List<Solution> solutions_to_remove = new ArrayList<>(); boolean should_add = true; for (Solution solution : solutions) { int flag = invertedCompare(solution_to_add, solution); if (flag < 0) // solution_to_add is better { solutions_to_remove.add(solution); } else if (flag > 0) // solution is better than solution_to_add { should_add = false; break; } else if (getDistance(solution_to_add, solution) < Epsilon) { should_add = false; break; } } solutions.removeAll(solutions_to_remove); if (should_add) { return solutions.add(solution_to_add); } return should_add; }
java
{ "resource": "" }
q12014
vpntrafficpolicy.get
train
public static vpntrafficpolicy[] get(nitro_service service) throws Exception{ vpntrafficpolicy obj = new vpntrafficpolicy(); vpntrafficpolicy[] response = (vpntrafficpolicy[])obj.get_resources(service); return response; }
java
{ "resource": "" }
q12015
vpntrafficpolicy.get
train
public static vpntrafficpolicy get(nitro_service service, String name) throws Exception{ vpntrafficpolicy obj = new vpntrafficpolicy(); obj.set_name(name); vpntrafficpolicy response = (vpntrafficpolicy) obj.get_resource(service); return response; }
java
{ "resource": "" }
q12016
GeneralDataset.numFeatureTokens
train
public int numFeatureTokens() { int x = 0; for (int i = 0, m = size; i < m; i++) { x += data[i].length; } return x; }
java
{ "resource": "" }
q12017
GeneralDataset.addAll
train
public void addAll(Iterable<? extends Datum<L,F>> data) { for (Datum<L, F> d : data) { add(d); } }
java
{ "resource": "" }
q12018
GeneralDataset.makeSvmLabelMap
train
public String[] makeSvmLabelMap() { String[] labelMap = new String[numClasses()]; if (numClasses() > 2) { for (int i = 0; i < labelMap.length; i++) { labelMap[i] = String.valueOf((i + 1)); } } else { labelMap = new String[]{"+1", "-1"}; } return labelMap; }
java
{ "resource": "" }
q12019
GeneralDataset.printSVMLightFormat
train
public void printSVMLightFormat(PrintWriter pw) { //assumes each data item has a few features on, and sorts the feature keys while collecting the values in a counter // old comment: // the following code commented out by Ramesh (nmramesh@cs.stanford.edu) 12/17/2009. // why not simply print the exact id of the label instead of mapping to some values?? // new comment: // mihai: we NEED this, because svm_light has special conventions not supported by default by our labels, // e.g., in a multiclass setting it assumes that labels start at 1 whereas our labels start at 0 (08/31/2010) String[] labelMap = makeSvmLabelMap(); for (int i = 0; i < size; i++) { RVFDatum<L, F> d = getRVFDatum(i); Counter<F> c = d.asFeaturesCounter(); ClassicCounter<Integer> printC = new ClassicCounter<Integer>(); for (F f : c.keySet()) { printC.setCount(featureIndex.indexOf(f), c.getCount(f)); } Integer[] features = printC.keySet().toArray(new Integer[printC.keySet().size()]); Arrays.sort(features); StringBuilder sb = new StringBuilder(); sb.append(labelMap[labels[i]]).append(' '); // sb.append(labels[i]).append(' '); // commented out by mihai: labels[i] breaks svm_light conventions! /* Old code: assumes that F is Integer.... * for (int f: features) { sb.append((f + 1)).append(":").append(c.getCount(f)).append(" "); } */ //I think this is what was meant (using printC rather than c), but not sure // ~Sarah Spikes (sdspikes@cs.stanford.edu) for (int f: features) { sb.append((f + 1)).append(':').append(printC.getCount(f)).append(' '); } pw.println(sb.toString()); } }
java
{ "resource": "" }
q12020
tmglobal_auditnslogpolicy_binding.get
train
public static tmglobal_auditnslogpolicy_binding[] get(nitro_service service) throws Exception{ tmglobal_auditnslogpolicy_binding obj = new tmglobal_auditnslogpolicy_binding(); tmglobal_auditnslogpolicy_binding response[] = (tmglobal_auditnslogpolicy_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q12021
cachepolicylabel_cachepolicy_binding.get
train
public static cachepolicylabel_cachepolicy_binding[] get(nitro_service service, String labelname) throws Exception{ cachepolicylabel_cachepolicy_binding obj = new cachepolicylabel_cachepolicy_binding(); obj.set_labelname(labelname); cachepolicylabel_cachepolicy_binding response[] = (cachepolicylabel_cachepolicy_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q12022
sslcrl.add
train
public static base_response add(nitro_service client, sslcrl resource) throws Exception { sslcrl addresource = new sslcrl(); addresource.crlname = resource.crlname; addresource.crlpath = resource.crlpath; addresource.inform = resource.inform; addresource.refresh = resource.refresh; addresource.cacert = resource.cacert; addresource.method = resource.method; addresource.server = resource.server; addresource.url = resource.url; addresource.port = resource.port; addresource.basedn = resource.basedn; addresource.scope = resource.scope; addresource.interval = resource.interval; addresource.day = resource.day; addresource.time = resource.time; addresource.binddn = resource.binddn; addresource.password = resource.password; addresource.binary = resource.binary; return addresource.add_resource(client); }
java
{ "resource": "" }
q12023
sslcrl.add
train
public static base_responses add(nitro_service client, sslcrl resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { sslcrl addresources[] = new sslcrl[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new sslcrl(); addresources[i].crlname = resources[i].crlname; addresources[i].crlpath = resources[i].crlpath; addresources[i].inform = resources[i].inform; addresources[i].refresh = resources[i].refresh; addresources[i].cacert = resources[i].cacert; addresources[i].method = resources[i].method; addresources[i].server = resources[i].server; addresources[i].url = resources[i].url; addresources[i].port = resources[i].port; addresources[i].basedn = resources[i].basedn; addresources[i].scope = resources[i].scope; addresources[i].interval = resources[i].interval; addresources[i].day = resources[i].day; addresources[i].time = resources[i].time; addresources[i].binddn = resources[i].binddn; addresources[i].password = resources[i].password; addresources[i].binary = resources[i].binary; } result = add_bulk_request(client, addresources); } return result; }
java
{ "resource": "" }
q12024
sslcrl.create
train
public static base_response create(nitro_service client, sslcrl resource) throws Exception { sslcrl createresource = new sslcrl(); createresource.cacertfile = resource.cacertfile; createresource.cakeyfile = resource.cakeyfile; createresource.indexfile = resource.indexfile; createresource.revoke = resource.revoke; createresource.gencrl = resource.gencrl; createresource.password = resource.password; return createresource.perform_operation(client,"create"); }
java
{ "resource": "" }
q12025
sslcrl.create
train
public static base_responses create(nitro_service client, sslcrl resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { sslcrl createresources[] = new sslcrl[resources.length]; for (int i=0;i<resources.length;i++){ createresources[i] = new sslcrl(); createresources[i].cacertfile = resources[i].cacertfile; createresources[i].cakeyfile = resources[i].cakeyfile; createresources[i].indexfile = resources[i].indexfile; createresources[i].revoke = resources[i].revoke; createresources[i].gencrl = resources[i].gencrl; createresources[i].password = resources[i].password; } result = perform_operation_bulk_request(client, createresources,"create"); } return result; }
java
{ "resource": "" }
q12026
sslcrl.delete
train
public static base_response delete(nitro_service client, String crlname) throws Exception { sslcrl deleteresource = new sslcrl(); deleteresource.crlname = crlname; return deleteresource.delete_resource(client); }
java
{ "resource": "" }
q12027
sslcrl.delete
train
public static base_responses delete(nitro_service client, String crlname[]) throws Exception { base_responses result = null; if (crlname != null && crlname.length > 0) { sslcrl deleteresources[] = new sslcrl[crlname.length]; for (int i=0;i<crlname.length;i++){ deleteresources[i] = new sslcrl(); deleteresources[i].crlname = crlname[i]; } result = delete_bulk_request(client, deleteresources); } return result; }
java
{ "resource": "" }
q12028
sslcrl.update
train
public static base_response update(nitro_service client, sslcrl resource) throws Exception { sslcrl updateresource = new sslcrl(); updateresource.crlname = resource.crlname; updateresource.refresh = resource.refresh; updateresource.cacert = resource.cacert; updateresource.server = resource.server; updateresource.method = resource.method; updateresource.url = resource.url; updateresource.port = resource.port; updateresource.basedn = resource.basedn; updateresource.scope = resource.scope; updateresource.interval = resource.interval; updateresource.day = resource.day; updateresource.time = resource.time; updateresource.binddn = resource.binddn; updateresource.password = resource.password; updateresource.binary = resource.binary; return updateresource.update_resource(client); }
java
{ "resource": "" }
q12029
sslcrl.update
train
public static base_responses update(nitro_service client, sslcrl resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { sslcrl updateresources[] = new sslcrl[resources.length]; for (int i=0;i<resources.length;i++){ updateresources[i] = new sslcrl(); updateresources[i].crlname = resources[i].crlname; updateresources[i].refresh = resources[i].refresh; updateresources[i].cacert = resources[i].cacert; updateresources[i].server = resources[i].server; updateresources[i].method = resources[i].method; updateresources[i].url = resources[i].url; updateresources[i].port = resources[i].port; updateresources[i].basedn = resources[i].basedn; updateresources[i].scope = resources[i].scope; updateresources[i].interval = resources[i].interval; updateresources[i].day = resources[i].day; updateresources[i].time = resources[i].time; updateresources[i].binddn = resources[i].binddn; updateresources[i].password = resources[i].password; updateresources[i].binary = resources[i].binary; } result = update_bulk_request(client, updateresources); } return result; }
java
{ "resource": "" }
q12030
sslcrl.unset
train
public static base_response unset(nitro_service client, sslcrl resource, String[] args) throws Exception{ sslcrl unsetresource = new sslcrl(); unsetresource.crlname = resource.crlname; return unsetresource.unset_resource(client,args); }
java
{ "resource": "" }
q12031
sslcrl.unset
train
public static base_responses unset(nitro_service client, String crlname[], String args[]) throws Exception { base_responses result = null; if (crlname != null && crlname.length > 0) { sslcrl unsetresources[] = new sslcrl[crlname.length]; for (int i=0;i<crlname.length;i++){ unsetresources[i] = new sslcrl(); unsetresources[i].crlname = crlname[i]; } result = unset_bulk_request(client, unsetresources,args); } return result; }
java
{ "resource": "" }
q12032
sslcrl.get
train
public static sslcrl[] get(nitro_service service) throws Exception{ sslcrl obj = new sslcrl(); sslcrl[] response = (sslcrl[])obj.get_resources(service); return response; }
java
{ "resource": "" }
q12033
sslcrl.get
train
public static sslcrl get(nitro_service service, String crlname) throws Exception{ sslcrl obj = new sslcrl(); obj.set_crlname(crlname); sslcrl response = (sslcrl) obj.get_resource(service); return response; }
java
{ "resource": "" }
q12034
sslcrl.get
train
public static sslcrl[] get(nitro_service service, String crlname[]) throws Exception{ if (crlname !=null && crlname.length>0) { sslcrl response[] = new sslcrl[crlname.length]; sslcrl obj[] = new sslcrl[crlname.length]; for (int i=0;i<crlname.length;i++) { obj[i] = new sslcrl(); obj[i].set_crlname(crlname[i]); response[i] = (sslcrl) obj[i].get_resource(service); } return response; } return null; }
java
{ "resource": "" }
q12035
l3param.update
train
public static base_response update(nitro_service client, l3param resource) throws Exception { l3param updateresource = new l3param(); updateresource.srcnat = resource.srcnat; updateresource.icmpgenratethreshold = resource.icmpgenratethreshold; updateresource.overridernat = resource.overridernat; updateresource.dropdfflag = resource.dropdfflag; updateresource.miproundrobin = resource.miproundrobin; updateresource.externalloopback = resource.externalloopback; updateresource.tnlpmtuwoconn = resource.tnlpmtuwoconn; updateresource.usipserverstraypkt = resource.usipserverstraypkt; updateresource.forwardicmpfragments = resource.forwardicmpfragments; updateresource.dropipfragments = resource.dropipfragments; updateresource.acllogtime = resource.acllogtime; return updateresource.update_resource(client); }
java
{ "resource": "" }
q12036
l3param.unset
train
public static base_response unset(nitro_service client, l3param resource, String[] args) throws Exception{ l3param unsetresource = new l3param(); return unsetresource.unset_resource(client,args); }
java
{ "resource": "" }
q12037
l3param.get
train
public static l3param get(nitro_service service) throws Exception{ l3param obj = new l3param(); l3param[] response = (l3param[])obj.get_resources(service); return response[0]; }
java
{ "resource": "" }
q12038
responderpolicy_responderpolicylabel_binding.get
train
public static responderpolicy_responderpolicylabel_binding[] get(nitro_service service, String name) throws Exception{ responderpolicy_responderpolicylabel_binding obj = new responderpolicy_responderpolicylabel_binding(); obj.set_name(name); responderpolicy_responderpolicylabel_binding response[] = (responderpolicy_responderpolicylabel_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q12039
appflowpolicy_lbvserver_binding.get
train
public static appflowpolicy_lbvserver_binding[] get(nitro_service service, String name) throws Exception{ appflowpolicy_lbvserver_binding obj = new appflowpolicy_lbvserver_binding(); obj.set_name(name); appflowpolicy_lbvserver_binding response[] = (appflowpolicy_lbvserver_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q12040
ntpsync.enable
train
public static base_response enable(nitro_service client) throws Exception { ntpsync enableresource = new ntpsync(); return enableresource.perform_operation(client,"enable"); }
java
{ "resource": "" }
q12041
ntpsync.disable
train
public static base_response disable(nitro_service client) throws Exception { ntpsync disableresource = new ntpsync(); return disableresource.perform_operation(client,"disable"); }
java
{ "resource": "" }
q12042
ntpsync.get
train
public static ntpsync get(nitro_service service) throws Exception{ ntpsync obj = new ntpsync(); ntpsync[] response = (ntpsync[])obj.get_resources(service); return response[0]; }
java
{ "resource": "" }
q12043
vlan_stats.get
train
public static vlan_stats[] get(nitro_service service) throws Exception{ vlan_stats obj = new vlan_stats(); vlan_stats[] response = (vlan_stats[])obj.stat_resources(service); return response; }
java
{ "resource": "" }
q12044
vlan_stats.get
train
public static vlan_stats get(nitro_service service, Long id) throws Exception{ vlan_stats obj = new vlan_stats(); obj.set_id(id); vlan_stats response = (vlan_stats) obj.stat_resource(service); return response; }
java
{ "resource": "" }
q12045
AbstractList.checkRangeFromTo
train
protected static void checkRangeFromTo(int from, int to, int theSize) { if (to==from-1) return; if (from<0 || from>to || to>=theSize) throw new IndexOutOfBoundsException("from: "+from+", to: "+to+", size="+theSize); }
java
{ "resource": "" }
q12046
lbvserver_authorizationpolicy_binding.get
train
public static lbvserver_authorizationpolicy_binding[] get(nitro_service service, String name) throws Exception{ lbvserver_authorizationpolicy_binding obj = new lbvserver_authorizationpolicy_binding(); obj.set_name(name); lbvserver_authorizationpolicy_binding response[] = (lbvserver_authorizationpolicy_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q12047
vpntrafficaction.add
train
public static base_response add(nitro_service client, vpntrafficaction resource) throws Exception { vpntrafficaction addresource = new vpntrafficaction(); addresource.name = resource.name; addresource.qual = resource.qual; addresource.apptimeout = resource.apptimeout; addresource.sso = resource.sso; addresource.formssoaction = resource.formssoaction; addresource.fta = resource.fta; addresource.wanscaler = resource.wanscaler; addresource.kcdaccount = resource.kcdaccount; addresource.samlssoprofile = resource.samlssoprofile; return addresource.add_resource(client); }
java
{ "resource": "" }
q12048
vpntrafficaction.add
train
public static base_responses add(nitro_service client, vpntrafficaction resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { vpntrafficaction addresources[] = new vpntrafficaction[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new vpntrafficaction(); addresources[i].name = resources[i].name; addresources[i].qual = resources[i].qual; addresources[i].apptimeout = resources[i].apptimeout; addresources[i].sso = resources[i].sso; addresources[i].formssoaction = resources[i].formssoaction; addresources[i].fta = resources[i].fta; addresources[i].wanscaler = resources[i].wanscaler; addresources[i].kcdaccount = resources[i].kcdaccount; addresources[i].samlssoprofile = resources[i].samlssoprofile; } result = add_bulk_request(client, addresources); } return result; }
java
{ "resource": "" }
q12049
vpntrafficaction.update
train
public static base_response update(nitro_service client, vpntrafficaction resource) throws Exception { vpntrafficaction updateresource = new vpntrafficaction(); updateresource.name = resource.name; updateresource.apptimeout = resource.apptimeout; updateresource.sso = resource.sso; updateresource.formssoaction = resource.formssoaction; updateresource.fta = resource.fta; updateresource.wanscaler = resource.wanscaler; updateresource.kcdaccount = resource.kcdaccount; updateresource.samlssoprofile = resource.samlssoprofile; return updateresource.update_resource(client); }
java
{ "resource": "" }
q12050
vpntrafficaction.update
train
public static base_responses update(nitro_service client, vpntrafficaction resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { vpntrafficaction updateresources[] = new vpntrafficaction[resources.length]; for (int i=0;i<resources.length;i++){ updateresources[i] = new vpntrafficaction(); updateresources[i].name = resources[i].name; updateresources[i].apptimeout = resources[i].apptimeout; updateresources[i].sso = resources[i].sso; updateresources[i].formssoaction = resources[i].formssoaction; updateresources[i].fta = resources[i].fta; updateresources[i].wanscaler = resources[i].wanscaler; updateresources[i].kcdaccount = resources[i].kcdaccount; updateresources[i].samlssoprofile = resources[i].samlssoprofile; } result = update_bulk_request(client, updateresources); } return result; }
java
{ "resource": "" }
q12051
vpntrafficaction.get
train
public static vpntrafficaction[] get(nitro_service service) throws Exception{ vpntrafficaction obj = new vpntrafficaction(); vpntrafficaction[] response = (vpntrafficaction[])obj.get_resources(service); return response; }
java
{ "resource": "" }
q12052
vpntrafficaction.get
train
public static vpntrafficaction get(nitro_service service, String name) throws Exception{ vpntrafficaction obj = new vpntrafficaction(); obj.set_name(name); vpntrafficaction response = (vpntrafficaction) obj.get_resource(service); return response; }
java
{ "resource": "" }
q12053
tmtrafficpolicy.get
train
public static tmtrafficpolicy[] get(nitro_service service, options option) throws Exception{ tmtrafficpolicy obj = new tmtrafficpolicy(); tmtrafficpolicy[] response = (tmtrafficpolicy[])obj.get_resources(service,option); return response; }
java
{ "resource": "" }
q12054
tmtrafficpolicy.get
train
public static tmtrafficpolicy get(nitro_service service, String name) throws Exception{ tmtrafficpolicy obj = new tmtrafficpolicy(); obj.set_name(name); tmtrafficpolicy response = (tmtrafficpolicy) obj.get_resource(service); return response; }
java
{ "resource": "" }
q12055
aaagroup_tmsessionpolicy_binding.get
train
public static aaagroup_tmsessionpolicy_binding[] get(nitro_service service, String groupname) throws Exception{ aaagroup_tmsessionpolicy_binding obj = new aaagroup_tmsessionpolicy_binding(); obj.set_groupname(groupname); aaagroup_tmsessionpolicy_binding response[] = (aaagroup_tmsessionpolicy_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q12056
sslcrl_binding.get
train
public static sslcrl_binding get(nitro_service service, String crlname) throws Exception{ sslcrl_binding obj = new sslcrl_binding(); obj.set_crlname(crlname); sslcrl_binding response = (sslcrl_binding) obj.get_resource(service); return response; }
java
{ "resource": "" }
q12057
SequenceSampler.bestSequence
train
public int[] bestSequence(SequenceModel ts) { int[] sample = new int[ts.length()+ts.leftWindow()]; for (int pos = ts.leftWindow(); pos < sample.length; pos++) { double[] scores = ts.scoresOf(sample, pos); double total = 0.0; for (int i = 0; i < scores.length; i++) { scores[i] = Math.exp(scores[i]); } ArrayMath.normalize(scores); int l = ArrayMath.sampleFromDistribution(scores); sample[pos] = ts.getPossibleValues(pos)[l]; } return sample; }
java
{ "resource": "" }
q12058
auditnslogpolicy_csvserver_binding.get
train
public static auditnslogpolicy_csvserver_binding[] get(nitro_service service, String name) throws Exception{ auditnslogpolicy_csvserver_binding obj = new auditnslogpolicy_csvserver_binding(); obj.set_name(name); auditnslogpolicy_csvserver_binding response[] = (auditnslogpolicy_csvserver_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q12059
authenticationcertpolicy_vpnglobal_binding.get
train
public static authenticationcertpolicy_vpnglobal_binding[] get(nitro_service service, String name) throws Exception{ authenticationcertpolicy_vpnglobal_binding obj = new authenticationcertpolicy_vpnglobal_binding(); obj.set_name(name); authenticationcertpolicy_vpnglobal_binding response[] = (authenticationcertpolicy_vpnglobal_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q12060
sslcertreq.create
train
public static base_response create(nitro_service client, sslcertreq resource) throws Exception { sslcertreq createresource = new sslcertreq(); createresource.reqfile = resource.reqfile; createresource.keyfile = resource.keyfile; createresource.fipskeyname = resource.fipskeyname; createresource.keyform = resource.keyform; createresource.pempassphrase = resource.pempassphrase; createresource.countryname = resource.countryname; createresource.statename = resource.statename; createresource.organizationname = resource.organizationname; createresource.organizationunitname = resource.organizationunitname; createresource.localityname = resource.localityname; createresource.commonname = resource.commonname; createresource.emailaddress = resource.emailaddress; createresource.challengepassword = resource.challengepassword; createresource.companyname = resource.companyname; return createresource.perform_operation(client,"create"); }
java
{ "resource": "" }
q12061
snmpoid.get
train
public static snmpoid[] get(nitro_service service, snmpoid_args args) throws Exception{ snmpoid obj = new snmpoid(); options option = new options(); option.set_args(nitro_util.object_to_string_withoutquotes(args)); snmpoid[] response = (snmpoid[])obj.get_resources(service, option); return response; }
java
{ "resource": "" }
q12062
MtasSpanRecurrenceSpans.toMatchDoc
train
int toMatchDoc() throws IOException { while (true) { if (findMatches()) { return docID(); } resetQueue(); if (spans.nextDoc() == NO_MORE_DOCS) { return NO_MORE_DOCS; } } }
java
{ "resource": "" }
q12063
MtasSpanRecurrenceSpans.collectSpan
train
private boolean collectSpan() throws IOException { if (lastSpan) { return false; } else if (spans.nextStartPosition() == NO_MORE_POSITIONS) { lastSpan = true; return false; } else { queueSpans.add(new Match(spans.startPosition(), spans.endPosition())); lastStartPosition = spans.startPosition(); return true; } }
java
{ "resource": "" }
q12064
MtasSpanRecurrenceSpans.expandWithIgnoreItem
train
private List<Match> expandWithIgnoreItem(int docId, Match match) { List<Match> list = new ArrayList<>(); try { Set<Integer> ignoreList = ignoreItem.getFullEndPositionList(docId, match.endPosition); if (ignoreList != null) { for (Integer endPosition : ignoreList) { list.add(new Match(match.startPosition, endPosition)); } } } catch (IOException e) { log.debug(e); } return list; }
java
{ "resource": "" }
q12065
csvserver_binding.get
train
public static csvserver_binding get(nitro_service service, String name) throws Exception{ csvserver_binding obj = new csvserver_binding(); obj.set_name(name); csvserver_binding response = (csvserver_binding) obj.get_resource(service); return response; }
java
{ "resource": "" }
q12066
transformglobal_binding.get
train
public static transformglobal_binding get(nitro_service service) throws Exception{ transformglobal_binding obj = new transformglobal_binding(); transformglobal_binding response = (transformglobal_binding) obj.get_resource(service); return response; }
java
{ "resource": "" }
q12067
aaagroup_vpnurl_binding.get
train
public static aaagroup_vpnurl_binding[] get(nitro_service service, String groupname) throws Exception{ aaagroup_vpnurl_binding obj = new aaagroup_vpnurl_binding(); obj.set_groupname(groupname); aaagroup_vpnurl_binding response[] = (aaagroup_vpnurl_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q12068
IntervalTreeNode.addList
train
final public void addList(ArrayList<MtasTreeHit<T>> list) { if (list != null) { lists.add(list); } }
java
{ "resource": "" }
q12069
MtasTokenizer.constructTokenCollection
train
private void constructTokenCollection(final Reader reader) throws MtasConfigException, MtasParserException { tokenCollection = null; try { Constructor<?> c = Class.forName(parserName) .getDeclaredConstructor(MtasConfiguration.class); Object p = c.newInstance(parserConfiguration); if (p instanceof MtasParser) { MtasParser parser = (MtasParser) p; tokenCollection = parser.createTokenCollection(reader); return; } else { throw new MtasConfigException("no instance of MtasParser"); } } catch (MtasParserException e) { log.debug(e); tokenCollection = new MtasTokenCollection(); throw new MtasParserException(e.getMessage()); } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException | ClassNotFoundException | InstantiationException e) { log.debug(e); throw new MtasConfigException( e.getClass().getName() + " : '" + e.getMessage() + "'"); } }
java
{ "resource": "" }
q12070
MtasTokenizer.readConfigurationFile
train
private void readConfigurationFile(final String configFile) { InputStream is; try { is = new FileInputStream(configFile); processConfiguration(MtasConfiguration.readConfiguration(is)); is.close(); } catch (FileNotFoundException e) { log.error("Couldn't find " + configFile, e); } catch (IOException e) { log.error("Couldn't read " + configFile, e); } }
java
{ "resource": "" }
q12071
MtasTokenizer.processConfiguration
train
private void processConfiguration(final MtasConfiguration config) throws IOException { HashMap<String, Integer> indexEncodingMapper = new HashMap<>(); indexEncodingMapper.put("payload", MtasPayloadEncoder.ENCODE_PAYLOAD); indexEncodingMapper.put("offset", MtasPayloadEncoder.ENCODE_OFFSET); indexEncodingMapper.put("realoffset", MtasPayloadEncoder.ENCODE_REALOFFSET); indexEncodingMapper.put("parent", MtasPayloadEncoder.ENCODE_PARENT); // process if (config != null) { for (int i = 0; i < config.children.size(); i++) { if (config.children.get(i).name.equals(CONFIGURATION_MTAS_INDEX)) { MtasConfiguration index = config.children.get(i); for (int j = 0; j < index.children.size(); j++) { if (indexEncodingMapper.containsKey(index.children.get(j).name)) { String value = index.children.get(j).attributes.get(CONFIGURATION_MTAS_INDEX_ATTRIBUTE); if ((value.equals(VALUE_TRUE)) || (value.equals(VALUE_1))) { encodingFlags |= indexEncodingMapper .get(index.children.get(j).name); } else if ((value.equals(VALUE_FALSE)) || (value.equals(VALUE_0))) { encodingFlags &= ~indexEncodingMapper .get(index.children.get(j).name); } } } } else if (config.children.get(i).name.equals(CONFIGURATION_MTAS_PARSER)) { if (config.children.get(i).attributes.containsKey(CONFIGURATION_MTAS_PARSER_ATTRIBUTE)) { parserName = config.children.get(i).attributes.get(CONFIGURATION_MTAS_PARSER_ATTRIBUTE); parserConfiguration = config.children.get(i); } else { throw new IOException("no parser configuration"); } } } } else { throw new IOException("no (valid) configuration"); } }
java
{ "resource": "" }
q12072
nitro_util.encode
train
public static String encode(String str) { try { return java.net.URLEncoder.encode(str, "UTF-8"); } catch(java.io.UnsupportedEncodingException ue) { return str; } }
java
{ "resource": "" }
q12073
aaatacacsparams.update
train
public static base_response update(nitro_service client, aaatacacsparams resource) throws Exception { aaatacacsparams updateresource = new aaatacacsparams(); updateresource.serverip = resource.serverip; updateresource.serverport = resource.serverport; updateresource.authtimeout = resource.authtimeout; updateresource.tacacssecret = resource.tacacssecret; updateresource.authorization = resource.authorization; updateresource.accounting = resource.accounting; updateresource.auditfailedcmds = resource.auditfailedcmds; updateresource.defaultauthenticationgroup = resource.defaultauthenticationgroup; return updateresource.update_resource(client); }
java
{ "resource": "" }
q12074
aaatacacsparams.unset
train
public static base_response unset(nitro_service client, aaatacacsparams resource, String[] args) throws Exception{ aaatacacsparams unsetresource = new aaatacacsparams(); return unsetresource.unset_resource(client,args); }
java
{ "resource": "" }
q12075
aaatacacsparams.get
train
public static aaatacacsparams get(nitro_service service) throws Exception{ aaatacacsparams obj = new aaatacacsparams(); aaatacacsparams[] response = (aaatacacsparams[])obj.get_resources(service); return response[0]; }
java
{ "resource": "" }
q12076
MtasParser.initParser
train
protected void initParser() throws MtasConfigException { if (config != null) { // find namespaceURI for (int i = 0; i < config.children.size(); i++) { MtasConfiguration current = config.children.get(i); if (current.name.equals("autorepair")) { autorepair = current.attributes.get("value").equals("true"); } if (current.name.equals("makeunique")) { makeunique = current.attributes.get("value").equals("true"); } } } }
java
{ "resource": "" }
q12077
bridgegroup.add
train
public static base_response add(nitro_service client, bridgegroup resource) throws Exception { bridgegroup addresource = new bridgegroup(); addresource.id = resource.id; addresource.ipv6dynamicrouting = resource.ipv6dynamicrouting; return addresource.add_resource(client); }
java
{ "resource": "" }
q12078
bridgegroup.update
train
public static base_response update(nitro_service client, bridgegroup resource) throws Exception { bridgegroup updateresource = new bridgegroup(); updateresource.id = resource.id; updateresource.ipv6dynamicrouting = resource.ipv6dynamicrouting; return updateresource.update_resource(client); }
java
{ "resource": "" }
q12079
bridgegroup.update
train
public static base_responses update(nitro_service client, bridgegroup resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { bridgegroup updateresources[] = new bridgegroup[resources.length]; for (int i=0;i<resources.length;i++){ updateresources[i] = new bridgegroup(); updateresources[i].id = resources[i].id; updateresources[i].ipv6dynamicrouting = resources[i].ipv6dynamicrouting; } result = update_bulk_request(client, updateresources); } return result; }
java
{ "resource": "" }
q12080
bridgegroup.get
train
public static bridgegroup[] get(nitro_service service) throws Exception{ bridgegroup obj = new bridgegroup(); bridgegroup[] response = (bridgegroup[])obj.get_resources(service); return response; }
java
{ "resource": "" }
q12081
bridgegroup.get
train
public static bridgegroup get(nitro_service service, Long id) throws Exception{ bridgegroup obj = new bridgegroup(); obj.set_id(id); bridgegroup response = (bridgegroup) obj.get_resource(service); return response; }
java
{ "resource": "" }
q12082
tmtrafficpolicy_stats.get
train
public static tmtrafficpolicy_stats[] get(nitro_service service) throws Exception{ tmtrafficpolicy_stats obj = new tmtrafficpolicy_stats(); tmtrafficpolicy_stats[] response = (tmtrafficpolicy_stats[])obj.stat_resources(service); return response; }
java
{ "resource": "" }
q12083
tmtrafficpolicy_stats.get
train
public static tmtrafficpolicy_stats get(nitro_service service, String name) throws Exception{ tmtrafficpolicy_stats obj = new tmtrafficpolicy_stats(); obj.set_name(name); tmtrafficpolicy_stats response = (tmtrafficpolicy_stats) obj.stat_resource(service); return response; }
java
{ "resource": "" }
q12084
cmppolicy_lbvserver_binding.get
train
public static cmppolicy_lbvserver_binding[] get(nitro_service service, String name) throws Exception{ cmppolicy_lbvserver_binding obj = new cmppolicy_lbvserver_binding(); obj.set_name(name); cmppolicy_lbvserver_binding response[] = (cmppolicy_lbvserver_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q12085
lbmetrictable.add
train
public static base_response add(nitro_service client, lbmetrictable resource) throws Exception { lbmetrictable addresource = new lbmetrictable(); addresource.metrictable = resource.metrictable; return addresource.add_resource(client); }
java
{ "resource": "" }
q12086
lbmetrictable.add
train
public static base_responses add(nitro_service client, lbmetrictable resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { lbmetrictable addresources[] = new lbmetrictable[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new lbmetrictable(); addresources[i].metrictable = resources[i].metrictable; } result = add_bulk_request(client, addresources); } return result; }
java
{ "resource": "" }
q12087
lbmetrictable.delete
train
public static base_response delete(nitro_service client, lbmetrictable resource) throws Exception { lbmetrictable deleteresource = new lbmetrictable(); deleteresource.metrictable = resource.metrictable; return deleteresource.delete_resource(client); }
java
{ "resource": "" }
q12088
lbmetrictable.delete
train
public static base_responses delete(nitro_service client, String metrictable[]) throws Exception { base_responses result = null; if (metrictable != null && metrictable.length > 0) { lbmetrictable deleteresources[] = new lbmetrictable[metrictable.length]; for (int i=0;i<metrictable.length;i++){ deleteresources[i] = new lbmetrictable(); deleteresources[i].metrictable = metrictable[i]; } result = delete_bulk_request(client, deleteresources); } return result; }
java
{ "resource": "" }
q12089
lbmetrictable.update
train
public static base_response update(nitro_service client, lbmetrictable resource) throws Exception { lbmetrictable updateresource = new lbmetrictable(); updateresource.metrictable = resource.metrictable; updateresource.metric = resource.metric; updateresource.Snmpoid = resource.Snmpoid; return updateresource.update_resource(client); }
java
{ "resource": "" }
q12090
lbmetrictable.update
train
public static base_responses update(nitro_service client, lbmetrictable resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { lbmetrictable updateresources[] = new lbmetrictable[resources.length]; for (int i=0;i<resources.length;i++){ updateresources[i] = new lbmetrictable(); updateresources[i].metrictable = resources[i].metrictable; updateresources[i].metric = resources[i].metric; updateresources[i].Snmpoid = resources[i].Snmpoid; } result = update_bulk_request(client, updateresources); } return result; }
java
{ "resource": "" }
q12091
lbmetrictable.get
train
public static lbmetrictable[] get(nitro_service service) throws Exception{ lbmetrictable obj = new lbmetrictable(); lbmetrictable[] response = (lbmetrictable[])obj.get_resources(service); return response; }
java
{ "resource": "" }
q12092
lbmetrictable.get
train
public static lbmetrictable get(nitro_service service, String metrictable) throws Exception{ lbmetrictable obj = new lbmetrictable(); obj.set_metrictable(metrictable); lbmetrictable response = (lbmetrictable) obj.get_resource(service); return response; }
java
{ "resource": "" }
q12093
lbmetrictable.get
train
public static lbmetrictable[] get(nitro_service service, String metrictable[]) throws Exception{ if (metrictable !=null && metrictable.length>0) { lbmetrictable response[] = new lbmetrictable[metrictable.length]; lbmetrictable obj[] = new lbmetrictable[metrictable.length]; for (int i=0;i<metrictable.length;i++) { obj[i] = new lbmetrictable(); obj[i].set_metrictable(metrictable[i]); response[i] = (lbmetrictable) obj[i].get_resource(service); } return response; } return null; }
java
{ "resource": "" }
q12094
cspolicylabel_binding.get
train
public static cspolicylabel_binding get(nitro_service service, String labelname) throws Exception{ cspolicylabel_binding obj = new cspolicylabel_binding(); obj.set_labelname(labelname); cspolicylabel_binding response = (cspolicylabel_binding) obj.get_resource(service); return response; }
java
{ "resource": "" }
q12095
vpnvserver_authenticationcertpolicy_binding.get
train
public static vpnvserver_authenticationcertpolicy_binding[] get(nitro_service service, String name) throws Exception{ vpnvserver_authenticationcertpolicy_binding obj = new vpnvserver_authenticationcertpolicy_binding(); obj.set_name(name); vpnvserver_authenticationcertpolicy_binding response[] = (vpnvserver_authenticationcertpolicy_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q12096
vpnglobal_authenticationlocalpolicy_binding.get
train
public static vpnglobal_authenticationlocalpolicy_binding[] get(nitro_service service) throws Exception{ vpnglobal_authenticationlocalpolicy_binding obj = new vpnglobal_authenticationlocalpolicy_binding(); vpnglobal_authenticationlocalpolicy_binding response[] = (vpnglobal_authenticationlocalpolicy_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q12097
rewritepolicy_binding.get
train
public static rewritepolicy_binding get(nitro_service service, String name) throws Exception{ rewritepolicy_binding obj = new rewritepolicy_binding(); obj.set_name(name); rewritepolicy_binding response = (rewritepolicy_binding) obj.get_resource(service); return response; }
java
{ "resource": "" }
q12098
Interface_stats.get
train
public static Interface_stats[] get(nitro_service service) throws Exception{ Interface_stats obj = new Interface_stats(); Interface_stats[] response = (Interface_stats[])obj.stat_resources(service); return response; }
java
{ "resource": "" }
q12099
Interface_stats.get
train
public static Interface_stats get(nitro_service service, String id) throws Exception{ Interface_stats obj = new Interface_stats(); obj.set_id(id); Interface_stats response = (Interface_stats) obj.stat_resource(service); return response; }
java
{ "resource": "" }