<commit_before># coding=utf-8
# (utf-8 mostly just so we can put ellipses in docstrings.)

"""A friendly interface to mapping scans.

The most important function here is mscan(), which collates information into a
ScanRequest and submits it to a queue for attention of the GDA server. This is
the only function with side effects in this module.

Users who want to create a ScanRequest without submitting it to GDA can use the
pure function scan_request(), whose signature is similar to mscan().

The following pure functions create scan paths which may be passed to mscan():
grid(), step(), line(), array(), point().

There are also some pure functions which may be used to narrow the region of
interest (ROI) when using grid(). They are: circ(), rect(), poly().
"""

from java.net import URI
from org.eclipse.scanning.api.event.scan import ScanRequest
from org.eclipse.dawnsci.analysis.dataset.roi import (
    CircularROI, RectangularROI, PolygonalROI, PolylineROI, PointROI)
from org.eclipse.scanning.api.points.models import (
    StepModel, GridModel, RasterModel, SinglePointModel,
    OneDEqualSpacingModel, OneDStepModel, ArrayModel,
    BoundingBox, BoundingLine)
from org.eclipse.scanning.server.servlet import Services
from org.eclipse.scanning.api.event.scan import ScanBean
from org.eclipse.scanning.api.event.IEventService import (
    SUBMISSION_QUEUE, REQUEST_TOPIC, RESPONSE_TOPIC)


# Grepping for 'mscan' in a GDA workspace shows up nothing, so it seems that
# mscan is a free name.
def mscan(path=None, mon=None, det=None, now=False, block=False,
          broker_uri="tcp://localhost:61616"):
    """Create a ScanRequest and submit it to the GDA server.

    A simple usage of this function is as follows:
    >>> mscan(step(my_scannable, 0, 10, 1), det=mandelbrot(0.1))

    The above invokation says "please perform a mapping scan over my scannable
    from 0 to 10 with step size 1, collecting data from the 'Mandelbrot'
    detector with an exposure of 0.1 at each step".

    You can specify multiple detectors with a list (square brackets):<commit_msg>Remove some unused imports<commit_after># coding=utf-8
# (utf-8 mostly just so we can put ellipses in docstrings.)

"""A friendly interface to mapping scans.

The most important function here is mscan(), which collates information into a
ScanRequest and submits it to a queue for attention of the GDA server. This is
the only function with side effects in this module.

Users who want to create a ScanRequest without submitting it to GDA can use the
pure function scan_request(), whose signature is similar to mscan().

The following pure functions create scan paths which may be passed to mscan():
grid(), step(), line(), array(), point().

There are also some pure functions which may be used to narrow the region of
interest (ROI) when using grid(). They are: circ(), rect(), poly().
"""

from java.net import URI
from org.eclipse.scanning.api.event.scan import ScanRequest
from org.eclipse.dawnsci.analysis.dataset.roi import (
    CircularROI, RectangularROI, PolygonalROI, PolylineROI, PointROI)
from org.eclipse.scanning.api.points.models import (
    StepModel, GridModel, RasterModel, SinglePointModel,
    OneDEqualSpacingModel, OneDStepModel, ArrayModel,
    BoundingBox, BoundingLine)
from org.eclipse.scanning.server.servlet import Services
from org.eclipse.scanning.api.event.scan import ScanBean
from org.eclipse.scanning.api.event.IEventService import SUBMISSION_QUEUE


# Grepping for 'mscan' in a GDA workspace shows up nothing, so it seems that
# mscan is a free name.
def mscan(path=None, mon=None, det=None, now=False, block=False,
          broker_uri="tcp://localhost:61616"):
    """Create a ScanRequest and submit it to the GDA server.

    A simple usage of this function is as follows:
    >>> mscan(step(my_scannable, 0, 10, 1), det=mandelbrot(0.1))

    The above invokation says "please perform a mapping scan over my scannable
    from 0 to 10 with step size 1, collecting data from the 'Mandelbrot'
    detector with an exposure of 0.1 at each step".

    You can specify multiple detectors with a list (square brackets):
{'fraction_non_alphanumeric': 0.08036794964899541, 'fraction_numerical': 0.009198741224885015, 'mean_word_length': 4.458388375165126, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '676669', 'n_tokens_mistral': 1227, 'n_tokens_neox': 1173, 'n_words': 514}