_id
stringlengths
2
7
title
stringclasses
1 value
partition
stringclasses
3 values
text
stringlengths
6
2.61k
language
stringclasses
1 value
meta_information
dict
c11400
train
// Cast casts a buffer onto a multihash, and returns an error // if it does not work.
{ "resource": "" }
c11401
train
// Decode parses multihash bytes into a DecodedMultihash.
{ "resource": "" }
c11402
train
// Sum obtains the cryptographic sum of a given buffer. The length parameter // indicates the length of the resulting digest and passing a negative value // use default length values for the selected hash function.
{ "resource": "" }
c11403
train
// RegisterHashFunc adds an entry to the package-level code -> hash func map. // The hash function must return at least the requested number of bytes. If it // returns more, the hash will be truncated.
{ "resource": "" }
c11404
train
// init initializes a scanner with a new buffer.
{ "resource": "" }
c11405
train
// read returns the next unicode character. It returns eof at // the end of the string buffer.
{ "resource": "" }
c11406
train
// skip skips over the curring unicode character in the buffer // by slicing and removing from the buffer.
{ "resource": "" }
c11407
train
// scan reads the next token or Unicode character from source and // returns it. It returns EOF at the end of the source.
{ "resource": "" }
c11408
train
// scanIdent reads the next token or Unicode character from source // and returns true if the Ident character is accepted.
{ "resource": "" }
c11409
train
// scanLbrack reads the next token or Unicode character from source // and returns true if the open bracket is encountered.
{ "resource": "" }
c11410
train
// scanRbrack reads the next token or Unicode character from source // and returns true if the closing bracket is encountered.
{ "resource": "" }
c11411
train
// scanEscaped reads the next token or Unicode character from source // and returns true if it being escaped and should be sipped.
{ "resource": "" }
c11412
train
// Parse parses the string and returns a Tree.
{ "resource": "" }
c11413
train
// Parse parses the string buffer to construct an ast // representation for expansion.
{ "resource": "" }
c11414
train
// parse a substitution function parameter.
{ "resource": "" }
c11415
train
// parse either a default or substring substitution function.
{ "resource": "" }
c11416
train
// consumeRbrack consumes a right closing bracket. If a closing // bracket token is not consumed an ErrBadSubstitution is returned.
{ "resource": "" }
c11417
train
// toLen returns the length of string s.
{ "resource": "" }
c11418
train
// toLowerFirst returns a copy of the string s with the first // character mapped to its lower case.
{ "resource": "" }
c11419
train
// toUpperFirst returns a copy of the string s with the first // character mapped to its upper case.
{ "resource": "" }
c11420
train
// toDefault returns a copy of the string s if not empty, else // returns a copy of the first string arugment.
{ "resource": "" }
c11421
train
// toSubstr returns a slice of the string s at the specified // length and position.
{ "resource": "" }
c11422
train
// replaceAll returns a copy of the string s with all instances // of the substring replaced with the replacement string.
{ "resource": "" }
c11423
train
// replaceFirst returns a copy of the string s with the first // instance of the substring replaced with the replacement string.
{ "resource": "" }
c11424
train
// replacePrefix returns a copy of the string s with the matching // prefix replaced with the replacement string.
{ "resource": "" }
c11425
train
// replaceSuffix returns a copy of the string s with the matching // suffix replaced with the replacement string.
{ "resource": "" }
c11426
train
// Parse creates a new shell format template and parses the template // definition from string s.
{ "resource": "" }
c11427
train
// Execute applies a parsed template to the specified data mapping.
{ "resource": "" }
c11428
train
// lookupFunc returns the parameters substitution function by name. If the // named function does not exists, a default function is returned.
{ "resource": "" }
c11429
train
// Backoff returns whether the client should backoff from dialing // peer p
{ "resource": "" }
c11430
train
// Clear removes a backoff record. Clients should call this after a // successful Dial.
{ "resource": "" }
c11431
train
// doDial is an ugly shim method to retain all the logging and backoff logic // of the old dialsync code
{ "resource": "" }
c11432
train
// dial is the actual swarm's dial logic, gated by Dial.
{ "resource": "" }
c11433
train
// limitedDial will start a dial to the given peer when // it is able, respecting the various different types of rate // limiting that occur without using extra goroutines per addr
{ "resource": "" }
c11434
train
// freeFDToken frees FD token and if there are any schedules another waiting dialJob // in it's place
{ "resource": "" }
c11435
train
// AddDialJob tries to take the needed tokens for starting the given dial job. // If it acquires all needed tokens, it immediately starts the dial, otherwise // it will put it on the waitlist for the requested token.
{ "resource": "" }
c11436
train
// executeDial calls the dialFunc, and reports the result through the response // channel when finished. Once the response is sent it also releases all tokens // it held during the dial.
{ "resource": "" }
c11437
train
// TransportForDialing retrieves the appropriate transport for dialing the given // multiaddr.
{ "resource": "" }
c11438
train
// AddTransport adds a transport to this swarm. // // Satisfies the Network interface from go-libp2p-transport.
{ "resource": "" }
c11439
train
// AddListenAddr tells the swarm to listen on a single address. Unlike Listen, // this method does not attempt to filter out bad addresses.
{ "resource": "" }
c11440
train
// NewDialSync constructs a new DialSync
{ "resource": "" }
c11441
train
// DialLock initiates a dial to the given peer if there are none in progress // then waits for the dial to that peer to complete.
{ "resource": "" }
c11442
train
// CancelDial cancels all in-progress dials to the given peer.
{ "resource": "" }
c11443
train
// listens for new streams. // // The caller must take a swarm ref before calling. This function decrements the // swarm ref count.
{ "resource": "" }
c11444
train
// NewStream returns a new Stream from this connection
{ "resource": "" }
c11445
train
// GetStreams returns the streams associated with this connection.
{ "resource": "" }
c11446
train
// Read reads bytes from a stream.
{ "resource": "" }
c11447
train
// Write writes bytes to a stream, flushing for each call.
{ "resource": "" }
c11448
train
// Close closes the stream, indicating this side is finished // with the stream.
{ "resource": "" }
c11449
train
// Reset resets the stream, closing both ends.
{ "resource": "" }
c11450
train
// NewSwarm constructs a Swarm
{ "resource": "" }
c11451
train
// AddAddrFilter adds a multiaddr filter to the set of filters the swarm will use to determine which // addresses not to dial to.
{ "resource": "" }
c11452
train
// ConnHandler gets the handler for new connections.
{ "resource": "" }
c11453
train
// SetStreamHandler assigns the handler for new streams.
{ "resource": "" }
c11454
train
// StreamHandler gets the handler for new streams.
{ "resource": "" }
c11455
train
// NewStream creates a new stream on any available connection to peer, dialing // if necessary.
{ "resource": "" }
c11456
train
// ConnsToPeer returns all the live connections to peer.
{ "resource": "" }
c11457
train
// bestConnToPeer returns the best connection to peer.
{ "resource": "" }
c11458
train
// Conns returns a slice of all connections.
{ "resource": "" }
c11459
train
// ClosePeer closes all connections to the given peer.
{ "resource": "" }
c11460
train
// Peers returns a copy of the set of peers swarm is connected to.
{ "resource": "" }
c11461
train
// notifyAll sends a signal to all Notifiees
{ "resource": "" }
c11462
train
// ListenAddresses returns a list of addresses at which this swarm listens.
{ "resource": "" }
c11463
train
// NewWithServer wraps an existing http.Server object and returns a // GracefulServer that supports all of the original Server operations.
{ "resource": "" }
c11464
train
// RoutinesCount returns the number of currently running routines
{ "resource": "" }
c11465
train
// runSubcommand executes a command with arguments in the context // of an environment populated with secret values.
{ "resource": "" }
c11466
train
// Resolve resolves a filepath to a provider // Checks the CLI arg, environment and then default path
{ "resource": "" }
c11467
train
// Call shells out to a provider and return its output // If call succeeds, stdout is returned with no error // If call fails, "" is return with error containing stderr
{ "resource": "" }
c11468
train
// Create a temp file with given value. Returns the path.
{ "resource": "" }
c11469
train
// Cleanup removes the temporary files created with this factory.
{ "resource": "" }
c11470
train
// runAction encapsulates the logic of Action without cli Context for easier testing
{ "resource": "" }
c11471
train
// formatForEnv returns a string in %k=%v format, where %k=namespace of the secret and // %v=the secret value or path to a temporary file containing the secret
{ "resource": "" }
c11472
train
// scans arguments for the magic string; if found, // creates a tempfile to which all the environment mappings are dumped // and replaces the magic string with its path. // Returns the path if so, returns an empty string otherwise.
{ "resource": "" }
c11473
train
// convertSubsToMap converts the list of substitutions passed in via // command line to a map
{ "resource": "" }
c11474
train
// ParseFromString parses a string in secrets.yml format to a map.
{ "resource": "" }
c11475
train
// ParseFromFile parses a file in secrets.yml format to a map.
{ "resource": "" }
c11476
train
// Wrapper for parsing yaml contents
{ "resource": "" }
c11477
train
// Parse secrets yaml that has environment sections
{ "resource": "" }
c11478
train
// Parse a secrets yaml that has no environment sections
{ "resource": "" }
c11479
train
// tagInSlice determines whether a YamlTag is in a list of YamlTag
{ "resource": "" }
c11480
train
// ListenAndServe listens on the UDP network address addr and then calls // Serve with handler to handle requests on incoming packets.
{ "resource": "" }
c11481
train
// get gets the Pather object wrapped in a node, instantiating if required.
{ "resource": "" }
c11482
train
// Path calculates a short path and the distance between the two Pather nodes. // // If no path is found, found will be false.
{ "resource": "" }
c11483
train
// PathNeighbors returns the neighbors of the Truck
{ "resource": "" }
c11484
train
// PathNeighborCost returns the cost of the tube leading to Truck.
{ "resource": "" }
c11485
train
// PathEstimatedCost uses Manhattan distance to estimate orthogonal distance // between non-adjacent nodes.
{ "resource": "" }
c11486
train
// RenderPath renders a path on top of a Goreland world.
{ "resource": "" }
c11487
train
// IPLess returns where IP a is less than IP b.
{ "resource": "" }
c11488
train
// OptionsLeaseTime - converts a time.Duration to a 4 byte slice, compatible // with OptionIPAddressLeaseTime.
{ "resource": "" }
c11489
train
// JoinIPs returns a byte slice of IP addresses, one immediately after the other // This may be useful for creating multiple IP options such as OptionRouter.
{ "resource": "" }
c11490
train
// Parses the packet's options into an Options map
{ "resource": "" }
c11491
train
// Appends a DHCP option to the end of a packet
{ "resource": "" }
c11492
train
// Creates a request packet that a Client would send to a server.
{ "resource": "" }
c11493
train
// Creates listener on all interfaces and then filters packets not received by interfaceName
{ "resource": "" }
c11494
train
// Dial establishes a connection to a log daemon by connecting to // address raddr on the specified network. Each write to the returned // writer sends a log message with the given facility, severity and // tag. // If network is empty, Dial will connect to the local syslog server.
{ "resource": "" }
c11495
train
// unixSyslog opens a connection to the syslog daemon running on the // local machine using a Unix domain socket.
{ "resource": "" }
c11496
train
// WriteLevel writes out a message at the given priority
{ "resource": "" }
c11497
train
// facilityPriority converts a facility string into // an appropriate priority level or returns an error
{ "resource": "" }
c11498
train
// Decrypt decrypts the input with a given mechanism.
{ "resource": "" }
c11499
train
// IV returns a copy of the actual IV used for the operation. // // Some HSMs may ignore the user-specified IV and write their own at the end of // the encryption operation; this method allows you to retrieve it.
{ "resource": "" }