def airports_codes_from_city(name, airports_list, airport_type):
    """
        Here we finding all airports(their codes) in city or state.
        :param name: name of airport we gonna check
        :param airports_list: list of all airports
        :param airport_type: type of :param name: - 'code', 'city', 'state'
        :return: list of airports codes
    """
    temp = []
    for airport in airports_list:
        if name.lower() == airport[airport_type].lower():
            temp.append(airport['code'])
    return temp