language
stringclasses
2 values
func_code_string
stringlengths
63
466k
python
def extractall(self, directory, auto_create_dir=False, patool_path=None): ''' :param directory: directory to extract to :param auto_create_dir: auto create directory :param patool_path: the path to the patool backend ''' log.debug('extracting %s into %s (backend=%s)', sel...
java
public static base_responses update(nitro_service client, transformaction resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { transformaction updateresources[] = new transformaction[resources.length]; for (int i=0;i<resources.length;i++){ updatere...
python
def mkdir(self, req, parent, name, mode): """Create a directory Valid replies: reply_entry reply_err """ self.reply_err(req, errno.EROFS)
python
def get_objects_for_subject(subject=None, object_category=None, relation=None, **kwargs): """ Convenience method: Given a subject (e.g. gene, disease, variant), return all associated objects (phenotypes, functions, interacting g...
java
@Override public void setDate(int year, int month, int dayOfMonth) { this.setDate(new org.joda.time.LocalDate(year, month, dayOfMonth)); }
python
def __save_plots_of_the_current_page(self, section, page, output_path): """This method saves plots in the appropriate section folder. As a consequence two plots cannot have the same name within the same section.""" for key in self.sections[section].pages[page].elements.keys(): ...
java
@Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case AfplibPackage.GCHST__XPOS: return getXPOS(); case AfplibPackage.GCHST__YPOS: return getYPOS(); case AfplibPackage.GCHST__CP: return getCP(); } return super.eGet(featureID, resolve, core...
java
@Override public Map<String, Object> toSource() { Map<String, Object> sourceMap = new HashMap<>(); if (configId != null) { addFieldToSource(sourceMap, "configId", configId); } if (errorCount != null) { addFieldToSource(sourceMap, "errorCount", errorCount); ...
python
def upload_job_chunk_retreive(self, upload_job_id, chunk_id, **kwargs): # noqa: E501 """Get metadata about a chunk # noqa: E501 Get metadata about a chunk # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass asynchron...
python
def get_version(self, id=None, endpoint=None): """ Get the current version of the endpoint. Note: Not all endpoints currently implement this method Args: id: (int, optional) id to use for response tracking endpoint: (RPCEndpoint, optional) endpoint to specify to ...
python
def update_repository_method_acl(namespace, method, snapshot_id, acl_updates): """Set method permissions. The method should exist in the methods repository. Args: namespace (str): Methods namespace method (str): method name snapshot_id (int): snapshot_id of the method acl_u...
python
def get_colmin(data): """ Get rowwise column names with minimum values :param data: pandas dataframe """ data=data.T colmins=[] for col in data: colmins.append(data[col].idxmin()) return colmins
java
static BinaryString readBinaryStringFieldFromSegments( MemorySegment[] segments, int baseOffset, int fieldOffset, long variablePartOffsetAndLen) { long mark = variablePartOffsetAndLen & HIGHEST_FIRST_BIT; if (mark == 0) { final int subOffset = (int) (variablePartOffsetAndLen >> 32); final int len = (int...
java
public void marshall(PutConfigurationAggregatorRequest putConfigurationAggregatorRequest, ProtocolMarshaller protocolMarshaller) { if (putConfigurationAggregatorRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocol...
python
def rotate_clip(data_np, theta_deg, rotctr_x=None, rotctr_y=None, out=None, use_opencl=True, logger=None): """ Rotate numpy array `data_np` by `theta_deg` around rotation center (rotctr_x, rotctr_y). If the rotation center is omitted it defaults to the center of the array. No adjus...
python
def _dictproduct(rdict): ''' Yields a series of dicts that cover the combination of all multiple-value (e.g. lists or tuples) values, with non-multiple-value values remaining the same. ''' multkeys = [k for k, v in rdict.items() if isinstance(v, Iterable)] if not multkeys...
java
public static IMolecularFormula getMinimalFormula(MolecularFormulaRange mfRange, IChemObjectBuilder builder) { IMolecularFormula formula = builder.newInstance(IMolecularFormula.class); for (IIsotope isotope : mfRange.isotopes()) { formula.addIsotope(isotope, mfRange.getIsotopeCountMin(isoto...
python
def join(self): """ Wait for all current tasks to be finished """ self._jobs.join() try: return self._results, self._errors finally: self._clear()
python
def notify_height_changed(self): """ Called by a row when its height changes, triggering the graphic frame to recalculate its total height (as the sum of the row heights). """ new_table_height = sum([row.height for row in self.rows]) self._graphic_frame.height = new_table...
python
def restart(config, container, timeout=10, *args, **kwargs): ''' Restart a running container :type container: string :param container: The container id to restart :type timout: int :param timeout: Wait for a timeout to let the container exit gracefully before killing it :rtype: di...
java
@TargetApi(Build.VERSION_CODES.FROYO) public static boolean hasMicrophoneFeature(Context context) { return hasMicrophoneFeature(context.getPackageManager()); }
java
public CommonTokenStream lex(final String cleanedCobolSource) throws RecognizerException { if (_log.isDebugEnabled()) { _log.debug("2. Lexing COBOL source code: {}", cleanedCobolSource); } try { CobolStructureLexer lex = new CobolStructureLexerImpl( ...
python
def import_po_files(path='poexport', stdout=None): """ Import all the content updates from the po files into the pages. """ import polib from basic_cms.models import Page, Content source_language = settings.PAGE_DEFAULT_LANGUAGE source_list = [] pages_to_invalidate = [] for page ...
python
def post_headline(self, name, level, message): """Asynchronously update the sticky headline for a service. Args: name (string): The name of the service level (int): A message level in states.*_LEVEL message (string): The user facing error message that will be stored ...
java
protected void attemptRedirect(final Request request, final Response response, final Form form) { this.log.debug("redirectQueryName: {}", this.getRedirectQueryName()); this.log.debug("query: {}", request.getResourceRef().getQueryAsForm()); //this.log.info("form: {}", form); ...
python
def read_int_option (self, section, option, key=None, min=None, max=None): """Read an integer option.""" if self.has_option(section, option): num = self.getint(section, option) if min is not None and num < min: raise LinkCheckerError( _("invali...
java
public static MutableSymbolTable readStringMap(ObjectInput in) throws IOException, ClassNotFoundException { int mapSize = in.readInt(); MutableSymbolTable syms = new MutableSymbolTable(); for (int i = 0; i < mapSize; i++) { String sym = in.readUTF(); int index = in.readInt(); syms.p...
java
public static Query fromProto(@Nonnull ReadRowsRequest request) { Preconditions.checkArgument(request != null, "ReadRowsRequest must not be null"); Query query = new Query(NameUtil.extractTableIdFromTableName(request.getTableName())); query.builder = request.toBuilder(); return query; }
java
private int getDecreasesEdges(Collection<KamEdge> edges) { int count = 0; for (KamEdge edge : edges) { if (edge.getRelationshipType() == RelationshipType.DECREASES || edge.getRelationshipType() == RelationshipType.DIRECTLY_DECREASES) { count++; ...
python
def restore(self, url): """Restore the remote database from the URL of a backup.""" self._run( [ "heroku", "pg:backups:restore", "{}".format(url), "DATABASE_URL", "--app", self.name, ...
java
@Override public void writeNumber(Number num) { writeAMF3(); if (num.longValue() < AMF3.MIN_INTEGER_VALUE || num.longValue() > AMF3.MAX_INTEGER_VALUE) { // out of range for integer encoding buf.put(AMF3.TYPE_NUMBER); buf.putDouble(num.doubleValue()); ...
python
def is_valid_pred_string(predstr): """ Return `True` if *predstr* is a valid predicate string. Examples: >>> is_valid_pred_string('"_dog_n_1_rel"') True >>> is_valid_pred_string('_dog_n_1') True >>> is_valid_pred_string('_dog_noun_1') False >>> is_val...
java
public int addAgent(float[] pos, CrowdAgentParams params) { // Find empty slot. int idx = -1; for (int i = 0; i < m_maxAgents; ++i) { if (!m_agents[i].active) { idx = i; break; } } if (idx == -1) { return -1; ...
python
def quant(val, u=Ellipsis): ''' quant(scalar) yields a dimensionless quantity with the magnitude given by scalar. quant(q) yields q for any quantity q; if q is not part of the pimms units registry, then a version of q registered to pimms.units is yielded. Note that q is a quantity if pimms.is_qu...
java
public boolean deleteEntityGroup(EntityGroup entityGroup) { String entityGroupName = entityGroup.getName(); checkEntityGroupIsEmpty(entityGroupName); QueryPart<EntityGroup> query = new Query<EntityGroup>("entity-groups") .path(entityGroupName, true); return httpClientMana...
java
public void execute(Runnable job) { try { executor.execute(job); } catch (RejectedExecutionException e) { log.warnf(e, "Job rejected: %s", job); } }
java
public static boolean verify( Signature signatureAlgorithm, PublicKey publicKey, byte[] signatureBytes, byte[] contentBytes) throws InvalidKeyException, SignatureException { signatureAlgorithm.initVerify(publicKey); signatureAlgorithm.update(contentBytes); // SignatureException may be thrown if ...
java
private AmazonEC2 getEC2Service() { String aWSAccessId = serverConfig.getAWSAccessId(); String aWSSecretKey = serverConfig.getAWSSecretKey(); AmazonEC2 ec2Service; if (null != aWSAccessId && !"".equals(aWSAccessId) && null != aWSSecretKey && !"".equals(aWSSecretKey)) { ...
java
public static Class getTypeClass( Object obj ) { if( isNull( obj ) ){ return Object.class; }else if( isArray( obj ) ){ return List.class; }else if( isFunction( obj ) ){ return JSONFunction.class; }else if( isBoolean( obj ) ){ return Boolean.class; }else ...
java
public synchronized Future<Message> setExpectation(final C condition, final MessageAction<P> action) { if (this.isStopped()) { throw new IllegalStateException("Already stopped."); } final AbstractExpectation<C, P> expectation = this.createExpectation(condition, action); final...
java
protected boolean isUpdateAvailable() { boolean result = false; String version = EMPTY_VERSION; try { version = retrieveRemoteVersion(store.getVersionUrl(), store.getCharset()); } catch (final IOException e) { LOG.info(MSG_NO_UPDATE_CHECK_POSSIBLE); LOG.debug(String.format(MSG_NO_UPDATE_CHECK_POSSIBLE_...
python
def backend(self): """Returns the backend class""" from indico_livesync.plugin import LiveSyncPlugin return LiveSyncPlugin.instance.backend_classes.get(self.backend_name)
java
final PublishResponse publish(String topic, List<PubsubMessage> messages) { PublishRequest request = PublishRequest.newBuilder().setTopic(topic).addAllMessages(messages).build(); return publish(request); }
java
public Content throwsTagOutput(TypeMirror throwsType) { HtmlTree result = HtmlTree.DD(HtmlTree.CODE(htmlWriter.getLink( new LinkInfoImpl(configuration, LinkInfoImpl.Kind.MEMBER, throwsType)))); return result; }
python
def write_mesh(fname, vertices, faces, normals, texcoords, name='', format='obj', overwrite=False, reshape_faces=True): """ Write mesh data to file. Parameters ---------- fname : str Filename to write. Must end with ".obj" or ".gz". vertices : array Vertices. face...
java
public void setEps(double eps) { if(Double.isNaN(eps) || eps < 0 || Double.isInfinite(eps)) throw new IllegalArgumentException("eps must be non-negative, not "+eps); this.eps = eps; }
python
def add_group(self, number, name, led_type): """ Add a group. :param number: Group number (1-4). :param name: Group name. :param led_type: Either `RGBW`, `WRGB`, `RGBWW`, `WHITE`, `DIMMER` or `BRIDGE_LED`. :returns: Added group. """ group = group_factory(self, nu...
python
def normal_cdf(x, mu=0, sigma=1): """Cumulative Normal Distribution Function. :param x: scalar or array of real numbers. :type x: numpy.ndarray, float :param mu: Mean value. Default 0. :type mu: float, numpy.ndarray :param sigma: Standard deviation. Default 1. :type sigma: float :ret...
python
def radintpix(data, dataerr, bcx, bcy, mask=None, pix=None, returnavgpix=False, phi0=0, dphi=0, returnmask=False, symmetric_sector=False, doslice=False, errorpropagation=2, autoqrange_linear=True): """Radial integration (averaging) on the detector plane Inputs: data: scatter...
python
def set_attribute_label(series, resource_labels, attribute_key, canonical_key=None, label_value_prefix=''): """Set a label to timeseries that can be used for monitoring :param series: TimeSeries object based on view data :param resource_labels: collection of labels :param attribu...
python
def pad(data, length): """This function returns a padded version of the input data to the given length. this function will shorten the given data to the length specified if necessary. post-condition: len(data) = length :param data: the data byte array to pad :param length: the...
python
def get_ingredients(self): """Get a list of ingredients for guacamole.""" return [ cmdtree.CommandTreeBuilder(self.command), cmdtree.CommandTreeDispatcher(), argparse.AutocompleteIngredient(), argparse.ParserIngredient(), crash.VerboseCrashHand...
java
@Override public InstrumentationDeferredFieldParameters withNewState(InstrumentationState instrumentationState) { return new InstrumentationDeferredFieldParameters( this.getExecutionContext(), this.executionStrategyParameters, this.getField(), this.getExecutionStepInfo(), instrumentationStat...
python
def update_inverse(self): """ Recomputes W_k_inv and R_k given the current column selection When computed, the block matrix inverse W_k_inv will be updated. This is useful when you want to compute eigenvalues or get an approximation for the full matrix or individual columns. Calling thi...
python
def next_unwrittable_on_col(view, coords): """Return position of the next letter (in column) that is unwrittable""" x, y = coords maxy = max(view.keys(), key=itemgetter(1))[1] for offset in range(y + 1, maxy): letter = view[x, offset] if letter not in REWRITABLE_LETTERS: retu...
java
public <T> AioServer setOption(SocketOption<T> name, T value) throws IOException { this.channel.setOption(name, value); return this; }
python
def add_message(self, request, level, message_template, message_context=None, extra_tags=''): """ Wrapper of `django.contrib.messages.add_message`, that reads the message text from a template. """ if 'django.contrib.messages' in settings.INSTALLED_APPS: ...
python
def physical_separation_crossmatch_against_catalogue( self, objectList, searchPara, search_name, brightnessFilter=False, classificationType=False ): """*perform an physical separation crossmatch against a given catalogue in the database* This search i...
python
def _set_ldp_peer_state(self, v, load=False): """ Setter method for ldp_peer_state, mapped from YANG variable /brocade_mpls_rpc/show_mpls_ldp_peer_det_rec/output/ldp_peer_state (ldp-state-name) If this variable is read-only (config: false) in the source YANG file, then _set_ldp_peer_state is considered ...
java
public <V> void waitUntil(Sampler<V> variable, Matcher<? super V> criteria) { waitUntil(variable, eventually(), criteria); }
java
public static void checkForDuplicateNames( Map<String, Boolean> isDuplicateName, Cursor cursor, int nameIndex) { isDuplicateName.clear(); cursor.moveToPosition(-1); while (cursor.moveToNext()) { String displayName = cursor.getString(nameIndex); // Set it to tr...
java
@Nullable private static View getEmptyView(@Nullable View rootView) { if (rootView == null) { throw new RuntimeException("A null rootView was passed to getEmptyView, but Hits/RefinementList require one."); } return rootView.findViewById(android.R.id.empty); }
python
def firewall_policy_insert_rule(self, firewall_policy, body=None): """Inserts specified rule into firewall policy.""" return self.put(self.firewall_policy_insert_path % (firewall_policy), body=body)
python
def unsubscribe_rpc(self, service, mask, value): '''Remove a rpc subscription :param service: the service of the subscription to remove :type service: anything hash-able :param mask: the mask of the subscription to remove :type mask: int :param value: the value in the su...
python
def singleton(the_class): """ Decorator for a class to make a singleton out of it. @type the_class: class @param the_class: the class that should work as a singleton @rtype: decorator @return: decorator """ class_instances = {} def get_instance(*args, **kwargs): """ ...
java
private void createJmsTemplate() { Assert.isTrue(this.connectionFactory != null, "Neither 'jmsTemplate' nor 'connectionFactory' is set correctly."); jmsTemplate = new JmsTemplate(); jmsTemplate.setConnectionFactory(this.connectionFactory); if (this.destination != null)...
java
public long getSaving(Configuration conf) { try { DFSClient dfs = ((DistributedFileSystem)FileSystem.get(conf)).getClient(); Counters raidedCounters = stateToSourceCounters.get(RaidState.RAIDED); long physical = raidedCounters.getNumBytes() + parityCounters.getNumBytes(); long logi...
python
def calc_2d_ellipse_properties(cov,nstd=2): """Calculate the properties for 2d ellipse given the covariance matrix.""" def eigsorted(cov): vals, vecs = np.linalg.eigh(cov) order = vals.argsort()[::-1] return vals[order], vecs[:,order] vals, vecs = eigsorted(cov) width, height = ...
java
public void setLocations(java.util.Collection<Location> locations) { if (locations == null) { this.locations = null; return; } this.locations = new com.amazonaws.internal.SdkInternalList<Location>(locations); }
python
def _GetZeepFormattedSOAPHeaders(self): """Returns a dict with SOAP headers in the right format for zeep.""" headers = self._header_handler.GetSOAPHeaders(self.CreateSoapElementForType) soap_headers = {'RequestHeader': headers} return soap_headers
java
public void setObjectLabel(String v) { if (TextObject_Type.featOkTst && ((TextObject_Type)jcasType).casFeat_objectLabel == null) jcasType.jcas.throwFeatMissing("objectLabel", "de.julielab.jules.types.TextObject"); jcasType.ll_cas.ll_setStringValue(addr, ((TextObject_Type)jcasType).casFeatCode_objectLabel,...
python
def find_value_at_cursor(ast_tree, filename, line, col, root_env=gcl.default_env): """Find the value of the object under the cursor.""" q = gcl.SourceQuery(filename, line, col) rootpath = ast_tree.find_tokens(q) rootpath = path_until(rootpath, is_thunk) if len(rootpath) <= 1: # Just the file tuple itself...
java
public void endConnection(SuroConnection connection) { if (connection != null && shouldChangeConnection(connection)) { connection.initStat(); connectionPool.put(connection.getServer(), connection); connection = chooseFromPool(); } if (connection != null) { ...
python
def _find_address_range(addresses): """Find a sequence of addresses. Args: addresses: a list of IPv4 or IPv6 addresses. Returns: A tuple containing the first and last IP addresses in the sequence, and the index of the last IP address in the sequence. """ first = last = add...
python
def scan(self, restrict): """ Should scan another token and add it to the list, self.tokens, and add the restriction to self.restrictions """ # Keep looking for a token, ignoring any in self.ignore while True: # Search the patterns for a match, with earlier ...
java
@Deprecated public C expect(int allowedStatements, Query query) { return expect(SqlQueries.exactQueries(allowedStatements).type(adapter(query))); }
python
def generate_folder_names(name, project): """Creates sensible folder names.""" out_data_dir = prms.Paths.outdatadir project_dir = os.path.join(out_data_dir, project) batch_dir = os.path.join(project_dir, name) raw_dir = os.path.join(batch_dir, "raw_data") return out_data_dir, project_dir, batch...
python
def set_video_stream_param(self, streamtype, resolution, bitrate, framerate, gop, isvbr, callback=None): ''' Set the video stream param of stream N streamtype(0~3): Stream N. resolution(0~4): 0 720P, 1 VGA(640*480), 2 VGA(640*...
java
void sendMessage(IMessage message) throws IOException, AvpDataException, NotInitializedException, ParseException { if (!isConnected()) { throw new IOException("Failed to send message over [" + socketDescription + "]"); } //switch to wait for SSL handshake to workout. if (!isExchangeAllowe...
java
public String toHexString() { final StringBuffer sb = new StringBuffer(); for (final byte b : this.bytes) { sb.append(Integer.toHexString(b & 0xFF)); } return sb.substring(0, Math.min(this.bitLength / 4, sb.length())); }
python
def get_key_by_value(dictionary, search_value): """ searchs a value in a dicionary and returns the key of the first occurrence :param dictionary: dictionary to search in :param search_value: value to search for """ for key, value in dictionary.iteritems(): if value == search_value: ...
python
def Serialize(self, writer): """ Serialize full object. Args: writer (neo.IO.BinaryWriter): """ self.SerializeUnsigned(writer) writer.WriteByte(1) self.Script.Serialize(writer)
java
private MapReduceCommand parseMapReduceCommand(String jsonClause) { String collectionName = jsonClause.replaceFirst("(?ms).*?\\.\\s*(.+?)\\s*\\.\\s*mapReduce\\s*\\(.*", "$1"); if (collectionName.contains("getCollection")) { collectionName = collectionName .rep...
java
public OvhNicAutorenewInfos autorenew_GET() throws IOException { String qPath = "/me/autorenew"; StringBuilder sb = path(qPath); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhNicAutorenewInfos.class); }
python
def createContactItem(self, person, notes): """ Create a new L{Notes} associated with the given person based on the given string. @type person: L{Person} @param person: The person with whom to associate the new L{Notes}. @type notes: C{unicode} @param notes: The...
python
def make_dir(dir_name, linux_mode=0o755, error_if_not_writable=False): """ Creates a directory, if it doesn't exist already. If the directory does exist, and <error_if_not_writable> is True, the directory will be checked for writability. :param str|unicode dir_name: The name of the directory to create ...
python
def pop_group(self): """Terminates the redirection begun by a call to :meth:`push_group` or :meth:`push_group_with_content` and returns a new pattern containing the results of all drawing operations performed to the group. The :meth:`pop_group` method calls :meth:`restore`, ...
python
def _idle_register_view(self, view): """Internal method that calls register_view""" assert(self.view is None) self.view = view if self.handlers == "class": for name in dir(self): when, _, what = partition(name, '_') widget, _, signal = partiti...
python
def _assemble_and_send_request(self): """ Fires off the Fedex request. @warning: NEVER CALL THIS METHOD DIRECTLY. CALL send_request(), WHICH RESIDES ON FedexBaseService AND IS INHERITED. """ # We get an exception like this when specifying an IntegratorId: ...
python
def requestJoinDetails(self): """add configuration information to the SC2 protocol join request REQUIREMENTS FOR SUCCESSFUL LAUNCH: server game_port must match between all join requests to client (represents the host's port to sync game clients) server base_port client game_port must be unique b...
java
protected final Date getExpiration(RenderRequest renderRequest) { // Expiration of the JWT final PortletSession portletSession = renderRequest.getPortletSession(); final Date rslt = new Date( portletSession.getLastAccessedTime() ...
java
public int compareTo(Object obj) { LdapRdnComponent that = (LdapRdnComponent) obj; // It's safe to compare directly against key and value, // because they are validated not to be null on instance creation. int keyCompare = this.key.toLowerCase().compareTo(that.key.toLowerCase()); if(k...
java
private static CharArraySet getDefaultStopwords(String language) { switch (language) { case "English": return EnglishAnalyzer.getDefaultStopSet(); case "French": return FrenchAnalyzer.getDefaultStopSet(); case "Spanish": return ...
python
def get_static_field(classname, fieldname, signature): """ Returns the Java object associated with the static field of the specified class. :param classname: the classname of the class to get the field from :type classname: str :param fieldname: the name of the field to retriev :type fieldname:...
python
def next_offsets(self): # type: (Descriptor) -> Offsets """Retrieve the next offsets :param Descriptor self: this :rtype: Offsets :return: upload offsets """ resume_bytes = self._resume() with self._meta_lock: if self._chunk_num >= self._total_...
java
protected Animation buildHorizontalAnimation(final double fromX, final double toX, final double fromY, final double toY) { final double angle = findAngle(fromX, toX, fromY, toY); final MotionBlur mb = MotionBlurBuilder.create().angle(angle).build(); node().setEffect(mb); return Parall...
java
public static void fixAsyncStackTrace(Throwable asyncCause, StackTraceElement[] localSideStackTrace) { Throwable throwable = asyncCause; if (asyncCause instanceof ExecutionException && throwable.getCause() != null) { throwable = throwable.getCause(); } StackTraceElement[] re...
python
def scan_interface(self, address): """ Scan interface for Crazyflies """ if self.cfusb is None: try: self.cfusb = CfUsb() except Exception as e: logger.warn( 'Exception while scanning for Crazyflie USB: {}'.format( ...
java
public static ExecutorService createPool(PoolType type, String format) { //检查是否符合格式 String.format(format, 0); //线程工厂 ThreadFactory factory = new ThreadFactory() { AtomicInteger counter = new AtomicInteger(0); @Override public Thread newThread(Runnable...
python
def reboot(name, provision=False): ''' Reboot a VM. (vagrant reload) CLI Example: .. code-block:: bash salt <host> vagrant.reboot <salt_id> provision=True :param name: The salt_id name you will use to control this VM :param provision: (False) also re-run the Vagrant provisioning scri...