set drift length list of three elements

        :param drift_length: input drift_length in [m], single float, or list/tuple of float numbers
974354
def _setDriftList(self, drift_length):
        
        if isinstance(drift_length, tuple) or isinstance(drift_length, list):
            if len(drift_length) == 1:
                self.dflist = drift_length * 3
            elif len(drift_length) == 2:
                self.dflist = []
                self.dflist.extend(drift_length)
                self.dflist.append(drift_length[0])
            elif len(drift_length) >= 3:
                self.dflist = drift_length[0:3]
                if self.dflist[0] != self.dflist[-1]:
                    print("warning: chicane is not symmetric.")
            else:
                print("drift_length is not a valid list or tuple.")
                self.mflag = False
        else:
            self.dflist = []
            self.dflist.extend([drift_length, drift_length, drift_length])
664004
public static void setFloat(MemorySegment[] segments, int offset, float value) {
		if (inFirstSegment(segments, offset, 4)) {
			segments[0].putFloat(offset, value);
		} else {
			setFloatMultiSegments(segments, offset, value);
		}
	}
1242089
def float(self, **kwargs):
        
        for key in kwargs:
            setattr(self, key, kwargs[key])
        self.command = self.COMMAND_FLOAT
68762
def setImembPtr(self): 
        """"""
        jseg = 0
        for sec in list(self.secs.values()):
            hSec = sec['hObj']
            for iseg, seg in enumerate(hSec):
                self.imembPtr.pset(jseg, seg._ref_i_membrane_)  # notice the underscore at the end (in nA)
                jseg += 1
155420
def p_length(self, p):
        ''
        p[0] = Length(p[2], p[4], lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))
1035494
def ctypes2numpy(cptr, length, dtype):
    
    if not isinstance(cptr, ctypes.POINTER(ctypes.c_float)):
        raise RuntimeError('expected float pointer')
    res = np.zeros(length, dtype=dtype)
    if not ctypes.memmove(res.ctypes.data, cptr, length * res.strides[0]):
        raise RuntimeError('memmove failed')
    return res
501337
def set_element_tail(parent_to_parse, element_path=None, element_tail=u''):
    

    return _set_element_property(parent_to_parse, element_path, _ELEM_TAIL, element_tail)
1318736
def ticks(
            cls, request,
            length: (Ptypes.path, Integer('Duration of the stream, in seconds.')),
            style: (Ptypes.path, String('Tick style.', enum=['compact', 'extended']))
        ) -> [
            (200, 'Ok', TickStream),
            (400, 'Invalid parameters')
        ]:
        ''''''
        try:
            length = int(length)
            style = cls._styles[style]
        except (ValueError, KeyError):
            Respond(400)
        def vetinari_clock():
            start = time()
            while time() - start <= length:
                sleep(randint(25, 400) / 100)
                yield strftime(style, localtime())
        Respond(200, vetinari_clock())
498969
def _len_list(obj):
    '''
    '''
    n = len(obj)
     # estimate over-allocation
    if n > 8:
       n += 6 + (n >> 3)
    elif n:
       n += 4
    return n
646171
def set_offset_and_sequence_number(self, event_data):
        
        if not event_data:
            raise Exception(event_data)
        self.offset = event_data.offset.value
        self.sequence_number = event_data.sequence_number
