Retrieves the timestamp from the Load Configuration directory.

    Args:
      pefile_object (pefile.PE): pefile object.

    Returns:
      int: load configuration timestamps or None if there are none present.
323057
def _GetLoadConfigTimestamp(self, pefile_object):
    
    if not hasattr(pefile_object, 'DIRECTORY_ENTRY_LOAD_CONFIG'):
      return None
    timestamp = getattr(
        pefile_object.DIRECTORY_ENTRY_LOAD_CONFIG.struct, 'TimeDateStamp', 0)
    return timestamp
1056524
def get_time(self):
        
        if isinstance(self.path, pathlib.Path):
            thetime = self.path.stat().st_mtime
        else:
            thetime = np.nan
        return thetime
998429
def get_times(self):
        
        send_time = ctypes.c_int32()
        recv_time = ctypes.c_int32()
        result = self.library.Par_GetTimes(self.pointer, ctypes.byref(send_time),
                                   ctypes.byref(recv_time))
        check_error(result, "partner")
        return send_time, recv_time
1277772
def GetPathInfo(self, timestamp=None):
    
    path_info_timestamp = self._LastEntryTimestamp(self._path_infos, timestamp)
    try:
      result = self._path_infos[path_info_timestamp].Copy()
    except KeyError:
      result = rdf_objects.PathInfo(
          path_type=self._path_type, components=self._components)

    stat_entry_timestamp = self._LastEntryTimestamp(self._stat_entries,
                                                    timestamp)
    result.last_stat_entry_timestamp = stat_entry_timestamp
    result.stat_entry = self._stat_entries.get(stat_entry_timestamp)

    hash_entry_timestamp = self._LastEntryTimestamp(self._hash_entries,
                                                    timestamp)
    result.last_hash_entry_timestamp = hash_entry_timestamp
    result.hash_entry = self._hash_entries.get(hash_entry_timestamp)

    return result
661806
def GetDate(self):
    
    if self._timestamp is None:
      return None, None, None

    try:
      number_of_days, _, _, _ = self._GetTimeValues(self._timestamp)
      return self._GetDateValues(number_of_days, 1970, 1, 1)
    except ValueError:
      return None, None, None
347994
def open_using_pefile(input_name, input_bytes):
        '''  '''
        try:
            pef = pefile.PE(data=input_bytes, fast_load=False)
        except (AttributeError, pefile.PEFormatError), error:
            print 'warning: pe_fail (with exception from pefile module) on file: %s' % input_name
            error_str = '(Exception):, %s' % (str(error))
            return None, error_str

        # Now test to see if the features are there/extractable if not return FAIL flag
        if pef.PE_TYPE is None or pef.OPTIONAL_HEADER is None or len(pef.OPTIONAL_HEADER.DATA_DIRECTORY) < 7:
            print 'warning: pe_fail on file: %s' % input_name
            error_str = 'warning: pe_fail on file: %s' % input_name
            return None, error_str

        # Success
        return pef, None
950736
def timesince(self, now=None):
        
        from django.utils.timesince import timesince as timesince_
        return timesince_(self.timestamp, now)
1353820
def getUptime(self):
        
        try:
            fp = open(uptimeFile, 'r')
            line = fp.readline()
            fp.close()
        except:
            raise IOError('Failed reading stats from file: %s' % uptimeFile)
        return float(line.split()[0])
804138
def fetch_or_load(spec_path):
    

    headers = {}

    try:
        modified = datetime.utcfromtimestamp(os.path.getmtime(spec_path))
        date = modified.strftime("%a, %d %b %Y %I:%M:%S UTC")
        headers["If-Modified-Since"] = date
    except OSError as error:
        if error.errno != errno.ENOENT:
            raise

    request = urllib.Request(VALIDATION_SPEC, headers=headers)
    response = urllib.urlopen(request, cafile=certifi.where())

    if response.code == 200:
        with open(spec_path, "w+b") as spec:
            spec.writelines(response)
            spec.seek(0)
            return html.parse(spec)

    with open(spec_path) as spec:
        return html.parse(spec)
481667
def get_timestamp(self, **kwargs):
        """"""
        timestamp = kwargs.get('timestamp')
        if not timestamp:
            now = datetime.datetime.utcnow()
            timestamp = now.strftime("%Y-%m-%dT%H:%M:%S") + ".%03d" % (now.microsecond / 1000) + "Z"

        return timestamp
1147091
def _get_timestamp(dirname_full, remove):
    
    record_filename = os.path.join(dirname_full, RECORD_FILENAME)

    if not os.path.exists(record_filename):
        return None

    mtime = os.stat(record_filename).st_mtime
    mtime_str = datetime.fromtimestamp(mtime)
    print('Found timestamp {}:{}'.format(dirname_full, mtime_str))
    if Settings.record_timestamp and remove:
        OLD_TIMESTAMPS.add(record_filename)
    return mtime
822079
def get_code(self, timestamp=None):
        
        return generate_twofactor_code_for_time(b64decode(self.shared_secret),
                                                self.get_time() if timestamp is None else timestamp)
315457
def _get_timestamp(self):
        """"""
        filename_date = _find_date(os.path.basename(self._path))
        if filename_date:
            return filename_date
730651
def Timestamp():
    
    timestamp = ''
    try:
        timestamp = str(datetime.datetime.now())+' UTC'
    except Exception as e:  # pragma: no cover
        logger.error('Could not get current time ' + str(e))
    return timestamp
807697
def get_timestamp(dt=None):
    '''
    
    '''

    if dt is None: dt = datetime.datetime.utcnow()
    t = dt.utctimetuple()

    return calendar.timegm(t)
1325639
def from_config(cls, config: dict):
        
        timestamp = config.get('timestamp', None)
        return cls(config.get('id'),
                   config.get('type'),
                   config.get('data', dict()),
                   config.get('origin', None),
                   timestamp,
                   config.get('object_type', None),
                   config.get('object_id', None),
                   config.get('object_key', None))
770027
def timestamp_file():
    """"""
    config_dir = os.path.join(
        os.path.expanduser("~"), BaseGlobalConfig.config_local_dir
    )

    if not os.path.exists(config_dir):
        os.mkdir(config_dir)

    timestamp_file = os.path.join(config_dir, "cumulus_timestamp")

    try:
        with open(timestamp_file, "r+") as f:
            yield f
    except IOError:  # file does not exist
        with open(timestamp_file, "w+") as f:
            yield f