This function check if current permalink is valid. If it is not valid it
 generate a new from the post title.
542301
def check_meta_permalink
      candidate = (self.meta_permalink ? self.meta_permalink : self.title.parameterize)
      accepted = nil
      counter = 0

      while accepted.nil?
        if LatoBlog::Tag.find_by(meta_permalink: candidate)
          counter += 1
          candidate = "#{candidate}-#{counter}"
        else
          accepted = candidate
        end
      end

      self.meta_permalink = accepted
    end
697108
public function iShouldNotBeAbleToViewThePost($post_title)
    {
        try {
            $this->getContentFromTitle($post_title);
        } catch (UnexpectedValueException $e) {
            // This is expected to fail.
            return;
        }

        throw new RuntimeException(sprintf('[W811] Content "%s" exists, but it should not.', $post_title));
    }
425574
public function save_post_detect_new( $new_status, $old_status, $post ) {

		if ( $post ) {
			self::$old_post_status[ $post->post_type ] = $old_status;
		}

	}
683169
public static function isValueValid($postedParam)
	{
		$isValid = false;

		if(isset($postedParam['value'])) {

			$amount = $postedParam['value'];

			$isAmountEmpty = CheckoutApi_Lib_Validator::isEmpty($amount);

			
			if(!$isAmountEmpty  ) {
				$isValid = true;

			} 
	
		} 

		return $isValid;
	}
1122093
function _isArgsValid(title, options) {
            var isTitleString = angular.isString(title),
                isOnClickFunction = (!options.onClick || angular.isFunction(options.onClick));

            return (isTitleString && isOnClickFunction);
        }
345658
def ValidateURL(url, column_name=None, problems=None):
  
  if IsEmpty(url) or IsValidURL(url):
    return True
  else:
    if problems:
      problems.InvalidValue(column_name, url)
    return False
1165983
public function validate()
	{
		$varValue = $this->getPost($this->strName);

		if (!empty($varValue) && !$this->isValidOption($varValue))
		{
			$this->addError(sprintf($GLOBALS['TL_LANG']['ERR']['invalid'], (is_array($varValue) ? implode(', ', $varValue) : $varValue)));
		}

		parent::validate();
	}
24766
static function isFormSubmission() {

		if ( empty( $_REQUEST['page'] ) ) {
			return false;
		}

		if ( 'pb_export' !== $_REQUEST['page'] ) {
			return false;
		}

		if ( $_SERVER['REQUEST_METHOD'] === 'POST' ) {
			return true;
		}

		if ( count( $_GET ) > 1 ) {
			return true;
		}

		return false;
	}
117923
private function validateOneLineSummary(): bool
    {
        $isValid = true;
        $summaryPos = $this->getSummaryPosition();
        $nextPossiblePos = $this->loadNextDocBlockContent($summaryPos);

        if ($nextPossiblePos > -1) {
            $nextToken = $this->tokens[$nextPossiblePos];

            if (($nextToken['code'] === T_DOC_COMMENT_STRING) && !$this->isNextLineEmpty($summaryPos)) {
                $isValid = false;

                $this->file->addWarning(
                    self::MESSAGE_SUMMARY_TOO_LONG,
                    $nextPossiblePos,
                    static::CODE_SUMMARY_TOO_LONG
                );
            }
        }

        return $isValid;
    }
89017
function checkLink(s) {
        return ((s.indexOf("http") === 0) || (s.indexOf(SLASH) === 0)) ? "<a href='" + s + "'>" + s + "</a>" : s;
    }
320148
function check() {
    if (links[currentLink] && currentLink < upTo) {
        this.echo('--- Link ' + currentLink + ' ---');
        start.call(this, links[currentLink]);
        addLinks.call(this, links[currentLink]);
        currentLink++;
        this.run(check);
    } else {
        this.echo("All done.");
        this.exit();
    }
}
732340
def push(self, url, title=''):
        
        # ignore refreshes of the top level
        if self.currentUrl() == url or self._blockStack:
            return False
        
        self._blockStack = True
        
        self._stack = self._stack[:self._index+1]
        self._stack.append((nativestring(url), nativestring(title)))
        
        over = len(self._stack) - self.maximum()
        if over > 0:
            self._stack = self._stack[over:]
        
        self._index = len(self._stack) - 1
        
        self.canGoBackChanged.emit(self.canGoBack())
        self.canGoForwardChanged.emit(self.canGoForward())
        
        self._blockStack = False
        return True
646274
def validate!

      if title.blank?
        raise RuntimeError, "HelpLinks must provide a string title"
      end

      file_configured = (slug.present? && markdown_file.present?)
      link_configured = link_to.present?

      unless file_configured || link_configured
        raise RuntimeError, "Incomplete HelpLink config. You must provide link_to, or both slug and markdown_file."
      end

      if file_configured && link_configured
        raise RuntimeError, "Ambiguous HelpLink config. You must provide link_to, or both slug and markdown_file, but not all three."
      end

    end
170222
def submit_text(self, title, text):
        
        return self._reddit.submit_text(self.display_name, title, text)
1148627
public function iVisitTheBlogPostPage($title)
    {
        $post = $this->findPostByTitle($title);
        $url = '/'.$post['post_name'];

        return new Then(sprintf('I go to "%s"', $url));
    }
157805
protected function validateUrlDownload()
    {
        $invalid = array();

        foreach ($this->getSubmitted('sources') as $line => $url) {
            $line++;
            if (filter_var($url, FILTER_VALIDATE_URL) === false) {
                $invalid[] = $line;
            }
        }

        if (!empty($invalid)) {
            $this->setError('sources', $this->text('Error on line @num', array('@num' => implode(',', $invalid))));
        }
    }
289565
def set_is_valid_rss(self):
        """"""
        if self.title and self.link and self.description:
            self.is_valid_rss = True
        else:
            self.is_valid_rss = False