-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/disable-preview
- Loading branch information
Showing
10 changed files
with
222 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
[ | ||
{ | ||
"shuttle_id": 63561, | ||
"shuttle_location": "Niue", | ||
"shuttle_type": "Type V5", | ||
"engine_type": "Quantum", | ||
"engine_vendor": "ThetaBase Services", | ||
"engines": 1.0, | ||
"passenger_capacity": 2, | ||
"cancellation_policy": "strict", | ||
"crew": 1.0, | ||
"d_check_complete": false, | ||
"moon_clearance_complete": false, | ||
"price": 1325.0, | ||
"company_id": 35029, | ||
"review_scores_rating": 97, | ||
"review_scores_comfort": 10, | ||
"review_scores_amenities": 9, | ||
"review_scores_trip": 10, | ||
"review_scores_crew": 10, | ||
"review_scores_location": 9, | ||
"review_scores_price": 10, | ||
"number_of_reviews": 133, | ||
"reviews_per_month": 1.65, | ||
"review_id": 1, | ||
"company_rating": 1.0, | ||
"company_location": "Niue", | ||
"total_fleet_count": 4.0, | ||
"iata_approved": false | ||
}, | ||
{ | ||
"shuttle_id": 53260, | ||
"shuttle_location": "Niue", | ||
"shuttle_type": "Type V5", | ||
"engine_type": "Quantum", | ||
"engine_vendor": "Banks, Wood and Phillips", | ||
"engines": 1.0, | ||
"passenger_capacity": 2, | ||
"cancellation_policy": "strict", | ||
"crew": 1.0, | ||
"d_check_complete": false, | ||
"moon_clearance_complete": false, | ||
"price": 1325.0, | ||
"company_id": 35029, | ||
"review_scores_rating": 98, | ||
"review_scores_comfort": 10, | ||
"review_scores_amenities": 9, | ||
"review_scores_trip": 10, | ||
"review_scores_crew": 10, | ||
"review_scores_location": 9, | ||
"review_scores_price": 10, | ||
"number_of_reviews": 37, | ||
"reviews_per_month": 0.48, | ||
"review_id": 1354, | ||
"company_rating": 1.0, | ||
"company_location": "Niue", | ||
"total_fleet_count": 4.0, | ||
"iata_approved": false | ||
}, | ||
{ | ||
"shuttle_id": 51019, | ||
"shuttle_location": "Niue", | ||
"shuttle_type": "Type V5", | ||
"engine_type": "Quantum", | ||
"engine_vendor": "ThetaBase Services", | ||
"engines": 1.0, | ||
"passenger_capacity": 2, | ||
"cancellation_policy": "flexible", | ||
"crew": 1.0, | ||
"d_check_complete": false, | ||
"moon_clearance_complete": false, | ||
"price": 1260.0, | ||
"company_id": 35029, | ||
"review_scores_rating": 92, | ||
"review_scores_comfort": 10, | ||
"review_scores_amenities": 9, | ||
"review_scores_trip": 10, | ||
"review_scores_crew": 10, | ||
"review_scores_location": 9, | ||
"review_scores_price": 9, | ||
"number_of_reviews": 10, | ||
"reviews_per_month": 0.15, | ||
"review_id": 1985, | ||
"company_rating": 1.0, | ||
"company_location": "Niue", | ||
"total_fleet_count": 4.0, | ||
"iata_approved": false | ||
}, | ||
{ | ||
"shuttle_id": 53898, | ||
"shuttle_location": "Niue", | ||
"shuttle_type": "Type V5", | ||
"engine_type": "Plasma", | ||
"engine_vendor": "ThetaBase Services", | ||
"engines": 3.0, | ||
"passenger_capacity": 5, | ||
"cancellation_policy": "strict", | ||
"crew": 3.0, | ||
"d_check_complete": false, | ||
"moon_clearance_complete": false, | ||
"price": 2196.0, | ||
"company_id": 35029, | ||
"review_scores_rating": 98, | ||
"review_scores_comfort": 10, | ||
"review_scores_amenities": 9, | ||
"review_scores_trip": 10, | ||
"review_scores_crew": 10, | ||
"review_scores_location": 9, | ||
"review_scores_price": 10, | ||
"number_of_reviews": 11, | ||
"reviews_per_month": 0.21, | ||
"review_id": 4879, | ||
"company_rating": 1.0, | ||
"company_location": "Niue", | ||
"total_fleet_count": 4.0, | ||
"iata_approved": false | ||
}, | ||
{ | ||
"shuttle_id": 36260, | ||
"shuttle_location": "Anguilla", | ||
"shuttle_type": "Type V5", | ||
"engine_type": "Quantum", | ||
"engine_vendor": "ThetaBase Services", | ||
"engines": 1.0, | ||
"passenger_capacity": 2, | ||
"cancellation_policy": "strict", | ||
"crew": 1.0, | ||
"d_check_complete": true, | ||
"moon_clearance_complete": false, | ||
"price": 1780.0, | ||
"company_id": 30292, | ||
"review_scores_rating": 90, | ||
"review_scores_comfort": 8, | ||
"review_scores_amenities": 9, | ||
"review_scores_trip": 10, | ||
"review_scores_crew": 9, | ||
"review_scores_location": 9, | ||
"review_scores_price": 9, | ||
"number_of_reviews": 3, | ||
"reviews_per_month": 0.09, | ||
"review_id": 2, | ||
"company_rating": 0.67, | ||
"company_location": "Anguilla", | ||
"total_fleet_count": 6.0, | ||
"iata_approved": false | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
"""Transcoding related utility functions.""" | ||
from typing import Tuple | ||
|
||
TRANSCODING_SEPARATOR = "@" | ||
|
||
|
||
def _transcode_split(element: str) -> Tuple[str, str]: | ||
"""Split the name by the transcoding separator. | ||
If the transcoding part is missing, empty string will be put in. | ||
Returns: | ||
Node input/output name before the transcoding separator, if present. | ||
Raises: | ||
ValueError: Raised if more than one transcoding separator | ||
is present in the name. | ||
""" | ||
split_name = element.split(TRANSCODING_SEPARATOR) | ||
|
||
if len(split_name) > 2: # noqa: PLR2004 | ||
raise ValueError( # pragma: no cover | ||
f"Expected maximum 1 transcoding separator, found {len(split_name) - 1} " | ||
f"instead: '{element}'." | ||
) | ||
if len(split_name) == 1: | ||
split_name.append("") | ||
|
||
return tuple(split_name) # type: ignore | ||
|
||
|
||
def _strip_transcoding(element: str) -> str: | ||
"""Strip out the transcoding separator and anything that follows. | ||
Returns: | ||
Node input/output name before the transcoding separator, if present. | ||
Raises: | ||
ValueError: Raised if more than one transcoding separator | ||
is present in the name. | ||
""" | ||
return _transcode_split(element)[0] |