_id stringlengths 2 7 | title stringlengths 3 140 | partition stringclasses 3
values | text stringlengths 73 34.1k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q11800 | rewriteglobal_rewritepolicy_binding.get | train | public static rewriteglobal_rewritepolicy_binding[] get(nitro_service service) throws Exception{
rewriteglobal_rewritepolicy_binding obj = new rewriteglobal_rewritepolicy_binding();
rewriteglobal_rewritepolicy_binding response[] = (rewriteglobal_rewritepolicy_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q11801 | PrettyLogger.log | train | public static void log(RedwoodChannels channels, Object obj) {
log(channels, obj.getClass().getSimpleName(), obj);
} | java | {
"resource": ""
} |
q11802 | arp.add | train | public static base_response add(nitro_service client, arp resource) throws Exception {
arp addresource = new arp();
addresource.ipaddress = resource.ipaddress;
addresource.td = resource.td;
addresource.mac = resource.mac;
addresource.ifnum = resource.ifnum;
addresource.ownernode = resource.ownernode;
return addresource.add_resource(client);
} | java | {
"resource": ""
} |
q11803 | arp.add | train | public static base_responses add(nitro_service client, arp resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
arp addresources[] = new arp[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new arp();
addresources[i].ipaddress = resources[i].ipaddress;
addresources[i].td = resources[i].td;
addresources[i].mac = resources[i].mac;
addresources[i].ifnum = resources[i].ifnum;
addresources[i].ownernode = resources[i].ownernode;
}
result = add_bulk_request(client, addresources);
}
return result;
} | java | {
"resource": ""
} |
q11804 | arp.delete | train | public static base_response delete(nitro_service client, arp resource) throws Exception {
arp deleteresource = new arp();
deleteresource.ipaddress = resource.ipaddress;
deleteresource.td = resource.td;
deleteresource.all = resource.all;
deleteresource.ownernode = resource.ownernode;
return deleteresource.delete_resource(client);
} | java | {
"resource": ""
} |
q11805 | arp.delete | train | public static base_responses delete(nitro_service client, arp resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
arp deleteresources[] = new arp[resources.length];
for (int i=0;i<resources.length;i++){
deleteresources[i] = new arp();
deleteresources[i].ipaddress = resources[i].ipaddress;
deleteresources[i].td = resources[i].td;
deleteresources[i].all = resources[i].all;
deleteresources[i].ownernode = resources[i].ownernode;
}
result = delete_bulk_request(client, deleteresources);
}
return result;
} | java | {
"resource": ""
} |
q11806 | arp.send | train | public static base_response send(nitro_service client, arp resource) throws Exception {
arp sendresource = new arp();
sendresource.ipaddress = resource.ipaddress;
sendresource.td = resource.td;
sendresource.all = resource.all;
return sendresource.perform_operation(client,"send");
} | java | {
"resource": ""
} |
q11807 | arp.send | train | public static base_responses send(nitro_service client, arp resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
arp sendresources[] = new arp[resources.length];
for (int i=0;i<resources.length;i++){
sendresources[i] = new arp();
sendresources[i].ipaddress = resources[i].ipaddress;
sendresources[i].td = resources[i].td;
sendresources[i].all = resources[i].all;
}
result = perform_operation_bulk_request(client, sendresources,"send");
}
return result;
} | java | {
"resource": ""
} |
q11808 | arp.get | train | public static arp[] get(nitro_service service) throws Exception{
arp obj = new arp();
arp[] response = (arp[])obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q11809 | sslpolicy_csvserver_binding.get | train | public static sslpolicy_csvserver_binding[] get(nitro_service service, String name) throws Exception{
sslpolicy_csvserver_binding obj = new sslpolicy_csvserver_binding();
obj.set_name(name);
sslpolicy_csvserver_binding response[] = (sslpolicy_csvserver_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q11810 | vpnvserver_authenticationldappolicy_binding.get | train | public static vpnvserver_authenticationldappolicy_binding[] get(nitro_service service, String name) throws Exception{
vpnvserver_authenticationldappolicy_binding obj = new vpnvserver_authenticationldappolicy_binding();
obj.set_name(name);
vpnvserver_authenticationldappolicy_binding response[] = (vpnvserver_authenticationldappolicy_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q11811 | appfwpolicylabel.add | train | public static base_response add(nitro_service client, appfwpolicylabel resource) throws Exception {
appfwpolicylabel addresource = new appfwpolicylabel();
addresource.labelname = resource.labelname;
addresource.policylabeltype = resource.policylabeltype;
return addresource.add_resource(client);
} | java | {
"resource": ""
} |
q11812 | appfwpolicylabel.get | train | public static appfwpolicylabel[] get(nitro_service service) throws Exception{
appfwpolicylabel obj = new appfwpolicylabel();
appfwpolicylabel[] response = (appfwpolicylabel[])obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q11813 | appfwpolicylabel.get | train | public static appfwpolicylabel get(nitro_service service, String labelname) throws Exception{
appfwpolicylabel obj = new appfwpolicylabel();
obj.set_labelname(labelname);
appfwpolicylabel response = (appfwpolicylabel) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q11814 | ClassifierComparator.compare | train | public boolean compare(List<CoreLabel> doc1, List<CoreLabel> doc2) {
int i1 = 0, i2 = 0; //
String last1 = "O", last2 = "O";
boolean cm_set;
for (int i = 0; i < doc1.size(); i++) {
CoreLabel c1 = doc1.get(i);
CoreLabel c2 = doc2.get(i);
String a1 = c1.getString(AnswerAnnotation.class);
String a2 = c2.getString(AnswerAnnotation.class);
if (a1 == null || a2 == null) return false;
}
// TODO
return true;
} | java | {
"resource": ""
} |
q11815 | vpnglobal_authenticationldappolicy_binding.get | train | public static vpnglobal_authenticationldappolicy_binding[] get(nitro_service service) throws Exception{
vpnglobal_authenticationldappolicy_binding obj = new vpnglobal_authenticationldappolicy_binding();
vpnglobal_authenticationldappolicy_binding response[] = (vpnglobal_authenticationldappolicy_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q11816 | systemglobal_authenticationtacacspolicy_binding.get | train | public static systemglobal_authenticationtacacspolicy_binding[] get(nitro_service service) throws Exception{
systemglobal_authenticationtacacspolicy_binding obj = new systemglobal_authenticationtacacspolicy_binding();
systemglobal_authenticationtacacspolicy_binding response[] = (systemglobal_authenticationtacacspolicy_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q11817 | svcbindings.get | train | public static svcbindings get(nitro_service service, String servicename) throws Exception{
svcbindings obj = new svcbindings();
obj.set_servicename(servicename);
svcbindings response = (svcbindings) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q11818 | svcbindings.get | train | public static svcbindings[] get(nitro_service service, String servicename[]) throws Exception{
if (servicename !=null && servicename.length>0) {
svcbindings response[] = new svcbindings[servicename.length];
svcbindings obj[] = new svcbindings[servicename.length];
for (int i=0;i<servicename.length;i++) {
obj[i] = new svcbindings();
obj[i].set_servicename(servicename[i]);
response[i] = (svcbindings) obj[i].get_resource(service);
}
return response;
}
return null;
} | java | {
"resource": ""
} |
q11819 | cachepolicylabel_stats.get | train | public static cachepolicylabel_stats[] get(nitro_service service) throws Exception{
cachepolicylabel_stats obj = new cachepolicylabel_stats();
cachepolicylabel_stats[] response = (cachepolicylabel_stats[])obj.stat_resources(service);
return response;
} | java | {
"resource": ""
} |
q11820 | cachepolicylabel_stats.get | train | public static cachepolicylabel_stats get(nitro_service service, String labelname) throws Exception{
cachepolicylabel_stats obj = new cachepolicylabel_stats();
obj.set_labelname(labelname);
cachepolicylabel_stats response = (cachepolicylabel_stats) obj.stat_resource(service);
return response;
} | java | {
"resource": ""
} |
q11821 | systementitytype.get | train | public static systementitytype get(nitro_service service) throws Exception{
systementitytype obj = new systementitytype();
systementitytype[] response = (systementitytype[])obj.get_resources(service);
return response[0];
} | java | {
"resource": ""
} |
q11822 | systementitytype.get | train | public static systementitytype[] get(nitro_service service, systementitytype_args args) throws Exception{
systementitytype obj = new systementitytype();
options option = new options();
option.set_args(nitro_util.object_to_string_withoutquotes(args));
systementitytype[] response = (systementitytype[])obj.get_resources(service, option);
return response;
} | java | {
"resource": ""
} |
q11823 | spilloverpolicy_binding.get | train | public static spilloverpolicy_binding get(nitro_service service, String name) throws Exception{
spilloverpolicy_binding obj = new spilloverpolicy_binding();
obj.set_name(name);
spilloverpolicy_binding response = (spilloverpolicy_binding) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q11824 | cspolicy_binding.get | train | public static cspolicy_binding get(nitro_service service, String policyname) throws Exception{
cspolicy_binding obj = new cspolicy_binding();
obj.set_policyname(policyname);
cspolicy_binding response = (cspolicy_binding) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q11825 | gslbvserver_stats.get | train | public static gslbvserver_stats[] get(nitro_service service) throws Exception{
gslbvserver_stats obj = new gslbvserver_stats();
gslbvserver_stats[] response = (gslbvserver_stats[])obj.stat_resources(service);
return response;
} | java | {
"resource": ""
} |
q11826 | gslbvserver_stats.get | train | public static gslbvserver_stats get(nitro_service service, String name) throws Exception{
gslbvserver_stats obj = new gslbvserver_stats();
obj.set_name(name);
gslbvserver_stats response = (gslbvserver_stats) obj.stat_resource(service);
return response;
} | java | {
"resource": ""
} |
q11827 | filterglobal_binding.get | train | public static filterglobal_binding get(nitro_service service) throws Exception{
filterglobal_binding obj = new filterglobal_binding();
filterglobal_binding response = (filterglobal_binding) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q11828 | server_servicegroup_binding.get | train | public static server_servicegroup_binding[] get(nitro_service service, String name) throws Exception{
server_servicegroup_binding obj = new server_servicegroup_binding();
obj.set_name(name);
server_servicegroup_binding response[] = (server_servicegroup_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q11829 | dospolicy_stats.get | train | public static dospolicy_stats[] get(nitro_service service) throws Exception{
dospolicy_stats obj = new dospolicy_stats();
dospolicy_stats[] response = (dospolicy_stats[])obj.stat_resources(service);
return response;
} | java | {
"resource": ""
} |
q11830 | dospolicy_stats.get | train | public static dospolicy_stats get(nitro_service service, String name) throws Exception{
dospolicy_stats obj = new dospolicy_stats();
obj.set_name(name);
dospolicy_stats response = (dospolicy_stats) obj.stat_resource(service);
return response;
} | java | {
"resource": ""
} |
q11831 | Triple.makeTriple | train | public static <X, Y, Z> Triple<X, Y, Z> makeTriple(X x, Y y, Z z) {
return new Triple<X, Y, Z>(x, y, z);
} | java | {
"resource": ""
} |
q11832 | authenticationvserver_authenticationldappolicy_binding.get | train | public static authenticationvserver_authenticationldappolicy_binding[] get(nitro_service service, String name) throws Exception{
authenticationvserver_authenticationldappolicy_binding obj = new authenticationvserver_authenticationldappolicy_binding();
obj.set_name(name);
authenticationvserver_authenticationldappolicy_binding response[] = (authenticationvserver_authenticationldappolicy_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q11833 | responderglobal_binding.get | train | public static responderglobal_binding get(nitro_service service) throws Exception{
responderglobal_binding obj = new responderglobal_binding();
responderglobal_binding response = (responderglobal_binding) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q11834 | sslvserver_sslpolicy_binding.get | train | public static sslvserver_sslpolicy_binding[] get(nitro_service service, String vservername) throws Exception{
sslvserver_sslpolicy_binding obj = new sslvserver_sslpolicy_binding();
obj.set_vservername(vservername);
sslvserver_sslpolicy_binding response[] = (sslvserver_sslpolicy_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q11835 | systemcounters.get | train | public static systemcounters get(nitro_service service) throws Exception{
systemcounters obj = new systemcounters();
systemcounters[] response = (systemcounters[])obj.get_resources(service);
return response[0];
} | java | {
"resource": ""
} |
q11836 | systemcounters.get | train | public static systemcounters[] get(nitro_service service, systemcounters_args args) throws Exception{
systemcounters obj = new systemcounters();
options option = new options();
option.set_args(nitro_util.object_to_string_withoutquotes(args));
systemcounters[] response = (systemcounters[])obj.get_resources(service, option);
return response;
} | java | {
"resource": ""
} |
q11837 | responderpolicylabel_policybinding_binding.get | train | public static responderpolicylabel_policybinding_binding[] get(nitro_service service, String labelname) throws Exception{
responderpolicylabel_policybinding_binding obj = new responderpolicylabel_policybinding_binding();
obj.set_labelname(labelname);
responderpolicylabel_policybinding_binding response[] = (responderpolicylabel_policybinding_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q11838 | channel_binding.get | train | public static channel_binding get(nitro_service service, String id) throws Exception{
channel_binding obj = new channel_binding();
obj.set_id(id);
channel_binding response = (channel_binding) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q11839 | appfwprofile_binding.get | train | public static appfwprofile_binding get(nitro_service service, String name) throws Exception{
appfwprofile_binding obj = new appfwprofile_binding();
obj.set_name(name);
appfwprofile_binding response = (appfwprofile_binding) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q11840 | lbvserver_auditsyslogpolicy_binding.get | train | public static lbvserver_auditsyslogpolicy_binding[] get(nitro_service service, String name) throws Exception{
lbvserver_auditsyslogpolicy_binding obj = new lbvserver_auditsyslogpolicy_binding();
obj.set_name(name);
lbvserver_auditsyslogpolicy_binding response[] = (lbvserver_auditsyslogpolicy_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q11841 | appfwprofile_sqlinjection_binding.get | train | public static appfwprofile_sqlinjection_binding[] get(nitro_service service, String name) throws Exception{
appfwprofile_sqlinjection_binding obj = new appfwprofile_sqlinjection_binding();
obj.set_name(name);
appfwprofile_sqlinjection_binding response[] = (appfwprofile_sqlinjection_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q11842 | clusternode.add | train | public static base_response add(nitro_service client, clusternode resource) throws Exception {
clusternode addresource = new clusternode();
addresource.nodeid = resource.nodeid;
addresource.ipaddress = resource.ipaddress;
addresource.state = resource.state;
addresource.backplane = resource.backplane;
addresource.priority = resource.priority;
return addresource.add_resource(client);
} | java | {
"resource": ""
} |
q11843 | clusternode.add | train | public static base_responses add(nitro_service client, clusternode resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
clusternode addresources[] = new clusternode[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new clusternode();
addresources[i].nodeid = resources[i].nodeid;
addresources[i].ipaddress = resources[i].ipaddress;
addresources[i].state = resources[i].state;
addresources[i].backplane = resources[i].backplane;
addresources[i].priority = resources[i].priority;
}
result = add_bulk_request(client, addresources);
}
return result;
} | java | {
"resource": ""
} |
q11844 | clusternode.update | train | public static base_response update(nitro_service client, clusternode resource) throws Exception {
clusternode updateresource = new clusternode();
updateresource.nodeid = resource.nodeid;
updateresource.state = resource.state;
updateresource.backplane = resource.backplane;
updateresource.priority = resource.priority;
return updateresource.update_resource(client);
} | java | {
"resource": ""
} |
q11845 | clusternode.update | train | public static base_responses update(nitro_service client, clusternode resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
clusternode updateresources[] = new clusternode[resources.length];
for (int i=0;i<resources.length;i++){
updateresources[i] = new clusternode();
updateresources[i].nodeid = resources[i].nodeid;
updateresources[i].state = resources[i].state;
updateresources[i].backplane = resources[i].backplane;
updateresources[i].priority = resources[i].priority;
}
result = update_bulk_request(client, updateresources);
}
return result;
} | java | {
"resource": ""
} |
q11846 | clusternode.unset | train | public static base_response unset(nitro_service client, clusternode resource, String[] args) throws Exception{
clusternode unsetresource = new clusternode();
unsetresource.nodeid = resource.nodeid;
return unsetresource.unset_resource(client,args);
} | java | {
"resource": ""
} |
q11847 | clusternode.unset | train | public static base_responses unset(nitro_service client, Long nodeid[], String args[]) throws Exception {
base_responses result = null;
if (nodeid != null && nodeid.length > 0) {
clusternode unsetresources[] = new clusternode[nodeid.length];
for (int i=0;i<nodeid.length;i++){
unsetresources[i] = new clusternode();
unsetresources[i].nodeid = nodeid[i];
}
result = unset_bulk_request(client, unsetresources,args);
}
return result;
} | java | {
"resource": ""
} |
q11848 | clusternode.delete | train | public static base_response delete(nitro_service client, clusternode resource) throws Exception {
clusternode deleteresource = new clusternode();
deleteresource.nodeid = resource.nodeid;
return deleteresource.delete_resource(client);
} | java | {
"resource": ""
} |
q11849 | clusternode.delete | train | public static base_responses delete(nitro_service client, Long nodeid[]) throws Exception {
base_responses result = null;
if (nodeid != null && nodeid.length > 0) {
clusternode deleteresources[] = new clusternode[nodeid.length];
for (int i=0;i<nodeid.length;i++){
deleteresources[i] = new clusternode();
deleteresources[i].nodeid = nodeid[i];
}
result = delete_bulk_request(client, deleteresources);
}
return result;
} | java | {
"resource": ""
} |
q11850 | clusternode.get | train | public static clusternode[] get(nitro_service service) throws Exception{
clusternode obj = new clusternode();
clusternode[] response = (clusternode[])obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q11851 | clusternode.get | train | public static clusternode get(nitro_service service, Long nodeid) throws Exception{
clusternode obj = new clusternode();
obj.set_nodeid(nodeid);
clusternode response = (clusternode) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q11852 | clusternode.get | train | public static clusternode[] get(nitro_service service, Long nodeid[]) throws Exception{
if (nodeid !=null && nodeid.length>0) {
clusternode response[] = new clusternode[nodeid.length];
clusternode obj[] = new clusternode[nodeid.length];
for (int i=0;i<nodeid.length;i++) {
obj[i] = new clusternode();
obj[i].set_nodeid(nodeid[i]);
response[i] = (clusternode) obj[i].get_resource(service);
}
return response;
}
return null;
} | java | {
"resource": ""
} |
q11853 | clusternode.get_filtered | train | public static clusternode[] get_filtered(nitro_service service, filtervalue[] filter) throws Exception{
clusternode obj = new clusternode();
options option = new options();
option.set_filter(filter);
clusternode[] response = (clusternode[]) obj.getfiltered(service, option);
return response;
} | java | {
"resource": ""
} |
q11854 | sslpolicy_binding.get | train | public static sslpolicy_binding get(nitro_service service, String name) throws Exception{
sslpolicy_binding obj = new sslpolicy_binding();
obj.set_name(name);
sslpolicy_binding response = (sslpolicy_binding) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q11855 | lbvserver_responderpolicy_binding.get | train | public static lbvserver_responderpolicy_binding[] get(nitro_service service, String name) throws Exception{
lbvserver_responderpolicy_binding obj = new lbvserver_responderpolicy_binding();
obj.set_name(name);
lbvserver_responderpolicy_binding response[] = (lbvserver_responderpolicy_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q11856 | cmppolicy_csvserver_binding.get | train | public static cmppolicy_csvserver_binding[] get(nitro_service service, String name) throws Exception{
cmppolicy_csvserver_binding obj = new cmppolicy_csvserver_binding();
obj.set_name(name);
cmppolicy_csvserver_binding response[] = (cmppolicy_csvserver_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q11857 | tunnelglobal_tunneltrafficpolicy_binding.get | train | public static tunnelglobal_tunneltrafficpolicy_binding[] get(nitro_service service) throws Exception{
tunnelglobal_tunneltrafficpolicy_binding obj = new tunnelglobal_tunneltrafficpolicy_binding();
tunnelglobal_tunneltrafficpolicy_binding response[] = (tunnelglobal_tunneltrafficpolicy_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q11858 | pq_stats.get | train | public static pq_stats get(nitro_service service) throws Exception{
pq_stats obj = new pq_stats();
pq_stats[] response = (pq_stats[])obj.stat_resources(service);
return response[0];
} | java | {
"resource": ""
} |
q11859 | csvserver_authorizationpolicy_binding.get | train | public static csvserver_authorizationpolicy_binding[] get(nitro_service service, String name) throws Exception{
csvserver_authorizationpolicy_binding obj = new csvserver_authorizationpolicy_binding();
obj.set_name(name);
csvserver_authorizationpolicy_binding response[] = (csvserver_authorizationpolicy_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q11860 | LabeledScoredTreeFactory.newTreeNode | train | @Override
public Tree newTreeNode(Label parentLabel, List<Tree> children) {
return new LabeledScoredTreeNode(lf.newLabel(parentLabel), children);
} | java | {
"resource": ""
} |
q11861 | policystringmap_binding.get | train | public static policystringmap_binding get(nitro_service service, String name) throws Exception{
policystringmap_binding obj = new policystringmap_binding();
obj.set_name(name);
policystringmap_binding response = (policystringmap_binding) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q11862 | clusternodegroup_crvserver_binding.count | train | public static long count(nitro_service service, clusternodegroup_crvserver_binding obj) throws Exception{
options option = new options();
option.set_count(true);
option.set_args(nitro_util.object_to_string_withoutquotes(obj));
clusternodegroup_crvserver_binding response[] = (clusternodegroup_crvserver_binding[]) obj.get_resources(service,option);
if (response != null) {
return response[0].__count;
}
return 0;
} | java | {
"resource": ""
} |
q11863 | ArrayUtils.asSet | train | public static <T> Set<T> asSet(T[] a) {
return new HashSet<T>(Arrays.asList(a));
} | java | {
"resource": ""
} |
q11864 | ArrayUtils.toDouble | train | public static double[] toDouble(float[] a) {
double[] d = new double[a.length];
for (int i = 0; i < a.length; i++) {
d[i] = a[i];
}
return d;
} | java | {
"resource": ""
} |
q11865 | ArrayUtils.toDouble | train | public static double[] toDouble(int[] array) {
double[] rv = new double[array.length];
for (int i = 0; i < array.length; i++) {
rv[i] = array[i];
}
return rv;
} | java | {
"resource": ""
} |
q11866 | vpnsessionpolicy.add | train | public static base_response add(nitro_service client, vpnsessionpolicy resource) throws Exception {
vpnsessionpolicy addresource = new vpnsessionpolicy();
addresource.name = resource.name;
addresource.rule = resource.rule;
addresource.action = resource.action;
return addresource.add_resource(client);
} | java | {
"resource": ""
} |
q11867 | vpnsessionpolicy.update | train | public static base_response update(nitro_service client, vpnsessionpolicy resource) throws Exception {
vpnsessionpolicy updateresource = new vpnsessionpolicy();
updateresource.name = resource.name;
updateresource.rule = resource.rule;
updateresource.action = resource.action;
return updateresource.update_resource(client);
} | java | {
"resource": ""
} |
q11868 | vpnsessionpolicy.get | train | public static vpnsessionpolicy[] get(nitro_service service) throws Exception{
vpnsessionpolicy obj = new vpnsessionpolicy();
vpnsessionpolicy[] response = (vpnsessionpolicy[])obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q11869 | vpnsessionpolicy.get | train | public static vpnsessionpolicy get(nitro_service service, String name) throws Exception{
vpnsessionpolicy obj = new vpnsessionpolicy();
obj.set_name(name);
vpnsessionpolicy response = (vpnsessionpolicy) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q11870 | SVMLightClassifierFactory.readModel | train | private static Pair<Double, ClassicCounter<Integer>> readModel(File modelFile, boolean multiclass) {
int modelLineCount = 0;
try {
int numLinesToSkip = multiclass ? 13 : 10;
String stopToken = "#";
BufferedReader in = new BufferedReader(new FileReader(modelFile));
for (int i=0; i < numLinesToSkip; i++) {
in.readLine();
modelLineCount ++;
}
List<Pair<Double, ClassicCounter<Integer>>> supportVectors = new ArrayList<Pair<Double, ClassicCounter<Integer>>>();
// Read Threshold
String thresholdLine = in.readLine();
modelLineCount ++;
String[] pieces = thresholdLine.split("\\s+");
double threshold = Double.parseDouble(pieces[0]);
// Read Support Vectors
while (in.ready()) {
String svLine = in.readLine();
modelLineCount ++;
pieces = svLine.split("\\s+");
// First Element is the alpha_i * y_i
double alpha = Double.parseDouble(pieces[0]);
ClassicCounter<Integer> supportVector = new ClassicCounter<Integer>();
for (int i=1; i < pieces.length; ++i) {
String piece = pieces[i];
if (piece.equals(stopToken)) break;
// Each in featureIndex:num class
String[] indexNum = piece.split(":");
String featureIndex = indexNum[0];
// mihai: we may see "qid" as indexNum[0]. just skip this piece. this is the block id useful only for reranking, which we don't do here.
if(! featureIndex.equals("qid")){
double count = Double.parseDouble(indexNum[1]);
supportVector.incrementCount(Integer.valueOf(featureIndex), count);
}
}
supportVectors.add(new Pair<Double, ClassicCounter<Integer>>(alpha, supportVector));
}
in.close();
return new Pair<Double, ClassicCounter<Integer>>(threshold, getWeights(supportVectors));
}
catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("Error reading SVM model (line " + modelLineCount + " in file " + modelFile.getAbsolutePath() + ")");
}
} | java | {
"resource": ""
} |
q11871 | SVMLightClassifierFactory.convertWeights | train | private ClassicCounter<Pair<F, L>> convertWeights(ClassicCounter<Integer> weights, Index<F> featureIndex, Index<L> labelIndex, boolean multiclass) {
return multiclass ? convertSVMStructWeights(weights, featureIndex, labelIndex) : convertSVMLightWeights(weights, featureIndex, labelIndex);
} | java | {
"resource": ""
} |
q11872 | SVMLightClassifierFactory.fitSigmoid | train | private LinearClassifier<L, L> fitSigmoid(SVMLightClassifier<L, F> classifier, GeneralDataset<L, F> dataset) {
RVFDataset<L, L> plattDataset = new RVFDataset<L, L>();
for (int i = 0; i < dataset.size(); i++) {
RVFDatum<L, F> d = dataset.getRVFDatum(i);
Counter<L> scores = classifier.scoresOf((Datum<L,F>)d);
scores.incrementCount(null);
plattDataset.add(new RVFDatum<L, L>(scores, d.label()));
}
LinearClassifierFactory<L, L> factory = new LinearClassifierFactory<L, L>();
factory.setPrior(new LogPrior(LogPrior.LogPriorType.NULL));
return factory.trainClassifier(plattDataset);
} | java | {
"resource": ""
} |
q11873 | gslbservice_binding.get | train | public static gslbservice_binding get(nitro_service service, String servicename) throws Exception{
gslbservice_binding obj = new gslbservice_binding();
obj.set_servicename(servicename);
gslbservice_binding response = (gslbservice_binding) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q11874 | MtasFetchData.getUrl | train | public Reader getUrl(String prefix, String postfix)
throws MtasParserException {
String url = getString();
if ((url != null) && !url.equals("")) {
if (prefix != null) {
url = prefix + url;
}
if (postfix != null) {
url = url + postfix;
}
if (url.startsWith("http://") || url.startsWith("https://")) {
BufferedReader in = null;
try {
URLConnection connection = new URL(url).openConnection();
connection.setRequestProperty("Accept-Encoding", "gzip");
connection.setReadTimeout(10000);
if (connection.getHeaderField("Content-Encoding") != null
&& connection.getHeaderField("Content-Encoding").equals("gzip")) {
in = new BufferedReader(new InputStreamReader(
new GZIPInputStream(connection.getInputStream()),
StandardCharsets.UTF_8));
} else {
in = new BufferedReader(new InputStreamReader(
connection.getInputStream(), StandardCharsets.UTF_8));
}
return in;
} catch (IOException ex) {
log.debug(ex);
throw new MtasParserException("couldn't get " + url);
}
} else {
throw new MtasParserException("no valid url: " + url);
}
} else {
throw new MtasParserException("no valid url: " + url);
}
} | java | {
"resource": ""
} |
q11875 | MtasFetchData.getFile | train | public Reader getFile(String prefix, String postfix)
throws MtasParserException {
String file = getString();
if ((file != null) && !file.equals("")) {
if (prefix != null) {
file = prefix + file;
}
if (postfix != null) {
file = file + postfix;
}
Path path = (new File(file)).toPath();
if(Files.isReadable(path)) {
try {
return new InputStreamReader(new GZIPInputStream(new FileInputStream(file)), StandardCharsets.UTF_8);
} catch (IOException e1) {
log.debug(e1);
try {
String text = new String(Files.readAllBytes(Paths.get(file)),
StandardCharsets.UTF_8);
return new StringReader(text);
} catch (IOException e2) {
log.debug(e2);
throw new MtasParserException(e2.getMessage());
}
}
} else {
throw new MtasParserException("file '"+file+"' does not exists or not readable");
}
} else {
throw new MtasParserException("no valid file: " + file);
}
} | java | {
"resource": ""
} |
q11876 | service_binding.get | train | public static service_binding get(nitro_service service, String name) throws Exception{
service_binding obj = new service_binding();
obj.set_name(name);
service_binding response = (service_binding) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q11877 | systemglobal_authenticationlocalpolicy_binding.get | train | public static systemglobal_authenticationlocalpolicy_binding[] get(nitro_service service) throws Exception{
systemglobal_authenticationlocalpolicy_binding obj = new systemglobal_authenticationlocalpolicy_binding();
systemglobal_authenticationlocalpolicy_binding response[] = (systemglobal_authenticationlocalpolicy_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q11878 | auditsyslogpolicy_tmglobal_binding.get | train | public static auditsyslogpolicy_tmglobal_binding[] get(nitro_service service, String name) throws Exception{
auditsyslogpolicy_tmglobal_binding obj = new auditsyslogpolicy_tmglobal_binding();
obj.set_name(name);
auditsyslogpolicy_tmglobal_binding response[] = (auditsyslogpolicy_tmglobal_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q11879 | MtasBufferedReader.readLine | train | String readLine(boolean ignoreLF) throws IOException {
StringBuffer s = null;
int startChar;
synchronized (lock) {
ensureOpen();
boolean omitLF = ignoreLF || skipLF;
for (;;) {
if (nextChar >= nChars)
fill();
if (nextChar >= nChars) { /* EOF */
if (s != null && s.length() > 0)
return s.toString();
else
return null;
}
boolean eol = false;
char c = 0;
int i;
/* Skip a leftover '\n', if necessary */
if (omitLF && (cb[nextChar] == '\n'))
nextChar++;
skipLF = false;
omitLF = false;
charLoop: for (i = nextChar; i < nChars; i++) {
c = cb[i];
if ((c == '\n') || (c == '\r')) {
eol = true;
break charLoop;
}
}
startChar = nextChar;
nextChar = i;
if (eol) {
String str;
if (s == null) {
str = new String(cb, startChar, i - startChar);
} else {
s.append(cb, startChar, i - startChar);
str = s.toString();
}
nextChar++;
if (c == '\r') {
skipLF = true;
}
return str;
}
if (s == null)
s = new StringBuffer(defaultExpectedLineLength);
s.append(cb, startChar, i - startChar);
}
}
} | java | {
"resource": ""
} |
q11880 | vpnparameter.unset | train | public static base_response unset(nitro_service client, vpnparameter resource, String[] args) throws Exception{
vpnparameter unsetresource = new vpnparameter();
return unsetresource.unset_resource(client,args);
} | java | {
"resource": ""
} |
q11881 | vpnparameter.get | train | public static vpnparameter get(nitro_service service, options option) throws Exception{
vpnparameter obj = new vpnparameter();
vpnparameter[] response = (vpnparameter[])obj.get_resources(service,option);
return response[0];
} | java | {
"resource": ""
} |
q11882 | PlainTextDocumentReaderAndWriter.getIterator | train | public Iterator<List<IN>> getIterator(Reader r) {
Tokenizer<IN> tokenizer = tokenizerFactory.getTokenizer(r);
// PTBTokenizer.newPTBTokenizer(r, false, true);
List<IN> words = new ArrayList<IN>();
IN previous = tokenFactory.makeToken();
StringBuilder prepend = new StringBuilder();
/*
* This changes SGML tags into whitespace -- it should maybe be moved
* elsewhere
*/
while (tokenizer.hasNext()) {
IN w = tokenizer.next();
String word = w.get(CoreAnnotations.TextAnnotation.class);
Matcher m = sgml.matcher(word);
if (m.matches()) {
String before = StringUtils.getNotNullString(w.get(CoreAnnotations.BeforeAnnotation.class));
String after = StringUtils.getNotNullString(w.get(CoreAnnotations.AfterAnnotation.class));
prepend.append(before).append(word);
String previousTokenAfter = StringUtils.getNotNullString(previous.get(CoreAnnotations.AfterAnnotation.class));
previous.set(AfterAnnotation.class, previousTokenAfter + word + after);
// previous.appendAfter(w.word() + w.after());
} else {
String before = StringUtils.getNotNullString(w.get(CoreAnnotations.BeforeAnnotation.class));
if (prepend.length() > 0) {
w.set(BeforeAnnotation.class, prepend.toString() + before);
// w.prependBefore(prepend.toString());
prepend = new StringBuilder();
}
words.add(w);
previous = w;
}
}
List<List<IN>> sentences = wts.process(words);
String after = "";
IN last = null;
for (List<IN> sentence : sentences) {
int pos = 0;
for (IN w : sentence) {
w.set(PositionAnnotation.class, Integer.toString(pos));
after = StringUtils.getNotNullString(w.get(CoreAnnotations.AfterAnnotation.class));
w.remove(AfterAnnotation.class);
last = w;
}
}
if (last != null) {
last.set(AfterAnnotation.class, after);
}
return sentences.iterator();
} | java | {
"resource": ""
} |
q11883 | lbvserver_dospolicy_binding.get | train | public static lbvserver_dospolicy_binding[] get(nitro_service service, String name) throws Exception{
lbvserver_dospolicy_binding obj = new lbvserver_dospolicy_binding();
obj.set_name(name);
lbvserver_dospolicy_binding response[] = (lbvserver_dospolicy_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q11884 | nsrunningconfig.get | train | public static nsrunningconfig get(nitro_service service) throws Exception{
nsrunningconfig obj = new nsrunningconfig();
nsrunningconfig[] response = (nsrunningconfig[])obj.get_resources(service);
return response[0];
} | java | {
"resource": ""
} |
q11885 | nsrunningconfig.get | train | public static nsrunningconfig[] get(nitro_service service, nsrunningconfig_args args) throws Exception{
nsrunningconfig obj = new nsrunningconfig();
options option = new options();
option.set_args(nitro_util.object_to_string_withoutquotes(args));
nsrunningconfig[] response = (nsrunningconfig[])obj.get_resources(service, option);
return response;
} | java | {
"resource": ""
} |
q11886 | servicegroup_servicegroupmember_binding.get | train | public static servicegroup_servicegroupmember_binding[] get(nitro_service service, String servicegroupname) throws Exception{
servicegroup_servicegroupmember_binding obj = new servicegroup_servicegroupmember_binding();
obj.set_servicegroupname(servicegroupname);
servicegroup_servicegroupmember_binding response[] = (servicegroup_servicegroupmember_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q11887 | aaagroup_auditnslogpolicy_binding.get | train | public static aaagroup_auditnslogpolicy_binding[] get(nitro_service service, String groupname) throws Exception{
aaagroup_auditnslogpolicy_binding obj = new aaagroup_auditnslogpolicy_binding();
obj.set_groupname(groupname);
aaagroup_auditnslogpolicy_binding response[] = (aaagroup_auditnslogpolicy_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q11888 | nd6ravariables_onlinkipv6prefix_binding.get | train | public static nd6ravariables_onlinkipv6prefix_binding[] get(nitro_service service, Long vlan) throws Exception{
nd6ravariables_onlinkipv6prefix_binding obj = new nd6ravariables_onlinkipv6prefix_binding();
obj.set_vlan(vlan);
nd6ravariables_onlinkipv6prefix_binding response[] = (nd6ravariables_onlinkipv6prefix_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q11889 | ArrayMath.exp | train | public static double[] exp(double[] a) {
double[] result = new double[a.length];
for (int i = 0; i < a.length; i++) {
result[i] = Math.exp(a[i]);
}
return result;
} | java | {
"resource": ""
} |
q11890 | ArrayMath.expInPlace | train | public static void expInPlace(double[] a) {
for (int i = 0; i < a.length; i++) {
a[i] = Math.exp(a[i]);
}
} | java | {
"resource": ""
} |
q11891 | ArrayMath.addInPlace | train | public static void addInPlace(double[] a, double b) {
for (int i = 0; i < a.length; i++) {
a[i] = a[i] + b;
}
} | java | {
"resource": ""
} |
q11892 | ArrayMath.addMultInPlace | train | public static void addMultInPlace(double[] a, double[] b, double c) {
for (int i=0; i<a.length; i++) {
a[i] += b[i] * c;
}
} | java | {
"resource": ""
} |
q11893 | ArrayMath.multiplyInPlace | train | public static void multiplyInPlace(double[] a, double b) {
for (int i = 0; i < a.length; i++) {
a[i] = a[i] * b;
}
} | java | {
"resource": ""
} |
q11894 | ArrayMath.add | train | public static double[] add(double[] a, double c) {
double[] result = new double[a.length];
for (int i = 0; i < a.length; i++) {
result[i] = a[i] + c;
}
return result;
} | java | {
"resource": ""
} |
q11895 | ArrayMath.pow | train | public static double[] pow(double[] a, double c) {
double[] result = new double[a.length];
for (int i = 0; i < a.length; i++) {
result[i] = Math.pow(a[i], c);
}
return result;
} | java | {
"resource": ""
} |
q11896 | ArrayMath.pairwiseAdd | train | public static int[] pairwiseAdd(int[] a, int[] b) {
int[] result = new int[a.length];
for (int i = 0; i < a.length; i++) {
result[i] = a[i] + b[i];
}
return result;
} | java | {
"resource": ""
} |
q11897 | ArrayMath.pairwiseMultiply | train | public static double[] pairwiseMultiply(double[] a, double[] b) {
if (a.length != b.length) {
throw new RuntimeException("Can't pairwise multiple different lengths: a.length=" + a.length + " b.length=" + b.length);
}
double[] result = new double[a.length];
for (int i = 0; i < result.length; i++) {
result[i] = a[i] * b[i];
}
return result;
} | java | {
"resource": ""
} |
q11898 | ArrayMath.norm_1 | train | public static double norm_1(double[] a) {
double sum = 0;
for (double anA : a) {
sum += (anA < 0 ? -anA : anA);
}
return sum;
} | java | {
"resource": ""
} |
q11899 | ArrayMath.norm | train | public static double norm(double[] a) {
double squaredSum = 0;
for (double anA : a) {
squaredSum += anA * anA;
}
return Math.sqrt(squaredSum);
} | java | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.