_id
stringlengths
2
7
title
stringclasses
1 value
partition
stringclasses
3 values
text
stringlengths
6
2.61k
language
stringclasses
1 value
meta_information
dict
c14800
train
// OnSplitWithBits reports whether at least n consecutive trailing bits // of the current checksum are set the same way.
{ "resource": "" }
c14801
train
// MakeInterface returns a sort Interface using the provided length // and pair of swap and less functions.
{ "resource": "" }
c14802
train
// SliceSorter returns a sort.Interface to sort the provided slice // using the provided less function. // If the provided interface is not a slice, the function panics.
{ "resource": "" }
c14803
train
// Slice sorts the provided slice using less. // If the provided interface is not a slice, the function panics. // The sort is not stable. For a stable sort, use sort.Stable with sort.SliceSorter.
{ "resource": "" }
c14804
train
// With sorts data given the provided length, swap, and less // functions. // The sort is not guaranteed to be stable.
{ "resource": "" }
c14805
train
// Less returns the opposite of the embedded implementation's Less method.
{ "resource": "" }
c14806
train
// IsSorted reports whether data is sorted.
{ "resource": "" }
c14807
train
// EXIFItemID returns the item ID of the EXIF part, or 0 if not found.
{ "resource": "" }
c14808
train
// SpatialExtents returns the item's spatial extents property values, if present, // not correcting from any camera rotation metadata.
{ "resource": "" }
c14809
train
// VisualDimensions returns the item's width and height after correcting // for any rotations.
{ "resource": "" }
c14810
train
// PrimaryItem returns the HEIF file's primary item.
{ "resource": "" }
c14811
train
// ItemByID by returns the file's Item of a given ID. // If the ID is known, the returned error is ErrUnknownItem.
{ "resource": "" }
c14812
train
// NewSem creates a semaphore with max units available for acquisition.
{ "resource": "" }
c14813
train
// Acquire will deduct n units from the semaphore. If the deduction would // result in the available units falling below zero, the call will block until // another go routine returns units via a call to Release. If more units are // requested than the semaphore is configured to hold, error will be non-nil.
{ "resource": "" }
c14814
train
// Release will return n units to the semaphore and notify any currently // blocking Acquire calls.
{ "resource": "" }
c14815
train
// Path returns the absolute path of the primary directory, or an empty // string if there's no suitable directory present. This is the path // that should be used for writing files.
{ "resource": "" }
c14816
train
// Open opens the named file inside the directory for reading. If the // directory has multiple search paths, each path is checked in order // for the file and the first one found is opened.
{ "resource": "" }
c14817
train
// NewStatsReader returns an io.Reader that will have the number of bytes // read from r added to v.
{ "resource": "" }
c14818
train
// NewStatsReadSeeker returns an io.ReadSeeker that will have the number of bytes // read from rs added to v.
{ "resource": "" }
c14819
train
// Bytes returns a slice of the bytes, or a copy of the bytes, retained by w. // If more bytes than could be retained were written to w, it returns a // concatenation of the N first bytes, a message for how many bytes were dropped, // and the N last bytes.
{ "resource": "" }
c14820
train
// GoroutineID returns the current goroutine's ID. // Use of this function is almost always a terrible idea. // It is also very slow. // GoroutineID is intended only for debugging. // In particular, it is used by syncutil.
{ "resource": "" }
c14821
train
// ShouldFail reports whether a fake error should be returned.
{ "resource": "" }
c14822
train
// FailErr checks ShouldFail and, if true, assigns a fake error to err // and returns true.
{ "resource": "" }
c14823
train
// UnknownKeys returns the keys from the config that have not yet been discovered by one of the RequiredT or OptionalT calls.
{ "resource": "" }
c14824
train
// Err waits for all previous calls to Go to complete and returns the // first non-nil error, or nil.
{ "resource": "" }
c14825
train
// New returns a new Replacer from a list of old, new string pairs. // Replacements are performed in order, without overlapping matches.
{ "resource": "" }
c14826
train
// Replace performs all replacements in-place on s. If the capacity // of s is not sufficient, a new slice is allocated, otherwise Replace // returns s.
{ "resource": "" }
c14827
train
// Size tries to determine the length of r. If r is an io.Seeker, Size may seek // to guess the length.
{ "resource": "" }
c14828
train
// equalFoldRune compares a and b runes whether they fold equally. // // The code comes from strings.EqualFold, but shortened to only one rune.
{ "resource": "" }
c14829
train
// HasPrefixFold is like strings.HasPrefix but uses Unicode case-folding.
{ "resource": "" }
c14830
train
// HasSuffixFold is like strings.HasPrefix but uses Unicode case-folding.
{ "resource": "" }
c14831
train
// ContainsFold is like strings.Contains but uses Unicode case-folding.
{ "resource": "" }
c14832
train
// Open opens the given file path for reading, reusing existing file descriptors // when possible.
{ "resource": "" }
c14833
train
// CoreOSImageURL returns the URL of the latest stable CoreOS image for running on Google Compute Engine.
{ "resource": "" }
c14834
train
// InstanceGroups returns all the instance groups in a project's zone, along // with their associated InstanceGroupManagers. // The returned map is keyed by the instance group identifier URL.
{ "resource": "" }
c14835
train
// Open opens the named file for reading. It returns an error if the file size // is larger than 1 << 20.
{ "resource": "" }
c14836
train
// IFFT returns the inverse FFT of the complex-valued slice.
{ "resource": "" }
c14837
train
// FFT returns the forward FFT of the complex-valued slice.
{ "resource": "" }
c14838
train
// decrDim decrements an element of x by 1, skipping all -1s, and wrapping up to d. // If a value is 0, it will be reset to its correspending value in d, and will carry one from the next non -1 value to the right. // Returns true if decremented, else false.
{ "resource": "" }
c14839
train
// bluesteinFFT returns the FFT calculated using the Bluestein algorithm.
{ "resource": "" }
c14840
train
// New reads the WAV header from r.
{ "resource": "" }
c14841
train
// ReadFloats is like ReadSamples, but it converts any underlying data to a // float32.
{ "resource": "" }
c14842
train
// NextPowerOf2 returns the next power of 2 >= x.
{ "resource": "" }
c14843
train
// ToComplex2 returns the complex equivalent of the real-valued matrix.
{ "resource": "" }
c14844
train
// Segment returns segs equal-length slices that are segments of x with noverlap% of overlap. // The returned slices are not copies of x, but slices into it. // Trailing entries in x that connot be included in the equal-length segments are discarded. // noverlap is a percentage, thus 0 <= noverlap <= 1, and noverlap = ...
{ "resource": "" }
c14845
train
// radix2FFT returns the FFT calculated using the radix-2 DIT Cooley-Tukey algorithm.
{ "resource": "" }
c14846
train
// reorderData returns a copy of x reordered for the DFT.
{ "resource": "" }
c14847
train
// Apply applies the window windowFunction to x.
{ "resource": "" }
c14848
train
// PrettyClose returns true if the slices a and b are very close, else false.
{ "resource": "" }
c14849
train
// PrettyCloseC returns true if the slices a and b are very close, else false.
{ "resource": "" }
c14850
train
// ComplexEqual returns true if a and b are very close, else false.
{ "resource": "" }
c14851
train
// Float64Equal returns true if a and b are very close, else false.
{ "resource": "" }
c14852
train
// MakeMatrix2 is a helper function to convert a 2-d array to a matrix.
{ "resource": "" }
c14853
train
// Copy returns a new copy of m.
{ "resource": "" }
c14854
train
// MakeEmptyMatrix creates an empty Matrix with given dimensions.
{ "resource": "" }
c14855
train
// offset returns the index in the one-dimensional array
{ "resource": "" }
c14856
train
// Dimensions returns the dimension array of the Matrix.
{ "resource": "" }
c14857
train
// To2D returns the 2-D array equivalent of the Matrix. // Only works on Matrixes of 2 dimensions.
{ "resource": "" }
c14858
train
// Authenticator is a default authentication middleware to enforce access from the // Verifier middleware request context values. The Authenticator sends a 401 Unauthorized // response for any unverified tokens and passes the good ones through. It's just fine // until you decide to write something similar and customize...
{ "resource": "" }
c14859
train
// TokenFromCookie tries to retreive the token string from a cookie named // "jwt".
{ "resource": "" }
c14860
train
// NewLocker return new lock
{ "resource": "" }
c14861
train
// NewLocker return new redis based lock
{ "resource": "" }
c14862
train
// ReadMethods returns regexp slice of readable methods, mostly used by the acl
{ "resource": "" }
c14863
train
// NewProvider creates and prepare the stripe provider
{ "resource": "" }
c14864
train
// getAccessMap return access map for specific client
{ "resource": "" }
c14865
train
// CanAccessMethod check if user can access fullMethod by getting its accessMap
{ "resource": "" }
c14866
train
// RecoveryHandlerFunc outputs the stack and the error // returns valid grpc error
{ "resource": "" }
c14867
train
// Retry function for default retry attempts
{ "resource": "" }
c14868
train
// NewHandler create new mongo handler
{ "resource": "" }
c14869
train
// NewClient creates new grpc connection to the addr using the ClientOpt
{ "resource": "" }
c14870
train
// New create new digota server
{ "resource": "" }
c14871
train
// Provider returns payment provider from the map using the provided id // panics if the provider could not be found
{ "resource": "" }
c14872
train
// NewContext store user in ctx and return new ctx.
{ "resource": "" }
c14873
train
// FromContext returns the User stored in ctx, if any.
{ "resource": "" }
c14874
train
// GetClient return client based on provided serialId
{ "resource": "" }
c14875
train
// Validate is doing struct level validation using validator.v9
{ "resource": "" }
c14876
train
// New creates storage handler from config.Storage and prepare it for use // returns error if something went wrong during the preparations
{ "resource": "" }
c14877
train
// New creates a locker handler from the provided // config.Locker and save it in handler for further use
{ "resource": "" }
c14878
train
// IsReturnable checks che
{ "resource": "" }
c14879
train
// New implements the orderpb.New interface. // Creates new order from order Items and return Order or error, error will // returned if something went wrong .. let say something such as inactive Items.
{ "resource": "" }
c14880
train
// Get implements the orderpb.Get interface. // Retrieve order or returns error.
{ "resource": "" }
c14881
train
// Pay implements the orderpb.Pay interface. Pay on specific orderId with CC based on payment provider supplied.
{ "resource": "" }
c14882
train
// calculateTotal will calculate the new amount of the cart. using // go-money library, which helps us to do money calculations of // the `Fowler's Money pattern`. will return error if something went // wrong, like wrong currencies.
{ "resource": "" }
c14883
train
// WriteMethods returns regexp slice of writable methods, mostly used by the acl
{ "resource": "" }
c14884
train
// WithLocation creates a new Option that sets up a // "Clock" interface that the RotateLogs object will use // to determine the current time. // // This optin works by always returning the in the given // location.
{ "resource": "" }
c14885
train
// New creates a new RotateLogs object. A log filename pattern // must be passed. Optional `Option` parameters may be passed
{ "resource": "" }
c14886
train
// Write satisfies the io.Writer interface. It writes to the // appropriate file handle that is currently being used. // If we have reached rotation time, the target file gets // automatically rotated, and also purged if necessary.
{ "resource": "" }
c14887
train
// must be locked during this operation
{ "resource": "" }
c14888
train
// CurrentFileName returns the current file name that // the RotateLogs object is writing to
{ "resource": "" }
c14889
train
// Rotate forcefully rotates the log files. If the generated file name // clash because file already exists, a numeric suffix of the form // ".1", ".2", ".3" and so forth are appended to the end of the log file // // Thie method can be used in conjunction with a signal handler so to // emulate servers that generate new...
{ "resource": "" }
c14890
train
// Close satisfies the io.Closer interface. You must // call this method if you performed any writes to // the object.
{ "resource": "" }
c14891
train
// Text returns the text that should be // prepended to the log message when a specific // log level is being written.
{ "resource": "" }
c14892
train
// New returns a new golog with a default output to `os.Stdout` // and level to `InfoLevel`.
{ "resource": "" }
c14893
train
// acquireLog returns a new log fom the pool.
{ "resource": "" }
c14894
train
// SetOutput overrides the Logger's Printer's Output with another `io.Writer`. // // Returns itself.
{ "resource": "" }
c14895
train
// SetPrefix sets a prefix for this "l" Logger. // // The prefix is the first space-separated // word that is being presented to the output. // It's written even before the log level text. // // Returns itself.
{ "resource": "" }
c14896
train
// SetTimeFormat sets time format for logs, // if "s" is empty then time representation will be off. // // Returns itself.
{ "resource": "" }
c14897
train
// DisableNewLine disables the new line suffix on every log function, even the `F`'s, // the caller should add "\n" to the log message manually after this call. // // Returns itself.
{ "resource": "" }
c14898
train
// Print prints a log message without levels and colors.
{ "resource": "" }
c14899
train
// Println prints a log message without levels and colors. // It adds a new line at the end, it overrides the `NewLine` option.
{ "resource": "" }