Should repeated course grades be included in GPA calculations for reporting to institutions in the U.S.? I'm from Iran and planning to apply for a master in CS in USA.  I'm trying to figure out how should I report my GPA, but I'm confused about courses that I have failed and repeated.  Should I include both failing and repeated grades when calculating my GPA or just my last grade in that course?

The Iranian grading system is based on a 20-point grading scale, the passing grade is 10 (for undergrads) and both failing and repeated grades are included in GPA calculation.  As it is mentioned in Wikipedia link, Iranian GPA is not directly converted to USA grading system: instead each course grade is converted individually and then GPA is recalculated for converted grades. 

But as far as I have researched online and offline I have found different answers about repeated grades when converting.
Should I include both failing and repeated grades when calculating my
  GPA or just my last grade in that course?


If all your failings and repeated courses are reported in your transcripts, then you should report them too.

You should report all your official documents as they are and the applicant should never edit them or report them partially (by his own favor).

PS:

When you have your transcripts, your cGPA and also GPAs of each semester (including your passed, repeating and failed courses) is reported in the transcripts. 

You can check whether the marks of your failed and repeating courses are calculated in your GPA or not. You should translate/report/recalculate your GPA exactly the same as they appear in your original transcripts.

Also, as you can see in one comment's liked question, the GPA calculation method differs from one country to another; so you don't need to re-calculate anything yourself (even, I think that by translating your GPA to another GPA-system by mistake may disturb your admissions opportunities); just officially translate your transcripts and send it to the admission office of the university you are aiming to study in. The admission office will recalculate your GPA based on their methods or they may then ask you for more supporting documents. Read the following quotation from the accepted answer to the question: How to convert from one grading scheme to another


  Most countries have their own system which doesn't really make sense
  as you try to "translate" them to some other system.


even, in this answer it is mentioned:


  Don't convert between different grading schemes unless it is
  explicitly mentioned what minimum grades you need for your own
  country. Just apply and hope for the best.