Searches the database for a planet. Input can be complete ie GJ1214b, alternate name variations or even
        just 1214.

        :param name: the name of the planet to search
        :return: dictionary of results as planetname -> planet object
179094
def searchPlanet(self, name):
        

        searchName = compactString(name)
        returnDict = {}

        for altname, planetObj in self._planetSearchDict.iteritems():
            if re.search(searchName, altname):
                returnDict[planetObj.name] = planetObj

        if returnDict:
            if len(returnDict) == 1:
                return returnDict.values()[0]
            else:
                return returnDict.values()

        else:
            return False
986849
def get_body(name):
    

    body = Pck()[name]
    body.propagate = lambda date: get_orbit(name, date)
    return body
1130959
def search_by_name(cls, query, name):
        
        query = query.filter(db.or_(cls.first_name.contains(name),
                                    cls.last_name.contains(name)))
        return query
164584
def get_variant_by_name(self, name):
        
        results = []

        try:
            for info, dosage in self._bgen.get_variant(name):
                results.append(Genotypes(
                    Variant(
                        info.name,
                        CHROM_STR_ENCODE.get(info.chrom, info.chrom),
                        info.pos,
                        [info.a1, info.a2],
                    ),
                    dosage,
                    reference=info.a1,
                    coded=info.a2,
                    multiallelic=False,
                ))

        except ValueError:
            logging.variant_name_not_found(name)

        return results
1166990
def getVariantSetByName(self, name):
        
        if name not in self._variantSetNameMap:
            raise exceptions.VariantSetNameNotFoundException(name)
        return self._variantSetNameMap[name]
820328
def uniqueName(self, name):
        
        try:
            suffix = self.name_suffixes[name]
        except KeyError:
            self.name_suffixes[name] = 0
            return name

        suffix += 1
        self.name_suffixes[name] = suffix

        return "%s%i" % (name, suffix)
842217
def getFeatureSetByName(self, name):
        
        if name not in self._featureSetNameMap:
            raise exceptions.FeatureSetNameNotFoundException(name)
        return self._featureSetNameMap[name]
1370460
def database(self, database_name):
        
        if database_name and MongoDB.valid_mongodb_name(database_name):
            self._database = self.client[database_name]
        else:
            raise ShellError(f"'{database_name}' is not a valid database name")
378728
def table(self, name: str):
        
        if self._check_db() == False:
            return
        try:
            res = self.getall(name)
        except Exception as e:
            self.err(e, self.table, "Can not get records from database")
            return
        if res is None:
            self.warning("Table", name, "does not contain any record")
            return
        num = len(res)
        self.info(num, "rows")
        self.info("Fields:", ", ".join(list(res)))
1096955
def get_id_by_name(self, obj, name):
        
        list = self.list(obj, filter='name = "{}"'.format(name),
                         only_id=True, limit=1)
        return list[name] if name in list.keys() else False
311768
def fetch_by_relname(self, name):
        

        ormclass = self._mapped[name]
        query = self.session.query(ormclass)

        if name != carr_ormclass:

            query = query.filter(
                ormclass.scn_name == self.scn_name)

        if self.version:
            query = query.filter(ormclass.version == self.version)

        # TODO: Naming is not consistent. Change in database required.
        if name == 'Transformer':
            name = 'Trafo'

        df = pd.read_sql(query.statement,
                         self.session.bind,
                         index_col=name.lower() + '_id')
        if name == 'Link':
            df['bus0'] = df.bus0.astype(int)
            df['bus1'] = df.bus1.astype(int)

        if 'source' in df:
            df.source = df.source.map(self.id_to_source())

        return df
494234
def find(cls, name):
        
        try:
            return cls._member_map_[name]
        except KeyError:
            for ctype in cls._member_map_.values():
                if ctype.name == name:
                    return ctype
            raise ValueError('%s is not a valid %s' % (name, cls.__name__))
625048
def _getsatname(self):
        
        if self.platform_name.startswith("Meteosat"):
            return self.platform_name
        else:
            raise NotImplementedError(
                'Platform {0} not yet supported...'.format(self.platform_name))
908787
def search(self, name):
        
        pattern = re.compile(name)
        result = {}
        for i in self.__allstockno:
            query = re.search(pattern, self.__allstockno[i])
            if query:
                query.group()
                result[i] = self.__allstockno[i]
        return result
670172
def _get_name(self):
        
        if self._name is None:
            self._name = self._generate_name()
        return self._name
1001094
def _get_platform_name(ncattr):
        """"""
        match = re.match(r'G-(\d+)', ncattr)
        if match:
            return SPACECRAFTS.get(int(match.groups()[0]))

        return None
1306225
def get_object_by_name(self, name):
        
        for obj in self.objects:
            if obj.name == name:
                return obj
        raise ValueError