<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_trainer_from_username(self, username, detail=False):
 		"""Returns a Trainer object from a Trainers username"""

		params = {
			'detail': '1' if detail is True else '0',
			'q': username
		}
		r = requests.get(api_url+'trainers/', params=params, headers=self.headers)
		print(request_status(r))
		try:
			r = r.json()[0]
		except IndexError:
			return None
		return Trainer(r) if r else None