Skip to content

Instantly share code, notes, and snippets.

@jself
Last active December 14, 2015 17:49
Show Gist options
  • Save jself/5124848 to your computer and use it in GitHub Desktop.
Save jself/5124848 to your computer and use it in GitHub Desktop.
def get_agent_id(self, agent_id):
if not hasattr(self, '_agent_ids'):
self._agent_ids = {}
if agent_id in self.agent_ids:
return self.agent_ids[agent_id]
a_id_list = self.list_agent_id()
for a in a_id_list:
if a == agent_id:
self.agent_ids[agent_id] = a
return a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment