def find_market(self, string):
    if (not self.markets):
        self.raise_error(ExchangeError, details='Markets not loaded')
    if isinstance(string, basestring):
        if (string in self.markets_by_id):
            return self.markets_by_id[string]
        if (string in self.markets):
            return self.markets[string]
    return string
def find_market(self, string):
    if (not self.markets):
        self.raise_error(ExchangeError, details='Markets not loaded')
    if isinstance(string, basestring):
        if (string in self.markets_by_id):
            return self.markets_by_id[string]
        if (string in self.markets):
            return self.markets[string]
    return string