_id
stringlengths
2
7
title
stringclasses
1 value
partition
stringclasses
3 values
text
stringlengths
6
2.61k
language
stringclasses
1 value
meta_information
dict
c21700
train
// lintPackageComment checks package comments. It complains if // there is no package comment, or if it is not of the right form. // This has a notable false positive in that a package comment // could rightfully appear in a different file of the same package, // but that's not easy to fix since this linter is file-ori...
{ "resource": "" }
c21701
train
// lintBlankImports complains if a non-main package has blank imports that are // not documented.
{ "resource": "" }
c21702
train
// lintImports examines import blocks.
{ "resource": "" }
c21703
train
// lintExported examines the exported names. // It complains if any required doc comments are missing, // or if they are not of the right form. The exact rules are in // lintFuncDoc, lintTypeDoc and lintValueSpecDoc; this function // also tracks the GenDecl structure being traversed to permit // doc comments for consta...
{ "resource": "" }
c21704
train
// lintTypeDoc examines the doc comment on a type. // It complains if they are missing from an exported type, // or if they are not of the standard form.
{ "resource": "" }
c21705
train
// lintVarDecls examines variable declarations. It complains about declarations with // redundant LHS types that can be inferred from the RHS.
{ "resource": "" }
c21706
train
// lintElses examines else blocks. It complains about any else block whose if block ends in a return.
{ "resource": "" }
c21707
train
// lintRanges examines range clauses. It complains about redundant constructions.
{ "resource": "" }
c21708
train
// lintErrorf examines errors.New and testing.Error calls. It complains if its only argument is an fmt.Sprintf invocation.
{ "resource": "" }
c21709
train
// lintErrors examines global error vars. It complains if they aren't named in the standard way.
{ "resource": "" }
c21710
train
// lintErrorStrings examines error strings. // It complains if they are capitalized or end in punctuation or a newline.
{ "resource": "" }
c21711
train
// lintReceiverNames examines receiver names. It complains about inconsistent // names used for the same type and names such as "this".
{ "resource": "" }
c21712
train
// lintErrorReturn examines function declarations that return an error. // It complains if the error isn't the last parameter.
{ "resource": "" }
c21713
train
// lintUnexportedReturn examines exported function declarations. // It complains if any return an unexported type.
{ "resource": "" }
c21714
train
// exportedType reports whether typ is an exported type. // It is imprecise, and will err on the side of returning true, // such as for composite types.
{ "resource": "" }
c21715
train
// checkContextKeyType reports an error if the call expression calls // context.WithValue with a key argument of basic type.
{ "resource": "" }
c21716
train
// lintContextArgs examines function declarations that contain an // argument with a type of context.Context // It complains if that argument isn't the first parameter.
{ "resource": "" }
c21717
train
// isUntypedConst reports whether expr is an untyped constant, // and indicates what its default type is. // scope may be nil.
{ "resource": "" }
c21718
train
// firstLineOf renders the given node and returns its first line. // It will also match the indentation of another node.
{ "resource": "" }
c21719
train
// imports returns true if the current file imports the specified package path.
{ "resource": "" }
c21720
train
// srcLine returns the complete line at p, including the terminating newline.
{ "resource": "" }
c21721
train
// importPaths returns the import paths to use for the given command line.
{ "resource": "" }
c21722
train
// hasPathPrefix reports whether the path s begins with the // elements in prefix.
{ "resource": "" }
c21723
train
// newGRPCClient creates a new GRPCClient. The Client argument is expected // to be successfully started already with a lock held.
{ "resource": "" }
c21724
train
// ServeMux is like Serve, but serves multiple types of plugins determined // by the argument given on the command-line. // // This command doesn't return until the plugin is done being executed. Any // errors are logged or output to stderr.
{ "resource": "" }
c21725
train
// Recv is used by the GRPCBroker to pass connection information that has been // sent from the client from the stream to the broker.
{ "resource": "" }
c21726
train
// Send is used by the GRPCBroker to pass connection information into the stream // to the plugin.
{ "resource": "" }
c21727
train
// AcceptAndServe is used to accept a specific stream ID and immediately // serve a gRPC server on that stream ID. This is used to easily serve // complex arguments. Each AcceptAndServe call opens a new listener socket and // sends the connection info down the stream to the dialer. Since a new // connection is opened e...
{ "resource": "" }
c21728
train
// Close closes the stream and all servers.
{ "resource": "" }
c21729
train
// parseJSON handles parsing JSON output
{ "resource": "" }
c21730
train
// Check takes the filepath to an executable and returns true if the checksum of // the file matches the checksum provided in the SecureConfig.
{ "resource": "" }
c21731
train
// Client returns the protocol client for this connection. // // Subsequent calls to this will return the same client.
{ "resource": "" }
c21732
train
// killed is used in tests to check if a process failed to exit gracefully, and // needed to be killed.
{ "resource": "" }
c21733
train
// loadServerCert is used by AutoMTLS to read an x.509 cert returned by the // server, and load it as the RootCA for the client TLSConfig.
{ "resource": "" }
c21734
train
// checkProtoVersion returns the negotiated version and PluginSet. // This returns an error if the server returned an incompatible protocol // version, or an invalid handshake response.
{ "resource": "" }
c21735
train
// ReattachConfig returns the information that must be provided to NewClient // to reattach to the plugin process that this client started. This is // useful for plugins that detach from their parent process. // // If this returns nil then the process hasn't been started yet. Please // call Start or Client before calli...
{ "resource": "" }
c21736
train
// Protocol returns the protocol of server on the remote end. This will // start the plugin process if it isn't already started. Errors from // starting the plugin are surpressed and ProtocolInvalid is returned. It // is recommended you call Start explicitly before calling Protocol to ensure // no errors occur.
{ "resource": "" }
c21737
train
// dialer is compatible with grpc.WithDialer and creates the connection // to the plugin.
{ "resource": "" }
c21738
train
// generateCert generates a temporary certificate for plugin authentication. The // certificate and private key are returns in PEM format.
{ "resource": "" }
c21739
train
// _pidAlive tests whether a process is alive or not
{ "resource": "" }
c21740
train
// Config is the GRPCServerConfig encoded as JSON then base64.
{ "resource": "" }
c21741
train
// newRPCClient creates a new RPCClient. The Client argument is expected // to be successfully started already with a lock held.
{ "resource": "" }
c21742
train
// NewRPCClient creates a client from an already-open connection-like value. // Dial is typically used instead.
{ "resource": "" }
c21743
train
// SyncStreams should be called to enable syncing of stdout, // stderr with the plugin. // // This will return immediately and the syncing will continue to happen // in the background. You do not need to launch this in a goroutine itself. // // This should never be called multiple times.
{ "resource": "" }
c21744
train
// Close closes the connection. The client is no longer usable after this // is called.
{ "resource": "" }
c21745
train
// Ping pings the connection to ensure it is still alive. // // The error from the RPC call is returned exactly if you want to inspect // it for further error analysis. Any error returned from here would indicate // that the connection to the plugin is not healthy.
{ "resource": "" }
c21746
train
// ServeConn runs a single connection. // // ServeConn blocks, serving the connection until the client hangs up.
{ "resource": "" }
c21747
train
// done is called internally by the control server to trigger the // doneCh to close which is listened to by the main process to cleanly // exit.
{ "resource": "" }
c21748
train
// protocolVersion determines the protocol version and plugin set to be used by // the server. In the event that there is no suitable version, the last version // in the config is returned leaving the client to report the incompatibility.
{ "resource": "" }
c21749
train
// _pidAlive tests whether a process is alive or not by sending it Signal 0, // since Go otherwise has no way to test this.
{ "resource": "" }
c21750
train
// AcceptAndServe is used to accept a specific stream ID and immediately // serve an RPC server on that stream ID. This is used to easily serve // complex arguments. // // The served interface is always registered to the "Plugin" name.
{ "resource": "" }
c21751
train
// pidWait blocks for a process to exit.
{ "resource": "" }
c21752
train
// Shutdown stops the grpc server. It first will attempt a graceful stop, then a // full stop on the server.
{ "resource": "" }
c21753
train
// Check if this sample format is in planar.
{ "resource": "" }
c21754
train
// Make a new audio codec type.
{ "resource": "" }
c21755
train
// Check this audio frame has same format as other audio frame.
{ "resource": "" }
c21756
train
// Split sample audio sample from this frame.
{ "resource": "" }
c21757
train
// Concat two audio frames.
{ "resource": "" }
c21758
train
// Do the transcode. // // In audio transcoding one Packet may transcode into many Packets // packet time will be adjusted automatically.
{ "resource": "" }
c21759
train
// Get CodecDatas after transcoding.
{ "resource": "" }
c21760
train
// Close transcoder, close related encoder and decoders.
{ "resource": "" }
c21761
train
// Put packet into buffer, old packets will be discared.
{ "resource": "" }
c21762
train
// Create cursor position at oldest buffered packet.
{ "resource": "" }
c21763
train
// Create cursor position at specific time in buffered packets.
{ "resource": "" }
c21764
train
// Create cursor position at specific delayed GOP count in buffered packets.
{ "resource": "" }
c21765
train
// ReadPacket will not consume packets in Queue, it's just a cursor.
{ "resource": "" }
c21766
train
// New creates a bare bones Martini instance. Use this method if you want to have full control over the middleware that is used.
{ "resource": "" }
c21767
train
// Logger sets the logger
{ "resource": "" }
c21768
train
// Use adds a middleware Handler to the stack. Will panic if the handler is not a callable func. Middleware Handlers are invoked in the order that they are added.
{ "resource": "" }
c21769
train
// ServeHTTP is the HTTP Entry point for a Martini instance. Useful if you want to control your own HTTP server.
{ "resource": "" }
c21770
train
// Run the http server on a given host and port.
{ "resource": "" }
c21771
train
// Classic creates a classic Martini with some basic default middleware - martini.Logger, martini.Recovery and martini.Static. // Classic also maps martini.Routes as a service.
{ "resource": "" }
c21772
train
// URLWith returns the url pattern replacing the parameters for its values
{ "resource": "" }
c21773
train
// URLFor returns the url for the given route name.
{ "resource": "" }
c21774
train
// MethodsFor returns all methods available for path
{ "resource": "" }
c21775
train
// Logger returns a middleware handler that logs the request as it goes in and the response as it goes out.
{ "resource": "" }
c21776
train
// decodeSingleUnicodeEscape decodes a single \uXXXX escape sequence. The prefix \u is assumed to be present and // is not checked. // In JSON, these escapes can either come alone or as part of "UTF16 surrogate pairs" that must be handled together. // This function only handles one; decodeUnicodeEscape handles this mor...
{ "resource": "" }
c21777
train
// About 2x faster then strconv.ParseInt because it only supports base 10, which is enough for JSON
{ "resource": "" }
c21778
train
// Find position of last character which is not whitespace
{ "resource": "" }
c21779
train
// Tries to find the end of string // Support if string contains escaped quote symbols.
{ "resource": "" }
c21780
train
// ArrayEach is used when iterating arrays, accepts a callback function with the same return arguments as `Get`.
{ "resource": "" }
c21781
train
// ObjectEach iterates over the key-value pairs of a JSON object, invoking a given callback for each such entry
{ "resource": "" }
c21782
train
// GetUnsafeString returns the value retrieved by `Get`, use creates string without memory allocation by mapping string to slice memory. It does not handle escape symbols.
{ "resource": "" }
c21783
train
// GetString returns the value retrieved by `Get`, cast to a string if possible, trying to properly handle escape and utf8 symbols // If key data type do not match, it will return an error.
{ "resource": "" }
c21784
train
// GetFloat returns the value retrieved by `Get`, cast to a float64 if possible. // The offset is the same as in `Get`. // If key data type do not match, it will return an error.
{ "resource": "" }
c21785
train
// GetInt returns the value retrieved by `Get`, cast to a int64 if possible. // If key data type do not match, it will return an error.
{ "resource": "" }
c21786
train
// GetBoolean returns the value retrieved by `Get`, cast to a bool if possible. // The offset is the same as in `Get`. // If key data type do not match, it will return error.
{ "resource": "" }
c21787
train
// ParseNumber parses a Number ValueType into a Go float64
{ "resource": "" }
c21788
train
// ParseInt parses a Number ValueType into a Go int64
{ "resource": "" }
c21789
train
// SetErrorf sets the internal Fpdf error with formatted text to halt PDF // generation; this may facilitate error handling by application. If an error // condition is already set, this call is ignored. // // See the documentation for printing in the standard fmt package for details // about fmtStr and args.
{ "resource": "" }
c21790
train
// SetMargins defines the left, top and right margins. By default, they equal 1 // cm. Call this method to change them. If the value of the right margin is // less than zero, it is set to the same as the left margin.
{ "resource": "" }
c21791
train
// SetLeftMargin defines the left margin. The method can be called before // creating the first page. If the current abscissa gets out of page, it is // brought back to the margin.
{ "resource": "" }
c21792
train
// SetPageBox sets the page box for the current page, and any following pages. // Allowable types are trim, trimbox, crop, cropbox, bleed, bleedbox, art and // artbox box types are case insensitive.
{ "resource": "" }
c21793
train
// GetAutoPageBreak returns true if automatic pages breaks are enabled, false // otherwise. This is followed by the triggering limit from the bottom of the // page. This value applies only if automatic page breaks are enabled.
{ "resource": "" }
c21794
train
// SetAutoPageBreak enables or disables the automatic page breaking mode. When // enabling, the second parameter is the distance from the bottom of the page // that defines the triggering limit. By default, the mode is on and the margin // is 2 cm.
{ "resource": "" }
c21795
train
// SetKeywords defines the keywords of the document. keywordStr is a // space-delimited string, for example "invoice August". isUTF8 indicates if // the string is encoded
{ "resource": "" }
c21796
train
// GetStringWidth returns the length of a string in user units. A font must be // currently selected.
{ "resource": "" }
c21797
train
// SetLineCapStyle defines the line cap style. styleStr should be "butt", // "round" or "square". A square style projects from the end of the line. The // method can be called before the first page is created. The value is // retained from page to page.
{ "resource": "" }
c21798
train
// SetLineJoinStyle defines the line cap style. styleStr should be "miter", // "round" or "bevel". The method can be called before the first page // is created. The value is retained from page to page.
{ "resource": "" }
c21799
train
// fillDrawOp corrects path painting operators
{ "resource": "" }