def __extract_resources_from_droplets(self, data):
resources = []<EOL>if not isinstance(data, list): return data<EOL>for a_droplet in data:<EOL><INDENT>res = {}<EOL>try:<EOL><INDENT>if isinstance(a_droplet, unicode):<EOL><INDENT>res = {"<STR_LIT>": a_droplet, "<STR_LIT>": "<STR_LIT>"}<EOL><DEDENT><DEDENT>except NameError:<EOL><INDENT>pass<EOL><DEDENT>if isinstance(a_droplet, str) or isinstance(a_droplet, int):<EOL><INDENT>res = {"<STR_LIT>": str(a_droplet), "<STR_LIT>": "<STR_LIT>"}<EOL><DEDENT>elif isinstance(a_droplet, Droplet):<EOL><INDENT>res = {"<STR_LIT>": str(a_droplet.id), "<STR_LIT>": "<STR_LIT>"}<EOL><DEDENT>if len(res) > <NUM_LIT:0>:<EOL><INDENT>resources.append(res)<EOL><DEDENT><DEDENT>return resources<EOL>
Private method to extract from a value, the resources.
It will check the type of object in the array provided and build
the right structure for the API.