// SupportANSI checks if the terminal supports ANSI escape sequences.
183802
func SupportANSI() bool {
	term := os.Getenv("TERM")
	if term == "" {
		return false
	}

	for _, v := range shellsWithoutANSI {
		if v == term {
			return false
		}
	}
	return true
}
1219408
func (l *List) Supports(capability Capability) bool {
	_, ok := l.m[capability]
	return ok
}
409998
func (surface *Surface) SupportsMimeType(mimeType string) bool {
	c_mimeType := C.CString(mimeType)
	defer C.free(unsafe.Pointer(c_mimeType))
	ret := C.cairo_surface_supports_mime_type(surface.Ptr, c_mimeType) != 0
	if err := surface.status(); err != nil {
		panic(err)
	}
	return ret
}
666033
func WindowsNativeANSI() bool {
	enabled, _ := windowsNativeANSI(true, false, nil)
	if enabled {
		return enabled
	}
	enabled, _ = windowsNativeANSI(false, false, nil)
	return enabled
}
374376
func (p *StorageProvider) Supports(kind storage.StorageKind) bool {
	p.MethodCall(p, "Supports", kind)
	if p.SupportsFunc != nil {
		return p.SupportsFunc(kind)
	}
	return true
}
315154
func Up(n uint) ANSI {
	if n == 0 {
		return empty
	}
	return newAnsi(fmt.Sprintf(esc+"%dA", n))
}
150034
func (e Environ) SupportsSpaceDiscovery(ctx context.ProviderCallContext) (bool, error) {
	access, err := e.canAccessNetworkAPI()
	if err != nil {
		return false, errors.Trace(err)
	}
	if access {
		return true, nil
	}
	return false, nil
}
70890
func ParseINI(s string) (map[string]string, error) {
	m := make(map[string]string)
	sc := bufio.NewScanner(strings.NewReader(s))

	for sc.Scan() {
		l := sc.Text() // format: K=V
		p := strings.Split(l, "=")
		if len(p) != 2 {
			return nil, fmt.Errorf("Unexpected config line: %q", l)
		}
		m[p[0]] = p[1]
	}
	if err := sc.Err(); err != nil {
		return nil, fmt.Errorf("Could not scan config file: %v", err)
	}
	return m, nil
}
1058439
func (s *IndicesExistsTypeService) AllowNoIndices(allowNoIndices bool) *IndicesExistsTypeService {
	s.allowNoIndices = &allowNoIndices
	return s
}
430846
func (c *Client) Admin1CodesASCII() ([]*models.AdminCode, error) {
	var err error
	var result []*models.AdminCode

	data, err := httpGet(geonamesURL + admin1CodesASCIIURL)
	if err != nil {
		return nil, err
	}

	parse(data, 0, func(raw [][]byte) bool {
		if len(raw) != 4 {
			return true
		}

		geonameID, _ := strconv.ParseInt(string(raw[3]), 10, 64)

		result = append(result, &models.AdminCode{
			Codes:     string(raw[0]),
			Name:      string(raw[1]),
			ASCIIName: string(raw[2]),
			GeonameID: geonameID,
		})

		return true
	})

	return result, nil
}
1141754
func checkAdminInfoSyntax(ctx *cli.Context) {
	if len(ctx.Args()) == 0 || len(ctx.Args()) > 2 {
		cli.ShowCommandHelpAndExit(ctx, "info", 1) // last argument is exit code
	}
}
173332
func (a *Assertion) NotPanic(fn func(), msg ...interface{}) *Assertion {
	NotPanic(a.t, fn, msg...)
	return a
}
362988
func sgExistsInENI(sgID string, iface *ec2.NetworkInterface) bool {
	for _, v := range iface.Groups {
		if *v.GroupId == sgID {
			return true
		}
	}
	return false
}
1365911
func windowsNativeANSI(stderr bool, setMode bool, sc sysCaller) (enabled bool, err error) {
	// Check if ANSI is supported by means of ANSICON or ConEmu first.
	isAnsicon := (os.Getenv("ANSICON") != "" && os.Getenv("ANSICON_VER") != "")
	isConEmu := os.Getenv("ConEmuANSI") == "ON"
	if isAnsicon || isConEmu {
		return true, nil
	}

	if sc == nil {
		if stderr {
			sc = &sysCall{nStdHandle: syscall.STD_ERROR_HANDLE}
		} else {
			sc = &sysCall{nStdHandle: syscall.STD_OUTPUT_HANDLE}
		}
	}

	// Get win32 handle.
	if err = sc.getStdHandle(); err != nil {
		return
	}

	// Get console mode.
	var dwMode uint32
	if err = sc.getConsoleMode(&dwMode); err != nil {
		return
	}
	enabled = dwMode&EnableVirtualTerminalProcessing != 0
	if enabled || !setMode {
		return
	}

	// Try to enable the feature.
	dwMode |= EnableVirtualTerminalProcessing
	if r1, err := sc.setConsoleMode(uintptr(dwMode)); r1 == 0 {
		return false, err
	}
	return true, nil
}
313684
func checkAdminUserDisableSyntax(ctx *cli.Context) {
	if len(ctx.Args()) != 2 {
		cli.ShowCommandHelpAndExit(ctx, "disable", 1) // last argument is exit code
	}
}
525433
func (d *driver) Supported(
	ctx types.Context,
	opts types.Store) (bool, error) {

	if !gotil.FileExistsInPath("lsscsi") {
		ctx.Error("lsscsi executable not found in PATH")
		return false, nil
	}

	return utils.IsAzureInstance(ctx)
}
910461
func EncodeMulti(name string, value interface{}, codecs ...Codec) (string, error) {
	if len(codecs) == 0 {
		return "", errNoCodecs
	}

	var errors MultiError
	for _, codec := range codecs {
		encoded, err := codec.Encode(name, value)
		if err == nil {
			return encoded, nil
		}
		errors = append(errors, err)
	}
	return "", errors
}