_id
stringlengths
2
7
title
stringlengths
3
140
partition
stringclasses
3 values
text
stringlengths
73
34.1k
language
stringclasses
1 value
meta_information
dict
q10200
appfwjsoncontenttype.get
train
public static appfwjsoncontenttype[] get(nitro_service service, String jsoncontenttypevalue[]) throws Exception{ if (jsoncontenttypevalue !=null && jsoncontenttypevalue.length>0) { appfwjsoncontenttype response[] = new appfwjsoncontenttype[jsoncontenttypevalue.length]; appfwjsoncontenttype obj[] = new appfwjsoncontenttype[jsoncontenttypevalue.length]; for (int i=0;i<jsoncontenttypevalue.length;i++) { obj[i] = new appfwjsoncontenttype(); obj[i].set_jsoncontenttypevalue(jsoncontenttypevalue[i]); response[i] = (appfwjsoncontenttype) obj[i].get_resource(service); } return response; } return null; }
java
{ "resource": "" }
q10201
AbstractCollinsHeadFinder.determineHead
train
public Tree determineHead(Tree t, Tree parent) { if (nonTerminalInfo == null) { throw new RuntimeException("Classes derived from AbstractCollinsHeadFinder must" + " create and fill HashMap nonTerminalInfo."); } if (t == null || t.isLeaf()) { return null; } if (DEBUG) { System.err.println("determineHead for " + t.value()); } Tree[] kids = t.children(); Tree theHead; // first check if subclass found explicitly marked head if ((theHead = findMarkedHead(t)) != null) { if (DEBUG) { System.err.println("Find marked head method returned " + theHead.label() + " as head of " + t.label()); } return theHead; } // if the node is a unary, then that kid must be the head // it used to special case preterminal and ROOT/TOP case // but that seemed bad (especially hardcoding string "ROOT") if (kids.length == 1) { if (DEBUG) { System.err.println("Only one child determines " + kids[0].label() + " as head of " + t.label()); } return kids[0]; } return determineNonTrivialHead(t, parent); }
java
{ "resource": "" }
q10202
AbstractCollinsHeadFinder.determineNonTrivialHead
train
protected Tree determineNonTrivialHead(Tree t, Tree parent) { Tree theHead = null; String motherCat = tlp.basicCategory(t.label().value()); if (DEBUG) { System.err.println("Looking for head of " + t.label() + "; value is |" + t.label().value() + "|, " + " baseCat is |" + motherCat + '|'); } // We know we have nonterminals underneath // (a bit of a Penn Treebank assumption, but). // Look at label. // a total special case.... // first look for POS tag at end // this appears to be redundant in the Collins case since the rule already would do that // Tree lastDtr = t.lastChild(); // if (tlp.basicCategory(lastDtr.label().value()).equals("POS")) { // theHead = lastDtr; // } else { String[][] how = nonTerminalInfo.get(motherCat); if (how == null) { if (DEBUG) { System.err.println("Warning: No rule found for " + motherCat + " (first char: " + motherCat.charAt(0) + ')'); System.err.println("Known nonterms are: " + nonTerminalInfo.keySet()); } if (defaultRule != null) { if (DEBUG) { System.err.println(" Using defaultRule"); } return traverseLocate(t.children(), defaultRule, true); } else { return null; } } for (int i = 0; i < how.length; i++) { boolean lastResort = (i == how.length - 1); theHead = traverseLocate(t.children(), how[i], lastResort); if (theHead != null) { break; } } if (DEBUG) { System.err.println(" Chose " + theHead.label()); } return theHead; }
java
{ "resource": "" }
q10203
policydataset.add
train
public static base_response add(nitro_service client, policydataset resource) throws Exception { policydataset addresource = new policydataset(); addresource.name = resource.name; addresource.type = resource.type; addresource.indextype = resource.indextype; return addresource.add_resource(client); }
java
{ "resource": "" }
q10204
policydataset.get
train
public static policydataset[] get(nitro_service service) throws Exception{ policydataset obj = new policydataset(); policydataset[] response = (policydataset[])obj.get_resources(service); return response; }
java
{ "resource": "" }
q10205
policydataset.get
train
public static policydataset get(nitro_service service, String name) throws Exception{ policydataset obj = new policydataset(); obj.set_name(name); policydataset response = (policydataset) obj.get_resource(service); return response; }
java
{ "resource": "" }
q10206
CodecUtil.isSinglePositionPrefix
train
public static boolean isSinglePositionPrefix(FieldInfo fieldInfo, String prefix) throws IOException { if (fieldInfo == null) { throw new IOException("no fieldInfo"); } else { String info = fieldInfo.getAttribute( MtasCodecPostingsFormat.MTAS_FIELDINFO_ATTRIBUTE_PREFIX_SINGLE_POSITION); if (info == null) { throw new IOException("no " + MtasCodecPostingsFormat.MTAS_FIELDINFO_ATTRIBUTE_PREFIX_SINGLE_POSITION); } else { return Arrays.asList(info.split(Pattern.quote(MtasToken.DELIMITER))) .contains(prefix); } } }
java
{ "resource": "" }
q10207
CodecUtil.termValue
train
public static String termValue(String term) { int i = term.indexOf(MtasToken.DELIMITER); String value = null; if (i >= 0) { value = term.substring((i + MtasToken.DELIMITER.length())); value = (value.length() > 0) ? value : null; } return (value == null) ? null : value.replace("\u0000", ""); }
java
{ "resource": "" }
q10208
CodecUtil.termPrefix
train
public static String termPrefix(String term) { int i = term.indexOf(MtasToken.DELIMITER); String prefix = term; if (i >= 0) { prefix = term.substring(0, i); } return prefix.replace("\u0000", ""); }
java
{ "resource": "" }
q10209
CodecUtil.createStatsItems
train
static SortedSet<String> createStatsItems(String statsType) throws IOException { SortedSet<String> statsItems = new TreeSet<>(); SortedSet<String> functionItems = new TreeSet<>(); if (statsType != null) { Matcher m = fpStatsItems.matcher(statsType.trim()); while (m.find()) { String tmpStatsItem = m.group(2).trim(); if (STATS_TYPES.contains(tmpStatsItem)) { statsItems.add(tmpStatsItem); } else if (tmpStatsItem.equals(STATS_TYPE_ALL)) { for (String type : STATS_TYPES) { statsItems.add(type); } } else if (STATS_FUNCTIONS.contains(tmpStatsItem)) { if (m.group(3) == null) { throw new IOException("'" + tmpStatsItem + "' should be called as '" + tmpStatsItem + "()' with an optional argument"); } else { functionItems.add(m.group(1).trim()); } } else { throw new IOException("unknown statsType '" + tmpStatsItem + "'"); } } } if (statsItems.size() == 0 && functionItems.size() == 0) { statsItems.add(STATS_TYPE_SUM); statsItems.add(STATS_TYPE_N); statsItems.add(STATS_TYPE_MEAN); } if (functionItems.size() > 0) { statsItems.addAll(functionItems); } return statsItems; }
java
{ "resource": "" }
q10210
CodecUtil.createStatsType
train
static String createStatsType(Set<String> statsItems, String sortType, MtasFunctionParserFunction functionParser) { String statsType = STATS_BASIC; for (String statsItem : statsItems) { if (STATS_FULL_TYPES.contains(statsItem)) { statsType = STATS_FULL; break; } else if (STATS_ADVANCED_TYPES.contains(statsItem)) { statsType = STATS_ADVANCED; } else if (statsType != STATS_ADVANCED && STATS_BASIC_TYPES.contains(statsItem)) { statsType = STATS_BASIC; } else { Matcher m = fpStatsFunctionItems.matcher(statsItem.trim()); if (m.find()) { if (STATS_FUNCTIONS.contains(m.group(2).trim())) { statsType = STATS_FULL; break; } } } } if (sortType != null && STATS_TYPES.contains(sortType)) { if (STATS_FULL_TYPES.contains(sortType)) { statsType = STATS_FULL; } else if (STATS_ADVANCED_TYPES.contains(sortType)) { statsType = (statsType == null || statsType != STATS_FULL) ? STATS_ADVANCED : statsType; } } return statsType; }
java
{ "resource": "" }
q10211
appfwwsdl.get
train
public static appfwwsdl get(nitro_service service) throws Exception{ appfwwsdl obj = new appfwwsdl(); appfwwsdl[] response = (appfwwsdl[])obj.get_resources(service); return response[0]; }
java
{ "resource": "" }
q10212
appfwwsdl.get
train
public static appfwwsdl get(nitro_service service, String name) throws Exception{ appfwwsdl obj = new appfwwsdl(); obj.set_name(name); appfwwsdl response = (appfwwsdl) obj.get_resource(service); return response; }
java
{ "resource": "" }
q10213
lbvserver_servicegroup_binding.get
train
public static lbvserver_servicegroup_binding[] get(nitro_service service, String name) throws Exception{ lbvserver_servicegroup_binding obj = new lbvserver_servicegroup_binding(); obj.set_name(name); lbvserver_servicegroup_binding response[] = (lbvserver_servicegroup_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q10214
systemsession.kill
train
public static base_response kill(nitro_service client, systemsession resource) throws Exception { systemsession killresource = new systemsession(); killresource.sid = resource.sid; killresource.all = resource.all; return killresource.perform_operation(client,"kill"); }
java
{ "resource": "" }
q10215
systemsession.kill
train
public static base_responses kill(nitro_service client, systemsession resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { systemsession killresources[] = new systemsession[resources.length]; for (int i=0;i<resources.length;i++){ killresources[i] = new systemsession(); killresources[i].sid = resources[i].sid; killresources[i].all = resources[i].all; } result = perform_operation_bulk_request(client, killresources,"kill"); } return result; }
java
{ "resource": "" }
q10216
systemsession.get
train
public static systemsession[] get(nitro_service service) throws Exception{ systemsession obj = new systemsession(); systemsession[] response = (systemsession[])obj.get_resources(service); return response; }
java
{ "resource": "" }
q10217
systemsession.get
train
public static systemsession get(nitro_service service, Long sid) throws Exception{ systemsession obj = new systemsession(); obj.set_sid(sid); systemsession response = (systemsession) obj.get_resource(service); return response; }
java
{ "resource": "" }
q10218
systemsession.get
train
public static systemsession[] get(nitro_service service, Long sid[]) throws Exception{ if (sid !=null && sid.length>0) { systemsession response[] = new systemsession[sid.length]; systemsession obj[] = new systemsession[sid.length]; for (int i=0;i<sid.length;i++) { obj[i] = new systemsession(); obj[i].set_sid(sid[i]); response[i] = (systemsession) obj[i].get_resource(service); } return response; } return null; }
java
{ "resource": "" }
q10219
snmpalarm.update
train
public static base_response update(nitro_service client, snmpalarm resource) throws Exception { snmpalarm updateresource = new snmpalarm(); updateresource.trapname = resource.trapname; updateresource.thresholdvalue = resource.thresholdvalue; updateresource.normalvalue = resource.normalvalue; updateresource.time = resource.time; updateresource.state = resource.state; updateresource.severity = resource.severity; updateresource.logging = resource.logging; return updateresource.update_resource(client); }
java
{ "resource": "" }
q10220
snmpalarm.update
train
public static base_responses update(nitro_service client, snmpalarm resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { snmpalarm updateresources[] = new snmpalarm[resources.length]; for (int i=0;i<resources.length;i++){ updateresources[i] = new snmpalarm(); updateresources[i].trapname = resources[i].trapname; updateresources[i].thresholdvalue = resources[i].thresholdvalue; updateresources[i].normalvalue = resources[i].normalvalue; updateresources[i].time = resources[i].time; updateresources[i].state = resources[i].state; updateresources[i].severity = resources[i].severity; updateresources[i].logging = resources[i].logging; } result = update_bulk_request(client, updateresources); } return result; }
java
{ "resource": "" }
q10221
snmpalarm.unset
train
public static base_response unset(nitro_service client, snmpalarm resource, String[] args) throws Exception{ snmpalarm unsetresource = new snmpalarm(); unsetresource.trapname = resource.trapname; return unsetresource.unset_resource(client,args); }
java
{ "resource": "" }
q10222
snmpalarm.unset
train
public static base_responses unset(nitro_service client, String trapname[], String args[]) throws Exception { base_responses result = null; if (trapname != null && trapname.length > 0) { snmpalarm unsetresources[] = new snmpalarm[trapname.length]; for (int i=0;i<trapname.length;i++){ unsetresources[i] = new snmpalarm(); unsetresources[i].trapname = trapname[i]; } result = unset_bulk_request(client, unsetresources,args); } return result; }
java
{ "resource": "" }
q10223
snmpalarm.enable
train
public static base_response enable(nitro_service client, String trapname) throws Exception { snmpalarm enableresource = new snmpalarm(); enableresource.trapname = trapname; return enableresource.perform_operation(client,"enable"); }
java
{ "resource": "" }
q10224
snmpalarm.enable
train
public static base_responses enable(nitro_service client, String trapname[]) throws Exception { base_responses result = null; if (trapname != null && trapname.length > 0) { snmpalarm enableresources[] = new snmpalarm[trapname.length]; for (int i=0;i<trapname.length;i++){ enableresources[i] = new snmpalarm(); enableresources[i].trapname = trapname[i]; } result = perform_operation_bulk_request(client, enableresources,"enable"); } return result; }
java
{ "resource": "" }
q10225
snmpalarm.disable
train
public static base_response disable(nitro_service client, String trapname) throws Exception { snmpalarm disableresource = new snmpalarm(); disableresource.trapname = trapname; return disableresource.perform_operation(client,"disable"); }
java
{ "resource": "" }
q10226
snmpalarm.disable
train
public static base_responses disable(nitro_service client, String trapname[]) throws Exception { base_responses result = null; if (trapname != null && trapname.length > 0) { snmpalarm disableresources[] = new snmpalarm[trapname.length]; for (int i=0;i<trapname.length;i++){ disableresources[i] = new snmpalarm(); disableresources[i].trapname = trapname[i]; } result = perform_operation_bulk_request(client, disableresources,"disable"); } return result; }
java
{ "resource": "" }
q10227
snmpalarm.get
train
public static snmpalarm[] get(nitro_service service) throws Exception{ snmpalarm obj = new snmpalarm(); snmpalarm[] response = (snmpalarm[])obj.get_resources(service); return response; }
java
{ "resource": "" }
q10228
snmpalarm.get
train
public static snmpalarm get(nitro_service service, String trapname) throws Exception{ snmpalarm obj = new snmpalarm(); obj.set_trapname(trapname); snmpalarm response = (snmpalarm) obj.get_resource(service); return response; }
java
{ "resource": "" }
q10229
snmpalarm.get
train
public static snmpalarm[] get(nitro_service service, String trapname[]) throws Exception{ if (trapname !=null && trapname.length>0) { snmpalarm response[] = new snmpalarm[trapname.length]; snmpalarm obj[] = new snmpalarm[trapname.length]; for (int i=0;i<trapname.length;i++) { obj[i] = new snmpalarm(); obj[i].set_trapname(trapname[i]); response[i] = (snmpalarm) obj[i].get_resource(service); } return response; } return null; }
java
{ "resource": "" }
q10230
dnsglobal_binding.get
train
public static dnsglobal_binding get(nitro_service service) throws Exception{ dnsglobal_binding obj = new dnsglobal_binding(); dnsglobal_binding response = (dnsglobal_binding) obj.get_resource(service); return response; }
java
{ "resource": "" }
q10231
sslfipskey.create
train
public static base_response create(nitro_service client, sslfipskey resource) throws Exception { sslfipskey createresource = new sslfipskey(); createresource.fipskeyname = resource.fipskeyname; createresource.modulus = resource.modulus; createresource.exponent = resource.exponent; return createresource.perform_operation(client,"create"); }
java
{ "resource": "" }
q10232
sslfipskey.create
train
public static base_responses create(nitro_service client, sslfipskey resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { sslfipskey createresources[] = new sslfipskey[resources.length]; for (int i=0;i<resources.length;i++){ createresources[i] = new sslfipskey(); createresources[i].fipskeyname = resources[i].fipskeyname; createresources[i].modulus = resources[i].modulus; createresources[i].exponent = resources[i].exponent; } result = perform_operation_bulk_request(client, createresources,"create"); } return result; }
java
{ "resource": "" }
q10233
sslfipskey.delete
train
public static base_response delete(nitro_service client, String fipskeyname) throws Exception { sslfipskey deleteresource = new sslfipskey(); deleteresource.fipskeyname = fipskeyname; return deleteresource.delete_resource(client); }
java
{ "resource": "" }
q10234
sslfipskey.delete
train
public static base_responses delete(nitro_service client, String fipskeyname[]) throws Exception { base_responses result = null; if (fipskeyname != null && fipskeyname.length > 0) { sslfipskey deleteresources[] = new sslfipskey[fipskeyname.length]; for (int i=0;i<fipskeyname.length;i++){ deleteresources[i] = new sslfipskey(); deleteresources[i].fipskeyname = fipskeyname[i]; } result = delete_bulk_request(client, deleteresources); } return result; }
java
{ "resource": "" }
q10235
sslfipskey.Import
train
public static base_response Import(nitro_service client, sslfipskey resource) throws Exception { sslfipskey Importresource = new sslfipskey(); Importresource.fipskeyname = resource.fipskeyname; Importresource.key = resource.key; Importresource.inform = resource.inform; Importresource.wrapkeyname = resource.wrapkeyname; Importresource.iv = resource.iv; Importresource.exponent = resource.exponent; return Importresource.perform_operation(client,"Import"); }
java
{ "resource": "" }
q10236
sslfipskey.Import
train
public static base_responses Import(nitro_service client, sslfipskey resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { sslfipskey Importresources[] = new sslfipskey[resources.length]; for (int i=0;i<resources.length;i++){ Importresources[i] = new sslfipskey(); Importresources[i].fipskeyname = resources[i].fipskeyname; Importresources[i].key = resources[i].key; Importresources[i].inform = resources[i].inform; Importresources[i].wrapkeyname = resources[i].wrapkeyname; Importresources[i].iv = resources[i].iv; Importresources[i].exponent = resources[i].exponent; } result = perform_operation_bulk_request(client, Importresources,"Import"); } return result; }
java
{ "resource": "" }
q10237
sslfipskey.export
train
public static base_response export(nitro_service client, sslfipskey resource) throws Exception { sslfipskey exportresource = new sslfipskey(); exportresource.fipskeyname = resource.fipskeyname; exportresource.key = resource.key; return exportresource.perform_operation(client,"export"); }
java
{ "resource": "" }
q10238
sslfipskey.export
train
public static base_responses export(nitro_service client, sslfipskey resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { sslfipskey exportresources[] = new sslfipskey[resources.length]; for (int i=0;i<resources.length;i++){ exportresources[i] = new sslfipskey(); exportresources[i].fipskeyname = resources[i].fipskeyname; exportresources[i].key = resources[i].key; } result = perform_operation_bulk_request(client, exportresources,"export"); } return result; }
java
{ "resource": "" }
q10239
sslfipskey.get
train
public static sslfipskey[] get(nitro_service service) throws Exception{ sslfipskey obj = new sslfipskey(); sslfipskey[] response = (sslfipskey[])obj.get_resources(service); return response; }
java
{ "resource": "" }
q10240
sslfipskey.get
train
public static sslfipskey get(nitro_service service, String fipskeyname) throws Exception{ sslfipskey obj = new sslfipskey(); obj.set_fipskeyname(fipskeyname); sslfipskey response = (sslfipskey) obj.get_resource(service); return response; }
java
{ "resource": "" }
q10241
sslfipskey.get
train
public static sslfipskey[] get(nitro_service service, String fipskeyname[]) throws Exception{ if (fipskeyname !=null && fipskeyname.length>0) { sslfipskey response[] = new sslfipskey[fipskeyname.length]; sslfipskey obj[] = new sslfipskey[fipskeyname.length]; for (int i=0;i<fipskeyname.length;i++) { obj[i] = new sslfipskey(); obj[i].set_fipskeyname(fipskeyname[i]); response[i] = (sslfipskey) obj[i].get_resource(service); } return response; } return null; }
java
{ "resource": "" }
q10242
aaauser_vpntrafficpolicy_binding.get
train
public static aaauser_vpntrafficpolicy_binding[] get(nitro_service service, String username) throws Exception{ aaauser_vpntrafficpolicy_binding obj = new aaauser_vpntrafficpolicy_binding(); obj.set_username(username); aaauser_vpntrafficpolicy_binding response[] = (aaauser_vpntrafficpolicy_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q10243
gslbdomain_stats.get
train
public static gslbdomain_stats[] get(nitro_service service) throws Exception{ gslbdomain_stats obj = new gslbdomain_stats(); gslbdomain_stats[] response = (gslbdomain_stats[])obj.stat_resources(service); return response; }
java
{ "resource": "" }
q10244
gslbdomain_stats.get
train
public static gslbdomain_stats get(nitro_service service, String name) throws Exception{ gslbdomain_stats obj = new gslbdomain_stats(); obj.set_name(name); gslbdomain_stats response = (gslbdomain_stats) obj.stat_resource(service); return response; }
java
{ "resource": "" }
q10245
appfwsignatures.Import
train
public static base_response Import(nitro_service client, appfwsignatures resource) throws Exception { appfwsignatures Importresource = new appfwsignatures(); Importresource.src = resource.src; Importresource.name = resource.name; Importresource.xslt = resource.xslt; Importresource.comment = resource.comment; Importresource.overwrite = resource.overwrite; Importresource.merge = resource.merge; Importresource.sha1 = resource.sha1; return Importresource.perform_operation(client,"Import"); }
java
{ "resource": "" }
q10246
appfwsignatures.change
train
public static base_response change(nitro_service client, appfwsignatures resource) throws Exception { appfwsignatures updateresource = new appfwsignatures(); updateresource.name = resource.name; updateresource.mergedefault = resource.mergedefault; return updateresource.perform_operation(client,"update"); }
java
{ "resource": "" }
q10247
appfwsignatures.get
train
public static appfwsignatures get(nitro_service service) throws Exception{ appfwsignatures obj = new appfwsignatures(); appfwsignatures[] response = (appfwsignatures[])obj.get_resources(service); return response[0]; }
java
{ "resource": "" }
q10248
appfwsignatures.get
train
public static appfwsignatures get(nitro_service service, String name) throws Exception{ appfwsignatures obj = new appfwsignatures(); obj.set_name(name); appfwsignatures response = (appfwsignatures) obj.get_resource(service); return response; }
java
{ "resource": "" }
q10249
MtasToken.addPosition
train
final public void addPosition(int position) { if (tokenPosition == null) { tokenPosition = new MtasPosition(position); } else { tokenPosition.add(position); } }
java
{ "resource": "" }
q10250
MtasToken.addPositionRange
train
final public void addPositionRange(int start, int end) { if (tokenPosition == null) { tokenPosition = new MtasPosition(start, end); } else { int[] positions = new int[end - start + 1]; for (int i = start; i <= end; i++) { positions[i - start] = i; } tokenPosition.add(positions); } }
java
{ "resource": "" }
q10251
MtasToken.checkPositionType
train
final public Boolean checkPositionType(String type) { if (tokenPosition == null) { return false; } else { return tokenPosition.checkType(type); } }
java
{ "resource": "" }
q10252
MtasToken.checkRealOffset
train
final public Boolean checkRealOffset() { if ((tokenRealOffset == null) || !provideRealOffset) { return false; } else if (tokenOffset == null) { return true; } else if (tokenOffset.getStart() == tokenRealOffset.getStart() && tokenOffset.getEnd() == tokenRealOffset.getEnd()) { return false; } else { return true; } }
java
{ "resource": "" }
q10253
MtasToken.addOffset
train
final public void addOffset(Integer start, Integer end) { if (tokenOffset == null) { setOffset(start, end); } else if ((start == null) || (end == null)) { // do nothing } else if (start > end) { throw new IllegalArgumentException("Start offset after end offset"); } else { tokenOffset.add(start, end); } }
java
{ "resource": "" }
q10254
MtasToken.setRealOffset
train
final public void setRealOffset(Integer start, Integer end) { if ((start == null) || (end == null)) { // do nothing } else if (start > end) { throw new IllegalArgumentException( "Start real offset after end real offset"); } else { tokenRealOffset = new MtasOffset(start, end); } }
java
{ "resource": "" }
q10255
MtasToken.getPrefixFromValue
train
public static String getPrefixFromValue(String value) { if (value == null) { return null; } else if (value.contains(DELIMITER)) { String[] list = value.split(DELIMITER); if (list != null && list.length > 0) { return list[0].replaceAll("\u0000", ""); } else { return null; } } else { return value.replaceAll("\u0000", ""); } }
java
{ "resource": "" }
q10256
MtasToken.createAutomatonMap
train
public static Map<String, Automaton> createAutomatonMap(String prefix, List<String> valueList, Boolean filter) { HashMap<String, Automaton> automatonMap = new HashMap<>(); if (valueList != null) { for (String item : valueList) { if (filter) { item = item.replaceAll("([\\\"\\)\\(\\<\\>\\.\\@\\#\\]\\[\\{\\}])", "\\\\$1"); } automatonMap.put(item, new RegExp(prefix + MtasToken.DELIMITER + item + "\u0000*") .toAutomaton()); } } return automatonMap; }
java
{ "resource": "" }
q10257
MtasToken.byteRunAutomatonMap
train
public static Map<String, ByteRunAutomaton> byteRunAutomatonMap( Map<String, Automaton> automatonMap) { HashMap<String, ByteRunAutomaton> byteRunAutomatonMap = new HashMap<>(); if (automatonMap != null) { for (Entry<String, Automaton> entry : automatonMap.entrySet()) { byteRunAutomatonMap.put(entry.getKey(), new ByteRunAutomaton(entry.getValue())); } } return byteRunAutomatonMap; }
java
{ "resource": "" }
q10258
MtasToken.createAutomata
train
public static List<CompiledAutomaton> createAutomata(String prefix, String regexp, Map<String, Automaton> automatonMap) throws IOException { List<CompiledAutomaton> list = new ArrayList<>(); Automaton automatonRegexp = null; if (regexp != null) { RegExp re = new RegExp(prefix + MtasToken.DELIMITER + regexp + "\u0000*"); automatonRegexp = re.toAutomaton(); } int step = 500; List<String> keyList = new ArrayList<>(automatonMap.keySet()); for (int i = 0; i < keyList.size(); i += step) { int localStep = step; boolean success = false; CompiledAutomaton compiledAutomaton = null; while (!success) { success = true; int next = Math.min(keyList.size(), i + localStep); List<Automaton> listAutomaton = new ArrayList<>(); for (int j = i; j < next; j++) { listAutomaton.add(automatonMap.get(keyList.get(j))); } Automaton automatonList = Operations.union(listAutomaton); Automaton automaton; if (automatonRegexp != null) { automaton = Operations.intersection(automatonList, automatonRegexp); } else { automaton = automatonList; } try { compiledAutomaton = new CompiledAutomaton(automaton); } catch (TooComplexToDeterminizeException e) { log.debug(e); success = false; if (localStep > 1) { localStep /= 2; } else { throw new IOException("TooComplexToDeterminizeException"); } } } list.add(compiledAutomaton); } return list; }
java
{ "resource": "" }
q10259
authenticationtacacspolicy_authenticationvserver_binding.get
train
public static authenticationtacacspolicy_authenticationvserver_binding[] get(nitro_service service, String name) throws Exception{ authenticationtacacspolicy_authenticationvserver_binding obj = new authenticationtacacspolicy_authenticationvserver_binding(); obj.set_name(name); authenticationtacacspolicy_authenticationvserver_binding response[] = (authenticationtacacspolicy_authenticationvserver_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q10260
snmpmanager.add
train
public static base_response add(nitro_service client, snmpmanager resource) throws Exception { snmpmanager addresource = new snmpmanager(); addresource.ipaddress = resource.ipaddress; addresource.netmask = resource.netmask; addresource.domainresolveretry = resource.domainresolveretry; return addresource.add_resource(client); }
java
{ "resource": "" }
q10261
snmpmanager.add
train
public static base_responses add(nitro_service client, snmpmanager resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { snmpmanager addresources[] = new snmpmanager[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new snmpmanager(); addresources[i].ipaddress = resources[i].ipaddress; addresources[i].netmask = resources[i].netmask; addresources[i].domainresolveretry = resources[i].domainresolveretry; } result = add_bulk_request(client, addresources); } return result; }
java
{ "resource": "" }
q10262
snmpmanager.delete
train
public static base_response delete(nitro_service client, snmpmanager resource) throws Exception { snmpmanager deleteresource = new snmpmanager(); deleteresource.ipaddress = resource.ipaddress; deleteresource.netmask = resource.netmask; return deleteresource.delete_resource(client); }
java
{ "resource": "" }
q10263
snmpmanager.update
train
public static base_response update(nitro_service client, snmpmanager resource) throws Exception { snmpmanager updateresource = new snmpmanager(); updateresource.ipaddress = resource.ipaddress; updateresource.netmask = resource.netmask; updateresource.domainresolveretry = resource.domainresolveretry; return updateresource.update_resource(client); }
java
{ "resource": "" }
q10264
snmpmanager.update
train
public static base_responses update(nitro_service client, snmpmanager resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { snmpmanager updateresources[] = new snmpmanager[resources.length]; for (int i=0;i<resources.length;i++){ updateresources[i] = new snmpmanager(); updateresources[i].ipaddress = resources[i].ipaddress; updateresources[i].netmask = resources[i].netmask; updateresources[i].domainresolveretry = resources[i].domainresolveretry; } result = update_bulk_request(client, updateresources); } return result; }
java
{ "resource": "" }
q10265
snmpmanager.unset
train
public static base_response unset(nitro_service client, snmpmanager resource, String[] args) throws Exception{ snmpmanager unsetresource = new snmpmanager(); unsetresource.ipaddress = resource.ipaddress; unsetresource.netmask = resource.netmask; return unsetresource.unset_resource(client,args); }
java
{ "resource": "" }
q10266
snmpmanager.get
train
public static snmpmanager[] get(nitro_service service) throws Exception{ snmpmanager obj = new snmpmanager(); snmpmanager[] response = (snmpmanager[])obj.get_resources(service); return response; }
java
{ "resource": "" }
q10267
appfwprofile_denyurl_binding.get
train
public static appfwprofile_denyurl_binding[] get(nitro_service service, String name) throws Exception{ appfwprofile_denyurl_binding obj = new appfwprofile_denyurl_binding(); obj.set_name(name); appfwprofile_denyurl_binding response[] = (appfwprofile_denyurl_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q10268
netbridge_vlan_binding.get
train
public static netbridge_vlan_binding[] get(nitro_service service, String name) throws Exception{ netbridge_vlan_binding obj = new netbridge_vlan_binding(); obj.set_name(name); netbridge_vlan_binding response[] = (netbridge_vlan_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q10269
audit_stats.get
train
public static audit_stats get(nitro_service service, options option) throws Exception{ audit_stats obj = new audit_stats(); audit_stats[] response = (audit_stats[])obj.stat_resources(service,option); return response[0]; }
java
{ "resource": "" }
q10270
nitro_service.clear_config
train
public base_response clear_config(Boolean force, String level) throws Exception { base_response result = null; nsconfig resource = new nsconfig(); if (force) resource.set_force(force); resource.set_level(level); options option = new options(); option.set_action("clear"); result = resource.perform_operation(this, option); return result; }
java
{ "resource": "" }
q10271
nitro_service.enable_features
train
public base_response enable_features(String[] features) throws Exception { base_response result = null; nsfeature resource = new nsfeature(); resource.set_feature(features); options option = new options(); option.set_action("enable"); result = resource.perform_operation(this, option); return result; }
java
{ "resource": "" }
q10272
nitro_service.enable_modes
train
public base_response enable_modes(String[] modes) throws Exception { base_response result = null; nsmode resource = new nsmode(); resource.set_mode(modes); options option = new options(); option.set_action("enable"); result = resource.perform_operation(this, option); return result; }
java
{ "resource": "" }
q10273
nitro_service.login
train
public base_response login(String username, String password, Long timeout) throws Exception { this.set_credential(username, password); this.set_timeout(timeout); return this.login(); }
java
{ "resource": "" }
q10274
nitro_service.set_protocol
train
public void set_protocol(String protocol) throws nitro_exception { if (protocol == null || !(protocol.equalsIgnoreCase("http") ||protocol.equalsIgnoreCase("https"))) { throw new nitro_exception("error: protocol value " + protocol + " is not supported"); } this.protocol = protocol; }
java
{ "resource": "" }
q10275
authenticationvserver_authenticationlocalpolicy_binding.get
train
public static authenticationvserver_authenticationlocalpolicy_binding[] get(nitro_service service, String name) throws Exception{ authenticationvserver_authenticationlocalpolicy_binding obj = new authenticationvserver_authenticationlocalpolicy_binding(); obj.set_name(name); authenticationvserver_authenticationlocalpolicy_binding response[] = (authenticationvserver_authenticationlocalpolicy_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q10276
responderglobal_responderpolicy_binding.get
train
public static responderglobal_responderpolicy_binding[] get(nitro_service service) throws Exception{ responderglobal_responderpolicy_binding obj = new responderglobal_responderpolicy_binding(); responderglobal_responderpolicy_binding response[] = (responderglobal_responderpolicy_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q10277
systemmemory_stats.get
train
public static systemmemory_stats get(nitro_service service) throws Exception{ systemmemory_stats obj = new systemmemory_stats(); systemmemory_stats[] response = (systemmemory_stats[])obj.stat_resources(service); return response[0]; }
java
{ "resource": "" }
q10278
sslservice.unset
train
public static base_response unset(nitro_service client, sslservice resource, String[] args) throws Exception{ sslservice unsetresource = new sslservice(); unsetresource.servicename = resource.servicename; return unsetresource.unset_resource(client,args); }
java
{ "resource": "" }
q10279
sslservice.get
train
public static sslservice[] get(nitro_service service) throws Exception{ sslservice obj = new sslservice(); sslservice[] response = (sslservice[])obj.get_resources(service); return response; }
java
{ "resource": "" }
q10280
sslservice.get
train
public static sslservice[] get(nitro_service service, sslservice_args args) throws Exception{ sslservice obj = new sslservice(); options option = new options(); option.set_args(nitro_util.object_to_string_withoutquotes(args)); sslservice[] response = (sslservice[])obj.get_resources(service, option); return response; }
java
{ "resource": "" }
q10281
sslservice.get
train
public static sslservice get(nitro_service service, String servicename) throws Exception{ sslservice obj = new sslservice(); obj.set_servicename(servicename); sslservice response = (sslservice) obj.get_resource(service); return response; }
java
{ "resource": "" }
q10282
vpath.add
train
public static base_response add(nitro_service client, vpath resource) throws Exception { vpath addresource = new vpath(); addresource.name = resource.name; addresource.destip = resource.destip; addresource.encapmode = resource.encapmode; return addresource.add_resource(client); }
java
{ "resource": "" }
q10283
vpath.add
train
public static base_responses add(nitro_service client, vpath resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { vpath addresources[] = new vpath[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new vpath(); addresources[i].name = resources[i].name; addresources[i].destip = resources[i].destip; addresources[i].encapmode = resources[i].encapmode; } result = add_bulk_request(client, addresources); } return result; }
java
{ "resource": "" }
q10284
vpath.get
train
public static vpath[] get(nitro_service service) throws Exception{ vpath obj = new vpath(); vpath[] response = (vpath[])obj.get_resources(service); return response; }
java
{ "resource": "" }
q10285
vpath.get
train
public static vpath get(nitro_service service, String name) throws Exception{ vpath obj = new vpath(); obj.set_name(name); vpath response = (vpath) obj.get_resource(service); return response; }
java
{ "resource": "" }
q10286
TreeTokenizerFactory.getTokenizer
train
public Tokenizer<Tree> getTokenizer(final Reader r) { return new AbstractTokenizer<Tree>() { TreeReader tr = trf.newTreeReader(r); @Override public Tree getNext() { try { return tr.readTree(); } catch(IOException e) { System.err.println("Error in reading tree."); return null; } } }; }
java
{ "resource": "" }
q10287
lbvserver_scpolicy_binding.get
train
public static lbvserver_scpolicy_binding[] get(nitro_service service, String name) throws Exception{ lbvserver_scpolicy_binding obj = new lbvserver_scpolicy_binding(); obj.set_name(name); lbvserver_scpolicy_binding response[] = (lbvserver_scpolicy_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q10288
transformpolicylabel.get
train
public static transformpolicylabel[] get(nitro_service service) throws Exception{ transformpolicylabel obj = new transformpolicylabel(); transformpolicylabel[] response = (transformpolicylabel[])obj.get_resources(service); return response; }
java
{ "resource": "" }
q10289
transformpolicylabel.get
train
public static transformpolicylabel get(nitro_service service, String labelname) throws Exception{ transformpolicylabel obj = new transformpolicylabel(); obj.set_labelname(labelname); transformpolicylabel response = (transformpolicylabel) obj.get_resource(service); return response; }
java
{ "resource": "" }
q10290
ntpserver.add
train
public static base_response add(nitro_service client, ntpserver resource) throws Exception { ntpserver addresource = new ntpserver(); addresource.serverip = resource.serverip; addresource.servername = resource.servername; addresource.minpoll = resource.minpoll; addresource.maxpoll = resource.maxpoll; addresource.autokey = resource.autokey; addresource.key = resource.key; return addresource.add_resource(client); }
java
{ "resource": "" }
q10291
ntpserver.add
train
public static base_responses add(nitro_service client, ntpserver resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { ntpserver addresources[] = new ntpserver[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new ntpserver(); addresources[i].serverip = resources[i].serverip; addresources[i].servername = resources[i].servername; addresources[i].minpoll = resources[i].minpoll; addresources[i].maxpoll = resources[i].maxpoll; addresources[i].autokey = resources[i].autokey; addresources[i].key = resources[i].key; } result = add_bulk_request(client, addresources); } return result; }
java
{ "resource": "" }
q10292
ntpserver.delete
train
public static base_response delete(nitro_service client, String serverip) throws Exception { ntpserver deleteresource = new ntpserver(); deleteresource.serverip = serverip; return deleteresource.delete_resource(client); }
java
{ "resource": "" }
q10293
ntpserver.delete
train
public static base_response delete(nitro_service client, ntpserver resource) throws Exception { ntpserver deleteresource = new ntpserver(); deleteresource.serverip = resource.serverip; deleteresource.servername = resource.servername; return deleteresource.delete_resource(client); }
java
{ "resource": "" }
q10294
ntpserver.delete
train
public static base_responses delete(nitro_service client, String serverip[]) throws Exception { base_responses result = null; if (serverip != null && serverip.length > 0) { ntpserver deleteresources[] = new ntpserver[serverip.length]; for (int i=0;i<serverip.length;i++){ deleteresources[i] = new ntpserver(); deleteresources[i].serverip = serverip[i]; } result = delete_bulk_request(client, deleteresources); } return result; }
java
{ "resource": "" }
q10295
ntpserver.delete
train
public static base_responses delete(nitro_service client, ntpserver resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { ntpserver deleteresources[] = new ntpserver[resources.length]; for (int i=0;i<resources.length;i++){ deleteresources[i] = new ntpserver(); deleteresources[i].serverip = resources[i].serverip; deleteresources[i].servername = resources[i].servername; } result = delete_bulk_request(client, deleteresources); } return result; }
java
{ "resource": "" }
q10296
ntpserver.update
train
public static base_response update(nitro_service client, ntpserver resource) throws Exception { ntpserver updateresource = new ntpserver(); updateresource.serverip = resource.serverip; updateresource.servername = resource.servername; updateresource.minpoll = resource.minpoll; updateresource.maxpoll = resource.maxpoll; updateresource.preferredntpserver = resource.preferredntpserver; updateresource.autokey = resource.autokey; updateresource.key = resource.key; return updateresource.update_resource(client); }
java
{ "resource": "" }
q10297
ntpserver.update
train
public static base_responses update(nitro_service client, ntpserver resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { ntpserver updateresources[] = new ntpserver[resources.length]; for (int i=0;i<resources.length;i++){ updateresources[i] = new ntpserver(); updateresources[i].serverip = resources[i].serverip; updateresources[i].servername = resources[i].servername; updateresources[i].minpoll = resources[i].minpoll; updateresources[i].maxpoll = resources[i].maxpoll; updateresources[i].preferredntpserver = resources[i].preferredntpserver; updateresources[i].autokey = resources[i].autokey; updateresources[i].key = resources[i].key; } result = update_bulk_request(client, updateresources); } return result; }
java
{ "resource": "" }
q10298
ntpserver.unset
train
public static base_response unset(nitro_service client, ntpserver resource, String[] args) throws Exception{ ntpserver unsetresource = new ntpserver(); unsetresource.serverip = resource.serverip; unsetresource.servername = resource.servername; return unsetresource.unset_resource(client,args); }
java
{ "resource": "" }
q10299
ntpserver.get
train
public static ntpserver[] get(nitro_service service) throws Exception{ ntpserver obj = new ntpserver(); ntpserver[] response = (ntpserver[])obj.get_resources(service); return response; }
java
{ "resource": "" }