def info(self, query):

        import yaml

        class Timestamp(yaml.YAMLObject, dict):

            yaml_tag = '!timestamp'

            def __setstate__(self, state):
                self['at'] = state['at'][:state['at'].index(' ')]

        class Version(yaml.YAMLObject, dict):

            yaml_tag = '!ruby/object:Gem::Version'

            def __setstate__(self, state):
                self['version'] = state['version']


        class Requirement(yaml.YAMLObject, dict):

            yaml_tag = '!ruby/object:Gem::Requirement'

            def __setstate__(self, state):
                r = state['requirements'].pop()
                self['requirement'] = '{} {}'.format(r.pop(0), r.pop(0)['version'])


        class Dependency(yaml.YAMLObject, dict):

            yaml_tag = '!ruby/object:Gem::Dependency'

            def __setstate__(self, state):
                for require in [r for r in state.keys() if 'require' in r]:
                    try:
                        self['requirement'] = state[require]['requirement']
                        break
                    except KeyError:
                        continue
                self['name'] = state['name']
                self['type'] = state['type']


        class GemSpec(yaml.YAMLObject, dict):

            yaml_tag = '!ruby/object:Gem::Specification'

            def __setstate__(self, state):
                for k, v in [st for st in state.items() if st[1]]:
                    if isinstance(v, list):
                        if k == 'dependencies':
                            s = []
                            mx = 0
                            for dep in v:
                                mx = max(len(dep['name']), mx)
                                s.append((dep['name'], dep['type'], dep['requirement']))
                            mx += 1
                            s = '\n'.join(['{:{}}{:12} {:12}'.format(t[0], mx, t[1], t[2]) for t in s])
                            v = s
                        else:
                            v = ', '.join(v)
                    if isinstance(v, Timestamp):
                        v = v['at']
                    if isinstance(v, Version):
                        v = v['version']
                    if isinstance(v, Requirement):
                        v = v['requirement']
                    if not isinstance(v, str):
                        v = str(v)
                    self.update([(k, v)])

        response = self.command('specification -qb --yaml', query)[0].decode(*enc)
        if 'ERROR:' in response:
            return ['Aboted: {}\n'.format(response)]
        from re import sub
        result = yaml.load(sub(r'!binary', r'!!binary', response))
        try:
            return sorted(result.items())
        except AttributeError:
            return ['Aborted: No info available for a gem called: {}\n'.format(query)]
dataset/ETHPy150Open Aeronautics/aero/aero/adapters/gem.py/Gem.info/original