_id
stringlengths
2
7
title
stringlengths
3
140
partition
stringclasses
3 values
text
stringlengths
73
34.1k
language
stringclasses
1 value
meta_information
dict
q12900
GrammaticalStructure.getDependencyPath
train
public List<String> getDependencyPath(int nodeIndex, int rootIndex) { TreeGraphNode node = getNodeByIndex(nodeIndex); TreeGraphNode rootTree = getNodeByIndex(rootIndex); return getDependencyPath(node, rootTree); }
java
{ "resource": "" }
q12901
GrammaticalStructure.getDependencyPath
train
private static List<String> getDependencyPath(TreeGraphNode node, TreeGraphNode root) { List<String> path = new ArrayList<String>(); while (!node.equals(root)) { TreeGraphNode gov = getGovernor(node); // System.out.println("Governor for \"" + node.value() + "\": \"" + gov.value() + "\""); List<GrammaticalRelation> relations = getListGrammaticalRelation(gov, node); StringBuilder sb = new StringBuilder(); for (GrammaticalRelation relation : relations) { //if (!arcLabel.equals(GOVERNOR)) sb.append((sb.length() == 0 ? "" : "+")).append(relation.toString()); } path.add(sb.toString()); node = gov; } return path; }
java
{ "resource": "" }
q12902
GrammaticalStructure.getAllDependents
train
private static Map<Class<? extends CoreAnnotation>, Set<TreeGraphNode>> getAllDependents(TreeGraphNode node) { Map<Class<? extends CoreAnnotation>, Set<TreeGraphNode>> newMap = Generics.newHashMap(); for (Class<?> o : node.label.keySet()) { try { // The line below will exception unless it's a GrammaticalRelationAnnotation, // so the effect is that only the GrammaticalRelationAnnotation things get put into newMap o.asSubclass(GrammaticalRelationAnnotation.class); newMap.put((Class<? extends CoreAnnotation>) o, (Set<TreeGraphNode>) node.label.get((Class<? extends CoreAnnotation>) o));//javac doesn't compile properly if generics are fully specified (but eclipse does...) } catch (Exception e) { // ignore a non-GrammaticalRelationAnnotation element } } return newMap; }
java
{ "resource": "" }
q12903
GrammaticalStructure.getRoots
train
public static Collection<TypedDependency> getRoots(Collection<TypedDependency> list) { Collection<TypedDependency> roots = new ArrayList<TypedDependency>(); // need to see if more than one governor is not listed somewhere as a dependent // first take all the deps Collection<TreeGraphNode> deps = new HashSet<TreeGraphNode>(); for (TypedDependency typedDep : list) { deps.add(typedDep.dep()); } // go through the list and add typedDependency for which the gov is not a dep Collection<TreeGraphNode> govs = new HashSet<TreeGraphNode>(); for (TypedDependency typedDep : list) { TreeGraphNode gov = typedDep.gov(); if (!deps.contains(gov) && !govs.contains(gov)) { roots.add(typedDep); } govs.add(gov); } return roots; }
java
{ "resource": "" }
q12904
GrammaticalStructure.printDependencies
train
public static void printDependencies(GrammaticalStructure gs, Collection<TypedDependency> deps, Tree tree, boolean conllx, boolean extraSep) { System.out.println(dependenciesToString(gs, deps, tree, conllx, extraSep)); }
java
{ "resource": "" }
q12905
GrammaticalStructure.readCoNLLXGrammaticStructureCollection
train
public static List<GrammaticalStructure> readCoNLLXGrammaticStructureCollection(String fileName, Map<String, GrammaticalRelation> shortNameToGRel, GrammaticalStructureFromDependenciesFactory factory) throws IOException { LineNumberReader reader = new LineNumberReader(new FileReader(fileName)); List<GrammaticalStructure> gsList = new LinkedList<GrammaticalStructure>(); List<List<String>> tokenFields = new ArrayList<List<String>>(); for (String inline = reader.readLine(); inline != null; inline = reader.readLine()) { if (!"".equals(inline)) { // read in a single sentence token by token List<String> fields = Arrays.asList(inline.split("\t")); if (fields.size() != CoNLLX_FieldCount) { throw new RuntimeException(String.format("Error (line %d): 10 fields expected but %d are present", reader.getLineNumber(), fields.size())); } tokenFields.add(fields); } else { if (tokenFields.isEmpty()) continue; // skip excess empty lines gsList.add(buildCoNNLXGrammaticStructure(tokenFields, shortNameToGRel, factory)); tokenFields = new ArrayList<List<String>>(); } } return gsList; }
java
{ "resource": "" }
q12906
auditnslogpolicy_vpnglobal_binding.get
train
public static auditnslogpolicy_vpnglobal_binding[] get(nitro_service service, String name) throws Exception{ auditnslogpolicy_vpnglobal_binding obj = new auditnslogpolicy_vpnglobal_binding(); obj.set_name(name); auditnslogpolicy_vpnglobal_binding response[] = (auditnslogpolicy_vpnglobal_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q12907
protocolicmp_stats.get
train
public static protocolicmp_stats get(nitro_service service) throws Exception{ protocolicmp_stats obj = new protocolicmp_stats(); protocolicmp_stats[] response = (protocolicmp_stats[])obj.stat_resources(service); return response[0]; }
java
{ "resource": "" }
q12908
ip6tunnel.add
train
public static base_response add(nitro_service client, ip6tunnel resource) throws Exception { ip6tunnel addresource = new ip6tunnel(); addresource.name = resource.name; addresource.remote = resource.remote; addresource.local = resource.local; return addresource.add_resource(client); }
java
{ "resource": "" }
q12909
ip6tunnel.add
train
public static base_responses add(nitro_service client, ip6tunnel resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { ip6tunnel addresources[] = new ip6tunnel[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new ip6tunnel(); addresources[i].name = resources[i].name; addresources[i].remote = resources[i].remote; addresources[i].local = resources[i].local; } result = add_bulk_request(client, addresources); } return result; }
java
{ "resource": "" }
q12910
ip6tunnel.get
train
public static ip6tunnel[] get(nitro_service service) throws Exception{ ip6tunnel obj = new ip6tunnel(); ip6tunnel[] response = (ip6tunnel[])obj.get_resources(service); return response; }
java
{ "resource": "" }
q12911
ip6tunnel.get
train
public static ip6tunnel[] get(nitro_service service, ip6tunnel_args args) throws Exception{ ip6tunnel obj = new ip6tunnel(); options option = new options(); option.set_args(nitro_util.object_to_string_withoutquotes(args)); ip6tunnel[] response = (ip6tunnel[])obj.get_resources(service, option); return response; }
java
{ "resource": "" }
q12912
ip6tunnel.get
train
public static ip6tunnel get(nitro_service service, String name) throws Exception{ ip6tunnel obj = new ip6tunnel(); obj.set_name(name); ip6tunnel response = (ip6tunnel) obj.get_resource(service); return response; }
java
{ "resource": "" }
q12913
transformaction.add
train
public static base_response add(nitro_service client, transformaction resource) throws Exception { transformaction addresource = new transformaction(); addresource.name = resource.name; addresource.profilename = resource.profilename; addresource.priority = resource.priority; addresource.state = resource.state; return addresource.add_resource(client); }
java
{ "resource": "" }
q12914
transformaction.add
train
public static base_responses add(nitro_service client, transformaction resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { transformaction addresources[] = new transformaction[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new transformaction(); addresources[i].name = resources[i].name; addresources[i].profilename = resources[i].profilename; addresources[i].priority = resources[i].priority; addresources[i].state = resources[i].state; } result = add_bulk_request(client, addresources); } return result; }
java
{ "resource": "" }
q12915
transformaction.update
train
public static base_response update(nitro_service client, transformaction resource) throws Exception { transformaction updateresource = new transformaction(); updateresource.name = resource.name; updateresource.priority = resource.priority; updateresource.requrlfrom = resource.requrlfrom; updateresource.requrlinto = resource.requrlinto; updateresource.resurlfrom = resource.resurlfrom; updateresource.resurlinto = resource.resurlinto; updateresource.cookiedomainfrom = resource.cookiedomainfrom; updateresource.cookiedomaininto = resource.cookiedomaininto; updateresource.state = resource.state; updateresource.comment = resource.comment; return updateresource.update_resource(client); }
java
{ "resource": "" }
q12916
transformaction.update
train
public static base_responses update(nitro_service client, transformaction resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { transformaction updateresources[] = new transformaction[resources.length]; for (int i=0;i<resources.length;i++){ updateresources[i] = new transformaction(); updateresources[i].name = resources[i].name; updateresources[i].priority = resources[i].priority; updateresources[i].requrlfrom = resources[i].requrlfrom; updateresources[i].requrlinto = resources[i].requrlinto; updateresources[i].resurlfrom = resources[i].resurlfrom; updateresources[i].resurlinto = resources[i].resurlinto; updateresources[i].cookiedomainfrom = resources[i].cookiedomainfrom; updateresources[i].cookiedomaininto = resources[i].cookiedomaininto; updateresources[i].state = resources[i].state; updateresources[i].comment = resources[i].comment; } result = update_bulk_request(client, updateresources); } return result; }
java
{ "resource": "" }
q12917
transformaction.get
train
public static transformaction[] get(nitro_service service) throws Exception{ transformaction obj = new transformaction(); transformaction[] response = (transformaction[])obj.get_resources(service); return response; }
java
{ "resource": "" }
q12918
transformaction.get
train
public static transformaction get(nitro_service service, String name) throws Exception{ transformaction obj = new transformaction(); obj.set_name(name); transformaction response = (transformaction) obj.get_resource(service); return response; }
java
{ "resource": "" }
q12919
MtasBitInputStream.readBit
train
public int readBit() throws IOException { if (bitCount == 0) { bitBuffer = read(); if (bitBuffer == -1) { throw new IOException("no more bits"); } } int value = (bitBuffer >> bitCount) & 1; bitCount++; if (bitCount > 7) { bitCount = 0; } return value; }
java
{ "resource": "" }
q12920
MtasBitInputStream.readRemainingBytes
train
public byte[] readRemainingBytes() throws IOException { if (this.available() > 0) { byte[] b = new byte[this.available()]; if (read(b) >= 0) { return b; } else { throw new IOException("returned negative number of remaining bytes"); } } else { throw new IOException("no more bytes"); } }
java
{ "resource": "" }
q12921
MtasBitInputStream.readEliasGammaCodingPositiveInteger
train
public int readEliasGammaCodingPositiveInteger() throws IOException { int value; int counter = 0; int bit = readBit(); while (bit == 0) { counter++; bit = readBit(); } value = 1; for (int i = 0; i < counter; i++) { value = (2 * value) + readBit(); } return value; }
java
{ "resource": "" }
q12922
vrid.add
train
public static base_response add(nitro_service client, vrid resource) throws Exception { vrid addresource = new vrid(); addresource.id = resource.id; addresource.priority = resource.priority; addresource.preemption = resource.preemption; addresource.sharing = resource.sharing; addresource.tracking = resource.tracking; return addresource.add_resource(client); }
java
{ "resource": "" }
q12923
vrid.add
train
public static base_responses add(nitro_service client, vrid resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { vrid addresources[] = new vrid[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new vrid(); addresources[i].id = resources[i].id; addresources[i].priority = resources[i].priority; addresources[i].preemption = resources[i].preemption; addresources[i].sharing = resources[i].sharing; addresources[i].tracking = resources[i].tracking; } result = add_bulk_request(client, addresources); } return result; }
java
{ "resource": "" }
q12924
vrid.delete
train
public static base_response delete(nitro_service client, vrid resource) throws Exception { vrid deleteresource = new vrid(); deleteresource.id = resource.id; deleteresource.all = resource.all; return deleteresource.delete_resource(client); }
java
{ "resource": "" }
q12925
vrid.update
train
public static base_response update(nitro_service client, vrid resource) throws Exception { vrid updateresource = new vrid(); updateresource.id = resource.id; updateresource.priority = resource.priority; updateresource.preemption = resource.preemption; updateresource.sharing = resource.sharing; updateresource.tracking = resource.tracking; return updateresource.update_resource(client); }
java
{ "resource": "" }
q12926
vrid.update
train
public static base_responses update(nitro_service client, vrid resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { vrid updateresources[] = new vrid[resources.length]; for (int i=0;i<resources.length;i++){ updateresources[i] = new vrid(); updateresources[i].id = resources[i].id; updateresources[i].priority = resources[i].priority; updateresources[i].preemption = resources[i].preemption; updateresources[i].sharing = resources[i].sharing; updateresources[i].tracking = resources[i].tracking; } result = update_bulk_request(client, updateresources); } return result; }
java
{ "resource": "" }
q12927
vrid.get
train
public static vrid[] get(nitro_service service) throws Exception{ vrid obj = new vrid(); vrid[] response = (vrid[])obj.get_resources(service); return response; }
java
{ "resource": "" }
q12928
vrid.get
train
public static vrid get(nitro_service service, Long id) throws Exception{ vrid obj = new vrid(); obj.set_id(id); vrid response = (vrid) obj.get_resource(service); return response; }
java
{ "resource": "" }
q12929
nshttpprofile.add
train
public static base_response add(nitro_service client, nshttpprofile resource) throws Exception { nshttpprofile addresource = new nshttpprofile(); addresource.name = resource.name; addresource.dropinvalreqs = resource.dropinvalreqs; addresource.markhttp09inval = resource.markhttp09inval; addresource.markconnreqinval = resource.markconnreqinval; addresource.cmponpush = resource.cmponpush; addresource.conmultiplex = resource.conmultiplex; addresource.maxreusepool = resource.maxreusepool; addresource.dropextracrlf = resource.dropextracrlf; addresource.incomphdrdelay = resource.incomphdrdelay; addresource.websocket = resource.websocket; addresource.reqtimeout = resource.reqtimeout; addresource.adpttimeout = resource.adpttimeout; addresource.reqtimeoutaction = resource.reqtimeoutaction; addresource.dropextradata = resource.dropextradata; addresource.weblog = resource.weblog; addresource.clientiphdrexpr = resource.clientiphdrexpr; addresource.maxreq = resource.maxreq; addresource.persistentetag = resource.persistentetag; addresource.spdy = resource.spdy; return addresource.add_resource(client); }
java
{ "resource": "" }
q12930
nshttpprofile.update
train
public static base_response update(nitro_service client, nshttpprofile resource) throws Exception { nshttpprofile updateresource = new nshttpprofile(); updateresource.name = resource.name; updateresource.dropinvalreqs = resource.dropinvalreqs; updateresource.markhttp09inval = resource.markhttp09inval; updateresource.markconnreqinval = resource.markconnreqinval; updateresource.cmponpush = resource.cmponpush; updateresource.conmultiplex = resource.conmultiplex; updateresource.maxreusepool = resource.maxreusepool; updateresource.dropextracrlf = resource.dropextracrlf; updateresource.incomphdrdelay = resource.incomphdrdelay; updateresource.websocket = resource.websocket; updateresource.reqtimeout = resource.reqtimeout; updateresource.adpttimeout = resource.adpttimeout; updateresource.reqtimeoutaction = resource.reqtimeoutaction; updateresource.dropextradata = resource.dropextradata; updateresource.weblog = resource.weblog; updateresource.clientiphdrexpr = resource.clientiphdrexpr; updateresource.maxreq = resource.maxreq; updateresource.persistentetag = resource.persistentetag; updateresource.spdy = resource.spdy; return updateresource.update_resource(client); }
java
{ "resource": "" }
q12931
nshttpprofile.update
train
public static base_responses update(nitro_service client, nshttpprofile resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { nshttpprofile updateresources[] = new nshttpprofile[resources.length]; for (int i=0;i<resources.length;i++){ updateresources[i] = new nshttpprofile(); updateresources[i].name = resources[i].name; updateresources[i].dropinvalreqs = resources[i].dropinvalreqs; updateresources[i].markhttp09inval = resources[i].markhttp09inval; updateresources[i].markconnreqinval = resources[i].markconnreqinval; updateresources[i].cmponpush = resources[i].cmponpush; updateresources[i].conmultiplex = resources[i].conmultiplex; updateresources[i].maxreusepool = resources[i].maxreusepool; updateresources[i].dropextracrlf = resources[i].dropextracrlf; updateresources[i].incomphdrdelay = resources[i].incomphdrdelay; updateresources[i].websocket = resources[i].websocket; updateresources[i].reqtimeout = resources[i].reqtimeout; updateresources[i].adpttimeout = resources[i].adpttimeout; updateresources[i].reqtimeoutaction = resources[i].reqtimeoutaction; updateresources[i].dropextradata = resources[i].dropextradata; updateresources[i].weblog = resources[i].weblog; updateresources[i].clientiphdrexpr = resources[i].clientiphdrexpr; updateresources[i].maxreq = resources[i].maxreq; updateresources[i].persistentetag = resources[i].persistentetag; updateresources[i].spdy = resources[i].spdy; } result = update_bulk_request(client, updateresources); } return result; }
java
{ "resource": "" }
q12932
nshttpprofile.get
train
public static nshttpprofile[] get(nitro_service service) throws Exception{ nshttpprofile obj = new nshttpprofile(); nshttpprofile[] response = (nshttpprofile[])obj.get_resources(service); return response; }
java
{ "resource": "" }
q12933
nshttpprofile.get
train
public static nshttpprofile get(nitro_service service, String name) throws Exception{ nshttpprofile obj = new nshttpprofile(); obj.set_name(name); nshttpprofile response = (nshttpprofile) obj.get_resource(service); return response; }
java
{ "resource": "" }
q12934
vpathparam.update
train
public static base_response update(nitro_service client, vpathparam resource) throws Exception { vpathparam updateresource = new vpathparam(); updateresource.srcip = resource.srcip; return updateresource.update_resource(client); }
java
{ "resource": "" }
q12935
vpathparam.unset
train
public static base_response unset(nitro_service client, vpathparam resource, String[] args) throws Exception{ vpathparam unsetresource = new vpathparam(); return unsetresource.unset_resource(client,args); }
java
{ "resource": "" }
q12936
vpathparam.get
train
public static vpathparam get(nitro_service service) throws Exception{ vpathparam obj = new vpathparam(); vpathparam[] response = (vpathparam[])obj.get_resources(service); return response[0]; }
java
{ "resource": "" }
q12937
OpenIntObjectHashMap.setUp
train
protected void setUp(int initialCapacity, double minLoadFactor, double maxLoadFactor) { int capacity = initialCapacity; super.setUp(capacity, minLoadFactor, maxLoadFactor); capacity = nextPrime(capacity); if (capacity==0) capacity=1; // open addressing needs at least one FREE slot at any time. this.table = new int[capacity]; this.values = new Object[capacity]; this.state = new byte[capacity]; // memory will be exhausted long before this pathological case happens, anyway. this.minLoadFactor = minLoadFactor; if (capacity == PrimeFinder.largestPrime) this.maxLoadFactor = 1.0; else this.maxLoadFactor = maxLoadFactor; this.distinct = 0; this.freeEntries = capacity; // delta // lowWaterMark will be established upon first expansion. // establishing it now (upon instance construction) would immediately make the table shrink upon first put(...). // After all the idea of an "initialCapacity" implies violating lowWaterMarks when an object is young. // See ensureCapacity(...) this.lowWaterMark = 0; this.highWaterMark = chooseHighWaterMark(capacity, this.maxLoadFactor); }
java
{ "resource": "" }
q12938
appfwfieldtype.add
train
public static base_response add(nitro_service client, appfwfieldtype resource) throws Exception { appfwfieldtype addresource = new appfwfieldtype(); addresource.name = resource.name; addresource.regex = resource.regex; addresource.priority = resource.priority; addresource.comment = resource.comment; return addresource.add_resource(client); }
java
{ "resource": "" }
q12939
appfwfieldtype.add
train
public static base_responses add(nitro_service client, appfwfieldtype resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { appfwfieldtype addresources[] = new appfwfieldtype[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new appfwfieldtype(); addresources[i].name = resources[i].name; addresources[i].regex = resources[i].regex; addresources[i].priority = resources[i].priority; addresources[i].comment = resources[i].comment; } result = add_bulk_request(client, addresources); } return result; }
java
{ "resource": "" }
q12940
appfwfieldtype.update
train
public static base_response update(nitro_service client, appfwfieldtype resource) throws Exception { appfwfieldtype updateresource = new appfwfieldtype(); updateresource.name = resource.name; updateresource.regex = resource.regex; updateresource.priority = resource.priority; updateresource.comment = resource.comment; return updateresource.update_resource(client); }
java
{ "resource": "" }
q12941
appfwfieldtype.update
train
public static base_responses update(nitro_service client, appfwfieldtype resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { appfwfieldtype updateresources[] = new appfwfieldtype[resources.length]; for (int i=0;i<resources.length;i++){ updateresources[i] = new appfwfieldtype(); updateresources[i].name = resources[i].name; updateresources[i].regex = resources[i].regex; updateresources[i].priority = resources[i].priority; updateresources[i].comment = resources[i].comment; } result = update_bulk_request(client, updateresources); } return result; }
java
{ "resource": "" }
q12942
appfwfieldtype.get
train
public static appfwfieldtype[] get(nitro_service service) throws Exception{ appfwfieldtype obj = new appfwfieldtype(); appfwfieldtype[] response = (appfwfieldtype[])obj.get_resources(service); return response; }
java
{ "resource": "" }
q12943
appfwfieldtype.get
train
public static appfwfieldtype get(nitro_service service, String name) throws Exception{ appfwfieldtype obj = new appfwfieldtype(); obj.set_name(name); appfwfieldtype response = (appfwfieldtype) obj.get_resource(service); return response; }
java
{ "resource": "" }
q12944
vpnvserver_stats.get
train
public static vpnvserver_stats[] get(nitro_service service) throws Exception{ vpnvserver_stats obj = new vpnvserver_stats(); vpnvserver_stats[] response = (vpnvserver_stats[])obj.stat_resources(service); return response; }
java
{ "resource": "" }
q12945
vpnvserver_stats.get
train
public static vpnvserver_stats get(nitro_service service, String name) throws Exception{ vpnvserver_stats obj = new vpnvserver_stats(); obj.set_name(name); vpnvserver_stats response = (vpnvserver_stats) obj.stat_resource(service); return response; }
java
{ "resource": "" }
q12946
hanode_binding.get
train
public static hanode_binding get(nitro_service service, Long id) throws Exception{ hanode_binding obj = new hanode_binding(); obj.set_id(id); hanode_binding response = (hanode_binding) obj.get_resource(service); return response; }
java
{ "resource": "" }
q12947
MtasSolrHistoryList.setLimits
train
public void setLimits(int softLimit, int hardLimit) { if ((softLimit > 0 && hardLimit > softLimit) || (softLimit == 0 && hardLimit == 0)) { this.softLimit = softLimit; this.hardLimit = hardLimit; garbageCollect(); } else { throw new IllegalArgumentException(); } }
java
{ "resource": "" }
q12948
TsurgeonPatternRoot.evaluate
train
@Override public Tree evaluate(Tree t, TregexMatcher m) { newNodeNames = new HashMap<String,Tree>(); coindexer.setLastIndex(t); for (TsurgeonPattern child : children) { t = child.evaluate(t, m); if (t == null) { return null; } } return t; }
java
{ "resource": "" }
q12949
MtasSolrComponentStats.generatePermutations
train
private void generatePermutations( ArrayList<HashMap<String, String[]>[]> result, int index, HashMap<String, String[]>[][] subResult) { int localIndex = index; HashMap<String, String[]>[] value = subResult[localIndex]; if (localIndex == 0) { for (int i = 0; i < value.length; i++) { HashMap<String, String[]>[] resultItem = new HashMap[subResult.length]; resultItem[localIndex] = value[i]; result.add(resultItem); } } else { ArrayList<HashMap<String, String[]>[]> newResult = new ArrayList<>(); for (int e = 0; e < result.size(); e++) { for (int i = 0; i < value.length; i++) { HashMap<String, String[]>[] resultItem = result.get(e); resultItem[localIndex] = value[i]; newResult.add(resultItem); } } result.clear(); result.addAll(newResult); } localIndex++; if (localIndex < subResult.length) { generatePermutations(result, localIndex, subResult); } }
java
{ "resource": "" }
q12950
MtasSolrComponentStats.generatePermutationsQueryVariables
train
private void generatePermutationsQueryVariables( ArrayList<HashMap<String, String[]>> result, Set<String> keys, HashMap<String, String[]> queryVariables) { if (keys != null && !keys.isEmpty()) { Set<String> newKeys = new HashSet<>(); Iterator<String> it = keys.iterator(); String key = it.next(); String[] value = queryVariables.get(key); if (result.isEmpty()) { HashMap<String, String[]> newItem; if (value == null || value.length == 0) { newItem = new HashMap<>(); newItem.put(key, value); result.add(newItem); } else { for (int j = 0; j < value.length; j++) { newItem = new HashMap<>(); newItem.put(key, new String[] { value[j] }); result.add(newItem); } } } else { ArrayList<HashMap<String, String[]>> newResult = new ArrayList<>(); for (int i = 0; i < result.size(); i++) { HashMap<String, String[]> newItem; if (value == null || value.length == 0) { newItem = (HashMap<String, String[]>) result.get(i).clone(); newItem.put(key, value); newResult.add(newItem); } else { for (int j = 0; j < value.length; j++) { newItem = (HashMap<String, String[]>) result.get(i).clone(); newItem.put(key, new String[] { value[j] }); newResult.add(newItem); } } } result.clear(); result.addAll(newResult); } while (it.hasNext()) { newKeys.add(it.next()); } generatePermutationsQueryVariables(result, newKeys, queryVariables); } }
java
{ "resource": "" }
q12951
MtasSolrComponentStats.createPosition
train
private SimpleOrderedMap<Object> createPosition(ComponentPosition position, Boolean encode) throws IOException { // System.out.println("Create stats position " + position.dataType + " " // + position.statsType + " " + position.statsItems + " --- " + encode); SimpleOrderedMap<Object> mtasPositionResponse = new SimpleOrderedMap<>(); mtasPositionResponse.add("key", position.key); MtasSolrMtasResult data = new MtasSolrMtasResult(position.dataCollector, position.dataType, position.statsType, position.statsItems, null, null); if (encode) { mtasPositionResponse.add("_encoded_data", MtasSolrResultUtil.encode(data)); } else { mtasPositionResponse.add(position.dataCollector.getCollectorType(), data); MtasSolrResultUtil.rewrite(mtasPositionResponse, searchComponent); } return mtasPositionResponse; }
java
{ "resource": "" }
q12952
MtasSolrComponentStats.createToken
train
private SimpleOrderedMap<Object> createToken(ComponentToken token, Boolean encode) throws IOException { // System.out.println("Create stats position " + position.dataType + " " // + position.statsType + " " + position.statsItems + " --- " + encode); SimpleOrderedMap<Object> mtasTokenResponse = new SimpleOrderedMap<>(); mtasTokenResponse.add("key", token.key); MtasSolrMtasResult data = new MtasSolrMtasResult(token.dataCollector, token.dataType, token.statsType, token.statsItems, null, null); if (encode) { mtasTokenResponse.add("_encoded_data", MtasSolrResultUtil.encode(data)); } else { mtasTokenResponse.add(token.dataCollector.getCollectorType(), data); MtasSolrResultUtil.rewrite(mtasTokenResponse, searchComponent); } return mtasTokenResponse; }
java
{ "resource": "" }
q12953
MtasSolrComponentStats.createSpan
train
@SuppressWarnings("unchecked") private SimpleOrderedMap<Object> createSpan(ComponentSpan span, Boolean encode) throws IOException { // System.out.println("Create stats span " + span.dataType + " " // + span.statsType + " " + span.statsItems + " --- " + encode); SimpleOrderedMap<Object> mtasSpanResponse = new SimpleOrderedMap<>(); mtasSpanResponse.add("key", span.key); HashMap<MtasDataCollector<?, ?>, HashMap<String, MtasSolrMtasResult>> functionData = new HashMap<>(); HashMap<String, MtasSolrMtasResult> functionDataItem = new HashMap<>(); functionData.put(span.dataCollector, functionDataItem); if (span.functions != null) { for (SubComponentFunction function : span.functions) { function.dataCollector.close(); functionDataItem.put(function.key, new MtasSolrMtasResult( function.dataCollector, new String[] { function.dataType }, new String[] { function.statsType }, new SortedSet[] { function.statsItems }, new List[] { null }, new String[] { null }, new String[] { null }, new Integer[] { 0 }, new Integer[] { Integer.MAX_VALUE }, null)); } } MtasSolrMtasResult data = new MtasSolrMtasResult(span.dataCollector, span.dataType, span.statsType, span.statsItems, null, functionData); if (encode) { mtasSpanResponse.add("_encoded_data", MtasSolrResultUtil.encode(data)); } else { mtasSpanResponse.add(span.dataCollector.getCollectorType(), data); MtasSolrResultUtil.rewrite(mtasSpanResponse, searchComponent); } return mtasSpanResponse; }
java
{ "resource": "" }
q12954
MtasSolrStatus.shardKey
train
public final String shardKey(int stage) { if (shardStageKeys == null) { return null; } else { shardKey = shardStageKeys.get(stage); if (shardKey == null) { shardKey = UUID.randomUUID().toString(); shardStageKeys.put(stage, shardKey); } return shardKey; } }
java
{ "resource": "" }
q12955
MtasSolrStatus.setFinished
train
public final void setFinished() { if (!finished) { totalTime = ((Long) (System.currentTimeMillis() - startTime)).intValue(); shardInfoUpdated = false; finished = true; rsp = null; } }
java
{ "resource": "" }
q12956
MtasSolrStatus.setKey
train
public void setKey(String key) throws IOException { if (this.key != null) { throw new IOException("key already set"); } else { this.key = Objects.requireNonNull(key, "key required"); } }
java
{ "resource": "" }
q12957
MtasSolrStatus.checkResponseForException
train
public boolean checkResponseForException() { if (!finished && rsp != null) { Exception e; if ((e = rsp.getException()) != null) { setError(e.getMessage()); setFinished(); return true; } } return false; }
java
{ "resource": "" }
q12958
MtasSolrStatus.createOutput
train
private SimpleOrderedMap<Object> createOutput(boolean detailed) { // checkResponseOnException(); SimpleOrderedMap<Object> output = new SimpleOrderedMap<>(); updateShardInfo(); output.add(NAME_KEY, key); output.add(NAME_REQUEST, request); if (errorStatus) { output.add(NAME_ERROR, errorMessage); } if (abortStatus) { output.add(NAME_ABORT, abortMessage); } output.add(NAME_FINISHED, finished); if (totalTime != null) { output.add(NAME_TIME_TOTAL, totalTime); } output.add(NAME_TIME_START, (new Date(startTime)).toString()); output.add(NAME_SHARDREQUEST, shardRequest); if (shardNumberTotal > 0) { if (detailed) { output.add(NAME_STATUS_DISTRIBUTED, createShardsOutput()); } else { output.add(NAME_STATUS_DISTRIBUTED, true); } } else if (detailed) { output.add(NAME_STATUS_DISTRIBUTED, false); } if (status.numberSegmentsTotal != null) { output.add(NAME_STATUS_SEGMENT_NUMBER_TOTAL, status.numberSegmentsTotal); output.add(NAME_STATUS_SEGMENT_NUMBER_FINISHED, status.numberSegmentsFinished); if (!status.subNumberSegmentsFinished.isEmpty()) { output.add(NAME_STATUS_SEGMENT_SUB_NUMBER_FINISHED, status.subNumberSegmentsFinished); output.add(NAME_STATUS_SEGMENT_SUB_NUMBER_TOTAL, status.subNumberSegmentsTotal); output.add(NAME_STATUS_SEGMENT_SUB_NUMBER_FINISHED_TOTAL, status.subNumberSegmentsFinishedTotal); } } if (status.numberDocumentsTotal != null) { output.add(NAME_STATUS_DOCUMENT_NUMBER_TOTAL, status.numberDocumentsTotal); output.add(NAME_STATUS_DOCUMENT_NUMBER_FOUND, status.numberDocumentsFound); output.add(NAME_STATUS_DOCUMENT_NUMBER_FINISHED, status.numberDocumentsFinished); if (!status.subNumberDocumentsFinished.isEmpty()) { output.add(NAME_STATUS_DOCUMENT_SUB_NUMBER_FINISHED, status.subNumberDocumentsFinished); output.add(NAME_STATUS_DOCUMENT_SUB_NUMBER_TOTAL, status.subNumberDocumentsTotal); output.add(NAME_STATUS_DOCUMENT_SUB_NUMBER_FINISHED_TOTAL, status.subNumberDocumentsFinishedTotal); } } return output; }
java
{ "resource": "" }
q12959
MtasSolrStatus.createShardsOutput
train
private final SimpleOrderedMap<Object> createShardsOutput() { SimpleOrderedMap<Object> output = new SimpleOrderedMap<>(); if (shardStageStatus != null && !shardStageStatus.isEmpty()) { List<SimpleOrderedMap<Object>> list = new ArrayList<>(); for (StageStatus stageStatus : shardStageStatus.values()) { list.add(stageStatus.createOutput()); } output.add(NAME_STATUS_STAGES, list); } if (shards != null && !shards.isEmpty()) { List<SimpleOrderedMap<Object>> list = new ArrayList<>(); for (ShardStatus shardStatus : shards.values()) { list.add(shardStatus.createOutput()); } output.add(NAME_STATUS_SHARDS, list); } return output; }
java
{ "resource": "" }
q12960
MtasSolrStatus.getInteger
train
private final Integer getInteger(NamedList<Object> response, String... args) { Object objectItem = response.findRecursive(args); if (objectItem != null && objectItem instanceof Integer) { return (Integer) objectItem; } else { return null; } }
java
{ "resource": "" }
q12961
MtasSolrStatus.getIntegerMap
train
private final Map<String, Integer> getIntegerMap(NamedList<Object> response, String... args) { Object objectItem = response.findRecursive(args); Map<String, Integer> result = null; if (objectItem != null && objectItem instanceof Map) { result = (Map) objectItem; } return result; }
java
{ "resource": "" }
q12962
MtasSolrStatus.getLong
train
private final Long getLong(NamedList<Object> response, String... args) { Object objectItem = response.findRecursive(args); if (objectItem != null && objectItem instanceof Long) { return (Long) objectItem; } else { return null; } }
java
{ "resource": "" }
q12963
MtasSolrStatus.getLongMap
train
private final Map<String, Long> getLongMap(NamedList<Object> response, String... args) { Object objectItem = response.findRecursive(args); if (objectItem != null && objectItem instanceof Map) { return (Map) objectItem; } else { return null; } }
java
{ "resource": "" }
q12964
vpnformssoaction.add
train
public static base_response add(nitro_service client, vpnformssoaction resource) throws Exception { vpnformssoaction addresource = new vpnformssoaction(); addresource.name = resource.name; addresource.actionurl = resource.actionurl; addresource.userfield = resource.userfield; addresource.passwdfield = resource.passwdfield; addresource.ssosuccessrule = resource.ssosuccessrule; addresource.namevaluepair = resource.namevaluepair; addresource.responsesize = resource.responsesize; addresource.nvtype = resource.nvtype; addresource.submitmethod = resource.submitmethod; return addresource.add_resource(client); }
java
{ "resource": "" }
q12965
vpnformssoaction.update
train
public static base_response update(nitro_service client, vpnformssoaction resource) throws Exception { vpnformssoaction updateresource = new vpnformssoaction(); updateresource.name = resource.name; updateresource.actionurl = resource.actionurl; updateresource.userfield = resource.userfield; updateresource.passwdfield = resource.passwdfield; updateresource.ssosuccessrule = resource.ssosuccessrule; updateresource.responsesize = resource.responsesize; updateresource.namevaluepair = resource.namevaluepair; updateresource.nvtype = resource.nvtype; updateresource.submitmethod = resource.submitmethod; return updateresource.update_resource(client); }
java
{ "resource": "" }
q12966
vpnformssoaction.update
train
public static base_responses update(nitro_service client, vpnformssoaction resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { vpnformssoaction updateresources[] = new vpnformssoaction[resources.length]; for (int i=0;i<resources.length;i++){ updateresources[i] = new vpnformssoaction(); updateresources[i].name = resources[i].name; updateresources[i].actionurl = resources[i].actionurl; updateresources[i].userfield = resources[i].userfield; updateresources[i].passwdfield = resources[i].passwdfield; updateresources[i].ssosuccessrule = resources[i].ssosuccessrule; updateresources[i].responsesize = resources[i].responsesize; updateresources[i].namevaluepair = resources[i].namevaluepair; updateresources[i].nvtype = resources[i].nvtype; updateresources[i].submitmethod = resources[i].submitmethod; } result = update_bulk_request(client, updateresources); } return result; }
java
{ "resource": "" }
q12967
vpnformssoaction.get
train
public static vpnformssoaction[] get(nitro_service service) throws Exception{ vpnformssoaction obj = new vpnformssoaction(); vpnformssoaction[] response = (vpnformssoaction[])obj.get_resources(service); return response; }
java
{ "resource": "" }
q12968
vpnformssoaction.get
train
public static vpnformssoaction get(nitro_service service, String name) throws Exception{ vpnformssoaction obj = new vpnformssoaction(); obj.set_name(name); vpnformssoaction response = (vpnformssoaction) obj.get_resource(service); return response; }
java
{ "resource": "" }
q12969
dnsview_dnspolicy_binding.get
train
public static dnsview_dnspolicy_binding[] get(nitro_service service, String viewname) throws Exception{ dnsview_dnspolicy_binding obj = new dnsview_dnspolicy_binding(); obj.set_viewname(viewname); dnsview_dnspolicy_binding response[] = (dnsview_dnspolicy_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q12970
aaasession.kill
train
public static base_response kill(nitro_service client, aaasession resource) throws Exception { aaasession killresource = new aaasession(); killresource.username = resource.username; killresource.groupname = resource.groupname; killresource.iip = resource.iip; killresource.netmask = resource.netmask; killresource.all = resource.all; return killresource.perform_operation(client,"kill"); }
java
{ "resource": "" }
q12971
aaasession.kill
train
public static base_responses kill(nitro_service client, aaasession resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { aaasession killresources[] = new aaasession[resources.length]; for (int i=0;i<resources.length;i++){ killresources[i] = new aaasession(); killresources[i].username = resources[i].username; killresources[i].groupname = resources[i].groupname; killresources[i].iip = resources[i].iip; killresources[i].netmask = resources[i].netmask; killresources[i].all = resources[i].all; } result = perform_operation_bulk_request(client, killresources,"kill"); } return result; }
java
{ "resource": "" }
q12972
aaasession.get
train
public static aaasession[] get(nitro_service service) throws Exception{ aaasession obj = new aaasession(); aaasession[] response = (aaasession[])obj.get_resources(service); return response; }
java
{ "resource": "" }
q12973
aaasession.get
train
public static aaasession[] get(nitro_service service, aaasession_args args) throws Exception{ aaasession obj = new aaasession(); options option = new options(); option.set_args(nitro_util.object_to_string_withoutquotes(args)); aaasession[] response = (aaasession[])obj.get_resources(service, option); return response; }
java
{ "resource": "" }
q12974
aaakcdaccount.add
train
public static base_response add(nitro_service client, aaakcdaccount resource) throws Exception { aaakcdaccount addresource = new aaakcdaccount(); addresource.kcdaccount = resource.kcdaccount; addresource.keytab = resource.keytab; addresource.realmstr = resource.realmstr; addresource.delegateduser = resource.delegateduser; addresource.kcdpassword = resource.kcdpassword; addresource.usercert = resource.usercert; addresource.cacert = resource.cacert; return addresource.add_resource(client); }
java
{ "resource": "" }
q12975
aaakcdaccount.add
train
public static base_responses add(nitro_service client, aaakcdaccount resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { aaakcdaccount addresources[] = new aaakcdaccount[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new aaakcdaccount(); addresources[i].kcdaccount = resources[i].kcdaccount; addresources[i].keytab = resources[i].keytab; addresources[i].realmstr = resources[i].realmstr; addresources[i].delegateduser = resources[i].delegateduser; addresources[i].kcdpassword = resources[i].kcdpassword; addresources[i].usercert = resources[i].usercert; addresources[i].cacert = resources[i].cacert; } result = add_bulk_request(client, addresources); } return result; }
java
{ "resource": "" }
q12976
aaakcdaccount.delete
train
public static base_response delete(nitro_service client, String kcdaccount) throws Exception { aaakcdaccount deleteresource = new aaakcdaccount(); deleteresource.kcdaccount = kcdaccount; return deleteresource.delete_resource(client); }
java
{ "resource": "" }
q12977
aaakcdaccount.delete
train
public static base_responses delete(nitro_service client, String kcdaccount[]) throws Exception { base_responses result = null; if (kcdaccount != null && kcdaccount.length > 0) { aaakcdaccount deleteresources[] = new aaakcdaccount[kcdaccount.length]; for (int i=0;i<kcdaccount.length;i++){ deleteresources[i] = new aaakcdaccount(); deleteresources[i].kcdaccount = kcdaccount[i]; } result = delete_bulk_request(client, deleteresources); } return result; }
java
{ "resource": "" }
q12978
aaakcdaccount.update
train
public static base_response update(nitro_service client, aaakcdaccount resource) throws Exception { aaakcdaccount updateresource = new aaakcdaccount(); updateresource.kcdaccount = resource.kcdaccount; updateresource.keytab = resource.keytab; updateresource.realmstr = resource.realmstr; updateresource.delegateduser = resource.delegateduser; updateresource.kcdpassword = resource.kcdpassword; updateresource.usercert = resource.usercert; updateresource.cacert = resource.cacert; return updateresource.update_resource(client); }
java
{ "resource": "" }
q12979
aaakcdaccount.update
train
public static base_responses update(nitro_service client, aaakcdaccount resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { aaakcdaccount updateresources[] = new aaakcdaccount[resources.length]; for (int i=0;i<resources.length;i++){ updateresources[i] = new aaakcdaccount(); updateresources[i].kcdaccount = resources[i].kcdaccount; updateresources[i].keytab = resources[i].keytab; updateresources[i].realmstr = resources[i].realmstr; updateresources[i].delegateduser = resources[i].delegateduser; updateresources[i].kcdpassword = resources[i].kcdpassword; updateresources[i].usercert = resources[i].usercert; updateresources[i].cacert = resources[i].cacert; } result = update_bulk_request(client, updateresources); } return result; }
java
{ "resource": "" }
q12980
aaakcdaccount.unset
train
public static base_response unset(nitro_service client, aaakcdaccount resource, String[] args) throws Exception{ aaakcdaccount unsetresource = new aaakcdaccount(); unsetresource.kcdaccount = resource.kcdaccount; unsetresource.keytab = resource.keytab; unsetresource.usercert = resource.usercert; unsetresource.cacert = resource.cacert; return unsetresource.unset_resource(client,args); }
java
{ "resource": "" }
q12981
aaakcdaccount.get
train
public static aaakcdaccount[] get(nitro_service service) throws Exception{ aaakcdaccount obj = new aaakcdaccount(); aaakcdaccount[] response = (aaakcdaccount[])obj.get_resources(service); return response; }
java
{ "resource": "" }
q12982
aaakcdaccount.get
train
public static aaakcdaccount get(nitro_service service, String kcdaccount) throws Exception{ aaakcdaccount obj = new aaakcdaccount(); obj.set_kcdaccount(kcdaccount); aaakcdaccount response = (aaakcdaccount) obj.get_resource(service); return response; }
java
{ "resource": "" }
q12983
aaakcdaccount.get
train
public static aaakcdaccount[] get(nitro_service service, String kcdaccount[]) throws Exception{ if (kcdaccount !=null && kcdaccount.length>0) { aaakcdaccount response[] = new aaakcdaccount[kcdaccount.length]; aaakcdaccount obj[] = new aaakcdaccount[kcdaccount.length]; for (int i=0;i<kcdaccount.length;i++) { obj[i] = new aaakcdaccount(); obj[i].set_kcdaccount(kcdaccount[i]); response[i] = (aaakcdaccount) obj[i].get_resource(service); } return response; } return null; }
java
{ "resource": "" }
q12984
nsparam.update
train
public static base_response update(nitro_service client, nsparam resource) throws Exception { nsparam updateresource = new nsparam(); updateresource.httpport = resource.httpport; updateresource.maxconn = resource.maxconn; updateresource.maxreq = resource.maxreq; updateresource.cip = resource.cip; updateresource.cipheader = resource.cipheader; updateresource.cookieversion = resource.cookieversion; updateresource.securecookie = resource.securecookie; updateresource.pmtumin = resource.pmtumin; updateresource.pmtutimeout = resource.pmtutimeout; updateresource.ftpportrange = resource.ftpportrange; updateresource.crportrange = resource.crportrange; updateresource.timezone = resource.timezone; updateresource.grantquotamaxclient = resource.grantquotamaxclient; updateresource.exclusivequotamaxclient = resource.exclusivequotamaxclient; updateresource.grantquotaspillover = resource.grantquotaspillover; updateresource.exclusivequotaspillover = resource.exclusivequotaspillover; updateresource.useproxyport = resource.useproxyport; updateresource.internaluserlogin = resource.internaluserlogin; updateresource.aftpallowrandomsourceport = resource.aftpallowrandomsourceport; updateresource.icaports = resource.icaports; return updateresource.update_resource(client); }
java
{ "resource": "" }
q12985
nsparam.unset
train
public static base_response unset(nitro_service client, nsparam resource, String[] args) throws Exception{ nsparam unsetresource = new nsparam(); return unsetresource.unset_resource(client,args); }
java
{ "resource": "" }
q12986
nsparam.get
train
public static nsparam get(nitro_service service) throws Exception{ nsparam obj = new nsparam(); nsparam[] response = (nsparam[])obj.get_resources(service); return response[0]; }
java
{ "resource": "" }
q12987
ChunkAnnotationUtils.checkOffsets
train
public static boolean checkOffsets(CoreMap docAnnotation) { boolean okay = true; String docText = docAnnotation.get(CoreAnnotations.TextAnnotation.class); String docId = docAnnotation.get(CoreAnnotations.DocIDAnnotation.class); List<CoreLabel> docTokens = docAnnotation.get(CoreAnnotations.TokensAnnotation.class); List<CoreMap> sentences = docAnnotation.get(CoreAnnotations.SentencesAnnotation.class); for (CoreMap sentence:sentences) { String sentText = sentence.get(CoreAnnotations.TextAnnotation.class); List<CoreLabel> sentTokens = sentence.get(CoreAnnotations.TokensAnnotation.class); int sentBeginChar = sentence.get(CoreAnnotations.CharacterOffsetBeginAnnotation.class); int sentEndChar = sentence.get(CoreAnnotations.CharacterOffsetEndAnnotation.class); int sentBeginToken = sentence.get(CoreAnnotations.TokenBeginAnnotation.class); int sentEndToken = sentence.get(CoreAnnotations.TokenEndAnnotation.class); String docTextSpan = docText.substring(sentBeginChar, sentEndChar); List<CoreLabel> docTokenSpan = new ArrayList<CoreLabel>(docTokens.subList(sentBeginToken, sentEndToken)); logger.finer("Checking Document " + docId + " span (" + sentBeginChar + "," + sentEndChar + ") "); if (!docTextSpan.equals(sentText) ) { okay = false; logger.finer("WARNING: Document " + docId + " span does not match sentence"); logger.finer("DocSpanText: " + docTextSpan); logger.finer("SentenceText: " + sentText); } String sentTokenStr = getTokenText(sentTokens, CoreAnnotations.TextAnnotation.class); String docTokenStr = getTokenText(docTokenSpan, CoreAnnotations.TextAnnotation.class); if (!docTokenStr.equals(sentTokenStr) ) { okay = false; logger.finer("WARNING: Document " + docId + " tokens does not match sentence"); logger.finer("DocSpanTokens: " + docTokenStr); logger.finer("SentenceTokens: " + sentTokenStr); } } return okay; }
java
{ "resource": "" }
q12988
ChunkAnnotationUtils.copyUnsetAnnotations
train
public static void copyUnsetAnnotations(CoreMap src, CoreMap dest) { Set<Class<?>> otherKeys = src.keySet(); for (Class key : otherKeys) { if (!dest.has(key)) { dest.set(key, src.get(key)); } } }
java
{ "resource": "" }
q12989
ChunkAnnotationUtils.getChunkOffsetsUsingCharOffsets
train
public static Interval<Integer> getChunkOffsetsUsingCharOffsets(List<? extends CoreMap> chunkList, int charStart, int charEnd) { int chunkStart = 0; int chunkEnd = chunkList.size(); // Find first chunk with start > charStart for (int i = 0; i < chunkList.size(); i++) { int start = chunkList.get(i).get(CoreAnnotations.CharacterOffsetBeginAnnotation.class); if (start > charStart) { break; } chunkStart = i; } // Find first chunk with start >= charEnd for (int i = chunkStart; i < chunkList.size(); i++) { int start = chunkList.get(i).get(CoreAnnotations.CharacterOffsetBeginAnnotation.class); if (start >= charEnd) { chunkEnd = i; break; } } return Interval.toInterval(chunkStart, chunkEnd, Interval.INTERVAL_OPEN_END); }
java
{ "resource": "" }
q12990
ChunkAnnotationUtils.annotateChunkText
train
public static void annotateChunkText(CoreMap chunk, CoreMap origAnnotation) { String annoText = origAnnotation.get(CoreAnnotations.TextAnnotation.class); Integer annoBeginCharOffset = origAnnotation.get(CoreAnnotations.CharacterOffsetBeginAnnotation.class); if (annoBeginCharOffset == null) { annoBeginCharOffset = 0; } int chunkBeginCharOffset = chunk.get(CoreAnnotations.CharacterOffsetBeginAnnotation.class) - annoBeginCharOffset; int chunkEndCharOffset = chunk.get(CoreAnnotations.CharacterOffsetEndAnnotation.class) - annoBeginCharOffset; if (chunkBeginCharOffset < 0) { logger.fine("Adjusting begin char offset from " + chunkBeginCharOffset + " to 0"); logger.fine("Chunk begin offset: " + chunk.get(CoreAnnotations.CharacterOffsetBeginAnnotation.class) + ", Source text begin offset " + annoBeginCharOffset); chunkBeginCharOffset = 0; } if (chunkBeginCharOffset > annoText.length()) { logger.fine("Adjusting begin char offset from " + chunkBeginCharOffset + " to " + annoText.length()); logger.fine("Chunk begin offset: " + chunk.get(CoreAnnotations.CharacterOffsetBeginAnnotation.class) + ", Source text begin offset " + annoBeginCharOffset); chunkBeginCharOffset = annoText.length(); } if (chunkEndCharOffset < 0) { logger.fine("Adjusting end char offset from " + chunkEndCharOffset + " to 0"); logger.fine("Chunk end offset: " + chunk.get(CoreAnnotations.CharacterOffsetEndAnnotation.class) + ", Source text begin offset " + annoBeginCharOffset); chunkEndCharOffset = 0; } if (chunkEndCharOffset > annoText.length()) { logger.fine("Adjusting end char offset from " + chunkEndCharOffset + " to " + annoText.length()); logger.fine("Chunk end offset: " + chunk.get(CoreAnnotations.CharacterOffsetEndAnnotation.class) + ", Source text begin offset " + annoBeginCharOffset); chunkEndCharOffset = annoText.length(); } if (chunkEndCharOffset < chunkBeginCharOffset) { logger.fine("Adjusting end char offset from " + chunkEndCharOffset + " to " + chunkBeginCharOffset); logger.fine("Chunk end offset: " + chunk.get(CoreAnnotations.CharacterOffsetEndAnnotation.class) + ", Source text begin offset " + annoBeginCharOffset); chunkEndCharOffset = chunkBeginCharOffset; } String chunkText = annoText.substring(chunkBeginCharOffset, chunkEndCharOffset); chunk.set(CoreAnnotations.TextAnnotation.class, chunkText); }
java
{ "resource": "" }
q12991
ChunkAnnotationUtils.annotateChunkTokens
train
public static void annotateChunkTokens(CoreMap chunk, Class tokenChunkKey, Class tokenLabelKey) { List<CoreLabel> chunkTokens = chunk.get(CoreAnnotations.TokensAnnotation.class); if (tokenLabelKey != null) { String text = chunk.get(CoreAnnotations.TextAnnotation.class); for (CoreLabel t: chunkTokens) { t.set(tokenLabelKey, text); } } if (tokenChunkKey != null) { for (CoreLabel t: chunkTokens) { t.set(tokenChunkKey, chunk); } } }
java
{ "resource": "" }
q12992
MtasDataItem.computeComparableValue
train
private void computeComparableValue() { recomputeComparableSortValue = false; try { int type = getCompareValueType(); switch (type) { case 0: comparableSortValue = getCompareValue0(); break; case 1: comparableSortValue = getCompareValue1(); break; case 2: comparableSortValue = getCompareValue2(); break; default: comparableSortValue = null; break; } } catch (IOException e) { log.debug(e); comparableSortValue = null; } }
java
{ "resource": "" }
q12993
service_scpolicy_binding.get
train
public static service_scpolicy_binding[] get(nitro_service service, String name) throws Exception{ service_scpolicy_binding obj = new service_scpolicy_binding(); obj.set_name(name); service_scpolicy_binding response[] = (service_scpolicy_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q12994
appfwpolicy_appfwglobal_binding.get
train
public static appfwpolicy_appfwglobal_binding[] get(nitro_service service, String name) throws Exception{ appfwpolicy_appfwglobal_binding obj = new appfwpolicy_appfwglobal_binding(); obj.set_name(name); appfwpolicy_appfwglobal_binding response[] = (appfwpolicy_appfwglobal_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q12995
transformpolicy_lbvserver_binding.get
train
public static transformpolicy_lbvserver_binding[] get(nitro_service service, String name) throws Exception{ transformpolicy_lbvserver_binding obj = new transformpolicy_lbvserver_binding(); obj.set_name(name); transformpolicy_lbvserver_binding response[] = (transformpolicy_lbvserver_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q12996
systemparameter.update
train
public static base_response update(nitro_service client, systemparameter resource) throws Exception { systemparameter updateresource = new systemparameter(); updateresource.rbaonresponse = resource.rbaonresponse; updateresource.promptstring = resource.promptstring; updateresource.natpcbforceflushlimit = resource.natpcbforceflushlimit; updateresource.natpcbrstontimeout = resource.natpcbrstontimeout; updateresource.timeout = resource.timeout; return updateresource.update_resource(client); }
java
{ "resource": "" }
q12997
systemparameter.unset
train
public static base_response unset(nitro_service client, systemparameter resource, String[] args) throws Exception{ systemparameter unsetresource = new systemparameter(); return unsetresource.unset_resource(client,args); }
java
{ "resource": "" }
q12998
systemparameter.get
train
public static systemparameter get(nitro_service service) throws Exception{ systemparameter obj = new systemparameter(); systemparameter[] response = (systemparameter[])obj.get_resources(service); return response[0]; }
java
{ "resource": "" }
q12999
auditnslogpolicy_appfwglobal_binding.get
train
public static auditnslogpolicy_appfwglobal_binding[] get(nitro_service service, String name) throws Exception{ auditnslogpolicy_appfwglobal_binding obj = new auditnslogpolicy_appfwglobal_binding(); obj.set_name(name); auditnslogpolicy_appfwglobal_binding response[] = (auditnslogpolicy_appfwglobal_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }