Returns the create_time of a Process instance.

    It's backward compatible with < 2.0 versions of psutil.
555072
def _get_proc_create_time(proc):
    '''
    
    '''
    try:
        return salt.utils.data.decode(proc.create_time() if PSUTIL2 else proc.create_time)
    except (psutil.NoSuchProcess, psutil.AccessDenied):
        return None
626905
def create_fork_exec(original_name):
    

    def new_fork_exec(args, *other_args):
        import _posixsubprocess  # @UnresolvedImport
        args = patch_args(args)
        send_process_created_message()
        return getattr(_posixsubprocess, original_name)(args, *other_args)

    return new_fork_exec
1073056
def libvlc_vlm_get_media_instance_time(p_instance, psz_name, i_instance):
    '''
    '''
    f = _Cfunctions.get('libvlc_vlm_get_media_instance_time', None) or \
        _Cfunction('libvlc_vlm_get_media_instance_time', ((1,), (1,), (1,),), None,
                    ctypes.c_int, Instance, ctypes.c_char_p, ctypes.c_int)
    return f(p_instance, psz_name, i_instance)
161052
public static DurationUtil getInstance() {

    if (instance == null) {
      synchronized (DurationUtilImpl.class) {
        if (instance == null) {
          instance = new DurationUtilImpl();
        }
      }
    }
    return instance;
  }
401007
def from_datetime(dt, machine_id=0):
        
        td = dt - Timestamp._EPOCH
        seconds = td.days * 3600 * 24
        seconds += td.seconds
        return Timestamp(seconds, td.microseconds*1000, machine_id)
1056524
def get_time(self):
        
        if isinstance(self.path, pathlib.Path):
            thetime = self.path.stat().st_mtime
        else:
            thetime = np.nan
        return thetime
1084105
def compute_end_timeperiod(self, process_name, timeperiod):
        
        time_qualifier = context.process_context[process_name].time_qualifier
        end_timeperiod = time_helper.increment_timeperiod(time_qualifier, timeperiod)
        return end_timeperiod
1022011
def _get_pkg_build_time(name):
    '''
    
    '''
    iso_time = iso_time_t = None
    changelog_dir = os.path.join('/usr/share/doc', name)
    if os.path.exists(changelog_dir):
        for fname in os.listdir(changelog_dir):
            try:
                iso_time_t = int(os.path.getmtime(os.path.join(changelog_dir, fname)))
                iso_time = datetime.datetime.utcfromtimestamp(iso_time_t).isoformat() + 'Z'
                break
            except OSError:
                pass

    # Packager doesn't care about Debian standards, therefore Plan B: brute-force it.
    if not iso_time:
        for pkg_f_path in __salt__['cmd.run']('dpkg-query -L {}'.format(name)).splitlines():
            if 'changelog' in pkg_f_path.lower() and os.path.exists(pkg_f_path):
                try:
                    iso_time_t = int(os.path.getmtime(pkg_f_path))
                    iso_time = datetime.datetime.utcfromtimestamp(iso_time_t).isoformat() + 'Z'
                    break
                except OSError:
                    pass

    return iso_time, iso_time_t
416627
def create_process(daemon, name, callback, *callbackParams):
    
    bp = Process(daemon=daemon, name=name, target=callback, args=callbackParams)
    return bp
1207126
def timeit(method):
    

    def timed(*arguments, **kw):
        ts = time.time()
        result = method(*arguments, **kw)
        te = time.time()

        sys.stdout.write('Time:  %r %2.2f sec\n' % (method.__name__.strip("_"), te - ts))
        sys.stdout.write('------------------------------------\n')
        sys.stdout.flush()
        return result

    return timed
127948
def _timestamp(_process_name):
    """"""
    _prefix= time.strftime("%Y%j%H%M%S-I-----",time.localtime())
    _lenstr = 60 - len(_process_name)
    return _prefix+_process_name+(_lenstr*'-')+'\n'
626576
def get_running_time(self):
        
        if win32.PROCESS_ALL_ACCESS == win32.PROCESS_ALL_ACCESS_VISTA:
            dwAccess = win32.PROCESS_QUERY_LIMITED_INFORMATION
        else:
            dwAccess = win32.PROCESS_QUERY_INFORMATION
        hProcess = self.get_handle(dwAccess)
        (CreationTime, ExitTime, _, _) = win32.GetProcessTimes(hProcess)
        if self.is_alive():
            ExitTime = win32.GetSystemTimeAsFileTime()
        CreationTime = CreationTime.dwLowDateTime + (CreationTime.dwHighDateTime << 32)
        ExitTime     =     ExitTime.dwLowDateTime + (    ExitTime.dwHighDateTime << 32)
        RunningTime  = ExitTime - CreationTime
        return RunningTime / 10000
47946
def creation_time(self):
    """"""
    timestamp = self._fsapfs_file_entry.get_creation_time_as_integer()
    return dfdatetime_apfs_time.APFSTime(timestamp=timestamp)
604529
def output_start_time(self, start_time_msec):
        '''
        '''
        self.log.write("#[StartTime: %f (seconds since epoch), %s]\n" %
                       (float(start_time_msec) / 1000.0,
                        datetime.fromtimestamp(start_time_msec).iso_format(' ')))
955233
def time(arg):
    
    # handle datetime instances.
    if _has_method(arg, "timetuple"):
        arg = _time.mktime(arg.timetuple())

    if isinstance(arg, float):
        arg = int(arg)

    return str(arg)
1003454
def generation_time(self):
        
        entry = self._proto.commandQueueEntry
        if entry.HasField('generationTimeUTC'):
            return parse_isostring(entry.generationTimeUTC)
        return None
569852
def _get_process_mapping():
    
    for impl in (proc, ps):
        try:
            mapping = impl.get_process_mapping()
        except EnvironmentError:
            continue
        return mapping
    raise ShellDetectionFailure('compatible proc fs or ps utility is required')