Convert to local mode.
554124
def tolocal(self):
        
        from thunder.series.readers import fromarray

        if self.mode == 'local':
            logging.getLogger('thunder').warn('images already in local mode')
            pass

        return fromarray(self.toarray(), index=self.index, labels=self.labels)
1366346
def list_local():
    '''
    
    '''
    cmd = 'layman --quietness=1 --list-local --nocolor'
    out = __salt__['cmd.run'](cmd, python_shell=False).split('\n')
    ret = [line.split()[1] for line in out if len(line.split()) > 2]
    return ret
781966
def from_env():
    """"""
    if 'MICROMONGO_URI' in os.environ:
        return (os.environ['MICROMONGO_URI'],)
    host = os.environ.get('MICROMONGO_HOST', 'localhost')
    port = int(os.environ.get('MICROMONGO_PORT', 27017))
    return (host, port)
1188333
def _to_memory_mode(self):
        """"""
        self._adata.__X = self._adata.X[()]
        self._file.close()
        self._file = None
        self._filename = None
361238
def _note_local_option(self, option, state):
        """"""
        if not self.telnet_opt_dict.has_key(option):
            self.telnet_opt_dict[option] = TelnetOption()
        self.telnet_opt_dict[option].local_option = state
214336
def get_local(self, key, default=None, scope=None):
        
        return self.conversation(scope).get_local(key, default)
1151484
def ConvertFromWireFormat(self, value, container=None):
    """"""
    result = self.type()
    ReadIntoObject(value[2], 0, result)

    return result
425882
def reset_mode(self):
        """"""
        self.command(0x18, b"\x01", timeout=0.1)
        self.transport.write(Chipset.ACK)
        time.sleep(0.010)
417046
def local():
    """"""
    logger.info("Loading requirements from local file.")
    with open(REQUIREMENTS_FILE, 'r') as f:
        requirements = parse(f)
        for r in requirements:
            logger.debug("Creating new package: %r", r)
            create_package_version(r)
160935
def mode(self, target, mode_string=None, tags=None):
        """"""
        params = [target]
        if mode_string:
            params += mode_string
        self.send('MODE', params=params, source=self.nick, tags=tags)
415344
def caller_locals():
    """"""
    import inspect
    frame = inspect.currentframe()
    try:
        return frame.f_back.f_back.f_locals
    finally:
        del frame
450473
def cli(ctx, path, renku_home, use_external_storage):
    """"""
    ctx.obj = LocalClient(
        path=path,
        renku_home=renku_home,
        use_external_storage=use_external_storage,
    )
883643
def _parse_local_version(local):
    
    if local is not None:
        return tuple(
            part.lower() if not part.isdigit() else int(part)
            for part in _local_version_separators.split(local)
        )
819301
def set_mode(how):
    
    global __mode
    if how == "local":
        __mode = how
    elif how == "remote":
        __mode = how
    else:
        raise ValueError("how must be 'local' or 'remote'")
623662
def open(self, mode='r', encoding=None):
        """"""
        access_type = self._get_access_type(mode)
        return open(self.localpath, 'r'+access_type, encoding=encoding)
1275503
def localize(self, mode="r", perm=None, parent_perm=None, **kwargs):
        
        if mode not in ("r", "w"):
            raise Exception("unknown mode '{}', use r or w".format(mode))

        # get additional arguments
        skip_copy = kwargs.pop("skip_copy", False)
        is_tmp = kwargs.pop("is_tmp", mode == "w")

        if mode == "r":
            if is_tmp:
                # create a temporary target
                tmp = self.__class__(is_tmp=self.ext(n=1) or True)

                # always copy
                self.copy_to_local(tmp)

                # yield the copy
                try:
                    yield tmp
                finally:
                    tmp.remove()
            else:
                # simply yield
                yield self

        else:  # write mode
            if is_tmp:
                # create a temporary target
                tmp = self.__class__(is_tmp=self.ext(n=1) or True)

                # copy when existing
                if not skip_copy and self.exists():
                    self.copy_to_local(tmp)

                # yield the copy
                try:
                    yield tmp

                    # move back again
                    if tmp.exists():
                        tmp.move_to_local(self, dir_perm=parent_perm)
                        self.chmod(perm)
                    else:
                        logger.warning("cannot move non-existing localized file target {!r}".format(
                            self))
                finally:
                    tmp.remove()
            else:
                # create the parent dir
                self.parent.touch(perm=parent_perm)

                # simply yield
                yield self

                if self.exists():
                    self.chmod(perm)
1143566
def set_local(self, value, variable_name):
        '''
        
        '''
        self.log('assigning %s = %r', variable_name, value)
        self._locals[variable_name] = value
        return value