// NewDataScope create new instance of data scope
13465
func NewDataScope(data map[string]interface{}) app.DataScope {
	return app.DataScope(&DataScope{
		Data: make(map[string]interface{}),
	})
}
719808
func NewDatabaseAPI(client *Client) *DatabaseAPI {
	return &DatabaseAPI{
		&baseAPI{
			client: client,
			FuncGetResourceURL: func() string {
				return "appliance"
			},
			FuncBaseSearchCondition: func() *sacloud.Request {
				res := &sacloud.Request{}
				res.AddFilter("Class", "database")
				return res
			},
		},
	}
}
1207155
func New(bs []string) (*Table, error) {
	m := make(map[string]bool)
	for _, b := range bs {
		m[b] = true
	}
	if len(m) != len(bs) {
		return nil, fmt.Errorf("table.New does not allow duplicated bindings in %s", bs)
	}
	return &Table{
		AvailableBindings: bs,
		mbs:               m,
	}, nil
}
898092
func (m *GormRoleScopeRepository) LoadByScope(ctx context.Context, ID uuid.UUID) ([]RoleScope, error) {
	return m.Query(RoleScopeFilterByScope(ID))
}
47972
func (c *adminClient) CreateScope(ctx context.Context, md *ScopeMetadata) error {
	return c.connector.CreateScope(ctx, md)
}
433355
func NewMockScope(ctrl *gomock.Controller) *MockScope {
	mock := &MockScope{ctrl: ctrl}
	mock.recorder = &MockScopeMockRecorder{mock}
	return mock
}
1043266
func newClient(scope string, kv string, addr string, config *store.Config, cached bool) (DataStore, error) {

	if cached && scope != LocalScope {
		return nil, fmt.Errorf("caching supported only for scope %s", LocalScope)
	}
	sequential := false
	if scope == LocalScope {
		sequential = true
	}

	if config == nil {
		config = &store.Config{}
	}

	var addrs []string

	if kv == string(store.BOLTDB) {
		// Parse file path
		addrs = strings.Split(addr, ",")
	} else {
		// Parse URI
		parts := strings.SplitN(addr, "/", 2)
		addrs = strings.Split(parts[0], ",")

		// Add the custom prefix to the root chain
		if len(parts) == 2 {
			rootChain = append([]string{parts[1]}, defaultRootChain...)
		}
	}

	store, err := libkv.NewStore(store.Backend(kv), addrs, config)
	if err != nil {
		return nil, err
	}

	ds := &datastore{scope: scope, store: store, active: true, watchCh: make(chan struct{}), sequential: sequential}
	if cached {
		ds.cache = newCache(ds)
	}

	return ds, nil
}
789058
func (api *DatabaseAPI) New(values *sacloud.CreateDatabaseValue) *sacloud.Database {
	return sacloud.CreateNewDatabase(values)
}
424821
func (r *resourceRecordSets) New(name string, rrdatas []string, ttl int64, rrstype rrstype.RrsType) dnsprovider.ResourceRecordSet {
	data := dns.DNSRecord{
		Name:    name,
		Rrdatas: rrdatas,
		//Ttl:     int(ttl),
		RrsType: string(rrstype),
	}
	return &resourceRecordSet{data: data}
}
1314552
func NewLogScope(name string) LogScope {
	scopeMarker := tfmt.Colorizef(tfmt.DarkGray, tfmt.NoBackground, "[%s] ", name)

	return LogScope{
		name:    name,
		Error:   log.New(logLogger{Error}, scopeMarker, 0),
		Warning: log.New(logLogger{Warning}, scopeMarker, 0),
		Note:    log.New(logLogger{Note}, scopeMarker, 0),
		Debug:   log.New(logLogger{Debug}, scopeMarker, 0),
	}
}
163360
func NewDatasetWithData(headers []string, data [][]interface{}) *Dataset {
	d := &Dataset{"", headers, data, make([][]string, 0), make([]ColumnConstraint,
		len(headers)), len(data), len(headers), nil}
	return d
}
256051
func (c *Connector) CreateScope(ctx context.Context, md *dosa.ScopeMetadata) error {
	if c.Next == nil {
		return NewErrNoMoreConnector()
	}
	return c.Next.CreateScope(ctx, md)
}
1126208
func (aSpace *addrSpace) DataScope() string {
	aSpace.Lock()
	defer aSpace.Unlock()

	return aSpace.scope
}
654651
func NewDatapath(config DatapathConfiguration) datapath.Datapath {
	dp := &linuxDatapath{
		nodeAddressing: NewNodeAddressing(),
		config:         config,
	}

	dp.node = NewNodeHandler(config, dp.nodeAddressing)

	return dp
}
276823
func NewScopes(in interface{}, context *compiler.Context) (*Scopes, error) {
	errors := make([]error, 0)
	x := &Scopes{}
	m, ok := compiler.UnpackMap(in)
	if !ok {
		message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
		errors = append(errors, compiler.NewError(context, message))
	} else {
		// repeated NamedScope additional_properties = 1;
		// MAP: Scope
		x.AdditionalProperties = make([]*NamedScope, 0)
		for _, item := range m {
			k, ok := compiler.StringValue(item.Key)
			if ok {
				v := item.Value
				pair := &NamedScope{}
				pair.Name = k
				var err error
				pair.Value, err = NewScope(v, compiler.NewContext(k, context))
				if err != nil {
					errors = append(errors, err)
				}
				x.AdditionalProperties = append(x.AdditionalProperties, pair)
			}
		}
	}
	return x, compiler.NewErrorGroupOrNil(errors)
}
768586
func (s *sessionV8) NewDataWriter() io.Writer {
	// DataFP is always intitialized, either via new or load functions.
	s.DataFP.Seek(0, os.SEEK_SET)
	// when moving to file position 0 we want to truncate the file as well,
	// otherwise we'll partly overwrite existing data
	s.DataFP.Truncate(0)
	return io.Writer(s.DataFP)
}
1216583
func NewMapInjector(tagname string, data map[string]interface{}) app.Injector {
	return app.Injector(MapInjector{
		tagname: tagname,
		data:    data,
	})
}