183044
private int reduceSubsetChanges(Mode[] mode_type, int[] mode_length, int index_point) {

        int totalLength = 0;
        int i, length;
        Mode current, last, next;

        for (i = 0; i < index_point; i++) {
            current = mode_type[i];
            length = mode_length[i];
            if (i != 0) {
                last = mode_type[i - 1];
            } else {
                last = Mode.NULL;
            }
            if (i != index_point - 1) {
                next = mode_type[i + 1];
            } else {
                next = Mode.NULL;
            }

            /* ISO 15417 Annex E Note 2 */
            /* Calculate difference between logical length and actual length in this block */
            int extraLength = 0;
            for (int j = 0; j < length - extraLength; j++) {
                if (length(inputData[totalLength + j], current) == 2) {
                    extraLength++;
                }
            }

            if (i == 0) { /* first block */
                if ((index_point == 1) && ((length == 2) && (current == Mode.ABORC))) { /* Rule 1a */
                    mode_type[i] = Mode.LATCHC;
                    current = Mode.LATCHC;
                }
                if (current == Mode.ABORC) {
                    if (length >= 4) { /* Rule 1b */
                        mode_type[i] = Mode.LATCHC;
                        current = Mode.LATCHC;
                    } else {
                        mode_type[i] = Mode.AORB;
                        current = Mode.AORB;
                    }
                }
                if (current == Mode.SHIFTA) { /* Rule 1c */
                    mode_type[i] = Mode.LATCHA;
                    current = Mode.LATCHA;
                }
                if ((current == Mode.AORB) && (next == Mode.SHIFTA)) { /* Rule 1c */
                    mode_type[i] = Mode.LATCHA;
                    current = Mode.LATCHA;
                }
                if (current == Mode.AORB) { /* Rule 1d */
                    mode_type[i] = Mode.LATCHB;
                    current = Mode.LATCHB;
                }
            } else {
                if ((current == Mode.ABORC) && (length >= 4)) { /* Rule 3 */
                    mode_type[i] = Mode.LATCHC;
                    current = Mode.LATCHC;
                }
                if (current == Mode.ABORC) {
                    mode_type[i] = Mode.AORB;
                    current = Mode.AORB;
                }
                if ((current == Mode.AORB) && (last == Mode.LATCHA)) {
                    mode_type[i] = Mode.LATCHA;
                    current = Mode.LATCHA;
                }
                if ((current == Mode.AORB) && (last == Mode.LATCHB)) {
                    mode_type[i] = Mode.LATCHB;
                    current = Mode.LATCHB;
                }
                if ((current == Mode.AORB) && (next == Mode.SHIFTA)) {
                    mode_type[i] = Mode.LATCHA;
                    current = Mode.LATCHA;
                }
                if ((current == Mode.AORB) && (next == Mode.SHIFTB)) {
                    mode_type[i] = Mode.LATCHB;
                    current = Mode.LATCHB;
                }
                if (current == Mode.AORB) {
                    mode_type[i] = Mode.LATCHB;
                    current = Mode.LATCHB;
                }
                if ((current == Mode.SHIFTA) && (length > 1)) { /* Rule 4 */
                    mode_type[i] = Mode.LATCHA;
                    current = Mode.LATCHA;
                }
                if ((current == Mode.SHIFTB) && (length > 1)) { /* Rule 5 */
                    mode_type[i] = Mode.LATCHB;
                    current = Mode.LATCHB;
                }
                if ((current == Mode.SHIFTA) && (last == Mode.LATCHA)) {
                    mode_type[i] = Mode.LATCHA;
                    current = Mode.LATCHA;
                }
                if ((current == Mode.SHIFTB) && (last == Mode.LATCHB)) {
                    mode_type[i] = Mode.LATCHB;
                    current = Mode.LATCHB;
                }
                if ((current == Mode.SHIFTA) && (next == Mode.AORB)) {
                    mode_type[i] = Mode.LATCHA;
                    current = Mode.LATCHA;
                }
                if ((current == Mode.SHIFTB) && (next == Mode.AORB)) {
                    mode_type[i] = Mode.LATCHB;
                    current = Mode.LATCHB;
                }
                if ((current == Mode.SHIFTA) && (last == Mode.LATCHC)) {
                    mode_type[i] = Mode.LATCHA;
                    current = Mode.LATCHA;
                }
                if ((current == Mode.SHIFTB) && (last == Mode.LATCHC)) {
                    mode_type[i] = Mode.LATCHB;
                    current = Mode.LATCHB;
                }
            } /* Rule 2 is implemented elsewhere, Rule 6 is implied */

            /* ISO 15417 Annex E Note 2 */
            /* Convert logical length back to actual length for this block, now that we've decided on a subset */
            mode_length[i] -= extraLength;
            totalLength += mode_length[i];
        }

        return combineSubsetBlocks(mode_type, mode_length, index_point);
    }
1221667
public void setLength(int length) {
		if (length < 0 || body.length == length) {
			return;
		}

		int oldPos = pos;
		pos = Math.min(pos, length);

		byte[] newBody = new byte[length];
		System.arraycopy(body, 0, newBody, 0, pos);
		body = newBody;
		
		if (oldPos > pos) {
			cachedString = null;
		}
	}
1371266
def set_rate(rate):
    
    if not (isinstance(rate, int) or isinstance(rate, float)):
        raise TypeError("argument to set_rate is expected to be int or float")
    global loop_duration
    loop_duration = 1.0/rate
1301235
def set_float_info(self, field, data):
        
        _check_call(_LIB.XGDMatrixSetFloatInfo(self.handle,
                                               c_str(field),
                                               c_array(ctypes.c_float, data),
                                               len(data)))
1235853
def equal_length(*args):
    
    for i, arg in enumerate(args):
        if not isinstance(arg, Sized):
            raise ExpectedTypeError(arg, ["Sized"])
        if i >= 1 and len(arg) != len(args[0]):
            raise DifferentLengthError(args, arg)
1269238
def floating_point(
        element_name,  # type: Text
        attribute=None,  # type: Optional[Text]
        required=True,  # type: bool
        alias=None,  # type: Optional[Text]
        default=0.0,  # type: Optional[float]
        omit_empty=False,  # type: bool
        hooks=None  # type: Optional[Hooks]
):
    # type: (...) -> Processor
    
    value_parser = _number_parser(float)
    return _PrimitiveValue(
        element_name,
        value_parser,
        attribute,
        required,
        alias,
        default,
        omit_empty,
        hooks
    )
1311310
def read_lsm_floatpairs(fh):
    """"""
    size = struct.unpack('<i', fh.read(4))[0]
    return fh.read_array('<2f8', count=size)