code: def is_valid_code(self, code):
          
          if code:
              stock_codes = self.get_stock_codes()
              if code.upper() in stock_codes.keys():
                  return True
              else:
                  return False
docs: :param code: a string stock code
          :return: Boolean