_id
stringlengths
2
7
title
stringclasses
1 value
partition
stringclasses
3 values
text
stringlengths
6
2.61k
language
stringclasses
1 value
meta_information
dict
c31700
train
// dr.mu just be locked.
{ "resource": "" }
c31701
train
// fileList parses deps.js from the closure repo, as well as the similar // dependencies generated for the UI js files, and compiles the list of // js files from the closure lib required for the UI.
{ "resource": "" }
c31702
train
// run runs the command and returns the output if it succeeds. // On error, the process dies.
{ "resource": "" }
c31703
train
// Delete removes the document with the matching key.
{ "resource": "" }
c31704
train
// Wipe removes all documents from the collection.
{ "resource": "" }
c31705
train
// Ping tests if MongoDB on host can be dialed.
{ "resource": "" }
c31706
train
// SendStatusUpdate sends a JSON status map to any connected WebSocket clients.
{ "resource": "" }
c31707
train
// HasLegacySHA1 reports whether the server has legacy SHA-1 blobs indexed.
{ "resource": "" }
c31708
train
// GetRecentPermanodes returns recently-modified permanodes.
{ "resource": "" }
c31709
train
// GetPermanodesWithAttr returns permanodes with attribute req.Attr // having the req.Value as a value. // See WithAttrRequest for more details about the query.
{ "resource": "" }
c31710
train
// GetClaims returns the claims on req.Permanode signed by h.owner.
{ "resource": "" }
c31711
train
// EdgesTo returns edges that reference req.RefTo. // It filters out since-deleted permanode edges.
{ "resource": "" }
c31712
train
// Unlike the index interface's EdgesTo method, the "edgesto" Handler // here additionally filters out since-deleted permanode edges.
{ "resource": "" }
c31713
train
// GetSignerPaths returns paths with a target of req.Target.
{ "resource": "" }
c31714
train
// EvalSearchInput checks if its input is JSON. If so it returns a Constraint constructed from that JSON. Otherwise // it assumes the input to be a search expression. It parses the expression and returns the parsed Constraint.
{ "resource": "" }
c31715
train
// getNamed displays the search expression or constraint json for the requested alias.
{ "resource": "" }
c31716
train
// newSeparatedString returns a newly created SeparatedString value from the string given. // There is no error if the string does not include a comma.
{ "resource": "" }
c31717
train
// Minus returns a newly created SeparatedString containing all the elements from css that did // not appear in css2
{ "resource": "" }
c31718
train
// equal compares css with css2. Both css and css2 are sorted in place before being compared.
{ "resource": "" }
c31719
train
// Unmount attempts to unmount the provided FUSE mount point, forcibly // if necessary.
{ "resource": "" }
c31720
train
// markConnDead clears the cached SFTP connection after the caller detects // a connection failure.
{ "resource": "" }
c31721
train
// fetchJS gets the javascript resource at jsURL and writes it to jsOnDisk. // Since said resource can be quite large, it first fetches the hashsum contained // in the file at jsURL+".sha256", and if we already have the file on disk, with a // matching hashsum, it does not actually fetch jsURL. If it does, it checks th...
{ "resource": "" }
c31722
train
// fullSrcPath returns the full path concatenation // of pkRoot with fromSrc.
{ "resource": "" }
c31723
train
// getVersion returns the version of Perkeep found in a VERSION file at the root.
{ "resource": "" }
c31724
train
// getGitVersion returns the git version of the git repo at pkRoot as a // string of the form "yyyy-mm-dd-xxxxxxx", with an optional trailing // '+' if there are any local uncommitted modifications to the tree.
{ "resource": "" }
c31725
train
// verifyPerkeepRoot sets pkRoot and crashes if dir isn't the Perkeep root directory.
{ "resource": "" }
c31726
train
// verifyGoVersion runs "go version" and parses the output. If the version is // acceptable a check for gopherjs versions are also done. If problems // are found a message is logged and we abort.
{ "resource": "" }
c31727
train
// quote escapes and quotes the bytes from bs and writes // them to dest.
{ "resource": "" }
c31728
train
// ReceiveBlob would receive the blobs, but now just returns ErrReadonly.
{ "resource": "" }
c31729
train
// RemoveBlobs would remove the given blobs, but now just returns ErrReadonly.
{ "resource": "" }
c31730
train
// Fetch the blob by trying all configured read Storage concurrently, // returning the first successful response, or the first error if there's no match.
{ "resource": "" }
c31731
train
// EnumerateBlobs concurrently on the readers, returning one of the errors.
{ "resource": "" }
c31732
train
// Set writes the key, value pair to cs. But it does not actually write if the // value already exists, is up to date, and is more recent than 30 days.
{ "resource": "" }
c31733
train
// newFromConfigWithTransport constructs a s3 blobserver using the given // transport for all s3 requests. The transport may be set to 'nil' to use a // default transport. // This is used for unit tests.
{ "resource": "" }
c31734
train
// isNotFound checks for s3 errors which indicate the object doesn't exist.
{ "resource": "" }
c31735
train
// bytesHaveSchemaLink reports whether bb is a valid Perkeep schema // blob and has target somewhere in a schema field used to represent a // Merkle-tree-ish file or directory.
{ "resource": "" }
c31736
train
// Reindex rewrites the index files of the diskpacked .pack files
{ "resource": "" }
c31737
train
// Walk walks the storage and calls the walker callback with each blobref // stops if walker returns non-nil error, and returns that
{ "resource": "" }
c31738
train
// makeSingleMetaBlob makes and encrypts a metaBlob with one entry.
{ "resource": "" }
c31739
train
// fetchMeta returns os.ErrNotExist if the plaintext blob is not in the index.
{ "resource": "" }
c31740
train
// Props is an auto-generated proxy to the current props of AboutMenuItem
{ "resource": "" }
c31741
train
// AwaitReachable tries to make a TCP connection to addr regularly. // It returns an error if it's unable to make a connection before maxWait.
{ "resource": "" }
c31742
train
// ListenOnLocalRandomPort returns a TCP listener on a random // localhost port.
{ "resource": "" }
c31743
train
// Localhost returns the first address found when // doing a lookup of "localhost". If not successful, // it looks for an ip on the loopback interfaces.
{ "resource": "" }
c31744
train
// localhostLookup looks for a loopback IP by resolving localhost.
{ "resource": "" }
c31745
train
// loopbackIP returns the first loopback IP address sniffing network // interfaces or nil if none is found.
{ "resource": "" }
c31746
train
// RandPort returns a random port to listen on.
{ "resource": "" }
c31747
train
// IsFQDN reports whether domain looks like a fully qualified domain name.
{ "resource": "" }
c31748
train
// IsLocMapPredicate returns whether predicate is a map location predicate.
{ "resource": "" }
c31749
train
// rectangleFromPredicate, if predicate is a valid location predicate of the given kind // and returns the corresponding rectangular area.
{ "resource": "" }
c31750
train
// NewChecker returns a Checker, remembering the stack trace.
{ "resource": "" }
c31751
train
// autodiscover takes an HTML document and returns the autodiscovered feed // URL. Returns an error if there is no such URL.
{ "resource": "" }
c31752
train
// importStatuses imports statuses for the given user into the store
{ "resource": "" }
c31753
train
// importStatus imports a single status, also adding it to the statuses node. // Returns true if we already had the status in the database.
{ "resource": "" }
c31754
train
// auth returns the appropriate oauth2.Config for this account
{ "resource": "" }
c31755
train
// createMastodonClient returns a new Client configured for the provided // account. It does not check if the account has the needed fields filled.
{ "resource": "" }
c31756
train
// getExpandedAddress returns the address for the account in the @user@example.com form
{ "resource": "" }
c31757
train
// Body returns the bytes written to the BlobSniffer.
{ "resource": "" }
c31758
train
// cacheScaled saves in the image handler's cache the scaled image bytes // in thumbBytes, and puts its blobref in the scaledImage under the key name.
{ "resource": "" }
c31759
train
// ScaledCached reads the scaled version of the image in file, // if it is in cache and writes it to buf. // // On successful read and population of buf, the returned format is non-empty. // Almost all errors are not interesting. Real errors will be logged.
{ "resource": "" }
c31760
train
// Sizes returns the sorted blob sizes.
{ "resource": "" }
c31761
train
// resizeYCbCr returns a scaled copy of the YCbCr image slice r of m. // The returned image has width w and height h.
{ "resource": "" }
c31762
train
// ResampleInplace will resample m inplace, overwritting existing pixel data, // and return a subimage of m sized to w and h.
{ "resource": "" }
c31763
train
// wipeMongo erases all documents from the mongo collection // if c.dbType is "mongo".
{ "resource": "" }
c31764
train
// RedirectURL returns the redirect URI that imp should set in an oauth.Config // for the authorization phase of OAuth2 authentication.
{ "resource": "" }
c31765
train
// IsAccountReady returns whether the account has been properly configured // - whether the user ID and access token has been stored in the given account node.
{ "resource": "" }
c31766
train
// Do sends through octx the request defined by url and the values in form.
{ "resource": "" }
c31767
train
// PopulateJSONFromURL makes a POST or GET call at apiURL, using keyval as parameters of // the associated form. The JSON response is decoded into result.
{ "resource": "" }
c31768
train
// NewOAuthClient returns an oauth Client configured with uris and the // credentials obtained from ctx.
{ "resource": "" }
c31769
train
// RegisterHandlerConstructor registers an http Handler constructor function // for a given handler type. // // It is an error to register the same handler type twice.
{ "resource": "" }
c31770
train
// CreateHandler instantiates an http Handler of type 'typ' from the // provided JSON configuration, and finding peer handlers and // configuration from the environment in 'loader'. // // The handler 'typ' must have been previously registered with // RegisterHandlerConstructor.
{ "resource": "" }
c31771
train
// genLowLevelConfig returns a low-level config from a high-level config.
{ "resource": "" }
c31772
train
// dbUnique returns the uniqueness string that is used in databases names to // differentiate them from databases used by other Perkeep instances on the same // DBMS.
{ "resource": "" }
c31773
train
// As of rev 7eda9fd5027fda88166d6c03b6490cffbf2de5fb, we changed how the // databases names were defined. But we wanted the existing GCE instances to keep // on working with the old names, so that nothing would break for existing users, // without any intervention needed. Through the help of the perkeep-config-version...
{ "resource": "" }
c31774
train
// Error is errNoOwner if no identity configured
{ "resource": "" }
c31775
train
// kvFileType returns the file based sorted type defined for index storage, if // any. It defaults to "leveldb" otherwise.
{ "resource": "" }
c31776
train
// sortedDBMS returns the configuration for a name database on one of the // DBMS, if any was found in the configuration. It returns nil otherwise.
{ "resource": "" }
c31777
train
// filePrefix gives a file path of where to put the database. It can be omitted by // some sorted implementations, but is required by others. // The filePrefix should be to a file, not a directory, and should not end in a ".ext" extension. // An extension like ".kv" or ".sqlite" will be added.
{ "resource": "" }
c31778
train
// indexFileDir returns the directory of the sqlite or kv file, or the // empty string.
{ "resource": "" }
c31779
train
// WriteDefaultConfigFile generates a new default high-level server configuration // file at filePath. If useSQLite, the default indexer will use SQLite, otherwise // leveldb. If filePath already exists, it is overwritten.
{ "resource": "" }
c31780
train
// listenForCamliNet prepares the TLS listener for both the GPG challenge, and // for Let's Encrypt. It then starts listening and returns the baseURL derived from // the hostname we should obtain from the GPG challenge.
{ "resource": "" }
c31781
train
// ctx will be canceled on failure
{ "resource": "" }
c31782
train
// Collect performs a garbage collection.
{ "resource": "" }
c31783
train
// New returnes a sorted.KeyValue implementation that adds a Flush // method to flush the buffer to the backing storage. A flush will // also be performed when maxBufferBytes are reached. If // maxBufferBytes <= 0, no automatic flushing is performed.
{ "resource": "" }
c31784
train
// maybeRunCompaction forces compaction of db, if the number of // tables in level 0 is >= 4. dbname should be provided for error messages.
{ "resource": "" }
c31785
train
// marshalBinary returns a more compact binary // representation of the contents of sk.
{ "resource": "" }
c31786
train
// marshalBinary returns a more compact binary // representation of the contents of scv.
{ "resource": "" }
c31787
train
// RestartProcess restarts the process with the given arguments, if any, // replacing the original process's arguments. It defaults to os.Args otherwise. It // returns an error if things couldn't be restarted. On success, this function // never returns because the process becomes the new process.
{ "resource": "" }
c31788
train
// buildDockerImage builds a docker image from the Dockerfile located in // imageDir, which is a path relative to dockDir. The image will be named after // imageName. dockDir should have been set behorehand.
{ "resource": "" }
c31789
train
// MergedEnumerate implements the BlobEnumerator interface by // merge-joining 0 or more sources.
{ "resource": "" }
c31790
train
// NewOAuthConfig returns an OAuth configuration template.
{ "resource": "" }
c31791
train
// Get returns the Instance corresponding to the Project, Zone, and Name defined in the // Deployer's Conf.
{ "resource": "" }
c31792
train
// projectHasInstance checks for all the possible zones if there's already an instance for the project. // It returns the name of the zone at the first instance it finds, if any.
{ "resource": "" }
c31793
train
// getInstanceAttribute returns the value for attr in the custom metadata of the // instance. It returns errAttrNotFound is such a metadata attributed does not // exist.
{ "resource": "" }
c31794
train
// Create sets up and starts a Google Compute Engine instance as defined in d.Conf. It // creates the necessary Google Storage buckets beforehand.
{ "resource": "" }
c31795
train
// setBuckets defines the buckets needed by the instance and creates them.
{ "resource": "" }
c31796
train
// setFirewall adds the firewall rules needed for ports 80 & 433 to the default network.
{ "resource": "" }
c31797
train
// loadX509KeyPair is a copy of tls.LoadX509KeyPair but using wkfs.
{ "resource": "" }
c31798
train
// RequestTargetPort returns the port targeted by the client // in req. If not present, it returns 80, or 443 if TLS is used.
{ "resource": "" }
c31799
train
// RecoverJSON is like Recover but returns with a JSON response.
{ "resource": "" }