prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  ImportError: cannot import name 'build_sampler' from 'mmdet.core.bbox.assign_sampling' 
  I have successful install the mmdetection by the command "pip install -v -e .". But I have the problem in the test. Would anyone help me ?
  
  (lab) gpuserver@ubuntu:~/ht/labs/mmdetection-master$ python
  Python 3.7.3 (default, Mar 27 2019, 22:11:17) 
  [GCC 7.3.0] :: Anaconda, Inc. on linux
  Type "help", "copyright", "credits" or "license" for more information.
  >>> from mmdet.apis import init_detector
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/home/gpuserver/ht/labs/mmdetection-master/mmdet/apis/__init__.py", line 2, in <module>
      from .inference import inference_detector, init_detector, show_result
    File "/home/gpuserver/ht/labs/mmdetection-master/mmdet/apis/inference.py", line 9, in <module>
      from mmdet.core import get_classes
    File "/home/gpuserver/ht/labs/mmdetection-master/mmdet/core/__init__.py", line 1, in <module>
      from .anchor import *  # noqa: F401, F403
    File "/home/gpuserver/ht/labs/mmdetection-master/mmdet/core/anchor/__init__.py", line 2, in <module>
      from .anchor_target import anchor_inside_flags, anchor_target
    File "/home/gpuserver/ht/labs/mmdetection-master/mmdet/core/anchor/anchor_target.py", line 3, in <module>
      from ..bbox import PseudoSampler, assign_and_sample, bbox2delta, build_assigner
    File "/home/gpuserver/ht/labs/mmdetection-master/mmdet/core/bbox/__init__.py", line 1, in <module>
      from .assign_sampling import assign_and_sample, build_assigner, build_sampler
    File "/home/gpuserver/ht/labs/mmdetection-master/mmdet/core/bbox/assign_sampling.py", line 3, in <module>
      from . import assigners, samplers
    File "/home/gpuserver/ht/labs/mmdetection-master/mmdet/core/bbox/samplers/__init__.py", line 2, in <module>
      from .combined_sampler import CombinedSampler
    File "/home/gpuserver/ht/labs/mmdetection-master/mmdet/core/bbox/samplers/combined_sampler.py", line 1, in <module>
      from ..assign_sampling import build_sampler
  ImportError: cannot import name 'build_sampler' from 'mmdet.core.bbox.assign_sampling' (/home/gpuserver/ht/labs/mmdetection-master/mmdet/core/bbox/assign_sampling.py)
  
  </issue>
  <code>
  [start of mmdet/core/bbox/__init__.py]
  1 from .assign_sampling import assign_and_sample, build_assigner, build_sampler
  2 from .assigners import AssignResult, BaseAssigner, MaxIoUAssigner
  3 from .bbox_target import bbox_target
  4 from .geometry import bbox_overlaps
  5 from .samplers import (BaseSampler, CombinedSampler,
  6                        InstanceBalancedPosSampler, IoUBalancedNegSampler,
  7                        PseudoSampler, RandomSampler, SamplingResult)
  8 from .transforms import (bbox2delta, bbox2result, bbox2roi, bbox_flip,
  9                          bbox_mapping, bbox_mapping_back, delta2bbox,
  10                          distance2bbox, roi2bbox)
  11 
  12 __all__ = [
  13     'bbox_overlaps', 'BaseAssigner', 'MaxIoUAssigner', 'AssignResult',
  14     'BaseSampler', 'PseudoSampler', 'RandomSampler',
  15     'InstanceBalancedPosSampler', 'IoUBalancedNegSampler', 'CombinedSampler',
  16     'SamplingResult', 'build_assigner', 'build_sampler', 'assign_and_sample',
  17     'bbox2delta', 'delta2bbox', 'bbox_flip', 'bbox_mapping',
  18     'bbox_mapping_back', 'bbox2roi', 'roi2bbox', 'bbox2result',
  19     'distance2bbox', 'bbox_target'
  20 ]
  21
  [end of mmdet/core/bbox/__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/mmdet/core/bbox/__init__.py b/mmdet/core/bbox/__init__.py
  --- a/mmdet/core/bbox/__init__.py
  +++ b/mmdet/core/bbox/__init__.py
  @@ -1,4 +1,3 @@
  -from .assign_sampling import assign_and_sample, build_assigner, build_sampler
   from .assigners import AssignResult, BaseAssigner, MaxIoUAssigner
   from .bbox_target import bbox_target
   from .geometry import bbox_overlaps
  @@ -9,6 +8,9 @@
                            bbox_mapping, bbox_mapping_back, delta2bbox,
                            distance2bbox, roi2bbox)
   
  +from .assign_sampling import (  # isort:skip, avoid recursive imports
  +    assign_and_sample, build_assigner, build_sampler)
  +
   __all__ = [
       'bbox_overlaps', 'BaseAssigner', 'MaxIoUAssigner', 'AssignResult',
       'BaseSampler', 'PseudoSampler', 'RandomSampler',
  
verification_info: {"golden_diff": "diff --git a/mmdet/core/bbox/__init__.py b/mmdet/core/bbox/__init__.py\n--- a/mmdet/core/bbox/__init__.py\n+++ b/mmdet/core/bbox/__init__.py\n@@ -1,4 +1,3 @@\n-from .assign_sampling import assign_and_sample, build_assigner, build_sampler\n from .assigners import AssignResult, BaseAssigner, MaxIoUAssigner\n from .bbox_target import bbox_target\n from .geometry import bbox_overlaps\n@@ -9,6 +8,9 @@\n                          bbox_mapping, bbox_mapping_back, delta2bbox,\n                          distance2bbox, roi2bbox)\n \n+from .assign_sampling import (  # isort:skip, avoid recursive imports\n+    assign_and_sample, build_assigner, build_sampler)\n+\n __all__ = [\n     'bbox_overlaps', 'BaseAssigner', 'MaxIoUAssigner', 'AssignResult',\n     'BaseSampler', 'PseudoSampler', 'RandomSampler',\n", "issue": "ImportError: cannot import name 'build_sampler' from 'mmdet.core.bbox.assign_sampling' \nI have successful install the mmdetection by the command \"pip install -v -e .\". But I have the problem in the test. Would anyone help me ?\r\n\r\n(lab) gpuserver@ubuntu:~/ht/labs/mmdetection-master$ python\r\nPython 3.7.3 (default, Mar 27 2019, 22:11:17) \r\n[GCC 7.3.0] :: Anaconda, Inc. on linux\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> from mmdet.apis import init_detector\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\n  File \"/home/gpuserver/ht/labs/mmdetection-master/mmdet/apis/__init__.py\", line 2, in <module>\r\n    from .inference import inference_detector, init_detector, show_result\r\n  File \"/home/gpuserver/ht/labs/mmdetection-master/mmdet/apis/inference.py\", line 9, in <module>\r\n    from mmdet.core import get_classes\r\n  File \"/home/gpuserver/ht/labs/mmdetection-master/mmdet/core/__init__.py\", line 1, in <module>\r\n    from .anchor import *  # noqa: F401, F403\r\n  File \"/home/gpuserver/ht/labs/mmdetection-master/mmdet/core/anchor/__init__.py\", line 2, in <module>\r\n    from .anchor_target import anchor_inside_flags, anchor_target\r\n  File \"/home/gpuserver/ht/labs/mmdetection-master/mmdet/core/anchor/anchor_target.py\", line 3, in <module>\r\n    from ..bbox import PseudoSampler, assign_and_sample, bbox2delta, build_assigner\r\n  File \"/home/gpuserver/ht/labs/mmdetection-master/mmdet/core/bbox/__init__.py\", line 1, in <module>\r\n    from .assign_sampling import assign_and_sample, build_assigner, build_sampler\r\n  File \"/home/gpuserver/ht/labs/mmdetection-master/mmdet/core/bbox/assign_sampling.py\", line 3, in <module>\r\n    from . import assigners, samplers\r\n  File \"/home/gpuserver/ht/labs/mmdetection-master/mmdet/core/bbox/samplers/__init__.py\", line 2, in <module>\r\n    from .combined_sampler import CombinedSampler\r\n  File \"/home/gpuserver/ht/labs/mmdetection-master/mmdet/core/bbox/samplers/combined_sampler.py\", line 1, in <module>\r\n    from ..assign_sampling import build_sampler\r\nImportError: cannot import name 'build_sampler' from 'mmdet.core.bbox.assign_sampling' (/home/gpuserver/ht/labs/mmdetection-master/mmdet/core/bbox/assign_sampling.py)\n", "before_files": [{"content": "from .assign_sampling import assign_and_sample, build_assigner, build_sampler\nfrom .assigners import AssignResult, BaseAssigner, MaxIoUAssigner\nfrom .bbox_target import bbox_target\nfrom .geometry import bbox_overlaps\nfrom .samplers import (BaseSampler, CombinedSampler,\n                       InstanceBalancedPosSampler, IoUBalancedNegSampler,\n                       PseudoSampler, RandomSampler, SamplingResult)\nfrom .transforms import (bbox2delta, bbox2result, bbox2roi, bbox_flip,\n                         bbox_mapping, bbox_mapping_back, delta2bbox,\n                         distance2bbox, roi2bbox)\n\n__all__ = [\n    'bbox_overlaps', 'BaseAssigner', 'MaxIoUAssigner', 'AssignResult',\n    'BaseSampler', 'PseudoSampler', 'RandomSampler',\n    'InstanceBalancedPosSampler', 'IoUBalancedNegSampler', 'CombinedSampler',\n    'SamplingResult', 'build_assigner', 'build_sampler', 'assign_and_sample',\n    'bbox2delta', 'delta2bbox', 'bbox_flip', 'bbox_mapping',\n    'bbox_mapping_back', 'bbox2roi', 'roi2bbox', 'bbox2result',\n    'distance2bbox', 'bbox_target'\n]\n", "path": "mmdet/core/bbox/__init__.py"}]}