title: Get all non-unique elements in a list
body: <p>I am trying to build a code that returns me a list with non-unique values, such as <code>[1,2,2,3]</code> => <code>[2,2]</code> and the function isn't case-sensitive, such as: <code>['p','P','a','b',1,5,6]</code> => <code>['p','P']</code>.</p>
  
  <p>This is what I have come up with so far:</p>
  
  <pre><code>def non_unique(*data):
      tempLst = [x for x in data if (data.count(x) &gt; 1 if (ord('a') &lt;= ord(x) &lt;= ord('z') or ord('A') &lt;= ord(x) &lt;= ord('Z')) and (data.count(x.upper()) + data.count(x.lower()) &gt; 1)]
      return tempLst
  </code></pre>
  
  <p>These are the test examples:</p>
  
  <pre><code>if __name__ == "__main__":
      assert isinstance(non_unique([1]), list)
      assert non_unique([1, 2, 3, 1, 3]) == [1, 3, 1, 3]
      assert non_unique([1, 2, 3, 4, 5]) == []
      assert non_unique([5, 5, 5, 5, 5]) == [5, 5, 5, 5, 5]
      assert non_unique([10, 9, 10, 10, 9, 8]) == [10, 9, 10, 10, 9]
  
  
      assert non_unique(['P', 7, 'j', 'A', 'P', 'N', 'Z', 'i',
                     'A', 'X', 'j', 'L', 'y', 's', 'K', 'g',
                     'p', 'r', 7, 'b']) == ['P', 7, 'j', 'A', 'P', 'A', 'j', 'p', 7]
  </code></pre>