```
#!/usr/bin/env python3
import string
import boto3
import sys
import argparse
instance_id = sys.argv[1].split(',')
tagname = sys.argv[2]
tagvalue = sys.argv[3]
ec2= boto3.resource('ec2', region_name='us-west-1')
print(instance_id)
def tag_instance(instance_id,tagname,tagvalue):
TAGS = [
{
'Key': tagname,
'Value': tagvalue
}
]
#instances = ec2.instances(instance_id)
#instances = []
#instances.append(instance_id)
#print(instances)
instances = ec2.instances(instance_id)
print(instances)
for instance in instances:
instance.create_tags(Tags=TAGS)
print(f'Tags successfully added to the instance {instance.id}')
#print(f'EC2 instance {instance.id}" information:')
tag_instance(instance_id,tagname,tagvalue)
```
getting error
TypeError: 'ec2.instancesCollectionManager' object is not callable