Python: check if all array values are same
You are iterating over the list, and copying elements that have a certain property to the correct list, then checking whether it's of the size of the original list. In other words, you're checking whether all elements fulfill a certain condition, in other words: 

return all(object[number].text == "Sample" for number in array)