def get_version(self, spec=None):
        if self.detect_presence():
            if spec is not None:
                command = ['bzr log -r %s .' % sanitized(spec)]
                _, output, _ = run_shell_command(command,
                                                 shell=True,
                                                 cwd=self._path,
                                                 us_env=True)
                if output is None or output.strip() == '' or output.startswith("bzr:"):
                    return None
                else:
                    matches = [l for l in output.split('\n') if l.startswith('revno: ')]
                    if len(matches) == 1:
                        return matches[0].split()[1]
            else:
                _, output, _ = run_shell_command('bzr revno --tree',
                                                 shell=True,
                                                 cwd=self._path,
                                                 us_env=True)
                return output.strip()
Solve a generic system of polynomial equations.
dataset/ETHPy150Open vcstools/vcstools/src/vcstools/bzr.py/BzrClient.get_version--crossover with--dataset/ETHPy150Open sympy/sympy/sympy/solvers/polysys.py/solve_generic