Fix use the fact that empty sequences are false

For sequences(strings, lists, tuples), in order to consistent with
pep8 recommendations, 'if len(seq)' should be replaced with 'if seq',
and 'if not len(seq)' should be replaced with 'if not seq'.

Change-Id: Ie7b6afbde07bb57a05b36d92a079c5355945b262
Closes-Bug: #1265688
Merge "Fix use the fact that empty sequences are false"