language
stringclasses
2 values
func_code_string
stringlengths
63
466k
python
def find_sdk_dir(self): """Try to find the MS SDK from the registry. Return None if failed or the directory does not exist. """ if not SCons.Util.can_read_reg: debug('find_sdk_dir(): can not read registry') return None hkey = self.HKEY_FMT % self.hkey_da...
java
public String addMapping(String prefix, String uri) { String[] strs = mNsStrings; int phash = prefix.hashCode(); for (int ix = mScopeStart, end = mScopeEnd; ix < end; ix += 2) { String thisP = strs[ix]; if (thisP == prefix || (thisP.hashCode() == phas...
java
private ScoreWeight getDashboardScoreFromWidgets(List<ScoreWeight> widgetScores) { if (null == widgetScores) { return getDashboardScore(new ScoreTypeValue(Constants.ZERO_SCORE), widgetScores); } try { //Calculate score return getDashboardScore( ScoreCalculationUtils.calculateCompo...
java
public static String getMimeTypeByPath(String suffix) { while(suffix.startsWith(".") && suffix.length() > 0) { suffix = suffix.substring(1); } String mimeType = null; while((mimeType = findInMap(suffix)) == null) { int pos = suffix.indexOf('.'); if(pos == -1) { break; } suffix = suffix.substr...
python
def unlock(self, passphrase): """ Context manager method for unlocking passphrase-protected private keys. Has no effect if the key is not both private and passphrase-protected. When the context managed block is exited, the unprotected private key material is removed. Example:: ...
java
public static systemdatasource[] get(nitro_service service, systemdatasource_args args) throws Exception{ systemdatasource obj = new systemdatasource(); options option = new options(); option.set_args(nitro_util.object_to_string_withoutquotes(args)); systemdatasource[] response = (systemdatasource[])obj.get_res...
java
public static base_responses unset(nitro_service client, String variable[], String args[]) throws Exception { base_responses result = null; if (variable != null && variable.length > 0) { filterhtmlinjectionvariable unsetresources[] = new filterhtmlinjectionvariable[variable.length]; for (int i=0;i<variable.le...
python
def xstep(self): r"""Minimise Augmented Lagrangian with respect to :math:`\mathbf{x}`. """ b = self.AHSf + self.rho*np.sum( np.conj(self.Gf)*sl.rfftn(self.Y-self.U, axes=self.axes), axis=self.Y.ndim-1) self.Xf = b / (self.AHAf + self.rho*self.GHGf) ...
python
def to_dict(self): """Return description of self in dict format. This is useful for serializing to something like json later. """ jdict = { 'user': self.user, 'summary': self.summary, 'body': self.body, 'markup': self.markup, '...
java
public <N> CompletableFutureQueue<T, N> thenCombineAsyncFromArray(Function<R, N>[] nextTransformations) { CompletableFutureQueue cfq = this; for (Function<R, N> nextTransformation : nextTransformations) { cfq = cfq.thenCombineAsync(nextTransformation); } return cfq; }
java
@Override public boolean unregisterService(URI serviceUri) throws SalException { // Check the URI is correct and belongs to the server if (serviceUri == null || !UriUtil.isResourceLocalToServer(serviceUri, this.getIserveUri())) { return false; } if (this...
java
private HttpServletRequest fixupRequest(HttpServletRequest request) { if (isAzureAppService(request)) { final StringBuffer requestUrl = request.getRequestURL(); if (requestUrl.indexOf("http://") == 0) { final String forwardedProto = request.getHeader("x-forwarded-proto"); if (StringUtils.equals(...
python
def filename(value): ''' Remove everything that would affect paths in the filename :param value: :return: ''' return re.sub('[^a-zA-Z0-9.-_ ]', '', os.path.basename(InputSanitizer.trim(value)))
python
def add_remote_provider(self, provider, client, path): """Adds a remote configuration source. Remote Providers are searched in the order they are added. provider is a string value, "etcd", "consul" and "zookeeper" are currently supported. client is a client object path is...
python
def get_polygon_constraints(self, range_polygones=range(3, 5), print_out=False): """ :param range_polygones: list of numbers of polygones to test. :return A, b: the constraints on the theta-vector of the form A*theta = b ...
java
protected void validate(String operationType) throws Exception { super.validate(operationType); MPSLong exporter_id_validator = new MPSLong(); exporter_id_validator.validate(operationType, exporter_id, "\"exporter_id\""); MPSLong priority_validator = new MPSLong(); priority_validator.validate(ope...
java
public <T extends AbstractGoogleJsonClient.Builder> T fromServiceAccount(T builder, String serviceAccountId, File p12File) throws GeneralSecurityException, IOException { Preconditions.checkNotNull(builder); GoogleCredential creds = new GoogleCredential.Builder() .setTransport(httpTransport) ...
python
def show_firmware_version_output_show_firmware_version_build_time(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") show_firmware_version = ET.Element("show_firmware_version") config = show_firmware_version output = ET.SubElement(show_firmware_vers...
python
def autoblend(self): """ Ensure that all schemas within the collection import each other which has a blending effect. @return: self @rtype: L{SchemaCollection} """ namespaces = self.namespaces.keys() for s in self.children: for ns in namespaces...
java
private final void pollProgress() { final String pollUrl = this.httpPollerProcessor .getPollerRequestUrl(pollerData.getJobId()); final HttpMethod pollerHttpMethod = HttpMethod.GET; final String postBodyForPoller = ""; final ActorRef pollerWorker = getContext().actorOf( ...
python
def to_unicode(text, charset=None): """Convert a `str` object to an `unicode` object. If `charset` is given, we simply assume that encoding for the text, but we'll use the "replace" mode so that the decoding will always succeed. If `charset` is ''not'' specified, we'll make some guesses, first trying the UTF-8 e...
python
def cut_from_block(html_message): """Cuts div tag which wraps block starting with "From:".""" # handle the case when From: block is enclosed in some tag block = html_message.xpath( ("//*[starts-with(mg:text_content(), 'From:')]|" "//*[starts-with(mg:text_content(), 'Date:')]")) if bloc...
java
private boolean interruptAndJoinThreads(List<Thread> threads) { // interrupt and wait for all ongoing create threads for(Thread t : threads) { t.interrupt(); } for(Thread t : threads) { try { t.join(); } catch (InterruptedException e) { DataNode.LOG.warn("interruptOngoi...
python
def clear_cache(self): """Clear the raw packet cache for the field and all its subfields""" self.raw_packet_cache = None for _, fval in six.iteritems(self.fields): if isinstance(fval, Packet): fval.clear_cache() self.payload.clear_cache()
java
public static String matchImplicit(Pointer ptr, int len) { String tag = "str"; int cs; int act; int have = 0; int nread = 0; int p=ptr.start; int pe = p+len; int eof = p+len; int tokstart = -1; int tokend = -1; byte[] data = ptr.buffer; ...
python
def purge_url(self, host, path): """Purge an individual URL.""" content = self._fetch(path, method="PURGE", headers={ "Host": host }) return FastlyPurge(self, content)
java
public BiDiNavigator<Vertex> getBiDiNavigator() { if(CACHING && (cachedNavigator != null)) return cachedNavigator; BiDiNavigator<Vertex> navigator = constructBiDiNavigator(RelFacts.<Vertex,Vertex>mapSet()); if(CACHING) { cachedNavigator = navigator; } return navigator; }
python
def transform_to_length(nndata, length): """ Given NNData, transforms data to the specified fingerprint length Args: nndata: (NNData) length: (int) desired length of NNData """ if length is None: return nndata if length: f...
python
def add_to_environment(self, environment): """Add the router to the given environment.""" self._env = environment._env self._userdata = ffi.new_handle(self) ENVIRONMENT_DATA[self._env].routers[self.name] = self lib.EnvAddRouterWithContext( self._env, self._name.enco...
java
public String[] getJustify() { String[] valueDestination = new String[ justify.size() ]; this.justify.getValue(valueDestination); return valueDestination; }
python
def _impute_one_feature(self, X_filled, mask_missing_values, feat_idx, neighbor_feat_idx, predictor=None, fit_mode=True): """Impute a single fea...
java
public static void context(CharSequence context, int indent) { if (Boolean.getBoolean("visibleassertions.silence")) { return; } StringBuilder sb = new StringBuilder(); for (int i = 0; i < indent; i++) sb.append(" "); for (int i = 0; i < 4; i++) sb.append(CONTEXT_MARK...
java
public static void include( HttpServletRequest request, HttpServletResponse response, String relativePath, JspWriter out, boolean flush) throws IOException, ServletException { include((ServletRequest) request, (ServletResponse) response, relativePath, (Writer) out...
python
def read(cls, file): """Reads a WebVTT captions file.""" parser = WebVTTParser().read(file) return cls(file=file, captions=parser.captions, styles=parser.styles)
java
public static int getColor(GraphicFactory graphicFactory, String colorString, ThemeCallback themeCallback, RenderInstruction origin) { if (colorString.isEmpty() || colorString.charAt(0) != '#') { throw new IllegalArgumentException(UNSUPPORTED_COLOR_FORMAT + colorString); } else if (colorStri...
python
def yearly_plots( df, variable, renormalize = True, horizontal_axis_labels_days = False, horizontal_axis_labels_months = True, plot = True, scatter = False, linestyle = "-", linewidth ...
java
public void marshall(BGPPeer bGPPeer, ProtocolMarshaller protocolMarshaller) { if (bGPPeer == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(bGPPeer.getBgpPeerId(), BGPPEERID_BINDING); pr...
python
def determine_file_type(self, z): """Determine file type.""" content = z.read('[Content_Types].xml') with io.BytesIO(content) as b: encoding = self._analyze_file(b) if encoding is None: encoding = 'utf-8' b.seek(0) text = b.read()....
python
def main(command_line=True, **kwargs): """ NAME jr6_txt_magic.py DESCRIPTION converts JR6 .txt format files to magic_measurements format files SYNTAX jr6_txt_magic.py [command line options] OPTIONS -h: prints the help message and quits. -f FILE: specify i...
python
def protocol_str(protocol): """Convert internal API protocol to string.""" if protocol == const.PROTOCOL_MRP: return 'MRP' if protocol == const.PROTOCOL_DMAP: return 'DMAP' if protocol == const.PROTOCOL_AIRPLAY: return 'AirPlay' return 'Unknown'
java
public void close() throws IOException, GeneralSecurityException { if (mManifest != null) { // write the manifest to the jar file mOutputJar.putNextEntry(new JarEntry(JarFile.MANIFEST_NAME)); mManifest.write(mOutputJar); // CERT.SF Signature signature...
java
public InlineResponse2001 peekMultiple(String ids) throws ApiException { ApiResponse<InlineResponse2001> resp = peekMultipleWithHttpInfo(ids); return resp.getData(); }
python
def make_any_items_node(rawtext, app, prefixed_name, obj, parent, modname, options): """Render a Python sequence as a comma-separated list, with an "or" for the final item. :param rawtext: Text being replaced with link node. :param app: Sphinx application context :param prefixed_name: The dotted Python...
python
def _cut_selection(self, *event): """Cuts the current selection and copys it to the clipboard. """ if react_to_event(self.view, self.view.editor, event): logger.debug("cut selection") global_clipboard.cut(self.model.selection) return True
java
@Override public void commit() throws TransactionManagementException { logger.entering(CLASSNAME, "commit"); try { userTran.commit(); logger.log(Level.FINE, "javax.transaction.Status: {0}", userTran.getStatus()); } catch (SecurityException e) { throw new TransactionManagementException(e); } catch (Ill...
python
def import_and_get_task(task_path): """ Given a modular path to a function, import that module and return the function. """ module, function = task_path.rsplit('.', 1) app_module = importlib.import_module(module) app_function = getattr(app_module, function) return app_function
python
def absolute(parser, token): ''' Returns a full absolute URL based on the request host. This template tag takes exactly the same paramters as url template tag. ''' node = url(parser, token) return AbsoluteUrlNode( view_name=node.view_name, args=node.args, kwargs=node.kwa...
java
public void init(Configuration configuration) { if (devMode && reload && !listeningToDispatcher) { // this is the only way I found to be able to get added to to // ConfigurationProvider list // listening to events in Dispatcher listeningToDispatcher = true; ...
python
def run(job_ini, slowest=False, hc=None, param='', concurrent_tasks=None, exports='', loglevel='info', pdb=None): """ Run a calculation bypassing the database layer """ dbserver.ensure_on() if param: params = oqvalidation.OqParam.check( dict(p.split('=', 1) for p in param...
python
def find_relations(chunked): """ The input is a list of [token, tag, chunk]-items. The output is a list of [token, tag, chunk, relation]-items. A noun phrase preceding a verb phrase is perceived as sentence subject. A noun phrase following a verb phrase is perceived as sentence object. "...
java
protected long getNumConnections(IPeer peer) { if (peer == null) { return 0; } IStatistic stats = peer.getStatistic(); // If no statistics are available, return zero if (!stats.isEnabled()) { if (logger.isDebugEnabled()) { logger.debug("Statistics for peer are disabled. Please e...
java
public Collection<String> getOutDatedCache(Map<String, Long> states) { return updatedCacheManager.getOutDatedCache(states); }
python
def upsert_smart_invite(self, smart_invite_id, recipient, event, callback_url=None, organizer=None): """ Creates or updates smart invite. :param string smart_invite_id - A String uniquely identifying the event for your application (note: this is NOT an ID generated by Cronofy...
java
private void validationRelations(Task task) { List<Relation> predecessors = task.getPredecessors(); if (!predecessors.isEmpty()) { ArrayList<Relation> invalid = new ArrayList<Relation>(); for (Relation relation : predecessors) { Task sourceTask = relation.getS...
java
public static SentryClient getStoredClient() { if (storedClient != null) { return storedClient; } synchronized (Sentry.class) { if (storedClient == null && !autoInitAttempted.get()) { // attempt initialization by using configuration found in the environme...
java
public InputStream get( Artifact artifact ) throws IOException, ArtifactNotFoundException { File file = getFile( artifact ); if ( !file.isFile() ) { throw new ArtifactNotFoundException( artifact ); } return new FileInputStream( file ); }
python
def setup_colorbars(self, plot_call_sign): """Setup colorbars for each type of plot. Take all of the optional performed during ``__init__`` method and makes the colorbar. Args: plot_call_sign (obj): Plot instance of ax.contourf with colormapping to add as a colorbar...
python
def closest_hendecasyllable_patterns(self, scansion: str) -> List[str]: """ Find the closest group of matching valid hendecasyllable patterns. :return: list of the closest valid hendecasyllable patterns; only candidates with a matching length/number of syllables are considered. ...
java
private Set<String> containerExposedPorts() { final Set<String> ports = Sets.newHashSet(); for (final Map.Entry<String, PortMapping> entry : job.getPorts().entrySet()) { final PortMapping mapping = entry.getValue(); ports.add(containerPort(mapping.getInternalPort(), mapping.getProtocol())); } ...
python
def validate(self, arg=None): """Check that inputted path is valid - set validator accordingly""" if os.path.isdir(self.path): self.validator.object = None else: self.validator.object = ICONS['error']
java
public static BindEntity parse(final BindModel model, TypeElement element) { final Elements elementUtils = BaseProcessor.elementUtils; final InnerCounter counterPropertyInValue = new InnerCounter(); final Converter<String, String> typeNameConverter = CaseFormat.UPPER_CAMEL.converterTo(CaseFormat.LOWER_CAMEL); ...
java
public static double Kurtosis(int[] values){ double mean = Mean(values); double std = StdDev(values, mean); return Kurtosis(values, mean, std); }
python
def debugtoolbar_middleware_factory(app, handler): """Setup Debug middleware.""" dbtb = app.ps.debugtoolbar @asyncio.coroutine def debugtoolbar_middleware(request): """Integrate to application.""" # Check for debugtoolbar is enabled for the request if not dbtb.cfg.enabled or an...
python
def _gen_labels_columns(self, list_columns): """ Auto generates pretty label_columns from list of columns """ for col in list_columns: if not self.label_columns.get(col): self.label_columns[col] = self._prettify_column(col)
java
private void adaptBreadCrumbVisibility(final boolean hideBreadCrumb) { if (isSplitScreen()) { if (breadCrumbToolbar != null && breadCrumbShadowView != null) { breadCrumbToolbar.setVisibility(hideBreadCrumb ? View.GONE : View.VISIBLE); breadCrumbShadowView.setVisibilit...
python
def complete(self): """ Returns whether or not this manager has reached a "completed" state. """ if not self._techniques: return False if not any(tech._is_overriden('complete') for tech in self._techniques): return False return self.completion_mode...
java
public boolean hasKey(String scope, Object key) throws Exception { return getScopeCache(scope).containsKey(key); }
python
def run_command_line(args=None): """ Entry point for the FlowCal and flowcal console scripts. Parameters ---------- args: list of strings, optional Command line arguments. If None or not specified, get arguments from ``sys.argv``. See Also ---------- FlowCal.excel_ui.ru...
java
protected ResourceBundle resolveBundle (HttpServletRequest req, String bundlePath, ClassLoader loader, boolean silent) { ResourceBundle bundle = null; if (req != null) { Enumeration<?> locales = req.getLocales(); while (locales.has...
java
protected void initUserObject() { if (m_indexsource == null) { try { m_indexsource = m_searchManager.getIndexSource(getParamIndexsource()); if (m_indexsource == null) { m_indexsource = new CmsSearchIndexSource(); } } ca...
python
def _get_connection_info(): """Return a string with the connection info.""" info = 'Connection: %s,' % CONN.url if CONN.creds is not None: info += ' userid=%s,' % CONN.creds[0] else: info += ' no creds,' info += ' cacerts=%s,' % ('sys-default' if CONN.ca_certs is None ...
java
@Override public boolean listenToException(final AbstractPerfidixMethodException exec) { final StringBuilder builder = new StringBuilder(); if (exec.getMethod() != null) { builder.append("Class: ").append(exec.getMethod().getDeclaringClass().getSimpleName()).append("#").append(exec.getMe...
python
def generic_find_constraint_name(table, columns, referenced, db): """Utility to find a constraint name in alembic migrations""" t = sa.Table(table, db.metadata, autoload=True, autoload_with=db.engine) for fk in t.foreign_key_constraints: if fk.referred_table.name == referenced and set(fk.column_key...
python
def read(cls, data): """Reads data from URL, Dataframe, JSON string, JSON file or OrderedDict. Args: data: can be a Pandas Dataframe, a JSON file, a JSON string, an OrderedDict or a URL pointing to a JSONstat file. Returns: An object of class...
java
private SerializerWrapper getSerializerWrapper(Class cls) { SerializerWrapper w = serializers.get(cls); if (w != null) { return w; } else { // Try with interfaces implemented for (Class c : cls.getInterfaces()) { w = serializers.get(c); if (w != null) { return w; ...
python
def restore(self, backup=None, delete_backup=False): """Restore the snapshot to the associated storage resource. :param backup: name of the backup snapshot :param delete_backup: Whether to delete the backup snap after a successful restore. """ resp ...
java
@Override public EClass getIfcSanitaryTerminalType() { if (ifcSanitaryTerminalTypeEClass == null) { ifcSanitaryTerminalTypeEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(585); } return ifcSanitaryTerminalTypeEClass; }
java
public static <E extends Exception> long importCSV(final InputStream is, long offset, final long count, final Try.Predicate<String[], E> filter, final PreparedStatement stmt, final int batchSize, final int batchInterval, final Try.BiConsumer<? super PreparedStatement, ? super String[], SQLExce...
python
def find_eggs_in_zip(importer, path_item, only=False): """ Find eggs in zip files; possibly multiple nested eggs. """ if importer.archive.endswith('.whl'): # wheels are not supported with this finder # they don't have PKG-INFO metadata, and won't ever contain eggs return meta...
java
@Override public void updateAfterMisfire(Calendar cal) { int instr = getMisfireInstruction(); if (instr == Trigger.MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY) { return; } if (instr == Trigger.MISFIRE_INSTRUCTION_SMART_POLICY) { if (getRepeatCount() == 0) { instr = MISFIRE_INSTRUC...
python
def log_env(self, level, env): """dump env into debug logger in readable format""" self.log(level, "ENVIRONMENT:") for k, v in env.items(): self.log(level, " {} = {}".format(k, pformat(v)))
java
private void serializePartitionInfoToState() { List<PartitionDescriptor> descriptors = new ArrayList<>(); for (DataWriter writer : partitionWriters.asMap().values()) { Descriptor descriptor = writer.getDataDescriptor(); if (null == descriptor) { log.warn("Drop partition info as writer {} re...
python
def add(self, namespace_uri): """Add this namespace URI to the mapping, without caring what alias it ends up with""" # See if this namespace is already mapped to an alias alias = self.namespace_to_alias.get(namespace_uri) if alias is not None: return alias # ...
python
def bin(x, bins, maxX=None, minX=None): ''' bin signal x using 'binsN' bin. If minX, maxX are None, they default to the full range of the signal. If they are not None, everything above maxX gets assigned to binsN-1 and everything below minX gets assigned to 0, this is effectively the same as clippin...
python
def _data_to_sign(self) -> bytes: """ Return the binary data to be/which was signed """ packed = pack_reward_proof( canonical_identifier=CanonicalIdentifier( chain_identifier=self.balance_proof.chain_id, token_network_address=self.balance_proof.token_network_a...
python
def _get_fs(name, blade): ''' Private function to check for existance of a filesystem ''' _fs = [] _fs.append(name) try: res = blade.file_systems.list_file_systems(names=_fs) return res.items[0] except rest.ApiException: return None
java
@Override public void eSet(int featureID, Object newValue) { switch (featureID) { case AfplibPackage.GPARC__XPOS: setXPOS((Integer)newValue); return; case AfplibPackage.GPARC__YPOS: setYPOS((Integer)newValue); return; case AfplibPackage.GPARC__XCENT: setXCENT((Integer)newValue); retu...
python
def comparator(operator): """ Wrap a VersionInfo binary op method in a type-check """ @wraps(operator) def wrapper(self, other): if not isinstance(other, (VersionInfo, dict)): return NotImplemented return operator(self, other) return wrapper
python
def _joinedQnames(self, _list): """util for returning a string joinin names of entities *used only in info command*""" try: s = "; ".join([p.qname for p in _list]) except: s = "; ".join([p for p in _list]) return s
java
@Override public DeleteApplicationResult deleteApplication(DeleteApplicationRequest request) { request = beforeClientExecution(request); return executeDeleteApplication(request); }
python
def update(i): """ Update repository info Input: { data_uoa - data UOA of the repo (shared) - if not remote and =='git', shared through GIT (url) - if type=='git', URL of remote repository or git repositor...
java
public static Collection<URL> forManifest(final URL url) { final Collection<URL> result = new ArrayList<URL>(); result.add(url); try { final String part = cleanPath(url); File jarFile = new File(part); JarFile myJar = new JarFile(part); URL validUr...
python
def Upload(self,directory,filename): """Uploads/Updates/Replaces files""" if self._isMediaFile(filename): return self._upload_media(directory,filename) elif self._isConfigFile(filename): return self._update_config(directory,filename) print "Not handled!" ...
java
@Override public Object getValue(ELContext context, Object base, Object property) { if (context == null) { throw new NullPointerException("context is null"); } Object result = null; if (isResolvable(base)) { int index = toIndex(null, property); result = index < 0 || index >= Array.getLength(base) ? nu...
java
@Override public String getDbName(final FinderObject owner) { final Root root = (Root) owner; return root.getTheDbName(); }
java
public void invoke(HttpServletRequest req, HttpServletResponse rsp, Object root, String url) throws IOException, ServletException { RequestImpl sreq = new RequestImpl(this, req, new ArrayList<AncestorImpl>(), new TokenList(url)); RequestImpl oreq = CURRENT_REQUEST.get(); CURRENT_REQUEST.set(sreq...
java
@Override public boolean eIsSet(int featureID) { switch (featureID) { case BpsimPackage.ERLANG_DISTRIBUTION_TYPE__K: return isSetK(); case BpsimPackage.ERLANG_DISTRIBUTION_TYPE__MEAN: return isSetMean(); } return super.eIsSet(featureID); }
python
def weather_history_at_id(self, id, start=None, end=None): """ Queries the OWM Weather API for weather history for the specified city ID. A list of *Weather* objects is returned. It is possible to query for weather history in a closed time period, whose boundaries can be passed a...
python
def estimate_rotation(self, camera, ransac_threshold=7.0): """Estimate the rotation between first and last frame It uses RANSAC where the error metric is the reprojection error of the points from the last frame to the first frame. Parameters ----------------- camera : C...
java
void sixLock(Object obj, long txNum) { Object anchor = getAnchor(obj); txWaitMap.put(txNum, anchor); synchronized (anchor) { Lockers lks = prepareLockers(obj); if (hasSixLock(lks, txNum)) return; try { long timestamp = System.currentTimeMillis(); while (!sixLockable(lks, txNum) &...