// ExtractName extracts the name of the test case from test output lines
161541
func (p *testDataParser) ExtractName(line string) (string, bool) {
	// The test declaration pattern is technically a subset of the test conclusion pattern, and will therefore
	// match anything the test declaration pattern matches. The match from the test conclusion pattern is more
	// correct, if it exists, so we check the conclusion pattern first and return if we have a name candidate.
	if matches := p.testConclusionPattern.FindStringSubmatch(line); len(matches) > 3 && len(matches[3]) > 0 {
		return matches[3], true
	}

	if matches := p.testDeclarationPattern.FindStringSubmatch(line); len(matches) > 0 && len(matches[0]) > 0 {
		return matches[0], true
	}

	return "", false
}
84961
func Name(input string) error {
	if govalidator.StringMatches(input, namePattern) {
		return nil
	}

	return NewValidationError(fmt.Sprintf(nameErrorPattern, "Names"))
}
1214253
func extractHostname(in string) string {
	if in == "" {
		return ""
	}
	// help url.Parse by adding a scheme if one is missing. This should still
	// allow for any scheme, but by default we assume http (only for parsing)
	urlStr := in
	if !strings.Contains(urlStr, "://") {
		urlStr = "http://" + urlStr
	}
	u, err := url.Parse(urlStr)
	if err == nil {
		if ch := fsutil.CleanFilename(u.Hostname()); ch != "" {
			return ch
		}
	}
	return fsutil.CleanFilename(in)
}
998184
func Extract(source, target, destination string) error {
	eIface, err := ByExtension(source)
	if err != nil {
		return err
	}
	e, ok := eIface.(Extractor)
	if !ok {
		return fmt.Errorf("format specified by source filename is not an extractor format: %s (%T)", source, eIface)
	}
	return e.Extract(source, target, destination)
}
982280
func ExtractExplain(opts ...interface{}) *opt.ExplainOption {
	for _, o := range opts {
		if v, ok := o.(*opt.ExplainOption); ok {
			return v
		}
	}
	return nil
}
3980
func strippedIsolatedName(isolated string) string {
	name := filepath.Base(isolated)
	// Strip the extension if there is one.
	if dotIndex := strings.LastIndex(name, "."); dotIndex != -1 {
		return name[0:dotIndex]
	}
	return name
}
201914
func Name(s string) string {
	// Start with lowercase string
	fileName := strings.ToLower(s)
	fileName = path.Clean(path.Base(fileName))

	// Remove illegal characters for names, replacing some common separators with -
	fileName = cleanString(fileName, illegalName)

	// NB this may be of length 0, caller must check
	return fileName
}
281633
func ExtractParameterAsString(s string, params interface{}) (string, bool) {
	if pValue, ok := GetParameter(s, params); ok {
		return fmt.Sprintf("%v", pValue), true
	}
	return "", false
}
537934
func (obj *GCSObject) ExtractKindName() string {
	if id := obj.extractKindNameForDatastoreAdmin(obj.Name); len(id) > 0 {
		return id
	}
	if id := obj.extractKindNameForDatastoreExport(obj.Name); len(id) > 0 {
		return id
	}
	return ""
}
185234
func (r *ReleaseAsset) GetName() string {
	if r == nil || r.Name == nil {
		return ""
	}
	return *r.Name
}
375387
func (p *StoragePool) GetName() (string, error) {
	var err C.virError
	name := C.virStoragePoolGetNameWrapper(p.ptr, &err)
	if name == nil {
		return "", makeError(&err)
	}
	return C.GoString(name), nil
}
1280150
func (c *CombinedStatus) GetName() string {
	if c == nil || c.Name == nil {
		return ""
	}
	return *c.Name
}
607290
func ExtractNamespace(np metav1.Object) string {
	ns := np.GetNamespace()
	if ns == "" {
		return v1.NamespaceDefault
	}
	return ns
}
640870
func (o *Organization) GetName() string {
	if o == nil || o.Name == nil {
		return ""
	}
	return *o.Name
}
1334296
func (o *ScanRefsOptions) GetName(sha string) (string, bool) {
	o.Mutex.Lock()
	defer o.Mutex.Unlock()

	name, ok := o.Names[sha]
	return name, ok
}
122947
func extractTableList(node ast.ResultSetNode, input []*ast.TableName, asName bool) []*ast.TableName {
	switch x := node.(type) {
	case *ast.Join:
		input = extractTableList(x.Left, input, asName)
		input = extractTableList(x.Right, input, asName)
	case *ast.TableSource:
		if s, ok := x.Source.(*ast.TableName); ok {
			if x.AsName.L != "" && asName {
				newTableName := *s
				newTableName.Name = x.AsName
				input = append(input, &newTableName)
			} else {
				input = append(input, s)
			}
		}
	}
	return input
}
842824
func (e *Entry) GetName() string {
	if len(e.NameRaw) > 0 {
		return string(e.NameRaw)
	}
	return e.Name
}