// From returns the dimensions currently set inside a context object
13761
func (c *CtxDimensions) From(ctx context.Context) []interface{} {
	existing := ctx.Value(c)
	if existing == nil {
		return []interface{}{}
	}
	return existing.([]interface{})
}
220971
func From(other generic.T) T {
	return T{other.Get(0, 0), other.Get(0, 1)}
}
1354693
func from(b *Builder, args []string, attributes map[string]bool, flagArgs []string, original string) error {
	switch {
	case len(args) == 1:
	case len(args) == 3 && len(args[0]) > 0 && strings.EqualFold(args[1], "as") && len(args[2]) > 0:

	default:
		return fmt.Errorf("FROM requires either one argument, or three: FROM <source> [as <name>]")
	}

	name := args[0]

	// Support ARG before from
	argStrs := []string{}
	for n, v := range b.Args {
		argStrs = append(argStrs, n+"="+v)
	}
	var err error
	if name, err = ProcessWord(name, argStrs); err != nil {
		return err
	}

	// Windows cannot support a container with no base image.
	if name == NoBaseImageSpecifier {
		if runtime.GOOS == "windows" {
			return fmt.Errorf("Windows does not support FROM scratch")
		}
	}
	b.RunConfig.Image = name
	// TODO: handle onbuild
	return nil
}
38405
func (jf openTracingService) FromContext(ctx context.Context) (Span, bool) {
	innerSpan := opentracing.SpanFromContext(ctx)

	if innerSpan != nil {
		return openTracingSpan{otSpan: innerSpan}, true
	} else {
		return nil, false
	}
}
691341
func FromContext(ctx context.Context) *Context {
	c, _ := ctx.Value(contextKey{}).(*Context)
	return c
}
394107
func FromRequest(r *http.Request) XStater {
	if r == nil {
		return nop
	}
	return FromContext(r.Context())
}
136199
func FromMap(m map[string]interface{}, current string, namespace *[]string) error {
	return FromCompositeObject(m, current, namespace,
		InspectNilPointers(AlwaysFalse),
		InspectEmptyContainers(AlwaysFalse),
		ExportJsonFieldNames(AlwaysFalse))
}
710451
func FromObject(obj runtime.Object) error {
	switch t := obj.(type) {
	case *metav1.Status:
		return &StatusError{ErrStatus: *t}
	case runtime.Unstructured:
		var status metav1.Status
		obj := t.UnstructuredContent()
		if !reflect.DeepEqual(obj["kind"], "Status") {
			break
		}
		if err := runtime.DefaultUnstructuredConverter.FromUnstructured(t.UnstructuredContent(), &status); err != nil {
			return err
		}
		if status.APIVersion != "v1" && status.APIVersion != "meta.k8s.io/v1" {
			break
		}
		return &StatusError{ErrStatus: status}
	}
	return &UnexpectedObjectError{obj}
}
883144
func FromContext(c context.Context) *Goon {
	return &Goon{
		Context:          c,
		cache:            make(map[string]interface{}),
		KindNameResolver: DefaultKindName,
	}
}
705930
func From(in []byte) ([]byte, error) {
	tr, err := fromCp949()
	if err != nil {
		return nil, err
	}

	_, out, err := tr.Translate(in)
	if err != nil {
		return nil, err
	}

	return out, nil
}
752016
func FromContext(ctx context.Context) log15.Logger {
	if logger, ok := ctx.Value(loggerKey).(log15.Logger); ok {
		return logger
	}

	return log15.Root()
}
894193
func FromContext(ctx context.Context) (Logger, bool) {
	l, ok := ctx.Value(loggerKey).(Logger)
	return l, ok
}
664228
func (e *containerByIDIndexer) FromObject(obj interface{}) (bool, []byte, error) {
	c, ok := obj.(*Container)
	if !ok {
		return false, nil, fmt.Errorf("%T is not a Container", obj)
	}
	// Add the null character as a terminator
	v := c.ID + "\x00"
	return true, []byte(v), nil
}
208231
func From(other generic.T) T {
	r := Ident
	cols := other.Cols()
	rows := other.Rows()
	if (cols == 3 && rows == 3) || (cols == 4 && rows == 4) {
		cols = 2
		rows = 2
	} else if !(cols == 2 && rows == 2) {
		panic("Unsupported type")
	}
	for col := 0; col < cols; col++ {
		for row := 0; row < rows; row++ {
			r[col][row] = other.Get(col, row)
		}
	}
	return r
}
731641
func FromContext(ctx context.Context) (*LoggerMeta, bool) {
	v, ok := ctx.Value(loggerMetaKey).(*LoggerMeta)
	return v, ok
}
363078
func FromParameters(parameters map[string]interface{}) (*Driver, error) {
	params := Parameters{
		ChunkSize:          defaultChunkSize,
		InsecureSkipVerify: false,
	}

	// Sanitize some entries before trying to decode parameters with mapstructure
	// TenantID and Tenant when integers only and passed as ENV variables
	// are considered as integer and not string. The parser fails in this
	// case.
	_, ok := parameters["tenant"]
	if ok {
		parameters["tenant"] = fmt.Sprint(parameters["tenant"])
	}
	_, ok = parameters["tenantid"]
	if ok {
		parameters["tenantid"] = fmt.Sprint(parameters["tenantid"])
	}

	if err := mapstructure.Decode(parameters, &params); err != nil {
		return nil, err
	}

	if params.Username == "" {
		return nil, fmt.Errorf("no username parameter provided")
	}

	if params.Password == "" {
		return nil, fmt.Errorf("no password parameter provided")
	}

	if params.AuthURL == "" {
		return nil, fmt.Errorf("no authurl parameter provided")
	}

	if params.Container == "" {
		return nil, fmt.Errorf("no container parameter provided")
	}

	if params.ChunkSize < minChunkSize {
		return nil, fmt.Errorf("the chunksize %#v parameter should be a number that is larger than or equal to %d", params.ChunkSize, minChunkSize)
	}

	return New(params)
}
891436
func (transition *EventTransition) From(states ...string) *EventTransition {
	transition.froms = states
	return transition
}