<commit_before>package nds

import (
	"appengine"
	"time"
)

// Timeout returns a context that will set the timeout duration for datastore
// RPC calls. The default timeout is 5 seconds and can be set to a maximum of
// 60 seconds.
// Use this packages Timeout function instead of appengine.Timeout to ensure
// caching works with nds.
func Timeout(c appengine.Context, d time.Duration) appengine.Context {
	if ndsc, ok := c.(*context); ok {
		return &context{
			Context: appengine.Timeout(ndsc.Context, d),
			RWMutex: ndsc.RWMutex,
			cache:   ndsc.cache,
		}
	}
	return appengine.Timeout(c, d)
}<commit_msg>Fixed bug where transaction flag was not copied when modifying timeout.<commit_after>package nds

import (
	"appengine"
	"time"
)

// Timeout returns a context that will set the timeout duration for datastore
// RPC calls. The default timeout is 5 seconds and can be set to a maximum of
// 60 seconds.
// Use this packages Timeout function instead of appengine.Timeout to ensure
// caching works with nds.
func Timeout(c appengine.Context, d time.Duration) appengine.Context {
	if ndsc, ok := c.(*context); ok {
		return &context{
			Context:       appengine.Timeout(ndsc.Context, d),
			RWMutex:       ndsc.RWMutex,
			cache:         ndsc.cache,
			inTransaction: ndsc.inTransaction,
		}
	}
	return appengine.Timeout(c, d)
}
{'fraction_non_alphanumeric': 0.09431137724550898, 'fraction_numerical': 0.004491017964071856, 'mean_word_length': 3.5476190476190474, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4569150', 'n_tokens_mistral': 439, 'n_tokens_neox': 418, 'n_words': 156}