_id
stringlengths
2
7
title
stringlengths
3
140
partition
stringclasses
3 values
text
stringlengths
73
34.1k
language
stringclasses
1 value
meta_information
dict
q12500
appfwpolicy_appfwpolicylabel_binding.get
train
public static appfwpolicy_appfwpolicylabel_binding[] get(nitro_service service, String name) throws Exception{ appfwpolicy_appfwpolicylabel_binding obj = new appfwpolicy_appfwpolicylabel_binding(); obj.set_name(name); appfwpolicy_appfwpolicylabel_binding response[] = (appfwpolicy_appfwpolicylabel_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q12501
nsversion.get
train
public static nsversion get(nitro_service service) throws Exception{ nsversion obj = new nsversion(); nsversion[] response = (nsversion[])obj.get_resources(service); return response[0]; }
java
{ "resource": "" }
q12502
sc_stats.get
train
public static sc_stats get(nitro_service service) throws Exception{ sc_stats obj = new sc_stats(); sc_stats[] response = (sc_stats[])obj.stat_resources(service); return response[0]; }
java
{ "resource": "" }
q12503
sslwrapkey.create
train
public static base_response create(nitro_service client, sslwrapkey resource) throws Exception { sslwrapkey createresource = new sslwrapkey(); createresource.wrapkeyname = resource.wrapkeyname; createresource.password = resource.password; createresource.salt = resource.salt; return createresource.perform_operation(client,"create"); }
java
{ "resource": "" }
q12504
sslwrapkey.create
train
public static base_responses create(nitro_service client, sslwrapkey resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { sslwrapkey createresources[] = new sslwrapkey[resources.length]; for (int i=0;i<resources.length;i++){ createresources[i] = new sslwrapkey(); createresources[i].wrapkeyname = resources[i].wrapkeyname; createresources[i].password = resources[i].password; createresources[i].salt = resources[i].salt; } result = perform_operation_bulk_request(client, createresources,"create"); } return result; }
java
{ "resource": "" }
q12505
sslwrapkey.delete
train
public static base_response delete(nitro_service client, String wrapkeyname) throws Exception { sslwrapkey deleteresource = new sslwrapkey(); deleteresource.wrapkeyname = wrapkeyname; return deleteresource.delete_resource(client); }
java
{ "resource": "" }
q12506
sslwrapkey.delete
train
public static base_responses delete(nitro_service client, String wrapkeyname[]) throws Exception { base_responses result = null; if (wrapkeyname != null && wrapkeyname.length > 0) { sslwrapkey deleteresources[] = new sslwrapkey[wrapkeyname.length]; for (int i=0;i<wrapkeyname.length;i++){ deleteresources[i] = new sslwrapkey(); deleteresources[i].wrapkeyname = wrapkeyname[i]; } result = delete_bulk_request(client, deleteresources); } return result; }
java
{ "resource": "" }
q12507
sslwrapkey.get
train
public static sslwrapkey[] get(nitro_service service) throws Exception{ sslwrapkey obj = new sslwrapkey(); sslwrapkey[] response = (sslwrapkey[])obj.get_resources(service); return response; }
java
{ "resource": "" }
q12508
SloppyMath.min
train
public static int min(int a, int b, int c) { int mi; mi = a; if (b < mi) { mi = b; } if (c < mi) { mi = c; } return mi; }
java
{ "resource": "" }
q12509
SloppyMath.exactBinomial
train
public static double exactBinomial(int k, int n, double p) { double total = 0.0; for (int m = k; m <= n; m++) { double nChooseM = 1.0; for (int r = 1; r <= m; r++) { nChooseM *= (n - r) + 1; nChooseM /= r; } // System.out.println(n + " choose " + m + " is " + nChooseM); // System.out.println("prob contribution is " + // (nChooseM * Math.pow(p, m) * Math.pow(1.0-p, n - m))); total += nChooseM * Math.pow(p, m) * Math.pow(1.0 - p, n - m); } return total; }
java
{ "resource": "" }
q12510
SloppyMath.factorial
train
public static double factorial(int x) { double result = 1.0; for (int i=x; i>1; i--) { result *= i; } return result; }
java
{ "resource": "" }
q12511
dnsaction64.add
train
public static base_response add(nitro_service client, dnsaction64 resource) throws Exception { dnsaction64 addresource = new dnsaction64(); addresource.actionname = resource.actionname; addresource.prefix = resource.prefix; addresource.mappedrule = resource.mappedrule; addresource.excluderule = resource.excluderule; return addresource.add_resource(client); }
java
{ "resource": "" }
q12512
dnsaction64.add
train
public static base_responses add(nitro_service client, dnsaction64 resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { dnsaction64 addresources[] = new dnsaction64[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new dnsaction64(); addresources[i].actionname = resources[i].actionname; addresources[i].prefix = resources[i].prefix; addresources[i].mappedrule = resources[i].mappedrule; addresources[i].excluderule = resources[i].excluderule; } result = add_bulk_request(client, addresources); } return result; }
java
{ "resource": "" }
q12513
dnsaction64.delete
train
public static base_response delete(nitro_service client, String actionname) throws Exception { dnsaction64 deleteresource = new dnsaction64(); deleteresource.actionname = actionname; return deleteresource.delete_resource(client); }
java
{ "resource": "" }
q12514
dnsaction64.update
train
public static base_response update(nitro_service client, dnsaction64 resource) throws Exception { dnsaction64 updateresource = new dnsaction64(); updateresource.actionname = resource.actionname; updateresource.prefix = resource.prefix; updateresource.mappedrule = resource.mappedrule; updateresource.excluderule = resource.excluderule; return updateresource.update_resource(client); }
java
{ "resource": "" }
q12515
dnsaction64.update
train
public static base_responses update(nitro_service client, dnsaction64 resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { dnsaction64 updateresources[] = new dnsaction64[resources.length]; for (int i=0;i<resources.length;i++){ updateresources[i] = new dnsaction64(); updateresources[i].actionname = resources[i].actionname; updateresources[i].prefix = resources[i].prefix; updateresources[i].mappedrule = resources[i].mappedrule; updateresources[i].excluderule = resources[i].excluderule; } result = update_bulk_request(client, updateresources); } return result; }
java
{ "resource": "" }
q12516
dnsaction64.unset
train
public static base_responses unset(nitro_service client, dnsaction64 resources[], String[] args) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { dnsaction64 unsetresources[] = new dnsaction64[resources.length]; for (int i=0;i<resources.length;i++){ unsetresources[i] = new dnsaction64(); unsetresources[i].actionname = resources[i].actionname; } result = unset_bulk_request(client, unsetresources,args); } return result; }
java
{ "resource": "" }
q12517
dnsaction64.get
train
public static dnsaction64[] get(nitro_service service) throws Exception{ dnsaction64 obj = new dnsaction64(); dnsaction64[] response = (dnsaction64[])obj.get_resources(service); return response; }
java
{ "resource": "" }
q12518
dnsaction64.get
train
public static dnsaction64 get(nitro_service service, String actionname) throws Exception{ dnsaction64 obj = new dnsaction64(); obj.set_actionname(actionname); dnsaction64 response = (dnsaction64) obj.get_resource(service); return response; }
java
{ "resource": "" }
q12519
dnsaction64.get
train
public static dnsaction64[] get(nitro_service service, String actionname[]) throws Exception{ if (actionname !=null && actionname.length>0) { dnsaction64 response[] = new dnsaction64[actionname.length]; dnsaction64 obj[] = new dnsaction64[actionname.length]; for (int i=0;i<actionname.length;i++) { obj[i] = new dnsaction64(); obj[i].set_actionname(actionname[i]); response[i] = (dnsaction64) obj[i].get_resource(service); } return response; } return null; }
java
{ "resource": "" }
q12520
vpnsessionpolicy_aaagroup_binding.get
train
public static vpnsessionpolicy_aaagroup_binding[] get(nitro_service service, String name) throws Exception{ vpnsessionpolicy_aaagroup_binding obj = new vpnsessionpolicy_aaagroup_binding(); obj.set_name(name); vpnsessionpolicy_aaagroup_binding response[] = (vpnsessionpolicy_aaagroup_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q12521
EnglishTreebankParserParams.treeReaderFactory
train
public TreeReaderFactory treeReaderFactory() { return new TreeReaderFactory() { public TreeReader newTreeReader(Reader in) { return new PennTreeReader(in, new LabeledScoredTreeFactory(), new NPTmpRetainingTreeNormalizer(englishTrain.splitTMP, englishTrain.splitSGapped == 5, englishTrain.leaveItAll, englishTrain.splitNPADV >= 1, headFinder())); } }; }
java
{ "resource": "" }
q12522
EnglishTreebankParserParams.deduceTag
train
private static String deduceTag(String w) { String word = w.toLowerCase(); if (word.endsWith("ing")) { return "VBG"; } else if (word.endsWith("d") || word.endsWith("t")) { return "VBN"; } else if (word.endsWith("s")) { return "VBZ"; } else if (word.equals("to")) { return "TO"; } else { return "VB"; } }
java
{ "resource": "" }
q12523
MtasSpanNotSpans.collectAndCheckLastSpans
train
private boolean collectAndCheckLastSpans(int nextSpans1StartPosition, int nextSpans1EndPosition) throws IOException { // check next if (nextSpans1StartPosition == nextSpans2StartPosition && nextSpans1EndPosition == nextSpans2EndPosition) { return false; } // check last if (nextSpans1StartPosition == lastSpans2StartPosition && (nextSpans1EndPosition == lastSpans2EndPosition || lastSpans2EndPositions.contains(nextSpans1EndPosition))) { return false; } // collect if (nextSpans1StartPosition == nextSpans2StartPosition) { // reset if (nextSpans2StartPosition != lastSpans2StartPosition) { lastSpans2StartPosition = nextSpans2StartPosition; lastSpans2EndPosition = -1; lastSpans2EndPositions.clear(); } while (nextSpans1StartPosition == nextSpans2StartPosition) { if (lastSpans2EndPosition > -1) { lastSpans2EndPositions.add(lastSpans2EndPosition); } lastSpans2EndPosition = nextSpans2EndPosition; nextSpans2StartPosition = spans2.spans.nextStartPosition(); nextSpans2EndPosition = spans2.spans.endPosition(); if (nextSpans1StartPosition == nextSpans2StartPosition && nextSpans1EndPosition == nextSpans2EndPosition) { return false; } } } return true; }
java
{ "resource": "" }
q12524
vpnnexthopserver.add
train
public static base_response add(nitro_service client, vpnnexthopserver resource) throws Exception { vpnnexthopserver addresource = new vpnnexthopserver(); addresource.name = resource.name; addresource.nexthopip = resource.nexthopip; addresource.nexthopport = resource.nexthopport; addresource.secure = resource.secure; return addresource.add_resource(client); }
java
{ "resource": "" }
q12525
vpnnexthopserver.add
train
public static base_responses add(nitro_service client, vpnnexthopserver resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { vpnnexthopserver addresources[] = new vpnnexthopserver[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new vpnnexthopserver(); addresources[i].name = resources[i].name; addresources[i].nexthopip = resources[i].nexthopip; addresources[i].nexthopport = resources[i].nexthopport; addresources[i].secure = resources[i].secure; } result = add_bulk_request(client, addresources); } return result; }
java
{ "resource": "" }
q12526
vpnnexthopserver.get
train
public static vpnnexthopserver[] get(nitro_service service) throws Exception{ vpnnexthopserver obj = new vpnnexthopserver(); vpnnexthopserver[] response = (vpnnexthopserver[])obj.get_resources(service); return response; }
java
{ "resource": "" }
q12527
vpnnexthopserver.get
train
public static vpnnexthopserver get(nitro_service service, String name) throws Exception{ vpnnexthopserver obj = new vpnnexthopserver(); obj.set_name(name); vpnnexthopserver response = (vpnnexthopserver) obj.get_resource(service); return response; }
java
{ "resource": "" }
q12528
lbvserver_csvserver_binding.get
train
public static lbvserver_csvserver_binding[] get(nitro_service service, String name) throws Exception{ lbvserver_csvserver_binding obj = new lbvserver_csvserver_binding(); obj.set_name(name); lbvserver_csvserver_binding response[] = (lbvserver_csvserver_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q12529
nstrafficdomain_vlan_binding.get
train
public static nstrafficdomain_vlan_binding[] get(nitro_service service, Long td) throws Exception{ nstrafficdomain_vlan_binding obj = new nstrafficdomain_vlan_binding(); obj.set_td(td); nstrafficdomain_vlan_binding response[] = (nstrafficdomain_vlan_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q12530
BinaryHeapPriorityQueue.getEntry
train
private Entry<E> getEntry(int index) { Entry<E> entry = indexToEntry.get(index); return entry; }
java
{ "resource": "" }
q12531
BinaryHeapPriorityQueue.add
train
public boolean add(E key, double priority) { // System.err.println("Adding " + key + " with priority " + priority); if (add(key)) { relaxPriority(key, priority); return true; } return false; }
java
{ "resource": "" }
q12532
BinaryHeapPriorityQueue.relaxPriority
train
public boolean relaxPriority(E key, double priority) { Entry<E> entry = getEntry(key); if (entry == null) { entry = makeEntry(key); } if (compare(priority, entry.priority) <= 0) { return false; } entry.priority = priority; heapifyUp(entry); return true; }
java
{ "resource": "" }
q12533
BinaryHeapPriorityQueue.decreasePriority
train
public boolean decreasePriority(E key, double priority) { Entry<E> entry = getEntry(key); if (entry == null) { entry = makeEntry(key); } if (compare(priority, entry.priority) >= 0) { return false; } entry.priority = priority; heapifyDown(entry); return true; }
java
{ "resource": "" }
q12534
BinaryHeapPriorityQueue.changePriority
train
public boolean changePriority(E key, double priority) { Entry<E> entry = getEntry(key); if (entry == null) { entry = makeEntry(key); } if (compare(priority, entry.priority) == 0) { return false; } entry.priority = priority; heapify(entry); return true; }
java
{ "resource": "" }
q12535
location.add
train
public static base_response add(nitro_service client, location resource) throws Exception { location addresource = new location(); addresource.ipfrom = resource.ipfrom; addresource.ipto = resource.ipto; addresource.preferredlocation = resource.preferredlocation; addresource.longitude = resource.longitude; addresource.latitude = resource.latitude; return addresource.add_resource(client); }
java
{ "resource": "" }
q12536
location.add
train
public static base_responses add(nitro_service client, location resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { location addresources[] = new location[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new location(); addresources[i].ipfrom = resources[i].ipfrom; addresources[i].ipto = resources[i].ipto; addresources[i].preferredlocation = resources[i].preferredlocation; addresources[i].longitude = resources[i].longitude; addresources[i].latitude = resources[i].latitude; } result = add_bulk_request(client, addresources); } return result; }
java
{ "resource": "" }
q12537
location.delete
train
public static base_response delete(nitro_service client, String ipfrom) throws Exception { location deleteresource = new location(); deleteresource.ipfrom = ipfrom; return deleteresource.delete_resource(client); }
java
{ "resource": "" }
q12538
location.delete
train
public static base_response delete(nitro_service client, location resource) throws Exception { location deleteresource = new location(); deleteresource.ipfrom = resource.ipfrom; deleteresource.ipto = resource.ipto; return deleteresource.delete_resource(client); }
java
{ "resource": "" }
q12539
location.delete
train
public static base_responses delete(nitro_service client, String ipfrom[]) throws Exception { base_responses result = null; if (ipfrom != null && ipfrom.length > 0) { location deleteresources[] = new location[ipfrom.length]; for (int i=0;i<ipfrom.length;i++){ deleteresources[i] = new location(); deleteresources[i].ipfrom = ipfrom[i]; } result = delete_bulk_request(client, deleteresources); } return result; }
java
{ "resource": "" }
q12540
location.delete
train
public static base_responses delete(nitro_service client, location resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { location deleteresources[] = new location[resources.length]; for (int i=0;i<resources.length;i++){ deleteresources[i] = new location(); deleteresources[i].ipfrom = resources[i].ipfrom; deleteresources[i].ipto = resources[i].ipto; } result = delete_bulk_request(client, deleteresources); } return result; }
java
{ "resource": "" }
q12541
location.get
train
public static location[] get(nitro_service service) throws Exception{ location obj = new location(); location[] response = (location[])obj.get_resources(service); return response; }
java
{ "resource": "" }
q12542
location.get
train
public static location get(nitro_service service, String ipfrom) throws Exception{ location obj = new location(); obj.set_ipfrom(ipfrom); location response = (location) obj.get_resource(service); return response; }
java
{ "resource": "" }
q12543
location.get
train
public static location[] get(nitro_service service, String ipfrom[]) throws Exception{ if (ipfrom !=null && ipfrom.length>0) { location response[] = new location[ipfrom.length]; location obj[] = new location[ipfrom.length]; for (int i=0;i<ipfrom.length;i++) { obj[i] = new location(); obj[i].set_ipfrom(ipfrom[i]); response[i] = (location) obj[i].get_resource(service); } return response; } return null; }
java
{ "resource": "" }
q12544
location.get_filtered
train
public static location[] get_filtered(nitro_service service, filtervalue[] filter) throws Exception{ location obj = new location(); options option = new options(); option.set_filter(filter); location[] response = (location[]) obj.getfiltered(service, option); return response; }
java
{ "resource": "" }
q12545
MtasSolrResultMerge.mergeNamedList
train
@SuppressWarnings("unchecked") private void mergeNamedList(ShardRequest sreq, NamedList<Object> mtasResponse, String key, Integer preferredPurpose) { // create new response for key NamedList<Object> mtasListResponse; Object o = mtasResponse.get(key); if (o instanceof NamedList) { mtasListResponse = (NamedList<Object>) o; } else { mtasListResponse = new SimpleOrderedMap<>(); mtasResponse.removeAll(key); mtasResponse.add(key, mtasListResponse); } // collect responses for each shard HashMap<String, NamedList<Object>> mtasListShardResponses = new HashMap<>(); for (ShardResponse response : sreq.responses) { // only continue if new shard or preferred purpose if (mtasListShardResponses.containsKey(response.getShard()) && ((preferredPurpose == null) || (sreq.purpose != preferredPurpose))) { break; } // update try { NamedList<Object> result = response.getSolrResponse().getResponse(); NamedList<Object> data = (NamedList<Object>) result.findRecursive("mtas", key); if (data != null) { mtasListShardResponses.put(response.getShard(), MtasSolrResultUtil.decode(data)); } } catch (ClassCastException e) { log.debug(e); } } try { for (NamedList<Object> mtasListShardResponse : mtasListShardResponses.values()) { mergeResponsesNamedList(mtasListResponse, mtasListShardResponse); } } catch (IOException e) { log.error(e); } }
java
{ "resource": "" }
q12546
MtasSolrResultMerge.mergeArrayList
train
@SuppressWarnings("unchecked") private void mergeArrayList(ShardRequest sreq, NamedList<Object> mtasResponse, String key, Integer preferredPurpose, boolean mergeAllShardResponses) { // create new response for key ArrayList<Object> mtasListResponse; Object o = mtasResponse.get(key); if (o instanceof ArrayList) { mtasListResponse = (ArrayList<Object>) o; } else { mtasListResponse = new ArrayList<>(); mtasResponse.removeAll(key); mtasResponse.add(key, mtasListResponse); } // collect responses for each shard HashMap<String, ArrayList<Object>> mtasListShardResponses = new HashMap<>(); ArrayList<ArrayList<Object>> mtasListShardResponsesExtra = new ArrayList<>(); for (ShardResponse response : sreq.responses) { // only continue if new shard or preferred purpose if (mtasListShardResponses.containsKey(response.getShard()) && ((preferredPurpose == null) || (sreq.purpose != preferredPurpose))) { break; } // update try { NamedList<Object> result = response.getSolrResponse().getResponse(); ArrayList<Object> data = (ArrayList<Object>) result.findRecursive("mtas", key); if (data != null) { if (mtasListShardResponses.containsKey(response.getShardAddress())) { if (mergeAllShardResponses) { mtasListShardResponsesExtra.add(data); } } else { mtasListShardResponses.put(response.getShardAddress(), data); } } } catch (ClassCastException e) { log.error(e); } } try { for (ArrayList<Object> mtasListShardResponse : mtasListShardResponses.values()) { mergeResponsesArrayList(mtasListResponse, mtasListShardResponse); } for (ArrayList<Object> mtasListShardResponse : mtasListShardResponsesExtra) { mergeResponsesArrayList(mtasListResponse, mtasListShardResponse); } } catch (IOException e) { log.error(e); } }
java
{ "resource": "" }
q12547
MtasSolrResultMerge.mergeResponsesSortedSet
train
private void mergeResponsesSortedSet(SortedSet<Object> originalList, SortedSet<Object> shardList) { for (Object item : shardList) { originalList.add(item); } }
java
{ "resource": "" }
q12548
MtasSolrResultMerge.mergeResponsesArrayList
train
@SuppressWarnings("unchecked") private void mergeResponsesArrayList(ArrayList<Object> originalList, ArrayList<Object> shardList) throws IOException { // get keys from original HashMap<String, Object> originalKeyList = new HashMap<>(); for (Object item : originalList) { if (item instanceof NamedList<?>) { NamedList<Object> itemList = (NamedList<Object>) item; Object key = itemList.get("key"); if ((key != null) && (key instanceof String)) { originalKeyList.put((String) key, item); } } } for (Object item : shardList) { if (item instanceof NamedList<?>) { NamedList<Object> itemList = (NamedList<Object>) item; Object key = itemList.get("key"); // item with key if ((key != null) && (key instanceof String)) { // merge if (originalKeyList.containsKey(key)) { Object originalItem = originalKeyList.get(key); if (originalItem.getClass().equals(item.getClass())) { mergeResponsesNamedList((NamedList<Object>) originalItem, (NamedList<Object>) item); } else { // ignore? } // add } else { Object clonedItem = adjustablePartsCloned(item); originalList.add(clonedItem); originalKeyList.put((String) key, clonedItem); } } else { originalList.add(item); } } else { originalList.add(item); } } }
java
{ "resource": "" }
q12549
MtasSolrResultMerge.mergeResponsesNamedList
train
@SuppressWarnings({ "rawtypes", "unchecked" }) private void mergeResponsesNamedList(NamedList<Object> mainResponse, NamedList<Object> shardResponse) throws IOException { Iterator<Entry<String, Object>> it = shardResponse.iterator(); while (it.hasNext()) { Entry<String, Object> entry = it.next(); String name = entry.getKey(); Object shardValue = entry.getValue(); int originalId = mainResponse.indexOf(name, 0); if (originalId < 0) { mainResponse.add(name, adjustablePartsCloned(shardValue)); } else { Object original = mainResponse.getVal(originalId); if (original == null) { original = adjustablePartsCloned(shardValue); } else if (shardValue != null && original.getClass().equals(shardValue.getClass())) { // merge ArrayList if (original instanceof ArrayList) { ArrayList originalList = (ArrayList) original; ArrayList shardList = (ArrayList) shardValue; mergeResponsesArrayList(originalList, shardList); // merge Namedlist } else if (original instanceof NamedList<?>) { mergeResponsesNamedList((NamedList<Object>) original, (NamedList<Object>) shardValue); // merge SortedSet } else if (original instanceof SortedSet<?>) { mergeResponsesSortedSet((SortedSet<Object>) original, (SortedSet<Object>) shardValue); } else if (original instanceof MtasSolrMtasResult) { MtasSolrMtasResult originalComponentResult = (MtasSolrMtasResult) original; originalComponentResult.merge((MtasSolrMtasResult) shardValue); } else if (original instanceof MtasSolrCollectionResult) { MtasSolrCollectionResult originalComponentResult = (MtasSolrCollectionResult) original; originalComponentResult.merge((MtasSolrCollectionResult) shardValue); } else if (original instanceof String) { // ignore? } else if (original instanceof Integer) { original = (Integer) original + ((Integer) shardValue); } else if (original instanceof Long) { original = (Long) original + ((Long) shardValue); } else { // ignore? } mainResponse.setVal(originalId, original); } else { // ignore? } } } }
java
{ "resource": "" }
q12550
MtasSolrResultMerge.adjustablePartsCloned
train
@SuppressWarnings({ "rawtypes", "unchecked" }) private Object adjustablePartsCloned(Object original) { if (original instanceof NamedList) { NamedList<Object> newObject = new SimpleOrderedMap(); NamedList<Object> originalObject = (NamedList<Object>) original; for (int i = 0; i < originalObject.size(); i++) { newObject.add(originalObject.getName(i), adjustablePartsCloned(originalObject.getVal(i))); } return newObject; } else if (original instanceof ArrayList) { ArrayList<Object> newObject = new ArrayList<>(); ArrayList<Object> originalObject = (ArrayList<Object>) original; for (int i = 0; i < originalObject.size(); i++) { newObject.add(adjustablePartsCloned(originalObject.get(i))); } return newObject; } else if (original instanceof Integer) { return original; } return original; }
java
{ "resource": "" }
q12551
sslcertkey_service_binding.get
train
public static sslcertkey_service_binding[] get(nitro_service service, String certkey) throws Exception{ sslcertkey_service_binding obj = new sslcertkey_service_binding(); obj.set_certkey(certkey); sslcertkey_service_binding response[] = (sslcertkey_service_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q12552
csvserver_responderpolicy_binding.get
train
public static csvserver_responderpolicy_binding[] get(nitro_service service, String name) throws Exception{ csvserver_responderpolicy_binding obj = new csvserver_responderpolicy_binding(); obj.set_name(name); csvserver_responderpolicy_binding response[] = (csvserver_responderpolicy_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q12553
TreeGraphNode.addArc
train
@SuppressWarnings("unchecked") public <GR extends GrammaticalRelationAnnotation> boolean addArc(Class<GR> arcLabel, TreeGraphNode node) { if (node == null) { return false; } if (!treeGraph().equals(node.treeGraph())) { System.err.println("Warning: you are trying to add an arc from node " + this + " to node " + node + ", but they do not belong to the same TreeGraph!"); } if (!label.containsKey(arcLabel)) { label.set(arcLabel, new HashSet<TreeGraphNode>()); } return ((Collection) label.get(arcLabel)).add(node); }
java
{ "resource": "" }
q12554
TreeGraphNode.dependencies
train
public Set<Dependency<Label, Label, Object>> dependencies(Filter<Dependency<Label, Label, Object>> f, HeadFinder hf) { Set<Dependency<Label, Label, Object>> deps = Generics.newHashSet(); for (Tree t : this) { TreeGraphNode node = safeCast(t); if (node == null || node.isLeaf() || node.children().length < 2) { continue; } TreeGraphNode headWordNode; if (hf != null) { headWordNode = safeCast(node.headTerminal(hf)); } else { headWordNode = node.headWordNode(); } for (Tree k : node.children()) { TreeGraphNode kid = safeCast(k); if (kid == null) { continue; } TreeGraphNode kidHeadWordNode; if (hf != null) { kidHeadWordNode = safeCast(kid.headTerminal(hf)); } else { kidHeadWordNode = kid.headWordNode(); } if (headWordNode != null && headWordNode != kidHeadWordNode && kidHeadWordNode != null) { int headWordNodeIndex = headWordNode.index(); int kidHeadWordNodeIndex = kidHeadWordNode.index(); // If the two indices are equal, then the leaves haven't been indexed. Just return an ordinary // UnnamedDependency. This mirrors the implementation of super.dependencies(). Dependency<Label, Label, Object> d = (headWordNodeIndex == kidHeadWordNodeIndex) ? new UnnamedDependency(headWordNode, kidHeadWordNode) : new UnnamedConcreteDependency(headWordNode, headWordNodeIndex, kidHeadWordNode, kidHeadWordNodeIndex); if (f.accept(d)) { deps.add(d); } } } } return deps; }
java
{ "resource": "" }
q12555
systemglobal_auditsyslogpolicy_binding.get
train
public static systemglobal_auditsyslogpolicy_binding[] get(nitro_service service) throws Exception{ systemglobal_auditsyslogpolicy_binding obj = new systemglobal_auditsyslogpolicy_binding(); systemglobal_auditsyslogpolicy_binding response[] = (systemglobal_auditsyslogpolicy_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q12556
streamidentifier.add
train
public static base_response add(nitro_service client, streamidentifier resource) throws Exception { streamidentifier addresource = new streamidentifier(); addresource.name = resource.name; addresource.selectorname = resource.selectorname; addresource.interval = resource.interval; addresource.samplecount = resource.samplecount; addresource.sort = resource.sort; return addresource.add_resource(client); }
java
{ "resource": "" }
q12557
streamidentifier.add
train
public static base_responses add(nitro_service client, streamidentifier resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { streamidentifier addresources[] = new streamidentifier[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new streamidentifier(); addresources[i].name = resources[i].name; addresources[i].selectorname = resources[i].selectorname; addresources[i].interval = resources[i].interval; addresources[i].samplecount = resources[i].samplecount; addresources[i].sort = resources[i].sort; } result = add_bulk_request(client, addresources); } return result; }
java
{ "resource": "" }
q12558
streamidentifier.update
train
public static base_response update(nitro_service client, streamidentifier resource) throws Exception { streamidentifier updateresource = new streamidentifier(); updateresource.name = resource.name; updateresource.selectorname = resource.selectorname; updateresource.interval = resource.interval; updateresource.samplecount = resource.samplecount; updateresource.sort = resource.sort; return updateresource.update_resource(client); }
java
{ "resource": "" }
q12559
streamidentifier.update
train
public static base_responses update(nitro_service client, streamidentifier resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { streamidentifier updateresources[] = new streamidentifier[resources.length]; for (int i=0;i<resources.length;i++){ updateresources[i] = new streamidentifier(); updateresources[i].name = resources[i].name; updateresources[i].selectorname = resources[i].selectorname; updateresources[i].interval = resources[i].interval; updateresources[i].samplecount = resources[i].samplecount; updateresources[i].sort = resources[i].sort; } result = update_bulk_request(client, updateresources); } return result; }
java
{ "resource": "" }
q12560
streamidentifier.get
train
public static streamidentifier[] get(nitro_service service) throws Exception{ streamidentifier obj = new streamidentifier(); streamidentifier[] response = (streamidentifier[])obj.get_resources(service); return response; }
java
{ "resource": "" }
q12561
streamidentifier.get
train
public static streamidentifier get(nitro_service service, String name) throws Exception{ streamidentifier obj = new streamidentifier(); obj.set_name(name); streamidentifier response = (streamidentifier) obj.get_resource(service); return response; }
java
{ "resource": "" }
q12562
streamidentifier.get_filtered
train
public static streamidentifier[] get_filtered(nitro_service service, filtervalue[] filter) throws Exception{ streamidentifier obj = new streamidentifier(); options option = new options(); option.set_filter(filter); streamidentifier[] response = (streamidentifier[]) obj.getfiltered(service, option); return response; }
java
{ "resource": "" }
q12563
NERServer.run
train
@SuppressWarnings({"InfiniteLoopStatement", "ConstantConditions", "null"}) public void run() { Socket client = null; while (true) { try { client = listener.accept(); if (DEBUG) { System.err.print("Accepted request from "); System.err.println(client.getInetAddress().getHostName()); } new Session(client); } catch (Exception e1) { System.err.println("NERServer: couldn't accept"); e1.printStackTrace(System.err); try { client.close(); } catch (Exception e2) { System.err.println("NERServer: couldn't close client"); e2.printStackTrace(System.err); } } } }
java
{ "resource": "" }
q12564
nat64_stats.get
train
public static nat64_stats get(nitro_service service) throws Exception{ nat64_stats obj = new nat64_stats(); nat64_stats[] response = (nat64_stats[])obj.stat_resources(service); return response[0]; }
java
{ "resource": "" }
q12565
csvserver_transformpolicy_binding.get
train
public static csvserver_transformpolicy_binding[] get(nitro_service service, String name) throws Exception{ csvserver_transformpolicy_binding obj = new csvserver_transformpolicy_binding(); obj.set_name(name); csvserver_transformpolicy_binding response[] = (csvserver_transformpolicy_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q12566
appfwprofile_xmlsqlinjection_binding.get
train
public static appfwprofile_xmlsqlinjection_binding[] get(nitro_service service, String name) throws Exception{ appfwprofile_xmlsqlinjection_binding obj = new appfwprofile_xmlsqlinjection_binding(); obj.set_name(name); appfwprofile_xmlsqlinjection_binding response[] = (appfwprofile_xmlsqlinjection_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q12567
FixedPrioritiesPriorityQueue.removeFirst
train
public E removeFirst() { E first = getFirst(); swap(0, size - 1); size--; elements.remove(size); heapifyDown(0); return first; }
java
{ "resource": "" }
q12568
pqpolicy.add
train
public static base_response add(nitro_service client, pqpolicy resource) throws Exception { pqpolicy addresource = new pqpolicy(); addresource.policyname = resource.policyname; addresource.rule = resource.rule; addresource.priority = resource.priority; addresource.weight = resource.weight; addresource.qdepth = resource.qdepth; addresource.polqdepth = resource.polqdepth; return addresource.add_resource(client); }
java
{ "resource": "" }
q12569
pqpolicy.add
train
public static base_responses add(nitro_service client, pqpolicy resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { pqpolicy addresources[] = new pqpolicy[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new pqpolicy(); addresources[i].policyname = resources[i].policyname; addresources[i].rule = resources[i].rule; addresources[i].priority = resources[i].priority; addresources[i].weight = resources[i].weight; addresources[i].qdepth = resources[i].qdepth; addresources[i].polqdepth = resources[i].polqdepth; } result = add_bulk_request(client, addresources); } return result; }
java
{ "resource": "" }
q12570
pqpolicy.update
train
public static base_response update(nitro_service client, pqpolicy resource) throws Exception { pqpolicy updateresource = new pqpolicy(); updateresource.policyname = resource.policyname; updateresource.weight = resource.weight; updateresource.qdepth = resource.qdepth; updateresource.polqdepth = resource.polqdepth; return updateresource.update_resource(client); }
java
{ "resource": "" }
q12571
pqpolicy.update
train
public static base_responses update(nitro_service client, pqpolicy resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { pqpolicy updateresources[] = new pqpolicy[resources.length]; for (int i=0;i<resources.length;i++){ updateresources[i] = new pqpolicy(); updateresources[i].policyname = resources[i].policyname; updateresources[i].weight = resources[i].weight; updateresources[i].qdepth = resources[i].qdepth; updateresources[i].polqdepth = resources[i].polqdepth; } result = update_bulk_request(client, updateresources); } return result; }
java
{ "resource": "" }
q12572
pqpolicy.unset
train
public static base_response unset(nitro_service client, pqpolicy resource, String[] args) throws Exception{ pqpolicy unsetresource = new pqpolicy(); unsetresource.policyname = resource.policyname; return unsetresource.unset_resource(client,args); }
java
{ "resource": "" }
q12573
pqpolicy.get
train
public static pqpolicy[] get(nitro_service service) throws Exception{ pqpolicy obj = new pqpolicy(); pqpolicy[] response = (pqpolicy[])obj.get_resources(service); return response; }
java
{ "resource": "" }
q12574
pqpolicy.get
train
public static pqpolicy get(nitro_service service, String policyname) throws Exception{ pqpolicy obj = new pqpolicy(); obj.set_policyname(policyname); pqpolicy response = (pqpolicy) obj.get_resource(service); return response; }
java
{ "resource": "" }
q12575
lbmonbindings_binding.get
train
public static lbmonbindings_binding get(nitro_service service, String monitorname) throws Exception{ lbmonbindings_binding obj = new lbmonbindings_binding(); obj.set_monitorname(monitorname); lbmonbindings_binding response = (lbmonbindings_binding) obj.get_resource(service); return response; }
java
{ "resource": "" }
q12576
transformpolicy_transformglobal_binding.get
train
public static transformpolicy_transformglobal_binding[] get(nitro_service service, String name) throws Exception{ transformpolicy_transformglobal_binding obj = new transformpolicy_transformglobal_binding(); obj.set_name(name); transformpolicy_transformglobal_binding response[] = (transformpolicy_transformglobal_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q12577
tunnelip6_stats.get
train
public static tunnelip6_stats[] get(nitro_service service) throws Exception{ tunnelip6_stats obj = new tunnelip6_stats(); tunnelip6_stats[] response = (tunnelip6_stats[])obj.stat_resources(service); return response; }
java
{ "resource": "" }
q12578
tunnelip6_stats.get
train
public static tunnelip6_stats get(nitro_service service, String tunnelip6) throws Exception{ tunnelip6_stats obj = new tunnelip6_stats(); obj.set_tunnelip6(tunnelip6); tunnelip6_stats response = (tunnelip6_stats) obj.stat_resource(service); return response; }
java
{ "resource": "" }
q12579
AuxiliaryTree.copy
train
public AuxiliaryTree copy(TsurgeonPattern p) { Map<String,Tree> newNamesToNodes = new HashMap<String,Tree>(); Pair<Tree,Tree> result = copyHelper(tree,newNamesToNodes); //if(! result.first().dominates(result.second())) //System.err.println("Error -- aux tree copy doesn't dominate foot copy."); p.root.newNodeNames.putAll(newNamesToNodes); return new AuxiliaryTree(result.first(), result.second(), newNamesToNodes, originalTreeString); }
java
{ "resource": "" }
q12580
AuxiliaryTree.findFootNode
train
private static Tree findFootNode(Tree t) { Tree footNode = findFootNodeHelper(t); Tree result = footNode; if (footNode != null) { Tree parent = footNode.parent(t); int i = parent.indexOf(footNode); Tree newFootNode = footNode.treeFactory().newTreeNode(footNode.label(), new ArrayList<Tree>()); parent.setChild(i, newFootNode); result = newFootNode; } return result; }
java
{ "resource": "" }
q12581
AuxiliaryTree.initializeNamesNodesMaps
train
private void initializeNamesNodesMaps(Tree t) { for (Tree node : t.subTreeList()) { Matcher m = namePattern.matcher(node.label().value()); if (m.find()) { namesToNodes.put(m.group(1),node); nodesToNames.put(node,m.group(1)); node.label().setValue(m.replaceFirst("")); } Matcher m1 = escapedNameChar.matcher(node.label().value()); node.label().setValue(m1.replaceAll(nameIntroducingChar)); } }
java
{ "resource": "" }
q12582
dnsmxrec.add
train
public static base_response add(nitro_service client, dnsmxrec resource) throws Exception { dnsmxrec addresource = new dnsmxrec(); addresource.domain = resource.domain; addresource.mx = resource.mx; addresource.pref = resource.pref; addresource.ttl = resource.ttl; return addresource.add_resource(client); }
java
{ "resource": "" }
q12583
dnsmxrec.add
train
public static base_responses add(nitro_service client, dnsmxrec resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { dnsmxrec addresources[] = new dnsmxrec[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new dnsmxrec(); addresources[i].domain = resources[i].domain; addresources[i].mx = resources[i].mx; addresources[i].pref = resources[i].pref; addresources[i].ttl = resources[i].ttl; } result = add_bulk_request(client, addresources); } return result; }
java
{ "resource": "" }
q12584
dnsmxrec.delete
train
public static base_response delete(nitro_service client, dnsmxrec resource) throws Exception { dnsmxrec deleteresource = new dnsmxrec(); deleteresource.domain = resource.domain; deleteresource.mx = resource.mx; return deleteresource.delete_resource(client); }
java
{ "resource": "" }
q12585
dnsmxrec.update
train
public static base_response update(nitro_service client, dnsmxrec resource) throws Exception { dnsmxrec updateresource = new dnsmxrec(); updateresource.domain = resource.domain; updateresource.mx = resource.mx; updateresource.pref = resource.pref; updateresource.ttl = resource.ttl; return updateresource.update_resource(client); }
java
{ "resource": "" }
q12586
dnsmxrec.update
train
public static base_responses update(nitro_service client, dnsmxrec resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { dnsmxrec updateresources[] = new dnsmxrec[resources.length]; for (int i=0;i<resources.length;i++){ updateresources[i] = new dnsmxrec(); updateresources[i].domain = resources[i].domain; updateresources[i].mx = resources[i].mx; updateresources[i].pref = resources[i].pref; updateresources[i].ttl = resources[i].ttl; } result = update_bulk_request(client, updateresources); } return result; }
java
{ "resource": "" }
q12587
dnsmxrec.unset
train
public static base_response unset(nitro_service client, dnsmxrec resource, String[] args) throws Exception{ dnsmxrec unsetresource = new dnsmxrec(); unsetresource.domain = resource.domain; unsetresource.mx = resource.mx; return unsetresource.unset_resource(client,args); }
java
{ "resource": "" }
q12588
dnsmxrec.get
train
public static dnsmxrec[] get(nitro_service service, options option) throws Exception{ dnsmxrec obj = new dnsmxrec(); dnsmxrec[] response = (dnsmxrec[])obj.get_resources(service,option); return response; }
java
{ "resource": "" }
q12589
dnsmxrec.get
train
public static dnsmxrec[] get(nitro_service service, dnsmxrec_args args) throws Exception{ dnsmxrec obj = new dnsmxrec(); options option = new options(); option.set_args(nitro_util.object_to_string_withoutquotes(args)); dnsmxrec[] response = (dnsmxrec[])obj.get_resources(service, option); return response; }
java
{ "resource": "" }
q12590
dnsmxrec.get
train
public static dnsmxrec get(nitro_service service, String domain) throws Exception{ dnsmxrec obj = new dnsmxrec(); obj.set_domain(domain); dnsmxrec response = (dnsmxrec) obj.get_resource(service); return response; }
java
{ "resource": "" }
q12591
nstrafficdomain.add
train
public static base_response add(nitro_service client, nstrafficdomain resource) throws Exception { nstrafficdomain addresource = new nstrafficdomain(); addresource.td = resource.td; addresource.aliasname = resource.aliasname; return addresource.add_resource(client); }
java
{ "resource": "" }
q12592
nstrafficdomain.add
train
public static base_responses add(nitro_service client, nstrafficdomain resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { nstrafficdomain addresources[] = new nstrafficdomain[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new nstrafficdomain(); addresources[i].td = resources[i].td; addresources[i].aliasname = resources[i].aliasname; } result = add_bulk_request(client, addresources); } return result; }
java
{ "resource": "" }
q12593
nstrafficdomain.delete
train
public static base_response delete(nitro_service client, Long td) throws Exception { nstrafficdomain deleteresource = new nstrafficdomain(); deleteresource.td = td; return deleteresource.delete_resource(client); }
java
{ "resource": "" }
q12594
nstrafficdomain.clear
train
public static base_response clear(nitro_service client, nstrafficdomain resource) throws Exception { nstrafficdomain clearresource = new nstrafficdomain(); clearresource.td = resource.td; return clearresource.perform_operation(client,"clear"); }
java
{ "resource": "" }
q12595
nstrafficdomain.clear
train
public static base_responses clear(nitro_service client, nstrafficdomain resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { nstrafficdomain clearresources[] = new nstrafficdomain[resources.length]; for (int i=0;i<resources.length;i++){ clearresources[i] = new nstrafficdomain(); clearresources[i].td = resources[i].td; } result = perform_operation_bulk_request(client, clearresources,"clear"); } return result; }
java
{ "resource": "" }
q12596
nstrafficdomain.enable
train
public static base_response enable(nitro_service client, Long td) throws Exception { nstrafficdomain enableresource = new nstrafficdomain(); enableresource.td = td; return enableresource.perform_operation(client,"enable"); }
java
{ "resource": "" }
q12597
nstrafficdomain.enable
train
public static base_response enable(nitro_service client, nstrafficdomain resource) throws Exception { nstrafficdomain enableresource = new nstrafficdomain(); enableresource.td = resource.td; enableresource.state = resource.state; return enableresource.perform_operation(client,"enable"); }
java
{ "resource": "" }
q12598
nstrafficdomain.enable
train
public static base_responses enable(nitro_service client, Long td[]) throws Exception { base_responses result = null; if (td != null && td.length > 0) { nstrafficdomain enableresources[] = new nstrafficdomain[td.length]; for (int i=0;i<td.length;i++){ enableresources[i] = new nstrafficdomain(); enableresources[i].td = td[i]; } result = perform_operation_bulk_request(client, enableresources,"enable"); } return result; }
java
{ "resource": "" }
q12599
nstrafficdomain.enable
train
public static base_responses enable(nitro_service client, nstrafficdomain resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { nstrafficdomain enableresources[] = new nstrafficdomain[resources.length]; for (int i=0;i<resources.length;i++){ enableresources[i] = new nstrafficdomain(); enableresources[i].td = resources[i].td; enableresources[i].state = resources[i].state; } result = perform_operation_bulk_request(client, enableresources,"enable"); } return result; }
java
{ "resource": "" }