<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_parameters_by_location(self, locations=None, excludes=None):
 """ Get parameters list by location :param locations: list of locations :type locations: list or None :param excludes: list of excludes locations :type excludes: list or None :return: list of Parameter :rtype: list """

        result = self.parameters
        if locations:
            result = filter(lambda x: x.location_in in locations, result)
        if excludes:
            result = filter(lambda x: x.location_in not in excludes, result)
        return list(result)