def by_name(self, name):
for d in self.list():<EOL><INDENT>if d['<STR_LIT:name>'] == name:<EOL><INDENT>return self.get(d['<STR_LIT:id>'])<EOL><DEDENT><DEDENT>raise KeyError("<STR_LIT>" % name)<EOL>
Retrieve a droplet by name (return first if duplicated)

Parameters
----------
name: str
    droplet name

Returns
-------
droplet: DropletActions