Return a list of content types in a repository.

    :param Repo repo:
        The git repository.
    :returns: list
328726
def list_content_types(repo):
    
    schema_files = glob.glob(
        os.path.join(repo.working_dir, '_schemas', '*.avsc'))
    return [os.path.splitext(os.path.basename(schema_file))[0]
            for schema_file in schema_files]
1255981
def list(user_name, repo_name, params={})
      update_and_validate_user_repo_params(user_name, repo_name)
      normalize! params

      response = get_request("/2.0/repositories/#{user}/#{repo.downcase}/components", params)
      return response['values'] unless block_given?
      response['values'].each { |el| yield el }
    end
1262024
def format_repo_status(repo):
    
    commit = repo.commit()
    return {
        'name': os.path.basename(repo.working_dir),
        'commit': commit.hexsha,
        'timestamp': datetime.fromtimestamp(
            commit.committed_date).isoformat(),
    }
382962
def has_repo(self, repo):
        
        url = self._build_url('repos', repo, base_url=self._api)
        return self._boolean(self._get(url), 204, 404)
1110166
def search_repository_configuration(url, page_size=10, page_index=0, sort=""):
    
    content = search_repository_configuration_raw(url, page_size, page_index, sort)
    if content:
        return utils.format_json_list(content)
611721
public function getContents($owner, $repo, $path, $ref = null)
	{
		$data = array();
		if(!is_null($ref))
			$data['ref'] = $ref;
		
		return $this->client->request("/repos/$owner/$repo/contents/$path", 'GET', $data, 200, 'GitHubContents');
	}
913757
def get_repo_config(self, repo='default'):
        
        for repo_config in self.repositories:
            if repo_config.name == repo or repo_config.url in RepositoryURL(repo):
                return repo_config

        return None
935443
def _parse_repo(self, xml):
        
        self.name = get_attrib(xml, "name", "repo")
        self.username = get_attrib(xml, "user", "repo")
        self.apikey = get_attrib(xml, "apikey", "repo")
        self.organization = get_attrib(xml, "organization")
        self.staging = get_attrib(xml, "staging", "repo")
880016
def tag(self, repository_tag, tags=[]):
        
        if not isinstance(repository_tag, six.string_types):
            raise TypeError('repository_tag must be a string')

        if not isinstance(tags, list):
            raise TypeError('tags must be a list.')

        if ':' in repository_tag:
            repository, tag = repository_tag.split(':')
            tags.append(tag)
        else:
            repository = repository_tag

            if not tags:
                tags.append('latest')

        for tag in tags:
            repo_tag = "{0}:{1}".format(repository, tag)

            if repo_tag not in self.repo_tags:
                logger.info("Tagging Image: {0} Repo Tag: {1}".format(self.identifier, repo_tag))
                self.repo_tags = self.repo_tags + (repo_tag, )

                # always going to force tags until a feature is added to allow users to specify.
                try:
                    self.client.tag(self.id, repository, tag)
                except:
                    self.client.tag(self.id, repository, tag, force=True)
737761
def _fields_common(self):
        
        result = {}
        if not self.testmode:
            result["__reponame__"] = self.repo.repo.full_name
            result["__repodesc__"] = self.repo.repo.description
            result["__repourl__"] = self.repo.repo.html_url
            result["__repodir__"] = self.repodir

            if self.organization is not None:
                owner = self.repo.organization
            else:
                owner = self.repo.user
                
            result["__username__"] = owner.name
            result["__userurl__"] = owner.html_url
            result["__useravatar__"] = owner.avatar_url
            result["__useremail__"] = owner.email

        return result
273064
def get_repositories_by_composition(self, *args, **kwargs):
        """"""
        # Implemented from kitosid template for -
        # osid.resource.ResourceBinSession.get_bins_by_resource
        catalogs = self._get_provider_session('composition_repository_session').get_repositories_by_composition(*args, **kwargs)
        cat_list = []
        for cat in catalogs:
            cat_list.append(Repository(self._provider_manager, cat, self._runtime, self._proxy))
        return RepositoryList(cat_list)
896398
def load_model_class(repo, content_type):
    
    schema = get_schema(repo, content_type).to_json()
    return deserialize(schema, module_name=schema['namespace'])
1057962
def package_list(self, repo, name, INDEX, installed):
        
        tty_size = os.popen("stty size", "r").read().split()
        row = int(tty_size[0]) - 2
        try:
            all_installed_names = []
            index, page, pkg_list = 0, row, []
            r = self.list_lib(repo)
            pkg_list = self.list_greps(repo, r)[0]
            all_installed_names = self.list_of_installed(repo, name)
            print("")
            for pkg in sorted(pkg_list):
                pkg = self._splitting_packages(pkg, repo, name)
                if installed:
                    if repo == "sbo":
                        if pkg in all_installed_names:
                            pkg = ("{0}{1}{2}".format(self.meta.color["GREEN"],
                                                      pkg,
                                                      self.meta.color["ENDC"]))
                    else:
                        if pkg in all_installed_names:
                            pkg = ("{0}{1}{2}".format(self.meta.color["GREEN"],
                                                      pkg,
                                                      self.meta.color["ENDC"]))
                if INDEX:
                    index += 1
                    pkg = self.list_color_tag(pkg)
                    print("{0}{1}:{2} {3}".format(
                        self.meta.color["GREY"], index,
                        self.meta.color["ENDC"], pkg))
                    if index == page:
                        read = raw_input("\nPress {0}Enter{1} to "
                                         "continue... ".format(
                                             self.meta.color["CYAN"],
                                             self.meta.color["ENDC"]))
                        if read in ["Q", "q"]:
                            break
                        print("")   # new line after page
                        page += row
                else:
                    print(pkg)
            print("")   # new line at end
        except EOFError:
            print("")   # new line at exit
            raise SystemExit()
349477
def resource_names(self, repo_type):
        
        try:
            names = self._resource_names[repo_type]
        except KeyError:
            names = [self.name, self.name.upper()]
        return names
1225624
def _get_repos(self):
        
        result = {}
        for xmlpath in self.installed:
            repo = RepositorySettings(self, xmlpath)
            result[repo.name.lower()] = repo

        return result
1103886
def get_content(self, content_type=github.GithubObject.NotSet):
        
        if self.content_url == None:
            return None
            
        if content_type == "PullRequest":
            headers, data = self._requester.requestJsonAndCheck(
                "GET",
                self.content_url.replace("issues", "pulls")
            )
            return github.PullRequest.PullRequest(self._requester, headers, data, completed=True)
        elif content_type is github.GithubObject.NotSet or content_type == "Issue":
            headers, data = self._requester.requestJsonAndCheck(
                "GET",
                self.content_url
            )
            return github.Issue.Issue(self._requester, headers, data, completed=True)
        else:
            assert False, "Unknown content type: %s" % content_type
342095
def repo_all_list(self, project_key):
        
        url = 'rest/api/1.0/projects/{projectKey}/repos'.format(projectKey=project_key)
        params = {}
        start = 0
        params['start'] = start
        response = self.get(url, params=params)
        if 'values' not in response:
            return []
        repo_list = (response or {}).get('values')
        while not response.get('isLastPage'):
            start = response.get('nextPageStart')
            params['start'] = start
            response = self.get(url, params=params)
            repo_list += (response or {}).get('values')
        return repo_list