Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_convert_values_to_list(self):
d = {1: None, 2: "b", 3: ["c"]}
expected = {1: [], 2: ["b"], 3: ["c"]}
assert convert_values_to_list(d) == expected
Search multiple geography terms
```python
>>> df = Geographies().search(term=["Liverpool", "Southampton"]).to_df()
```
returns
| | id | name | layer |
|---:|:------------------|:-----------------------|:-------------|
| 0 | b63d8f625669fd... | Liverpool [GB] | ['port'] |
| 1 | 0cb7d4566de0f2... | Southampton [GB] | ['port'] |
| 2 | 8b4273e3181f2d... | Liverpool Docks | ['terminal'] |
| 3 | 98c50b0d2ee2b1... | Liverpool Bulk Liquids | ['terminal'] |
"""
api_params = convert_values_to_list({"term": term})
return GeographyResult(
super().search(exact_term_match=exact_term_match, **api_params)
)
Search multiple geography terms
```python
>>> df = Geographies().search(term=["Liverpool", "Southampton"]).to_df()
```
returns
| | id | name | layer |
|---:|:------------------|:-----------------------|:-------------|
| 0 | b63d8f625669fd... | Liverpool [GB] | ['port'] |
| 1 | 0cb7d4566de0f2... | Southampton [GB] | ['port'] |
| 2 | 8b4273e3181f2d... | Liverpool Docks | ['terminal'] |
| 3 | 98c50b0d2ee2b1... | Liverpool Bulk Liquids | ['terminal'] |
"""
params = convert_values_to_list({"term": term})
return GeographyResult(super().search(**params))
| 1 | b6384cf17f1639a64bbff04cfd32257bf732a3a13e4b0532802a9ae84a36be34 | 5XJAPANESE | ['commercial_owner'] |
Let's find all corporations with 'do' in the name.
```python
>>> [x.name for x in Corporations().search(term="do").to_list()]
[...]
```
# Further Documentation
[VortexaAPI Corporation Reference](https://docs.vortexa.com/reference/POST/reference/charterers)
"""
params = convert_values_to_list({"term": term})
return CorporationsResult(super().search(**params))