Set the option to repo
518891
def _set_repo_option(repo, option):
    '''
    
    '''
    if not option:
        return
    opt = option.split('=')
    if len(opt) != 2:
        return
    if opt[0] == 'trusted':
        repo['trusted'] = opt[1] == 'yes'
    else:
        repo[opt[0]] = opt[1]
946190
function githubRepo (options) {
  try {
    const url = options.data.root.package.repository.url
    const match = url.match(/.*?(:\/\/|@)github\.com[/:](.*?)(#.*?)?$/)
    if (match) {
      return match[2].replace(/\.git$/, '')
    } else {
      return null
    }
  } catch (e) {
    // No repositor-url exists
    return null
  }
}
864056
def set_status(repo_full_name, repo_sha, state, description, target_url)
      options = {
        :description => description.length > 140 ? "#{description[0..136]}..." : description,
        :context => 'build-buddy',
        :target_url => target_url || ''
      }
      @gh_client.create_status(repo_full_name, repo_sha, state.to_s, options)
    end
894909
public function setDefault(): void
	{
		$repo = $this->getRepository();
		$locales = $repo->findAll();
		foreach ($locales as $locale) {
			/* @var $locale self */
			$locale->default = false;
			$repo->persist($locale);
		}
		$this->default = true;
		$repo->persist($this);
		$repo->flush();
	}
152190
def git_reset(repo, options = {})
      ensure_ready!(:authorization)
      response = connection.delete(git_repo_path(repo), options)
      checked_response_body(response)
    end
395434
def add_repo(repo, overwrite = false)
      raise ArgumentError, "Repo must be of type Gitolite::Config::Repo!" unless repo.instance_of? Gitolite::Config::Repo
      @repos[repo.name] = repo
    end
264112
def set_option(self, name, value):
        """"""
        _assert_value_is_valid(name)
        self._options[name] = value
817118
protected function configure()
    {
        $this->setName('split')
            ->setDescription('Split subtree and push to various remotes.')
            ->addArgument(
                'parent',
                InputArgument::REQUIRED,
                'The parent repository tag to which each component is linked.'
            )
            ->addOption(
                'token',
                't',
                InputOption::VALUE_OPTIONAL,
                sprintf(
                    'A Github Auth Token. If not provided, uses value of environment variable `%s`.',
                    self::TOKEN_ENV
                )
            )
            ->addOption(
                'splitsh',
                null,
                InputOption::VALUE_OPTIONAL,
                'Path to a pre-compiled splitsh-lite binary.'
            )
            ->addOption(
                'component',
                'c',
                InputOption::VALUE_OPTIONAL,
                'Split and release only a single component.'
            );
    }
624096
def run(self, args):
        '''
        
        '''
        command = args[0]
        try:
            if command == 'install':
                self._install(args)
            elif command == 'local':
                self._local(args)
            elif command == 'repo':
                self._repo(args)
            elif command == 'remove':
                self._remove(args)
            elif command == 'build':
                self._build(args)
            elif command == 'update_repo':
                self._download_repo_metadata(args)
            elif command == 'create_repo':
                self._create_repo(args)
            elif command == 'files':
                self._list_files(args)
            elif command == 'info':
                self._info(args)
            elif command == 'list':
                self._list(args)
            elif command == 'close':
                self._close()
            else:
                raise SPMInvocationError('Invalid command \'{0}\''.format(command))
        except SPMException as exc:
            self.ui.error(six.text_type(exc))
1350312
def set_version(self, version, force=True):
        

        if version in self.versions:
            self._version = version
            if 'working' in self.repo.branch().stdout:
                if force:
                    logger.info('Found working branch. Removing...')
                    cmd = self.repo.checkout('master')
                    cmd = self.repo.branch('working', d=True)                    
                else:
                    logger.info('Found working branch from previous session. Use force=True to remove it and start anew.')
                    return

            stdout = self.repo.checkout(version, b='working').stdout  # active version set in 'working' branch
            logger.info('Version {0} set'.format(version))
        else:
            raise AttributeError('Version {0} not found'.format(version))
876531
def repository(self, only):
        
        print("\nCheck and update repositories:\n")
        default = self.meta.default_repositories
        enabled = self.meta.repositories
        if only:
            enabled = only
        for repo in enabled:
            if check_for_local_repos(repo) is True:
                continue
            sys.stdout.write("{0}Check repository [{1}{2}{3}] ... "
                             "{4}".format(
                                    self.meta.color["GREY"],
                                    self.meta.color["CYAN"], repo,
                                    self.meta.color["GREY"],
                                    self.meta.color["ENDC"]))
            sys.stdout.flush()
            if repo in default:
                exec("{0}.{1}()".format(self._init, repo))
                sys.stdout.write(self.done)
            elif repo in enabled:
                Initialization(False).custom(repo)
                sys.stdout.write(self.done)
            else:
                sys.stdout.write(self.error)
        print("")   # new line at end
        raise SystemExit()
156594
def get(self, option, default=undefined, cast=undefined):
        
        if option in self.repository:
            value = self.repository.get(option)
        else:
            value = default

        if isinstance(value, Undefined):
            raise UndefinedValueError('%s option not found and default value was not defined.' % option)

        if isinstance(cast, Undefined):
            cast = lambda v: v  # nop
        elif cast is bool:
            cast = self._cast_boolean

        return cast(value)
543630
function setOptions(opts) {
  opts = opts || {};

  if ((!opts.src || !opts.dest) && opts._.length < 2) {
    var msg = 'please let me know your "src" and "dest" path. \n--> run "assets-bundler -h" for more info.';
    console.error(msg);
    if (opts.parent === 'cmd') process.exit(1);
  }

  if (!opts.src && opts._.length >= 2) opts.src = opts._[0];
  if (!opts.dest && opts._.length >= 2) opts.dest = opts._[1];

  opts.env = opts.env || process.env.NODE_ENV || defaultEnv;
  if (opts.env === 'dev') opts.env = 'development';
  if (opts.env === 'prod') opts.env = 'production';

  debug('options', opts);
  return opts;
}
1029974
def require_repo(directory=None):
    """"""
    if directory and not os.path.isdir(directory):
        raise ValueError('Directory not found: ' + repr(directory))
    repo = repo_path(directory)
    if not os.path.isdir(repo):
        raise RepositoryNotFoundError(directory)
    return repo
387821
def _repo(self, args):
        '''
        
        '''
        args.pop(0)
        command = args[0]
        if command == 'list':
            self._repo_list(args)
        elif command == 'packages':
            self._repo_packages(args)
        elif command == 'search':
            self._repo_packages(args, search=True)
        elif command == 'update':
            self._download_repo_metadata(args)
        elif command == 'create':
            self._create_repo(args)
        else:
            raise SPMInvocationError('Invalid repo command \'{0}\''.format(command))
801030
def down(context, repo_url):
    
    if repo_url == '':
        context.obj.find_repo_type()
        if context.obj.vc_name == 'git':
            context.obj.call(['git', 'pull'])
        elif context.obj.vc_name == 'hg':
            context.obj.call(['hg', 'pull', '-u'])
    else:
        context.obj.call([context.obj.vc_name, 'clone', repo_url])
1037084
def update_repos(self):
        
        with open("{0}{1}".format(self.meta.conf_path,
                                  self.repositories_conf), "w") as new_conf:
            for line in self.conf.splitlines():
                line = line.lstrip()
                if self.tag in line:
                    self.tag_line = True
                if self.tag_line and line.startswith("#"):
                    repo = "".join(line.split("#")).strip()
                    if repo in self.selected:
                        new_conf.write(line.replace(line, repo + "\n"))
                        continue
                if (self.tag_line and not line.startswith("#") and
                        line != self.tag):
                    repo = line.strip()
                    if repo not in self.selected:
                        new_conf.write(line.replace(line, "# " + line + "\n"))
                        continue
                new_conf.write(line + "\n")