_id
stringlengths
2
7
title
stringlengths
3
140
partition
stringclasses
3 values
text
stringlengths
73
34.1k
language
stringclasses
1 value
meta_information
dict
q10800
MorseDistance.computeMorse
train
private String computeMorse(BytesRef term) { StringBuilder stringBuilder = new StringBuilder(); int i = term.offset + prefixOffset; for (; i < term.length; i++) { if (ALPHABET_MORSE.containsKey(term.bytes[i])) { stringBuilder.append(ALPHABET_MORSE.get(term.bytes[i]) + " "); } else if(term.bytes[i]!=0x00){ return null; } else { break; } } return stringBuilder.toString(); }
java
{ "resource": "" }
q10801
MtasSolrComponentTermvector.distributedProcessFinish
train
private void distributedProcessFinish(ResponseBuilder rb, ComponentFields mtasFields) throws IOException { // rewrite Object mtasResponseRaw; if ((mtasResponseRaw = rb.rsp.getValues().get("mtas")) != null && mtasResponseRaw instanceof NamedList) { NamedList<Object> mtasResponse = (NamedList<Object>) mtasResponseRaw; Object mtasResponseTermvectorRaw; if ((mtasResponseTermvectorRaw = mtasResponse.get(NAME)) != null && mtasResponseTermvectorRaw instanceof ArrayList) { MtasSolrResultUtil.rewrite( (ArrayList<Object>) mtasResponseTermvectorRaw, searchComponent); } } }
java
{ "resource": "" }
q10802
protocoludp_stats.get
train
public static protocoludp_stats get(nitro_service service) throws Exception{ protocoludp_stats obj = new protocoludp_stats(); protocoludp_stats[] response = (protocoludp_stats[])obj.stat_resources(service); return response[0]; }
java
{ "resource": "" }
q10803
csvserver_cachepolicy_binding.get
train
public static csvserver_cachepolicy_binding[] get(nitro_service service, String name) throws Exception{ csvserver_cachepolicy_binding obj = new csvserver_cachepolicy_binding(); obj.set_name(name); csvserver_cachepolicy_binding response[] = (csvserver_cachepolicy_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q10804
authenticationradiuspolicy_vpnglobal_binding.get
train
public static authenticationradiuspolicy_vpnglobal_binding[] get(nitro_service service, String name) throws Exception{ authenticationradiuspolicy_vpnglobal_binding obj = new authenticationradiuspolicy_vpnglobal_binding(); obj.set_name(name); authenticationradiuspolicy_vpnglobal_binding response[] = (authenticationradiuspolicy_vpnglobal_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q10805
HashIndex.indices
train
public int[] indices(Collection<E> elems) { int[] indices = new int[elems.size()]; int i = 0; for (E elem : elems) { indices[i++] = indexOf(elem); } return indices; }
java
{ "resource": "" }
q10806
HashIndex.get
train
public E get(int i) { if (i < 0 || i >= objects.size()) throw new ArrayIndexOutOfBoundsException("Index " + i + " outside the bounds [0," + size() + ")"); return objects.get(i); }
java
{ "resource": "" }
q10807
HashIndex.add
train
@Override public boolean add(E o) { Integer index = indexes.get(o); if (index == null && ! locked) { index = objects.size(); objects.add(o); indexes.put(o, index); return true; } return false; }
java
{ "resource": "" }
q10808
vlan.add
train
public static base_response add(nitro_service client, vlan resource) throws Exception { vlan addresource = new vlan(); addresource.id = resource.id; addresource.aliasname = resource.aliasname; addresource.ipv6dynamicrouting = resource.ipv6dynamicrouting; return addresource.add_resource(client); }
java
{ "resource": "" }
q10809
vlan.add
train
public static base_responses add(nitro_service client, vlan resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { vlan addresources[] = new vlan[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new vlan(); addresources[i].id = resources[i].id; addresources[i].aliasname = resources[i].aliasname; addresources[i].ipv6dynamicrouting = resources[i].ipv6dynamicrouting; } result = add_bulk_request(client, addresources); } return result; }
java
{ "resource": "" }
q10810
vlan.update
train
public static base_response update(nitro_service client, vlan resource) throws Exception { vlan updateresource = new vlan(); updateresource.id = resource.id; updateresource.aliasname = resource.aliasname; updateresource.ipv6dynamicrouting = resource.ipv6dynamicrouting; return updateresource.update_resource(client); }
java
{ "resource": "" }
q10811
vlan.get
train
public static vlan[] get(nitro_service service) throws Exception{ vlan obj = new vlan(); vlan[] response = (vlan[])obj.get_resources(service); return response; }
java
{ "resource": "" }
q10812
vlan.get
train
public static vlan get(nitro_service service, Long id) throws Exception{ vlan obj = new vlan(); obj.set_id(id); vlan response = (vlan) obj.get_resource(service); return response; }
java
{ "resource": "" }
q10813
systemcore.get
train
public static systemcore get(nitro_service service) throws Exception{ systemcore obj = new systemcore(); systemcore[] response = (systemcore[])obj.get_resources(service); return response[0]; }
java
{ "resource": "" }
q10814
systemcore.get
train
public static systemcore[] get(nitro_service service, systemcore_args args) throws Exception{ systemcore obj = new systemcore(); options option = new options(); option.set_args(nitro_util.object_to_string_withoutquotes(args)); systemcore[] response = (systemcore[])obj.get_resources(service, option); return response; }
java
{ "resource": "" }
q10815
rnat_stats.get
train
public static rnat_stats get(nitro_service service) throws Exception{ rnat_stats obj = new rnat_stats(); rnat_stats[] response = (rnat_stats[])obj.stat_resources(service); return response[0]; }
java
{ "resource": "" }
q10816
snmpoption.update
train
public static base_response update(nitro_service client, snmpoption resource) throws Exception { snmpoption updateresource = new snmpoption(); updateresource.snmpset = resource.snmpset; updateresource.snmptraplogging = resource.snmptraplogging; return updateresource.update_resource(client); }
java
{ "resource": "" }
q10817
snmpoption.unset
train
public static base_response unset(nitro_service client, snmpoption resource, String[] args) throws Exception{ snmpoption unsetresource = new snmpoption(); return unsetresource.unset_resource(client,args); }
java
{ "resource": "" }
q10818
snmpoption.get
train
public static snmpoption get(nitro_service service) throws Exception{ snmpoption obj = new snmpoption(); snmpoption[] response = (snmpoption[])obj.get_resources(service); return response[0]; }
java
{ "resource": "" }
q10819
lbvserver_filterpolicy_binding.get
train
public static lbvserver_filterpolicy_binding[] get(nitro_service service, String name) throws Exception{ lbvserver_filterpolicy_binding obj = new lbvserver_filterpolicy_binding(); obj.set_name(name); lbvserver_filterpolicy_binding response[] = (lbvserver_filterpolicy_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q10820
Redwood.removeHandler
train
protected static <E extends LogRecordHandler> boolean removeHandler(Class<E> toRemove) { boolean rtn = false; Iterator<LogRecordHandler> iter = handlers.iterator(); while(iter.hasNext()){ if(iter.next().getClass().equals(toRemove)){ rtn = true; iter.remove(); } } return rtn; }
java
{ "resource": "" }
q10821
Redwood.appendHandler
train
protected static void appendHandler(LogRecordHandler parent, LogRecordHandler child){ RecordHandlerTree p = handlers.find(parent); if(p != null){ p.addChild(child); } else { throw new IllegalArgumentException("No such parent handler: " + parent); } }
java
{ "resource": "" }
q10822
Redwood.appendHandler
train
protected static void appendHandler(Class<? extends LogRecordHandler> parent, LogRecordHandler child){ List<LogRecordHandler> toAdd = new LinkedList<LogRecordHandler>(); //--Find Parents for(LogRecordHandler term : handlers){ if(parent.isAssignableFrom(term.getClass())){ toAdd.add(term); } } //--Add Handler for(LogRecordHandler p : toAdd){ appendHandler(p, child); } }
java
{ "resource": "" }
q10823
Redwood.getHandler
train
@Deprecated @SuppressWarnings("unchecked") private static <E extends LogRecordHandler> E getHandler(Class<E> clazz){ for(LogRecordHandler cand : handlers){ if(clazz == cand.getClass()){ return (E) cand; } } return null; }
java
{ "resource": "" }
q10824
Redwood.captureSystemStreams
train
protected static void captureSystemStreams(boolean captureOut, boolean captureErr){ if(captureOut){ System.setOut(new RedwoodPrintStream(STDOUT, realSysOut)); } if(captureErr){ System.setErr(new RedwoodPrintStream(STDERR, realSysErr)); } }
java
{ "resource": "" }
q10825
Redwood.startTrack
train
public static void startTrack(final Object... args){ if(isClosed){ return; } //--Create Record final int len = args.length == 0 ? 0 : args.length-1; final Object content = args.length == 0 ? "" : args[len]; final Object[] tags = new Object[len]; final StackTraceElement ste = getStackTrace(); final long timestamp = System.currentTimeMillis(); System.arraycopy(args,0,tags,0,len); //--Create Task final long threadID = Thread.currentThread().getId(); final Runnable startTrack = new Runnable(){ public void run(){ assert !isThreaded || control.isHeldByCurrentThread(); Record toPass = new Record(content,tags,depth,ste,timestamp); depth += 1; titleStack.push(args.length == 0 ? "" : args[len].toString()); handlers.process(toPass, MessageType.START_TRACK, depth, toPass.timesstamp); assert !isThreaded || control.isHeldByCurrentThread(); } }; //--Run Task if(isThreaded){ //(case: multithreaded) long threadId = Thread.currentThread().getId(); attemptThreadControl( threadId, startTrack ); } else { //(case: no threading) startTrack.run(); } }
java
{ "resource": "" }
q10826
Redwood.endTrack
train
public static void endTrack(final String title){ if(isClosed){ return; } //--Make Task final long timestamp = System.currentTimeMillis(); Runnable endTrack = new Runnable(){ public void run(){ assert !isThreaded || control.isHeldByCurrentThread(); //(check name match) String expected = titleStack.pop(); if(!expected.equalsIgnoreCase(title)){ throw new IllegalArgumentException("Track names do not match: expected: " + expected + " found: " + title); } //(decrement depth) depth -= 1; //(send signal) handlers.process(null, MessageType.END_TRACK, depth, timestamp); assert !isThreaded || control.isHeldByCurrentThread(); } }; //--Run Task if(isThreaded){ //(case: multithreaded) long threadId = Thread.currentThread().getId(); attemptThreadControl( threadId, endTrack ); } else { //(case: no threading) endTrack.run(); } }
java
{ "resource": "" }
q10827
Redwood.finishThread
train
public static void finishThread(){ //--Create Task final long threadId = Thread.currentThread().getId(); Runnable finish = new Runnable(){ public void run(){ releaseThreadControl(threadId); } }; //--Run Task if(isThreaded){ //(case: multithreaded) attemptThreadControl( threadId, finish ); } else { //(case: no threading) throw new IllegalStateException("finishThreads() called outside of threaded environment"); } }
java
{ "resource": "" }
q10828
Redwood.endThreads
train
public static void endThreads(String check){ //(error check) if(currentThread != -1L){ throw new IllegalStateException("endThreads() called, but thread " + currentThread + " has not finished (exception in thread?)"); } //(end threaded environment) assert !control.isHeldByCurrentThread(); isThreaded = false; //(write remaining threads) boolean cleanPass = false; while(!cleanPass){ cleanPass = true; for(long thread : threadedLogQueue.keySet()){ assert currentThread < 0L; if(threadedLogQueue.get(thread) != null && !threadedLogQueue.get(thread).isEmpty()){ //(mark queue as unclean) cleanPass = false; //(variables) Queue<Runnable> backlog = threadedLogQueue.get(thread); currentThread = thread; //(clear buffer) while(currentThread >= 0){ if(currentThread != thread){ throw new IllegalStateException("Redwood control shifted away from flushing thread"); } if(backlog.isEmpty()){ throw new IllegalStateException("Forgot to call finishThread() on thread " + currentThread); } assert !control.isHeldByCurrentThread(); backlog.poll().run(); } //(unregister thread) threadsWaiting.remove(thread); } } } while(threadsWaiting.size() > 0){ assert currentThread < 0L; assert control.tryLock(); assert !threadsWaiting.isEmpty(); control.lock(); attemptThreadControlThreadsafe(-1); control.unlock(); } //(clean up) for(long threadId : threadedLogQueue.keySet()){ assert threadedLogQueue.get(threadId).isEmpty(); } assert threadsWaiting.isEmpty(); assert currentThread == -1L; endTrack("Threads( "+check+" )"); }
java
{ "resource": "" }
q10829
Redwood.showOnlyChannels
train
public static void showOnlyChannels(Object... channels){ for(LogRecordHandler handler : handlers){ if(handler instanceof VisibilityHandler){ VisibilityHandler visHandler = (VisibilityHandler) handler; visHandler.hideAll(); for (Object channel : channels) { visHandler.alsoShow(channel); } } } }
java
{ "resource": "" }
q10830
Redwood.hideOnlyChannels
train
public static void hideOnlyChannels(Object... channels){ for(LogRecordHandler handler : handlers){ if(handler instanceof VisibilityHandler){ VisibilityHandler visHandler = (VisibilityHandler) handler; visHandler.showAll(); for (Object channel : channels) { visHandler.alsoHide(channel); } } } }
java
{ "resource": "" }
q10831
Redwood.showChannels
train
public static void showChannels(Object... channels){ // TODO this could share more code with the other show/hide(Only)Channels methods for(LogRecordHandler handler : handlers){ if(handler instanceof VisibilityHandler){ VisibilityHandler visHandler = (VisibilityHandler) handler; for (Object channel : channels) { visHandler.alsoShow(channel); } } } }
java
{ "resource": "" }
q10832
Redwood.hideChannels
train
public static void hideChannels(Object... channels){ // TODO this could share more code with the other show/hide(Only)Channels methods for(LogRecordHandler handler : handlers){ if(handler instanceof VisibilityHandler){ VisibilityHandler visHandler = (VisibilityHandler) handler; for (Object channel : channels) { visHandler.alsoHide(channel); } } } }
java
{ "resource": "" }
q10833
Redwood.stop
train
public static void stop(){ //--Close logger isClosed = true; // <- not a thread-safe boolean Thread.yield(); //poor man's synchronization attempt (let everything else log that wants to) Thread.yield(); //--Close Tracks while(depth > 0){ depth -= 1; //(send signal to handlers) handlers.process(null, MessageType.END_TRACK, depth, System.currentTimeMillis()); } //--Shutdown handlers.process(null, MessageType.SHUTDOWN, 0, System.currentTimeMillis()); }
java
{ "resource": "" }
q10834
Redwood.getStackTrace
train
private static StackTraceElement getStackTrace() { StackTraceElement[] stack = Thread.currentThread().getStackTrace(); int i = 2; // we can skip the first two (first is getStackTrace(), second is this method) while (i < stack.length) { boolean isLoggingClass = false; for (String loggingClass : loggingClasses) { String className = stack[i].getClassName(); if (className.startsWith(loggingClass)) { isLoggingClass = true; break; } } if (!isLoggingClass) { break; } i += 1; } // if we didn't find anything, keep last element (probably shouldn't happen, but could if people add too many logging classes) if (i >= stack.length) { i = stack.length - 1; } return stack[i]; }
java
{ "resource": "" }
q10835
Redwood.filterStackTrace
train
protected static List<StackTraceElement> filterStackTrace(StackTraceElement[] stack) { List<StackTraceElement> filteredStack = new ArrayList<StackTraceElement>(); int i = 2; // we can skip the first two (first is getStackTrace(), second is this method) while (i < stack.length) { boolean isLoggingClass = false; for (String loggingClass : loggingClasses) { String className = stack[i].getClassName(); if (className.startsWith(loggingClass)) { isLoggingClass = true; break; } } if (!isLoggingClass) { filteredStack.add(stack[i]); } i += 1; } // if we didn't find anything, keep the full stack if (filteredStack.size() == 0) { return Arrays.asList(stack); } return filteredStack; }
java
{ "resource": "" }
q10836
ipset.add
train
public static base_response add(nitro_service client, ipset resource) throws Exception { ipset addresource = new ipset(); addresource.name = resource.name; addresource.td = resource.td; return addresource.add_resource(client); }
java
{ "resource": "" }
q10837
ipset.get
train
public static ipset[] get(nitro_service service) throws Exception{ ipset obj = new ipset(); ipset[] response = (ipset[])obj.get_resources(service); return response; }
java
{ "resource": "" }
q10838
ipset.get
train
public static ipset get(nitro_service service, String name) throws Exception{ ipset obj = new ipset(); obj.set_name(name); ipset response = (ipset) obj.get_resource(service); return response; }
java
{ "resource": "" }
q10839
appfwprofile_crosssitescripting_binding.get
train
public static appfwprofile_crosssitescripting_binding[] get(nitro_service service, String name) throws Exception{ appfwprofile_crosssitescripting_binding obj = new appfwprofile_crosssitescripting_binding(); obj.set_name(name); appfwprofile_crosssitescripting_binding response[] = (appfwprofile_crosssitescripting_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q10840
auditsyslogpolicy_aaauser_binding.get
train
public static auditsyslogpolicy_aaauser_binding[] get(nitro_service service, String name) throws Exception{ auditsyslogpolicy_aaauser_binding obj = new auditsyslogpolicy_aaauser_binding(); obj.set_name(name); auditsyslogpolicy_aaauser_binding response[] = (auditsyslogpolicy_aaauser_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q10841
autoscaleaction.add
train
public static base_response add(nitro_service client, autoscaleaction resource) throws Exception { autoscaleaction addresource = new autoscaleaction(); addresource.name = resource.name; addresource.type = resource.type; addresource.profilename = resource.profilename; addresource.parameters = resource.parameters; addresource.vmdestroygraceperiod = resource.vmdestroygraceperiod; addresource.quiettime = resource.quiettime; addresource.vserver = resource.vserver; return addresource.add_resource(client); }
java
{ "resource": "" }
q10842
autoscaleaction.add
train
public static base_responses add(nitro_service client, autoscaleaction resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { autoscaleaction addresources[] = new autoscaleaction[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new autoscaleaction(); addresources[i].name = resources[i].name; addresources[i].type = resources[i].type; addresources[i].profilename = resources[i].profilename; addresources[i].parameters = resources[i].parameters; addresources[i].vmdestroygraceperiod = resources[i].vmdestroygraceperiod; addresources[i].quiettime = resources[i].quiettime; addresources[i].vserver = resources[i].vserver; } result = add_bulk_request(client, addresources); } return result; }
java
{ "resource": "" }
q10843
autoscaleaction.update
train
public static base_response update(nitro_service client, autoscaleaction resource) throws Exception { autoscaleaction updateresource = new autoscaleaction(); updateresource.name = resource.name; updateresource.profilename = resource.profilename; updateresource.parameters = resource.parameters; updateresource.vmdestroygraceperiod = resource.vmdestroygraceperiod; updateresource.quiettime = resource.quiettime; updateresource.vserver = resource.vserver; return updateresource.update_resource(client); }
java
{ "resource": "" }
q10844
autoscaleaction.update
train
public static base_responses update(nitro_service client, autoscaleaction resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { autoscaleaction updateresources[] = new autoscaleaction[resources.length]; for (int i=0;i<resources.length;i++){ updateresources[i] = new autoscaleaction(); updateresources[i].name = resources[i].name; updateresources[i].profilename = resources[i].profilename; updateresources[i].parameters = resources[i].parameters; updateresources[i].vmdestroygraceperiod = resources[i].vmdestroygraceperiod; updateresources[i].quiettime = resources[i].quiettime; updateresources[i].vserver = resources[i].vserver; } result = update_bulk_request(client, updateresources); } return result; }
java
{ "resource": "" }
q10845
autoscaleaction.get
train
public static autoscaleaction[] get(nitro_service service) throws Exception{ autoscaleaction obj = new autoscaleaction(); autoscaleaction[] response = (autoscaleaction[])obj.get_resources(service); return response; }
java
{ "resource": "" }
q10846
autoscaleaction.get
train
public static autoscaleaction get(nitro_service service, String name) throws Exception{ autoscaleaction obj = new autoscaleaction(); obj.set_name(name); autoscaleaction response = (autoscaleaction) obj.get_resource(service); return response; }
java
{ "resource": "" }
q10847
sslvserver_sslcipher_binding.get
train
public static sslvserver_sslcipher_binding[] get(nitro_service service, String vservername) throws Exception{ sslvserver_sslcipher_binding obj = new sslvserver_sslcipher_binding(); obj.set_vservername(vservername); sslvserver_sslcipher_binding response[] = (sslvserver_sslcipher_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q10848
vpnglobal_authenticationsamlpolicy_binding.get
train
public static vpnglobal_authenticationsamlpolicy_binding[] get(nitro_service service) throws Exception{ vpnglobal_authenticationsamlpolicy_binding obj = new vpnglobal_authenticationsamlpolicy_binding(); vpnglobal_authenticationsamlpolicy_binding response[] = (vpnglobal_authenticationsamlpolicy_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q10849
nsacl6.add
train
public static base_response add(nitro_service client, nsacl6 resource) throws Exception { nsacl6 addresource = new nsacl6(); addresource.acl6name = resource.acl6name; addresource.acl6action = resource.acl6action; addresource.td = resource.td; addresource.srcipv6 = resource.srcipv6; addresource.srcipop = resource.srcipop; addresource.srcipv6val = resource.srcipv6val; addresource.srcport = resource.srcport; addresource.srcportop = resource.srcportop; addresource.srcportval = resource.srcportval; addresource.destipv6 = resource.destipv6; addresource.destipop = resource.destipop; addresource.destipv6val = resource.destipv6val; addresource.destport = resource.destport; addresource.destportop = resource.destportop; addresource.destportval = resource.destportval; addresource.ttl = resource.ttl; addresource.srcmac = resource.srcmac; addresource.protocol = resource.protocol; addresource.protocolnumber = resource.protocolnumber; addresource.vlan = resource.vlan; addresource.Interface = resource.Interface; addresource.established = resource.established; addresource.icmptype = resource.icmptype; addresource.icmpcode = resource.icmpcode; addresource.priority = resource.priority; addresource.state = resource.state; return addresource.add_resource(client); }
java
{ "resource": "" }
q10850
nsacl6.add
train
public static base_responses add(nitro_service client, nsacl6 resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { nsacl6 addresources[] = new nsacl6[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new nsacl6(); addresources[i].acl6name = resources[i].acl6name; addresources[i].acl6action = resources[i].acl6action; addresources[i].td = resources[i].td; addresources[i].srcipv6 = resources[i].srcipv6; addresources[i].srcipop = resources[i].srcipop; addresources[i].srcipv6val = resources[i].srcipv6val; addresources[i].srcport = resources[i].srcport; addresources[i].srcportop = resources[i].srcportop; addresources[i].srcportval = resources[i].srcportval; addresources[i].destipv6 = resources[i].destipv6; addresources[i].destipop = resources[i].destipop; addresources[i].destipv6val = resources[i].destipv6val; addresources[i].destport = resources[i].destport; addresources[i].destportop = resources[i].destportop; addresources[i].destportval = resources[i].destportval; addresources[i].ttl = resources[i].ttl; addresources[i].srcmac = resources[i].srcmac; addresources[i].protocol = resources[i].protocol; addresources[i].protocolnumber = resources[i].protocolnumber; addresources[i].vlan = resources[i].vlan; addresources[i].Interface = resources[i].Interface; addresources[i].established = resources[i].established; addresources[i].icmptype = resources[i].icmptype; addresources[i].icmpcode = resources[i].icmpcode; addresources[i].priority = resources[i].priority; addresources[i].state = resources[i].state; } result = add_bulk_request(client, addresources); } return result; }
java
{ "resource": "" }
q10851
nsacl6.delete
train
public static base_response delete(nitro_service client, String acl6name) throws Exception { nsacl6 deleteresource = new nsacl6(); deleteresource.acl6name = acl6name; return deleteresource.delete_resource(client); }
java
{ "resource": "" }
q10852
nsacl6.delete
train
public static base_responses delete(nitro_service client, String acl6name[]) throws Exception { base_responses result = null; if (acl6name != null && acl6name.length > 0) { nsacl6 deleteresources[] = new nsacl6[acl6name.length]; for (int i=0;i<acl6name.length;i++){ deleteresources[i] = new nsacl6(); deleteresources[i].acl6name = acl6name[i]; } result = delete_bulk_request(client, deleteresources); } return result; }
java
{ "resource": "" }
q10853
nsacl6.update
train
public static base_response update(nitro_service client, nsacl6 resource) throws Exception { nsacl6 updateresource = new nsacl6(); updateresource.acl6name = resource.acl6name; updateresource.aclaction = resource.aclaction; updateresource.srcipv6 = resource.srcipv6; updateresource.srcipop = resource.srcipop; updateresource.srcipv6val = resource.srcipv6val; updateresource.srcport = resource.srcport; updateresource.srcportop = resource.srcportop; updateresource.srcportval = resource.srcportval; updateresource.destipv6 = resource.destipv6; updateresource.destipop = resource.destipop; updateresource.destipv6val = resource.destipv6val; updateresource.destport = resource.destport; updateresource.destportop = resource.destportop; updateresource.destportval = resource.destportval; updateresource.srcmac = resource.srcmac; updateresource.protocol = resource.protocol; updateresource.protocolnumber = resource.protocolnumber; updateresource.icmptype = resource.icmptype; updateresource.icmpcode = resource.icmpcode; updateresource.vlan = resource.vlan; updateresource.Interface = resource.Interface; updateresource.priority = resource.priority; updateresource.established = resource.established; return updateresource.update_resource(client); }
java
{ "resource": "" }
q10854
nsacl6.update
train
public static base_responses update(nitro_service client, nsacl6 resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { nsacl6 updateresources[] = new nsacl6[resources.length]; for (int i=0;i<resources.length;i++){ updateresources[i] = new nsacl6(); updateresources[i].acl6name = resources[i].acl6name; updateresources[i].aclaction = resources[i].aclaction; updateresources[i].srcipv6 = resources[i].srcipv6; updateresources[i].srcipop = resources[i].srcipop; updateresources[i].srcipv6val = resources[i].srcipv6val; updateresources[i].srcport = resources[i].srcport; updateresources[i].srcportop = resources[i].srcportop; updateresources[i].srcportval = resources[i].srcportval; updateresources[i].destipv6 = resources[i].destipv6; updateresources[i].destipop = resources[i].destipop; updateresources[i].destipv6val = resources[i].destipv6val; updateresources[i].destport = resources[i].destport; updateresources[i].destportop = resources[i].destportop; updateresources[i].destportval = resources[i].destportval; updateresources[i].srcmac = resources[i].srcmac; updateresources[i].protocol = resources[i].protocol; updateresources[i].protocolnumber = resources[i].protocolnumber; updateresources[i].icmptype = resources[i].icmptype; updateresources[i].icmpcode = resources[i].icmpcode; updateresources[i].vlan = resources[i].vlan; updateresources[i].Interface = resources[i].Interface; updateresources[i].priority = resources[i].priority; updateresources[i].established = resources[i].established; } result = update_bulk_request(client, updateresources); } return result; }
java
{ "resource": "" }
q10855
nsacl6.unset
train
public static base_response unset(nitro_service client, nsacl6 resource, String[] args) throws Exception{ nsacl6 unsetresource = new nsacl6(); unsetresource.acl6name = resource.acl6name; return unsetresource.unset_resource(client,args); }
java
{ "resource": "" }
q10856
nsacl6.unset
train
public static base_responses unset(nitro_service client, String acl6name[], String args[]) throws Exception { base_responses result = null; if (acl6name != null && acl6name.length > 0) { nsacl6 unsetresources[] = new nsacl6[acl6name.length]; for (int i=0;i<acl6name.length;i++){ unsetresources[i] = new nsacl6(); unsetresources[i].acl6name = acl6name[i]; } result = unset_bulk_request(client, unsetresources,args); } return result; }
java
{ "resource": "" }
q10857
nsacl6.enable
train
public static base_response enable(nitro_service client, String acl6name) throws Exception { nsacl6 enableresource = new nsacl6(); enableresource.acl6name = acl6name; return enableresource.perform_operation(client,"enable"); }
java
{ "resource": "" }
q10858
nsacl6.enable
train
public static base_responses enable(nitro_service client, String acl6name[]) throws Exception { base_responses result = null; if (acl6name != null && acl6name.length > 0) { nsacl6 enableresources[] = new nsacl6[acl6name.length]; for (int i=0;i<acl6name.length;i++){ enableresources[i] = new nsacl6(); enableresources[i].acl6name = acl6name[i]; } result = perform_operation_bulk_request(client, enableresources,"enable"); } return result; }
java
{ "resource": "" }
q10859
nsacl6.disable
train
public static base_response disable(nitro_service client, nsacl6 resource) throws Exception { nsacl6 disableresource = new nsacl6(); disableresource.acl6name = resource.acl6name; return disableresource.perform_operation(client,"disable"); }
java
{ "resource": "" }
q10860
nsacl6.disable
train
public static base_responses disable(nitro_service client, String acl6name[]) throws Exception { base_responses result = null; if (acl6name != null && acl6name.length > 0) { nsacl6 disableresources[] = new nsacl6[acl6name.length]; for (int i=0;i<acl6name.length;i++){ disableresources[i] = new nsacl6(); disableresources[i].acl6name = acl6name[i]; } result = perform_operation_bulk_request(client, disableresources,"disable"); } return result; }
java
{ "resource": "" }
q10861
nsacl6.rename
train
public static base_response rename(nitro_service client, nsacl6 resource, String new_acl6name) throws Exception { nsacl6 renameresource = new nsacl6(); renameresource.acl6name = resource.acl6name; return renameresource.rename_resource(client,new_acl6name); }
java
{ "resource": "" }
q10862
nsacl6.get
train
public static nsacl6[] get(nitro_service service) throws Exception{ nsacl6 obj = new nsacl6(); nsacl6[] response = (nsacl6[])obj.get_resources(service); return response; }
java
{ "resource": "" }
q10863
nsacl6.get
train
public static nsacl6 get(nitro_service service, String acl6name) throws Exception{ nsacl6 obj = new nsacl6(); obj.set_acl6name(acl6name); nsacl6 response = (nsacl6) obj.get_resource(service); return response; }
java
{ "resource": "" }
q10864
nsacl6.get
train
public static nsacl6[] get(nitro_service service, String acl6name[]) throws Exception{ if (acl6name !=null && acl6name.length>0) { nsacl6 response[] = new nsacl6[acl6name.length]; nsacl6 obj[] = new nsacl6[acl6name.length]; for (int i=0;i<acl6name.length;i++) { obj[i] = new nsacl6(); obj[i].set_acl6name(acl6name[i]); response[i] = (nsacl6) obj[i].get_resource(service); } return response; } return null; }
java
{ "resource": "" }
q10865
service_dospolicy_binding.get
train
public static service_dospolicy_binding[] get(nitro_service service, String name) throws Exception{ service_dospolicy_binding obj = new service_dospolicy_binding(); obj.set_name(name); service_dospolicy_binding response[] = (service_dospolicy_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q10866
appfwprofile_csrftag_binding.get
train
public static appfwprofile_csrftag_binding[] get(nitro_service service, String name) throws Exception{ appfwprofile_csrftag_binding obj = new appfwprofile_csrftag_binding(); obj.set_name(name); appfwprofile_csrftag_binding response[] = (appfwprofile_csrftag_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q10867
dnsview_binding.get
train
public static dnsview_binding get(nitro_service service, String viewname) throws Exception{ dnsview_binding obj = new dnsview_binding(); obj.set_viewname(viewname); dnsview_binding response = (dnsview_binding) obj.get_resource(service); return response; }
java
{ "resource": "" }
q10868
nsspparams.update
train
public static base_response update(nitro_service client, nsspparams resource) throws Exception { nsspparams updateresource = new nsspparams(); updateresource.basethreshold = resource.basethreshold; updateresource.throttle = resource.throttle; return updateresource.update_resource(client); }
java
{ "resource": "" }
q10869
nsspparams.unset
train
public static base_response unset(nitro_service client, nsspparams resource, String[] args) throws Exception{ nsspparams unsetresource = new nsspparams(); return unsetresource.unset_resource(client,args); }
java
{ "resource": "" }
q10870
nsspparams.get
train
public static nsspparams get(nitro_service service) throws Exception{ nsspparams obj = new nsspparams(); nsspparams[] response = (nsspparams[])obj.get_resources(service); return response[0]; }
java
{ "resource": "" }
q10871
CollectionUtils.asList
train
public static List<Integer> asList(int[] a) { List<Integer> result = new ArrayList<Integer>(a.length); for (int i = 0; i < a.length; i++) { result.add(Integer.valueOf(a[i])); } return result; }
java
{ "resource": "" }
q10872
CollectionUtils.makeList
train
public static <T> List<T> makeList(T... items) { List<T> s = new ArrayList<T>(items.length); for (int i = 0; i < items.length; i++) { s.add(items[i]); } return s; }
java
{ "resource": "" }
q10873
CollectionUtils.asSet
train
public static <T> Set<T> asSet(T[] o) { return new HashSet<T>(Arrays.asList(o)); }
java
{ "resource": "" }
q10874
CollectionUtils.diff
train
public static <T> Collection<T> diff(Collection<T> list1, Collection<T> list2) { Collection<T> diff = new ArrayList<T>(); for (T t : list1) { if (!list2.contains(t)) { diff.add(t); } } return diff; }
java
{ "resource": "" }
q10875
CollectionUtils.sampleWithoutReplacement
train
public static <E> Collection<E> sampleWithoutReplacement(Collection<E> c, int n) { return sampleWithoutReplacement(c, n, new Random()); }
java
{ "resource": "" }
q10876
CollectionUtils.sampleWithReplacement
train
public static <E> Collection<E> sampleWithReplacement(Collection<E> c, int n) { return sampleWithReplacement(c, n, new Random()); }
java
{ "resource": "" }
q10877
CollectionUtils.compareLists
train
public static <T extends Comparable<T>> int compareLists(List<T> list1, List<T> list2) { if (list1 == null && list2 == null) return 0; if (list1 == null || list2 == null) { throw new IllegalArgumentException(); } int size1 = list1.size(); int size2 = list2.size(); int size = Math.min(size1, size2); for (int i = 0; i < size; i++) { int c = list1.get(i).compareTo(list2.get(i)); if (c != 0) return c; } if (size1 < size2) return -1; if (size1 > size2) return 1; return 0; }
java
{ "resource": "" }
q10878
CollectionUtils.toList
train
public static <T> List<T> toList(Iterable<T> items) { List<T> list = new ArrayList<T>(); addAll(list, items); return list; }
java
{ "resource": "" }
q10879
CollectionUtils.toSet
train
public static <T> Set<T> toSet(Iterable<T> items) { Set<T> set = new HashSet<T>(); addAll(set, items); return set; }
java
{ "resource": "" }
q10880
CollectionUtils.addAll
train
public static <T> void addAll(Collection<T> collection, Iterable<? extends T> items) { for (T item : items) { collection.add(item); } }
java
{ "resource": "" }
q10881
CollectionUtils.getNGrams
train
public static <T> List<List<T>> getNGrams(List<T> items, int minSize, int maxSize) { List<List<T>> ngrams = new ArrayList<List<T>>(); int listSize = items.size(); for (int i = 0; i < listSize; ++i) { for (int ngramSize = minSize; ngramSize <= maxSize; ++ngramSize) { if (i + ngramSize <= listSize) { List<T> ngram = new ArrayList<T>(); for (int j = i; j < i + ngramSize; ++j) { ngram.add(items.get(j)); } ngrams.add(ngram); } } } return ngrams; }
java
{ "resource": "" }
q10882
CollectionUtils.flatten
train
public static <T> List<T> flatten(Collection<List<T>> nestedList) { List<T> result = new ArrayList<T>(); for (List<T> list : nestedList) { result.addAll(list); } return result; }
java
{ "resource": "" }
q10883
CollectionUtils.uniqueNonhashableObjects
train
public static <ObjType, Hashable> Collection<ObjType> uniqueNonhashableObjects(Collection<ObjType> objects, Function<ObjType, Hashable> customHasher) { Map<Hashable, ObjType> hashesToObjects = new HashMap<Hashable, ObjType>(); for (ObjType object : objects) { hashesToObjects.put(customHasher.apply(object), object); } return hashesToObjects.values(); }
java
{ "resource": "" }
q10884
CollectionUtils.containsAny
train
public static <T> boolean containsAny(Collection<T> collection, Collection<T> toCheck){ for(T c: toCheck){ if(collection.contains(c)) return true; } return false; }
java
{ "resource": "" }
q10885
CollectionUtils.mode
train
public static <T> T mode(Collection<T> values) { Set<T> modes = modes(values); return modes.iterator().next(); }
java
{ "resource": "" }
q10886
crvserver_binding.get
train
public static crvserver_binding get(nitro_service service, String name) throws Exception{ crvserver_binding obj = new crvserver_binding(); obj.set_name(name); crvserver_binding response = (crvserver_binding) obj.get_resource(service); return response; }
java
{ "resource": "" }
q10887
appfwprofile.restore
train
public static base_response restore(nitro_service client, appfwprofile resource) throws Exception { appfwprofile restoreresource = new appfwprofile(); restoreresource.archivename = resource.archivename; return restoreresource.perform_operation(client,"restore"); }
java
{ "resource": "" }
q10888
appfwprofile.restore
train
public static base_responses restore(nitro_service client, appfwprofile resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { appfwprofile restoreresources[] = new appfwprofile[resources.length]; for (int i=0;i<resources.length;i++){ restoreresources[i] = new appfwprofile(); restoreresources[i].archivename = resources[i].archivename; } result = perform_operation_bulk_request(client, restoreresources,"restore"); } return result; }
java
{ "resource": "" }
q10889
appfwprofile.get
train
public static appfwprofile[] get(nitro_service service) throws Exception{ appfwprofile obj = new appfwprofile(); appfwprofile[] response = (appfwprofile[])obj.get_resources(service); return response; }
java
{ "resource": "" }
q10890
appfwprofile.get
train
public static appfwprofile get(nitro_service service, String name) throws Exception{ appfwprofile obj = new appfwprofile(); obj.set_name(name); appfwprofile response = (appfwprofile) obj.get_resource(service); return response; }
java
{ "resource": "" }
q10891
route6.add
train
public static base_response add(nitro_service client, route6 resource) throws Exception { route6 addresource = new route6(); addresource.network = resource.network; addresource.gateway = resource.gateway; addresource.vlan = resource.vlan; addresource.weight = resource.weight; addresource.distance = resource.distance; addresource.cost = resource.cost; addresource.advertise = resource.advertise; addresource.msr = resource.msr; addresource.monitor = resource.monitor; addresource.td = resource.td; return addresource.add_resource(client); }
java
{ "resource": "" }
q10892
route6.add
train
public static base_responses add(nitro_service client, route6 resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { route6 addresources[] = new route6[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new route6(); addresources[i].network = resources[i].network; addresources[i].gateway = resources[i].gateway; addresources[i].vlan = resources[i].vlan; addresources[i].weight = resources[i].weight; addresources[i].distance = resources[i].distance; addresources[i].cost = resources[i].cost; addresources[i].advertise = resources[i].advertise; addresources[i].msr = resources[i].msr; addresources[i].monitor = resources[i].monitor; addresources[i].td = resources[i].td; } result = add_bulk_request(client, addresources); } return result; }
java
{ "resource": "" }
q10893
route6.clear
train
public static base_response clear(nitro_service client, route6 resource) throws Exception { route6 clearresource = new route6(); clearresource.routetype = resource.routetype; return clearresource.perform_operation(client,"clear"); }
java
{ "resource": "" }
q10894
route6.clear
train
public static base_responses clear(nitro_service client, route6 resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { route6 clearresources[] = new route6[resources.length]; for (int i=0;i<resources.length;i++){ clearresources[i] = new route6(); clearresources[i].routetype = resources[i].routetype; } result = perform_operation_bulk_request(client, clearresources,"clear"); } return result; }
java
{ "resource": "" }
q10895
route6.delete
train
public static base_response delete(nitro_service client, String network) throws Exception { route6 deleteresource = new route6(); deleteresource.network = network; return deleteresource.delete_resource(client); }
java
{ "resource": "" }
q10896
route6.delete
train
public static base_response delete(nitro_service client, route6 resource) throws Exception { route6 deleteresource = new route6(); deleteresource.network = resource.network; deleteresource.gateway = resource.gateway; deleteresource.vlan = resource.vlan; deleteresource.td = resource.td; return deleteresource.delete_resource(client); }
java
{ "resource": "" }
q10897
route6.delete
train
public static base_responses delete(nitro_service client, String network[]) throws Exception { base_responses result = null; if (network != null && network.length > 0) { route6 deleteresources[] = new route6[network.length]; for (int i=0;i<network.length;i++){ deleteresources[i] = new route6(); deleteresources[i].network = network[i]; } result = delete_bulk_request(client, deleteresources); } return result; }
java
{ "resource": "" }
q10898
route6.delete
train
public static base_responses delete(nitro_service client, route6 resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { route6 deleteresources[] = new route6[resources.length]; for (int i=0;i<resources.length;i++){ deleteresources[i] = new route6(); deleteresources[i].network = resources[i].network; deleteresources[i].gateway = resources[i].gateway; deleteresources[i].vlan = resources[i].vlan; deleteresources[i].td = resources[i].td; } result = delete_bulk_request(client, deleteresources); } return result; }
java
{ "resource": "" }
q10899
route6.update
train
public static base_response update(nitro_service client, route6 resource) throws Exception { route6 updateresource = new route6(); updateresource.network = resource.network; updateresource.gateway = resource.gateway; updateresource.vlan = resource.vlan; updateresource.weight = resource.weight; updateresource.distance = resource.distance; updateresource.cost = resource.cost; updateresource.advertise = resource.advertise; updateresource.msr = resource.msr; updateresource.monitor = resource.monitor; updateresource.td = resource.td; return updateresource.update_resource(client); }
java
{ "resource": "" }