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/vpn/vpnurl.java | vpnurl.update | public static base_response update(nitro_service client, vpnurl resource) throws Exception {
vpnurl updateresource = new vpnurl();
updateresource.urlname = resource.urlname;
updateresource.linkname = resource.linkname;
updateresource.actualurl = resource.actualurl;
updateresource.clientlessaccess = resource.clientlessaccess;
updateresource.comment = resource.comment;
return updateresource.update_resource(client);
} | java | public static base_response update(nitro_service client, vpnurl resource) throws Exception {
vpnurl updateresource = new vpnurl();
updateresource.urlname = resource.urlname;
updateresource.linkname = resource.linkname;
updateresource.actualurl = resource.actualurl;
updateresource.clientlessaccess = resource.clientlessaccess;
updateresource.comment = resource.comment;
return updateresource.update_resource(client);
} | [
"public",
"static",
"base_response",
"update",
"(",
"nitro_service",
"client",
",",
"vpnurl",
"resource",
")",
"throws",
"Exception",
"{",
"vpnurl",
"updateresource",
"=",
"new",
"vpnurl",
"(",
")",
";",
"updateresource",
".",
"urlname",
"=",
"resource",
".",
"urlname",
";",
"updateresource",
".",
"linkname",
"=",
"resource",
".",
"linkname",
";",
"updateresource",
".",
"actualurl",
"=",
"resource",
".",
"actualurl",
";",
"updateresource",
".",
"clientlessaccess",
"=",
"resource",
".",
"clientlessaccess",
";",
"updateresource",
".",
"comment",
"=",
"resource",
".",
"comment",
";",
"return",
"updateresource",
".",
"update_resource",
"(",
"client",
")",
";",
"}"
] | Use this API to update vpnurl. | [
"Use",
"this",
"API",
"to",
"update",
"vpnurl",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnurl.java#L252-L260 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnurl.java | vpnurl.update | public static base_responses update(nitro_service client, vpnurl resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
vpnurl updateresources[] = new vpnurl[resources.length];
for (int i=0;i<resources.length;i++){
updateresources[i] = new vpnurl();
updateresources[i].urlname = resources[i].urlname;
updateresources[i].linkname = resources[i].linkname;
updateresources[i].actualurl = resources[i].actualurl;
updateresources[i].clientlessaccess = resources[i].clientlessaccess;
updateresources[i].comment = resources[i].comment;
}
result = update_bulk_request(client, updateresources);
}
return result;
} | java | public static base_responses update(nitro_service client, vpnurl resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
vpnurl updateresources[] = new vpnurl[resources.length];
for (int i=0;i<resources.length;i++){
updateresources[i] = new vpnurl();
updateresources[i].urlname = resources[i].urlname;
updateresources[i].linkname = resources[i].linkname;
updateresources[i].actualurl = resources[i].actualurl;
updateresources[i].clientlessaccess = resources[i].clientlessaccess;
updateresources[i].comment = resources[i].comment;
}
result = update_bulk_request(client, updateresources);
}
return result;
} | [
"public",
"static",
"base_responses",
"update",
"(",
"nitro_service",
"client",
",",
"vpnurl",
"resources",
"[",
"]",
")",
"throws",
"Exception",
"{",
"base_responses",
"result",
"=",
"null",
";",
"if",
"(",
"resources",
"!=",
"null",
"&&",
"resources",
".",
"length",
">",
"0",
")",
"{",
"vpnurl",
"updateresources",
"[",
"]",
"=",
"new",
"vpnurl",
"[",
"resources",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"resources",
".",
"length",
";",
"i",
"++",
")",
"{",
"updateresources",
"[",
"i",
"]",
"=",
"new",
"vpnurl",
"(",
")",
";",
"updateresources",
"[",
"i",
"]",
".",
"urlname",
"=",
"resources",
"[",
"i",
"]",
".",
"urlname",
";",
"updateresources",
"[",
"i",
"]",
".",
"linkname",
"=",
"resources",
"[",
"i",
"]",
".",
"linkname",
";",
"updateresources",
"[",
"i",
"]",
".",
"actualurl",
"=",
"resources",
"[",
"i",
"]",
".",
"actualurl",
";",
"updateresources",
"[",
"i",
"]",
".",
"clientlessaccess",
"=",
"resources",
"[",
"i",
"]",
".",
"clientlessaccess",
";",
"updateresources",
"[",
"i",
"]",
".",
"comment",
"=",
"resources",
"[",
"i",
"]",
".",
"comment",
";",
"}",
"result",
"=",
"update_bulk_request",
"(",
"client",
",",
"updateresources",
")",
";",
"}",
"return",
"result",
";",
"}"
] | Use this API to update vpnurl resources. | [
"Use",
"this",
"API",
"to",
"update",
"vpnurl",
"resources",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnurl.java#L265-L280 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnurl.java | vpnurl.unset | public static base_response unset(nitro_service client, vpnurl resource, String[] args) throws Exception{
vpnurl unsetresource = new vpnurl();
unsetresource.urlname = resource.urlname;
return unsetresource.unset_resource(client,args);
} | java | public static base_response unset(nitro_service client, vpnurl resource, String[] args) throws Exception{
vpnurl unsetresource = new vpnurl();
unsetresource.urlname = resource.urlname;
return unsetresource.unset_resource(client,args);
} | [
"public",
"static",
"base_response",
"unset",
"(",
"nitro_service",
"client",
",",
"vpnurl",
"resource",
",",
"String",
"[",
"]",
"args",
")",
"throws",
"Exception",
"{",
"vpnurl",
"unsetresource",
"=",
"new",
"vpnurl",
"(",
")",
";",
"unsetresource",
".",
"urlname",
"=",
"resource",
".",
"urlname",
";",
"return",
"unsetresource",
".",
"unset_resource",
"(",
"client",
",",
"args",
")",
";",
"}"
] | Use this API to unset the properties of vpnurl resource.
Properties that need to be unset are specified in args array. | [
"Use",
"this",
"API",
"to",
"unset",
"the",
"properties",
"of",
"vpnurl",
"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/vpn/vpnurl.java#L286-L290 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnurl.java | vpnurl.unset | public static base_responses unset(nitro_service client, String urlname[], String args[]) throws Exception {
base_responses result = null;
if (urlname != null && urlname.length > 0) {
vpnurl unsetresources[] = new vpnurl[urlname.length];
for (int i=0;i<urlname.length;i++){
unsetresources[i] = new vpnurl();
unsetresources[i].urlname = urlname[i];
}
result = unset_bulk_request(client, unsetresources,args);
}
return result;
} | java | public static base_responses unset(nitro_service client, String urlname[], String args[]) throws Exception {
base_responses result = null;
if (urlname != null && urlname.length > 0) {
vpnurl unsetresources[] = new vpnurl[urlname.length];
for (int i=0;i<urlname.length;i++){
unsetresources[i] = new vpnurl();
unsetresources[i].urlname = urlname[i];
}
result = unset_bulk_request(client, unsetresources,args);
}
return result;
} | [
"public",
"static",
"base_responses",
"unset",
"(",
"nitro_service",
"client",
",",
"String",
"urlname",
"[",
"]",
",",
"String",
"args",
"[",
"]",
")",
"throws",
"Exception",
"{",
"base_responses",
"result",
"=",
"null",
";",
"if",
"(",
"urlname",
"!=",
"null",
"&&",
"urlname",
".",
"length",
">",
"0",
")",
"{",
"vpnurl",
"unsetresources",
"[",
"]",
"=",
"new",
"vpnurl",
"[",
"urlname",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"urlname",
".",
"length",
";",
"i",
"++",
")",
"{",
"unsetresources",
"[",
"i",
"]",
"=",
"new",
"vpnurl",
"(",
")",
";",
"unsetresources",
"[",
"i",
"]",
".",
"urlname",
"=",
"urlname",
"[",
"i",
"]",
";",
"}",
"result",
"=",
"unset_bulk_request",
"(",
"client",
",",
"unsetresources",
",",
"args",
")",
";",
"}",
"return",
"result",
";",
"}"
] | Use this API to unset the properties of vpnurl resources.
Properties that need to be unset are specified in args array. | [
"Use",
"this",
"API",
"to",
"unset",
"the",
"properties",
"of",
"vpnurl",
"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/vpn/vpnurl.java#L296-L307 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnurl.java | vpnurl.get | public static vpnurl[] get(nitro_service service) throws Exception{
vpnurl obj = new vpnurl();
vpnurl[] response = (vpnurl[])obj.get_resources(service);
return response;
} | java | public static vpnurl[] get(nitro_service service) throws Exception{
vpnurl obj = new vpnurl();
vpnurl[] response = (vpnurl[])obj.get_resources(service);
return response;
} | [
"public",
"static",
"vpnurl",
"[",
"]",
"get",
"(",
"nitro_service",
"service",
")",
"throws",
"Exception",
"{",
"vpnurl",
"obj",
"=",
"new",
"vpnurl",
"(",
")",
";",
"vpnurl",
"[",
"]",
"response",
"=",
"(",
"vpnurl",
"[",
"]",
")",
"obj",
".",
"get_resources",
"(",
"service",
")",
";",
"return",
"response",
";",
"}"
] | Use this API to fetch all the vpnurl resources that are configured on netscaler. | [
"Use",
"this",
"API",
"to",
"fetch",
"all",
"the",
"vpnurl",
"resources",
"that",
"are",
"configured",
"on",
"netscaler",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnurl.java#L329-L333 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnurl.java | vpnurl.get | public static vpnurl get(nitro_service service, String urlname) throws Exception{
vpnurl obj = new vpnurl();
obj.set_urlname(urlname);
vpnurl response = (vpnurl) obj.get_resource(service);
return response;
} | java | public static vpnurl get(nitro_service service, String urlname) throws Exception{
vpnurl obj = new vpnurl();
obj.set_urlname(urlname);
vpnurl response = (vpnurl) obj.get_resource(service);
return response;
} | [
"public",
"static",
"vpnurl",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"urlname",
")",
"throws",
"Exception",
"{",
"vpnurl",
"obj",
"=",
"new",
"vpnurl",
"(",
")",
";",
"obj",
".",
"set_urlname",
"(",
"urlname",
")",
";",
"vpnurl",
"response",
"=",
"(",
"vpnurl",
")",
"obj",
".",
"get_resource",
"(",
"service",
")",
";",
"return",
"response",
";",
"}"
] | Use this API to fetch vpnurl resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"vpnurl",
"resource",
"of",
"given",
"name",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnurl.java#L345-L350 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnurl.java | vpnurl.get | public static vpnurl[] get(nitro_service service, String urlname[]) throws Exception{
if (urlname !=null && urlname.length>0) {
vpnurl response[] = new vpnurl[urlname.length];
vpnurl obj[] = new vpnurl[urlname.length];
for (int i=0;i<urlname.length;i++) {
obj[i] = new vpnurl();
obj[i].set_urlname(urlname[i]);
response[i] = (vpnurl) obj[i].get_resource(service);
}
return response;
}
return null;
} | java | public static vpnurl[] get(nitro_service service, String urlname[]) throws Exception{
if (urlname !=null && urlname.length>0) {
vpnurl response[] = new vpnurl[urlname.length];
vpnurl obj[] = new vpnurl[urlname.length];
for (int i=0;i<urlname.length;i++) {
obj[i] = new vpnurl();
obj[i].set_urlname(urlname[i]);
response[i] = (vpnurl) obj[i].get_resource(service);
}
return response;
}
return null;
} | [
"public",
"static",
"vpnurl",
"[",
"]",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"urlname",
"[",
"]",
")",
"throws",
"Exception",
"{",
"if",
"(",
"urlname",
"!=",
"null",
"&&",
"urlname",
".",
"length",
">",
"0",
")",
"{",
"vpnurl",
"response",
"[",
"]",
"=",
"new",
"vpnurl",
"[",
"urlname",
".",
"length",
"]",
";",
"vpnurl",
"obj",
"[",
"]",
"=",
"new",
"vpnurl",
"[",
"urlname",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"urlname",
".",
"length",
";",
"i",
"++",
")",
"{",
"obj",
"[",
"i",
"]",
"=",
"new",
"vpnurl",
"(",
")",
";",
"obj",
"[",
"i",
"]",
".",
"set_urlname",
"(",
"urlname",
"[",
"i",
"]",
")",
";",
"response",
"[",
"i",
"]",
"=",
"(",
"vpnurl",
")",
"obj",
"[",
"i",
"]",
".",
"get_resource",
"(",
"service",
")",
";",
"}",
"return",
"response",
";",
"}",
"return",
"null",
";",
"}"
] | Use this API to fetch vpnurl resources of given names . | [
"Use",
"this",
"API",
"to",
"fetch",
"vpnurl",
"resources",
"of",
"given",
"names",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnurl.java#L355-L367 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/parser/lexparser/BaseLexicon.java | BaseLexicon.ruleIteratorByWord | public Iterator<IntTaggedWord> ruleIteratorByWord(String word, int loc) {
return ruleIteratorByWord(wordIndex.indexOf(word, true), loc, null);
} | java | public Iterator<IntTaggedWord> ruleIteratorByWord(String word, int loc) {
return ruleIteratorByWord(wordIndex.indexOf(word, true), loc, null);
} | [
"public",
"Iterator",
"<",
"IntTaggedWord",
">",
"ruleIteratorByWord",
"(",
"String",
"word",
",",
"int",
"loc",
")",
"{",
"return",
"ruleIteratorByWord",
"(",
"wordIndex",
".",
"indexOf",
"(",
"word",
",",
"true",
")",
",",
"loc",
",",
"null",
")",
";",
"}"
] | Returns the possible POS taggings for a word.
@param word The word, represented as an integer in wordIndex
@param loc The position of the word in the sentence (counting from 0).
<i>Implementation note: The BaseLexicon class doesn't actually
make use of this position information.</i>
@return An Iterator over a List ofIntTaggedWords, which pair the word with
possible taggings as integer pairs. (Each can be thought of as a
<code>tag -> word<code> rule.) | [
"Returns",
"the",
"possible",
"POS",
"taggings",
"for",
"a",
"word",
"."
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/parser/lexparser/BaseLexicon.java#L184-L186 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/parser/lexparser/BaseLexicon.java | BaseLexicon.addAll | public void addAll(List<TaggedWord> taggedWords, double weight) {
List<IntTaggedWord> tagWords = listToEvents(taggedWords);
} | java | public void addAll(List<TaggedWord> taggedWords, double weight) {
List<IntTaggedWord> tagWords = listToEvents(taggedWords);
} | [
"public",
"void",
"addAll",
"(",
"List",
"<",
"TaggedWord",
">",
"taggedWords",
",",
"double",
"weight",
")",
"{",
"List",
"<",
"IntTaggedWord",
">",
"tagWords",
"=",
"listToEvents",
"(",
"taggedWords",
")",
";",
"}"
] | Not yet implemented. | [
"Not",
"yet",
"implemented",
"."
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/parser/lexparser/BaseLexicon.java#L322-L324 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/parser/lexparser/BaseLexicon.java | BaseLexicon.train | public final void train(Collection<Tree> trees, double weight) {
// scan data
for (Tree tree : trees) {
train(tree, weight);
}
} | java | public final void train(Collection<Tree> trees, double weight) {
// scan data
for (Tree tree : trees) {
train(tree, weight);
}
} | [
"public",
"final",
"void",
"train",
"(",
"Collection",
"<",
"Tree",
">",
"trees",
",",
"double",
"weight",
")",
"{",
"// scan data\r",
"for",
"(",
"Tree",
"tree",
":",
"trees",
")",
"{",
"train",
"(",
"tree",
",",
"weight",
")",
";",
"}",
"}"
] | Trains this lexicon on the Collection of trees.
Also trains the unknown word model pointed to by this lexicon. | [
"Trains",
"this",
"lexicon",
"on",
"the",
"Collection",
"of",
"trees",
".",
"Also",
"trains",
"the",
"unknown",
"word",
"model",
"pointed",
"to",
"by",
"this",
"lexicon",
"."
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/parser/lexparser/BaseLexicon.java#L349-L354 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/parser/lexparser/BaseLexicon.java | BaseLexicon.addTagging | protected void addTagging(boolean seen, IntTaggedWord itw, double count) {
if (seen) {
seenCounter.incrementCount(itw, count);
if (itw.tag() == nullTag) {
words.add(itw);
} else if (itw.word() == nullWord) {
tags.add(itw);
} else {
// rules.add(itw);
}
} else {
uwModel.addTagging(seen, itw, count);
// if (itw.tag() == nullTag) {
// sigs.add(itw);
// }
}
} | java | protected void addTagging(boolean seen, IntTaggedWord itw, double count) {
if (seen) {
seenCounter.incrementCount(itw, count);
if (itw.tag() == nullTag) {
words.add(itw);
} else if (itw.word() == nullWord) {
tags.add(itw);
} else {
// rules.add(itw);
}
} else {
uwModel.addTagging(seen, itw, count);
// if (itw.tag() == nullTag) {
// sigs.add(itw);
// }
}
} | [
"protected",
"void",
"addTagging",
"(",
"boolean",
"seen",
",",
"IntTaggedWord",
"itw",
",",
"double",
"count",
")",
"{",
"if",
"(",
"seen",
")",
"{",
"seenCounter",
".",
"incrementCount",
"(",
"itw",
",",
"count",
")",
";",
"if",
"(",
"itw",
".",
"tag",
"(",
")",
"==",
"nullTag",
")",
"{",
"words",
".",
"add",
"(",
"itw",
")",
";",
"}",
"else",
"if",
"(",
"itw",
".",
"word",
"(",
")",
"==",
"nullWord",
")",
"{",
"tags",
".",
"add",
"(",
"itw",
")",
";",
"}",
"else",
"{",
"// rules.add(itw);\r",
"}",
"}",
"else",
"{",
"uwModel",
".",
"addTagging",
"(",
"seen",
",",
"itw",
",",
"count",
")",
";",
"// if (itw.tag() == nullTag) {\r",
"// sigs.add(itw);\r",
"// }\r",
"}",
"}"
] | Adds the tagging with count to the data structures in this Lexicon. | [
"Adds",
"the",
"tagging",
"with",
"count",
"to",
"the",
"data",
"structures",
"in",
"this",
"Lexicon",
"."
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/parser/lexparser/BaseLexicon.java#L437-L453 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/parser/lexparser/BaseLexicon.java | BaseLexicon.writeData | public void writeData(Writer w) throws IOException {
PrintWriter out = new PrintWriter(w);
for (IntTaggedWord itw : seenCounter.keySet()) {
out.println(itw.toLexicalEntry(wordIndex, tagIndex) + " SEEN " + seenCounter.getCount(itw));
}
for (IntTaggedWord itw : getUnknownWordModel().unSeenCounter().keySet()) {
out.println(itw.toLexicalEntry(wordIndex, tagIndex) + " UNSEEN " + getUnknownWordModel().unSeenCounter().getCount(itw));
}
for (int i = 0; i < smooth.length; i++) {
out.println("smooth[" + i + "] = " + smooth[i]);
}
out.flush();
} | java | public void writeData(Writer w) throws IOException {
PrintWriter out = new PrintWriter(w);
for (IntTaggedWord itw : seenCounter.keySet()) {
out.println(itw.toLexicalEntry(wordIndex, tagIndex) + " SEEN " + seenCounter.getCount(itw));
}
for (IntTaggedWord itw : getUnknownWordModel().unSeenCounter().keySet()) {
out.println(itw.toLexicalEntry(wordIndex, tagIndex) + " UNSEEN " + getUnknownWordModel().unSeenCounter().getCount(itw));
}
for (int i = 0; i < smooth.length; i++) {
out.println("smooth[" + i + "] = " + smooth[i]);
}
out.flush();
} | [
"public",
"void",
"writeData",
"(",
"Writer",
"w",
")",
"throws",
"IOException",
"{",
"PrintWriter",
"out",
"=",
"new",
"PrintWriter",
"(",
"w",
")",
";",
"for",
"(",
"IntTaggedWord",
"itw",
":",
"seenCounter",
".",
"keySet",
"(",
")",
")",
"{",
"out",
".",
"println",
"(",
"itw",
".",
"toLexicalEntry",
"(",
"wordIndex",
",",
"tagIndex",
")",
"+",
"\" SEEN \"",
"+",
"seenCounter",
".",
"getCount",
"(",
"itw",
")",
")",
";",
"}",
"for",
"(",
"IntTaggedWord",
"itw",
":",
"getUnknownWordModel",
"(",
")",
".",
"unSeenCounter",
"(",
")",
".",
"keySet",
"(",
")",
")",
"{",
"out",
".",
"println",
"(",
"itw",
".",
"toLexicalEntry",
"(",
"wordIndex",
",",
"tagIndex",
")",
"+",
"\" UNSEEN \"",
"+",
"getUnknownWordModel",
"(",
")",
".",
"unSeenCounter",
"(",
")",
".",
"getCount",
"(",
"itw",
")",
")",
";",
"}",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"smooth",
".",
"length",
";",
"i",
"++",
")",
"{",
"out",
".",
"println",
"(",
"\"smooth[\"",
"+",
"i",
"+",
"\"] = \"",
"+",
"smooth",
"[",
"i",
"]",
")",
";",
"}",
"out",
".",
"flush",
"(",
")",
";",
"}"
] | Writes out data from this Object to the Writer w. Rules are separated by
newline, and rule elements are delimited by \t. | [
"Writes",
"out",
"data",
"from",
"this",
"Object",
"to",
"the",
"Writer",
"w",
".",
"Rules",
"are",
"separated",
"by",
"newline",
"and",
"rule",
"elements",
"are",
"delimited",
"by",
"\\",
"t",
"."
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/parser/lexparser/BaseLexicon.java#L752-L765 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/network/nd6.java | nd6.add | public static base_response add(nitro_service client, nd6 resource) throws Exception {
nd6 addresource = new nd6();
addresource.neighbor = resource.neighbor;
addresource.mac = resource.mac;
addresource.ifnum = resource.ifnum;
addresource.vlan = resource.vlan;
addresource.td = resource.td;
return addresource.add_resource(client);
} | java | public static base_response add(nitro_service client, nd6 resource) throws Exception {
nd6 addresource = new nd6();
addresource.neighbor = resource.neighbor;
addresource.mac = resource.mac;
addresource.ifnum = resource.ifnum;
addresource.vlan = resource.vlan;
addresource.td = resource.td;
return addresource.add_resource(client);
} | [
"public",
"static",
"base_response",
"add",
"(",
"nitro_service",
"client",
",",
"nd6",
"resource",
")",
"throws",
"Exception",
"{",
"nd6",
"addresource",
"=",
"new",
"nd6",
"(",
")",
";",
"addresource",
".",
"neighbor",
"=",
"resource",
".",
"neighbor",
";",
"addresource",
".",
"mac",
"=",
"resource",
".",
"mac",
";",
"addresource",
".",
"ifnum",
"=",
"resource",
".",
"ifnum",
";",
"addresource",
".",
"vlan",
"=",
"resource",
".",
"vlan",
";",
"addresource",
".",
"td",
"=",
"resource",
".",
"td",
";",
"return",
"addresource",
".",
"add_resource",
"(",
"client",
")",
";",
"}"
] | Use this API to add nd6. | [
"Use",
"this",
"API",
"to",
"add",
"nd6",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/network/nd6.java#L230-L238 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/network/nd6.java | nd6.add | public static base_responses add(nitro_service client, nd6 resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
nd6 addresources[] = new nd6[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new nd6();
addresources[i].neighbor = resources[i].neighbor;
addresources[i].mac = resources[i].mac;
addresources[i].ifnum = resources[i].ifnum;
addresources[i].vlan = resources[i].vlan;
addresources[i].td = resources[i].td;
}
result = add_bulk_request(client, addresources);
}
return result;
} | java | public static base_responses add(nitro_service client, nd6 resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
nd6 addresources[] = new nd6[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new nd6();
addresources[i].neighbor = resources[i].neighbor;
addresources[i].mac = resources[i].mac;
addresources[i].ifnum = resources[i].ifnum;
addresources[i].vlan = resources[i].vlan;
addresources[i].td = resources[i].td;
}
result = add_bulk_request(client, addresources);
}
return result;
} | [
"public",
"static",
"base_responses",
"add",
"(",
"nitro_service",
"client",
",",
"nd6",
"resources",
"[",
"]",
")",
"throws",
"Exception",
"{",
"base_responses",
"result",
"=",
"null",
";",
"if",
"(",
"resources",
"!=",
"null",
"&&",
"resources",
".",
"length",
">",
"0",
")",
"{",
"nd6",
"addresources",
"[",
"]",
"=",
"new",
"nd6",
"[",
"resources",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"resources",
".",
"length",
";",
"i",
"++",
")",
"{",
"addresources",
"[",
"i",
"]",
"=",
"new",
"nd6",
"(",
")",
";",
"addresources",
"[",
"i",
"]",
".",
"neighbor",
"=",
"resources",
"[",
"i",
"]",
".",
"neighbor",
";",
"addresources",
"[",
"i",
"]",
".",
"mac",
"=",
"resources",
"[",
"i",
"]",
".",
"mac",
";",
"addresources",
"[",
"i",
"]",
".",
"ifnum",
"=",
"resources",
"[",
"i",
"]",
".",
"ifnum",
";",
"addresources",
"[",
"i",
"]",
".",
"vlan",
"=",
"resources",
"[",
"i",
"]",
".",
"vlan",
";",
"addresources",
"[",
"i",
"]",
".",
"td",
"=",
"resources",
"[",
"i",
"]",
".",
"td",
";",
"}",
"result",
"=",
"add_bulk_request",
"(",
"client",
",",
"addresources",
")",
";",
"}",
"return",
"result",
";",
"}"
] | Use this API to add nd6 resources. | [
"Use",
"this",
"API",
"to",
"add",
"nd6",
"resources",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/network/nd6.java#L243-L258 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/network/nd6.java | nd6.clear | public static base_response clear(nitro_service client) throws Exception {
nd6 clearresource = new nd6();
return clearresource.perform_operation(client,"clear");
} | java | public static base_response clear(nitro_service client) throws Exception {
nd6 clearresource = new nd6();
return clearresource.perform_operation(client,"clear");
} | [
"public",
"static",
"base_response",
"clear",
"(",
"nitro_service",
"client",
")",
"throws",
"Exception",
"{",
"nd6",
"clearresource",
"=",
"new",
"nd6",
"(",
")",
";",
"return",
"clearresource",
".",
"perform_operation",
"(",
"client",
",",
"\"clear\"",
")",
";",
"}"
] | Use this API to clear nd6. | [
"Use",
"this",
"API",
"to",
"clear",
"nd6",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/network/nd6.java#L263-L266 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/network/nd6.java | nd6.delete | public static base_response delete(nitro_service client, String neighbor) throws Exception {
nd6 deleteresource = new nd6();
deleteresource.neighbor = neighbor;
return deleteresource.delete_resource(client);
} | java | public static base_response delete(nitro_service client, String neighbor) throws Exception {
nd6 deleteresource = new nd6();
deleteresource.neighbor = neighbor;
return deleteresource.delete_resource(client);
} | [
"public",
"static",
"base_response",
"delete",
"(",
"nitro_service",
"client",
",",
"String",
"neighbor",
")",
"throws",
"Exception",
"{",
"nd6",
"deleteresource",
"=",
"new",
"nd6",
"(",
")",
";",
"deleteresource",
".",
"neighbor",
"=",
"neighbor",
";",
"return",
"deleteresource",
".",
"delete_resource",
"(",
"client",
")",
";",
"}"
] | Use this API to delete nd6 of given name. | [
"Use",
"this",
"API",
"to",
"delete",
"nd6",
"of",
"given",
"name",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/network/nd6.java#L286-L290 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/network/nd6.java | nd6.delete | public static base_response delete(nitro_service client, nd6 resource) throws Exception {
nd6 deleteresource = new nd6();
deleteresource.neighbor = resource.neighbor;
deleteresource.vlan = resource.vlan;
deleteresource.td = resource.td;
return deleteresource.delete_resource(client);
} | java | public static base_response delete(nitro_service client, nd6 resource) throws Exception {
nd6 deleteresource = new nd6();
deleteresource.neighbor = resource.neighbor;
deleteresource.vlan = resource.vlan;
deleteresource.td = resource.td;
return deleteresource.delete_resource(client);
} | [
"public",
"static",
"base_response",
"delete",
"(",
"nitro_service",
"client",
",",
"nd6",
"resource",
")",
"throws",
"Exception",
"{",
"nd6",
"deleteresource",
"=",
"new",
"nd6",
"(",
")",
";",
"deleteresource",
".",
"neighbor",
"=",
"resource",
".",
"neighbor",
";",
"deleteresource",
".",
"vlan",
"=",
"resource",
".",
"vlan",
";",
"deleteresource",
".",
"td",
"=",
"resource",
".",
"td",
";",
"return",
"deleteresource",
".",
"delete_resource",
"(",
"client",
")",
";",
"}"
] | Use this API to delete nd6. | [
"Use",
"this",
"API",
"to",
"delete",
"nd6",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/network/nd6.java#L295-L301 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/network/nd6.java | nd6.delete | public static base_responses delete(nitro_service client, String neighbor[]) throws Exception {
base_responses result = null;
if (neighbor != null && neighbor.length > 0) {
nd6 deleteresources[] = new nd6[neighbor.length];
for (int i=0;i<neighbor.length;i++){
deleteresources[i] = new nd6();
deleteresources[i].neighbor = neighbor[i];
}
result = delete_bulk_request(client, deleteresources);
}
return result;
} | java | public static base_responses delete(nitro_service client, String neighbor[]) throws Exception {
base_responses result = null;
if (neighbor != null && neighbor.length > 0) {
nd6 deleteresources[] = new nd6[neighbor.length];
for (int i=0;i<neighbor.length;i++){
deleteresources[i] = new nd6();
deleteresources[i].neighbor = neighbor[i];
}
result = delete_bulk_request(client, deleteresources);
}
return result;
} | [
"public",
"static",
"base_responses",
"delete",
"(",
"nitro_service",
"client",
",",
"String",
"neighbor",
"[",
"]",
")",
"throws",
"Exception",
"{",
"base_responses",
"result",
"=",
"null",
";",
"if",
"(",
"neighbor",
"!=",
"null",
"&&",
"neighbor",
".",
"length",
">",
"0",
")",
"{",
"nd6",
"deleteresources",
"[",
"]",
"=",
"new",
"nd6",
"[",
"neighbor",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"neighbor",
".",
"length",
";",
"i",
"++",
")",
"{",
"deleteresources",
"[",
"i",
"]",
"=",
"new",
"nd6",
"(",
")",
";",
"deleteresources",
"[",
"i",
"]",
".",
"neighbor",
"=",
"neighbor",
"[",
"i",
"]",
";",
"}",
"result",
"=",
"delete_bulk_request",
"(",
"client",
",",
"deleteresources",
")",
";",
"}",
"return",
"result",
";",
"}"
] | Use this API to delete nd6 resources of given names. | [
"Use",
"this",
"API",
"to",
"delete",
"nd6",
"resources",
"of",
"given",
"names",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/network/nd6.java#L306-L317 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/network/nd6.java | nd6.get | public static nd6[] get(nitro_service service) throws Exception{
nd6 obj = new nd6();
nd6[] response = (nd6[])obj.get_resources(service);
return response;
} | java | public static nd6[] get(nitro_service service) throws Exception{
nd6 obj = new nd6();
nd6[] response = (nd6[])obj.get_resources(service);
return response;
} | [
"public",
"static",
"nd6",
"[",
"]",
"get",
"(",
"nitro_service",
"service",
")",
"throws",
"Exception",
"{",
"nd6",
"obj",
"=",
"new",
"nd6",
"(",
")",
";",
"nd6",
"[",
"]",
"response",
"=",
"(",
"nd6",
"[",
"]",
")",
"obj",
".",
"get_resources",
"(",
"service",
")",
";",
"return",
"response",
";",
"}"
] | Use this API to fetch all the nd6 resources that are configured on netscaler. | [
"Use",
"this",
"API",
"to",
"fetch",
"all",
"the",
"nd6",
"resources",
"that",
"are",
"configured",
"on",
"netscaler",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/network/nd6.java#L340-L344 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/cs/csvserver_lbvserver_binding.java | csvserver_lbvserver_binding.get | public static csvserver_lbvserver_binding[] get(nitro_service service, String name) throws Exception{
csvserver_lbvserver_binding obj = new csvserver_lbvserver_binding();
obj.set_name(name);
csvserver_lbvserver_binding response[] = (csvserver_lbvserver_binding[]) obj.get_resources(service);
return response;
} | java | public static csvserver_lbvserver_binding[] get(nitro_service service, String name) throws Exception{
csvserver_lbvserver_binding obj = new csvserver_lbvserver_binding();
obj.set_name(name);
csvserver_lbvserver_binding response[] = (csvserver_lbvserver_binding[]) obj.get_resources(service);
return response;
} | [
"public",
"static",
"csvserver_lbvserver_binding",
"[",
"]",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"csvserver_lbvserver_binding",
"obj",
"=",
"new",
"csvserver_lbvserver_binding",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
")",
";",
"csvserver_lbvserver_binding",
"response",
"[",
"]",
"=",
"(",
"csvserver_lbvserver_binding",
"[",
"]",
")",
"obj",
".",
"get_resources",
"(",
"service",
")",
";",
"return",
"response",
";",
"}"
] | Use this API to fetch csvserver_lbvserver_binding resources of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"csvserver_lbvserver_binding",
"resources",
"of",
"given",
"name",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/cs/csvserver_lbvserver_binding.java#L185-L190 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/stream/streamidentifier_binding.java | streamidentifier_binding.get | public static streamidentifier_binding get(nitro_service service, String name) throws Exception{
streamidentifier_binding obj = new streamidentifier_binding();
obj.set_name(name);
streamidentifier_binding response = (streamidentifier_binding) obj.get_resource(service);
return response;
} | java | public static streamidentifier_binding get(nitro_service service, String name) throws Exception{
streamidentifier_binding obj = new streamidentifier_binding();
obj.set_name(name);
streamidentifier_binding response = (streamidentifier_binding) obj.get_resource(service);
return response;
} | [
"public",
"static",
"streamidentifier_binding",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"streamidentifier_binding",
"obj",
"=",
"new",
"streamidentifier_binding",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
")",
";",
"streamidentifier_binding",
"response",
"=",
"(",
"streamidentifier_binding",
")",
"obj",
".",
"get_resource",
"(",
"service",
")",
";",
"return",
"response",
";",
"}"
] | Use this API to fetch streamidentifier_binding resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"streamidentifier_binding",
"resource",
"of",
"given",
"name",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/stream/streamidentifier_binding.java#L103-L108 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/appfw/appfwprofile_xmlxss_binding.java | appfwprofile_xmlxss_binding.get | public static appfwprofile_xmlxss_binding[] get(nitro_service service, String name) throws Exception{
appfwprofile_xmlxss_binding obj = new appfwprofile_xmlxss_binding();
obj.set_name(name);
appfwprofile_xmlxss_binding response[] = (appfwprofile_xmlxss_binding[]) obj.get_resources(service);
return response;
} | java | public static appfwprofile_xmlxss_binding[] get(nitro_service service, String name) throws Exception{
appfwprofile_xmlxss_binding obj = new appfwprofile_xmlxss_binding();
obj.set_name(name);
appfwprofile_xmlxss_binding response[] = (appfwprofile_xmlxss_binding[]) obj.get_resources(service);
return response;
} | [
"public",
"static",
"appfwprofile_xmlxss_binding",
"[",
"]",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"appfwprofile_xmlxss_binding",
"obj",
"=",
"new",
"appfwprofile_xmlxss_binding",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
")",
";",
"appfwprofile_xmlxss_binding",
"response",
"[",
"]",
"=",
"(",
"appfwprofile_xmlxss_binding",
"[",
"]",
")",
"obj",
".",
"get_resources",
"(",
"service",
")",
";",
"return",
"response",
";",
"}"
] | Use this API to fetch appfwprofile_xmlxss_binding resources of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"appfwprofile_xmlxss_binding",
"resources",
"of",
"given",
"name",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/appfw/appfwprofile_xmlxss_binding.java#L248-L253 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/authentication/authenticationlocalpolicy_binding.java | authenticationlocalpolicy_binding.get | public static authenticationlocalpolicy_binding get(nitro_service service, String name) throws Exception{
authenticationlocalpolicy_binding obj = new authenticationlocalpolicy_binding();
obj.set_name(name);
authenticationlocalpolicy_binding response = (authenticationlocalpolicy_binding) obj.get_resource(service);
return response;
} | java | public static authenticationlocalpolicy_binding get(nitro_service service, String name) throws Exception{
authenticationlocalpolicy_binding obj = new authenticationlocalpolicy_binding();
obj.set_name(name);
authenticationlocalpolicy_binding response = (authenticationlocalpolicy_binding) obj.get_resource(service);
return response;
} | [
"public",
"static",
"authenticationlocalpolicy_binding",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"authenticationlocalpolicy_binding",
"obj",
"=",
"new",
"authenticationlocalpolicy_binding",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
")",
";",
"authenticationlocalpolicy_binding",
"response",
"=",
"(",
"authenticationlocalpolicy_binding",
")",
"obj",
".",
"get_resource",
"(",
"service",
")",
";",
"return",
"response",
";",
"}"
] | Use this API to fetch authenticationlocalpolicy_binding resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"authenticationlocalpolicy_binding",
"resource",
"of",
"given",
"name",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/authentication/authenticationlocalpolicy_binding.java#L136-L141 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnspolicy64_lbvserver_binding.java | dnspolicy64_lbvserver_binding.get | public static dnspolicy64_lbvserver_binding[] get(nitro_service service, String name) throws Exception{
dnspolicy64_lbvserver_binding obj = new dnspolicy64_lbvserver_binding();
obj.set_name(name);
dnspolicy64_lbvserver_binding response[] = (dnspolicy64_lbvserver_binding[]) obj.get_resources(service);
return response;
} | java | public static dnspolicy64_lbvserver_binding[] get(nitro_service service, String name) throws Exception{
dnspolicy64_lbvserver_binding obj = new dnspolicy64_lbvserver_binding();
obj.set_name(name);
dnspolicy64_lbvserver_binding response[] = (dnspolicy64_lbvserver_binding[]) obj.get_resources(service);
return response;
} | [
"public",
"static",
"dnspolicy64_lbvserver_binding",
"[",
"]",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"dnspolicy64_lbvserver_binding",
"obj",
"=",
"new",
"dnspolicy64_lbvserver_binding",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
")",
";",
"dnspolicy64_lbvserver_binding",
"response",
"[",
"]",
"=",
"(",
"dnspolicy64_lbvserver_binding",
"[",
"]",
")",
"obj",
".",
"get_resources",
"(",
"service",
")",
";",
"return",
"response",
";",
"}"
] | Use this API to fetch dnspolicy64_lbvserver_binding resources of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"dnspolicy64_lbvserver_binding",
"resources",
"of",
"given",
"name",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnspolicy64_lbvserver_binding.java#L132-L137 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.logSum | public static <E> double logSum(Counter<E> c) {
return ArrayMath.logSum(ArrayMath.unbox(c.values()));
} | java | public static <E> double logSum(Counter<E> c) {
return ArrayMath.logSum(ArrayMath.unbox(c.values()));
} | [
"public",
"static",
"<",
"E",
">",
"double",
"logSum",
"(",
"Counter",
"<",
"E",
">",
"c",
")",
"{",
"return",
"ArrayMath",
".",
"logSum",
"(",
"ArrayMath",
".",
"unbox",
"(",
"c",
".",
"values",
"(",
")",
")",
")",
";",
"}"
] | Returns ArrayMath.logSum of the values in this counter.
@param c
Argument counter (which is not modified)
@return ArrayMath.logSum of the values in this counter. | [
"Returns",
"ArrayMath",
".",
"logSum",
"of",
"the",
"values",
"in",
"this",
"counter",
"."
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L110-L112 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.max | public static <E> double max(Counter<E> c) {
double max = Double.NEGATIVE_INFINITY;
for (double v : c.values()) {
max = Math.max(max, v);
}
return max;
} | java | public static <E> double max(Counter<E> c) {
double max = Double.NEGATIVE_INFINITY;
for (double v : c.values()) {
max = Math.max(max, v);
}
return max;
} | [
"public",
"static",
"<",
"E",
">",
"double",
"max",
"(",
"Counter",
"<",
"E",
">",
"c",
")",
"{",
"double",
"max",
"=",
"Double",
".",
"NEGATIVE_INFINITY",
";",
"for",
"(",
"double",
"v",
":",
"c",
".",
"values",
"(",
")",
")",
"{",
"max",
"=",
"Math",
".",
"max",
"(",
"max",
",",
"v",
")",
";",
"}",
"return",
"max",
";",
"}"
] | Returns the value of the maximum entry in this counter. This is also the
Linfinity norm. An empty counter is given a max value of
Double.NEGATIVE_INFINITY.
@param c
The Counter to find the max of
@return The maximum value of the Counter | [
"Returns",
"the",
"value",
"of",
"the",
"maximum",
"entry",
"in",
"this",
"counter",
".",
"This",
"is",
"also",
"the",
"Linfinity",
"norm",
".",
"An",
"empty",
"counter",
"is",
"given",
"a",
"max",
"value",
"of",
"Double",
".",
"NEGATIVE_INFINITY",
"."
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L149-L155 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.asCounter | public static <E> Counter<E> asCounter(Collection<E> c) {
Counter<E> count = new ClassicCounter<E>();
for (E elem : c) {
count.incrementCount(elem);
}
return count;
} | java | public static <E> Counter<E> asCounter(Collection<E> c) {
Counter<E> count = new ClassicCounter<E>();
for (E elem : c) {
count.incrementCount(elem);
}
return count;
} | [
"public",
"static",
"<",
"E",
">",
"Counter",
"<",
"E",
">",
"asCounter",
"(",
"Collection",
"<",
"E",
">",
"c",
")",
"{",
"Counter",
"<",
"E",
">",
"count",
"=",
"new",
"ClassicCounter",
"<",
"E",
">",
"(",
")",
";",
"for",
"(",
"E",
"elem",
":",
"c",
")",
"{",
"count",
".",
"incrementCount",
"(",
"elem",
")",
";",
"}",
"return",
"count",
";",
"}"
] | Takes in a Collection of something and makes a counter, incrementing once
for each object in the collection.
@param c
The Collection to turn into a counter
@return The counter made out of the collection | [
"Takes",
"in",
"a",
"Collection",
"of",
"something",
"and",
"makes",
"a",
"counter",
"incrementing",
"once",
"for",
"each",
"object",
"in",
"the",
"collection",
"."
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L165-L171 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.min | public static <E> double min(Counter<E> c) {
double min = Double.POSITIVE_INFINITY;
for (double v : c.values()) {
min = Math.min(min, v);
}
return min;
} | java | public static <E> double min(Counter<E> c) {
double min = Double.POSITIVE_INFINITY;
for (double v : c.values()) {
min = Math.min(min, v);
}
return min;
} | [
"public",
"static",
"<",
"E",
">",
"double",
"min",
"(",
"Counter",
"<",
"E",
">",
"c",
")",
"{",
"double",
"min",
"=",
"Double",
".",
"POSITIVE_INFINITY",
";",
"for",
"(",
"double",
"v",
":",
"c",
".",
"values",
"(",
")",
")",
"{",
"min",
"=",
"Math",
".",
"min",
"(",
"min",
",",
"v",
")",
";",
"}",
"return",
"min",
";",
"}"
] | Returns the value of the smallest entry in this counter.
@param c
The Counter (not modified)
@return The minimum value in the Counter | [
"Returns",
"the",
"value",
"of",
"the",
"smallest",
"entry",
"in",
"this",
"counter",
"."
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L180-L186 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.argmax | public static <E> E argmax(Counter<E> c) {
double max = Double.NEGATIVE_INFINITY;
E argmax = null;
for (E key : c.keySet()) {
double count = c.getCount(key);
if (argmax == null || count > max) {// || (count == max &&
// tieBreaker.compare(key, argmax) <
// 0)) {
max = count;
argmax = key;
}
}
return argmax;
} | java | public static <E> E argmax(Counter<E> c) {
double max = Double.NEGATIVE_INFINITY;
E argmax = null;
for (E key : c.keySet()) {
double count = c.getCount(key);
if (argmax == null || count > max) {// || (count == max &&
// tieBreaker.compare(key, argmax) <
// 0)) {
max = count;
argmax = key;
}
}
return argmax;
} | [
"public",
"static",
"<",
"E",
">",
"E",
"argmax",
"(",
"Counter",
"<",
"E",
">",
"c",
")",
"{",
"double",
"max",
"=",
"Double",
".",
"NEGATIVE_INFINITY",
";",
"E",
"argmax",
"=",
"null",
";",
"for",
"(",
"E",
"key",
":",
"c",
".",
"keySet",
"(",
")",
")",
"{",
"double",
"count",
"=",
"c",
".",
"getCount",
"(",
"key",
")",
";",
"if",
"(",
"argmax",
"==",
"null",
"||",
"count",
">",
"max",
")",
"{",
"// || (count == max &&\r",
"// tieBreaker.compare(key, argmax) <\r",
"// 0)) {\r",
"max",
"=",
"count",
";",
"argmax",
"=",
"key",
";",
"}",
"}",
"return",
"argmax",
";",
"}"
] | Finds and returns the key in the Counter with the largest count. Returning
null if count is empty.
@param c
The Counter
@return The key in the Counter with the largest count. | [
"Finds",
"and",
"returns",
"the",
"key",
"in",
"the",
"Counter",
"with",
"the",
"largest",
"count",
".",
"Returning",
"null",
"if",
"count",
"is",
"empty",
"."
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L196-L209 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.argmin | public static <E> E argmin(Counter<E> c) {
double min = Double.POSITIVE_INFINITY;
E argmin = null;
for (E key : c.keySet()) {
double count = c.getCount(key);
if (argmin == null || count < min) {// || (count == min &&
// tieBreaker.compare(key, argmin) <
// 0)) {
min = count;
argmin = key;
}
}
return argmin;
} | java | public static <E> E argmin(Counter<E> c) {
double min = Double.POSITIVE_INFINITY;
E argmin = null;
for (E key : c.keySet()) {
double count = c.getCount(key);
if (argmin == null || count < min) {// || (count == min &&
// tieBreaker.compare(key, argmin) <
// 0)) {
min = count;
argmin = key;
}
}
return argmin;
} | [
"public",
"static",
"<",
"E",
">",
"E",
"argmin",
"(",
"Counter",
"<",
"E",
">",
"c",
")",
"{",
"double",
"min",
"=",
"Double",
".",
"POSITIVE_INFINITY",
";",
"E",
"argmin",
"=",
"null",
";",
"for",
"(",
"E",
"key",
":",
"c",
".",
"keySet",
"(",
")",
")",
"{",
"double",
"count",
"=",
"c",
".",
"getCount",
"(",
"key",
")",
";",
"if",
"(",
"argmin",
"==",
"null",
"||",
"count",
"<",
"min",
")",
"{",
"// || (count == min &&\r",
"// tieBreaker.compare(key, argmin) <\r",
"// 0)) {\r",
"min",
"=",
"count",
";",
"argmin",
"=",
"key",
";",
"}",
"}",
"return",
"argmin",
";",
"}"
] | Finds and returns the key in this Counter with the smallest count.
@param c
The Counter
@return The key in the Counter with the smallest count. | [
"Finds",
"and",
"returns",
"the",
"key",
"in",
"this",
"Counter",
"with",
"the",
"smallest",
"count",
"."
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L218-L232 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.addInPlace | public static <E> void addInPlace(Counter<E> target, double value) {
for (E key : target.keySet()) {
target.incrementCount(key, value);
}
} | java | public static <E> void addInPlace(Counter<E> target, double value) {
for (E key : target.keySet()) {
target.incrementCount(key, value);
}
} | [
"public",
"static",
"<",
"E",
">",
"void",
"addInPlace",
"(",
"Counter",
"<",
"E",
">",
"target",
",",
"double",
"value",
")",
"{",
"for",
"(",
"E",
"key",
":",
"target",
".",
"keySet",
"(",
")",
")",
"{",
"target",
".",
"incrementCount",
"(",
"key",
",",
"value",
")",
";",
"}",
"}"
] | Increments all keys in a Counter by a specific value. | [
"Increments",
"all",
"keys",
"in",
"a",
"Counter",
"by",
"a",
"specific",
"value",
"."
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L382-L386 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.divideInPlace | public static <E> void divideInPlace(Counter<E> target, Counter<E> denominator) {
for (E key : target.keySet()) {
target.setCount(key, target.getCount(key) / denominator.getCount(key));
}
} | java | public static <E> void divideInPlace(Counter<E> target, Counter<E> denominator) {
for (E key : target.keySet()) {
target.setCount(key, target.getCount(key) / denominator.getCount(key));
}
} | [
"public",
"static",
"<",
"E",
">",
"void",
"divideInPlace",
"(",
"Counter",
"<",
"E",
">",
"target",
",",
"Counter",
"<",
"E",
">",
"denominator",
")",
"{",
"for",
"(",
"E",
"key",
":",
"target",
".",
"keySet",
"(",
")",
")",
"{",
"target",
".",
"setCount",
"(",
"key",
",",
"target",
".",
"getCount",
"(",
"key",
")",
"/",
"denominator",
".",
"getCount",
"(",
"key",
")",
")",
";",
"}",
"}"
] | Divides every non-zero count in target by the corresponding value in the
denominator Counter. Beware that this can give NaN values for zero counts
in the denominator counter! | [
"Divides",
"every",
"non",
"-",
"zero",
"count",
"in",
"target",
"by",
"the",
"corresponding",
"value",
"in",
"the",
"denominator",
"Counter",
".",
"Beware",
"that",
"this",
"can",
"give",
"NaN",
"values",
"for",
"zero",
"counts",
"in",
"the",
"denominator",
"counter!"
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L413-L417 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.dotProductInPlace | public static <E> void dotProductInPlace(Counter<E> target, Counter<E> term) {
for (E key : target.keySet()) {
target.setCount(key, target.getCount(key) * term.getCount(key));
}
} | java | public static <E> void dotProductInPlace(Counter<E> target, Counter<E> term) {
for (E key : target.keySet()) {
target.setCount(key, target.getCount(key) * term.getCount(key));
}
} | [
"public",
"static",
"<",
"E",
">",
"void",
"dotProductInPlace",
"(",
"Counter",
"<",
"E",
">",
"target",
",",
"Counter",
"<",
"E",
">",
"term",
")",
"{",
"for",
"(",
"E",
"key",
":",
"target",
".",
"keySet",
"(",
")",
")",
"{",
"target",
".",
"setCount",
"(",
"key",
",",
"target",
".",
"getCount",
"(",
"key",
")",
"*",
"term",
".",
"getCount",
"(",
"key",
")",
")",
";",
"}",
"}"
] | Multiplies every count in target by the corresponding value in the term
Counter. | [
"Multiplies",
"every",
"count",
"in",
"target",
"by",
"the",
"corresponding",
"value",
"in",
"the",
"term",
"Counter",
"."
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L423-L427 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.divideInPlace | public static <E> Counter<E> divideInPlace(Counter<E> target, double divisor) {
for (Entry<E, Double> entry : target.entrySet()) {
target.setCount(entry.getKey(), entry.getValue() / divisor);
}
return target;
} | java | public static <E> Counter<E> divideInPlace(Counter<E> target, double divisor) {
for (Entry<E, Double> entry : target.entrySet()) {
target.setCount(entry.getKey(), entry.getValue() / divisor);
}
return target;
} | [
"public",
"static",
"<",
"E",
">",
"Counter",
"<",
"E",
">",
"divideInPlace",
"(",
"Counter",
"<",
"E",
">",
"target",
",",
"double",
"divisor",
")",
"{",
"for",
"(",
"Entry",
"<",
"E",
",",
"Double",
">",
"entry",
":",
"target",
".",
"entrySet",
"(",
")",
")",
"{",
"target",
".",
"setCount",
"(",
"entry",
".",
"getKey",
"(",
")",
",",
"entry",
".",
"getValue",
"(",
")",
"/",
"divisor",
")",
";",
"}",
"return",
"target",
";",
"}"
] | Divides each value in target by the given divisor, in place.
@param target
The values in this Counter will be changed throught by the
multiplier
@param divisor
The number by which to change each number in the Counter
@return The target Counter is returned (for easier method chaining) | [
"Divides",
"each",
"value",
"in",
"target",
"by",
"the",
"given",
"divisor",
"in",
"place",
"."
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L439-L444 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.multiplyInPlace | public static <E> Counter<E> multiplyInPlace(Counter<E> target, double multiplier) {
for (Entry<E, Double> entry : target.entrySet()) {
target.setCount(entry.getKey(), entry.getValue() * multiplier);
}
return target;
} | java | public static <E> Counter<E> multiplyInPlace(Counter<E> target, double multiplier) {
for (Entry<E, Double> entry : target.entrySet()) {
target.setCount(entry.getKey(), entry.getValue() * multiplier);
}
return target;
} | [
"public",
"static",
"<",
"E",
">",
"Counter",
"<",
"E",
">",
"multiplyInPlace",
"(",
"Counter",
"<",
"E",
">",
"target",
",",
"double",
"multiplier",
")",
"{",
"for",
"(",
"Entry",
"<",
"E",
",",
"Double",
">",
"entry",
":",
"target",
".",
"entrySet",
"(",
")",
")",
"{",
"target",
".",
"setCount",
"(",
"entry",
".",
"getKey",
"(",
")",
",",
"entry",
".",
"getValue",
"(",
")",
"*",
"multiplier",
")",
";",
"}",
"return",
"target",
";",
"}"
] | Multiplies each value in target by the given multiplier, in place.
@param target
The values in this Counter will be changed throught by the
multiplier
@param multiplier
The number by which to change each number in the Counter | [
"Multiplies",
"each",
"value",
"in",
"target",
"by",
"the",
"given",
"multiplier",
"in",
"place",
"."
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L455-L460 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.deleteOutofRange | public static <E> List<E> deleteOutofRange(Counter<E> c, int top, int bottom) {
List<E> purgedItems = new ArrayList<E>();
int numToPurge = top + bottom;
if (numToPurge <= 0) {
return purgedItems;
}
List<E> l = Counters.toSortedList(c);
for (int i = 0; i < top; i++) {
E item = l.get(i);
purgedItems.add(item);
c.remove(item);
}
int size = c.size();
for (int i = c.size() - 1; i >= (size - bottom); i--) {
E item = l.get(i);
purgedItems.add(item);
c.remove(item);
}
return purgedItems;
} | java | public static <E> List<E> deleteOutofRange(Counter<E> c, int top, int bottom) {
List<E> purgedItems = new ArrayList<E>();
int numToPurge = top + bottom;
if (numToPurge <= 0) {
return purgedItems;
}
List<E> l = Counters.toSortedList(c);
for (int i = 0; i < top; i++) {
E item = l.get(i);
purgedItems.add(item);
c.remove(item);
}
int size = c.size();
for (int i = c.size() - 1; i >= (size - bottom); i--) {
E item = l.get(i);
purgedItems.add(item);
c.remove(item);
}
return purgedItems;
} | [
"public",
"static",
"<",
"E",
">",
"List",
"<",
"E",
">",
"deleteOutofRange",
"(",
"Counter",
"<",
"E",
">",
"c",
",",
"int",
"top",
",",
"int",
"bottom",
")",
"{",
"List",
"<",
"E",
">",
"purgedItems",
"=",
"new",
"ArrayList",
"<",
"E",
">",
"(",
")",
";",
"int",
"numToPurge",
"=",
"top",
"+",
"bottom",
";",
"if",
"(",
"numToPurge",
"<=",
"0",
")",
"{",
"return",
"purgedItems",
";",
"}",
"List",
"<",
"E",
">",
"l",
"=",
"Counters",
".",
"toSortedList",
"(",
"c",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"top",
";",
"i",
"++",
")",
"{",
"E",
"item",
"=",
"l",
".",
"get",
"(",
"i",
")",
";",
"purgedItems",
".",
"add",
"(",
"item",
")",
";",
"c",
".",
"remove",
"(",
"item",
")",
";",
"}",
"int",
"size",
"=",
"c",
".",
"size",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"c",
".",
"size",
"(",
")",
"-",
"1",
";",
"i",
">=",
"(",
"size",
"-",
"bottom",
")",
";",
"i",
"--",
")",
"{",
"E",
"item",
"=",
"l",
".",
"get",
"(",
"i",
")",
";",
"purgedItems",
".",
"add",
"(",
"item",
")",
";",
"c",
".",
"remove",
"(",
"item",
")",
";",
"}",
"return",
"purgedItems",
";",
"}"
] | Delete 'top' and 'bottom' number of elements from the top and bottom
respectively | [
"Delete",
"top",
"and",
"bottom",
"number",
"of",
"elements",
"from",
"the",
"top",
"and",
"bottom",
"respectively"
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L486-L507 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.retainNonZeros | public static <E> Set<E> retainNonZeros(Counter<E> counter) {
Set<E> removed = new HashSet<E>();
for (E key : counter.keySet()) {
if (counter.getCount(key) == 0.0) {
removed.add(key);
}
}
for (E key : removed) {
counter.remove(key);
}
return removed;
} | java | public static <E> Set<E> retainNonZeros(Counter<E> counter) {
Set<E> removed = new HashSet<E>();
for (E key : counter.keySet()) {
if (counter.getCount(key) == 0.0) {
removed.add(key);
}
}
for (E key : removed) {
counter.remove(key);
}
return removed;
} | [
"public",
"static",
"<",
"E",
">",
"Set",
"<",
"E",
">",
"retainNonZeros",
"(",
"Counter",
"<",
"E",
">",
"counter",
")",
"{",
"Set",
"<",
"E",
">",
"removed",
"=",
"new",
"HashSet",
"<",
"E",
">",
"(",
")",
";",
"for",
"(",
"E",
"key",
":",
"counter",
".",
"keySet",
"(",
")",
")",
"{",
"if",
"(",
"counter",
".",
"getCount",
"(",
"key",
")",
"==",
"0.0",
")",
"{",
"removed",
".",
"add",
"(",
"key",
")",
";",
"}",
"}",
"for",
"(",
"E",
"key",
":",
"removed",
")",
"{",
"counter",
".",
"remove",
"(",
"key",
")",
";",
"}",
"return",
"removed",
";",
"}"
] | Removes all entries with 0 count in the counter, returning the set of
removed entries. | [
"Removes",
"all",
"entries",
"with",
"0",
"count",
"in",
"the",
"counter",
"returning",
"the",
"set",
"of",
"removed",
"entries",
"."
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L560-L571 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.retainAbove | public static <E> Set<E> retainAbove(Counter<E> counter, double countThreshold) {
Set<E> removed = new HashSet<E>();
for (E key : counter.keySet()) {
if (counter.getCount(key) < countThreshold) {
removed.add(key);
}
}
for (E key : removed) {
counter.remove(key);
}
return removed;
} | java | public static <E> Set<E> retainAbove(Counter<E> counter, double countThreshold) {
Set<E> removed = new HashSet<E>();
for (E key : counter.keySet()) {
if (counter.getCount(key) < countThreshold) {
removed.add(key);
}
}
for (E key : removed) {
counter.remove(key);
}
return removed;
} | [
"public",
"static",
"<",
"E",
">",
"Set",
"<",
"E",
">",
"retainAbove",
"(",
"Counter",
"<",
"E",
">",
"counter",
",",
"double",
"countThreshold",
")",
"{",
"Set",
"<",
"E",
">",
"removed",
"=",
"new",
"HashSet",
"<",
"E",
">",
"(",
")",
";",
"for",
"(",
"E",
"key",
":",
"counter",
".",
"keySet",
"(",
")",
")",
"{",
"if",
"(",
"counter",
".",
"getCount",
"(",
"key",
")",
"<",
"countThreshold",
")",
"{",
"removed",
".",
"add",
"(",
"key",
")",
";",
"}",
"}",
"for",
"(",
"E",
"key",
":",
"removed",
")",
"{",
"counter",
".",
"remove",
"(",
"key",
")",
";",
"}",
"return",
"removed",
";",
"}"
] | Removes all entries with counts below the given threshold, returning the
set of removed entries.
@param counter
The counter.
@param countThreshold
The minimum count for an entry to be kept. Entries (strictly) less
than this threshold are discarded.
@return The set of discarded entries. | [
"Removes",
"all",
"entries",
"with",
"counts",
"below",
"the",
"given",
"threshold",
"returning",
"the",
"set",
"of",
"removed",
"entries",
"."
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L584-L595 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.retainBelow | public static <E> Set<E> retainBelow(Counter<E> counter, double countMaxThreshold) {
Set<E> removed = new HashSet<E>();
for (E key : counter.keySet()) {
if (counter.getCount(key) > countMaxThreshold) {
removed.add(key);
}
}
for (E key : removed) {
counter.remove(key);
}
return removed;
} | java | public static <E> Set<E> retainBelow(Counter<E> counter, double countMaxThreshold) {
Set<E> removed = new HashSet<E>();
for (E key : counter.keySet()) {
if (counter.getCount(key) > countMaxThreshold) {
removed.add(key);
}
}
for (E key : removed) {
counter.remove(key);
}
return removed;
} | [
"public",
"static",
"<",
"E",
">",
"Set",
"<",
"E",
">",
"retainBelow",
"(",
"Counter",
"<",
"E",
">",
"counter",
",",
"double",
"countMaxThreshold",
")",
"{",
"Set",
"<",
"E",
">",
"removed",
"=",
"new",
"HashSet",
"<",
"E",
">",
"(",
")",
";",
"for",
"(",
"E",
"key",
":",
"counter",
".",
"keySet",
"(",
")",
")",
"{",
"if",
"(",
"counter",
".",
"getCount",
"(",
"key",
")",
">",
"countMaxThreshold",
")",
"{",
"removed",
".",
"add",
"(",
"key",
")",
";",
"}",
"}",
"for",
"(",
"E",
"key",
":",
"removed",
")",
"{",
"counter",
".",
"remove",
"(",
"key",
")",
";",
"}",
"return",
"removed",
";",
"}"
] | Removes all entries with counts above the given threshold, returning the
set of removed entries.
@param counter
The counter.
@param countMaxThreshold
The maximum count for an entry to be kept. Entries (strictly) more
than this threshold are discarded.
@return The set of discarded entries. | [
"Removes",
"all",
"entries",
"with",
"counts",
"above",
"the",
"given",
"threshold",
"returning",
"the",
"set",
"of",
"removed",
"entries",
"."
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L608-L619 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.retainMatchingKeys | public static Set<String> retainMatchingKeys(Counter<String> counter, List<Pattern> matchPatterns) {
Set<String> removed = new HashSet<String>();
for (String key : counter.keySet()) {
boolean matched = false;
for (Pattern pattern : matchPatterns) {
if (pattern.matcher(key).matches()) {
matched = true;
break;
}
}
if (!matched) {
removed.add(key);
}
}
for (String key : removed) {
counter.remove(key);
}
return removed;
} | java | public static Set<String> retainMatchingKeys(Counter<String> counter, List<Pattern> matchPatterns) {
Set<String> removed = new HashSet<String>();
for (String key : counter.keySet()) {
boolean matched = false;
for (Pattern pattern : matchPatterns) {
if (pattern.matcher(key).matches()) {
matched = true;
break;
}
}
if (!matched) {
removed.add(key);
}
}
for (String key : removed) {
counter.remove(key);
}
return removed;
} | [
"public",
"static",
"Set",
"<",
"String",
">",
"retainMatchingKeys",
"(",
"Counter",
"<",
"String",
">",
"counter",
",",
"List",
"<",
"Pattern",
">",
"matchPatterns",
")",
"{",
"Set",
"<",
"String",
">",
"removed",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
")",
";",
"for",
"(",
"String",
"key",
":",
"counter",
".",
"keySet",
"(",
")",
")",
"{",
"boolean",
"matched",
"=",
"false",
";",
"for",
"(",
"Pattern",
"pattern",
":",
"matchPatterns",
")",
"{",
"if",
"(",
"pattern",
".",
"matcher",
"(",
"key",
")",
".",
"matches",
"(",
")",
")",
"{",
"matched",
"=",
"true",
";",
"break",
";",
"}",
"}",
"if",
"(",
"!",
"matched",
")",
"{",
"removed",
".",
"add",
"(",
"key",
")",
";",
"}",
"}",
"for",
"(",
"String",
"key",
":",
"removed",
")",
"{",
"counter",
".",
"remove",
"(",
"key",
")",
";",
"}",
"return",
"removed",
";",
"}"
] | Removes all entries with keys that does not match one of the given patterns
@param counter
The counter.
@param matchPatterns
pattern for key to match
@return The set of discarded entries. | [
"Removes",
"all",
"entries",
"with",
"keys",
"that",
"does",
"not",
"match",
"one",
"of",
"the",
"given",
"patterns"
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L630-L648 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.retainKeys | public static<E> Set<E> retainKeys(Counter<E> counter, Collection<E> matchKeys) {
Set<E> removed = new HashSet<E>();
for (E key : counter.keySet()) {
boolean matched = matchKeys.contains(key);
if (!matched) {
removed.add(key);
}
}
for (E key : removed) {
counter.remove(key);
}
return removed;
} | java | public static<E> Set<E> retainKeys(Counter<E> counter, Collection<E> matchKeys) {
Set<E> removed = new HashSet<E>();
for (E key : counter.keySet()) {
boolean matched = matchKeys.contains(key);
if (!matched) {
removed.add(key);
}
}
for (E key : removed) {
counter.remove(key);
}
return removed;
} | [
"public",
"static",
"<",
"E",
">",
"Set",
"<",
"E",
">",
"retainKeys",
"(",
"Counter",
"<",
"E",
">",
"counter",
",",
"Collection",
"<",
"E",
">",
"matchKeys",
")",
"{",
"Set",
"<",
"E",
">",
"removed",
"=",
"new",
"HashSet",
"<",
"E",
">",
"(",
")",
";",
"for",
"(",
"E",
"key",
":",
"counter",
".",
"keySet",
"(",
")",
")",
"{",
"boolean",
"matched",
"=",
"matchKeys",
".",
"contains",
"(",
"key",
")",
";",
"if",
"(",
"!",
"matched",
")",
"{",
"removed",
".",
"add",
"(",
"key",
")",
";",
"}",
"}",
"for",
"(",
"E",
"key",
":",
"removed",
")",
"{",
"counter",
".",
"remove",
"(",
"key",
")",
";",
"}",
"return",
"removed",
";",
"}"
] | Removes all entries with keys that does not match the given set of keys
@param counter
The counter.
@param matchKeys
Keys to match
@return The set of discarded entries. | [
"Removes",
"all",
"entries",
"with",
"keys",
"that",
"does",
"not",
"match",
"the",
"given",
"set",
"of",
"keys"
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L659-L671 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.removeKeys | public static <E> void removeKeys(Counter<E> counter, Collection<E> removeKeysCollection) {
for (E key : removeKeysCollection)
counter.remove(key);
} | java | public static <E> void removeKeys(Counter<E> counter, Collection<E> removeKeysCollection) {
for (E key : removeKeysCollection)
counter.remove(key);
} | [
"public",
"static",
"<",
"E",
">",
"void",
"removeKeys",
"(",
"Counter",
"<",
"E",
">",
"counter",
",",
"Collection",
"<",
"E",
">",
"removeKeysCollection",
")",
"{",
"for",
"(",
"E",
"key",
":",
"removeKeysCollection",
")",
"counter",
".",
"remove",
"(",
"key",
")",
";",
"}"
] | Removes all entries with keys in the given collection
@param <E>
@param counter
@param removeKeysCollection | [
"Removes",
"all",
"entries",
"with",
"keys",
"in",
"the",
"given",
"collection"
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L680-L684 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.transform | public static <T1, T2> Counter<T2> transform(Counter<T1> c, Function<T1, T2> f) {
Counter<T2> c2 = new ClassicCounter<T2>();
for (T1 key : c.keySet()) {
c2.setCount(f.apply(key), c.getCount(key));
}
return c2;
} | java | public static <T1, T2> Counter<T2> transform(Counter<T1> c, Function<T1, T2> f) {
Counter<T2> c2 = new ClassicCounter<T2>();
for (T1 key : c.keySet()) {
c2.setCount(f.apply(key), c.getCount(key));
}
return c2;
} | [
"public",
"static",
"<",
"T1",
",",
"T2",
">",
"Counter",
"<",
"T2",
">",
"transform",
"(",
"Counter",
"<",
"T1",
">",
"c",
",",
"Function",
"<",
"T1",
",",
"T2",
">",
"f",
")",
"{",
"Counter",
"<",
"T2",
">",
"c2",
"=",
"new",
"ClassicCounter",
"<",
"T2",
">",
"(",
")",
";",
"for",
"(",
"T1",
"key",
":",
"c",
".",
"keySet",
"(",
")",
")",
"{",
"c2",
".",
"setCount",
"(",
"f",
".",
"apply",
"(",
"key",
")",
",",
"c",
".",
"getCount",
"(",
"key",
")",
")",
";",
"}",
"return",
"c2",
";",
"}"
] | Returns the counter with keys modified according to function F. Eager
evaluation. | [
"Returns",
"the",
"counter",
"with",
"keys",
"modified",
"according",
"to",
"function",
"F",
".",
"Eager",
"evaluation",
"."
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L743-L749 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.toRankCounter | public static <E> IntCounter<E> toRankCounter(Counter<E> c) {
IntCounter<E> rankCounter = new IntCounter<E>();
List<E> sortedList = toSortedList(c);
for (int i = 0; i < sortedList.size(); i++) {
rankCounter.setCount(sortedList.get(i), i);
}
return rankCounter;
} | java | public static <E> IntCounter<E> toRankCounter(Counter<E> c) {
IntCounter<E> rankCounter = new IntCounter<E>();
List<E> sortedList = toSortedList(c);
for (int i = 0; i < sortedList.size(); i++) {
rankCounter.setCount(sortedList.get(i), i);
}
return rankCounter;
} | [
"public",
"static",
"<",
"E",
">",
"IntCounter",
"<",
"E",
">",
"toRankCounter",
"(",
"Counter",
"<",
"E",
">",
"c",
")",
"{",
"IntCounter",
"<",
"E",
">",
"rankCounter",
"=",
"new",
"IntCounter",
"<",
"E",
">",
"(",
")",
";",
"List",
"<",
"E",
">",
"sortedList",
"=",
"toSortedList",
"(",
"c",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"sortedList",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"rankCounter",
".",
"setCount",
"(",
"sortedList",
".",
"get",
"(",
"i",
")",
",",
"i",
")",
";",
"}",
"return",
"rankCounter",
";",
"}"
] | Converts a counter to ranks
@return A counter where the count is the rank in the original counter | [
"Converts",
"a",
"counter",
"to",
"ranks"
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L887-L894 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.toSortedListWithCounts | public static <E> List<Pair<E, Double>> toSortedListWithCounts(Counter<E> c) {
List<Pair<E, Double>> l = new ArrayList<Pair<E, Double>>(c.size());
for (E e : c.keySet()) {
l.add(new Pair<E, Double>(e, c.getCount(e)));
}
// descending order
Collections.sort(l, new Comparator<Pair<E, Double>>() {
public int compare(Pair<E, Double> a, Pair<E, Double> b) {
return Double.compare(b.second, a.second);
}
});
return l;
} | java | public static <E> List<Pair<E, Double>> toSortedListWithCounts(Counter<E> c) {
List<Pair<E, Double>> l = new ArrayList<Pair<E, Double>>(c.size());
for (E e : c.keySet()) {
l.add(new Pair<E, Double>(e, c.getCount(e)));
}
// descending order
Collections.sort(l, new Comparator<Pair<E, Double>>() {
public int compare(Pair<E, Double> a, Pair<E, Double> b) {
return Double.compare(b.second, a.second);
}
});
return l;
} | [
"public",
"static",
"<",
"E",
">",
"List",
"<",
"Pair",
"<",
"E",
",",
"Double",
">",
">",
"toSortedListWithCounts",
"(",
"Counter",
"<",
"E",
">",
"c",
")",
"{",
"List",
"<",
"Pair",
"<",
"E",
",",
"Double",
">",
">",
"l",
"=",
"new",
"ArrayList",
"<",
"Pair",
"<",
"E",
",",
"Double",
">",
">",
"(",
"c",
".",
"size",
"(",
")",
")",
";",
"for",
"(",
"E",
"e",
":",
"c",
".",
"keySet",
"(",
")",
")",
"{",
"l",
".",
"add",
"(",
"new",
"Pair",
"<",
"E",
",",
"Double",
">",
"(",
"e",
",",
"c",
".",
"getCount",
"(",
"e",
")",
")",
")",
";",
"}",
"// descending order\r",
"Collections",
".",
"sort",
"(",
"l",
",",
"new",
"Comparator",
"<",
"Pair",
"<",
"E",
",",
"Double",
">",
">",
"(",
")",
"{",
"public",
"int",
"compare",
"(",
"Pair",
"<",
"E",
",",
"Double",
">",
"a",
",",
"Pair",
"<",
"E",
",",
"Double",
">",
"b",
")",
"{",
"return",
"Double",
".",
"compare",
"(",
"b",
".",
"second",
",",
"a",
".",
"second",
")",
";",
"}",
"}",
")",
";",
"return",
"l",
";",
"}"
] | A List of the keys in c, sorted from highest count to lowest, paired with
counts
@return A List of the keys in c, sorted from highest count to lowest. | [
"A",
"List",
"of",
"the",
"keys",
"in",
"c",
"sorted",
"from",
"highest",
"count",
"to",
"lowest",
"paired",
"with",
"counts"
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L914-L926 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.intersection | public static <E> Counter<E> intersection(Counter<E> c1, Counter<E> c2) {
Counter<E> result = c1.getFactory().create();
for (E key : Sets.union(c1.keySet(), c2.keySet())) {
double count1 = c1.getCount(key);
double count2 = c2.getCount(key);
double minCount = (count1 < count2 ? count1 : count2);
if (minCount > 0) {
result.setCount(key, minCount);
}
}
return result;
} | java | public static <E> Counter<E> intersection(Counter<E> c1, Counter<E> c2) {
Counter<E> result = c1.getFactory().create();
for (E key : Sets.union(c1.keySet(), c2.keySet())) {
double count1 = c1.getCount(key);
double count2 = c2.getCount(key);
double minCount = (count1 < count2 ? count1 : count2);
if (minCount > 0) {
result.setCount(key, minCount);
}
}
return result;
} | [
"public",
"static",
"<",
"E",
">",
"Counter",
"<",
"E",
">",
"intersection",
"(",
"Counter",
"<",
"E",
">",
"c1",
",",
"Counter",
"<",
"E",
">",
"c2",
")",
"{",
"Counter",
"<",
"E",
">",
"result",
"=",
"c1",
".",
"getFactory",
"(",
")",
".",
"create",
"(",
")",
";",
"for",
"(",
"E",
"key",
":",
"Sets",
".",
"union",
"(",
"c1",
".",
"keySet",
"(",
")",
",",
"c2",
".",
"keySet",
"(",
")",
")",
")",
"{",
"double",
"count1",
"=",
"c1",
".",
"getCount",
"(",
"key",
")",
";",
"double",
"count2",
"=",
"c2",
".",
"getCount",
"(",
"key",
")",
";",
"double",
"minCount",
"=",
"(",
"count1",
"<",
"count2",
"?",
"count1",
":",
"count2",
")",
";",
"if",
"(",
"minCount",
">",
"0",
")",
"{",
"result",
".",
"setCount",
"(",
"key",
",",
"minCount",
")",
";",
"}",
"}",
"return",
"result",
";",
"}"
] | Returns a counter that is the intersection of c1 and c2. If both c1 and c2
contain a key, the min of the two counts is used.
@return A counter that is the intersection of c1 and c2 | [
"Returns",
"a",
"counter",
"that",
"is",
"the",
"intersection",
"of",
"c1",
"and",
"c2",
".",
"If",
"both",
"c1",
"and",
"c2",
"contain",
"a",
"key",
"the",
"min",
"of",
"the",
"two",
"counts",
"is",
"used",
"."
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L971-L982 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.optimizedDotProduct | public static <E> double optimizedDotProduct(Counter<E> c1, Counter<E> c2) {
double dotProd = 0.0;
int size1 = c1.size();
int size2 = c2.size();
if (size1 < size2) {
for (E key : c1.keySet()) {
double count1 = c1.getCount(key);
if (count1 != 0.0) {
double count2 = c2.getCount(key);
if (count2 != 0.0)
dotProd += (count1 * count2);
}
}
} else {
for (E key : c2.keySet()) {
double count2 = c2.getCount(key);
if (count2 != 0.0) {
double count1 = c1.getCount(key);
if (count1 != 0.0)
dotProd += (count1 * count2);
}
}
}
return dotProd;
} | java | public static <E> double optimizedDotProduct(Counter<E> c1, Counter<E> c2) {
double dotProd = 0.0;
int size1 = c1.size();
int size2 = c2.size();
if (size1 < size2) {
for (E key : c1.keySet()) {
double count1 = c1.getCount(key);
if (count1 != 0.0) {
double count2 = c2.getCount(key);
if (count2 != 0.0)
dotProd += (count1 * count2);
}
}
} else {
for (E key : c2.keySet()) {
double count2 = c2.getCount(key);
if (count2 != 0.0) {
double count1 = c1.getCount(key);
if (count1 != 0.0)
dotProd += (count1 * count2);
}
}
}
return dotProd;
} | [
"public",
"static",
"<",
"E",
">",
"double",
"optimizedDotProduct",
"(",
"Counter",
"<",
"E",
">",
"c1",
",",
"Counter",
"<",
"E",
">",
"c2",
")",
"{",
"double",
"dotProd",
"=",
"0.0",
";",
"int",
"size1",
"=",
"c1",
".",
"size",
"(",
")",
";",
"int",
"size2",
"=",
"c2",
".",
"size",
"(",
")",
";",
"if",
"(",
"size1",
"<",
"size2",
")",
"{",
"for",
"(",
"E",
"key",
":",
"c1",
".",
"keySet",
"(",
")",
")",
"{",
"double",
"count1",
"=",
"c1",
".",
"getCount",
"(",
"key",
")",
";",
"if",
"(",
"count1",
"!=",
"0.0",
")",
"{",
"double",
"count2",
"=",
"c2",
".",
"getCount",
"(",
"key",
")",
";",
"if",
"(",
"count2",
"!=",
"0.0",
")",
"dotProd",
"+=",
"(",
"count1",
"*",
"count2",
")",
";",
"}",
"}",
"}",
"else",
"{",
"for",
"(",
"E",
"key",
":",
"c2",
".",
"keySet",
"(",
")",
")",
"{",
"double",
"count2",
"=",
"c2",
".",
"getCount",
"(",
"key",
")",
";",
"if",
"(",
"count2",
"!=",
"0.0",
")",
"{",
"double",
"count1",
"=",
"c1",
".",
"getCount",
"(",
"key",
")",
";",
"if",
"(",
"count1",
"!=",
"0.0",
")",
"dotProd",
"+=",
"(",
"count1",
"*",
"count2",
")",
";",
"}",
"}",
"}",
"return",
"dotProd",
";",
"}"
] | This method does not check entries for NAN or INFINITY values in the
doubles returned. It also only iterates over the counter with the smallest
number of keys to help speed up computation. Pair this method with
normalizing your counters before hand and you have a reasonably quick
implementation of cosine.
@param <E>
@param c1
@param c2
@return The dot product of the two counter (as vectors) | [
"This",
"method",
"does",
"not",
"check",
"entries",
"for",
"NAN",
"or",
"INFINITY",
"values",
"in",
"the",
"doubles",
"returned",
".",
"It",
"also",
"only",
"iterates",
"over",
"the",
"counter",
"with",
"the",
"smallest",
"number",
"of",
"keys",
"to",
"help",
"speed",
"up",
"computation",
".",
"Pair",
"this",
"method",
"with",
"normalizing",
"your",
"counters",
"before",
"hand",
"and",
"you",
"have",
"a",
"reasonably",
"quick",
"implementation",
"of",
"cosine",
"."
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L1092-L1117 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.absoluteDifference | public static <E> Counter<E> absoluteDifference(Counter<E> c1, Counter<E> c2) {
Counter<E> result = c1.getFactory().create();
for (E key : Sets.union(c1.keySet(), c2.keySet())) {
double newCount = Math.abs(c1.getCount(key) - c2.getCount(key));
if (newCount > 0) {
result.setCount(key, newCount);
}
}
return result;
} | java | public static <E> Counter<E> absoluteDifference(Counter<E> c1, Counter<E> c2) {
Counter<E> result = c1.getFactory().create();
for (E key : Sets.union(c1.keySet(), c2.keySet())) {
double newCount = Math.abs(c1.getCount(key) - c2.getCount(key));
if (newCount > 0) {
result.setCount(key, newCount);
}
}
return result;
} | [
"public",
"static",
"<",
"E",
">",
"Counter",
"<",
"E",
">",
"absoluteDifference",
"(",
"Counter",
"<",
"E",
">",
"c1",
",",
"Counter",
"<",
"E",
">",
"c2",
")",
"{",
"Counter",
"<",
"E",
">",
"result",
"=",
"c1",
".",
"getFactory",
"(",
")",
".",
"create",
"(",
")",
";",
"for",
"(",
"E",
"key",
":",
"Sets",
".",
"union",
"(",
"c1",
".",
"keySet",
"(",
")",
",",
"c2",
".",
"keySet",
"(",
")",
")",
")",
"{",
"double",
"newCount",
"=",
"Math",
".",
"abs",
"(",
"c1",
".",
"getCount",
"(",
"key",
")",
"-",
"c2",
".",
"getCount",
"(",
"key",
")",
")",
";",
"if",
"(",
"newCount",
">",
"0",
")",
"{",
"result",
".",
"setCount",
"(",
"key",
",",
"newCount",
")",
";",
"}",
"}",
"return",
"result",
";",
"}"
] | Returns |c1 - c2|.
@return The difference between sets c1 and c2. | [
"Returns",
"|c1",
"-",
"c2|",
"."
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L1124-L1133 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.division | public static <E> Counter<E> division(Counter<E> c1, Counter<E> c2) {
Counter<E> result = c1.getFactory().create();
for (E key : Sets.union(c1.keySet(), c2.keySet())) {
result.setCount(key, c1.getCount(key) / c2.getCount(key));
}
return result;
} | java | public static <E> Counter<E> division(Counter<E> c1, Counter<E> c2) {
Counter<E> result = c1.getFactory().create();
for (E key : Sets.union(c1.keySet(), c2.keySet())) {
result.setCount(key, c1.getCount(key) / c2.getCount(key));
}
return result;
} | [
"public",
"static",
"<",
"E",
">",
"Counter",
"<",
"E",
">",
"division",
"(",
"Counter",
"<",
"E",
">",
"c1",
",",
"Counter",
"<",
"E",
">",
"c2",
")",
"{",
"Counter",
"<",
"E",
">",
"result",
"=",
"c1",
".",
"getFactory",
"(",
")",
".",
"create",
"(",
")",
";",
"for",
"(",
"E",
"key",
":",
"Sets",
".",
"union",
"(",
"c1",
".",
"keySet",
"(",
")",
",",
"c2",
".",
"keySet",
"(",
")",
")",
")",
"{",
"result",
".",
"setCount",
"(",
"key",
",",
"c1",
".",
"getCount",
"(",
"key",
")",
"/",
"c2",
".",
"getCount",
"(",
"key",
")",
")",
";",
"}",
"return",
"result",
";",
"}"
] | Returns c1 divided by c2. Note that this can create NaN if c1 has non-zero
counts for keys that c2 has zero counts.
@return c1 divided by c2. | [
"Returns",
"c1",
"divided",
"by",
"c2",
".",
"Note",
"that",
"this",
"can",
"create",
"NaN",
"if",
"c1",
"has",
"non",
"-",
"zero",
"counts",
"for",
"keys",
"that",
"c2",
"has",
"zero",
"counts",
"."
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L1141-L1147 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.crossEntropy | public static <E> double crossEntropy(Counter<E> from, Counter<E> to) {
double tot2 = to.totalCount();
double result = 0.0;
for (E key : from.keySet()) {
double count1 = from.getCount(key);
if (count1 == 0.0) {
continue;
}
double count2 = to.getCount(key);
double logFract = Math.log(count2 / tot2);
if (logFract == Double.NEGATIVE_INFINITY) {
return Double.NEGATIVE_INFINITY; // can't recover
}
result += count1 * (logFract / LOG_E_2); // express it in log base 2
}
return result;
} | java | public static <E> double crossEntropy(Counter<E> from, Counter<E> to) {
double tot2 = to.totalCount();
double result = 0.0;
for (E key : from.keySet()) {
double count1 = from.getCount(key);
if (count1 == 0.0) {
continue;
}
double count2 = to.getCount(key);
double logFract = Math.log(count2 / tot2);
if (logFract == Double.NEGATIVE_INFINITY) {
return Double.NEGATIVE_INFINITY; // can't recover
}
result += count1 * (logFract / LOG_E_2); // express it in log base 2
}
return result;
} | [
"public",
"static",
"<",
"E",
">",
"double",
"crossEntropy",
"(",
"Counter",
"<",
"E",
">",
"from",
",",
"Counter",
"<",
"E",
">",
"to",
")",
"{",
"double",
"tot2",
"=",
"to",
".",
"totalCount",
"(",
")",
";",
"double",
"result",
"=",
"0.0",
";",
"for",
"(",
"E",
"key",
":",
"from",
".",
"keySet",
"(",
")",
")",
"{",
"double",
"count1",
"=",
"from",
".",
"getCount",
"(",
"key",
")",
";",
"if",
"(",
"count1",
"==",
"0.0",
")",
"{",
"continue",
";",
"}",
"double",
"count2",
"=",
"to",
".",
"getCount",
"(",
"key",
")",
";",
"double",
"logFract",
"=",
"Math",
".",
"log",
"(",
"count2",
"/",
"tot2",
")",
";",
"if",
"(",
"logFract",
"==",
"Double",
".",
"NEGATIVE_INFINITY",
")",
"{",
"return",
"Double",
".",
"NEGATIVE_INFINITY",
";",
"// can't recover\r",
"}",
"result",
"+=",
"count1",
"*",
"(",
"logFract",
"/",
"LOG_E_2",
")",
";",
"// express it in log base 2\r",
"}",
"return",
"result",
";",
"}"
] | Note that this implementation doesn't normalize the "from" Counter. It
does, however, normalize the "to" Counter. Result is meaningless if any of
the counts are negative.
@return The cross entropy of H(from, to) | [
"Note",
"that",
"this",
"implementation",
"doesn",
"t",
"normalize",
"the",
"from",
"Counter",
".",
"It",
"does",
"however",
"normalize",
"the",
"to",
"Counter",
".",
"Result",
"is",
"meaningless",
"if",
"any",
"of",
"the",
"counts",
"are",
"negative",
"."
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L1177-L1193 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.L2Normalize | public static <E, C extends Counter<E>> C L2Normalize(C c) {
return scale(c, 1.0 / L2Norm(c));
} | java | public static <E, C extends Counter<E>> C L2Normalize(C c) {
return scale(c, 1.0 / L2Norm(c));
} | [
"public",
"static",
"<",
"E",
",",
"C",
"extends",
"Counter",
"<",
"E",
">",
">",
"C",
"L2Normalize",
"(",
"C",
"c",
")",
"{",
"return",
"scale",
"(",
"c",
",",
"1.0",
"/",
"L2Norm",
"(",
"c",
")",
")",
";",
"}"
] | L2 normalize a counter.
@param c
The {@link Counter} to be L2 normalized. This counter is not
modified.
@return A new l2-normalized Counter based on c. | [
"L2",
"normalize",
"a",
"counter",
"."
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L1301-L1303 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.L2NormalizeInPlace | public static <E, C extends Counter<E>> Counter<E> L2NormalizeInPlace(Counter<E> c) {
return multiplyInPlace(c, 1.0 / L2Norm(c));
} | java | public static <E, C extends Counter<E>> Counter<E> L2NormalizeInPlace(Counter<E> c) {
return multiplyInPlace(c, 1.0 / L2Norm(c));
} | [
"public",
"static",
"<",
"E",
",",
"C",
"extends",
"Counter",
"<",
"E",
">",
">",
"Counter",
"<",
"E",
">",
"L2NormalizeInPlace",
"(",
"Counter",
"<",
"E",
">",
"c",
")",
"{",
"return",
"multiplyInPlace",
"(",
"c",
",",
"1.0",
"/",
"L2Norm",
"(",
"c",
")",
")",
";",
"}"
] | L2 normalize a counter in place.
@param c
The {@link Counter} to be L2 normalized. This counter is modified
@return the passed in counter l2-normalized | [
"L2",
"normalize",
"a",
"counter",
"in",
"place",
"."
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L1312-L1314 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.saferL2Normalize | public static <E, C extends Counter<E>> C saferL2Normalize(C c) {
return scale(c, 1.0 / saferL2Norm(c));
} | java | public static <E, C extends Counter<E>> C saferL2Normalize(C c) {
return scale(c, 1.0 / saferL2Norm(c));
} | [
"public",
"static",
"<",
"E",
",",
"C",
"extends",
"Counter",
"<",
"E",
">",
">",
"C",
"saferL2Normalize",
"(",
"C",
"c",
")",
"{",
"return",
"scale",
"(",
"c",
",",
"1.0",
"/",
"saferL2Norm",
"(",
"c",
")",
")",
";",
"}"
] | L2 normalize a counter, using the "safer" L2 normalizer.
@param c
The {@link Counter} to be L2 normalized. This counter is not
modified.
@return A new l2-normalized Counter based on c. | [
"L2",
"normalize",
"a",
"counter",
"using",
"the",
"safer",
"L2",
"normalizer",
"."
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L1348-L1350 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.average | public static <E> Counter<E> average(Counter<E> c1, Counter<E> c2) {
Counter<E> average = c1.getFactory().create();
Set<E> allKeys = new HashSet<E>(c1.keySet());
allKeys.addAll(c2.keySet());
for (E key : allKeys) {
average.setCount(key, (c1.getCount(key) + c2.getCount(key)) * 0.5);
}
return average;
} | java | public static <E> Counter<E> average(Counter<E> c1, Counter<E> c2) {
Counter<E> average = c1.getFactory().create();
Set<E> allKeys = new HashSet<E>(c1.keySet());
allKeys.addAll(c2.keySet());
for (E key : allKeys) {
average.setCount(key, (c1.getCount(key) + c2.getCount(key)) * 0.5);
}
return average;
} | [
"public",
"static",
"<",
"E",
">",
"Counter",
"<",
"E",
">",
"average",
"(",
"Counter",
"<",
"E",
">",
"c1",
",",
"Counter",
"<",
"E",
">",
"c2",
")",
"{",
"Counter",
"<",
"E",
">",
"average",
"=",
"c1",
".",
"getFactory",
"(",
")",
".",
"create",
"(",
")",
";",
"Set",
"<",
"E",
">",
"allKeys",
"=",
"new",
"HashSet",
"<",
"E",
">",
"(",
"c1",
".",
"keySet",
"(",
")",
")",
";",
"allKeys",
".",
"addAll",
"(",
"c2",
".",
"keySet",
"(",
")",
")",
";",
"for",
"(",
"E",
"key",
":",
"allKeys",
")",
"{",
"average",
".",
"setCount",
"(",
"key",
",",
"(",
"c1",
".",
"getCount",
"(",
"key",
")",
"+",
"c2",
".",
"getCount",
"(",
"key",
")",
")",
"*",
"0.5",
")",
";",
"}",
"return",
"average",
";",
"}"
] | Returns a new Counter with counts averaged from the two given Counters. The
average Counter will contain the union of keys in both source Counters, and
each count will be the average of the two source counts for that key, where
as usual a missing count in one Counter is treated as count 0.
@return A new counter with counts that are the mean of the resp. counts in
the given counters. | [
"Returns",
"a",
"new",
"Counter",
"with",
"counts",
"averaged",
"from",
"the",
"two",
"given",
"Counters",
".",
"The",
"average",
"Counter",
"will",
"contain",
"the",
"union",
"of",
"keys",
"in",
"both",
"source",
"Counters",
"and",
"each",
"count",
"will",
"be",
"the",
"average",
"of",
"the",
"two",
"source",
"counts",
"for",
"that",
"key",
"where",
"as",
"usual",
"a",
"missing",
"count",
"in",
"one",
"Counter",
"is",
"treated",
"as",
"count",
"0",
"."
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L1389-L1397 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.linearCombination | public static <E> Counter<E> linearCombination(Counter<E> c1, double w1, Counter<E> c2, double w2) {
Counter<E> result = c1.getFactory().create();
for (E o : c1.keySet()) {
result.incrementCount(o, c1.getCount(o) * w1);
}
for (E o : c2.keySet()) {
result.incrementCount(o, c2.getCount(o) * w2);
}
return result;
} | java | public static <E> Counter<E> linearCombination(Counter<E> c1, double w1, Counter<E> c2, double w2) {
Counter<E> result = c1.getFactory().create();
for (E o : c1.keySet()) {
result.incrementCount(o, c1.getCount(o) * w1);
}
for (E o : c2.keySet()) {
result.incrementCount(o, c2.getCount(o) * w2);
}
return result;
} | [
"public",
"static",
"<",
"E",
">",
"Counter",
"<",
"E",
">",
"linearCombination",
"(",
"Counter",
"<",
"E",
">",
"c1",
",",
"double",
"w1",
",",
"Counter",
"<",
"E",
">",
"c2",
",",
"double",
"w2",
")",
"{",
"Counter",
"<",
"E",
">",
"result",
"=",
"c1",
".",
"getFactory",
"(",
")",
".",
"create",
"(",
")",
";",
"for",
"(",
"E",
"o",
":",
"c1",
".",
"keySet",
"(",
")",
")",
"{",
"result",
".",
"incrementCount",
"(",
"o",
",",
"c1",
".",
"getCount",
"(",
"o",
")",
"*",
"w1",
")",
";",
"}",
"for",
"(",
"E",
"o",
":",
"c2",
".",
"keySet",
"(",
")",
")",
"{",
"result",
".",
"incrementCount",
"(",
"o",
",",
"c2",
".",
"getCount",
"(",
"o",
")",
"*",
"w2",
")",
";",
"}",
"return",
"result",
";",
"}"
] | Returns a Counter which is a weighted average of c1 and c2. Counts from c1
are weighted with weight w1 and counts from c2 are weighted with w2. | [
"Returns",
"a",
"Counter",
"which",
"is",
"a",
"weighted",
"average",
"of",
"c1",
"and",
"c2",
".",
"Counts",
"from",
"c1",
"are",
"weighted",
"with",
"weight",
"w1",
"and",
"counts",
"from",
"c2",
"are",
"weighted",
"with",
"w2",
"."
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L1403-L1412 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.scale | @SuppressWarnings("unchecked")
public static <E, C extends Counter<E>> C scale(C c, double s) {
C scaled = (C) c.getFactory().create();
for (E key : c.keySet()) {
scaled.setCount(key, c.getCount(key) * s);
}
return scaled;
} | java | @SuppressWarnings("unchecked")
public static <E, C extends Counter<E>> C scale(C c, double s) {
C scaled = (C) c.getFactory().create();
for (E key : c.keySet()) {
scaled.setCount(key, c.getCount(key) * s);
}
return scaled;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"E",
",",
"C",
"extends",
"Counter",
"<",
"E",
">",
">",
"C",
"scale",
"(",
"C",
"c",
",",
"double",
"s",
")",
"{",
"C",
"scaled",
"=",
"(",
"C",
")",
"c",
".",
"getFactory",
"(",
")",
".",
"create",
"(",
")",
";",
"for",
"(",
"E",
"key",
":",
"c",
".",
"keySet",
"(",
")",
")",
"{",
"scaled",
".",
"setCount",
"(",
"key",
",",
"c",
".",
"getCount",
"(",
"key",
")",
"*",
"s",
")",
";",
"}",
"return",
"scaled",
";",
"}"
] | Returns a new Counter which is scaled by the given scale factor.
@param c
The counter to scale. It is not changed
@param s
The constant to scale the counter by
@return A new Counter which is the argument scaled by the given scale
factor. | [
"Returns",
"a",
"new",
"Counter",
"which",
"is",
"scaled",
"by",
"the",
"given",
"scale",
"factor",
"."
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L1530-L1537 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.tfLogScale | @SuppressWarnings("unchecked")
public static <E, C extends Counter<E>> C tfLogScale(C c, double base) {
C scaled = (C) c.getFactory().create();
for (E key : c.keySet()) {
double cnt = c.getCount(key);
double scaledCnt = 0.0;
if (cnt > 0) {
scaledCnt = 1.0 + SloppyMath.log(cnt, base);
}
scaled.setCount(key, scaledCnt);
}
return scaled;
} | java | @SuppressWarnings("unchecked")
public static <E, C extends Counter<E>> C tfLogScale(C c, double base) {
C scaled = (C) c.getFactory().create();
for (E key : c.keySet()) {
double cnt = c.getCount(key);
double scaledCnt = 0.0;
if (cnt > 0) {
scaledCnt = 1.0 + SloppyMath.log(cnt, base);
}
scaled.setCount(key, scaledCnt);
}
return scaled;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"E",
",",
"C",
"extends",
"Counter",
"<",
"E",
">",
">",
"C",
"tfLogScale",
"(",
"C",
"c",
",",
"double",
"base",
")",
"{",
"C",
"scaled",
"=",
"(",
"C",
")",
"c",
".",
"getFactory",
"(",
")",
".",
"create",
"(",
")",
";",
"for",
"(",
"E",
"key",
":",
"c",
".",
"keySet",
"(",
")",
")",
"{",
"double",
"cnt",
"=",
"c",
".",
"getCount",
"(",
"key",
")",
";",
"double",
"scaledCnt",
"=",
"0.0",
";",
"if",
"(",
"cnt",
">",
"0",
")",
"{",
"scaledCnt",
"=",
"1.0",
"+",
"SloppyMath",
".",
"log",
"(",
"cnt",
",",
"base",
")",
";",
"}",
"scaled",
".",
"setCount",
"(",
"key",
",",
"scaledCnt",
")",
";",
"}",
"return",
"scaled",
";",
"}"
] | Returns a new Counter which is the input counter with log tf scaling
@param c
The counter to scale. It is not changed
@param base
The base of the logarithm used for tf scaling by 1 + log tf
@return A new Counter which is the argument scaled by the given scale
factor. | [
"Returns",
"a",
"new",
"Counter",
"which",
"is",
"the",
"input",
"counter",
"with",
"log",
"tf",
"scaling"
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L1549-L1561 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.loadIntoCounter | private static <E> void loadIntoCounter(String filename, Class<E> c, Counter<E> counter) throws RuntimeException {
try {
Constructor<E> m = c.getConstructor(String.class);
BufferedReader in = IOUtils.getBufferedFileReader(filename);// new
// BufferedReader(new
// FileReader(filename));
String line = in.readLine();
while (line != null && line.length() > 0) {
int endPos = Math.max(line.lastIndexOf(' '), line.lastIndexOf('\t'));
counter.setCount(m.newInstance(line.substring(0, endPos).trim()), Double.parseDouble(line.substring(endPos, line.length()).trim()));
line = in.readLine();
}
in.close();
} catch (Exception e) {
throw new RuntimeException(e);
}
} | java | private static <E> void loadIntoCounter(String filename, Class<E> c, Counter<E> counter) throws RuntimeException {
try {
Constructor<E> m = c.getConstructor(String.class);
BufferedReader in = IOUtils.getBufferedFileReader(filename);// new
// BufferedReader(new
// FileReader(filename));
String line = in.readLine();
while (line != null && line.length() > 0) {
int endPos = Math.max(line.lastIndexOf(' '), line.lastIndexOf('\t'));
counter.setCount(m.newInstance(line.substring(0, endPos).trim()), Double.parseDouble(line.substring(endPos, line.length()).trim()));
line = in.readLine();
}
in.close();
} catch (Exception e) {
throw new RuntimeException(e);
}
} | [
"private",
"static",
"<",
"E",
">",
"void",
"loadIntoCounter",
"(",
"String",
"filename",
",",
"Class",
"<",
"E",
">",
"c",
",",
"Counter",
"<",
"E",
">",
"counter",
")",
"throws",
"RuntimeException",
"{",
"try",
"{",
"Constructor",
"<",
"E",
">",
"m",
"=",
"c",
".",
"getConstructor",
"(",
"String",
".",
"class",
")",
";",
"BufferedReader",
"in",
"=",
"IOUtils",
".",
"getBufferedFileReader",
"(",
"filename",
")",
";",
"// new\r",
"// BufferedReader(new\r",
"// FileReader(filename));\r",
"String",
"line",
"=",
"in",
".",
"readLine",
"(",
")",
";",
"while",
"(",
"line",
"!=",
"null",
"&&",
"line",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"int",
"endPos",
"=",
"Math",
".",
"max",
"(",
"line",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
",",
"line",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
")",
";",
"counter",
".",
"setCount",
"(",
"m",
".",
"newInstance",
"(",
"line",
".",
"substring",
"(",
"0",
",",
"endPos",
")",
".",
"trim",
"(",
")",
")",
",",
"Double",
".",
"parseDouble",
"(",
"line",
".",
"substring",
"(",
"endPos",
",",
"line",
".",
"length",
"(",
")",
")",
".",
"trim",
"(",
")",
")",
")",
";",
"line",
"=",
"in",
".",
"readLine",
"(",
")",
";",
"}",
"in",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"e",
")",
";",
"}",
"}"
] | Loads a file into an GenericCounter. | [
"Loads",
"a",
"file",
"into",
"an",
"GenericCounter",
"."
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L1608-L1626 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.toCounter | public static <E> Counter<E> toCounter(Map<Integer, ? extends Number> counts, Index<E> index) {
Counter<E> counter = new ClassicCounter<E>();
for (Map.Entry<Integer, ? extends Number> entry : counts.entrySet()) {
counter.setCount(index.get(entry.getKey()), entry.getValue().doubleValue());
}
return counter;
} | java | public static <E> Counter<E> toCounter(Map<Integer, ? extends Number> counts, Index<E> index) {
Counter<E> counter = new ClassicCounter<E>();
for (Map.Entry<Integer, ? extends Number> entry : counts.entrySet()) {
counter.setCount(index.get(entry.getKey()), entry.getValue().doubleValue());
}
return counter;
} | [
"public",
"static",
"<",
"E",
">",
"Counter",
"<",
"E",
">",
"toCounter",
"(",
"Map",
"<",
"Integer",
",",
"?",
"extends",
"Number",
">",
"counts",
",",
"Index",
"<",
"E",
">",
"index",
")",
"{",
"Counter",
"<",
"E",
">",
"counter",
"=",
"new",
"ClassicCounter",
"<",
"E",
">",
"(",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"Integer",
",",
"?",
"extends",
"Number",
">",
"entry",
":",
"counts",
".",
"entrySet",
"(",
")",
")",
"{",
"counter",
".",
"setCount",
"(",
"index",
".",
"get",
"(",
"entry",
".",
"getKey",
"(",
")",
")",
",",
"entry",
".",
"getValue",
"(",
")",
".",
"doubleValue",
"(",
")",
")",
";",
"}",
"return",
"counter",
";",
"}"
] | Turns the given map and index into a counter instance. For each entry in
counts, its key is converted to a counter key via lookup in the given
index. | [
"Turns",
"the",
"given",
"map",
"and",
"index",
"into",
"a",
"counter",
"instance",
".",
"For",
"each",
"entry",
"in",
"counts",
"its",
"key",
"is",
"converted",
"to",
"a",
"counter",
"key",
"via",
"lookup",
"in",
"the",
"given",
"index",
"."
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L1996-L2003 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.sample | @SuppressWarnings("unchecked")
// This is not good code, but what's there to be done? TODO
public static <T> T sample(Counter<T> c, Random rand) {
Iterable<T> objects;
Set<T> keySet = c.keySet();
objects = c.keySet();
if (rand == null) {
rand = new Random();
} else { // TODO: Seems like there should be a way to directly check if T is
// comparable
if (!keySet.isEmpty() && keySet.iterator().next() instanceof Comparable) {
List l = new ArrayList<T>(keySet);
Collections.sort(l);
objects = l;
} else {
throw new RuntimeException("Results won't be stable since Counters keys are comparable.");
}
}
double r = rand.nextDouble() * c.totalCount();
double total = 0.0;
for (T t : objects) { // arbitrary ordering
total += c.getCount(t);
if (total >= r)
return t;
}
// only chance of reaching here is if c isn't properly normalized, or if
// double math makes total<1.0
return c.keySet().iterator().next();
} | java | @SuppressWarnings("unchecked")
// This is not good code, but what's there to be done? TODO
public static <T> T sample(Counter<T> c, Random rand) {
Iterable<T> objects;
Set<T> keySet = c.keySet();
objects = c.keySet();
if (rand == null) {
rand = new Random();
} else { // TODO: Seems like there should be a way to directly check if T is
// comparable
if (!keySet.isEmpty() && keySet.iterator().next() instanceof Comparable) {
List l = new ArrayList<T>(keySet);
Collections.sort(l);
objects = l;
} else {
throw new RuntimeException("Results won't be stable since Counters keys are comparable.");
}
}
double r = rand.nextDouble() * c.totalCount();
double total = 0.0;
for (T t : objects) { // arbitrary ordering
total += c.getCount(t);
if (total >= r)
return t;
}
// only chance of reaching here is if c isn't properly normalized, or if
// double math makes total<1.0
return c.keySet().iterator().next();
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"// This is not good code, but what's there to be done? TODO\r",
"public",
"static",
"<",
"T",
">",
"T",
"sample",
"(",
"Counter",
"<",
"T",
">",
"c",
",",
"Random",
"rand",
")",
"{",
"Iterable",
"<",
"T",
">",
"objects",
";",
"Set",
"<",
"T",
">",
"keySet",
"=",
"c",
".",
"keySet",
"(",
")",
";",
"objects",
"=",
"c",
".",
"keySet",
"(",
")",
";",
"if",
"(",
"rand",
"==",
"null",
")",
"{",
"rand",
"=",
"new",
"Random",
"(",
")",
";",
"}",
"else",
"{",
"// TODO: Seems like there should be a way to directly check if T is\r",
"// comparable\r",
"if",
"(",
"!",
"keySet",
".",
"isEmpty",
"(",
")",
"&&",
"keySet",
".",
"iterator",
"(",
")",
".",
"next",
"(",
")",
"instanceof",
"Comparable",
")",
"{",
"List",
"l",
"=",
"new",
"ArrayList",
"<",
"T",
">",
"(",
"keySet",
")",
";",
"Collections",
".",
"sort",
"(",
"l",
")",
";",
"objects",
"=",
"l",
";",
"}",
"else",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Results won't be stable since Counters keys are comparable.\"",
")",
";",
"}",
"}",
"double",
"r",
"=",
"rand",
".",
"nextDouble",
"(",
")",
"*",
"c",
".",
"totalCount",
"(",
")",
";",
"double",
"total",
"=",
"0.0",
";",
"for",
"(",
"T",
"t",
":",
"objects",
")",
"{",
"// arbitrary ordering\r",
"total",
"+=",
"c",
".",
"getCount",
"(",
"t",
")",
";",
"if",
"(",
"total",
">=",
"r",
")",
"return",
"t",
";",
"}",
"// only chance of reaching here is if c isn't properly normalized, or if\r",
"// double math makes total<1.0\r",
"return",
"c",
".",
"keySet",
"(",
")",
".",
"iterator",
"(",
")",
".",
"next",
"(",
")",
";",
"}"
] | Does not assumes c is normalized.
@return A sample from c | [
"Does",
"not",
"assumes",
"c",
"is",
"normalized",
"."
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L2025-L2054 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.powNormalized | public static <E> Counter<E> powNormalized(Counter<E> c, double temp) {
Counter<E> d = c.getFactory().create();
double total = c.totalCount();
for (E e : c.keySet()) {
d.setCount(e, Math.pow(c.getCount(e) / total, temp));
}
return d;
} | java | public static <E> Counter<E> powNormalized(Counter<E> c, double temp) {
Counter<E> d = c.getFactory().create();
double total = c.totalCount();
for (E e : c.keySet()) {
d.setCount(e, Math.pow(c.getCount(e) / total, temp));
}
return d;
} | [
"public",
"static",
"<",
"E",
">",
"Counter",
"<",
"E",
">",
"powNormalized",
"(",
"Counter",
"<",
"E",
">",
"c",
",",
"double",
"temp",
")",
"{",
"Counter",
"<",
"E",
">",
"d",
"=",
"c",
".",
"getFactory",
"(",
")",
".",
"create",
"(",
")",
";",
"double",
"total",
"=",
"c",
".",
"totalCount",
"(",
")",
";",
"for",
"(",
"E",
"e",
":",
"c",
".",
"keySet",
"(",
")",
")",
"{",
"d",
".",
"setCount",
"(",
"e",
",",
"Math",
".",
"pow",
"(",
"c",
".",
"getCount",
"(",
"e",
")",
"/",
"total",
",",
"temp",
")",
")",
";",
"}",
"return",
"d",
";",
"}"
] | Returns a counter where each element corresponds to the normalized count of
the corresponding element in c raised to the given power. | [
"Returns",
"a",
"counter",
"where",
"each",
"element",
"corresponds",
"to",
"the",
"normalized",
"count",
"of",
"the",
"corresponding",
"element",
"in",
"c",
"raised",
"to",
"the",
"given",
"power",
"."
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L2070-L2077 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.asCounter | public static <E> Counter<E> asCounter(FixedPrioritiesPriorityQueue<E> p) {
FixedPrioritiesPriorityQueue<E> pq = p.clone();
ClassicCounter<E> counter = new ClassicCounter<E>();
while (pq.hasNext()) {
double priority = pq.getPriority();
E element = pq.next();
counter.incrementCount(element, priority);
}
return counter;
} | java | public static <E> Counter<E> asCounter(FixedPrioritiesPriorityQueue<E> p) {
FixedPrioritiesPriorityQueue<E> pq = p.clone();
ClassicCounter<E> counter = new ClassicCounter<E>();
while (pq.hasNext()) {
double priority = pq.getPriority();
E element = pq.next();
counter.incrementCount(element, priority);
}
return counter;
} | [
"public",
"static",
"<",
"E",
">",
"Counter",
"<",
"E",
">",
"asCounter",
"(",
"FixedPrioritiesPriorityQueue",
"<",
"E",
">",
"p",
")",
"{",
"FixedPrioritiesPriorityQueue",
"<",
"E",
">",
"pq",
"=",
"p",
".",
"clone",
"(",
")",
";",
"ClassicCounter",
"<",
"E",
">",
"counter",
"=",
"new",
"ClassicCounter",
"<",
"E",
">",
"(",
")",
";",
"while",
"(",
"pq",
".",
"hasNext",
"(",
")",
")",
"{",
"double",
"priority",
"=",
"pq",
".",
"getPriority",
"(",
")",
";",
"E",
"element",
"=",
"pq",
".",
"next",
"(",
")",
";",
"counter",
".",
"incrementCount",
"(",
"element",
",",
"priority",
")",
";",
"}",
"return",
"counter",
";",
"}"
] | Returns a counter whose keys are the elements in this priority queue, and
whose counts are the priorities in this queue. In the event there are
multiple instances of the same element in the queue, the counter's count
will be the sum of the instances' priorities. | [
"Returns",
"a",
"counter",
"whose",
"keys",
"are",
"the",
"elements",
"in",
"this",
"priority",
"queue",
"and",
"whose",
"counts",
"are",
"the",
"priorities",
"in",
"this",
"queue",
".",
"In",
"the",
"event",
"there",
"are",
"multiple",
"instances",
"of",
"the",
"same",
"element",
"in",
"the",
"queue",
"the",
"counter",
"s",
"count",
"will",
"be",
"the",
"sum",
"of",
"the",
"instances",
"priorities",
"."
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L2275-L2284 | train |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.asMap | public static <E> Map<E, Double> asMap(final Counter<E> counter) {
return new AbstractMap<E, Double>() {
@Override
public int size() {
return counter.size();
}
@Override
public Set<Entry<E, Double>> entrySet() {
return counter.entrySet();
}
@Override
@SuppressWarnings("unchecked")
public boolean containsKey(Object key) {
return counter.containsKey((E) key);
}
@Override
@SuppressWarnings("unchecked")
public Double get(Object key) {
return counter.getCount((E) key);
}
@Override
public Double put(E key, Double value) {
double last = counter.getCount(key);
counter.setCount(key, value);
return last;
}
@Override
@SuppressWarnings("unchecked")
public Double remove(Object key) {
return counter.remove((E) key);
}
@Override
public Set<E> keySet() {
return counter.keySet();
}
};
} | java | public static <E> Map<E, Double> asMap(final Counter<E> counter) {
return new AbstractMap<E, Double>() {
@Override
public int size() {
return counter.size();
}
@Override
public Set<Entry<E, Double>> entrySet() {
return counter.entrySet();
}
@Override
@SuppressWarnings("unchecked")
public boolean containsKey(Object key) {
return counter.containsKey((E) key);
}
@Override
@SuppressWarnings("unchecked")
public Double get(Object key) {
return counter.getCount((E) key);
}
@Override
public Double put(E key, Double value) {
double last = counter.getCount(key);
counter.setCount(key, value);
return last;
}
@Override
@SuppressWarnings("unchecked")
public Double remove(Object key) {
return counter.remove((E) key);
}
@Override
public Set<E> keySet() {
return counter.keySet();
}
};
} | [
"public",
"static",
"<",
"E",
">",
"Map",
"<",
"E",
",",
"Double",
">",
"asMap",
"(",
"final",
"Counter",
"<",
"E",
">",
"counter",
")",
"{",
"return",
"new",
"AbstractMap",
"<",
"E",
",",
"Double",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"int",
"size",
"(",
")",
"{",
"return",
"counter",
".",
"size",
"(",
")",
";",
"}",
"@",
"Override",
"public",
"Set",
"<",
"Entry",
"<",
"E",
",",
"Double",
">",
">",
"entrySet",
"(",
")",
"{",
"return",
"counter",
".",
"entrySet",
"(",
")",
";",
"}",
"@",
"Override",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"boolean",
"containsKey",
"(",
"Object",
"key",
")",
"{",
"return",
"counter",
".",
"containsKey",
"(",
"(",
"E",
")",
"key",
")",
";",
"}",
"@",
"Override",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"Double",
"get",
"(",
"Object",
"key",
")",
"{",
"return",
"counter",
".",
"getCount",
"(",
"(",
"E",
")",
"key",
")",
";",
"}",
"@",
"Override",
"public",
"Double",
"put",
"(",
"E",
"key",
",",
"Double",
"value",
")",
"{",
"double",
"last",
"=",
"counter",
".",
"getCount",
"(",
"key",
")",
";",
"counter",
".",
"setCount",
"(",
"key",
",",
"value",
")",
";",
"return",
"last",
";",
"}",
"@",
"Override",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"Double",
"remove",
"(",
"Object",
"key",
")",
"{",
"return",
"counter",
".",
"remove",
"(",
"(",
"E",
")",
"key",
")",
";",
"}",
"@",
"Override",
"public",
"Set",
"<",
"E",
">",
"keySet",
"(",
")",
"{",
"return",
"counter",
".",
"keySet",
"(",
")",
";",
"}",
"}",
";",
"}"
] | Returns a map view of the given counter. | [
"Returns",
"a",
"map",
"view",
"of",
"the",
"given",
"counter",
"."
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L2556-L2598 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/appqoe/appqoepolicy_binding.java | appqoepolicy_binding.get | public static appqoepolicy_binding get(nitro_service service, String name) throws Exception{
appqoepolicy_binding obj = new appqoepolicy_binding();
obj.set_name(name);
appqoepolicy_binding response = (appqoepolicy_binding) obj.get_resource(service);
return response;
} | java | public static appqoepolicy_binding get(nitro_service service, String name) throws Exception{
appqoepolicy_binding obj = new appqoepolicy_binding();
obj.set_name(name);
appqoepolicy_binding response = (appqoepolicy_binding) obj.get_resource(service);
return response;
} | [
"public",
"static",
"appqoepolicy_binding",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"appqoepolicy_binding",
"obj",
"=",
"new",
"appqoepolicy_binding",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
")",
";",
"appqoepolicy_binding",
"response",
"=",
"(",
"appqoepolicy_binding",
")",
"obj",
".",
"get_resource",
"(",
"service",
")",
";",
"return",
"response",
";",
"}"
] | Use this API to fetch appqoepolicy_binding resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"appqoepolicy_binding",
"resource",
"of",
"given",
"name",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/appqoe/appqoepolicy_binding.java#L103-L108 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/appfw/appfwxmlcontenttype.java | appfwxmlcontenttype.add | public static base_response add(nitro_service client, appfwxmlcontenttype resource) throws Exception {
appfwxmlcontenttype addresource = new appfwxmlcontenttype();
addresource.xmlcontenttypevalue = resource.xmlcontenttypevalue;
addresource.isregex = resource.isregex;
return addresource.add_resource(client);
} | java | public static base_response add(nitro_service client, appfwxmlcontenttype resource) throws Exception {
appfwxmlcontenttype addresource = new appfwxmlcontenttype();
addresource.xmlcontenttypevalue = resource.xmlcontenttypevalue;
addresource.isregex = resource.isregex;
return addresource.add_resource(client);
} | [
"public",
"static",
"base_response",
"add",
"(",
"nitro_service",
"client",
",",
"appfwxmlcontenttype",
"resource",
")",
"throws",
"Exception",
"{",
"appfwxmlcontenttype",
"addresource",
"=",
"new",
"appfwxmlcontenttype",
"(",
")",
";",
"addresource",
".",
"xmlcontenttypevalue",
"=",
"resource",
".",
"xmlcontenttypevalue",
";",
"addresource",
".",
"isregex",
"=",
"resource",
".",
"isregex",
";",
"return",
"addresource",
".",
"add_resource",
"(",
"client",
")",
";",
"}"
] | Use this API to add appfwxmlcontenttype. | [
"Use",
"this",
"API",
"to",
"add",
"appfwxmlcontenttype",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/appfw/appfwxmlcontenttype.java#L125-L130 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/appfw/appfwxmlcontenttype.java | appfwxmlcontenttype.add | public static base_responses add(nitro_service client, appfwxmlcontenttype resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
appfwxmlcontenttype addresources[] = new appfwxmlcontenttype[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new appfwxmlcontenttype();
addresources[i].xmlcontenttypevalue = resources[i].xmlcontenttypevalue;
addresources[i].isregex = resources[i].isregex;
}
result = add_bulk_request(client, addresources);
}
return result;
} | java | public static base_responses add(nitro_service client, appfwxmlcontenttype resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
appfwxmlcontenttype addresources[] = new appfwxmlcontenttype[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new appfwxmlcontenttype();
addresources[i].xmlcontenttypevalue = resources[i].xmlcontenttypevalue;
addresources[i].isregex = resources[i].isregex;
}
result = add_bulk_request(client, addresources);
}
return result;
} | [
"public",
"static",
"base_responses",
"add",
"(",
"nitro_service",
"client",
",",
"appfwxmlcontenttype",
"resources",
"[",
"]",
")",
"throws",
"Exception",
"{",
"base_responses",
"result",
"=",
"null",
";",
"if",
"(",
"resources",
"!=",
"null",
"&&",
"resources",
".",
"length",
">",
"0",
")",
"{",
"appfwxmlcontenttype",
"addresources",
"[",
"]",
"=",
"new",
"appfwxmlcontenttype",
"[",
"resources",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"resources",
".",
"length",
";",
"i",
"++",
")",
"{",
"addresources",
"[",
"i",
"]",
"=",
"new",
"appfwxmlcontenttype",
"(",
")",
";",
"addresources",
"[",
"i",
"]",
".",
"xmlcontenttypevalue",
"=",
"resources",
"[",
"i",
"]",
".",
"xmlcontenttypevalue",
";",
"addresources",
"[",
"i",
"]",
".",
"isregex",
"=",
"resources",
"[",
"i",
"]",
".",
"isregex",
";",
"}",
"result",
"=",
"add_bulk_request",
"(",
"client",
",",
"addresources",
")",
";",
"}",
"return",
"result",
";",
"}"
] | Use this API to add appfwxmlcontenttype resources. | [
"Use",
"this",
"API",
"to",
"add",
"appfwxmlcontenttype",
"resources",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/appfw/appfwxmlcontenttype.java#L135-L147 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/appfw/appfwxmlcontenttype.java | appfwxmlcontenttype.delete | public static base_response delete(nitro_service client, String xmlcontenttypevalue) throws Exception {
appfwxmlcontenttype deleteresource = new appfwxmlcontenttype();
deleteresource.xmlcontenttypevalue = xmlcontenttypevalue;
return deleteresource.delete_resource(client);
} | java | public static base_response delete(nitro_service client, String xmlcontenttypevalue) throws Exception {
appfwxmlcontenttype deleteresource = new appfwxmlcontenttype();
deleteresource.xmlcontenttypevalue = xmlcontenttypevalue;
return deleteresource.delete_resource(client);
} | [
"public",
"static",
"base_response",
"delete",
"(",
"nitro_service",
"client",
",",
"String",
"xmlcontenttypevalue",
")",
"throws",
"Exception",
"{",
"appfwxmlcontenttype",
"deleteresource",
"=",
"new",
"appfwxmlcontenttype",
"(",
")",
";",
"deleteresource",
".",
"xmlcontenttypevalue",
"=",
"xmlcontenttypevalue",
";",
"return",
"deleteresource",
".",
"delete_resource",
"(",
"client",
")",
";",
"}"
] | Use this API to delete appfwxmlcontenttype of given name. | [
"Use",
"this",
"API",
"to",
"delete",
"appfwxmlcontenttype",
"of",
"given",
"name",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/appfw/appfwxmlcontenttype.java#L152-L156 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/appfw/appfwxmlcontenttype.java | appfwxmlcontenttype.delete | public static base_responses delete(nitro_service client, String xmlcontenttypevalue[]) throws Exception {
base_responses result = null;
if (xmlcontenttypevalue != null && xmlcontenttypevalue.length > 0) {
appfwxmlcontenttype deleteresources[] = new appfwxmlcontenttype[xmlcontenttypevalue.length];
for (int i=0;i<xmlcontenttypevalue.length;i++){
deleteresources[i] = new appfwxmlcontenttype();
deleteresources[i].xmlcontenttypevalue = xmlcontenttypevalue[i];
}
result = delete_bulk_request(client, deleteresources);
}
return result;
} | java | public static base_responses delete(nitro_service client, String xmlcontenttypevalue[]) throws Exception {
base_responses result = null;
if (xmlcontenttypevalue != null && xmlcontenttypevalue.length > 0) {
appfwxmlcontenttype deleteresources[] = new appfwxmlcontenttype[xmlcontenttypevalue.length];
for (int i=0;i<xmlcontenttypevalue.length;i++){
deleteresources[i] = new appfwxmlcontenttype();
deleteresources[i].xmlcontenttypevalue = xmlcontenttypevalue[i];
}
result = delete_bulk_request(client, deleteresources);
}
return result;
} | [
"public",
"static",
"base_responses",
"delete",
"(",
"nitro_service",
"client",
",",
"String",
"xmlcontenttypevalue",
"[",
"]",
")",
"throws",
"Exception",
"{",
"base_responses",
"result",
"=",
"null",
";",
"if",
"(",
"xmlcontenttypevalue",
"!=",
"null",
"&&",
"xmlcontenttypevalue",
".",
"length",
">",
"0",
")",
"{",
"appfwxmlcontenttype",
"deleteresources",
"[",
"]",
"=",
"new",
"appfwxmlcontenttype",
"[",
"xmlcontenttypevalue",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"xmlcontenttypevalue",
".",
"length",
";",
"i",
"++",
")",
"{",
"deleteresources",
"[",
"i",
"]",
"=",
"new",
"appfwxmlcontenttype",
"(",
")",
";",
"deleteresources",
"[",
"i",
"]",
".",
"xmlcontenttypevalue",
"=",
"xmlcontenttypevalue",
"[",
"i",
"]",
";",
"}",
"result",
"=",
"delete_bulk_request",
"(",
"client",
",",
"deleteresources",
")",
";",
"}",
"return",
"result",
";",
"}"
] | Use this API to delete appfwxmlcontenttype resources of given names. | [
"Use",
"this",
"API",
"to",
"delete",
"appfwxmlcontenttype",
"resources",
"of",
"given",
"names",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/appfw/appfwxmlcontenttype.java#L170-L181 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/appfw/appfwxmlcontenttype.java | appfwxmlcontenttype.get | public static appfwxmlcontenttype[] get(nitro_service service) throws Exception{
appfwxmlcontenttype obj = new appfwxmlcontenttype();
appfwxmlcontenttype[] response = (appfwxmlcontenttype[])obj.get_resources(service);
return response;
} | java | public static appfwxmlcontenttype[] get(nitro_service service) throws Exception{
appfwxmlcontenttype obj = new appfwxmlcontenttype();
appfwxmlcontenttype[] response = (appfwxmlcontenttype[])obj.get_resources(service);
return response;
} | [
"public",
"static",
"appfwxmlcontenttype",
"[",
"]",
"get",
"(",
"nitro_service",
"service",
")",
"throws",
"Exception",
"{",
"appfwxmlcontenttype",
"obj",
"=",
"new",
"appfwxmlcontenttype",
"(",
")",
";",
"appfwxmlcontenttype",
"[",
"]",
"response",
"=",
"(",
"appfwxmlcontenttype",
"[",
"]",
")",
"obj",
".",
"get_resources",
"(",
"service",
")",
";",
"return",
"response",
";",
"}"
] | Use this API to fetch all the appfwxmlcontenttype resources that are configured on netscaler. | [
"Use",
"this",
"API",
"to",
"fetch",
"all",
"the",
"appfwxmlcontenttype",
"resources",
"that",
"are",
"configured",
"on",
"netscaler",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/appfw/appfwxmlcontenttype.java#L202-L206 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/appfw/appfwxmlcontenttype.java | appfwxmlcontenttype.get | public static appfwxmlcontenttype get(nitro_service service, String xmlcontenttypevalue) throws Exception{
appfwxmlcontenttype obj = new appfwxmlcontenttype();
obj.set_xmlcontenttypevalue(xmlcontenttypevalue);
appfwxmlcontenttype response = (appfwxmlcontenttype) obj.get_resource(service);
return response;
} | java | public static appfwxmlcontenttype get(nitro_service service, String xmlcontenttypevalue) throws Exception{
appfwxmlcontenttype obj = new appfwxmlcontenttype();
obj.set_xmlcontenttypevalue(xmlcontenttypevalue);
appfwxmlcontenttype response = (appfwxmlcontenttype) obj.get_resource(service);
return response;
} | [
"public",
"static",
"appfwxmlcontenttype",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"xmlcontenttypevalue",
")",
"throws",
"Exception",
"{",
"appfwxmlcontenttype",
"obj",
"=",
"new",
"appfwxmlcontenttype",
"(",
")",
";",
"obj",
".",
"set_xmlcontenttypevalue",
"(",
"xmlcontenttypevalue",
")",
";",
"appfwxmlcontenttype",
"response",
"=",
"(",
"appfwxmlcontenttype",
")",
"obj",
".",
"get_resource",
"(",
"service",
")",
";",
"return",
"response",
";",
"}"
] | Use this API to fetch appfwxmlcontenttype resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"appfwxmlcontenttype",
"resource",
"of",
"given",
"name",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/appfw/appfwxmlcontenttype.java#L218-L223 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/appfw/appfwxmlcontenttype.java | appfwxmlcontenttype.get | public static appfwxmlcontenttype[] get(nitro_service service, String xmlcontenttypevalue[]) throws Exception{
if (xmlcontenttypevalue !=null && xmlcontenttypevalue.length>0) {
appfwxmlcontenttype response[] = new appfwxmlcontenttype[xmlcontenttypevalue.length];
appfwxmlcontenttype obj[] = new appfwxmlcontenttype[xmlcontenttypevalue.length];
for (int i=0;i<xmlcontenttypevalue.length;i++) {
obj[i] = new appfwxmlcontenttype();
obj[i].set_xmlcontenttypevalue(xmlcontenttypevalue[i]);
response[i] = (appfwxmlcontenttype) obj[i].get_resource(service);
}
return response;
}
return null;
} | java | public static appfwxmlcontenttype[] get(nitro_service service, String xmlcontenttypevalue[]) throws Exception{
if (xmlcontenttypevalue !=null && xmlcontenttypevalue.length>0) {
appfwxmlcontenttype response[] = new appfwxmlcontenttype[xmlcontenttypevalue.length];
appfwxmlcontenttype obj[] = new appfwxmlcontenttype[xmlcontenttypevalue.length];
for (int i=0;i<xmlcontenttypevalue.length;i++) {
obj[i] = new appfwxmlcontenttype();
obj[i].set_xmlcontenttypevalue(xmlcontenttypevalue[i]);
response[i] = (appfwxmlcontenttype) obj[i].get_resource(service);
}
return response;
}
return null;
} | [
"public",
"static",
"appfwxmlcontenttype",
"[",
"]",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"xmlcontenttypevalue",
"[",
"]",
")",
"throws",
"Exception",
"{",
"if",
"(",
"xmlcontenttypevalue",
"!=",
"null",
"&&",
"xmlcontenttypevalue",
".",
"length",
">",
"0",
")",
"{",
"appfwxmlcontenttype",
"response",
"[",
"]",
"=",
"new",
"appfwxmlcontenttype",
"[",
"xmlcontenttypevalue",
".",
"length",
"]",
";",
"appfwxmlcontenttype",
"obj",
"[",
"]",
"=",
"new",
"appfwxmlcontenttype",
"[",
"xmlcontenttypevalue",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"xmlcontenttypevalue",
".",
"length",
";",
"i",
"++",
")",
"{",
"obj",
"[",
"i",
"]",
"=",
"new",
"appfwxmlcontenttype",
"(",
")",
";",
"obj",
"[",
"i",
"]",
".",
"set_xmlcontenttypevalue",
"(",
"xmlcontenttypevalue",
"[",
"i",
"]",
")",
";",
"response",
"[",
"i",
"]",
"=",
"(",
"appfwxmlcontenttype",
")",
"obj",
"[",
"i",
"]",
".",
"get_resource",
"(",
"service",
")",
";",
"}",
"return",
"response",
";",
"}",
"return",
"null",
";",
"}"
] | Use this API to fetch appfwxmlcontenttype resources of given names . | [
"Use",
"this",
"API",
"to",
"fetch",
"appfwxmlcontenttype",
"resources",
"of",
"given",
"names",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/appfw/appfwxmlcontenttype.java#L228-L240 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/policy/policymap.java | policymap.add | public static base_response add(nitro_service client, policymap resource) throws Exception {
policymap addresource = new policymap();
addresource.mappolicyname = resource.mappolicyname;
addresource.sd = resource.sd;
addresource.su = resource.su;
addresource.td = resource.td;
addresource.tu = resource.tu;
return addresource.add_resource(client);
} | java | public static base_response add(nitro_service client, policymap resource) throws Exception {
policymap addresource = new policymap();
addresource.mappolicyname = resource.mappolicyname;
addresource.sd = resource.sd;
addresource.su = resource.su;
addresource.td = resource.td;
addresource.tu = resource.tu;
return addresource.add_resource(client);
} | [
"public",
"static",
"base_response",
"add",
"(",
"nitro_service",
"client",
",",
"policymap",
"resource",
")",
"throws",
"Exception",
"{",
"policymap",
"addresource",
"=",
"new",
"policymap",
"(",
")",
";",
"addresource",
".",
"mappolicyname",
"=",
"resource",
".",
"mappolicyname",
";",
"addresource",
".",
"sd",
"=",
"resource",
".",
"sd",
";",
"addresource",
".",
"su",
"=",
"resource",
".",
"su",
";",
"addresource",
".",
"td",
"=",
"resource",
".",
"td",
";",
"addresource",
".",
"tu",
"=",
"resource",
".",
"tu",
";",
"return",
"addresource",
".",
"add_resource",
"(",
"client",
")",
";",
"}"
] | Use this API to add policymap. | [
"Use",
"this",
"API",
"to",
"add",
"policymap",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/policy/policymap.java#L186-L194 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/policy/policymap.java | policymap.add | public static base_responses add(nitro_service client, policymap resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
policymap addresources[] = new policymap[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new policymap();
addresources[i].mappolicyname = resources[i].mappolicyname;
addresources[i].sd = resources[i].sd;
addresources[i].su = resources[i].su;
addresources[i].td = resources[i].td;
addresources[i].tu = resources[i].tu;
}
result = add_bulk_request(client, addresources);
}
return result;
} | java | public static base_responses add(nitro_service client, policymap resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
policymap addresources[] = new policymap[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new policymap();
addresources[i].mappolicyname = resources[i].mappolicyname;
addresources[i].sd = resources[i].sd;
addresources[i].su = resources[i].su;
addresources[i].td = resources[i].td;
addresources[i].tu = resources[i].tu;
}
result = add_bulk_request(client, addresources);
}
return result;
} | [
"public",
"static",
"base_responses",
"add",
"(",
"nitro_service",
"client",
",",
"policymap",
"resources",
"[",
"]",
")",
"throws",
"Exception",
"{",
"base_responses",
"result",
"=",
"null",
";",
"if",
"(",
"resources",
"!=",
"null",
"&&",
"resources",
".",
"length",
">",
"0",
")",
"{",
"policymap",
"addresources",
"[",
"]",
"=",
"new",
"policymap",
"[",
"resources",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"resources",
".",
"length",
";",
"i",
"++",
")",
"{",
"addresources",
"[",
"i",
"]",
"=",
"new",
"policymap",
"(",
")",
";",
"addresources",
"[",
"i",
"]",
".",
"mappolicyname",
"=",
"resources",
"[",
"i",
"]",
".",
"mappolicyname",
";",
"addresources",
"[",
"i",
"]",
".",
"sd",
"=",
"resources",
"[",
"i",
"]",
".",
"sd",
";",
"addresources",
"[",
"i",
"]",
".",
"su",
"=",
"resources",
"[",
"i",
"]",
".",
"su",
";",
"addresources",
"[",
"i",
"]",
".",
"td",
"=",
"resources",
"[",
"i",
"]",
".",
"td",
";",
"addresources",
"[",
"i",
"]",
".",
"tu",
"=",
"resources",
"[",
"i",
"]",
".",
"tu",
";",
"}",
"result",
"=",
"add_bulk_request",
"(",
"client",
",",
"addresources",
")",
";",
"}",
"return",
"result",
";",
"}"
] | Use this API to add policymap resources. | [
"Use",
"this",
"API",
"to",
"add",
"policymap",
"resources",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/policy/policymap.java#L199-L214 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/policy/policymap.java | policymap.delete | public static base_response delete(nitro_service client, String mappolicyname) throws Exception {
policymap deleteresource = new policymap();
deleteresource.mappolicyname = mappolicyname;
return deleteresource.delete_resource(client);
} | java | public static base_response delete(nitro_service client, String mappolicyname) throws Exception {
policymap deleteresource = new policymap();
deleteresource.mappolicyname = mappolicyname;
return deleteresource.delete_resource(client);
} | [
"public",
"static",
"base_response",
"delete",
"(",
"nitro_service",
"client",
",",
"String",
"mappolicyname",
")",
"throws",
"Exception",
"{",
"policymap",
"deleteresource",
"=",
"new",
"policymap",
"(",
")",
";",
"deleteresource",
".",
"mappolicyname",
"=",
"mappolicyname",
";",
"return",
"deleteresource",
".",
"delete_resource",
"(",
"client",
")",
";",
"}"
] | Use this API to delete policymap of given name. | [
"Use",
"this",
"API",
"to",
"delete",
"policymap",
"of",
"given",
"name",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/policy/policymap.java#L219-L223 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/policy/policymap.java | policymap.delete | public static base_responses delete(nitro_service client, String mappolicyname[]) throws Exception {
base_responses result = null;
if (mappolicyname != null && mappolicyname.length > 0) {
policymap deleteresources[] = new policymap[mappolicyname.length];
for (int i=0;i<mappolicyname.length;i++){
deleteresources[i] = new policymap();
deleteresources[i].mappolicyname = mappolicyname[i];
}
result = delete_bulk_request(client, deleteresources);
}
return result;
} | java | public static base_responses delete(nitro_service client, String mappolicyname[]) throws Exception {
base_responses result = null;
if (mappolicyname != null && mappolicyname.length > 0) {
policymap deleteresources[] = new policymap[mappolicyname.length];
for (int i=0;i<mappolicyname.length;i++){
deleteresources[i] = new policymap();
deleteresources[i].mappolicyname = mappolicyname[i];
}
result = delete_bulk_request(client, deleteresources);
}
return result;
} | [
"public",
"static",
"base_responses",
"delete",
"(",
"nitro_service",
"client",
",",
"String",
"mappolicyname",
"[",
"]",
")",
"throws",
"Exception",
"{",
"base_responses",
"result",
"=",
"null",
";",
"if",
"(",
"mappolicyname",
"!=",
"null",
"&&",
"mappolicyname",
".",
"length",
">",
"0",
")",
"{",
"policymap",
"deleteresources",
"[",
"]",
"=",
"new",
"policymap",
"[",
"mappolicyname",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"mappolicyname",
".",
"length",
";",
"i",
"++",
")",
"{",
"deleteresources",
"[",
"i",
"]",
"=",
"new",
"policymap",
"(",
")",
";",
"deleteresources",
"[",
"i",
"]",
".",
"mappolicyname",
"=",
"mappolicyname",
"[",
"i",
"]",
";",
"}",
"result",
"=",
"delete_bulk_request",
"(",
"client",
",",
"deleteresources",
")",
";",
"}",
"return",
"result",
";",
"}"
] | Use this API to delete policymap resources of given names. | [
"Use",
"this",
"API",
"to",
"delete",
"policymap",
"resources",
"of",
"given",
"names",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/policy/policymap.java#L237-L248 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/policy/policymap.java | policymap.get | public static policymap[] get(nitro_service service) throws Exception{
policymap obj = new policymap();
policymap[] response = (policymap[])obj.get_resources(service);
return response;
} | java | public static policymap[] get(nitro_service service) throws Exception{
policymap obj = new policymap();
policymap[] response = (policymap[])obj.get_resources(service);
return response;
} | [
"public",
"static",
"policymap",
"[",
"]",
"get",
"(",
"nitro_service",
"service",
")",
"throws",
"Exception",
"{",
"policymap",
"obj",
"=",
"new",
"policymap",
"(",
")",
";",
"policymap",
"[",
"]",
"response",
"=",
"(",
"policymap",
"[",
"]",
")",
"obj",
".",
"get_resources",
"(",
"service",
")",
";",
"return",
"response",
";",
"}"
] | Use this API to fetch all the policymap resources that are configured on netscaler. | [
"Use",
"this",
"API",
"to",
"fetch",
"all",
"the",
"policymap",
"resources",
"that",
"are",
"configured",
"on",
"netscaler",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/policy/policymap.java#L269-L273 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/policy/policymap.java | policymap.get | public static policymap get(nitro_service service, String mappolicyname) throws Exception{
policymap obj = new policymap();
obj.set_mappolicyname(mappolicyname);
policymap response = (policymap) obj.get_resource(service);
return response;
} | java | public static policymap get(nitro_service service, String mappolicyname) throws Exception{
policymap obj = new policymap();
obj.set_mappolicyname(mappolicyname);
policymap response = (policymap) obj.get_resource(service);
return response;
} | [
"public",
"static",
"policymap",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"mappolicyname",
")",
"throws",
"Exception",
"{",
"policymap",
"obj",
"=",
"new",
"policymap",
"(",
")",
";",
"obj",
".",
"set_mappolicyname",
"(",
"mappolicyname",
")",
";",
"policymap",
"response",
"=",
"(",
"policymap",
")",
"obj",
".",
"get_resource",
"(",
"service",
")",
";",
"return",
"response",
";",
"}"
] | Use this API to fetch policymap resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"policymap",
"resource",
"of",
"given",
"name",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/policy/policymap.java#L285-L290 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/policy/policymap.java | policymap.get | public static policymap[] get(nitro_service service, String mappolicyname[]) throws Exception{
if (mappolicyname !=null && mappolicyname.length>0) {
policymap response[] = new policymap[mappolicyname.length];
policymap obj[] = new policymap[mappolicyname.length];
for (int i=0;i<mappolicyname.length;i++) {
obj[i] = new policymap();
obj[i].set_mappolicyname(mappolicyname[i]);
response[i] = (policymap) obj[i].get_resource(service);
}
return response;
}
return null;
} | java | public static policymap[] get(nitro_service service, String mappolicyname[]) throws Exception{
if (mappolicyname !=null && mappolicyname.length>0) {
policymap response[] = new policymap[mappolicyname.length];
policymap obj[] = new policymap[mappolicyname.length];
for (int i=0;i<mappolicyname.length;i++) {
obj[i] = new policymap();
obj[i].set_mappolicyname(mappolicyname[i]);
response[i] = (policymap) obj[i].get_resource(service);
}
return response;
}
return null;
} | [
"public",
"static",
"policymap",
"[",
"]",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"mappolicyname",
"[",
"]",
")",
"throws",
"Exception",
"{",
"if",
"(",
"mappolicyname",
"!=",
"null",
"&&",
"mappolicyname",
".",
"length",
">",
"0",
")",
"{",
"policymap",
"response",
"[",
"]",
"=",
"new",
"policymap",
"[",
"mappolicyname",
".",
"length",
"]",
";",
"policymap",
"obj",
"[",
"]",
"=",
"new",
"policymap",
"[",
"mappolicyname",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"mappolicyname",
".",
"length",
";",
"i",
"++",
")",
"{",
"obj",
"[",
"i",
"]",
"=",
"new",
"policymap",
"(",
")",
";",
"obj",
"[",
"i",
"]",
".",
"set_mappolicyname",
"(",
"mappolicyname",
"[",
"i",
"]",
")",
";",
"response",
"[",
"i",
"]",
"=",
"(",
"policymap",
")",
"obj",
"[",
"i",
"]",
".",
"get_resource",
"(",
"service",
")",
";",
"}",
"return",
"response",
";",
"}",
"return",
"null",
";",
"}"
] | Use this API to fetch policymap resources of given names . | [
"Use",
"this",
"API",
"to",
"fetch",
"policymap",
"resources",
"of",
"given",
"names",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/policy/policymap.java#L295-L307 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/network/iptunnelparam.java | iptunnelparam.unset | public static base_response unset(nitro_service client, iptunnelparam resource, String[] args) throws Exception{
iptunnelparam unsetresource = new iptunnelparam();
return unsetresource.unset_resource(client,args);
} | java | public static base_response unset(nitro_service client, iptunnelparam resource, String[] args) throws Exception{
iptunnelparam unsetresource = new iptunnelparam();
return unsetresource.unset_resource(client,args);
} | [
"public",
"static",
"base_response",
"unset",
"(",
"nitro_service",
"client",
",",
"iptunnelparam",
"resource",
",",
"String",
"[",
"]",
"args",
")",
"throws",
"Exception",
"{",
"iptunnelparam",
"unsetresource",
"=",
"new",
"iptunnelparam",
"(",
")",
";",
"return",
"unsetresource",
".",
"unset_resource",
"(",
"client",
",",
"args",
")",
";",
"}"
] | Use this API to unset the properties of iptunnelparam resource.
Properties that need to be unset are specified in args array. | [
"Use",
"this",
"API",
"to",
"unset",
"the",
"properties",
"of",
"iptunnelparam",
"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/network/iptunnelparam.java#L173-L176 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/network/iptunnelparam.java | iptunnelparam.get | public static iptunnelparam get(nitro_service service) throws Exception{
iptunnelparam obj = new iptunnelparam();
iptunnelparam[] response = (iptunnelparam[])obj.get_resources(service);
return response[0];
} | java | public static iptunnelparam get(nitro_service service) throws Exception{
iptunnelparam obj = new iptunnelparam();
iptunnelparam[] response = (iptunnelparam[])obj.get_resources(service);
return response[0];
} | [
"public",
"static",
"iptunnelparam",
"get",
"(",
"nitro_service",
"service",
")",
"throws",
"Exception",
"{",
"iptunnelparam",
"obj",
"=",
"new",
"iptunnelparam",
"(",
")",
";",
"iptunnelparam",
"[",
"]",
"response",
"=",
"(",
"iptunnelparam",
"[",
"]",
")",
"obj",
".",
"get_resources",
"(",
"service",
")",
";",
"return",
"response",
"[",
"0",
"]",
";",
"}"
] | Use this API to fetch all the iptunnelparam resources that are configured on netscaler. | [
"Use",
"this",
"API",
"to",
"fetch",
"all",
"the",
"iptunnelparam",
"resources",
"that",
"are",
"configured",
"on",
"netscaler",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/network/iptunnelparam.java#L181-L185 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/base/statobjects.java | statobjects.get | public static statobjects get(nitro_service service) throws Exception{
statobjects obj = new statobjects();
statobjects[] response = (statobjects[])obj.get_resources(service);
return response[0];
} | java | public static statobjects get(nitro_service service) throws Exception{
statobjects obj = new statobjects();
statobjects[] response = (statobjects[])obj.get_resources(service);
return response[0];
} | [
"public",
"static",
"statobjects",
"get",
"(",
"nitro_service",
"service",
")",
"throws",
"Exception",
"{",
"statobjects",
"obj",
"=",
"new",
"statobjects",
"(",
")",
";",
"statobjects",
"[",
"]",
"response",
"=",
"(",
"statobjects",
"[",
"]",
")",
"obj",
".",
"get_resources",
"(",
"service",
")",
";",
"return",
"response",
"[",
"0",
"]",
";",
"}"
] | Use this API to fetch all the statistic objects resources that are available on netscaler. | [
"Use",
"this",
"API",
"to",
"fetch",
"all",
"the",
"statistic",
"objects",
"resources",
"that",
"are",
"available",
"on",
"netscaler",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/base/statobjects.java#L65-L69 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/lb/lbmonitor_metric_binding.java | lbmonitor_metric_binding.get | public static lbmonitor_metric_binding[] get(nitro_service service, String monitorname) throws Exception{
lbmonitor_metric_binding obj = new lbmonitor_metric_binding();
obj.set_monitorname(monitorname);
lbmonitor_metric_binding response[] = (lbmonitor_metric_binding[]) obj.get_resources(service);
return response;
} | java | public static lbmonitor_metric_binding[] get(nitro_service service, String monitorname) throws Exception{
lbmonitor_metric_binding obj = new lbmonitor_metric_binding();
obj.set_monitorname(monitorname);
lbmonitor_metric_binding response[] = (lbmonitor_metric_binding[]) obj.get_resources(service);
return response;
} | [
"public",
"static",
"lbmonitor_metric_binding",
"[",
"]",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"monitorname",
")",
"throws",
"Exception",
"{",
"lbmonitor_metric_binding",
"obj",
"=",
"new",
"lbmonitor_metric_binding",
"(",
")",
";",
"obj",
".",
"set_monitorname",
"(",
"monitorname",
")",
";",
"lbmonitor_metric_binding",
"response",
"[",
"]",
"=",
"(",
"lbmonitor_metric_binding",
"[",
"]",
")",
"obj",
".",
"get_resources",
"(",
"service",
")",
";",
"return",
"response",
";",
"}"
] | Use this API to fetch lbmonitor_metric_binding resources of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"lbmonitor_metric_binding",
"resources",
"of",
"given",
"name",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/lb/lbmonitor_metric_binding.java#L234-L239 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/lb/lbmonitor_metric_binding.java | lbmonitor_metric_binding.count | public static long count(nitro_service service, String monitorname) throws Exception{
lbmonitor_metric_binding obj = new lbmonitor_metric_binding();
obj.set_monitorname(monitorname);
options option = new options();
option.set_count(true);
lbmonitor_metric_binding response[] = (lbmonitor_metric_binding[]) obj.get_resources(service,option);
if (response != null) {
return response[0].__count;
}
return 0;
} | java | public static long count(nitro_service service, String monitorname) throws Exception{
lbmonitor_metric_binding obj = new lbmonitor_metric_binding();
obj.set_monitorname(monitorname);
options option = new options();
option.set_count(true);
lbmonitor_metric_binding response[] = (lbmonitor_metric_binding[]) obj.get_resources(service,option);
if (response != null) {
return response[0].__count;
}
return 0;
} | [
"public",
"static",
"long",
"count",
"(",
"nitro_service",
"service",
",",
"String",
"monitorname",
")",
"throws",
"Exception",
"{",
"lbmonitor_metric_binding",
"obj",
"=",
"new",
"lbmonitor_metric_binding",
"(",
")",
";",
"obj",
".",
"set_monitorname",
"(",
"monitorname",
")",
";",
"options",
"option",
"=",
"new",
"options",
"(",
")",
";",
"option",
".",
"set_count",
"(",
"true",
")",
";",
"lbmonitor_metric_binding",
"response",
"[",
"]",
"=",
"(",
"lbmonitor_metric_binding",
"[",
"]",
")",
"obj",
".",
"get_resources",
"(",
"service",
",",
"option",
")",
";",
"if",
"(",
"response",
"!=",
"null",
")",
"{",
"return",
"response",
"[",
"0",
"]",
".",
"__count",
";",
"}",
"return",
"0",
";",
"}"
] | Use this API to count lbmonitor_metric_binding resources configued on NetScaler. | [
"Use",
"this",
"API",
"to",
"count",
"lbmonitor_metric_binding",
"resources",
"configued",
"on",
"NetScaler",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/lb/lbmonitor_metric_binding.java#L270-L280 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/basic/server_binding.java | server_binding.get | public static server_binding get(nitro_service service, String name) throws Exception{
server_binding obj = new server_binding();
obj.set_name(name);
server_binding response = (server_binding) obj.get_resource(service);
return response;
} | java | public static server_binding get(nitro_service service, String name) throws Exception{
server_binding obj = new server_binding();
obj.set_name(name);
server_binding response = (server_binding) obj.get_resource(service);
return response;
} | [
"public",
"static",
"server_binding",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"server_binding",
"obj",
"=",
"new",
"server_binding",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
")",
";",
"server_binding",
"response",
"=",
"(",
"server_binding",
")",
"obj",
".",
"get_resource",
"(",
"service",
")",
";",
"return",
"response",
";",
"}"
] | Use this API to fetch server_binding resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"server_binding",
"resource",
"of",
"given",
"name",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/basic/server_binding.java#L114-L119 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/aaa/aaacertparams.java | aaacertparams.update | public static base_response update(nitro_service client, aaacertparams resource) throws Exception {
aaacertparams updateresource = new aaacertparams();
updateresource.usernamefield = resource.usernamefield;
updateresource.groupnamefield = resource.groupnamefield;
updateresource.defaultauthenticationgroup = resource.defaultauthenticationgroup;
return updateresource.update_resource(client);
} | java | public static base_response update(nitro_service client, aaacertparams resource) throws Exception {
aaacertparams updateresource = new aaacertparams();
updateresource.usernamefield = resource.usernamefield;
updateresource.groupnamefield = resource.groupnamefield;
updateresource.defaultauthenticationgroup = resource.defaultauthenticationgroup;
return updateresource.update_resource(client);
} | [
"public",
"static",
"base_response",
"update",
"(",
"nitro_service",
"client",
",",
"aaacertparams",
"resource",
")",
"throws",
"Exception",
"{",
"aaacertparams",
"updateresource",
"=",
"new",
"aaacertparams",
"(",
")",
";",
"updateresource",
".",
"usernamefield",
"=",
"resource",
".",
"usernamefield",
";",
"updateresource",
".",
"groupnamefield",
"=",
"resource",
".",
"groupnamefield",
";",
"updateresource",
".",
"defaultauthenticationgroup",
"=",
"resource",
".",
"defaultauthenticationgroup",
";",
"return",
"updateresource",
".",
"update_resource",
"(",
"client",
")",
";",
"}"
] | Use this API to update aaacertparams. | [
"Use",
"this",
"API",
"to",
"update",
"aaacertparams",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/aaa/aaacertparams.java#L145-L151 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/aaa/aaacertparams.java | aaacertparams.unset | public static base_response unset(nitro_service client, aaacertparams resource, String[] args) throws Exception{
aaacertparams unsetresource = new aaacertparams();
return unsetresource.unset_resource(client,args);
} | java | public static base_response unset(nitro_service client, aaacertparams resource, String[] args) throws Exception{
aaacertparams unsetresource = new aaacertparams();
return unsetresource.unset_resource(client,args);
} | [
"public",
"static",
"base_response",
"unset",
"(",
"nitro_service",
"client",
",",
"aaacertparams",
"resource",
",",
"String",
"[",
"]",
"args",
")",
"throws",
"Exception",
"{",
"aaacertparams",
"unsetresource",
"=",
"new",
"aaacertparams",
"(",
")",
";",
"return",
"unsetresource",
".",
"unset_resource",
"(",
"client",
",",
"args",
")",
";",
"}"
] | Use this API to unset the properties of aaacertparams resource.
Properties that need to be unset are specified in args array. | [
"Use",
"this",
"API",
"to",
"unset",
"the",
"properties",
"of",
"aaacertparams",
"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/aaa/aaacertparams.java#L157-L160 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/aaa/aaacertparams.java | aaacertparams.get | public static aaacertparams get(nitro_service service) throws Exception{
aaacertparams obj = new aaacertparams();
aaacertparams[] response = (aaacertparams[])obj.get_resources(service);
return response[0];
} | java | public static aaacertparams get(nitro_service service) throws Exception{
aaacertparams obj = new aaacertparams();
aaacertparams[] response = (aaacertparams[])obj.get_resources(service);
return response[0];
} | [
"public",
"static",
"aaacertparams",
"get",
"(",
"nitro_service",
"service",
")",
"throws",
"Exception",
"{",
"aaacertparams",
"obj",
"=",
"new",
"aaacertparams",
"(",
")",
";",
"aaacertparams",
"[",
"]",
"response",
"=",
"(",
"aaacertparams",
"[",
"]",
")",
"obj",
".",
"get_resources",
"(",
"service",
")",
";",
"return",
"response",
"[",
"0",
"]",
";",
"}"
] | Use this API to fetch all the aaacertparams resources that are configured on netscaler. | [
"Use",
"this",
"API",
"to",
"fetch",
"all",
"the",
"aaacertparams",
"resources",
"that",
"are",
"configured",
"on",
"netscaler",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/aaa/aaacertparams.java#L165-L169 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/cmp/cmpaction.java | cmpaction.add | public static base_response add(nitro_service client, cmpaction resource) throws Exception {
cmpaction addresource = new cmpaction();
addresource.name = resource.name;
addresource.cmptype = resource.cmptype;
addresource.deltatype = resource.deltatype;
return addresource.add_resource(client);
} | java | public static base_response add(nitro_service client, cmpaction resource) throws Exception {
cmpaction addresource = new cmpaction();
addresource.name = resource.name;
addresource.cmptype = resource.cmptype;
addresource.deltatype = resource.deltatype;
return addresource.add_resource(client);
} | [
"public",
"static",
"base_response",
"add",
"(",
"nitro_service",
"client",
",",
"cmpaction",
"resource",
")",
"throws",
"Exception",
"{",
"cmpaction",
"addresource",
"=",
"new",
"cmpaction",
"(",
")",
";",
"addresource",
".",
"name",
"=",
"resource",
".",
"name",
";",
"addresource",
".",
"cmptype",
"=",
"resource",
".",
"cmptype",
";",
"addresource",
".",
"deltatype",
"=",
"resource",
".",
"deltatype",
";",
"return",
"addresource",
".",
"add_resource",
"(",
"client",
")",
";",
"}"
] | Use this API to add cmpaction. | [
"Use",
"this",
"API",
"to",
"add",
"cmpaction",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/cmp/cmpaction.java#L199-L205 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/cmp/cmpaction.java | cmpaction.add | public static base_responses add(nitro_service client, cmpaction resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
cmpaction addresources[] = new cmpaction[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new cmpaction();
addresources[i].name = resources[i].name;
addresources[i].cmptype = resources[i].cmptype;
addresources[i].deltatype = resources[i].deltatype;
}
result = add_bulk_request(client, addresources);
}
return result;
} | java | public static base_responses add(nitro_service client, cmpaction resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
cmpaction addresources[] = new cmpaction[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new cmpaction();
addresources[i].name = resources[i].name;
addresources[i].cmptype = resources[i].cmptype;
addresources[i].deltatype = resources[i].deltatype;
}
result = add_bulk_request(client, addresources);
}
return result;
} | [
"public",
"static",
"base_responses",
"add",
"(",
"nitro_service",
"client",
",",
"cmpaction",
"resources",
"[",
"]",
")",
"throws",
"Exception",
"{",
"base_responses",
"result",
"=",
"null",
";",
"if",
"(",
"resources",
"!=",
"null",
"&&",
"resources",
".",
"length",
">",
"0",
")",
"{",
"cmpaction",
"addresources",
"[",
"]",
"=",
"new",
"cmpaction",
"[",
"resources",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"resources",
".",
"length",
";",
"i",
"++",
")",
"{",
"addresources",
"[",
"i",
"]",
"=",
"new",
"cmpaction",
"(",
")",
";",
"addresources",
"[",
"i",
"]",
".",
"name",
"=",
"resources",
"[",
"i",
"]",
".",
"name",
";",
"addresources",
"[",
"i",
"]",
".",
"cmptype",
"=",
"resources",
"[",
"i",
"]",
".",
"cmptype",
";",
"addresources",
"[",
"i",
"]",
".",
"deltatype",
"=",
"resources",
"[",
"i",
"]",
".",
"deltatype",
";",
"}",
"result",
"=",
"add_bulk_request",
"(",
"client",
",",
"addresources",
")",
";",
"}",
"return",
"result",
";",
"}"
] | Use this API to add cmpaction resources. | [
"Use",
"this",
"API",
"to",
"add",
"cmpaction",
"resources",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/cmp/cmpaction.java#L210-L223 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/cmp/cmpaction.java | cmpaction.get | public static cmpaction[] get(nitro_service service, options option) throws Exception{
cmpaction obj = new cmpaction();
cmpaction[] response = (cmpaction[])obj.get_resources(service,option);
return response;
} | java | public static cmpaction[] get(nitro_service service, options option) throws Exception{
cmpaction obj = new cmpaction();
cmpaction[] response = (cmpaction[])obj.get_resources(service,option);
return response;
} | [
"public",
"static",
"cmpaction",
"[",
"]",
"get",
"(",
"nitro_service",
"service",
",",
"options",
"option",
")",
"throws",
"Exception",
"{",
"cmpaction",
"obj",
"=",
"new",
"cmpaction",
"(",
")",
";",
"cmpaction",
"[",
"]",
"response",
"=",
"(",
"cmpaction",
"[",
"]",
")",
"obj",
".",
"get_resources",
"(",
"service",
",",
"option",
")",
";",
"return",
"response",
";",
"}"
] | Use this API to fetch all the cmpaction resources that are configured on netscaler. | [
"Use",
"this",
"API",
"to",
"fetch",
"all",
"the",
"cmpaction",
"resources",
"that",
"are",
"configured",
"on",
"netscaler",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/cmp/cmpaction.java#L304-L308 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/cmp/cmpaction.java | cmpaction.get | public static cmpaction get(nitro_service service, String name) throws Exception{
cmpaction obj = new cmpaction();
obj.set_name(name);
cmpaction response = (cmpaction) obj.get_resource(service);
return response;
} | java | public static cmpaction get(nitro_service service, String name) throws Exception{
cmpaction obj = new cmpaction();
obj.set_name(name);
cmpaction response = (cmpaction) obj.get_resource(service);
return response;
} | [
"public",
"static",
"cmpaction",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"cmpaction",
"obj",
"=",
"new",
"cmpaction",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
")",
";",
"cmpaction",
"response",
"=",
"(",
"cmpaction",
")",
"obj",
".",
"get_resource",
"(",
"service",
")",
";",
"return",
"response",
";",
"}"
] | Use this API to fetch cmpaction resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"cmpaction",
"resource",
"of",
"given",
"name",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/cmp/cmpaction.java#L312-L317 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/network/netbridge.java | netbridge.delete | public static base_response delete(nitro_service client, String name) throws Exception {
netbridge deleteresource = new netbridge();
deleteresource.name = name;
return deleteresource.delete_resource(client);
} | java | public static base_response delete(nitro_service client, String name) throws Exception {
netbridge deleteresource = new netbridge();
deleteresource.name = name;
return deleteresource.delete_resource(client);
} | [
"public",
"static",
"base_response",
"delete",
"(",
"nitro_service",
"client",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"netbridge",
"deleteresource",
"=",
"new",
"netbridge",
"(",
")",
";",
"deleteresource",
".",
"name",
"=",
"name",
";",
"return",
"deleteresource",
".",
"delete_resource",
"(",
"client",
")",
";",
"}"
] | Use this API to delete netbridge of given name. | [
"Use",
"this",
"API",
"to",
"delete",
"netbridge",
"of",
"given",
"name",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/network/netbridge.java#L118-L122 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/network/netbridge.java | netbridge.get | public static netbridge[] get(nitro_service service, options option) throws Exception{
netbridge obj = new netbridge();
netbridge[] response = (netbridge[])obj.get_resources(service,option);
return response;
} | java | public static netbridge[] get(nitro_service service, options option) throws Exception{
netbridge obj = new netbridge();
netbridge[] response = (netbridge[])obj.get_resources(service,option);
return response;
} | [
"public",
"static",
"netbridge",
"[",
"]",
"get",
"(",
"nitro_service",
"service",
",",
"options",
"option",
")",
"throws",
"Exception",
"{",
"netbridge",
"obj",
"=",
"new",
"netbridge",
"(",
")",
";",
"netbridge",
"[",
"]",
"response",
"=",
"(",
"netbridge",
"[",
"]",
")",
"obj",
".",
"get_resources",
"(",
"service",
",",
"option",
")",
";",
"return",
"response",
";",
"}"
] | Use this API to fetch all the netbridge resources that are configured on netscaler. | [
"Use",
"this",
"API",
"to",
"fetch",
"all",
"the",
"netbridge",
"resources",
"that",
"are",
"configured",
"on",
"netscaler",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/network/netbridge.java#L176-L180 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/network/netbridge.java | netbridge.get | public static netbridge get(nitro_service service, String name) throws Exception{
netbridge obj = new netbridge();
obj.set_name(name);
netbridge response = (netbridge) obj.get_resource(service);
return response;
} | java | public static netbridge get(nitro_service service, String name) throws Exception{
netbridge obj = new netbridge();
obj.set_name(name);
netbridge response = (netbridge) obj.get_resource(service);
return response;
} | [
"public",
"static",
"netbridge",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"netbridge",
"obj",
"=",
"new",
"netbridge",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
")",
";",
"netbridge",
"response",
"=",
"(",
"netbridge",
")",
"obj",
".",
"get_resource",
"(",
"service",
")",
";",
"return",
"response",
";",
"}"
] | Use this API to fetch netbridge resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"netbridge",
"resource",
"of",
"given",
"name",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/network/netbridge.java#L184-L189 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nsaptlicense.java | nsaptlicense.change | public static base_response change(nitro_service client, nsaptlicense resource) throws Exception {
nsaptlicense updateresource = new nsaptlicense();
updateresource.id = resource.id;
updateresource.sessionid = resource.sessionid;
updateresource.bindtype = resource.bindtype;
updateresource.countavailable = resource.countavailable;
updateresource.licensedir = resource.licensedir;
return updateresource.perform_operation(client,"update");
} | java | public static base_response change(nitro_service client, nsaptlicense resource) throws Exception {
nsaptlicense updateresource = new nsaptlicense();
updateresource.id = resource.id;
updateresource.sessionid = resource.sessionid;
updateresource.bindtype = resource.bindtype;
updateresource.countavailable = resource.countavailable;
updateresource.licensedir = resource.licensedir;
return updateresource.perform_operation(client,"update");
} | [
"public",
"static",
"base_response",
"change",
"(",
"nitro_service",
"client",
",",
"nsaptlicense",
"resource",
")",
"throws",
"Exception",
"{",
"nsaptlicense",
"updateresource",
"=",
"new",
"nsaptlicense",
"(",
")",
";",
"updateresource",
".",
"id",
"=",
"resource",
".",
"id",
";",
"updateresource",
".",
"sessionid",
"=",
"resource",
".",
"sessionid",
";",
"updateresource",
".",
"bindtype",
"=",
"resource",
".",
"bindtype",
";",
"updateresource",
".",
"countavailable",
"=",
"resource",
".",
"countavailable",
";",
"updateresource",
".",
"licensedir",
"=",
"resource",
".",
"licensedir",
";",
"return",
"updateresource",
".",
"perform_operation",
"(",
"client",
",",
"\"update\"",
")",
";",
"}"
] | Use this API to change nsaptlicense. | [
"Use",
"this",
"API",
"to",
"change",
"nsaptlicense",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nsaptlicense.java#L271-L279 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nsaptlicense.java | nsaptlicense.change | public static base_responses change(nitro_service client, nsaptlicense resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
nsaptlicense updateresources[] = new nsaptlicense[resources.length];
for (int i=0;i<resources.length;i++){
updateresources[i] = new nsaptlicense();
updateresources[i].id = resources[i].id;
updateresources[i].sessionid = resources[i].sessionid;
updateresources[i].bindtype = resources[i].bindtype;
updateresources[i].countavailable = resources[i].countavailable;
updateresources[i].licensedir = resources[i].licensedir;
}
result = perform_operation_bulk_request(client, updateresources,"update");
}
return result;
} | java | public static base_responses change(nitro_service client, nsaptlicense resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
nsaptlicense updateresources[] = new nsaptlicense[resources.length];
for (int i=0;i<resources.length;i++){
updateresources[i] = new nsaptlicense();
updateresources[i].id = resources[i].id;
updateresources[i].sessionid = resources[i].sessionid;
updateresources[i].bindtype = resources[i].bindtype;
updateresources[i].countavailable = resources[i].countavailable;
updateresources[i].licensedir = resources[i].licensedir;
}
result = perform_operation_bulk_request(client, updateresources,"update");
}
return result;
} | [
"public",
"static",
"base_responses",
"change",
"(",
"nitro_service",
"client",
",",
"nsaptlicense",
"resources",
"[",
"]",
")",
"throws",
"Exception",
"{",
"base_responses",
"result",
"=",
"null",
";",
"if",
"(",
"resources",
"!=",
"null",
"&&",
"resources",
".",
"length",
">",
"0",
")",
"{",
"nsaptlicense",
"updateresources",
"[",
"]",
"=",
"new",
"nsaptlicense",
"[",
"resources",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"resources",
".",
"length",
";",
"i",
"++",
")",
"{",
"updateresources",
"[",
"i",
"]",
"=",
"new",
"nsaptlicense",
"(",
")",
";",
"updateresources",
"[",
"i",
"]",
".",
"id",
"=",
"resources",
"[",
"i",
"]",
".",
"id",
";",
"updateresources",
"[",
"i",
"]",
".",
"sessionid",
"=",
"resources",
"[",
"i",
"]",
".",
"sessionid",
";",
"updateresources",
"[",
"i",
"]",
".",
"bindtype",
"=",
"resources",
"[",
"i",
"]",
".",
"bindtype",
";",
"updateresources",
"[",
"i",
"]",
".",
"countavailable",
"=",
"resources",
"[",
"i",
"]",
".",
"countavailable",
";",
"updateresources",
"[",
"i",
"]",
".",
"licensedir",
"=",
"resources",
"[",
"i",
"]",
".",
"licensedir",
";",
"}",
"result",
"=",
"perform_operation_bulk_request",
"(",
"client",
",",
"updateresources",
",",
"\"update\"",
")",
";",
"}",
"return",
"result",
";",
"}"
] | Use this API to change nsaptlicense resources. | [
"Use",
"this",
"API",
"to",
"change",
"nsaptlicense",
"resources",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nsaptlicense.java#L284-L299 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nsaptlicense.java | nsaptlicense.get | public static nsaptlicense[] get(nitro_service service, nsaptlicense_args args) throws Exception{
nsaptlicense obj = new nsaptlicense();
options option = new options();
option.set_args(nitro_util.object_to_string_withoutquotes(args));
nsaptlicense[] response = (nsaptlicense[])obj.get_resources(service, option);
return response;
} | java | public static nsaptlicense[] get(nitro_service service, nsaptlicense_args args) throws Exception{
nsaptlicense obj = new nsaptlicense();
options option = new options();
option.set_args(nitro_util.object_to_string_withoutquotes(args));
nsaptlicense[] response = (nsaptlicense[])obj.get_resources(service, option);
return response;
} | [
"public",
"static",
"nsaptlicense",
"[",
"]",
"get",
"(",
"nitro_service",
"service",
",",
"nsaptlicense_args",
"args",
")",
"throws",
"Exception",
"{",
"nsaptlicense",
"obj",
"=",
"new",
"nsaptlicense",
"(",
")",
";",
"options",
"option",
"=",
"new",
"options",
"(",
")",
";",
"option",
".",
"set_args",
"(",
"nitro_util",
".",
"object_to_string_withoutquotes",
"(",
"args",
")",
")",
";",
"nsaptlicense",
"[",
"]",
"response",
"=",
"(",
"nsaptlicense",
"[",
"]",
")",
"obj",
".",
"get_resources",
"(",
"service",
",",
"option",
")",
";",
"return",
"response",
";",
"}"
] | Use this API to fetch all the nsaptlicense resources that are configured on netscaler.
This uses nsaptlicense_args which is a way to provide additional arguments while fetching the resources. | [
"Use",
"this",
"API",
"to",
"fetch",
"all",
"the",
"nsaptlicense",
"resources",
"that",
"are",
"configured",
"on",
"netscaler",
".",
"This",
"uses",
"nsaptlicense_args",
"which",
"is",
"a",
"way",
"to",
"provide",
"additional",
"arguments",
"while",
"fetching",
"the",
"resources",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nsaptlicense.java#L305-L311 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/cache/cacheglobal_cachepolicy_binding.java | cacheglobal_cachepolicy_binding.get | public static cacheglobal_cachepolicy_binding[] get(nitro_service service) throws Exception{
cacheglobal_cachepolicy_binding obj = new cacheglobal_cachepolicy_binding();
cacheglobal_cachepolicy_binding response[] = (cacheglobal_cachepolicy_binding[]) obj.get_resources(service);
return response;
} | java | public static cacheglobal_cachepolicy_binding[] get(nitro_service service) throws Exception{
cacheglobal_cachepolicy_binding obj = new cacheglobal_cachepolicy_binding();
cacheglobal_cachepolicy_binding response[] = (cacheglobal_cachepolicy_binding[]) obj.get_resources(service);
return response;
} | [
"public",
"static",
"cacheglobal_cachepolicy_binding",
"[",
"]",
"get",
"(",
"nitro_service",
"service",
")",
"throws",
"Exception",
"{",
"cacheglobal_cachepolicy_binding",
"obj",
"=",
"new",
"cacheglobal_cachepolicy_binding",
"(",
")",
";",
"cacheglobal_cachepolicy_binding",
"response",
"[",
"]",
"=",
"(",
"cacheglobal_cachepolicy_binding",
"[",
"]",
")",
"obj",
".",
"get_resources",
"(",
"service",
")",
";",
"return",
"response",
";",
"}"
] | Use this API to fetch a cacheglobal_cachepolicy_binding resources. | [
"Use",
"this",
"API",
"to",
"fetch",
"a",
"cacheglobal_cachepolicy_binding",
"resources",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/cache/cacheglobal_cachepolicy_binding.java#L320-L324 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/stat/responder/responderpolicy_stats.java | responderpolicy_stats.get | public static responderpolicy_stats[] get(nitro_service service) throws Exception{
responderpolicy_stats obj = new responderpolicy_stats();
responderpolicy_stats[] response = (responderpolicy_stats[])obj.stat_resources(service);
return response;
} | java | public static responderpolicy_stats[] get(nitro_service service) throws Exception{
responderpolicy_stats obj = new responderpolicy_stats();
responderpolicy_stats[] response = (responderpolicy_stats[])obj.stat_resources(service);
return response;
} | [
"public",
"static",
"responderpolicy_stats",
"[",
"]",
"get",
"(",
"nitro_service",
"service",
")",
"throws",
"Exception",
"{",
"responderpolicy_stats",
"obj",
"=",
"new",
"responderpolicy_stats",
"(",
")",
";",
"responderpolicy_stats",
"[",
"]",
"response",
"=",
"(",
"responderpolicy_stats",
"[",
"]",
")",
"obj",
".",
"stat_resources",
"(",
"service",
")",
";",
"return",
"response",
";",
"}"
] | Use this API to fetch the statistics of all responderpolicy_stats resources that are configured on netscaler. | [
"Use",
"this",
"API",
"to",
"fetch",
"the",
"statistics",
"of",
"all",
"responderpolicy_stats",
"resources",
"that",
"are",
"configured",
"on",
"netscaler",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/responder/responderpolicy_stats.java#L151-L155 | train |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/stat/responder/responderpolicy_stats.java | responderpolicy_stats.get | public static responderpolicy_stats get(nitro_service service, String name) throws Exception{
responderpolicy_stats obj = new responderpolicy_stats();
obj.set_name(name);
responderpolicy_stats response = (responderpolicy_stats) obj.stat_resource(service);
return response;
} | java | public static responderpolicy_stats get(nitro_service service, String name) throws Exception{
responderpolicy_stats obj = new responderpolicy_stats();
obj.set_name(name);
responderpolicy_stats response = (responderpolicy_stats) obj.stat_resource(service);
return response;
} | [
"public",
"static",
"responderpolicy_stats",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"responderpolicy_stats",
"obj",
"=",
"new",
"responderpolicy_stats",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
")",
";",
"responderpolicy_stats",
"response",
"=",
"(",
"responderpolicy_stats",
")",
"obj",
".",
"stat_resource",
"(",
"service",
")",
";",
"return",
"response",
";",
"}"
] | Use this API to fetch statistics of responderpolicy_stats resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"statistics",
"of",
"responderpolicy_stats",
"resource",
"of",
"given",
"name",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/responder/responderpolicy_stats.java#L169-L174 | train |
Subsets and Splits