def take_action(self, parsed_args):
        self.log.debug('take_action({a})'.format(a=parsed_args))

        args = {}
        args_id = {}
        args_followers = {}

        if parsed_args.limit:
            args['limit'] = parsed_args.limit

        if parsed_args.status:
            args['status'] = parsed_args.status

        if parsed_args.kind:
            args['kind'] = parsed_args.kind

        if parsed_args.priority:
            args['priority'] = parsed_args.priority

        if parsed_args.reported_by:
            args['reported_by'] = parsed_args.reported_by

        if parsed_args.is_spam:
            args['is_spam'] = parsed_args.is_spam

        if parsed_args.search:
            args['search'] = parsed_args.search

        if parsed_args.id:
            args_id['id'] = parsed_args.id

        if parsed_args.followers:
            args_followers['followers'] = parsed_args.followers

        issuelist_url = {}
        issuedetail_url = {}
        issuefilter_url = {}
        issuefollowers_url = {}

        if all([not(args),
                not(args_id),
                not(args_followers)]):
            url = ("https://bitbucket.org/api/1.0/"
                   "repositories/{a.account}/{a.reponame}/"
                   "issues/?").format(a=parsed_args)
            issuelist_url['url'] = url
        elif args == {} and args_followers == {} and args_id != {}:
            url = ("https://bitbucket.org/api/1.0/"
                   "repositories/{a.account}/{a.reponame}/"
                   "issues/{a.id}").format(a=parsed_args)
            issuedetail_url['url'] = url
        elif args_id == {} and args_followers == {} and args != {}:
            primaryurl = ("https://bitbucket.org/api/1.0/"
                          "repositories/{a.account}/{a.reponame}/"
                          "issues/?").format(a=parsed_args)
            params = urllib.urlencode(args)
            url = primaryurl + params
            issuefilter_url['url'] = url
        elif args == {} and args_id != {} and args_followers != {}:
            url = ("https://bitbucket.org/api/1.0/"
                   "repositories/{a.account}/{a.reponame}/"
                   "issues/{a.id}/"
                   "followers").format(a=parsed_args)
            issuefollowers_url['url'] = url
        else:
            self.app.stdout.write('\nInvalid argument supplied.\n')
            sys.exit(1)

        r = requests.get(url, auth=(user, passwd))

        try:
            data = json.loads(r.text)
        except:
            print """
 Error: '404' No Issues Found ' or ' Invalid argument supplied.
"""
            sys.exit(1)

        if all([issuelist_url,
                not(issuedetail_url),
                not(issuefilter_url),
                not(issuefollowers_url)]):
            if parsed_args.export:
                csvdata = tablib.Dataset()
                csvdata.headers = [
                    "ID",
                    "Status",
                    "Title",
                    "Kind",
                    "Priority",
                    "Version",
                    "Component",
                    "Milestone",
                    "Reported By",
                    "Created On",
                    "Last Updated",
                    "Responsible",
                    "Comment Count",
                    "is_spam",
                    "Followers Count"]

                with open('issues.xls', 'wb') as f:
                    for i in data['issues']:
                        row = []
                        if 'local_id' in i:
                            row.append(i['local_id'])
                        else:
                            row.append('None')

                        if 'status' in i:
                            row.append(i['status'])
                        else:
                            row.append('None')

                        if 'title' in i:
                            row.append(i['title'])
                        else:
                            row.append('None')

                        if 'metadata' in i:
                            row.append(i['metadata']['kind'])
                        else:
                            row.append('None')

                        if 'priority' in i:
                            row.append(i['priority'])
                        else:
                            row.append('None')

                        if 'metadata' in i:
                            row.append(i['metadata']['version'])
                        else:
                            row.append('None')

                        if 'metadata' in i:
                            row.append(i['metadata']['component'])
                        else:
                            row.append('None')

                        if 'metadata' in i:
                            row.append(i['metadata']['milestone'])
                        else:
                            row.append('None')

                        if 'reported_by' in i:
                            row.append(i['reported_by']['username'])
                        else:
                            row.append('None')

                        if 'utc_created_on' in i:
                            row.append(i['utc_created_on'])
                        else:
                            row.append('None')

                        if 'utc_last_updated' in i:
                            row.append(i['utc_last_updated'])
                        else:
                            row.append('None')

                        if 'responsible' in i:
                            row.append(i['responsible']['username'])
                        else:
                            row.append('None')

                        if 'comment_count' in i:
                            row.append(i['comment_count'])
                        else:
                            row.append('None')

                        if 'is_spam' in i:
                            row.append(i['is_spam'])
                        else:
                            row.append('None')

                        if 'follower_count' in i:
                            row.append(i['follower_count'])
                        else:
                            row.append('None')

                        csvdata.append(row)
                    f.write(csvdata.csv)
                    f.close()
                    print "\n CSV File created.\n"
                    sys.exit(0)
            else:
                print "\nTotal Issues: {d[count]}\n".format(d=data)

                loopmsg = """Issue_ID: {i[local_id]}
Issue_Status: {i[status]}
Issue_Title: {i[title]}
======================================================================="""

                for i in data['issues']:
                    print loopmsg.format(i=i)
                sys.exit(0)
        elif all([issuedetail_url,
                  not(issuelist_url),
                  not(issuefilter_url),
                  not(issuefollowers_url)]):
            newdata = {}
            newdata['issue id'] = data['local_id']
            newdata['status'] = data['status']
            newdata['kind'] = data['metadata']['kind']
            newdata['priority'] = data['priority']
            newdata['version'] = data['metadata']['version']
            newdata['component'] = data['metadata']['component']
            newdata['milestone'] = data['metadata']['milestone']
            newdata['reported by'] = data['reported_by']['username']
            newdata['utc_created_on'] = data['utc_created_on']
            newdata['utc_last_updated'] = data['utc_last_updated']
            newdata['responsible'] = data['responsible']['username']
            newdata['created on'] = data['created_on']
            newdata['comment_count'] = data['comment_count']
            newdata['is_spam'] = data['is_spam']
            newdata['follower_count'] = data['follower_count']
            columns = newdata.viewkeys()
            columndata = newdata.viewvalues()
            print "\nTitle: %s\n" % (data['title'])
            print "Content: %s\n" % (data['content'])
            return (columns, columndata)
        elif all([issuefilter_url,
                  not(issuelist_url),
                  not(issuedetail_url),
                  not(issuefollowers_url)]):
            if parsed_args.export:
                csvdata = tablib.Dataset()
                csvdata.headers = [
                    "ID",
                    "Status",
                    "Title",
                    "Kind",
                    "Priority",
                    "Version",
                    "Component",
                    "Milestone",
                    "Reported By",
                    "Created On",
                    "Last Updated",
                    "Responsible",
                    "Title",
                    "Content",
                    "Comment Count",
                    "is_spam",
                    "Followers Count"]

                with open('issues.xls', 'wb') as f:
                    for i in data['issues']:
                        row = []
                        if 'local_id' in i:
                            row.append(i['local_id'])
                        else:
                            row.append('None')

                        if 'status' in i:
                            row.append(i['status'])
                        else:
                            row.append('None')

                        if 'title' in i:
                            row.append(i['title'])
                        else:
                            row.append('None')

                        if 'metadata' in i:
                            row.append(i['metadata']['kind'])
                        else:
                            row.append('None')

                        if 'priority' in i:
                            row.append(i['priority'])
                        else:
                            row.append('None')

                        if 'metadata' in i:
                            row.append(i['metadata']['version'])
                        else:
                            row.append('None')

                        if 'metadata' in i:
                            row.append(i['metadata']['component'])
                        else:
                            row.append('None')

                        if 'metadata' in i:
                            row.append(i['metadata']['milestone'])
                        else:
                            row.append('None')

                        if 'reported_by' in i:
                            row.append(i['reported_by']['username'])
                        else:
                            row.append('None')

                        if 'utc_created_on' in i:
                            row.append(i['utc_created_on'])
                        else:
                            row.append('None')

                        if 'utc_last_updated' in i:
                            row.append(i['utc_last_updated'])
                        else:
                            row.append('None')

                        if 'responsible' in i:
                            row.append(i['responsible']['username'])
                        else:
                            row.append('None')

                        if 'title' in i:
                            row.append(i['title'])
                        else:
                            row.append('None')

                        if 'content' in i:
                            row.append(i['content'])
                        else:
                            row.append('None')

                        if 'comment_count' in i:
                            row.append(i['comment_count'])
                        else:
                            row.append('None')

                        if 'is_spam' in i:
                            row.append(i['is_spam'])
                        else:
                            row.append('None')

                        if i in 'follower_count':
                            row.append(i['follower_count'])
                        else:
                            row.append('None')

                        csvdata.append(row)
                    f.write(csvdata.csv)
                    f.close()
                    print "\n CSV File created.\n"
                sys.exit(0)
            else:
                print "\nTotal Issues: {d[count]}\n".format(d=data)

                loopmsg = """Issue_ID: {i[local_id]}
Issue_Status: {i[status]}
Issue_Title: {i[title]}
======================================================================="""
                for i in data['issues']:
                    print loopmsg.format(i=i)
                sys.exit(0)
        elif all([issuefollowers_url,
                  not(issuelist_url),
                  not(issuedetail_url),
                  not(issuefilter_url)]):
            print "\nFollowers Count: %s\n" % (data['count'])
            for i in data['followers']:
                print "Followers Name: %s" % (i['username'])
            print "\n"
            sys.exit(0)
        else:
            print "Invalid Request no data received."
            sys.exit(1)
dataset/ETHPy150Open yspanchal/bitbucketcli/bitbucket/issues.py/Getissue.take_action/swapped operands of `in`