// IsMarkdownFile reports whether name looks like a Markdown file based on its extension.
428271
func IsMarkdownFile(name string) bool {
	extension := strings.ToLower(filepath.Ext(name))
	for _, ext := range setting.Markdown.FileExtensions {
		if strings.ToLower(ext) == extension {
			return true
		}
	}
	return false
}
645882
func GenMarkdown(cmd *cobra.Command, w io.Writer) error {
	return GenMarkdownCustom(cmd, w, func(s string) string { return s })
}
1354494
func (m FileMode) IsMalformed() bool {
	return m != Dir &&
		m != Regular &&
		m != Deprecated &&
		m != Executable &&
		m != Symlink &&
		m != Submodule
}
239371
func validateTagFileName(name string) (err error) {
	_, err = os.Stat(filepath.Dir(name))
	re, _ := regexp.Compile(`.*\.txt`)
	if !re.MatchString(filepath.Base(name)) {
		err = errors.New(fmt.Sprint("Tagfiles must end in .txt and contain at least 1 letter.  Provided: ", filepath.Base(name)))
	}
	return err
}
1115582
func (fs *Filespace) IsFile(subPath string) bool {
	srcNode, err := fs.root.GetByPath(subPath)
	if err != nil || srcNode == nil {
		return false
	}
	return !srcNode.IsDir()
}
685783
func Detect(filename string) Type {
	switch {
	case IsMarkdownFile(filename):
		return MARKDOWN
	case IsOrgModeFile(filename):
		return ORG_MODE
	case IsIPythonNotebook(filename):
		return IPYTHON_NOTEBOOK
	default:
		return UNRECOGNIZED
	}
}
1245620
func isPerfFile(path string) bool {
	sourceFile, openErr := os.Open(path)
	if openErr != nil {
		return false
	}
	defer sourceFile.Close()

	// If the file is the output of a perf record command, it should begin
	// with the string PERFILE2.
	perfHeader := []byte("PERFILE2")
	actualHeader := make([]byte, len(perfHeader))
	if _, readErr := sourceFile.Read(actualHeader); readErr != nil {
		return false
	}
	return bytes.Equal(actualHeader, perfHeader)
}
1309325
func (b *bitmap) isMarked(addr uintptr) bool {
	block, baddr := b.block(addr)
	return block.isMarked(baddr)
}
1100832
func (ctx *context) Markdown(markdownB []byte, opts ...Markdown) (int, error) {
	options := DefaultMarkdownOptions

	if len(opts) > 0 {
		options = opts[0]
	}

	ctx.ContentType(ContentHTMLHeaderValue)

	n, err := WriteMarkdown(ctx.writer, markdownB, options)
	if err != nil {
		ctx.StatusCode(http.StatusInternalServerError)
		return 0, err
	}

	return n, err
}
302655
func IsFileExist(fpath string) bool {
	if _, err := os.Stat(fpath); os.IsNotExist(err) {
		return false
	}
	return true
}
106590
func (u *CopyOnWriteFs) isBaseFile(name string) (bool, error) {
	if _, err := u.layer.Stat(name); err == nil {
		return false, nil
	}
	_, err := u.base.Stat(name)
	if err != nil {
		if oerr, ok := err.(*os.PathError); ok {
			if oerr.Err == os.ErrNotExist || oerr.Err == syscall.ENOENT || oerr.Err == syscall.ENOTDIR {
				return false, nil
			}
		}
		if err == syscall.ENOENT {
			return false, nil
		}
	}
	return true, err
}
563793
func (d *Decoder) IsValidFile() bool {
	d.ReadInfo()
	if d.err != nil && d.err != io.EOF {
		return false
	}
	if d.NumChans < 1 {
		return false
	}
	if d.BitDepth < 8 {
		return false
	}
	if d, err := d.Duration(); err != nil || d <= 0 {
		return false
	}

	return true
}
219523
func (s *HTTPScaffold) handleMarkdown(resp http.ResponseWriter, req *http.Request) {
	if req.Method != s.markdownMethod {
		resp.WriteHeader(http.StatusMethodNotAllowed)
		return
	}

	req.Body.Close()
	s.tracker.markDown()
	if s.markdownHandler != nil {
		s.markdownHandler()
	}
}
839612
func checkFilename(name string) error {
	cleanedName := path.Clean(name)
	if cleanedName != name {
		// The filename on the wire should be in canonical format. If
		// Clean() managed to clean it up, there was something wrong with
		// it.
		return errUncleanFilename
	}

	switch name {
	case "", ".", "..":
		// These names are always invalid.
		return errInvalidFilename
	}
	if strings.HasPrefix(name, "/") {
		// Names are folder relative, not absolute.
		return errInvalidFilename
	}
	if strings.HasPrefix(name, "../") {
		// Starting with a dotdot is not allowed. Any other dotdots would
		// have been handled by the Clean() call at the top.
		return errInvalidFilename
	}
	return nil
}
657383
func IsValidConfigFilename(filename string) bool {
	ext := strings.ToLower(strings.TrimPrefix(filepath.Ext(filename), "."))
	return validConfigFileExtensionsMap[ext]
}
60771
func (c *ChatPostMessageCall) Markdown(markdown bool) *ChatPostMessageCall {
	c.markdown = markdown
	return c
}
1251635
func (container *Container) IsSingleFile() bool {
	if len(container.Files) == 1 && len(container.Dirs) == 0 && len(container.Symlinks) == 0 {
		return true
	}
	return false
}