repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
sequence
docstring
stringlengths
3
16k
docstring_tokens
sequence
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/stream/streamselector.java
streamselector.get
public static streamselector get(nitro_service service, String name) throws Exception{ streamselector obj = new streamselector(); obj.set_name(name); streamselector response = (streamselector) obj.get_resource(service); return response; }
java
public static streamselector get(nitro_service service, String name) throws Exception{ streamselector obj = new streamselector(); obj.set_name(name); streamselector response = (streamselector) obj.get_resource(service); return response; }
[ "public", "static", "streamselector", "get", "(", "nitro_service", "service", ",", "String", "name", ")", "throws", "Exception", "{", "streamselector", "obj", "=", "new", "streamselector", "(", ")", ";", "obj", ".", "set_name", "(", "name", ")", ";", "streamselector", "response", "=", "(", "streamselector", ")", "obj", ".", "get_resource", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch streamselector resource of given name .
[ "Use", "this", "API", "to", "fetch", "streamselector", "resource", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/stream/streamselector.java#L234-L239
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/appfw/appfwglobal_appfwpolicy_binding.java
appfwglobal_appfwpolicy_binding.get
public static appfwglobal_appfwpolicy_binding[] get(nitro_service service) throws Exception{ appfwglobal_appfwpolicy_binding obj = new appfwglobal_appfwpolicy_binding(); appfwglobal_appfwpolicy_binding response[] = (appfwglobal_appfwpolicy_binding[]) obj.get_resources(service); return response; }
java
public static appfwglobal_appfwpolicy_binding[] get(nitro_service service) throws Exception{ appfwglobal_appfwpolicy_binding obj = new appfwglobal_appfwpolicy_binding(); appfwglobal_appfwpolicy_binding response[] = (appfwglobal_appfwpolicy_binding[]) obj.get_resources(service); return response; }
[ "public", "static", "appfwglobal_appfwpolicy_binding", "[", "]", "get", "(", "nitro_service", "service", ")", "throws", "Exception", "{", "appfwglobal_appfwpolicy_binding", "obj", "=", "new", "appfwglobal_appfwpolicy_binding", "(", ")", ";", "appfwglobal_appfwpolicy_binding", "response", "[", "]", "=", "(", "appfwglobal_appfwpolicy_binding", "[", "]", ")", "obj", ".", "get_resources", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch a appfwglobal_appfwpolicy_binding resources.
[ "Use", "this", "API", "to", "fetch", "a", "appfwglobal_appfwpolicy_binding", "resources", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/appfw/appfwglobal_appfwpolicy_binding.java#L330-L334
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/appfw/appfwprofile_fieldconsistency_binding.java
appfwprofile_fieldconsistency_binding.get
public static appfwprofile_fieldconsistency_binding[] get(nitro_service service, String name) throws Exception{ appfwprofile_fieldconsistency_binding obj = new appfwprofile_fieldconsistency_binding(); obj.set_name(name); appfwprofile_fieldconsistency_binding response[] = (appfwprofile_fieldconsistency_binding[]) obj.get_resources(service); return response; }
java
public static appfwprofile_fieldconsistency_binding[] get(nitro_service service, String name) throws Exception{ appfwprofile_fieldconsistency_binding obj = new appfwprofile_fieldconsistency_binding(); obj.set_name(name); appfwprofile_fieldconsistency_binding response[] = (appfwprofile_fieldconsistency_binding[]) obj.get_resources(service); return response; }
[ "public", "static", "appfwprofile_fieldconsistency_binding", "[", "]", "get", "(", "nitro_service", "service", ",", "String", "name", ")", "throws", "Exception", "{", "appfwprofile_fieldconsistency_binding", "obj", "=", "new", "appfwprofile_fieldconsistency_binding", "(", ")", ";", "obj", ".", "set_name", "(", "name", ")", ";", "appfwprofile_fieldconsistency_binding", "response", "[", "]", "=", "(", "appfwprofile_fieldconsistency_binding", "[", "]", ")", "obj", ".", "get_resources", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch appfwprofile_fieldconsistency_binding resources of given name .
[ "Use", "this", "API", "to", "fetch", "appfwprofile_fieldconsistency_binding", "resources", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/appfw/appfwprofile_fieldconsistency_binding.java#L240-L245
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnsparameter.java
dnsparameter.update
public static base_response update(nitro_service client, dnsparameter resource) throws Exception { dnsparameter updateresource = new dnsparameter(); updateresource.retries = resource.retries; updateresource.minttl = resource.minttl; updateresource.maxttl = resource.maxttl; updateresource.cacherecords = resource.cacherecords; updateresource.namelookuppriority = resource.namelookuppriority; updateresource.recursion = resource.recursion; updateresource.resolutionorder = resource.resolutionorder; updateresource.dnssec = resource.dnssec; updateresource.maxpipeline = resource.maxpipeline; updateresource.dnsrootreferral = resource.dnsrootreferral; updateresource.dns64timeout = resource.dns64timeout; return updateresource.update_resource(client); }
java
public static base_response update(nitro_service client, dnsparameter resource) throws Exception { dnsparameter updateresource = new dnsparameter(); updateresource.retries = resource.retries; updateresource.minttl = resource.minttl; updateresource.maxttl = resource.maxttl; updateresource.cacherecords = resource.cacherecords; updateresource.namelookuppriority = resource.namelookuppriority; updateresource.recursion = resource.recursion; updateresource.resolutionorder = resource.resolutionorder; updateresource.dnssec = resource.dnssec; updateresource.maxpipeline = resource.maxpipeline; updateresource.dnsrootreferral = resource.dnsrootreferral; updateresource.dns64timeout = resource.dns64timeout; return updateresource.update_resource(client); }
[ "public", "static", "base_response", "update", "(", "nitro_service", "client", ",", "dnsparameter", "resource", ")", "throws", "Exception", "{", "dnsparameter", "updateresource", "=", "new", "dnsparameter", "(", ")", ";", "updateresource", ".", "retries", "=", "resource", ".", "retries", ";", "updateresource", ".", "minttl", "=", "resource", ".", "minttl", ";", "updateresource", ".", "maxttl", "=", "resource", ".", "maxttl", ";", "updateresource", ".", "cacherecords", "=", "resource", ".", "cacherecords", ";", "updateresource", ".", "namelookuppriority", "=", "resource", ".", "namelookuppriority", ";", "updateresource", ".", "recursion", "=", "resource", ".", "recursion", ";", "updateresource", ".", "resolutionorder", "=", "resource", ".", "resolutionorder", ";", "updateresource", ".", "dnssec", "=", "resource", ".", "dnssec", ";", "updateresource", ".", "maxpipeline", "=", "resource", ".", "maxpipeline", ";", "updateresource", ".", "dnsrootreferral", "=", "resource", ".", "dnsrootreferral", ";", "updateresource", ".", "dns64timeout", "=", "resource", ".", "dns64timeout", ";", "return", "updateresource", ".", "update_resource", "(", "client", ")", ";", "}" ]
Use this API to update dnsparameter.
[ "Use", "this", "API", "to", "update", "dnsparameter", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnsparameter.java#L337-L351
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnsparameter.java
dnsparameter.unset
public static base_response unset(nitro_service client, dnsparameter resource, String[] args) throws Exception{ dnsparameter unsetresource = new dnsparameter(); return unsetresource.unset_resource(client,args); }
java
public static base_response unset(nitro_service client, dnsparameter resource, String[] args) throws Exception{ dnsparameter unsetresource = new dnsparameter(); return unsetresource.unset_resource(client,args); }
[ "public", "static", "base_response", "unset", "(", "nitro_service", "client", ",", "dnsparameter", "resource", ",", "String", "[", "]", "args", ")", "throws", "Exception", "{", "dnsparameter", "unsetresource", "=", "new", "dnsparameter", "(", ")", ";", "return", "unsetresource", ".", "unset_resource", "(", "client", ",", "args", ")", ";", "}" ]
Use this API to unset the properties of dnsparameter resource. Properties that need to be unset are specified in args array.
[ "Use", "this", "API", "to", "unset", "the", "properties", "of", "dnsparameter", "resource", ".", "Properties", "that", "need", "to", "be", "unset", "are", "specified", "in", "args", "array", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnsparameter.java#L357-L360
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnsparameter.java
dnsparameter.get
public static dnsparameter get(nitro_service service) throws Exception{ dnsparameter obj = new dnsparameter(); dnsparameter[] response = (dnsparameter[])obj.get_resources(service); return response[0]; }
java
public static dnsparameter get(nitro_service service) throws Exception{ dnsparameter obj = new dnsparameter(); dnsparameter[] response = (dnsparameter[])obj.get_resources(service); return response[0]; }
[ "public", "static", "dnsparameter", "get", "(", "nitro_service", "service", ")", "throws", "Exception", "{", "dnsparameter", "obj", "=", "new", "dnsparameter", "(", ")", ";", "dnsparameter", "[", "]", "response", "=", "(", "dnsparameter", "[", "]", ")", "obj", ".", "get_resources", "(", "service", ")", ";", "return", "response", "[", "0", "]", ";", "}" ]
Use this API to fetch all the dnsparameter resources that are configured on netscaler.
[ "Use", "this", "API", "to", "fetch", "all", "the", "dnsparameter", "resources", "that", "are", "configured", "on", "netscaler", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnsparameter.java#L365-L369
train
meertensinstituut/mtas
src/main/java/mtas/solr/handler/component/util/MtasSolrComponentCollection.java
MtasSolrComponentCollection.stringToStringValues
private static HashSet<String> stringToStringValues(String stringValue) throws IOException { // should be improved to support escaped characters HashSet<String> stringValues = new HashSet<>(); JSONParser jsonParser = new JSONParser(stringValue); int event = jsonParser.nextEvent(); if (event == JSONParser.ARRAY_START) { while ((event = jsonParser.nextEvent()) != JSONParser.ARRAY_END) { if (jsonParser.getLevel() == 1) { switch (event) { case JSONParser.STRING: stringValues.add(jsonParser.getString()); break; case JSONParser.BIGNUMBER: case JSONParser.NUMBER: case JSONParser.LONG: stringValues.add(jsonParser.getNumberChars().toString()); break; case JSONParser.BOOLEAN: stringValues.add(Boolean.toString(jsonParser.getBoolean())); break; default: // do nothing break; } } } } else { throw new IOException("unsupported json structure"); } return stringValues; }
java
private static HashSet<String> stringToStringValues(String stringValue) throws IOException { // should be improved to support escaped characters HashSet<String> stringValues = new HashSet<>(); JSONParser jsonParser = new JSONParser(stringValue); int event = jsonParser.nextEvent(); if (event == JSONParser.ARRAY_START) { while ((event = jsonParser.nextEvent()) != JSONParser.ARRAY_END) { if (jsonParser.getLevel() == 1) { switch (event) { case JSONParser.STRING: stringValues.add(jsonParser.getString()); break; case JSONParser.BIGNUMBER: case JSONParser.NUMBER: case JSONParser.LONG: stringValues.add(jsonParser.getNumberChars().toString()); break; case JSONParser.BOOLEAN: stringValues.add(Boolean.toString(jsonParser.getBoolean())); break; default: // do nothing break; } } } } else { throw new IOException("unsupported json structure"); } return stringValues; }
[ "private", "static", "HashSet", "<", "String", ">", "stringToStringValues", "(", "String", "stringValue", ")", "throws", "IOException", "{", "// should be improved to support escaped characters", "HashSet", "<", "String", ">", "stringValues", "=", "new", "HashSet", "<>", "(", ")", ";", "JSONParser", "jsonParser", "=", "new", "JSONParser", "(", "stringValue", ")", ";", "int", "event", "=", "jsonParser", ".", "nextEvent", "(", ")", ";", "if", "(", "event", "==", "JSONParser", ".", "ARRAY_START", ")", "{", "while", "(", "(", "event", "=", "jsonParser", ".", "nextEvent", "(", ")", ")", "!=", "JSONParser", ".", "ARRAY_END", ")", "{", "if", "(", "jsonParser", ".", "getLevel", "(", ")", "==", "1", ")", "{", "switch", "(", "event", ")", "{", "case", "JSONParser", ".", "STRING", ":", "stringValues", ".", "add", "(", "jsonParser", ".", "getString", "(", ")", ")", ";", "break", ";", "case", "JSONParser", ".", "BIGNUMBER", ":", "case", "JSONParser", ".", "NUMBER", ":", "case", "JSONParser", ".", "LONG", ":", "stringValues", ".", "add", "(", "jsonParser", ".", "getNumberChars", "(", ")", ".", "toString", "(", ")", ")", ";", "break", ";", "case", "JSONParser", ".", "BOOLEAN", ":", "stringValues", ".", "add", "(", "Boolean", ".", "toString", "(", "jsonParser", ".", "getBoolean", "(", ")", ")", ")", ";", "break", ";", "default", ":", "// do nothing", "break", ";", "}", "}", "}", "}", "else", "{", "throw", "new", "IOException", "(", "\"unsupported json structure\"", ")", ";", "}", "return", "stringValues", ";", "}" ]
String to string values. @param stringValue the string value @return the hash set @throws IOException Signals that an I/O exception has occurred.
[ "String", "to", "string", "values", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/solr/handler/component/util/MtasSolrComponentCollection.java#L773-L804
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/system/systemglobal_binding.java
systemglobal_binding.get
public static systemglobal_binding get(nitro_service service) throws Exception{ systemglobal_binding obj = new systemglobal_binding(); systemglobal_binding response = (systemglobal_binding) obj.get_resource(service); return response; }
java
public static systemglobal_binding get(nitro_service service) throws Exception{ systemglobal_binding obj = new systemglobal_binding(); systemglobal_binding response = (systemglobal_binding) obj.get_resource(service); return response; }
[ "public", "static", "systemglobal_binding", "get", "(", "nitro_service", "service", ")", "throws", "Exception", "{", "systemglobal_binding", "obj", "=", "new", "systemglobal_binding", "(", ")", ";", "systemglobal_binding", "response", "=", "(", "systemglobal_binding", ")", "obj", ".", "get_resource", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch a systemglobal_binding resource .
[ "Use", "this", "API", "to", "fetch", "a", "systemglobal_binding", "resource", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/system/systemglobal_binding.java#L139-L143
train
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/parser/lexparser/AbstractDependencyGrammar.java
AbstractDependencyGrammar.intern
protected IntDependency intern(IntTaggedWord headTW, IntTaggedWord argTW, boolean leftHeaded, short dist) { Map<IntDependency,IntDependency> map = expandDependencyMap; IntDependency internTempDependency = new IntDependency(itwInterner.intern(headTW), itwInterner.intern(argTW), leftHeaded, dist); IntDependency returnDependency = internTempDependency; if (map != null) { returnDependency = map.get(internTempDependency); if (returnDependency == null) { map.put(internTempDependency, internTempDependency); returnDependency = internTempDependency; } } return returnDependency; }
java
protected IntDependency intern(IntTaggedWord headTW, IntTaggedWord argTW, boolean leftHeaded, short dist) { Map<IntDependency,IntDependency> map = expandDependencyMap; IntDependency internTempDependency = new IntDependency(itwInterner.intern(headTW), itwInterner.intern(argTW), leftHeaded, dist); IntDependency returnDependency = internTempDependency; if (map != null) { returnDependency = map.get(internTempDependency); if (returnDependency == null) { map.put(internTempDependency, internTempDependency); returnDependency = internTempDependency; } } return returnDependency; }
[ "protected", "IntDependency", "intern", "(", "IntTaggedWord", "headTW", ",", "IntTaggedWord", "argTW", ",", "boolean", "leftHeaded", ",", "short", "dist", ")", "{", "Map", "<", "IntDependency", ",", "IntDependency", ">", "map", "=", "expandDependencyMap", ";", "IntDependency", "internTempDependency", "=", "new", "IntDependency", "(", "itwInterner", ".", "intern", "(", "headTW", ")", ",", "itwInterner", ".", "intern", "(", "argTW", ")", ",", "leftHeaded", ",", "dist", ")", ";", "IntDependency", "returnDependency", "=", "internTempDependency", ";", "if", "(", "map", "!=", "null", ")", "{", "returnDependency", "=", "map", ".", "get", "(", "internTempDependency", ")", ";", "if", "(", "returnDependency", "==", "null", ")", "{", "map", ".", "put", "(", "internTempDependency", ",", "internTempDependency", ")", ";", "returnDependency", "=", "internTempDependency", ";", "}", "}", "return", "returnDependency", ";", "}" ]
This is a custom interner that simultaneously creates and interns an IntDependency. @return An interned IntDependency
[ "This", "is", "a", "custom", "interner", "that", "simultaneously", "creates", "and", "interns", "an", "IntDependency", "." ]
b3d44bab9ec07ace0d13612c448a6b7298c1f681
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/parser/lexparser/AbstractDependencyGrammar.java#L232-L244
train
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/sequences/LVMorphologyReaderAndWriter.java
LVMorphologyReaderAndWriter.getAnalyzer
public static Analyzer getAnalyzer() { if (analyzer == null ) initAnalyzer(); if (!analyzer.enableGuessing) System.err.println("Morphologic analyzer has disabled out-of-vocabulary guessing - this will reduce tagging accuracy"); return analyzer; }
java
public static Analyzer getAnalyzer() { if (analyzer == null ) initAnalyzer(); if (!analyzer.enableGuessing) System.err.println("Morphologic analyzer has disabled out-of-vocabulary guessing - this will reduce tagging accuracy"); return analyzer; }
[ "public", "static", "Analyzer", "getAnalyzer", "(", ")", "{", "if", "(", "analyzer", "==", "null", ")", "initAnalyzer", "(", ")", ";", "if", "(", "!", "analyzer", ".", "enableGuessing", ")", "System", ".", "err", ".", "println", "(", "\"Morphologic analyzer has disabled out-of-vocabulary guessing - this will reduce tagging accuracy\"", ")", ";", "return", "analyzer", ";", "}" ]
Getter for the currently used analyzer @return
[ "Getter", "for", "the", "currently", "used", "analyzer" ]
b3d44bab9ec07ace0d13612c448a6b7298c1f681
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/sequences/LVMorphologyReaderAndWriter.java#L91-L96
train
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/sequences/LVMorphologyReaderAndWriter.java
LVMorphologyReaderAndWriter.applyLVmorphoanalysis
private static void applyLVmorphoanalysis(CoreLabel wi, Collection<String> answerAttributes) { Word analysis = analyzer.analyze(wi.word()); applyLVmorphoanalysis(wi, analysis, answerAttributes); }
java
private static void applyLVmorphoanalysis(CoreLabel wi, Collection<String> answerAttributes) { Word analysis = analyzer.analyze(wi.word()); applyLVmorphoanalysis(wi, analysis, answerAttributes); }
[ "private", "static", "void", "applyLVmorphoanalysis", "(", "CoreLabel", "wi", ",", "Collection", "<", "String", ">", "answerAttributes", ")", "{", "Word", "analysis", "=", "analyzer", ".", "analyze", "(", "wi", ".", "word", "(", ")", ")", ";", "applyLVmorphoanalysis", "(", "wi", ",", "analysis", ",", "answerAttributes", ")", ";", "}" ]
Performs LV morphology analysis of the token wi, adds the possible readins and marks the most likely one. If an AnswerAnnotation exists, then it is considered to be a morphosyntactic tag, and the attributes are filtered for the training. @param wi @param answerAttributes
[ "Performs", "LV", "morphology", "analysis", "of", "the", "token", "wi", "adds", "the", "possible", "readins", "and", "marks", "the", "most", "likely", "one", ".", "If", "an", "AnswerAnnotation", "exists", "then", "it", "is", "considered", "to", "be", "a", "morphosyntactic", "tag", "and", "the", "attributes", "are", "filtered", "for", "the", "training", "." ]
b3d44bab9ec07ace0d13612c448a6b7298c1f681
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/sequences/LVMorphologyReaderAndWriter.java#L185-L188
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/ssl/sslpolicy_sslglobal_binding.java
sslpolicy_sslglobal_binding.get
public static sslpolicy_sslglobal_binding[] get(nitro_service service, String name) throws Exception{ sslpolicy_sslglobal_binding obj = new sslpolicy_sslglobal_binding(); obj.set_name(name); sslpolicy_sslglobal_binding response[] = (sslpolicy_sslglobal_binding[]) obj.get_resources(service); return response; }
java
public static sslpolicy_sslglobal_binding[] get(nitro_service service, String name) throws Exception{ sslpolicy_sslglobal_binding obj = new sslpolicy_sslglobal_binding(); obj.set_name(name); sslpolicy_sslglobal_binding response[] = (sslpolicy_sslglobal_binding[]) obj.get_resources(service); return response; }
[ "public", "static", "sslpolicy_sslglobal_binding", "[", "]", "get", "(", "nitro_service", "service", ",", "String", "name", ")", "throws", "Exception", "{", "sslpolicy_sslglobal_binding", "obj", "=", "new", "sslpolicy_sslglobal_binding", "(", ")", ";", "obj", ".", "set_name", "(", "name", ")", ";", "sslpolicy_sslglobal_binding", "response", "[", "]", "=", "(", "sslpolicy_sslglobal_binding", "[", "]", ")", "obj", ".", "get_resources", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch sslpolicy_sslglobal_binding resources of given name .
[ "Use", "this", "API", "to", "fetch", "sslpolicy_sslglobal_binding", "resources", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/ssl/sslpolicy_sslglobal_binding.java#L162-L167
train
meertensinstituut/mtas
src/main/java/mtas/codec/util/collector/MtasDataItemNumberComparator.java
MtasDataItemNumberComparator.recomputeBoundary
public MtasDataItemNumberComparator<T> recomputeBoundary(int n) throws IOException { if (sortDirection.equals(CodecUtil.SORT_DESC)) { if (value instanceof Integer) { return new MtasDataItemNumberComparator( Math.floorDiv((Integer) value, n), sortDirection); } else if (value instanceof Long) { return new MtasDataItemNumberComparator(Math.floorDiv((Long) value, n), sortDirection); } else if (value instanceof Float) { return new MtasDataItemNumberComparator(((Float) value) / n, sortDirection); } else if (value instanceof Double) { return new MtasDataItemNumberComparator(((Double) value) / n, sortDirection); } else { throw new IOException("unknown NumberComparator"); } } else if (sortDirection.equals(CodecUtil.SORT_ASC)) { return new MtasDataItemNumberComparator(getValue(), sortDirection); } else { throw new IOException("unknown sortDirection " + sortDirection); } }
java
public MtasDataItemNumberComparator<T> recomputeBoundary(int n) throws IOException { if (sortDirection.equals(CodecUtil.SORT_DESC)) { if (value instanceof Integer) { return new MtasDataItemNumberComparator( Math.floorDiv((Integer) value, n), sortDirection); } else if (value instanceof Long) { return new MtasDataItemNumberComparator(Math.floorDiv((Long) value, n), sortDirection); } else if (value instanceof Float) { return new MtasDataItemNumberComparator(((Float) value) / n, sortDirection); } else if (value instanceof Double) { return new MtasDataItemNumberComparator(((Double) value) / n, sortDirection); } else { throw new IOException("unknown NumberComparator"); } } else if (sortDirection.equals(CodecUtil.SORT_ASC)) { return new MtasDataItemNumberComparator(getValue(), sortDirection); } else { throw new IOException("unknown sortDirection " + sortDirection); } }
[ "public", "MtasDataItemNumberComparator", "<", "T", ">", "recomputeBoundary", "(", "int", "n", ")", "throws", "IOException", "{", "if", "(", "sortDirection", ".", "equals", "(", "CodecUtil", ".", "SORT_DESC", ")", ")", "{", "if", "(", "value", "instanceof", "Integer", ")", "{", "return", "new", "MtasDataItemNumberComparator", "(", "Math", ".", "floorDiv", "(", "(", "Integer", ")", "value", ",", "n", ")", ",", "sortDirection", ")", ";", "}", "else", "if", "(", "value", "instanceof", "Long", ")", "{", "return", "new", "MtasDataItemNumberComparator", "(", "Math", ".", "floorDiv", "(", "(", "Long", ")", "value", ",", "n", ")", ",", "sortDirection", ")", ";", "}", "else", "if", "(", "value", "instanceof", "Float", ")", "{", "return", "new", "MtasDataItemNumberComparator", "(", "(", "(", "Float", ")", "value", ")", "/", "n", ",", "sortDirection", ")", ";", "}", "else", "if", "(", "value", "instanceof", "Double", ")", "{", "return", "new", "MtasDataItemNumberComparator", "(", "(", "(", "Double", ")", "value", ")", "/", "n", ",", "sortDirection", ")", ";", "}", "else", "{", "throw", "new", "IOException", "(", "\"unknown NumberComparator\"", ")", ";", "}", "}", "else", "if", "(", "sortDirection", ".", "equals", "(", "CodecUtil", ".", "SORT_ASC", ")", ")", "{", "return", "new", "MtasDataItemNumberComparator", "(", "getValue", "(", ")", ",", "sortDirection", ")", ";", "}", "else", "{", "throw", "new", "IOException", "(", "\"unknown sortDirection \"", "+", "sortDirection", ")", ";", "}", "}" ]
Recompute boundary. @param n the n @return the mtas data item number comparator @throws IOException Signals that an I/O exception has occurred.
[ "Recompute", "boundary", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/codec/util/collector/MtasDataItemNumberComparator.java#L123-L146
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/authentication/authenticationradiuspolicy_binding.java
authenticationradiuspolicy_binding.get
public static authenticationradiuspolicy_binding get(nitro_service service, String name) throws Exception{ authenticationradiuspolicy_binding obj = new authenticationradiuspolicy_binding(); obj.set_name(name); authenticationradiuspolicy_binding response = (authenticationradiuspolicy_binding) obj.get_resource(service); return response; }
java
public static authenticationradiuspolicy_binding get(nitro_service service, String name) throws Exception{ authenticationradiuspolicy_binding obj = new authenticationradiuspolicy_binding(); obj.set_name(name); authenticationradiuspolicy_binding response = (authenticationradiuspolicy_binding) obj.get_resource(service); return response; }
[ "public", "static", "authenticationradiuspolicy_binding", "get", "(", "nitro_service", "service", ",", "String", "name", ")", "throws", "Exception", "{", "authenticationradiuspolicy_binding", "obj", "=", "new", "authenticationradiuspolicy_binding", "(", ")", ";", "obj", ".", "set_name", "(", "name", ")", ";", "authenticationradiuspolicy_binding", "response", "=", "(", "authenticationradiuspolicy_binding", ")", "obj", ".", "get_resource", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch authenticationradiuspolicy_binding resource of given name .
[ "Use", "this", "API", "to", "fetch", "authenticationradiuspolicy_binding", "resource", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/authentication/authenticationradiuspolicy_binding.java#L136-L141
train
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/trees/Treebank.java
Treebank.decimate
public void decimate(Writer trainW, Writer devW, Writer testW) throws IOException { PrintWriter trainPW = new PrintWriter(trainW, true); PrintWriter devPW = new PrintWriter(devW, true); PrintWriter testPW = new PrintWriter(testW, true); int i = 0; for (Tree t : this) { if (i == 8) { t.pennPrint(devPW); } else if (i == 9) { t.pennPrint(testPW); } else { t.pennPrint(trainPW); } i = (i+1) % 10; } }
java
public void decimate(Writer trainW, Writer devW, Writer testW) throws IOException { PrintWriter trainPW = new PrintWriter(trainW, true); PrintWriter devPW = new PrintWriter(devW, true); PrintWriter testPW = new PrintWriter(testW, true); int i = 0; for (Tree t : this) { if (i == 8) { t.pennPrint(devPW); } else if (i == 9) { t.pennPrint(testPW); } else { t.pennPrint(trainPW); } i = (i+1) % 10; } }
[ "public", "void", "decimate", "(", "Writer", "trainW", ",", "Writer", "devW", ",", "Writer", "testW", ")", "throws", "IOException", "{", "PrintWriter", "trainPW", "=", "new", "PrintWriter", "(", "trainW", ",", "true", ")", ";", "PrintWriter", "devPW", "=", "new", "PrintWriter", "(", "devW", ",", "true", ")", ";", "PrintWriter", "testPW", "=", "new", "PrintWriter", "(", "testW", ",", "true", ")", ";", "int", "i", "=", "0", ";", "for", "(", "Tree", "t", ":", "this", ")", "{", "if", "(", "i", "==", "8", ")", "{", "t", ".", "pennPrint", "(", "devPW", ")", ";", "}", "else", "if", "(", "i", "==", "9", ")", "{", "t", ".", "pennPrint", "(", "testPW", ")", ";", "}", "else", "{", "t", ".", "pennPrint", "(", "trainPW", ")", ";", "}", "i", "=", "(", "i", "+", "1", ")", "%", "10", ";", "}", "}" ]
Divide a Treebank into 3, by taking every 9th sentence for the dev set and every 10th for the test set. Penn people do this.
[ "Divide", "a", "Treebank", "into", "3", "by", "taking", "every", "9th", "sentence", "for", "the", "dev", "set", "and", "every", "10th", "for", "the", "test", "set", ".", "Penn", "people", "do", "this", "." ]
b3d44bab9ec07ace0d13612c448a6b7298c1f681
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/trees/Treebank.java#L276-L291
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/cr/crvserver_cspolicy_binding.java
crvserver_cspolicy_binding.get
public static crvserver_cspolicy_binding[] get(nitro_service service, String name) throws Exception{ crvserver_cspolicy_binding obj = new crvserver_cspolicy_binding(); obj.set_name(name); crvserver_cspolicy_binding response[] = (crvserver_cspolicy_binding[]) obj.get_resources(service); return response; }
java
public static crvserver_cspolicy_binding[] get(nitro_service service, String name) throws Exception{ crvserver_cspolicy_binding obj = new crvserver_cspolicy_binding(); obj.set_name(name); crvserver_cspolicy_binding response[] = (crvserver_cspolicy_binding[]) obj.get_resources(service); return response; }
[ "public", "static", "crvserver_cspolicy_binding", "[", "]", "get", "(", "nitro_service", "service", ",", "String", "name", ")", "throws", "Exception", "{", "crvserver_cspolicy_binding", "obj", "=", "new", "crvserver_cspolicy_binding", "(", ")", ";", "obj", ".", "set_name", "(", "name", ")", ";", "crvserver_cspolicy_binding", "response", "[", "]", "=", "(", "crvserver_cspolicy_binding", "[", "]", ")", "obj", ".", "get_resources", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch crvserver_cspolicy_binding resources of given name .
[ "Use", "this", "API", "to", "fetch", "crvserver_cspolicy_binding", "resources", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/cr/crvserver_cspolicy_binding.java#L215-L220
train
meertensinstituut/mtas
src/main/java/mtas/analysis/parser/MtasXMLParser.java
MtasXMLParser.printConfigMappingTypes
private String printConfigMappingTypes( Map<QName, MtasParserType<MtasParserMapping<?>>> types) { StringBuilder text = new StringBuilder(); for (Entry<QName, MtasParserType<MtasParserMapping<?>>> entry : types .entrySet()) { text.append("- " + entry.getKey().getLocalPart() + ": " + entry.getValue().items.size() + " mapping(s)\n"); for (int i = 0; i < entry.getValue().items.size(); i++) { text.append("\t" + entry.getValue().items.get(i) + "\n"); } } return text.toString(); }
java
private String printConfigMappingTypes( Map<QName, MtasParserType<MtasParserMapping<?>>> types) { StringBuilder text = new StringBuilder(); for (Entry<QName, MtasParserType<MtasParserMapping<?>>> entry : types .entrySet()) { text.append("- " + entry.getKey().getLocalPart() + ": " + entry.getValue().items.size() + " mapping(s)\n"); for (int i = 0; i < entry.getValue().items.size(); i++) { text.append("\t" + entry.getValue().items.get(i) + "\n"); } } return text.toString(); }
[ "private", "String", "printConfigMappingTypes", "(", "Map", "<", "QName", ",", "MtasParserType", "<", "MtasParserMapping", "<", "?", ">", ">", ">", "types", ")", "{", "StringBuilder", "text", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "Entry", "<", "QName", ",", "MtasParserType", "<", "MtasParserMapping", "<", "?", ">", ">", ">", "entry", ":", "types", ".", "entrySet", "(", ")", ")", "{", "text", ".", "append", "(", "\"- \"", "+", "entry", ".", "getKey", "(", ")", ".", "getLocalPart", "(", ")", "+", "\": \"", "+", "entry", ".", "getValue", "(", ")", ".", "items", ".", "size", "(", ")", "+", "\" mapping(s)\\n\"", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "entry", ".", "getValue", "(", ")", ".", "items", ".", "size", "(", ")", ";", "i", "++", ")", "{", "text", ".", "append", "(", "\"\\t\"", "+", "entry", ".", "getValue", "(", ")", ".", "items", ".", "get", "(", "i", ")", "+", "\"\\n\"", ")", ";", "}", "}", "return", "text", ".", "toString", "(", ")", ";", "}" ]
Prints the config mapping types. @param types the types @return the string
[ "Prints", "the", "config", "mapping", "types", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/analysis/parser/MtasXMLParser.java#L171-L183
train
meertensinstituut/mtas
src/main/java/mtas/analysis/parser/MtasXMLParser.java
MtasXMLParser.recursiveCollect
private Collection<? extends String> recursiveCollect(String refId, Map<String, SortedSet<String>> relationKeyMap, int maxRecursion) { Set<String> list = new HashSet<>(); if (maxRecursion > 0 && relationKeyMap.containsKey(refId)) { SortedSet<String> subList = relationKeyMap.get(refId); for (String subRefId : subList) { list.add(subRefId); list.addAll( recursiveCollect(subRefId, relationKeyMap, maxRecursion - 1)); } } return list; }
java
private Collection<? extends String> recursiveCollect(String refId, Map<String, SortedSet<String>> relationKeyMap, int maxRecursion) { Set<String> list = new HashSet<>(); if (maxRecursion > 0 && relationKeyMap.containsKey(refId)) { SortedSet<String> subList = relationKeyMap.get(refId); for (String subRefId : subList) { list.add(subRefId); list.addAll( recursiveCollect(subRefId, relationKeyMap, maxRecursion - 1)); } } return list; }
[ "private", "Collection", "<", "?", "extends", "String", ">", "recursiveCollect", "(", "String", "refId", ",", "Map", "<", "String", ",", "SortedSet", "<", "String", ">", ">", "relationKeyMap", ",", "int", "maxRecursion", ")", "{", "Set", "<", "String", ">", "list", "=", "new", "HashSet", "<>", "(", ")", ";", "if", "(", "maxRecursion", ">", "0", "&&", "relationKeyMap", ".", "containsKey", "(", "refId", ")", ")", "{", "SortedSet", "<", "String", ">", "subList", "=", "relationKeyMap", ".", "get", "(", "refId", ")", ";", "for", "(", "String", "subRefId", ":", "subList", ")", "{", "list", ".", "add", "(", "subRefId", ")", ";", "list", ".", "addAll", "(", "recursiveCollect", "(", "subRefId", ",", "relationKeyMap", ",", "maxRecursion", "-", "1", ")", ")", ";", "}", "}", "return", "list", ";", "}" ]
Recursive collect. @param refId the ref id @param relationKeyMap the relation key map @param maxRecursion the max recursion @return the collection<? extends string>
[ "Recursive", "collect", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/analysis/parser/MtasXMLParser.java#L910-L922
train
meertensinstituut/mtas
src/main/java/mtas/analysis/parser/MtasXMLParser.java
MtasXMLParser.getQName
private QName getQName(String key) { QName qname; if ((qname = qNames.get(key)) == null) { qname = new QName(namespaceURI, key); qNames.put(key, qname); } return qname; }
java
private QName getQName(String key) { QName qname; if ((qname = qNames.get(key)) == null) { qname = new QName(namespaceURI, key); qNames.put(key, qname); } return qname; }
[ "private", "QName", "getQName", "(", "String", "key", ")", "{", "QName", "qname", ";", "if", "(", "(", "qname", "=", "qNames", ".", "get", "(", "key", ")", ")", "==", "null", ")", "{", "qname", "=", "new", "QName", "(", "namespaceURI", ",", "key", ")", ";", "qNames", ".", "put", "(", "key", ",", "qname", ")", ";", "}", "return", "qname", ";", "}" ]
Gets the q name. @param key the key @return the q name
[ "Gets", "the", "q", "name", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/analysis/parser/MtasXMLParser.java#L930-L937
train
meertensinstituut/mtas
src/main/java/mtas/analysis/parser/MtasXMLParser.java
MtasXMLParser.collectAttributes
public void collectAttributes(MtasParserObject currentObject, XMLStreamReader streamReader) { String attributeNamespaceURI; currentObject.objectAttributes.clear(); currentObject.objectId = streamReader.getAttributeValue(namespaceURI_id, "id"); for (int i = 0; i < streamReader.getAttributeCount(); i++) { attributeNamespaceURI = streamReader.getAttributeNamespace(i); if (attributeNamespaceURI == null || attributeNamespaceURI.equals("")) { attributeNamespaceURI = streamReader.getNamespaceURI(); } if (namespaceURI == null || attributeNamespaceURI.equals(namespaceURI)) { currentObject.objectAttributes.put( streamReader.getAttributeLocalName(i), streamReader.getAttributeValue(i)); } else { HashMap<String, String> otherMap; if(!currentObject.objectOtherAttributes.containsKey(attributeNamespaceURI)) { otherMap = new HashMap<>(); currentObject.objectOtherAttributes.put(attributeNamespaceURI, otherMap); } else { otherMap = currentObject.objectOtherAttributes.get(attributeNamespaceURI); } otherMap.put( streamReader.getAttributeLocalName(i), streamReader.getAttributeValue(i)); } } }
java
public void collectAttributes(MtasParserObject currentObject, XMLStreamReader streamReader) { String attributeNamespaceURI; currentObject.objectAttributes.clear(); currentObject.objectId = streamReader.getAttributeValue(namespaceURI_id, "id"); for (int i = 0; i < streamReader.getAttributeCount(); i++) { attributeNamespaceURI = streamReader.getAttributeNamespace(i); if (attributeNamespaceURI == null || attributeNamespaceURI.equals("")) { attributeNamespaceURI = streamReader.getNamespaceURI(); } if (namespaceURI == null || attributeNamespaceURI.equals(namespaceURI)) { currentObject.objectAttributes.put( streamReader.getAttributeLocalName(i), streamReader.getAttributeValue(i)); } else { HashMap<String, String> otherMap; if(!currentObject.objectOtherAttributes.containsKey(attributeNamespaceURI)) { otherMap = new HashMap<>(); currentObject.objectOtherAttributes.put(attributeNamespaceURI, otherMap); } else { otherMap = currentObject.objectOtherAttributes.get(attributeNamespaceURI); } otherMap.put( streamReader.getAttributeLocalName(i), streamReader.getAttributeValue(i)); } } }
[ "public", "void", "collectAttributes", "(", "MtasParserObject", "currentObject", ",", "XMLStreamReader", "streamReader", ")", "{", "String", "attributeNamespaceURI", ";", "currentObject", ".", "objectAttributes", ".", "clear", "(", ")", ";", "currentObject", ".", "objectId", "=", "streamReader", ".", "getAttributeValue", "(", "namespaceURI_id", ",", "\"id\"", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "streamReader", ".", "getAttributeCount", "(", ")", ";", "i", "++", ")", "{", "attributeNamespaceURI", "=", "streamReader", ".", "getAttributeNamespace", "(", "i", ")", ";", "if", "(", "attributeNamespaceURI", "==", "null", "||", "attributeNamespaceURI", ".", "equals", "(", "\"\"", ")", ")", "{", "attributeNamespaceURI", "=", "streamReader", ".", "getNamespaceURI", "(", ")", ";", "}", "if", "(", "namespaceURI", "==", "null", "||", "attributeNamespaceURI", ".", "equals", "(", "namespaceURI", ")", ")", "{", "currentObject", ".", "objectAttributes", ".", "put", "(", "streamReader", ".", "getAttributeLocalName", "(", "i", ")", ",", "streamReader", ".", "getAttributeValue", "(", "i", ")", ")", ";", "}", "else", "{", "HashMap", "<", "String", ",", "String", ">", "otherMap", ";", "if", "(", "!", "currentObject", ".", "objectOtherAttributes", ".", "containsKey", "(", "attributeNamespaceURI", ")", ")", "{", "otherMap", "=", "new", "HashMap", "<>", "(", ")", ";", "currentObject", ".", "objectOtherAttributes", ".", "put", "(", "attributeNamespaceURI", ",", "otherMap", ")", ";", "}", "else", "{", "otherMap", "=", "currentObject", ".", "objectOtherAttributes", ".", "get", "(", "attributeNamespaceURI", ")", ";", "}", "otherMap", ".", "put", "(", "streamReader", ".", "getAttributeLocalName", "(", "i", ")", ",", "streamReader", ".", "getAttributeValue", "(", "i", ")", ")", ";", "}", "}", "}" ]
Collect attributes. @param currentObject the current object @param streamReader the stream reader
[ "Collect", "attributes", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/analysis/parser/MtasXMLParser.java#L945-L973
train
meertensinstituut/mtas
src/main/java/mtas/analysis/parser/MtasCRMParser.java
MtasCRMParser.processCRMSentence
private Set<MtasParserObject> processCRMSentence( MtasTokenIdFactory mtasTokenIdFactory, String name, String text, Integer currentOffset, List<MtasCRMParserFunctionOutput> functionOutputList, MtasCRMAncestors unknownAncestors, Map<String, List<MtasParserObject>> currentList, Map<String, Map<Integer, Set<String>>> updateList, Map<String, Set<Integer>> idPositions, Map<String, Integer[]> idOffsets, Set<MtasParserObject> previous, Set<MtasParserObject> previousClause) throws MtasParserException, MtasConfigException { MtasParserType tmpCurrentType; MtasParserObject currentObject; if ((tmpCurrentType = crmSentenceTypes.get(name)) != null) { String filteredText = text.replaceAll("[^0-9\\-]", ""); currentObject = new MtasParserObject(tmpCurrentType); currentObject.setUnknownAncestorNumber(unknownAncestors.unknown); currentObject.setRealOffsetStart(currentOffset); currentObject.setText(filteredText); if (!prevalidateObject(currentObject, currentList)) { return new HashSet<>(); } else { closePrevious(mtasTokenIdFactory, previousClause, currentOffset, unknownAncestors, currentList, updateList, idPositions, idOffsets); closePrevious(mtasTokenIdFactory, previous, currentOffset, unknownAncestors, currentList, updateList, idPositions, idOffsets); previous.clear(); currentList.get(MAPPING_TYPE_GROUP).add(currentObject); unknownAncestors.unknown = 0; return new HashSet<>(Arrays.asList(currentObject)); } } return new HashSet<>(); }
java
private Set<MtasParserObject> processCRMSentence( MtasTokenIdFactory mtasTokenIdFactory, String name, String text, Integer currentOffset, List<MtasCRMParserFunctionOutput> functionOutputList, MtasCRMAncestors unknownAncestors, Map<String, List<MtasParserObject>> currentList, Map<String, Map<Integer, Set<String>>> updateList, Map<String, Set<Integer>> idPositions, Map<String, Integer[]> idOffsets, Set<MtasParserObject> previous, Set<MtasParserObject> previousClause) throws MtasParserException, MtasConfigException { MtasParserType tmpCurrentType; MtasParserObject currentObject; if ((tmpCurrentType = crmSentenceTypes.get(name)) != null) { String filteredText = text.replaceAll("[^0-9\\-]", ""); currentObject = new MtasParserObject(tmpCurrentType); currentObject.setUnknownAncestorNumber(unknownAncestors.unknown); currentObject.setRealOffsetStart(currentOffset); currentObject.setText(filteredText); if (!prevalidateObject(currentObject, currentList)) { return new HashSet<>(); } else { closePrevious(mtasTokenIdFactory, previousClause, currentOffset, unknownAncestors, currentList, updateList, idPositions, idOffsets); closePrevious(mtasTokenIdFactory, previous, currentOffset, unknownAncestors, currentList, updateList, idPositions, idOffsets); previous.clear(); currentList.get(MAPPING_TYPE_GROUP).add(currentObject); unknownAncestors.unknown = 0; return new HashSet<>(Arrays.asList(currentObject)); } } return new HashSet<>(); }
[ "private", "Set", "<", "MtasParserObject", ">", "processCRMSentence", "(", "MtasTokenIdFactory", "mtasTokenIdFactory", ",", "String", "name", ",", "String", "text", ",", "Integer", "currentOffset", ",", "List", "<", "MtasCRMParserFunctionOutput", ">", "functionOutputList", ",", "MtasCRMAncestors", "unknownAncestors", ",", "Map", "<", "String", ",", "List", "<", "MtasParserObject", ">", ">", "currentList", ",", "Map", "<", "String", ",", "Map", "<", "Integer", ",", "Set", "<", "String", ">", ">", ">", "updateList", ",", "Map", "<", "String", ",", "Set", "<", "Integer", ">", ">", "idPositions", ",", "Map", "<", "String", ",", "Integer", "[", "]", ">", "idOffsets", ",", "Set", "<", "MtasParserObject", ">", "previous", ",", "Set", "<", "MtasParserObject", ">", "previousClause", ")", "throws", "MtasParserException", ",", "MtasConfigException", "{", "MtasParserType", "tmpCurrentType", ";", "MtasParserObject", "currentObject", ";", "if", "(", "(", "tmpCurrentType", "=", "crmSentenceTypes", ".", "get", "(", "name", ")", ")", "!=", "null", ")", "{", "String", "filteredText", "=", "text", ".", "replaceAll", "(", "\"[^0-9\\\\-]\"", ",", "\"\"", ")", ";", "currentObject", "=", "new", "MtasParserObject", "(", "tmpCurrentType", ")", ";", "currentObject", ".", "setUnknownAncestorNumber", "(", "unknownAncestors", ".", "unknown", ")", ";", "currentObject", ".", "setRealOffsetStart", "(", "currentOffset", ")", ";", "currentObject", ".", "setText", "(", "filteredText", ")", ";", "if", "(", "!", "prevalidateObject", "(", "currentObject", ",", "currentList", ")", ")", "{", "return", "new", "HashSet", "<>", "(", ")", ";", "}", "else", "{", "closePrevious", "(", "mtasTokenIdFactory", ",", "previousClause", ",", "currentOffset", ",", "unknownAncestors", ",", "currentList", ",", "updateList", ",", "idPositions", ",", "idOffsets", ")", ";", "closePrevious", "(", "mtasTokenIdFactory", ",", "previous", ",", "currentOffset", ",", "unknownAncestors", ",", "currentList", ",", "updateList", ",", "idPositions", ",", "idOffsets", ")", ";", "previous", ".", "clear", "(", ")", ";", "currentList", ".", "get", "(", "MAPPING_TYPE_GROUP", ")", ".", "add", "(", "currentObject", ")", ";", "unknownAncestors", ".", "unknown", "=", "0", ";", "return", "new", "HashSet", "<>", "(", "Arrays", ".", "asList", "(", "currentObject", ")", ")", ";", "}", "}", "return", "new", "HashSet", "<>", "(", ")", ";", "}" ]
Process CRM sentence. @param mtasTokenIdFactory the mtas token id factory @param name the name @param text the text @param currentOffset the current offset @param functionOutputList the function output list @param unknownAncestors the unknown ancestors @param currentList the current list @param updateList the update list @param idPositions the id positions @param idOffsets the id offsets @param previous the previous @param previousClause the previous clause @return the sets the @throws MtasParserException the mtas parser exception @throws MtasConfigException the mtas config exception
[ "Process", "CRM", "sentence", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/analysis/parser/MtasCRMParser.java#L577-L609
train
meertensinstituut/mtas
src/main/java/mtas/analysis/parser/MtasCRMParser.java
MtasCRMParser.closePrevious
private void closePrevious(MtasTokenIdFactory mtasTokenIdFactory, Set<MtasParserObject> previous, Integer currentOffset, MtasCRMAncestors unknownAncestors, Map<String, List<MtasParserObject>> currentList, Map<String, Map<Integer, Set<String>>> updateList, Map<String, Set<Integer>> idPositions, Map<String, Integer[]> idOffsets) throws MtasParserException, MtasConfigException { for (MtasParserObject previousObject : previous) { previousObject.setRealOffsetEnd(currentOffset); idPositions.put(previousObject.getId(), previousObject.getPositions()); idOffsets.put(previousObject.getId(), previousObject.getOffset()); previousObject.updateMappings(idPositions, idOffsets); unknownAncestors.unknown = previousObject.getUnknownAncestorNumber(); computeMappingsFromObject(mtasTokenIdFactory, previousObject, currentList, updateList); currentList.get(MAPPING_TYPE_GROUP).remove(previousObject); } }
java
private void closePrevious(MtasTokenIdFactory mtasTokenIdFactory, Set<MtasParserObject> previous, Integer currentOffset, MtasCRMAncestors unknownAncestors, Map<String, List<MtasParserObject>> currentList, Map<String, Map<Integer, Set<String>>> updateList, Map<String, Set<Integer>> idPositions, Map<String, Integer[]> idOffsets) throws MtasParserException, MtasConfigException { for (MtasParserObject previousObject : previous) { previousObject.setRealOffsetEnd(currentOffset); idPositions.put(previousObject.getId(), previousObject.getPositions()); idOffsets.put(previousObject.getId(), previousObject.getOffset()); previousObject.updateMappings(idPositions, idOffsets); unknownAncestors.unknown = previousObject.getUnknownAncestorNumber(); computeMappingsFromObject(mtasTokenIdFactory, previousObject, currentList, updateList); currentList.get(MAPPING_TYPE_GROUP).remove(previousObject); } }
[ "private", "void", "closePrevious", "(", "MtasTokenIdFactory", "mtasTokenIdFactory", ",", "Set", "<", "MtasParserObject", ">", "previous", ",", "Integer", "currentOffset", ",", "MtasCRMAncestors", "unknownAncestors", ",", "Map", "<", "String", ",", "List", "<", "MtasParserObject", ">", ">", "currentList", ",", "Map", "<", "String", ",", "Map", "<", "Integer", ",", "Set", "<", "String", ">", ">", ">", "updateList", ",", "Map", "<", "String", ",", "Set", "<", "Integer", ">", ">", "idPositions", ",", "Map", "<", "String", ",", "Integer", "[", "]", ">", "idOffsets", ")", "throws", "MtasParserException", ",", "MtasConfigException", "{", "for", "(", "MtasParserObject", "previousObject", ":", "previous", ")", "{", "previousObject", ".", "setRealOffsetEnd", "(", "currentOffset", ")", ";", "idPositions", ".", "put", "(", "previousObject", ".", "getId", "(", ")", ",", "previousObject", ".", "getPositions", "(", ")", ")", ";", "idOffsets", ".", "put", "(", "previousObject", ".", "getId", "(", ")", ",", "previousObject", ".", "getOffset", "(", ")", ")", ";", "previousObject", ".", "updateMappings", "(", "idPositions", ",", "idOffsets", ")", ";", "unknownAncestors", ".", "unknown", "=", "previousObject", ".", "getUnknownAncestorNumber", "(", ")", ";", "computeMappingsFromObject", "(", "mtasTokenIdFactory", ",", "previousObject", ",", "currentList", ",", "updateList", ")", ";", "currentList", ".", "get", "(", "MAPPING_TYPE_GROUP", ")", ".", "remove", "(", "previousObject", ")", ";", "}", "}" ]
Close previous. @param mtasTokenIdFactory the mtas token id factory @param previous the previous @param currentOffset the current offset @param unknownAncestors the unknown ancestors @param currentList the current list @param updateList the update list @param idPositions the id positions @param idOffsets the id offsets @throws MtasParserException the mtas parser exception @throws MtasConfigException the mtas config exception
[ "Close", "previous", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/analysis/parser/MtasCRMParser.java#L675-L692
train
meertensinstituut/mtas
src/main/java/mtas/analysis/parser/MtasCRMParser.java
MtasCRMParser.processFunctions
private void processFunctions(String name, String text, String type, List<MtasCRMParserFunctionOutput> functionOutputList) { if (functions.containsKey(type) && functions.get(type).containsKey(name) && text != null) { MtasCRMParserFunction function = functions.get(type).get(name); String[] value; if (function.split != null) { value = text.split(Pattern.quote(function.split)); } else { value = new String[] { text }; } for (int c = 0; c < value.length; c++) { boolean checkedEmpty = false; if (value[c].equals("")) { checkedEmpty = true; } if (function.output.containsKey(value[c])) { ArrayList<MtasCRMParserFunctionOutput> list = function.output .get(value[c]); for (MtasCRMParserFunctionOutput listItem : list) { functionOutputList.add(listItem.create(value[c])); } } if (!checkedEmpty && function.output.containsKey("")) { ArrayList<MtasCRMParserFunctionOutput> list = function.output.get(""); for (MtasCRMParserFunctionOutput listItem : list) { functionOutputList.add(listItem.create(value[c])); } } } } }
java
private void processFunctions(String name, String text, String type, List<MtasCRMParserFunctionOutput> functionOutputList) { if (functions.containsKey(type) && functions.get(type).containsKey(name) && text != null) { MtasCRMParserFunction function = functions.get(type).get(name); String[] value; if (function.split != null) { value = text.split(Pattern.quote(function.split)); } else { value = new String[] { text }; } for (int c = 0; c < value.length; c++) { boolean checkedEmpty = false; if (value[c].equals("")) { checkedEmpty = true; } if (function.output.containsKey(value[c])) { ArrayList<MtasCRMParserFunctionOutput> list = function.output .get(value[c]); for (MtasCRMParserFunctionOutput listItem : list) { functionOutputList.add(listItem.create(value[c])); } } if (!checkedEmpty && function.output.containsKey("")) { ArrayList<MtasCRMParserFunctionOutput> list = function.output.get(""); for (MtasCRMParserFunctionOutput listItem : list) { functionOutputList.add(listItem.create(value[c])); } } } } }
[ "private", "void", "processFunctions", "(", "String", "name", ",", "String", "text", ",", "String", "type", ",", "List", "<", "MtasCRMParserFunctionOutput", ">", "functionOutputList", ")", "{", "if", "(", "functions", ".", "containsKey", "(", "type", ")", "&&", "functions", ".", "get", "(", "type", ")", ".", "containsKey", "(", "name", ")", "&&", "text", "!=", "null", ")", "{", "MtasCRMParserFunction", "function", "=", "functions", ".", "get", "(", "type", ")", ".", "get", "(", "name", ")", ";", "String", "[", "]", "value", ";", "if", "(", "function", ".", "split", "!=", "null", ")", "{", "value", "=", "text", ".", "split", "(", "Pattern", ".", "quote", "(", "function", ".", "split", ")", ")", ";", "}", "else", "{", "value", "=", "new", "String", "[", "]", "{", "text", "}", ";", "}", "for", "(", "int", "c", "=", "0", ";", "c", "<", "value", ".", "length", ";", "c", "++", ")", "{", "boolean", "checkedEmpty", "=", "false", ";", "if", "(", "value", "[", "c", "]", ".", "equals", "(", "\"\"", ")", ")", "{", "checkedEmpty", "=", "true", ";", "}", "if", "(", "function", ".", "output", ".", "containsKey", "(", "value", "[", "c", "]", ")", ")", "{", "ArrayList", "<", "MtasCRMParserFunctionOutput", ">", "list", "=", "function", ".", "output", ".", "get", "(", "value", "[", "c", "]", ")", ";", "for", "(", "MtasCRMParserFunctionOutput", "listItem", ":", "list", ")", "{", "functionOutputList", ".", "add", "(", "listItem", ".", "create", "(", "value", "[", "c", "]", ")", ")", ";", "}", "}", "if", "(", "!", "checkedEmpty", "&&", "function", ".", "output", ".", "containsKey", "(", "\"\"", ")", ")", "{", "ArrayList", "<", "MtasCRMParserFunctionOutput", ">", "list", "=", "function", ".", "output", ".", "get", "(", "\"\"", ")", ";", "for", "(", "MtasCRMParserFunctionOutput", "listItem", ":", "list", ")", "{", "functionOutputList", ".", "add", "(", "listItem", ".", "create", "(", "value", "[", "c", "]", ")", ")", ";", "}", "}", "}", "}", "}" ]
Process functions. @param name the name @param text the text @param type the type @param functionOutputList the function output list
[ "Process", "functions", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/analysis/parser/MtasCRMParser.java#L793-L824
train
meertensinstituut/mtas
src/main/java/mtas/analysis/parser/MtasCRMParser.java
MtasCRMParser.printConfigTypes
private String printConfigTypes( HashMap<?, MtasParserType<MtasParserMapping<?>>> types) { StringBuilder text = new StringBuilder(); for (Entry<?, MtasParserType<MtasParserMapping<?>>> entry : types .entrySet()) { text.append("- " + entry.getKey() + ": " + entry.getValue().items.size() + " mapping(s)\n"); for (int i = 0; i < entry.getValue().items.size(); i++) { text.append("\t" + entry.getValue().items.get(i) + "\n"); } } return text.toString(); }
java
private String printConfigTypes( HashMap<?, MtasParserType<MtasParserMapping<?>>> types) { StringBuilder text = new StringBuilder(); for (Entry<?, MtasParserType<MtasParserMapping<?>>> entry : types .entrySet()) { text.append("- " + entry.getKey() + ": " + entry.getValue().items.size() + " mapping(s)\n"); for (int i = 0; i < entry.getValue().items.size(); i++) { text.append("\t" + entry.getValue().items.get(i) + "\n"); } } return text.toString(); }
[ "private", "String", "printConfigTypes", "(", "HashMap", "<", "?", ",", "MtasParserType", "<", "MtasParserMapping", "<", "?", ">", ">", ">", "types", ")", "{", "StringBuilder", "text", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "Entry", "<", "?", ",", "MtasParserType", "<", "MtasParserMapping", "<", "?", ">", ">", ">", "entry", ":", "types", ".", "entrySet", "(", ")", ")", "{", "text", ".", "append", "(", "\"- \"", "+", "entry", ".", "getKey", "(", ")", "+", "\": \"", "+", "entry", ".", "getValue", "(", ")", ".", "items", ".", "size", "(", ")", "+", "\" mapping(s)\\n\"", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "entry", ".", "getValue", "(", ")", ".", "items", ".", "size", "(", ")", ";", "i", "++", ")", "{", "text", ".", "append", "(", "\"\\t\"", "+", "entry", ".", "getValue", "(", ")", ".", "items", ".", "get", "(", "i", ")", "+", "\"\\n\"", ")", ";", "}", "}", "return", "text", ".", "toString", "(", ")", ";", "}" ]
Prints the config types. @param types the types @return the string
[ "Prints", "the", "config", "types", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/analysis/parser/MtasCRMParser.java#L847-L859
train
meertensinstituut/mtas
src/main/java/mtas/search/spans/util/MtasIgnoreItem.java
MtasIgnoreItem.getMinStartPosition
public int getMinStartPosition(int docId, int position) throws IOException { if (ignoreSpans != null && docId == currentDocId) { if (position < minimumPosition) { throw new IOException( "Unexpected position, should be >= " + minimumPosition + "!"); } else { computeFullStartPositionMinimum(position); if (minFullStartPosition.containsKey(position)) { return minFullStartPosition.get(position); } else { return 0; } } } else { return 0; } }
java
public int getMinStartPosition(int docId, int position) throws IOException { if (ignoreSpans != null && docId == currentDocId) { if (position < minimumPosition) { throw new IOException( "Unexpected position, should be >= " + minimumPosition + "!"); } else { computeFullStartPositionMinimum(position); if (minFullStartPosition.containsKey(position)) { return minFullStartPosition.get(position); } else { return 0; } } } else { return 0; } }
[ "public", "int", "getMinStartPosition", "(", "int", "docId", ",", "int", "position", ")", "throws", "IOException", "{", "if", "(", "ignoreSpans", "!=", "null", "&&", "docId", "==", "currentDocId", ")", "{", "if", "(", "position", "<", "minimumPosition", ")", "{", "throw", "new", "IOException", "(", "\"Unexpected position, should be >= \"", "+", "minimumPosition", "+", "\"!\"", ")", ";", "}", "else", "{", "computeFullStartPositionMinimum", "(", "position", ")", ";", "if", "(", "minFullStartPosition", ".", "containsKey", "(", "position", ")", ")", "{", "return", "minFullStartPosition", ".", "get", "(", "position", ")", ";", "}", "else", "{", "return", "0", ";", "}", "}", "}", "else", "{", "return", "0", ";", "}", "}" ]
Gets the min start position. @param docId the doc id @param position the position @return the min start position @throws IOException Signals that an I/O exception has occurred.
[ "Gets", "the", "min", "start", "position", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/search/spans/util/MtasIgnoreItem.java#L118-L134
train
meertensinstituut/mtas
src/main/java/mtas/search/spans/util/MtasIgnoreItem.java
MtasIgnoreItem.getMaxEndPosition
public int getMaxEndPosition(int docId, int position) throws IOException { if (ignoreSpans != null && docId == currentDocId) { if (position < minimumPosition) { throw new IOException( "Unexpected position, should be >= " + minimumPosition + "!"); } computeFullEndPositionList(position); if (maxFullEndPosition.containsKey(position)) { return maxFullEndPosition.get(position); } else { return 0; } } else { return 0; } }
java
public int getMaxEndPosition(int docId, int position) throws IOException { if (ignoreSpans != null && docId == currentDocId) { if (position < minimumPosition) { throw new IOException( "Unexpected position, should be >= " + minimumPosition + "!"); } computeFullEndPositionList(position); if (maxFullEndPosition.containsKey(position)) { return maxFullEndPosition.get(position); } else { return 0; } } else { return 0; } }
[ "public", "int", "getMaxEndPosition", "(", "int", "docId", ",", "int", "position", ")", "throws", "IOException", "{", "if", "(", "ignoreSpans", "!=", "null", "&&", "docId", "==", "currentDocId", ")", "{", "if", "(", "position", "<", "minimumPosition", ")", "{", "throw", "new", "IOException", "(", "\"Unexpected position, should be >= \"", "+", "minimumPosition", "+", "\"!\"", ")", ";", "}", "computeFullEndPositionList", "(", "position", ")", ";", "if", "(", "maxFullEndPosition", ".", "containsKey", "(", "position", ")", ")", "{", "return", "maxFullEndPosition", ".", "get", "(", "position", ")", ";", "}", "else", "{", "return", "0", ";", "}", "}", "else", "{", "return", "0", ";", "}", "}" ]
Gets the max end position. @param docId the doc id @param position the position @return the max end position @throws IOException Signals that an I/O exception has occurred.
[ "Gets", "the", "max", "end", "position", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/search/spans/util/MtasIgnoreItem.java#L144-L159
train
meertensinstituut/mtas
src/main/java/mtas/search/spans/util/MtasIgnoreItem.java
MtasIgnoreItem.getFullEndPositionList
public Set<Integer> getFullEndPositionList(int docId, int position) throws IOException { if (ignoreSpans != null && docId == currentDocId) { if (position < minimumPosition) { throw new IOException( "Unexpected startPosition, should be >= " + minimumPosition + "!"); } else { computeFullEndPositionList(position); return fullEndPositionList.get(position); } } else { return null; } }
java
public Set<Integer> getFullEndPositionList(int docId, int position) throws IOException { if (ignoreSpans != null && docId == currentDocId) { if (position < minimumPosition) { throw new IOException( "Unexpected startPosition, should be >= " + minimumPosition + "!"); } else { computeFullEndPositionList(position); return fullEndPositionList.get(position); } } else { return null; } }
[ "public", "Set", "<", "Integer", ">", "getFullEndPositionList", "(", "int", "docId", ",", "int", "position", ")", "throws", "IOException", "{", "if", "(", "ignoreSpans", "!=", "null", "&&", "docId", "==", "currentDocId", ")", "{", "if", "(", "position", "<", "minimumPosition", ")", "{", "throw", "new", "IOException", "(", "\"Unexpected startPosition, should be >= \"", "+", "minimumPosition", "+", "\"!\"", ")", ";", "}", "else", "{", "computeFullEndPositionList", "(", "position", ")", ";", "return", "fullEndPositionList", ".", "get", "(", "position", ")", ";", "}", "}", "else", "{", "return", "null", ";", "}", "}" ]
Gets the full end position list. @param docId the doc id @param position the position @return the full end position list @throws IOException Signals that an I/O exception has occurred.
[ "Gets", "the", "full", "end", "position", "list", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/search/spans/util/MtasIgnoreItem.java#L169-L182
train
meertensinstituut/mtas
src/main/java/mtas/search/spans/util/MtasIgnoreItem.java
MtasIgnoreItem.computeFullStartPositionMinimum
private void computeFullStartPositionMinimum(int position) throws IOException { if (ignoreSpans != null && !minFullStartPosition.containsKey(position)) { HashSet<Integer> list = baseStartPositionList.get(position); HashSet<Integer> newList = new HashSet<>(); int minimumStartPosition = position; while (list != null && !list.isEmpty()) { newList.clear(); for (int startPosition : list) { if (minFullStartPosition.containsKey(startPosition)) { minimumStartPosition = Math.min(minimumStartPosition, minFullStartPosition.get(startPosition)); } else if (baseStartPositionList.containsKey(startPosition)) { newList.addAll(baseStartPositionList.get(startPosition)); } else { if (startPosition < minimumStartPosition) { minimumStartPosition = startPosition; } } } list.clear(); list.addAll(newList); } minFullStartPosition.put(position, minimumStartPosition); } }
java
private void computeFullStartPositionMinimum(int position) throws IOException { if (ignoreSpans != null && !minFullStartPosition.containsKey(position)) { HashSet<Integer> list = baseStartPositionList.get(position); HashSet<Integer> newList = new HashSet<>(); int minimumStartPosition = position; while (list != null && !list.isEmpty()) { newList.clear(); for (int startPosition : list) { if (minFullStartPosition.containsKey(startPosition)) { minimumStartPosition = Math.min(minimumStartPosition, minFullStartPosition.get(startPosition)); } else if (baseStartPositionList.containsKey(startPosition)) { newList.addAll(baseStartPositionList.get(startPosition)); } else { if (startPosition < minimumStartPosition) { minimumStartPosition = startPosition; } } } list.clear(); list.addAll(newList); } minFullStartPosition.put(position, minimumStartPosition); } }
[ "private", "void", "computeFullStartPositionMinimum", "(", "int", "position", ")", "throws", "IOException", "{", "if", "(", "ignoreSpans", "!=", "null", "&&", "!", "minFullStartPosition", ".", "containsKey", "(", "position", ")", ")", "{", "HashSet", "<", "Integer", ">", "list", "=", "baseStartPositionList", ".", "get", "(", "position", ")", ";", "HashSet", "<", "Integer", ">", "newList", "=", "new", "HashSet", "<>", "(", ")", ";", "int", "minimumStartPosition", "=", "position", ";", "while", "(", "list", "!=", "null", "&&", "!", "list", ".", "isEmpty", "(", ")", ")", "{", "newList", ".", "clear", "(", ")", ";", "for", "(", "int", "startPosition", ":", "list", ")", "{", "if", "(", "minFullStartPosition", ".", "containsKey", "(", "startPosition", ")", ")", "{", "minimumStartPosition", "=", "Math", ".", "min", "(", "minimumStartPosition", ",", "minFullStartPosition", ".", "get", "(", "startPosition", ")", ")", ";", "}", "else", "if", "(", "baseStartPositionList", ".", "containsKey", "(", "startPosition", ")", ")", "{", "newList", ".", "addAll", "(", "baseStartPositionList", ".", "get", "(", "startPosition", ")", ")", ";", "}", "else", "{", "if", "(", "startPosition", "<", "minimumStartPosition", ")", "{", "minimumStartPosition", "=", "startPosition", ";", "}", "}", "}", "list", ".", "clear", "(", ")", ";", "list", ".", "addAll", "(", "newList", ")", ";", "}", "minFullStartPosition", ".", "put", "(", "position", ",", "minimumStartPosition", ")", ";", "}", "}" ]
Compute full start position minimum. @param position the position @throws IOException Signals that an I/O exception has occurred.
[ "Compute", "full", "start", "position", "minimum", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/search/spans/util/MtasIgnoreItem.java#L190-L215
train
meertensinstituut/mtas
src/main/java/mtas/search/spans/util/MtasIgnoreItem.java
MtasIgnoreItem.computeFullEndPositionList
private void computeFullEndPositionList(int position) throws IOException { if (ignoreSpans != null && !fullEndPositionList.containsKey(position)) { // initial fill moveTo(position); HashSet<Integer> list = baseEndPositionList.get(position); if (list != null && !list.isEmpty()) { int maxEndPosition = maxBaseEndPosition.get(position); HashSet<Integer> checkList = new HashSet<>(); HashSet<Integer> subCheckList = new HashSet<>(); checkList.addAll(list); int depth = 1; while (!checkList.isEmpty()) { if (depth > maximumIgnoreLength) { checkList.clear(); subCheckList.clear(); throw new IOException("too many successive ignores, maximum is " + maximumIgnoreLength); } else { for (Integer checkItem : checkList) { if (fullEndPositionList.get(checkItem) != null) { list.addAll(fullEndPositionList.get(checkItem)); maxEndPosition = Math.max(maxEndPosition, maxFullEndPosition.get(checkItem)); } else { moveTo(checkItem); if (baseEndPositionList.containsKey(checkItem)) { list.addAll(baseEndPositionList.get(checkItem)); maxEndPosition = Math.max(maxEndPosition, maxBaseEndPosition.get(checkItem)); subCheckList.addAll(baseEndPositionList.get(checkItem)); } else { // ready for checkItem } } } checkList.clear(); checkList.addAll(subCheckList); subCheckList.clear(); depth++; } } fullEndPositionList.put(position, list); maxFullEndPosition.put(position, (maxEndPosition - position)); } else { fullEndPositionList.put(position, null); maxFullEndPosition.put(position, 0); } } }
java
private void computeFullEndPositionList(int position) throws IOException { if (ignoreSpans != null && !fullEndPositionList.containsKey(position)) { // initial fill moveTo(position); HashSet<Integer> list = baseEndPositionList.get(position); if (list != null && !list.isEmpty()) { int maxEndPosition = maxBaseEndPosition.get(position); HashSet<Integer> checkList = new HashSet<>(); HashSet<Integer> subCheckList = new HashSet<>(); checkList.addAll(list); int depth = 1; while (!checkList.isEmpty()) { if (depth > maximumIgnoreLength) { checkList.clear(); subCheckList.clear(); throw new IOException("too many successive ignores, maximum is " + maximumIgnoreLength); } else { for (Integer checkItem : checkList) { if (fullEndPositionList.get(checkItem) != null) { list.addAll(fullEndPositionList.get(checkItem)); maxEndPosition = Math.max(maxEndPosition, maxFullEndPosition.get(checkItem)); } else { moveTo(checkItem); if (baseEndPositionList.containsKey(checkItem)) { list.addAll(baseEndPositionList.get(checkItem)); maxEndPosition = Math.max(maxEndPosition, maxBaseEndPosition.get(checkItem)); subCheckList.addAll(baseEndPositionList.get(checkItem)); } else { // ready for checkItem } } } checkList.clear(); checkList.addAll(subCheckList); subCheckList.clear(); depth++; } } fullEndPositionList.put(position, list); maxFullEndPosition.put(position, (maxEndPosition - position)); } else { fullEndPositionList.put(position, null); maxFullEndPosition.put(position, 0); } } }
[ "private", "void", "computeFullEndPositionList", "(", "int", "position", ")", "throws", "IOException", "{", "if", "(", "ignoreSpans", "!=", "null", "&&", "!", "fullEndPositionList", ".", "containsKey", "(", "position", ")", ")", "{", "// initial fill", "moveTo", "(", "position", ")", ";", "HashSet", "<", "Integer", ">", "list", "=", "baseEndPositionList", ".", "get", "(", "position", ")", ";", "if", "(", "list", "!=", "null", "&&", "!", "list", ".", "isEmpty", "(", ")", ")", "{", "int", "maxEndPosition", "=", "maxBaseEndPosition", ".", "get", "(", "position", ")", ";", "HashSet", "<", "Integer", ">", "checkList", "=", "new", "HashSet", "<>", "(", ")", ";", "HashSet", "<", "Integer", ">", "subCheckList", "=", "new", "HashSet", "<>", "(", ")", ";", "checkList", ".", "addAll", "(", "list", ")", ";", "int", "depth", "=", "1", ";", "while", "(", "!", "checkList", ".", "isEmpty", "(", ")", ")", "{", "if", "(", "depth", ">", "maximumIgnoreLength", ")", "{", "checkList", ".", "clear", "(", ")", ";", "subCheckList", ".", "clear", "(", ")", ";", "throw", "new", "IOException", "(", "\"too many successive ignores, maximum is \"", "+", "maximumIgnoreLength", ")", ";", "}", "else", "{", "for", "(", "Integer", "checkItem", ":", "checkList", ")", "{", "if", "(", "fullEndPositionList", ".", "get", "(", "checkItem", ")", "!=", "null", ")", "{", "list", ".", "addAll", "(", "fullEndPositionList", ".", "get", "(", "checkItem", ")", ")", ";", "maxEndPosition", "=", "Math", ".", "max", "(", "maxEndPosition", ",", "maxFullEndPosition", ".", "get", "(", "checkItem", ")", ")", ";", "}", "else", "{", "moveTo", "(", "checkItem", ")", ";", "if", "(", "baseEndPositionList", ".", "containsKey", "(", "checkItem", ")", ")", "{", "list", ".", "addAll", "(", "baseEndPositionList", ".", "get", "(", "checkItem", ")", ")", ";", "maxEndPosition", "=", "Math", ".", "max", "(", "maxEndPosition", ",", "maxBaseEndPosition", ".", "get", "(", "checkItem", ")", ")", ";", "subCheckList", ".", "addAll", "(", "baseEndPositionList", ".", "get", "(", "checkItem", ")", ")", ";", "}", "else", "{", "// ready for checkItem", "}", "}", "}", "checkList", ".", "clear", "(", ")", ";", "checkList", ".", "addAll", "(", "subCheckList", ")", ";", "subCheckList", ".", "clear", "(", ")", ";", "depth", "++", ";", "}", "}", "fullEndPositionList", ".", "put", "(", "position", ",", "list", ")", ";", "maxFullEndPosition", ".", "put", "(", "position", ",", "(", "maxEndPosition", "-", "position", ")", ")", ";", "}", "else", "{", "fullEndPositionList", ".", "put", "(", "position", ",", "null", ")", ";", "maxFullEndPosition", ".", "put", "(", "position", ",", "0", ")", ";", "}", "}", "}" ]
Compute full end position list. @param position the position @throws IOException Signals that an I/O exception has occurred.
[ "Compute", "full", "end", "position", "list", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/search/spans/util/MtasIgnoreItem.java#L223-L271
train
meertensinstituut/mtas
src/main/java/mtas/search/spans/util/MtasIgnoreItem.java
MtasIgnoreItem.moveTo
private void moveTo(int position) { while (position >= currentPosition) { try { currentPosition = ignoreSpans.nextStartPosition(); if (currentPosition != Spans.NO_MORE_POSITIONS && currentPosition >= minimumPosition) { if (!baseEndPositionList.containsKey(currentPosition)) { baseEndPositionList.put(currentPosition, new HashSet<Integer>()); maxBaseEndPosition.put(currentPosition, currentPosition); } else { maxBaseEndPosition.put(currentPosition, Math.max(maxBaseEndPosition.get(currentPosition), ignoreSpans.endPosition())); } if (!baseStartPositionList.containsKey(ignoreSpans.endPosition())) { baseStartPositionList.put(ignoreSpans.endPosition(), new HashSet<Integer>()); minBaseStartPosition.put(ignoreSpans.endPosition(), ignoreSpans.endPosition()); } else { minBaseStartPosition.put(ignoreSpans.endPosition(), Math.min(minBaseStartPosition.get(ignoreSpans.endPosition()), currentPosition)); } baseStartPositionList.get(ignoreSpans.endPosition()) .add(currentPosition); baseEndPositionList.get(currentPosition) .add(ignoreSpans.endPosition()); } } catch (IOException e) { log.debug(e); currentPosition = Spans.NO_MORE_POSITIONS; break; } } }
java
private void moveTo(int position) { while (position >= currentPosition) { try { currentPosition = ignoreSpans.nextStartPosition(); if (currentPosition != Spans.NO_MORE_POSITIONS && currentPosition >= minimumPosition) { if (!baseEndPositionList.containsKey(currentPosition)) { baseEndPositionList.put(currentPosition, new HashSet<Integer>()); maxBaseEndPosition.put(currentPosition, currentPosition); } else { maxBaseEndPosition.put(currentPosition, Math.max(maxBaseEndPosition.get(currentPosition), ignoreSpans.endPosition())); } if (!baseStartPositionList.containsKey(ignoreSpans.endPosition())) { baseStartPositionList.put(ignoreSpans.endPosition(), new HashSet<Integer>()); minBaseStartPosition.put(ignoreSpans.endPosition(), ignoreSpans.endPosition()); } else { minBaseStartPosition.put(ignoreSpans.endPosition(), Math.min(minBaseStartPosition.get(ignoreSpans.endPosition()), currentPosition)); } baseStartPositionList.get(ignoreSpans.endPosition()) .add(currentPosition); baseEndPositionList.get(currentPosition) .add(ignoreSpans.endPosition()); } } catch (IOException e) { log.debug(e); currentPosition = Spans.NO_MORE_POSITIONS; break; } } }
[ "private", "void", "moveTo", "(", "int", "position", ")", "{", "while", "(", "position", ">=", "currentPosition", ")", "{", "try", "{", "currentPosition", "=", "ignoreSpans", ".", "nextStartPosition", "(", ")", ";", "if", "(", "currentPosition", "!=", "Spans", ".", "NO_MORE_POSITIONS", "&&", "currentPosition", ">=", "minimumPosition", ")", "{", "if", "(", "!", "baseEndPositionList", ".", "containsKey", "(", "currentPosition", ")", ")", "{", "baseEndPositionList", ".", "put", "(", "currentPosition", ",", "new", "HashSet", "<", "Integer", ">", "(", ")", ")", ";", "maxBaseEndPosition", ".", "put", "(", "currentPosition", ",", "currentPosition", ")", ";", "}", "else", "{", "maxBaseEndPosition", ".", "put", "(", "currentPosition", ",", "Math", ".", "max", "(", "maxBaseEndPosition", ".", "get", "(", "currentPosition", ")", ",", "ignoreSpans", ".", "endPosition", "(", ")", ")", ")", ";", "}", "if", "(", "!", "baseStartPositionList", ".", "containsKey", "(", "ignoreSpans", ".", "endPosition", "(", ")", ")", ")", "{", "baseStartPositionList", ".", "put", "(", "ignoreSpans", ".", "endPosition", "(", ")", ",", "new", "HashSet", "<", "Integer", ">", "(", ")", ")", ";", "minBaseStartPosition", ".", "put", "(", "ignoreSpans", ".", "endPosition", "(", ")", ",", "ignoreSpans", ".", "endPosition", "(", ")", ")", ";", "}", "else", "{", "minBaseStartPosition", ".", "put", "(", "ignoreSpans", ".", "endPosition", "(", ")", ",", "Math", ".", "min", "(", "minBaseStartPosition", ".", "get", "(", "ignoreSpans", ".", "endPosition", "(", ")", ")", ",", "currentPosition", ")", ")", ";", "}", "baseStartPositionList", ".", "get", "(", "ignoreSpans", ".", "endPosition", "(", ")", ")", ".", "add", "(", "currentPosition", ")", ";", "baseEndPositionList", ".", "get", "(", "currentPosition", ")", ".", "add", "(", "ignoreSpans", ".", "endPosition", "(", ")", ")", ";", "}", "}", "catch", "(", "IOException", "e", ")", "{", "log", ".", "debug", "(", "e", ")", ";", "currentPosition", "=", "Spans", ".", "NO_MORE_POSITIONS", ";", "break", ";", "}", "}", "}" ]
Move to. @param position the position
[ "Move", "to", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/search/spans/util/MtasIgnoreItem.java#L278-L313
train
meertensinstituut/mtas
src/main/java/mtas/search/spans/util/MtasIgnoreItem.java
MtasIgnoreItem.removeBefore
public void removeBefore(int docId, int position) { if (ignoreSpans != null && docId == currentDocId) { baseStartPositionList.entrySet() .removeIf(entry -> entry.getKey() < position); baseEndPositionList.entrySet() .removeIf(entry -> entry.getKey() < position); fullEndPositionList.entrySet() .removeIf(entry -> entry.getKey() < position); minBaseStartPosition.entrySet() .removeIf(entry -> entry.getKey() < position); maxBaseEndPosition.entrySet() .removeIf(entry -> entry.getKey() < position); minFullStartPosition.entrySet() .removeIf(entry -> entry.getKey() < position); maxFullEndPosition.entrySet() .removeIf(entry -> entry.getKey() < position); if (minimumPosition < position) { minimumPosition = position; } if (currentPosition < position) { currentPosition = position; } } }
java
public void removeBefore(int docId, int position) { if (ignoreSpans != null && docId == currentDocId) { baseStartPositionList.entrySet() .removeIf(entry -> entry.getKey() < position); baseEndPositionList.entrySet() .removeIf(entry -> entry.getKey() < position); fullEndPositionList.entrySet() .removeIf(entry -> entry.getKey() < position); minBaseStartPosition.entrySet() .removeIf(entry -> entry.getKey() < position); maxBaseEndPosition.entrySet() .removeIf(entry -> entry.getKey() < position); minFullStartPosition.entrySet() .removeIf(entry -> entry.getKey() < position); maxFullEndPosition.entrySet() .removeIf(entry -> entry.getKey() < position); if (minimumPosition < position) { minimumPosition = position; } if (currentPosition < position) { currentPosition = position; } } }
[ "public", "void", "removeBefore", "(", "int", "docId", ",", "int", "position", ")", "{", "if", "(", "ignoreSpans", "!=", "null", "&&", "docId", "==", "currentDocId", ")", "{", "baseStartPositionList", ".", "entrySet", "(", ")", ".", "removeIf", "(", "entry", "->", "entry", ".", "getKey", "(", ")", "<", "position", ")", ";", "baseEndPositionList", ".", "entrySet", "(", ")", ".", "removeIf", "(", "entry", "->", "entry", ".", "getKey", "(", ")", "<", "position", ")", ";", "fullEndPositionList", ".", "entrySet", "(", ")", ".", "removeIf", "(", "entry", "->", "entry", ".", "getKey", "(", ")", "<", "position", ")", ";", "minBaseStartPosition", ".", "entrySet", "(", ")", ".", "removeIf", "(", "entry", "->", "entry", ".", "getKey", "(", ")", "<", "position", ")", ";", "maxBaseEndPosition", ".", "entrySet", "(", ")", ".", "removeIf", "(", "entry", "->", "entry", ".", "getKey", "(", ")", "<", "position", ")", ";", "minFullStartPosition", ".", "entrySet", "(", ")", ".", "removeIf", "(", "entry", "->", "entry", ".", "getKey", "(", ")", "<", "position", ")", ";", "maxFullEndPosition", ".", "entrySet", "(", ")", ".", "removeIf", "(", "entry", "->", "entry", ".", "getKey", "(", ")", "<", "position", ")", ";", "if", "(", "minimumPosition", "<", "position", ")", "{", "minimumPosition", "=", "position", ";", "}", "if", "(", "currentPosition", "<", "position", ")", "{", "currentPosition", "=", "position", ";", "}", "}", "}" ]
Removes the before. @param docId the doc id @param position the position
[ "Removes", "the", "before", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/search/spans/util/MtasIgnoreItem.java#L321-L344
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnvserver_authenticationlocalpolicy_binding.java
vpnvserver_authenticationlocalpolicy_binding.get
public static vpnvserver_authenticationlocalpolicy_binding[] get(nitro_service service, String name) throws Exception{ vpnvserver_authenticationlocalpolicy_binding obj = new vpnvserver_authenticationlocalpolicy_binding(); obj.set_name(name); vpnvserver_authenticationlocalpolicy_binding response[] = (vpnvserver_authenticationlocalpolicy_binding[]) obj.get_resources(service); return response; }
java
public static vpnvserver_authenticationlocalpolicy_binding[] get(nitro_service service, String name) throws Exception{ vpnvserver_authenticationlocalpolicy_binding obj = new vpnvserver_authenticationlocalpolicy_binding(); obj.set_name(name); vpnvserver_authenticationlocalpolicy_binding response[] = (vpnvserver_authenticationlocalpolicy_binding[]) obj.get_resources(service); return response; }
[ "public", "static", "vpnvserver_authenticationlocalpolicy_binding", "[", "]", "get", "(", "nitro_service", "service", ",", "String", "name", ")", "throws", "Exception", "{", "vpnvserver_authenticationlocalpolicy_binding", "obj", "=", "new", "vpnvserver_authenticationlocalpolicy_binding", "(", ")", ";", "obj", ".", "set_name", "(", "name", ")", ";", "vpnvserver_authenticationlocalpolicy_binding", "response", "[", "]", "=", "(", "vpnvserver_authenticationlocalpolicy_binding", "[", "]", ")", "obj", ".", "get_resources", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch vpnvserver_authenticationlocalpolicy_binding resources of given name .
[ "Use", "this", "API", "to", "fetch", "vpnvserver_authenticationlocalpolicy_binding", "resources", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnvserver_authenticationlocalpolicy_binding.java#L326-L331
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/gslb/gslbvserver.java
gslbvserver.add
public static base_response add(nitro_service client, gslbvserver resource) throws Exception { gslbvserver addresource = new gslbvserver(); addresource.name = resource.name; addresource.servicetype = resource.servicetype; addresource.iptype = resource.iptype; addresource.dnsrecordtype = resource.dnsrecordtype; addresource.lbmethod = resource.lbmethod; addresource.backupsessiontimeout = resource.backupsessiontimeout; addresource.backuplbmethod = resource.backuplbmethod; addresource.netmask = resource.netmask; addresource.v6netmasklen = resource.v6netmasklen; addresource.tolerance = resource.tolerance; addresource.persistencetype = resource.persistencetype; addresource.persistenceid = resource.persistenceid; addresource.persistmask = resource.persistmask; addresource.v6persistmasklen = resource.v6persistmasklen; addresource.timeout = resource.timeout; addresource.edr = resource.edr; addresource.mir = resource.mir; addresource.disableprimaryondown = resource.disableprimaryondown; addresource.dynamicweight = resource.dynamicweight; addresource.state = resource.state; addresource.considereffectivestate = resource.considereffectivestate; addresource.comment = resource.comment; addresource.somethod = resource.somethod; addresource.sopersistence = resource.sopersistence; addresource.sopersistencetimeout = resource.sopersistencetimeout; addresource.sothreshold = resource.sothreshold; addresource.sobackupaction = resource.sobackupaction; addresource.appflowlog = resource.appflowlog; return addresource.add_resource(client); }
java
public static base_response add(nitro_service client, gslbvserver resource) throws Exception { gslbvserver addresource = new gslbvserver(); addresource.name = resource.name; addresource.servicetype = resource.servicetype; addresource.iptype = resource.iptype; addresource.dnsrecordtype = resource.dnsrecordtype; addresource.lbmethod = resource.lbmethod; addresource.backupsessiontimeout = resource.backupsessiontimeout; addresource.backuplbmethod = resource.backuplbmethod; addresource.netmask = resource.netmask; addresource.v6netmasklen = resource.v6netmasklen; addresource.tolerance = resource.tolerance; addresource.persistencetype = resource.persistencetype; addresource.persistenceid = resource.persistenceid; addresource.persistmask = resource.persistmask; addresource.v6persistmasklen = resource.v6persistmasklen; addresource.timeout = resource.timeout; addresource.edr = resource.edr; addresource.mir = resource.mir; addresource.disableprimaryondown = resource.disableprimaryondown; addresource.dynamicweight = resource.dynamicweight; addresource.state = resource.state; addresource.considereffectivestate = resource.considereffectivestate; addresource.comment = resource.comment; addresource.somethod = resource.somethod; addresource.sopersistence = resource.sopersistence; addresource.sopersistencetimeout = resource.sopersistencetimeout; addresource.sothreshold = resource.sothreshold; addresource.sobackupaction = resource.sobackupaction; addresource.appflowlog = resource.appflowlog; return addresource.add_resource(client); }
[ "public", "static", "base_response", "add", "(", "nitro_service", "client", ",", "gslbvserver", "resource", ")", "throws", "Exception", "{", "gslbvserver", "addresource", "=", "new", "gslbvserver", "(", ")", ";", "addresource", ".", "name", "=", "resource", ".", "name", ";", "addresource", ".", "servicetype", "=", "resource", ".", "servicetype", ";", "addresource", ".", "iptype", "=", "resource", ".", "iptype", ";", "addresource", ".", "dnsrecordtype", "=", "resource", ".", "dnsrecordtype", ";", "addresource", ".", "lbmethod", "=", "resource", ".", "lbmethod", ";", "addresource", ".", "backupsessiontimeout", "=", "resource", ".", "backupsessiontimeout", ";", "addresource", ".", "backuplbmethod", "=", "resource", ".", "backuplbmethod", ";", "addresource", ".", "netmask", "=", "resource", ".", "netmask", ";", "addresource", ".", "v6netmasklen", "=", "resource", ".", "v6netmasklen", ";", "addresource", ".", "tolerance", "=", "resource", ".", "tolerance", ";", "addresource", ".", "persistencetype", "=", "resource", ".", "persistencetype", ";", "addresource", ".", "persistenceid", "=", "resource", ".", "persistenceid", ";", "addresource", ".", "persistmask", "=", "resource", ".", "persistmask", ";", "addresource", ".", "v6persistmasklen", "=", "resource", ".", "v6persistmasklen", ";", "addresource", ".", "timeout", "=", "resource", ".", "timeout", ";", "addresource", ".", "edr", "=", "resource", ".", "edr", ";", "addresource", ".", "mir", "=", "resource", ".", "mir", ";", "addresource", ".", "disableprimaryondown", "=", "resource", ".", "disableprimaryondown", ";", "addresource", ".", "dynamicweight", "=", "resource", ".", "dynamicweight", ";", "addresource", ".", "state", "=", "resource", ".", "state", ";", "addresource", ".", "considereffectivestate", "=", "resource", ".", "considereffectivestate", ";", "addresource", ".", "comment", "=", "resource", ".", "comment", ";", "addresource", ".", "somethod", "=", "resource", ".", "somethod", ";", "addresource", ".", "sopersistence", "=", "resource", ".", "sopersistence", ";", "addresource", ".", "sopersistencetimeout", "=", "resource", ".", "sopersistencetimeout", ";", "addresource", ".", "sothreshold", "=", "resource", ".", "sothreshold", ";", "addresource", ".", "sobackupaction", "=", "resource", ".", "sobackupaction", ";", "addresource", ".", "appflowlog", "=", "resource", ".", "appflowlog", ";", "return", "addresource", ".", "add_resource", "(", "client", ")", ";", "}" ]
Use this API to add gslbvserver.
[ "Use", "this", "API", "to", "add", "gslbvserver", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/gslb/gslbvserver.java#L1093-L1124
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/gslb/gslbvserver.java
gslbvserver.add
public static base_responses add(nitro_service client, gslbvserver resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { gslbvserver addresources[] = new gslbvserver[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new gslbvserver(); addresources[i].name = resources[i].name; addresources[i].servicetype = resources[i].servicetype; addresources[i].iptype = resources[i].iptype; addresources[i].dnsrecordtype = resources[i].dnsrecordtype; addresources[i].lbmethod = resources[i].lbmethod; addresources[i].backupsessiontimeout = resources[i].backupsessiontimeout; addresources[i].backuplbmethod = resources[i].backuplbmethod; addresources[i].netmask = resources[i].netmask; addresources[i].v6netmasklen = resources[i].v6netmasklen; addresources[i].tolerance = resources[i].tolerance; addresources[i].persistencetype = resources[i].persistencetype; addresources[i].persistenceid = resources[i].persistenceid; addresources[i].persistmask = resources[i].persistmask; addresources[i].v6persistmasklen = resources[i].v6persistmasklen; addresources[i].timeout = resources[i].timeout; addresources[i].edr = resources[i].edr; addresources[i].mir = resources[i].mir; addresources[i].disableprimaryondown = resources[i].disableprimaryondown; addresources[i].dynamicweight = resources[i].dynamicweight; addresources[i].state = resources[i].state; addresources[i].considereffectivestate = resources[i].considereffectivestate; addresources[i].comment = resources[i].comment; addresources[i].somethod = resources[i].somethod; addresources[i].sopersistence = resources[i].sopersistence; addresources[i].sopersistencetimeout = resources[i].sopersistencetimeout; addresources[i].sothreshold = resources[i].sothreshold; addresources[i].sobackupaction = resources[i].sobackupaction; addresources[i].appflowlog = resources[i].appflowlog; } result = add_bulk_request(client, addresources); } return result; }
java
public static base_responses add(nitro_service client, gslbvserver resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { gslbvserver addresources[] = new gslbvserver[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new gslbvserver(); addresources[i].name = resources[i].name; addresources[i].servicetype = resources[i].servicetype; addresources[i].iptype = resources[i].iptype; addresources[i].dnsrecordtype = resources[i].dnsrecordtype; addresources[i].lbmethod = resources[i].lbmethod; addresources[i].backupsessiontimeout = resources[i].backupsessiontimeout; addresources[i].backuplbmethod = resources[i].backuplbmethod; addresources[i].netmask = resources[i].netmask; addresources[i].v6netmasklen = resources[i].v6netmasklen; addresources[i].tolerance = resources[i].tolerance; addresources[i].persistencetype = resources[i].persistencetype; addresources[i].persistenceid = resources[i].persistenceid; addresources[i].persistmask = resources[i].persistmask; addresources[i].v6persistmasklen = resources[i].v6persistmasklen; addresources[i].timeout = resources[i].timeout; addresources[i].edr = resources[i].edr; addresources[i].mir = resources[i].mir; addresources[i].disableprimaryondown = resources[i].disableprimaryondown; addresources[i].dynamicweight = resources[i].dynamicweight; addresources[i].state = resources[i].state; addresources[i].considereffectivestate = resources[i].considereffectivestate; addresources[i].comment = resources[i].comment; addresources[i].somethod = resources[i].somethod; addresources[i].sopersistence = resources[i].sopersistence; addresources[i].sopersistencetimeout = resources[i].sopersistencetimeout; addresources[i].sothreshold = resources[i].sothreshold; addresources[i].sobackupaction = resources[i].sobackupaction; addresources[i].appflowlog = resources[i].appflowlog; } result = add_bulk_request(client, addresources); } return result; }
[ "public", "static", "base_responses", "add", "(", "nitro_service", "client", ",", "gslbvserver", "resources", "[", "]", ")", "throws", "Exception", "{", "base_responses", "result", "=", "null", ";", "if", "(", "resources", "!=", "null", "&&", "resources", ".", "length", ">", "0", ")", "{", "gslbvserver", "addresources", "[", "]", "=", "new", "gslbvserver", "[", "resources", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "resources", ".", "length", ";", "i", "++", ")", "{", "addresources", "[", "i", "]", "=", "new", "gslbvserver", "(", ")", ";", "addresources", "[", "i", "]", ".", "name", "=", "resources", "[", "i", "]", ".", "name", ";", "addresources", "[", "i", "]", ".", "servicetype", "=", "resources", "[", "i", "]", ".", "servicetype", ";", "addresources", "[", "i", "]", ".", "iptype", "=", "resources", "[", "i", "]", ".", "iptype", ";", "addresources", "[", "i", "]", ".", "dnsrecordtype", "=", "resources", "[", "i", "]", ".", "dnsrecordtype", ";", "addresources", "[", "i", "]", ".", "lbmethod", "=", "resources", "[", "i", "]", ".", "lbmethod", ";", "addresources", "[", "i", "]", ".", "backupsessiontimeout", "=", "resources", "[", "i", "]", ".", "backupsessiontimeout", ";", "addresources", "[", "i", "]", ".", "backuplbmethod", "=", "resources", "[", "i", "]", ".", "backuplbmethod", ";", "addresources", "[", "i", "]", ".", "netmask", "=", "resources", "[", "i", "]", ".", "netmask", ";", "addresources", "[", "i", "]", ".", "v6netmasklen", "=", "resources", "[", "i", "]", ".", "v6netmasklen", ";", "addresources", "[", "i", "]", ".", "tolerance", "=", "resources", "[", "i", "]", ".", "tolerance", ";", "addresources", "[", "i", "]", ".", "persistencetype", "=", "resources", "[", "i", "]", ".", "persistencetype", ";", "addresources", "[", "i", "]", ".", "persistenceid", "=", "resources", "[", "i", "]", ".", "persistenceid", ";", "addresources", "[", "i", "]", ".", "persistmask", "=", "resources", "[", "i", "]", ".", "persistmask", ";", "addresources", "[", "i", "]", ".", "v6persistmasklen", "=", "resources", "[", "i", "]", ".", "v6persistmasklen", ";", "addresources", "[", "i", "]", ".", "timeout", "=", "resources", "[", "i", "]", ".", "timeout", ";", "addresources", "[", "i", "]", ".", "edr", "=", "resources", "[", "i", "]", ".", "edr", ";", "addresources", "[", "i", "]", ".", "mir", "=", "resources", "[", "i", "]", ".", "mir", ";", "addresources", "[", "i", "]", ".", "disableprimaryondown", "=", "resources", "[", "i", "]", ".", "disableprimaryondown", ";", "addresources", "[", "i", "]", ".", "dynamicweight", "=", "resources", "[", "i", "]", ".", "dynamicweight", ";", "addresources", "[", "i", "]", ".", "state", "=", "resources", "[", "i", "]", ".", "state", ";", "addresources", "[", "i", "]", ".", "considereffectivestate", "=", "resources", "[", "i", "]", ".", "considereffectivestate", ";", "addresources", "[", "i", "]", ".", "comment", "=", "resources", "[", "i", "]", ".", "comment", ";", "addresources", "[", "i", "]", ".", "somethod", "=", "resources", "[", "i", "]", ".", "somethod", ";", "addresources", "[", "i", "]", ".", "sopersistence", "=", "resources", "[", "i", "]", ".", "sopersistence", ";", "addresources", "[", "i", "]", ".", "sopersistencetimeout", "=", "resources", "[", "i", "]", ".", "sopersistencetimeout", ";", "addresources", "[", "i", "]", ".", "sothreshold", "=", "resources", "[", "i", "]", ".", "sothreshold", ";", "addresources", "[", "i", "]", ".", "sobackupaction", "=", "resources", "[", "i", "]", ".", "sobackupaction", ";", "addresources", "[", "i", "]", ".", "appflowlog", "=", "resources", "[", "i", "]", ".", "appflowlog", ";", "}", "result", "=", "add_bulk_request", "(", "client", ",", "addresources", ")", ";", "}", "return", "result", ";", "}" ]
Use this API to add gslbvserver resources.
[ "Use", "this", "API", "to", "add", "gslbvserver", "resources", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/gslb/gslbvserver.java#L1129-L1167
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/gslb/gslbvserver.java
gslbvserver.update
public static base_response update(nitro_service client, gslbvserver resource) throws Exception { gslbvserver updateresource = new gslbvserver(); updateresource.name = resource.name; updateresource.iptype = resource.iptype; updateresource.dnsrecordtype = resource.dnsrecordtype; updateresource.backupvserver = resource.backupvserver; updateresource.backupsessiontimeout = resource.backupsessiontimeout; updateresource.lbmethod = resource.lbmethod; updateresource.backuplbmethod = resource.backuplbmethod; updateresource.netmask = resource.netmask; updateresource.v6netmasklen = resource.v6netmasklen; updateresource.tolerance = resource.tolerance; updateresource.persistencetype = resource.persistencetype; updateresource.persistenceid = resource.persistenceid; updateresource.persistmask = resource.persistmask; updateresource.v6persistmasklen = resource.v6persistmasklen; updateresource.timeout = resource.timeout; updateresource.edr = resource.edr; updateresource.mir = resource.mir; updateresource.disableprimaryondown = resource.disableprimaryondown; updateresource.dynamicweight = resource.dynamicweight; updateresource.considereffectivestate = resource.considereffectivestate; updateresource.somethod = resource.somethod; updateresource.sopersistence = resource.sopersistence; updateresource.sopersistencetimeout = resource.sopersistencetimeout; updateresource.sothreshold = resource.sothreshold; updateresource.sobackupaction = resource.sobackupaction; updateresource.servicename = resource.servicename; updateresource.weight = resource.weight; updateresource.domainname = resource.domainname; updateresource.ttl = resource.ttl; updateresource.backupip = resource.backupip; updateresource.cookie_domain = resource.cookie_domain; updateresource.cookietimeout = resource.cookietimeout; updateresource.sitedomainttl = resource.sitedomainttl; updateresource.comment = resource.comment; updateresource.appflowlog = resource.appflowlog; return updateresource.update_resource(client); }
java
public static base_response update(nitro_service client, gslbvserver resource) throws Exception { gslbvserver updateresource = new gslbvserver(); updateresource.name = resource.name; updateresource.iptype = resource.iptype; updateresource.dnsrecordtype = resource.dnsrecordtype; updateresource.backupvserver = resource.backupvserver; updateresource.backupsessiontimeout = resource.backupsessiontimeout; updateresource.lbmethod = resource.lbmethod; updateresource.backuplbmethod = resource.backuplbmethod; updateresource.netmask = resource.netmask; updateresource.v6netmasklen = resource.v6netmasklen; updateresource.tolerance = resource.tolerance; updateresource.persistencetype = resource.persistencetype; updateresource.persistenceid = resource.persistenceid; updateresource.persistmask = resource.persistmask; updateresource.v6persistmasklen = resource.v6persistmasklen; updateresource.timeout = resource.timeout; updateresource.edr = resource.edr; updateresource.mir = resource.mir; updateresource.disableprimaryondown = resource.disableprimaryondown; updateresource.dynamicweight = resource.dynamicweight; updateresource.considereffectivestate = resource.considereffectivestate; updateresource.somethod = resource.somethod; updateresource.sopersistence = resource.sopersistence; updateresource.sopersistencetimeout = resource.sopersistencetimeout; updateresource.sothreshold = resource.sothreshold; updateresource.sobackupaction = resource.sobackupaction; updateresource.servicename = resource.servicename; updateresource.weight = resource.weight; updateresource.domainname = resource.domainname; updateresource.ttl = resource.ttl; updateresource.backupip = resource.backupip; updateresource.cookie_domain = resource.cookie_domain; updateresource.cookietimeout = resource.cookietimeout; updateresource.sitedomainttl = resource.sitedomainttl; updateresource.comment = resource.comment; updateresource.appflowlog = resource.appflowlog; return updateresource.update_resource(client); }
[ "public", "static", "base_response", "update", "(", "nitro_service", "client", ",", "gslbvserver", "resource", ")", "throws", "Exception", "{", "gslbvserver", "updateresource", "=", "new", "gslbvserver", "(", ")", ";", "updateresource", ".", "name", "=", "resource", ".", "name", ";", "updateresource", ".", "iptype", "=", "resource", ".", "iptype", ";", "updateresource", ".", "dnsrecordtype", "=", "resource", ".", "dnsrecordtype", ";", "updateresource", ".", "backupvserver", "=", "resource", ".", "backupvserver", ";", "updateresource", ".", "backupsessiontimeout", "=", "resource", ".", "backupsessiontimeout", ";", "updateresource", ".", "lbmethod", "=", "resource", ".", "lbmethod", ";", "updateresource", ".", "backuplbmethod", "=", "resource", ".", "backuplbmethod", ";", "updateresource", ".", "netmask", "=", "resource", ".", "netmask", ";", "updateresource", ".", "v6netmasklen", "=", "resource", ".", "v6netmasklen", ";", "updateresource", ".", "tolerance", "=", "resource", ".", "tolerance", ";", "updateresource", ".", "persistencetype", "=", "resource", ".", "persistencetype", ";", "updateresource", ".", "persistenceid", "=", "resource", ".", "persistenceid", ";", "updateresource", ".", "persistmask", "=", "resource", ".", "persistmask", ";", "updateresource", ".", "v6persistmasklen", "=", "resource", ".", "v6persistmasklen", ";", "updateresource", ".", "timeout", "=", "resource", ".", "timeout", ";", "updateresource", ".", "edr", "=", "resource", ".", "edr", ";", "updateresource", ".", "mir", "=", "resource", ".", "mir", ";", "updateresource", ".", "disableprimaryondown", "=", "resource", ".", "disableprimaryondown", ";", "updateresource", ".", "dynamicweight", "=", "resource", ".", "dynamicweight", ";", "updateresource", ".", "considereffectivestate", "=", "resource", ".", "considereffectivestate", ";", "updateresource", ".", "somethod", "=", "resource", ".", "somethod", ";", "updateresource", ".", "sopersistence", "=", "resource", ".", "sopersistence", ";", "updateresource", ".", "sopersistencetimeout", "=", "resource", ".", "sopersistencetimeout", ";", "updateresource", ".", "sothreshold", "=", "resource", ".", "sothreshold", ";", "updateresource", ".", "sobackupaction", "=", "resource", ".", "sobackupaction", ";", "updateresource", ".", "servicename", "=", "resource", ".", "servicename", ";", "updateresource", ".", "weight", "=", "resource", ".", "weight", ";", "updateresource", ".", "domainname", "=", "resource", ".", "domainname", ";", "updateresource", ".", "ttl", "=", "resource", ".", "ttl", ";", "updateresource", ".", "backupip", "=", "resource", ".", "backupip", ";", "updateresource", ".", "cookie_domain", "=", "resource", ".", "cookie_domain", ";", "updateresource", ".", "cookietimeout", "=", "resource", ".", "cookietimeout", ";", "updateresource", ".", "sitedomainttl", "=", "resource", ".", "sitedomainttl", ";", "updateresource", ".", "comment", "=", "resource", ".", "comment", ";", "updateresource", ".", "appflowlog", "=", "resource", ".", "appflowlog", ";", "return", "updateresource", ".", "update_resource", "(", "client", ")", ";", "}" ]
Use this API to update gslbvserver.
[ "Use", "this", "API", "to", "update", "gslbvserver", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/gslb/gslbvserver.java#L1222-L1260
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/gslb/gslbvserver.java
gslbvserver.disable
public static base_responses disable(nitro_service client, String name[]) throws Exception { base_responses result = null; if (name != null && name.length > 0) { gslbvserver disableresources[] = new gslbvserver[name.length]; for (int i=0;i<name.length;i++){ disableresources[i] = new gslbvserver(); disableresources[i].name = name[i]; } result = perform_operation_bulk_request(client, disableresources,"disable"); } return result; }
java
public static base_responses disable(nitro_service client, String name[]) throws Exception { base_responses result = null; if (name != null && name.length > 0) { gslbvserver disableresources[] = new gslbvserver[name.length]; for (int i=0;i<name.length;i++){ disableresources[i] = new gslbvserver(); disableresources[i].name = name[i]; } result = perform_operation_bulk_request(client, disableresources,"disable"); } return result; }
[ "public", "static", "base_responses", "disable", "(", "nitro_service", "client", ",", "String", "name", "[", "]", ")", "throws", "Exception", "{", "base_responses", "result", "=", "null", ";", "if", "(", "name", "!=", "null", "&&", "name", ".", "length", ">", "0", ")", "{", "gslbvserver", "disableresources", "[", "]", "=", "new", "gslbvserver", "[", "name", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "name", ".", "length", ";", "i", "++", ")", "{", "disableresources", "[", "i", "]", "=", "new", "gslbvserver", "(", ")", ";", "disableresources", "[", "i", "]", ".", "name", "=", "name", "[", "i", "]", ";", "}", "result", "=", "perform_operation_bulk_request", "(", "client", ",", "disableresources", ",", "\"disable\"", ")", ";", "}", "return", "result", ";", "}" ]
Use this API to disable gslbvserver resources of given names.
[ "Use", "this", "API", "to", "disable", "gslbvserver", "resources", "of", "given", "names", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/gslb/gslbvserver.java#L1427-L1438
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/gslb/gslbvserver.java
gslbvserver.get
public static gslbvserver[] get(nitro_service service) throws Exception{ gslbvserver obj = new gslbvserver(); gslbvserver[] response = (gslbvserver[])obj.get_resources(service); return response; }
java
public static gslbvserver[] get(nitro_service service) throws Exception{ gslbvserver obj = new gslbvserver(); gslbvserver[] response = (gslbvserver[])obj.get_resources(service); return response; }
[ "public", "static", "gslbvserver", "[", "]", "get", "(", "nitro_service", "service", ")", "throws", "Exception", "{", "gslbvserver", "obj", "=", "new", "gslbvserver", "(", ")", ";", "gslbvserver", "[", "]", "response", "=", "(", "gslbvserver", "[", "]", ")", "obj", ".", "get_resources", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch all the gslbvserver resources that are configured on netscaler.
[ "Use", "this", "API", "to", "fetch", "all", "the", "gslbvserver", "resources", "that", "are", "configured", "on", "netscaler", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/gslb/gslbvserver.java#L1477-L1481
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/gslb/gslbvserver.java
gslbvserver.get
public static gslbvserver get(nitro_service service, String name) throws Exception{ gslbvserver obj = new gslbvserver(); obj.set_name(name); gslbvserver response = (gslbvserver) obj.get_resource(service); return response; }
java
public static gslbvserver get(nitro_service service, String name) throws Exception{ gslbvserver obj = new gslbvserver(); obj.set_name(name); gslbvserver response = (gslbvserver) obj.get_resource(service); return response; }
[ "public", "static", "gslbvserver", "get", "(", "nitro_service", "service", ",", "String", "name", ")", "throws", "Exception", "{", "gslbvserver", "obj", "=", "new", "gslbvserver", "(", ")", ";", "obj", ".", "set_name", "(", "name", ")", ";", "gslbvserver", "response", "=", "(", "gslbvserver", ")", "obj", ".", "get_resource", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch gslbvserver resource of given name .
[ "Use", "this", "API", "to", "fetch", "gslbvserver", "resource", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/gslb/gslbvserver.java#L1493-L1498
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/transform/transformprofile.java
transformprofile.add
public static base_response add(nitro_service client, transformprofile resource) throws Exception { transformprofile addresource = new transformprofile(); addresource.name = resource.name; addresource.type = resource.type; return addresource.add_resource(client); }
java
public static base_response add(nitro_service client, transformprofile resource) throws Exception { transformprofile addresource = new transformprofile(); addresource.name = resource.name; addresource.type = resource.type; return addresource.add_resource(client); }
[ "public", "static", "base_response", "add", "(", "nitro_service", "client", ",", "transformprofile", "resource", ")", "throws", "Exception", "{", "transformprofile", "addresource", "=", "new", "transformprofile", "(", ")", ";", "addresource", ".", "name", "=", "resource", ".", "name", ";", "addresource", ".", "type", "=", "resource", ".", "type", ";", "return", "addresource", ".", "add_resource", "(", "client", ")", ";", "}" ]
Use this API to add transformprofile.
[ "Use", "this", "API", "to", "add", "transformprofile", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/transform/transformprofile.java#L219-L224
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/transform/transformprofile.java
transformprofile.update
public static base_response update(nitro_service client, transformprofile resource) throws Exception { transformprofile updateresource = new transformprofile(); updateresource.name = resource.name; updateresource.type = resource.type; updateresource.onlytransformabsurlinbody = resource.onlytransformabsurlinbody; updateresource.comment = resource.comment; return updateresource.update_resource(client); }
java
public static base_response update(nitro_service client, transformprofile resource) throws Exception { transformprofile updateresource = new transformprofile(); updateresource.name = resource.name; updateresource.type = resource.type; updateresource.onlytransformabsurlinbody = resource.onlytransformabsurlinbody; updateresource.comment = resource.comment; return updateresource.update_resource(client); }
[ "public", "static", "base_response", "update", "(", "nitro_service", "client", ",", "transformprofile", "resource", ")", "throws", "Exception", "{", "transformprofile", "updateresource", "=", "new", "transformprofile", "(", ")", ";", "updateresource", ".", "name", "=", "resource", ".", "name", ";", "updateresource", ".", "type", "=", "resource", ".", "type", ";", "updateresource", ".", "onlytransformabsurlinbody", "=", "resource", ".", "onlytransformabsurlinbody", ";", "updateresource", ".", "comment", "=", "resource", ".", "comment", ";", "return", "updateresource", ".", "update_resource", "(", "client", ")", ";", "}" ]
Use this API to update transformprofile.
[ "Use", "this", "API", "to", "update", "transformprofile", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/transform/transformprofile.java#L296-L303
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/transform/transformprofile.java
transformprofile.update
public static base_responses update(nitro_service client, transformprofile resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { transformprofile updateresources[] = new transformprofile[resources.length]; for (int i=0;i<resources.length;i++){ updateresources[i] = new transformprofile(); updateresources[i].name = resources[i].name; updateresources[i].type = resources[i].type; updateresources[i].onlytransformabsurlinbody = resources[i].onlytransformabsurlinbody; updateresources[i].comment = resources[i].comment; } result = update_bulk_request(client, updateresources); } return result; }
java
public static base_responses update(nitro_service client, transformprofile resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { transformprofile updateresources[] = new transformprofile[resources.length]; for (int i=0;i<resources.length;i++){ updateresources[i] = new transformprofile(); updateresources[i].name = resources[i].name; updateresources[i].type = resources[i].type; updateresources[i].onlytransformabsurlinbody = resources[i].onlytransformabsurlinbody; updateresources[i].comment = resources[i].comment; } result = update_bulk_request(client, updateresources); } return result; }
[ "public", "static", "base_responses", "update", "(", "nitro_service", "client", ",", "transformprofile", "resources", "[", "]", ")", "throws", "Exception", "{", "base_responses", "result", "=", "null", ";", "if", "(", "resources", "!=", "null", "&&", "resources", ".", "length", ">", "0", ")", "{", "transformprofile", "updateresources", "[", "]", "=", "new", "transformprofile", "[", "resources", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "resources", ".", "length", ";", "i", "++", ")", "{", "updateresources", "[", "i", "]", "=", "new", "transformprofile", "(", ")", ";", "updateresources", "[", "i", "]", ".", "name", "=", "resources", "[", "i", "]", ".", "name", ";", "updateresources", "[", "i", "]", ".", "type", "=", "resources", "[", "i", "]", ".", "type", ";", "updateresources", "[", "i", "]", ".", "onlytransformabsurlinbody", "=", "resources", "[", "i", "]", ".", "onlytransformabsurlinbody", ";", "updateresources", "[", "i", "]", ".", "comment", "=", "resources", "[", "i", "]", ".", "comment", ";", "}", "result", "=", "update_bulk_request", "(", "client", ",", "updateresources", ")", ";", "}", "return", "result", ";", "}" ]
Use this API to update transformprofile resources.
[ "Use", "this", "API", "to", "update", "transformprofile", "resources", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/transform/transformprofile.java#L308-L322
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/transform/transformprofile.java
transformprofile.get
public static transformprofile[] get(nitro_service service) throws Exception{ transformprofile obj = new transformprofile(); transformprofile[] response = (transformprofile[])obj.get_resources(service); return response; }
java
public static transformprofile[] get(nitro_service service) throws Exception{ transformprofile obj = new transformprofile(); transformprofile[] response = (transformprofile[])obj.get_resources(service); return response; }
[ "public", "static", "transformprofile", "[", "]", "get", "(", "nitro_service", "service", ")", "throws", "Exception", "{", "transformprofile", "obj", "=", "new", "transformprofile", "(", ")", ";", "transformprofile", "[", "]", "response", "=", "(", "transformprofile", "[", "]", ")", "obj", ".", "get_resources", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch all the transformprofile resources that are configured on netscaler.
[ "Use", "this", "API", "to", "fetch", "all", "the", "transformprofile", "resources", "that", "are", "configured", "on", "netscaler", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/transform/transformprofile.java#L371-L375
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/transform/transformprofile.java
transformprofile.get
public static transformprofile get(nitro_service service, String name) throws Exception{ transformprofile obj = new transformprofile(); obj.set_name(name); transformprofile response = (transformprofile) obj.get_resource(service); return response; }
java
public static transformprofile get(nitro_service service, String name) throws Exception{ transformprofile obj = new transformprofile(); obj.set_name(name); transformprofile response = (transformprofile) obj.get_resource(service); return response; }
[ "public", "static", "transformprofile", "get", "(", "nitro_service", "service", ",", "String", "name", ")", "throws", "Exception", "{", "transformprofile", "obj", "=", "new", "transformprofile", "(", ")", ";", "obj", ".", "set_name", "(", "name", ")", ";", "transformprofile", "response", "=", "(", "transformprofile", ")", "obj", ".", "get_resource", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch transformprofile resource of given name .
[ "Use", "this", "API", "to", "fetch", "transformprofile", "resource", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/transform/transformprofile.java#L387-L392
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/appfw/appfwpolicy_appfwpolicylabel_binding.java
appfwpolicy_appfwpolicylabel_binding.get
public static appfwpolicy_appfwpolicylabel_binding[] get(nitro_service service, String name) throws Exception{ appfwpolicy_appfwpolicylabel_binding obj = new appfwpolicy_appfwpolicylabel_binding(); obj.set_name(name); appfwpolicy_appfwpolicylabel_binding response[] = (appfwpolicy_appfwpolicylabel_binding[]) obj.get_resources(service); return response; }
java
public static appfwpolicy_appfwpolicylabel_binding[] get(nitro_service service, String name) throws Exception{ appfwpolicy_appfwpolicylabel_binding obj = new appfwpolicy_appfwpolicylabel_binding(); obj.set_name(name); appfwpolicy_appfwpolicylabel_binding response[] = (appfwpolicy_appfwpolicylabel_binding[]) obj.get_resources(service); return response; }
[ "public", "static", "appfwpolicy_appfwpolicylabel_binding", "[", "]", "get", "(", "nitro_service", "service", ",", "String", "name", ")", "throws", "Exception", "{", "appfwpolicy_appfwpolicylabel_binding", "obj", "=", "new", "appfwpolicy_appfwpolicylabel_binding", "(", ")", ";", "obj", ".", "set_name", "(", "name", ")", ";", "appfwpolicy_appfwpolicylabel_binding", "response", "[", "]", "=", "(", "appfwpolicy_appfwpolicylabel_binding", "[", "]", ")", "obj", ".", "get_resources", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch appfwpolicy_appfwpolicylabel_binding resources of given name .
[ "Use", "this", "API", "to", "fetch", "appfwpolicy_appfwpolicylabel_binding", "resources", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/appfw/appfwpolicy_appfwpolicylabel_binding.java#L162-L167
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nsversion.java
nsversion.get
public static nsversion get(nitro_service service) throws Exception{ nsversion obj = new nsversion(); nsversion[] response = (nsversion[])obj.get_resources(service); return response[0]; }
java
public static nsversion get(nitro_service service) throws Exception{ nsversion obj = new nsversion(); nsversion[] response = (nsversion[])obj.get_resources(service); return response[0]; }
[ "public", "static", "nsversion", "get", "(", "nitro_service", "service", ")", "throws", "Exception", "{", "nsversion", "obj", "=", "new", "nsversion", "(", ")", ";", "nsversion", "[", "]", "response", "=", "(", "nsversion", "[", "]", ")", "obj", ".", "get_resources", "(", "service", ")", ";", "return", "response", "[", "0", "]", ";", "}" ]
Use this API to fetch all the nsversion resources that are configured on netscaler.
[ "Use", "this", "API", "to", "fetch", "all", "the", "nsversion", "resources", "that", "are", "configured", "on", "netscaler", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nsversion.java#L98-L102
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/stat/sc/sc_stats.java
sc_stats.get
public static sc_stats get(nitro_service service) throws Exception{ sc_stats obj = new sc_stats(); sc_stats[] response = (sc_stats[])obj.stat_resources(service); return response[0]; }
java
public static sc_stats get(nitro_service service) throws Exception{ sc_stats obj = new sc_stats(); sc_stats[] response = (sc_stats[])obj.stat_resources(service); return response[0]; }
[ "public", "static", "sc_stats", "get", "(", "nitro_service", "service", ")", "throws", "Exception", "{", "sc_stats", "obj", "=", "new", "sc_stats", "(", ")", ";", "sc_stats", "[", "]", "response", "=", "(", "sc_stats", "[", "]", ")", "obj", ".", "stat_resources", "(", "service", ")", ";", "return", "response", "[", "0", "]", ";", "}" ]
Use this API to fetch the statistics of all sc_stats resources that are configured on netscaler.
[ "Use", "this", "API", "to", "fetch", "the", "statistics", "of", "all", "sc_stats", "resources", "that", "are", "configured", "on", "netscaler", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/sc/sc_stats.java#L291-L295
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/ssl/sslwrapkey.java
sslwrapkey.create
public static base_response create(nitro_service client, sslwrapkey resource) throws Exception { sslwrapkey createresource = new sslwrapkey(); createresource.wrapkeyname = resource.wrapkeyname; createresource.password = resource.password; createresource.salt = resource.salt; return createresource.perform_operation(client,"create"); }
java
public static base_response create(nitro_service client, sslwrapkey resource) throws Exception { sslwrapkey createresource = new sslwrapkey(); createresource.wrapkeyname = resource.wrapkeyname; createresource.password = resource.password; createresource.salt = resource.salt; return createresource.perform_operation(client,"create"); }
[ "public", "static", "base_response", "create", "(", "nitro_service", "client", ",", "sslwrapkey", "resource", ")", "throws", "Exception", "{", "sslwrapkey", "createresource", "=", "new", "sslwrapkey", "(", ")", ";", "createresource", ".", "wrapkeyname", "=", "resource", ".", "wrapkeyname", ";", "createresource", ".", "password", "=", "resource", ".", "password", ";", "createresource", ".", "salt", "=", "resource", ".", "salt", ";", "return", "createresource", ".", "perform_operation", "(", "client", ",", "\"create\"", ")", ";", "}" ]
Use this API to create sslwrapkey.
[ "Use", "this", "API", "to", "create", "sslwrapkey", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/ssl/sslwrapkey.java#L135-L141
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/ssl/sslwrapkey.java
sslwrapkey.create
public static base_responses create(nitro_service client, sslwrapkey resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { sslwrapkey createresources[] = new sslwrapkey[resources.length]; for (int i=0;i<resources.length;i++){ createresources[i] = new sslwrapkey(); createresources[i].wrapkeyname = resources[i].wrapkeyname; createresources[i].password = resources[i].password; createresources[i].salt = resources[i].salt; } result = perform_operation_bulk_request(client, createresources,"create"); } return result; }
java
public static base_responses create(nitro_service client, sslwrapkey resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { sslwrapkey createresources[] = new sslwrapkey[resources.length]; for (int i=0;i<resources.length;i++){ createresources[i] = new sslwrapkey(); createresources[i].wrapkeyname = resources[i].wrapkeyname; createresources[i].password = resources[i].password; createresources[i].salt = resources[i].salt; } result = perform_operation_bulk_request(client, createresources,"create"); } return result; }
[ "public", "static", "base_responses", "create", "(", "nitro_service", "client", ",", "sslwrapkey", "resources", "[", "]", ")", "throws", "Exception", "{", "base_responses", "result", "=", "null", ";", "if", "(", "resources", "!=", "null", "&&", "resources", ".", "length", ">", "0", ")", "{", "sslwrapkey", "createresources", "[", "]", "=", "new", "sslwrapkey", "[", "resources", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "resources", ".", "length", ";", "i", "++", ")", "{", "createresources", "[", "i", "]", "=", "new", "sslwrapkey", "(", ")", ";", "createresources", "[", "i", "]", ".", "wrapkeyname", "=", "resources", "[", "i", "]", ".", "wrapkeyname", ";", "createresources", "[", "i", "]", ".", "password", "=", "resources", "[", "i", "]", ".", "password", ";", "createresources", "[", "i", "]", ".", "salt", "=", "resources", "[", "i", "]", ".", "salt", ";", "}", "result", "=", "perform_operation_bulk_request", "(", "client", ",", "createresources", ",", "\"create\"", ")", ";", "}", "return", "result", ";", "}" ]
Use this API to create sslwrapkey resources.
[ "Use", "this", "API", "to", "create", "sslwrapkey", "resources", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/ssl/sslwrapkey.java#L146-L159
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/ssl/sslwrapkey.java
sslwrapkey.delete
public static base_response delete(nitro_service client, String wrapkeyname) throws Exception { sslwrapkey deleteresource = new sslwrapkey(); deleteresource.wrapkeyname = wrapkeyname; return deleteresource.delete_resource(client); }
java
public static base_response delete(nitro_service client, String wrapkeyname) throws Exception { sslwrapkey deleteresource = new sslwrapkey(); deleteresource.wrapkeyname = wrapkeyname; return deleteresource.delete_resource(client); }
[ "public", "static", "base_response", "delete", "(", "nitro_service", "client", ",", "String", "wrapkeyname", ")", "throws", "Exception", "{", "sslwrapkey", "deleteresource", "=", "new", "sslwrapkey", "(", ")", ";", "deleteresource", ".", "wrapkeyname", "=", "wrapkeyname", ";", "return", "deleteresource", ".", "delete_resource", "(", "client", ")", ";", "}" ]
Use this API to delete sslwrapkey of given name.
[ "Use", "this", "API", "to", "delete", "sslwrapkey", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/ssl/sslwrapkey.java#L164-L168
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/ssl/sslwrapkey.java
sslwrapkey.delete
public static base_responses delete(nitro_service client, String wrapkeyname[]) throws Exception { base_responses result = null; if (wrapkeyname != null && wrapkeyname.length > 0) { sslwrapkey deleteresources[] = new sslwrapkey[wrapkeyname.length]; for (int i=0;i<wrapkeyname.length;i++){ deleteresources[i] = new sslwrapkey(); deleteresources[i].wrapkeyname = wrapkeyname[i]; } result = delete_bulk_request(client, deleteresources); } return result; }
java
public static base_responses delete(nitro_service client, String wrapkeyname[]) throws Exception { base_responses result = null; if (wrapkeyname != null && wrapkeyname.length > 0) { sslwrapkey deleteresources[] = new sslwrapkey[wrapkeyname.length]; for (int i=0;i<wrapkeyname.length;i++){ deleteresources[i] = new sslwrapkey(); deleteresources[i].wrapkeyname = wrapkeyname[i]; } result = delete_bulk_request(client, deleteresources); } return result; }
[ "public", "static", "base_responses", "delete", "(", "nitro_service", "client", ",", "String", "wrapkeyname", "[", "]", ")", "throws", "Exception", "{", "base_responses", "result", "=", "null", ";", "if", "(", "wrapkeyname", "!=", "null", "&&", "wrapkeyname", ".", "length", ">", "0", ")", "{", "sslwrapkey", "deleteresources", "[", "]", "=", "new", "sslwrapkey", "[", "wrapkeyname", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "wrapkeyname", ".", "length", ";", "i", "++", ")", "{", "deleteresources", "[", "i", "]", "=", "new", "sslwrapkey", "(", ")", ";", "deleteresources", "[", "i", "]", ".", "wrapkeyname", "=", "wrapkeyname", "[", "i", "]", ";", "}", "result", "=", "delete_bulk_request", "(", "client", ",", "deleteresources", ")", ";", "}", "return", "result", ";", "}" ]
Use this API to delete sslwrapkey resources of given names.
[ "Use", "this", "API", "to", "delete", "sslwrapkey", "resources", "of", "given", "names", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/ssl/sslwrapkey.java#L182-L193
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/ssl/sslwrapkey.java
sslwrapkey.get
public static sslwrapkey[] get(nitro_service service) throws Exception{ sslwrapkey obj = new sslwrapkey(); sslwrapkey[] response = (sslwrapkey[])obj.get_resources(service); return response; }
java
public static sslwrapkey[] get(nitro_service service) throws Exception{ sslwrapkey obj = new sslwrapkey(); sslwrapkey[] response = (sslwrapkey[])obj.get_resources(service); return response; }
[ "public", "static", "sslwrapkey", "[", "]", "get", "(", "nitro_service", "service", ")", "throws", "Exception", "{", "sslwrapkey", "obj", "=", "new", "sslwrapkey", "(", ")", ";", "sslwrapkey", "[", "]", "response", "=", "(", "sslwrapkey", "[", "]", ")", "obj", ".", "get_resources", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch all the sslwrapkey resources that are configured on netscaler.
[ "Use", "this", "API", "to", "fetch", "all", "the", "sslwrapkey", "resources", "that", "are", "configured", "on", "netscaler", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/ssl/sslwrapkey.java#L214-L218
train
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/math/SloppyMath.java
SloppyMath.min
public static int min(int a, int b, int c) { int mi; mi = a; if (b < mi) { mi = b; } if (c < mi) { mi = c; } return mi; }
java
public static int min(int a, int b, int c) { int mi; mi = a; if (b < mi) { mi = b; } if (c < mi) { mi = c; } return mi; }
[ "public", "static", "int", "min", "(", "int", "a", ",", "int", "b", ",", "int", "c", ")", "{", "int", "mi", ";", "mi", "=", "a", ";", "if", "(", "b", "<", "mi", ")", "{", "mi", "=", "b", ";", "}", "if", "(", "c", "<", "mi", ")", "{", "mi", "=", "c", ";", "}", "return", "mi", ";", "}" ]
Returns the minimum of three int values.
[ "Returns", "the", "minimum", "of", "three", "int", "values", "." ]
b3d44bab9ec07ace0d13612c448a6b7298c1f681
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/math/SloppyMath.java#L119-L130
train
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/math/SloppyMath.java
SloppyMath.exactBinomial
public static double exactBinomial(int k, int n, double p) { double total = 0.0; for (int m = k; m <= n; m++) { double nChooseM = 1.0; for (int r = 1; r <= m; r++) { nChooseM *= (n - r) + 1; nChooseM /= r; } // System.out.println(n + " choose " + m + " is " + nChooseM); // System.out.println("prob contribution is " + // (nChooseM * Math.pow(p, m) * Math.pow(1.0-p, n - m))); total += nChooseM * Math.pow(p, m) * Math.pow(1.0 - p, n - m); } return total; }
java
public static double exactBinomial(int k, int n, double p) { double total = 0.0; for (int m = k; m <= n; m++) { double nChooseM = 1.0; for (int r = 1; r <= m; r++) { nChooseM *= (n - r) + 1; nChooseM /= r; } // System.out.println(n + " choose " + m + " is " + nChooseM); // System.out.println("prob contribution is " + // (nChooseM * Math.pow(p, m) * Math.pow(1.0-p, n - m))); total += nChooseM * Math.pow(p, m) * Math.pow(1.0 - p, n - m); } return total; }
[ "public", "static", "double", "exactBinomial", "(", "int", "k", ",", "int", "n", ",", "double", "p", ")", "{", "double", "total", "=", "0.0", ";", "for", "(", "int", "m", "=", "k", ";", "m", "<=", "n", ";", "m", "++", ")", "{", "double", "nChooseM", "=", "1.0", ";", "for", "(", "int", "r", "=", "1", ";", "r", "<=", "m", ";", "r", "++", ")", "{", "nChooseM", "*=", "(", "n", "-", "r", ")", "+", "1", ";", "nChooseM", "/=", "r", ";", "}", "// System.out.println(n + \" choose \" + m + \" is \" + nChooseM);\r", "// System.out.println(\"prob contribution is \" +\r", "//\t (nChooseM * Math.pow(p, m) * Math.pow(1.0-p, n - m)));\r", "total", "+=", "nChooseM", "*", "Math", ".", "pow", "(", "p", ",", "m", ")", "*", "Math", ".", "pow", "(", "1.0", "-", "p", ",", "n", "-", "m", ")", ";", "}", "return", "total", ";", "}" ]
Find a one tailed exact binomial test probability. Finds the chance of this or a higher result @param k number of successes @param n Number of trials @param p Probability of a success
[ "Find", "a", "one", "tailed", "exact", "binomial", "test", "probability", ".", "Finds", "the", "chance", "of", "this", "or", "a", "higher", "result" ]
b3d44bab9ec07ace0d13612c448a6b7298c1f681
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/math/SloppyMath.java#L509-L523
train
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/math/SloppyMath.java
SloppyMath.factorial
public static double factorial(int x) { double result = 1.0; for (int i=x; i>1; i--) { result *= i; } return result; }
java
public static double factorial(int x) { double result = 1.0; for (int i=x; i>1; i--) { result *= i; } return result; }
[ "public", "static", "double", "factorial", "(", "int", "x", ")", "{", "double", "result", "=", "1.0", ";", "for", "(", "int", "i", "=", "x", ";", "i", ">", "1", ";", "i", "--", ")", "{", "result", "*=", "i", ";", "}", "return", "result", ";", "}" ]
Uses floating point so that it can represent the really big numbers that come up. @param x Argumet to take factorial of @return Factorial of argument
[ "Uses", "floating", "point", "so", "that", "it", "can", "represent", "the", "really", "big", "numbers", "that", "come", "up", "." ]
b3d44bab9ec07ace0d13612c448a6b7298c1f681
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/math/SloppyMath.java#L636-L642
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnsaction64.java
dnsaction64.add
public static base_response add(nitro_service client, dnsaction64 resource) throws Exception { dnsaction64 addresource = new dnsaction64(); addresource.actionname = resource.actionname; addresource.prefix = resource.prefix; addresource.mappedrule = resource.mappedrule; addresource.excluderule = resource.excluderule; return addresource.add_resource(client); }
java
public static base_response add(nitro_service client, dnsaction64 resource) throws Exception { dnsaction64 addresource = new dnsaction64(); addresource.actionname = resource.actionname; addresource.prefix = resource.prefix; addresource.mappedrule = resource.mappedrule; addresource.excluderule = resource.excluderule; return addresource.add_resource(client); }
[ "public", "static", "base_response", "add", "(", "nitro_service", "client", ",", "dnsaction64", "resource", ")", "throws", "Exception", "{", "dnsaction64", "addresource", "=", "new", "dnsaction64", "(", ")", ";", "addresource", ".", "actionname", "=", "resource", ".", "actionname", ";", "addresource", ".", "prefix", "=", "resource", ".", "prefix", ";", "addresource", ".", "mappedrule", "=", "resource", ".", "mappedrule", ";", "addresource", ".", "excluderule", "=", "resource", ".", "excluderule", ";", "return", "addresource", ".", "add_resource", "(", "client", ")", ";", "}" ]
Use this API to add dnsaction64.
[ "Use", "this", "API", "to", "add", "dnsaction64", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnsaction64.java#L167-L174
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnsaction64.java
dnsaction64.add
public static base_responses add(nitro_service client, dnsaction64 resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { dnsaction64 addresources[] = new dnsaction64[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new dnsaction64(); addresources[i].actionname = resources[i].actionname; addresources[i].prefix = resources[i].prefix; addresources[i].mappedrule = resources[i].mappedrule; addresources[i].excluderule = resources[i].excluderule; } result = add_bulk_request(client, addresources); } return result; }
java
public static base_responses add(nitro_service client, dnsaction64 resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { dnsaction64 addresources[] = new dnsaction64[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new dnsaction64(); addresources[i].actionname = resources[i].actionname; addresources[i].prefix = resources[i].prefix; addresources[i].mappedrule = resources[i].mappedrule; addresources[i].excluderule = resources[i].excluderule; } result = add_bulk_request(client, addresources); } return result; }
[ "public", "static", "base_responses", "add", "(", "nitro_service", "client", ",", "dnsaction64", "resources", "[", "]", ")", "throws", "Exception", "{", "base_responses", "result", "=", "null", ";", "if", "(", "resources", "!=", "null", "&&", "resources", ".", "length", ">", "0", ")", "{", "dnsaction64", "addresources", "[", "]", "=", "new", "dnsaction64", "[", "resources", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "resources", ".", "length", ";", "i", "++", ")", "{", "addresources", "[", "i", "]", "=", "new", "dnsaction64", "(", ")", ";", "addresources", "[", "i", "]", ".", "actionname", "=", "resources", "[", "i", "]", ".", "actionname", ";", "addresources", "[", "i", "]", ".", "prefix", "=", "resources", "[", "i", "]", ".", "prefix", ";", "addresources", "[", "i", "]", ".", "mappedrule", "=", "resources", "[", "i", "]", ".", "mappedrule", ";", "addresources", "[", "i", "]", ".", "excluderule", "=", "resources", "[", "i", "]", ".", "excluderule", ";", "}", "result", "=", "add_bulk_request", "(", "client", ",", "addresources", ")", ";", "}", "return", "result", ";", "}" ]
Use this API to add dnsaction64 resources.
[ "Use", "this", "API", "to", "add", "dnsaction64", "resources", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnsaction64.java#L179-L193
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnsaction64.java
dnsaction64.delete
public static base_response delete(nitro_service client, String actionname) throws Exception { dnsaction64 deleteresource = new dnsaction64(); deleteresource.actionname = actionname; return deleteresource.delete_resource(client); }
java
public static base_response delete(nitro_service client, String actionname) throws Exception { dnsaction64 deleteresource = new dnsaction64(); deleteresource.actionname = actionname; return deleteresource.delete_resource(client); }
[ "public", "static", "base_response", "delete", "(", "nitro_service", "client", ",", "String", "actionname", ")", "throws", "Exception", "{", "dnsaction64", "deleteresource", "=", "new", "dnsaction64", "(", ")", ";", "deleteresource", ".", "actionname", "=", "actionname", ";", "return", "deleteresource", ".", "delete_resource", "(", "client", ")", ";", "}" ]
Use this API to delete dnsaction64 of given name.
[ "Use", "this", "API", "to", "delete", "dnsaction64", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnsaction64.java#L198-L202
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnsaction64.java
dnsaction64.update
public static base_response update(nitro_service client, dnsaction64 resource) throws Exception { dnsaction64 updateresource = new dnsaction64(); updateresource.actionname = resource.actionname; updateresource.prefix = resource.prefix; updateresource.mappedrule = resource.mappedrule; updateresource.excluderule = resource.excluderule; return updateresource.update_resource(client); }
java
public static base_response update(nitro_service client, dnsaction64 resource) throws Exception { dnsaction64 updateresource = new dnsaction64(); updateresource.actionname = resource.actionname; updateresource.prefix = resource.prefix; updateresource.mappedrule = resource.mappedrule; updateresource.excluderule = resource.excluderule; return updateresource.update_resource(client); }
[ "public", "static", "base_response", "update", "(", "nitro_service", "client", ",", "dnsaction64", "resource", ")", "throws", "Exception", "{", "dnsaction64", "updateresource", "=", "new", "dnsaction64", "(", ")", ";", "updateresource", ".", "actionname", "=", "resource", ".", "actionname", ";", "updateresource", ".", "prefix", "=", "resource", ".", "prefix", ";", "updateresource", ".", "mappedrule", "=", "resource", ".", "mappedrule", ";", "updateresource", ".", "excluderule", "=", "resource", ".", "excluderule", ";", "return", "updateresource", ".", "update_resource", "(", "client", ")", ";", "}" ]
Use this API to update dnsaction64.
[ "Use", "this", "API", "to", "update", "dnsaction64", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnsaction64.java#L248-L255
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnsaction64.java
dnsaction64.update
public static base_responses update(nitro_service client, dnsaction64 resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { dnsaction64 updateresources[] = new dnsaction64[resources.length]; for (int i=0;i<resources.length;i++){ updateresources[i] = new dnsaction64(); updateresources[i].actionname = resources[i].actionname; updateresources[i].prefix = resources[i].prefix; updateresources[i].mappedrule = resources[i].mappedrule; updateresources[i].excluderule = resources[i].excluderule; } result = update_bulk_request(client, updateresources); } return result; }
java
public static base_responses update(nitro_service client, dnsaction64 resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { dnsaction64 updateresources[] = new dnsaction64[resources.length]; for (int i=0;i<resources.length;i++){ updateresources[i] = new dnsaction64(); updateresources[i].actionname = resources[i].actionname; updateresources[i].prefix = resources[i].prefix; updateresources[i].mappedrule = resources[i].mappedrule; updateresources[i].excluderule = resources[i].excluderule; } result = update_bulk_request(client, updateresources); } return result; }
[ "public", "static", "base_responses", "update", "(", "nitro_service", "client", ",", "dnsaction64", "resources", "[", "]", ")", "throws", "Exception", "{", "base_responses", "result", "=", "null", ";", "if", "(", "resources", "!=", "null", "&&", "resources", ".", "length", ">", "0", ")", "{", "dnsaction64", "updateresources", "[", "]", "=", "new", "dnsaction64", "[", "resources", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "resources", ".", "length", ";", "i", "++", ")", "{", "updateresources", "[", "i", "]", "=", "new", "dnsaction64", "(", ")", ";", "updateresources", "[", "i", "]", ".", "actionname", "=", "resources", "[", "i", "]", ".", "actionname", ";", "updateresources", "[", "i", "]", ".", "prefix", "=", "resources", "[", "i", "]", ".", "prefix", ";", "updateresources", "[", "i", "]", ".", "mappedrule", "=", "resources", "[", "i", "]", ".", "mappedrule", ";", "updateresources", "[", "i", "]", ".", "excluderule", "=", "resources", "[", "i", "]", ".", "excluderule", ";", "}", "result", "=", "update_bulk_request", "(", "client", ",", "updateresources", ")", ";", "}", "return", "result", ";", "}" ]
Use this API to update dnsaction64 resources.
[ "Use", "this", "API", "to", "update", "dnsaction64", "resources", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnsaction64.java#L260-L274
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnsaction64.java
dnsaction64.unset
public static base_responses unset(nitro_service client, dnsaction64 resources[], String[] args) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { dnsaction64 unsetresources[] = new dnsaction64[resources.length]; for (int i=0;i<resources.length;i++){ unsetresources[i] = new dnsaction64(); unsetresources[i].actionname = resources[i].actionname; } result = unset_bulk_request(client, unsetresources,args); } return result; }
java
public static base_responses unset(nitro_service client, dnsaction64 resources[], String[] args) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { dnsaction64 unsetresources[] = new dnsaction64[resources.length]; for (int i=0;i<resources.length;i++){ unsetresources[i] = new dnsaction64(); unsetresources[i].actionname = resources[i].actionname; } result = unset_bulk_request(client, unsetresources,args); } return result; }
[ "public", "static", "base_responses", "unset", "(", "nitro_service", "client", ",", "dnsaction64", "resources", "[", "]", ",", "String", "[", "]", "args", ")", "throws", "Exception", "{", "base_responses", "result", "=", "null", ";", "if", "(", "resources", "!=", "null", "&&", "resources", ".", "length", ">", "0", ")", "{", "dnsaction64", "unsetresources", "[", "]", "=", "new", "dnsaction64", "[", "resources", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "resources", ".", "length", ";", "i", "++", ")", "{", "unsetresources", "[", "i", "]", "=", "new", "dnsaction64", "(", ")", ";", "unsetresources", "[", "i", "]", ".", "actionname", "=", "resources", "[", "i", "]", ".", "actionname", ";", "}", "result", "=", "unset_bulk_request", "(", "client", ",", "unsetresources", ",", "args", ")", ";", "}", "return", "result", ";", "}" ]
Use this API to unset the properties of dnsaction64 resources. Properties that need to be unset are specified in args array.
[ "Use", "this", "API", "to", "unset", "the", "properties", "of", "dnsaction64", "resources", ".", "Properties", "that", "need", "to", "be", "unset", "are", "specified", "in", "args", "array", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnsaction64.java#L307-L318
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnsaction64.java
dnsaction64.get
public static dnsaction64[] get(nitro_service service) throws Exception{ dnsaction64 obj = new dnsaction64(); dnsaction64[] response = (dnsaction64[])obj.get_resources(service); return response; }
java
public static dnsaction64[] get(nitro_service service) throws Exception{ dnsaction64 obj = new dnsaction64(); dnsaction64[] response = (dnsaction64[])obj.get_resources(service); return response; }
[ "public", "static", "dnsaction64", "[", "]", "get", "(", "nitro_service", "service", ")", "throws", "Exception", "{", "dnsaction64", "obj", "=", "new", "dnsaction64", "(", ")", ";", "dnsaction64", "[", "]", "response", "=", "(", "dnsaction64", "[", "]", ")", "obj", ".", "get_resources", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch all the dnsaction64 resources that are configured on netscaler.
[ "Use", "this", "API", "to", "fetch", "all", "the", "dnsaction64", "resources", "that", "are", "configured", "on", "netscaler", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnsaction64.java#L323-L327
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnsaction64.java
dnsaction64.get
public static dnsaction64 get(nitro_service service, String actionname) throws Exception{ dnsaction64 obj = new dnsaction64(); obj.set_actionname(actionname); dnsaction64 response = (dnsaction64) obj.get_resource(service); return response; }
java
public static dnsaction64 get(nitro_service service, String actionname) throws Exception{ dnsaction64 obj = new dnsaction64(); obj.set_actionname(actionname); dnsaction64 response = (dnsaction64) obj.get_resource(service); return response; }
[ "public", "static", "dnsaction64", "get", "(", "nitro_service", "service", ",", "String", "actionname", ")", "throws", "Exception", "{", "dnsaction64", "obj", "=", "new", "dnsaction64", "(", ")", ";", "obj", ".", "set_actionname", "(", "actionname", ")", ";", "dnsaction64", "response", "=", "(", "dnsaction64", ")", "obj", ".", "get_resource", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch dnsaction64 resource of given name .
[ "Use", "this", "API", "to", "fetch", "dnsaction64", "resource", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnsaction64.java#L339-L344
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnsaction64.java
dnsaction64.get
public static dnsaction64[] get(nitro_service service, String actionname[]) throws Exception{ if (actionname !=null && actionname.length>0) { dnsaction64 response[] = new dnsaction64[actionname.length]; dnsaction64 obj[] = new dnsaction64[actionname.length]; for (int i=0;i<actionname.length;i++) { obj[i] = new dnsaction64(); obj[i].set_actionname(actionname[i]); response[i] = (dnsaction64) obj[i].get_resource(service); } return response; } return null; }
java
public static dnsaction64[] get(nitro_service service, String actionname[]) throws Exception{ if (actionname !=null && actionname.length>0) { dnsaction64 response[] = new dnsaction64[actionname.length]; dnsaction64 obj[] = new dnsaction64[actionname.length]; for (int i=0;i<actionname.length;i++) { obj[i] = new dnsaction64(); obj[i].set_actionname(actionname[i]); response[i] = (dnsaction64) obj[i].get_resource(service); } return response; } return null; }
[ "public", "static", "dnsaction64", "[", "]", "get", "(", "nitro_service", "service", ",", "String", "actionname", "[", "]", ")", "throws", "Exception", "{", "if", "(", "actionname", "!=", "null", "&&", "actionname", ".", "length", ">", "0", ")", "{", "dnsaction64", "response", "[", "]", "=", "new", "dnsaction64", "[", "actionname", ".", "length", "]", ";", "dnsaction64", "obj", "[", "]", "=", "new", "dnsaction64", "[", "actionname", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "actionname", ".", "length", ";", "i", "++", ")", "{", "obj", "[", "i", "]", "=", "new", "dnsaction64", "(", ")", ";", "obj", "[", "i", "]", ".", "set_actionname", "(", "actionname", "[", "i", "]", ")", ";", "response", "[", "i", "]", "=", "(", "dnsaction64", ")", "obj", "[", "i", "]", ".", "get_resource", "(", "service", ")", ";", "}", "return", "response", ";", "}", "return", "null", ";", "}" ]
Use this API to fetch dnsaction64 resources of given names .
[ "Use", "this", "API", "to", "fetch", "dnsaction64", "resources", "of", "given", "names", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnsaction64.java#L349-L361
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnsessionpolicy_aaagroup_binding.java
vpnsessionpolicy_aaagroup_binding.get
public static vpnsessionpolicy_aaagroup_binding[] get(nitro_service service, String name) throws Exception{ vpnsessionpolicy_aaagroup_binding obj = new vpnsessionpolicy_aaagroup_binding(); obj.set_name(name); vpnsessionpolicy_aaagroup_binding response[] = (vpnsessionpolicy_aaagroup_binding[]) obj.get_resources(service); return response; }
java
public static vpnsessionpolicy_aaagroup_binding[] get(nitro_service service, String name) throws Exception{ vpnsessionpolicy_aaagroup_binding obj = new vpnsessionpolicy_aaagroup_binding(); obj.set_name(name); vpnsessionpolicy_aaagroup_binding response[] = (vpnsessionpolicy_aaagroup_binding[]) obj.get_resources(service); return response; }
[ "public", "static", "vpnsessionpolicy_aaagroup_binding", "[", "]", "get", "(", "nitro_service", "service", ",", "String", "name", ")", "throws", "Exception", "{", "vpnsessionpolicy_aaagroup_binding", "obj", "=", "new", "vpnsessionpolicy_aaagroup_binding", "(", ")", ";", "obj", ".", "set_name", "(", "name", ")", ";", "vpnsessionpolicy_aaagroup_binding", "response", "[", "]", "=", "(", "vpnsessionpolicy_aaagroup_binding", "[", "]", ")", "obj", ".", "get_resources", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch vpnsessionpolicy_aaagroup_binding resources of given name .
[ "Use", "this", "API", "to", "fetch", "vpnsessionpolicy_aaagroup_binding", "resources", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnsessionpolicy_aaagroup_binding.java#L132-L137
train
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/parser/lexparser/EnglishTreebankParserParams.java
EnglishTreebankParserParams.treeReaderFactory
public TreeReaderFactory treeReaderFactory() { return new TreeReaderFactory() { public TreeReader newTreeReader(Reader in) { return new PennTreeReader(in, new LabeledScoredTreeFactory(), new NPTmpRetainingTreeNormalizer(englishTrain.splitTMP, englishTrain.splitSGapped == 5, englishTrain.leaveItAll, englishTrain.splitNPADV >= 1, headFinder())); } }; }
java
public TreeReaderFactory treeReaderFactory() { return new TreeReaderFactory() { public TreeReader newTreeReader(Reader in) { return new PennTreeReader(in, new LabeledScoredTreeFactory(), new NPTmpRetainingTreeNormalizer(englishTrain.splitTMP, englishTrain.splitSGapped == 5, englishTrain.leaveItAll, englishTrain.splitNPADV >= 1, headFinder())); } }; }
[ "public", "TreeReaderFactory", "treeReaderFactory", "(", ")", "{", "return", "new", "TreeReaderFactory", "(", ")", "{", "public", "TreeReader", "newTreeReader", "(", "Reader", "in", ")", "{", "return", "new", "PennTreeReader", "(", "in", ",", "new", "LabeledScoredTreeFactory", "(", ")", ",", "new", "NPTmpRetainingTreeNormalizer", "(", "englishTrain", ".", "splitTMP", ",", "englishTrain", ".", "splitSGapped", "==", "5", ",", "englishTrain", ".", "leaveItAll", ",", "englishTrain", ".", "splitNPADV", ">=", "1", ",", "headFinder", "(", ")", ")", ")", ";", "}", "}", ";", "}" ]
Makes appropriate TreeReaderFactory with all options specified
[ "Makes", "appropriate", "TreeReaderFactory", "with", "all", "options", "specified" ]
b3d44bab9ec07ace0d13612c448a6b7298c1f681
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/parser/lexparser/EnglishTreebankParserParams.java#L172-L178
train
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/parser/lexparser/EnglishTreebankParserParams.java
EnglishTreebankParserParams.deduceTag
private static String deduceTag(String w) { String word = w.toLowerCase(); if (word.endsWith("ing")) { return "VBG"; } else if (word.endsWith("d") || word.endsWith("t")) { return "VBN"; } else if (word.endsWith("s")) { return "VBZ"; } else if (word.equals("to")) { return "TO"; } else { return "VB"; } }
java
private static String deduceTag(String w) { String word = w.toLowerCase(); if (word.endsWith("ing")) { return "VBG"; } else if (word.endsWith("d") || word.endsWith("t")) { return "VBN"; } else if (word.endsWith("s")) { return "VBZ"; } else if (word.equals("to")) { return "TO"; } else { return "VB"; } }
[ "private", "static", "String", "deduceTag", "(", "String", "w", ")", "{", "String", "word", "=", "w", ".", "toLowerCase", "(", ")", ";", "if", "(", "word", ".", "endsWith", "(", "\"ing\"", ")", ")", "{", "return", "\"VBG\"", ";", "}", "else", "if", "(", "word", ".", "endsWith", "(", "\"d\"", ")", "||", "word", ".", "endsWith", "(", "\"t\"", ")", ")", "{", "return", "\"VBN\"", ";", "}", "else", "if", "(", "word", ".", "endsWith", "(", "\"s\"", ")", ")", "{", "return", "\"VBZ\"", ";", "}", "else", "if", "(", "word", ".", "equals", "(", "\"to\"", ")", ")", "{", "return", "\"TO\"", ";", "}", "else", "{", "return", "\"VB\"", ";", "}", "}" ]
quite heuristic, but not useless given tagging errors?
[ "quite", "heuristic", "but", "not", "useless", "given", "tagging", "errors?" ]
b3d44bab9ec07ace0d13612c448a6b7298c1f681
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/parser/lexparser/EnglishTreebankParserParams.java#L1803-L1816
train
meertensinstituut/mtas
src/main/java/mtas/search/spans/MtasSpanNotSpans.java
MtasSpanNotSpans.collectAndCheckLastSpans
private boolean collectAndCheckLastSpans(int nextSpans1StartPosition, int nextSpans1EndPosition) throws IOException { // check next if (nextSpans1StartPosition == nextSpans2StartPosition && nextSpans1EndPosition == nextSpans2EndPosition) { return false; } // check last if (nextSpans1StartPosition == lastSpans2StartPosition && (nextSpans1EndPosition == lastSpans2EndPosition || lastSpans2EndPositions.contains(nextSpans1EndPosition))) { return false; } // collect if (nextSpans1StartPosition == nextSpans2StartPosition) { // reset if (nextSpans2StartPosition != lastSpans2StartPosition) { lastSpans2StartPosition = nextSpans2StartPosition; lastSpans2EndPosition = -1; lastSpans2EndPositions.clear(); } while (nextSpans1StartPosition == nextSpans2StartPosition) { if (lastSpans2EndPosition > -1) { lastSpans2EndPositions.add(lastSpans2EndPosition); } lastSpans2EndPosition = nextSpans2EndPosition; nextSpans2StartPosition = spans2.spans.nextStartPosition(); nextSpans2EndPosition = spans2.spans.endPosition(); if (nextSpans1StartPosition == nextSpans2StartPosition && nextSpans1EndPosition == nextSpans2EndPosition) { return false; } } } return true; }
java
private boolean collectAndCheckLastSpans(int nextSpans1StartPosition, int nextSpans1EndPosition) throws IOException { // check next if (nextSpans1StartPosition == nextSpans2StartPosition && nextSpans1EndPosition == nextSpans2EndPosition) { return false; } // check last if (nextSpans1StartPosition == lastSpans2StartPosition && (nextSpans1EndPosition == lastSpans2EndPosition || lastSpans2EndPositions.contains(nextSpans1EndPosition))) { return false; } // collect if (nextSpans1StartPosition == nextSpans2StartPosition) { // reset if (nextSpans2StartPosition != lastSpans2StartPosition) { lastSpans2StartPosition = nextSpans2StartPosition; lastSpans2EndPosition = -1; lastSpans2EndPositions.clear(); } while (nextSpans1StartPosition == nextSpans2StartPosition) { if (lastSpans2EndPosition > -1) { lastSpans2EndPositions.add(lastSpans2EndPosition); } lastSpans2EndPosition = nextSpans2EndPosition; nextSpans2StartPosition = spans2.spans.nextStartPosition(); nextSpans2EndPosition = spans2.spans.endPosition(); if (nextSpans1StartPosition == nextSpans2StartPosition && nextSpans1EndPosition == nextSpans2EndPosition) { return false; } } } return true; }
[ "private", "boolean", "collectAndCheckLastSpans", "(", "int", "nextSpans1StartPosition", ",", "int", "nextSpans1EndPosition", ")", "throws", "IOException", "{", "// check next", "if", "(", "nextSpans1StartPosition", "==", "nextSpans2StartPosition", "&&", "nextSpans1EndPosition", "==", "nextSpans2EndPosition", ")", "{", "return", "false", ";", "}", "// check last", "if", "(", "nextSpans1StartPosition", "==", "lastSpans2StartPosition", "&&", "(", "nextSpans1EndPosition", "==", "lastSpans2EndPosition", "||", "lastSpans2EndPositions", ".", "contains", "(", "nextSpans1EndPosition", ")", ")", ")", "{", "return", "false", ";", "}", "// collect", "if", "(", "nextSpans1StartPosition", "==", "nextSpans2StartPosition", ")", "{", "// reset", "if", "(", "nextSpans2StartPosition", "!=", "lastSpans2StartPosition", ")", "{", "lastSpans2StartPosition", "=", "nextSpans2StartPosition", ";", "lastSpans2EndPosition", "=", "-", "1", ";", "lastSpans2EndPositions", ".", "clear", "(", ")", ";", "}", "while", "(", "nextSpans1StartPosition", "==", "nextSpans2StartPosition", ")", "{", "if", "(", "lastSpans2EndPosition", ">", "-", "1", ")", "{", "lastSpans2EndPositions", ".", "add", "(", "lastSpans2EndPosition", ")", ";", "}", "lastSpans2EndPosition", "=", "nextSpans2EndPosition", ";", "nextSpans2StartPosition", "=", "spans2", ".", "spans", ".", "nextStartPosition", "(", ")", ";", "nextSpans2EndPosition", "=", "spans2", ".", "spans", ".", "endPosition", "(", ")", ";", "if", "(", "nextSpans1StartPosition", "==", "nextSpans2StartPosition", "&&", "nextSpans1EndPosition", "==", "nextSpans2EndPosition", ")", "{", "return", "false", ";", "}", "}", "}", "return", "true", ";", "}" ]
Collect and check last spans. @param nextSpans1StartPosition the next spans 1 start position @param nextSpans1EndPosition the next spans 1 end position @return true, if successful @throws IOException Signals that an I/O exception has occurred.
[ "Collect", "and", "check", "last", "spans", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/search/spans/MtasSpanNotSpans.java#L379-L415
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnnexthopserver.java
vpnnexthopserver.add
public static base_response add(nitro_service client, vpnnexthopserver resource) throws Exception { vpnnexthopserver addresource = new vpnnexthopserver(); addresource.name = resource.name; addresource.nexthopip = resource.nexthopip; addresource.nexthopport = resource.nexthopport; addresource.secure = resource.secure; return addresource.add_resource(client); }
java
public static base_response add(nitro_service client, vpnnexthopserver resource) throws Exception { vpnnexthopserver addresource = new vpnnexthopserver(); addresource.name = resource.name; addresource.nexthopip = resource.nexthopip; addresource.nexthopport = resource.nexthopport; addresource.secure = resource.secure; return addresource.add_resource(client); }
[ "public", "static", "base_response", "add", "(", "nitro_service", "client", ",", "vpnnexthopserver", "resource", ")", "throws", "Exception", "{", "vpnnexthopserver", "addresource", "=", "new", "vpnnexthopserver", "(", ")", ";", "addresource", ".", "name", "=", "resource", ".", "name", ";", "addresource", ".", "nexthopip", "=", "resource", ".", "nexthopip", ";", "addresource", ".", "nexthopport", "=", "resource", ".", "nexthopport", ";", "addresource", ".", "secure", "=", "resource", ".", "secure", ";", "return", "addresource", ".", "add_resource", "(", "client", ")", ";", "}" ]
Use this API to add vpnnexthopserver.
[ "Use", "this", "API", "to", "add", "vpnnexthopserver", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnnexthopserver.java#L159-L166
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnnexthopserver.java
vpnnexthopserver.add
public static base_responses add(nitro_service client, vpnnexthopserver resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { vpnnexthopserver addresources[] = new vpnnexthopserver[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new vpnnexthopserver(); addresources[i].name = resources[i].name; addresources[i].nexthopip = resources[i].nexthopip; addresources[i].nexthopport = resources[i].nexthopport; addresources[i].secure = resources[i].secure; } result = add_bulk_request(client, addresources); } return result; }
java
public static base_responses add(nitro_service client, vpnnexthopserver resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { vpnnexthopserver addresources[] = new vpnnexthopserver[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new vpnnexthopserver(); addresources[i].name = resources[i].name; addresources[i].nexthopip = resources[i].nexthopip; addresources[i].nexthopport = resources[i].nexthopport; addresources[i].secure = resources[i].secure; } result = add_bulk_request(client, addresources); } return result; }
[ "public", "static", "base_responses", "add", "(", "nitro_service", "client", ",", "vpnnexthopserver", "resources", "[", "]", ")", "throws", "Exception", "{", "base_responses", "result", "=", "null", ";", "if", "(", "resources", "!=", "null", "&&", "resources", ".", "length", ">", "0", ")", "{", "vpnnexthopserver", "addresources", "[", "]", "=", "new", "vpnnexthopserver", "[", "resources", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "resources", ".", "length", ";", "i", "++", ")", "{", "addresources", "[", "i", "]", "=", "new", "vpnnexthopserver", "(", ")", ";", "addresources", "[", "i", "]", ".", "name", "=", "resources", "[", "i", "]", ".", "name", ";", "addresources", "[", "i", "]", ".", "nexthopip", "=", "resources", "[", "i", "]", ".", "nexthopip", ";", "addresources", "[", "i", "]", ".", "nexthopport", "=", "resources", "[", "i", "]", ".", "nexthopport", ";", "addresources", "[", "i", "]", ".", "secure", "=", "resources", "[", "i", "]", ".", "secure", ";", "}", "result", "=", "add_bulk_request", "(", "client", ",", "addresources", ")", ";", "}", "return", "result", ";", "}" ]
Use this API to add vpnnexthopserver resources.
[ "Use", "this", "API", "to", "add", "vpnnexthopserver", "resources", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnnexthopserver.java#L171-L185
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnnexthopserver.java
vpnnexthopserver.get
public static vpnnexthopserver[] get(nitro_service service) throws Exception{ vpnnexthopserver obj = new vpnnexthopserver(); vpnnexthopserver[] response = (vpnnexthopserver[])obj.get_resources(service); return response; }
java
public static vpnnexthopserver[] get(nitro_service service) throws Exception{ vpnnexthopserver obj = new vpnnexthopserver(); vpnnexthopserver[] response = (vpnnexthopserver[])obj.get_resources(service); return response; }
[ "public", "static", "vpnnexthopserver", "[", "]", "get", "(", "nitro_service", "service", ")", "throws", "Exception", "{", "vpnnexthopserver", "obj", "=", "new", "vpnnexthopserver", "(", ")", ";", "vpnnexthopserver", "[", "]", "response", "=", "(", "vpnnexthopserver", "[", "]", ")", "obj", ".", "get_resources", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch all the vpnnexthopserver resources that are configured on netscaler.
[ "Use", "this", "API", "to", "fetch", "all", "the", "vpnnexthopserver", "resources", "that", "are", "configured", "on", "netscaler", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnnexthopserver.java#L240-L244
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnnexthopserver.java
vpnnexthopserver.get
public static vpnnexthopserver get(nitro_service service, String name) throws Exception{ vpnnexthopserver obj = new vpnnexthopserver(); obj.set_name(name); vpnnexthopserver response = (vpnnexthopserver) obj.get_resource(service); return response; }
java
public static vpnnexthopserver get(nitro_service service, String name) throws Exception{ vpnnexthopserver obj = new vpnnexthopserver(); obj.set_name(name); vpnnexthopserver response = (vpnnexthopserver) obj.get_resource(service); return response; }
[ "public", "static", "vpnnexthopserver", "get", "(", "nitro_service", "service", ",", "String", "name", ")", "throws", "Exception", "{", "vpnnexthopserver", "obj", "=", "new", "vpnnexthopserver", "(", ")", ";", "obj", ".", "set_name", "(", "name", ")", ";", "vpnnexthopserver", "response", "=", "(", "vpnnexthopserver", ")", "obj", ".", "get_resource", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch vpnnexthopserver resource of given name .
[ "Use", "this", "API", "to", "fetch", "vpnnexthopserver", "resource", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnnexthopserver.java#L256-L261
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/lb/lbvserver_csvserver_binding.java
lbvserver_csvserver_binding.get
public static lbvserver_csvserver_binding[] get(nitro_service service, String name) throws Exception{ lbvserver_csvserver_binding obj = new lbvserver_csvserver_binding(); obj.set_name(name); lbvserver_csvserver_binding response[] = (lbvserver_csvserver_binding[]) obj.get_resources(service); return response; }
java
public static lbvserver_csvserver_binding[] get(nitro_service service, String name) throws Exception{ lbvserver_csvserver_binding obj = new lbvserver_csvserver_binding(); obj.set_name(name); lbvserver_csvserver_binding response[] = (lbvserver_csvserver_binding[]) obj.get_resources(service); return response; }
[ "public", "static", "lbvserver_csvserver_binding", "[", "]", "get", "(", "nitro_service", "service", ",", "String", "name", ")", "throws", "Exception", "{", "lbvserver_csvserver_binding", "obj", "=", "new", "lbvserver_csvserver_binding", "(", ")", ";", "obj", ".", "set_name", "(", "name", ")", ";", "lbvserver_csvserver_binding", "response", "[", "]", "=", "(", "lbvserver_csvserver_binding", "[", "]", ")", "obj", ".", "get_resources", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch lbvserver_csvserver_binding resources of given name .
[ "Use", "this", "API", "to", "fetch", "lbvserver_csvserver_binding", "resources", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/lb/lbvserver_csvserver_binding.java#L193-L198
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nstrafficdomain_vlan_binding.java
nstrafficdomain_vlan_binding.get
public static nstrafficdomain_vlan_binding[] get(nitro_service service, Long td) throws Exception{ nstrafficdomain_vlan_binding obj = new nstrafficdomain_vlan_binding(); obj.set_td(td); nstrafficdomain_vlan_binding response[] = (nstrafficdomain_vlan_binding[]) obj.get_resources(service); return response; }
java
public static nstrafficdomain_vlan_binding[] get(nitro_service service, Long td) throws Exception{ nstrafficdomain_vlan_binding obj = new nstrafficdomain_vlan_binding(); obj.set_td(td); nstrafficdomain_vlan_binding response[] = (nstrafficdomain_vlan_binding[]) obj.get_resources(service); return response; }
[ "public", "static", "nstrafficdomain_vlan_binding", "[", "]", "get", "(", "nitro_service", "service", ",", "Long", "td", ")", "throws", "Exception", "{", "nstrafficdomain_vlan_binding", "obj", "=", "new", "nstrafficdomain_vlan_binding", "(", ")", ";", "obj", ".", "set_td", "(", "td", ")", ";", "nstrafficdomain_vlan_binding", "response", "[", "]", "=", "(", "nstrafficdomain_vlan_binding", "[", "]", ")", "obj", ".", "get_resources", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch nstrafficdomain_vlan_binding resources of given name .
[ "Use", "this", "API", "to", "fetch", "nstrafficdomain_vlan_binding", "resources", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nstrafficdomain_vlan_binding.java#L175-L180
train
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/util/BinaryHeapPriorityQueue.java
BinaryHeapPriorityQueue.getEntry
private Entry<E> getEntry(int index) { Entry<E> entry = indexToEntry.get(index); return entry; }
java
private Entry<E> getEntry(int index) { Entry<E> entry = indexToEntry.get(index); return entry; }
[ "private", "Entry", "<", "E", ">", "getEntry", "(", "int", "index", ")", "{", "Entry", "<", "E", ">", "entry", "=", "indexToEntry", ".", "get", "(", "index", ")", ";", "return", "entry", ";", "}" ]
Get entry by index, exception if none.
[ "Get", "entry", "by", "index", "exception", "if", "none", "." ]
b3d44bab9ec07ace0d13612c448a6b7298c1f681
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/BinaryHeapPriorityQueue.java#L116-L119
train
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/util/BinaryHeapPriorityQueue.java
BinaryHeapPriorityQueue.add
public boolean add(E key, double priority) { // System.err.println("Adding " + key + " with priority " + priority); if (add(key)) { relaxPriority(key, priority); return true; } return false; }
java
public boolean add(E key, double priority) { // System.err.println("Adding " + key + " with priority " + priority); if (add(key)) { relaxPriority(key, priority); return true; } return false; }
[ "public", "boolean", "add", "(", "E", "key", ",", "double", "priority", ")", "{", "// System.err.println(\"Adding \" + key + \" with priority \" + priority);\r", "if", "(", "add", "(", "key", ")", ")", "{", "relaxPriority", "(", "key", ",", "priority", ")", ";", "return", "true", ";", "}", "return", "false", ";", "}" ]
Convenience method for if you want to pretend relaxPriority doesn't exist, or if you really want add's return conditions.
[ "Convenience", "method", "for", "if", "you", "want", "to", "pretend", "relaxPriority", "doesn", "t", "exist", "or", "if", "you", "really", "want", "add", "s", "return", "conditions", "." ]
b3d44bab9ec07ace0d13612c448a6b7298c1f681
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/BinaryHeapPriorityQueue.java#L275-L282
train
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/util/BinaryHeapPriorityQueue.java
BinaryHeapPriorityQueue.relaxPriority
public boolean relaxPriority(E key, double priority) { Entry<E> entry = getEntry(key); if (entry == null) { entry = makeEntry(key); } if (compare(priority, entry.priority) <= 0) { return false; } entry.priority = priority; heapifyUp(entry); return true; }
java
public boolean relaxPriority(E key, double priority) { Entry<E> entry = getEntry(key); if (entry == null) { entry = makeEntry(key); } if (compare(priority, entry.priority) <= 0) { return false; } entry.priority = priority; heapifyUp(entry); return true; }
[ "public", "boolean", "relaxPriority", "(", "E", "key", ",", "double", "priority", ")", "{", "Entry", "<", "E", ">", "entry", "=", "getEntry", "(", "key", ")", ";", "if", "(", "entry", "==", "null", ")", "{", "entry", "=", "makeEntry", "(", "key", ")", ";", "}", "if", "(", "compare", "(", "priority", ",", "entry", ".", "priority", ")", "<=", "0", ")", "{", "return", "false", ";", "}", "entry", ".", "priority", "=", "priority", ";", "heapifyUp", "(", "entry", ")", ";", "return", "true", ";", "}" ]
Promotes a key in the queue, adding it if it wasn't there already. If the specified priority is worse than the current priority, nothing happens. Faster than add if you don't care about whether the key is new. @param key an <code>Object</code> value @return whether the priority actually improved.
[ "Promotes", "a", "key", "in", "the", "queue", "adding", "it", "if", "it", "wasn", "t", "there", "already", ".", "If", "the", "specified", "priority", "is", "worse", "than", "the", "current", "priority", "nothing", "happens", ".", "Faster", "than", "add", "if", "you", "don", "t", "care", "about", "whether", "the", "key", "is", "new", "." ]
b3d44bab9ec07ace0d13612c448a6b7298c1f681
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/BinaryHeapPriorityQueue.java#L318-L329
train
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/util/BinaryHeapPriorityQueue.java
BinaryHeapPriorityQueue.decreasePriority
public boolean decreasePriority(E key, double priority) { Entry<E> entry = getEntry(key); if (entry == null) { entry = makeEntry(key); } if (compare(priority, entry.priority) >= 0) { return false; } entry.priority = priority; heapifyDown(entry); return true; }
java
public boolean decreasePriority(E key, double priority) { Entry<E> entry = getEntry(key); if (entry == null) { entry = makeEntry(key); } if (compare(priority, entry.priority) >= 0) { return false; } entry.priority = priority; heapifyDown(entry); return true; }
[ "public", "boolean", "decreasePriority", "(", "E", "key", ",", "double", "priority", ")", "{", "Entry", "<", "E", ">", "entry", "=", "getEntry", "(", "key", ")", ";", "if", "(", "entry", "==", "null", ")", "{", "entry", "=", "makeEntry", "(", "key", ")", ";", "}", "if", "(", "compare", "(", "priority", ",", "entry", ".", "priority", ")", ">=", "0", ")", "{", "return", "false", ";", "}", "entry", ".", "priority", "=", "priority", ";", "heapifyDown", "(", "entry", ")", ";", "return", "true", ";", "}" ]
Demotes a key in the queue, adding it if it wasn't there already. If the specified priority is better than the current priority, nothing happens. If you decrease the priority on a non-present key, it will get added, but at it's old implicit priority of Double.NEGATIVE_INFINITY. @param key an <code>Object</code> value @return whether the priority actually improved.
[ "Demotes", "a", "key", "in", "the", "queue", "adding", "it", "if", "it", "wasn", "t", "there", "already", ".", "If", "the", "specified", "priority", "is", "better", "than", "the", "current", "priority", "nothing", "happens", ".", "If", "you", "decrease", "the", "priority", "on", "a", "non", "-", "present", "key", "it", "will", "get", "added", "but", "at", "it", "s", "old", "implicit", "priority", "of", "Double", ".", "NEGATIVE_INFINITY", "." ]
b3d44bab9ec07ace0d13612c448a6b7298c1f681
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/BinaryHeapPriorityQueue.java#L337-L348
train
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/util/BinaryHeapPriorityQueue.java
BinaryHeapPriorityQueue.changePriority
public boolean changePriority(E key, double priority) { Entry<E> entry = getEntry(key); if (entry == null) { entry = makeEntry(key); } if (compare(priority, entry.priority) == 0) { return false; } entry.priority = priority; heapify(entry); return true; }
java
public boolean changePriority(E key, double priority) { Entry<E> entry = getEntry(key); if (entry == null) { entry = makeEntry(key); } if (compare(priority, entry.priority) == 0) { return false; } entry.priority = priority; heapify(entry); return true; }
[ "public", "boolean", "changePriority", "(", "E", "key", ",", "double", "priority", ")", "{", "Entry", "<", "E", ">", "entry", "=", "getEntry", "(", "key", ")", ";", "if", "(", "entry", "==", "null", ")", "{", "entry", "=", "makeEntry", "(", "key", ")", ";", "}", "if", "(", "compare", "(", "priority", ",", "entry", ".", "priority", ")", "==", "0", ")", "{", "return", "false", ";", "}", "entry", ".", "priority", "=", "priority", ";", "heapify", "(", "entry", ")", ";", "return", "true", ";", "}" ]
Changes a priority, either up or down, adding the key it if it wasn't there already. @param key an <code>Object</code> value @return whether the priority actually changed.
[ "Changes", "a", "priority", "either", "up", "or", "down", "adding", "the", "key", "it", "if", "it", "wasn", "t", "there", "already", "." ]
b3d44bab9ec07ace0d13612c448a6b7298c1f681
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/BinaryHeapPriorityQueue.java#L356-L367
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/basic/location.java
location.add
public static base_response add(nitro_service client, location resource) throws Exception { location addresource = new location(); addresource.ipfrom = resource.ipfrom; addresource.ipto = resource.ipto; addresource.preferredlocation = resource.preferredlocation; addresource.longitude = resource.longitude; addresource.latitude = resource.latitude; return addresource.add_resource(client); }
java
public static base_response add(nitro_service client, location resource) throws Exception { location addresource = new location(); addresource.ipfrom = resource.ipfrom; addresource.ipto = resource.ipto; addresource.preferredlocation = resource.preferredlocation; addresource.longitude = resource.longitude; addresource.latitude = resource.latitude; return addresource.add_resource(client); }
[ "public", "static", "base_response", "add", "(", "nitro_service", "client", ",", "location", "resource", ")", "throws", "Exception", "{", "location", "addresource", "=", "new", "location", "(", ")", ";", "addresource", ".", "ipfrom", "=", "resource", ".", "ipfrom", ";", "addresource", ".", "ipto", "=", "resource", ".", "ipto", ";", "addresource", ".", "preferredlocation", "=", "resource", ".", "preferredlocation", ";", "addresource", ".", "longitude", "=", "resource", ".", "longitude", ";", "addresource", ".", "latitude", "=", "resource", ".", "latitude", ";", "return", "addresource", ".", "add_resource", "(", "client", ")", ";", "}" ]
Use this API to add location.
[ "Use", "this", "API", "to", "add", "location", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/basic/location.java#L258-L266
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/basic/location.java
location.add
public static base_responses add(nitro_service client, location resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { location addresources[] = new location[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new location(); addresources[i].ipfrom = resources[i].ipfrom; addresources[i].ipto = resources[i].ipto; addresources[i].preferredlocation = resources[i].preferredlocation; addresources[i].longitude = resources[i].longitude; addresources[i].latitude = resources[i].latitude; } result = add_bulk_request(client, addresources); } return result; }
java
public static base_responses add(nitro_service client, location resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { location addresources[] = new location[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new location(); addresources[i].ipfrom = resources[i].ipfrom; addresources[i].ipto = resources[i].ipto; addresources[i].preferredlocation = resources[i].preferredlocation; addresources[i].longitude = resources[i].longitude; addresources[i].latitude = resources[i].latitude; } result = add_bulk_request(client, addresources); } return result; }
[ "public", "static", "base_responses", "add", "(", "nitro_service", "client", ",", "location", "resources", "[", "]", ")", "throws", "Exception", "{", "base_responses", "result", "=", "null", ";", "if", "(", "resources", "!=", "null", "&&", "resources", ".", "length", ">", "0", ")", "{", "location", "addresources", "[", "]", "=", "new", "location", "[", "resources", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "resources", ".", "length", ";", "i", "++", ")", "{", "addresources", "[", "i", "]", "=", "new", "location", "(", ")", ";", "addresources", "[", "i", "]", ".", "ipfrom", "=", "resources", "[", "i", "]", ".", "ipfrom", ";", "addresources", "[", "i", "]", ".", "ipto", "=", "resources", "[", "i", "]", ".", "ipto", ";", "addresources", "[", "i", "]", ".", "preferredlocation", "=", "resources", "[", "i", "]", ".", "preferredlocation", ";", "addresources", "[", "i", "]", ".", "longitude", "=", "resources", "[", "i", "]", ".", "longitude", ";", "addresources", "[", "i", "]", ".", "latitude", "=", "resources", "[", "i", "]", ".", "latitude", ";", "}", "result", "=", "add_bulk_request", "(", "client", ",", "addresources", ")", ";", "}", "return", "result", ";", "}" ]
Use this API to add location resources.
[ "Use", "this", "API", "to", "add", "location", "resources", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/basic/location.java#L271-L286
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/basic/location.java
location.delete
public static base_response delete(nitro_service client, String ipfrom) throws Exception { location deleteresource = new location(); deleteresource.ipfrom = ipfrom; return deleteresource.delete_resource(client); }
java
public static base_response delete(nitro_service client, String ipfrom) throws Exception { location deleteresource = new location(); deleteresource.ipfrom = ipfrom; return deleteresource.delete_resource(client); }
[ "public", "static", "base_response", "delete", "(", "nitro_service", "client", ",", "String", "ipfrom", ")", "throws", "Exception", "{", "location", "deleteresource", "=", "new", "location", "(", ")", ";", "deleteresource", ".", "ipfrom", "=", "ipfrom", ";", "return", "deleteresource", ".", "delete_resource", "(", "client", ")", ";", "}" ]
Use this API to delete location of given name.
[ "Use", "this", "API", "to", "delete", "location", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/basic/location.java#L291-L295
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/basic/location.java
location.delete
public static base_response delete(nitro_service client, location resource) throws Exception { location deleteresource = new location(); deleteresource.ipfrom = resource.ipfrom; deleteresource.ipto = resource.ipto; return deleteresource.delete_resource(client); }
java
public static base_response delete(nitro_service client, location resource) throws Exception { location deleteresource = new location(); deleteresource.ipfrom = resource.ipfrom; deleteresource.ipto = resource.ipto; return deleteresource.delete_resource(client); }
[ "public", "static", "base_response", "delete", "(", "nitro_service", "client", ",", "location", "resource", ")", "throws", "Exception", "{", "location", "deleteresource", "=", "new", "location", "(", ")", ";", "deleteresource", ".", "ipfrom", "=", "resource", ".", "ipfrom", ";", "deleteresource", ".", "ipto", "=", "resource", ".", "ipto", ";", "return", "deleteresource", ".", "delete_resource", "(", "client", ")", ";", "}" ]
Use this API to delete location.
[ "Use", "this", "API", "to", "delete", "location", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/basic/location.java#L300-L305
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/basic/location.java
location.delete
public static base_responses delete(nitro_service client, String ipfrom[]) throws Exception { base_responses result = null; if (ipfrom != null && ipfrom.length > 0) { location deleteresources[] = new location[ipfrom.length]; for (int i=0;i<ipfrom.length;i++){ deleteresources[i] = new location(); deleteresources[i].ipfrom = ipfrom[i]; } result = delete_bulk_request(client, deleteresources); } return result; }
java
public static base_responses delete(nitro_service client, String ipfrom[]) throws Exception { base_responses result = null; if (ipfrom != null && ipfrom.length > 0) { location deleteresources[] = new location[ipfrom.length]; for (int i=0;i<ipfrom.length;i++){ deleteresources[i] = new location(); deleteresources[i].ipfrom = ipfrom[i]; } result = delete_bulk_request(client, deleteresources); } return result; }
[ "public", "static", "base_responses", "delete", "(", "nitro_service", "client", ",", "String", "ipfrom", "[", "]", ")", "throws", "Exception", "{", "base_responses", "result", "=", "null", ";", "if", "(", "ipfrom", "!=", "null", "&&", "ipfrom", ".", "length", ">", "0", ")", "{", "location", "deleteresources", "[", "]", "=", "new", "location", "[", "ipfrom", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "ipfrom", ".", "length", ";", "i", "++", ")", "{", "deleteresources", "[", "i", "]", "=", "new", "location", "(", ")", ";", "deleteresources", "[", "i", "]", ".", "ipfrom", "=", "ipfrom", "[", "i", "]", ";", "}", "result", "=", "delete_bulk_request", "(", "client", ",", "deleteresources", ")", ";", "}", "return", "result", ";", "}" ]
Use this API to delete location resources of given names.
[ "Use", "this", "API", "to", "delete", "location", "resources", "of", "given", "names", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/basic/location.java#L310-L321
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/basic/location.java
location.delete
public static base_responses delete(nitro_service client, location resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { location deleteresources[] = new location[resources.length]; for (int i=0;i<resources.length;i++){ deleteresources[i] = new location(); deleteresources[i].ipfrom = resources[i].ipfrom; deleteresources[i].ipto = resources[i].ipto; } result = delete_bulk_request(client, deleteresources); } return result; }
java
public static base_responses delete(nitro_service client, location resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { location deleteresources[] = new location[resources.length]; for (int i=0;i<resources.length;i++){ deleteresources[i] = new location(); deleteresources[i].ipfrom = resources[i].ipfrom; deleteresources[i].ipto = resources[i].ipto; } result = delete_bulk_request(client, deleteresources); } return result; }
[ "public", "static", "base_responses", "delete", "(", "nitro_service", "client", ",", "location", "resources", "[", "]", ")", "throws", "Exception", "{", "base_responses", "result", "=", "null", ";", "if", "(", "resources", "!=", "null", "&&", "resources", ".", "length", ">", "0", ")", "{", "location", "deleteresources", "[", "]", "=", "new", "location", "[", "resources", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "resources", ".", "length", ";", "i", "++", ")", "{", "deleteresources", "[", "i", "]", "=", "new", "location", "(", ")", ";", "deleteresources", "[", "i", "]", ".", "ipfrom", "=", "resources", "[", "i", "]", ".", "ipfrom", ";", "deleteresources", "[", "i", "]", ".", "ipto", "=", "resources", "[", "i", "]", ".", "ipto", ";", "}", "result", "=", "delete_bulk_request", "(", "client", ",", "deleteresources", ")", ";", "}", "return", "result", ";", "}" ]
Use this API to delete location resources.
[ "Use", "this", "API", "to", "delete", "location", "resources", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/basic/location.java#L326-L338
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/basic/location.java
location.get
public static location[] get(nitro_service service) throws Exception{ location obj = new location(); location[] response = (location[])obj.get_resources(service); return response; }
java
public static location[] get(nitro_service service) throws Exception{ location obj = new location(); location[] response = (location[])obj.get_resources(service); return response; }
[ "public", "static", "location", "[", "]", "get", "(", "nitro_service", "service", ")", "throws", "Exception", "{", "location", "obj", "=", "new", "location", "(", ")", ";", "location", "[", "]", "response", "=", "(", "location", "[", "]", ")", "obj", ".", "get_resources", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch all the location resources that are configured on netscaler.
[ "Use", "this", "API", "to", "fetch", "all", "the", "location", "resources", "that", "are", "configured", "on", "netscaler", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/basic/location.java#L343-L347
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/basic/location.java
location.get
public static location get(nitro_service service, String ipfrom) throws Exception{ location obj = new location(); obj.set_ipfrom(ipfrom); location response = (location) obj.get_resource(service); return response; }
java
public static location get(nitro_service service, String ipfrom) throws Exception{ location obj = new location(); obj.set_ipfrom(ipfrom); location response = (location) obj.get_resource(service); return response; }
[ "public", "static", "location", "get", "(", "nitro_service", "service", ",", "String", "ipfrom", ")", "throws", "Exception", "{", "location", "obj", "=", "new", "location", "(", ")", ";", "obj", ".", "set_ipfrom", "(", "ipfrom", ")", ";", "location", "response", "=", "(", "location", ")", "obj", ".", "get_resource", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch location resource of given name .
[ "Use", "this", "API", "to", "fetch", "location", "resource", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/basic/location.java#L359-L364
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/basic/location.java
location.get
public static location[] get(nitro_service service, String ipfrom[]) throws Exception{ if (ipfrom !=null && ipfrom.length>0) { location response[] = new location[ipfrom.length]; location obj[] = new location[ipfrom.length]; for (int i=0;i<ipfrom.length;i++) { obj[i] = new location(); obj[i].set_ipfrom(ipfrom[i]); response[i] = (location) obj[i].get_resource(service); } return response; } return null; }
java
public static location[] get(nitro_service service, String ipfrom[]) throws Exception{ if (ipfrom !=null && ipfrom.length>0) { location response[] = new location[ipfrom.length]; location obj[] = new location[ipfrom.length]; for (int i=0;i<ipfrom.length;i++) { obj[i] = new location(); obj[i].set_ipfrom(ipfrom[i]); response[i] = (location) obj[i].get_resource(service); } return response; } return null; }
[ "public", "static", "location", "[", "]", "get", "(", "nitro_service", "service", ",", "String", "ipfrom", "[", "]", ")", "throws", "Exception", "{", "if", "(", "ipfrom", "!=", "null", "&&", "ipfrom", ".", "length", ">", "0", ")", "{", "location", "response", "[", "]", "=", "new", "location", "[", "ipfrom", ".", "length", "]", ";", "location", "obj", "[", "]", "=", "new", "location", "[", "ipfrom", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "ipfrom", ".", "length", ";", "i", "++", ")", "{", "obj", "[", "i", "]", "=", "new", "location", "(", ")", ";", "obj", "[", "i", "]", ".", "set_ipfrom", "(", "ipfrom", "[", "i", "]", ")", ";", "response", "[", "i", "]", "=", "(", "location", ")", "obj", "[", "i", "]", ".", "get_resource", "(", "service", ")", ";", "}", "return", "response", ";", "}", "return", "null", ";", "}" ]
Use this API to fetch location resources of given names .
[ "Use", "this", "API", "to", "fetch", "location", "resources", "of", "given", "names", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/basic/location.java#L369-L381
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/basic/location.java
location.get_filtered
public static location[] get_filtered(nitro_service service, filtervalue[] filter) throws Exception{ location obj = new location(); options option = new options(); option.set_filter(filter); location[] response = (location[]) obj.getfiltered(service, option); return response; }
java
public static location[] get_filtered(nitro_service service, filtervalue[] filter) throws Exception{ location obj = new location(); options option = new options(); option.set_filter(filter); location[] response = (location[]) obj.getfiltered(service, option); return response; }
[ "public", "static", "location", "[", "]", "get_filtered", "(", "nitro_service", "service", ",", "filtervalue", "[", "]", "filter", ")", "throws", "Exception", "{", "location", "obj", "=", "new", "location", "(", ")", ";", "options", "option", "=", "new", "options", "(", ")", ";", "option", ".", "set_filter", "(", "filter", ")", ";", "location", "[", "]", "response", "=", "(", "location", "[", "]", ")", "obj", ".", "getfiltered", "(", "service", ",", "option", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch filtered set of location resources. set the filter parameter values in filtervalue object.
[ "Use", "this", "API", "to", "fetch", "filtered", "set", "of", "location", "resources", ".", "set", "the", "filter", "parameter", "values", "in", "filtervalue", "object", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/basic/location.java#L398-L404
train
meertensinstituut/mtas
src/main/java/mtas/solr/handler/component/util/MtasSolrResultMerge.java
MtasSolrResultMerge.mergeNamedList
@SuppressWarnings("unchecked") private void mergeNamedList(ShardRequest sreq, NamedList<Object> mtasResponse, String key, Integer preferredPurpose) { // create new response for key NamedList<Object> mtasListResponse; Object o = mtasResponse.get(key); if (o instanceof NamedList) { mtasListResponse = (NamedList<Object>) o; } else { mtasListResponse = new SimpleOrderedMap<>(); mtasResponse.removeAll(key); mtasResponse.add(key, mtasListResponse); } // collect responses for each shard HashMap<String, NamedList<Object>> mtasListShardResponses = new HashMap<>(); for (ShardResponse response : sreq.responses) { // only continue if new shard or preferred purpose if (mtasListShardResponses.containsKey(response.getShard()) && ((preferredPurpose == null) || (sreq.purpose != preferredPurpose))) { break; } // update try { NamedList<Object> result = response.getSolrResponse().getResponse(); NamedList<Object> data = (NamedList<Object>) result.findRecursive("mtas", key); if (data != null) { mtasListShardResponses.put(response.getShard(), MtasSolrResultUtil.decode(data)); } } catch (ClassCastException e) { log.debug(e); } } try { for (NamedList<Object> mtasListShardResponse : mtasListShardResponses.values()) { mergeResponsesNamedList(mtasListResponse, mtasListShardResponse); } } catch (IOException e) { log.error(e); } }
java
@SuppressWarnings("unchecked") private void mergeNamedList(ShardRequest sreq, NamedList<Object> mtasResponse, String key, Integer preferredPurpose) { // create new response for key NamedList<Object> mtasListResponse; Object o = mtasResponse.get(key); if (o instanceof NamedList) { mtasListResponse = (NamedList<Object>) o; } else { mtasListResponse = new SimpleOrderedMap<>(); mtasResponse.removeAll(key); mtasResponse.add(key, mtasListResponse); } // collect responses for each shard HashMap<String, NamedList<Object>> mtasListShardResponses = new HashMap<>(); for (ShardResponse response : sreq.responses) { // only continue if new shard or preferred purpose if (mtasListShardResponses.containsKey(response.getShard()) && ((preferredPurpose == null) || (sreq.purpose != preferredPurpose))) { break; } // update try { NamedList<Object> result = response.getSolrResponse().getResponse(); NamedList<Object> data = (NamedList<Object>) result.findRecursive("mtas", key); if (data != null) { mtasListShardResponses.put(response.getShard(), MtasSolrResultUtil.decode(data)); } } catch (ClassCastException e) { log.debug(e); } } try { for (NamedList<Object> mtasListShardResponse : mtasListShardResponses.values()) { mergeResponsesNamedList(mtasListResponse, mtasListShardResponse); } } catch (IOException e) { log.error(e); } }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "void", "mergeNamedList", "(", "ShardRequest", "sreq", ",", "NamedList", "<", "Object", ">", "mtasResponse", ",", "String", "key", ",", "Integer", "preferredPurpose", ")", "{", "// create new response for key", "NamedList", "<", "Object", ">", "mtasListResponse", ";", "Object", "o", "=", "mtasResponse", ".", "get", "(", "key", ")", ";", "if", "(", "o", "instanceof", "NamedList", ")", "{", "mtasListResponse", "=", "(", "NamedList", "<", "Object", ">", ")", "o", ";", "}", "else", "{", "mtasListResponse", "=", "new", "SimpleOrderedMap", "<>", "(", ")", ";", "mtasResponse", ".", "removeAll", "(", "key", ")", ";", "mtasResponse", ".", "add", "(", "key", ",", "mtasListResponse", ")", ";", "}", "// collect responses for each shard", "HashMap", "<", "String", ",", "NamedList", "<", "Object", ">", ">", "mtasListShardResponses", "=", "new", "HashMap", "<>", "(", ")", ";", "for", "(", "ShardResponse", "response", ":", "sreq", ".", "responses", ")", "{", "// only continue if new shard or preferred purpose", "if", "(", "mtasListShardResponses", ".", "containsKey", "(", "response", ".", "getShard", "(", ")", ")", "&&", "(", "(", "preferredPurpose", "==", "null", ")", "||", "(", "sreq", ".", "purpose", "!=", "preferredPurpose", ")", ")", ")", "{", "break", ";", "}", "// update", "try", "{", "NamedList", "<", "Object", ">", "result", "=", "response", ".", "getSolrResponse", "(", ")", ".", "getResponse", "(", ")", ";", "NamedList", "<", "Object", ">", "data", "=", "(", "NamedList", "<", "Object", ">", ")", "result", ".", "findRecursive", "(", "\"mtas\"", ",", "key", ")", ";", "if", "(", "data", "!=", "null", ")", "{", "mtasListShardResponses", ".", "put", "(", "response", ".", "getShard", "(", ")", ",", "MtasSolrResultUtil", ".", "decode", "(", "data", ")", ")", ";", "}", "}", "catch", "(", "ClassCastException", "e", ")", "{", "log", ".", "debug", "(", "e", ")", ";", "}", "}", "try", "{", "for", "(", "NamedList", "<", "Object", ">", "mtasListShardResponse", ":", "mtasListShardResponses", ".", "values", "(", ")", ")", "{", "mergeResponsesNamedList", "(", "mtasListResponse", ",", "mtasListShardResponse", ")", ";", "}", "}", "catch", "(", "IOException", "e", ")", "{", "log", ".", "error", "(", "e", ")", ";", "}", "}" ]
Merge named list. @param sreq the sreq @param mtasResponse the mtas response @param key the key @param preferredPurpose the preferred purpose
[ "Merge", "named", "list", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/solr/handler/component/util/MtasSolrResultMerge.java#L124-L163
train
meertensinstituut/mtas
src/main/java/mtas/solr/handler/component/util/MtasSolrResultMerge.java
MtasSolrResultMerge.mergeArrayList
@SuppressWarnings("unchecked") private void mergeArrayList(ShardRequest sreq, NamedList<Object> mtasResponse, String key, Integer preferredPurpose, boolean mergeAllShardResponses) { // create new response for key ArrayList<Object> mtasListResponse; Object o = mtasResponse.get(key); if (o instanceof ArrayList) { mtasListResponse = (ArrayList<Object>) o; } else { mtasListResponse = new ArrayList<>(); mtasResponse.removeAll(key); mtasResponse.add(key, mtasListResponse); } // collect responses for each shard HashMap<String, ArrayList<Object>> mtasListShardResponses = new HashMap<>(); ArrayList<ArrayList<Object>> mtasListShardResponsesExtra = new ArrayList<>(); for (ShardResponse response : sreq.responses) { // only continue if new shard or preferred purpose if (mtasListShardResponses.containsKey(response.getShard()) && ((preferredPurpose == null) || (sreq.purpose != preferredPurpose))) { break; } // update try { NamedList<Object> result = response.getSolrResponse().getResponse(); ArrayList<Object> data = (ArrayList<Object>) result.findRecursive("mtas", key); if (data != null) { if (mtasListShardResponses.containsKey(response.getShardAddress())) { if (mergeAllShardResponses) { mtasListShardResponsesExtra.add(data); } } else { mtasListShardResponses.put(response.getShardAddress(), data); } } } catch (ClassCastException e) { log.error(e); } } try { for (ArrayList<Object> mtasListShardResponse : mtasListShardResponses.values()) { mergeResponsesArrayList(mtasListResponse, mtasListShardResponse); } for (ArrayList<Object> mtasListShardResponse : mtasListShardResponsesExtra) { mergeResponsesArrayList(mtasListResponse, mtasListShardResponse); } } catch (IOException e) { log.error(e); } }
java
@SuppressWarnings("unchecked") private void mergeArrayList(ShardRequest sreq, NamedList<Object> mtasResponse, String key, Integer preferredPurpose, boolean mergeAllShardResponses) { // create new response for key ArrayList<Object> mtasListResponse; Object o = mtasResponse.get(key); if (o instanceof ArrayList) { mtasListResponse = (ArrayList<Object>) o; } else { mtasListResponse = new ArrayList<>(); mtasResponse.removeAll(key); mtasResponse.add(key, mtasListResponse); } // collect responses for each shard HashMap<String, ArrayList<Object>> mtasListShardResponses = new HashMap<>(); ArrayList<ArrayList<Object>> mtasListShardResponsesExtra = new ArrayList<>(); for (ShardResponse response : sreq.responses) { // only continue if new shard or preferred purpose if (mtasListShardResponses.containsKey(response.getShard()) && ((preferredPurpose == null) || (sreq.purpose != preferredPurpose))) { break; } // update try { NamedList<Object> result = response.getSolrResponse().getResponse(); ArrayList<Object> data = (ArrayList<Object>) result.findRecursive("mtas", key); if (data != null) { if (mtasListShardResponses.containsKey(response.getShardAddress())) { if (mergeAllShardResponses) { mtasListShardResponsesExtra.add(data); } } else { mtasListShardResponses.put(response.getShardAddress(), data); } } } catch (ClassCastException e) { log.error(e); } } try { for (ArrayList<Object> mtasListShardResponse : mtasListShardResponses.values()) { mergeResponsesArrayList(mtasListResponse, mtasListShardResponse); } for (ArrayList<Object> mtasListShardResponse : mtasListShardResponsesExtra) { mergeResponsesArrayList(mtasListResponse, mtasListShardResponse); } } catch (IOException e) { log.error(e); } }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "void", "mergeArrayList", "(", "ShardRequest", "sreq", ",", "NamedList", "<", "Object", ">", "mtasResponse", ",", "String", "key", ",", "Integer", "preferredPurpose", ",", "boolean", "mergeAllShardResponses", ")", "{", "// create new response for key", "ArrayList", "<", "Object", ">", "mtasListResponse", ";", "Object", "o", "=", "mtasResponse", ".", "get", "(", "key", ")", ";", "if", "(", "o", "instanceof", "ArrayList", ")", "{", "mtasListResponse", "=", "(", "ArrayList", "<", "Object", ">", ")", "o", ";", "}", "else", "{", "mtasListResponse", "=", "new", "ArrayList", "<>", "(", ")", ";", "mtasResponse", ".", "removeAll", "(", "key", ")", ";", "mtasResponse", ".", "add", "(", "key", ",", "mtasListResponse", ")", ";", "}", "// collect responses for each shard", "HashMap", "<", "String", ",", "ArrayList", "<", "Object", ">", ">", "mtasListShardResponses", "=", "new", "HashMap", "<>", "(", ")", ";", "ArrayList", "<", "ArrayList", "<", "Object", ">", ">", "mtasListShardResponsesExtra", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "ShardResponse", "response", ":", "sreq", ".", "responses", ")", "{", "// only continue if new shard or preferred purpose", "if", "(", "mtasListShardResponses", ".", "containsKey", "(", "response", ".", "getShard", "(", ")", ")", "&&", "(", "(", "preferredPurpose", "==", "null", ")", "||", "(", "sreq", ".", "purpose", "!=", "preferredPurpose", ")", ")", ")", "{", "break", ";", "}", "// update", "try", "{", "NamedList", "<", "Object", ">", "result", "=", "response", ".", "getSolrResponse", "(", ")", ".", "getResponse", "(", ")", ";", "ArrayList", "<", "Object", ">", "data", "=", "(", "ArrayList", "<", "Object", ">", ")", "result", ".", "findRecursive", "(", "\"mtas\"", ",", "key", ")", ";", "if", "(", "data", "!=", "null", ")", "{", "if", "(", "mtasListShardResponses", ".", "containsKey", "(", "response", ".", "getShardAddress", "(", ")", ")", ")", "{", "if", "(", "mergeAllShardResponses", ")", "{", "mtasListShardResponsesExtra", ".", "add", "(", "data", ")", ";", "}", "}", "else", "{", "mtasListShardResponses", ".", "put", "(", "response", ".", "getShardAddress", "(", ")", ",", "data", ")", ";", "}", "}", "}", "catch", "(", "ClassCastException", "e", ")", "{", "log", ".", "error", "(", "e", ")", ";", "}", "}", "try", "{", "for", "(", "ArrayList", "<", "Object", ">", "mtasListShardResponse", ":", "mtasListShardResponses", ".", "values", "(", ")", ")", "{", "mergeResponsesArrayList", "(", "mtasListResponse", ",", "mtasListShardResponse", ")", ";", "}", "for", "(", "ArrayList", "<", "Object", ">", "mtasListShardResponse", ":", "mtasListShardResponsesExtra", ")", "{", "mergeResponsesArrayList", "(", "mtasListResponse", ",", "mtasListShardResponse", ")", ";", "}", "}", "catch", "(", "IOException", "e", ")", "{", "log", ".", "error", "(", "e", ")", ";", "}", "}" ]
Merge array list. @param sreq the sreq @param mtasResponse the mtas response @param key the key @param preferredPurpose the preferred purpose @param mergeAllShardResponses the merge all shard responses
[ "Merge", "array", "list", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/solr/handler/component/util/MtasSolrResultMerge.java#L179-L229
train
meertensinstituut/mtas
src/main/java/mtas/solr/handler/component/util/MtasSolrResultMerge.java
MtasSolrResultMerge.mergeResponsesSortedSet
private void mergeResponsesSortedSet(SortedSet<Object> originalList, SortedSet<Object> shardList) { for (Object item : shardList) { originalList.add(item); } }
java
private void mergeResponsesSortedSet(SortedSet<Object> originalList, SortedSet<Object> shardList) { for (Object item : shardList) { originalList.add(item); } }
[ "private", "void", "mergeResponsesSortedSet", "(", "SortedSet", "<", "Object", ">", "originalList", ",", "SortedSet", "<", "Object", ">", "shardList", ")", "{", "for", "(", "Object", "item", ":", "shardList", ")", "{", "originalList", ".", "add", "(", "item", ")", ";", "}", "}" ]
Merge responses sorted set. @param originalList the original list @param shardList the shard list
[ "Merge", "responses", "sorted", "set", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/solr/handler/component/util/MtasSolrResultMerge.java#L239-L243
train
meertensinstituut/mtas
src/main/java/mtas/solr/handler/component/util/MtasSolrResultMerge.java
MtasSolrResultMerge.mergeResponsesArrayList
@SuppressWarnings("unchecked") private void mergeResponsesArrayList(ArrayList<Object> originalList, ArrayList<Object> shardList) throws IOException { // get keys from original HashMap<String, Object> originalKeyList = new HashMap<>(); for (Object item : originalList) { if (item instanceof NamedList<?>) { NamedList<Object> itemList = (NamedList<Object>) item; Object key = itemList.get("key"); if ((key != null) && (key instanceof String)) { originalKeyList.put((String) key, item); } } } for (Object item : shardList) { if (item instanceof NamedList<?>) { NamedList<Object> itemList = (NamedList<Object>) item; Object key = itemList.get("key"); // item with key if ((key != null) && (key instanceof String)) { // merge if (originalKeyList.containsKey(key)) { Object originalItem = originalKeyList.get(key); if (originalItem.getClass().equals(item.getClass())) { mergeResponsesNamedList((NamedList<Object>) originalItem, (NamedList<Object>) item); } else { // ignore? } // add } else { Object clonedItem = adjustablePartsCloned(item); originalList.add(clonedItem); originalKeyList.put((String) key, clonedItem); } } else { originalList.add(item); } } else { originalList.add(item); } } }
java
@SuppressWarnings("unchecked") private void mergeResponsesArrayList(ArrayList<Object> originalList, ArrayList<Object> shardList) throws IOException { // get keys from original HashMap<String, Object> originalKeyList = new HashMap<>(); for (Object item : originalList) { if (item instanceof NamedList<?>) { NamedList<Object> itemList = (NamedList<Object>) item; Object key = itemList.get("key"); if ((key != null) && (key instanceof String)) { originalKeyList.put((String) key, item); } } } for (Object item : shardList) { if (item instanceof NamedList<?>) { NamedList<Object> itemList = (NamedList<Object>) item; Object key = itemList.get("key"); // item with key if ((key != null) && (key instanceof String)) { // merge if (originalKeyList.containsKey(key)) { Object originalItem = originalKeyList.get(key); if (originalItem.getClass().equals(item.getClass())) { mergeResponsesNamedList((NamedList<Object>) originalItem, (NamedList<Object>) item); } else { // ignore? } // add } else { Object clonedItem = adjustablePartsCloned(item); originalList.add(clonedItem); originalKeyList.put((String) key, clonedItem); } } else { originalList.add(item); } } else { originalList.add(item); } } }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "void", "mergeResponsesArrayList", "(", "ArrayList", "<", "Object", ">", "originalList", ",", "ArrayList", "<", "Object", ">", "shardList", ")", "throws", "IOException", "{", "// get keys from original", "HashMap", "<", "String", ",", "Object", ">", "originalKeyList", "=", "new", "HashMap", "<>", "(", ")", ";", "for", "(", "Object", "item", ":", "originalList", ")", "{", "if", "(", "item", "instanceof", "NamedList", "<", "?", ">", ")", "{", "NamedList", "<", "Object", ">", "itemList", "=", "(", "NamedList", "<", "Object", ">", ")", "item", ";", "Object", "key", "=", "itemList", ".", "get", "(", "\"key\"", ")", ";", "if", "(", "(", "key", "!=", "null", ")", "&&", "(", "key", "instanceof", "String", ")", ")", "{", "originalKeyList", ".", "put", "(", "(", "String", ")", "key", ",", "item", ")", ";", "}", "}", "}", "for", "(", "Object", "item", ":", "shardList", ")", "{", "if", "(", "item", "instanceof", "NamedList", "<", "?", ">", ")", "{", "NamedList", "<", "Object", ">", "itemList", "=", "(", "NamedList", "<", "Object", ">", ")", "item", ";", "Object", "key", "=", "itemList", ".", "get", "(", "\"key\"", ")", ";", "// item with key", "if", "(", "(", "key", "!=", "null", ")", "&&", "(", "key", "instanceof", "String", ")", ")", "{", "// merge", "if", "(", "originalKeyList", ".", "containsKey", "(", "key", ")", ")", "{", "Object", "originalItem", "=", "originalKeyList", ".", "get", "(", "key", ")", ";", "if", "(", "originalItem", ".", "getClass", "(", ")", ".", "equals", "(", "item", ".", "getClass", "(", ")", ")", ")", "{", "mergeResponsesNamedList", "(", "(", "NamedList", "<", "Object", ">", ")", "originalItem", ",", "(", "NamedList", "<", "Object", ">", ")", "item", ")", ";", "}", "else", "{", "// ignore?", "}", "// add", "}", "else", "{", "Object", "clonedItem", "=", "adjustablePartsCloned", "(", "item", ")", ";", "originalList", ".", "add", "(", "clonedItem", ")", ";", "originalKeyList", ".", "put", "(", "(", "String", ")", "key", ",", "clonedItem", ")", ";", "}", "}", "else", "{", "originalList", ".", "add", "(", "item", ")", ";", "}", "}", "else", "{", "originalList", ".", "add", "(", "item", ")", ";", "}", "}", "}" ]
Merge responses array list. @param originalList the original list @param shardList the shard list @throws IOException Signals that an I/O exception has occurred.
[ "Merge", "responses", "array", "list", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/solr/handler/component/util/MtasSolrResultMerge.java#L255-L296
train
meertensinstituut/mtas
src/main/java/mtas/solr/handler/component/util/MtasSolrResultMerge.java
MtasSolrResultMerge.mergeResponsesNamedList
@SuppressWarnings({ "rawtypes", "unchecked" }) private void mergeResponsesNamedList(NamedList<Object> mainResponse, NamedList<Object> shardResponse) throws IOException { Iterator<Entry<String, Object>> it = shardResponse.iterator(); while (it.hasNext()) { Entry<String, Object> entry = it.next(); String name = entry.getKey(); Object shardValue = entry.getValue(); int originalId = mainResponse.indexOf(name, 0); if (originalId < 0) { mainResponse.add(name, adjustablePartsCloned(shardValue)); } else { Object original = mainResponse.getVal(originalId); if (original == null) { original = adjustablePartsCloned(shardValue); } else if (shardValue != null && original.getClass().equals(shardValue.getClass())) { // merge ArrayList if (original instanceof ArrayList) { ArrayList originalList = (ArrayList) original; ArrayList shardList = (ArrayList) shardValue; mergeResponsesArrayList(originalList, shardList); // merge Namedlist } else if (original instanceof NamedList<?>) { mergeResponsesNamedList((NamedList<Object>) original, (NamedList<Object>) shardValue); // merge SortedSet } else if (original instanceof SortedSet<?>) { mergeResponsesSortedSet((SortedSet<Object>) original, (SortedSet<Object>) shardValue); } else if (original instanceof MtasSolrMtasResult) { MtasSolrMtasResult originalComponentResult = (MtasSolrMtasResult) original; originalComponentResult.merge((MtasSolrMtasResult) shardValue); } else if (original instanceof MtasSolrCollectionResult) { MtasSolrCollectionResult originalComponentResult = (MtasSolrCollectionResult) original; originalComponentResult.merge((MtasSolrCollectionResult) shardValue); } else if (original instanceof String) { // ignore? } else if (original instanceof Integer) { original = (Integer) original + ((Integer) shardValue); } else if (original instanceof Long) { original = (Long) original + ((Long) shardValue); } else { // ignore? } mainResponse.setVal(originalId, original); } else { // ignore? } } } }
java
@SuppressWarnings({ "rawtypes", "unchecked" }) private void mergeResponsesNamedList(NamedList<Object> mainResponse, NamedList<Object> shardResponse) throws IOException { Iterator<Entry<String, Object>> it = shardResponse.iterator(); while (it.hasNext()) { Entry<String, Object> entry = it.next(); String name = entry.getKey(); Object shardValue = entry.getValue(); int originalId = mainResponse.indexOf(name, 0); if (originalId < 0) { mainResponse.add(name, adjustablePartsCloned(shardValue)); } else { Object original = mainResponse.getVal(originalId); if (original == null) { original = adjustablePartsCloned(shardValue); } else if (shardValue != null && original.getClass().equals(shardValue.getClass())) { // merge ArrayList if (original instanceof ArrayList) { ArrayList originalList = (ArrayList) original; ArrayList shardList = (ArrayList) shardValue; mergeResponsesArrayList(originalList, shardList); // merge Namedlist } else if (original instanceof NamedList<?>) { mergeResponsesNamedList((NamedList<Object>) original, (NamedList<Object>) shardValue); // merge SortedSet } else if (original instanceof SortedSet<?>) { mergeResponsesSortedSet((SortedSet<Object>) original, (SortedSet<Object>) shardValue); } else if (original instanceof MtasSolrMtasResult) { MtasSolrMtasResult originalComponentResult = (MtasSolrMtasResult) original; originalComponentResult.merge((MtasSolrMtasResult) shardValue); } else if (original instanceof MtasSolrCollectionResult) { MtasSolrCollectionResult originalComponentResult = (MtasSolrCollectionResult) original; originalComponentResult.merge((MtasSolrCollectionResult) shardValue); } else if (original instanceof String) { // ignore? } else if (original instanceof Integer) { original = (Integer) original + ((Integer) shardValue); } else if (original instanceof Long) { original = (Long) original + ((Long) shardValue); } else { // ignore? } mainResponse.setVal(originalId, original); } else { // ignore? } } } }
[ "@", "SuppressWarnings", "(", "{", "\"rawtypes\"", ",", "\"unchecked\"", "}", ")", "private", "void", "mergeResponsesNamedList", "(", "NamedList", "<", "Object", ">", "mainResponse", ",", "NamedList", "<", "Object", ">", "shardResponse", ")", "throws", "IOException", "{", "Iterator", "<", "Entry", "<", "String", ",", "Object", ">", ">", "it", "=", "shardResponse", ".", "iterator", "(", ")", ";", "while", "(", "it", ".", "hasNext", "(", ")", ")", "{", "Entry", "<", "String", ",", "Object", ">", "entry", "=", "it", ".", "next", "(", ")", ";", "String", "name", "=", "entry", ".", "getKey", "(", ")", ";", "Object", "shardValue", "=", "entry", ".", "getValue", "(", ")", ";", "int", "originalId", "=", "mainResponse", ".", "indexOf", "(", "name", ",", "0", ")", ";", "if", "(", "originalId", "<", "0", ")", "{", "mainResponse", ".", "add", "(", "name", ",", "adjustablePartsCloned", "(", "shardValue", ")", ")", ";", "}", "else", "{", "Object", "original", "=", "mainResponse", ".", "getVal", "(", "originalId", ")", ";", "if", "(", "original", "==", "null", ")", "{", "original", "=", "adjustablePartsCloned", "(", "shardValue", ")", ";", "}", "else", "if", "(", "shardValue", "!=", "null", "&&", "original", ".", "getClass", "(", ")", ".", "equals", "(", "shardValue", ".", "getClass", "(", ")", ")", ")", "{", "// merge ArrayList", "if", "(", "original", "instanceof", "ArrayList", ")", "{", "ArrayList", "originalList", "=", "(", "ArrayList", ")", "original", ";", "ArrayList", "shardList", "=", "(", "ArrayList", ")", "shardValue", ";", "mergeResponsesArrayList", "(", "originalList", ",", "shardList", ")", ";", "// merge Namedlist", "}", "else", "if", "(", "original", "instanceof", "NamedList", "<", "?", ">", ")", "{", "mergeResponsesNamedList", "(", "(", "NamedList", "<", "Object", ">", ")", "original", ",", "(", "NamedList", "<", "Object", ">", ")", "shardValue", ")", ";", "// merge SortedSet", "}", "else", "if", "(", "original", "instanceof", "SortedSet", "<", "?", ">", ")", "{", "mergeResponsesSortedSet", "(", "(", "SortedSet", "<", "Object", ">", ")", "original", ",", "(", "SortedSet", "<", "Object", ">", ")", "shardValue", ")", ";", "}", "else", "if", "(", "original", "instanceof", "MtasSolrMtasResult", ")", "{", "MtasSolrMtasResult", "originalComponentResult", "=", "(", "MtasSolrMtasResult", ")", "original", ";", "originalComponentResult", ".", "merge", "(", "(", "MtasSolrMtasResult", ")", "shardValue", ")", ";", "}", "else", "if", "(", "original", "instanceof", "MtasSolrCollectionResult", ")", "{", "MtasSolrCollectionResult", "originalComponentResult", "=", "(", "MtasSolrCollectionResult", ")", "original", ";", "originalComponentResult", ".", "merge", "(", "(", "MtasSolrCollectionResult", ")", "shardValue", ")", ";", "}", "else", "if", "(", "original", "instanceof", "String", ")", "{", "// ignore?", "}", "else", "if", "(", "original", "instanceof", "Integer", ")", "{", "original", "=", "(", "Integer", ")", "original", "+", "(", "(", "Integer", ")", "shardValue", ")", ";", "}", "else", "if", "(", "original", "instanceof", "Long", ")", "{", "original", "=", "(", "Long", ")", "original", "+", "(", "(", "Long", ")", "shardValue", ")", ";", "}", "else", "{", "// ignore?", "}", "mainResponse", ".", "setVal", "(", "originalId", ",", "original", ")", ";", "}", "else", "{", "// ignore?", "}", "}", "}", "}" ]
Merge responses named list. @param mainResponse the main response @param shardResponse the shard response @throws IOException Signals that an I/O exception has occurred.
[ "Merge", "responses", "named", "list", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/solr/handler/component/util/MtasSolrResultMerge.java#L308-L356
train
meertensinstituut/mtas
src/main/java/mtas/solr/handler/component/util/MtasSolrResultMerge.java
MtasSolrResultMerge.adjustablePartsCloned
@SuppressWarnings({ "rawtypes", "unchecked" }) private Object adjustablePartsCloned(Object original) { if (original instanceof NamedList) { NamedList<Object> newObject = new SimpleOrderedMap(); NamedList<Object> originalObject = (NamedList<Object>) original; for (int i = 0; i < originalObject.size(); i++) { newObject.add(originalObject.getName(i), adjustablePartsCloned(originalObject.getVal(i))); } return newObject; } else if (original instanceof ArrayList) { ArrayList<Object> newObject = new ArrayList<>(); ArrayList<Object> originalObject = (ArrayList<Object>) original; for (int i = 0; i < originalObject.size(); i++) { newObject.add(adjustablePartsCloned(originalObject.get(i))); } return newObject; } else if (original instanceof Integer) { return original; } return original; }
java
@SuppressWarnings({ "rawtypes", "unchecked" }) private Object adjustablePartsCloned(Object original) { if (original instanceof NamedList) { NamedList<Object> newObject = new SimpleOrderedMap(); NamedList<Object> originalObject = (NamedList<Object>) original; for (int i = 0; i < originalObject.size(); i++) { newObject.add(originalObject.getName(i), adjustablePartsCloned(originalObject.getVal(i))); } return newObject; } else if (original instanceof ArrayList) { ArrayList<Object> newObject = new ArrayList<>(); ArrayList<Object> originalObject = (ArrayList<Object>) original; for (int i = 0; i < originalObject.size(); i++) { newObject.add(adjustablePartsCloned(originalObject.get(i))); } return newObject; } else if (original instanceof Integer) { return original; } return original; }
[ "@", "SuppressWarnings", "(", "{", "\"rawtypes\"", ",", "\"unchecked\"", "}", ")", "private", "Object", "adjustablePartsCloned", "(", "Object", "original", ")", "{", "if", "(", "original", "instanceof", "NamedList", ")", "{", "NamedList", "<", "Object", ">", "newObject", "=", "new", "SimpleOrderedMap", "(", ")", ";", "NamedList", "<", "Object", ">", "originalObject", "=", "(", "NamedList", "<", "Object", ">", ")", "original", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "originalObject", ".", "size", "(", ")", ";", "i", "++", ")", "{", "newObject", ".", "add", "(", "originalObject", ".", "getName", "(", "i", ")", ",", "adjustablePartsCloned", "(", "originalObject", ".", "getVal", "(", "i", ")", ")", ")", ";", "}", "return", "newObject", ";", "}", "else", "if", "(", "original", "instanceof", "ArrayList", ")", "{", "ArrayList", "<", "Object", ">", "newObject", "=", "new", "ArrayList", "<>", "(", ")", ";", "ArrayList", "<", "Object", ">", "originalObject", "=", "(", "ArrayList", "<", "Object", ">", ")", "original", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "originalObject", ".", "size", "(", ")", ";", "i", "++", ")", "{", "newObject", ".", "add", "(", "adjustablePartsCloned", "(", "originalObject", ".", "get", "(", "i", ")", ")", ")", ";", "}", "return", "newObject", ";", "}", "else", "if", "(", "original", "instanceof", "Integer", ")", "{", "return", "original", ";", "}", "return", "original", ";", "}" ]
Adjustable parts cloned. @param original the original @return the object
[ "Adjustable", "parts", "cloned", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/solr/handler/component/util/MtasSolrResultMerge.java#L365-L385
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/ssl/sslcertkey_service_binding.java
sslcertkey_service_binding.get
public static sslcertkey_service_binding[] get(nitro_service service, String certkey) throws Exception{ sslcertkey_service_binding obj = new sslcertkey_service_binding(); obj.set_certkey(certkey); sslcertkey_service_binding response[] = (sslcertkey_service_binding[]) obj.get_resources(service); return response; }
java
public static sslcertkey_service_binding[] get(nitro_service service, String certkey) throws Exception{ sslcertkey_service_binding obj = new sslcertkey_service_binding(); obj.set_certkey(certkey); sslcertkey_service_binding response[] = (sslcertkey_service_binding[]) obj.get_resources(service); return response; }
[ "public", "static", "sslcertkey_service_binding", "[", "]", "get", "(", "nitro_service", "service", ",", "String", "certkey", ")", "throws", "Exception", "{", "sslcertkey_service_binding", "obj", "=", "new", "sslcertkey_service_binding", "(", ")", ";", "obj", ".", "set_certkey", "(", "certkey", ")", ";", "sslcertkey_service_binding", "response", "[", "]", "=", "(", "sslcertkey_service_binding", "[", "]", ")", "obj", ".", "get_resources", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch sslcertkey_service_binding resources of given name .
[ "Use", "this", "API", "to", "fetch", "sslcertkey_service_binding", "resources", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/ssl/sslcertkey_service_binding.java#L232-L237
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/cs/csvserver_responderpolicy_binding.java
csvserver_responderpolicy_binding.get
public static csvserver_responderpolicy_binding[] get(nitro_service service, String name) throws Exception{ csvserver_responderpolicy_binding obj = new csvserver_responderpolicy_binding(); obj.set_name(name); csvserver_responderpolicy_binding response[] = (csvserver_responderpolicy_binding[]) obj.get_resources(service); return response; }
java
public static csvserver_responderpolicy_binding[] get(nitro_service service, String name) throws Exception{ csvserver_responderpolicy_binding obj = new csvserver_responderpolicy_binding(); obj.set_name(name); csvserver_responderpolicy_binding response[] = (csvserver_responderpolicy_binding[]) obj.get_resources(service); return response; }
[ "public", "static", "csvserver_responderpolicy_binding", "[", "]", "get", "(", "nitro_service", "service", ",", "String", "name", ")", "throws", "Exception", "{", "csvserver_responderpolicy_binding", "obj", "=", "new", "csvserver_responderpolicy_binding", "(", ")", ";", "obj", ".", "set_name", "(", "name", ")", ";", "csvserver_responderpolicy_binding", "response", "[", "]", "=", "(", "csvserver_responderpolicy_binding", "[", "]", ")", "obj", ".", "get_resources", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch csvserver_responderpolicy_binding resources of given name .
[ "Use", "this", "API", "to", "fetch", "csvserver_responderpolicy_binding", "resources", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/cs/csvserver_responderpolicy_binding.java#L327-L332
train
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/trees/TreeGraphNode.java
TreeGraphNode.addArc
@SuppressWarnings("unchecked") public <GR extends GrammaticalRelationAnnotation> boolean addArc(Class<GR> arcLabel, TreeGraphNode node) { if (node == null) { return false; } if (!treeGraph().equals(node.treeGraph())) { System.err.println("Warning: you are trying to add an arc from node " + this + " to node " + node + ", but they do not belong to the same TreeGraph!"); } if (!label.containsKey(arcLabel)) { label.set(arcLabel, new HashSet<TreeGraphNode>()); } return ((Collection) label.get(arcLabel)).add(node); }
java
@SuppressWarnings("unchecked") public <GR extends GrammaticalRelationAnnotation> boolean addArc(Class<GR> arcLabel, TreeGraphNode node) { if (node == null) { return false; } if (!treeGraph().equals(node.treeGraph())) { System.err.println("Warning: you are trying to add an arc from node " + this + " to node " + node + ", but they do not belong to the same TreeGraph!"); } if (!label.containsKey(arcLabel)) { label.set(arcLabel, new HashSet<TreeGraphNode>()); } return ((Collection) label.get(arcLabel)).add(node); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "<", "GR", "extends", "GrammaticalRelationAnnotation", ">", "boolean", "addArc", "(", "Class", "<", "GR", ">", "arcLabel", ",", "TreeGraphNode", "node", ")", "{", "if", "(", "node", "==", "null", ")", "{", "return", "false", ";", "}", "if", "(", "!", "treeGraph", "(", ")", ".", "equals", "(", "node", ".", "treeGraph", "(", ")", ")", ")", "{", "System", ".", "err", ".", "println", "(", "\"Warning: you are trying to add an arc from node \"", "+", "this", "+", "\" to node \"", "+", "node", "+", "\", but they do not belong to the same TreeGraph!\"", ")", ";", "}", "if", "(", "!", "label", ".", "containsKey", "(", "arcLabel", ")", ")", "{", "label", ".", "set", "(", "arcLabel", ",", "new", "HashSet", "<", "TreeGraphNode", ">", "(", ")", ")", ";", "}", "return", "(", "(", "Collection", ")", "label", ".", "get", "(", "arcLabel", ")", ")", ".", "add", "(", "node", ")", ";", "}" ]
Add a labeled arc from this node to the argument node. @param arcLabel the <code>Class&lt;? extends GrammaticalRelationAnnotation&gt;</code> with which the new arc is to be labeled. @param node the <code>TreeGraphNode</code> to which the new arc should point. @return <code>true</code> iff the arc did not already exist.
[ "Add", "a", "labeled", "arc", "from", "this", "node", "to", "the", "argument", "node", "." ]
b3d44bab9ec07ace0d13612c448a6b7298c1f681
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/trees/TreeGraphNode.java#L351-L363
train
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/trees/TreeGraphNode.java
TreeGraphNode.dependencies
public Set<Dependency<Label, Label, Object>> dependencies(Filter<Dependency<Label, Label, Object>> f, HeadFinder hf) { Set<Dependency<Label, Label, Object>> deps = Generics.newHashSet(); for (Tree t : this) { TreeGraphNode node = safeCast(t); if (node == null || node.isLeaf() || node.children().length < 2) { continue; } TreeGraphNode headWordNode; if (hf != null) { headWordNode = safeCast(node.headTerminal(hf)); } else { headWordNode = node.headWordNode(); } for (Tree k : node.children()) { TreeGraphNode kid = safeCast(k); if (kid == null) { continue; } TreeGraphNode kidHeadWordNode; if (hf != null) { kidHeadWordNode = safeCast(kid.headTerminal(hf)); } else { kidHeadWordNode = kid.headWordNode(); } if (headWordNode != null && headWordNode != kidHeadWordNode && kidHeadWordNode != null) { int headWordNodeIndex = headWordNode.index(); int kidHeadWordNodeIndex = kidHeadWordNode.index(); // If the two indices are equal, then the leaves haven't been indexed. Just return an ordinary // UnnamedDependency. This mirrors the implementation of super.dependencies(). Dependency<Label, Label, Object> d = (headWordNodeIndex == kidHeadWordNodeIndex) ? new UnnamedDependency(headWordNode, kidHeadWordNode) : new UnnamedConcreteDependency(headWordNode, headWordNodeIndex, kidHeadWordNode, kidHeadWordNodeIndex); if (f.accept(d)) { deps.add(d); } } } } return deps; }
java
public Set<Dependency<Label, Label, Object>> dependencies(Filter<Dependency<Label, Label, Object>> f, HeadFinder hf) { Set<Dependency<Label, Label, Object>> deps = Generics.newHashSet(); for (Tree t : this) { TreeGraphNode node = safeCast(t); if (node == null || node.isLeaf() || node.children().length < 2) { continue; } TreeGraphNode headWordNode; if (hf != null) { headWordNode = safeCast(node.headTerminal(hf)); } else { headWordNode = node.headWordNode(); } for (Tree k : node.children()) { TreeGraphNode kid = safeCast(k); if (kid == null) { continue; } TreeGraphNode kidHeadWordNode; if (hf != null) { kidHeadWordNode = safeCast(kid.headTerminal(hf)); } else { kidHeadWordNode = kid.headWordNode(); } if (headWordNode != null && headWordNode != kidHeadWordNode && kidHeadWordNode != null) { int headWordNodeIndex = headWordNode.index(); int kidHeadWordNodeIndex = kidHeadWordNode.index(); // If the two indices are equal, then the leaves haven't been indexed. Just return an ordinary // UnnamedDependency. This mirrors the implementation of super.dependencies(). Dependency<Label, Label, Object> d = (headWordNodeIndex == kidHeadWordNodeIndex) ? new UnnamedDependency(headWordNode, kidHeadWordNode) : new UnnamedConcreteDependency(headWordNode, headWordNodeIndex, kidHeadWordNode, kidHeadWordNodeIndex); if (f.accept(d)) { deps.add(d); } } } } return deps; }
[ "public", "Set", "<", "Dependency", "<", "Label", ",", "Label", ",", "Object", ">", ">", "dependencies", "(", "Filter", "<", "Dependency", "<", "Label", ",", "Label", ",", "Object", ">", ">", "f", ",", "HeadFinder", "hf", ")", "{", "Set", "<", "Dependency", "<", "Label", ",", "Label", ",", "Object", ">", ">", "deps", "=", "Generics", ".", "newHashSet", "(", ")", ";", "for", "(", "Tree", "t", ":", "this", ")", "{", "TreeGraphNode", "node", "=", "safeCast", "(", "t", ")", ";", "if", "(", "node", "==", "null", "||", "node", ".", "isLeaf", "(", ")", "||", "node", ".", "children", "(", ")", ".", "length", "<", "2", ")", "{", "continue", ";", "}", "TreeGraphNode", "headWordNode", ";", "if", "(", "hf", "!=", "null", ")", "{", "headWordNode", "=", "safeCast", "(", "node", ".", "headTerminal", "(", "hf", ")", ")", ";", "}", "else", "{", "headWordNode", "=", "node", ".", "headWordNode", "(", ")", ";", "}", "for", "(", "Tree", "k", ":", "node", ".", "children", "(", ")", ")", "{", "TreeGraphNode", "kid", "=", "safeCast", "(", "k", ")", ";", "if", "(", "kid", "==", "null", ")", "{", "continue", ";", "}", "TreeGraphNode", "kidHeadWordNode", ";", "if", "(", "hf", "!=", "null", ")", "{", "kidHeadWordNode", "=", "safeCast", "(", "kid", ".", "headTerminal", "(", "hf", ")", ")", ";", "}", "else", "{", "kidHeadWordNode", "=", "kid", ".", "headWordNode", "(", ")", ";", "}", "if", "(", "headWordNode", "!=", "null", "&&", "headWordNode", "!=", "kidHeadWordNode", "&&", "kidHeadWordNode", "!=", "null", ")", "{", "int", "headWordNodeIndex", "=", "headWordNode", ".", "index", "(", ")", ";", "int", "kidHeadWordNodeIndex", "=", "kidHeadWordNode", ".", "index", "(", ")", ";", "// If the two indices are equal, then the leaves haven't been indexed. Just return an ordinary\r", "// UnnamedDependency. This mirrors the implementation of super.dependencies().\r", "Dependency", "<", "Label", ",", "Label", ",", "Object", ">", "d", "=", "(", "headWordNodeIndex", "==", "kidHeadWordNodeIndex", ")", "?", "new", "UnnamedDependency", "(", "headWordNode", ",", "kidHeadWordNode", ")", ":", "new", "UnnamedConcreteDependency", "(", "headWordNode", ",", "headWordNodeIndex", ",", "kidHeadWordNode", ",", "kidHeadWordNodeIndex", ")", ";", "if", "(", "f", ".", "accept", "(", "d", ")", ")", "{", "deps", ".", "add", "(", "d", ")", ";", "}", "}", "}", "}", "return", "deps", ";", "}" ]
Return a set of node-node dependencies, represented as Dependency objects, for the Tree. @param hf The HeadFinder to use to identify the head of constituents. If this is <code>null</code>, then nodes are assumed to already be marked with their heads. @return Set of dependencies (each a <code>Dependency</code>)
[ "Return", "a", "set", "of", "node", "-", "node", "dependencies", "represented", "as", "Dependency", "objects", "for", "the", "Tree", "." ]
b3d44bab9ec07ace0d13612c448a6b7298c1f681
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/trees/TreeGraphNode.java#L510-L555
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/system/systemglobal_auditsyslogpolicy_binding.java
systemglobal_auditsyslogpolicy_binding.get
public static systemglobal_auditsyslogpolicy_binding[] get(nitro_service service) throws Exception{ systemglobal_auditsyslogpolicy_binding obj = new systemglobal_auditsyslogpolicy_binding(); systemglobal_auditsyslogpolicy_binding response[] = (systemglobal_auditsyslogpolicy_binding[]) obj.get_resources(service); return response; }
java
public static systemglobal_auditsyslogpolicy_binding[] get(nitro_service service) throws Exception{ systemglobal_auditsyslogpolicy_binding obj = new systemglobal_auditsyslogpolicy_binding(); systemglobal_auditsyslogpolicy_binding response[] = (systemglobal_auditsyslogpolicy_binding[]) obj.get_resources(service); return response; }
[ "public", "static", "systemglobal_auditsyslogpolicy_binding", "[", "]", "get", "(", "nitro_service", "service", ")", "throws", "Exception", "{", "systemglobal_auditsyslogpolicy_binding", "obj", "=", "new", "systemglobal_auditsyslogpolicy_binding", "(", ")", ";", "systemglobal_auditsyslogpolicy_binding", "response", "[", "]", "=", "(", "systemglobal_auditsyslogpolicy_binding", "[", "]", ")", "obj", ".", "get_resources", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch a systemglobal_auditsyslogpolicy_binding resources.
[ "Use", "this", "API", "to", "fetch", "a", "systemglobal_auditsyslogpolicy_binding", "resources", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/system/systemglobal_auditsyslogpolicy_binding.java#L180-L184
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/stream/streamidentifier.java
streamidentifier.add
public static base_response add(nitro_service client, streamidentifier resource) throws Exception { streamidentifier addresource = new streamidentifier(); addresource.name = resource.name; addresource.selectorname = resource.selectorname; addresource.interval = resource.interval; addresource.samplecount = resource.samplecount; addresource.sort = resource.sort; return addresource.add_resource(client); }
java
public static base_response add(nitro_service client, streamidentifier resource) throws Exception { streamidentifier addresource = new streamidentifier(); addresource.name = resource.name; addresource.selectorname = resource.selectorname; addresource.interval = resource.interval; addresource.samplecount = resource.samplecount; addresource.sort = resource.sort; return addresource.add_resource(client); }
[ "public", "static", "base_response", "add", "(", "nitro_service", "client", ",", "streamidentifier", "resource", ")", "throws", "Exception", "{", "streamidentifier", "addresource", "=", "new", "streamidentifier", "(", ")", ";", "addresource", ".", "name", "=", "resource", ".", "name", ";", "addresource", ".", "selectorname", "=", "resource", ".", "selectorname", ";", "addresource", ".", "interval", "=", "resource", ".", "interval", ";", "addresource", ".", "samplecount", "=", "resource", ".", "samplecount", ";", "addresource", ".", "sort", "=", "resource", ".", "sort", ";", "return", "addresource", ".", "add_resource", "(", "client", ")", ";", "}" ]
Use this API to add streamidentifier.
[ "Use", "this", "API", "to", "add", "streamidentifier", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/stream/streamidentifier.java#L200-L208
train