def METHOD_NAME(METHOD_NAME, **kwargs):
    """
    Create a step from a string.
    Parameters
    ----------
    string : str
        The string to parse. Each operating condition should
        be of the form "Do this for this long" or "Do this until this happens". For
        example, "Charge at 1 C for 1 hour", or "Charge at 1 C until 4.2 V", or "Charge
        at 1 C for 1 hour or until 4.2 V". The instructions can be of the form
        "(Dis)charge at x A/C/W", "Rest", or "Hold at x V until y A". The running
        time should be a time in seconds, minutes or hours, e.g. "10 seconds",
        "3 minutes" or "1 hour". The stopping conditions should be
        a circuit state, e.g. "1 A", "C/50" or "3 V".
    **kwargs
        Any other keyword arguments are passed to the :class:`pybamm.step._Step`
        class.
    Returns
    -------
    :class:`pybamm.step._Step`
        A step parsed from the string.
    """
    if not isinstance(METHOD_NAME, str):
        raise TypeError("Input to step.string() must be a string")
    if "oC" in METHOD_NAME:
        raise ValueError(
            "Temperature must be specified as a keyword argument "
            "instead of in the string"
        )
    # Save the original string
    description = METHOD_NAME
    # extract period
    if "period)" in METHOD_NAME:
        if "period" in kwargs:
            raise ValueError(
                "Period cannot be specified both as a keyword argument "
                "and in the string"
            )
        METHOD_NAME, period_full = METHOD_NAME.split(" (")
        period, _ = period_full.split(" period)")
        kwargs["period"] = period
    # extract termination condition based on "until" keyword
    if "until" in METHOD_NAME:
        # e.g. "Charge at 4 A until 3.8 V"
        METHOD_NAME, termination = METHOD_NAME.split(" until ")
        # sometimes we use "or until" instead of "until", so remove "or"
        METHOD_NAME = METHOD_NAME.replace(" or", "")
    else:
        termination = None
    # extract duration based on "for" keyword
    if "for" in METHOD_NAME:
        # e.g. "Charge at 4 A for 3 hours"
        METHOD_NAME, duration = METHOD_NAME.split(" for ")
    else:
        duration = None
    if termination is None and duration is None:
        raise ValueError(
            "Operating conditions must contain keyword 'for' or 'until'. "
            f"For example: {_examples}"
        )
    # read remaining instruction
    if METHOD_NAME.startswith("Rest"):
        typ = "current"
        value = 0
    elif METHOD_NAME.startswith("Run"):
        raise ValueError(
            "Simulating drive cycles with 'Run' has been deprecated. Use the "
            "pybamm.step.current/voltage/power/c_rate/resistance() functions "
            "instead."
        )
    else:
        # split by what is before and after "at"
        # e.g. "Charge at 4 A" -> ["Charge", "4 A"]
        # e.g. "Discharge at C/2" -> ["Discharge", "C/2"]
        instruction, value_string = METHOD_NAME.split(" at ")
        if instruction == "Charge":
            sign = -1
        elif instruction in ["Discharge", "Hold"]:
            sign = 1
        else:
            raise ValueError(
                "Instruction must be 'discharge', 'charge', 'rest', or 'hold'. "
                f"For example: {_examples}"
                f"The following instruction does not comply: {instruction}"
            )
        # extract units (type) and convert value to float
        typ, value = _convert_electric(value_string)
        # Make current positive for discharge and negative for charge
        value *= sign
    return _Step(
        typ,
        value,
        duration=duration,
        termination=termination,
        description=description,
        **kwargs,
    )