Determines whether the feed is in a form that we understand, and
       if so, returns True.
160632
def _DetermineFormat(self):
    """"""
    if self._zip:
      # If zip was passed to __init__ then path isn't used
      assert not self._path
      return True

    if not isinstance(self._path, basestring) and hasattr(self._path, 'read'):
      # A file-like object, used for testing with a StringIO file
      self._zip = zipfile.ZipFile(self._path, mode='r')
      return True

    if not os.path.exists(self._path):
      self._problems.FeedNotFound(self._path)
      return False

    if self._path.endswith('.zip'):
      try:
        self._zip = zipfile.ZipFile(self._path, mode='r')
      except IOError:  # self._path is a directory
        pass
      except zipfile.BadZipfile:
        self._problems.UnknownFormat(self._path)
        return False

    if not self._zip and not os.path.isdir(self._path):
      self._problems.UnknownFormat(self._path)
      return False

    return True
502927
public function hasNext()
    {
        if (parent::hasNext()
            && ($this->getItemPosition() < ($this->getItemOffset() + $this->getItemCount()) - 1)
        ) {
            return true;
        }
        return false;
    }
105249
boolean isYes(String read) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.entry(tc, "isYes", read);

        String expectedYesShortResponse = TraceNLSHelper.getInstance().getString("ssl.trustmanager.signer.prompt.answer.yes", "y");
        String expectedYesFullResponse = TraceNLSHelper.getInstance().getString("ssl.trustmanager.signer.prompt.answer.full.yes", "yes");
        boolean isItYes = ((expectedYesShortResponse != null && expectedYesShortResponse.length() > 0 && expectedYesShortResponse.equalsIgnoreCase(read)) || // return true if translated y matches
        (expectedYesFullResponse != null && expectedYesFullResponse.length() > 0 && expectedYesFullResponse.equalsIgnoreCase(read))); // return true if translated yes matches

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.exit(tc, "isYes", isItYes);
        return isItYes;
    }
168567
protected function checkIfNamedForm()
    {
        if ($this->getFormOption('name')) {
            $this->name = Arr::pull($this->formOptions, 'name', $this->name);
        }
    }
