Checks the stimulus, including expanded parameters for invalidating conditions

        :param windowSize: acquistion (recording) window size (seconds)
        :type windowSize: float
        :returns: str -- error message, if any, 0 otherwise
775682
def verify(self, windowSize=None):
        """"""
        if self.samplerate() is None:
            return "Multiple recording files with conflicting samplerates"
        msg = self._autoParams.verify()
        if msg:
            return msg
        if self.traceCount() == 0:
            return "Test is empty"
        if windowSize is not None:
            durations = self.expandFunction(self.duration)
            # print 'windowSize', windowSize, 'self', durations[0],  durations[-1]
            # ranges are linear, so we only need to test first and last
            if durations[0] > windowSize or durations[-1] > windowSize:
                return "Stimulus duration exceeds window duration"
        msg = self.verifyExpanded(self.samplerate())
        if msg:
            return msg
        if self.caldb is None or self.calv is None:
            return "Test reference voltage not set"
        if None in self.voltage_limits:
            return "Device voltage limits not set"
        return 0
405776
def window_size(self):
        
        the_size = self.app_window.baseSize()
        return the_size.width(), the_size.height()
59646
def speckleWindowSize(self, value):
        """"""
        if value >= 0 and value <= 200:
            self._speckle_window_size = value
        else:
            raise InvalidSpeckleWindowSizeError("Speckle window size must be 0 "
                                                "for disabled checks or "
                                                "between 50 and 200.")
        self._replace_bm()
492572
def window_size(self, window_size):
        
        BasePlotter.window_size.fset(self, window_size)
        self.app_window.setBaseSize(*window_size)
726198
def resize(self, size=None):
        

        if not self.operation.israw():
            return

        size = size or tty.size(self.operation.stdout)

        if size is not None:
            rows, cols = size
            try:
                self.operation.resize(height=rows, width=cols)
            except IOError:  # Container already exited
                pass
1148676
def _maxSizeCheck(cls, obj):
        
        fail = False
        size = 0

        if isinstance(obj, numbers.Number):
            if obj > constants.MAX_FRAME_SIZE:
                fail = True
                size = obj

        elif hasattr(obj, '__len__'):
            size = len(obj)
            fail = size > constants.MAX_FRAME_SIZE

        if fail:
            raise MaxSizeException('Frame size %s > %s (MAX_FRAME_SIZE)' \
                    % (size, constants.MAX_FRAME_SIZE))
1362127
private void validateWindowedSyntax() {
        // Check that the aggregate is one of the supported ones, and
        // that the number of aggregate parameters is right.
        switch (opType) {
        case OpTypes.WINDOWED_RANK:
        case OpTypes.WINDOWED_DENSE_RANK:
        case OpTypes.WINDOWED_ROW_NUMBER:
            if (nodes.length != 0) {
                throw Error.error("Windowed Aggregate " + OpTypes.aggregateName(opType) + " expects no arguments.", "", 0);
            }
            break;
        case OpTypes.WINDOWED_COUNT:
        case OpTypes.WINDOWED_MIN:
        case OpTypes.WINDOWED_MAX:
        case OpTypes.WINDOWED_SUM:
        	break;
        default:
            throw Error.error("Unsupported window function " + OpTypes.aggregateName(opType), "", 0);
        }
    }
802348
def padding(self):
        
        pad = self.ntiles - self.windowsize
        return (int((pad - 1)/2.), int((pad + 1)/2.))
357273
public void writeWindowFrame(int windowSize) throws IOException {
        ByteArrayOutputStream output = new ByteArrayOutputStream();

        output.write(PROTOCOL_VERSION.getBytes(UTF_8));//Protocol version
        output.write(WINDOW_SIZE_FRAME_TYPE.getBytes(UTF_8)); //Frame type 'W'
        output.write(ByteBuffer.allocate(4).putInt(windowSize).array());//32-bit window size

        lastUsedTime = System.currentTimeMillis();
        out.write(output.toByteArray());
        out.flush();
    }
489564
def init_check_window2(self):
        
        self.check_dia = pmag_er_magic_dialogs.ErMagicCheckFrame(self, 'Check Data',
                                                                 self.WD, self.er_magic)
518385
protected final void checkMaxSize(final Dimension screenSize,
            final Dimension frameSize) {
        if (frameSize.height > screenSize.height) {
            frameSize.height = screenSize.height;
        }
        if (frameSize.width > screenSize.width) {
            frameSize.width = screenSize.width;
        }
    }
1350143
def validate(self, size):
        
        msg = 'scale and array size must match, ' \
              'but were scale: {self.scale.n_bands},  array size: {size}'

        if size != len(self.scale):
            raise ValueError(msg.format(**locals()))
873512
def resizeEvent(self, event):
        """"""
        if not self.isMaximized() and not self.isFullScreen():
            self.window_size = self.size()
        QMainWindow.resizeEvent(self, event)
468185
def check_sizes(size, width, height):
    

    if not size:
        return width, height

    if len(size) != 2:
        raise ProtocolError(
            "size argument should be a pair (width, height)")
    if width is not None and width != size[0]:
        raise ProtocolError(
            "size[0] (%r) and width (%r) should match when both are used."
            % (size[0], width))
    if height is not None and height != size[1]:
        raise ProtocolError(
            "size[1] (%r) and height (%r) should match when both are used."
            % (size[1], height))
    return size
296073
def estimate_size_in_bytes(cls, key, value, headers):
        
        return (
            cls.HEADER_STRUCT.size + cls.MAX_RECORD_OVERHEAD +
            cls.size_of(key, value, headers)
        )
691529
def get_size_str(size):
    
    if size == 0:
        magnitude = 0
        level = 0
    else:
        magnitude = math.floor(math.log(size, 10))
        level = int(min(math.floor(magnitude // 3), 4))
    return ('%d' if level == 0 else '%.2f') % (float(size) / 2**(level*10)) + ' ' + SIZE_LEVEL[level]
519710
def get_filesize(self, f):
        
        try:
            filesize = float(f.get_size())
            return float("%.2f" % (filesize / 1024))
        except (POSKeyError, TypeError, AttributeError):
            return 0.0