Return the last modcommit of the given field. If no
        modcommit exists (for example after a migration that created
        new fields) returns None.
766860
def _get_modcommit(self, key):
        
        try:
            return ModificationCommit.objects.filter(
                object_uid = self.uid,
                key = key,
                action__id__lte = self.step
            ).order_by("-action__id")[0]
        except IndexError:
            return None
35478
def get_new_version(self, last_version, last_commit,
                        diff_to_increase_ratio):
        

        version = Version(last_version)
        diff = self.get_diff(last_commit, self.get_last_commit_hash())
        total_changed = diff[Diff.ADD] + diff[Diff.DEL]

        version.increase_by_changes(total_changed, diff_to_increase_ratio)
        return version
948463
def last_modified(self):
        ''''''
        lm = self.response.headers.get('last-modified', None)
        return datetime.strptime(lm, '%a, %d %b %Y %H:%M:%S GMT') if lm \
            else None
1303099
public int lastModified(int iAreaDesc, boolean bForceUniqueKey)
    {   // Set up the end key
        int iLastKeyField = this.getKeyFields(bForceUniqueKey, false) - 1;
        for (int iKeyFieldSeq = iLastKeyField; iKeyFieldSeq >= DBConstants.MAIN_KEY_FIELD; iKeyFieldSeq--)
        {
            KeyField keyField = this.getKeyField(iKeyFieldSeq, bForceUniqueKey);
            if (keyField.getField(iAreaDesc).isModified())
                return iKeyFieldSeq;
        }
        return -1;
    }
905944
public static function getDeleted(Field $field)
    {
        $change = new FieldMigrationChange();

        $change->isDeleted = true;
        $change->field = $field;

        return $change;
    }
415843
def get_last_item_field(self, field, filters_=[], offset=False):
        '''
            
        '''

        last_value = None

        url = self.index_url
        url += "/_search"

        if filters_ is None:
            filters_ = []

        terms = []
        for filter_ in filters_:
            if not filter_:
                continue
            term = '''{"term" : { "%s" : "%s"}}''' % (filter_['name'], filter_['value'])
            terms.append(term)

        data_query = '''"query": {"bool": {"filter": [%s]}},''' % (','.join(terms))

        data_agg = '''
            "aggs": {
                "1": {
                  "max": {
                    "field": "%s"
                  }
                }
            }
        ''' % field

        data_json = '''
        { "size": 0, %s  %s
        } ''' % (data_query, data_agg)

        logger.debug("%s %s", self.anonymize_url(url), data_json)

        headers = {"Content-Type": "application/json"}

        res = self.requests.post(url, data=data_json, headers=headers)
        res.raise_for_status()
        res_json = res.json()

        if 'aggregations' in res_json:
            last_value = res_json["aggregations"]["1"]["value"]

            if offset:
                if last_value is not None:
                    last_value = int(last_value)
            else:
                if "value_as_string" in res_json["aggregations"]["1"]:
                    last_value = res_json["aggregations"]["1"]["value_as_string"]
                    last_value = parser.parse(last_value)
                else:
                    last_value = res_json["aggregations"]["1"]["value"]
                    if last_value:
                        try:
                            last_value = unixtime_to_datetime(last_value)
                        except ValueError:
                            # last_value is in microsecs
                            last_value = unixtime_to_datetime(last_value / 1000)
        return last_value
329016
def last_commit(self) -> Tuple:
        """"""
        from libs.repos import git

        return git.get_last_commit(repo_path=self.path)
1303475
def _last(self, **spec):
        
        for record in self._entries(spec).order_by(orm.desc(model.Entry.local_date),
                                                   orm.desc(model.Entry.id))[:1]:
            return entry.Entry(record)
        return None
1335471
@Override
	public long getLastModified(String filePath) {
		long lastModified = 0;
		File f = new File(filePath);
		if (f.exists()) {
			lastModified = f.lastModified();
		}
		return lastModified;
	}
