<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def from_country(cls, country):
 """Retrieve the first datacenter id associated to a country."""

        result = cls.list({'sort_by': 'id ASC'})
        dc_countries = {}
        for dc in result:
            if dc['country'] not in dc_countries:
                dc_countries[dc['country']] = dc['id']

        return dc_countries.get(country)