Returns the content signature currently stored for this node
        if it's been unmodified longer than the max_drift value, or the
        max_drift value is 0.  Returns None otherwise.
513577
def get_max_drift_csig(self):
        
        old = self.get_stored_info()
        mtime = self.get_timestamp()

        max_drift = self.fs.max_drift
        if max_drift > 0:
            if (time.time() - mtime) > max_drift:
                try:
                    n = old.ninfo
                    if n.timestamp and n.csig and n.timestamp == mtime:
                        return n.csig
                except AttributeError:
                    pass
        elif max_drift == 0:
            try:
                return old.ninfo.csig
            except AttributeError:
                pass

        return None
307400
def last_modified(self) -> Optional[datetime.datetime]:
        
        httpdate = self._headers.get(hdrs.LAST_MODIFIED)
        if httpdate is not None:
            timetuple = parsedate(httpdate)
            if timetuple is not None:
                return datetime.datetime(*timetuple[:6],
                                         tzinfo=datetime.timezone.utc)
        return None
988996
def payload(self):
        
        if self._content_type is not None:
            try:
                return self._payload[self._content_type]
            except KeyError:
                raise KeyError("Content-Type not available")
        else:

            if defines.Content_types["text/plain"] in self._payload:
                return self._payload[defines.Content_types["text/plain"]]
            else:
                val = list(self._payload.keys())
                return val[0], self._payload[val[0]]
721398
def file_signature(filename):
    

    if not os.path.isfile(filename):
        return None
    if not os.path.exists(filename):
        return None

    # Duplicate auto-generated files can be recognized with the sha1 hash.
    sig = hashlib.sha1()
    with open(filename, "rb") as f:
        buf = f.read()
        sig.update(buf)

    return sig.hexdigest()
148540
async def get_value(self):
        

        cc = self.request.custom_content

        async with self.lock:
            if self.content_key not in cc:
                cc[self.content_key] = await self.call_api()

        return cc[self.content_key]
389603
def _get_persistent_id(self, o):
        
        if type(o) in self.hash_dedup:
            oid = o.__class__.__name__ + "-" + str(hash(o))
            self._object_cache[oid] = o
            return oid

        if any(isinstance(o,c) for c in self.unsafe_key_baseclasses):
            return None

        try:
            return self._uuid_cache[o]
        except KeyError:
            pass
        except TypeError:
            return None

        #if type(o) in self.uuid_dedup:
        #    return self._get_id(o)
        if o.__class__.__module__.split('.')[0] in self.module_dedup or o.__class__ in self.uuid_dedup:
            oid = o.__class__.__name__.split(".")[-1] + '-' + str(uuid.uuid4())
            self._object_cache[oid] = o
            self._uuid_cache[o] = oid
            return oid

        return None
489249
def get_signature(self, content):
        """"""
        data = content.get('data', {})
        text = data.get('text/plain', '')
        if text:
            text = ANSI_OR_SPECIAL_PATTERN.sub('', text)
            self._control.current_prompt_pos = self._prompt_pos
            line = self._control.get_current_line_to_cursor()
            name = line[:-1].split('(')[-1]   # Take last token after a (
            name = name.split('.')[-1]        # Then take last token after a .
            # Clean name from invalid chars
            try:
                name = self.clean_invalid_var_chars(name).split('_')[-1]
            except:
                pass
            argspec = getargspecfromtext(text)
            if argspec:
                # This covers cases like np.abs, whose docstring is
                # the same as np.absolute and because of that a proper
                # signature can't be obtained correctly
                signature = name + argspec
            else:
                signature = getsignaturefromtext(text, name)

            # Remove docstring for uniformity with editor
            signature = signature.split('Docstring:')[0]

            return signature
        else:
            return ''
301860
def last_modified(self):
        
        if self.entries:
            latest = max(self.entries, key=lambda x: x.last_modified)
            return arrow.get(latest.last_modified)
        return arrow.get()
1203267
def default(cls):
    
    if cls._DEFAULT is None:
      cls._DEFAULT = cls.skip_signatures_and_duplicates_concat_well_known_metadata()
    return cls._DEFAULT
504103
def finalize(self):
        
        signature = self.signer.finalize()
        sig_r, sig_s = decode_dss_signature(signature)
        sig_b64 = encode_signature(sig_r, sig_s)
        return sig_b64
801840
private String getFNSignatureFromIContext(INode node) {

        String ret = node.getNodeData().getName();
        List<INode> children = node.getChildrenList();
        if (children != null && children.size() > 0) {
            ret += "(";
            for (INode aChildren : children) {
                ret += getFNSignatureFromIContext(aChildren) + ",";
            }

            ret = ret.substring(0, ret.length() - 1);
            ret += ")";
        }
        return ret;

    }
438680
@JsonIgnore
    public String getSigningCertificateDecoded() {
        if (EncodingUtils.isBase64(signingCertificate)) {
            return EncodingUtils.decodeBase64ToString(signingCertificate);
        }
        return signingCertificate;
    }
735383
public long getLastModified() throws GetLastModifiedException {
        long result;

        result = Long.MIN_VALUE;
        for (Node node : nodes) {
            if (node instanceof HttpNode) {
                // skip getLastModified - it's not supported by Webservice Stub Servlet
            } else {
                result = Math.max(result, node.getLastModified());
            }
        }
        return result == Long.MIN_VALUE ? -1 : result;
    }
292130
def get_hashed_signature(self, url):
        
        data = "%s%s" % (url, self.association_id)
        if self.session_id:
            data = "%s%s" % (data, self.session_id)
        data_b = bytearray(data, 'utf-8')
        secret_key = base64.b64decode(self.secret_key)
        secret_b = bytearray(secret_key)

        hashed = hmac.new(secret_b, data_b, sha1).digest()
        return base64.b64encode(hashed).decode("utf-8")
112378
def get_last_modified_date(filename):
    
    if os.path.isfile(filename):
        t = os.path.getmtime(filename)
        return datetime.date.fromtimestamp(t).strftime('%d/%m/%Y')
    return None
929092
def _data_to_sign(self) -> bytes:
        
        packed = self.packed()

        field = type(packed).fields_spec[-1]
        assert field.name == 'signature', 'signature is not the last field'

        # this slice must be from the end of the buffer
        return packed.data[:-field.size_bytes]
1009661
public String getLastUpdatedString() {
        long newestTs = 0;
        for (UpdateSite s : sites) {
            if (s.getDataTimestamp()>newestTs) {
                newestTs = s.getDataTimestamp();
            }
        }
        if (newestTs == 0) {
            return Messages.UpdateCenter_n_a();
        }
        return Util.getPastTimeString(System.currentTimeMillis()-newestTs);
    }