1252847
private boolean isCandidate(Field field) {
		return !Modifier.isStatic(field.getModifiers()) && field.getAnnotation(Transient.class) == null;
	}
1046697
@SuppressWarnings("unchecked")
	@Override
	public long getLastModified(HttpServletRequest request) throws IOException {
		long lastModified = _lastModified;
		IAggregator aggregator = (IAggregator)request.getAttribute(IAggregator.AGGREGATOR_REQATTRNAME);
		IOptions options = aggregator.getOptions();
		// Don't check last modified dates of source files on every request in production mode
		// for performance reasons.  _validateLastModified is a transient that gets initialize
		// to true whenever this object is de-serialized (i.e. on server startup).
		if (lastModified == -1 || _validateLastModified.getAndSet(false) || options.isDevelopmentMode()) {
			// see if we already determined the last modified time for this request
			Object obj = request.getAttribute(LAST_MODIFIED_PROPNAME);
			if (obj == null) {
				// Determine latest last-modified time from source files in moduleList
				ModuleList moduleFiles = getModules(request);
				lastModified = getLastModified(aggregator, moduleFiles);
				// Get last-modified date of config file
				lastModified = Math.max(
						lastModified,
						aggregator.getConfig().lastModified());
				List<String> cacheInfoReport = null;
				if (_isReportCacheInfo) {
					cacheInfoReport = (List<String>)request.getAttribute(LAYERCACHEINFO_PROPNAME);
				}
				synchronized(this) {
					if (_lastModified == -1) {
						// Initialize value of instance property
						_lastModified = lastModified;
						if (cacheInfoReport != null) {
							cacheInfoReport.add("update_lastmod1"); //$NON-NLS-1$
						}
					}
				}
				request.setAttribute(LAST_MODIFIED_PROPNAME, lastModified);
				if (log.isLoggable(Level.FINER)) {
					log.finer("Returning calculated last modified "  //$NON-NLS-1$
							+ lastModified + " for layer " +  //$NON-NLS-1$
							request.getAttribute(IHttpTransport.REQUESTEDMODULENAMES_REQATTRNAME).toString());
				}
			} else {
				lastModified = (Long)obj;
				if (log.isLoggable(Level.FINER)) {
					log.finer("Returning last modified "  //$NON-NLS-1$
							+ lastModified + " from request for layer " +  //$NON-NLS-1$
							request.getAttribute(IHttpTransport.REQUESTEDMODULENAMES_REQATTRNAME).toString());
				}
			}
		} else {
			if (log.isLoggable(Level.FINER)) {
				log.finer("Returning cached last modified "  //$NON-NLS-1$
						+ lastModified + " for layer " + //$NON-NLS-1$
						request.getAttribute(IHttpTransport.REQUESTEDMODULENAMES_REQATTRNAME).toString());
			}
		}
		return lastModified;
	}
464713
public function lastModified($modified = null)
    {
        if ($modified && $modified > $this->last_modified) {
            $this->last_modified = $modified;
        }

        return $this->last_modified;
    }
884453
def get_last_commit(git_path='git'):
    
    hash_, udate, aname, amail, cname, cmail = (
        call((git_path, 'log', '-1',
              '--pretty=format:%H,%ct,%an,%ae,%cn,%ce')).split(","))
    date = time.strftime('%Y-%m-%d %H:%M:%S +0000', time.gmtime(float(udate)))
    author = '%s <%s>' % (aname, amail)
    committer = '%s <%s>' % (cname, cmail)
    return hash_, date, author, committer
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
26438
public static function getLastId($table, $field) {

        try {
            $sql = 'SELECT max(' . $field . ') as lastid FROM ' . $table;
            list($lastid) = self::dbFetch(self::query($sql), "num"); // cause warning when use assoc array
            return (int) $lastid;
        } catch (Exception $e) {
            echo $e->getTraceAsString();
        }        
    }
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
205424
def posted_data(self, field):
        
        try:
            return self.cleaned_data[field]
        except (AttributeError, KeyError):
            return field.endswith("_export")