159866
def _is_estimated(self):
        
        """
        result = self._estimated
        for el in self._chain:
            if not el.is_reader:
                result &= el._estimated
        return result
773070
@Override
    public boolean hasNext()
    {
        if (checkOnFetchSize())
        {
            onCheckRelation();
            if (!checkOnEmptyResult())
            {
                scrollComplete = true;
                return false;
            }
            return true;
        }
        return false;
    }
89809
private boolean isWellFormed()
    {
        for (int i = 0 ; i < maxHeight ; i++)
        {
            int c = 0;
            for (Node node = head ; node != null ; node = node.next(i))
            {
                if (node.prev(i) != null && node.prev(i).next(i) != node)
                    return false;
                if (node.next(i) != null && node.next(i).prev(i) != node)
                    return false;
                c += node.size[i];
                if (i + 1 < maxHeight && node.parent(i + 1).next(i + 1) == node.next(i))
                {
                    if (node.parent(i + 1).size[i + 1] != c)
                        return false;
                    c = 0;
                }
            }
            if (i == maxHeight - 1 && c != size + 1)
                return false;
        }
        return true;
    }
399640
public boolean hasNext()
    {
        if (scanner == null)
        {
            return false;
        }
        else
        {
            if (fetchSize != null)
            {
                if (counter < fetchSize)
                {
                    return resultsIter.hasNext();
                }
            }
            else
            {
                return resultsIter.hasNext();
            }
        }
        return false;
    }
1201465
public boolean hasNext() {
        // check if we already fetched next item
        if (next != null) {
            return true;
        }

        // check if result set already finished
        if (resultSetFinished) {
            return false;
        }

        // now fetch next item
        next = safeReadNext();

        // check if we got something
        if (next != null) {
            return true;
        }

        // no more items
        resultSetFinished = true;

        return false;
    }
121390
public boolean contains(Format format) {
        for (Format f : list) {
            if (f.matches(format)) return true;
        }
        return false;
    }
530113
private ESat isConsistent() {
        int[][] l = new int[nbDims][nbBins];
        for (int i = 0; i < bins.length; i++) {
            if (bins[i].isInstantiated()) {
                for (int d = 0; d < nbDims; d++) {
                    int v = bins[i].getValue();
                    l[d][v] += iSizes[d][i];
                    if (l[d][v] > loads[d][v].getUB()) {
                        return ESat.FALSE;
                    }
                }
            }
        }
        return ESat.TRUE;
    }
384683
protected function checkForMorePages()
	{
		$this->hasMore = count( $this->items ) > ( $this->perPage );

		$this->items = $this->items->slice( 0, $this->perPage );
	}
896214
protected function isValidFormat()
    {
        //    Reading 2048 bytes should be enough to validate that the format is HTML
        $data = fread($this->fileHandle, 2048);
        if ((strpos($data, '<') !== false) &&
                (strlen($data) !== strlen(strip_tags($data)))) {
            return true;
        }

        return false;
    }
870499
def check_shapes(
    feed: "Feed", *, as_df: bool = False, include_warnings: bool = False
) -> List:
    
    table = "shapes"
    problems = []

    # Preliminary checks
    if feed.shapes is None:
        return problems

    f = feed.shapes.copy()
    problems = check_for_required_columns(problems, table, f)
    if problems:
        return format_problems(problems, as_df=as_df)

    if include_warnings:
        problems = check_for_invalid_columns(problems, table, f)

    # Check shape_id
    problems = check_column(problems, table, f, "shape_id", valid_str)

    # Check shape_pt_lon and shape_pt_lat
    for column, bound in [("shape_pt_lon", 180), ("shape_pt_lat", 90)]:
        v = lambda x: pd.notnull(x) and -bound <= x <= bound
        cond = ~f[column].map(v)
        problems = check_table(
            problems,
            table,
            f,
            cond,
            f"{column} out of bounds {[-bound, bound]}",
        )

    # Check for duplicated (shape_id, shape_pt_sequence) pairs
    cond = f[["shape_id", "shape_pt_sequence"]].duplicated()
    problems = check_table(
        problems, table, f, cond, "Repeated pair (shape_id, shape_pt_sequence)"
    )

    # Check if shape_dist_traveled does decreases on a trip
    if "shape_dist_traveled" in f.columns:
        g = f.dropna(subset=["shape_dist_traveled"])
        indices = []
        prev_sid = None
        prev_dist = -1
        cols = ["shape_id", "shape_dist_traveled"]
        for i, sid, dist in g[cols].itertuples():
            if sid == prev_sid and dist < prev_dist:
                indices.append(i)

            prev_sid = sid
            prev_dist = dist

        if indices:
            problems.append(
                [
                    "error",
                    "shape_dist_traveled decreases on a trip",
                    table,
                    indices,
                ]
            )

    return format_problems(problems, as_df=as_df)
168142
private function fetchForm() : bool
    {
        // Get the field keys
        $form_key = preg_grep('/^form_' . preg_quote($this->name, '/') . '_[a-f0-9]+$/', array_keys($_SESSION));
        if (empty($form_key)) {
            return false;
        }
        $this->key = array_values($form_key)[0];

        // Save properties
        foreach ($_SESSION[$this->key] as $key => $value) {
            if (substr($key, -2) === '[]') {
                $this->keys[substr($key, 0, -2)] = $value;
            } else {
                $this->keys[$key] = $value;
            }
        }
        return true;
    }
394429
def form_valid(self, post_form, attachment_formset, **kwargs):
        
        save_attachment_formset = attachment_formset is not None \
            and not self.preview

        if self.preview:
            return self.render_to_response(
                self.get_context_data(
                    preview=True, post_form=post_form, attachment_formset=attachment_formset,
                    **kwargs
                ),
            )

        # This is not a preview ; the object is going to be saved
        self.forum_post = post_form.save()

        if save_attachment_formset:
            attachment_formset.post = self.forum_post
            attachment_formset.save()

        messages.success(self.request, self.success_message)
        if not self.forum_post.approved:
            messages.warning(self.request, self.approval_required_message)

        return HttpResponseRedirect(self.get_success_url())
420945
public function isUploaded()
    {
        if ($this->form->isSubmitted() && is_array($this->value) && $this->value['error'] == UPLOAD_ERR_OK) {
            return true;
        }

        return false;
    }