Dump scheduler objects into a dump (temp) file

        :return: None
336266
def dump_objects(self):
        
        path = os.path.join(tempfile.gettempdir(),
                            'dump-obj-scheduler-%s-%d.json' % (self.name, int(time.time())))

        logger.info('Dumping scheduler objects to: %s', path)
        try:
            fd = open(path, 'wb')
            output = 'type:uuid:status:t_to_go:poller_tag:worker:command\n'
            fd.write(output.encode('utf-8'))
            for check in list(self.checks.values()):
                output = 'check:%s:%s:%s:%s:%s:%s\n' \
                         % (check.uuid, check.status, check.t_to_go, check.poller_tag,
                            check.command, check.my_worker)
                fd.write(output.encode('utf-8'))
            logger.info('- dumped checks')
            for action in list(self.actions.values()):
                output = '%s: %s:%s:%s:%s:%s:%s\n'\
                         % (action.__class__.my_type, action.uuid, action.status,
                            action.t_to_go, action.reactionner_tag, action.command,
                            action.my_worker)
                fd.write(output.encode('utf-8'))
            logger.info('- dumped actions')
            broks = []
            for broker in list(self.my_daemon.brokers.values()):
                for brok in broker.broks:
                    broks.append(brok)
            for brok in broks:
                output = 'BROK: %s:%s\n' % (brok.uuid, brok.type)
                fd.write(output.encode('utf-8'))
            logger.info('- dumped broks')
            fd.close()
            logger.info('Dumped')
        except OSError as exp:  # pragma: no cover, should never happen...
            logger.critical("Error when writing the objects dump file %s : %s", path, str(exp))
904452
def save_to_object(self):
        

        tmpdir = tempfile.mkdtemp("save_to_object", dir=self.logdir)
        checkpoint_prefix = self.save(tmpdir)

        data = {}
        base_dir = os.path.dirname(checkpoint_prefix)
        for path in os.listdir(base_dir):
            path = os.path.join(base_dir, path)
            if path.startswith(checkpoint_prefix):
                with open(path, "rb") as f:
                    data[os.path.basename(path)] = f.read()

        out = io.BytesIO()
        data_dict = pickle.dumps({
            "checkpoint_name": os.path.basename(checkpoint_prefix),
            "data": data,
        })
        if len(data_dict) > 10e6:  # getting pretty large
            logger.info("Checkpoint size is {} bytes".format(len(data_dict)))
        out.write(data_dict)

        shutil.rmtree(tmpdir)
        return out.getvalue()
1211789
def dump(cls, obj, file, protocol=0):
        
        cls.save_option_state = True
        pickle.dump(obj, file, protocol=protocol)
        cls.save_option_state = False
140657
def tempfile_writer(target):
    ''''''
    tmp = target.parent / ('_%s' % target.name)
    try:
        with tmp.open('wb') as fd:
            yield fd
    except:
        tmp.unlink()
        raise
    LOG.debug('rename %s -> %s', tmp, target)
    tmp.rename(target)
61588
def dump_engines(target=sys.stderr):
    """"""
    print("Available templating engines:", file=target)

    width = max(len(engine) for engine in engines.engines)
    for handle, engine in sorted(engines.engines.items()):
        description = engine.__doc__.split('\n', 0)[0]
        print("  %-*s  -  %s" % (width, handle, description), file=target)
557079
def dump(self, obj, format=None, *, kwargs={}):
        '''
        
        '''
        return dump(self, obj, format=format, kwargs=kwargs)
471639
def dump(self, format=None, **kwargs):
        
        formatter = Formatters.get(format, None)
        if not format:
            return self.display()
        elif not formatter:
            raise FormattingException('Formatter %s not available' % format)
        else:
            return formatter(self, **kwargs)
306236
def tempdir(*args, **kwargs):
    

    d = tempfile.mkdtemp(*args, **kwargs)
    try:
        yield d
    finally:
        shutil.rmtree(d)
81684
def dump_logs(job_queue='run_reach_queue', job_status='RUNNING'):
    """"""
    jobs = get_jobs(job_queue, job_status)
    for job in jobs:
        get_job_log(job, write_file=True)
1206437
def dump(self, zone, output_dir, lenient, split, source, *sources):
        '''
        
        '''
        self.log.info('dump: zone=%s, sources=%s', zone, sources)

        # We broke out source to force at least one to be passed, add it to any
        # others we got.
        sources = [source] + list(sources)

        try:
            sources = [self.providers[s] for s in sources]
        except KeyError as e:
            raise Exception('Unknown source: {}'.format(e.args[0]))

        clz = YamlProvider
        if split:
            clz = SplitYamlProvider
        target = clz('dump', output_dir)

        zone = Zone(zone, self.configured_sub_zones(zone))
        for source in sources:
            source.populate(zone, lenient=lenient)

        plan = target.plan(zone)
        if plan is None:
            plan = Plan(zone, zone, [], False)
        target.apply(plan)
192759
def dump(self, target=sys.stdout):
        
        for r in self.result:
            r.dump(target=target)
96397
def dump(self):
        
        import tempfile

        with tempfile.NamedTemporaryFile(delete=False, mode="w") as fobj:
            json.dump(self.info, fobj)
            return fobj.name
516976
function timestamp(scheduler) {
    if (scheduler === void 0) {
        scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_0__["async"];
    }
    return Object(_map__WEBPACK_IMPORTED_MODULE_1__["map"])(function (value) { return new Timestamp(value, scheduler.now()); });
}
667129
def dump(obj, root_file, proto=0, key=None):
    
    if isinstance(root_file, string_types):
        root_file = root_open(root_file, 'recreate')
        own_file = True
    else:
        own_file = False
    ret = Pickler(root_file, proto).dump(obj, key)
    if own_file:
        root_file.Close()
    return ret
317746
def fobj_to_tempfile(f, suffix=''):
    
    with tempfile.NamedTemporaryFile(
            dir=TEMPDIR, suffix=suffix, delete=False) as t:
        shutil.copyfileobj(f, t)
    try:
        yield t.name
    finally:
        os.remove(t.name)
1204901
def _dumps(cnf, **kwargs):
    
    return os.linesep.join(l for l in _dumps_itr(cnf))
1059054
def dump(obj, fp=None, indent=None, sort_keys=False, **kw):
    

    if fp:
        iterable = YAMLEncoder(indent=indent, sort_keys=sort_keys, **kw).iterencode(obj)
        for chunk in iterable:
            fp.write(chunk)
    else:
        return dumps(obj, indent=indent, sort_keys=sort_keys, **kw)