<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def contains (self, p):
 """Returns True if point is contained inside this Polygon, False otherwise. This method uses the Ray Casting algorithm. Examples: True False """

    inside = False

    if p in self.bounds():
      for s in self.segments():
        if ((s.p.y > p.y) != (s.q.y > p.y) and
            (p.x < (s.q.x - s.p.x) * (p.y - s.p.y) / (s.q.y - s.p.y) + s.p.x)):
          inside = not inside

    return inside