prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Sex-specific names and Sex attribute don't match
  While person distinguisheds between name_male() and name_female(), and profile generates a random ['sex'] attribute, these do not correlate at present. So in 50% of cases (ignoring neutral names like Chris) this results in F with male names and M with female names.
  
  
  </issue>
  <code>
  [start of faker/providers/profile/__init__.py]
  1 # coding=utf-8
  2 
  3 from .. import BaseProvider
  4 import itertools
  5 
  6 
  7 class Provider(BaseProvider):
  8     """
  9     This provider is a collection of functions to generate personal profiles and identities.
  10 
  11     """
  12 
  13     def simple_profile(self):
  14         """
  15         Generates a basic profile with personal informations
  16         """
  17 
  18         return {
  19             "username": self.generator.user_name(),
  20             "name": self.generator.name(),
  21             "sex": self.random_element(["M", "F"]),
  22             "address": self.generator.address(),
  23             "mail": self.generator.free_email(),
  24 
  25             #"password":self.generator.password()
  26             "birthdate": self.generator.date(),
  27 
  28         }
  29 
  30     def profile(self, fields=None):
  31         """
  32         Generates a complete profile.
  33         If "fields" is not empty, only the fields in the list will be returned
  34         """
  35         if fields is None:
  36             fields = []
  37 
  38         d = {
  39             "job": self.generator.job(),
  40             "company": self.generator.company(),
  41             "ssn": self.generator.ssn(),
  42             "residence": self.generator.address(),
  43             "current_location": (self.generator.latitude(), self.generator.longitude()),
  44             "blood_group": "".join(self.random_element(list(itertools.product(["A", "B", "AB", "0"], ["+", "-"])))),
  45             "website": [self.generator.url() for i in range(1, self.random_int(2, 5))]
  46         }
  47 
  48         d = dict(d, **self.generator.simple_profile())
  49         #field selection
  50         if len(fields) > 0:
  51             d = dict((k, v) for (k, v) in d.items() if k in fields)
  52 
  53         return d
  54
  [end of faker/providers/profile/__init__.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/faker/providers/profile/__init__.py b/faker/providers/profile/__init__.py
  --- a/faker/providers/profile/__init__.py
  +++ b/faker/providers/profile/__init__.py
  @@ -15,10 +15,15 @@
           Generates a basic profile with personal informations
           """
   
  +        sex = self.random_element(["F", "M"])
  +        if sex == 'F':
  +            name = self.generator.name_female()
  +        elif sex == 'M':
  +            name = self.generator.name_male()
           return {
               "username": self.generator.user_name(),
  -            "name": self.generator.name(),
  -            "sex": self.random_element(["M", "F"]),
  +            "name": name,
  +            "sex": sex,
               "address": self.generator.address(),
               "mail": self.generator.free_email(),
  
verification_info: {"golden_diff": "diff --git a/faker/providers/profile/__init__.py b/faker/providers/profile/__init__.py\n--- a/faker/providers/profile/__init__.py\n+++ b/faker/providers/profile/__init__.py\n@@ -15,10 +15,15 @@\n         Generates a basic profile with personal informations\n         \"\"\"\n \n+        sex = self.random_element([\"F\", \"M\"])\n+        if sex == 'F':\n+            name = self.generator.name_female()\n+        elif sex == 'M':\n+            name = self.generator.name_male()\n         return {\n             \"username\": self.generator.user_name(),\n-            \"name\": self.generator.name(),\n-            \"sex\": self.random_element([\"M\", \"F\"]),\n+            \"name\": name,\n+            \"sex\": sex,\n             \"address\": self.generator.address(),\n             \"mail\": self.generator.free_email(),\n", "issue": "Sex-specific names and Sex attribute don't match\nWhile person distinguisheds between name_male() and name_female(), and profile generates a random ['sex'] attribute, these do not correlate at present. So in 50% of cases (ignoring neutral names like Chris) this results in F with male names and M with female names.\n\n", "before_files": [{"content": "# coding=utf-8\n\nfrom .. import BaseProvider\nimport itertools\n\n\nclass Provider(BaseProvider):\n    \"\"\"\n    This provider is a collection of functions to generate personal profiles and identities.\n\n    \"\"\"\n\n    def simple_profile(self):\n        \"\"\"\n        Generates a basic profile with personal informations\n        \"\"\"\n\n        return {\n            \"username\": self.generator.user_name(),\n            \"name\": self.generator.name(),\n            \"sex\": self.random_element([\"M\", \"F\"]),\n            \"address\": self.generator.address(),\n            \"mail\": self.generator.free_email(),\n\n            #\"password\":self.generator.password()\n            \"birthdate\": self.generator.date(),\n\n        }\n\n    def profile(self, fields=None):\n        \"\"\"\n        Generates a complete profile.\n        If \"fields\" is not empty, only the fields in the list will be returned\n        \"\"\"\n        if fields is None:\n            fields = []\n\n        d = {\n            \"job\": self.generator.job(),\n            \"company\": self.generator.company(),\n            \"ssn\": self.generator.ssn(),\n            \"residence\": self.generator.address(),\n            \"current_location\": (self.generator.latitude(), self.generator.longitude()),\n            \"blood_group\": \"\".join(self.random_element(list(itertools.product([\"A\", \"B\", \"AB\", \"0\"], [\"+\", \"-\"])))),\n            \"website\": [self.generator.url() for i in range(1, self.random_int(2, 5))]\n        }\n\n        d = dict(d, **self.generator.simple_profile())\n        #field selection\n        if len(fields) > 0:\n            d = dict((k, v) for (k, v) in d.items() if k in fields)\n\n        return d\n", "path": "faker/providers/profile/__init__.py"}]}