Scan original post type to override
431186
public function scan_post_type() {
		$flg = false;
		foreach ( $this->namespaces as $ns => $dir ) {
			$dir = $dir . '/' . $ns . '/ThePost';
			if ( is_dir( $dir ) ) {
				foreach ( scandir( $dir ) as $file ) {
					if ( ! preg_match( '/^\./u', $file ) ) {
						$base_class = str_replace( '.php', '', $file );
						$class_name = $ns . '\\ThePost\\' . $base_class;
						if ( class_exists( $class_name ) && $this->is_sub_class_of( $class_name, PostHelper::class ) ) {
							$this->post_type_to_override[ $this->str->camel_to_hyphen( $base_class ) ] = $class_name;
							$flg                                                                       = true;
						}
					}
				}
			}
		}
		if ( $flg ) {
			add_action( 'the_post', [ $this, 'the_post' ] );
		}
	}
846809
function overrideCheck(msg) {
      if (msg.srclang){
        var langCode = payloadutils.langTransToSTTFormat(msg.srclang);
        config.lang = langCode;
      }
      return Promise.resolve();
    }
1182529
public function registered_post_type( string $post_type, WP_Post_Type $post_type_object ) {
		if ( $post_type !== $this->post_type ) {
			return;
		}
		$struct = str_replace( "%{$this->post_type}_slug%", $this->post_slug, $post_type_object->rewrite['permastruct'] );
		$struct = str_replace( '%postname%', "%{$this->post_type}%", $struct );
		add_permastruct( $this->post_type, $struct, $post_type_object->rewrite );
	}
490336
def post(self, request, *args, **kwargs):
        
        return self.update_type(request, *args, **kwargs)
229971
def html_override_tool():
    '''
    
    '''
    apiopts = cherrypy.config['apiopts']
    request = cherrypy.request

    url_blacklist = (
        apiopts.get('app_path', '/app'),
        apiopts.get('static_path', '/static'),
    )

    if 'app' not in cherrypy.config['apiopts']:
        return

    if request.path_info.startswith(url_blacklist):
        return

    if request.headers.get('Accept') == '*/*':
        return

    try:
        wants_html = cherrypy.lib.cptools.accept('text/html')
    except cherrypy.HTTPError:
        return
    else:
        if wants_html != 'text/html':
            return

    raise cherrypy.InternalRedirect(apiopts.get('app_path', '/app'))
542511
function getPostIntro(body) {
  let isBlankReg = /^\s+$/,
    start = 0;
  return body.split('\n').filter((item) => {
    if (start < 5 && !isBlankReg.test(item)) {
      start++;
      return true;
    }
  }).join('\n')
}
865339
def apply_overrides(request, omap):
        
        if omap:
            for k, v in omap.iteritems():
                o = request.GetElement('overrides').AppendElment()
                o.SetElement('fieldId', k)
                o.SetElement('value', v)
997365
function remakeBody (body, bodyType) {
  return blobUtil
    .base64StringToBlob(body)
    .then(function (blob) {
      switch (bodyType) {
        case BodyTypes.ARRAY_BUFFER:
          return blobUtil.blobToArrayBuffer(blob)
        case BodyTypes.BLOB:
          return blob
        case BodyTypes.FORM_DATA:
          throw new Error('Cannot make FormData from serialised Request')
        case BodyTypes.JSON:
          return blobToString(blob)
            .then(function (str) {
              return JSON.parse(str)
            })
        case BodyTypes.TEXT:
          return blobToString(blob)
        default:
          throw new Error('Unknown requested body type "' + bodyType + '"')
      }
    })
}
415746
function (element, type, original, handler, fn) {
                if (!type || type === '*') {
                  // search the whole registry
                  for (var t in map) {
                    if (t.charAt(0) === '$')
                      forAll(element, t.substr(1), original, handler, fn)
                  }
                } else {
                  var i = 0, l, list = map['$' + type], all = element === '*'
                  if (!list)
                    return
                  for (l = list.length; i < l; i++) {
                    if (all || list[i].matches(element, original, handler))
                      if (!fn(list[i], list, i, type))
                        return
                  }
                }
              }
566888
function(posType) {
    posType = posType || "current";

    var root = this.graph.getNode(this.root),
        config = this.config,
        size = this.canvas.getSize(),
        width = size.width,
        height = size.height,
        offset = config.offset,
        levelsToShow = config.constrained ? config.levelsToShow : Number.MAX_VALUE;

    this.controller.onBeforeCompute(root);

    Graph.Util.computeLevels(this.graph, root.id, 0, "ignore");

    var treeDepth = 0;

    Graph.Util.eachLevel(root, 0, false, function (n, d) { if(d > treeDepth) treeDepth = d; });

    var startNode = this.graph.getNode(this.clickedNode && this.clickedNode.id || root.id);
    var maxDepth = Math.min(treeDepth, levelsToShow-1);
    var initialDepth = startNode._depth;
    if(this.layout.horizontal()) {
      this.computeSubtree(startNode, -width/2, -height/2, width/(maxDepth+1), height, initialDepth, maxDepth, posType);
    } else {
      this.computeSubtree(startNode, -width/2, -height/2, width, height/(maxDepth+1), initialDepth, maxDepth, posType);
    }
  }
1069264
final protected function initPostTypesTrait() {
		add_action("init", function () {
			$postTypes = $this->getPostTypes();
			foreach ($postTypes as $postType) {
				$this->registerPostType($postType);
			}
		});
	}
117747
public function getPostTypeObject($post_type)
    {
        if ( ! isset($this->postTypes[ $post_type ])) {
            return false;
        }

        return $this->postTypes[ $post_type ];
    }
859026
function getPost(post) {
  if (!post || !post.body) return {};


  let postQuery = getPostQuery(post.body);
  let postIntro = postQuery.intro || getPostIntro(post.body);

  Object.assign(post, {
    intro: postIntro,
    query: postQuery,
    create_time: formatTime(post.created_at),
    update_time: formatTime(post.updated_at)
  })

  return post;
}
264330
function() {
      var t = this,
          raw = t.model.toJSON({trim:false});
      return !(_.isEqual(t.originalPage, raw));
    }
862176
def valuefrompostdata(self, postdata):
        """"""
        if self.id in postdata and postdata[self.id] != '':
            return float(postdata[self.id])
        else:
            return None
1107673
function formatPostData(data) { //, contentType
    // If it's a string, we assume it's properly encoded
    if (typeof(data) === 'string') return data;

    var queryString = [];

    for (var key in data) {
      queryString.push(
        encodeURIComponent(key) + '=' + encodeURIComponent(data[key])
      );
    }

    return queryString.join('&').replace(/\+/g, '%20');
  }
515921
public function elasticPressPreIndex($post)
    {
        $rendered = $this->getRenderedPostModules($post);

        if (is_array($post)) {
            $post['post_content'] .= $rendered;
        } else {
            $post->post_content .= $rendered;
        }

        return $post;
    }