Did I find the right examples for you? yes no

All Samples(6)  |  Call(4)  |  Derive(0)  |  Import(2)

        def gitrepo(root):
    tmpdir = sh.pwd().strip()
    sh.cd(root)
    gitlog = sh.git('--no-pager', 'log', '-1', pretty="format:%s" % FORMAT).split('\n', 5)
    branch = os.environ.get('CIRCLE_BRANCH') or os.environ.get('TRAVIS_BRANCH', sh.git('rev-parse', '--abbrev-ref', 'HEAD').strip())
    remotes = [x.split() for x in filter(lambda x: x.endswith('(fetch)'), sh.git.remote('-v').strip().splitlines())]
    sh.cd(tmpdir)
    return {
        "head": {
            "id": gitlog[0],
            "author_name": gitlog[1],
            "author_email": gitlog[2],
            "committer_name": gitlog[3],
            "committer_email": gitlog[4],
            "message": gitlog[5].strip(),
        },
        "branch": branch,
        "remotes": [{'name': remote[0], 'url': remote[1]} for remote in remotes]
    }
        


src/p/y/python-coveralls-2.4.2/coveralls/__init__.py   python-coveralls(Download)
def wear(args=None):
    from coveralls.control import coveralls
    from coveralls.repository import gitrepo
    from coveralls.api import post
    import logging
        service_job_id=args.service_job_id,
        service_name=args.service_name,
        git=gitrepo(args.base_dir),
        source_files=coverage.coveralls(args.base_dir, ignore_errors=args.ignore_errors),
    )

src/p/y/python-coveralls-HEAD/coveralls/__init__.py   python-coveralls(Download)
def wear(args=None):
    from coveralls.control import coveralls
    from coveralls.repository import gitrepo
    from coveralls.api import post
    import logging
        service_job_id=args.service_job_id,
        service_name=args.service_name,
        git=gitrepo(args.base_dir),
        source_files=coverage.coveralls(args.base_dir, ignore_errors=args.ignore_errors),
    )

src/p/y/python-coveralls-HEAD/coveralls/tests.py   python-coveralls(Download)
    def test_gitrepo(self):
        git = repository.gitrepo(Arguments.base_dir)
        self.assertEqual(git['head'], GIT_EXP['head'])
        self.assertEqual(git['remotes'], GIT_EXP['remotes'])
        self.assertTrue(git['branch'] in (GIT_EXP['branch'], 'HEAD'))

src/p/y/python-coveralls-2.4.2/coveralls/tests.py   python-coveralls(Download)
    def test_gitrepo(self):
        git = repository.gitrepo(Arguments.base_dir)
        self.assertEqual(git['head'], GIT_EXP['head'])
        self.assertEqual(git['remotes'], GIT_EXP['remotes'])
        self.assertTrue(git['branch'] in (GIT_EXP['branch'], 'HEAD'))