_id
stringlengths
2
7
title
stringclasses
1 value
partition
stringclasses
3 values
text
stringlengths
6
2.61k
language
stringclasses
1 value
meta_information
dict
c9400
train
// CreateFanout create a new fanout, and if it is non-blocked, it will start // the fanout goroutine at once, otherwise it will start the goroutine when it // get the first client
{ "resource": "" }
c9401
train
// loadProcessConfig loads the process configuration from the provided path.
{ "resource": "" }
c9402
train
// preCreateDirs creates necessary dirs for hyperstart
{ "resource": "" }
c9403
train
// allInterfaces return all the network interfaces except loop
{ "resource": "" }
c9404
train
// lock locks the sandbox to prevent it from being accessed by other processes.
{ "resource": "" }
c9405
train
// unlock unlocks the sandbox to allow it being accessed by other processes.
{ "resource": "" }
c9406
train
// SendVmEvent enqueues a VmEvent onto the context. Returns an error if there is // no handler associated with the context. VmEvent handling happens in a // separate goroutine, so this is thread-safe and asynchronous.
{ "resource": "" }
c9407
train
// ReadByte works like bufio.ReadByte
{ "resource": "" }
c9408
train
// ReadRune works like bufio.ReadRune
{ "resource": "" }
c9409
train
// Read is for implement an io.Reader interface
{ "resource": "" }
c9410
train
// ReadBytes works like bufio.ReadBytes
{ "resource": "" }
c9411
train
// SkipBytes works like ReadBytes but skips all read data.
{ "resource": "" }
c9412
train
// ReadString works like bufio.ReadString
{ "resource": "" }
c9413
train
// ReadUntilIndex reads from connection until one of delimiters occurs. Returns // read data and an index of delimiter or error.
{ "resource": "" }
c9414
train
// ReadUntil works like ReadUntilIndex but don't return a delimiter index.
{ "resource": "" }
c9415
train
// SkipUntilIndex works like ReadUntilIndex but skips all read data.
{ "resource": "" }
c9416
train
// SkipUntil works like ReadUntil but skips all read data.
{ "resource": "" }
c9417
train
// Write is for implement an io.Writer interface
{ "resource": "" }
c9418
train
// This function will only be invoked during daemon start
{ "resource": "" }
c9419
train
// This function should be put into the main process or somewhere that can be // use to init the network namespace trap.
{ "resource": "" }
c9420
train
// fatal prints the error's details if it is a runv specific error type // then exits the program with an exit status of 1.
{ "resource": "" }
c9421
train
// Error in spec, which is either mistake format or content inconsistency, and // is checked when elements are being added to Sandbox.
{ "resource": "" }
c9422
train
// On ARM platform, we have different gic interrupt controllers. // We have to detect the correct gic chip to set parameter for lkvm.
{ "resource": "" }
c9423
train
// boot vm from template, the returned vm is paused
{ "resource": "" }
c9424
train
// Return locked processlist, which needs to be released by caller after using
{ "resource": "" }
c9425
train
// NewServer initializes a brand new grpc server with registered grpc services
{ "resource": "" }
c9426
train
// machineID returns the key MachineGuid in registry `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography`. // If there is an error running the commad an empty string is returned.
{ "resource": "" }
c9427
train
// ProtectedID returns a hashed version of the machine ID in a cryptographically secure way, // using a fixed, application-specific key. // Internally, this function calculates HMAC-SHA256 of the application ID, keyed by the machine ID.
{ "resource": "" }
c9428
train
// machineID returns the uuid returned by `ioreg -rd1 -c IOPlatformExpertDevice`. // If there is an error running the commad an empty string is returned.
{ "resource": "" }
c9429
train
// run wraps `exec.Command` with easy access to stdout and stderr.
{ "resource": "" }
c9430
train
// protect calculates HMAC-SHA256 of the application ID, keyed by the machine ID and returns a hex-encoded string.
{ "resource": "" }
c9431
train
// Headers generates a map that can be used as headers to authenticate a request
{ "resource": "" }
c9432
train
// NewFake returns a Fake that loads the package and finds the interface or the // function.
{ "resource": "" }
c9433
train
// IsInterface indicates whether the fake is for an interface.
{ "resource": "" }
c9434
train
// IsFunction indicates whether the fake is for a function..
{ "resource": "" }
c9435
train
// Generate uses the Fake to generate an implementation, optionally running // goimports on the output.
{ "resource": "" }
c9436
train
// interfaceMethodSet identifies the methods that are exported for a given // interface.
{ "resource": "" }
c9437
train
// Slices returns those params that are a slice.
{ "resource": "" }
c9438
train
// WithPrefix builds a string representing a functions parameters, and adds a // prefix to each.
{ "resource": "" }
c9439
train
// AsArgs builds a string that represents the parameters to a function as // arguments to a function invocation.
{ "resource": "" }
c9440
train
// AsNamedArgsWithTypes builds a string that represents parameters as named // arugments to a function, with associated types.
{ "resource": "" }
c9441
train
// AsNamedArgs builds a string that represents parameters as named arguments.
{ "resource": "" }
c9442
train
// AsNamedArgsForInvocation builds a string that represents a function's // arguments as required for invocation of the function.
{ "resource": "" }
c9443
train
// AsReturnSignature builds a string representing signature for the params of // a function.
{ "resource": "" }
c9444
train
// String returns a string that may be used as an import line in a go source // file. Imports with aliases that match the package basename are printed without // an alias.
{ "resource": "" }
c9445
train
// Add creates an import with the given alias and path, and adds it to // Fake.Imports.
{ "resource": "" }
c9446
train
// AliasForPackage returns a package alias for the package.
{ "resource": "" }
c9447
train
// packageMethodSet identifies the functions that are exported from a given // package.
{ "resource": "" }
c9448
train
// addImportsFor inspects the given type and adds imports to the fake if importable // types are found.
{ "resource": "" }
c9449
train
// WithPrefix builds a string representing the parameters returned from a // function, and adds a prefix to each.
{ "resource": "" }
c9450
train
// AsArgs builds a string representing the arguments passed to a function.
{ "resource": "" }
c9451
train
// AsNamedArgsWithTypes builds a string representing a function's named // arguments, with associated types.
{ "resource": "" }
c9452
train
// AsNamedArgs builds a string representing a function's named arguments.
{ "resource": "" }
c9453
train
// AsReturnSignature builds a string representing signature for the returns of // a function.
{ "resource": "" }
c9454
train
// noop new, but in the future we may want to do some init work.
{ "resource": "" }
c9455
train
// NewPeerstore creates a peerstore backed by the provided persistent datastore.
{ "resource": "" }
c9456
train
// uniquePeerIds extracts and returns unique peer IDs from database keys.
{ "resource": "" }
c9457
train
// RecordLatency records a new latency measurement
{ "resource": "" }
c9458
train
// LatencyEWMA returns an exponentially-weighted moving avg. // of all measurements of a peer's latency.
{ "resource": "" }
c9459
train
// NewPopulatedProtoAddr generates a populated instance of the custom gogo type ProtoAddr. // It is required by gogo-generated tests.
{ "resource": "" }
c9460
train
// NewPopulatedProtoPeerID generates a populated instance of the custom gogo type ProtoPeerID. // It is required by gogo-generated tests.
{ "resource": "" }
c9461
train
// background periodically schedules a gc
{ "resource": "" }
c9462
train
// gc garbage collects the in-memory address book.
{ "resource": "" }
c9463
train
// UpdateAddrs updates the addresses associated with the given peer that have // the given oldTTL to have the given newTTL.
{ "resource": "" }
c9464
train
// ClearAddrs removes all previously stored addresses
{ "resource": "" }
c9465
train
// Used internally by the address stream coroutine to remove a subscription // from the manager.
{ "resource": "" }
c9466
train
// BroadcastAddr broadcasts a new address to all subscribed streams.
{ "resource": "" }
c9467
train
// AddrStream creates a new subscription for a given peer ID, pre-populating the // channel with any addresses we might already have on file.
{ "resource": "" }
c9468
train
// NewPeerstore creates a data structure that stores peer data, backed by the // supplied implementations of KeyBook, AddrBook and PeerMetadata.
{ "resource": "" }
c9469
train
// gc prunes expired addresses from the datastore at regular intervals. It should be spawned as a goroutine.
{ "resource": "" }
c9470
train
// flush writes the record to the datastore by calling ds.Put, unless the record is // marked for deletion, in which case we call ds.Delete. To be called within a lock.
{ "resource": "" }
c9471
train
// AddAddr will add a new address if it's not already in the AddrBook.
{ "resource": "" }
c9472
train
// AddAddrs will add many new addresses if they're not already in the AddrBook.
{ "resource": "" }
c9473
train
// SetAddr will add or update the TTL of an address in the AddrBook.
{ "resource": "" }
c9474
train
// SetAddrs will add or update the TTLs of addresses in the AddrBook.
{ "resource": "" }
c9475
train
// UpdateAddrs will update any addresses for a given peer and TTL combination to // have a new TTL.
{ "resource": "" }
c9476
train
// Addrs returns all of the non-expired addresses for a given peer.
{ "resource": "" }
c9477
train
// Peers returns all of the peer IDs for which the AddrBook has addresses.
{ "resource": "" }
c9478
train
// ClearAddrs will delete all known addresses for a peer ID.
{ "resource": "" }
c9479
train
// NewChanQueue creates a ChanQueue by wrapping pq.
{ "resource": "" }
c9480
train
// AddQueryParameters adds query parameters to the URL.
{ "resource": "" }
c9481
train
// BuildRequestObject creates the HTTP request object.
{ "resource": "" }
c9482
train
// MakeRequest makes the API call.
{ "resource": "" }
c9483
train
// BuildResponse builds the response struct.
{ "resource": "" }
c9484
train
// The following functions enable the ability to define a // custom HTTP Client // MakeRequest makes the API call.
{ "resource": "" }
c9485
train
// Send will build your request, make the request, and build your response.
{ "resource": "" }
c9486
train
// Parse returns Result and error if any. If have not matches it returns nil, nil.
{ "resource": "" }
c9487
train
// Add adds given rules to the main chain.
{ "resource": "" }
c9488
train
// Use adds give functions to middlewares.
{ "resource": "" }
c9489
train
// New returns Parser initialised with given options.
{ "resource": "" }
c9490
train
// NewBreakerWithOptions creates a base breaker with a specified backoff, clock and TripFunc
{ "resource": "" }
c9491
train
// NewRateBreaker creates a Breaker with a RateTripFunc.
{ "resource": "" }
c9492
train
// Subscribe returns a channel of BreakerEvents. Whenever the breaker changes state, // the state will be sent over the channel. See BreakerEvent for the types of events.
{ "resource": "" }
c9493
train
// AddListener adds a channel of ListenerEvents on behalf of a listener. // The listener channel must be buffered.
{ "resource": "" }
c9494
train
// RemoveListener removes a channel previously added via AddListener. // Once removed, the channel will no longer receive ListenerEvents. // Returns true if the listener was found and removed.
{ "resource": "" }
c9495
train
// ResetCounters will reset only the failures, consecFailures, and success counters
{ "resource": "" }
c9496
train
// Fail is used to indicate a failure condition the Breaker should record. It will // increment the failure counters and store the time of the last failure. If the // breaker has a TripFunc it will be called, tripping the breaker if necessary.
{ "resource": "" }
c9497
train
// Ready will return true if the circuit breaker is ready to call the function. // It will be ready if the breaker is in a reset state, or if it is time to retry // the call for auto resetting.
{ "resource": "" }
c9498
train
// Call wraps a function the Breaker will protect. A failure is recorded // whenever the function returns an error. If the called function takes longer // than timeout to run, a failure will be recorded.
{ "resource": "" }
c9499
train
// CallContext is same as Call but if the ctx is canceled after the circuit returned an error, // the error will not be marked as a failure because the call was canceled intentionally.
{ "resource": "" }