Clone the environment `clone` into `name` or `prefix`.
551566
def clone_environment(self, clone, name=None, prefix=None, **kwargs):
        """"""
        cmd_list = ['create', '--json']

        if (name and prefix) or not (name or prefix):
            raise TypeError("conda clone_environment: exactly one of `name` "
                            "or `path` required")

        if name:
            cmd_list.extend(['--name', name])

        if prefix:
            cmd_list.extend(['--prefix', prefix])

        cmd_list.extend(['--clone', clone])

        cmd_list.extend(
            self._setup_install_commands_from_kwargs(
                kwargs,
                ('dry_run', 'unknown', 'use_index_cache', 'use_local',
                 'no_pin', 'force', 'all', 'channel', 'override_channels',
                 'no_default_packages')))

        return self._call_and_parse(cmd_list, abspath=kwargs.get('abspath',
                                                                 True))
861125
def rename(self, name):
        """"""
        self.ec2.create_tags(Resources = [self.instance_id],
                             Tags      = [{'Key':   'Name',
                                           'Value':  name}])
        self.refresh_info()
704678
def clone(self, repo, ref, deps=()):
        """"""

        if os.path.isdir(repo):
            repo = os.path.abspath(repo)

        def clone_strategy(directory):
            env = git.no_git_env()

            def _git_cmd(*args):
                cmd_output('git', *args, cwd=directory, env=env)

            _git_cmd('init', '.')
            _git_cmd('remote', 'add', 'origin', repo)

            try:
                self._shallow_clone(ref, _git_cmd)
            except CalledProcessError:
                self._complete_clone(ref, _git_cmd)

        return self._new_repo(repo, ref, deps, clone_strategy)
759340
def from_prefix(cls, container, prefix):
        """"""
        if cls._is_gs_folder(prefix):
            name, suffix, extra = prefix.name.partition(cls._gs_folder_suffix)
            if (suffix, extra) == (cls._gs_folder_suffix, ''):
                # Patch GS specific folder to remove suffix.
                prefix.name = name

        return super(GsObject, cls).from_prefix(container, prefix)
1253808
def clone(cls, name, vhost, directory, origin):
        """"""
        paas_info = cls.info(name)

        if 'php' in paas_info['type'] and not vhost:
            cls.error('PHP instances require indicating the VHOST to clone '
                      'with --vhost <vhost>')

        paas_access = '%s@%s' % (paas_info['user'], paas_info['git_server'])
        remote_url = 'ssh+git://%s/%s.git' % (paas_access, vhost)

        command = 'git clone %s %s --origin %s' \
                  % (remote_url, directory, origin)

        init_git = cls.execute(command)
        if init_git:
            cls.echo('Use `git push %s master` to push your code to the '
                     'instance.' % (origin))
            cls.echo('Then `$ gandi deploy` to build and deploy your '
                     'application.')
495521
def clone(self, name=None):
    

    if name is None:
      name = self.module_name + "_clone"
    return MLP(
        name=name,
        output_sizes=self.output_sizes,
        activation=self.activation,
        activate_final=self.activate_final,
        initializers=self.initializers,
        partitioners=self.partitioners,
        regularizers=self.regularizers,
        use_bias=self.use_bias,
        use_dropout=self.use_dropout)
897742
def clone(cls, srcpath, destpath):
        """"""
        # Mercurial will not create intermediate directories for clones.
        try:
            os.makedirs(destpath)
        except OSError as e:
            if not e.errno == errno.EEXIST:
                raise
        cmd = [HG, 'clone', '--quiet', '--noupdate', srcpath, destpath]
        subprocess.check_call(cmd)
        return cls(destpath)
769614
def clone(self):
        
        return Monitor(org=self.org, app=self.app, env=self.env)
16508
function clone(source) {
    var ret = {};
    for (var prop in source) {
      ret[prop] = source[prop];
    }
    return ret;
  }
54370
def clone(self, **kw):
        """"""
        names = 'project_name version py_version platform location precedence'
        for attr in names.split():
            kw.setdefault(attr, getattr(self, attr, None))
        kw.setdefault('metadata', self._provider)
        return self.__class__(**kw)
192730
def using(self, alias):
        
        clone = self._clone()
        clone._index = alias
        return clone
1163963
def from_prefix(cls, container, prefix):
        """"""
        if prefix is None:
            raise errors.NoObjectException

        return cls(container,
                   name=prefix.name,
                   obj_type=cls.type_cls.SUBDIR)
1002575
def clone(self, **kwargs):
        """"""
        init_kwargs = {
            "name": self.__name,
            "dataframe": self.__df,
            "include_columns": self.__include_columns,
            "include_index": self.__include_index,
            "style": self.__style,
            "column_styles": self.__col_styles,
            "column_widths": self.__column_widths,
            "row_styles": self.__row_styles,
            "header_style": self.header_style,
            "index_style": self.index_style
        }
        init_kwargs.update(kwargs)
        return self.__class__(**init_kwargs)
838358
def _clone_vm(image=None, name=None, session=None):
    '''
    

    '''
    if session is None:
        session = _get_session()
    log.debug('Creating VM %s by cloning %s', name, image)
    source = _get_vm(image, session)
    task = session.xenapi.Async.VM.clone(source, name)
    _run_async_task(task, session)
514812
def clone(cls, srcpath, destpath):
        """"""
        try:
            os.makedirs(destpath)
        except OSError as e:
            if not e.errno == errno.EEXIST:
                raise
        cmd = [SVNADMIN, 'dump', '--quiet', '.']
        dump = subprocess.Popen(
               cmd, cwd=srcpath, stdout=subprocess.PIPE,
               stderr=subprocess.PIPE,
        )
        repo = cls.create(destpath)
        repo.load(dump.stdout)
        stderr = dump.stderr.read()
        dump.stdout.close()
        dump.stderr.close()
        dump.wait()
        if dump.returncode != 0:
            raise subprocess.CalledProcessError(dump.returncode, cmd, stderr)
        return repo
918866
def clone(self):
        
        clone = copy.copy(self)
        clone._unused = clone._unused.clone()
        return clone
401329
def clone_source(self):
        "  "

        print_header('Clone src: %s' % self.src, '-')

        # Get source
        source_dir = self._get_source()

        # Append settings from source
        self.read(op.join(source_dir, settings.CFGNAME))

        self.templates += (self.args.template or self.template).split(',')
        self.templates = OrderedSet(self._gen_templates(self.templates))
        self['template'] = ','.join(str(x[0]) for x in self.templates)

        print_header('Deploy templates: %s' % self.template, sep='-')
        with open(op.join(self.deploy_dir, settings.TPLNAME), 'w') as f:
            f.write(self.template)

        with open(op.join(self.deploy_dir, settings.CFGNAME), 'w') as f:
            self['deploy_dir'], tmp_dir = self.target_dir, self.deploy_dir
            self.write(f)
            self['deploy_dir'] = tmp_dir

        # Create site
        site = Site(self.deploy_dir)

        # Prepare templates
        for template_name, template in self.templates:
            site.paste_template(template_name, template, tmp_dir)

        # Create site
        if self.args.info:
            print_header('Project context', sep='-')
            LOGGER.debug(site.get_info(full=True))
            return None

        # Check requirements
        call('sudo chmod +x %s/*.sh' % self.service_dir)
        site.run_check(service_dir=self.service_dir)

        # Save options
        site.write()

        return site