_id stringlengths 2 7 | title stringlengths 3 140 | partition stringclasses 3
values | text stringlengths 73 34.1k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q12300 | nsacl.enable | train | public static base_response enable(nitro_service client, String aclname) throws Exception {
nsacl enableresource = new nsacl();
enableresource.aclname = aclname;
return enableresource.perform_operation(client,"enable");
} | java | {
"resource": ""
} |
q12301 | nsacl.enable | train | public static base_responses enable(nitro_service client, nsacl resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
nsacl enableresources[] = new nsacl[resources.length];
for (int i=0;i<resources.length;i++){
enableresources[i] = new nsacl();
enableresources[i].aclname = resources[i].aclname;
}
result = perform_operation_bulk_request(client, enableresources,"enable");
}
return result;
} | java | {
"resource": ""
} |
q12302 | nsacl.disable | train | public static base_response disable(nitro_service client, String aclname) throws Exception {
nsacl disableresource = new nsacl();
disableresource.aclname = aclname;
return disableresource.perform_operation(client,"disable");
} | java | {
"resource": ""
} |
q12303 | nsacl.disable | train | public static base_responses disable(nitro_service client, String aclname[]) throws Exception {
base_responses result = null;
if (aclname != null && aclname.length > 0) {
nsacl disableresources[] = new nsacl[aclname.length];
for (int i=0;i<aclname.length;i++){
disableresources[i] = new nsacl();
disableresources[i].aclname = aclname[i];
}
result = perform_operation_bulk_request(client, disableresources,"disable");
}
return result;
} | java | {
"resource": ""
} |
q12304 | nsacl.rename | train | public static base_response rename(nitro_service client, nsacl resource, String new_aclname) throws Exception {
nsacl renameresource = new nsacl();
renameresource.aclname = resource.aclname;
return renameresource.rename_resource(client,new_aclname);
} | java | {
"resource": ""
} |
q12305 | nsacl.get | train | public static nsacl[] get(nitro_service service, options option) throws Exception{
nsacl obj = new nsacl();
nsacl[] response = (nsacl[])obj.get_resources(service,option);
return response;
} | java | {
"resource": ""
} |
q12306 | nsacl.get | train | public static nsacl get(nitro_service service, String aclname) throws Exception{
nsacl obj = new nsacl();
obj.set_aclname(aclname);
nsacl response = (nsacl) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q12307 | ColumnDocumentReaderAndWriter.printAnswers | train | public void printAnswers(List<CoreLabel> doc, PrintWriter out) {
for (CoreLabel wi : doc) {
String answer = wi.get(AnswerAnnotation.class);
String goldAnswer = wi.get(GoldAnswerAnnotation.class);
out.println(wi.word() + "\t" + goldAnswer + "\t" + answer);
}
out.println();
} | java | {
"resource": ""
} |
q12308 | hasync.Force | train | public static base_response Force(nitro_service client, hasync resource) throws Exception {
hasync Forceresource = new hasync();
Forceresource.force = resource.force;
Forceresource.save = resource.save;
return Forceresource.perform_operation(client,"Force");
} | java | {
"resource": ""
} |
q12309 | GrammaticalRelation.isAncestor | train | public boolean isAncestor(GrammaticalRelation gr) {
while (gr != null) {
// Changed this test from this == gr (mrsmith)
if (this.equals(gr)) { return true; }
gr = gr.parent;
}
return false;
} | java | {
"resource": ""
} |
q12310 | clusterinstance_clusternode_binding.get | train | public static clusterinstance_clusternode_binding[] get(nitro_service service, Long clid) throws Exception{
clusterinstance_clusternode_binding obj = new clusterinstance_clusternode_binding();
obj.set_clid(clid);
clusterinstance_clusternode_binding response[] = (clusterinstance_clusternode_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q12311 | clusterinstance_clusternode_binding.count | train | public static long count(nitro_service service, Long clid) throws Exception{
clusterinstance_clusternode_binding obj = new clusterinstance_clusternode_binding();
obj.set_clid(clid);
options option = new options();
option.set_count(true);
clusterinstance_clusternode_binding response[] = (clusterinstance_clusternode_binding[]) obj.get_resources(service,option);
if (response != null) {
return response[0].__count;
}
return 0;
} | java | {
"resource": ""
} |
q12312 | rewritepolicylabel_stats.get | train | public static rewritepolicylabel_stats[] get(nitro_service service) throws Exception{
rewritepolicylabel_stats obj = new rewritepolicylabel_stats();
rewritepolicylabel_stats[] response = (rewritepolicylabel_stats[])obj.stat_resources(service);
return response;
} | java | {
"resource": ""
} |
q12313 | rewritepolicylabel_stats.get | train | public static rewritepolicylabel_stats get(nitro_service service, String labelname) throws Exception{
rewritepolicylabel_stats obj = new rewritepolicylabel_stats();
obj.set_labelname(labelname);
rewritepolicylabel_stats response = (rewritepolicylabel_stats) obj.stat_resource(service);
return response;
} | java | {
"resource": ""
} |
q12314 | cachepolicy_lbvserver_binding.get | train | public static cachepolicy_lbvserver_binding[] get(nitro_service service, String policyname) throws Exception{
cachepolicy_lbvserver_binding obj = new cachepolicy_lbvserver_binding();
obj.set_policyname(policyname);
cachepolicy_lbvserver_binding response[] = (cachepolicy_lbvserver_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q12315 | systemgroup_binding.get | train | public static systemgroup_binding get(nitro_service service, String groupname) throws Exception{
systemgroup_binding obj = new systemgroup_binding();
obj.set_groupname(groupname);
systemgroup_binding response = (systemgroup_binding) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q12316 | MtasCQLParserSentenceCondition.addSentenceAsFirstOption | train | public void addSentenceAsFirstOption(MtasCQLParserSentenceCondition s)
throws ParseException {
if (!simplified) {
MtasCQLParserSentenceCondition sentenceCurrent;
List<MtasCQLParserSentenceCondition> sentenceSequence;
if (isBasic()) {
if (basicSentence == null) {
sentenceSequence = new ArrayList<MtasCQLParserSentenceCondition>();
sentenceCurrent = s;
sentenceSequence.add(sentenceCurrent);
sequenceList.add(sentenceSequence);
// not simple anymore
basic = false;
} else {
// add sentence as first option
sentenceSequence = new ArrayList<MtasCQLParserSentenceCondition>();
sentenceCurrent = s;
sentenceSequence.add(sentenceCurrent);
sequenceList.add(sentenceSequence);
// add previous basic sentence as new option
sentenceSequence = new ArrayList<MtasCQLParserSentenceCondition>();
sentenceCurrent = new MtasCQLParserSentenceCondition(basicSentence,
ignore, maximumIgnoreLength);
sentenceSequence.add(sentenceCurrent);
sequenceList.add(sentenceSequence);
basicSentence = null;
// not simple anymore
basic = false;
}
} else {
sentenceSequence = new ArrayList<MtasCQLParserSentenceCondition>();
sentenceCurrent = s;
sentenceSequence.add(sentenceCurrent);
List<List<MtasCQLParserSentenceCondition>> newsequenceList = new ArrayList<List<MtasCQLParserSentenceCondition>>();
newsequenceList.add(sentenceSequence);
newsequenceList.addAll(sequenceList);
sequenceList = newsequenceList;
}
} else {
throw new ParseException("already simplified");
}
} | java | {
"resource": ""
} |
q12317 | MtasCQLParserSentenceCondition.simplifySequence | train | private void simplifySequence(List<MtasCQLParserSentenceCondition> sequence)
throws ParseException {
List<MtasCQLParserSentenceCondition> newSequence = new ArrayList<MtasCQLParserSentenceCondition>();
MtasCQLParserSentenceCondition lastSentence = null;
for (MtasCQLParserSentenceCondition sentence : sequence) {
sentence.simplify();
if (lastSentence == null) {
lastSentence = sentence;
} else if (lastSentence.isBasic() && sentence.isBasic()) {
if (!lastSentence.isOptional() && !sentence.isOptional()
&& sentence.getMaximumOccurence() == 1
&& lastSentence.getMaximumOccurence() == 1) {
lastSentence.basicSentence.addBasicSentence(sentence.basicSentence);
} else {
newSequence.add(lastSentence);
lastSentence = sentence;
}
} else if (lastSentence.isBasic() && !sentence.isBasic()) {
if (sentence.isSingle() && !sentence.isOptional()
&& sentence.getMaximumOccurence() == 1
&& lastSentence.getMaximumOccurence() == 1) {
// add all items from (first) sequenceList potentially to the new
// sequence
for (MtasCQLParserSentenceCondition subSentence : sentence.sequenceList
.get(0)) {
newSequence.add(lastSentence);
lastSentence = subSentence;
}
} else {
// add sentence potentially to the new sequence
newSequence.add(lastSentence);
lastSentence = sentence;
}
} else if (!lastSentence.isBasic() && sentence.isBasic()) {
if (lastSentence.isSingle() && !lastSentence.isOptional()
&& sentence.getMaximumOccurence() == 1
&& lastSentence.getMaximumOccurence() == 1) {
// add basic sentence to end latest sequence
lastSentence
.addBasicSentenceToEndLatestSequence(sentence.basicSentence);
} else {
// add sentence potentially to the new sequence
newSequence.add(lastSentence);
lastSentence = sentence;
}
} else {
if (sentence.isSingle() && !sentence.isOptional()
&& lastSentence.isSingle() && !lastSentence.isOptional()
&& sentence.getMaximumOccurence() == 1
&& lastSentence.getMaximumOccurence() == 1) {
// combine sentences
for (MtasCQLParserSentenceCondition subSentence : sentence.sequenceList
.get(0)) {
lastSentence.sequenceList.get(0).add(subSentence);
}
} else {
// add sentence potentially to the new sequence (both not basic)
newSequence.add(lastSentence);
lastSentence = sentence;
}
}
}
// add last to newSequence
if (lastSentence != null) {
newSequence.add(lastSentence);
}
// replace content sequence with newSequence
sequence.clear();
sequence.addAll(newSequence);
} | java | {
"resource": ""
} |
q12318 | AbstractTreebankParserParams.pw | train | public PrintWriter pw(OutputStream o) {
String encoding = outputEncoding;
if (!java.nio.charset.Charset.isSupported(encoding)) {
System.out.println("Warning: desired encoding " + encoding + " not accepted. ");
System.out.println("Using UTF-8 to construct PrintWriter");
encoding = "UTF-8";
}
try {
return new PrintWriter(new OutputStreamWriter(o, encoding), true);
} catch (UnsupportedEncodingException e) {
System.out.println("Warning: desired encoding " + outputEncoding + " not accepted. " + e);
try {
return new PrintWriter(new OutputStreamWriter(o, "UTF-8"), true);
} catch (UnsupportedEncodingException e1) {
System.out.println("Something is really wrong. Your system doesn't even support UTF-8!" + e1);
return new PrintWriter(o, true);
}
}
} | java | {
"resource": ""
} |
q12319 | AbstractTreebankParserParams.untypedDependencyObjectify | train | public static Collection<List<String>> untypedDependencyObjectify(Tree t, HeadFinder hf, TreeTransformer collinizer) {
return dependencyObjectify(t, hf, collinizer, new UntypedDependencyTyper(hf));
} | java | {
"resource": ""
} |
q12320 | AbstractTreebankParserParams.typedDependencyObjectify | train | public static Collection<List<String>> typedDependencyObjectify(Tree t, HeadFinder hf, TreeTransformer collinizer) {
return dependencyObjectify(t, hf, collinizer, new TypedDependencyTyper(hf));
} | java | {
"resource": ""
} |
q12321 | AbstractTreebankParserParams.typedDependencyClasser | train | public static EquivalenceClasser<List<String>, String> typedDependencyClasser() {
return new EquivalenceClasser<List<String>, String>() {
public String equivalenceClass(List<String> s) {
if(s.get(5).equals(leftHeaded))
return s.get(2) + '(' + s.get(3) + "->" + s.get(4) + ')';
return s.get(2) + '(' + s.get(4) + "<-" + s.get(3) + ')';
}
};
} | java | {
"resource": ""
} |
q12322 | netbridge_nsip_binding.get | train | public static netbridge_nsip_binding[] get(nitro_service service, String name) throws Exception{
netbridge_nsip_binding obj = new netbridge_nsip_binding();
obj.set_name(name);
netbridge_nsip_binding response[] = (netbridge_nsip_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q12323 | transformprofile_transformaction_binding.get | train | public static transformprofile_transformaction_binding[] get(nitro_service service, String name) throws Exception{
transformprofile_transformaction_binding obj = new transformprofile_transformaction_binding();
obj.set_name(name);
transformprofile_transformaction_binding response[] = (transformprofile_transformaction_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q12324 | Distribution.getDistributionFromLogValues | train | public static <E> Distribution<E> getDistributionFromLogValues(Counter<E> counter) {
ClassicCounter<E> c = new ClassicCounter<E>();
// go through once to get the max
// shift all by max so as to minimize the possibility of underflow
double max = Counters.max(counter); // Thang 17Feb12: max should operate on counter instead of c, fixed!
for (E key : counter.keySet()) {
double count = Math.exp(counter.getCount(key) - max);
c.setCount(key, count);
}
return getDistribution(c);
} | java | {
"resource": ""
} |
q12325 | Distribution.laplaceSmoothedDistribution | train | public static <E> Distribution<E> laplaceSmoothedDistribution(Counter<E> counter, int numberOfKeys) {
return laplaceSmoothedDistribution(counter, numberOfKeys, 1.0);
} | java | {
"resource": ""
} |
q12326 | Distribution.laplaceWithExplicitUnknown | train | public static <E> Distribution<E> laplaceWithExplicitUnknown(Counter<E> counter, double lambda, E UNK) {
Distribution<E> norm = new Distribution<E>();
norm.counter = new ClassicCounter<E>();
double total = counter.totalCount() + (lambda * (counter.size() - 1));
norm.numberOfKeys = counter.size();
norm.reservedMass = 0.0;
for (E key : counter.keySet()) {
if (key.equals(UNK)) {
norm.counter.setCount(key, counter.getCount(key) / total);
} else {
norm.counter.setCount(key, (counter.getCount(key) + lambda) / total);
}
}
return norm;
} | java | {
"resource": ""
} |
q12327 | Distribution.goodTuringSmoothedCounter | train | public static <E> Distribution<E> goodTuringSmoothedCounter(Counter<E> counter, int numberOfKeys) {
// gather count-counts
int[] countCounts = getCountCounts(counter);
// if count-counts are unreliable, we shouldn't be using G-T
// revert to laplace
for (int i = 1; i <= 10; i++) {
if (countCounts[i] < 3) {
return laplaceSmoothedDistribution(counter, numberOfKeys, 0.5);
}
}
double observedMass = counter.totalCount();
double reservedMass = countCounts[1] / observedMass;
// calculate and cache adjusted frequencies
// also adjusting total mass of observed items
double[] adjustedFreq = new double[10];
for (int freq = 1; freq < 10; freq++) {
adjustedFreq[freq] = (double) (freq + 1) * (double) countCounts[freq + 1] / countCounts[freq];
observedMass -= (freq - adjustedFreq[freq]) * countCounts[freq];
}
double normFactor = (1.0 - reservedMass) / observedMass;
Distribution<E> norm = new Distribution<E>();
norm.counter = new ClassicCounter<E>();
// fill in the new Distribution, renormalizing as we go
for (E key : counter.keySet()) {
int origFreq = (int) Math.round(counter.getCount(key));
if (origFreq < 10) {
norm.counter.setCount(key, adjustedFreq[origFreq] * normFactor);
} else {
norm.counter.setCount(key, origFreq * normFactor);
}
}
norm.numberOfKeys = numberOfKeys;
norm.reservedMass = reservedMass;
return norm;
} | java | {
"resource": ""
} |
q12328 | Distribution.simpleGoodTuring | train | public static <E> Distribution<E> simpleGoodTuring(Counter<E> counter, int numberOfKeys) {
// check arguments
validateCounter(counter);
int numUnseen = numberOfKeys - counter.size();
if (numUnseen < 1)
throw new IllegalArgumentException(String.format("ERROR: numberOfKeys %d must be > size of counter %d!", numberOfKeys, counter.size()));
// do smoothing
int[][] cc = countCounts2IntArrays(collectCountCounts(counter));
int[] r = cc[0]; // counts
int[] n = cc[1]; // counts of counts
SimpleGoodTuring sgt = new SimpleGoodTuring(r, n);
// collate results
Counter<Integer> probsByCount = new ClassicCounter<Integer>();
double[] probs = sgt.getProbabilities();
for (int i = 0; i < probs.length; i++) {
probsByCount.setCount(r[i], probs[i]);
}
// make smoothed distribution
Distribution<E> dist = new Distribution<E>();
dist.counter = new ClassicCounter<E>();
for (Map.Entry<E, Double> entry : counter.entrySet()) {
E item = entry.getKey();
Integer count = (int) Math.round(entry.getValue());
dist.counter.setCount(item, probsByCount.getCount(count));
}
dist.numberOfKeys = numberOfKeys;
dist.reservedMass = sgt.getProbabilityForUnseen();
return dist;
} | java | {
"resource": ""
} |
q12329 | Distribution.dynamicCounterWithDirichletPrior | train | public static <E> Distribution<E> dynamicCounterWithDirichletPrior(Counter<E> c, Distribution<E> prior, double weight) {
double totalWeight = c.totalCount() + weight;
Distribution<E> norm = new DynamicDistribution<E>(prior, weight / totalWeight);
norm.counter = new ClassicCounter<E>();
// this might be done more efficiently with entrySet but there isn't a way to get
// the entrySet from a Counter now. In most cases c will be small(-ish) anyway
for (E key : c.keySet()) {
double count = c.getCount(key) / totalWeight;
prior.addToKeySet(key);
norm.counter.setCount(key, count);
}
norm.numberOfKeys = prior.numberOfKeys;
return norm;
} | java | {
"resource": ""
} |
q12330 | Distribution.distributionFromLogisticCounter | train | public static <E> Distribution<E> distributionFromLogisticCounter(Counter<E> cntr) {
double expSum = 0.0;
int numKeys = 0;
for (E key : cntr.keySet()) {
expSum += Math.exp(cntr.getCount(key));
numKeys++;
}
Distribution<E> probs = new Distribution<E>();
probs.counter = new ClassicCounter<E>();
probs.reservedMass = 0.0;
probs.numberOfKeys = numKeys;
for (E key : cntr.keySet()) {
probs.counter.setCount(key, Math.exp(cntr.getCount(key)) / expSum);
}
return probs;
} | java | {
"resource": ""
} |
q12331 | Distribution.probabilityOf | train | public double probabilityOf(E key) {
if (counter.containsKey(key)) {
return counter.getCount(key);
} else {
int remainingKeys = numberOfKeys - counter.size();
if (remainingKeys <= 0) {
return 0.0;
} else {
return (reservedMass / remainingKeys);
}
}
} | java | {
"resource": ""
} |
q12332 | appfwprofile_contenttype_binding.get | train | public static appfwprofile_contenttype_binding[] get(nitro_service service, String name) throws Exception{
appfwprofile_contenttype_binding obj = new appfwprofile_contenttype_binding();
obj.set_name(name);
appfwprofile_contenttype_binding response[] = (appfwprofile_contenttype_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q12333 | appflowglobal_appflowpolicy_binding.get | train | public static appflowglobal_appflowpolicy_binding[] get(nitro_service service) throws Exception{
appflowglobal_appflowpolicy_binding obj = new appflowglobal_appflowpolicy_binding();
appflowglobal_appflowpolicy_binding response[] = (appflowglobal_appflowpolicy_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q12334 | locationdata.clear | train | public static base_response clear(nitro_service client) throws Exception {
locationdata clearresource = new locationdata();
return clearresource.perform_operation(client,"clear");
} | java | {
"resource": ""
} |
q12335 | ssldsakey.create | train | public static base_response create(nitro_service client, ssldsakey resource) throws Exception {
ssldsakey createresource = new ssldsakey();
createresource.keyfile = resource.keyfile;
createresource.bits = resource.bits;
createresource.keyform = resource.keyform;
createresource.des = resource.des;
createresource.des3 = resource.des3;
createresource.password = resource.password;
return createresource.perform_operation(client,"create");
} | java | {
"resource": ""
} |
q12336 | lacp.update | train | public static base_response update(nitro_service client, lacp resource) throws Exception {
lacp updateresource = new lacp();
updateresource.syspriority = resource.syspriority;
updateresource.ownernode = resource.ownernode;
return updateresource.update_resource(client);
} | java | {
"resource": ""
} |
q12337 | lacp.update | train | public static base_responses update(nitro_service client, lacp resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
lacp updateresources[] = new lacp[resources.length];
for (int i=0;i<resources.length;i++){
updateresources[i] = new lacp();
updateresources[i].syspriority = resources[i].syspriority;
updateresources[i].ownernode = resources[i].ownernode;
}
result = update_bulk_request(client, updateresources);
}
return result;
} | java | {
"resource": ""
} |
q12338 | lacp.get | train | public static lacp[] get(nitro_service service) throws Exception{
lacp obj = new lacp();
lacp[] response = (lacp[])obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q12339 | lacp.get | train | public static lacp get(nitro_service service, Long ownernode) throws Exception{
lacp obj = new lacp();
obj.set_ownernode(ownernode);
lacp response = (lacp) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q12340 | EnglishGrammaticalRelations.getConj | train | public static GrammaticalRelation getConj(String conjunctionString) {
GrammaticalRelation result = conjs.get(conjunctionString);
if (result == null) {
synchronized(conjs) {
result = conjs.get(conjunctionString);
if (result == null) {
result = new GrammaticalRelation(Language.English, "conj", "conj_collapsed", null, CONJUNCT, conjunctionString);
conjs.put(conjunctionString, result);
threadSafeAddRelation(result);
}
}
}
return result;
} | java | {
"resource": ""
} |
q12341 | nat64.add | train | public static base_response add(nitro_service client, nat64 resource) throws Exception {
nat64 addresource = new nat64();
addresource.name = resource.name;
addresource.acl6name = resource.acl6name;
addresource.netprofile = resource.netprofile;
return addresource.add_resource(client);
} | java | {
"resource": ""
} |
q12342 | nat64.add | train | public static base_responses add(nitro_service client, nat64 resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
nat64 addresources[] = new nat64[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new nat64();
addresources[i].name = resources[i].name;
addresources[i].acl6name = resources[i].acl6name;
addresources[i].netprofile = resources[i].netprofile;
}
result = add_bulk_request(client, addresources);
}
return result;
} | java | {
"resource": ""
} |
q12343 | nat64.update | train | public static base_response update(nitro_service client, nat64 resource) throws Exception {
nat64 updateresource = new nat64();
updateresource.name = resource.name;
updateresource.acl6name = resource.acl6name;
updateresource.netprofile = resource.netprofile;
return updateresource.update_resource(client);
} | java | {
"resource": ""
} |
q12344 | nat64.get | train | public static nat64[] get(nitro_service service) throws Exception{
nat64 obj = new nat64();
nat64[] response = (nat64[])obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q12345 | nat64.get | train | public static nat64 get(nitro_service service, String name) throws Exception{
nat64 obj = new nat64();
obj.set_name(name);
nat64 response = (nat64) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q12346 | nstimer.add | train | public static base_response add(nitro_service client, nstimer resource) throws Exception {
nstimer addresource = new nstimer();
addresource.name = resource.name;
addresource.interval = resource.interval;
addresource.unit = resource.unit;
addresource.comment = resource.comment;
return addresource.add_resource(client);
} | java | {
"resource": ""
} |
q12347 | nstimer.add | train | public static base_responses add(nitro_service client, nstimer resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
nstimer addresources[] = new nstimer[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new nstimer();
addresources[i].name = resources[i].name;
addresources[i].interval = resources[i].interval;
addresources[i].unit = resources[i].unit;
addresources[i].comment = resources[i].comment;
}
result = add_bulk_request(client, addresources);
}
return result;
} | java | {
"resource": ""
} |
q12348 | nstimer.update | train | public static base_response update(nitro_service client, nstimer resource) throws Exception {
nstimer updateresource = new nstimer();
updateresource.name = resource.name;
updateresource.interval = resource.interval;
updateresource.unit = resource.unit;
updateresource.comment = resource.comment;
return updateresource.update_resource(client);
} | java | {
"resource": ""
} |
q12349 | nstimer.update | train | public static base_responses update(nitro_service client, nstimer resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
nstimer updateresources[] = new nstimer[resources.length];
for (int i=0;i<resources.length;i++){
updateresources[i] = new nstimer();
updateresources[i].name = resources[i].name;
updateresources[i].interval = resources[i].interval;
updateresources[i].unit = resources[i].unit;
updateresources[i].comment = resources[i].comment;
}
result = update_bulk_request(client, updateresources);
}
return result;
} | java | {
"resource": ""
} |
q12350 | nstimer.unset | train | public static base_response unset(nitro_service client, nstimer resource, String[] args) throws Exception{
nstimer unsetresource = new nstimer();
unsetresource.name = resource.name;
unsetresource.interval = resource.interval;
unsetresource.unit = resource.unit;
unsetresource.comment = resource.comment;
return unsetresource.unset_resource(client,args);
} | java | {
"resource": ""
} |
q12351 | nstimer.unset | train | public static base_responses unset(nitro_service client, nstimer resources[], String[] args) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
nstimer unsetresources[] = new nstimer[resources.length];
for (int i=0;i<resources.length;i++){
unsetresources[i] = new nstimer();
unsetresources[i].name = resources[i].name;
unsetresources[i].interval = resources[i].interval;
unsetresources[i].unit = resources[i].unit;
unsetresources[i].comment = resources[i].comment;
}
result = unset_bulk_request(client, unsetresources,args);
}
return result;
} | java | {
"resource": ""
} |
q12352 | nstimer.get | train | public static nstimer[] get(nitro_service service) throws Exception{
nstimer obj = new nstimer();
nstimer[] response = (nstimer[])obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q12353 | nstimer.get | train | public static nstimer get(nitro_service service, String name) throws Exception{
nstimer obj = new nstimer();
obj.set_name(name);
nstimer response = (nstimer) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q12354 | appfwpolicylabel_appfwpolicy_binding.get | train | public static appfwpolicylabel_appfwpolicy_binding[] get(nitro_service service, String labelname) throws Exception{
appfwpolicylabel_appfwpolicy_binding obj = new appfwpolicylabel_appfwpolicy_binding();
obj.set_labelname(labelname);
appfwpolicylabel_appfwpolicy_binding response[] = (appfwpolicylabel_appfwpolicy_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q12355 | auditnslogpolicy_binding.get | train | public static auditnslogpolicy_binding get(nitro_service service, String name) throws Exception{
auditnslogpolicy_binding obj = new auditnslogpolicy_binding();
obj.set_name(name);
auditnslogpolicy_binding response = (auditnslogpolicy_binding) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q12356 | filterhtmlinjectionvariable.add | train | public static base_response add(nitro_service client, filterhtmlinjectionvariable resource) throws Exception {
filterhtmlinjectionvariable addresource = new filterhtmlinjectionvariable();
addresource.variable = resource.variable;
addresource.value = resource.value;
return addresource.add_resource(client);
} | java | {
"resource": ""
} |
q12357 | filterhtmlinjectionvariable.add | train | public static base_responses add(nitro_service client, filterhtmlinjectionvariable resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
filterhtmlinjectionvariable addresources[] = new filterhtmlinjectionvariable[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new filterhtmlinjectionvariable();
addresources[i].variable = resources[i].variable;
addresources[i].value = resources[i].value;
}
result = add_bulk_request(client, addresources);
}
return result;
} | java | {
"resource": ""
} |
q12358 | filterhtmlinjectionvariable.delete | train | public static base_response delete(nitro_service client, String variable) throws Exception {
filterhtmlinjectionvariable deleteresource = new filterhtmlinjectionvariable();
deleteresource.variable = variable;
return deleteresource.delete_resource(client);
} | java | {
"resource": ""
} |
q12359 | filterhtmlinjectionvariable.delete | train | public static base_responses delete(nitro_service client, String variable[]) throws Exception {
base_responses result = null;
if (variable != null && variable.length > 0) {
filterhtmlinjectionvariable deleteresources[] = new filterhtmlinjectionvariable[variable.length];
for (int i=0;i<variable.length;i++){
deleteresources[i] = new filterhtmlinjectionvariable();
deleteresources[i].variable = variable[i];
}
result = delete_bulk_request(client, deleteresources);
}
return result;
} | java | {
"resource": ""
} |
q12360 | filterhtmlinjectionvariable.update | train | public static base_response update(nitro_service client, filterhtmlinjectionvariable resource) throws Exception {
filterhtmlinjectionvariable updateresource = new filterhtmlinjectionvariable();
updateresource.variable = resource.variable;
updateresource.value = resource.value;
return updateresource.update_resource(client);
} | java | {
"resource": ""
} |
q12361 | filterhtmlinjectionvariable.update | train | public static base_responses update(nitro_service client, filterhtmlinjectionvariable resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
filterhtmlinjectionvariable updateresources[] = new filterhtmlinjectionvariable[resources.length];
for (int i=0;i<resources.length;i++){
updateresources[i] = new filterhtmlinjectionvariable();
updateresources[i].variable = resources[i].variable;
updateresources[i].value = resources[i].value;
}
result = update_bulk_request(client, updateresources);
}
return result;
} | java | {
"resource": ""
} |
q12362 | filterhtmlinjectionvariable.unset | train | public static base_response unset(nitro_service client, filterhtmlinjectionvariable resource, String[] args) throws Exception{
filterhtmlinjectionvariable unsetresource = new filterhtmlinjectionvariable();
unsetresource.variable = resource.variable;
return unsetresource.unset_resource(client,args);
} | java | {
"resource": ""
} |
q12363 | filterhtmlinjectionvariable.unset | train | public static base_responses unset(nitro_service client, String variable[], String args[]) throws Exception {
base_responses result = null;
if (variable != null && variable.length > 0) {
filterhtmlinjectionvariable unsetresources[] = new filterhtmlinjectionvariable[variable.length];
for (int i=0;i<variable.length;i++){
unsetresources[i] = new filterhtmlinjectionvariable();
unsetresources[i].variable = variable[i];
}
result = unset_bulk_request(client, unsetresources,args);
}
return result;
} | java | {
"resource": ""
} |
q12364 | filterhtmlinjectionvariable.get | train | public static filterhtmlinjectionvariable[] get(nitro_service service) throws Exception{
filterhtmlinjectionvariable obj = new filterhtmlinjectionvariable();
filterhtmlinjectionvariable[] response = (filterhtmlinjectionvariable[])obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q12365 | filterhtmlinjectionvariable.get | train | public static filterhtmlinjectionvariable get(nitro_service service, String variable) throws Exception{
filterhtmlinjectionvariable obj = new filterhtmlinjectionvariable();
obj.set_variable(variable);
filterhtmlinjectionvariable response = (filterhtmlinjectionvariable) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q12366 | filterhtmlinjectionvariable.get | train | public static filterhtmlinjectionvariable[] get(nitro_service service, String variable[]) throws Exception{
if (variable !=null && variable.length>0) {
filterhtmlinjectionvariable response[] = new filterhtmlinjectionvariable[variable.length];
filterhtmlinjectionvariable obj[] = new filterhtmlinjectionvariable[variable.length];
for (int i=0;i<variable.length;i++) {
obj[i] = new filterhtmlinjectionvariable();
obj[i].set_variable(variable[i]);
response[i] = (filterhtmlinjectionvariable) obj[i].get_resource(service);
}
return response;
}
return null;
} | java | {
"resource": ""
} |
q12367 | lbgroup_binding.get | train | public static lbgroup_binding get(nitro_service service, String name) throws Exception{
lbgroup_binding obj = new lbgroup_binding();
obj.set_name(name);
lbgroup_binding response = (lbgroup_binding) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q12368 | sslservicegroup_sslciphersuite_binding.get | train | public static sslservicegroup_sslciphersuite_binding[] get(nitro_service service, String servicegroupname) throws Exception{
sslservicegroup_sslciphersuite_binding obj = new sslservicegroup_sslciphersuite_binding();
obj.set_servicegroupname(servicegroupname);
sslservicegroup_sslciphersuite_binding response[] = (sslservicegroup_sslciphersuite_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q12369 | sslservicegroup_sslciphersuite_binding.count | train | public static long count(nitro_service service, String servicegroupname) throws Exception{
sslservicegroup_sslciphersuite_binding obj = new sslservicegroup_sslciphersuite_binding();
obj.set_servicegroupname(servicegroupname);
options option = new options();
option.set_count(true);
sslservicegroup_sslciphersuite_binding response[] = (sslservicegroup_sslciphersuite_binding[]) obj.get_resources(service,option);
if (response != null) {
return response[0].__count;
}
return 0;
} | java | {
"resource": ""
} |
q12370 | cacheparameter.update | train | public static base_response update(nitro_service client, cacheparameter resource) throws Exception {
cacheparameter updateresource = new cacheparameter();
updateresource.memlimit = resource.memlimit;
updateresource.via = resource.via;
updateresource.verifyusing = resource.verifyusing;
updateresource.maxpostlen = resource.maxpostlen;
updateresource.prefetchmaxpending = resource.prefetchmaxpending;
updateresource.enablebypass = resource.enablebypass;
updateresource.undefaction = resource.undefaction;
updateresource.enablediskcache = resource.enablediskcache;
return updateresource.update_resource(client);
} | java | {
"resource": ""
} |
q12371 | cacheparameter.unset | train | public static base_response unset(nitro_service client, cacheparameter resource, String[] args) throws Exception{
cacheparameter unsetresource = new cacheparameter();
return unsetresource.unset_resource(client,args);
} | java | {
"resource": ""
} |
q12372 | cacheparameter.get | train | public static cacheparameter get(nitro_service service) throws Exception{
cacheparameter obj = new cacheparameter();
cacheparameter[] response = (cacheparameter[])obj.get_resources(service);
return response[0];
} | java | {
"resource": ""
} |
q12373 | auditsyslogpolicy_csvserver_binding.get | train | public static auditsyslogpolicy_csvserver_binding[] get(nitro_service service, String name) throws Exception{
auditsyslogpolicy_csvserver_binding obj = new auditsyslogpolicy_csvserver_binding();
obj.set_name(name);
auditsyslogpolicy_csvserver_binding response[] = (auditsyslogpolicy_csvserver_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q12374 | nslimitsessions.clear | train | public static base_response clear(nitro_service client, nslimitsessions resource) throws Exception {
nslimitsessions clearresource = new nslimitsessions();
clearresource.limitidentifier = resource.limitidentifier;
return clearresource.perform_operation(client,"clear");
} | java | {
"resource": ""
} |
q12375 | nslimitsessions.clear | train | public static base_responses clear(nitro_service client, nslimitsessions resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
nslimitsessions clearresources[] = new nslimitsessions[resources.length];
for (int i=0;i<resources.length;i++){
clearresources[i] = new nslimitsessions();
clearresources[i].limitidentifier = resources[i].limitidentifier;
}
result = perform_operation_bulk_request(client, clearresources,"clear");
}
return result;
} | java | {
"resource": ""
} |
q12376 | nslimitsessions.get | train | public static nslimitsessions[] get(nitro_service service, nslimitsessions_args args) throws Exception{
nslimitsessions obj = new nslimitsessions();
options option = new options();
option.set_args(nitro_util.object_to_string_withoutquotes(args));
nslimitsessions[] response = (nslimitsessions[])obj.get_resources(service, option);
return response;
} | java | {
"resource": ""
} |
q12377 | lbgroup.update | train | public static base_response update(nitro_service client, lbgroup resource) throws Exception {
lbgroup updateresource = new lbgroup();
updateresource.name = resource.name;
updateresource.persistencetype = resource.persistencetype;
updateresource.persistencebackup = resource.persistencebackup;
updateresource.backuppersistencetimeout = resource.backuppersistencetimeout;
updateresource.persistmask = resource.persistmask;
updateresource.cookiename = resource.cookiename;
updateresource.v6persistmasklen = resource.v6persistmasklen;
updateresource.cookiedomain = resource.cookiedomain;
updateresource.timeout = resource.timeout;
updateresource.rule = resource.rule;
return updateresource.update_resource(client);
} | java | {
"resource": ""
} |
q12378 | lbgroup.update | train | public static base_responses update(nitro_service client, lbgroup resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
lbgroup updateresources[] = new lbgroup[resources.length];
for (int i=0;i<resources.length;i++){
updateresources[i] = new lbgroup();
updateresources[i].name = resources[i].name;
updateresources[i].persistencetype = resources[i].persistencetype;
updateresources[i].persistencebackup = resources[i].persistencebackup;
updateresources[i].backuppersistencetimeout = resources[i].backuppersistencetimeout;
updateresources[i].persistmask = resources[i].persistmask;
updateresources[i].cookiename = resources[i].cookiename;
updateresources[i].v6persistmasklen = resources[i].v6persistmasklen;
updateresources[i].cookiedomain = resources[i].cookiedomain;
updateresources[i].timeout = resources[i].timeout;
updateresources[i].rule = resources[i].rule;
}
result = update_bulk_request(client, updateresources);
}
return result;
} | java | {
"resource": ""
} |
q12379 | lbgroup.get | train | public static lbgroup[] get(nitro_service service) throws Exception{
lbgroup obj = new lbgroup();
lbgroup[] response = (lbgroup[])obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q12380 | lbgroup.get | train | public static lbgroup get(nitro_service service, String name) throws Exception{
lbgroup obj = new lbgroup();
obj.set_name(name);
lbgroup response = (lbgroup) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q12381 | lbgroup.get_filtered | train | public static lbgroup[] get_filtered(nitro_service service, filtervalue[] filter) throws Exception{
lbgroup obj = new lbgroup();
options option = new options();
option.set_filter(filter);
lbgroup[] response = (lbgroup[]) obj.getfiltered(service, option);
return response;
} | java | {
"resource": ""
} |
q12382 | tmformssoaction.add | train | public static base_responses add(nitro_service client, tmformssoaction resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
tmformssoaction addresources[] = new tmformssoaction[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new tmformssoaction();
addresources[i].name = resources[i].name;
addresources[i].actionurl = resources[i].actionurl;
addresources[i].userfield = resources[i].userfield;
addresources[i].passwdfield = resources[i].passwdfield;
addresources[i].ssosuccessrule = resources[i].ssosuccessrule;
addresources[i].namevaluepair = resources[i].namevaluepair;
addresources[i].responsesize = resources[i].responsesize;
addresources[i].nvtype = resources[i].nvtype;
addresources[i].submitmethod = resources[i].submitmethod;
}
result = add_bulk_request(client, addresources);
}
return result;
} | java | {
"resource": ""
} |
q12383 | tmformssoaction.get | train | public static tmformssoaction[] get(nitro_service service) throws Exception{
tmformssoaction obj = new tmformssoaction();
tmformssoaction[] response = (tmformssoaction[])obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q12384 | tmformssoaction.get | train | public static tmformssoaction get(nitro_service service, String name) throws Exception{
tmformssoaction obj = new tmformssoaction();
obj.set_name(name);
tmformssoaction response = (tmformssoaction) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q12385 | crvserver_crpolicy_binding.get | train | public static crvserver_crpolicy_binding[] get(nitro_service service, String name) throws Exception{
crvserver_crpolicy_binding obj = new crvserver_crpolicy_binding();
obj.set_name(name);
crvserver_crpolicy_binding response[] = (crvserver_crpolicy_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q12386 | vpnsessionpolicy_vpnvserver_binding.get | train | public static vpnsessionpolicy_vpnvserver_binding[] get(nitro_service service, String name) throws Exception{
vpnsessionpolicy_vpnvserver_binding obj = new vpnsessionpolicy_vpnvserver_binding();
obj.set_name(name);
vpnsessionpolicy_vpnvserver_binding response[] = (vpnsessionpolicy_vpnvserver_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q12387 | pqpolicy_stats.get | train | public static pqpolicy_stats[] get(nitro_service service) throws Exception{
pqpolicy_stats obj = new pqpolicy_stats();
pqpolicy_stats[] response = (pqpolicy_stats[])obj.stat_resources(service);
return response;
} | java | {
"resource": ""
} |
q12388 | pqpolicy_stats.get | train | public static pqpolicy_stats get(nitro_service service, String policyname) throws Exception{
pqpolicy_stats obj = new pqpolicy_stats();
obj.set_policyname(policyname);
pqpolicy_stats response = (pqpolicy_stats) obj.stat_resource(service);
return response;
} | java | {
"resource": ""
} |
q12389 | appqoepolicy_lbvserver_binding.get | train | public static appqoepolicy_lbvserver_binding[] get(nitro_service service, String name) throws Exception{
appqoepolicy_lbvserver_binding obj = new appqoepolicy_lbvserver_binding();
obj.set_name(name);
appqoepolicy_lbvserver_binding response[] = (appqoepolicy_lbvserver_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q12390 | Maps.invert | train | public static <X, Y> Map<Y, X> invert(Map<X, Y> map) {
Map<Y, X> invertedMap = new HashMap<Y, X>();
for (Map.Entry<X, Y> entry : map.entrySet()) {
X key = entry.getKey();
Y value = entry.getValue();
invertedMap.put(value, key);
}
return invertedMap;
} | java | {
"resource": ""
} |
q12391 | Maps.sortedEntries | train | public static <K extends Comparable<? super K>, V> List<Map.Entry<K, V>> sortedEntries(Collection<Map.Entry<K, V>> entries) {
List<Entry<K,V>> entriesList = new ArrayList<Map.Entry<K, V>>(entries);
Collections.sort(entriesList, new Comparator<Map.Entry<K, V>>() {
public int compare(Map.Entry<K, V> e1, Map.Entry<K, V> e2) {
return e1.getKey().compareTo(e2.getKey());
}
});
return entriesList;
} | java | {
"resource": ""
} |
q12392 | Maps.sortedEntries | train | public static <K extends Comparable<? super K>, V> List<Map.Entry<K, V>> sortedEntries(Map<K, V> map) {
return sortedEntries(map.entrySet());
} | java | {
"resource": ""
} |
q12393 | SequenceGibbsSampler.sampleSequenceRepeatedly | train | public void sampleSequenceRepeatedly(SequenceModel model, int[] sequence, int numSamples) {
sequence = copy(sequence); // so we don't change the initial, or the one we just stored
listener.setInitialSequence(sequence);
for (int iter=0; iter<numSamples; iter++) {
sampleSequenceForward(model, sequence);
}
} | java | {
"resource": ""
} |
q12394 | SequenceGibbsSampler.sampleSequenceRepeatedly | train | public void sampleSequenceRepeatedly(SequenceModel model, int numSamples) {
int[] sequence = getRandomSequence(model);
sampleSequenceRepeatedly(model, sequence, numSamples);
} | java | {
"resource": ""
} |
q12395 | SequenceGibbsSampler.sampleSequenceForward | train | public void sampleSequenceForward(SequenceModel model, int[] sequence, double temperature) {
// System.err.println("Sampling forward");
for (int pos=0; pos<sequence.length; pos++) {
samplePosition(model, sequence, pos, temperature);
}
} | java | {
"resource": ""
} |
q12396 | SequenceGibbsSampler.sampleSequenceBackward | train | public void sampleSequenceBackward(SequenceModel model, int[] sequence, double temperature) {
for (int pos=sequence.length-1; pos>=0; pos--) {
samplePosition(model, sequence, pos, temperature);
}
} | java | {
"resource": ""
} |
q12397 | SequenceGibbsSampler.samplePosition | train | public double samplePosition(SequenceModel model, int[] sequence, int pos, double temperature) {
double[] distribution = model.scoresOf(sequence, pos);
if (temperature!=1.0) {
if (temperature==0.0) {
// set the max to 1.0
int argmax = ArrayMath.argmax(distribution);
Arrays.fill(distribution, Double.NEGATIVE_INFINITY);
distribution[argmax] = 0.0;
} else {
// take all to a power
// use the temperature to increase/decrease the entropy of the sampling distribution
ArrayMath.multiplyInPlace(distribution, 1.0/temperature);
}
}
ArrayMath.logNormalize(distribution);
ArrayMath.expInPlace(distribution);
int oldTag = sequence[pos];
int newTag = ArrayMath.sampleFromDistribution(distribution, random);
// System.out.println("Sampled " + oldTag + "->" + newTag);
sequence[pos] = newTag;
listener.updateSequenceElement(sequence, pos, oldTag);
return distribution[newTag];
} | java | {
"resource": ""
} |
q12398 | aaagroup_binding.get | train | public static aaagroup_binding get(nitro_service service, String groupname) throws Exception{
aaagroup_binding obj = new aaagroup_binding();
obj.set_groupname(groupname);
aaagroup_binding response = (aaagroup_binding) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q12399 | gslbsyncstatus.get | train | public static gslbsyncstatus get(nitro_service service) throws Exception{
gslbsyncstatus obj = new gslbsyncstatus();
gslbsyncstatus[] response = (gslbsyncstatus[])obj.get_resources(service);
return response[0];
} | java | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.