{"sample_id": "sindresorhus__got___finalizeBody__upstream__2hop_1b97fb", "repo": "sindresorhus/got", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["flush"], "hop_1_files": ["private/tmp/repos/got/source/core/index.ts"], "hop_2": ["fn", "_beforeError", "asPromise"], "hop_2_files": ["private/tmp/repos/got/benchmark/index.ts", "private/tmp/repos/got/source/core/index.ts", "private/tmp/repos/got/source/as-promise/index.ts"]}, "metadata": {"anchor": "_finalizeBody", "anchor_file": "private/tmp/repos/got/source/core/index.ts", "anchor_source": "private async _finalizeBody(): Promise {\n\t\tconst {options} = this;\n\t\tconst headers = options.getInternalHeaders();\n\n\t\tconst isForm = !is.undefined(options.form);\n\t\t// eslint-disable-next-line @typescript-eslint/naming-convention\n\t\tconst isJSON = !is.undefined(options.json);\n\t\tconst isBody = !is.undefined(options.body);\n\t\tconst cannotHaveBody = methodsWithoutBody.has(options.method) && !(options.method === 'GET' && options.allowGetBody);\n\n\t\tif (isForm || isJSON || isBody) {\n\t\t\tif (cannotHaveBody) {\n\t\t\t\tthrow new TypeError(`The \\`${options.method}\\` method cannot be used with a body`);\n\t\t\t}\n\n\t\t\t// Serialize body\n\t\t\tconst noContentType = !is.string(headers['content-type']);\n\n\t\t\tif (isBody) {\n\t\t\t\t// Native FormData\n\t\t\t\tif (options.body instanceof FormData) {\n\t\t\t\t\tconst response = new Response(options.body);\n\n\t\t\t\t\tif (noContentType) {\n\t\t\t\t\t\theaders['content-type'] = response.headers.get('content-type') ?? 'multipart/form-data';\n\t\t\t\t\t}\n\n\t\t\t\t\toptions.body = response.body!;\n\t\t\t\t} else if (Object.prototype.toString.call(options.body) === '[object FormData]') {\n\t\t\t\t\tthrow new TypeError('Non-native FormData is not supported. Use globalThis.FormData instead.');\n\t\t\t\t}\n\t\t\t} else if (isForm) {\n\t\t\t\tif (noContentType) {\n\t\t\t\t\theaders['content-type'] = 'application/x-www-form-urlencoded';\n\t\t\t\t}\n\n\t\t\t\tconst {form} = options;\n\t\t\t\toptions.form = undefined;\n\n\t\t\t\toptions.body = (new URLSearchParams(form as Record)).toString();\n\t\t\t} else {\n\t\t\t\tif (noContentType) {\n\t\t\t\t\theaders['content-type'] = 'application/json';\n\t\t\t\t}\n\n\t\t\t\tconst {json} = options;\n\t\t\t\toptions.json = undefined;\n\n\t\t\t\toptions.body = options.stringifyJson(json);\n\t\t\t}\n\n\t\t\tconst uploadBodySize = getBodySize(options.body, headers);\n\n\t\t\t// See https://tools.ietf.org/html/rfc7230#section-3.3.2\n\t\t\t// A user agent SHOULD send a Content-Length in a request message when\n\t\t\t// no Transfer-Encoding is sent and the request method defines a meaning\n\t\t\t// for an enclosed payload body. For example, a Content-Length header\n\t\t\t// field is normally sent in a POST request even when the value is 0\n\t\t\t// (indicating an empty payload body). A user agent SHOULD NOT send a\n\t\t\t// Content-Length header field when the request message does not contain\n\t\t\t// a payload body and the method semantics do not anticipate such a\n\t\t\t// body.\n\t\t\tif (is.undefined(headers['content-length']) && is.undefined(headers['transfer-encoding']) && !cannotHaveBody && !is.undefined(uploadBodySize)) {\n\t\t\t\theaders['content-length'] = String(uploadBodySize);\n\t\t\t}\n\t\t}\n\n\t\tif (options.responseType === 'json' && !('accept' in headers)) {\n\t\t\theaders.accept = 'application/json';\n\t\t}\n\n\t\tthis._bodySize = Number(headers['content-length']) || undefined;\n\t}", "result_size": 7, "created_at": "2026-03-20T16:58:18.104721+00:00", "file_content": "import process from 'node:process';\nimport {Buffer} from 'node:buffer';\nimport {Duplex, type Readable} from 'node:stream';\nimport {addAbortListener} from 'node:events';\nimport http, {ServerResponse, type ClientRequest, type RequestOptions} from 'node:http';\nimport type {Socket} from 'node:net';\nimport {byteLength} from 'byte-counter';\nimport {chunk} from 'chunk-data';\nimport CacheableRequest, {\n\tCacheError as CacheableCacheError,\n\ttype CacheableRequestFunction,\n\ttype CacheableOptions,\n} from 'cacheable-request';\nimport decompressResponse from 'decompress-response';\nimport type {KeyvStoreAdapter} from 'keyv';\nimport type KeyvType from 'keyv';\nimport is, {isBuffer} from '@sindresorhus/is';\nimport type ResponseLike from 'responselike';\nimport timer, {type ClientRequestWithTimings, type Timings, type IncomingMessageWithTimings} from './utils/timer.js';\nimport getBodySize from './utils/get-body-size.js';\nimport proxyEvents from './utils/proxy-events.js';\nimport timedOut, {TimeoutError as TimedOutTimeoutError} from './timed-out.js';\nimport stripUrlAuth from './utils/strip-url-auth.js';\nimport WeakableMap from './utils/weakable-map.js';\nimport calculateRetryDelay from './calculate-retry-delay.js';\nimport Options, {\n\ttype PromiseCookieJar,\n\ttype NativeRequestOptions,\n\ttype RetryOptions,\n\ttype OptionsError,\n\ttype OptionsInit,\n\ttype NormalizedOptions,\n} from './options.js';\nimport {\n\tcacheDecodedBody,\n\tisResponseOk,\n\ttype PlainResponse,\n\ttype Response,\n} from './response.js';\nimport isClientRequest from './utils/is-client-request.js';\nimport isUnixSocketURL, {getUnixSocketPath} from './utils/is-unix-socket-url.js';\nimport {\n\tRequestError,\n\tReadError,\n\tMaxRedirectsError,\n\tHTTPError,\n\tTimeoutError,\n\tUploadError,\n\tCacheError,\n\tAbortError,\n} from './errors.js';\nimport {\n\tgenerateRequestId,\n\tpublishRequestCreate,\n\tpublishRequestStart,\n\tpublishResponseStart,\n\tpublishResponseEnd,\n\tpublishRetry,\n\tpublishError,\n\tpublishRedirect,\n} from './diagnostics-channel.js';\n\ntype Error = NodeJS.ErrnoException;\n\nexport type Progress = {\n\tpercent: number;\n\ttransferred: number;\n\ttotal?: number;\n};\n\nconst supportsBrotli = is.string(process.versions.brotli);\nconst supportsZstd = is.string(process.versions.zstd);\nconst isUtf8Encoding = (encoding?: BufferEncoding): boolean => encoding === undefined || encoding.toLowerCase().replace('-', '') === 'utf8';\nconst textEncoder = new TextEncoder();\nconst concatUint8Arrays = (chunks: readonly Uint8Array[]): Uint8Array => {\n\tlet totalLength = 0;\n\tfor (const chunk of chunks) {\n\t\ttotalLength += chunk.byteLength;\n\t}\n\n\tconst result = new Uint8Array(totalLength);\n\tlet offset = 0;\n\n\tfor (const chunk of chunks) {\n\t\tresult.set(chunk, offset);\n\t\toffset += chunk.byteLength;\n\t}\n\n\treturn result;\n};\n\nconst methodsWithoutBody: ReadonlySet = new Set(['GET', 'HEAD']);\n\nexport type GotEventFunction =\n\t/**\n\t`request` event to get the request object of the request.\n\n\t __Tip__: You can use `request` event to abort requests.\n\n\t@example\n\t```\n\timport got from 'got';\n\n\tgot.stream('https://github.com')\n\t\t.on('request', request => setTimeout(() => request.destroy(), 50));\n\t```\n\t*/\n\t((name: 'request', listener: (request: ClientRequest) => void) => T)\n\n\t/**\n\tThe `response` event to get the response object of the final request.\n\t*/\n\t& ((name: 'response', listener: (response: R) => void) => T)\n\n\t/**\n\tThe `redirect` event to get the response object of a redirect. The second argument is options for the next request to the redirect location.\n\t*/\n\t& ((name: 'redirect', listener: (response: R, nextOptions: N) => void) => T)\n\n\t/**\n\tProgress events for uploading (sending a request) and downloading (receiving a response).\n\tThe `progress` argument is an object like:\n\n\t```\n\t{\n\t\tpercent: 0.1,\n\t\ttransferred: 1024,\n\t\ttotal: 10240\n\t}\n\t```\n\n\tIf the `content-length` header is missing, `total` will be `undefined`.\n\n\t@example\n\t```\n\timport got from 'got';\n\n\tconst response = await got('https://sindresorhus.com')\n\t\t.on('downloadProgress', progress => {\n\t\t\t// Report download progress\n\t\t})\n\t\t.on('uploadProgress', progress => {\n\t\t\t// Report upload progress\n\t\t});\n\n\tconsole.log(response);\n\t```\n\t*/\n\t& ((name: 'uploadProgress' | 'downloadProgress', listener: (progress: Progress) => void) => T)\n\t/**\n\tTo enable retrying on a Got stream, it is required to have a `retry` handler attached.\n\n\tWhen this event is emitted, you should reset the stream you were writing to and prepare the body again.\n\n\tSee `got.options.retry` for more information.\n\t*/\n\t& ((name: 'retry', listener: (retryCount: number, error: RequestError, createRetryStream: (options?: OptionsInit) => Request) => void) => T);\n\nexport type RequestEvents = {\n\ton: GotEventFunction;\n\tonce: GotEventFunction;\n\toff: GotEventFunction;\n};\n\ntype StorageAdapter = KeyvStoreAdapter | KeyvType | Map;\n\nconst cacheableStore = new WeakableMap();\n\nconst redirectCodes: ReadonlySet = new Set([300, 301, 302, 303, 304, 307, 308]);\nconst transientWriteErrorCodes: ReadonlySet = new Set(['EPIPE', 'ECONNRESET']);\n\n// Track errors that have been processed by beforeError hooks to preserve custom error types\nconst errorsProcessedByHooks = new WeakSet();\n\nconst proxiedRequestEvents = [\n\t'socket',\n\t'connect',\n\t'continue',\n\t'information',\n\t'upgrade',\n] as const;\n\nconst noop = (): void => {};\n\nconst isTransientWriteError = (error: Error): boolean => {\n\tconst {code} = error;\n\treturn typeof code === 'string' && transientWriteErrorCodes.has(code);\n};\n\nconst normalizeError = (error: unknown): Error => {\n\tif (error instanceof globalThis.Error) {\n\t\treturn error;\n\t}\n\n\tif (is.object(error)) {\n\t\tconst errorLike = error as Partial;\n\t\tconst message = typeof errorLike.message === 'string' ? errorLike.message : 'Non-error object thrown';\n\t\tconst normalizedError = new globalThis.Error(message, {cause: error}) as Error & {code?: string; input?: string};\n\n\t\tif (typeof errorLike.stack === 'string') {\n\t\t\tnormalizedError.stack = errorLike.stack;\n\t\t}\n\n\t\tif (typeof errorLike.code === 'string') {\n\t\t\tnormalizedError.code = errorLike.code;\n\t\t}\n\n\t\tif (typeof errorLike.input === 'string') {\n\t\t\tnormalizedError.input = errorLike.input;\n\t\t}\n\n\t\treturn normalizedError;\n\t}\n\n\treturn new globalThis.Error(String(error));\n};\n\ntype UrlType = ConstructorParameters[0];\ntype OptionsType = ConstructorParameters[1];\ntype DefaultsType = ConstructorParameters[2];\nconst getSanitizedUrl = (options?: Options): string => options?.url ? stripUrlAuth(options.url) : '';\n\nexport default class Request extends Duplex implements RequestEvents {\n\t// @ts-expect-error - Ignoring for now.\n\toverride ['constructor']: typeof Request;\n\n\t_noPipe?: boolean;\n\n\t// @ts-expect-error https://github.com/microsoft/TypeScript/issues/9568\n\toptions: Options;\n\tresponse?: PlainResponse;\n\trequestUrl?: URL;\n\tredirectUrls: URL[] = [];\n\tretryCount = 0;\n\t_stopReading = false;\n\n\tdeclare private _requestOptions: NativeRequestOptions;\n\n\tprivate _stopRetry = noop;\n\tprivate _downloadedSize = 0;\n\tprivate _uploadedSize = 0;\n\tprivate readonly _pipedServerResponses = new Set();\n\tprivate _request?: ClientRequest;\n\tprivate _responseSize?: number;\n\tprivate _bodySize?: number;\n\tprivate _unproxyEvents = noop;\n\tprivate _isFromCache?: boolean;\n\tprivate _triggerRead = false;\n\tprivate readonly _jobs: Array<() => void> = [];\n\tprivate _cancelTimeouts = noop;\n\tprivate readonly _removeListeners = noop;\n\tprivate _nativeResponse?: IncomingMessageWithTimings;\n\tprivate _flushed = false;\n\tprivate _aborted = false;\n\tprivate _expectedContentLength?: number;\n\tprivate _compressedBytesCount?: number;\n\tprivate _skipRequestEndInFinal = false;\n\tprivate _incrementalBodyDecoder?: TextDecoder;\n\tprivate _incrementalDecodedBodyChunks: string[] = [];\n\tprivate readonly _requestId = generateRequestId();\n\n\t// We need thi\n# \u2026 (truncated at 8000 chars)"}} {"sample_id": "colinhacks__zod__time__downstream__2hop_f6de5f", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["_addCheck"], "hop_1_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"], "hop_2": ["ZodString", "constructor"], "hop_2_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"]}, "metadata": {"anchor": "time", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "anchor_source": "time(\n options?:\n | string\n | {\n message?: string | undefined;\n precision?: number | null;\n }\n ) {\n if (typeof options === \"string\") {\n return this._addCheck({\n kind: \"time\",\n precision: null,\n message: options,\n });\n }\n return this._addCheck({\n kind: \"time\",\n precision: typeof options?.precision === \"undefined\" ? null : options?.precision,\n ...errorUtil.errToObj(options?.message),\n });\n }", "result_size": 2, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "node-fetch__node-fetch__onHeaderEnd__downstream__1hop_0a2ed8", "repo": "node-fetch/node-fetch", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["_fileName"], "call_files": ["private/tmp/repos/node-fetch__node-fetch/src/utils/multipart-parser.js"]}, "metadata": {"anchor": "onHeaderEnd", "anchor_file": "private/tmp/repos/node-fetch__node-fetch/src/utils/multipart-parser.js", "anchor_source": "parser.onHeaderEnd = function () {\n\t\theaderValue += decoder.decode();\n\t\theaderField = headerField.toLowerCase();\n\n\t\tif (headerField === 'content-disposition') {\n\t\t\t// matches either a quoted-string or a token (RFC 2616 section 19.5.1)\n\t\t\tconst m = headerValue.match(/\\bname=(\"([^\"]*)\"|([^()<>@,;:\\\\\"/[\\]?={}\\s\\t]+))/i);\n\n\t\t\tif (m) {\n\t\t\t\tentryName = m[2] || m[3] || '';\n\t\t\t}\n\n\t\t\tfilename = _fileName(headerValue);\n\n\t\t\tif (filename) {\n\t\t\t\tparser.onPartData = appendToFile;\n\t\t\t\tparser.onPartEnd = appendFileToFormData;\n\t\t\t}\n\t\t} else if (headerField === 'content-type') {\n\t\t\tcontentType = headerValue;\n\t\t}\n\n\t\theaderValue = '';\n\t\theaderField = '';\n\t};", "result_size": 1, "created_at": "2026-03-20T16:58:17.058449+00:00"}} {"sample_id": "rq__rq__create_failure__downstream__2hop_60a619", "repo": "rq/rq", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["save"], "hop_1_files": ["private/tmp/repos/rq__rq/rq/results.py"], "hop_2": ["get_key", "serialize"], "hop_2_files": ["private/tmp/repos/rq__rq/rq/results.py", "private/tmp/repos/rq__rq/rq/results.py"]}, "metadata": {"anchor": "create_failure", "anchor_file": "private/tmp/repos/rq__rq/rq/results.py", "anchor_source": "@classmethod\n def create_failure(cls, job, ttl, exc_string, worker_name='', pipeline=None) -> 'Result':\n result = cls(\n job_id=job.id,\n type=cls.Type.FAILED,\n connection=job.connection,\n exc_string=exc_string,\n worker_name=worker_name,\n serializer=job.serializer,\n )\n result.save(ttl=ttl, pipeline=pipeline)\n return result", "result_size": 2, "created_at": "2026-03-20T16:58:17.875204+00:00"}} {"sample_id": "pallets__click__get_params__upstream__1hop_763b59", "repo": "pallets/click", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["collect_usage_pieces", "command_path", "format_options", "shell_complete", "to_info_dict", "parse_args", "make_parser", "_resolve_incomplete"], "call_files": ["private/tmp/repos/pallets__click/src/click/core.py", "private/tmp/repos/pallets__click/src/click/core.py", "private/tmp/repos/pallets__click/src/click/core.py", "private/tmp/repos/pallets__click/src/click/core.py", "private/tmp/repos/pallets__click/src/click/core.py", "private/tmp/repos/pallets__click/src/click/core.py", "private/tmp/repos/pallets__click/src/click/core.py", "private/tmp/repos/pallets__click/src/click/shell_completion.py"]}, "metadata": {"anchor": "get_params", "anchor_file": "private/tmp/repos/pallets__click/src/click/core.py", "anchor_source": "def get_params(self, ctx: Context) -> list[Parameter]:\n params = self.params\n help_option = self.get_help_option(ctx)\n\n if help_option is not None:\n params = [*params, help_option]\n\n if __debug__:\n import warnings\n\n opts = [opt for param in params for opt in param.opts]\n opts_counter = Counter(opts)\n duplicate_opts = (opt for opt, count in opts_counter.items() if count > 1)\n\n for duplicate_opt in duplicate_opts:\n warnings.warn(\n (\n f\"The parameter {duplicate_opt} is used more than once. \"\n \"Remove its duplicate as parameters should be unique.\"\n ),\n stacklevel=3,\n )\n\n return params", "result_size": 8, "created_at": "2026-03-20T16:58:17.078639+00:00", "file_content": ""}} {"sample_id": "rq__rq__perform_job__upstream__1hop_a067e4", "repo": "rq/rq", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["execute_job", "main_work_horse"], "call_files": ["private/tmp/repos/rq__rq/rq/worker/worker_classes.py", "private/tmp/repos/rq__rq/rq/worker/base.py"]}, "metadata": {"anchor": "perform_job", "anchor_file": "private/tmp/repos/rq__rq/rq/worker/base.py", "anchor_source": "def perform_job(self, job: 'Job', queue: 'Queue') -> bool:\n \"\"\"Performs the actual work of a job. Will/should only be called\n inside the work horse's process.\n\n Args:\n job (Job): The Job\n queue (Queue): The Queue\n\n Returns:\n bool: True after finished.\n \"\"\"\n started_job_registry = queue.started_job_registry\n self.log.debug('Worker %s: started job registry set.', self.name)\n\n try:\n remove_from_intermediate_queue = len(self.queues) == 1\n self.prepare_job_execution(job, remove_from_intermediate_queue)\n\n job.started_at = now()\n timeout = job.timeout or self.queue_class.DEFAULT_TIMEOUT\n with self.death_penalty_class(timeout, JobTimeoutException, job_id=job.id):\n self.log.debug('Worker %s: performing job %s ...', self.name, job.id)\n return_value = job.perform()\n self.log.debug('Worker %s: finished performing job %s', self.name, job.id)\n\n self.handle_execution_ended(job, queue, job.success_callback_timeout)\n # Pickle the result in the same try-except block since we need\n # to use the same exc handling when pickling fails\n job._result = return_value\n\n if isinstance(return_value, Retry):\n # Retry the job\n self.log.debug('Worker %s: job %s returns a Retry object', self.name, job.id)\n self.handle_job_retry(\n job=job, queue=queue, retry=return_value, started_job_registry=started_job_registry\n )\n return True\n else:\n job._status = JobStatus.FINISHED\n job.execute_success_callback(self.death_penalty_class, return_value)\n self.handle_job_success(job=job, queue=queue, started_job_registry=started_job_registry)\n\n except: # NOQA\n self.log.debug('Worker %s: job %s raised an exception.', self.name, job.id)\n job._status = JobStatus.FAILED\n\n self.handle_execution_ended(job, queue, job.failure_callback_timeout)\n exc_info = sys.exc_info()\n exc_string = ''.join(traceback.format_exception(*exc_info))\n\n try:\n job.execute_failure_callback(self.death_penalty_class, *exc_info)\n except: # noqa\n exc_info = sys.exc_info()\n exc_string = ''.join(traceback.format_exception(*exc_info))\n\n # TODO: reversing the order of handle_job_failure() and handle_exception()\n # causes Sentry test to fail\n self.handle_exception(job, *exc_info)\n self.handle_job_failure(\n job=job, exc_string=exc_string, queue=queue, started_job_registry=started_job_registry\n )\n\n return False\n\n self.log.info('%s: %s (%s)', green(job.origin), blue('Job OK'), job.id)\n if return_value is not None:\n self.log.debug('Worker %s: result: %r', self.name, yellow(str(return_value)))\n\n if self.log_result_lifespan:\n result_ttl = job.get_result_ttl(self.default_result_ttl)\n if result_ttl == 0:\n self.log.info('Result discarded immediately')\n elif result_ttl > 0:\n self.log.info('Result is kept for %s seconds', result_ttl)\n else:\n self.log.info('Result will never expire, clean up result key manually')\n\n return True", "result_size": 2, "created_at": "2026-03-20T16:58:17.875204+00:00", "file_content": ""}} {"sample_id": "colinhacks__zod__duration__downstream__2hop_5343d3", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["_isoDuration"], "hop_1_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/api.ts"], "hop_2": ["normalizeParams"], "hop_2_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/util.ts"]}, "metadata": {"anchor": "duration", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/mini/iso.ts", "anchor_source": "export function duration(params?: string | core.$ZodISODurationParams): ZodMiniISODuration {\n return core._isoDuration(ZodMiniISODuration, params);\n}", "result_size": 1, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "locustio__locust___getattr__upstream__2hop_56a886", "repo": "locustio/locust", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["serialize"], "hop_1_files": ["private/tmp/repos/locustio__locust/locust/stats.py"], "hop_2": ["serialize_errors", "request_stats"], "hop_2_files": ["private/tmp/repos/locustio__locust/locust/stats.py", "private/tmp/repos/locustio__locust/locust/web.py"]}, "metadata": {"anchor": "_getattr", "anchor_file": "private/tmp/repos/locustio__locust/locust/stats.py", "anchor_source": "def _getattr(obj: StatsError, key: str, default: Any) -> Any:\n value = getattr(obj, key, default)\n\n if key in [\"error\"]:\n value = StatsError.parse_error(value)\n\n return value", "result_size": 2, "created_at": "2026-03-20T16:58:16.951273+00:00", "file_content": ""}} {"sample_id": "pallets__jinja__args_as_const__downstream__2hop_65492c", "repo": "pallets/jinja", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["as_const"], "hop_1_files": ["private/tmp/repos/pallets__jinja/src/jinja2/nodes.py"], "hop_2": ["get_eval_context"], "hop_2_files": ["private/tmp/repos/pallets__jinja/src/jinja2/nodes.py"]}, "metadata": {"anchor": "args_as_const", "anchor_file": "private/tmp/repos/pallets__jinja/src/jinja2/nodes.py", "anchor_source": "def args_as_const(\n node: t.Union[\"_FilterTestCommon\", \"Call\"], eval_ctx: EvalContext | None\n) -> tuple[list[t.Any], dict[t.Any, t.Any]]:\n args = [x.as_const(eval_ctx) for x in node.args]\n kwargs = dict(x.as_const(eval_ctx) for x in node.kwargs)\n\n if node.dyn_args is not None:\n try:\n args.extend(node.dyn_args.as_const(eval_ctx))\n except Exception as e:\n raise Impossible() from e\n\n if node.dyn_kwargs is not None:\n try:\n kwargs.update(node.dyn_kwargs.as_const(eval_ctx))\n except Exception as e:\n raise Impossible() from e\n\n return args, kwargs", "result_size": 1, "created_at": "2026-03-20T16:58:17.229656+00:00"}} {"sample_id": "colinhacks__zod__date__downstream__2hop_7cb6da", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["_isoDate"], "hop_1_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/api.ts"], "hop_2": ["normalizeParams"], "hop_2_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/util.ts"]}, "metadata": {"anchor": "date", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/mini/iso.ts", "anchor_source": "export function date(params?: string | core.$ZodISODateParams): ZodMiniISODate {\n return core._isoDate(ZodMiniISODate, params);\n}", "result_size": 1, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "pallets__jinja__pgettext__downstream__2hop_a5b1a6", "repo": "pallets/jinja", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["call"], "hop_1_files": ["private/tmp/repos/pallets__jinja/src/jinja2/runtime.py"], "hop_2": ["derived", "from_obj"], "hop_2_files": ["private/tmp/repos/pallets__jinja/src/jinja2/runtime.py", "private/tmp/repos/pallets__jinja/src/jinja2/utils.py"]}, "metadata": {"anchor": "pgettext", "anchor_file": "private/tmp/repos/pallets__jinja/src/jinja2/ext.py", "anchor_source": "@pass_context\n def pgettext(\n __context: Context, __string_ctx: str, __string: str, **variables: t.Any\n ) -> str:\n variables.setdefault(\"context\", __string_ctx)\n rv = __context.call(func, __string_ctx, __string)\n\n if __context.eval_ctx.autoescape:\n rv = Markup(rv)\n\n # Always treat as a format string, see gettext comment above.\n return rv % variables # type: ignore", "result_size": 2, "created_at": "2026-03-20T16:58:17.229656+00:00"}} {"sample_id": "sindresorhus__got__setPipedHeader__upstream__2hop_5879e7", "repo": "sindresorhus/got", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["constructor"], "hop_1_files": ["private/tmp/repos/got/source/core/index.ts"], "hop_2": ["fn", "_beforeError", "asPromise"], "hop_2_files": ["private/tmp/repos/got/benchmark/index.ts", "private/tmp/repos/got/source/core/index.ts", "private/tmp/repos/got/source/as-promise/index.ts"]}, "metadata": {"anchor": "setPipedHeader", "anchor_file": "private/tmp/repos/got/source/core/options.ts", "anchor_source": "setPipedHeader(name: string, value: string | string[] | undefined): void {\n\t\tthis.#internals.headers[name.toLowerCase()] = value;\n\t}", "result_size": 6, "created_at": "2026-03-20T16:58:18.104721+00:00", "file_content": "import process from 'node:process';\nimport {promisify, inspect, type InspectOptions} from 'node:util';\nimport {checkServerIdentity, type SecureContextOptions, type DetailedPeerCertificate} from 'node:tls';\n// DO NOT use destructuring for `https.request` and `http.request` as it's not compatible with `nock`.\nimport https, {\n\ttype RequestOptions as HttpsRequestOptions,\n\ttype Agent as HttpsAgent,\n} from 'node:https';\nimport http, {\n\ttype Agent as HttpAgent,\n\ttype ClientRequest,\n} from 'node:http';\nimport type {Readable} from 'node:stream';\nimport type {Socket, LookupFunction} from 'node:net';\nimport is, {assert} from '@sindresorhus/is';\nimport lowercaseKeys from 'lowercase-keys';\nimport CacheableLookup from 'cacheable-lookup';\nimport http2wrapper, {type ClientHttp2Session} from 'http2-wrapper';\nimport type {KeyvStoreAdapter} from 'keyv';\nimport type KeyvType from 'keyv';\nimport type ResponseLike from 'responselike';\nimport type {RequestPromise} from '../as-promise/types.js';\nimport type {IncomingMessageWithTimings} from './utils/timer.js';\nimport parseLinkHeader from './parse-link-header.js';\nimport type {PlainResponse, Response} from './response.js';\nimport type {RequestError} from './errors.js';\nimport type {Delays} from './timed-out.js';\n\ntype StorageAdapter = KeyvStoreAdapter | KeyvType | Map;\n\ntype Promisable = T | Promise;\n\nconst [major, minor] = process.versions.node.split('.').map(Number) as [number, number, number];\n\nexport type DnsLookupIpVersion = undefined | 4 | 6;\n\ntype Except = Pick>;\n\nexport type NativeRequestOptions = HttpsRequestOptions & CacheOptions & {checkServerIdentity?: CheckServerIdentityFunction};\n\ntype AcceptableResponse = IncomingMessageWithTimings | ResponseLike;\ntype AcceptableRequestResult = Promisable;\nexport type RequestFunction = (url: URL, options: NativeRequestOptions, callback?: (response: AcceptableResponse) => void) => AcceptableRequestResult;\n\nexport type Agents = {\n\thttp?: HttpAgent | false;\n\thttps?: HttpsAgent | false;\n\thttp2?: unknown | false;\n};\n\nexport type Headers = Record;\n\nexport type ToughCookieJar = {\n\tgetCookieString: ((currentUrl: string, options: Record, callback: (error: Error | undefined, cookies: string) => void) => void)\n\t\t& ((url: string, callback: (error: Error | undefined, cookieHeader: string) => void) => void);\n\tsetCookie: ((cookieOrString: unknown, currentUrl: string, options: Record, callback: (error: Error | undefined, cookie: unknown) => void) => void)\n\t\t& ((rawCookie: string, url: string, callback: (error: Error | undefined, result: unknown) => void) => void);\n};\n\nexport type PromiseCookieJar = {\n\tgetCookieString: (url: string) => Promise;\n\tsetCookie: (rawCookie: string, url: string) => Promise;\n};\n\n/**\nUtility type to override specific properties in a type.\n\nUses `Omit` to remove properties before adding them back to ensure proper type replacement rather than intersection, which handles edge cases with optional/required properties correctly.\n*/\ntype OverrideProperties = Omit & U;\n\n/**\nRepresents the runtime state of Options as seen by hooks after normalization.\n\nSome Options properties accept multiple input types but are normalized to a single type internally by the Options class setters. This type reflects the actual runtime types that hooks receive, ensuring type safety when accessing options within hook functions.\n*/\nexport type NormalizedOptions = OverrideProperties;\n\nexport type InitHook = (init: OptionsInit, self: Options) => void;\n\nexport type BeforeRequestHookContext = {\n\t/**\n\tThe current retry count.\n\n\tIt will be `0` for the initial request and increment for each retry.\n\t*/\n\tretryCount: number;\n};\n\nexport type BeforeRequestHook = (options: NormalizedOptions, context: BeforeRequestHookContext) => Promisable;\nexport type BeforeRedirectHook = (updatedOptions: NormalizedOptions, plainResponse: PlainResponse) => Promisable;\nexport type BeforeErrorHook = (error: RequestError) => Promisable;\nexport type BeforeRetryHook = (error: RequestError, retryCount: number) => Promisable;\nexport type BeforeCacheHook = (response: PlainResponse) => false | void;\nexport type AfterResponseHook = (response: Response, retryWithMergedOptions: (options: OptionsInit) => never) => Promisable>;\n\n/**\nAll available hooks of Got.\n*/\nexport type Hooks = {\n\t/**\n\tCalled with the plain request options, right before their normalization.\n\n\tThe second argument represents the current `Options` instance.\n\n\t@default []\n\n\t**Note:**\n\t> - This hook must be synchronous.\n\n\t**Note:**\n\t> - This is called every time options are merged.\n\n\t**Note:**\n\t> - The `options` object may not have the `url` property. To modify it, use a `beforeRequest` hook instead.\n\n\t**Note:**\n\t> - This hook is called when a new instance of `Options` is created.\n\t> - Do not confuse this with the creation of `Request` or `got(\u2026)`.\n\n\t**Note:**\n\t> - When using `got(url)` or `got(url, undefined, defaults)` this hook will **not** be called.\n\n\tThis is especially useful in conjunction with `got.extend()` when the input needs custom handling.\n\n\tFor example, this can be used to fix typos to migrate from older versions faster.\n\n\t@example\n\t```\n\timport got from 'got';\n\n\tconst instance = got.extend({\n\t\thooks: {\n\t\t\tinit: [\n\t\t\t\tplain => {\n\t\t\t\t\tif ('followRedirects' in plain) {\n\t\t\t\t\t\tplain.followRedirect = plain.followRedirects;\n\t\t\t\t\t\tdelete plain.followRedirects;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t});\n\n\t// Normally, the following would throw:\n\tconst response = await instance(\n\t\t'https://example.com',\n\t\t{\n\t\t\tfollowRedirects: true\n\t\t}\n\t);\n\n\t// There is no option named `followRedirects`, but we correct it in an `init` hook.\n\t```\n\n\tOr you can create your own option and store it in a context:\n\n\t```\n\timport got from 'got';\n\n\tconst instance = got.extend({\n\t\thooks: {\n\t\t\tinit: [\n\t\t\t\t(plain, options) => {\n\t\t\t\t\tif ('secret' in plain) {\n\t\t\t\t\t\toptions.context.secret = plain.secret;\n\t\t\t\t\t\tdelete plain.secret;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t],\n\t\t\tbeforeRequest: [\n\t\t\t\toptions => {\n\t\t\t\t\toptions.headers.secret = options.context.secret;\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t});\n\n\tconst {headers} = await instance(\n\t\t'https://httpbin.org/anything',\n\t\t{\n\t\t\tsecret: 'passphrase'\n\t\t}\n\t).json();\n\n\tconsole.log(headers.Secret);\n\t//=> 'passphrase'\n\t```\n\t*/\n\tinit: InitHook[];\n\n\t/**\n\tCalled right before making the request with `options.createNativeRequestOptions()`.\n\n\tThe second argument is a context object containing request state information.\n\n\tThis hook is especially useful in conjunction with `got.extend()` when you want to sign your request.\n\n\t@default []\n\n\t**Note:**\n\t> - Got will make no further changes to the request before it is sent.\n\n\t**Note:**\n\t> - Changing `options.json` or `options.form` has no effect on the request. You should change `options.body` instead. If needed, update the `options.headers` accordingly.\n\n\t@example\n\t```\n\timport got from 'got';\n\n\tconst response = await got.post(\n\t\t'https://httpbin.org/anything',\n\t\t{\n\t\t\tjson: {payload: 'old'},\n\t\t\thooks: {\n\t\t\t\tbeforeRequest: [\n\t\t\t\t\t(options, context) => {\n\t\t\t\t\t\toptions.body = JSON.stringify({payload: 'new'});\n\t\t\n# \u2026 (truncated at 8000 chars)"}} {"sample_id": "trpc__trpc__getMutationKeyInternal__upstream__1hop_4b2e7f", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["createRecursiveUtilsProxy", "useMutation", "getMutationDefaults", "setMutationDefaults", "isMutating"], "call_files": ["private/tmp/repos/trpc__trpc/packages/react-query/src/shared/proxy/utilsProxy.ts", "private/tmp/repos/trpc__trpc/packages/react-query/src/shared/hooks/createHooksInternal.tsx", "private/tmp/repos/trpc__trpc/packages/react-query/src/shared/proxy/utilsProxy.ts", "private/tmp/repos/trpc__trpc/packages/react-query/src/shared/proxy/utilsProxy.ts", "private/tmp/repos/trpc__trpc/packages/react-query/src/shared/proxy/utilsProxy.ts"]}, "metadata": {"anchor": "getMutationKeyInternal", "anchor_file": "private/tmp/repos/trpc__trpc/packages/react-query/src/internals/getQueryKey.ts", "anchor_source": "export function getMutationKeyInternal(path: readonly string[]) {\n return getQueryKeyInternal(path, undefined, 'any') as TRPCMutationKey;\n}", "result_size": 7, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "python-poetry__poetry___create_file_url_reference__downstream__1hop_fbc06e", "repo": "python-poetry/poetry", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["_get_archive_info"], "call_files": ["private/tmp/repos/python-poetry__poetry/src/poetry/installation/executor.py"]}, "metadata": {"anchor": "_create_file_url_reference", "anchor_file": "private/tmp/repos/python-poetry__poetry/src/poetry/installation/executor.py", "anchor_source": "def _create_file_url_reference(self, package: Package) -> dict[str, Any]:\n archive_info = self._get_archive_info(package)\n\n assert package.source_url is not None\n return {\n \"url\": Path(package.source_url).as_uri(),\n \"archive_info\": archive_info,\n }", "result_size": 1, "created_at": "2026-03-20T16:58:17.758794+00:00"}} {"sample_id": "locustio__locust__start_automatic_run__downstream__2hop_5277db", "repo": "locustio/locust", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["quit", "start_shape", "spawn_run_time_quit_greenlet", "stop_and_optionally_quit"], "hop_1_files": ["private/tmp/repos/locustio__locust/locust/runners.py", "private/tmp/repos/locustio__locust/locust/runners.py", "private/tmp/repos/locustio__locust/locust/main.py", "private/tmp/repos/locustio__locust/locust/main.py"], "hop_2": ["reset_time", "update_state", "get_worker_index", "stop", "locust_exception_handler", "Message", "send_to_client"], "hop_2_files": ["private/tmp/repos/locustio__locust/locust/shape.py", "private/tmp/repos/locustio__locust/locust/runners.py", "private/tmp/repos/locustio__locust/locust/runners.py", "private/tmp/repos/locustio__locust/locust/runners.py", "private/tmp/repos/locustio__locust/locust/runners.py", "private/tmp/repos/locustio__locust/locust/rpc/protocol.py", "private/tmp/repos/locustio__locust/locust/rpc/zmqrpc.py"]}, "metadata": {"anchor": "start_automatic_run", "anchor_file": "private/tmp/repos/locustio__locust/locust/main.py", "anchor_source": "def start_automatic_run():\n if options.master:\n # wait for worker nodes to connect\n start_time = time.monotonic()\n while len(runner.clients.ready) < options.expect_workers:\n if options.expect_workers_max_wait and options.expect_workers_max_wait < time.monotonic() - start_time:\n logger.error(\"Gave up waiting for workers to connect\")\n runner.quit()\n sys.exit(1)\n if time.monotonic() - start_time > 5:\n logging.info(\n \"Waiting for workers to be ready, %s of %s connected\",\n len(runner.clients.ready),\n options.expect_workers,\n )\n else:\n logging.debug(\n \"Waiting for workers to be ready, %s of %s connected\",\n len(runner.clients.ready),\n options.expect_workers,\n )\n # TODO: Handle KeyboardInterrupt and send quit signal to workers that are started.\n # Right now, if the user sends a ctrl+c, the master will not gracefully\n # shutdown resulting in all the already started workers to stay active.\n time.sleep(1)\n if not options.worker:\n # apply headless mode defaults\n if options.num_users is None:\n options.num_users = 1\n if options.spawn_rate is None:\n options.spawn_rate = 1\n\n # start the test\n if environment.shape_class:\n try:\n environment.runner.start_shape()\n environment.runner.shape_greenlet.join()\n except KeyboardInterrupt:\n logging.info(\"Exiting due to CTRL+C interruption\")\n finally:\n stop_and_optionally_quit()\n else:\n headless_master_greenlet = gevent.spawn(runner.start, options.num_users, options.spawn_rate)\n headless_master_greenlet.link_exception(greenlet_exception_handler)\n\n if options.run_time:\n logger.info(f\"Run time limit set to {options.run_time} seconds\")\n spawn_run_time_quit_greenlet()\n elif not environment.shape_class:\n logger.info(\"No run time limit set, use CTRL+C to interrupt\")", "result_size": 8, "created_at": "2026-03-20T16:58:16.951273+00:00"}} {"sample_id": "pallets__jinja__load_bytecode__downstream__2hop_a402f0", "repo": "pallets/jinja", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["_get_cache_filename", "load_bytecode"], "hop_1_files": ["private/tmp/repos/pallets__jinja/src/jinja2/bccache.py", "private/tmp/repos/pallets__jinja/src/jinja2/bccache.py"], "hop_2": ["reset"], "hop_2_files": ["private/tmp/repos/pallets__jinja/src/jinja2/bccache.py"]}, "metadata": {"anchor": "load_bytecode", "anchor_file": "private/tmp/repos/pallets__jinja/src/jinja2/bccache.py", "anchor_source": "def load_bytecode(self, bucket: Bucket) -> None:\n filename = self._get_cache_filename(bucket)\n\n # Don't test for existence before opening the file, since the\n # file could disappear after the test before the open.\n try:\n f = open(filename, \"rb\")\n except (FileNotFoundError, IsADirectoryError, PermissionError):\n # PermissionError can occur on Windows when an operation is\n # in progress, such as calling clear().\n return\n\n with f:\n bucket.load_bytecode(f)", "result_size": 1, "created_at": "2026-03-20T16:58:17.229656+00:00"}} {"sample_id": "celery__celery___limit_post_eta__downstream__2hop_726ef8", "repo": "celery/celery", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["_schedule_bucket_request"], "hop_1_files": ["private/tmp/repos/celery/celery/worker/consumer/consumer.py"], "hop_2": ["_limit_move_to_pool"], "hop_2_files": ["private/tmp/repos/celery/celery/worker/consumer/consumer.py"]}, "metadata": {"anchor": "_limit_post_eta", "anchor_file": "private/tmp/repos/celery/celery/worker/consumer/consumer.py", "anchor_source": "def _limit_post_eta(self, request, bucket, tokens):\n self.qos.decrement_eventually()\n bucket.add((request, tokens))\n return self._schedule_bucket_request(bucket)", "result_size": 1, "created_at": "2026-03-20T16:58:16.326235+00:00"}} {"sample_id": "encode__httpx__aiter_bytes__upstream__2hop_870610", "repo": "encode/httpx", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["aiter_text", "aread"], "hop_1_files": ["private/tmp/repos/encode__httpx/httpx/_models.py", "private/tmp/repos/encode__httpx/httpx/_models.py"], "hop_2": ["async_auth_flow", "_send_handling_redirects", "aiter_lines", "_send_handling_auth", "send"], "hop_2_files": ["private/tmp/repos/encode__httpx/httpx/_auth.py", "private/tmp/repos/encode__httpx/httpx/_client.py", "private/tmp/repos/encode__httpx/httpx/_models.py", "private/tmp/repos/encode__httpx/httpx/_client.py", "private/tmp/repos/encode__httpx/httpx/_client.py"]}, "metadata": {"anchor": "aiter_bytes", "anchor_file": "private/tmp/repos/encode__httpx/httpx/_models.py", "anchor_source": "async def aiter_bytes(\n self, chunk_size: int | None = None\n ) -> typing.AsyncIterator[bytes]:\n \"\"\"\n A byte-iterator over the decoded response content.\n This allows us to handle gzip, deflate, brotli, and zstd encoded responses.\n \"\"\"\n if hasattr(self, \"_content\"):\n chunk_size = len(self._content) if chunk_size is None else chunk_size\n for i in range(0, len(self._content), max(chunk_size, 1)):\n yield self._content[i : i + chunk_size]\n else:\n decoder = self._get_content_decoder()\n chunker = ByteChunker(chunk_size=chunk_size)\n with request_context(request=self._request):\n async for raw_bytes in self.aiter_raw():\n decoded = decoder.decode(raw_bytes)\n for chunk in chunker.decode(decoded):\n yield chunk\n decoded = decoder.flush()\n for chunk in chunker.decode(decoded):\n yield chunk # pragma: no cover\n for chunk in chunker.flush():\n yield chunk", "result_size": 5, "created_at": "2026-03-20T16:58:16.700579+00:00", "file_content": ""}} {"sample_id": "trpc__trpc__transformResult__downstream__2hop_7a41be", "repo": "trpc/trpc", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["transformResultInner", "TransformResultError", "isObject", "constructor"], "hop_1_files": ["private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/transformer.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/transformer.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/utils.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/transformer.ts"], "hop_2": ["deserialize"], "hop_2_files": ["private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/transformer.ts"]}, "metadata": {"anchor": "transformResult", "anchor_file": "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/transformer.ts", "anchor_source": "export function transformResult(\n response:\n | TRPCResponse>\n | TRPCResponseMessage>,\n transformer: DataTransformer,\n): ReturnType {\n let result: ReturnType;\n try {\n // Use the data transformers on the JSON-response\n result = transformResultInner(response, transformer);\n } catch {\n throw new TransformResultError();\n }\n\n // check that output of the transformers is a valid TRPCResponse\n if (\n !result.ok &&\n (!isObject(result.error.error) ||\n typeof result.error.error['code'] !== 'number')\n ) {\n throw new TransformResultError();\n }\n if (result.ok && !isObject(result.result)) {\n throw new TransformResultError();\n }\n return result;\n}", "result_size": 1, "created_at": "2026-03-20T16:58:18.199328+00:00"}} {"sample_id": "rq__rq__register_dependency__upstream__1hop_0ff473", "repo": "rq/rq", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["get_jobs_with_met_dependencies", "setup_dependencies"], "call_files": ["private/tmp/repos/rq__rq/rq/dependency.py", "private/tmp/repos/rq__rq/rq/queue.py"]}, "metadata": {"anchor": "register_dependency", "anchor_file": "private/tmp/repos/rq__rq/rq/job.py", "anchor_source": "def register_dependency(self, pipeline: Optional['Pipeline'] = None):\n \"\"\"Jobs may have dependencies. Jobs are enqueued only if the jobs they\n depend on are successfully performed. We record this relation as\n a reverse dependency (a Redis set), with a key that looks something\n like:\n ..codeblock:python::\n\n rq:job:job_id:dependents = {'job_id_1', 'job_id_2'}\n\n This method adds the job in its dependencies' dependents sets,\n and adds the job to DeferredJobRegistry.\n\n Args:\n pipeline (Optional[Pipeline]): The Redis' pipeline. Defaults to None\n \"\"\"\n from .registry import DeferredJobRegistry\n\n self.log.debug('Job %s registering dependencies: %s', self.id, self._dependency_ids)\n\n registry = DeferredJobRegistry(\n self.origin, connection=self.connection, job_class=self.__class__, serializer=self.serializer\n )\n registry.add(self, pipeline=pipeline, ttl=self.ttl)\n\n connection = pipeline if pipeline is not None else self.connection\n\n for dependency_id in self._dependency_ids:\n dependents_key = self.dependents_key_for(dependency_id)\n connection.sadd(dependents_key, self.id)\n connection.sadd(self.dependencies_key, dependency_id)", "result_size": 2, "created_at": "2026-03-20T16:58:17.875204+00:00", "file_content": ""}} {"sample_id": "colinhacks__zod__getErrorMap__upstream__1hop_a577b6", "repo": "colinhacks/zod", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["makeArgsIssue", "_parse", "addIssueToContext", "makeReturnsIssue"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/helpers/parseUtil.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"]}, "metadata": {"anchor": "getErrorMap", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/errors.ts", "anchor_source": "export function getErrorMap() {\n return overrideErrorMap;\n}", "result_size": 4, "created_at": "2026-03-20T16:58:16.474869+00:00", "file_content": ""}} {"sample_id": "colinhacks__zod__setKey__downstream__2hop_c9443c", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["extend", "ZodObject"], "hop_1_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"], "hop_2": ["constructor"], "hop_2_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"]}, "metadata": {"anchor": "setKey", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "anchor_source": "setKey(\n key: Key,\n schema: Schema\n ): ZodObject {\n return this.augment({ [key]: schema }) as any;\n }", "result_size": 1, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "pallets__jinja__preprocess__upstream__2hop_6fc2dc", "repo": "pallets/jinja", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["preprocess"], "hop_1_files": ["private/tmp/repos/pallets__jinja/src/jinja2/environment.py"], "hop_2": ["babel_extract", "_tokenize"], "hop_2_files": ["private/tmp/repos/pallets__jinja/src/jinja2/ext.py", "private/tmp/repos/pallets__jinja/src/jinja2/environment.py"]}, "metadata": {"anchor": "preprocess", "anchor_file": "private/tmp/repos/pallets__jinja/src/jinja2/ext.py", "anchor_source": "def preprocess(\n self, source: str, name: str | None, filename: str | None = None\n ) -> str:\n \"\"\"This method is called before the actual lexing and can be used to\n preprocess the source. The `filename` is optional. The return value\n must be the preprocessed source.\n \"\"\"\n return source", "result_size": 2, "created_at": "2026-03-20T16:58:17.229656+00:00", "file_content": ""}} {"sample_id": "colinhacks__zod___custom__downstream__1hop_58c759", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["normalizeParams"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/util.ts"]}, "metadata": {"anchor": "_custom", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/api.ts", "anchor_source": "export function _custom(\n Class: util.SchemaClass,\n fn: (data: O) => unknown,\n _params: string | $ZodCustomParams | undefined\n): schemas.$ZodCustom {\n const norm = util.normalizeParams(_params);\n norm.abort ??= true; // default to abort:false\n const schema = new Class({\n type: \"custom\",\n check: \"custom\",\n fn: fn as any,\n ...norm,\n });\n\n return schema as any;\n}", "result_size": 1, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "trpc__trpc__trpcMutationOptions__downstream__2hop_60a9a5", "repo": "trpc/trpc", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["getMutationKeyInternal", "createTRPCOptionsResult", "mutation", "unwrapLazyArg", "onSuccess", "getClientArgs"], "hop_1_files": ["private/tmp/repos/trpc__trpc/packages/tanstack-react-query/src/internals/utils.ts", "private/tmp/repos/trpc__trpc/packages/tanstack-react-query/src/internals/utils.ts", "private/tmp/repos/trpc__trpc/packages/client/src/internals/TRPCUntypedClient.ts", "private/tmp/repos/trpc__trpc/packages/tanstack-react-query/src/internals/utils.ts", "private/tmp/repos/trpc__trpc/packages/tanstack-react-query/src/internals/mutationOptions.ts", "private/tmp/repos/trpc__trpc/packages/tanstack-react-query/src/internals/utils.ts"], "hop_2": ["readQueryKey", "isFunction"], "hop_2_files": ["private/tmp/repos/trpc__trpc/packages/tanstack-react-query/src/internals/utils.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/utils.ts"]}, "metadata": {"anchor": "trpcMutationOptions", "anchor_file": "private/tmp/repos/trpc__trpc/packages/tanstack-react-query/src/internals/mutationOptions.ts", "anchor_source": "export function trpcMutationOptions(args: {\n mutate: typeof TRPCUntypedClient.prototype.mutation;\n queryClient: QueryClient | (() => QueryClient);\n path: string[];\n opts: AnyTRPCMutationOptionsIn | undefined;\n overrides: MutationOptionsOverride | undefined;\n}): AnyTRPCMutationOptionsOut {\n const { mutate, path, opts, overrides } = args;\n const queryClient = unwrapLazyArg(args.queryClient);\n\n const mutationKey = getMutationKeyInternal({\n path,\n prefix: opts?.keyPrefix,\n }) as TRPCMutationKey;\n\n const defaultOpts = queryClient.defaultMutationOptions(\n queryClient.getMutationDefaults(mutationKey),\n );\n\n const mutationSuccessOverride: MutationOptionsOverride['onSuccess'] =\n overrides?.onSuccess ?? ((options) => options.originalFn());\n\n const mutationFn: MutationFunction = async (input) => {\n const result = await mutate(\n ...getClientArgs([...mutationKey, { input }] as any, opts),\n );\n\n return result;\n };\n\n return {\n ...opts,\n mutationKey,\n mutationFn,\n onSuccess(...args) {\n const originalFn = () =>\n opts?.onSuccess?.(...args) ?? defaultOpts?.onSuccess?.(...args);\n\n return mutationSuccessOverride({\n originalFn,\n queryClient,\n meta: opts?.meta ?? defaultOpts?.meta ?? {},\n });\n },\n trpc: createTRPCOptionsResult({ path }),\n };\n}", "result_size": 2, "created_at": "2026-03-20T16:58:18.199328+00:00"}} {"sample_id": "locustio__locust__send_message__upstream__2hop_9ebd1e", "repo": "locustio/locust", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["start", "update_user_class", "handle_message"], "hop_1_files": ["private/tmp/repos/locustio__locust/locust/runners.py", "private/tmp/repos/locustio__locust/locust/env.py", "private/tmp/repos/locustio__locust/locust/runners.py"], "hop_2": ["heartbeat_worker", "update_user", "client_listener", "handle_message", "main"], "hop_2_files": ["private/tmp/repos/locustio__locust/locust/runners.py", "private/tmp/repos/locustio__locust/locust/web.py", "private/tmp/repos/locustio__locust/locust/runners.py", "private/tmp/repos/locustio__locust/locust/runners.py", "private/tmp/repos/locustio__locust/locust/main.py"]}, "metadata": {"anchor": "send_message", "anchor_file": "private/tmp/repos/locustio__locust/locust/runners.py", "anchor_source": "def send_message(self, msg_type: str, data: dict[str, Any] | None = None, client_id: str | None = None):\n \"\"\"\n Sends a message to attached worker node(s)\n\n :param msg_type: The type of the message to send\n :param data: Optional data to send\n :param client_id: Optional id of the target worker node.\n If None, will send to all attached workers\n \"\"\"\n if client_id:\n logger.debug(f\"Sending {msg_type} message to worker {client_id}\")\n self.server.send_to_client(Message(msg_type, data, client_id))\n else:\n for client in self.clients.all:\n logger.debug(f\"Sending {msg_type} message to worker {client.id}\")\n self.server.send_to_client(Message(msg_type, data, client.id))", "result_size": 5, "created_at": "2026-03-20T16:58:16.951273+00:00", "file_content": ""}} {"sample_id": "locustio__locust__parse_error__upstream__2hop_0e0399", "repo": "locustio/locust", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["serialize", "_getattr", "to_dict", "create_key", "_failures_data_rows"], "hop_1_files": ["private/tmp/repos/locustio__locust/locust/stats.py", "private/tmp/repos/locustio__locust/locust/stats.py", "private/tmp/repos/locustio__locust/locust/stats.py", "private/tmp/repos/locustio__locust/locust/stats.py", "private/tmp/repos/locustio__locust/locust/stats.py"], "hop_2": ["serialize_errors", "failures_csv", "stats_writer", "request_stats", "log_error"], "hop_2_files": ["private/tmp/repos/locustio__locust/locust/stats.py", "private/tmp/repos/locustio__locust/locust/stats.py", "private/tmp/repos/locustio__locust/locust/stats.py", "private/tmp/repos/locustio__locust/locust/web.py", "private/tmp/repos/locustio__locust/locust/stats.py"]}, "metadata": {"anchor": "parse_error", "anchor_file": "private/tmp/repos/locustio__locust/locust/stats.py", "anchor_source": "@classmethod\n def parse_error(cls, error: Exception | str | None) -> str:\n if isinstance(error, str):\n string_error = error\n else:\n string_error = repr(error)\n target = \"object at 0x\"\n target_index = string_error.find(target)\n if target_index < 0:\n return string_error\n start = target_index + len(target) - 2\n end = string_error.find(\">\", start)\n if end < 0:\n return string_error\n hex_address = string_error[start:end]\n return string_error.replace(hex_address, \"0x....\")", "result_size": 5, "created_at": "2026-03-20T16:58:16.951273+00:00", "file_content": ""}} {"sample_id": "psf__requests__send__upstream__2hop_b8ff7a", "repo": "psf/requests", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["request"], "hop_1_files": ["private/tmp/repos/requests/src/requests/sessions.py"], "hop_2": ["delete", "get", "head", "patch", "put", "request", "post", "options"], "hop_2_files": ["private/tmp/repos/requests/src/requests/sessions.py", "private/tmp/repos/requests/src/requests/sessions.py", "private/tmp/repos/requests/src/requests/sessions.py", "private/tmp/repos/requests/src/requests/sessions.py", "private/tmp/repos/requests/src/requests/sessions.py", "private/tmp/repos/requests/src/requests/api.py", "private/tmp/repos/requests/src/requests/sessions.py", "private/tmp/repos/requests/src/requests/sessions.py"]}, "metadata": {"anchor": "send", "anchor_file": "private/tmp/repos/requests/src/requests/sessions.py", "anchor_source": "def send(self, request, **kwargs):\n \"\"\"Send a given PreparedRequest.\n\n :rtype: requests.Response\n \"\"\"\n # Set defaults that the hooks can utilize to ensure they always have\n # the correct parameters to reproduce the previous request.\n kwargs.setdefault(\"stream\", self.stream)\n kwargs.setdefault(\"verify\", self.verify)\n kwargs.setdefault(\"cert\", self.cert)\n if \"proxies\" not in kwargs:\n kwargs[\"proxies\"] = resolve_proxies(request, self.proxies, self.trust_env)\n\n # It's possible that users might accidentally send a Request object.\n # Guard against that specific failure case.\n if isinstance(request, Request):\n raise ValueError(\"You can only send PreparedRequests.\")\n\n # Set up variables needed for resolve_redirects and dispatching of hooks\n allow_redirects = kwargs.pop(\"allow_redirects\", True)\n stream = kwargs.get(\"stream\")\n hooks = request.hooks\n\n # Get the appropriate adapter to use\n adapter = self.get_adapter(url=request.url)\n\n # Start time (approximately) of the request\n start = preferred_clock()\n\n # Send the request\n r = adapter.send(request, **kwargs)\n\n # Total elapsed time of the request (approximately)\n elapsed = preferred_clock() - start\n r.elapsed = timedelta(seconds=elapsed)\n\n # Response manipulation hooks\n r = dispatch_hook(\"response\", hooks, r, **kwargs)\n\n # Persist cookies\n if r.history:\n # If the hooks create history then we want those cookies too\n for resp in r.history:\n extract_cookies_to_jar(self.cookies, resp.request, resp.raw)\n\n extract_cookies_to_jar(self.cookies, request, r.raw)\n\n # Resolve redirects if allowed.\n if allow_redirects:\n # Redirect resolving generator.\n gen = self.resolve_redirects(r, request, **kwargs)\n history = [resp for resp in gen]\n else:\n history = []\n\n # Shuffle things around if there's history.\n if history:\n # Insert the first (original) request at the start\n history.insert(0, r)\n # Get the last request made\n r = history.pop()\n r.history = history\n\n # If redirects aren't being followed, store the response on the Request for Response.next().\n if not allow_redirects:\n try:\n r._next = next(\n self.resolve_redirects(r, request, yield_requests=True, **kwargs)\n )\n except StopIteration:\n pass\n\n if not stream:\n r.content\n\n return r", "result_size": 8, "created_at": "2026-03-20T16:58:17.570287+00:00", "file_content": "\"\"\"\nrequests.sessions\n~~~~~~~~~~~~~~~~~\n\nThis module provides a Session object to manage and persist settings across\nrequests (cookies, auth, proxies).\n\"\"\"\n\nimport os\nimport sys\nimport time\nfrom collections import OrderedDict\nfrom datetime import timedelta\n\nfrom ._internal_utils import to_native_string\nfrom .adapters import HTTPAdapter\nfrom .auth import _basic_auth_str\nfrom .compat import Mapping, cookielib, urljoin, urlparse\nfrom .cookies import (\n RequestsCookieJar,\n cookiejar_from_dict,\n extract_cookies_to_jar,\n merge_cookies,\n)\nfrom .exceptions import (\n ChunkedEncodingError,\n ContentDecodingError,\n InvalidSchema,\n TooManyRedirects,\n)\nfrom .hooks import default_hooks, dispatch_hook\n\n# formerly defined here, reexposed here for backward compatibility\nfrom .models import ( # noqa: F401\n DEFAULT_REDIRECT_LIMIT,\n REDIRECT_STATI,\n PreparedRequest,\n Request,\n)\nfrom .status_codes import codes\nfrom .structures import CaseInsensitiveDict\nfrom .utils import ( # noqa: F401\n DEFAULT_PORTS,\n default_headers,\n get_auth_from_url,\n get_environ_proxies,\n get_netrc_auth,\n requote_uri,\n resolve_proxies,\n rewind_body,\n should_bypass_proxies,\n to_key_val_list,\n)\n\n# Preferred clock, based on which one is more accurate on a given system.\nif sys.platform == \"win32\":\n preferred_clock = time.perf_counter\nelse:\n preferred_clock = time.time\n\n\ndef merge_setting(request_setting, session_setting, dict_class=OrderedDict):\n \"\"\"Determines appropriate setting for a given request, taking into account\n the explicit setting on that request, and the setting in the session. If a\n setting is a dictionary, they will be merged together using `dict_class`\n \"\"\"\n\n if session_setting is None:\n return request_setting\n\n if request_setting is None:\n return session_setting\n\n # Bypass if not a dictionary (e.g. verify)\n if not (\n isinstance(session_setting, Mapping) and isinstance(request_setting, Mapping)\n ):\n return request_setting\n\n merged_setting = dict_class(to_key_val_list(session_setting))\n merged_setting.update(to_key_val_list(request_setting))\n\n # Remove keys that are set to None. Extract keys first to avoid altering\n # the dictionary during iteration.\n none_keys = [k for (k, v) in merged_setting.items() if v is None]\n for key in none_keys:\n del merged_setting[key]\n\n return merged_setting\n\n\ndef merge_hooks(request_hooks, session_hooks, dict_class=OrderedDict):\n \"\"\"Properly merges both requests and session hooks.\n\n This is necessary because when request_hooks == {'response': []}, the\n merge breaks Session hooks entirely.\n \"\"\"\n if session_hooks is None or session_hooks.get(\"response\") == []:\n return request_hooks\n\n if request_hooks is None or request_hooks.get(\"response\") == []:\n return session_hooks\n\n return merge_setting(request_hooks, session_hooks, dict_class)\n\n\nclass SessionRedirectMixin:\n def get_redirect_target(self, resp):\n \"\"\"Receives a Response. Returns a redirect URI or ``None``\"\"\"\n # Due to the nature of how requests processes redirects this method will\n # be called at least once upon the original response and at least twice\n # on each subsequent redirect response (if any).\n # If a custom mixin is used to handle this logic, it may be advantageous\n # to cache the redirect location onto the response object as a private\n # attribute.\n if resp.is_redirect:\n location = resp.headers[\"location\"]\n # Currently the underlying http module on py3 decode headers\n # in latin1, but empirical evidence suggests that latin1 is very\n # rarely used with non-ASCII characters in HTTP headers.\n # It is more likely to get UTF8 header rather than latin1.\n # This causes incorrect handling of UTF8 encoded location headers.\n # To solve this, we re-encode the location in latin1.\n location = location.encode(\"latin1\")\n return to_native_string(location, \"utf8\")\n return None\n\n def should_strip_auth(self, old_url, new_url):\n \"\"\"Decide whether Authorization header should be removed when redirecting\"\"\"\n old_parsed = urlparse(old_url)\n new_parsed = urlparse(new_url)\n if old_parsed.hostname != new_parsed.hostname:\n return True\n # Special case: allow http -> https redirect when using the standard\n # ports. This isn't specified by RFC 7235, but is kept to avoid\n # breaking backwards compatibility with older versions of requests\n # that allowed any redirects on the same host.\n if (\n old_parsed.scheme == \"http\"\n and old_parsed.port in (80, None)\n and new_parsed.scheme == \"https\"\n and new_parsed.port in (443, None)\n ):\n return False\n\n # Handle default port usage corresponding to scheme.\n changed_port = old_parsed.port != new_parsed.port\n changed_scheme = old_parsed.scheme != new_parsed.scheme\n default_port = (DEFAULT_PORTS.get(old_parsed.scheme, None), None)\n if (\n not changed_scheme\n and old_parsed.port in default_port\n and new_parsed.port in default_port\n ):\n return False\n\n # Standard case: root URI must match\n return changed_port or changed_scheme\n\n def resolve_redirects(\n self,\n resp,\n req,\n stream=False,\n timeout=None,\n verify=True,\n cert=None,\n proxies=None,\n yield_requests=False,\n **adapter_kwargs,\n ):\n \"\"\"Receives a Response. Returns a generator of Responses or Requests.\"\"\"\n\n hist = [] # keep track of history\n\n url = self.get_redirect_target(resp)\n previous_fragment = urlparse(req.url).fragment\n while url:\n prepared_request = req.copy()\n\n # Update history and keep track of redirects.\n # resp.history must ignore the original request in this loop\n hist.append(resp)\n resp.history = hist[1:]\n\n try:\n resp.content # Consume socket so it can be released\n except (ChunkedEncodingError, ContentDecodingError, RuntimeError):\n resp.raw.read(decode_content=False)\n\n if len(resp.history) >= self.max_redirects:\n raise TooManyRedirects(\n f\"Exceeded {self.max_redirects} redirects.\", response=resp\n )\n\n # Release the connection back into the pool.\n resp.close()\n\n # Handle redirection without scheme (see: RFC 1808 Section 4)\n if url.startswith(\"//\"):\n parsed_rurl = urlparse(resp.url)\n url = \":\".join([to_native_string(parsed_rurl.scheme), url])\n\n # Normalize url case and attach previous fragment if needed (RFC 7231 7.1.2)\n parsed = urlparse(url)\n if parsed.fragment == \"\" and previous_fragment:\n parsed = parsed._replace(fragment=previous_fragment)\n elif parsed.fragment:\n previous_fragment = parsed.fragment\n url = parsed.geturl()\n\n # Facilitate relative 'location' headers, as allowed by RFC 7231.\n # (e.g. '/path/to/resource' instead of 'http://domain.tld/path/to/resource')\n # Compliant with RFC3986, we percent encode the url.\n if not parsed.netloc:\n url = urljoin(resp.url, requote_uri(url))\n else:\n url = requote_uri(url)\n\n prepared_request.url = to_native_string(url)\n\n self.rebuild_method(prepared_request, resp)\n\n # https://github.com/psf/requests/issues/1084\n if resp.status_code not in (\n codes.temporary_redirect,\n codes.permanent_redirect,\n ):\n \n# \u2026 (truncated at 8000 chars)"}} {"sample_id": "python-poetry__poetry__find__downstream__2hop_1e5b5d", "repo": "python-poetry/poetry", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["_path_method_wrapper", "SitePackages"], "hop_1_files": ["private/tmp/repos/python-poetry__poetry/src/poetry/utils/env/site_packages.py", "private/tmp/repos/python-poetry__poetry/src/poetry/utils/env/site_packages.py"], "hop_2": ["make_candidates"], "hop_2_files": ["private/tmp/repos/python-poetry__poetry/src/poetry/utils/env/site_packages.py"]}, "metadata": {"anchor": "find", "anchor_file": "private/tmp/repos/python-poetry__poetry/src/poetry/utils/env/site_packages.py", "anchor_source": "def find(\n self,\n path: Path,\n writable_only: bool = False,\n ) -> list[Path]:\n return [\n value[0]\n for value in self._path_method_wrapper(\n path, \"exists\", return_first=False, writable_only=writable_only\n )\n if value[-1] is True\n ]", "result_size": 1, "created_at": "2026-03-20T16:58:17.758794+00:00"}} {"sample_id": "scrapy__scrapy___check_components__downstream__2hop_4c33f2", "repo": "scrapy/scrapy", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["build_component_list"], "hop_1_files": ["private/tmp/repos/scrapy__scrapy/scrapy/utils/conf.py"], "hop_2": ["_map_keys", "_validate_values"], "hop_2_files": ["private/tmp/repos/scrapy__scrapy/scrapy/utils/conf.py", "private/tmp/repos/scrapy__scrapy/scrapy/utils/conf.py"]}, "metadata": {"anchor": "_check_components", "anchor_file": "private/tmp/repos/scrapy__scrapy/scrapy/utils/conf.py", "anchor_source": "def _check_components(complist: Collection[Any]) -> None:\n if len({convert(c) for c in complist}) != len(complist):\n raise ValueError(\n f\"Some paths in {complist!r} convert to the same object, \"\n \"please update your settings\"\n )", "result_size": 2, "created_at": "2026-03-20T16:58:17.996583+00:00"}} {"sample_id": "python-poetry__poetry___clone_submodules__downstream__1hop_3c17ac", "repo": "python-poetry/poetry", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["clone", "_get_submodules"], "call_files": ["private/tmp/repos/python-poetry__poetry/src/poetry/vcs/git/backend.py", "private/tmp/repos/python-poetry__poetry/src/poetry/vcs/git/backend.py"]}, "metadata": {"anchor": "_clone_submodules", "anchor_file": "private/tmp/repos/python-poetry__poetry/src/poetry/vcs/git/backend.py", "anchor_source": "@classmethod\n def _clone_submodules(cls, repo: Repo) -> None:\n \"\"\"\n Helper method to identify configured submodules and clone them recursively.\n \"\"\"\n repo_root = Path(repo.path)\n for submodule in cls._get_submodules(repo):\n path_absolute = repo_root / submodule.path\n source_root = path_absolute.parent\n source_root.mkdir(parents=True, exist_ok=True)\n cls.clone(\n url=submodule.url,\n source_root=source_root,\n name=path_absolute.name,\n revision=submodule.revision,\n clean=path_absolute.exists()\n and not path_absolute.joinpath(\".git\").is_dir(),\n )", "result_size": 2, "created_at": "2026-03-20T16:58:17.758794+00:00"}} {"sample_id": "celery__celery___do_enter__downstream__1hop_e2c0cb", "repo": "celery/celery", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["ensure_started"], "call_files": ["private/tmp/repos/celery/celery/utils/timer2.py"]}, "metadata": {"anchor": "_do_enter", "anchor_file": "private/tmp/repos/celery/celery/utils/timer2.py", "anchor_source": "def _do_enter(self, meth: str, *args: Any, **kwargs: Any) -> Entry:\n self.ensure_started()\n with self.mutex:\n entry = getattr(self.schedule, meth)(*args, **kwargs)\n self.not_empty.notify()\n return entry", "result_size": 1, "created_at": "2026-03-20T16:58:16.326235+00:00"}} {"sample_id": "trpc__trpc__getClientArgs__upstream__2hop_8e0351", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["useQuery", "useMutation", "fetchQuery", "usePrefetchQuery", "fetchInfiniteQuery", "queryFn", "prefetchQuery", "setMutationDefaults", "useSuspenseQuery", "infiniteQueryOptions", "ensureQueryData", "queryOptions", "usePrefetchInfiniteQuery", "useInfiniteQuery", "prefetchInfiniteQuery", "createUtilityFunctions", "useSuspenseInfiniteQuery", "mutationFn"], "hop_1_files": ["private/tmp/repos/trpc__trpc/packages/react-query/src/shared/hooks/createHooksInternal.tsx", "private/tmp/repos/trpc__trpc/packages/react-query/src/shared/hooks/createHooksInternal.tsx", "private/tmp/repos/trpc__trpc/packages/react-query/src/utils/createUtilityFunctions.ts", "private/tmp/repos/trpc__trpc/packages/react-query/src/shared/hooks/createHooksInternal.tsx", "private/tmp/repos/trpc__trpc/packages/react-query/src/utils/createUtilityFunctions.ts", "private/tmp/repos/trpc__trpc/packages/react-query/src/utils/createUtilityFunctions.ts", "private/tmp/repos/trpc__trpc/packages/react-query/src/utils/createUtilityFunctions.ts", "private/tmp/repos/trpc__trpc/packages/react-query/src/utils/createUtilityFunctions.ts", "private/tmp/repos/trpc__trpc/packages/react-query/src/shared/hooks/createHooksInternal.tsx", "private/tmp/repos/trpc__trpc/packages/react-query/src/utils/createUtilityFunctions.ts", "private/tmp/repos/trpc__trpc/packages/react-query/src/utils/createUtilityFunctions.ts", "private/tmp/repos/trpc__trpc/packages/react-query/src/utils/createUtilityFunctions.ts", "private/tmp/repos/trpc__trpc/packages/react-query/src/shared/hooks/createHooksInternal.tsx", "private/tmp/repos/trpc__trpc/packages/react-query/src/shared/hooks/createHooksInternal.tsx", "private/tmp/repos/trpc__trpc/packages/react-query/src/utils/createUtilityFunctions.ts", "private/tmp/repos/trpc__trpc/packages/react-query/src/utils/createUtilityFunctions.ts", "private/tmp/repos/trpc__trpc/packages/react-query/src/shared/hooks/createHooksInternal.tsx", "private/tmp/repos/trpc__trpc/packages/react-query/src/shared/hooks/createHooksInternal.tsx"], "hop_2": ["createRootHooks", "createTRPCQueryUtils"], "hop_2_files": ["private/tmp/repos/trpc__trpc/packages/react-query/src/shared/hooks/createHooksInternal.tsx", "private/tmp/repos/trpc__trpc/packages/react-query/src/createTRPCQueryUtils.tsx"]}, "metadata": {"anchor": "getClientArgs", "anchor_file": "private/tmp/repos/trpc__trpc/packages/react-query/src/internals/getClientArgs.ts", "anchor_source": "export function getClientArgs(\n queryKey: TRPCQueryKey,\n opts: TOptions,\n infiniteParams?: {\n pageParam: any;\n direction: 'forward' | 'backward';\n },\n) {\n const path = queryKey[0];\n let input = queryKey[1]?.input;\n if (infiniteParams) {\n input = {\n ...(input ?? {}),\n ...(infiniteParams.pageParam ? { cursor: infiniteParams.pageParam } : {}),\n direction: infiniteParams.direction,\n };\n }\n return [path.join('.'), input, (opts as any)?.trpc] as const;\n}", "result_size": 3, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "locustio__locust__get_parser__downstream__1hop_822e29", "repo": "locustio/locust", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["setup_parser_arguments", "get_empty_argument_parser"], "call_files": ["private/tmp/repos/locustio__locust/locust/argument_parser.py", "private/tmp/repos/locustio__locust/locust/argument_parser.py"]}, "metadata": {"anchor": "get_parser", "anchor_file": "private/tmp/repos/locustio__locust/locust/argument_parser.py", "anchor_source": "def get_parser(default_config_files=DEFAULT_CONFIG_FILES) -> LocustArgumentParser:\n # get a parser that is only able to parse the -f argument\n parser = get_empty_argument_parser(add_help=True, default_config_files=default_config_files)\n # add all the other supported arguments\n setup_parser_arguments(parser)\n # fire event to provide a hook for locustscripts and plugins to add command line arguments\n locust.events.init_command_line_parser.fire(parser=parser)\n return parser", "result_size": 2, "created_at": "2026-03-20T16:58:16.951273+00:00"}} {"sample_id": "sindresorhus__got__dnsCache__downstream__2hop_7aa160", "repo": "sindresorhus/got", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["dnsCache", "assertAny"], "hop_1_files": ["private/tmp/repos/got/source/core/options.ts", "private/tmp/repos/got/source/core/options.ts"], "hop_2": ["wrapAssertionWithContext"], "hop_2_files": ["private/tmp/repos/got/source/core/options.ts"]}, "metadata": {"anchor": "dnsCache", "anchor_file": "private/tmp/repos/got/source/core/options.ts", "anchor_source": "set dnsCache(value: CacheableLookup | boolean | undefined) {\n\t\tassertAny('dnsCache', [is.object, is.boolean, is.undefined], value);\n\n\t\tif (value === true) {\n\t\t\tthis.#internals.dnsCache = getGlobalDnsCache();\n\t\t} else if (value === false) {\n\t\t\tthis.#internals.dnsCache = undefined;\n\t\t} else {\n\t\t\tthis.#internals.dnsCache = value;\n\t\t}\n\t}", "result_size": 1, "created_at": "2026-03-20T16:58:18.104721+00:00"}} {"sample_id": "immerjs__immer__childCleanup__downstream__2hop_563133", "repo": "immerjs/immer", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["updateDraftInParent", "generatePatchesAndFinalize"], "hop_1_files": ["private/tmp/repos/immerjs__immer/src/core/finalize.ts", "private/tmp/repos/immerjs__immer/src/core/finalize.ts"], "hop_2": ["markStateFinalized", "each"], "hop_2_files": ["private/tmp/repos/immerjs__immer/src/core/finalize.ts", "private/tmp/repos/immerjs__immer/src/utils/common.ts"]}, "metadata": {"anchor": "childCleanup", "anchor_file": "private/tmp/repos/immerjs__immer/src/core/finalize.ts", "anchor_source": "parent.callbacks_.push(function childCleanup(rootScope) {\n\t\tconst state: ImmerState = child\n\n\t\t// Can only continue if this is a draft owned by this scope\n\t\tif (!state || !isSameScope(state, rootScope)) {\n\t\t\treturn\n\t\t}\n\n\t\t// Handle potential set value finalization first\n\t\trootScope.mapSetPlugin_?.fixSetContents(state)\n\n\t\tconst finalizedValue = getFinalValue(state)\n\n\t\t// Update all locations in the parent that referenced this draft\n\t\tupdateDraftInParent(parent, state.draft_ ?? state, finalizedValue, key)\n\n\t\tgeneratePatchesAndFinalize(state, rootScope)\n\t})", "result_size": 2, "created_at": "2026-03-20T16:58:16.801413+00:00"}} {"sample_id": "scrapy__scrapy__from_args__downstream__1hop_a98542", "repo": "scrapy/scrapy", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["from_filename", "from_body", "from_headers"], "call_files": ["private/tmp/repos/scrapy__scrapy/scrapy/responsetypes.py", "private/tmp/repos/scrapy__scrapy/scrapy/responsetypes.py", "private/tmp/repos/scrapy__scrapy/scrapy/responsetypes.py"]}, "metadata": {"anchor": "from_args", "anchor_file": "private/tmp/repos/scrapy__scrapy/scrapy/responsetypes.py", "anchor_source": "def from_args(\n self,\n headers: Mapping[bytes, bytes] | None = None,\n url: str | None = None,\n filename: str | None = None,\n body: bytes | None = None,\n ) -> type[Response]:\n \"\"\"Guess the most appropriate Response class based on\n the given arguments.\"\"\"\n cls = Response\n if headers is not None:\n cls = self.from_headers(headers)\n if cls is Response and url is not None:\n cls = self.from_filename(url)\n if cls is Response and filename is not None:\n cls = self.from_filename(filename)\n if cls is Response and body is not None:\n cls = self.from_body(body)\n return cls", "result_size": 3, "created_at": "2026-03-20T16:58:17.996583+00:00"}} {"sample_id": "trpc__trpc__createTRPCUntypedClient__upstream__1hop_4d9060", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["experimental_createActionHook", "getInitialProps"], "call_files": ["private/tmp/repos/trpc__trpc/packages/next/src/app-dir/create-action-hook.tsx", "private/tmp/repos/trpc__trpc/packages/next/src/ssrPrepass.ts"]}, "metadata": {"anchor": "createTRPCUntypedClient", "anchor_file": "private/tmp/repos/trpc__trpc/packages/client/src/createTRPCUntypedClient.ts", "anchor_source": "export function createTRPCUntypedClient(\n opts: CreateTRPCClientOptions,\n): TRPCUntypedClient {\n return new TRPCUntypedClient(opts);\n}", "result_size": 2, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "locustio__locust__get_current_response_time_percentile__upstream__1hop_90ed5c", "repo": "locustio/locust", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["update_stats_history", "request_stats", "_percentile_fields"], "call_files": ["private/tmp/repos/locustio__locust/locust/stats.py", "private/tmp/repos/locustio__locust/locust/web.py", "private/tmp/repos/locustio__locust/locust/stats.py"]}, "metadata": {"anchor": "get_current_response_time_percentile", "anchor_file": "private/tmp/repos/locustio__locust/locust/stats.py", "anchor_source": "def get_current_response_time_percentile(self, percent: float) -> int | None:\n \"\"\"\n Calculate the *current* response time for a certain percentile. We use a sliding\n window of (approximately) the last 10 seconds (specified by CURRENT_RESPONSE_TIME_PERCENTILE_WINDOW)\n when calculating this.\n \"\"\"\n if not self.use_response_times_cache:\n raise ValueError(\n \"StatsEntry.use_response_times_cache must be set to True to calculate the _current_ response time percentile\"\n )\n # First, we want to determine which of the cached response_times dicts we should\n # use to get response_times for approximately 10 seconds ago.\n t = int(time.time())\n # Since we can't be sure that the cache contains an entry for every second.\n # We'll construct a list of timestamps which we consider acceptable keys to be used\n # when trying to fetch the cached response_times. We construct this list in such a way\n # that it's ordered by preference by starting to add t-10, then t-11, t-9, t-12, t-8,\n # and so on\n acceptable_timestamps: list[int] = []\n acceptable_timestamps.append(t - CURRENT_RESPONSE_TIME_PERCENTILE_WINDOW)\n for i in range(1, 9):\n acceptable_timestamps.append(t - CURRENT_RESPONSE_TIME_PERCENTILE_WINDOW - i)\n acceptable_timestamps.append(t - CURRENT_RESPONSE_TIME_PERCENTILE_WINDOW + i)\n\n cached: CachedResponseTimes | None = None\n if self.response_times_cache is not None:\n for ts in acceptable_timestamps:\n if ts in self.response_times_cache:\n cached = self.response_times_cache[ts]\n break\n\n if cached:\n # If we found an acceptable cached response times, we'll calculate a new response\n # times dict of the last 10 seconds (approximately) by diffing it with the current\n # total response times. Then we'll use that to calculate a response time percentile\n # for that timeframe\n return calculate_response_time_percentile(\n diff_response_time_dicts(self.response_times, cached.response_times),\n self.num_requests - cached.num_requests,\n percent,\n )\n # if time was not in response times cache window\n return None", "result_size": 3, "created_at": "2026-03-20T16:58:16.951273+00:00", "file_content": ""}} {"sample_id": "trpc__trpc__createTRPCOptionsResult__upstream__1hop_aee4c0", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["createUtilityFunctions", "infiniteQueryOptions", "queryOptions", "useHookResult"], "call_files": ["private/tmp/repos/trpc__trpc/packages/react-query/src/utils/createUtilityFunctions.ts", "private/tmp/repos/trpc__trpc/packages/react-query/src/utils/createUtilityFunctions.ts", "private/tmp/repos/trpc__trpc/packages/react-query/src/utils/createUtilityFunctions.ts", "private/tmp/repos/trpc__trpc/packages/react-query/src/internals/trpcResult.ts"]}, "metadata": {"anchor": "createTRPCOptionsResult", "anchor_file": "private/tmp/repos/trpc__trpc/packages/react-query/src/internals/trpcResult.ts", "anchor_source": "export function createTRPCOptionsResult(value: {\n path: readonly string[];\n}): TRPCQueryOptionsResult['trpc'] {\n const path = value.path.join('.');\n\n return {\n path,\n };\n}", "result_size": 4, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "encode__httpx__head__downstream__2hop_f06070", "repo": "encode/httpx", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["request"], "hop_1_files": ["private/tmp/repos/encode__httpx/httpx/_client.py"], "hop_2": ["send", "build_request"], "hop_2_files": ["private/tmp/repos/encode__httpx/httpx/_client.py", "private/tmp/repos/encode__httpx/httpx/_client.py"]}, "metadata": {"anchor": "head", "anchor_file": "private/tmp/repos/encode__httpx/httpx/_client.py", "anchor_source": "async def head(\n self,\n url: URL | str,\n *,\n params: QueryParamTypes | None = None,\n headers: HeaderTypes | None = None,\n cookies: CookieTypes | None = None,\n auth: AuthTypes | UseClientDefault = USE_CLIENT_DEFAULT,\n follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,\n timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,\n extensions: RequestExtensions | None = None,\n ) -> Response:\n \"\"\"\n Send a `HEAD` request.\n\n **Parameters**: See `httpx.request`.\n \"\"\"\n return await self.request(\n \"HEAD\",\n url,\n params=params,\n headers=headers,\n cookies=cookies,\n auth=auth,\n follow_redirects=follow_redirects,\n timeout=timeout,\n extensions=extensions,\n )", "result_size": 2, "created_at": "2026-03-20T16:58:16.700579+00:00"}} {"sample_id": "scrapy__scrapy___serialize_value__downstream__1hop_906c4b", "repo": "scrapy/scrapy", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["_serialize_item", "export_item"], "call_files": ["private/tmp/repos/scrapy__scrapy/scrapy/exporters.py", "private/tmp/repos/scrapy__scrapy/scrapy/exporters.py"]}, "metadata": {"anchor": "_serialize_value", "anchor_file": "private/tmp/repos/scrapy__scrapy/scrapy/exporters.py", "anchor_source": "def _serialize_value(self, value: Any) -> Any:\n if isinstance(value, Item):\n return self.export_item(value)\n if isinstance(value, (str, bytes)):\n return to_unicode(value, encoding=self.encoding)\n if is_item(value):\n return dict(self._serialize_item(value))\n if is_listlike(value):\n return [self._serialize_value(v) for v in value]\n return value", "result_size": 2, "created_at": "2026-03-20T16:58:17.996583+00:00"}} {"sample_id": "sindresorhus__got__merge__upstream__1hop_3c4d8e", "repo": "sindresorhus/got", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["asPromise", "constructor", "extend"], "call_files": ["private/tmp/repos/got/source/as-promise/index.ts", "private/tmp/repos/got/source/core/options.ts", "private/tmp/repos/got/source/create.ts"]}, "metadata": {"anchor": "merge", "anchor_file": "private/tmp/repos/got/source/core/options.ts", "anchor_source": "merge(options?: OptionsInit | Options) {\n\t\tif (!options) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (options instanceof Options) {\n\t\t\t// Create a copy of the #init array to avoid infinite loop\n\t\t\t// when merging an Options instance with itself\n\t\t\tconst initArray = [...options.#init];\n\t\t\tfor (const init of initArray) {\n\t\t\t\tthis.merge(init);\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\toptions = cloneRaw(options);\n\n\t\tinit(this, options, this);\n\t\tinit(options, options, this);\n\n\t\tthis.#merging = true;\n\n\t\ttry {\n\t\t\tlet push = false;\n\n\t\t\tfor (const key in options) {\n\t\t\t\t// `got.extend()` options\n\t\t\t\tif (key === 'mutableDefaults' || key === 'handlers') {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Never merge `url`\n\t\t\t\tif (key === 'url') {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Never merge `preserveHooks` - it's a control flag, not a persistent option\n\t\t\t\tif (key === 'preserveHooks') {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// `isStream` is set internally by `got.stream()`, not by user options\n\t\t\t\tif (key === 'isStream') {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (!(key in this)) {\n\t\t\t\t\tthrow new Error(`Unexpected option: ${key}`);\n\t\t\t\t}\n\n\t\t\t\t// @ts-expect-error Type 'unknown' is not assignable to type 'never'.\n\t\t\t\tconst value = options[key as keyof Options];\n\t\t\t\tif (value === undefined) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// @ts-expect-error Type 'unknown' is not assignable to type 'never'.\n\t\t\t\tthis[key as keyof Options] = value;\n\n\t\t\t\tpush = true;\n\t\t\t}\n\n\t\t\tif (push) {\n\t\t\t\tthis.#init.push(options);\n\t\t\t}\n\t\t} finally {\n\t\t\tthis.#merging = false;\n\t\t}\n\t}", "result_size": 7, "created_at": "2026-03-20T16:58:18.104721+00:00", "file_content": "import process from 'node:process';\nimport {promisify, inspect, type InspectOptions} from 'node:util';\nimport {checkServerIdentity, type SecureContextOptions, type DetailedPeerCertificate} from 'node:tls';\n// DO NOT use destructuring for `https.request` and `http.request` as it's not compatible with `nock`.\nimport https, {\n\ttype RequestOptions as HttpsRequestOptions,\n\ttype Agent as HttpsAgent,\n} from 'node:https';\nimport http, {\n\ttype Agent as HttpAgent,\n\ttype ClientRequest,\n} from 'node:http';\nimport type {Readable} from 'node:stream';\nimport type {Socket, LookupFunction} from 'node:net';\nimport is, {assert} from '@sindresorhus/is';\nimport lowercaseKeys from 'lowercase-keys';\nimport CacheableLookup from 'cacheable-lookup';\nimport http2wrapper, {type ClientHttp2Session} from 'http2-wrapper';\nimport type {KeyvStoreAdapter} from 'keyv';\nimport type KeyvType from 'keyv';\nimport type ResponseLike from 'responselike';\nimport type {RequestPromise} from '../as-promise/types.js';\nimport type {IncomingMessageWithTimings} from './utils/timer.js';\nimport parseLinkHeader from './parse-link-header.js';\nimport type {PlainResponse, Response} from './response.js';\nimport type {RequestError} from './errors.js';\nimport type {Delays} from './timed-out.js';\n\ntype StorageAdapter = KeyvStoreAdapter | KeyvType | Map;\n\ntype Promisable = T | Promise;\n\nconst [major, minor] = process.versions.node.split('.').map(Number) as [number, number, number];\n\nexport type DnsLookupIpVersion = undefined | 4 | 6;\n\ntype Except = Pick>;\n\nexport type NativeRequestOptions = HttpsRequestOptions & CacheOptions & {checkServerIdentity?: CheckServerIdentityFunction};\n\ntype AcceptableResponse = IncomingMessageWithTimings | ResponseLike;\ntype AcceptableRequestResult = Promisable;\nexport type RequestFunction = (url: URL, options: NativeRequestOptions, callback?: (response: AcceptableResponse) => void) => AcceptableRequestResult;\n\nexport type Agents = {\n\thttp?: HttpAgent | false;\n\thttps?: HttpsAgent | false;\n\thttp2?: unknown | false;\n};\n\nexport type Headers = Record;\n\nexport type ToughCookieJar = {\n\tgetCookieString: ((currentUrl: string, options: Record, callback: (error: Error | undefined, cookies: string) => void) => void)\n\t\t& ((url: string, callback: (error: Error | undefined, cookieHeader: string) => void) => void);\n\tsetCookie: ((cookieOrString: unknown, currentUrl: string, options: Record, callback: (error: Error | undefined, cookie: unknown) => void) => void)\n\t\t& ((rawCookie: string, url: string, callback: (error: Error | undefined, result: unknown) => void) => void);\n};\n\nexport type PromiseCookieJar = {\n\tgetCookieString: (url: string) => Promise;\n\tsetCookie: (rawCookie: string, url: string) => Promise;\n};\n\n/**\nUtility type to override specific properties in a type.\n\nUses `Omit` to remove properties before adding them back to ensure proper type replacement rather than intersection, which handles edge cases with optional/required properties correctly.\n*/\ntype OverrideProperties = Omit & U;\n\n/**\nRepresents the runtime state of Options as seen by hooks after normalization.\n\nSome Options properties accept multiple input types but are normalized to a single type internally by the Options class setters. This type reflects the actual runtime types that hooks receive, ensuring type safety when accessing options within hook functions.\n*/\nexport type NormalizedOptions = OverrideProperties;\n\nexport type InitHook = (init: OptionsInit, self: Options) => void;\n\nexport type BeforeRequestHookContext = {\n\t/**\n\tThe current retry count.\n\n\tIt will be `0` for the initial request and increment for each retry.\n\t*/\n\tretryCount: number;\n};\n\nexport type BeforeRequestHook = (options: NormalizedOptions, context: BeforeRequestHookContext) => Promisable;\nexport type BeforeRedirectHook = (updatedOptions: NormalizedOptions, plainResponse: PlainResponse) => Promisable;\nexport type BeforeErrorHook = (error: RequestError) => Promisable;\nexport type BeforeRetryHook = (error: RequestError, retryCount: number) => Promisable;\nexport type BeforeCacheHook = (response: PlainResponse) => false | void;\nexport type AfterResponseHook = (response: Response, retryWithMergedOptions: (options: OptionsInit) => never) => Promisable>;\n\n/**\nAll available hooks of Got.\n*/\nexport type Hooks = {\n\t/**\n\tCalled with the plain request options, right before their normalization.\n\n\tThe second argument represents the current `Options` instance.\n\n\t@default []\n\n\t**Note:**\n\t> - This hook must be synchronous.\n\n\t**Note:**\n\t> - This is called every time options are merged.\n\n\t**Note:**\n\t> - The `options` object may not have the `url` property. To modify it, use a `beforeRequest` hook instead.\n\n\t**Note:**\n\t> - This hook is called when a new instance of `Options` is created.\n\t> - Do not confuse this with the creation of `Request` or `got(\u2026)`.\n\n\t**Note:**\n\t> - When using `got(url)` or `got(url, undefined, defaults)` this hook will **not** be called.\n\n\tThis is especially useful in conjunction with `got.extend()` when the input needs custom handling.\n\n\tFor example, this can be used to fix typos to migrate from older versions faster.\n\n\t@example\n\t```\n\timport got from 'got';\n\n\tconst instance = got.extend({\n\t\thooks: {\n\t\t\tinit: [\n\t\t\t\tplain => {\n\t\t\t\t\tif ('followRedirects' in plain) {\n\t\t\t\t\t\tplain.followRedirect = plain.followRedirects;\n\t\t\t\t\t\tdelete plain.followRedirects;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t});\n\n\t// Normally, the following would throw:\n\tconst response = await instance(\n\t\t'https://example.com',\n\t\t{\n\t\t\tfollowRedirects: true\n\t\t}\n\t);\n\n\t// There is no option named `followRedirects`, but we correct it in an `init` hook.\n\t```\n\n\tOr you can create your own option and store it in a context:\n\n\t```\n\timport got from 'got';\n\n\tconst instance = got.extend({\n\t\thooks: {\n\t\t\tinit: [\n\t\t\t\t(plain, options) => {\n\t\t\t\t\tif ('secret' in plain) {\n\t\t\t\t\t\toptions.context.secret = plain.secret;\n\t\t\t\t\t\tdelete plain.secret;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t],\n\t\t\tbeforeRequest: [\n\t\t\t\toptions => {\n\t\t\t\t\toptions.headers.secret = options.context.secret;\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t});\n\n\tconst {headers} = await instance(\n\t\t'https://httpbin.org/anything',\n\t\t{\n\t\t\tsecret: 'passphrase'\n\t\t}\n\t).json();\n\n\tconsole.log(headers.Secret);\n\t//=> 'passphrase'\n\t```\n\t*/\n\tinit: InitHook[];\n\n\t/**\n\tCalled right before making the request with `options.createNativeRequestOptions()`.\n\n\tThe second argument is a context object containing request state information.\n\n\tThis hook is especially useful in conjunction with `got.extend()` when you want to sign your request.\n\n\t@default []\n\n\t**Note:**\n\t> - Got will make no further changes to the request before it is sent.\n\n\t**Note:**\n\t> - Changing `options.json` or `options.form` has no effect on the request. You should change `options.body` instead. If needed, update the `options.headers` accordingly.\n\n\t@example\n\t```\n\timport got from 'got';\n\n\tconst response = await got.post(\n\t\t'https://httpbin.org/anything',\n\t\t{\n\t\t\tjson: {payload: 'old'},\n\t\t\thooks: {\n\t\t\t\tbeforeRequest: [\n\t\t\t\t\t(options, context) => {\n\t\t\t\t\t\toptions.body = JSON.stringify({payload: 'new'});\n\t\t\n# \u2026 (truncated at 8000 chars)"}} {"sample_id": "getpelican__pelican__get_files__downstream__1hop_ddd583", "repo": "getpelican/pelican", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["_include_path"], "call_files": ["private/tmp/repos/getpelican__pelican/pelican/generators.py"]}, "metadata": {"anchor": "get_files", "anchor_file": "private/tmp/repos/getpelican__pelican/pelican/generators.py", "anchor_source": "def get_files(\n self, paths, exclude: list[str] | None = None, extensions=None\n ) -> set[str]:\n \"\"\"Return a list of files to use, based on rules\n\n :param paths: the list pf paths to search (relative to self.path)\n :param exclude: the list of path to exclude\n :param extensions: the list of allowed extensions (if False, all\n extensions are allowed)\n \"\"\"\n if exclude is None:\n exclude = []\n # backward compatibility for older generators\n if isinstance(paths, str):\n paths = [paths]\n\n # group the exclude dir names by parent path, for use with os.walk()\n exclusions_by_dirpath = {}\n for e in exclude:\n parent_path, subdir = os.path.split(os.path.join(self.path, e))\n exclusions_by_dirpath.setdefault(parent_path, set()).add(subdir)\n\n files = set()\n ignores = self.settings[\"IGNORE_FILES\"]\n for path in paths:\n # careful: os.path.join() will add a slash when path == ''.\n root = os.path.join(self.path, path) if path else self.path\n\n if os.path.isdir(root):\n for dirpath, dirs, temp_files in os.walk(\n root, topdown=True, followlinks=True\n ):\n excl = exclusions_by_dirpath.get(dirpath, ())\n # We copy the `dirs` list as we will modify it in the loop:\n for d in list(dirs):\n if d in excl or any(\n fnmatch.fnmatch(d, ignore) for ignore in ignores\n ):\n if d in dirs:\n dirs.remove(d)\n\n reldir = os.path.relpath(dirpath, self.path)\n for f in temp_files:\n fp = os.path.join(reldir, f)\n if self._include_path(fp, extensions):\n files.add(fp)\n elif os.path.exists(root) and self._include_path(path, extensions):\n files.add(path) # can't walk non-directories\n return files", "result_size": 1, "created_at": "2026-03-20T16:58:16.756586+00:00"}} {"sample_id": "psf__black__generate_matches__downstream__1hop_c45763", "repo": "psf/black", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["_iterative_matches", "_recursive_matches", "_bare_name_matches"], "call_files": ["private/tmp/repos/psf__black/src/blib2to3/pytree.py", "private/tmp/repos/psf__black/src/blib2to3/pytree.py", "private/tmp/repos/psf__black/src/blib2to3/pytree.py"]}, "metadata": {"anchor": "generate_matches", "anchor_file": "private/tmp/repos/psf__black/src/blib2to3/pytree.py", "anchor_source": "def generate_matches(self, nodes) -> Iterator[tuple[int, _Results]]:\n \"\"\"\n Generator yielding matches for a sequence of nodes.\n\n Args:\n nodes: sequence of nodes\n\n Yields:\n (count, results) tuples where:\n count: the match comprises nodes[:count];\n results: dict containing named submatches.\n \"\"\"\n if self.content is None:\n # Shortcut for special case (see __init__.__doc__)\n for count in range(self.min, 1 + min(len(nodes), self.max)):\n r = {}\n if self.name:\n r[self.name] = nodes[:count]\n yield count, r\n elif self.name == \"bare_name\":\n yield self._bare_name_matches(nodes)\n else:\n # The reason for this is that hitting the recursion limit usually\n # results in some ugly messages about how RuntimeErrors are being\n # ignored. We only have to do this on CPython, though, because other\n # implementations don't have this nasty bug in the first place.\n if hasattr(sys, \"getrefcount\"):\n save_stderr = sys.stderr\n sys.stderr = StringIO()\n try:\n for count, r in self._recursive_matches(nodes, 0):\n if self.name:\n r[self.name] = nodes[:count]\n yield count, r\n except RuntimeError:\n # We fall back to the iterative pattern matching scheme if the recursive\n # scheme hits the recursion limit.\n for count, r in self._iterative_matches(nodes):\n if self.name:\n r[self.name] = nodes[:count]\n yield count, r\n finally:\n if hasattr(sys, \"getrefcount\"):\n sys.stderr = save_stderr", "result_size": 3, "created_at": "2026-03-20T16:58:17.494246+00:00"}} {"sample_id": "immerjs__immer__deepClonePatchValue__downstream__2hop_80c82c", "repo": "immerjs/immer", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["isDraftable", "deepClonePatchValue"], "hop_1_files": ["private/tmp/repos/immerjs__immer/src/utils/common.ts", "private/tmp/repos/immerjs__immer/src/plugins/patches.ts"], "hop_2": ["isPlainObject"], "hop_2_files": ["private/tmp/repos/immerjs__immer/src/utils/common.ts"]}, "metadata": {"anchor": "deepClonePatchValue", "anchor_file": "private/tmp/repos/immerjs__immer/src/plugins/patches.ts", "anchor_source": "function deepClonePatchValue(obj: any) {\n\t\tif (!isDraftable(obj)) return obj\n\t\tif (isArray(obj)) return obj.map(deepClonePatchValue)\n\t\tif (isMap(obj))\n\t\t\treturn new Map(\n\t\t\t\tArray.from(obj.entries()).map(([k, v]) => [k, deepClonePatchValue(v)])\n\t\t\t)\n\t\tif (isSet(obj)) return new Set(Array.from(obj).map(deepClonePatchValue))\n\t\tconst cloned = Object.create(getPrototypeOf(obj))\n\t\tfor (const key in obj) cloned[key] = deepClonePatchValue(obj[key])\n\t\tif (has(obj, immerable)) cloned[immerable] = obj[immerable]\n\t\treturn cloned\n\t}", "result_size": 1, "created_at": "2026-03-20T16:58:16.801413+00:00"}} {"sample_id": "python-poetry__poetry____post_init____downstream__2hop_f10165", "repo": "python-poetry/poetry", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["normalize"], "hop_1_files": ["private/tmp/repos/python-poetry__poetry/src/poetry/config/config.py"], "hop_2": ["is_reserved"], "hop_2_files": ["private/tmp/repos/python-poetry__poetry/src/poetry/config/config.py"]}, "metadata": {"anchor": "__post_init__", "anchor_file": "private/tmp/repos/python-poetry__poetry/src/poetry/config/config.py", "anchor_source": "def __post_init__(self, policy: str | list[str] | None) -> None:\n if not policy:\n policy = []\n elif isinstance(policy, str):\n policy = self.normalize(policy)\n self.packages = policy", "result_size": 1, "created_at": "2026-03-20T16:58:17.758794+00:00"}} {"sample_id": "immerjs__immer__getPlugin__downstream__1hop_c6cd21", "repo": "immerjs/immer", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["die"], "call_files": ["private/tmp/repos/immerjs__immer/src/utils/errors.ts"]}, "metadata": {"anchor": "getPlugin", "anchor_file": "private/tmp/repos/immerjs__immer/src/utils/plugins.ts", "anchor_source": "export function getPlugin(\n\tpluginKey: K\n): Exclude {\n\tconst plugin = plugins[pluginKey]\n\tif (!plugin) {\n\t\tdie(0, pluginKey)\n\t}\n\t// @ts-ignore\n\treturn plugin\n}", "result_size": 1, "created_at": "2026-03-20T16:58:16.801413+00:00"}} {"sample_id": "pallets__click__show__downstream__1hop_e3d15e", "repo": "pallets/click", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["echo", "format_message", "get_usage", "get_text_stderr", "get_help_option"], "call_files": ["private/tmp/repos/pallets__click/src/click/utils.py", "private/tmp/repos/pallets__click/src/click/exceptions.py", "private/tmp/repos/pallets__click/src/click/core.py", "private/tmp/repos/pallets__click/src/click/_compat.py", "private/tmp/repos/pallets__click/src/click/core.py"]}, "metadata": {"anchor": "show", "anchor_file": "private/tmp/repos/pallets__click/src/click/exceptions.py", "anchor_source": "def show(self, file: t.IO[t.Any] | None = None) -> None:\n if file is None:\n file = get_text_stderr()\n color = None\n hint = \"\"\n if (\n self.ctx is not None\n and self.ctx.command.get_help_option(self.ctx) is not None\n ):\n hint = _(\"Try '{command} {option}' for help.\").format(\n command=self.ctx.command_path, option=self.ctx.help_option_names[0]\n )\n hint = f\"{hint}\\n\"\n if self.ctx is not None:\n color = self.ctx.color\n echo(f\"{self.ctx.get_usage()}\\n{hint}\", file=file, color=color)\n echo(\n _(\"Error: {message}\").format(message=self.format_message()),\n file=file,\n color=color,\n )", "result_size": 5, "created_at": "2026-03-20T16:58:17.078639+00:00"}} {"sample_id": "locustio__locust__update_user_class__upstream__1hop_02bc18", "repo": "locustio/locust", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["update_user", "main", "handle_message"], "call_files": ["private/tmp/repos/locustio__locust/locust/web.py", "private/tmp/repos/locustio__locust/locust/main.py", "private/tmp/repos/locustio__locust/locust/runners.py"]}, "metadata": {"anchor": "update_user_class", "anchor_file": "private/tmp/repos/locustio__locust/locust/env.py", "anchor_source": "def update_user_class(self, user_settings):\n if isinstance(self.runner, MasterRunner):\n self.runner.send_message(\"update_user_class\", user_settings)\n\n user_class_name = user_settings.get(\"user_class_name\")\n user_class = self.available_user_classes[user_class_name]\n user_tasks = self.available_user_tasks[user_class_name]\n\n for key, value in user_settings.items():\n if key not in [\"user_class_name\", \"tasks\"]:\n setattr(user_class, key, value)\n if key == \"tasks\":\n user_class.tasks = [task for task in user_tasks if task.__name__ in value]", "result_size": 3, "created_at": "2026-03-20T16:58:16.951273+00:00", "file_content": ""}} {"sample_id": "colinhacks__zod___parse__downstream__2hop_d31118", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["_processInputParams", "_parse"], "hop_1_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"], "hop_2": ["ParseStatus"], "hop_2_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/helpers/parseUtil.ts"]}, "metadata": {"anchor": "_parse", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "anchor_source": "_parse(input: ParseInput): ParseReturnType {\n const { ctx } = this._processInputParams(input);\n let data = ctx.data;\n if (ctx.parsedType === ZodParsedType.undefined) {\n data = this._def.defaultValue();\n }\n return this._def.innerType._parse({\n data,\n path: ctx.path,\n parent: ctx,\n });\n }", "result_size": 1, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "getpelican__pelican__generate_context__downstream__1hop_ba2088", "repo": "getpelican/pelican", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["add_source_path", "_process", "_add_failed_source_path", "add_static_links", "_update_context", "get_files"], "call_files": ["private/tmp/repos/getpelican__pelican/pelican/generators.py", "private/tmp/repos/getpelican__pelican/pelican/generators.py", "private/tmp/repos/getpelican__pelican/pelican/generators.py", "private/tmp/repos/getpelican__pelican/pelican/generators.py", "private/tmp/repos/getpelican__pelican/pelican/generators.py", "private/tmp/repos/getpelican__pelican/pelican/generators.py"]}, "metadata": {"anchor": "generate_context", "anchor_file": "private/tmp/repos/getpelican__pelican/pelican/generators.py", "anchor_source": "def generate_context(self):\n all_pages = []\n hidden_pages = []\n draft_pages = []\n for f in self.get_files(\n self.settings[\"PAGE_PATHS\"], exclude=self.settings[\"PAGE_EXCLUDES\"]\n ):\n page = self.get_cached_data(f, None)\n if page is None:\n try:\n page = self.readers.read_file(\n base_path=self.path,\n path=f,\n content_class=Page,\n context=self.context,\n preread_signal=signals.page_generator_preread,\n preread_sender=self,\n context_signal=signals.page_generator_context,\n context_sender=self,\n )\n except Exception:\n logger.exception(\n \"Could not process %s\",\n f,\n exc_info=self.settings.get(\"DEBUG\", False),\n )\n self._add_failed_source_path(f)\n continue\n\n if isinstance(page, SkipStub):\n logger.debug(\"Safely skipping %s\", f)\n continue\n\n if not page.is_valid():\n self._add_failed_source_path(f)\n continue\n\n self.cache_data(f, page)\n\n if page.status == \"published\":\n all_pages.append(page)\n elif page.status == \"hidden\":\n hidden_pages.append(page)\n elif page.status == \"draft\":\n draft_pages.append(page)\n elif page.status == \"skip\":\n raise AssertionError(\"Documents with 'skip' status should be skipped\")\n\n self.add_source_path(page)\n self.add_static_links(page)\n\n def _process(pages):\n origs, translations = process_translations(\n pages, translation_id=self.settings[\"PAGE_TRANSLATION_ID\"]\n )\n origs = order_content(origs, self.settings[\"PAGE_ORDER_BY\"])\n return origs, translations\n\n self.pages, self.translations = _process(all_pages)\n self.hidden_pages, self.hidden_translations = _process(hidden_pages)\n self.draft_pages, self.draft_translations = _process(draft_pages)\n\n self._update_context((\"pages\", \"hidden_pages\", \"draft_pages\"))\n\n self.save_cache()\n self.readers.save_cache()\n signals.page_generator_finalized.send(self)", "result_size": 6, "created_at": "2026-03-20T16:58:16.756586+00:00"}} {"sample_id": "colinhacks__zod___parse__downstream__2hop_2fbd4a", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["mergeObjectAsync", "_processInputParams", "addIssueToContext", "mergeObjectSync", "constructor", "_parse", "ParseInputLazyPath"], "hop_1_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/helpers/parseUtil.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/helpers/parseUtil.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/helpers/parseUtil.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"], "hop_2": ["getErrorMap", "ParseStatus", "dirty"], "hop_2_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/errors.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/helpers/parseUtil.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/helpers/parseUtil.ts"]}, "metadata": {"anchor": "_parse", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "anchor_source": "_parse(input: ParseInput): ParseReturnType {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.object) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.object,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n\n const pairs: {\n key: ParseReturnType;\n value: ParseReturnType;\n alwaysSet: boolean;\n }[] = [];\n\n const keyType = this._def.keyType;\n const valueType = this._def.valueType;\n\n for (const key in ctx.data) {\n pairs.push({\n key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),\n value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),\n alwaysSet: key in ctx.data,\n });\n }\n\n if (ctx.common.async) {\n return ParseStatus.mergeObjectAsync(status, pairs);\n } else {\n return ParseStatus.mergeObjectSync(status, pairs as any);\n }\n }", "result_size": 3, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "colinhacks__zod__date__downstream__1hop_2197a3", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["_addCheck"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"]}, "metadata": {"anchor": "date", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "anchor_source": "date(message?: string) {\n return this._addCheck({ kind: \"date\", message });\n }", "result_size": 1, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "paramiko__paramiko__readinto__downstream__2hop_1597fd", "repo": "paramiko/paramiko", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["read"], "hop_1_files": ["private/tmp/repos/paramiko/paramiko/file.py"], "hop_2": ["_read"], "hop_2_files": ["private/tmp/repos/paramiko/paramiko/file.py"]}, "metadata": {"anchor": "readinto", "anchor_file": "private/tmp/repos/paramiko/paramiko/file.py", "anchor_source": "def readinto(self, buff):\n \"\"\"\n Read up to ``len(buff)`` bytes into ``bytearray`` *buff* and return the\n number of bytes read.\n\n :returns:\n The number of bytes read.\n \"\"\"\n data = self.read(len(buff))\n buff[: len(data)] = data\n return len(data)", "result_size": 1, "created_at": "2026-03-20T16:58:17.364834+00:00"}} {"sample_id": "sindresorhus__got__isUnixSocketURL__upstream__1hop_d50ede", "repo": "sindresorhus/got", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["getUnixSocketPath", "_onResponseBase"], "call_files": ["private/tmp/repos/got/source/core/utils/is-unix-socket-url.ts", "private/tmp/repos/got/source/core/index.ts"]}, "metadata": {"anchor": "isUnixSocketURL", "anchor_file": "private/tmp/repos/got/source/core/utils/is-unix-socket-url.ts", "anchor_source": "export default function isUnixSocketURL(url: URL) {\n\treturn url.protocol === 'unix:' || url.hostname === 'unix';\n}", "result_size": 2, "created_at": "2026-03-20T16:58:18.104721+00:00", "file_content": "// eslint-disable-next-line @typescript-eslint/naming-convention\nexport default function isUnixSocketURL(url: URL) {\n\treturn url.protocol === 'unix:' || url.hostname === 'unix';\n}\n\n/**\nExtract the socket path from a UNIX socket URL.\n\n@example\n```\ngetUnixSocketPath(new URL('http://unix/foo:/path'));\n//=> '/foo'\n\ngetUnixSocketPath(new URL('unix:/foo:/path'));\n//=> '/foo'\n\ngetUnixSocketPath(new URL('http://example.com'));\n//=> undefined\n```\n*/\nexport function getUnixSocketPath(url: URL): string | undefined {\n\tif (!isUnixSocketURL(url)) {\n\t\treturn undefined;\n\t}\n\n\treturn /(?.+?):(?.+)/.exec(`${url.pathname}${url.search}`)?.groups?.socketPath;\n}\n"}} {"sample_id": "node-fetch__node-fetch__json__downstream__2hop_a70069", "repo": "node-fetch/node-fetch", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["text"], "hop_1_files": ["private/tmp/repos/node-fetch__node-fetch/src/body.js"], "hop_2": ["consumeBody"], "hop_2_files": ["private/tmp/repos/node-fetch__node-fetch/src/body.js"]}, "metadata": {"anchor": "json", "anchor_file": "private/tmp/repos/node-fetch__node-fetch/src/body.js", "anchor_source": "async json() {\n\t\tconst text = await this.text();\n\t\treturn JSON.parse(text);\n\t}", "result_size": 1, "created_at": "2026-03-20T16:58:17.058449+00:00"}} {"sample_id": "colinhacks__zod___string__upstream__2hop_967b13", "repo": "colinhacks/zod", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["string"], "hop_1_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/mini/schemas.ts"], "hop_2": ["string", "json"], "hop_2_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/schemas.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/mini/schemas.ts"]}, "metadata": {"anchor": "_string", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/api.ts", "anchor_source": "export function _string(\n Class: util.SchemaClass,\n params?: string | $ZodStringParams\n): T {\n return new Class({\n type: \"string\",\n ...util.normalizeParams(params),\n });\n}", "result_size": 3, "created_at": "2026-03-20T16:58:16.474869+00:00", "file_content": ""}} {"sample_id": "celery__celery__stats__downstream__2hop_f080fe", "repo": "celery/celery", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["Audit", "run", "report"], "hop_1_files": ["private/tmp/repos/celery/celery/bin/logtool.py", "private/tmp/repos/celery/celery/bin/logtool.py", "private/tmp/repos/celery/celery/bin/logtool.py"], "hop_2": ["feed", "_task_counts"], "hop_2_files": ["private/tmp/repos/celery/celery/bin/logtool.py", "private/tmp/repos/celery/celery/bin/logtool.py"]}, "metadata": {"anchor": "stats", "anchor_file": "private/tmp/repos/celery/celery/bin/logtool.py", "anchor_source": "@logtool.command(cls=CeleryCommand)\n@click.argument('files', nargs=-1)\n@click.pass_context\ndef stats(ctx, files):\n ctx.obj.echo(REPORT_FORMAT.format(\n **Audit().run(files).report()\n ))", "result_size": 2, "created_at": "2026-03-20T16:58:16.326235+00:00"}} {"sample_id": "colinhacks__zod__finite__downstream__2hop_9b70a1", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["_addCheck"], "hop_1_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"], "hop_2": ["ZodNumber", "constructor"], "hop_2_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"]}, "metadata": {"anchor": "finite", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "anchor_source": "finite(message?: errorUtil.ErrMessage) {\n return this._addCheck({\n kind: \"finite\",\n message: errorUtil.toString(message),\n });\n }", "result_size": 2, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "pallets__click__open_stream__upstream__1hop_a607df", "repo": "pallets/click", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["convert", "open", "open_file"], "call_files": ["private/tmp/repos/pallets__click/src/click/types.py", "private/tmp/repos/pallets__click/src/click/utils.py", "private/tmp/repos/pallets__click/src/click/utils.py"]}, "metadata": {"anchor": "open_stream", "anchor_file": "private/tmp/repos/pallets__click/src/click/_compat.py", "anchor_source": "def open_stream(\n filename: str | os.PathLike[str],\n mode: str = \"r\",\n encoding: str | None = None,\n errors: str | None = \"strict\",\n atomic: bool = False,\n) -> tuple[t.IO[t.Any], bool]:\n binary = \"b\" in mode\n filename = os.fspath(filename)\n\n # Standard streams first. These are simple because they ignore the\n # atomic flag. Use fsdecode to handle Path(\"-\").\n if os.fsdecode(filename) == \"-\":\n if any(m in mode for m in [\"w\", \"a\", \"x\"]):\n if binary:\n return get_binary_stdout(), False\n return get_text_stdout(encoding=encoding, errors=errors), False\n if binary:\n return get_binary_stdin(), False\n return get_text_stdin(encoding=encoding, errors=errors), False\n\n # Non-atomic writes directly go out through the regular open functions.\n if not atomic:\n return _wrap_io_open(filename, mode, encoding, errors), True\n\n # Some usability stuff for atomic writes\n if \"a\" in mode:\n raise ValueError(\n \"Appending to an existing file is not supported, because that\"\n \" would involve an expensive `copy`-operation to a temporary\"\n \" file. Open the file in normal `w`-mode and copy explicitly\"\n \" if that's what you're after.\"\n )\n if \"x\" in mode:\n raise ValueError(\"Use the `overwrite`-parameter instead.\")\n if \"w\" not in mode:\n raise ValueError(\"Atomic writes only make sense with `w`-mode.\")\n\n # Atomic writes are more complicated. They work by opening a file\n # as a proxy in the same folder and then using the fdopen\n # functionality to wrap it in a Python file. Then we wrap it in an\n # atomic file that moves the file over on close.\n import errno\n import random\n\n try:\n perm: int | None = os.stat(filename).st_mode\n except OSError:\n perm = None\n\n flags = os.O_RDWR | os.O_CREAT | os.O_EXCL\n\n if binary:\n flags |= getattr(os, \"O_BINARY\", 0)\n\n while True:\n tmp_filename = os.path.join(\n os.path.dirname(filename),\n f\".__atomic-write{random.randrange(1 << 32):08x}\",\n )\n try:\n fd = os.open(tmp_filename, flags, 0o666 if perm is None else perm)\n break\n except OSError as e:\n if e.errno == errno.EEXIST or (\n os.name == \"nt\"\n and e.errno == errno.EACCES\n and os.path.isdir(e.filename)\n and os.access(e.filename, os.W_OK)\n ):\n continue\n raise\n\n if perm is not None:\n os.chmod(tmp_filename, perm) # in case perm includes bits in umask\n\n f = _wrap_io_open(fd, mode, encoding, errors)\n af = _AtomicFile(f, tmp_filename, os.path.realpath(filename))\n return t.cast(t.IO[t.Any], af), True", "result_size": 3, "created_at": "2026-03-20T16:58:17.078639+00:00", "file_content": ""}} {"sample_id": "getpelican__pelican__handle_data__downstream__2hop_53ab41", "repo": "getpelican/pelican", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["add_last_word", "getoffset"], "hop_1_files": ["private/tmp/repos/getpelican__pelican/pelican/utils.py", "private/tmp/repos/getpelican__pelican/pelican/utils.py"], "hop_2": ["add_word"], "hop_2_files": ["private/tmp/repos/getpelican__pelican/pelican/utils.py"]}, "metadata": {"anchor": "handle_data", "anchor_file": "private/tmp/repos/getpelican__pelican/pelican/utils.py", "anchor_source": "def handle_data(self, data: str) -> None:\n word_end = 0\n offset = self.getoffset()\n\n while self.words_found < self.max_words:\n match = self._word_regex.search(data, word_end)\n if not match:\n break\n\n if match.start(0) > 0:\n self.add_last_word()\n\n word_end = match.end(0)\n self.last_word_end = offset + word_end\n\n if word_end < len(data):\n self.add_last_word()", "result_size": 1, "created_at": "2026-03-20T16:58:16.756586+00:00"}} {"sample_id": "pallets__flask___get_exc_class_and_code__upstream__1hop_c951cf", "repo": "pallets/flask", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["register_error_handler", "_find_error_handler"], "call_files": ["private/tmp/repos/flask/src/flask/sansio/scaffold.py", "private/tmp/repos/flask/src/flask/sansio/app.py"]}, "metadata": {"anchor": "_get_exc_class_and_code", "anchor_file": "private/tmp/repos/flask/src/flask/sansio/scaffold.py", "anchor_source": "@staticmethod\n def _get_exc_class_and_code(\n exc_class_or_code: type[Exception] | int,\n ) -> tuple[type[Exception], int | None]:\n \"\"\"Get the exception class being handled. For HTTP status codes\n or ``HTTPException`` subclasses, return both the exception and\n status code.\n\n :param exc_class_or_code: Any exception class, or an HTTP status\n code as an integer.\n \"\"\"\n exc_class: type[Exception]\n\n if isinstance(exc_class_or_code, int):\n try:\n exc_class = default_exceptions[exc_class_or_code]\n except KeyError:\n raise ValueError(\n f\"'{exc_class_or_code}' is not a recognized HTTP\"\n \" error code. Use a subclass of HTTPException with\"\n \" that code instead.\"\n ) from None\n else:\n exc_class = exc_class_or_code\n\n if isinstance(exc_class, Exception):\n raise TypeError(\n f\"{exc_class!r} is an instance, not a class. Handlers\"\n \" can only be registered for Exception classes or HTTP\"\n \" error codes.\"\n )\n\n if not issubclass(exc_class, Exception):\n raise ValueError(\n f\"'{exc_class.__name__}' is not a subclass of Exception.\"\n \" Handlers can only be registered for Exception classes\"\n \" or HTTP error codes.\"\n )\n\n if issubclass(exc_class, HTTPException):\n return exc_class, exc_class.code\n else:\n return exc_class, None", "result_size": 2, "created_at": "2026-03-20T16:58:17.167063+00:00", "file_content": "from __future__ import annotations\n\nimport importlib.util\nimport os\nimport pathlib\nimport sys\nimport typing as t\nfrom collections import defaultdict\nfrom functools import update_wrapper\n\nfrom jinja2 import BaseLoader\nfrom jinja2 import FileSystemLoader\nfrom werkzeug.exceptions import default_exceptions\nfrom werkzeug.exceptions import HTTPException\nfrom werkzeug.utils import cached_property\n\nfrom .. import typing as ft\nfrom ..helpers import get_root_path\nfrom ..templating import _default_template_ctx_processor\n\nif t.TYPE_CHECKING: # pragma: no cover\n from click import Group\n\n# a singleton sentinel value for parameter defaults\n_sentinel = object()\n\nF = t.TypeVar(\"F\", bound=t.Callable[..., t.Any])\nT_after_request = t.TypeVar(\"T_after_request\", bound=ft.AfterRequestCallable[t.Any])\nT_before_request = t.TypeVar(\"T_before_request\", bound=ft.BeforeRequestCallable)\nT_error_handler = t.TypeVar(\"T_error_handler\", bound=ft.ErrorHandlerCallable)\nT_teardown = t.TypeVar(\"T_teardown\", bound=ft.TeardownCallable)\nT_template_context_processor = t.TypeVar(\n \"T_template_context_processor\", bound=ft.TemplateContextProcessorCallable\n)\nT_url_defaults = t.TypeVar(\"T_url_defaults\", bound=ft.URLDefaultCallable)\nT_url_value_preprocessor = t.TypeVar(\n \"T_url_value_preprocessor\", bound=ft.URLValuePreprocessorCallable\n)\nT_route = t.TypeVar(\"T_route\", bound=ft.RouteCallable)\n\n\ndef setupmethod(f: F) -> F:\n f_name = f.__name__\n\n def wrapper_func(self: Scaffold, *args: t.Any, **kwargs: t.Any) -> t.Any:\n self._check_setup_finished(f_name)\n return f(self, *args, **kwargs)\n\n return t.cast(F, update_wrapper(wrapper_func, f))\n\n\nclass Scaffold:\n \"\"\"Common behavior shared between :class:`~flask.Flask` and\n :class:`~flask.blueprints.Blueprint`.\n\n :param import_name: The import name of the module where this object\n is defined. Usually :attr:`__name__` should be used.\n :param static_folder: Path to a folder of static files to serve.\n If this is set, a static route will be added.\n :param static_url_path: URL prefix for the static route.\n :param template_folder: Path to a folder containing template files.\n for rendering. If this is set, a Jinja loader will be added.\n :param root_path: The path that static, template, and resource files\n are relative to. Typically not set, it is discovered based on\n the ``import_name``.\n\n .. versionadded:: 2.0\n \"\"\"\n\n cli: Group\n name: str\n _static_folder: str | None = None\n _static_url_path: str | None = None\n\n def __init__(\n self,\n import_name: str,\n static_folder: str | os.PathLike[str] | None = None,\n static_url_path: str | None = None,\n template_folder: str | os.PathLike[str] | None = None,\n root_path: str | None = None,\n ):\n #: The name of the package or module that this object belongs\n #: to. Do not change this once it is set by the constructor.\n self.import_name = import_name\n\n self.static_folder = static_folder\n self.static_url_path = static_url_path\n\n #: The path to the templates folder, relative to\n #: :attr:`root_path`, to add to the template loader. ``None`` if\n #: templates should not be added.\n self.template_folder = template_folder\n\n if root_path is None:\n root_path = get_root_path(self.import_name)\n\n #: Absolute path to the package on the filesystem. Used to look\n #: up resources contained in the package.\n self.root_path = root_path\n\n #: A dictionary mapping endpoint names to view functions.\n #:\n #: To register a view function, use the :meth:`route` decorator.\n #:\n #: This data structure is internal. It should not be modified\n #: directly and its format may change at any time.\n self.view_functions: dict[str, ft.RouteCallable] = {}\n\n #: A data structure of registered error handlers, in the format\n #: ``{scope: {code: {class: handler}}}``. The ``scope`` key is\n #: the name of a blueprint the handlers are active for, or\n #: ``None`` for all requests. The ``code`` key is the HTTP\n #: status code for ``HTTPException``, or ``None`` for\n #: other exceptions. The innermost dictionary maps exception\n #: classes to handler functions.\n #:\n #: To register an error handler, use the :meth:`errorhandler`\n #: decorator.\n #:\n #: This data structure is internal. It should not be modified\n #: directly and its format may change at any time.\n self.error_handler_spec: dict[\n ft.AppOrBlueprintKey,\n dict[int | None, dict[type[Exception], ft.ErrorHandlerCallable]],\n ] = defaultdict(lambda: defaultdict(dict))\n\n #: A data structure of functions to call at the beginning of\n #: each request, in the format ``{scope: [functions]}``. The\n #: ``scope`` key is the name of a blueprint the functions are\n #: active for, or ``None`` for all requests.\n #:\n #: To register a function, use the :meth:`before_request`\n #: decorator.\n #:\n #: This data structure is internal. It should not be modified\n #: directly and its format may change at any time.\n self.before_request_funcs: dict[\n ft.AppOrBlueprintKey, list[ft.BeforeRequestCallable]\n ] = defaultdict(list)\n\n #: A data structure of functions to call at the end of each\n #: request, in the format ``{scope: [functions]}``. The\n #: ``scope`` key is the name of a blueprint the functions are\n #: active for, or ``None`` for all requests.\n #:\n #: To register a function, use the :meth:`after_request`\n #: decorator.\n #:\n #: This data structure is internal. It should not be modified\n #: directly and its format may change at any time.\n self.after_request_funcs: dict[\n ft.AppOrBlueprintKey, list[ft.AfterRequestCallable[t.Any]]\n ] = defaultdict(list)\n\n #: A data structure of functions to call at the end of each\n #: request even if an exception is raised, in the format\n #: ``{scope: [functions]}``. The ``scope`` key is the name of a\n #: blueprint the functions are active for, or ``None`` for all\n #: requests.\n #:\n #: To register a function, use the :meth:`teardown_request`\n #: decorator.\n #:\n #: This data structure is internal. It should not be modified\n #: directly and its format may change at any time.\n self.teardown_request_funcs: dict[\n ft.AppOrBlueprintKey, list[ft.TeardownCallable]\n ] = defaultdict(list)\n\n #: A data structure of functions to call to pass extra context\n #: values when rendering templates, in the format\n #: ``{scope: [functions]}``. The ``scope`` key is the name of a\n #: blueprint the functions are active for, or ``None`` for all\n #: requests.\n #:\n #: To register a function, use the :meth:`context_processor`\n #: decorator.\n #:\n #: This data structure is internal. It should not be modified\n #: directly and its format may change at any time.\n self.template_context_processors: dict[\n ft.AppOrBlueprintKey, list[ft.TemplateContextProcessorCallable]\n ] = defaultdict(list, {None: [_default_template_ctx_processor]})\n\n #: A data structure of functions to call to modify the keyword\n #: arguments passed to the view function, in the format\n #: ``{scope: [functions]}``. The ``scope`` key is the name of a\n #: blueprint the functions are active for, or ``None`` for all\n #: requests.\n #:\n #: To register a function, use the\n #: :meth:`url_value_preprocessor` decorator.\n #:\n #: This data structure is internal. It should not be modified\n #: directly and its format \n# \u2026 (truncated at 8000 chars)"}} {"sample_id": "immerjs__immer__loadPlugin__upstream__1hop_548a88", "repo": "immerjs/immer", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["enableArrayMethods", "enableMapSet", "enablePatches"], "call_files": ["private/tmp/repos/immerjs__immer/src/plugins/arrayMethods.ts", "private/tmp/repos/immerjs__immer/src/plugins/mapset.ts", "private/tmp/repos/immerjs__immer/src/plugins/patches.ts"]}, "metadata": {"anchor": "loadPlugin", "anchor_file": "private/tmp/repos/immerjs__immer/src/utils/plugins.ts", "anchor_source": "export function loadPlugin(\n\tpluginKey: K,\n\timplementation: Plugins[K]\n): void {\n\tif (!plugins[pluginKey]) plugins[pluginKey] = implementation\n}", "result_size": 3, "created_at": "2026-03-20T16:58:16.801413+00:00", "file_content": ""}} {"sample_id": "node-fetch__node-fetch__redirect__downstream__2hop_c68adb", "repo": "node-fetch/node-fetch", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["Response", "constructor"], "hop_1_files": ["private/tmp/repos/node-fetch__node-fetch/src/response.js", "private/tmp/repos/node-fetch__node-fetch/src/response.js"], "hop_2": ["Headers", "constructor", "Body"], "hop_2_files": ["private/tmp/repos/node-fetch__node-fetch/src/headers.js", "private/tmp/repos/node-fetch__node-fetch/src/headers.js", "private/tmp/repos/node-fetch__node-fetch/src/body.js"]}, "metadata": {"anchor": "redirect", "anchor_file": "private/tmp/repos/node-fetch__node-fetch/src/response.js", "anchor_source": "static redirect(url, status = 302) {\n\t\tif (!isRedirect(status)) {\n\t\t\tthrow new RangeError('Failed to execute \"redirect\" on \"response\": Invalid status code');\n\t\t}\n\n\t\treturn new Response(null, {\n\t\t\theaders: {\n\t\t\t\tlocation: new URL(url).toString()\n\t\t\t},\n\t\t\tstatus\n\t\t});\n\t}", "result_size": 4, "created_at": "2026-03-20T16:58:17.058449+00:00"}} {"sample_id": "rq__rq__enqueue_dependents__upstream__2hop_75c6f2", "repo": "rq/rq", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["handle_job_failure", "handle_job_success", "cleanup", "cancel"], "hop_1_files": ["private/tmp/repos/rq__rq/rq/worker/base.py", "private/tmp/repos/rq__rq/rq/worker/base.py", "private/tmp/repos/rq__rq/rq/registry.py", "private/tmp/repos/rq__rq/rq/job.py"], "hop_2": ["cancel_job", "perform_job", "clean_registries", "handle_job_retry", "monitor_work_horse", "get_job_and_execution_ids", "cleanup"], "hop_2_files": ["private/tmp/repos/rq__rq/rq/job.py", "private/tmp/repos/rq__rq/rq/worker/base.py", "private/tmp/repos/rq__rq/rq/registry.py", "private/tmp/repos/rq__rq/rq/worker/base.py", "private/tmp/repos/rq__rq/rq/worker/worker_classes.py", "private/tmp/repos/rq__rq/rq/registry.py", "private/tmp/repos/rq__rq/rq/intermediate_queue.py"]}, "metadata": {"anchor": "enqueue_dependents", "anchor_file": "private/tmp/repos/rq__rq/rq/queue.py", "anchor_source": "def enqueue_dependents(\n self,\n job: 'Job',\n pipeline: Optional['Pipeline'] = None,\n exclude_job_id: Optional[str] = None,\n refresh_job_status: bool = True,\n ):\n \"\"\"Enqueues all jobs in the given job's dependents set and clears it.\n\n When called without a pipeline, this method uses WATCH/MULTI/EXEC.\n If you pass a pipeline, only MULTI is called. The rest is up to the\n caller.\n\n Args:\n job (Job): The Job to enqueue the dependents\n pipeline (Optional[Pipeline], optional): The Redis Pipeline. Defaults to None.\n exclude_job_id (Optional[str], optional): Whether to exclude the job id. Defaults to None.\n refresh_job_status (bool): whether to refresh job status when checking for dependencies. Defaults to True.\n \"\"\"\n from .registry import DeferredJobRegistry\n\n pipe = pipeline if pipeline is not None else self.connection.pipeline()\n dependents_key = job.dependents_key\n\n while True:\n try:\n # if a pipeline is passed, the caller is responsible for calling WATCH\n # to ensure all jobs are enqueued\n if pipeline is None:\n pipe.watch(dependents_key)\n\n dependent_job_ids = {as_text(_id) for _id in pipe.smembers(dependents_key)} # type: ignore[attr-defined]\n\n # There's no dependents\n if not dependent_job_ids:\n break\n\n jobs_to_enqueue = [\n dependent_job\n for dependent_job in self.job_class.fetch_many(\n dependent_job_ids, connection=self.connection, serializer=self.serializer\n )\n if dependent_job\n and dependent_job.dependencies_are_met(\n parent_job=job,\n pipeline=pipe,\n exclude_job_id=exclude_job_id,\n refresh_job_status=refresh_job_status,\n )\n and dependent_job.get_status(refresh=False) != JobStatus.CANCELED\n ]\n\n pipe.multi()\n\n if not jobs_to_enqueue:\n break\n\n self.log.debug(\n 'Enqueueing %d dependent jobs for job %s: %s',\n len(jobs_to_enqueue),\n job.id,\n [j.id for j in jobs_to_enqueue],\n )\n\n for dependent in jobs_to_enqueue:\n enqueue_at_front = dependent.enqueue_at_front or False\n\n registry = DeferredJobRegistry(\n dependent.origin, self.connection, job_class=self.job_class, serializer=self.serializer\n )\n registry.remove(dependent, pipeline=pipe)\n self.log.debug('Removed job %s from DeferredJobRegistry', dependent.id)\n\n if dependent.origin == self.name:\n self.log.debug(\n 'Enqueueing job %s to current queue %s (at_front=%s)',\n dependent.id,\n self.name,\n enqueue_at_front,\n )\n self._enqueue_job(dependent, pipeline=pipe, at_front=enqueue_at_front)\n else:\n self.log.debug(\n 'Enqueueing job %s to different queue %s (at_front=%s)',\n dependent.id,\n dependent.origin,\n enqueue_at_front,\n )\n queue = self.__class__(name=dependent.origin, connection=self.connection)\n queue._enqueue_job(dependent, pipeline=pipe, at_front=enqueue_at_front)\n\n # Only delete dependents_key if all dependents have been enqueued\n if len(jobs_to_enqueue) == len(dependent_job_ids):\n pipe.delete(dependents_key)\n else:\n enqueued_job_ids = [job.id for job in jobs_to_enqueue]\n pipe.srem(dependents_key, *enqueued_job_ids)\n\n if pipeline is None:\n pipe.execute()\n break\n except WatchError:\n if pipeline is None:\n continue\n else:\n # if the pipeline comes from the caller, we re-raise the\n # exception as it it the responsibility of the caller to\n # handle it\n raise", "result_size": 7, "created_at": "2026-03-20T16:58:17.875204+00:00", "file_content": ""}} {"sample_id": "trpc__trpc__groupItems__upstream__2hop_fa2dea", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["dispatch", "dataLoader"], "hop_1_files": ["private/tmp/repos/trpc__trpc/packages/client/src/internals/dataLoader.ts", "private/tmp/repos/trpc__trpc/packages/client/src/internals/dataLoader.ts"], "hop_2": ["httpBatchStreamLink", "httpBatchLink"], "hop_2_files": ["private/tmp/repos/trpc__trpc/packages/client/src/links/httpBatchStreamLink.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/httpBatchLink.ts"]}, "metadata": {"anchor": "groupItems", "anchor_file": "private/tmp/repos/trpc__trpc/packages/client/src/internals/dataLoader.ts", "anchor_source": "function groupItems(items: BatchItem[]) {\n const groupedItems: BatchItem[][] = [[]];\n let index = 0;\n while (true) {\n const item = items[index];\n if (!item) {\n // we're done\n break;\n }\n const lastGroup = groupedItems[groupedItems.length - 1]!;\n\n if (item.aborted) {\n // Item was aborted before it was dispatched\n item.reject?.(new Error('Aborted'));\n index++;\n continue;\n }\n\n const isValid = batchLoader.validate(\n lastGroup.concat(item).map((it) => it.key),\n );\n\n if (isValid) {\n lastGroup.push(item);\n index++;\n continue;\n }\n\n if (lastGroup.length === 0) {\n item.reject?.(new Error('Input is too big for a single dispatch'));\n index++;\n continue;\n }\n // Create new group, next iteration will try to add the item to that\n groupedItems.push([]);\n }\n return groupedItems;\n }", "result_size": 6, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "trpc__trpc__getTRPCErrorFromUnknown__downstream__1hop_43bc90", "repo": "trpc/trpc", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["TRPCError", "constructor"], "call_files": ["private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/error/TRPCError.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/error/TRPCError.ts"]}, "metadata": {"anchor": "getTRPCErrorFromUnknown", "anchor_file": "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/error/TRPCError.ts", "anchor_source": "export function getTRPCErrorFromUnknown(cause: unknown): TRPCError {\n if (cause instanceof TRPCError) {\n return cause;\n }\n if (cause instanceof Error && cause.name === 'TRPCError') {\n // https://github.com/trpc/trpc/pull/4848\n return cause as TRPCError;\n }\n\n const trpcError = new TRPCError({\n code: 'INTERNAL_SERVER_ERROR',\n cause,\n });\n\n // Inherit stack from error\n if (cause instanceof Error && cause.stack) {\n trpcError.stack = cause.stack;\n }\n\n return trpcError;\n}", "result_size": 2, "created_at": "2026-03-20T16:58:18.199328+00:00"}} {"sample_id": "psf__black__parse_atom__downstream__2hop_a8d9d1", "repo": "psf/black", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["addarc", "NFAState", "parse_rhs", "raise_error", "expect", "gettoken"], "hop_1_files": ["private/tmp/repos/psf__black/src/blib2to3/pgen2/pgen.py", "private/tmp/repos/psf__black/src/blib2to3/pgen2/pgen.py", "private/tmp/repos/psf__black/src/blib2to3/pgen2/pgen.py", "private/tmp/repos/psf__black/src/blib2to3/pgen2/pgen.py", "private/tmp/repos/psf__black/src/blib2to3/pgen2/pgen.py", "private/tmp/repos/psf__black/src/blib2to3/pgen2/pgen.py"], "hop_2": ["parse_alt"], "hop_2_files": ["private/tmp/repos/psf__black/src/blib2to3/pgen2/pgen.py"]}, "metadata": {"anchor": "parse_atom", "anchor_file": "private/tmp/repos/psf__black/src/blib2to3/pgen2/pgen.py", "anchor_source": "def parse_atom(self) -> tuple[\"NFAState\", \"NFAState\"]:\n # ATOM: '(' RHS ')' | NAME | STRING\n if self.value == \"(\":\n self.gettoken()\n a, z = self.parse_rhs()\n self.expect(token.OP, \")\")\n return a, z\n elif self.type in (token.NAME, token.STRING):\n a = NFAState()\n z = NFAState()\n a.addarc(z, self.value)\n self.gettoken()\n return a, z\n else:\n self.raise_error(\n f\"expected (...) or NAME or STRING, got {self.type}/{self.value}\"\n )", "result_size": 1, "created_at": "2026-03-20T16:58:17.494246+00:00"}} {"sample_id": "immerjs__immer__shallowCopy__upstream__1hop_1111c1", "repo": "immerjs/immer", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["prepareCopy", "currentImpl"], "call_files": ["private/tmp/repos/immerjs__immer/src/core/proxy.ts", "private/tmp/repos/immerjs__immer/src/core/current.ts"]}, "metadata": {"anchor": "shallowCopy", "anchor_file": "private/tmp/repos/immerjs__immer/src/utils/common.ts", "anchor_source": "export function shallowCopy(base: any, strict: StrictMode) {\n\tif (isMap(base)) {\n\t\treturn new Map(base)\n\t}\n\tif (isSet(base)) {\n\t\treturn new Set(base)\n\t}\n\tif (isArray(base)) return Array[PROTOTYPE].slice.call(base)\n\n\tconst isPlain = isPlainObject(base)\n\n\tif (strict === true || (strict === \"class_only\" && !isPlain)) {\n\t\t// Perform a strict copy\n\t\tconst descriptors = O.getOwnPropertyDescriptors(base)\n\t\tdelete descriptors[DRAFT_STATE as any]\n\t\tlet keys = Reflect.ownKeys(descriptors)\n\t\tfor (let i = 0; i < keys.length; i++) {\n\t\t\tconst key: any = keys[i]\n\t\t\tconst desc = descriptors[key]\n\t\t\tif (desc[WRITABLE] === false) {\n\t\t\t\tdesc[WRITABLE] = true\n\t\t\t\tdesc[CONFIGURABLE] = true\n\t\t\t}\n\t\t\t// like object.assign, we will read any _own_, get/set accessors. This helps in dealing\n\t\t\t// with libraries that trap values, like mobx or vue\n\t\t\t// unlike object.assign, non-enumerables will be copied as well\n\t\t\tif (desc.get || desc.set)\n\t\t\t\tdescriptors[key] = {\n\t\t\t\t\t[CONFIGURABLE]: true,\n\t\t\t\t\t[WRITABLE]: true, // could live with !!desc.set as well here...\n\t\t\t\t\t[ENUMERABLE]: desc[ENUMERABLE],\n\t\t\t\t\t[VALUE]: base[key]\n\t\t\t\t}\n\t\t}\n\t\treturn O.create(getPrototypeOf(base), descriptors)\n\t} else {\n\t\t// perform a sloppy copy\n\t\tconst proto = getPrototypeOf(base)\n\t\tif (proto !== null && isPlain) {\n\t\t\treturn {...base} // assumption: better inner class optimization than the assign below\n\t\t}\n\t\tconst obj = O.create(proto)\n\t\treturn O.assign(obj, base)\n\t}\n}", "result_size": 7, "created_at": "2026-03-20T16:58:16.801413+00:00", "file_content": ""}} {"sample_id": "pallets__jinja__iter_child_nodes__upstream__1hop_97918d", "repo": "pallets/jinja", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["visit_For", "_simple_visit", "set_ctx", "set_environment", "set_lineno", "generic_visit", "find_all", "visit_CallBlock"], "call_files": ["private/tmp/repos/pallets__jinja/src/jinja2/compiler.py", "private/tmp/repos/pallets__jinja/src/jinja2/idtracking.py", "private/tmp/repos/pallets__jinja/src/jinja2/nodes.py", "private/tmp/repos/pallets__jinja/src/jinja2/nodes.py", "private/tmp/repos/pallets__jinja/src/jinja2/nodes.py", "private/tmp/repos/pallets__jinja/src/jinja2/visitor.py", "private/tmp/repos/pallets__jinja/src/jinja2/nodes.py", "private/tmp/repos/pallets__jinja/src/jinja2/idtracking.py"]}, "metadata": {"anchor": "iter_child_nodes", "anchor_file": "private/tmp/repos/pallets__jinja/src/jinja2/nodes.py", "anchor_source": "def iter_child_nodes(\n self,\n exclude: t.Container[str] | None = None,\n only: t.Container[str] | None = None,\n ) -> t.Iterator[\"Node\"]:\n \"\"\"Iterates over all direct child nodes of the node. This iterates\n over all fields and yields the values of they are nodes. If the value\n of a field is a list all the nodes in that list are returned.\n \"\"\"\n for _, item in self.iter_fields(exclude, only):\n if isinstance(item, list):\n for n in item:\n if isinstance(n, Node):\n yield n\n elif isinstance(item, Node):\n yield item", "result_size": 8, "created_at": "2026-03-20T16:58:17.229656+00:00", "file_content": ""}} {"sample_id": "encode__django-rest-framework__options__downstream__2hop_7ecc48", "repo": "encode/django-rest-framework", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["options"], "hop_1_files": ["private/tmp/repos/django-rest-framework/rest_framework/test.py"], "hop_2": ["_encode_data", "generic"], "hop_2_files": ["private/tmp/repos/django-rest-framework/rest_framework/test.py", "private/tmp/repos/django-rest-framework/rest_framework/test.py"]}, "metadata": {"anchor": "options", "anchor_file": "private/tmp/repos/django-rest-framework/rest_framework/test.py", "anchor_source": "def options(self, path, data=None, format=None, content_type=None,\n follow=False, **extra):\n response = super().options(\n path, data=data, format=format, content_type=content_type, **extra)\n if follow:\n response = self._handle_redirects(response, data=data, format=format, content_type=content_type, **extra)\n return response", "result_size": 2, "created_at": "2026-03-20T16:58:16.616316+00:00"}} {"sample_id": "immerjs__immer__leaveScope__upstream__1hop_b60e02", "repo": "immerjs/immer", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["createDraft", "revokeScope"], "call_files": ["private/tmp/repos/immerjs__immer/src/core/immerClass.ts", "private/tmp/repos/immerjs__immer/src/core/scope.ts"]}, "metadata": {"anchor": "leaveScope", "anchor_file": "private/tmp/repos/immerjs__immer/src/core/scope.ts", "anchor_source": "export function leaveScope(scope: ImmerScope) {\n\tif (scope === currentScope) {\n\t\tcurrentScope = scope.parent_\n\t}\n}", "result_size": 2, "created_at": "2026-03-20T16:58:16.801413+00:00", "file_content": ""}} {"sample_id": "immerjs__immer__updateDraftInParent__upstream__2hop_018d36", "repo": "immerjs/immer", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["childCleanup", "registerChildFinalizationCallback", "handleCrossReference", "crossReferenceCleanup"], "hop_1_files": ["private/tmp/repos/immerjs__immer/src/core/finalize.ts", "private/tmp/repos/immerjs__immer/src/core/finalize.ts", "private/tmp/repos/immerjs__immer/src/core/finalize.ts", "private/tmp/repos/immerjs__immer/src/core/finalize.ts"], "hop_2": ["add", "enableArrayMethods", "createProxy", "set", "handleInsertedValues", "enableMapSet"], "hop_2_files": ["private/tmp/repos/immerjs__immer/src/plugins/mapset.ts", "private/tmp/repos/immerjs__immer/src/plugins/arrayMethods.ts", "private/tmp/repos/immerjs__immer/src/core/immerClass.ts", "private/tmp/repos/immerjs__immer/src/plugins/mapset.ts", "private/tmp/repos/immerjs__immer/src/plugins/arrayMethods.ts", "private/tmp/repos/immerjs__immer/src/plugins/mapset.ts"]}, "metadata": {"anchor": "updateDraftInParent", "anchor_file": "private/tmp/repos/immerjs__immer/src/core/finalize.ts", "anchor_source": "export function updateDraftInParent(\n\tparent: ImmerState,\n\tdraftValue: any,\n\tfinalizedValue: any,\n\toriginalKey?: string | number | symbol\n): void {\n\tconst parentCopy = latest(parent)\n\tconst parentType = parent.type_\n\n\t// Fast path: Check if draft is still at original key\n\tif (originalKey !== undefined) {\n\t\tconst currentValue = get(parentCopy, originalKey, parentType)\n\t\tif (currentValue === draftValue) {\n\t\t\t// Still at original location, just update it\n\t\t\tset(parentCopy, originalKey, finalizedValue, parentType)\n\t\t\treturn\n\t\t}\n\t}\n\n\t// Slow path: Build reverse mapping of all children\n\t// to their indices in the parent, so that we can\n\t// replace all locations where this draft appears.\n\t// We only have to build this once per parent.\n\tif (!parent.draftLocations_) {\n\t\tconst draftLocations = (parent.draftLocations_ = new Map())\n\n\t\t// Use `each` which works on Arrays, Maps, and Objects\n\t\teach(parentCopy, (key, value) => {\n\t\t\tif (isDraft(value)) {\n\t\t\t\tconst keys = draftLocations.get(value) || []\n\t\t\t\tkeys.push(key)\n\t\t\t\tdraftLocations.set(value, keys)\n\t\t\t}\n\t\t})\n\t}\n\n\t// Look up all locations where this draft appears\n\tconst locations =\n\t\tparent.draftLocations_.get(draftValue) ?? EMPTY_LOCATIONS_RESULT\n\n\t// Update all locations\n\tfor (const location of locations) {\n\t\tset(parentCopy, location, finalizedValue, parentType)\n\t}\n}", "result_size": 7, "created_at": "2026-03-20T16:58:16.801413+00:00", "file_content": ""}} {"sample_id": "colinhacks__zod__array__downstream__1hop_c6a210", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["ZodArray"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"]}, "metadata": {"anchor": "array", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "anchor_source": "array(): ZodArray {\n return ZodArray.create(this);\n }", "result_size": 1, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "encode__django-rest-framework___get_forward_relationships__downstream__1hop_4e4f4f", "repo": "encode/django-rest-framework", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["_get_to_field"], "call_files": ["private/tmp/repos/django-rest-framework/rest_framework/utils/model_meta.py"]}, "metadata": {"anchor": "_get_forward_relationships", "anchor_file": "private/tmp/repos/django-rest-framework/rest_framework/utils/model_meta.py", "anchor_source": "def _get_forward_relationships(opts):\n \"\"\"\n Returns a dict of field names to `RelationInfo`.\n \"\"\"\n forward_relations = {}\n for field in [field for field in opts.fields if field.serialize and field.remote_field]:\n forward_relations[field.name] = RelationInfo(\n model_field=field,\n related_model=field.remote_field.model,\n to_many=False,\n to_field=_get_to_field(field),\n has_through_model=False,\n reverse=False\n )\n\n # Deal with forward many-to-many relationships.\n for field in [field for field in opts.many_to_many if field.serialize]:\n forward_relations[field.name] = RelationInfo(\n model_field=field,\n related_model=field.remote_field.model,\n to_many=True,\n # manytomany do not have to_fields\n to_field=None,\n has_through_model=(\n not field.remote_field.through._meta.auto_created\n ),\n reverse=False\n )\n\n return forward_relations", "result_size": 1, "created_at": "2026-03-20T16:58:16.616316+00:00"}} {"sample_id": "pytest-dev__pytest__write__downstream__2hop_8c4e69", "repo": "pytest-dev/pytest", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["write_raw", "markup"], "hop_1_files": ["private/tmp/repos/pytest-dev__pytest/src/_pytest/_io/terminalwriter.py", "private/tmp/repos/pytest-dev__pytest/src/_pytest/_io/terminalwriter.py"], "hop_2": ["flush"], "hop_2_files": ["private/tmp/repos/pytest-dev__pytest/src/_pytest/_io/terminalwriter.py"]}, "metadata": {"anchor": "write", "anchor_file": "private/tmp/repos/pytest-dev__pytest/src/_pytest/_io/terminalwriter.py", "anchor_source": "def write(self, msg: str, *, flush: bool = False, **markup: bool) -> None:\n if msg:\n current_line = msg.rsplit(\"\\n\", 1)[-1]\n if \"\\n\" in msg:\n self._current_line = current_line\n else:\n self._current_line += current_line\n\n msg = self.markup(msg, **markup)\n\n self.write_raw(msg, flush=flush)", "result_size": 1, "created_at": "2026-03-20T16:58:17.641689+00:00"}} {"sample_id": "rq__rq__set_current_job_id__upstream__1hop_2d87d7", "repo": "rq/rq", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["prepare_job_execution", "cleanup_execution"], "call_files": ["private/tmp/repos/rq__rq/rq/worker/base.py", "private/tmp/repos/rq__rq/rq/executions.py"]}, "metadata": {"anchor": "set_current_job_id", "anchor_file": "private/tmp/repos/rq__rq/rq/worker/base.py", "anchor_source": "def set_current_job_id(self, job_id: Optional[str] = None, pipeline: Optional['Pipeline'] = None):\n \"\"\"Sets the current job id.\n If `None` is used it will delete the current job key.\n\n Args:\n job_id (Optional[str], optional): The job id. Defaults to None.\n pipeline (Optional[Pipeline], optional): The pipeline to use. Defaults to None.\n \"\"\"\n connection = pipeline if pipeline is not None else self.connection\n if job_id is None:\n connection.hdel(self.key, 'current_job')\n else:\n connection.hset(self.key, 'current_job', job_id)", "result_size": 2, "created_at": "2026-03-20T16:58:17.875204+00:00", "file_content": ""}} {"sample_id": "immerjs__immer__applyPatches___downstream__1hop_187bc3", "repo": "immerjs/immer", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["die", "getArchtype", "deepClonePatchValue"], "call_files": ["private/tmp/repos/immerjs__immer/src/utils/errors.ts", "private/tmp/repos/immerjs__immer/src/utils/common.ts", "private/tmp/repos/immerjs__immer/src/plugins/patches.ts"]}, "metadata": {"anchor": "applyPatches_", "anchor_file": "private/tmp/repos/immerjs__immer/src/plugins/patches.ts", "anchor_source": "function applyPatches_(draft: T, patches: readonly Patch[]): T {\n\t\tpatches.forEach(patch => {\n\t\t\tconst {path, op} = patch\n\n\t\t\tlet base: any = draft\n\t\t\tfor (let i = 0; i < path.length - 1; i++) {\n\t\t\t\tconst parentType = getArchtype(base)\n\t\t\t\tlet p = path[i]\n\t\t\t\tif (typeof p !== \"string\" && typeof p !== \"number\") {\n\t\t\t\t\tp = \"\" + p\n\t\t\t\t}\n\n\t\t\t\t// See #738, avoid prototype pollution\n\t\t\t\tif (\n\t\t\t\t\t(parentType === ArchType.Object || parentType === ArchType.Array) &&\n\t\t\t\t\t(p === \"__proto__\" || p === CONSTRUCTOR)\n\t\t\t\t)\n\t\t\t\t\tdie(errorOffset + 3)\n\t\t\t\tif (isFunction(base) && p === PROTOTYPE) die(errorOffset + 3)\n\t\t\t\tbase = get(base, p)\n\t\t\t\tif (!isObjectish(base)) die(errorOffset + 2, path.join(\"/\"))\n\t\t\t}\n\n\t\t\tconst type = getArchtype(base)\n\t\t\tconst value = deepClonePatchValue(patch.value) // used to clone patch to ensure original patch is not modified, see #411\n\t\t\tconst key = path[path.length - 1]\n\t\t\tswitch (op) {\n\t\t\t\tcase REPLACE:\n\t\t\t\t\tswitch (type) {\n\t\t\t\t\t\tcase ArchType.Map:\n\t\t\t\t\t\t\treturn base.set(key, value)\n\t\t\t\t\t\t/* istanbul ignore next */\n\t\t\t\t\t\tcase ArchType.Set:\n\t\t\t\t\t\t\tdie(errorOffset)\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t// if value is an object, then it's assigned by reference\n\t\t\t\t\t\t\t// in the following add or remove ops, the value field inside the patch will also be modifyed\n\t\t\t\t\t\t\t// so we use value from the cloned patch\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\treturn (base[key] = value)\n\t\t\t\t\t}\n\t\t\t\tcase ADD:\n\t\t\t\t\tswitch (type) {\n\t\t\t\t\t\tcase ArchType.Array:\n\t\t\t\t\t\t\treturn key === \"-\"\n\t\t\t\t\t\t\t\t? base.push(value)\n\t\t\t\t\t\t\t\t: base.splice(key as any, 0, value)\n\t\t\t\t\t\tcase ArchType.Map:\n\t\t\t\t\t\t\treturn base.set(key, value)\n\t\t\t\t\t\tcase ArchType.Set:\n\t\t\t\t\t\t\treturn base.add(value)\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn (base[key] = value)\n\t\t\t\t\t}\n\t\t\t\tcase REMOVE:\n\t\t\t\t\tswitch (type) {\n\t\t\t\t\t\tcase ArchType.Array:\n\t\t\t\t\t\t\treturn base.splice(key as any, 1)\n\t\t\t\t\t\tcase ArchType.Map:\n\t\t\t\t\t\t\treturn base.delete(key)\n\t\t\t\t\t\tcase ArchType.Set:\n\t\t\t\t\t\t\treturn base.delete(patch.value)\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn delete base[key]\n\t\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\tdie(errorOffset + 1, op)\n\t\t\t}\n\t\t})\n\n\t\treturn draft\n\t}", "result_size": 4, "created_at": "2026-03-20T16:58:16.801413+00:00"}} {"sample_id": "pallets__jinja__preprocess__upstream__1hop_b951e2", "repo": "pallets/jinja", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["babel_extract", "_tokenize"], "call_files": ["private/tmp/repos/pallets__jinja/src/jinja2/ext.py", "private/tmp/repos/pallets__jinja/src/jinja2/environment.py"]}, "metadata": {"anchor": "preprocess", "anchor_file": "private/tmp/repos/pallets__jinja/src/jinja2/environment.py", "anchor_source": "def preprocess(\n self,\n source: str,\n name: str | None = None,\n filename: str | None = None,\n ) -> str:\n \"\"\"Preprocesses the source with all extensions. This is automatically\n called for all parsing and compiling methods but *not* for :meth:`lex`\n because there you usually only want the actual source tokenized.\n \"\"\"\n return reduce(\n lambda s, e: e.preprocess(s, name, filename),\n self.iter_extensions(),\n str(source),\n )", "result_size": 2, "created_at": "2026-03-20T16:58:17.229656+00:00", "file_content": ""}} {"sample_id": "trpc__trpc__startIfNeeded__upstream__2hop_3c32dd", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["share"], "hop_1_files": ["private/tmp/repos/trpc__trpc/packages/server/src/observable/operators.ts"], "hop_2": ["$request", "dedupeLink"], "hop_2_files": ["private/tmp/repos/trpc__trpc/packages/client/src/internals/TRPCUntypedClient.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/internals/dedupeLink.ts"]}, "metadata": {"anchor": "startIfNeeded", "anchor_file": "private/tmp/repos/trpc__trpc/packages/server/src/observable/operators.ts", "anchor_source": "function startIfNeeded() {\n if (subscription) {\n return;\n }\n subscription = source.subscribe({\n next(value) {\n for (const observer of observers) {\n observer.next?.(value);\n }\n },\n error(error) {\n for (const observer of observers) {\n observer.error?.(error);\n }\n },\n complete() {\n for (const observer of observers) {\n observer.complete?.();\n }\n },\n });\n }", "result_size": 6, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "sindresorhus__got___final__downstream__1hop_62edea", "repo": "sindresorhus/got", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["_emitUploadComplete"], "call_files": ["private/tmp/repos/got/source/core/index.ts"]}, "metadata": {"anchor": "_final", "anchor_file": "private/tmp/repos/got/source/core/index.ts", "anchor_source": "override _final(callback: (error?: Error | null) => void): void { // eslint-disable-line @typescript-eslint/no-restricted-types\n\t\tconst endRequest = (): void => {\n\t\t\tif (this._skipRequestEndInFinal) {\n\t\t\t\tthis._skipRequestEndInFinal = false;\n\t\t\t\tcallback();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst request = this._request;\n\n\t\t\t// We need to check if `this._request` is present,\n\t\t\t// because it isn't when we use cache.\n\t\t\tif (!request || request.destroyed) {\n\t\t\t\tcallback();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\trequest.end((error?: Error | null) => { // eslint-disable-line @typescript-eslint/no-restricted-types\n\t\t\t\t// The request has been destroyed before `_final` finished.\n\t\t\t\t// See https://github.com/nodejs/node/issues/39356\n\t\t\t\tif ((request as any)?._writableState?.errored) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (!error) {\n\t\t\t\t\tthis._emitUploadComplete(request);\n\t\t\t\t}\n\n\t\t\t\tcallback(error);\n\t\t\t});\n\t\t};\n\n\t\tif (this._requestInitialized) {\n\t\t\tendRequest();\n\t\t} else {\n\t\t\tthis._jobs.push(endRequest);\n\t\t}\n\t}", "result_size": 1, "created_at": "2026-03-20T16:58:18.104721+00:00"}} {"sample_id": "pallets__flask__add_url_rule__downstream__1hop_e049a9", "repo": "pallets/flask", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["App", "_endpoint_from_view_func"], "call_files": ["private/tmp/repos/flask/src/flask/sansio/app.py", "private/tmp/repos/flask/src/flask/sansio/scaffold.py"]}, "metadata": {"anchor": "add_url_rule", "anchor_file": "private/tmp/repos/flask/src/flask/sansio/app.py", "anchor_source": "@setupmethod\n def add_url_rule(\n self,\n rule: str,\n endpoint: str | None = None,\n view_func: ft.RouteCallable | None = None,\n provide_automatic_options: bool | None = None,\n **options: t.Any,\n ) -> None:\n if endpoint is None:\n endpoint = _endpoint_from_view_func(view_func) # type: ignore\n options[\"endpoint\"] = endpoint\n methods = options.pop(\"methods\", None)\n\n # if the methods are not given and the view_func object knows its\n # methods we can use that instead. If neither exists, we go with\n # a tuple of only ``GET`` as default.\n if methods is None:\n methods = getattr(view_func, \"methods\", None) or (\"GET\",)\n if isinstance(methods, str):\n raise TypeError(\n \"Allowed methods must be a list of strings, for\"\n ' example: @app.route(..., methods=[\"POST\"])'\n )\n methods = {item.upper() for item in methods}\n\n # Methods that should always be added\n required_methods: set[str] = set(getattr(view_func, \"required_methods\", ()))\n\n if provide_automatic_options is None:\n provide_automatic_options = getattr(\n view_func, \"provide_automatic_options\", None\n )\n\n if provide_automatic_options is None:\n provide_automatic_options = (\n \"OPTIONS\" not in methods\n and self.config[\"PROVIDE_AUTOMATIC_OPTIONS\"]\n )\n\n if provide_automatic_options:\n required_methods.add(\"OPTIONS\")\n\n # Add the required methods now.\n methods |= required_methods\n\n rule_obj = self.url_rule_class(rule, methods=methods, **options)\n rule_obj.provide_automatic_options = provide_automatic_options # type: ignore[attr-defined]\n\n self.url_map.add(rule_obj)\n if view_func is not None:\n old_func = self.view_functions.get(endpoint)\n if old_func is not None and old_func != view_func:\n raise AssertionError(\n \"View function mapping is overwriting an existing\"\n f\" endpoint function: {endpoint}\"\n )\n self.view_functions[endpoint] = view_func", "result_size": 2, "created_at": "2026-03-20T16:58:17.167063+00:00"}} {"sample_id": "trpc__trpc__resetIfNeeded__upstream__2hop_9315ab", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["unsubscribe", "share"], "hop_1_files": ["private/tmp/repos/trpc__trpc/packages/server/src/observable/operators.ts", "private/tmp/repos/trpc__trpc/packages/server/src/observable/operators.ts"], "hop_2": ["$request", "dedupeLink"], "hop_2_files": ["private/tmp/repos/trpc__trpc/packages/client/src/internals/TRPCUntypedClient.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/internals/dedupeLink.ts"]}, "metadata": {"anchor": "resetIfNeeded", "anchor_file": "private/tmp/repos/trpc__trpc/packages/server/src/observable/operators.ts", "anchor_source": "function resetIfNeeded() {\n // \"resetOnRefCountZero\"\n if (refCount === 0 && subscription) {\n const _sub = subscription;\n subscription = null;\n _sub.unsubscribe();\n }\n }", "result_size": 6, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "locustio__locust__reset__upstream__2hop_8aca58", "repo": "locustio/locust", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["get_stripped_report", "reset_all"], "hop_1_files": ["private/tmp/repos/locustio__locust/locust/stats.py", "private/tmp/repos/locustio__locust/locust/stats.py"], "hop_2": ["serialize_stats", "on_spawning_complete", "on_report_to_master", "reset_stats", "setup_distributed_stats_event_listeners"], "hop_2_files": ["private/tmp/repos/locustio__locust/locust/stats.py", "private/tmp/repos/locustio__locust/locust/runners.py", "private/tmp/repos/locustio__locust/locust/stats.py", "private/tmp/repos/locustio__locust/locust/web.py", "private/tmp/repos/locustio__locust/locust/stats.py"]}, "metadata": {"anchor": "reset", "anchor_file": "private/tmp/repos/locustio__locust/locust/stats.py", "anchor_source": "def reset(self):\n self.start_time = time.time()\n self.num_requests = 0\n self.num_none_requests = 0\n self.num_failures = 0\n self.total_response_time = 0\n self.response_times = defaultdict(int)\n self.min_response_time = None\n self.max_response_time = 0\n self.last_request_timestamp = None\n self.num_reqs_per_sec = defaultdict(int)\n self.num_fail_per_sec = defaultdict(int)\n self.total_content_length = 0\n if self.use_response_times_cache:\n self.response_times_cache = OrderedDict()\n self._cache_response_times(int(time.time()))", "result_size": 5, "created_at": "2026-03-20T16:58:16.951273+00:00", "file_content": ""}} {"sample_id": "colinhacks__zod__extractDefs__upstream__1hop_5a6b89", "repo": "colinhacks/zod", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["toJSONSchema", "emit"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/json-schema-processors.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/json-schema-generator.ts"]}, "metadata": {"anchor": "extractDefs", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/to-json-schema.ts", "anchor_source": "export function extractDefs(\n ctx: ToJSONSchemaContext,\n schema: T\n // params: EmitParams\n): void {\n // iterate over seen map;\n const root = ctx.seen.get(schema);\n\n if (!root) throw new Error(\"Unprocessed schema. This is a bug in Zod.\");\n\n // Track ids to detect duplicates across different schemas\n const idToSchema = new Map();\n for (const entry of ctx.seen.entries()) {\n const id = ctx.metadataRegistry.get(entry[0])?.id;\n if (id) {\n const existing = idToSchema.get(id);\n if (existing && existing !== entry[0]) {\n throw new Error(\n `Duplicate schema id \"${id}\" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`\n );\n }\n idToSchema.set(id, entry[0]);\n }\n }\n\n // returns a ref to the schema\n // defId will be empty if the ref points to an external schema (or #)\n const makeURI = (entry: [schemas.$ZodType, Seen]): { ref: string; defId?: string } => {\n // comparing the seen objects because sometimes\n // multiple schemas map to the same seen object.\n // e.g. lazy\n\n // external is configured\n const defsSegment = ctx.target === \"draft-2020-12\" ? \"$defs\" : \"definitions\";\n if (ctx.external) {\n const externalId = ctx.external.registry.get(entry[0])?.id; // ?? \"__shared\";// `__schema${ctx.counter++}`;\n\n // check if schema is in the external registry\n const uriGenerator = ctx.external.uri ?? ((id: string) => id);\n if (externalId) {\n return { ref: uriGenerator(externalId) };\n }\n\n // otherwise, add to __shared\n const id: string = entry[1].defId ?? (entry[1].schema.id as string) ?? `schema${ctx.counter++}`;\n entry[1].defId = id; // set defId so it will be reused if needed\n return { defId: id, ref: `${uriGenerator(\"__shared\")}#/${defsSegment}/${id}` };\n }\n\n if (entry[1] === root) {\n return { ref: \"#\" };\n }\n\n // self-contained schema\n const uriPrefix = `#`;\n const defUriPrefix = `${uriPrefix}/${defsSegment}/`;\n const defId = entry[1].schema.id ?? `__schema${ctx.counter++}`;\n return { defId, ref: defUriPrefix + defId };\n };\n\n // stored cached version in `def` property\n // remove all properties, set $ref\n const extractToDef = (entry: [schemas.$ZodType, Seen]): void => {\n // if the schema is already a reference, do not extract it\n if (entry[1].schema.$ref) {\n return;\n }\n const seen = entry[1];\n const { ref, defId } = makeURI(entry);\n\n seen.def = { ...seen.schema };\n // defId won't be set if the schema is a reference to an external schema\n // or if the schema is the root schema\n if (defId) seen.defId = defId;\n // wipe away all properties except $ref\n const schema = seen.schema;\n for (const key in schema) {\n delete schema[key];\n }\n schema.$ref = ref;\n };\n\n // throw on cycles\n\n // break cycles\n if (ctx.cycles === \"throw\") {\n for (const entry of ctx.seen.entries()) {\n const seen = entry[1];\n if (seen.cycle) {\n throw new Error(\n \"Cycle detected: \" +\n `#/${seen.cycle?.join(\"/\")}/` +\n '\\n\\nSet the `cycles` parameter to `\"ref\"` to resolve cyclical schemas with defs.'\n );\n }\n }\n }\n\n // extract schemas into $defs\n for (const entry of ctx.seen.entries()) {\n const seen = entry[1];\n\n // convert root schema to # $ref\n if (schema === entry[0]) {\n extractToDef(entry); // this has special handling for the root schema\n continue;\n }\n\n // extract schemas that are in the external registry\n if (ctx.external) {\n const ext = ctx.external.registry.get(entry[0])?.id;\n if (schema !== entry[0] && ext) {\n extractToDef(entry);\n continue;\n }\n }\n\n // extract schemas with `id` meta\n const id = ctx.metadataRegistry.get(entry[0])?.id;\n if (id) {\n extractToDef(entry);\n continue;\n }\n\n // break cycles\n if (seen.cycle) {\n // any\n extractToDef(entry);\n continue;\n }\n\n // extract reused schemas\n if (seen.count > 1) {\n if (ctx.reused === \"ref\") {\n extractToDef(entry);\n // biome-ignore lint:\n continue;\n }\n }\n }\n}", "result_size": 3, "created_at": "2026-03-20T16:58:16.474869+00:00", "file_content": ""}} {"sample_id": "python-poetry__poetry___links_to_data__downstream__2hop_ecfe64", "repo": "python-poetry/poetry", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["calculate_sha256", "_get_info_from_links"], "hop_1_files": ["private/tmp/repos/python-poetry__poetry/src/poetry/repositories/http_repository.py", "private/tmp/repos/python-poetry__poetry/src/poetry/repositories/http_repository.py"], "hop_2": ["_get_info_from_metadata", "_get_info_from_sdist", "_get_info_from_wheel", "_cached_or_downloaded_file"], "hop_2_files": ["private/tmp/repos/python-poetry__poetry/src/poetry/repositories/http_repository.py", "private/tmp/repos/python-poetry__poetry/src/poetry/repositories/http_repository.py", "private/tmp/repos/python-poetry__poetry/src/poetry/repositories/http_repository.py", "private/tmp/repos/python-poetry__poetry/src/poetry/repositories/http_repository.py"]}, "metadata": {"anchor": "_links_to_data", "anchor_file": "private/tmp/repos/python-poetry__poetry/src/poetry/repositories/http_repository.py", "anchor_source": "def _links_to_data(self, links: list[Link], data: PackageInfo) -> dict[str, Any]:\n if not links:\n raise PackageNotFoundError(\n f'No valid distribution links found for package: \"{data.name}\" version:'\n f' \"{data.version}\"'\n )\n\n files: list[PackageFile] = []\n for link in links:\n if link.yanked and not data.yanked:\n # drop yanked files unless the entire release is yanked\n continue\n\n file_hash: str | None\n for hash_name in (\"sha512\", \"sha384\", \"sha256\"):\n if hash_name in link.hashes:\n file_hash = f\"{hash_name}:{link.hashes[hash_name]}\"\n break\n else:\n file_hash = self.calculate_sha256(link)\n\n if file_hash is None and (\n hash_type := get_highest_priority_hash_type(link.hashes, link.filename)\n ):\n file_hash = f\"{hash_type}:{link.hashes[hash_type]}\"\n\n if file_hash is None:\n # Is that even possible?\n # Before introducing this warning and ignoring the file,\n # null hashes would have been written to the lockfile,\n # which should have been failed in the Chooser at latest.\n self._log(\n f\"Failed to determine hash of {link.url}. Skipping file.\",\n level=\"warning\",\n )\n else:\n files.append(\n {\n \"file\": link.filename,\n \"hash\": file_hash,\n \"url\": link.url_without_fragment,\n }\n )\n if link.size is not None:\n files[-1][\"size\"] = link.size\n if link.upload_time_isoformat is not None:\n files[-1][\"upload_time\"] = link.upload_time_isoformat\n\n if not files:\n raise PackageNotFoundError(\n f'Could not determine a hash for any distribution link of package: \"{data.name}\" version:'\n f' \"{data.version}\"'\n )\n\n data.files = files\n\n # drop yanked files unless the entire release is yanked\n info = self._get_info_from_links(links, ignore_yanked=not data.yanked)\n\n data.summary = info.summary\n data.requires_dist = info.requires_dist\n data.requires_python = info.requires_python\n\n return data.asdict()", "result_size": 4, "created_at": "2026-03-20T16:58:17.758794+00:00"}} {"sample_id": "trpc__trpc__fetchHTTPResponse__upstream__1hop_ac1c4b", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["httpRequest", "fetch", "httpBatchStreamLink"], "call_files": ["private/tmp/repos/trpc__trpc/packages/client/src/links/internals/httpUtils.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/httpBatchStreamLink.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/httpBatchStreamLink.ts"]}, "metadata": {"anchor": "fetchHTTPResponse", "anchor_file": "private/tmp/repos/trpc__trpc/packages/client/src/links/internals/httpUtils.ts", "anchor_source": "export async function fetchHTTPResponse(opts: HTTPRequestOptions) {\n throwIfAborted(opts.signal);\n\n const url = opts.getUrl(opts);\n const body = opts.getBody(opts);\n const method = opts.methodOverride ?? METHOD[opts.type];\n const resolvedHeaders = await (async () => {\n const heads = await opts.headers();\n if (Symbol.iterator in heads) {\n return Object.fromEntries(heads);\n }\n return heads;\n })();\n const headers = {\n ...(opts.contentTypeHeader && method !== 'GET'\n ? { 'content-type': opts.contentTypeHeader }\n : {}),\n ...(opts.trpcAcceptHeader\n ? { [opts.trpcAcceptHeaderKey ?? 'trpc-accept']: opts.trpcAcceptHeader }\n : undefined),\n ...resolvedHeaders,\n };\n\n return getFetch(opts.fetch)(url, {\n method,\n signal: opts.signal,\n body,\n headers,\n });\n}", "result_size": 5, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "pallets__click__complete__downstream__2hop_c48eeb", "repo": "pallets/click", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["get_completion_args", "format_completion", "get_completions"], "hop_1_files": ["private/tmp/repos/pallets__click/src/click/shell_completion.py", "private/tmp/repos/pallets__click/src/click/shell_completion.py", "private/tmp/repos/pallets__click/src/click/shell_completion.py"], "hop_2": ["shell_complete", "_resolve_incomplete", "_resolve_context"], "hop_2_files": ["private/tmp/repos/pallets__click/src/click/core.py", "private/tmp/repos/pallets__click/src/click/shell_completion.py", "private/tmp/repos/pallets__click/src/click/shell_completion.py"]}, "metadata": {"anchor": "complete", "anchor_file": "private/tmp/repos/pallets__click/src/click/shell_completion.py", "anchor_source": "def complete(self) -> str:\n \"\"\"Produce the completion data to send back to the shell.\n\n By default this calls :meth:`get_completion_args`, gets the\n completions, then calls :meth:`format_completion` for each\n completion.\n \"\"\"\n args, incomplete = self.get_completion_args()\n completions = self.get_completions(args, incomplete)\n out = [self.format_completion(item) for item in completions]\n return \"\\n\".join(out)", "result_size": 3, "created_at": "2026-03-20T16:58:17.078639+00:00"}} {"sample_id": "colinhacks__zod__refinement__downstream__2hop_b25424", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["_refinement"], "hop_1_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"], "hop_2": ["constructor", "ZodEffects"], "hop_2_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"]}, "metadata": {"anchor": "refinement", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "anchor_source": "refinement(\n check: (arg: Output) => unknown,\n refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)\n ): ZodEffects {\n return this._refinement((val, ctx) => {\n if (!check(val)) {\n ctx.addIssue(typeof refinementData === \"function\" ? refinementData(val, ctx) : refinementData);\n return false;\n } else {\n return true;\n }\n });\n }", "result_size": 2, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "colinhacks__zod__custom__downstream__1hop_125899", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["ZodAny", "superRefine", "cleanParams"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"]}, "metadata": {"anchor": "custom", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "anchor_source": "export function custom(\n check?: (data: any) => any,\n _params: string | CustomParams | ((input: any) => CustomParams) = {},\n /**\n * @deprecated\n *\n * Pass `fatal` into the params object instead:\n *\n * ```ts\n * z.string().custom((val) => val.length > 5, { fatal: false })\n * ```\n *\n */\n fatal?: boolean\n): ZodType {\n if (check)\n return ZodAny.create().superRefine((data, ctx) => {\n const r = check(data);\n if (r instanceof Promise) {\n return r.then((r) => {\n if (!r) {\n const params = cleanParams(_params, data);\n const _fatal = params.fatal ?? fatal ?? true;\n ctx.addIssue({ code: \"custom\", ...params, fatal: _fatal });\n }\n });\n }\n if (!r) {\n const params = cleanParams(_params, data);\n const _fatal = params.fatal ?? fatal ?? true;\n ctx.addIssue({ code: \"custom\", ...params, fatal: _fatal });\n }\n return;\n });\n return ZodAny.create();\n}", "result_size": 3, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "trpc__trpc__splitLink__downstream__1hop_f7a3a4", "repo": "trpc/trpc", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["subscribe", "asArray"], "call_files": ["private/tmp/repos/trpc__trpc/packages/server/src/observable/types.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/splitLink.ts"]}, "metadata": {"anchor": "splitLink", "anchor_file": "private/tmp/repos/trpc__trpc/packages/client/src/links/splitLink.ts", "anchor_source": "export function splitLink(opts: {\n condition: (op: Operation) => boolean;\n /**\n * The link to execute next if the test function returns `true`.\n */\n true: TRPCLink | TRPCLink[];\n /**\n * The link to execute next if the test function returns `false`.\n */\n false: TRPCLink | TRPCLink[];\n}): TRPCLink {\n return (runtime) => {\n const yes = asArray(opts.true).map((link) => link(runtime));\n const no = asArray(opts.false).map((link) => link(runtime));\n return (props) => {\n return observable((observer) => {\n const links = opts.condition(props.op) ? yes : no;\n return createChain({ op: props.op, links }).subscribe(observer);\n });\n };\n };\n}", "result_size": 4, "created_at": "2026-03-20T16:58:18.199328+00:00"}} {"sample_id": "immerjs__immer__scenario_update__downstream__1hop_2918dc", "repo": "immerjs/immer", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["createInitialState"], "call_files": ["private/tmp/repos/immerjs__immer/perf-testing/immutability-profiling.mjs"]}, "metadata": {"anchor": "scenario_update", "anchor_file": "private/tmp/repos/immerjs__immer/perf-testing/immutability-profiling.mjs", "anchor_source": "function scenario_update() {\n\tconst initialState = createInitialState()\n\tfor (let j = 0; j < MAX; j++) {\n\t\timmerReducer(initialState, actions.update(j))\n\t}\n}", "result_size": 1, "created_at": "2026-03-20T16:58:16.801413+00:00"}} {"sample_id": "immerjs__immer__registerChildFinalizationCallback__upstream__2hop_d115b9", "repo": "immerjs/immer", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["createProxy"], "hop_1_files": ["private/tmp/repos/immerjs__immer/src/core/immerClass.ts"], "hop_2": ["createDraft", "enableMapSet", "prepareSetCopy", "get"], "hop_2_files": ["private/tmp/repos/immerjs__immer/src/core/immerClass.ts", "private/tmp/repos/immerjs__immer/src/plugins/mapset.ts", "private/tmp/repos/immerjs__immer/src/plugins/mapset.ts", "private/tmp/repos/immerjs__immer/src/plugins/mapset.ts"]}, "metadata": {"anchor": "registerChildFinalizationCallback", "anchor_file": "private/tmp/repos/immerjs__immer/src/core/finalize.ts", "anchor_source": "export function registerChildFinalizationCallback(\n\tparent: ImmerState,\n\tchild: ImmerState,\n\tkey: string | number | symbol\n) {\n\tparent.callbacks_.push(function childCleanup(rootScope) {\n\t\tconst state: ImmerState = child\n\n\t\t// Can only continue if this is a draft owned by this scope\n\t\tif (!state || !isSameScope(state, rootScope)) {\n\t\t\treturn\n\t\t}\n\n\t\t// Handle potential set value finalization first\n\t\trootScope.mapSetPlugin_?.fixSetContents(state)\n\n\t\tconst finalizedValue = getFinalValue(state)\n\n\t\t// Update all locations in the parent that referenced this draft\n\t\tupdateDraftInParent(parent, state.draft_ ?? state, finalizedValue, key)\n\n\t\tgeneratePatchesAndFinalize(state, rootScope)\n\t})\n}", "result_size": 6, "created_at": "2026-03-20T16:58:16.801413+00:00", "file_content": ""}} {"sample_id": "psf__black__visit_Assign__downstream__1hop_cc7d7c", "repo": "psf/black", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["OffsetAndMagic", "_get_str_args"], "call_files": ["private/tmp/repos/psf__black/src/black/handle_ipynb_magics.py", "private/tmp/repos/psf__black/src/black/handle_ipynb_magics.py"]}, "metadata": {"anchor": "visit_Assign", "anchor_file": "private/tmp/repos/psf__black/src/black/handle_ipynb_magics.py", "anchor_source": "def visit_Assign(self, node: ast.Assign) -> None:\n \"\"\"Look for system assign magics.\n\n For example,\n\n black_version = !black --version\n env = %env var\n\n would have been (respectively) transformed to\n\n black_version = get_ipython().getoutput('black --version')\n env = get_ipython().run_line_magic('env', 'var')\n\n and we look for instances of any of the latter.\n \"\"\"\n if isinstance(node.value, ast.Call) and _is_ipython_magic(node.value.func):\n args = _get_str_args(node.value.args)\n if node.value.func.attr == \"getoutput\":\n src = f\"!{args[0]}\"\n elif node.value.func.attr == \"run_line_magic\":\n src = f\"%{args[0]}\"\n if args[1]:\n src += f\" {args[1]}\"\n else:\n raise AssertionError(\n f\"Unexpected IPython magic {node.value.func.attr!r} found. \"\n \"Please report a bug on https://github.com/psf/black/issues.\"\n ) from None\n self.magics[node.value.lineno].append(\n OffsetAndMagic(node.value.col_offset, src)\n )\n self.generic_visit(node)", "result_size": 2, "created_at": "2026-03-20T16:58:17.494246+00:00"}} {"sample_id": "colinhacks__zod__prefixIssues__upstream__1hop_28a772", "repo": "colinhacks/zod", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["handlePropertyResult", "handleCheckPropertyResult", "handleMapResult", "handleArrayResult", "handleTupleResult", "parse"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/schemas.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/checks.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/schemas.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/schemas.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/schemas.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/schemas.ts"]}, "metadata": {"anchor": "prefixIssues", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/util.ts", "anchor_source": "export function prefixIssues(path: PropertyKey, issues: errors.$ZodRawIssue[]): errors.$ZodRawIssue[] {\n return issues.map((iss) => {\n (iss as any).path ??= [];\n (iss as any).path.unshift(path);\n return iss;\n });\n}", "result_size": 8, "created_at": "2026-03-20T16:58:16.474869+00:00", "file_content": ""}} {"sample_id": "pallets__jinja__new_context__upstream__1hop_4f8002", "repo": "pallets/jinja", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["render_async", "make_module", "generate", "render", "generate_async", "make_module_async"], "call_files": ["private/tmp/repos/pallets__jinja/src/jinja2/nativetypes.py", "private/tmp/repos/pallets__jinja/src/jinja2/environment.py", "private/tmp/repos/pallets__jinja/src/jinja2/environment.py", "private/tmp/repos/pallets__jinja/src/jinja2/environment.py", "private/tmp/repos/pallets__jinja/src/jinja2/environment.py", "private/tmp/repos/pallets__jinja/src/jinja2/environment.py"]}, "metadata": {"anchor": "new_context", "anchor_file": "private/tmp/repos/pallets__jinja/src/jinja2/environment.py", "anchor_source": "def new_context(\n self,\n vars: dict[str, t.Any] | None = None,\n shared: bool = False,\n locals: t.Mapping[str, t.Any] | None = None,\n ) -> Context:\n \"\"\"Create a new :class:`Context` for this template. The vars\n provided will be passed to the template. Per default the globals\n are added to the context. If shared is set to `True` the data\n is passed as is to the context without adding the globals.\n\n `locals` can be a dict of local variables for internal usage.\n \"\"\"\n return new_context(\n self.environment, self.name, self.blocks, vars, shared, self.globals, locals\n )", "result_size": 8, "created_at": "2026-03-20T16:58:17.229656+00:00", "file_content": ""}} {"sample_id": "python-poetry__poetry___get_credentials_for_url__downstream__1hop_330f78", "repo": "python-poetry/poetry", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["_get_credentials_for_repository"], "call_files": ["private/tmp/repos/python-poetry__poetry/src/poetry/utils/authenticator.py"]}, "metadata": {"anchor": "_get_credentials_for_url", "anchor_file": "private/tmp/repos/python-poetry__poetry/src/poetry/utils/authenticator.py", "anchor_source": "def _get_credentials_for_url(\n self, url: str, exact_match: bool = False\n ) -> HTTPAuthCredential:\n repository = self.get_repository_config_for_url(url, exact_match)\n\n credential = (\n self._get_credentials_for_repository(repository=repository)\n if repository is not None\n else HTTPAuthCredential()\n )\n\n if credential.password is None:\n parsed_url = urllib.parse.urlsplit(url)\n netloc = parsed_url.netloc\n credential = self._password_manager.get_credential(\n url, netloc, username=credential.username\n )\n\n return HTTPAuthCredential(\n username=credential.username, password=credential.password\n )\n\n return credential", "result_size": 1, "created_at": "2026-03-20T16:58:17.758794+00:00"}} {"sample_id": "pallets__click__get_help_option__upstream__1hop_4574d5", "repo": "pallets/click", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["get_params", "show"], "call_files": ["private/tmp/repos/pallets__click/src/click/core.py", "private/tmp/repos/pallets__click/src/click/exceptions.py"]}, "metadata": {"anchor": "get_help_option", "anchor_file": "private/tmp/repos/pallets__click/src/click/core.py", "anchor_source": "def get_help_option(self, ctx: Context) -> Option | None:\n \"\"\"Returns the help option object.\n\n Skipped if :attr:`add_help_option` is ``False``.\n\n .. versionchanged:: 8.1.8\n The help option is now cached to avoid creating it multiple times.\n \"\"\"\n help_option_names = self.get_help_option_names(ctx)\n\n if not help_option_names or not self.add_help_option:\n return None\n\n # Cache the help option object in private _help_option attribute to\n # avoid creating it multiple times. Not doing this will break the\n # callback odering by iter_params_for_processing(), which relies on\n # object comparison.\n if self._help_option is None:\n # Avoid circular import.\n from .decorators import help_option\n\n # Apply help_option decorator and pop resulting option\n help_option(*help_option_names)(self)\n self._help_option = self.params.pop() # type: ignore[assignment]\n\n return self._help_option", "result_size": 2, "created_at": "2026-03-20T16:58:17.078639+00:00", "file_content": ""}} {"sample_id": "rq__rq__retry__upstream__2hop_0febf0", "repo": "rq/rq", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["handle_job_failure", "cleanup"], "hop_1_files": ["private/tmp/repos/rq__rq/rq/worker/base.py", "private/tmp/repos/rq__rq/rq/registry.py"], "hop_2": ["perform_job", "clean_registries", "handle_job_retry", "monitor_work_horse", "get_job_and_execution_ids", "cleanup"], "hop_2_files": ["private/tmp/repos/rq__rq/rq/worker/base.py", "private/tmp/repos/rq__rq/rq/registry.py", "private/tmp/repos/rq__rq/rq/worker/base.py", "private/tmp/repos/rq__rq/rq/worker/worker_classes.py", "private/tmp/repos/rq__rq/rq/registry.py", "private/tmp/repos/rq__rq/rq/intermediate_queue.py"]}, "metadata": {"anchor": "retry", "anchor_file": "private/tmp/repos/rq__rq/rq/job.py", "anchor_source": "def retry(self, queue: 'Queue', pipeline: 'Pipeline'):\n \"\"\"Should be called when a job was enqueued with queue.enqueue(retry=Retry(...)) raises an exception.\n\n Requeues or schedules the job for execution. If retry_interval was set,\n the job will be scheduled for later; otherwise it will be enqueued immediately.\n\n Args:\n queue (Queue): The queue to retry the job on\n pipeline (Pipeline): The Redis' pipeline to use\n \"\"\"\n retry_interval = self.get_retry_interval()\n assert self.retries_left\n self.retries_left = self.retries_left - 1\n if retry_interval:\n scheduled_datetime = now() + timedelta(seconds=retry_interval)\n self.set_status(JobStatus.SCHEDULED)\n queue.schedule_job(self, scheduled_datetime, pipeline=pipeline)\n self.log.info(\n 'Job %s: scheduled for retry at %s, %s remaining', self.id, scheduled_datetime, self.retries_left\n )\n else:\n queue._enqueue_job(self, pipeline=pipeline)\n self.log.info('Job %s: enqueued for retry, %s remaining', self.id, self.retries_left)", "result_size": 6, "created_at": "2026-03-20T16:58:17.875204+00:00", "file_content": ""}} {"sample_id": "locustio__locust__quit__upstream__1hop_72c09d", "repo": "locustio/locust", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["on_quitting", "start_automatic_run", "stop_and_optionally_quit", "start", "handle_message", "main", "shutdown"], "call_files": ["private/tmp/repos/locustio__locust/locust/runners.py", "private/tmp/repos/locustio__locust/locust/main.py", "private/tmp/repos/locustio__locust/locust/main.py", "private/tmp/repos/locustio__locust/locust/runners.py", "private/tmp/repos/locustio__locust/locust/runners.py", "private/tmp/repos/locustio__locust/locust/main.py", "private/tmp/repos/locustio__locust/locust/main.py"]}, "metadata": {"anchor": "quit", "anchor_file": "private/tmp/repos/locustio__locust/locust/runners.py", "anchor_source": "def quit(self) -> None:\n self.stop(send_stop_to_client=False)\n logger.debug(\"Quitting...\")\n for client in self.clients.all:\n logger.debug(f\"Sending quit message to worker {client.id} (index {self.get_worker_index(client.id)})\")\n self.server.send_to_client(Message(\"quit\", None, client.id))\n gevent.sleep(0.5) # wait for final stats report from all workers\n self.greenlet.kill(block=True)", "result_size": 7, "created_at": "2026-03-20T16:58:16.951273+00:00", "file_content": ""}} {"sample_id": "trpc__trpc__toSearchString__upstream__1hop_ba4d5e", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["DocItemMetadata", "BlogPostPageMetadata", "Page"], "call_files": ["private/tmp/repos/trpc__trpc/www/src/theme/DocItem/Metadata/index.tsx", "private/tmp/repos/trpc__trpc/www/src/theme/BlogPostPage/Metadata/index.tsx", "private/tmp/repos/trpc__trpc/www/src/pages/pricing.tsx"]}, "metadata": {"anchor": "toSearchString", "anchor_file": "private/tmp/repos/trpc__trpc/www/og-image/utils/zodParams.ts", "anchor_source": "toSearchString: (obj: (typeof schema)['_input']) => {\n schema.parse(obj);\n return `input=${encodeURIComponent(JSON.stringify(obj))}`;\n },", "result_size": 3, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "rq__rq__handle_job_failure__upstream__2hop_d1f9d3", "repo": "rq/rq", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["handle_job_retry", "monitor_work_horse", "cleanup", "perform_job"], "hop_1_files": ["private/tmp/repos/rq__rq/rq/worker/base.py", "private/tmp/repos/rq__rq/rq/worker/worker_classes.py", "private/tmp/repos/rq__rq/rq/intermediate_queue.py", "private/tmp/repos/rq__rq/rq/worker/base.py"], "hop_2": ["clean_intermediate_queue", "clean_registries", "main_work_horse", "execute_job"], "hop_2_files": ["private/tmp/repos/rq__rq/rq/maintenance.py", "private/tmp/repos/rq__rq/rq/worker/base.py", "private/tmp/repos/rq__rq/rq/worker/base.py", "private/tmp/repos/rq__rq/rq/worker/worker_classes.py"]}, "metadata": {"anchor": "handle_job_failure", "anchor_file": "private/tmp/repos/rq__rq/rq/worker/base.py", "anchor_source": "def handle_job_failure(self, job: 'Job', queue: 'Queue', started_job_registry=None, exc_string=''):\n \"\"\"\n Handles the failure or an executing job by:\n 1. Setting the job status to failed\n 2. Removing the job from StartedJobRegistry\n 3. Setting the workers current job to None\n 4. Add the job to FailedJobRegistry\n `save_exc_to_job` should only be used for testing purposes\n \"\"\"\n self.log.debug('Worker %s: handling failed execution of job %s', self.name, job.id)\n with self.connection.pipeline() as pipeline:\n if started_job_registry is None:\n started_job_registry = StartedJobRegistry(\n job.origin, self.connection, job_class=self.job_class, serializer=self.serializer\n )\n\n # check whether a job was stopped intentionally and set the job\n # status appropriately if it was this job.\n job_is_stopped = self._stopped_job_id == job.id\n retry = job.should_retry and not job_is_stopped\n\n if job_is_stopped:\n job.set_status(JobStatus.STOPPED, pipeline=pipeline)\n self._stopped_job_id = None\n else:\n # Requeue/reschedule if retry is configured, otherwise\n if not retry:\n job.set_status(JobStatus.FAILED, pipeline=pipeline)\n\n self.cleanup_execution(job, pipeline=pipeline)\n\n if not self.disable_default_exception_handler and not retry:\n job._handle_failure(exc_string, pipeline=pipeline, worker_name=self.name)\n with suppress(redis.exceptions.ConnectionError):\n pipeline.execute()\n\n self.increment_failed_job_count(pipeline)\n if job.started_at and job.ended_at:\n self.increment_total_working_time(job.ended_at - job.started_at, pipeline)\n\n if retry:\n job.retry(queue, pipeline)\n enqueue_dependents = False\n else:\n enqueue_dependents = True\n\n try:\n pipeline.execute()\n if enqueue_dependents:\n queue.enqueue_dependents(job)\n except Exception as e:\n # Ensure that custom exception handlers are called\n # even if Redis is down\n self.log.error(\n 'Worker %s: exception during pipeline execute or enqueue_dependents for job %s: %s',\n self.name,\n job.id,\n e,\n )\n pass", "result_size": 4, "created_at": "2026-03-20T16:58:17.875204+00:00", "file_content": ""}} {"sample_id": "rq__rq__fork_work_horse__downstream__1hop_205489", "repo": "rq/rq", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["procline", "main_work_horse"], "call_files": ["private/tmp/repos/rq__rq/rq/worker/base.py", "private/tmp/repos/rq__rq/rq/worker/base.py"]}, "metadata": {"anchor": "fork_work_horse", "anchor_file": "private/tmp/repos/rq__rq/rq/worker/worker_classes.py", "anchor_source": "def fork_work_horse(self, job: 'Job', queue: 'Queue'):\n \"\"\"Spawns a work horse to perform the actual work and passes it a job.\n This is where the `fork()` actually happens.\n\n Args:\n job (Job): The Job that will be ran\n queue (Queue): The queue\n \"\"\"\n child_pid = os.fork()\n os.environ['RQ_WORKER_ID'] = self.name\n os.environ['RQ_JOB_ID'] = job.id\n if child_pid == 0:\n os.setpgrp()\n self.main_work_horse(job, queue)\n os._exit(0) # just in case\n else:\n self._horse_pid = child_pid\n self.procline(f'Forked {child_pid} at {time.time()}')", "result_size": 2, "created_at": "2026-03-20T16:58:17.875204+00:00"}} {"sample_id": "immerjs__immer__createProxy__downstream__1hop_54c658", "repo": "immerjs/immer", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["createProxyProxy", "registerChildFinalizationCallback", "rootDraftCleanup", "getPlugin"], "call_files": ["private/tmp/repos/immerjs__immer/src/core/proxy.ts", "private/tmp/repos/immerjs__immer/src/core/finalize.ts", "private/tmp/repos/immerjs__immer/src/core/immerClass.ts", "private/tmp/repos/immerjs__immer/src/utils/plugins.ts"]}, "metadata": {"anchor": "createProxy", "anchor_file": "private/tmp/repos/immerjs__immer/src/core/immerClass.ts", "anchor_source": "export function createProxy(\n\trootScope: ImmerScope,\n\tvalue: T,\n\tparent?: ImmerState,\n\tkey?: string | number | symbol\n): Drafted {\n\t// precondition: createProxy should be guarded by isDraftable, so we know we can safely draft\n\t// returning a tuple here lets us skip a proxy access\n\t// to DRAFT_STATE later\n\tconst [draft, state] = isMap(value)\n\t\t? getPlugin(PluginMapSet).proxyMap_(value, parent)\n\t\t: isSet(value)\n\t\t? getPlugin(PluginMapSet).proxySet_(value, parent)\n\t\t: createProxyProxy(value, parent)\n\n\tconst scope = parent?.scope_ ?? getCurrentScope()\n\tscope.drafts_.push(draft)\n\n\t// Ensure the parent callbacks are passed down so we actually\n\t// track all callbacks added throughout the tree\n\tstate.callbacks_ = parent?.callbacks_ ?? []\n\tstate.key_ = key\n\n\tif (parent && key !== undefined) {\n\t\tregisterChildFinalizationCallback(parent, state, key)\n\t} else {\n\t\t// It's a root draft, register it with the scope\n\t\tstate.callbacks_.push(function rootDraftCleanup(rootScope) {\n\t\t\trootScope.mapSetPlugin_?.fixSetContents(state)\n\n\t\t\tconst {patchPlugin_} = rootScope\n\n\t\t\tif (state.modified_ && patchPlugin_) {\n\t\t\t\tpatchPlugin_.generatePatches_(state, [], rootScope)\n\t\t\t}\n\t\t})\n\t}\n\n\treturn draft as any\n}", "result_size": 4, "created_at": "2026-03-20T16:58:16.801413+00:00"}} {"sample_id": "psf__requests__to_native_string__upstream__1hop_7aa8c4", "repo": "psf/requests", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["_basic_auth_str", "prepare_headers", "prepare_url", "resolve_redirects", "get_full_url", "prepare_method"], "call_files": ["private/tmp/repos/requests/src/requests/auth.py", "private/tmp/repos/requests/src/requests/models.py", "private/tmp/repos/requests/src/requests/models.py", "private/tmp/repos/requests/src/requests/sessions.py", "private/tmp/repos/requests/src/requests/cookies.py", "private/tmp/repos/requests/src/requests/models.py"]}, "metadata": {"anchor": "to_native_string", "anchor_file": "private/tmp/repos/requests/src/requests/_internal_utils.py", "anchor_source": "def to_native_string(string, encoding=\"ascii\"):\n \"\"\"Given a string object, regardless of type, returns a representation of\n that string in the native string type, encoding and decoding where\n necessary. This assumes ASCII unless told otherwise.\n \"\"\"\n if isinstance(string, builtin_str):\n out = string\n else:\n out = string.decode(encoding)\n\n return out", "result_size": 6, "created_at": "2026-03-20T16:58:17.570287+00:00", "file_content": "\"\"\"\nrequests._internal_utils\n~~~~~~~~~~~~~~\n\nProvides utility functions that are consumed internally by Requests\nwhich depend on extremely few external helpers (such as compat)\n\"\"\"\n\nimport re\n\nfrom .compat import builtin_str\n\n_VALID_HEADER_NAME_RE_BYTE = re.compile(rb\"^[^:\\s][^:\\r\\n]*$\")\n_VALID_HEADER_NAME_RE_STR = re.compile(r\"^[^:\\s][^:\\r\\n]*$\")\n_VALID_HEADER_VALUE_RE_BYTE = re.compile(rb\"^\\S[^\\r\\n]*$|^$\")\n_VALID_HEADER_VALUE_RE_STR = re.compile(r\"^\\S[^\\r\\n]*$|^$\")\n\n_HEADER_VALIDATORS_STR = (_VALID_HEADER_NAME_RE_STR, _VALID_HEADER_VALUE_RE_STR)\n_HEADER_VALIDATORS_BYTE = (_VALID_HEADER_NAME_RE_BYTE, _VALID_HEADER_VALUE_RE_BYTE)\nHEADER_VALIDATORS = {\n bytes: _HEADER_VALIDATORS_BYTE,\n str: _HEADER_VALIDATORS_STR,\n}\n\n\ndef to_native_string(string, encoding=\"ascii\"):\n \"\"\"Given a string object, regardless of type, returns a representation of\n that string in the native string type, encoding and decoding where\n necessary. This assumes ASCII unless told otherwise.\n \"\"\"\n if isinstance(string, builtin_str):\n out = string\n else:\n out = string.decode(encoding)\n\n return out\n\n\ndef unicode_is_ascii(u_string):\n \"\"\"Determine if unicode string only contains ASCII characters.\n\n :param str u_string: unicode string to check. Must be unicode\n and not Python 2 `str`.\n :rtype: bool\n \"\"\"\n assert isinstance(u_string, str)\n try:\n u_string.encode(\"ascii\")\n return True\n except UnicodeEncodeError:\n return False\n"}} {"sample_id": "pallets__jinja__visit_DerivedContextReference__downstream__1hop_689407", "repo": "pallets/jinja", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["derive_context", "write"], "call_files": ["private/tmp/repos/pallets__jinja/src/jinja2/compiler.py", "private/tmp/repos/pallets__jinja/src/jinja2/compiler.py"]}, "metadata": {"anchor": "visit_DerivedContextReference", "anchor_file": "private/tmp/repos/pallets__jinja/src/jinja2/compiler.py", "anchor_source": "def visit_DerivedContextReference(\n self, node: nodes.DerivedContextReference, frame: Frame\n ) -> None:\n self.write(self.derive_context(frame))", "result_size": 2, "created_at": "2026-03-20T16:58:17.229656+00:00"}} {"sample_id": "trpc__trpc__parseTRPCMessage__upstream__2hop_138316", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["getWSConnectionHandler"], "hop_1_files": ["private/tmp/repos/trpc__trpc/packages/server/src/adapters/ws.ts"], "hop_2": ["fastifyTRPCPlugin", "applyWSSHandler"], "hop_2_files": ["private/tmp/repos/trpc__trpc/packages/server/src/adapters/fastify/fastifyTRPCPlugin.ts", "private/tmp/repos/trpc__trpc/packages/server/src/adapters/ws.ts"]}, "metadata": {"anchor": "parseTRPCMessage", "anchor_file": "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts", "anchor_source": "export function parseTRPCMessage(\n obj: unknown,\n transformer: CombinedDataTransformer,\n): TRPCClientOutgoingMessage {\n assertIsObject(obj);\n\n const { id, jsonrpc, method, params } = obj;\n assertIsRequestId(id);\n assertIsJSONRPC2OrUndefined(jsonrpc);\n\n if (method === 'subscription.stop') {\n return {\n id,\n jsonrpc,\n method,\n };\n }\n assertIsProcedureType(method);\n assertIsObject(params);\n const { input: rawInput, path, lastEventId } = params;\n\n assertIsString(path);\n if (lastEventId !== undefined) {\n assertIsString(lastEventId);\n }\n\n const input = transformer.input.deserialize(rawInput);\n\n return {\n id,\n jsonrpc,\n method,\n params: {\n input,\n path,\n lastEventId,\n },\n };\n}", "result_size": 4, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "celery__celery__start_scheduler__downstream__2hop_3368cc", "repo": "celery/celery", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["setup_logging", "banner", "Beat", "install_sync_handler"], "hop_1_files": ["private/tmp/repos/celery/celery/apps/beat.py", "private/tmp/repos/celery/celery/apps/beat.py", "private/tmp/repos/celery/celery/apps/beat.py", "private/tmp/repos/celery/celery/apps/beat.py"], "hop_2": ["startup_info"], "hop_2_files": ["private/tmp/repos/celery/celery/apps/beat.py"]}, "metadata": {"anchor": "start_scheduler", "anchor_file": "private/tmp/repos/celery/celery/apps/beat.py", "anchor_source": "def start_scheduler(self) -> None:\n if self.pidfile:\n platforms.create_pidlock(self.pidfile)\n service = self.Service(\n app=self.app,\n max_interval=self.max_interval,\n scheduler_cls=self.scheduler_cls,\n schedule_filename=self.schedule,\n )\n\n if not self.quiet:\n print(self.banner(service))\n\n self.setup_logging()\n if self.socket_timeout:\n logger.debug('Setting default socket timeout to %r',\n self.socket_timeout)\n socket.setdefaulttimeout(self.socket_timeout)\n try:\n self.install_sync_handler(service)\n service.start()\n except Exception as exc:\n logger.critical('beat raised exception %s: %r',\n exc.__class__, exc,\n exc_info=True)\n raise", "result_size": 1, "created_at": "2026-03-20T16:58:16.326235+00:00"}} {"sample_id": "trpc__trpc__createTRPCErrorInterceptor__downstream__1hop_30bba7", "repo": "trpc/trpc", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["resolveTransformer", "deserialize"], "call_files": ["private/tmp/repos/trpc__trpc/packages/openapi/src/heyapi/index.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/transformer.ts"]}, "metadata": {"anchor": "createTRPCErrorInterceptor", "anchor_file": "private/tmp/repos/trpc__trpc/packages/openapi/src/heyapi/index.ts", "anchor_source": "export function createTRPCErrorInterceptor(\n transformerOpts: DataTransformerOptions,\n) {\n const transformer = resolveTransformer(transformerOpts);\n return (error: unknown) => {\n if (!!error && typeof error === 'object' && 'error' in error) {\n (error as any).error = transformer.output.deserialize(\n (error as any).error,\n );\n }\n return error;\n };\n}", "result_size": 2, "created_at": "2026-03-20T16:58:18.199328+00:00"}} {"sample_id": "rq__rq__import_attribute__upstream__1hop_94341b", "repo": "rq/rq", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["import_job_class", "failure_callback", "stopped_callback", "success_callback", "import_worker_class", "import_queue_class", "resolve_serializer"], "call_files": ["private/tmp/repos/rq__rq/rq/utils.py", "private/tmp/repos/rq__rq/rq/job.py", "private/tmp/repos/rq__rq/rq/job.py", "private/tmp/repos/rq__rq/rq/job.py", "private/tmp/repos/rq__rq/rq/utils.py", "private/tmp/repos/rq__rq/rq/utils.py", "private/tmp/repos/rq__rq/rq/serializers.py"]}, "metadata": {"anchor": "import_attribute", "anchor_file": "private/tmp/repos/rq__rq/rq/utils.py", "anchor_source": "def import_attribute(name: str) -> Callable[..., Any]:\n \"\"\"Returns an attribute from a dotted path name. Example: `path.to.func`.\n\n When the attribute we look for is a staticmethod, module name in its\n dotted path is not the last-before-end word\n\n E.g.: package_a.package_b.module_a.ClassA.my_static_method\n\n Thus we remove the bits from the end of the name until we can import it\n\n Args:\n name (str): The name (reference) to the path.\n\n Raises:\n ValueError: If no module is found or invalid attribute name.\n\n Returns:\n Any: An attribute (normally a Callable)\n \"\"\"\n name_bits = name.split('.')\n module_name_bits, attribute_bits = name_bits[:-1], [name_bits[-1]]\n module = None\n while len(module_name_bits):\n try:\n module_name = '.'.join(module_name_bits)\n module = importlib.import_module(module_name)\n break\n except ImportError:\n attribute_bits.insert(0, module_name_bits.pop())\n\n if module is None:\n # maybe it's a builtin\n try:\n return __builtins__[name] # type: ignore[index]\n except KeyError:\n raise ValueError(f'Invalid attribute name: {name}')\n\n attribute_name = '.'.join(attribute_bits)\n if hasattr(module, attribute_name):\n return getattr(module, attribute_name)\n # staticmethods\n attribute_name = attribute_bits.pop()\n attribute_owner_name = '.'.join(attribute_bits)\n try:\n attribute_owner = getattr(module, attribute_owner_name)\n except: # noqa\n raise ValueError(f'Invalid attribute name: {attribute_name}')\n\n if not hasattr(attribute_owner, attribute_name):\n raise ValueError(f'Invalid attribute name: {name}')\n return getattr(attribute_owner, attribute_name)", "result_size": 7, "created_at": "2026-03-20T16:58:17.875204+00:00", "file_content": ""}} {"sample_id": "paramiko__paramiko___send_version__downstream__2hop_38de47", "repo": "paramiko/paramiko", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["_read_packet", "_send_packet"], "hop_1_files": ["private/tmp/repos/paramiko/paramiko/sftp.py", "private/tmp/repos/paramiko/paramiko/sftp.py"], "hop_2": ["_write_all", "_log", "_read_all"], "hop_2_files": ["private/tmp/repos/paramiko/paramiko/sftp.py", "private/tmp/repos/paramiko/paramiko/sftp.py", "private/tmp/repos/paramiko/paramiko/sftp.py"]}, "metadata": {"anchor": "_send_version", "anchor_file": "private/tmp/repos/paramiko/paramiko/sftp.py", "anchor_source": "def _send_version(self):\n m = Message()\n m.add_int(_VERSION)\n self._send_packet(CMD_INIT, m)\n t, data = self._read_packet()\n if t != CMD_VERSION:\n raise SFTPError(\"Incompatible sftp protocol\")\n version = struct.unpack(\">I\", data[:4])[0]\n # if version != _VERSION:\n # raise SFTPError('Incompatible sftp protocol')\n return version", "result_size": 3, "created_at": "2026-03-20T16:58:17.364834+00:00"}} {"sample_id": "trpc__trpc__next__downstream__2hop_cd6872", "repo": "trpc/trpc", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["distinctUntilChanged"], "hop_1_files": ["private/tmp/repos/trpc__trpc/packages/server/src/observable/operators.ts"], "hop_2": ["subscribe"], "hop_2_files": ["private/tmp/repos/trpc__trpc/packages/server/src/observable/types.ts"]}, "metadata": {"anchor": "next", "anchor_file": "private/tmp/repos/trpc__trpc/packages/server/src/observable/operators.ts", "anchor_source": "next(value) {\n if (lastValue !== distinctUnsetMarker && compare(lastValue, value)) {\n return;\n }\n lastValue = value;\n destination.next(value);\n },", "result_size": 1, "created_at": "2026-03-20T16:58:18.199328+00:00"}} {"sample_id": "colinhacks__zod___nativeEnum__downstream__1hop_d9281c", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["normalizeParams"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/util.ts"]}, "metadata": {"anchor": "_nativeEnum", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/api.ts", "anchor_source": "export function _nativeEnum(\n Class: util.SchemaClass,\n entries: T,\n params?: string | $ZodEnumParams\n): schemas.$ZodEnum {\n return new Class({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n }) as any;\n}", "result_size": 1, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "colinhacks__zod__issue__upstream__2hop_02bf3a", "repo": "colinhacks/zod", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["issue"], "hop_1_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/util.ts"], "hop_2": ["parse", "_superRefine", "addIssue", "handleRefineResult"], "hop_2_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/schemas.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/api.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/schemas.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/schemas.ts"]}, "metadata": {"anchor": "issue", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/util.ts", "anchor_source": "export function issue(...args: [string | errors.$ZodRawIssue, any?, any?]): errors.$ZodRawIssue {\n const [iss, input, inst] = args;\n if (typeof iss === \"string\") {\n return {\n message: iss,\n code: \"custom\",\n input,\n inst,\n };\n }\n\n return { ...iss };\n}", "result_size": 7, "created_at": "2026-03-20T16:58:16.474869+00:00", "file_content": ""}} {"sample_id": "pallets__flask__show_server_banner__upstream__1hop_efd301", "repo": "pallets/flask", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["run_command", "run"], "call_files": ["private/tmp/repos/flask/src/flask/cli.py", "private/tmp/repos/flask/src/flask/app.py"]}, "metadata": {"anchor": "show_server_banner", "anchor_file": "private/tmp/repos/flask/src/flask/cli.py", "anchor_source": "def show_server_banner(debug: bool, app_import_path: str | None) -> None:\n \"\"\"Show extra startup messages the first time the server is run,\n ignoring the reloader.\n \"\"\"\n if is_running_from_reloader():\n return\n\n if app_import_path is not None:\n click.echo(f\" * Serving Flask app '{app_import_path}'\")\n\n if debug is not None:\n click.echo(f\" * Debug mode: {'on' if debug else 'off'}\")", "result_size": 2, "created_at": "2026-03-20T16:58:17.167063+00:00", "file_content": "from __future__ import annotations\n\nimport ast\nimport collections.abc as cabc\nimport importlib.metadata\nimport inspect\nimport os\nimport platform\nimport re\nimport sys\nimport traceback\nimport typing as t\nfrom functools import update_wrapper\nfrom operator import itemgetter\nfrom types import ModuleType\n\nimport click\nfrom click.core import ParameterSource\nfrom werkzeug import run_simple\nfrom werkzeug.serving import is_running_from_reloader\nfrom werkzeug.utils import import_string\n\nfrom .globals import current_app\nfrom .helpers import get_debug_flag\nfrom .helpers import get_load_dotenv\n\nif t.TYPE_CHECKING:\n import ssl\n\n from _typeshed.wsgi import StartResponse\n from _typeshed.wsgi import WSGIApplication\n from _typeshed.wsgi import WSGIEnvironment\n\n from .app import Flask\n\n\nclass NoAppException(click.UsageError):\n \"\"\"Raised if an application cannot be found or loaded.\"\"\"\n\n\ndef find_best_app(module: ModuleType) -> Flask:\n \"\"\"Given a module instance this tries to find the best possible\n application in the module or raises an exception.\n \"\"\"\n from . import Flask\n\n # Search for the most common names first.\n for attr_name in (\"app\", \"application\"):\n app = getattr(module, attr_name, None)\n\n if isinstance(app, Flask):\n return app\n\n # Otherwise find the only object that is a Flask instance.\n matches = [v for v in module.__dict__.values() if isinstance(v, Flask)]\n\n if len(matches) == 1:\n return matches[0]\n elif len(matches) > 1:\n raise NoAppException(\n \"Detected multiple Flask applications in module\"\n f\" '{module.__name__}'. Use '{module.__name__}:name'\"\n \" to specify the correct one.\"\n )\n\n # Search for app factory functions.\n for attr_name in (\"create_app\", \"make_app\"):\n app_factory = getattr(module, attr_name, None)\n\n if inspect.isfunction(app_factory):\n try:\n app = app_factory()\n\n if isinstance(app, Flask):\n return app\n except TypeError as e:\n if not _called_with_wrong_args(app_factory):\n raise\n\n raise NoAppException(\n f\"Detected factory '{attr_name}' in module '{module.__name__}',\"\n \" but could not call it without arguments. Use\"\n f\" '{module.__name__}:{attr_name}(args)'\"\n \" to specify arguments.\"\n ) from e\n\n raise NoAppException(\n \"Failed to find Flask application or factory in module\"\n f\" '{module.__name__}'. Use '{module.__name__}:name'\"\n \" to specify one.\"\n )\n\n\ndef _called_with_wrong_args(f: t.Callable[..., Flask]) -> bool:\n \"\"\"Check whether calling a function raised a ``TypeError`` because\n the call failed or because something in the factory raised the\n error.\n\n :param f: The function that was called.\n :return: ``True`` if the call failed.\n \"\"\"\n tb = sys.exc_info()[2]\n\n try:\n while tb is not None:\n if tb.tb_frame.f_code is f.__code__:\n # In the function, it was called successfully.\n return False\n\n tb = tb.tb_next\n\n # Didn't reach the function.\n return True\n finally:\n # Delete tb to break a circular reference.\n # https://docs.python.org/2/library/sys.html#sys.exc_info\n del tb\n\n\ndef find_app_by_string(module: ModuleType, app_name: str) -> Flask:\n \"\"\"Check if the given string is a variable name or a function. Call\n a function to get the app instance, or return the variable directly.\n \"\"\"\n from . import Flask\n\n # Parse app_name as a single expression to determine if it's a valid\n # attribute name or function call.\n try:\n expr = ast.parse(app_name.strip(), mode=\"eval\").body\n except SyntaxError:\n raise NoAppException(\n f\"Failed to parse {app_name!r} as an attribute name or function call.\"\n ) from None\n\n if isinstance(expr, ast.Name):\n name = expr.id\n args = []\n kwargs = {}\n elif isinstance(expr, ast.Call):\n # Ensure the function name is an attribute name only.\n if not isinstance(expr.func, ast.Name):\n raise NoAppException(\n f\"Function reference must be a simple name: {app_name!r}.\"\n )\n\n name = expr.func.id\n\n # Parse the positional and keyword arguments as literals.\n try:\n args = [ast.literal_eval(arg) for arg in expr.args]\n kwargs = {\n kw.arg: ast.literal_eval(kw.value)\n for kw in expr.keywords\n if kw.arg is not None\n }\n except ValueError:\n # literal_eval gives cryptic error messages, show a generic\n # message with the full expression instead.\n raise NoAppException(\n f\"Failed to parse arguments as literal values: {app_name!r}.\"\n ) from None\n else:\n raise NoAppException(\n f\"Failed to parse {app_name!r} as an attribute name or function call.\"\n )\n\n try:\n attr = getattr(module, name)\n except AttributeError as e:\n raise NoAppException(\n f\"Failed to find attribute {name!r} in {module.__name__!r}.\"\n ) from e\n\n # If the attribute is a function, call it with any args and kwargs\n # to get the real application.\n if inspect.isfunction(attr):\n try:\n app = attr(*args, **kwargs)\n except TypeError as e:\n if not _called_with_wrong_args(attr):\n raise\n\n raise NoAppException(\n f\"The factory {app_name!r} in module\"\n f\" {module.__name__!r} could not be called with the\"\n \" specified arguments.\"\n ) from e\n else:\n app = attr\n\n if isinstance(app, Flask):\n return app\n\n raise NoAppException(\n \"A valid Flask application was not obtained from\"\n f\" '{module.__name__}:{app_name}'.\"\n )\n\n\ndef prepare_import(path: str) -> str:\n \"\"\"Given a filename this will try to calculate the python path, add it\n to the search path and return the actual module name that is expected.\n \"\"\"\n path = os.path.realpath(path)\n\n fname, ext = os.path.splitext(path)\n if ext == \".py\":\n path = fname\n\n if os.path.basename(path) == \"__init__\":\n path = os.path.dirname(path)\n\n module_name = []\n\n # move up until outside package structure (no __init__.py)\n while True:\n path, name = os.path.split(path)\n module_name.append(name)\n\n if not os.path.exists(os.path.join(path, \"__init__.py\")):\n break\n\n if sys.path[0] != path:\n sys.path.insert(0, path)\n\n return \".\".join(module_name[::-1])\n\n\n@t.overload\ndef locate_app(\n module_name: str, app_name: str | None, raise_if_not_found: t.Literal[True] = True\n) -> Flask: ...\n\n\n@t.overload\ndef locate_app(\n module_name: str, app_name: str | None, raise_if_not_found: t.Literal[False] = ...\n) -> Flask | None: ...\n\n\ndef locate_app(\n module_name: str, app_name: str | None, raise_if_not_found: bool = True\n) -> Flask | None:\n try:\n __import__(module_name)\n except ImportError:\n # Reraise the ImportError if it occurred within the imported module.\n # Determine this by checking whether the trace has a depth > 1.\n if sys.exc_info()[2].tb_next: # type: ignore[union-attr]\n raise NoAppException(\n f\"While importing {module_name!r}, an ImportError was\"\n f\" raised:\\n\\n{traceback.format_exc()}\"\n ) from None\n elif raise_if_not_found:\n raise NoAppException(f\"Could not import {module_name!r}.\") from None\n else:\n return None\n\n module = sys.modules[module_name]\n\n if app_name is None:\n return find_best_app(module)\n else:\n return find_app_by_string(module, app_name)\n# \u2026 (truncated at 8000 chars)"}} {"sample_id": "trpc__trpc__reset__upstream__2hop_dd7d52", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["constructor", "batchSend", "setupWebSocketListeners"], "hop_1_files": ["private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/wsClient.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/wsClient.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/wsClient.ts"], "hop_2": ["createWSClient", "request", "next"], "hop_2_files": ["private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/createWsClient.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/wsClient.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/wsClient.ts"]}, "metadata": {"anchor": "reset", "anchor_file": "private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/utils.ts", "anchor_source": "public reset() {\n if (!this.timeout) return;\n\n clearTimeout(this.timeout);\n this.timeout = setTimeout(this.onTimeout, this.timeoutMs);\n }", "result_size": 8, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "colinhacks__zod___uuidv4__downstream__1hop_f1d8b3", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["normalizeParams"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/util.ts"]}, "metadata": {"anchor": "_uuidv4", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/api.ts", "anchor_source": "export function _uuidv4(\n Class: util.SchemaClass,\n params?: string | $ZodUUIDv4Params | $ZodCheckUUIDv4Params\n): T {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n version: \"v4\",\n ...util.normalizeParams(params),\n });\n}", "result_size": 1, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "colinhacks__zod__nullish__downstream__1hop_f106c3", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["optional", "nullable"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"]}, "metadata": {"anchor": "nullish", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "anchor_source": "nullish(): ZodOptional> {\n return this.nullable().optional();\n }", "result_size": 2, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "encode__django-rest-framework__action__downstream__1hop_3ebe30", "repo": "encode/django-rest-framework", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["MethodMapper"], "call_files": ["private/tmp/repos/django-rest-framework/rest_framework/decorators.py"]}, "metadata": {"anchor": "action", "anchor_file": "private/tmp/repos/django-rest-framework/rest_framework/decorators.py", "anchor_source": "def action(methods=None, detail=None, url_path=None, url_name=None, **kwargs):\n \"\"\"\n Mark a ViewSet method as a routable action.\n\n `@action`-decorated functions will be endowed with a `mapping` property,\n a `MethodMapper` that can be used to add additional method-based behaviors\n on the routed action.\n\n :param methods: A list of HTTP method names this action responds to.\n Defaults to GET only.\n :param detail: Required. Determines whether this action applies to\n instance/detail requests or collection/list requests.\n :param url_path: Define the URL segment for this action. Defaults to the\n name of the method decorated.\n :param url_name: Define the internal (`reverse`) URL name for this action.\n Defaults to the name of the method decorated with underscores\n replaced with dashes.\n :param kwargs: Additional properties to set on the view. This can be used\n to override viewset-level *_classes settings, equivalent to\n how the `@renderer_classes` etc. decorators work for function-\n based API views.\n \"\"\"\n methods = ['get'] if methods is None else methods\n methods = [method.lower() for method in methods]\n\n assert detail is not None, (\n \"@action() missing required argument: 'detail'\"\n )\n\n # name and suffix are mutually exclusive\n if 'name' in kwargs and 'suffix' in kwargs:\n raise TypeError(\"`name` and `suffix` are mutually exclusive arguments.\")\n\n def decorator(func):\n func.mapping = MethodMapper(func, methods)\n\n func.detail = detail\n func.url_path = url_path if url_path else func.__name__\n func.url_name = url_name if url_name else func.__name__.replace('_', '-')\n\n # These kwargs will end up being passed to `ViewSet.as_view()` within\n # the router, which eventually delegates to Django's CBV `View`,\n # which assigns them as instance attributes for each request.\n func.kwargs = kwargs\n\n # Set descriptive arguments for viewsets\n if 'name' not in kwargs and 'suffix' not in kwargs:\n func.kwargs['name'] = pretty_name(func.__name__)\n func.kwargs['description'] = func.__doc__ or None\n\n return func\n return decorator", "result_size": 1, "created_at": "2026-03-20T16:58:16.616316+00:00"}} {"sample_id": "agronholm__apscheduler____setstate____downstream__1hop_21728b", "repo": "agronholm/apscheduler", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["require_state_version"], "call_files": ["private/tmp/repos/agronholm__apscheduler/src/apscheduler/_utils.py"]}, "metadata": {"anchor": "__setstate__", "anchor_file": "private/tmp/repos/agronholm__apscheduler/src/apscheduler/triggers/interval.py", "anchor_source": "def __setstate__(self, state: dict[str, Any]) -> None:\n require_state_version(self, state, 1)\n (\n self.weeks,\n self.days,\n self.hours,\n self.minutes,\n self.seconds,\n self.microseconds,\n ) = state[\"interval\"]\n self.start_time = state[\"start_time\"]\n self.end_time = state[\"end_time\"]\n self._last_fire_time = state[\"last_fire_time\"]\n self._interval = timedelta(\n weeks=self.weeks,\n days=self.days,\n hours=self.hours,\n minutes=self.minutes,\n seconds=self.seconds,\n microseconds=self.microseconds,\n )", "result_size": 1, "created_at": "2026-03-20T16:58:16.252821+00:00"}} {"sample_id": "trpc__trpc__load__upstream__1hop_c25e91", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["dataLoader", "httpBatchStreamLink", "httpBatchLink"], "call_files": ["private/tmp/repos/trpc__trpc/packages/client/src/internals/dataLoader.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/httpBatchStreamLink.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/httpBatchLink.ts"]}, "metadata": {"anchor": "load", "anchor_file": "private/tmp/repos/trpc__trpc/packages/client/src/internals/dataLoader.ts", "anchor_source": "function load(key: TKey): Promise {\n const item: BatchItem = {\n aborted: false,\n key,\n batch: null,\n resolve: throwFatalError,\n reject: throwFatalError,\n };\n\n const promise = new Promise((resolve, reject) => {\n item.reject = reject;\n item.resolve = resolve;\n\n pendingItems ??= [];\n pendingItems.push(item);\n });\n\n dispatchTimer ??= setTimeout(dispatch);\n\n return promise;\n }", "result_size": 7, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "colinhacks__zod__endsWith__downstream__1hop_5420c5", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["_addCheck"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"]}, "metadata": {"anchor": "endsWith", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "anchor_source": "endsWith(value: string, message?: errorUtil.ErrMessage) {\n return this._addCheck({\n kind: \"endsWith\",\n value: value,\n ...errorUtil.errToObj(message),\n });\n }", "result_size": 1, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "immerjs__immer__benchMethod__downstream__2hop_0ffc56", "repo": "immerjs/immer", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["createInitialState"], "hop_1_files": ["private/tmp/repos/immerjs__immer/perf-testing/immutability-benchmarks.mjs"], "hop_2": ["createLargeObject"], "hop_2_files": ["private/tmp/repos/immerjs__immer/perf-testing/immutability-benchmarks.mjs"]}, "metadata": {"anchor": "benchMethod", "anchor_file": "private/tmp/repos/immerjs__immer/perf-testing/immutability-benchmarks.mjs", "anchor_source": "function benchMethod() {\n\t\t\t\t\tsetAutoFreezes[version](freeze)\n\t\t\t\t\tsetStrictIteration[version](false)\n\t\t\t\t\tsetEnableArrayMethods[version]()\n\n\t\t\t\t\tlet currentState = createInitialState()\n\n\t\t\t\t\t// Perform multiple operations on the same evolving state\n\t\t\t\t\tfor (let i = 0; i < BENCHMARK_CONFIG.reuseStateIterations; i++) {\n\t\t\t\t\t\tcurrentState = reducers[version](currentState, actions[action](i))\n\t\t\t\t\t}\n\t\t\t\t\tsetAutoFreezes[version](false)\n\t\t\t\t}", "result_size": 1, "created_at": "2026-03-20T16:58:16.801413+00:00"}} {"sample_id": "immerjs__immer__crossReferenceCleanup__upstream__2hop_6f2eba", "repo": "immerjs/immer", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["handleCrossReference"], "hop_1_files": ["private/tmp/repos/immerjs__immer/src/core/finalize.ts"], "hop_2": ["add", "enableArrayMethods", "set", "handleInsertedValues", "enableMapSet"], "hop_2_files": ["private/tmp/repos/immerjs__immer/src/plugins/mapset.ts", "private/tmp/repos/immerjs__immer/src/plugins/arrayMethods.ts", "private/tmp/repos/immerjs__immer/src/plugins/mapset.ts", "private/tmp/repos/immerjs__immer/src/plugins/arrayMethods.ts", "private/tmp/repos/immerjs__immer/src/plugins/mapset.ts"]}, "metadata": {"anchor": "crossReferenceCleanup", "anchor_file": "private/tmp/repos/immerjs__immer/src/core/finalize.ts", "anchor_source": "state.callbacks_.push(function crossReferenceCleanup() {\n\t\t\t\t// Update the target location with finalized value\n\t\t\t\tprepareCopy(target)\n\n\t\t\t\tconst finalizedValue = getFinalValue(state)\n\n\t\t\t\tupdateDraftInParent(target, value, finalizedValue, key)\n\t\t\t})", "result_size": 6, "created_at": "2026-03-20T16:58:16.801413+00:00", "file_content": ""}} {"sample_id": "pallets__click__handle_parse_result__downstream__1hop_b85c55", "repo": "pallets/click", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["process_value", "set_parameter_source", "echo", "style", "consume_value"], "call_files": ["private/tmp/repos/pallets__click/src/click/core.py", "private/tmp/repos/pallets__click/src/click/core.py", "private/tmp/repos/pallets__click/src/click/utils.py", "private/tmp/repos/pallets__click/src/click/termui.py", "private/tmp/repos/pallets__click/src/click/core.py"]}, "metadata": {"anchor": "handle_parse_result", "anchor_file": "private/tmp/repos/pallets__click/src/click/core.py", "anchor_source": "def handle_parse_result(\n self, ctx: Context, opts: cabc.Mapping[str, t.Any], args: list[str]\n ) -> tuple[t.Any, list[str]]:\n \"\"\"Process the value produced by the parser from user input.\n\n Always process the value through the Parameter's :attr:`type`, wherever it\n comes from.\n\n If the parameter is deprecated, this method warn the user about it. But only if\n the value has been explicitly set by the user (and as such, is not coming from\n a default).\n\n :meta private:\n \"\"\"\n with augment_usage_errors(ctx, param=self):\n value, source = self.consume_value(ctx, opts)\n\n ctx.set_parameter_source(self.name, source) # type: ignore\n\n # Display a deprecation warning if necessary.\n if (\n self.deprecated\n and value is not UNSET\n and source not in (ParameterSource.DEFAULT, ParameterSource.DEFAULT_MAP)\n ):\n extra_message = (\n f\" {self.deprecated}\" if isinstance(self.deprecated, str) else \"\"\n )\n message = _(\n \"DeprecationWarning: The {param_type} {name!r} is deprecated.\"\n \"{extra_message}\"\n ).format(\n param_type=self.param_type_name,\n name=self.human_readable_name,\n extra_message=extra_message,\n )\n echo(style(message, fg=\"red\"), err=True)\n\n # Process the value through the parameter's type.\n try:\n value = self.process_value(ctx, value)\n except Exception:\n if not ctx.resilient_parsing:\n raise\n # In resilient parsing mode, we do not want to fail the command if the\n # value is incompatible with the parameter type, so we reset the value\n # to UNSET, which will be interpreted as a missing value.\n value = UNSET\n\n # Add parameter's value to the context.\n if (\n self.expose_value\n # We skip adding the value if it was previously set by another parameter\n # targeting the same variable name. This prevents parameters competing for\n # the same name to override each other.\n and (self.name not in ctx.params or ctx.params[self.name] is UNSET)\n ):\n # Click is logically enforcing that the name is None if the parameter is\n # not to be exposed. We still assert it here to please the type checker.\n assert self.name is not None, (\n f\"{self!r} parameter's name should not be None when exposing value.\"\n )\n ctx.params[self.name] = value\n\n return value, args", "result_size": 5, "created_at": "2026-03-20T16:58:17.078639+00:00"}} {"sample_id": "pytest-dev__pytest__call_and_report__downstream__1hop_a47c30", "repo": "pytest-dev/pytest", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["from_call", "get_reraise_exceptions"], "call_files": ["private/tmp/repos/pytest-dev__pytest/src/_pytest/runner.py", "private/tmp/repos/pytest-dev__pytest/src/_pytest/runner.py"]}, "metadata": {"anchor": "call_and_report", "anchor_file": "private/tmp/repos/pytest-dev__pytest/src/_pytest/runner.py", "anchor_source": "def call_and_report(\n item: Item, when: Literal[\"setup\", \"call\", \"teardown\"], log: bool = True, **kwds\n) -> TestReport:\n ihook = item.ihook\n if when == \"setup\":\n runtest_hook: Callable[..., None] = ihook.pytest_runtest_setup\n elif when == \"call\":\n runtest_hook = ihook.pytest_runtest_call\n elif when == \"teardown\":\n runtest_hook = ihook.pytest_runtest_teardown\n else:\n assert False, f\"Unhandled runtest hook case: {when}\"\n\n call = CallInfo.from_call(\n lambda: runtest_hook(item=item, **kwds),\n when=when,\n reraise=get_reraise_exceptions(item.config),\n )\n report: TestReport = ihook.pytest_runtest_makereport(item=item, call=call)\n if log:\n ihook.pytest_runtest_logreport(report=report)\n if check_interactive_exception(call, report):\n ihook.pytest_exception_interact(node=item, call=call, report=report)\n return report", "result_size": 2, "created_at": "2026-03-20T16:58:17.641689+00:00"}} {"sample_id": "psf__requests__unquote_unreserved__upstream__2hop_5bf014", "repo": "psf/requests", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["requote_uri"], "hop_1_files": ["private/tmp/repos/requests/src/requests/utils.py"], "hop_2": ["prepare_url", "resolve_redirects"], "hop_2_files": ["private/tmp/repos/requests/src/requests/models.py", "private/tmp/repos/requests/src/requests/sessions.py"]}, "metadata": {"anchor": "unquote_unreserved", "anchor_file": "private/tmp/repos/requests/src/requests/utils.py", "anchor_source": "def unquote_unreserved(uri):\n \"\"\"Un-escape any percent-escape sequences in a URI that are unreserved\n characters. This leaves all reserved, illegal and non-ASCII bytes encoded.\n\n :rtype: str\n \"\"\"\n parts = uri.split(\"%\")\n for i in range(1, len(parts)):\n h = parts[i][0:2]\n if len(h) == 2 and h.isalnum():\n try:\n c = chr(int(h, 16))\n except ValueError:\n raise InvalidURL(f\"Invalid percent-escape sequence: '{h}'\")\n\n if c in UNRESERVED_SET:\n parts[i] = c + parts[i][2:]\n else:\n parts[i] = f\"%{parts[i]}\"\n else:\n parts[i] = f\"%{parts[i]}\"\n return \"\".join(parts)", "result_size": 2, "created_at": "2026-03-20T16:58:17.570287+00:00", "file_content": "\"\"\"\nrequests.utils\n~~~~~~~~~~~~~~\n\nThis module provides utility functions that are used within Requests\nthat are also useful for external consumption.\n\"\"\"\n\nimport codecs\nimport contextlib\nimport io\nimport os\nimport re\nimport socket\nimport struct\nimport sys\nimport tempfile\nimport warnings\nimport zipfile\nfrom collections import OrderedDict\n\nfrom urllib3.util import make_headers, parse_url\n\nfrom . import certs\nfrom .__version__ import __version__\n\n# to_native_string is unused here, but imported here for backwards compatibility\nfrom ._internal_utils import ( # noqa: F401\n _HEADER_VALIDATORS_BYTE,\n _HEADER_VALIDATORS_STR,\n HEADER_VALIDATORS,\n to_native_string,\n)\nfrom .compat import (\n Mapping,\n basestring,\n bytes,\n getproxies,\n getproxies_environment,\n integer_types,\n is_urllib3_1,\n proxy_bypass,\n proxy_bypass_environment,\n quote,\n str,\n unquote,\n urlparse,\n urlunparse,\n)\nfrom .compat import parse_http_list as _parse_list_header\nfrom .cookies import cookiejar_from_dict\nfrom .exceptions import (\n FileModeWarning,\n InvalidHeader,\n InvalidURL,\n UnrewindableBodyError,\n)\nfrom .structures import CaseInsensitiveDict\n\nNETRC_FILES = (\".netrc\", \"_netrc\")\n\nDEFAULT_CA_BUNDLE_PATH = certs.where()\n\nDEFAULT_PORTS = {\"http\": 80, \"https\": 443}\n\n# Ensure that ', ' is used to preserve previous delimiter behavior.\nDEFAULT_ACCEPT_ENCODING = \", \".join(\n re.split(r\",\\s*\", make_headers(accept_encoding=True)[\"accept-encoding\"])\n)\n\n\nif sys.platform == \"win32\":\n # provide a proxy_bypass version on Windows without DNS lookups\n\n def proxy_bypass_registry(host):\n try:\n import winreg\n except ImportError:\n return False\n\n try:\n internetSettings = winreg.OpenKey(\n winreg.HKEY_CURRENT_USER,\n r\"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\",\n )\n # ProxyEnable could be REG_SZ or REG_DWORD, normalizing it\n proxyEnable = int(winreg.QueryValueEx(internetSettings, \"ProxyEnable\")[0])\n # ProxyOverride is almost always a string\n proxyOverride = winreg.QueryValueEx(internetSettings, \"ProxyOverride\")[0]\n except (OSError, ValueError):\n return False\n if not proxyEnable or not proxyOverride:\n return False\n\n # make a check value list from the registry entry: replace the\n # '' string by the localhost entry and the corresponding\n # canonical entry.\n proxyOverride = proxyOverride.split(\";\")\n # filter out empty strings to avoid re.match return true in the following code.\n proxyOverride = filter(None, proxyOverride)\n # now check if we match one of the registry values.\n for test in proxyOverride:\n if test == \"\":\n if \".\" not in host:\n return True\n test = test.replace(\".\", r\"\\.\") # mask dots\n test = test.replace(\"*\", r\".*\") # change glob sequence\n test = test.replace(\"?\", r\".\") # change glob char\n if re.match(test, host, re.I):\n return True\n return False\n\n def proxy_bypass(host): # noqa\n \"\"\"Return True, if the host should be bypassed.\n\n Checks proxy settings gathered from the environment, if specified,\n or the registry.\n \"\"\"\n if getproxies_environment():\n return proxy_bypass_environment(host)\n else:\n return proxy_bypass_registry(host)\n\n\ndef dict_to_sequence(d):\n \"\"\"Returns an internal sequence dictionary update.\"\"\"\n\n if hasattr(d, \"items\"):\n d = d.items()\n\n return d\n\n\ndef super_len(o):\n total_length = None\n current_position = 0\n\n if not is_urllib3_1 and isinstance(o, str):\n # urllib3 2.x+ treats all strings as utf-8 instead\n # of latin-1 (iso-8859-1) like http.client.\n o = o.encode(\"utf-8\")\n\n if hasattr(o, \"__len__\"):\n total_length = len(o)\n\n elif hasattr(o, \"len\"):\n total_length = o.len\n\n elif hasattr(o, \"fileno\"):\n try:\n fileno = o.fileno()\n except (io.UnsupportedOperation, AttributeError):\n # AttributeError is a surprising exception, seeing as how we've just checked\n # that `hasattr(o, 'fileno')`. It happens for objects obtained via\n # `Tarfile.extractfile()`, per issue 5229.\n pass\n else:\n total_length = os.fstat(fileno).st_size\n\n # Having used fstat to determine the file length, we need to\n # confirm that this file was opened up in binary mode.\n if \"b\" not in o.mode:\n warnings.warn(\n (\n \"Requests has determined the content-length for this \"\n \"request using the binary size of the file: however, the \"\n \"file has been opened in text mode (i.e. without the 'b' \"\n \"flag in the mode). This may lead to an incorrect \"\n \"content-length. In Requests 3.0, support will be removed \"\n \"for files in text mode.\"\n ),\n FileModeWarning,\n )\n\n if hasattr(o, \"tell\"):\n try:\n current_position = o.tell()\n except OSError:\n # This can happen in some weird situations, such as when the file\n # is actually a special file descriptor like stdin. In this\n # instance, we don't know what the length is, so set it to zero and\n # let requests chunk it instead.\n if total_length is not None:\n current_position = total_length\n else:\n if hasattr(o, \"seek\") and total_length is None:\n # StringIO and BytesIO have seek but no usable fileno\n try:\n # seek to end of file\n o.seek(0, 2)\n total_length = o.tell()\n\n # seek back to current position to support\n # partially read file-like objects\n o.seek(current_position or 0)\n except OSError:\n total_length = 0\n\n if total_length is None:\n total_length = 0\n\n return max(0, total_length - current_position)\n\n\ndef get_netrc_auth(url, raise_errors=False):\n \"\"\"Returns the Requests tuple auth for a given url from netrc.\"\"\"\n\n netrc_file = os.environ.get(\"NETRC\")\n if netrc_file is not None:\n netrc_locations = (netrc_file,)\n else:\n netrc_locations = (f\"~/{f}\" for f in NETRC_FILES)\n\n try:\n from netrc import NetrcParseError, netrc\n\n netrc_path = None\n\n for f in netrc_locations:\n loc = os.path.expanduser(f)\n if os.path.exists(loc):\n netrc_path = loc\n break\n\n # Abort early if there isn't one.\n if netrc_path is None:\n return\n\n ri = urlparse(url)\n host = ri.hostname\n\n try:\n _netrc = netrc(netrc_path).authenticators(host)\n if _netrc and any(_netrc):\n # Return with login / password\n login_i = 0 if _netrc[0] else 1\n return (_netrc[login_i], _netrc[2])\n except (NetrcParseError, OSError):\n # If there was a parsing error or a permissions issue reading the file,\n # we'll just skip netrc auth unless explicitly asked to raise errors.\n if raise_errors:\n raise\n\n # App Engine hackiness.\n except (ImportError, AttributeError):\n pass\n\n\ndef guess_filename(obj):\n \"\"\"Tries to guess the filename of the given object.\"\"\"\n name = getattr(obj, \"name\", None)\n if name and isinstance(name, basestring) and name[0] != \"<\" and name[-1] != \">\":\n return os.path.basename(name)\n\n\ndef extract_zipped_paths(path):\n \"\"\"Replace nonexistent paths that look \n# \u2026 (truncated at 8000 chars)"}} {"sample_id": "agronholm__apscheduler____getstate____downstream__2hop_9ec212", "repo": "agronholm/apscheduler", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["__getstate__"], "hop_1_files": ["private/tmp/repos/agronholm__apscheduler/src/apscheduler/triggers/combining.py"], "hop_2": ["marshal_object"], "hop_2_files": ["private/tmp/repos/agronholm__apscheduler/src/apscheduler/_marshalling.py"]}, "metadata": {"anchor": "__getstate__", "anchor_file": "private/tmp/repos/agronholm__apscheduler/src/apscheduler/triggers/combining.py", "anchor_source": "def __getstate__(self) -> dict[str, Any]:\n state = super().__getstate__()\n state[\"threshold\"] = self.threshold\n state[\"max_iterations\"] = self.max_iterations\n return state", "result_size": 1, "created_at": "2026-03-20T16:58:16.252821+00:00"}} {"sample_id": "immerjs__immer__forEach__downstream__2hop_90fcd2", "repo": "immerjs/immer", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["get"], "hop_1_files": ["private/tmp/repos/immerjs__immer/src/plugins/mapset.ts"], "hop_2": ["isDraftable", "createProxy", "prepareMapCopy", "assertUnrevoked"], "hop_2_files": ["private/tmp/repos/immerjs__immer/src/utils/common.ts", "private/tmp/repos/immerjs__immer/src/core/immerClass.ts", "private/tmp/repos/immerjs__immer/src/plugins/mapset.ts", "private/tmp/repos/immerjs__immer/src/plugins/mapset.ts"]}, "metadata": {"anchor": "forEach", "anchor_file": "private/tmp/repos/immerjs__immer/src/plugins/mapset.ts", "anchor_source": "forEach(cb: (value: any, key: any, self: any) => void, thisArg?: any) {\n\t\t\tconst state: MapState = this[DRAFT_STATE]\n\t\t\tlatest(state).forEach((_value: any, key: any, _map: any) => {\n\t\t\t\tcb.call(thisArg, this.get(key), key, this)\n\t\t\t})\n\t\t}", "result_size": 4, "created_at": "2026-03-20T16:58:16.801413+00:00"}} {"sample_id": "colinhacks__zod__refinement__downstream__2hop_7e78f9", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["refinement"], "hop_1_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"], "hop_2": ["_refinement"], "hop_2_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"]}, "metadata": {"anchor": "refinement", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "anchor_source": "refinement(\n check: (arg: Output) => boolean,\n refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)\n ): ZodEffects;", "result_size": 1, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "python-poetry__poetry__get_compatible_python__downstream__1hop_a85041", "repo": "python-poetry/poetry", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["find_all"], "call_files": ["private/tmp/repos/python-poetry__poetry/src/poetry/utils/env/python/manager.py"]}, "metadata": {"anchor": "get_compatible_python", "anchor_file": "private/tmp/repos/python-poetry__poetry/src/poetry/utils/env/python/manager.py", "anchor_source": "@classmethod\n def get_compatible_python(cls, poetry: Poetry, io: IO | None = None) -> Python:\n \"\"\"\n Retrieve a compatible Python version based on the given poetry configuration\n and Python constraints derived from the project.\n\n This method iterates through all available Python candidates and checks if any\n match the supported Python constraint as defined in the specified poetry package.\n\n :param poetry: The poetry configuration containing package information,\n including Python constraints.\n :param io: The input/output stream for error and status messages. Defaults\n to a null I/O if not provided.\n :return: A Python instance representing a compatible Python version.\n :raises NoCompatiblePythonVersionFoundError: If no Python version matches\n the supported constraint.\n \"\"\"\n io = io or NullIO()\n supported_python = poetry.package.python_constraint\n\n for python in cls.find_all():\n if python.version.allows_any(supported_python):\n io.write_error_line(\n f\"Using {python.name} ({python.patch_version})\"\n )\n return python\n\n raise NoCompatiblePythonVersionFoundError(poetry.package.python_versions)", "result_size": 1, "created_at": "2026-03-20T16:58:17.758794+00:00"}} {"sample_id": "sindresorhus__got__publishRequestCreate__upstream__2hop_7b83a7", "repo": "sindresorhus/got", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["constructor"], "hop_1_files": ["private/tmp/repos/got/source/core/index.ts"], "hop_2": ["fn", "_beforeError", "asPromise"], "hop_2_files": ["private/tmp/repos/got/benchmark/index.ts", "private/tmp/repos/got/source/core/index.ts", "private/tmp/repos/got/source/as-promise/index.ts"]}, "metadata": {"anchor": "publishRequestCreate", "anchor_file": "private/tmp/repos/got/source/core/diagnostics-channel.ts", "anchor_source": "export function publishRequestCreate(message: DiagnosticRequestCreate): void {\n\tif (channels.requestCreate.hasSubscribers) {\n\t\tchannels.requestCreate.publish(message);\n\t}\n}", "result_size": 6, "created_at": "2026-03-20T16:58:18.104721+00:00", "file_content": "import {randomUUID} from 'node:crypto';\nimport diagnosticsChannel from 'node:diagnostics_channel';\nimport type {Timings} from './utils/timer.js';\nimport type {RequestError} from './errors.js';\n\nconst channels = {\n\trequestCreate: diagnosticsChannel.channel('got:request:create'),\n\trequestStart: diagnosticsChannel.channel('got:request:start'),\n\tresponseStart: diagnosticsChannel.channel('got:response:start'),\n\tresponseEnd: diagnosticsChannel.channel('got:response:end'),\n\tretry: diagnosticsChannel.channel('got:request:retry'),\n\terror: diagnosticsChannel.channel('got:request:error'),\n\tredirect: diagnosticsChannel.channel('got:response:redirect'),\n};\n\nexport type RequestId = string;\n\n/**\nMessage for the `got:request:create` diagnostic channel.\n\nEmitted when a request is created.\n*/\nexport type DiagnosticRequestCreate = {\n\trequestId: RequestId;\n\turl: string;\n\tmethod: string;\n};\n\n/**\nMessage for the `got:request:start` diagnostic channel.\n\nEmitted before the native HTTP request is sent.\n*/\nexport type DiagnosticRequestStart = {\n\trequestId: RequestId;\n\turl: string;\n\tmethod: string;\n\theaders: Record;\n};\n\n/**\nMessage for the `got:response:start` diagnostic channel.\n\nEmitted when response headers are received.\n*/\nexport type DiagnosticResponseStart = {\n\trequestId: RequestId;\n\turl: string;\n\tstatusCode: number;\n\theaders: Record;\n\tisFromCache: boolean;\n};\n\n/**\nMessage for the `got:response:end` diagnostic channel.\n\nEmitted when the response completes.\n*/\nexport type DiagnosticResponseEnd = {\n\trequestId: RequestId;\n\turl: string;\n\tstatusCode: number;\n\tbodySize?: number;\n\ttimings?: Timings;\n};\n\n/**\nMessage for the `got:request:retry` diagnostic channel.\n\nEmitted when retrying a request.\n*/\nexport type DiagnosticRequestRetry = {\n\trequestId: RequestId;\n\tretryCount: number;\n\terror: RequestError;\n\tdelay: number;\n};\n\n/**\nMessage for the `got:request:error` diagnostic channel.\n\nEmitted when a request fails.\n*/\nexport type DiagnosticRequestError = {\n\trequestId: RequestId;\n\turl: string;\n\terror: RequestError;\n\ttimings?: Timings;\n};\n\n/**\nMessage for the `got:response:redirect` diagnostic channel.\n\nEmitted when following a redirect.\n*/\nexport type DiagnosticResponseRedirect = {\n\trequestId: RequestId;\n\tfromUrl: string;\n\ttoUrl: string;\n\tstatusCode: number;\n};\n\nexport function generateRequestId(): RequestId {\n\treturn randomUUID();\n}\n\nexport function publishRequestCreate(message: DiagnosticRequestCreate): void {\n\tif (channels.requestCreate.hasSubscribers) {\n\t\tchannels.requestCreate.publish(message);\n\t}\n}\n\nexport function publishRequestStart(message: DiagnosticRequestStart): void {\n\tif (channels.requestStart.hasSubscribers) {\n\t\tchannels.requestStart.publish(message);\n\t}\n}\n\nexport function publishResponseStart(message: DiagnosticResponseStart): void {\n\tif (channels.responseStart.hasSubscribers) {\n\t\tchannels.responseStart.publish(message);\n\t}\n}\n\nexport function publishResponseEnd(message: DiagnosticResponseEnd): void {\n\tif (channels.responseEnd.hasSubscribers) {\n\t\tchannels.responseEnd.publish(message);\n\t}\n}\n\nexport function publishRetry(message: DiagnosticRequestRetry): void {\n\tif (channels.retry.hasSubscribers) {\n\t\tchannels.retry.publish(message);\n\t}\n}\n\nexport function publishError(message: DiagnosticRequestError): void {\n\tif (channels.error.hasSubscribers) {\n\t\tchannels.error.publish(message);\n\t}\n}\n\nexport function publishRedirect(message: DiagnosticResponseRedirect): void {\n\tif (channels.redirect.hasSubscribers) {\n\t\tchannels.redirect.publish(message);\n\t}\n}\n"}} {"sample_id": "rq__rq__fetch_job__upstream__1hop_6f03f4", "repo": "rq/rq", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["get_jobs", "cleanup"], "call_files": ["private/tmp/repos/rq__rq/rq/queue.py", "private/tmp/repos/rq__rq/rq/intermediate_queue.py"]}, "metadata": {"anchor": "fetch_job", "anchor_file": "private/tmp/repos/rq__rq/rq/queue.py", "anchor_source": "def fetch_job(self, job_id: str) -> Optional['Job']:\n \"\"\"Fetch a single job by Job ID.\n If the job key is not found, will run the `remove` method, to exclude the key.\n If the job has the same name as as the current job origin, returns the Job\n\n Args:\n job_id (str): The Job ID\n\n Returns:\n job (Optional[Job]): The job if found\n \"\"\"\n try:\n job = self.job_class.fetch(job_id, connection=self.connection, serializer=self.serializer)\n except NoSuchJobError:\n self.remove(job_id)\n else:\n if job.origin == self.name:\n return job\n\n return None", "result_size": 2, "created_at": "2026-03-20T16:58:17.875204+00:00", "file_content": ""}} {"sample_id": "python-poetry__poetry__all__downstream__1hop_e28862", "repo": "python-poetry/poetry", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["get", "_all"], "call_files": ["private/tmp/repos/python-poetry__poetry/src/poetry/config/config.py", "private/tmp/repos/python-poetry__poetry/src/poetry/config/config.py"]}, "metadata": {"anchor": "all", "anchor_file": "private/tmp/repos/python-poetry__poetry/src/poetry/config/config.py", "anchor_source": "def all(self) -> dict[str, Any]:\n def _all(config: dict[str, Any], parent_key: str = \"\") -> dict[str, Any]:\n all_ = {}\n\n for key in config:\n value = self.get(parent_key + key)\n if isinstance(value, dict):\n if parent_key != \"\":\n current_parent = parent_key + key + \".\"\n else:\n current_parent = key + \".\"\n all_[key] = _all(config[key], parent_key=current_parent)\n continue\n\n all_[key] = value\n\n return all_\n\n return _all(self.config)", "result_size": 2, "created_at": "2026-03-20T16:58:17.758794+00:00"}} {"sample_id": "node-fetch__node-fetch__raw__upstream__2hop_fdee05", "repo": "node-fetch/node-fetch", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["constructor"], "hop_1_files": ["private/tmp/repos/node-fetch__node-fetch/src/headers.js"], "hop_2": ["constructor", "fromRawHeaders", "fetch", "json"], "hop_2_files": ["private/tmp/repos/node-fetch__node-fetch/src/response.js", "private/tmp/repos/node-fetch__node-fetch/src/headers.js", "private/tmp/repos/node-fetch__node-fetch/src/index.js", "private/tmp/repos/node-fetch__node-fetch/src/response.js"]}, "metadata": {"anchor": "raw", "anchor_file": "private/tmp/repos/node-fetch__node-fetch/src/headers.js", "anchor_source": "raw() {\n\t\treturn [...this.keys()].reduce((result, key) => {\n\t\t\tresult[key] = this.getAll(key);\n\t\t\treturn result;\n\t\t}, {});\n\t}", "result_size": 7, "created_at": "2026-03-20T16:58:17.058449+00:00", "file_content": ""}} {"sample_id": "pallets__jinja___filter_test_common__downstream__2hop_93a32a", "repo": "pallets/jinja", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["_fail_with_undefined_error", "from_obj", "EvalContext"], "hop_1_files": ["private/tmp/repos/pallets__jinja/src/jinja2/runtime.py", "private/tmp/repos/pallets__jinja/src/jinja2/utils.py", "private/tmp/repos/pallets__jinja/src/jinja2/nodes.py"], "hop_2": ["Undefined"], "hop_2_files": ["private/tmp/repos/pallets__jinja/src/jinja2/runtime.py"]}, "metadata": {"anchor": "_filter_test_common", "anchor_file": "private/tmp/repos/pallets__jinja/src/jinja2/environment.py", "anchor_source": "def _filter_test_common(\n self,\n name: str | Undefined,\n value: t.Any,\n args: t.Sequence[t.Any] | None,\n kwargs: t.Mapping[str, t.Any] | None,\n context: Context | None,\n eval_ctx: EvalContext | None,\n is_filter: bool,\n ) -> t.Any:\n if is_filter:\n env_map = self.filters\n type_name = \"filter\"\n else:\n env_map = self.tests\n type_name = \"test\"\n\n func = env_map.get(name) # type: ignore\n\n if func is None:\n msg = f\"No {type_name} named {name!r}.\"\n\n if isinstance(name, Undefined):\n try:\n name._fail_with_undefined_error()\n except Exception as e:\n msg = f\"{msg} ({e}; did you forget to quote the callable name?)\"\n\n raise TemplateRuntimeError(msg)\n\n args = [value, *(args if args is not None else ())]\n kwargs = kwargs if kwargs is not None else {}\n pass_arg = _PassArg.from_obj(func)\n\n if pass_arg is _PassArg.context:\n if context is None:\n raise TemplateRuntimeError(\n f\"Attempted to invoke a context {type_name} without context.\"\n )\n\n args.insert(0, context)\n elif pass_arg is _PassArg.eval_context:\n if eval_ctx is None:\n if context is not None:\n eval_ctx = context.eval_ctx\n else:\n eval_ctx = EvalContext(self)\n\n args.insert(0, eval_ctx)\n elif pass_arg is _PassArg.environment:\n args.insert(0, self)\n\n return func(*args, **kwargs)", "result_size": 1, "created_at": "2026-03-20T16:58:17.229656+00:00"}} {"sample_id": "trpc__trpc__onSuccess__downstream__1hop_34d413", "repo": "trpc/trpc", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["generateEntrypoints"], "call_files": ["private/tmp/repos/trpc__trpc/scripts/entrypoints.ts"]}, "metadata": {"anchor": "onSuccess", "anchor_file": "private/tmp/repos/trpc__trpc/packages/react-query/tsdown.config.ts", "anchor_source": "onSuccess: async () => {\n const start = Date.now();\n const { generateEntrypoints } = await import(\n '../../scripts/entrypoints.js'\n );\n await generateEntrypoints(input);\n // eslint-disable-next-line no-console\n console.log(`Generated entrypoints in ${Date.now() - start}ms`);\n },", "result_size": 1, "created_at": "2026-03-20T16:58:18.199328+00:00"}} {"sample_id": "colinhacks__zod__dirty__upstream__1hop_2de57b", "repo": "colinhacks/zod", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["_parse", "addIssue", "mergeObjectSync", "finalizeSet", "mergeArray"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/helpers/parseUtil.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/helpers/parseUtil.ts"]}, "metadata": {"anchor": "dirty", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/helpers/parseUtil.ts", "anchor_source": "dirty(): void {\n if (this.value === \"valid\") this.value = \"dirty\";\n }", "result_size": 6, "created_at": "2026-03-20T16:58:16.474869+00:00", "file_content": ""}} {"sample_id": "immerjs__immer__scenario_concat__downstream__2hop_898a2b", "repo": "immerjs/immer", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["createInitialState"], "hop_1_files": ["private/tmp/repos/immerjs__immer/perf-testing/immutability-profiling.mjs"], "hop_2": ["createLargeObject"], "hop_2_files": ["private/tmp/repos/immerjs__immer/perf-testing/immutability-profiling.mjs"]}, "metadata": {"anchor": "scenario_concat", "anchor_file": "private/tmp/repos/immerjs__immer/perf-testing/immutability-profiling.mjs", "anchor_source": "function scenario_concat() {\n\tconst initialState = createInitialState()\n\tfor (let j = 0; j < MAX; j++) {\n\t\timmerReducer(initialState, actions.concat(j))\n\t}\n}", "result_size": 1, "created_at": "2026-03-20T16:58:16.801413+00:00"}} {"sample_id": "psf__black__generate_comments__downstream__1hop_9238ae", "repo": "psf/black", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["normalize_trailing_prefix"], "call_files": ["private/tmp/repos/psf__black/src/black/comments.py"]}, "metadata": {"anchor": "generate_comments", "anchor_file": "private/tmp/repos/psf__black/src/black/comments.py", "anchor_source": "def generate_comments(leaf: LN, mode: Mode) -> Iterator[Leaf]:\n \"\"\"Clean the prefix of the `leaf` and generate comments from it, if any.\n\n Comments in lib2to3 are shoved into the whitespace prefix. This happens\n in `pgen2/driver.py:Driver.parse_tokens()`. This was a brilliant implementation\n move because it does away with modifying the grammar to include all the\n possible places in which comments can be placed.\n\n The sad consequence for us though is that comments don't \"belong\" anywhere.\n This is why this function generates simple parentless Leaf objects for\n comments. We simply don't know what the correct parent should be.\n\n No matter though, we can live without this. We really only need to\n differentiate between inline and standalone comments. The latter don't\n share the line with any code.\n\n Inline comments are emitted as regular token.COMMENT leaves. Standalone\n are emitted with a fake STANDALONE_COMMENT token identifier.\n \"\"\"\n total_consumed = 0\n for pc in list_comments(\n leaf.prefix, is_endmarker=leaf.type == token.ENDMARKER, mode=mode\n ):\n total_consumed = pc.consumed\n prefix = make_simple_prefix(pc.newlines, pc.form_feed)\n yield Leaf(pc.type, pc.value, prefix=prefix)\n normalize_trailing_prefix(leaf, total_consumed)", "result_size": 1, "created_at": "2026-03-20T16:58:17.494246+00:00"}} {"sample_id": "pallets__flask___get_source_fast__downstream__2hop_b68596", "repo": "pallets/flask", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["_iter_loaders"], "hop_1_files": ["private/tmp/repos/flask/src/flask/templating.py"], "hop_2": ["iter_blueprints"], "hop_2_files": ["private/tmp/repos/flask/src/flask/sansio/app.py"]}, "metadata": {"anchor": "_get_source_fast", "anchor_file": "private/tmp/repos/flask/src/flask/templating.py", "anchor_source": "def _get_source_fast(\n self, environment: BaseEnvironment, template: str\n ) -> tuple[str, str | None, t.Callable[[], bool] | None]:\n for _srcobj, loader in self._iter_loaders(template):\n try:\n return loader.get_source(environment, template)\n except TemplateNotFound:\n continue\n raise TemplateNotFound(template)", "result_size": 1, "created_at": "2026-03-20T16:58:17.167063+00:00"}} {"sample_id": "locustio__locust__get_ratio__upstream__1hop_0a7624", "repo": "locustio/locust", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["print_task_ratio_json", "tasks", "print_task_ratio", "get_html_report"], "call_files": ["private/tmp/repos/locustio__locust/locust/user/inspectuser.py", "private/tmp/repos/locustio__locust/locust/web.py", "private/tmp/repos/locustio__locust/locust/user/inspectuser.py", "private/tmp/repos/locustio__locust/locust/html.py"]}, "metadata": {"anchor": "get_ratio", "anchor_file": "private/tmp/repos/locustio__locust/locust/user/inspectuser.py", "anchor_source": "def get_ratio(user_classes: list[type[User]], user_spawned: dict[str, int], total: bool) -> dict[str, dict[str, float]]:\n user_count = sum(user_spawned.values()) or 1\n ratio_percent: dict[type[User], float] = {u: user_spawned.get(u.__name__, 0) / user_count for u in user_classes}\n\n task_dict: dict[str, dict[str, float]] = {}\n for u, r in ratio_percent.items():\n d = {\"ratio\": r}\n d[\"tasks\"] = _get_task_ratio(u.tasks, total, r)\n task_dict[u.__name__] = d\n\n return task_dict", "result_size": 4, "created_at": "2026-03-20T16:58:16.951273+00:00", "file_content": ""}} {"sample_id": "rq__rq__failure_callback__upstream__1hop_88ceba", "repo": "rq/rq", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["run_sync", "execute_failure_callback"], "call_files": ["private/tmp/repos/rq__rq/rq/queue.py", "private/tmp/repos/rq__rq/rq/job.py"]}, "metadata": {"anchor": "failure_callback", "anchor_file": "private/tmp/repos/rq__rq/rq/job.py", "anchor_source": "@property\n def failure_callback(self) -> Optional[FailureCallbackType]:\n if self._failure_callback is UNEVALUATED:\n if self._failure_callback_name:\n self._failure_callback = import_attribute(self._failure_callback_name)\n else:\n return None\n\n return self._failure_callback # type: ignore[return-value]", "result_size": 2, "created_at": "2026-03-20T16:58:17.875204+00:00", "file_content": ""}} {"sample_id": "rq__rq___handle_failure__upstream__2hop_3b29e6", "repo": "rq/rq", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["run_sync", "handle_job_failure", "cleanup"], "hop_1_files": ["private/tmp/repos/rq__rq/rq/queue.py", "private/tmp/repos/rq__rq/rq/worker/base.py", "private/tmp/repos/rq__rq/rq/registry.py"], "hop_2": ["perform_job", "clean_registries", "handle_job_retry", "monitor_work_horse", "get_job_and_execution_ids", "_enqueue_sync_job", "cleanup"], "hop_2_files": ["private/tmp/repos/rq__rq/rq/worker/base.py", "private/tmp/repos/rq__rq/rq/registry.py", "private/tmp/repos/rq__rq/rq/worker/base.py", "private/tmp/repos/rq__rq/rq/worker/worker_classes.py", "private/tmp/repos/rq__rq/rq/registry.py", "private/tmp/repos/rq__rq/rq/queue.py", "private/tmp/repos/rq__rq/rq/intermediate_queue.py"]}, "metadata": {"anchor": "_handle_failure", "anchor_file": "private/tmp/repos/rq__rq/rq/job.py", "anchor_source": "def _handle_failure(self, exc_string: str, pipeline: 'Pipeline', worker_name: str = ''):\n self.log.debug(\n 'Job %s: handling failure: %s', self.id, exc_string[:200] + '...' if len(exc_string) > 200 else exc_string\n )\n\n failed_job_registry = self.failed_job_registry\n failed_job_registry.add(\n self,\n ttl=self.failure_ttl,\n exc_string=exc_string,\n pipeline=pipeline,\n )\n from .results import Result\n\n Result.create_failure(self, self.failure_ttl, exc_string=exc_string, worker_name=worker_name, pipeline=pipeline)", "result_size": 7, "created_at": "2026-03-20T16:58:17.875204+00:00", "file_content": ""}} {"sample_id": "paramiko__paramiko__ssh_check_mic__downstream__2hop_847877", "repo": "paramiko/paramiko", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["_ssh_build_mic"], "hop_1_files": ["private/tmp/repos/paramiko/paramiko/ssh_gss.py"], "hop_2": ["_make_uint32"], "hop_2_files": ["private/tmp/repos/paramiko/paramiko/ssh_gss.py"]}, "metadata": {"anchor": "ssh_check_mic", "anchor_file": "private/tmp/repos/paramiko/paramiko/ssh_gss.py", "anchor_source": "def ssh_check_mic(self, mic_token, session_id, username=None):\n \"\"\"\n Verify the MIC token for a SSH2 message.\n\n :param str mic_token: The MIC token received from the client\n :param str session_id: The SSH session ID\n :param str username: The name of the user who attempts to login\n :return: None if the MIC check was successful\n :raises: ``gssapi.GSSException`` -- if the MIC check failed\n \"\"\"\n self._session_id = session_id\n self._username = username\n if self._username is not None:\n # server mode\n mic_field = self._ssh_build_mic(\n self._session_id,\n self._username,\n self._service,\n self._auth_method,\n )\n self._gss_srv_ctxt.verify_mic(mic_field, mic_token)\n else:\n # for key exchange with gssapi-keyex\n # client mode\n self._gss_ctxt.verify_mic(self._session_id, mic_token)", "result_size": 1, "created_at": "2026-03-20T16:58:17.364834+00:00"}} {"sample_id": "immerjs__immer__shallowCopy__downstream__1hop_b0a34c", "repo": "immerjs/immer", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["isPlainObject"], "call_files": ["private/tmp/repos/immerjs__immer/src/utils/common.ts"]}, "metadata": {"anchor": "shallowCopy", "anchor_file": "private/tmp/repos/immerjs__immer/src/utils/common.ts", "anchor_source": "export function shallowCopy(base: any, strict: StrictMode) {\n\tif (isMap(base)) {\n\t\treturn new Map(base)\n\t}\n\tif (isSet(base)) {\n\t\treturn new Set(base)\n\t}\n\tif (isArray(base)) return Array[PROTOTYPE].slice.call(base)\n\n\tconst isPlain = isPlainObject(base)\n\n\tif (strict === true || (strict === \"class_only\" && !isPlain)) {\n\t\t// Perform a strict copy\n\t\tconst descriptors = O.getOwnPropertyDescriptors(base)\n\t\tdelete descriptors[DRAFT_STATE as any]\n\t\tlet keys = Reflect.ownKeys(descriptors)\n\t\tfor (let i = 0; i < keys.length; i++) {\n\t\t\tconst key: any = keys[i]\n\t\t\tconst desc = descriptors[key]\n\t\t\tif (desc[WRITABLE] === false) {\n\t\t\t\tdesc[WRITABLE] = true\n\t\t\t\tdesc[CONFIGURABLE] = true\n\t\t\t}\n\t\t\t// like object.assign, we will read any _own_, get/set accessors. This helps in dealing\n\t\t\t// with libraries that trap values, like mobx or vue\n\t\t\t// unlike object.assign, non-enumerables will be copied as well\n\t\t\tif (desc.get || desc.set)\n\t\t\t\tdescriptors[key] = {\n\t\t\t\t\t[CONFIGURABLE]: true,\n\t\t\t\t\t[WRITABLE]: true, // could live with !!desc.set as well here...\n\t\t\t\t\t[ENUMERABLE]: desc[ENUMERABLE],\n\t\t\t\t\t[VALUE]: base[key]\n\t\t\t\t}\n\t\t}\n\t\treturn O.create(getPrototypeOf(base), descriptors)\n\t} else {\n\t\t// perform a sloppy copy\n\t\tconst proto = getPrototypeOf(base)\n\t\tif (proto !== null && isPlain) {\n\t\t\treturn {...base} // assumption: better inner class optimization than the assign below\n\t\t}\n\t\tconst obj = O.create(proto)\n\t\treturn O.assign(obj, base)\n\t}\n}", "result_size": 1, "created_at": "2026-03-20T16:58:16.801413+00:00"}} {"sample_id": "trpc__trpc__generateEntrypoints__downstream__1hop_cc7524", "repo": "trpc/trpc", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["writeFileSyncRecursive"], "call_files": ["private/tmp/repos/trpc__trpc/scripts/entrypoints.ts"]}, "metadata": {"anchor": "generateEntrypoints", "anchor_file": "private/tmp/repos/trpc__trpc/scripts/entrypoints.ts", "anchor_source": "export async function generateEntrypoints(rawInputs: string[]) {\n const inputs = [...rawInputs];\n // set some defaults for the package.json\n\n const pkgJsonPath = path.resolve('package.json');\n\n const pkgJson: PackageJson = JSON.parse(fs.readFileSync(pkgJsonPath, 'utf8'));\n pkgJson.main = './dist/index.cjs';\n pkgJson.module = './dist/index.mjs';\n pkgJson.types = './dist/index.d.cts';\n pkgJson.files = ['dist', 'src', 'README.md'];\n pkgJson.exports = {\n './package.json': './package.json',\n '.': {\n import: { types: './dist/index.d.mts', default: './dist/index.mjs' },\n require: { types: './dist/index.d.cts', default: './dist/index.cjs' },\n },\n };\n\n // Added to turbo.json pipeline output to ensure cache works\n const scriptOutputs = new Set();\n scriptOutputs.add('package.json');\n scriptOutputs.add('dist/**');\n\n /** Parse the inputs to get the user-import-paths, e.g.\n * src/adapters/aws-lambda/index.ts -> adapters/aws-lambda\n * src/adapters/express.ts -> adapters/express\n *\n * Also, write to the package.json exports field, e.g.\n * src/adapters/aws-lambda/index.ts -> exports['adapters/aws-lambda'] = { import: './dist/adapters/aws-lambda/index.mjs', ... }\n * src/adapters/express.ts -> exports['adapters/express'] = { import: './dist/adapters/express.mjs', ... }\n */\n inputs\n .filter((i) => i !== 'src/index.ts') // index included by default above\n .sort()\n .forEach((i) => {\n // first, exclude 'src' part of the path\n const parts = i.split('/').slice(1);\n const pathWithoutSrc = parts.join('/');\n\n // if filename is index.ts, importPath is path until index.ts,\n // otherwise, importPath is the path without the file extension\n const importPath =\n parts.at(-1) === 'index.ts'\n ? parts.slice(0, -1).join('/')\n : pathWithoutSrc.replace(/\\.(ts|tsx)$/, '');\n\n // write this entrypoint to the package.json exports field\n const esm = './dist/' + pathWithoutSrc.replace(/\\.(ts|tsx)$/, '.mjs');\n const cjs = './dist/' + pathWithoutSrc.replace(/\\.(ts|tsx)$/, '.cjs');\n pkgJson.exports[`./${importPath}`] = {\n import: { types: esm.replace(/\\.mjs$/, '.d.mts'), default: esm },\n require: { types: cjs.replace(/\\.cjs$/, '.d.cts'), default: cjs },\n };\n\n // create the barrelfile, linking the declared exports to the compiled files in dist\n const importDepth = importPath.split('/').length || 1;\n\n // in windows, \"path.join\" uses backslashes, it leads escape characters\n const resolvedImport = [\n ...Array(importDepth).fill('..'),\n 'dist',\n pathWithoutSrc.replace(/\\.(ts|tsx)$/, ''),\n ].join('/');\n\n // package.json\n const packageJson = path.resolve(importPath, 'package.json');\n const packageJsonContent = JSON.stringify({\n main: `${resolvedImport}.cjs`,\n module: `${resolvedImport}.mjs`,\n types: `${resolvedImport}.d.cts`,\n });\n writeFileSyncRecursive(packageJson, packageJsonContent);\n });\n\n // write top-level directories to package.json 'files' field\n Object.keys(pkgJson.exports).forEach((entrypoint) => {\n // get the top-level directory of the entrypoint, e.g. 'adapters/aws-lambda' -> 'adapters'\n const topLevel = entrypoint.split('/')[1];\n\n if (!topLevel) return;\n if (pkgJson.files.includes(topLevel)) return;\n pkgJson.files.push(topLevel);\n\n if (topLevel !== 'package.json') scriptOutputs.add(topLevel + '/**');\n });\n\n // Exclude test files in builds\n pkgJson.files.push('!**/*.test.*');\n pkgJson.files.push('!**/__tests__');\n // Add `funding` in all packages\n pkgJson.funding = ['https://trpc.io/sponsor'];\n\n // Add `peerDependencies` in all packages\n pkgJson.peerDependencies ??= {};\n pkgJson.peerDependencies['typescript'] = '>=5.7.2';\n\n // write package.json\n const formattedPkgJson = await prettier.format(JSON.stringify(pkgJson), {\n parser: 'json-stringify',\n ...(await prettier.resolveConfig(pkgJsonPath)),\n });\n fs.writeFileSync(pkgJsonPath, formattedPkgJson, 'utf8');\n\n const turboPath = path.resolve('turbo.json');\n const turboJson = JSON.parse(fs.readFileSync(turboPath, 'utf8'));\n turboJson.tasks.build ??= {};\n turboJson.tasks.build.outputs = [...scriptOutputs];\n const formattedTurboJson = await prettier.format(JSON.stringify(turboJson), {\n parser: 'json',\n ...(await prettier.resolveConfig(turboPath)),\n });\n fs.writeFileSync(turboPath, formattedTurboJson, 'utf8');\n}", "result_size": 1, "created_at": "2026-03-20T16:58:18.199328+00:00"}} {"sample_id": "colinhacks__zod___never__upstream__2hop_0556ec", "repo": "colinhacks/zod", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["never"], "hop_1_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/schemas.ts"], "hop_2": ["strictObject", "fromJSONSchema", "strict", "convertSchema", "convertBaseSchema"], "hop_2_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/schemas.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/from-json-schema.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/schemas.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/from-json-schema.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/from-json-schema.ts"]}, "metadata": {"anchor": "_never", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/api.ts", "anchor_source": "export function _never(Class: util.SchemaClass, params?: string | $ZodNeverParams): T {\n return new Class({\n type: \"never\",\n ...util.normalizeParams(params),\n });\n}", "result_size": 7, "created_at": "2026-03-20T16:58:16.474869+00:00", "file_content": ""}} {"sample_id": "psf__black__do_match__downstream__2hop_c423f1", "repo": "psf/black", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["is_valid_index_factory", "StringParser", "parse"], "hop_1_files": ["private/tmp/repos/psf__black/src/black/trans.py", "private/tmp/repos/psf__black/src/black/trans.py", "private/tmp/repos/psf__black/src/black/trans.py"], "hop_2": ["_next_state"], "hop_2_files": ["private/tmp/repos/psf__black/src/black/trans.py"]}, "metadata": {"anchor": "do_match", "anchor_file": "private/tmp/repos/psf__black/src/black/trans.py", "anchor_source": "def do_match(self, line: Line) -> TMatchResult:\n LL = line.leaves\n\n is_valid_index = is_valid_index_factory(LL)\n\n string_indices = []\n\n idx = -1\n while True:\n idx += 1\n if idx >= len(LL):\n break\n leaf = LL[idx]\n\n # Should be a string...\n if leaf.type != token.STRING:\n continue\n\n # If this is a \"pointless\" string...\n if (\n leaf.parent\n and leaf.parent.parent\n and leaf.parent.parent.type == syms.simple_stmt\n ):\n continue\n\n # Should be preceded by a non-empty LPAR...\n if (\n not is_valid_index(idx - 1)\n or LL[idx - 1].type != token.LPAR\n or is_empty_lpar(LL[idx - 1])\n ):\n continue\n\n # That LPAR should NOT be preceded by a colon (which could be a\n # dictionary value), function name, or a closing bracket (which\n # could be a function returning a function or a list/dictionary\n # containing a function)...\n if is_valid_index(idx - 2) and (\n LL[idx - 2].type == token.COLON\n or LL[idx - 2].type == token.NAME\n or LL[idx - 2].type in CLOSING_BRACKETS\n ):\n continue\n\n string_idx = idx\n\n # Skip the string trailer, if one exists.\n string_parser = StringParser()\n next_idx = string_parser.parse(LL, string_idx)\n\n # if the leaves in the parsed string include a PERCENT, we need to\n # make sure the initial LPAR is NOT preceded by an operator with\n # higher or equal precedence to PERCENT\n if is_valid_index(idx - 2):\n # mypy can't quite follow unless we name this\n before_lpar = LL[idx - 2]\n if token.PERCENT in {leaf.type for leaf in LL[idx - 1 : next_idx]} and (\n (\n before_lpar.type\n in {\n token.STAR,\n token.AT,\n token.SLASH,\n token.DOUBLESLASH,\n token.PERCENT,\n token.TILDE,\n token.DOUBLESTAR,\n token.AWAIT,\n token.LSQB,\n token.LPAR,\n }\n )\n or (\n # only unary PLUS/MINUS\n before_lpar.parent\n and before_lpar.parent.type == syms.factor\n and (before_lpar.type in {token.PLUS, token.MINUS})\n )\n ):\n continue\n\n # Should be followed by a non-empty RPAR...\n if (\n is_valid_index(next_idx)\n and LL[next_idx].type == token.RPAR\n and not is_empty_rpar(LL[next_idx])\n ):\n # That RPAR should NOT be followed by anything with higher\n # precedence than PERCENT\n if is_valid_index(next_idx + 1) and LL[next_idx + 1].type in {\n token.DOUBLESTAR,\n token.LSQB,\n token.LPAR,\n token.DOT,\n }:\n continue\n\n string_indices.append(string_idx)\n idx = string_idx\n while idx < len(LL) - 1 and LL[idx + 1].type == token.STRING:\n idx += 1\n\n if string_indices:\n return Ok(string_indices)\n return TErr(\"This line has no strings wrapped in parens.\")", "result_size": 1, "created_at": "2026-03-20T16:58:17.494246+00:00"}} {"sample_id": "immerjs__immer__next__downstream__2hop_57166e", "repo": "immerjs/immer", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["get"], "hop_1_files": ["private/tmp/repos/immerjs__immer/src/plugins/mapset.ts"], "hop_2": ["isDraftable", "createProxy", "prepareMapCopy", "assertUnrevoked"], "hop_2_files": ["private/tmp/repos/immerjs__immer/src/utils/common.ts", "private/tmp/repos/immerjs__immer/src/core/immerClass.ts", "private/tmp/repos/immerjs__immer/src/plugins/mapset.ts", "private/tmp/repos/immerjs__immer/src/plugins/mapset.ts"]}, "metadata": {"anchor": "next", "anchor_file": "private/tmp/repos/immerjs__immer/src/plugins/mapset.ts", "anchor_source": "next: () => {\n\t\t\t\t\tconst r = iterator.next()\n\t\t\t\t\t/* istanbul ignore next */\n\t\t\t\t\tif (r.done) return r\n\t\t\t\t\tconst value = this.get(r.value)\n\t\t\t\t\treturn {\n\t\t\t\t\t\tdone: false,\n\t\t\t\t\t\tvalue\n\t\t\t\t\t}\n\t\t\t\t}", "result_size": 4, "created_at": "2026-03-20T16:58:16.801413+00:00"}} {"sample_id": "agronholm__apscheduler___reconstitute_event__upstream__2hop_cd31f3", "repo": "agronholm/apscheduler", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["reconstitute_event", "reconstitute_event_str"], "hop_1_files": ["private/tmp/repos/agronholm__apscheduler/src/apscheduler/eventbrokers/base.py", "private/tmp/repos/agronholm__apscheduler/src/apscheduler/eventbrokers/base.py"], "hop_2": ["listen_callback", "_listen_notifications", "_on_message", "_listen_messages"], "hop_2_files": ["private/tmp/repos/agronholm__apscheduler/src/apscheduler/eventbrokers/asyncpg.py", "private/tmp/repos/agronholm__apscheduler/src/apscheduler/eventbrokers/psycopg.py", "private/tmp/repos/agronholm__apscheduler/src/apscheduler/eventbrokers/mqtt.py", "private/tmp/repos/agronholm__apscheduler/src/apscheduler/eventbrokers/redis.py"]}, "metadata": {"anchor": "_reconstitute_event", "anchor_file": "private/tmp/repos/agronholm__apscheduler/src/apscheduler/eventbrokers/base.py", "anchor_source": "def _reconstitute_event(self, event_type: str, serialized: bytes) -> Event | None:\n try:\n kwargs = self.serializer.deserialize(serialized)\n except DeserializationError:\n self._logger.exception(\n \"Failed to deserialize an event of type %s\",\n event_type,\n extra={\"serialized\": serialized},\n )\n return None\n\n try:\n event_class = getattr(_events, event_type)\n except AttributeError:\n self._logger.error(\n \"Receive notification for a nonexistent event type: %s\",\n event_type,\n extra={\"serialized\": serialized},\n )\n return None\n\n try:\n return event_class.unmarshal(kwargs)\n except Exception:\n self._logger.exception(\"Error reconstituting event of type %s\", event_type)\n return None", "result_size": 5, "created_at": "2026-03-20T16:58:16.252821+00:00", "file_content": ""}} {"sample_id": "pallets__flask___prepare_response_obj__upstream__2hop_b0ddc6", "repo": "pallets/flask", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["response"], "hop_1_files": ["private/tmp/repos/flask/src/flask/json/provider.py"], "hop_2": ["jsonify", "make_response"], "hop_2_files": ["private/tmp/repos/flask/src/flask/json/__init__.py", "private/tmp/repos/flask/src/flask/app.py"]}, "metadata": {"anchor": "_prepare_response_obj", "anchor_file": "private/tmp/repos/flask/src/flask/json/provider.py", "anchor_source": "def _prepare_response_obj(\n self, args: tuple[t.Any, ...], kwargs: dict[str, t.Any]\n ) -> t.Any:\n if args and kwargs:\n raise TypeError(\"app.json.response() takes either args or kwargs, not both\")\n\n if not args and not kwargs:\n return None\n\n if len(args) == 1:\n return args[0]\n\n return args or kwargs", "result_size": 2, "created_at": "2026-03-20T16:58:17.167063+00:00", "file_content": "from __future__ import annotations\n\nimport dataclasses\nimport decimal\nimport json\nimport typing as t\nimport uuid\nimport weakref\nfrom datetime import date\n\nfrom werkzeug.http import http_date\n\nif t.TYPE_CHECKING: # pragma: no cover\n from werkzeug.sansio.response import Response\n\n from ..sansio.app import App\n\n\nclass JSONProvider:\n \"\"\"A standard set of JSON operations for an application. Subclasses\n of this can be used to customize JSON behavior or use different\n JSON libraries.\n\n To implement a provider for a specific library, subclass this base\n class and implement at least :meth:`dumps` and :meth:`loads`. All\n other methods have default implementations.\n\n To use a different provider, either subclass ``Flask`` and set\n :attr:`~flask.Flask.json_provider_class` to a provider class, or set\n :attr:`app.json ` to an instance of the class.\n\n :param app: An application instance. This will be stored as a\n :class:`weakref.proxy` on the :attr:`_app` attribute.\n\n .. versionadded:: 2.2\n \"\"\"\n\n def __init__(self, app: App) -> None:\n self._app: App = weakref.proxy(app)\n\n def dumps(self, obj: t.Any, **kwargs: t.Any) -> str:\n \"\"\"Serialize data as JSON.\n\n :param obj: The data to serialize.\n :param kwargs: May be passed to the underlying JSON library.\n \"\"\"\n raise NotImplementedError\n\n def dump(self, obj: t.Any, fp: t.IO[str], **kwargs: t.Any) -> None:\n \"\"\"Serialize data as JSON and write to a file.\n\n :param obj: The data to serialize.\n :param fp: A file opened for writing text. Should use the UTF-8\n encoding to be valid JSON.\n :param kwargs: May be passed to the underlying JSON library.\n \"\"\"\n fp.write(self.dumps(obj, **kwargs))\n\n def loads(self, s: str | bytes, **kwargs: t.Any) -> t.Any:\n \"\"\"Deserialize data as JSON.\n\n :param s: Text or UTF-8 bytes.\n :param kwargs: May be passed to the underlying JSON library.\n \"\"\"\n raise NotImplementedError\n\n def load(self, fp: t.IO[t.AnyStr], **kwargs: t.Any) -> t.Any:\n \"\"\"Deserialize data as JSON read from a file.\n\n :param fp: A file opened for reading text or UTF-8 bytes.\n :param kwargs: May be passed to the underlying JSON library.\n \"\"\"\n return self.loads(fp.read(), **kwargs)\n\n def _prepare_response_obj(\n self, args: tuple[t.Any, ...], kwargs: dict[str, t.Any]\n ) -> t.Any:\n if args and kwargs:\n raise TypeError(\"app.json.response() takes either args or kwargs, not both\")\n\n if not args and not kwargs:\n return None\n\n if len(args) == 1:\n return args[0]\n\n return args or kwargs\n\n def response(self, *args: t.Any, **kwargs: t.Any) -> Response:\n \"\"\"Serialize the given arguments as JSON, and return a\n :class:`~flask.Response` object with the ``application/json``\n mimetype.\n\n The :func:`~flask.json.jsonify` function calls this method for\n the current application.\n\n Either positional or keyword arguments can be given, not both.\n If no arguments are given, ``None`` is serialized.\n\n :param args: A single value to serialize, or multiple values to\n treat as a list to serialize.\n :param kwargs: Treat as a dict to serialize.\n \"\"\"\n obj = self._prepare_response_obj(args, kwargs)\n return self._app.response_class(self.dumps(obj), mimetype=\"application/json\")\n\n\ndef _default(o: t.Any) -> t.Any:\n if isinstance(o, date):\n return http_date(o)\n\n if isinstance(o, (decimal.Decimal, uuid.UUID)):\n return str(o)\n\n if dataclasses and dataclasses.is_dataclass(o):\n return dataclasses.asdict(o) # type: ignore[arg-type]\n\n if hasattr(o, \"__html__\"):\n return str(o.__html__())\n\n raise TypeError(f\"Object of type {type(o).__name__} is not JSON serializable\")\n\n\nclass DefaultJSONProvider(JSONProvider):\n \"\"\"Provide JSON operations using Python's built-in :mod:`json`\n library. Serializes the following additional data types:\n\n - :class:`datetime.datetime` and :class:`datetime.date` are\n serialized to :rfc:`822` strings. This is the same as the HTTP\n date format.\n - :class:`uuid.UUID` is serialized to a string.\n - :class:`dataclasses.dataclass` is passed to\n :func:`dataclasses.asdict`.\n - :class:`~markupsafe.Markup` (or any object with a ``__html__``\n method) will call the ``__html__`` method to get a string.\n \"\"\"\n\n default: t.Callable[[t.Any], t.Any] = staticmethod(_default)\n \"\"\"Apply this function to any object that :meth:`json.dumps` does\n not know how to serialize. It should return a valid JSON type or\n raise a ``TypeError``.\n \"\"\"\n\n ensure_ascii = True\n \"\"\"Replace non-ASCII characters with escape sequences. This may be\n more compatible with some clients, but can be disabled for better\n performance and size.\n \"\"\"\n\n sort_keys = True\n \"\"\"Sort the keys in any serialized dicts. This may be useful for\n some caching situations, but can be disabled for better performance.\n When enabled, keys must all be strings, they are not converted\n before sorting.\n \"\"\"\n\n compact: bool | None = None\n \"\"\"If ``True``, or ``None`` out of debug mode, the :meth:`response`\n output will not add indentation, newlines, or spaces. If ``False``,\n or ``None`` in debug mode, it will use a non-compact representation.\n \"\"\"\n\n mimetype = \"application/json\"\n \"\"\"The mimetype set in :meth:`response`.\"\"\"\n\n def dumps(self, obj: t.Any, **kwargs: t.Any) -> str:\n \"\"\"Serialize data as JSON to a string.\n\n Keyword arguments are passed to :func:`json.dumps`. Sets some\n parameter defaults from the :attr:`default`,\n :attr:`ensure_ascii`, and :attr:`sort_keys` attributes.\n\n :param obj: The data to serialize.\n :param kwargs: Passed to :func:`json.dumps`.\n \"\"\"\n kwargs.setdefault(\"default\", self.default)\n kwargs.setdefault(\"ensure_ascii\", self.ensure_ascii)\n kwargs.setdefault(\"sort_keys\", self.sort_keys)\n return json.dumps(obj, **kwargs)\n\n def loads(self, s: str | bytes, **kwargs: t.Any) -> t.Any:\n \"\"\"Deserialize data as JSON from a string or bytes.\n\n :param s: Text or UTF-8 bytes.\n :param kwargs: Passed to :func:`json.loads`.\n \"\"\"\n return json.loads(s, **kwargs)\n\n def response(self, *args: t.Any, **kwargs: t.Any) -> Response:\n \"\"\"Serialize the given arguments as JSON, and return a\n :class:`~flask.Response` object with it. The response mimetype\n will be \"application/json\" and can be changed with\n :attr:`mimetype`.\n\n If :attr:`compact` is ``False`` or debug mode is enabled, the\n output will be formatted to be easier to read.\n\n Either positional or keyword arguments can be given, not both.\n If no arguments are given, ``None`` is serialized.\n\n :param args: A single value to serialize, or multiple values to\n treat as a list to serialize.\n :param kwargs: Treat as a dict to serialize.\n \"\"\"\n obj = self._prepare_response_obj(args, kwargs)\n dump_args: dict[str, t.Any] = {}\n\n if (self.compact is None and self._app.debug) or self.compact is False:\n dump_args.setdefault(\"indent\", 2)\n else:\n dump_args.setdefault(\"separators\", (\",\", \":\"))\n\n return self._app.response_class(\n f\"{self.dumps(obj, **dump_args)}\\n\", mimetype=self.mimetype\n )\n"}} {"sample_id": "colinhacks__zod__gte__downstream__2hop_3b3175", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["setLimit"], "hop_1_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"], "hop_2": ["ZodNumber", "constructor"], "hop_2_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"]}, "metadata": {"anchor": "gte", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "anchor_source": "gte(value: number, message?: errorUtil.ErrMessage) {\n return this.setLimit(\"min\", value, true, errorUtil.toString(message));\n }", "result_size": 2, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "trpc__trpc__actionHandler__downstream__2hop_f42a78", "repo": "trpc/trpc", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["formDataToObject", "createServerAction", "getTRPCErrorFromUnknown", "TRPCError", "deserialize", "constructor", "getErrorShape", "isFormData", "transformTRPCResponse"], "hop_1_files": ["private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/http/formDataToObject.ts", "private/tmp/repos/trpc__trpc/packages/next/src/app-dir/server.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/error/TRPCError.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/error/TRPCError.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/transformer.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/error/TRPCError.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/error/getErrorShape.ts", "private/tmp/repos/trpc__trpc/packages/next/src/app-dir/shared.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/transformer.ts"], "hop_2": ["transformTRPCResponseItem", "set", "emptyObject", "getHTTPStatusCodeFromError", "getCauseFromUnknown"], "hop_2_files": ["private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/transformer.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/http/formDataToObject.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/utils.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/error/TRPCError.ts"]}, "metadata": {"anchor": "actionHandler", "anchor_file": "private/tmp/repos/trpc__trpc/packages/next/src/app-dir/server.ts", "anchor_source": "return async function actionHandler(\n rawInput: FormData | inferProcedureInput,\n ) {\n let ctx: TInstance['_config']['$types']['ctx'] | undefined = undefined;\n try {\n ctx = (await createContext?.()) ?? {};\n if (normalizeFormData && isFormData(rawInput)) {\n // Normalizes FormData so we can use `z.object({})` etc on the server\n try {\n rawInput = formDataToObject(rawInput);\n } catch {\n throw new TRPCError({\n code: 'INTERNAL_SERVER_ERROR',\n message: 'Failed to convert FormData to an object',\n });\n }\n } else if (rawInput && !isFormData(rawInput)) {\n rawInput = transformer.input.deserialize(rawInput);\n }\n\n const data = proc._def.experimental_caller\n ? await proc(rawInput as any)\n : await proc({\n input: undefined,\n ctx,\n path: '',\n getRawInput: async () => rawInput,\n type: proc._def.type,\n // is it possible to get the AbortSignal from the request?\n signal: undefined,\n batchIndex: 0,\n });\n\n const transformedJSON = transformTRPCResponse(config, {\n result: {\n data,\n },\n });\n return transformedJSON;\n } catch (cause) {\n const error = getTRPCErrorFromUnknown(cause);\n\n opts.onError?.({\n ctx,\n error,\n input: rawInput,\n path: '',\n type: proc._def.type,\n });\n\n if (shouldRethrowNextErrors) {\n rethrowNextErrors(error);\n }\n\n const shape = getErrorShape({\n config,\n ctx,\n error,\n input: rawInput,\n path: '',\n type: proc._def.type,\n });\n\n return transformTRPCResponse(t._config, {\n error: shape,\n });\n }\n } as TRPCActionHandler<", "result_size": 5, "created_at": "2026-03-20T16:58:18.199328+00:00"}} {"sample_id": "trpc__trpc__allAbortSignals__upstream__1hop_5ffc00", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["fetch", "httpBatchStreamLink", "httpBatchLink"], "call_files": ["private/tmp/repos/trpc__trpc/packages/client/src/links/httpBatchStreamLink.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/httpBatchStreamLink.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/httpBatchLink.ts"]}, "metadata": {"anchor": "allAbortSignals", "anchor_file": "private/tmp/repos/trpc__trpc/packages/client/src/internals/signals.ts", "anchor_source": "export function allAbortSignals(...signals: Maybe[]): AbortSignal {\n const ac = new AbortController();\n\n const count = signals.length;\n\n let abortedCount = 0;\n\n const onAbort = () => {\n if (++abortedCount === count) {\n ac.abort();\n }\n };\n\n for (const signal of signals) {\n if (signal?.aborted) {\n onAbort();\n } else {\n signal?.addEventListener('abort', onAbort, {\n once: true,\n });\n }\n }\n\n return ac.signal;\n}", "result_size": 7, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "immerjs__immer__rootDraftCleanup__upstream__2hop_79e347", "repo": "immerjs/immer", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["createProxy"], "hop_1_files": ["private/tmp/repos/immerjs__immer/src/core/immerClass.ts"], "hop_2": ["createDraft", "enableMapSet", "prepareSetCopy", "get"], "hop_2_files": ["private/tmp/repos/immerjs__immer/src/core/immerClass.ts", "private/tmp/repos/immerjs__immer/src/plugins/mapset.ts", "private/tmp/repos/immerjs__immer/src/plugins/mapset.ts", "private/tmp/repos/immerjs__immer/src/plugins/mapset.ts"]}, "metadata": {"anchor": "rootDraftCleanup", "anchor_file": "private/tmp/repos/immerjs__immer/src/core/immerClass.ts", "anchor_source": "state.callbacks_.push(function rootDraftCleanup(rootScope) {\n\t\t\trootScope.mapSetPlugin_?.fixSetContents(state)\n\n\t\t\tconst {patchPlugin_} = rootScope\n\n\t\t\tif (state.modified_ && patchPlugin_) {\n\t\t\t\tpatchPlugin_.generatePatches_(state, [], rootScope)\n\t\t\t}\n\t\t})", "result_size": 6, "created_at": "2026-03-20T16:58:16.801413+00:00", "file_content": ""}} {"sample_id": "colinhacks__zod__dirty__upstream__2hop_fdba94", "repo": "colinhacks/zod", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["_parse", "addIssue", "mergeObjectSync", "finalizeSet", "mergeArray"], "hop_1_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/helpers/parseUtil.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/helpers/parseUtil.ts"], "hop_2": ["mergeObjectAsync", "_parse"], "hop_2_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/helpers/parseUtil.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"]}, "metadata": {"anchor": "dirty", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/helpers/parseUtil.ts", "anchor_source": "dirty(): void {\n if (this.value === \"valid\") this.value = \"dirty\";\n }", "result_size": 3, "created_at": "2026-03-20T16:58:16.474869+00:00", "file_content": ""}} {"sample_id": "colinhacks__zod___maxLength__upstream__1hop_b15b22", "repo": "colinhacks/zod", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["max", "convertBaseSchema"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/schemas.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/from-json-schema.ts"]}, "metadata": {"anchor": "_maxLength", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/api.ts", "anchor_source": "export function _maxLength(\n maximum: number,\n params?: string | $ZodCheckMaxLengthParams\n): checks.$ZodCheckMaxLength {\n const ch = new checks.$ZodCheckMaxLength({\n check: \"max_length\",\n ...util.normalizeParams(params),\n maximum,\n });\n return ch;\n}", "result_size": 4, "created_at": "2026-03-20T16:58:16.474869+00:00", "file_content": ""}} {"sample_id": "immerjs__immer__prepareCopy__upstream__1hop_4716c2", "repo": "immerjs/immer", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["deleteProperty", "handleCrossReference", "enableArrayMethods", "executeArrayMethod", "crossReferenceCleanup", "set", "get"], "call_files": ["private/tmp/repos/immerjs__immer/src/core/proxy.ts", "private/tmp/repos/immerjs__immer/src/core/finalize.ts", "private/tmp/repos/immerjs__immer/src/plugins/arrayMethods.ts", "private/tmp/repos/immerjs__immer/src/plugins/arrayMethods.ts", "private/tmp/repos/immerjs__immer/src/core/finalize.ts", "private/tmp/repos/immerjs__immer/src/core/proxy.ts", "private/tmp/repos/immerjs__immer/src/core/proxy.ts"]}, "metadata": {"anchor": "prepareCopy", "anchor_file": "private/tmp/repos/immerjs__immer/src/core/proxy.ts", "anchor_source": "export function prepareCopy(state: ImmerState) {\n\tif (!state.copy_) {\n\t\t// Actually create the `assigned_` map now that we\n\t\t// know this is a modified draft.\n\t\tstate.assigned_ = new Map()\n\t\tstate.copy_ = shallowCopy(\n\t\t\tstate.base_,\n\t\t\tstate.scope_.immer_.useStrictShallowCopy_\n\t\t)\n\t}\n}", "result_size": 7, "created_at": "2026-03-20T16:58:16.801413+00:00", "file_content": ""}} {"sample_id": "immerjs__immer__applyPatches__downstream__1hop_759b29", "repo": "immerjs/immer", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["Immer", "getPlugin"], "call_files": ["private/tmp/repos/immerjs__immer/src/core/immerClass.ts", "private/tmp/repos/immerjs__immer/src/utils/plugins.ts"]}, "metadata": {"anchor": "applyPatches", "anchor_file": "private/tmp/repos/immerjs__immer/src/core/immerClass.ts", "anchor_source": "applyPatches(base: T, patches: readonly Patch[]): T {\n\t\t// If a patch replaces the entire state, take that replacement as base\n\t\t// before applying patches\n\t\tlet i: number\n\t\tfor (i = patches.length - 1; i >= 0; i--) {\n\t\t\tconst patch = patches[i]\n\t\t\tif (patch.path.length === 0 && patch.op === \"replace\") {\n\t\t\t\tbase = patch.value\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\t// If there was a patch that replaced the entire state, start from the\n\t\t// patch after that.\n\t\tif (i > -1) {\n\t\t\tpatches = patches.slice(i + 1)\n\t\t}\n\n\t\tconst applyPatchesImpl = getPlugin(PluginPatches).applyPatches_\n\t\tif (isDraft(base)) {\n\t\t\t// N.B: never hits if some patch a replacement, patches are never drafts\n\t\t\treturn applyPatchesImpl(base, patches)\n\t\t}\n\t\t// Otherwise, produce a copy of the base state.\n\t\treturn this.produce(base, (draft: Drafted) =>\n\t\t\tapplyPatchesImpl(draft, patches)\n\t\t)\n\t}", "result_size": 2, "created_at": "2026-03-20T16:58:16.801413+00:00"}} {"sample_id": "rq__rq__get_job_count__downstream__1hop_bb8d67", "repo": "rq/rq", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["cleanup"], "call_files": ["private/tmp/repos/rq__rq/rq/registry.py"]}, "metadata": {"anchor": "get_job_count", "anchor_file": "private/tmp/repos/rq__rq/rq/registry.py", "anchor_source": "def get_job_count(self, cleanup=True) -> int:\n \"\"\"Returns the number of jobs in this registry after optional cleanup.\n\n Args:\n cleanup (bool, optional): _description_. Defaults to True.\n\n Returns:\n int: _description_\n \"\"\"\n if cleanup:\n self.cleanup()\n return self.connection.zcard(self.key)", "result_size": 1, "created_at": "2026-03-20T16:58:17.875204+00:00"}} {"sample_id": "immerjs__immer__executeArrayMethod__downstream__2hop_6cb168", "repo": "immerjs/immer", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["markChanged", "prepareCopy"], "hop_1_files": ["private/tmp/repos/immerjs__immer/src/core/proxy.ts", "private/tmp/repos/immerjs__immer/src/core/proxy.ts"], "hop_2": ["shallowCopy"], "hop_2_files": ["private/tmp/repos/immerjs__immer/src/utils/common.ts"]}, "metadata": {"anchor": "executeArrayMethod", "anchor_file": "private/tmp/repos/immerjs__immer/src/plugins/arrayMethods.ts", "anchor_source": "function executeArrayMethod(\n\t\tstate: ProxyArrayState,\n\t\toperation: () => T,\n\t\tmarkLength = true\n\t): T {\n\t\tprepareCopy(state)\n\t\tconst result = operation()\n\t\tmarkChanged(state)\n\t\tif (markLength) state.assigned_!.set(\"length\", true)\n\t\treturn result\n\t}", "result_size": 1, "created_at": "2026-03-20T16:58:16.801413+00:00"}} {"sample_id": "rq__rq__is_deferred__downstream__2hop_6d3942", "repo": "rq/rq", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["get_status"], "hop_1_files": ["private/tmp/repos/rq__rq/rq/job.py"], "hop_2": ["as_text", "JobStatus"], "hop_2_files": ["private/tmp/repos/rq__rq/rq/utils.py", "private/tmp/repos/rq__rq/rq/job.py"]}, "metadata": {"anchor": "is_deferred", "anchor_file": "private/tmp/repos/rq__rq/rq/job.py", "anchor_source": "@property\n def is_deferred(self) -> bool:\n return self.get_status() == JobStatus.DEFERRED", "result_size": 2, "created_at": "2026-03-20T16:58:17.875204+00:00"}} {"sample_id": "sindresorhus__got__merge__upstream__2hop_f63814", "repo": "sindresorhus/got", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["asPromise", "constructor", "extend"], "hop_1_files": ["private/tmp/repos/got/source/as-promise/index.ts", "private/tmp/repos/got/source/core/options.ts", "private/tmp/repos/got/source/create.ts"], "hop_2": ["constructor", "_onResponseBase", "fn"], "hop_2_files": ["private/tmp/repos/got/source/core/index.ts", "private/tmp/repos/got/source/core/index.ts", "private/tmp/repos/got/benchmark/index.ts"]}, "metadata": {"anchor": "merge", "anchor_file": "private/tmp/repos/got/source/core/options.ts", "anchor_source": "merge(options?: OptionsInit | Options) {\n\t\tif (!options) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (options instanceof Options) {\n\t\t\t// Create a copy of the #init array to avoid infinite loop\n\t\t\t// when merging an Options instance with itself\n\t\t\tconst initArray = [...options.#init];\n\t\t\tfor (const init of initArray) {\n\t\t\t\tthis.merge(init);\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\toptions = cloneRaw(options);\n\n\t\tinit(this, options, this);\n\t\tinit(options, options, this);\n\n\t\tthis.#merging = true;\n\n\t\ttry {\n\t\t\tlet push = false;\n\n\t\t\tfor (const key in options) {\n\t\t\t\t// `got.extend()` options\n\t\t\t\tif (key === 'mutableDefaults' || key === 'handlers') {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Never merge `url`\n\t\t\t\tif (key === 'url') {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Never merge `preserveHooks` - it's a control flag, not a persistent option\n\t\t\t\tif (key === 'preserveHooks') {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// `isStream` is set internally by `got.stream()`, not by user options\n\t\t\t\tif (key === 'isStream') {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (!(key in this)) {\n\t\t\t\t\tthrow new Error(`Unexpected option: ${key}`);\n\t\t\t\t}\n\n\t\t\t\t// @ts-expect-error Type 'unknown' is not assignable to type 'never'.\n\t\t\t\tconst value = options[key as keyof Options];\n\t\t\t\tif (value === undefined) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// @ts-expect-error Type 'unknown' is not assignable to type 'never'.\n\t\t\t\tthis[key as keyof Options] = value;\n\n\t\t\t\tpush = true;\n\t\t\t}\n\n\t\t\tif (push) {\n\t\t\t\tthis.#init.push(options);\n\t\t\t}\n\t\t} finally {\n\t\t\tthis.#merging = false;\n\t\t}\n\t}", "result_size": 4, "created_at": "2026-03-20T16:58:18.104721+00:00", "file_content": "import process from 'node:process';\nimport {promisify, inspect, type InspectOptions} from 'node:util';\nimport {checkServerIdentity, type SecureContextOptions, type DetailedPeerCertificate} from 'node:tls';\n// DO NOT use destructuring for `https.request` and `http.request` as it's not compatible with `nock`.\nimport https, {\n\ttype RequestOptions as HttpsRequestOptions,\n\ttype Agent as HttpsAgent,\n} from 'node:https';\nimport http, {\n\ttype Agent as HttpAgent,\n\ttype ClientRequest,\n} from 'node:http';\nimport type {Readable} from 'node:stream';\nimport type {Socket, LookupFunction} from 'node:net';\nimport is, {assert} from '@sindresorhus/is';\nimport lowercaseKeys from 'lowercase-keys';\nimport CacheableLookup from 'cacheable-lookup';\nimport http2wrapper, {type ClientHttp2Session} from 'http2-wrapper';\nimport type {KeyvStoreAdapter} from 'keyv';\nimport type KeyvType from 'keyv';\nimport type ResponseLike from 'responselike';\nimport type {RequestPromise} from '../as-promise/types.js';\nimport type {IncomingMessageWithTimings} from './utils/timer.js';\nimport parseLinkHeader from './parse-link-header.js';\nimport type {PlainResponse, Response} from './response.js';\nimport type {RequestError} from './errors.js';\nimport type {Delays} from './timed-out.js';\n\ntype StorageAdapter = KeyvStoreAdapter | KeyvType | Map;\n\ntype Promisable = T | Promise;\n\nconst [major, minor] = process.versions.node.split('.').map(Number) as [number, number, number];\n\nexport type DnsLookupIpVersion = undefined | 4 | 6;\n\ntype Except = Pick>;\n\nexport type NativeRequestOptions = HttpsRequestOptions & CacheOptions & {checkServerIdentity?: CheckServerIdentityFunction};\n\ntype AcceptableResponse = IncomingMessageWithTimings | ResponseLike;\ntype AcceptableRequestResult = Promisable;\nexport type RequestFunction = (url: URL, options: NativeRequestOptions, callback?: (response: AcceptableResponse) => void) => AcceptableRequestResult;\n\nexport type Agents = {\n\thttp?: HttpAgent | false;\n\thttps?: HttpsAgent | false;\n\thttp2?: unknown | false;\n};\n\nexport type Headers = Record;\n\nexport type ToughCookieJar = {\n\tgetCookieString: ((currentUrl: string, options: Record, callback: (error: Error | undefined, cookies: string) => void) => void)\n\t\t& ((url: string, callback: (error: Error | undefined, cookieHeader: string) => void) => void);\n\tsetCookie: ((cookieOrString: unknown, currentUrl: string, options: Record, callback: (error: Error | undefined, cookie: unknown) => void) => void)\n\t\t& ((rawCookie: string, url: string, callback: (error: Error | undefined, result: unknown) => void) => void);\n};\n\nexport type PromiseCookieJar = {\n\tgetCookieString: (url: string) => Promise;\n\tsetCookie: (rawCookie: string, url: string) => Promise;\n};\n\n/**\nUtility type to override specific properties in a type.\n\nUses `Omit` to remove properties before adding them back to ensure proper type replacement rather than intersection, which handles edge cases with optional/required properties correctly.\n*/\ntype OverrideProperties = Omit & U;\n\n/**\nRepresents the runtime state of Options as seen by hooks after normalization.\n\nSome Options properties accept multiple input types but are normalized to a single type internally by the Options class setters. This type reflects the actual runtime types that hooks receive, ensuring type safety when accessing options within hook functions.\n*/\nexport type NormalizedOptions = OverrideProperties;\n\nexport type InitHook = (init: OptionsInit, self: Options) => void;\n\nexport type BeforeRequestHookContext = {\n\t/**\n\tThe current retry count.\n\n\tIt will be `0` for the initial request and increment for each retry.\n\t*/\n\tretryCount: number;\n};\n\nexport type BeforeRequestHook = (options: NormalizedOptions, context: BeforeRequestHookContext) => Promisable;\nexport type BeforeRedirectHook = (updatedOptions: NormalizedOptions, plainResponse: PlainResponse) => Promisable;\nexport type BeforeErrorHook = (error: RequestError) => Promisable;\nexport type BeforeRetryHook = (error: RequestError, retryCount: number) => Promisable;\nexport type BeforeCacheHook = (response: PlainResponse) => false | void;\nexport type AfterResponseHook = (response: Response, retryWithMergedOptions: (options: OptionsInit) => never) => Promisable>;\n\n/**\nAll available hooks of Got.\n*/\nexport type Hooks = {\n\t/**\n\tCalled with the plain request options, right before their normalization.\n\n\tThe second argument represents the current `Options` instance.\n\n\t@default []\n\n\t**Note:**\n\t> - This hook must be synchronous.\n\n\t**Note:**\n\t> - This is called every time options are merged.\n\n\t**Note:**\n\t> - The `options` object may not have the `url` property. To modify it, use a `beforeRequest` hook instead.\n\n\t**Note:**\n\t> - This hook is called when a new instance of `Options` is created.\n\t> - Do not confuse this with the creation of `Request` or `got(\u2026)`.\n\n\t**Note:**\n\t> - When using `got(url)` or `got(url, undefined, defaults)` this hook will **not** be called.\n\n\tThis is especially useful in conjunction with `got.extend()` when the input needs custom handling.\n\n\tFor example, this can be used to fix typos to migrate from older versions faster.\n\n\t@example\n\t```\n\timport got from 'got';\n\n\tconst instance = got.extend({\n\t\thooks: {\n\t\t\tinit: [\n\t\t\t\tplain => {\n\t\t\t\t\tif ('followRedirects' in plain) {\n\t\t\t\t\t\tplain.followRedirect = plain.followRedirects;\n\t\t\t\t\t\tdelete plain.followRedirects;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t});\n\n\t// Normally, the following would throw:\n\tconst response = await instance(\n\t\t'https://example.com',\n\t\t{\n\t\t\tfollowRedirects: true\n\t\t}\n\t);\n\n\t// There is no option named `followRedirects`, but we correct it in an `init` hook.\n\t```\n\n\tOr you can create your own option and store it in a context:\n\n\t```\n\timport got from 'got';\n\n\tconst instance = got.extend({\n\t\thooks: {\n\t\t\tinit: [\n\t\t\t\t(plain, options) => {\n\t\t\t\t\tif ('secret' in plain) {\n\t\t\t\t\t\toptions.context.secret = plain.secret;\n\t\t\t\t\t\tdelete plain.secret;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t],\n\t\t\tbeforeRequest: [\n\t\t\t\toptions => {\n\t\t\t\t\toptions.headers.secret = options.context.secret;\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t});\n\n\tconst {headers} = await instance(\n\t\t'https://httpbin.org/anything',\n\t\t{\n\t\t\tsecret: 'passphrase'\n\t\t}\n\t).json();\n\n\tconsole.log(headers.Secret);\n\t//=> 'passphrase'\n\t```\n\t*/\n\tinit: InitHook[];\n\n\t/**\n\tCalled right before making the request with `options.createNativeRequestOptions()`.\n\n\tThe second argument is a context object containing request state information.\n\n\tThis hook is especially useful in conjunction with `got.extend()` when you want to sign your request.\n\n\t@default []\n\n\t**Note:**\n\t> - Got will make no further changes to the request before it is sent.\n\n\t**Note:**\n\t> - Changing `options.json` or `options.form` has no effect on the request. You should change `options.body` instead. If needed, update the `options.headers` accordingly.\n\n\t@example\n\t```\n\timport got from 'got';\n\n\tconst response = await got.post(\n\t\t'https://httpbin.org/anything',\n\t\t{\n\t\t\tjson: {payload: 'old'},\n\t\t\thooks: {\n\t\t\t\tbeforeRequest: [\n\t\t\t\t\t(options, context) => {\n\t\t\t\t\t\toptions.body = JSON.stringify({payload: 'new'});\n\t\t\n# \u2026 (truncated at 8000 chars)"}} {"sample_id": "python-poetry__poetry__handle_starttag__downstream__1hop_d991bc", "repo": "python-poetry/poetry", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["Result", "_match_class"], "call_files": ["private/tmp/repos/python-poetry__poetry/src/poetry/repositories/parsers/pypi_search_parser.py", "private/tmp/repos/python-poetry__poetry/src/poetry/repositories/parsers/pypi_search_parser.py"]}, "metadata": {"anchor": "handle_starttag", "anchor_file": "private/tmp/repos/python-poetry__poetry/src/poetry/repositories/parsers/pypi_search_parser.py", "anchor_source": "def handle_starttag(self, tag: str, attrs: list[tuple[str, str | None]]) -> None:\n if not self._current:\n if tag == \"a\" and self._match_class(attrs, \"package-snippet\"):\n self._current = Result()\n self._nest_anchors = 1\n else:\n if tag == \"span\" and self._match_class(attrs, \"package-snippet__name\"):\n self._data_callback = functools.partial(setattr, self._current, \"name\")\n elif tag == \"span\" and self._match_class(attrs, \"package-snippet__version\"):\n self._data_callback = functools.partial(\n setattr, self._current, \"version\"\n )\n elif tag == \"p\" and self._match_class(\n attrs, \"package-snippet__description\"\n ):\n self._data_callback = functools.partial(\n setattr, self._current, \"description\"\n )\n elif tag == \"a\":\n self._nest_anchors += 1", "result_size": 2, "created_at": "2026-03-20T16:58:17.758794+00:00"}} {"sample_id": "trpc__trpc__error__downstream__2hop_11edf1", "repo": "trpc/trpc", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["attempt"], "hop_1_files": ["private/tmp/repos/trpc__trpc/packages/client/src/links/retryLink.ts"], "hop_2": ["opWithLastEventId", "subscribe"], "hop_2_files": ["private/tmp/repos/trpc__trpc/packages/client/src/links/retryLink.ts", "private/tmp/repos/trpc__trpc/packages/server/src/observable/types.ts"]}, "metadata": {"anchor": "error", "anchor_file": "private/tmp/repos/trpc__trpc/packages/client/src/links/retryLink.ts", "anchor_source": "error(error) {\n const shouldRetry = opts.retry({\n op,\n attempts,\n error,\n });\n if (!shouldRetry) {\n observer.error(error);\n return;\n }\n const delayMs = opts.retryDelayMs?.(attempts) ?? 0;\n\n if (delayMs <= 0) {\n attempt(attempts + 1);\n return;\n }\n callNextTimeout = setTimeout(\n () => attempt(attempts + 1),\n delayMs,\n );\n },", "result_size": 2, "created_at": "2026-03-20T16:58:18.199328+00:00"}} {"sample_id": "pytest-dev__pytest__pytest_runtest_setup__downstream__2hop_3835e5", "repo": "pytest-dev/pytest", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["evaluate_skip_marks", "evaluate_xfail_marks"], "hop_1_files": ["private/tmp/repos/pytest-dev__pytest/src/_pytest/skipping.py", "private/tmp/repos/pytest-dev__pytest/src/_pytest/skipping.py"], "hop_2": ["evaluate_condition"], "hop_2_files": ["private/tmp/repos/pytest-dev__pytest/src/_pytest/skipping.py"]}, "metadata": {"anchor": "pytest_runtest_setup", "anchor_file": "private/tmp/repos/pytest-dev__pytest/src/_pytest/skipping.py", "anchor_source": "@hookimpl(tryfirst=True)\ndef pytest_runtest_setup(item: Item) -> None:\n skipped = evaluate_skip_marks(item)\n if skipped:\n raise skip.Exception(skipped.reason, _use_item_location=True)\n\n item.stash[xfailed_key] = xfailed = evaluate_xfail_marks(item)\n if xfailed and not item.config.option.runxfail and not xfailed.run:\n xfail(\"[NOTRUN] \" + xfailed.reason)", "result_size": 1, "created_at": "2026-03-20T16:58:17.641689+00:00"}} {"sample_id": "psf__black___generate_pickle_name__upstream__2hop_25ea17", "repo": "psf/black", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["load_packaged_grammar", "load_grammar"], "hop_1_files": ["private/tmp/repos/psf__black/src/blib2to3/pgen2/driver.py", "private/tmp/repos/psf__black/src/blib2to3/pgen2/driver.py"], "hop_2": ["initialize", "main"], "hop_2_files": ["private/tmp/repos/psf__black/src/blib2to3/pygram.py", "private/tmp/repos/psf__black/src/blib2to3/pgen2/driver.py"]}, "metadata": {"anchor": "_generate_pickle_name", "anchor_file": "private/tmp/repos/psf__black/src/blib2to3/pgen2/driver.py", "anchor_source": "def _generate_pickle_name(gt: Path, cache_dir: Path | None = None) -> str:\n head, tail = os.path.splitext(gt)\n if tail == \".txt\":\n tail = \"\"\n name = head + tail + \".\".join(map(str, sys.version_info)) + \".pickle\"\n if cache_dir:\n return os.path.join(cache_dir, os.path.basename(name))\n else:\n return name", "result_size": 2, "created_at": "2026-03-20T16:58:17.494246+00:00", "file_content": ""}} {"sample_id": "locustio__locust__print_stats__upstream__1hop_e0c385", "repo": "locustio/locust", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["stats_printer_func", "main", "stats_printer", "shutdown"], "call_files": ["private/tmp/repos/locustio__locust/locust/stats.py", "private/tmp/repos/locustio__locust/locust/main.py", "private/tmp/repos/locustio__locust/locust/stats.py", "private/tmp/repos/locustio__locust/locust/main.py"]}, "metadata": {"anchor": "print_stats", "anchor_file": "private/tmp/repos/locustio__locust/locust/stats.py", "anchor_source": "def print_stats(stats: RequestStats, current=True) -> None:\n for line in get_stats_summary(stats, current):\n console_logger.info(line)\n console_logger.info(\"\")", "result_size": 4, "created_at": "2026-03-20T16:58:16.951273+00:00", "file_content": ""}} {"sample_id": "pallets__click__render_progress__downstream__2hop_adc4ec", "repo": "pallets/click", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["term_len", "format_progress_line", "echo"], "hop_1_files": ["private/tmp/repos/pallets__click/src/click/_compat.py", "private/tmp/repos/pallets__click/src/click/_termui_impl.py", "private/tmp/repos/pallets__click/src/click/utils.py"], "hop_2": ["_find_binary_writer", "format_pos", "format_bar", "auto_wrap_for_ansi", "format_eta", "strip_ansi", "format_pct", "resolve_color_default"], "hop_2_files": ["private/tmp/repos/pallets__click/src/click/_compat.py", "private/tmp/repos/pallets__click/src/click/_termui_impl.py", "private/tmp/repos/pallets__click/src/click/_termui_impl.py", "private/tmp/repos/pallets__click/src/click/_compat.py", "private/tmp/repos/pallets__click/src/click/_termui_impl.py", "private/tmp/repos/pallets__click/src/click/_compat.py", "private/tmp/repos/pallets__click/src/click/_termui_impl.py", "private/tmp/repos/pallets__click/src/click/globals.py"]}, "metadata": {"anchor": "render_progress", "anchor_file": "private/tmp/repos/pallets__click/src/click/_termui_impl.py", "anchor_source": "def render_progress(self) -> None:\n if self.hidden:\n return\n\n if not self._is_atty:\n # Only output the label once if the output is not a TTY.\n if self._last_line != self.label:\n self._last_line = self.label\n echo(self.label, file=self.file, color=self.color)\n return\n\n buf = []\n # Update width in case the terminal has been resized\n if self.autowidth:\n import shutil\n\n old_width = self.width\n self.width = 0\n clutter_length = term_len(self.format_progress_line())\n new_width = max(0, shutil.get_terminal_size().columns - clutter_length)\n if new_width < old_width and self.max_width is not None:\n buf.append(BEFORE_BAR)\n buf.append(\" \" * self.max_width)\n self.max_width = new_width\n self.width = new_width\n\n clear_width = self.width\n if self.max_width is not None:\n clear_width = self.max_width\n\n buf.append(BEFORE_BAR)\n line = self.format_progress_line()\n line_len = term_len(line)\n if self.max_width is None or self.max_width < line_len:\n self.max_width = line_len\n\n buf.append(line)\n buf.append(\" \" * (clear_width - line_len))\n line = \"\".join(buf)\n # Render the line only if it changed.\n\n if line != self._last_line:\n self._last_line = line\n echo(line, file=self.file, color=self.color, nl=False)\n self.file.flush()", "result_size": 8, "created_at": "2026-03-20T16:58:17.078639+00:00"}} {"sample_id": "immerjs__immer__dontMutateFrozenCollections__downstream__1hop_217ee4", "repo": "immerjs/immer", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["die"], "call_files": ["private/tmp/repos/immerjs__immer/src/utils/errors.ts"]}, "metadata": {"anchor": "dontMutateFrozenCollections", "anchor_file": "private/tmp/repos/immerjs__immer/src/utils/common.ts", "anchor_source": "function dontMutateFrozenCollections() {\n\tdie(2)\n}", "result_size": 1, "created_at": "2026-03-20T16:58:16.801413+00:00"}} {"sample_id": "encode__httpx__iter_raw__upstream__2hop_df5e88", "repo": "encode/httpx", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["iter_bytes"], "hop_1_files": ["private/tmp/repos/encode__httpx/httpx/_models.py"], "hop_2": ["read", "download_response", "iter_text"], "hop_2_files": ["private/tmp/repos/encode__httpx/httpx/_models.py", "private/tmp/repos/encode__httpx/httpx/_main.py", "private/tmp/repos/encode__httpx/httpx/_models.py"]}, "metadata": {"anchor": "iter_raw", "anchor_file": "private/tmp/repos/encode__httpx/httpx/_models.py", "anchor_source": "def iter_raw(self, chunk_size: int | None = None) -> typing.Iterator[bytes]:\n \"\"\"\n A byte-iterator over the raw response content.\n \"\"\"\n if self.is_stream_consumed:\n raise StreamConsumed()\n if self.is_closed:\n raise StreamClosed()\n if not isinstance(self.stream, SyncByteStream):\n raise RuntimeError(\"Attempted to call a sync iterator on an async stream.\")\n\n self.is_stream_consumed = True\n self._num_bytes_downloaded = 0\n chunker = ByteChunker(chunk_size=chunk_size)\n\n with request_context(request=self._request):\n for raw_stream_bytes in self.stream:\n self._num_bytes_downloaded += len(raw_stream_bytes)\n for chunk in chunker.decode(raw_stream_bytes):\n yield chunk\n\n for chunk in chunker.flush():\n yield chunk\n\n self.close()", "result_size": 3, "created_at": "2026-03-20T16:58:16.700579+00:00", "file_content": ""}} {"sample_id": "immerjs__immer__generatePatchesAndFinalize__upstream__2hop_8c957f", "repo": "immerjs/immer", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["childCleanup", "registerChildFinalizationCallback", "finalize"], "hop_1_files": ["private/tmp/repos/immerjs__immer/src/core/finalize.ts", "private/tmp/repos/immerjs__immer/src/core/finalize.ts", "private/tmp/repos/immerjs__immer/src/core/finalize.ts"], "hop_2": ["createProxy", "processResult"], "hop_2_files": ["private/tmp/repos/immerjs__immer/src/core/immerClass.ts", "private/tmp/repos/immerjs__immer/src/core/finalize.ts"]}, "metadata": {"anchor": "generatePatchesAndFinalize", "anchor_file": "private/tmp/repos/immerjs__immer/src/core/finalize.ts", "anchor_source": "function generatePatchesAndFinalize(state: ImmerState, rootScope: ImmerScope) {\n\tconst shouldFinalize =\n\t\tstate.modified_ &&\n\t\t!state.finalized_ &&\n\t\t(state.type_ === ArchType.Set ||\n\t\t\t(state.type_ === ArchType.Array &&\n\t\t\t\t(state as ProxyArrayState).allIndicesReassigned_) ||\n\t\t\t(state.assigned_?.size ?? 0) > 0)\n\n\tif (shouldFinalize) {\n\t\tconst {patchPlugin_} = rootScope\n\t\tif (patchPlugin_) {\n\t\t\tconst basePath = patchPlugin_!.getPath(state)\n\n\t\t\tif (basePath) {\n\t\t\t\tpatchPlugin_!.generatePatches_(state, basePath, rootScope)\n\t\t\t}\n\t\t}\n\n\t\tmarkStateFinalized(state)\n\t}\n}", "result_size": 2, "created_at": "2026-03-20T16:58:16.801413+00:00", "file_content": ""}} {"sample_id": "scrapy__scrapy__referrer__downstream__2hop_c321f7", "repo": "scrapy/scrapy", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["origin_referrer", "potentially_trustworthy", "tls_protected"], "hop_1_files": ["private/tmp/repos/scrapy__scrapy/scrapy/spidermiddlewares/referer.py", "private/tmp/repos/scrapy__scrapy/scrapy/spidermiddlewares/referer.py", "private/tmp/repos/scrapy__scrapy/scrapy/spidermiddlewares/referer.py"], "hop_2": ["origin"], "hop_2_files": ["private/tmp/repos/scrapy__scrapy/scrapy/spidermiddlewares/referer.py"]}, "metadata": {"anchor": "referrer", "anchor_file": "private/tmp/repos/scrapy__scrapy/scrapy/spidermiddlewares/referer.py", "anchor_source": "def referrer(self, response_url: str, request_url: str) -> str | None:\n if (\n self.tls_protected(response_url)\n and self.potentially_trustworthy(request_url)\n ) or not self.tls_protected(response_url):\n return self.origin_referrer(response_url)\n return None", "result_size": 1, "created_at": "2026-03-20T16:58:17.996583+00:00"}} {"sample_id": "rq__rq__fetch_dependencies__upstream__2hop_36f63c", "repo": "rq/rq", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["setup_dependencies", "cancel"], "hop_1_files": ["private/tmp/repos/rq__rq/rq/queue.py", "private/tmp/repos/rq__rq/rq/job.py"], "hop_2": ["cancel_job", "enqueue_job"], "hop_2_files": ["private/tmp/repos/rq__rq/rq/job.py", "private/tmp/repos/rq__rq/rq/queue.py"]}, "metadata": {"anchor": "fetch_dependencies", "anchor_file": "private/tmp/repos/rq__rq/rq/job.py", "anchor_source": "def fetch_dependencies(self, watch: bool = False, pipeline: Optional['Pipeline'] = None) -> list['Job']:\n \"\"\"Fetch all of a job's dependencies. If a pipeline is supplied, and\n watch is true, then set WATCH on all the keys of all dependencies.\n\n Returned jobs will use self's connection, not the pipeline supplied.\n\n If a job has been deleted from redis, it is not returned.\n\n Args:\n watch (bool, optional): Whether to WATCH the keys. Defaults to False.\n pipeline (Optional[Pipeline]): The Redis' pipeline to use. Defaults to None.\n\n Returns:\n jobs (list[Job]): A list of Jobs\n \"\"\"\n connection = pipeline if pipeline is not None else self.connection\n\n if watch and self._dependency_ids:\n connection.watch(*[self.key_for(dependency_id) for dependency_id in self._dependency_ids])\n\n dependencies_list = self.fetch_many(\n self._dependency_ids, connection=self.connection, serializer=self.serializer\n )\n jobs = [job for job in dependencies_list if job]\n return jobs", "result_size": 2, "created_at": "2026-03-20T16:58:17.875204+00:00", "file_content": ""}} {"sample_id": "celery__celery__reconnect_on_error__downstream__1hop_4f5cd9", "repo": "celery/celery", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["_reconnect"], "call_files": ["private/tmp/repos/celery/celery/backends/asynchronous.py"]}, "metadata": {"anchor": "reconnect_on_error", "anchor_file": "private/tmp/repos/celery/celery/backends/asynchronous.py", "anchor_source": "@contextmanager\n def reconnect_on_error(self):\n \"\"\"Context manager that catches connection errors and reconnects.\n\n Wraps a block of code so that any :attr:`_connection_errors` raised\n inside it trigger a call to :meth:`_reconnect`. If reconnection\n itself raises a connection error the consumer is considered\n unrecoverable and a :exc:`RuntimeError` is raised to signal that\n the Celery application must be restarted.\n \"\"\"\n try:\n yield\n except self._connection_errors:\n try:\n self._reconnect()\n except self._connection_errors as exc:\n logger.critical(E_RETRY_LIMIT_EXCEEDED)\n raise RuntimeError(E_RETRY_LIMIT_EXCEEDED) from exc", "result_size": 1, "created_at": "2026-03-20T16:58:16.326235+00:00"}} {"sample_id": "scrapy__scrapy__spider_closed__downstream__2hop_c0e92c", "repo": "scrapy/scrapy", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["log"], "hop_1_files": ["private/tmp/repos/scrapy__scrapy/scrapy/extensions/periodic_log.py"], "hop_2": ["log_timing", "log_delta", "log_crawler_stats"], "hop_2_files": ["private/tmp/repos/scrapy__scrapy/scrapy/extensions/periodic_log.py", "private/tmp/repos/scrapy__scrapy/scrapy/extensions/periodic_log.py", "private/tmp/repos/scrapy__scrapy/scrapy/extensions/periodic_log.py"]}, "metadata": {"anchor": "spider_closed", "anchor_file": "private/tmp/repos/scrapy__scrapy/scrapy/extensions/periodic_log.py", "anchor_source": "def spider_closed(self, spider: Spider, reason: str) -> None:\n self.log()\n if self.task and self.task.running:\n self.task.stop()", "result_size": 3, "created_at": "2026-03-20T16:58:17.996583+00:00"}} {"sample_id": "pallets__jinja__find_all__upstream__1hop_0bb961", "repo": "pallets/jinja", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["visit_For", "find_referenced_templates", "find", "visit_Assign", "extract_from_ast", "visit_Template"], "call_files": ["private/tmp/repos/pallets__jinja/src/jinja2/compiler.py", "private/tmp/repos/pallets__jinja/src/jinja2/meta.py", "private/tmp/repos/pallets__jinja/src/jinja2/nodes.py", "private/tmp/repos/pallets__jinja/src/jinja2/compiler.py", "private/tmp/repos/pallets__jinja/src/jinja2/ext.py", "private/tmp/repos/pallets__jinja/src/jinja2/compiler.py"]}, "metadata": {"anchor": "find_all", "anchor_file": "private/tmp/repos/pallets__jinja/src/jinja2/nodes.py", "anchor_source": "def find_all(\n self, node_type: type[_NodeBound] | tuple[type[_NodeBound], ...]\n ) -> t.Iterator[_NodeBound]:\n \"\"\"Find all the nodes of a given type. If the type is a tuple,\n the check is performed for any of the tuple items.\n \"\"\"\n for child in self.iter_child_nodes():\n if isinstance(child, node_type):\n yield child # type: ignore\n yield from child.find_all(node_type)", "result_size": 6, "created_at": "2026-03-20T16:58:17.229656+00:00", "file_content": ""}} {"sample_id": "trpc__trpc__getTransformer__upstream__1hop_b450d0", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["withTRPC", "createServerSideHelpers", "experimental_serverActionLink", "experimental_nextCacheLink", "wsLink", "httpSubscriptionLink", "unstable_localLink", "resolveHTTPLinkOptions"], "call_files": ["private/tmp/repos/trpc__trpc/packages/next/src/withTRPC.tsx", "private/tmp/repos/trpc__trpc/packages/react-query/src/server/ssgProxy.ts", "private/tmp/repos/trpc__trpc/packages/next/src/app-dir/create-action-hook.tsx", "private/tmp/repos/trpc__trpc/packages/next/src/app-dir/links/nextCache.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsLink.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/httpSubscriptionLink.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/localLink.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/internals/httpUtils.ts"]}, "metadata": {"anchor": "getTransformer", "anchor_file": "private/tmp/repos/trpc__trpc/packages/client/src/internals/transformer.ts", "anchor_source": "export function getTransformer(\n transformer:\n | TransformerOptions<{ transformer: false }>['transformer']\n | TransformerOptions<{ transformer: true }>['transformer']\n | undefined,\n): CombinedDataTransformer {\n const _transformer =\n transformer as CoercedTransformerParameters['transformer'];\n if (!_transformer) {\n return {\n input: {\n serialize: (data) => data,\n deserialize: (data) => data,\n },\n output: {\n serialize: (data) => data,\n deserialize: (data) => data,\n },\n };\n }\n if ('input' in _transformer) {\n return _transformer;\n }\n return {\n input: _transformer,\n output: _transformer,\n };\n}", "result_size": 8, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "rq__rq__get_jobs_with_met_dependencies__downstream__1hop_b52609", "repo": "rq/rq", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["key_for", "register_dependency", "dependencies_are_met"], "call_files": ["private/tmp/repos/rq__rq/rq/job.py", "private/tmp/repos/rq__rq/rq/job.py", "private/tmp/repos/rq__rq/rq/job.py"]}, "metadata": {"anchor": "get_jobs_with_met_dependencies", "anchor_file": "private/tmp/repos/rq__rq/rq/dependency.py", "anchor_source": "@classmethod\n def get_jobs_with_met_dependencies(cls, jobs: Iterable['Job'], pipeline: Pipeline):\n jobs_with_met_dependencies = []\n jobs_with_unmet_dependencies = []\n for job in jobs:\n while True:\n try:\n pipeline.watch(*[Job.key_for(dependency_id) for dependency_id in job._dependency_ids])\n job.register_dependency(pipeline=pipeline)\n if job.dependencies_are_met(pipeline=pipeline):\n jobs_with_met_dependencies.append(job)\n else:\n jobs_with_unmet_dependencies.append(job)\n pipeline.execute()\n except WatchError:\n continue\n break\n return jobs_with_met_dependencies, jobs_with_unmet_dependencies", "result_size": 3, "created_at": "2026-03-20T16:58:17.875204+00:00"}} {"sample_id": "colinhacks__zod__strip__downstream__1hop_63f33f", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["constructor", "ZodObject"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"]}, "metadata": {"anchor": "strip", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "anchor_source": "strip(): ZodObject {\n return new ZodObject({\n ...this._def,\n unknownKeys: \"strip\",\n }) as any;\n }", "result_size": 2, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "trpc__trpc__getClientArgs__upstream__1hop_2cc1ea", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["trpcQueryOptions", "trpcInfiniteQueryOptions", "trpcMutationOptions"], "call_files": ["private/tmp/repos/trpc__trpc/packages/tanstack-react-query/src/internals/queryOptions.ts", "private/tmp/repos/trpc__trpc/packages/tanstack-react-query/src/internals/infiniteQueryOptions.ts", "private/tmp/repos/trpc__trpc/packages/tanstack-react-query/src/internals/mutationOptions.ts"]}, "metadata": {"anchor": "getClientArgs", "anchor_file": "private/tmp/repos/trpc__trpc/packages/tanstack-react-query/src/internals/utils.ts", "anchor_source": "export function getClientArgs(\n queryKey: TRPCQueryKey,\n opts: TOptions,\n infiniteParams?: {\n pageParam: any;\n direction: 'forward' | 'backward';\n },\n) {\n const queryKeyData = readQueryKey(queryKey);\n\n let input = queryKeyData.args?.input;\n if (infiniteParams) {\n input = {\n ...(queryKeyData.args?.input ?? {}),\n ...(infiniteParams.pageParam !== undefined\n ? { cursor: infiniteParams.pageParam }\n : {}),\n direction: infiniteParams.direction,\n };\n }\n return [queryKeyData.path.join('.'), input, (opts as any)?.trpc] as const;\n}", "result_size": 3, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "sindresorhus__got___makeRequest__upstream__2hop_dbc0f7", "repo": "sindresorhus/got", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["_onResponseBase", "flush"], "hop_1_files": ["private/tmp/repos/got/source/core/index.ts", "private/tmp/repos/got/source/core/index.ts"], "hop_2": ["fn", "_onResponse", "_beforeError", "asPromise"], "hop_2_files": ["private/tmp/repos/got/benchmark/index.ts", "private/tmp/repos/got/source/core/index.ts", "private/tmp/repos/got/source/core/index.ts", "private/tmp/repos/got/source/as-promise/index.ts"]}, "metadata": {"anchor": "_makeRequest", "anchor_file": "private/tmp/repos/got/source/core/index.ts", "anchor_source": "private async _makeRequest(): Promise {\n\t\tconst {options} = this;\n\t\tconst headers = options.getInternalHeaders();\n\t\tconst {username, password} = options;\n\t\tconst cookieJar = options.cookieJar as PromiseCookieJar | undefined;\n\n\t\tfor (const key in headers) {\n\t\t\tif (is.undefined(headers[key])) {\n\t\t\t\toptions.deleteInternalHeader(key);\n\t\t\t} else if (is.null(headers[key])) {\n\t\t\t\tthrow new TypeError(`Use \\`undefined\\` instead of \\`null\\` to delete the \\`${key}\\` header`);\n\t\t\t}\n\t\t}\n\n\t\tif (options.decompress && is.undefined(headers['accept-encoding'])) {\n\t\t\tconst encodings = ['gzip', 'deflate'];\n\t\t\tif (supportsBrotli) {\n\t\t\t\tencodings.push('br');\n\t\t\t}\n\n\t\t\tif (supportsZstd) {\n\t\t\t\tencodings.push('zstd');\n\t\t\t}\n\n\t\t\toptions.setInternalHeader('accept-encoding', encodings.join(', '));\n\t\t}\n\n\t\tif (username || password) {\n\t\t\tconst credentials = Buffer.from(`${username}:${password}`).toString('base64');\n\t\t\toptions.setInternalHeader('authorization', `Basic ${credentials}`);\n\t\t}\n\n\t\t// Set cookies\n\t\tif (cookieJar) {\n\t\t\tlet cookieString = '';\n\t\t\tcookieString = await cookieJar.getCookieString(options.url!.toString());\n\n\t\t\tif (is.nonEmptyString(cookieString)) {\n\t\t\t\toptions.setInternalHeader('cookie', cookieString);\n\t\t\t}\n\t\t}\n\n\t\tlet request: ReturnType | undefined;\n\n\t\tfor (const hook of options.hooks.beforeRequest) {\n\t\t\t// eslint-disable-next-line no-await-in-loop\n\t\t\tconst result = await hook(options as NormalizedOptions, {retryCount: this.retryCount});\n\n\t\t\tif (!is.undefined(result)) {\n\t\t\t\t// @ts-expect-error Skip the type mismatch to support abstract responses\n\t\t\t\trequest = () => result;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\trequest ??= options.getRequestFunction();\n\n\t\tconst url = options.url as URL;\n\n\t\tthis._requestOptions = options.createNativeRequestOptions() as NativeRequestOptions;\n\n\t\tif (options.cache) {\n\t\t\t(this._requestOptions as any)._request = request;\n\t\t\t(this._requestOptions as any).cache = options.cache;\n\t\t\t(this._requestOptions as any).body = options.body;\n\t\t\t(this._requestOptions as any).beforeCacheHooks = options.hooks.beforeCache;\n\t\t\t(this._requestOptions as any).gotRequest = this;\n\n\t\t\ttry {\n\t\t\t\tthis._prepareCache(options.cache as StorageAdapter);\n\t\t\t} catch (error: unknown) {\n\t\t\t\tthrow new CacheError(normalizeError(error), this);\n\t\t\t}\n\t\t}\n\n\t\t// Cache support\n\t\tconst function_ = options.cache ? this._createCacheableRequest : request;\n\n\t\ttry {\n\t\t\t// We can't do `await fn(...)`,\n\t\t\t// because stream `error` event can be emitted before `Promise.resolve()`.\n\t\t\tlet requestOrResponse = function_!(url, this._requestOptions);\n\n\t\t\tif (is.promise(requestOrResponse)) {\n\t\t\t\trequestOrResponse = await requestOrResponse;\n\t\t\t}\n\n\t\t\tif (isClientRequest(requestOrResponse!)) {\n\t\t\t\tthis._onRequest(requestOrResponse);\n\t\t\t} else if (this.writableEnded) {\n\t\t\t\tvoid this._onResponse(requestOrResponse as IncomingMessageWithTimings);\n\t\t\t} else {\n\t\t\t\tthis.once('finish', () => {\n\t\t\t\t\tvoid this._onResponse(requestOrResponse as IncomingMessageWithTimings);\n\t\t\t\t});\n\n\t\t\t\tthis._sendBody();\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tif (error instanceof CacheableCacheError) {\n\t\t\t\tthrow new CacheError(error, this);\n\t\t\t}\n\n\t\t\tthrow error;\n\t\t}\n\t}", "result_size": 8, "created_at": "2026-03-20T16:58:18.104721+00:00", "file_content": "import process from 'node:process';\nimport {Buffer} from 'node:buffer';\nimport {Duplex, type Readable} from 'node:stream';\nimport {addAbortListener} from 'node:events';\nimport http, {ServerResponse, type ClientRequest, type RequestOptions} from 'node:http';\nimport type {Socket} from 'node:net';\nimport {byteLength} from 'byte-counter';\nimport {chunk} from 'chunk-data';\nimport CacheableRequest, {\n\tCacheError as CacheableCacheError,\n\ttype CacheableRequestFunction,\n\ttype CacheableOptions,\n} from 'cacheable-request';\nimport decompressResponse from 'decompress-response';\nimport type {KeyvStoreAdapter} from 'keyv';\nimport type KeyvType from 'keyv';\nimport is, {isBuffer} from '@sindresorhus/is';\nimport type ResponseLike from 'responselike';\nimport timer, {type ClientRequestWithTimings, type Timings, type IncomingMessageWithTimings} from './utils/timer.js';\nimport getBodySize from './utils/get-body-size.js';\nimport proxyEvents from './utils/proxy-events.js';\nimport timedOut, {TimeoutError as TimedOutTimeoutError} from './timed-out.js';\nimport stripUrlAuth from './utils/strip-url-auth.js';\nimport WeakableMap from './utils/weakable-map.js';\nimport calculateRetryDelay from './calculate-retry-delay.js';\nimport Options, {\n\ttype PromiseCookieJar,\n\ttype NativeRequestOptions,\n\ttype RetryOptions,\n\ttype OptionsError,\n\ttype OptionsInit,\n\ttype NormalizedOptions,\n} from './options.js';\nimport {\n\tcacheDecodedBody,\n\tisResponseOk,\n\ttype PlainResponse,\n\ttype Response,\n} from './response.js';\nimport isClientRequest from './utils/is-client-request.js';\nimport isUnixSocketURL, {getUnixSocketPath} from './utils/is-unix-socket-url.js';\nimport {\n\tRequestError,\n\tReadError,\n\tMaxRedirectsError,\n\tHTTPError,\n\tTimeoutError,\n\tUploadError,\n\tCacheError,\n\tAbortError,\n} from './errors.js';\nimport {\n\tgenerateRequestId,\n\tpublishRequestCreate,\n\tpublishRequestStart,\n\tpublishResponseStart,\n\tpublishResponseEnd,\n\tpublishRetry,\n\tpublishError,\n\tpublishRedirect,\n} from './diagnostics-channel.js';\n\ntype Error = NodeJS.ErrnoException;\n\nexport type Progress = {\n\tpercent: number;\n\ttransferred: number;\n\ttotal?: number;\n};\n\nconst supportsBrotli = is.string(process.versions.brotli);\nconst supportsZstd = is.string(process.versions.zstd);\nconst isUtf8Encoding = (encoding?: BufferEncoding): boolean => encoding === undefined || encoding.toLowerCase().replace('-', '') === 'utf8';\nconst textEncoder = new TextEncoder();\nconst concatUint8Arrays = (chunks: readonly Uint8Array[]): Uint8Array => {\n\tlet totalLength = 0;\n\tfor (const chunk of chunks) {\n\t\ttotalLength += chunk.byteLength;\n\t}\n\n\tconst result = new Uint8Array(totalLength);\n\tlet offset = 0;\n\n\tfor (const chunk of chunks) {\n\t\tresult.set(chunk, offset);\n\t\toffset += chunk.byteLength;\n\t}\n\n\treturn result;\n};\n\nconst methodsWithoutBody: ReadonlySet = new Set(['GET', 'HEAD']);\n\nexport type GotEventFunction =\n\t/**\n\t`request` event to get the request object of the request.\n\n\t __Tip__: You can use `request` event to abort requests.\n\n\t@example\n\t```\n\timport got from 'got';\n\n\tgot.stream('https://github.com')\n\t\t.on('request', request => setTimeout(() => request.destroy(), 50));\n\t```\n\t*/\n\t((name: 'request', listener: (request: ClientRequest) => void) => T)\n\n\t/**\n\tThe `response` event to get the response object of the final request.\n\t*/\n\t& ((name: 'response', listener: (response: R) => void) => T)\n\n\t/**\n\tThe `redirect` event to get the response object of a redirect. The second argument is options for the next request to the redirect location.\n\t*/\n\t& ((name: 'redirect', listener: (response: R, nextOptions: N) => void) => T)\n\n\t/**\n\tProgress events for uploading (sending a request) and downloading (receiving a response).\n\tThe `progress` argument is an object like:\n\n\t```\n\t{\n\t\tpercent: 0.1,\n\t\ttransferred: 1024,\n\t\ttotal: 10240\n\t}\n\t```\n\n\tIf the `content-length` header is missing, `total` will be `undefined`.\n\n\t@example\n\t```\n\timport got from 'got';\n\n\tconst response = await got('https://sindresorhus.com')\n\t\t.on('downloadProgress', progress => {\n\t\t\t// Report download progress\n\t\t})\n\t\t.on('uploadProgress', progress => {\n\t\t\t// Report upload progress\n\t\t});\n\n\tconsole.log(response);\n\t```\n\t*/\n\t& ((name: 'uploadProgress' | 'downloadProgress', listener: (progress: Progress) => void) => T)\n\t/**\n\tTo enable retrying on a Got stream, it is required to have a `retry` handler attached.\n\n\tWhen this event is emitted, you should reset the stream you were writing to and prepare the body again.\n\n\tSee `got.options.retry` for more information.\n\t*/\n\t& ((name: 'retry', listener: (retryCount: number, error: RequestError, createRetryStream: (options?: OptionsInit) => Request) => void) => T);\n\nexport type RequestEvents = {\n\ton: GotEventFunction;\n\tonce: GotEventFunction;\n\toff: GotEventFunction;\n};\n\ntype StorageAdapter = KeyvStoreAdapter | KeyvType | Map;\n\nconst cacheableStore = new WeakableMap();\n\nconst redirectCodes: ReadonlySet = new Set([300, 301, 302, 303, 304, 307, 308]);\nconst transientWriteErrorCodes: ReadonlySet = new Set(['EPIPE', 'ECONNRESET']);\n\n// Track errors that have been processed by beforeError hooks to preserve custom error types\nconst errorsProcessedByHooks = new WeakSet();\n\nconst proxiedRequestEvents = [\n\t'socket',\n\t'connect',\n\t'continue',\n\t'information',\n\t'upgrade',\n] as const;\n\nconst noop = (): void => {};\n\nconst isTransientWriteError = (error: Error): boolean => {\n\tconst {code} = error;\n\treturn typeof code === 'string' && transientWriteErrorCodes.has(code);\n};\n\nconst normalizeError = (error: unknown): Error => {\n\tif (error instanceof globalThis.Error) {\n\t\treturn error;\n\t}\n\n\tif (is.object(error)) {\n\t\tconst errorLike = error as Partial;\n\t\tconst message = typeof errorLike.message === 'string' ? errorLike.message : 'Non-error object thrown';\n\t\tconst normalizedError = new globalThis.Error(message, {cause: error}) as Error & {code?: string; input?: string};\n\n\t\tif (typeof errorLike.stack === 'string') {\n\t\t\tnormalizedError.stack = errorLike.stack;\n\t\t}\n\n\t\tif (typeof errorLike.code === 'string') {\n\t\t\tnormalizedError.code = errorLike.code;\n\t\t}\n\n\t\tif (typeof errorLike.input === 'string') {\n\t\t\tnormalizedError.input = errorLike.input;\n\t\t}\n\n\t\treturn normalizedError;\n\t}\n\n\treturn new globalThis.Error(String(error));\n};\n\ntype UrlType = ConstructorParameters[0];\ntype OptionsType = ConstructorParameters[1];\ntype DefaultsType = ConstructorParameters[2];\nconst getSanitizedUrl = (options?: Options): string => options?.url ? stripUrlAuth(options.url) : '';\n\nexport default class Request extends Duplex implements RequestEvents {\n\t// @ts-expect-error - Ignoring for now.\n\toverride ['constructor']: typeof Request;\n\n\t_noPipe?: boolean;\n\n\t// @ts-expect-error https://github.com/microsoft/TypeScript/issues/9568\n\toptions: Options;\n\tresponse?: PlainResponse;\n\trequestUrl?: URL;\n\tredirectUrls: URL[] = [];\n\tretryCount = 0;\n\t_stopReading = false;\n\n\tdeclare private _requestOptions: NativeRequestOptions;\n\n\tprivate _stopRetry = noop;\n\tprivate _downloadedSize = 0;\n\tprivate _uploadedSize = 0;\n\tprivate readonly _pipedServerResponses = new Set();\n\tprivate _request?: ClientRequest;\n\tprivate _responseSize?: number;\n\tprivate _bodySize?: number;\n\tprivate _unproxyEvents = noop;\n\tprivate _isFromCache?: boolean;\n\tprivate _triggerRead = false;\n\tprivate readonly _jobs: Array<() => void> = [];\n\tprivate _cancelTimeouts = noop;\n\tprivate readonly _removeListeners = noop;\n\tprivate _nativeResponse?: IncomingMessageWithTimings;\n\tprivate _flushed = false;\n\tprivate _aborted = false;\n\tprivate _expectedContentLength?: number;\n\tprivate _compressedBytesCount?: number;\n\tprivate _skipRequestEndInFinal = false;\n\tprivate _incrementalBodyDecoder?: TextDecoder;\n\tprivate _incrementalDecodedBodyChunks: string[] = [];\n\tprivate readonly _requestId = generateRequestId();\n\n\t// We need thi\n# \u2026 (truncated at 8000 chars)"}} {"sample_id": "trpc__trpc__withPing__upstream__1hop_326a27", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["generator", "createBatchStreamProducer", "sseStreamProducer"], "call_files": ["private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/sse.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/jsonl.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/sse.ts"]}, "metadata": {"anchor": "withPing", "anchor_file": "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/utils/withPing.ts", "anchor_source": "export async function* withPing(\n iterable: AsyncIterable,\n pingIntervalMs: number,\n): AsyncGenerator {\n await using iterator = iteratorResource(iterable);\n\n // declaration outside the loop for garbage collection reasons\n let result:\n | null\n | IteratorResult\n | typeof disposablePromiseTimerResult;\n\n let nextPromise = iterator.next();\n\n while (true) {\n using pingPromise = timerResource(pingIntervalMs);\n\n result = await Unpromise.race([nextPromise, pingPromise.start()]);\n\n if (result === disposablePromiseTimerResult) {\n // cancelled\n\n yield PING_SYM;\n continue;\n }\n\n if (result.done) {\n return result.value;\n }\n\n nextPromise = iterator.next();\n yield result.value;\n\n // free up reference for garbage collection\n result = null;\n }\n}", "result_size": 5, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "trpc__trpc__load__upstream__2hop_53729c", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["dataLoader", "httpBatchStreamLink", "httpBatchLink"], "hop_1_files": ["private/tmp/repos/trpc__trpc/packages/client/src/internals/dataLoader.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/httpBatchStreamLink.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/httpBatchLink.ts"], "hop_2": ["experimental_nextHttpLink", "dispatch"], "hop_2_files": ["private/tmp/repos/trpc__trpc/packages/next/src/app-dir/links/nextHttp.ts", "private/tmp/repos/trpc__trpc/packages/client/src/internals/dataLoader.ts"]}, "metadata": {"anchor": "load", "anchor_file": "private/tmp/repos/trpc__trpc/packages/client/src/internals/dataLoader.ts", "anchor_source": "function load(key: TKey): Promise {\n const item: BatchItem = {\n aborted: false,\n key,\n batch: null,\n resolve: throwFatalError,\n reject: throwFatalError,\n };\n\n const promise = new Promise((resolve, reject) => {\n item.reject = reject;\n item.resolve = resolve;\n\n pendingItems ??= [];\n pendingItems.push(item);\n });\n\n dispatchTimer ??= setTimeout(dispatch);\n\n return promise;\n }", "result_size": 6, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "rq__rq__get_heartbeat_ttl__upstream__2hop_719625", "repo": "rq/rq", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["maintain_heartbeats", "prepare_execution", "prepare_job_execution"], "hop_1_files": ["private/tmp/repos/rq__rq/rq/worker/base.py", "private/tmp/repos/rq__rq/rq/executions.py", "private/tmp/repos/rq__rq/rq/worker/base.py"], "hop_2": ["monitor_work_horse", "perform_job"], "hop_2_files": ["private/tmp/repos/rq__rq/rq/worker/worker_classes.py", "private/tmp/repos/rq__rq/rq/worker/base.py"]}, "metadata": {"anchor": "get_heartbeat_ttl", "anchor_file": "private/tmp/repos/rq__rq/rq/worker/base.py", "anchor_source": "def get_heartbeat_ttl(self, job: 'Job') -> int:\n \"\"\"Get's the TTL for the next heartbeat.\n\n Args:\n job (Job): The Job\n\n Returns:\n int: The heartbeat TTL.\n \"\"\"\n if job.timeout and job.timeout > 0:\n remaining_execution_time = job.timeout - self.current_job_working_time\n return int(min(remaining_execution_time, self.job_monitoring_interval)) + 60\n else:\n return self.job_monitoring_interval + 60", "result_size": 2, "created_at": "2026-03-20T16:58:17.875204+00:00", "file_content": ""}} {"sample_id": "pallets__jinja__do_unique__downstream__2hop_a60bda", "repo": "pallets/jinja", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["auto_to_list", "async_variant"], "hop_1_files": ["private/tmp/repos/pallets__jinja/src/jinja2/async_utils.py", "private/tmp/repos/pallets__jinja/src/jinja2/async_utils.py"], "hop_2": ["from_obj", "pass_eval_context", "is_async", "decorator"], "hop_2_files": ["private/tmp/repos/pallets__jinja/src/jinja2/utils.py", "private/tmp/repos/pallets__jinja/src/jinja2/utils.py", "private/tmp/repos/pallets__jinja/src/jinja2/async_utils.py", "private/tmp/repos/pallets__jinja/src/jinja2/async_utils.py"]}, "metadata": {"anchor": "do_unique", "anchor_file": "private/tmp/repos/pallets__jinja/src/jinja2/filters.py", "anchor_source": "@async_variant(sync_do_unique) # type: ignore\nasync def do_unique(\n environment: \"Environment\",\n value: \"t.AsyncIterable[V] | t.Iterable[V]\",\n case_sensitive: bool = False,\n attribute: str | int | None = None,\n) -> \"t.Iterator[V]\":\n return sync_do_unique(\n environment, await auto_to_list(value), case_sensitive, attribute\n )", "result_size": 4, "created_at": "2026-03-20T16:58:17.229656+00:00"}} {"sample_id": "python-poetry__poetry__build_config_setting_validator__downstream__1hop_5c4882", "repo": "python-poetry/poetry", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["build_config_setting_normalizer"], "call_files": ["private/tmp/repos/python-poetry__poetry/src/poetry/config/config.py"]}, "metadata": {"anchor": "build_config_setting_validator", "anchor_file": "private/tmp/repos/python-poetry__poetry/src/poetry/config/config.py", "anchor_source": "def build_config_setting_validator(val: str) -> bool:\n try:\n value = build_config_setting_normalizer(val)\n except JSONDecodeError:\n return False\n\n if not isinstance(value, dict):\n return False\n\n for key, item in value.items():\n # keys should be string\n if not isinstance(key, str):\n return False\n\n # items are allowed to be a string\n if isinstance(item, str):\n continue\n\n # list items should only contain strings\n is_valid_list = isinstance(item, list) and all(isinstance(i, str) for i in item)\n if not is_valid_list:\n return False\n\n return True", "result_size": 1, "created_at": "2026-03-20T16:58:17.758794+00:00"}} {"sample_id": "trpc__trpc__register__upstream__1hop_a700f3", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["error", "complete", "request", "batchSend"], "call_files": ["private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/requestManager.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/requestManager.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/wsClient.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/wsClient.ts"]}, "metadata": {"anchor": "register", "anchor_file": "private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/requestManager.ts", "anchor_source": "public register(message: TRPCClientOutgoingMessage, callbacks: TCallbacks) {\n const { promise: end, resolve } = withResolvers();\n\n this.outgoingRequests.push({\n id: String(message.id),\n message,\n end,\n callbacks: {\n next: callbacks.next,\n complete: () => {\n callbacks.complete();\n resolve();\n },\n error: (e) => {\n callbacks.error(e);\n resolve();\n },\n },\n });\n\n return () => {\n this.delete(message.id);\n callbacks.complete();\n resolve();\n };\n }", "result_size": 6, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "pallets__jinja__tokeniter__upstream__1hop_cda549", "repo": "pallets/jinja", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["lex", "tokenize"], "call_files": ["private/tmp/repos/pallets__jinja/src/jinja2/environment.py", "private/tmp/repos/pallets__jinja/src/jinja2/lexer.py"]}, "metadata": {"anchor": "tokeniter", "anchor_file": "private/tmp/repos/pallets__jinja/src/jinja2/lexer.py", "anchor_source": "def tokeniter(\n self,\n source: str,\n name: str | None,\n filename: str | None = None,\n state: str | None = None,\n ) -> t.Iterator[tuple[int, str, str]]:\n \"\"\"This method tokenizes the text and returns the tokens in a\n generator. Use this method if you just want to tokenize a template.\n\n .. versionchanged:: 3.0\n Only ``\\\\n``, ``\\\\r\\\\n`` and ``\\\\r`` are treated as line\n breaks.\n \"\"\"\n lines = newline_re.split(source)[::2]\n\n if not self.keep_trailing_newline and lines[-1] == \"\":\n del lines[-1]\n\n source = \"\\n\".join(lines)\n pos = 0\n lineno = 1\n stack = [\"root\"]\n\n if state is not None and state != \"root\":\n assert state in (\"variable\", \"block\"), \"invalid state\"\n stack.append(state + \"_begin\")\n\n statetokens = self.rules[stack[-1]]\n source_length = len(source)\n balancing_stack: list[str] = []\n newlines_stripped = 0\n line_starting = True\n\n while True:\n # tokenizer loop\n for regex, tokens, new_state in statetokens:\n m = regex.match(source, pos)\n\n # if no match we try again with the next rule\n if m is None:\n continue\n\n # we only match blocks and variables if braces / parentheses\n # are balanced. continue parsing with the lower rule which\n # is the operator rule. do this only if the end tags look\n # like operators\n if balancing_stack and tokens in (\n TOKEN_VARIABLE_END,\n TOKEN_BLOCK_END,\n TOKEN_LINESTATEMENT_END,\n ):\n continue\n\n # tuples support more options\n if isinstance(tokens, tuple):\n groups: t.Sequence[str] = m.groups()\n\n if isinstance(tokens, OptionalLStrip):\n # Rule supports lstrip. Match will look like\n # text, block type, whitespace control, type, control, ...\n text = groups[0]\n # Skipping the text and first type, every other group is the\n # whitespace control for each type. One of the groups will be\n # -, +, or empty string instead of None.\n strip_sign = next(g for g in groups[2::2] if g is not None)\n\n if strip_sign == \"-\":\n # Strip all whitespace between the text and the tag.\n stripped = text.rstrip()\n newlines_stripped = text[len(stripped) :].count(\"\\n\")\n groups = [stripped, *groups[1:]]\n elif (\n # Not marked for preserving whitespace.\n strip_sign != \"+\"\n # lstrip is enabled.\n and self.lstrip_blocks\n # Not a variable expression.\n and not m.groupdict().get(TOKEN_VARIABLE_BEGIN)\n ):\n # The start of text between the last newline and the tag.\n l_pos = text.rfind(\"\\n\") + 1\n\n if l_pos > 0 or line_starting:\n # If there's only whitespace between the newline and the\n # tag, strip it.\n if whitespace_re.fullmatch(text, l_pos):\n groups = [text[:l_pos], *groups[1:]]\n\n for idx, token in enumerate(tokens):\n # failure group\n if isinstance(token, Failure):\n raise token(lineno, filename)\n # bygroup is a bit more complex, in that case we\n # yield for the current token the first named\n # group that matched\n elif token == \"#bygroup\":\n for key, value in m.groupdict().items():\n if value is not None:\n yield lineno, key, value\n lineno += value.count(\"\\n\")\n break\n else:\n raise RuntimeError(\n f\"{regex!r} wanted to resolve the token dynamically\"\n \" but no group matched\"\n )\n # normal group\n else:\n data = groups[idx]\n\n if data or token not in ignore_if_empty:\n yield lineno, token, data # type: ignore[misc]\n\n lineno += data.count(\"\\n\") + newlines_stripped\n newlines_stripped = 0\n\n # strings as token just are yielded as it.\n else:\n data = m.group()\n\n # update brace/parentheses balance\n if tokens == TOKEN_OPERATOR:\n if data == \"{\":\n balancing_stack.append(\"}\")\n elif data == \"(\":\n balancing_stack.append(\")\")\n elif data == \"[\":\n balancing_stack.append(\"]\")\n elif data in (\"}\", \")\", \"]\"):\n if not balancing_stack:\n raise TemplateSyntaxError(\n f\"unexpected '{data}'\", lineno, name, filename\n )\n\n expected_op = balancing_stack.pop()\n\n if expected_op != data:\n raise TemplateSyntaxError(\n f\"unexpected '{data}', expected '{expected_op}'\",\n lineno,\n name,\n filename,\n )\n\n # yield items\n if data or tokens not in ignore_if_empty:\n yield lineno, tokens, data\n\n lineno += data.count(\"\\n\")\n\n line_starting = m.group()[-1:] == \"\\n\"\n # fetch new position into new variable so that we can check\n # if there is a internal parsing error which would result\n # in an infinite loop\n pos2 = m.end()\n\n # handle state changes\n if new_state is not None:\n # remove the uppermost state\n if new_state == \"#pop\":\n stack.pop()\n # resolve the new state by group checking\n elif new_state == \"#bygroup\":\n for key, value in m.groupdict().items():\n if value is not None:\n stack.append(key)\n break\n else:\n raise RuntimeError(\n f\"{regex!r} wanted to resolve the new state dynamically\"\n f\" but no group matched\"\n )\n # direct state name given\n else:\n stack.append(new_state)\n\n statetokens = self.rules[stack[-1]]\n # we are still at the same position and no stack change.\n # this means a loop without break condition, avoid that and\n # raise error\n elif pos2 == pos:\n raise RuntimeError(\n f\"{regex!r} yielded empty string without stack change\"\n )\n\n # publish new function and start again\n pos = pos2\n break\n # if loop terminated without break we haven't found a single match\n # either we are at the end of the file or we have a problem\n else:\n # end of text\n if pos >= source_length:\n return\n\n # something went wrong\n raise TemplateSyntaxError(\n f\"unexpected char {source[pos]!r} at {pos}\", lineno, name, filename\n )", "result_size": 2, "created_at": "2026-03-20T16:58:17.229656+00:00", "file_content": ""}} {"sample_id": "immerjs__immer__clear__downstream__2hop_2b7574", "repo": "immerjs/immer", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["markChanged", "prepareMapCopy", "each", "assertUnrevoked"], "hop_1_files": ["private/tmp/repos/immerjs__immer/src/core/proxy.ts", "private/tmp/repos/immerjs__immer/src/plugins/mapset.ts", "private/tmp/repos/immerjs__immer/src/utils/common.ts", "private/tmp/repos/immerjs__immer/src/plugins/mapset.ts"], "hop_2": ["die"], "hop_2_files": ["private/tmp/repos/immerjs__immer/src/utils/errors.ts"]}, "metadata": {"anchor": "clear", "anchor_file": "private/tmp/repos/immerjs__immer/src/plugins/mapset.ts", "anchor_source": "clear() {\n\t\t\tconst state: MapState = this[DRAFT_STATE]\n\t\t\tassertUnrevoked(state)\n\t\t\tif (latest(state).size) {\n\t\t\t\tprepareMapCopy(state)\n\t\t\t\tmarkChanged(state)\n\t\t\t\tstate.assigned_ = new Map()\n\t\t\t\teach(state.base_, key => {\n\t\t\t\t\tstate.assigned_!.set(key, false)\n\t\t\t\t})\n\t\t\t\tstate.copy_!.clear()\n\t\t\t}\n\t\t}", "result_size": 1, "created_at": "2026-03-20T16:58:16.801413+00:00"}} {"sample_id": "colinhacks__zod__mergeObjectSync__upstream__1hop_99a523", "repo": "colinhacks/zod", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["mergeObjectAsync", "_parse"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/helpers/parseUtil.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"]}, "metadata": {"anchor": "mergeObjectSync", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/helpers/parseUtil.ts", "anchor_source": "static mergeObjectSync(\n status: ParseStatus,\n pairs: {\n key: SyncParseReturnType;\n value: SyncParseReturnType;\n alwaysSet?: boolean;\n }[]\n ): SyncParseReturnType {\n const finalObject: any = {};\n for (const pair of pairs) {\n const { key, value } = pair;\n if (key.status === \"aborted\") return INVALID;\n if (value.status === \"aborted\") return INVALID;\n if (key.status === \"dirty\") status.dirty();\n if (value.status === \"dirty\") status.dirty();\n\n if (key.value !== \"__proto__\" && (typeof value.value !== \"undefined\" || pair.alwaysSet)) {\n finalObject[key.value] = value.value;\n }\n }\n\n return { status: status.value, value: finalObject };\n }", "result_size": 3, "created_at": "2026-03-20T16:58:16.474869+00:00", "file_content": ""}} {"sample_id": "rq__rq__set_state__upstream__1hop_058205", "repo": "rq/rq", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["prepare_execution", "execute_job", "bootstrap", "_set_state", "dequeue_job_and_maintain_ttl", "check_for_suspension"], "call_files": ["private/tmp/repos/rq__rq/rq/executions.py", "private/tmp/repos/rq__rq/rq/worker/worker_classes.py", "private/tmp/repos/rq__rq/rq/worker/base.py", "private/tmp/repos/rq__rq/rq/worker/base.py", "private/tmp/repos/rq__rq/rq/worker/base.py", "private/tmp/repos/rq__rq/rq/worker/base.py"]}, "metadata": {"anchor": "set_state", "anchor_file": "private/tmp/repos/rq__rq/rq/worker/base.py", "anchor_source": "def set_state(self, state: str, pipeline: Optional['Pipeline'] = None):\n \"\"\"Sets the worker's state.\n\n Args:\n state (str): The state\n pipeline (Optional[Pipeline], optional): The pipeline to use. Defaults to None.\n \"\"\"\n self._state = state\n connection = pipeline if pipeline is not None else self.connection\n connection.hset(self.key, 'state', state)", "result_size": 6, "created_at": "2026-03-20T16:58:17.875204+00:00", "file_content": ""}} {"sample_id": "immerjs__immer__handleValue__upstream__2hop_e06dcf", "repo": "immerjs/immer", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["handleCrossReference", "finalize", "nestedDraftCleanup"], "hop_1_files": ["private/tmp/repos/immerjs__immer/src/core/finalize.ts", "private/tmp/repos/immerjs__immer/src/core/finalize.ts", "private/tmp/repos/immerjs__immer/src/core/finalize.ts"], "hop_2": ["add", "enableArrayMethods", "set", "handleInsertedValues", "enableMapSet", "processResult"], "hop_2_files": ["private/tmp/repos/immerjs__immer/src/plugins/mapset.ts", "private/tmp/repos/immerjs__immer/src/plugins/arrayMethods.ts", "private/tmp/repos/immerjs__immer/src/plugins/mapset.ts", "private/tmp/repos/immerjs__immer/src/plugins/arrayMethods.ts", "private/tmp/repos/immerjs__immer/src/plugins/mapset.ts", "private/tmp/repos/immerjs__immer/src/core/finalize.ts"]}, "metadata": {"anchor": "handleValue", "anchor_file": "private/tmp/repos/immerjs__immer/src/core/finalize.ts", "anchor_source": "export function handleValue(\n\ttarget: any,\n\thandledSet: Set,\n\trootScope: ImmerScope\n) {\n\tif (!rootScope.immer_.autoFreeze_ && rootScope.unfinalizedDrafts_ < 1) {\n\t\t// optimization: if an object is not a draft, and we don't have to\n\t\t// deepfreeze everything, and we are sure that no drafts are left in the remaining object\n\t\t// cause we saw and finalized all drafts already; we can stop visiting the rest of the tree.\n\t\t// This benefits especially adding large data tree's without further processing.\n\t\t// See add-data.js perf test\n\t\treturn target\n\t}\n\n\t// Skip if already handled, frozen, or not draftable\n\tif (\n\t\tisDraft(target) ||\n\t\thandledSet.has(target) ||\n\t\t!isDraftable(target) ||\n\t\tisFrozen(target)\n\t) {\n\t\treturn target\n\t}\n\n\thandledSet.add(target)\n\n\t// Process ALL properties/entries\n\teach(target, (key, value) => {\n\t\tif (isDraft(value)) {\n\t\t\tconst state: ImmerState = value[DRAFT_STATE]\n\t\t\tif (isSameScope(state, rootScope)) {\n\t\t\t\t// Replace draft with finalized value\n\n\t\t\t\tconst updatedValue = getFinalValue(state)\n\n\t\t\t\tset(target, key, updatedValue, target.type_)\n\n\t\t\t\tmarkStateFinalized(state)\n\t\t\t}\n\t\t} else if (isDraftable(value)) {\n\t\t\t// Recursively handle nested values\n\t\t\thandleValue(value, handledSet, rootScope)\n\t\t}\n\t})\n\n\treturn target\n}", "result_size": 7, "created_at": "2026-03-20T16:58:16.801413+00:00", "file_content": ""}} {"sample_id": "colinhacks__zod___parse__downstream__2hop_67ad94", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["addIssueToContext", "_processInputParams", "parseAsync"], "hop_1_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/helpers/parseUtil.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"], "hop_2": ["getErrorMap", "ParseStatus", "safeParseAsync"], "hop_2_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/errors.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/helpers/parseUtil.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"]}, "metadata": {"anchor": "_parse", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "anchor_source": "_parse(input: ParseInput): ParseReturnType {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.promise,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n\n const promisified = ctx.parsedType === ZodParsedType.promise ? ctx.data : Promise.resolve(ctx.data);\n\n return OK(\n promisified.then((data: any) => {\n return this._def.type.parseAsync(data, {\n path: ctx.path,\n errorMap: ctx.common.contextualErrorMap,\n });\n })\n );\n }", "result_size": 3, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "sindresorhus__got___prepareCache__downstream__2hop_2ef091", "repo": "sindresorhus/got", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["has", "constructor", "once", "RequestError", "set"], "hop_1_files": ["private/tmp/repos/got/source/core/utils/weakable-map.ts", "private/tmp/repos/got/source/core/errors.ts", "private/tmp/repos/got/source/core/index.ts", "private/tmp/repos/got/source/core/errors.ts", "private/tmp/repos/got/source/core/utils/weakable-map.ts"], "hop_2": ["isRequest"], "hop_2_files": ["private/tmp/repos/got/source/core/errors.ts"]}, "metadata": {"anchor": "_prepareCache", "anchor_file": "private/tmp/repos/got/source/core/index.ts", "anchor_source": "private _prepareCache(cache: string | StorageAdapter) {\n\t\tif (cacheableStore.has(cache)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst cacheableRequest = new CacheableRequest(\n\t\t\t((requestOptions: RequestOptions, handler?: (response: IncomingMessageWithTimings) => void): ClientRequest => {\n\t\t\t\t/**\n\t\t\t\tWraps the cacheable-request handler to run beforeCache hooks.\n\t\t\t\tThese hooks control caching behavior by:\n\t\t\t\t- Directly mutating the response object (changes apply to what gets cached)\n\t\t\t\t- Returning `false` to prevent caching\n\t\t\t\t- Returning `void`/`undefined` to use default caching behavior\n\n\t\t\t\tHooks use direct mutation - they can modify response.headers, response.statusCode, etc.\n\t\t\t\tMutations take effect immediately and determine what gets cached.\n\t\t\t\t*/\n\t\t\t\tconst wrappedHandler = handler\n\t\t\t\t\t? (response: IncomingMessageWithTimings) => {\n\t\t\t\t\t\tconst {beforeCacheHooks, gotRequest} = requestOptions as any;\n\n\t\t\t\t\t\t// Early return if no hooks - cache the original response\n\t\t\t\t\t\tif (!beforeCacheHooks || beforeCacheHooks.length === 0) {\n\t\t\t\t\t\t\thandler(response);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t// Call each beforeCache hook with the response\n\t\t\t\t\t\t\t// Hooks can directly mutate the response - mutations take effect immediately\n\t\t\t\t\t\t\tfor (const hook of beforeCacheHooks) {\n\t\t\t\t\t\t\t\tconst result = hook(response);\n\n\t\t\t\t\t\t\t\tif (result === false) {\n\t\t\t\t\t\t\t\t\t// Prevent caching by adding no-cache headers\n\t\t\t\t\t\t\t\t\t// Mutate the response directly to add headers\n\t\t\t\t\t\t\t\t\tresponse.headers['cache-control'] = 'no-cache, no-store, must-revalidate';\n\t\t\t\t\t\t\t\t\tresponse.headers.pragma = 'no-cache';\n\t\t\t\t\t\t\t\t\tresponse.headers.expires = '0';\n\t\t\t\t\t\t\t\t\thandler(response);\n\t\t\t\t\t\t\t\t\t// Don't call remaining hooks - we've decided not to cache\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (is.promise(result)) {\n\t\t\t\t\t\t\t\t\t// BeforeCache hooks must be synchronous because cacheable-request's handler is synchronous\n\t\t\t\t\t\t\t\t\tthrow new TypeError('beforeCache hooks must be synchronous. The hook returned a Promise, but this hook must return synchronously. If you need async logic, use beforeRequest hook instead.');\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (result !== undefined) {\n\t\t\t\t\t\t\t\t\t// Hooks should return false or undefined only\n\t\t\t\t\t\t\t\t\t// Mutations work directly - no need to return the response\n\t\t\t\t\t\t\t\t\tthrow new TypeError('beforeCache hook must return false or undefined. To modify the response, mutate it directly.');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// Else: void/undefined = continue\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (error: unknown) {\n\t\t\t\t\t\t\tconst normalizedError = normalizeError(error);\n\t\t\t\t\t\t\t// Convert hook errors to RequestError and propagate\n\t\t\t\t\t\t\t// This is consistent with how other hooks handle errors\n\t\t\t\t\t\t\tif (gotRequest) {\n\t\t\t\t\t\t\t\tgotRequest._beforeError(normalizedError instanceof RequestError ? normalizedError : new RequestError(normalizedError.message, normalizedError, gotRequest));\n\t\t\t\t\t\t\t\t// Don't call handler when error was propagated successfully\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// If gotRequest is missing, log the error to aid debugging\n\t\t\t\t\t\t\t// We still call the handler to prevent the request from hanging\n\t\t\t\t\t\t\tconsole.error('Got: beforeCache hook error (request context unavailable):', normalizedError);\n\t\t\t\t\t\t\t// Call handler with response (potentially partially modified)\n\t\t\t\t\t\t\thandler(response);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// All hooks ran successfully\n\t\t\t\t\t\t// Cache the response with any mutations applied\n\t\t\t\t\t\thandler(response);\n\t\t\t\t\t}\n\t\t\t\t\t: handler;\n\n\t\t\t\tconst result = (requestOptions as any)._request(requestOptions, wrappedHandler);\n\n\t\t\t\t// TODO: remove this when `cacheable-request` supports async request functions.\n\t\t\t\tif (is.promise(result)) {\n\t\t\t\t\t// We only need to implement the error handler in order to support HTTP2 caching.\n\t\t\t\t\t// The result will be a promise anyway.\n\t\t\t\t\t// @ts-expect-error ignore\n\t\t\t\t\tresult.once = (event: string, handler: (reason: unknown) => void) => {\n\t\t\t\t\t\tif (event === 'error') {\n\t\t\t\t\t\t\t(async () => {\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tawait result;\n\t\t\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\t\t\thandler(error);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})();\n\t\t\t\t\t\t} else if (event === 'abort' || event === 'destroy') {\n\t\t\t\t\t\t\t// The empty catch is needed here in case when\n\t\t\t\t\t\t\t// it rejects before it's `await`ed in `_makeRequest`.\n\t\t\t\t\t\t\t(async () => {\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tconst request = (await result) as ClientRequest;\n\t\t\t\t\t\t\t\t\trequest.once(event, handler);\n\t\t\t\t\t\t\t\t} catch {}\n\t\t\t\t\t\t\t})();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t/* istanbul ignore next: safety check */\n\t\t\t\t\t\t\tthrow new Error(`Unknown HTTP2 promise event: ${event}`);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t}) as typeof http.request,\n\t\t\tcache as StorageAdapter,\n\t\t);\n\t\tcacheableStore.set(cache, cacheableRequest.request());\n\t}", "result_size": 1, "created_at": "2026-03-20T16:58:18.104721+00:00"}} {"sample_id": "agronholm__apscheduler__release_job__downstream__1hop_7c84ba", "repo": "agronholm/apscheduler", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["publish", "_retry", "_release_job"], "call_files": ["private/tmp/repos/agronholm__apscheduler/src/apscheduler/abc.py", "private/tmp/repos/agronholm__apscheduler/src/apscheduler/_retry.py", "private/tmp/repos/agronholm__apscheduler/src/apscheduler/datastores/mongodb.py"]}, "metadata": {"anchor": "release_job", "anchor_file": "private/tmp/repos/agronholm__apscheduler/src/apscheduler/datastores/mongodb.py", "anchor_source": "async def release_job(self, scheduler_id: str, job: Job, result: JobResult) -> None:\n async for attempt in self._retry():\n with attempt:\n async with self._client.start_session() as session:\n event = await self._release_job(\n session,\n result,\n scheduler_id,\n job.task_id,\n job.schedule_id,\n job.scheduled_fire_time,\n )\n\n # Notify other schedulers\n await self._event_broker.publish(event)", "result_size": 3, "created_at": "2026-03-20T16:58:16.252821+00:00"}} {"sample_id": "rq__rq__get_version__upstream__2hop_18d1bc", "repo": "rq/rq", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["get_redis_server_version"], "hop_1_files": ["private/tmp/repos/rq__rq/rq/queue.py"], "hop_2": ["dequeue_job_and_maintain_ttl", "_prepare_for_queue", "get_job_position"], "hop_2_files": ["private/tmp/repos/rq__rq/rq/worker/base.py", "private/tmp/repos/rq__rq/rq/queue.py", "private/tmp/repos/rq__rq/rq/queue.py"]}, "metadata": {"anchor": "get_version", "anchor_file": "private/tmp/repos/rq__rq/rq/utils.py", "anchor_source": "def get_version(connection: 'Redis') -> tuple[int, int, int]:\n \"\"\"\n Returns tuple of Redis server version.\n This function also correctly handles 4 digit redis server versions.\n\n Args:\n connection (Redis): The Redis connection.\n\n Returns:\n version (Tuple[int, int, int]): A tuple representing the semantic versioning format (eg. (5, 0, 9))\n \"\"\"\n try:\n # Getting the connection info for each job tanks performance, we can cache it on the connection object\n if not getattr(connection, '__rq_redis_server_version', None):\n # Cast the version string to a tuple of integers. Some Redis implementations may return a float.\n version_str = str(connection.info('server')['redis_version'])\n version_parts = [int(i) for i in version_str.split('.')[:3]]\n # Ensure the version tuple has exactly three elements\n while len(version_parts) < 3:\n version_parts.append(0)\n setattr(\n connection,\n '__rq_redis_server_version',\n tuple(version_parts),\n )\n return getattr(connection, '__rq_redis_server_version')\n except ResponseError: # fakeredis doesn't implement Redis' INFO command\n return (5, 0, 9)", "result_size": 3, "created_at": "2026-03-20T16:58:17.875204+00:00", "file_content": ""}} {"sample_id": "pallets__jinja__next_if__upstream__1hop_34f3a5", "repo": "pallets/jinja", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["parse", "skip_if"], "call_files": ["private/tmp/repos/pallets__jinja/src/jinja2/ext.py", "private/tmp/repos/pallets__jinja/src/jinja2/lexer.py"]}, "metadata": {"anchor": "next_if", "anchor_file": "private/tmp/repos/pallets__jinja/src/jinja2/lexer.py", "anchor_source": "def next_if(self, expr: str) -> Token | None:\n \"\"\"Perform the token test and return the token if it matched.\n Otherwise the return value is `None`.\n \"\"\"\n if self.current.test(expr):\n return next(self)\n\n return None", "result_size": 2, "created_at": "2026-03-20T16:58:17.229656+00:00", "file_content": ""}} {"sample_id": "encode__django-rest-framework__initial__downstream__2hop_fd11d7", "repo": "encode/django-rest-framework", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["perform_authentication", "check_permissions", "determine_version", "perform_content_negotiation", "get_format_suffix", "check_throttles"], "hop_1_files": ["private/tmp/repos/django-rest-framework/rest_framework/views.py", "private/tmp/repos/django-rest-framework/rest_framework/views.py", "private/tmp/repos/django-rest-framework/rest_framework/views.py", "private/tmp/repos/django-rest-framework/rest_framework/views.py", "private/tmp/repos/django-rest-framework/rest_framework/views.py", "private/tmp/repos/django-rest-framework/rest_framework/views.py"], "hop_2": ["get_renderers", "get_throttles", "throttled", "get_permissions", "permission_denied", "get_content_negotiator", "APIView"], "hop_2_files": ["private/tmp/repos/django-rest-framework/rest_framework/views.py", "private/tmp/repos/django-rest-framework/rest_framework/views.py", "private/tmp/repos/django-rest-framework/rest_framework/views.py", "private/tmp/repos/django-rest-framework/rest_framework/views.py", "private/tmp/repos/django-rest-framework/rest_framework/views.py", "private/tmp/repos/django-rest-framework/rest_framework/views.py", "private/tmp/repos/django-rest-framework/rest_framework/views.py"]}, "metadata": {"anchor": "initial", "anchor_file": "private/tmp/repos/django-rest-framework/rest_framework/views.py", "anchor_source": "def initial(self, request, *args, **kwargs):\n \"\"\"\n Runs anything that needs to occur prior to calling the method handler.\n \"\"\"\n self.format_kwarg = self.get_format_suffix(**kwargs)\n\n # Perform content negotiation and store the accepted info on the request\n neg = self.perform_content_negotiation(request)\n request.accepted_renderer, request.accepted_media_type = neg\n\n # Determine the API version, if versioning is in use.\n version, scheme = self.determine_version(request, *args, **kwargs)\n request.version, request.versioning_scheme = version, scheme\n\n # Ensure that the incoming request is permitted\n self.perform_authentication(request)\n self.check_permissions(request)\n self.check_throttles(request)", "result_size": 7, "created_at": "2026-03-20T16:58:16.616316+00:00"}} {"sample_id": "encode__django-rest-framework__check_throttles__downstream__1hop_ed5007", "repo": "encode/django-rest-framework", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["get_throttles", "throttled"], "call_files": ["private/tmp/repos/django-rest-framework/rest_framework/views.py", "private/tmp/repos/django-rest-framework/rest_framework/views.py"]}, "metadata": {"anchor": "check_throttles", "anchor_file": "private/tmp/repos/django-rest-framework/rest_framework/views.py", "anchor_source": "def check_throttles(self, request):\n \"\"\"\n Check if request should be throttled.\n Raises an appropriate exception if the request is throttled.\n \"\"\"\n throttle_durations = []\n for throttle in self.get_throttles():\n if not throttle.allow_request(request, self):\n throttle_durations.append(throttle.wait())\n\n if throttle_durations:\n # Filter out `None` values which may happen in case of config / rate\n # changes, see #1438\n durations = [\n duration for duration in throttle_durations\n if duration is not None\n ]\n\n duration = max(durations, default=None)\n self.throttled(request, duration)", "result_size": 2, "created_at": "2026-03-20T16:58:16.616316+00:00"}} {"sample_id": "encode__httpx__read__upstream__1hop_d0c099", "repo": "encode/httpx", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["main", "_send_handling_redirects", "sync_auth_flow", "_send_handling_auth", "send"], "call_files": ["private/tmp/repos/encode__httpx/httpx/_main.py", "private/tmp/repos/encode__httpx/httpx/_client.py", "private/tmp/repos/encode__httpx/httpx/_auth.py", "private/tmp/repos/encode__httpx/httpx/_client.py", "private/tmp/repos/encode__httpx/httpx/_client.py"]}, "metadata": {"anchor": "read", "anchor_file": "private/tmp/repos/encode__httpx/httpx/_models.py", "anchor_source": "def read(self) -> bytes:\n \"\"\"\n Read and return the response content.\n \"\"\"\n if not hasattr(self, \"_content\"):\n self._content = b\"\".join(self.iter_bytes())\n return self._content", "result_size": 5, "created_at": "2026-03-20T16:58:16.700579+00:00", "file_content": ""}} {"sample_id": "trpc__trpc__mutation__upstream__1hop_56b212", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["setMutationDefaults", "trpcMutationOptions", "createUtilityFunctions", "useAction", "experimental_createActionHook"], "call_files": ["private/tmp/repos/trpc__trpc/packages/react-query/src/utils/createUtilityFunctions.ts", "private/tmp/repos/trpc__trpc/packages/tanstack-react-query/src/internals/mutationOptions.ts", "private/tmp/repos/trpc__trpc/packages/react-query/src/utils/createUtilityFunctions.ts", "private/tmp/repos/trpc__trpc/packages/next/src/app-dir/create-action-hook.tsx", "private/tmp/repos/trpc__trpc/packages/next/src/app-dir/create-action-hook.tsx"]}, "metadata": {"anchor": "mutation", "anchor_file": "private/tmp/repos/trpc__trpc/packages/client/src/internals/TRPCUntypedClient.ts", "anchor_source": "public mutation(path: string, input?: unknown, opts?: TRPCRequestOptions) {\n return this.requestAsPromise({\n type: 'mutation',\n path,\n input,\n context: opts?.context,\n signal: opts?.signal,\n });\n }", "result_size": 6, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "pallets__jinja__get_bucket__upstream__2hop_9cc1dc", "repo": "pallets/jinja", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["load"], "hop_1_files": ["private/tmp/repos/pallets__jinja/src/jinja2/loaders.py"], "hop_2": ["_load_template", "load"], "hop_2_files": ["private/tmp/repos/pallets__jinja/src/jinja2/environment.py", "private/tmp/repos/pallets__jinja/src/jinja2/loaders.py"]}, "metadata": {"anchor": "get_bucket", "anchor_file": "private/tmp/repos/pallets__jinja/src/jinja2/bccache.py", "anchor_source": "def get_bucket(\n self,\n environment: \"Environment\",\n name: str,\n filename: str | None,\n source: str,\n ) -> Bucket:\n \"\"\"Return a cache bucket for the given template. All arguments are\n mandatory but filename may be `None`.\n \"\"\"\n key = self.get_cache_key(name, filename)\n checksum = self.get_source_checksum(source)\n bucket = Bucket(environment, key, checksum)\n self.load_bytecode(bucket)\n return bucket", "result_size": 2, "created_at": "2026-03-20T16:58:17.229656+00:00", "file_content": ""}} {"sample_id": "python-poetry__poetry___try_requires_both__downstream__1hop_6338f8", "repo": "python-poetry/poetry", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["_single_term_where", "_terse"], "call_files": ["private/tmp/repos/python-poetry__poetry/src/poetry/mixology/incompatibility.py", "private/tmp/repos/python-poetry__poetry/src/poetry/mixology/incompatibility.py"]}, "metadata": {"anchor": "_try_requires_both", "anchor_file": "private/tmp/repos/python-poetry__poetry/src/poetry/mixology/incompatibility.py", "anchor_source": "def _try_requires_both(\n self,\n other: Incompatibility,\n this_line: int | None,\n other_line: int | None,\n ) -> str | None:\n if len(self._terms) == 1 or len(other.terms) == 1:\n return None\n\n this_positive = self._single_term_where(lambda term: term.is_positive())\n if this_positive is None:\n return None\n\n other_positive = other._single_term_where(lambda term: term.is_positive())\n if other_positive is None:\n return None\n\n if this_positive.dependency != other_positive.dependency:\n return None\n\n this_negatives = \" or \".join(\n [self._terse(term) for term in self._terms if not term.is_positive()]\n )\n\n other_negatives = \" or \".join(\n [self._terse(term) for term in other.terms if not term.is_positive()]\n )\n\n buffer = [self._terse(this_positive, allow_every=True) + \" \"]\n is_dependency = isinstance(self.cause, DependencyCauseError) and isinstance(\n other.cause, DependencyCauseError\n )\n\n if is_dependency:\n buffer.append(\"depends on\")\n else:\n buffer.append(\"requires\")\n\n buffer.append(f\" both {this_negatives}\")\n if this_line is not None:\n buffer.append(f\" ({this_line})\")\n\n buffer.append(f\" and {other_negatives}\")\n\n if other_line is not None:\n buffer.append(f\" ({other_line})\")\n\n return \"\".join(buffer)", "result_size": 2, "created_at": "2026-03-20T16:58:17.758794+00:00"}} {"sample_id": "scrapy__scrapy__create_deprecated_class__downstream__1hop_265854", "repo": "scrapy/scrapy", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["__subclasscheck__", "_clspath", "DeprecatedClass"], "call_files": ["private/tmp/repos/scrapy__scrapy/scrapy/utils/deprecate.py", "private/tmp/repos/scrapy__scrapy/scrapy/utils/deprecate.py", "private/tmp/repos/scrapy__scrapy/scrapy/utils/deprecate.py"]}, "metadata": {"anchor": "create_deprecated_class", "anchor_file": "private/tmp/repos/scrapy__scrapy/scrapy/utils/deprecate.py", "anchor_source": "def create_deprecated_class(\n name: str,\n new_class: type,\n clsdict: dict[str, Any] | None = None,\n warn_category: type[Warning] = ScrapyDeprecationWarning,\n warn_once: bool = True,\n old_class_path: str | None = None,\n new_class_path: str | None = None,\n subclass_warn_message: str = \"{cls} inherits from deprecated class {old}, please inherit from {new}.\",\n instance_warn_message: str = \"{cls} is deprecated, instantiate {new} instead.\",\n) -> type:\n \"\"\"\n Return a \"deprecated\" class that causes its subclasses to issue a warning.\n Subclasses of ``new_class`` are considered subclasses of this class.\n It also warns when the deprecated class is instantiated, but do not when\n its subclasses are instantiated.\n\n It can be used to rename a base class in a library. For example, if we\n have\n\n class OldName(SomeClass):\n # ...\n\n and we want to rename it to NewName, we can do the following::\n\n class NewName(SomeClass):\n # ...\n\n OldName = create_deprecated_class('OldName', NewName)\n\n Then, if user class inherits from OldName, warning is issued. Also, if\n some code uses ``issubclass(sub, OldName)`` or ``isinstance(sub(), OldName)``\n checks they'll still return True if sub is a subclass of NewName instead of\n OldName.\n \"\"\"\n\n # https://github.com/python/mypy/issues/4177\n class DeprecatedClass(new_class.__class__): # type: ignore[misc,name-defined]\n # pylint: disable=no-self-argument\n deprecated_class: type | None = None\n warned_on_subclass: bool = False\n\n def __new__( # pylint: disable=bad-classmethod-argument\n metacls, name: str, bases: tuple[type, ...], clsdict_: dict[str, Any]\n ) -> type:\n cls = super().__new__(metacls, name, bases, clsdict_)\n if metacls.deprecated_class is None:\n metacls.deprecated_class = cls\n return cls\n\n def __init__(cls, name: str, bases: tuple[type, ...], clsdict_: dict[str, Any]):\n meta = cls.__class__\n old = meta.deprecated_class\n if old in bases and not (warn_once and meta.warned_on_subclass):\n meta.warned_on_subclass = True\n msg = subclass_warn_message.format(\n cls=_clspath(cls),\n old=_clspath(old, old_class_path),\n new=_clspath(new_class, new_class_path),\n )\n if warn_once:\n msg += \" (warning only on first subclass, there may be others)\"\n warnings.warn(msg, warn_category, stacklevel=2)\n super().__init__(name, bases, clsdict_)\n\n # see https://www.python.org/dev/peps/pep-3119/#overloading-isinstance-and-issubclass\n # and https://docs.python.org/reference/datamodel.html#customizing-instance-and-subclass-checks\n # for implementation details\n def __instancecheck__(cls, inst: Any) -> bool:\n return any(cls.__subclasscheck__(c) for c in (type(inst), inst.__class__))\n\n def __subclasscheck__(cls, sub: type) -> bool:\n if cls is not DeprecatedClass.deprecated_class:\n # we should do the magic only if second `issubclass` argument\n # is the deprecated class itself - subclasses of the\n # deprecated class should not use custom `__subclasscheck__`\n # method.\n return super().__subclasscheck__(sub)\n\n if not inspect.isclass(sub):\n raise TypeError(\"issubclass() arg 1 must be a class\")\n\n mro = getattr(sub, \"__mro__\", ())\n return any(c in {cls, new_class} for c in mro)\n\n def __call__(cls, *args: Any, **kwargs: Any) -> Any:\n old = DeprecatedClass.deprecated_class\n if cls is old:\n msg = instance_warn_message.format(\n cls=_clspath(cls, old_class_path),\n new=_clspath(new_class, new_class_path),\n )\n warnings.warn(msg, warn_category, stacklevel=2)\n return super().__call__(*args, **kwargs)\n\n deprecated_cls = DeprecatedClass(name, (new_class,), clsdict or {})\n\n try:\n frm = inspect.stack()[1]\n parent_module = inspect.getmodule(frm[0])\n if parent_module is not None:\n deprecated_cls.__module__ = parent_module.__name__\n except Exception as e:\n # Sometimes inspect.stack() fails (e.g. when the first import of\n # deprecated class is in jinja2 template). __module__ attribute is not\n # important enough to raise an exception as users may be unable\n # to fix inspect.stack() errors.\n warnings.warn(f\"Error detecting parent module: {e!r}\")\n\n return deprecated_cls", "result_size": 3, "created_at": "2026-03-20T16:58:17.996583+00:00"}} {"sample_id": "python-poetry__poetry___init_pyproject__downstream__2hop_db3c2c", "repo": "python-poetry/poetry", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["_determine_requirements", "_format_requirements", "_validate_author"], "hop_1_files": ["private/tmp/repos/python-poetry__poetry/src/poetry/console/commands/init.py", "private/tmp/repos/python-poetry__poetry/src/poetry/console/commands/init.py", "private/tmp/repos/python-poetry__poetry/src/poetry/console/commands/init.py"], "hop_2": ["_generate_choice_list", "_get_pool", "_parse_requirements", "_find_best_version_for_package"], "hop_2_files": ["private/tmp/repos/python-poetry__poetry/src/poetry/console/commands/init.py", "private/tmp/repos/python-poetry__poetry/src/poetry/console/commands/init.py", "private/tmp/repos/python-poetry__poetry/src/poetry/console/commands/init.py", "private/tmp/repos/python-poetry__poetry/src/poetry/console/commands/init.py"]}, "metadata": {"anchor": "_init_pyproject", "anchor_file": "private/tmp/repos/python-poetry__poetry/src/poetry/console/commands/init.py", "anchor_source": "def _init_pyproject(\n self,\n project_path: Path,\n allow_interactive: bool = True,\n layout_name: str = \"standard\",\n readme_format: str = \"md\",\n allow_layout_creation_on_empty: bool = False,\n ) -> int:\n from poetry.core.vcs.git import GitConfig\n\n from poetry.config.config import Config\n from poetry.layouts import layout\n from poetry.pyproject.toml import PyProjectTOML\n\n is_interactive = self.io.is_interactive() and allow_interactive\n\n pyproject = PyProjectTOML(project_path / \"pyproject.toml\")\n\n if pyproject.file.exists():\n if pyproject.is_poetry_project():\n self.line_error(\n \"A pyproject.toml file with a project and/or\"\n \" a poetry section already exists.\"\n )\n return 1\n\n if pyproject.data.get(\"build-system\"):\n self.line_error(\n \"A pyproject.toml file with a defined build-system already\"\n \" exists.\"\n )\n return 1\n\n vcs_config = GitConfig()\n\n if is_interactive:\n self.line(\"\")\n self.line(\n \"This command will guide you through creating your\"\n \" pyproject.toml config.\"\n )\n self.line(\"\")\n\n name = self.option(\"name\")\n if not name:\n name = project_path.name.lower()\n\n if is_interactive:\n question = self.create_question(\n f\"Package name [{name}]: \", default=name\n )\n name = self.ask(question)\n\n version = \"0.1.0\"\n\n if is_interactive:\n question = self.create_question(\n f\"Version [{version}]: \", default=version\n )\n version = self.ask(question)\n\n description = self.option(\"description\") or \"\"\n if not description and is_interactive:\n description = self.ask(self.create_question(\"Description []: \", default=\"\"))\n\n author = self.option(\"author\")\n if not author and vcs_config.get(\"user.name\"):\n author = vcs_config[\"user.name\"]\n author_email = vcs_config.get(\"user.email\")\n if author_email:\n author += f\" <{author_email}>\"\n\n if is_interactive:\n question = self.create_question(\n f\"Author [{author}, n to skip]: \", default=author\n )\n question.set_validator(lambda v: self._validate_author(v, author))\n author = self.ask(question)\n\n authors = [author] if author else []\n\n license_name = self.option(\"license\")\n if not license_name and is_interactive:\n license_name = self.ask(self.create_question(\"License []: \", default=\"\"))\n\n python = self.option(\"python\")\n if not python:\n config = Config.create()\n python = (\n \">=\"\n + Python.get_preferred_python(config, self.io).minor_version.to_string()\n )\n\n if is_interactive:\n question = self.create_question(\n f\"Compatible Python versions [{python}]: \",\n default=python,\n )\n python = self.ask(question)\n\n if is_interactive:\n self.line(\"\")\n\n requirements: Requirements = {}\n if self.option(\"dependency\"):\n requirements = self._format_requirements(\n self._determine_requirements(self.option(\"dependency\"))\n )\n\n question_text = \"Would you like to define your main dependencies interactively?\"\n help_message = \"\"\"\\\n You can specify a package in the following forms:\n - A single name (requests): this will search for matches on PyPI\n - A name and a constraint (requests@^2.23.0)\n - A git url (git+https://github.com/python-poetry/poetry.git)\n - A git url with a revision\\\n (git+https://github.com/python-poetry/poetry.git#develop)\n - A file path (../my-package/my-package.whl)\n - A directory (../my-package/)\n - A url (https://example.com/packages/my-package-0.1.0.tar.gz)\n \"\"\"\n\n help_displayed = False\n if is_interactive and self.confirm(question_text, True):\n self.line(help_message)\n help_displayed = True\n requirements.update(\n self._format_requirements(self._determine_requirements([]))\n )\n self.line(\"\")\n\n dev_requirements: Requirements = {}\n if self.option(\"dev-dependency\"):\n dev_requirements = self._format_requirements(\n self._determine_requirements(self.option(\"dev-dependency\"))\n )\n\n question_text = (\n \"Would you like to define your development dependencies interactively?\"\n )\n if is_interactive and self.confirm(question_text, True):\n if not help_displayed:\n self.line(help_message)\n\n dev_requirements.update(\n self._format_requirements(self._determine_requirements([]))\n )\n\n self.line(\"\")\n\n layout_ = layout(layout_name)(\n name,\n version,\n description=description,\n author=authors[0] if authors else None,\n readme_format=readme_format,\n license=license_name,\n python=python,\n dependencies=requirements,\n dev_dependencies=dev_requirements,\n )\n\n create_layout = not project_path.exists() or (\n allow_layout_creation_on_empty and not any(project_path.iterdir())\n )\n\n if create_layout:\n layout_.create(project_path, with_pyproject=False)\n\n content = layout_.generate_project_content(project_path)\n for section, item in content.items():\n pyproject.data.append(section, item)\n\n if is_interactive:\n self.line(\"Generated file\")\n self.line(\"\")\n self.line(pyproject.data.as_string().replace(\"\\r\\n\", \"\\n\"))\n self.line(\"\")\n\n if is_interactive and not self.confirm(\"Do you confirm generation?\", True):\n self.line_error(\"Command aborted\")\n\n return 1\n\n pyproject.save()\n\n if create_layout:\n path = project_path.resolve()\n\n with suppress(ValueError):\n path = path.relative_to(Path.cwd())\n\n self.line(\n f\"Created package {layout_._package_name} in\"\n f\" {path.as_posix()}\"\n )\n\n return 0", "result_size": 4, "created_at": "2026-03-20T16:58:17.758794+00:00"}} {"sample_id": "colinhacks__zod__mergeObjectAsync__downstream__1hop_f82f5d", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["mergeObjectSync"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/helpers/parseUtil.ts"]}, "metadata": {"anchor": "mergeObjectAsync", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/helpers/parseUtil.ts", "anchor_source": "static async mergeObjectAsync(\n status: ParseStatus,\n pairs: { key: ParseReturnType; value: ParseReturnType }[]\n ): Promise> {\n const syncPairs: ObjectPair[] = [];\n for (const pair of pairs) {\n const key = await pair.key;\n const value = await pair.value;\n syncPairs.push({\n key,\n value,\n });\n }\n return ParseStatus.mergeObjectSync(status, syncPairs);\n }", "result_size": 1, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "trpc__trpc__getPendingRequests__upstream__1hop_0f56a2", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["hasPendingRequests", "getRequests", "hasPendingSubscriptions", "setupWebSocketListeners", "reconnect"], "call_files": ["private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/requestManager.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/requestManager.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/requestManager.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/wsClient.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/wsClient.ts"]}, "metadata": {"anchor": "getPendingRequests", "anchor_file": "private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/requestManager.ts", "anchor_source": "public getPendingRequests() {\n return Object.values(this.pendingRequests);\n }", "result_size": 6, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "pallets__click__resolve_color_default__upstream__1hop_d852c6", "repo": "pallets/click", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["echo_via_pager", "progressbar", "echo"], "call_files": ["private/tmp/repos/pallets__click/src/click/termui.py", "private/tmp/repos/pallets__click/src/click/termui.py", "private/tmp/repos/pallets__click/src/click/utils.py"]}, "metadata": {"anchor": "resolve_color_default", "anchor_file": "private/tmp/repos/pallets__click/src/click/globals.py", "anchor_source": "def resolve_color_default(color: bool | None = None) -> bool | None:\n \"\"\"Internal helper to get the default value of the color flag. If a\n value is passed it's returned unchanged, otherwise it's looked up from\n the current context.\n \"\"\"\n if color is not None:\n return color\n\n ctx = get_current_context(silent=True)\n\n if ctx is not None:\n return ctx.color\n\n return None", "result_size": 3, "created_at": "2026-03-20T16:58:17.078639+00:00", "file_content": ""}} {"sample_id": "trpc__trpc__getQueryKey__downstream__2hop_62f570", "repo": "trpc/trpc", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["getQueryKeyInternal"], "hop_1_files": ["private/tmp/repos/trpc__trpc/packages/react-query/src/internals/getQueryKey.ts"], "hop_2": ["isObject"], "hop_2_files": ["private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/utils.ts"]}, "metadata": {"anchor": "getQueryKey", "anchor_file": "private/tmp/repos/trpc__trpc/packages/react-query/src/internals/getQueryKey.ts", "anchor_source": "export function getQueryKey(\n procedureOrRouter: TProcedureOrRouter,\n ..._params: GetParams\n) {\n const [input, type] = _params;\n\n // @ts-expect-error - we don't expose _def on the type layer\n const path = procedureOrRouter._def().path as string[];\n const queryKey = getQueryKeyInternal(path, input, type ?? 'any');\n return queryKey;\n}", "result_size": 1, "created_at": "2026-03-20T16:58:18.199328+00:00"}} {"sample_id": "colinhacks__zod___isoDuration__upstream__2hop_ee133e", "repo": "colinhacks/zod", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["duration"], "hop_1_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/iso.ts"], "hop_2": ["convertBaseSchema", "duration"], "hop_2_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/from-json-schema.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/schemas.ts"]}, "metadata": {"anchor": "_isoDuration", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/api.ts", "anchor_source": "export function _isoDuration(\n Class: util.SchemaClass,\n params?: string | $ZodISODurationParams | $ZodCheckISODurationParams\n): T {\n return new Class({\n type: \"string\",\n format: \"duration\",\n check: \"string_format\",\n ...util.normalizeParams(params),\n });\n}", "result_size": 3, "created_at": "2026-03-20T16:58:16.474869+00:00", "file_content": ""}} {"sample_id": "python-poetry__poetry__normalize__downstream__1hop_598821", "repo": "python-poetry/poetry", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["is_reserved"], "call_files": ["private/tmp/repos/python-poetry__poetry/src/poetry/config/config.py"]}, "metadata": {"anchor": "normalize", "anchor_file": "private/tmp/repos/python-poetry__poetry/src/poetry/config/config.py", "anchor_source": "@classmethod\n def normalize(cls, policy: str) -> list[str]:\n if boolean_validator(policy):\n if boolean_normalizer(policy):\n return [\":all:\"]\n else:\n return [\":none:\"]\n\n return list(\n {\n name.strip() if cls.is_reserved(name) else canonicalize_name(name)\n for name in policy.strip().split(\",\")\n if name\n }\n )", "result_size": 1, "created_at": "2026-03-20T16:58:17.758794+00:00"}} {"sample_id": "pallets__jinja___define_ref__upstream__2hop_51067b", "repo": "pallets/jinja", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["declare_parameter", "load", "store"], "hop_1_files": ["private/tmp/repos/pallets__jinja/src/jinja2/idtracking.py", "private/tmp/repos/pallets__jinja/src/jinja2/idtracking.py", "private/tmp/repos/pallets__jinja/src/jinja2/idtracking.py"], "hop_2": ["visit_For", "visit_FromImport", "visit_Macro", "visit_Import", "visit_NSRef", "visit_Name", "visit_Template", "macro_body"], "hop_2_files": ["private/tmp/repos/pallets__jinja/src/jinja2/compiler.py", "private/tmp/repos/pallets__jinja/src/jinja2/idtracking.py", "private/tmp/repos/pallets__jinja/src/jinja2/idtracking.py", "private/tmp/repos/pallets__jinja/src/jinja2/idtracking.py", "private/tmp/repos/pallets__jinja/src/jinja2/idtracking.py", "private/tmp/repos/pallets__jinja/src/jinja2/idtracking.py", "private/tmp/repos/pallets__jinja/src/jinja2/compiler.py", "private/tmp/repos/pallets__jinja/src/jinja2/compiler.py"]}, "metadata": {"anchor": "_define_ref", "anchor_file": "private/tmp/repos/pallets__jinja/src/jinja2/idtracking.py", "anchor_source": "def _define_ref(self, name: str, load: tuple[str, str | None] | None = None) -> str:\n ident = f\"l_{self.level}_{name}\"\n self.refs[name] = ident\n if load is not None:\n self.loads[ident] = load\n return ident", "result_size": 8, "created_at": "2026-03-20T16:58:17.229656+00:00", "file_content": ""}} {"sample_id": "locustio__locust__get_html_report__upstream__1hop_41da23", "repo": "locustio/locust", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["main", "save_html_report", "stats_report"], "call_files": ["private/tmp/repos/locustio__locust/locust/main.py", "private/tmp/repos/locustio__locust/locust/main.py", "private/tmp/repos/locustio__locust/locust/web.py"]}, "metadata": {"anchor": "get_html_report", "anchor_file": "private/tmp/repos/locustio__locust/locust/html.py", "anchor_source": "def get_html_report(\n environment,\n show_download_link=True,\n theme=\"\",\n):\n request_stats = environment.runner.stats\n\n start_time = format_utc_timestamp(request_stats.start_time)\n\n if end_ts := request_stats.last_request_timestamp:\n end_time = format_utc_timestamp(end_ts)\n else:\n end_ts = request_stats.start_time\n end_time = start_time\n\n host = None\n if environment.host:\n host = environment.host\n elif environment.runner.user_classes:\n all_hosts = {l.host for l in environment.runner.user_classes}\n if len(all_hosts) == 1:\n host = list(all_hosts)[0]\n\n requests_statistics = list(chain(stats.sort_stats(request_stats.entries), [request_stats.total]))\n failures_statistics = stats.sort_stats(request_stats.errors)\n exceptions_statistics = [\n {**exc, \"nodes\": \", \".join(exc[\"nodes\"])} for exc in environment.runner.exceptions.values()\n ]\n\n if request_stats.history and request_stats.history[-1][\"time\"] < end_time:\n stats.update_stats_history(environment.runner, end_time)\n history = request_stats.history\n\n is_distributed = isinstance(environment.runner, MasterRunner)\n user_spawned = (\n environment.runner.reported_user_classes_count if is_distributed else environment.runner.user_classes_count\n )\n\n if environment.runner.state in [STATE_STOPPED, STATE_STOPPING]:\n user_spawned = environment.runner.final_user_classes_count\n\n task_data = {\n \"per_class\": get_ratio(environment.user_classes, user_spawned, False),\n \"total\": get_ratio(environment.user_classes, user_spawned, True),\n }\n\n return render_template_from(\n \"report.html\",\n template_args={\n \"is_report\": True,\n \"requests_statistics\": [stat.to_dict() for stat in requests_statistics],\n \"failures_statistics\": [stat.to_dict() for stat in failures_statistics],\n \"exceptions_statistics\": [stat for stat in exceptions_statistics],\n \"response_time_statistics\": [\n {\n \"name\": stat.name,\n \"method\": stat.method or \"\",\n **{\n str(percentile): stat.get_response_time_percentile(percentile)\n for percentile in PERCENTILES_FOR_HTML_REPORT\n },\n }\n for stat in requests_statistics\n ],\n \"start_time\": start_time,\n \"end_time\": end_time,\n \"duration\": format_duration(request_stats.start_time, end_ts),\n \"host\": str(host),\n \"history\": history,\n \"show_download_link\": show_download_link,\n \"locustfile\": str(environment.locustfile),\n \"tasks\": task_data,\n \"percentiles_to_chart\": stats.PERCENTILES_TO_CHART,\n \"profile\": str(environment.profile) if environment.profile else None,\n },\n theme=\"dark\" if theme == \"dark\" else \"light\",\n )", "result_size": 3, "created_at": "2026-03-20T16:58:16.951273+00:00", "file_content": ""}} {"sample_id": "rq__rq__remove__upstream__1hop_0f7164", "repo": "rq/rq", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["enqueue_dependents", "enqueue_scheduled_jobs", "_remove_from_registries"], "call_files": ["private/tmp/repos/rq__rq/rq/queue.py", "private/tmp/repos/rq__rq/rq/scheduler.py", "private/tmp/repos/rq__rq/rq/job.py"]}, "metadata": {"anchor": "remove", "anchor_file": "private/tmp/repos/rq__rq/rq/registry.py", "anchor_source": "def remove(self, job: Union[Job, str], pipeline: Optional['Pipeline'] = None, delete_job: bool = False):\n \"\"\"Removes job from registry and deletes it if `delete_job == True`\n\n Args:\n job (Job|str): The Job to remove from the registry, or job_id\n pipeline (Pipeline|None): The Redis Pipeline. Defaults to None.\n delete_job (bool, optional): If should delete the job.. Defaults to False.\n \"\"\"\n connection = pipeline if pipeline is not None else self.connection\n job_id = job.id if isinstance(job, self.job_class) else job\n result = connection.zrem(self.key, job_id)\n if delete_job:\n if isinstance(job, self.job_class):\n job_instance = job\n else:\n job_instance = Job.fetch(job_id, connection=connection, serializer=self.serializer)\n job_instance.delete()\n return result", "result_size": 3, "created_at": "2026-03-20T16:58:17.875204+00:00", "file_content": ""}} {"sample_id": "colinhacks__zod__min__downstream__2hop_85d644", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["_addCheck"], "hop_1_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"], "hop_2": ["ZodString", "constructor"], "hop_2_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"]}, "metadata": {"anchor": "min", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "anchor_source": "min(minLength: number, message?: errorUtil.ErrMessage) {\n return this._addCheck({\n kind: \"min\",\n value: minLength,\n ...errorUtil.errToObj(message),\n });\n }", "result_size": 2, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "rq__rq__delete_dependents__upstream__2hop_359076", "repo": "rq/rq", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["delete"], "hop_1_files": ["private/tmp/repos/rq__rq/rq/job.py"], "hop_2": ["cleanup", "remove"], "hop_2_files": ["private/tmp/repos/rq__rq/rq/job.py", "private/tmp/repos/rq__rq/rq/registry.py"]}, "metadata": {"anchor": "delete_dependents", "anchor_file": "private/tmp/repos/rq__rq/rq/job.py", "anchor_source": "def delete_dependents(self, pipeline: Optional['Pipeline'] = None):\n \"\"\"Delete jobs depending on this job.\n\n Args:\n pipeline (Optional[Pipeline], optional): Redis' pipeline. Defaults to None.\n \"\"\"\n connection = pipeline if pipeline is not None else self.connection\n for dependent_id in self.dependent_ids:\n try:\n job = Job.fetch(dependent_id, connection=self.connection, serializer=self.serializer)\n job.delete(pipeline=pipeline, remove_from_queue=False)\n except NoSuchJobError:\n # It could be that the dependent job was never saved to redis\n pass\n connection.delete(self.dependents_key)", "result_size": 2, "created_at": "2026-03-20T16:58:17.875204+00:00", "file_content": ""}} {"sample_id": "rq__rq__get_status__upstream__2hop_5572cf", "repo": "rq/rq", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["dependencies_are_met", "is_finished", "setup_dependencies", "is_scheduled", "is_canceled", "enqueue_dependents", "is_stopped", "is_queued", "is_failed", "is_deferred", "monitor_work_horse", "enqueue_job", "is_started"], "hop_1_files": ["private/tmp/repos/rq__rq/rq/job.py", "private/tmp/repos/rq__rq/rq/job.py", "private/tmp/repos/rq__rq/rq/queue.py", "private/tmp/repos/rq__rq/rq/job.py", "private/tmp/repos/rq__rq/rq/job.py", "private/tmp/repos/rq__rq/rq/queue.py", "private/tmp/repos/rq__rq/rq/job.py", "private/tmp/repos/rq__rq/rq/job.py", "private/tmp/repos/rq__rq/rq/job.py", "private/tmp/repos/rq__rq/rq/job.py", "private/tmp/repos/rq__rq/rq/worker/worker_classes.py", "private/tmp/repos/rq__rq/rq/queue.py", "private/tmp/repos/rq__rq/rq/job.py"], "hop_2": ["enqueue_call", "get_jobs_with_met_dependencies", "handle_job_failure", "handle_job_success", "cleanup", "execute_job", "cancel"], "hop_2_files": ["private/tmp/repos/rq__rq/rq/queue.py", "private/tmp/repos/rq__rq/rq/dependency.py", "private/tmp/repos/rq__rq/rq/worker/base.py", "private/tmp/repos/rq__rq/rq/worker/base.py", "private/tmp/repos/rq__rq/rq/registry.py", "private/tmp/repos/rq__rq/rq/worker/worker_classes.py", "private/tmp/repos/rq__rq/rq/job.py"]}, "metadata": {"anchor": "get_status", "anchor_file": "private/tmp/repos/rq__rq/rq/job.py", "anchor_source": "def get_status(self, refresh: bool = True) -> JobStatus:\n \"\"\"Gets the Job Status\n\n Args:\n refresh (bool, optional): Whether to refresh the Job. Defaults to True.\n\n Raises:\n InvalidJobOperation: If refreshing and nothing is returned from the `HGET` operation.\n\n Returns:\n status (JobStatus): The Job Status\n \"\"\"\n if refresh:\n status = self.connection.hget(self.key, 'status')\n if not status:\n raise InvalidJobOperation(f'Failed to retrieve status for job: {self.id}')\n self._status = JobStatus(as_text(status))\n return self._status", "result_size": 7, "created_at": "2026-03-20T16:58:17.875204+00:00", "file_content": ""}} {"sample_id": "colinhacks__zod__pick__downstream__1hop_0a574e", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["assignProp", "shape", "mergeDefs"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/util.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/util.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/util.ts"]}, "metadata": {"anchor": "pick", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/util.ts", "anchor_source": "export function pick(schema: schemas.$ZodObject, mask: Record): any {\n const currDef = schema._zod.def;\n\n const checks = currDef.checks;\n const hasChecks = checks && checks.length > 0;\n if (hasChecks) {\n throw new Error(\".pick() cannot be used on object schemas containing refinements\");\n }\n\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const newShape: Writeable = {};\n for (const key in mask) {\n if (!(key in currDef.shape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key]) continue;\n newShape[key] = currDef.shape[key]!;\n }\n\n assignProp(this, \"shape\", newShape); // self-caching\n return newShape;\n },\n checks: [],\n });\n\n return clone(schema, def) as any;\n}", "result_size": 3, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "locustio__locust__useForm__upstream__1hop_0055ae", "repo": "locustio/locust", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["[mode]", "onChange", "SwarmForm"], "call_files": ["private/tmp/repos/locustio__locust/locust/webui/src/hooks/useForm.ts", "private/tmp/repos/locustio__locust/locust/webui/src/hooks/useForm.ts", "private/tmp/repos/locustio__locust/locust/webui/src/components/SwarmForm/SwarmForm.tsx"]}, "metadata": {"anchor": "useForm", "anchor_file": "private/tmp/repos/locustio__locust/locust/webui/src/hooks/useForm.ts", "anchor_source": "export default function useForm() {\n const [errors, setErrors] = useState({});\n const [isValid, setIsValid] = useState(true);\n\n const validate = (\n name: string,\n value: string,\n rules: ValidationRules,\n { onlyDelete } = { onlyDelete: false },\n ) => {\n const newErrors = { ...errors };\n let errorMessage;\n const failedMatch =\n rules.match &&\n Array.isArray(rules.match) &&\n rules.match.find(({ pattern }) => !new RegExp(pattern).test(value));\n\n if (rules.minLength && value.length < rules.minLength) {\n errorMessage = `Please enter at least ${rules.minLength} characters`;\n } else if (failedMatch) {\n errorMessage = failedMatch.message || 'Invalid format';\n } else if (\n rules.match &&\n !Array.isArray(rules.match) &&\n !new RegExp(rules.match.pattern).test(value)\n ) {\n errorMessage = rules.match.message || 'Invalid format';\n } else {\n delete newErrors[name];\n }\n\n if (errorMessage && !onlyDelete) {\n newErrors[name] = errorMessage;\n }\n\n setErrors(newErrors);\n setIsValid(Object.keys(newErrors).length === 0);\n };\n\n const register = (name: string, rules: ValidationRules, mode = 'onChange') => {\n const alertLevelProps =\n errors[name] && rules.level\n ? {\n color: rules.level,\n focused: true,\n FormHelperTextProps: {\n sx: { color: (theme: Theme) => theme.palette.warning.main },\n },\n }\n : {};\n\n return {\n ...alertLevelProps,\n name,\n onChange: ({ target: { value } }: ChangeEvent) =>\n validate(name, value, rules, { onlyDelete: true }),\n [mode]: ({ target: { value } }: ChangeEvent) =>\n validate(name, value, rules),\n error: !!errors[name] && !rules.level,\n helperText: errors[name] || '',\n };\n };\n\n return { register, isValid };\n}", "result_size": 3, "created_at": "2026-03-20T16:58:16.951273+00:00", "file_content": ""}} {"sample_id": "locustio__locust__get_ratio__upstream__2hop_b8d233", "repo": "locustio/locust", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["print_task_ratio_json", "tasks", "print_task_ratio", "get_html_report"], "hop_1_files": ["private/tmp/repos/locustio__locust/locust/user/inspectuser.py", "private/tmp/repos/locustio__locust/locust/web.py", "private/tmp/repos/locustio__locust/locust/user/inspectuser.py", "private/tmp/repos/locustio__locust/locust/html.py"], "hop_2": ["main", "stats_report", "save_html_report"], "hop_2_files": ["private/tmp/repos/locustio__locust/locust/main.py", "private/tmp/repos/locustio__locust/locust/web.py", "private/tmp/repos/locustio__locust/locust/main.py"]}, "metadata": {"anchor": "get_ratio", "anchor_file": "private/tmp/repos/locustio__locust/locust/user/inspectuser.py", "anchor_source": "def get_ratio(user_classes: list[type[User]], user_spawned: dict[str, int], total: bool) -> dict[str, dict[str, float]]:\n user_count = sum(user_spawned.values()) or 1\n ratio_percent: dict[type[User], float] = {u: user_spawned.get(u.__name__, 0) / user_count for u in user_classes}\n\n task_dict: dict[str, dict[str, float]] = {}\n for u, r in ratio_percent.items():\n d = {\"ratio\": r}\n d[\"tasks\"] = _get_task_ratio(u.tasks, total, r)\n task_dict[u.__name__] = d\n\n return task_dict", "result_size": 3, "created_at": "2026-03-20T16:58:16.951273+00:00", "file_content": ""}} {"sample_id": "locustio__locust___wait_for_workers_report_after_ramp_up__upstream__2hop_d65e0d", "repo": "locustio/locust", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["start"], "hop_1_files": ["private/tmp/repos/locustio__locust/locust/runners.py"], "hop_2": ["main", "heartbeat_worker", "handle_message"], "hop_2_files": ["private/tmp/repos/locustio__locust/locust/main.py", "private/tmp/repos/locustio__locust/locust/runners.py", "private/tmp/repos/locustio__locust/locust/runners.py"]}, "metadata": {"anchor": "_wait_for_workers_report_after_ramp_up", "anchor_file": "private/tmp/repos/locustio__locust/locust/runners.py", "anchor_source": "@functools.lru_cache\n def _wait_for_workers_report_after_ramp_up(self) -> float:\n \"\"\"\n The amount of time to wait after a ramp-up in order for all the workers to report their state\n to the master. If not supplied by the user, it is 1000ms by default. If the supplied value is a number,\n it is taken as-is. If the supplied value is a pattern like \"some_number * WORKER_REPORT_INTERVAL\",\n the value will be \"some_number * WORKER_REPORT_INTERVAL\". The most sensible value would be something\n like \"1.25 * WORKER_REPORT_INTERVAL\". However, some users might find it too high, so it is left\n to a relatively small value of 1000ms by default.\n \"\"\"\n locust_wait_for_workers_report_after_ramp_up = os.getenv(\"LOCUST_WAIT_FOR_WORKERS_REPORT_AFTER_RAMP_UP\")\n if locust_wait_for_workers_report_after_ramp_up is None:\n return 1.0\n\n match = re.search(\n r\"^(?P(\\d+)|(\\d+\\.\\d+))[ ]*\\*[ ]*WORKER_REPORT_INTERVAL$\",\n locust_wait_for_workers_report_after_ramp_up,\n )\n if match is None:\n assert float(locust_wait_for_workers_report_after_ramp_up) >= 0\n return float(locust_wait_for_workers_report_after_ramp_up)\n else:\n return float(match.group(\"coeff\")) * WORKER_REPORT_INTERVAL", "result_size": 3, "created_at": "2026-03-20T16:58:16.951273+00:00", "file_content": ""}} {"sample_id": "trpc__trpc__isFormData__upstream__1hop_a60af4", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["createServerAction", "experimental_createServerActionHandler", "actionHandler", "experimental_serverActionLink"], "call_files": ["private/tmp/repos/trpc__trpc/packages/next/src/app-dir/server.ts", "private/tmp/repos/trpc__trpc/packages/next/src/app-dir/server.ts", "private/tmp/repos/trpc__trpc/packages/next/src/app-dir/server.ts", "private/tmp/repos/trpc__trpc/packages/next/src/app-dir/create-action-hook.tsx"]}, "metadata": {"anchor": "isFormData", "anchor_file": "private/tmp/repos/trpc__trpc/packages/next/src/app-dir/shared.ts", "anchor_source": "export function isFormData(value: unknown): value is FormData {\n if (typeof FormData === 'undefined') {\n // FormData is not supported\n return false;\n }\n return value instanceof FormData;\n}", "result_size": 6, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "locustio__locust__update_stats_history__upstream__1hop_a5bd1a", "repo": "locustio/locust", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["stats_history", "get_html_report"], "call_files": ["private/tmp/repos/locustio__locust/locust/stats.py", "private/tmp/repos/locustio__locust/locust/html.py"]}, "metadata": {"anchor": "update_stats_history", "anchor_file": "private/tmp/repos/locustio__locust/locust/stats.py", "anchor_source": "def update_stats_history(runner: Runner, timestamp: str | None = None) -> None:\n stats = runner.stats\n timestamp = timestamp or format_utc_timestamp(time.time())\n current_response_time_percentiles = {\n f\"response_time_percentile_{percentile}\": [\n timestamp,\n stats.total.get_current_response_time_percentile(percentile) or 0,\n ]\n for percentile in PERCENTILES_TO_CHART\n }\n\n r = {\n **current_response_time_percentiles,\n \"current_rps\": [timestamp, stats.total.current_rps or 0],\n \"current_fail_per_sec\": [timestamp, stats.total.current_fail_per_sec or 0],\n \"total_avg_response_time\": [timestamp, proper_round(stats.total.avg_response_time, digits=2)],\n \"user_count\": [timestamp, runner.user_count or 0],\n \"time\": timestamp,\n }\n stats.history.append(r)", "result_size": 2, "created_at": "2026-03-20T16:58:16.951273+00:00", "file_content": ""}} {"sample_id": "trpc__trpc__createTRPCOptionsResult__upstream__1hop_4ec9c9", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["trpcQueryOptions", "trpcInfiniteQueryOptions", "trpcMutationOptions"], "call_files": ["private/tmp/repos/trpc__trpc/packages/tanstack-react-query/src/internals/queryOptions.ts", "private/tmp/repos/trpc__trpc/packages/tanstack-react-query/src/internals/infiniteQueryOptions.ts", "private/tmp/repos/trpc__trpc/packages/tanstack-react-query/src/internals/mutationOptions.ts"]}, "metadata": {"anchor": "createTRPCOptionsResult", "anchor_file": "private/tmp/repos/trpc__trpc/packages/tanstack-react-query/src/internals/utils.ts", "anchor_source": "export function createTRPCOptionsResult(value: {\n path: string[];\n}): TRPCQueryOptionsResult['trpc'] {\n const path = value.path.join('.');\n\n return {\n path,\n };\n}", "result_size": 3, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "rq__rq__parse_composite_key__upstream__1hop_f70714", "repo": "rq/rq", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["parse_job_id", "from_composite_key", "get_job_and_execution_ids"], "call_files": ["private/tmp/repos/rq__rq/rq/registry.py", "private/tmp/repos/rq__rq/rq/executions.py", "private/tmp/repos/rq__rq/rq/registry.py"]}, "metadata": {"anchor": "parse_composite_key", "anchor_file": "private/tmp/repos/rq__rq/rq/utils.py", "anchor_source": "def parse_composite_key(composite_key: str) -> tuple[str, str]:\n \"\"\"Method returns a parsed composite key.\n\n Args:\n composite_key (str): the composite key to parse\n\n Returns:\n tuple[str, str]: tuple of job id and the execution id\n \"\"\"\n result = composite_key.split(':')\n if len(result) == 1:\n # StartedJobRegistry contains a composite key under the sorted set\n # a single job_id should've never ended up in the set, but\n # just in case there's a regression (tests don't show any)\n warnings.warn(\n f'Composite key must contain job_id:execution_id, got {composite_key}',\n DeprecationWarning,\n )\n return (result[0], '')\n job_id, execution_id = result\n return (job_id, execution_id)", "result_size": 3, "created_at": "2026-03-20T16:58:17.875204+00:00", "file_content": ""}} {"sample_id": "immerjs__immer__currentImpl__downstream__2hop_4f80e9", "repo": "immerjs/immer", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["each", "shouldUseStrictIteration", "isDraftable", "shallowCopy", "isFrozen"], "hop_1_files": ["private/tmp/repos/immerjs__immer/src/utils/common.ts", "private/tmp/repos/immerjs__immer/src/core/immerClass.ts", "private/tmp/repos/immerjs__immer/src/utils/common.ts", "private/tmp/repos/immerjs__immer/src/utils/common.ts", "private/tmp/repos/immerjs__immer/src/utils/common.ts"], "hop_2": ["isPlainObject"], "hop_2_files": ["private/tmp/repos/immerjs__immer/src/utils/common.ts"]}, "metadata": {"anchor": "currentImpl", "anchor_file": "private/tmp/repos/immerjs__immer/src/core/current.ts", "anchor_source": "function currentImpl(value: any): any {\n\tif (!isDraftable(value) || isFrozen(value)) return value\n\tconst state: ImmerState | undefined = value[DRAFT_STATE]\n\tlet copy: any\n\tlet strict = true // Default to strict for compatibility\n\tif (state) {\n\t\tif (!state.modified_) return state.base_\n\t\t// Optimization: avoid generating new drafts during copying\n\t\tstate.finalized_ = true\n\t\tcopy = shallowCopy(value, state.scope_.immer_.useStrictShallowCopy_)\n\t\tstrict = state.scope_.immer_.shouldUseStrictIteration()\n\t} else {\n\t\tcopy = shallowCopy(value, true)\n\t}\n\t// recurse\n\teach(\n\t\tcopy,\n\t\t(key, childValue) => {\n\t\t\tset(copy, key, currentImpl(childValue))\n\t\t},\n\t\tstrict\n\t)\n\tif (state) {\n\t\tstate.finalized_ = false\n\t}\n\treturn copy\n}", "result_size": 1, "created_at": "2026-03-20T16:58:16.801413+00:00"}} {"sample_id": "psf__requests__build_response__downstream__2hop_fa0f8f", "repo": "psf/requests", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["get_encoding_from_headers", "Response", "extract_cookies_to_jar", "CaseInsensitiveDict"], "hop_1_files": ["private/tmp/repos/requests/src/requests/utils.py", "private/tmp/repos/requests/src/requests/models.py", "private/tmp/repos/requests/src/requests/cookies.py", "private/tmp/repos/requests/src/requests/structures.py"], "hop_2": ["MockResponse", "MockRequest", "_parse_content_type_header"], "hop_2_files": ["private/tmp/repos/requests/src/requests/cookies.py", "private/tmp/repos/requests/src/requests/cookies.py", "private/tmp/repos/requests/src/requests/utils.py"]}, "metadata": {"anchor": "build_response", "anchor_file": "private/tmp/repos/requests/src/requests/adapters.py", "anchor_source": "def build_response(self, req, resp):\n \"\"\"Builds a :class:`Response ` object from a urllib3\n response. This should not be called from user code, and is only exposed\n for use when subclassing the\n :class:`HTTPAdapter `\n\n :param req: The :class:`PreparedRequest ` used to generate the response.\n :param resp: The urllib3 response object.\n :rtype: requests.Response\n \"\"\"\n response = Response()\n\n # Fallback to None if there's no status_code, for whatever reason.\n response.status_code = getattr(resp, \"status\", None)\n\n # Make headers case-insensitive.\n response.headers = CaseInsensitiveDict(getattr(resp, \"headers\", {}))\n\n # Set encoding.\n response.encoding = get_encoding_from_headers(response.headers)\n response.raw = resp\n response.reason = response.raw.reason\n\n if isinstance(req.url, bytes):\n response.url = req.url.decode(\"utf-8\")\n else:\n response.url = req.url\n\n # Add new cookies from the server.\n extract_cookies_to_jar(response.cookies, req, resp)\n\n # Give the Response some context.\n response.request = req\n response.connection = self\n\n return response", "result_size": 3, "created_at": "2026-03-20T16:58:17.570287+00:00"}} {"sample_id": "locustio__locust__add_argument__upstream__2hop_dc35f6", "repo": "locustio/locust", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["parse_locustfile_option", "get_empty_argument_parser"], "hop_1_files": ["private/tmp/repos/locustio__locust/locust/argument_parser.py", "private/tmp/repos/locustio__locust/locust/argument_parser.py"], "hop_2": ["default_args_dict", "main", "get_parser", "handle_message"], "hop_2_files": ["private/tmp/repos/locustio__locust/locust/argument_parser.py", "private/tmp/repos/locustio__locust/locust/main.py", "private/tmp/repos/locustio__locust/locust/argument_parser.py", "private/tmp/repos/locustio__locust/locust/runners.py"]}, "metadata": {"anchor": "add_argument", "anchor_file": "private/tmp/repos/locustio__locust/locust/argument_parser.py", "anchor_source": "def add_argument(self, *args, **kwargs) -> configargparse.Action:\n \"\"\"\n This method supports the same args as ArgumentParser.add_argument(..)\n as well as the additional args below.\n\n Arguments:\n include_in_web_ui: If True (default), the argument will show in the UI.\n is_secret: If True (default is False) and include_in_web_ui is True, the argument will show in the UI with a password masked text input.\n is_required: If True (default is False) and include_in_web_ui is True, the argument will show in the UI as a required form field.\n is_multiple: If True (default is False) and include_in_web_ui is True, the argument will show in the UI as a multiple select form field.\n\n Returns:\n argparse.Action: the new argparse action\n \"\"\"\n include_in_web_ui = kwargs.pop(\"include_in_web_ui\", True)\n is_secret = kwargs.pop(\"is_secret\", False)\n is_required = kwargs.pop(\"is_required\", False)\n is_multiple = kwargs.pop(\"is_multiple\", False)\n action = super().add_argument(*args, **kwargs)\n action.include_in_web_ui = include_in_web_ui\n action.is_secret = is_secret\n action.is_required = is_required\n action.is_multiple = is_multiple\n return action", "result_size": 4, "created_at": "2026-03-20T16:58:16.951273+00:00", "file_content": ""}} {"sample_id": "sindresorhus__got__agent__downstream__2hop_da7f79", "repo": "sindresorhus/got", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["agent"], "hop_1_files": ["private/tmp/repos/got/source/core/options.ts"], "hop_2": ["assertAny", "assertPlainObject"], "hop_2_files": ["private/tmp/repos/got/source/core/options.ts", "private/tmp/repos/got/source/core/options.ts"]}, "metadata": {"anchor": "agent", "anchor_file": "private/tmp/repos/got/source/core/options.ts", "anchor_source": "get agent(): Agents {\n\t\treturn this.#internals.agent;\n\t}", "result_size": 2, "created_at": "2026-03-20T16:58:18.104721+00:00"}} {"sample_id": "trpc__trpc__next__downstream__1hop_c2125e", "repo": "trpc/trpc", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["transformResult", "from"], "call_files": ["private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/transformer.ts", "private/tmp/repos/trpc__trpc/packages/client/src/TRPCClientError.ts"]}, "metadata": {"anchor": "next", "anchor_file": "private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/wsClient.ts", "anchor_source": "next(event) {\n const transformed = transformResult(event, transformer.output);\n\n if (!transformed.ok) {\n observer.error(TRPCClientError.from(transformed.error));\n return;\n }\n\n observer.next({\n result: transformed.result,\n });\n },", "result_size": 2, "created_at": "2026-03-20T16:58:18.199328+00:00"}} {"sample_id": "immerjs__immer__createProxyProxy__upstream__2hop_b02fca", "repo": "immerjs/immer", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["createProxy"], "hop_1_files": ["private/tmp/repos/immerjs__immer/src/core/immerClass.ts"], "hop_2": ["createDraft", "enableMapSet", "prepareSetCopy", "get"], "hop_2_files": ["private/tmp/repos/immerjs__immer/src/core/immerClass.ts", "private/tmp/repos/immerjs__immer/src/plugins/mapset.ts", "private/tmp/repos/immerjs__immer/src/plugins/mapset.ts", "private/tmp/repos/immerjs__immer/src/plugins/mapset.ts"]}, "metadata": {"anchor": "createProxyProxy", "anchor_file": "private/tmp/repos/immerjs__immer/src/core/proxy.ts", "anchor_source": "export function createProxyProxy(\n\tbase: T,\n\tparent?: ImmerState\n): [Drafted, ProxyState] {\n\tconst baseIsArray = isArray(base)\n\tconst state: ProxyState = {\n\t\ttype_: baseIsArray ? ArchType.Array : (ArchType.Object as any),\n\t\t// Track which produce call this is associated with.\n\t\tscope_: parent ? parent.scope_ : getCurrentScope()!,\n\t\t// True for both shallow and deep changes.\n\t\tmodified_: false,\n\t\t// Used during finalization.\n\t\tfinalized_: false,\n\t\t// Track which properties have been assigned (true) or deleted (false).\n\t\t// actually instantiated in `prepareCopy()`\n\t\tassigned_: undefined,\n\t\t// The parent draft state.\n\t\tparent_: parent,\n\t\t// The base state.\n\t\tbase_: base,\n\t\t// The base proxy.\n\t\tdraft_: null as any, // set below\n\t\t// The base copy with any updated values.\n\t\tcopy_: null,\n\t\t// Called by the `produce` function.\n\t\trevoke_: null as any,\n\t\tisManual_: false,\n\t\t// `callbacks` actually gets assigned in `createProxy`\n\t\tcallbacks_: undefined as any\n\t}\n\n\t// the traps must target something, a bit like the 'real' base.\n\t// but also, we need to be able to determine from the target what the relevant state is\n\t// (to avoid creating traps per instance to capture the state in closure,\n\t// and to avoid creating weird hidden properties as well)\n\t// So the trick is to use 'state' as the actual 'target'! (and make sure we intercept everything)\n\t// Note that in the case of an array, we put the state in an array to have better Reflect defaults ootb\n\tlet target: T = state as any\n\tlet traps: ProxyHandler> = objectTraps\n\tif (baseIsArray) {\n\t\ttarget = [state] as any\n\t\ttraps = arrayTraps\n\t}\n\n\tconst {revoke, proxy} = Proxy.revocable(target, traps)\n\tstate.draft_ = proxy as any\n\tstate.revoke_ = revoke\n\treturn [proxy as any, state]\n}", "result_size": 6, "created_at": "2026-03-20T16:58:16.801413+00:00", "file_content": ""}} {"sample_id": "python-poetry__poetry___download__downstream__1hop_4d518e", "repo": "python-poetry/poetry", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["_download_link"], "call_files": ["private/tmp/repos/python-poetry__poetry/src/poetry/installation/executor.py"]}, "metadata": {"anchor": "_download", "anchor_file": "private/tmp/repos/python-poetry__poetry/src/poetry/installation/executor.py", "anchor_source": "def _download(self, operation: Install | Update) -> Path:\n link = self._chooser.choose_for(operation.package)\n\n if link.yanked:\n # Store yanked warnings in a list and print after installing, so they can't\n # be overlooked. Further, printing them in the concerning section would have\n # the risk of overwriting the warning, so it is only briefly visible.\n message = (\n f\"The file chosen for install of {operation.package.pretty_name} \"\n f\"{operation.package.pretty_version} ({link.show_url}) is yanked.\"\n )\n if link.yanked_reason:\n message += f\" Reason for being yanked: {link.yanked_reason}\"\n self._yanked_warnings.append(message)\n\n return self._download_link(operation, link)", "result_size": 1, "created_at": "2026-03-20T16:58:17.758794+00:00"}} {"sample_id": "immerjs__immer__values__downstream__1hop_7cf9fb", "repo": "immerjs/immer", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["get", "keys"], "call_files": ["private/tmp/repos/immerjs__immer/src/plugins/mapset.ts", "private/tmp/repos/immerjs__immer/src/plugins/mapset.ts"]}, "metadata": {"anchor": "values", "anchor_file": "private/tmp/repos/immerjs__immer/src/plugins/mapset.ts", "anchor_source": "values(): IterableIterator {\n\t\t\tconst iterator = this.keys()\n\t\t\treturn {\n\t\t\t\t[Symbol.iterator]: () => this.values(),\n\t\t\t\tnext: () => {\n\t\t\t\t\tconst r = iterator.next()\n\t\t\t\t\t/* istanbul ignore next */\n\t\t\t\t\tif (r.done) return r\n\t\t\t\t\tconst value = this.get(r.value)\n\t\t\t\t\treturn {\n\t\t\t\t\t\tdone: false,\n\t\t\t\t\t\tvalue\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} as any\n\t\t}", "result_size": 2, "created_at": "2026-03-20T16:58:16.801413+00:00"}} {"sample_id": "trpc__trpc__send__upstream__2hop_73f13b", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["request", "batchSend", "reconnect"], "hop_1_files": ["private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/wsClient.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/wsClient.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/wsClient.ts"], "hop_2": ["open", "wsLink", "setupWebSocketListeners", "handleIncomingRequest"], "hop_2_files": ["private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/wsClient.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsLink.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/wsClient.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/wsClient.ts"]}, "metadata": {"anchor": "send", "anchor_file": "private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/wsClient.ts", "anchor_source": "private send(\n messageOrMessages: TRPCClientOutgoingMessage | TRPCClientOutgoingMessage[],\n ) {\n if (!this.activeConnection.isOpen()) {\n throw new Error('Active connection is not open');\n }\n\n const messages =\n messageOrMessages instanceof Array\n ? messageOrMessages\n : [messageOrMessages];\n this.activeConnection.ws.send(\n this.encoder.encode(messages.length === 1 ? messages[0] : messages),\n );\n }", "result_size": 8, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "colinhacks__zod___multipleOf__downstream__1hop_dd36b4", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["normalizeParams"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/util.ts"]}, "metadata": {"anchor": "_multipleOf", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/api.ts", "anchor_source": "export function _multipleOf(\n value: number | bigint,\n params?: string | $ZodCheckMultipleOfParams\n): checks.$ZodCheckMultipleOf {\n return new checks.$ZodCheckMultipleOf({\n check: \"multiple_of\",\n ...util.normalizeParams(params),\n value,\n });\n}", "result_size": 1, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "paramiko__paramiko__auth_interactive__downstream__2hop_9314fe", "repo": "paramiko/paramiko", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["send_auth_request"], "hop_1_files": ["private/tmp/repos/paramiko/paramiko/auth_handler.py"], "hop_2": ["wait_for_response"], "hop_2_files": ["private/tmp/repos/paramiko/paramiko/auth_handler.py"]}, "metadata": {"anchor": "auth_interactive", "anchor_file": "private/tmp/repos/paramiko/paramiko/auth_handler.py", "anchor_source": "def auth_interactive(self, username, handler, submethods=\"\"):\n \"\"\"\n response_list = handler(title, instructions, prompt_list)\n \"\"\"\n # Unlike most siblings, this auth method _does_ require other\n # superclass handlers (eg userauth info request) to understand\n # what's going on, so we still set some self attributes.\n self.auth_method = \"keyboard_interactive\"\n self.interactive_handler = handler\n\n def finish(m):\n # Empty string for deprecated language tag field, per RFC 4256:\n # https://www.rfc-editor.org/rfc/rfc4256#section-3.1\n m.add_string(\"\")\n m.add_string(submethods)\n\n return self.send_auth_request(username, \"keyboard-interactive\", finish)", "result_size": 1, "created_at": "2026-03-20T16:58:17.364834+00:00"}} {"sample_id": "locustio__locust__new_dispatch__upstream__2hop_952659", "repo": "locustio/locust", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["start", "_start"], "hop_1_files": ["private/tmp/repos/locustio__locust/locust/runners.py", "private/tmp/repos/locustio__locust/locust/runners.py"], "hop_2": ["main", "heartbeat_worker", "start", "handle_message"], "hop_2_files": ["private/tmp/repos/locustio__locust/locust/main.py", "private/tmp/repos/locustio__locust/locust/runners.py", "private/tmp/repos/locustio__locust/locust/runners.py", "private/tmp/repos/locustio__locust/locust/runners.py"]}, "metadata": {"anchor": "new_dispatch", "anchor_file": "private/tmp/repos/locustio__locust/locust/dispatch.py", "anchor_source": "def new_dispatch(\n self, target_user_count: int, spawn_rate: float, user_classes: list[type[User]] | None = None\n ) -> None:\n \"\"\"\n Initialize a new dispatch cycle.\n\n :param target_user_count: The desired user count at the end of the dispatch cycle\n :param spawn_rate: The spawn rate\n :param user_classes: The user classes to be used for the new dispatch\n \"\"\"\n if user_classes is not None and self._user_classes != sorted(user_classes, key=attrgetter(\"__name__\")):\n self._user_classes = sorted(user_classes, key=attrgetter(\"__name__\"))\n self._user_generator = self._user_gen()\n\n self._target_user_count = target_user_count\n\n self._spawn_rate = spawn_rate\n\n self._user_count_per_dispatch_iteration = max(1, math.floor(self._spawn_rate))\n\n self._wait_between_dispatch = self._user_count_per_dispatch_iteration / self._spawn_rate\n\n self._initial_users_on_workers = self._users_on_workers\n\n self._users_on_workers = self._fast_users_on_workers_copy(self._initial_users_on_workers)\n\n self._current_user_count = self.get_current_user_count()\n\n self._dispatcher_generator = self._dispatcher()\n\n self._dispatch_iteration_durations.clear()", "result_size": 4, "created_at": "2026-03-20T16:58:16.951273+00:00", "file_content": ""}} {"sample_id": "pallets__jinja__new_func__downstream__2hop_137bca", "repo": "pallets/jinja", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["visit"], "hop_1_files": ["private/tmp/repos/pallets__jinja/src/jinja2/visitor.py"], "hop_2": ["get_visitor", "generic_visit"], "hop_2_files": ["private/tmp/repos/pallets__jinja/src/jinja2/visitor.py", "private/tmp/repos/pallets__jinja/src/jinja2/visitor.py"]}, "metadata": {"anchor": "new_func", "anchor_file": "private/tmp/repos/pallets__jinja/src/jinja2/compiler.py", "anchor_source": "def new_func(\n self: \"CodeGenerator\", node: nodes.Expr, frame: \"Frame\", **kwargs: t.Any\n ) -> t.Any:\n # Only optimize if the frame is not volatile\n if self.optimizer is not None and not frame.eval_ctx.volatile:\n new_node = self.optimizer.visit(node, frame.eval_ctx)\n\n if new_node != node:\n return self.visit(new_node, frame)\n\n return f(self, node, frame, **kwargs)", "result_size": 2, "created_at": "2026-03-20T16:58:17.229656+00:00"}} {"sample_id": "pallets__jinja__get_source__upstream__2hop_e1117a", "repo": "pallets/jinja", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["get_source", "load", "compile_templates"], "hop_1_files": ["private/tmp/repos/pallets__jinja/src/jinja2/loaders.py", "private/tmp/repos/pallets__jinja/src/jinja2/loaders.py", "private/tmp/repos/pallets__jinja/src/jinja2/environment.py"], "hop_2": ["_load_template", "load"], "hop_2_files": ["private/tmp/repos/pallets__jinja/src/jinja2/environment.py", "private/tmp/repos/pallets__jinja/src/jinja2/loaders.py"]}, "metadata": {"anchor": "get_source", "anchor_file": "private/tmp/repos/pallets__jinja/src/jinja2/loaders.py", "anchor_source": "def get_source(\n self, environment: \"Environment\", template: str\n ) -> tuple[str, str | None, t.Callable[[], bool] | None]:\n \"\"\"Get the template source, filename and reload helper for a template.\n It's passed the environment and template name and has to return a\n tuple in the form ``(source, filename, uptodate)`` or raise a\n `TemplateNotFound` error if it can't locate the template.\n\n The source part of the returned tuple must be the source of the\n template as a string. The filename should be the name of the\n file on the filesystem if it was loaded from there, otherwise\n ``None``. The filename is used by Python for the tracebacks\n if no loader extension is used.\n\n The last item in the tuple is the `uptodate` function. If auto\n reloading is enabled it's always called to check if the template\n changed. No arguments are passed so the function must store the\n old state somewhere (for example in a closure). If it returns `False`\n the template will be reloaded.\n \"\"\"\n if not self.has_source_access:\n raise RuntimeError(\n f\"{type(self).__name__} cannot provide access to the source\"\n )\n raise TemplateNotFound(template)", "result_size": 2, "created_at": "2026-03-20T16:58:17.229656+00:00", "file_content": ""}} {"sample_id": "colinhacks__zod__finalize__upstream__1hop_9d6111", "repo": "colinhacks/zod", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["toJSONSchema", "emit"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/json-schema-processors.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/json-schema-generator.ts"]}, "metadata": {"anchor": "finalize", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/to-json-schema.ts", "anchor_source": "export function finalize(\n ctx: ToJSONSchemaContext,\n schema: T\n): ZodStandardJSONSchemaPayload {\n const root = ctx.seen.get(schema);\n if (!root) throw new Error(\"Unprocessed schema. This is a bug in Zod.\");\n\n // flatten refs - inherit properties from parent schemas\n const flattenRef = (zodSchema: schemas.$ZodType) => {\n const seen = ctx.seen.get(zodSchema)!;\n\n // already processed\n if (seen.ref === null) return;\n\n const schema = seen.def ?? seen.schema;\n const _cached = { ...schema };\n\n const ref = seen.ref;\n seen.ref = null; // prevent infinite recursion\n\n if (ref) {\n flattenRef(ref);\n\n const refSeen = ctx.seen.get(ref)!;\n const refSchema = refSeen.schema;\n\n // merge referenced schema into current\n if (refSchema.$ref && (ctx.target === \"draft-07\" || ctx.target === \"draft-04\" || ctx.target === \"openapi-3.0\")) {\n // older drafts can't combine $ref with other properties\n schema.allOf = schema.allOf ?? [];\n schema.allOf.push(refSchema);\n } else {\n Object.assign(schema, refSchema);\n }\n // restore child's own properties (child wins)\n Object.assign(schema, _cached);\n\n const isParentRef = zodSchema._zod.parent === ref;\n\n // For parent chain, child is a refinement - remove parent-only properties\n if (isParentRef) {\n for (const key in schema) {\n if (key === \"$ref\" || key === \"allOf\") continue;\n if (!(key in _cached)) {\n delete schema[key];\n }\n }\n }\n\n // When ref was extracted to $defs, remove properties that match the definition\n if (refSchema.$ref && refSeen.def) {\n for (const key in schema) {\n if (key === \"$ref\" || key === \"allOf\") continue;\n if (key in refSeen.def && JSON.stringify(schema[key]) === JSON.stringify(refSeen.def[key])) {\n delete schema[key];\n }\n }\n }\n }\n\n // If parent was extracted (has $ref), propagate $ref to this schema\n // This handles cases like: readonly().meta({id}).describe()\n // where processor sets ref to innerType but parent should be referenced\n const parent = zodSchema._zod.parent;\n if (parent && parent !== ref) {\n // Ensure parent is processed first so its def has inherited properties\n flattenRef(parent);\n const parentSeen = ctx.seen.get(parent);\n if (parentSeen?.schema.$ref) {\n schema.$ref = parentSeen.schema.$ref;\n // De-duplicate with parent's definition\n if (parentSeen.def) {\n for (const key in schema) {\n if (key === \"$ref\" || key === \"allOf\") continue;\n if (key in parentSeen.def && JSON.stringify(schema[key]) === JSON.stringify(parentSeen.def[key])) {\n delete schema[key];\n }\n }\n }\n }\n }\n\n // execute overrides\n ctx.override({\n zodSchema: zodSchema as schemas.$ZodTypes,\n jsonSchema: schema,\n path: seen.path ?? [],\n });\n };\n\n for (const entry of [...ctx.seen.entries()].reverse()) {\n flattenRef(entry[0]);\n }\n\n const result: JSONSchema.BaseSchema = {};\n if (ctx.target === \"draft-2020-12\") {\n result.$schema = \"https://json-schema.org/draft/2020-12/schema\";\n } else if (ctx.target === \"draft-07\") {\n result.$schema = \"http://json-schema.org/draft-07/schema#\";\n } else if (ctx.target === \"draft-04\") {\n result.$schema = \"http://json-schema.org/draft-04/schema#\";\n } else if (ctx.target === \"openapi-3.0\") {\n // OpenAPI 3.0 schema objects should not include a $schema property\n } else {\n // Arbitrary string values are allowed but won't have a $schema property set\n }\n\n if (ctx.external?.uri) {\n const id = ctx.external.registry.get(schema)?.id;\n if (!id) throw new Error(\"Schema is missing an `id` property\");\n result.$id = ctx.external.uri(id);\n }\n\n Object.assign(result, root.def ?? root.schema);\n\n // build defs object\n const defs: JSONSchema.BaseSchema[\"$defs\"] = ctx.external?.defs ?? {};\n for (const entry of ctx.seen.entries()) {\n const seen = entry[1];\n if (seen.def && seen.defId) {\n defs[seen.defId] = seen.def;\n }\n }\n\n // set definitions in result\n if (ctx.external) {\n } else {\n if (Object.keys(defs).length > 0) {\n if (ctx.target === \"draft-2020-12\") {\n result.$defs = defs;\n } else {\n result.definitions = defs;\n }\n }\n }\n\n try {\n // this \"finalizes\" this schema and ensures all cycles are removed\n // each call to finalize() is functionally independent\n // though the seen map is shared\n const finalized = JSON.parse(JSON.stringify(result));\n Object.defineProperty(finalized, \"~standard\", {\n value: {\n ...schema[\"~standard\"],\n jsonSchema: {\n input: createStandardJSONSchemaMethod(schema, \"input\", ctx.processors),\n output: createStandardJSONSchemaMethod(schema, \"output\", ctx.processors),\n },\n },\n enumerable: false,\n writable: false,\n });\n\n return finalized;\n } catch (_err) {\n throw new Error(\"Error converting schema to JSON.\");\n }\n}", "result_size": 2, "created_at": "2026-03-20T16:58:16.474869+00:00", "file_content": ""}} {"sample_id": "rq__rq__signal_name__upstream__1hop_e85df5", "repo": "rq/rq", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["request_force_stop_sigrtmin", "request_stop"], "call_files": ["private/tmp/repos/rq__rq/rq/worker/worker_classes.py", "private/tmp/repos/rq__rq/rq/worker/base.py"]}, "metadata": {"anchor": "signal_name", "anchor_file": "private/tmp/repos/rq__rq/rq/worker/base.py", "anchor_source": "def signal_name(signum):\n try:\n return signal.Signals(signum).name\n\n except KeyError:\n return 'SIG_UNKNOWN'\n except ValueError:\n return 'SIG_UNKNOWN'", "result_size": 2, "created_at": "2026-03-20T16:58:17.875204+00:00", "file_content": ""}} {"sample_id": "colinhacks__zod__isObject__upstream__1hop_812386", "repo": "colinhacks/zod", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["parse", "isPlainObject"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/schemas.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/util.ts"]}, "metadata": {"anchor": "isObject", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/util.ts", "anchor_source": "export function isObject(data: any): data is Record {\n return typeof data === \"object\" && data !== null && !Array.isArray(data);\n}", "result_size": 5, "created_at": "2026-03-20T16:58:16.474869+00:00", "file_content": ""}} {"sample_id": "immerjs__immer__createProxy__upstream__1hop_05ab35", "repo": "immerjs/immer", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["createDraft", "enableMapSet", "prepareSetCopy", "get"], "call_files": ["private/tmp/repos/immerjs__immer/src/core/immerClass.ts", "private/tmp/repos/immerjs__immer/src/plugins/mapset.ts", "private/tmp/repos/immerjs__immer/src/plugins/mapset.ts", "private/tmp/repos/immerjs__immer/src/plugins/mapset.ts"]}, "metadata": {"anchor": "createProxy", "anchor_file": "private/tmp/repos/immerjs__immer/src/core/immerClass.ts", "anchor_source": "export function createProxy(\n\trootScope: ImmerScope,\n\tvalue: T,\n\tparent?: ImmerState,\n\tkey?: string | number | symbol\n): Drafted {\n\t// precondition: createProxy should be guarded by isDraftable, so we know we can safely draft\n\t// returning a tuple here lets us skip a proxy access\n\t// to DRAFT_STATE later\n\tconst [draft, state] = isMap(value)\n\t\t? getPlugin(PluginMapSet).proxyMap_(value, parent)\n\t\t: isSet(value)\n\t\t? getPlugin(PluginMapSet).proxySet_(value, parent)\n\t\t: createProxyProxy(value, parent)\n\n\tconst scope = parent?.scope_ ?? getCurrentScope()\n\tscope.drafts_.push(draft)\n\n\t// Ensure the parent callbacks are passed down so we actually\n\t// track all callbacks added throughout the tree\n\tstate.callbacks_ = parent?.callbacks_ ?? []\n\tstate.key_ = key\n\n\tif (parent && key !== undefined) {\n\t\tregisterChildFinalizationCallback(parent, state, key)\n\t} else {\n\t\t// It's a root draft, register it with the scope\n\t\tstate.callbacks_.push(function rootDraftCleanup(rootScope) {\n\t\t\trootScope.mapSetPlugin_?.fixSetContents(state)\n\n\t\t\tconst {patchPlugin_} = rootScope\n\n\t\t\tif (state.modified_ && patchPlugin_) {\n\t\t\t\tpatchPlugin_.generatePatches_(state, [], rootScope)\n\t\t\t}\n\t\t})\n\t}\n\n\treturn draft as any\n}", "result_size": 6, "created_at": "2026-03-20T16:58:16.801413+00:00", "file_content": ""}} {"sample_id": "psf__requests__extract_cookies_to_jar__upstream__2hop_3f8951", "repo": "psf/requests", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["resolve_redirects", "send", "build_response", "handle_401"], "hop_1_files": ["private/tmp/repos/requests/src/requests/sessions.py", "private/tmp/repos/requests/src/requests/sessions.py", "private/tmp/repos/requests/src/requests/adapters.py", "private/tmp/repos/requests/src/requests/auth.py"], "hop_2": ["send", "request"], "hop_2_files": ["private/tmp/repos/requests/src/requests/adapters.py", "private/tmp/repos/requests/src/requests/sessions.py"]}, "metadata": {"anchor": "extract_cookies_to_jar", "anchor_file": "private/tmp/repos/requests/src/requests/cookies.py", "anchor_source": "def extract_cookies_to_jar(jar, request, response):\n \"\"\"Extract the cookies from the response into a CookieJar.\n\n :param jar: http.cookiejar.CookieJar (not necessarily a RequestsCookieJar)\n :param request: our own requests.Request object\n :param response: urllib3.HTTPResponse object\n \"\"\"\n if not (hasattr(response, \"_original_response\") and response._original_response):\n return\n # the _original_response field is the wrapped httplib.HTTPResponse object,\n req = MockRequest(request)\n # pull out the HTTPMessage with the headers and put it in the mock:\n res = MockResponse(response._original_response.msg)\n jar.extract_cookies(res, req)", "result_size": 2, "created_at": "2026-03-20T16:58:17.570287+00:00", "file_content": "\"\"\"\nrequests.cookies\n~~~~~~~~~~~~~~~~\n\nCompatibility code to be able to use `http.cookiejar.CookieJar` with requests.\n\nrequests.utils imports from here, so be careful with imports.\n\"\"\"\n\nimport calendar\nimport copy\nimport time\n\nfrom ._internal_utils import to_native_string\nfrom .compat import Morsel, MutableMapping, cookielib, urlparse, urlunparse\n\ntry:\n import threading\nexcept ImportError:\n import dummy_threading as threading\n\n\nclass MockRequest:\n \"\"\"Wraps a `requests.Request` to mimic a `urllib2.Request`.\n\n The code in `http.cookiejar.CookieJar` expects this interface in order to correctly\n manage cookie policies, i.e., determine whether a cookie can be set, given the\n domains of the request and the cookie.\n\n The original request object is read-only. The client is responsible for collecting\n the new headers via `get_new_headers()` and interpreting them appropriately. You\n probably want `get_cookie_header`, defined below.\n \"\"\"\n\n def __init__(self, request):\n self._r = request\n self._new_headers = {}\n self.type = urlparse(self._r.url).scheme\n\n def get_type(self):\n return self.type\n\n def get_host(self):\n return urlparse(self._r.url).netloc\n\n def get_origin_req_host(self):\n return self.get_host()\n\n def get_full_url(self):\n # Only return the response's URL if the user hadn't set the Host\n # header\n if not self._r.headers.get(\"Host\"):\n return self._r.url\n # If they did set it, retrieve it and reconstruct the expected domain\n host = to_native_string(self._r.headers[\"Host\"], encoding=\"utf-8\")\n parsed = urlparse(self._r.url)\n # Reconstruct the URL as we expect it\n return urlunparse(\n [\n parsed.scheme,\n host,\n parsed.path,\n parsed.params,\n parsed.query,\n parsed.fragment,\n ]\n )\n\n def is_unverifiable(self):\n return True\n\n def has_header(self, name):\n return name in self._r.headers or name in self._new_headers\n\n def get_header(self, name, default=None):\n return self._r.headers.get(name, self._new_headers.get(name, default))\n\n def add_header(self, key, val):\n \"\"\"cookiejar has no legitimate use for this method; add it back if you find one.\"\"\"\n raise NotImplementedError(\n \"Cookie headers should be added with add_unredirected_header()\"\n )\n\n def add_unredirected_header(self, name, value):\n self._new_headers[name] = value\n\n def get_new_headers(self):\n return self._new_headers\n\n @property\n def unverifiable(self):\n return self.is_unverifiable()\n\n @property\n def origin_req_host(self):\n return self.get_origin_req_host()\n\n @property\n def host(self):\n return self.get_host()\n\n\nclass MockResponse:\n \"\"\"Wraps a `httplib.HTTPMessage` to mimic a `urllib.addinfourl`.\n\n ...what? Basically, expose the parsed HTTP headers from the server response\n the way `http.cookiejar` expects to see them.\n \"\"\"\n\n def __init__(self, headers):\n \"\"\"Make a MockResponse for `cookiejar` to read.\n\n :param headers: a httplib.HTTPMessage or analogous carrying the headers\n \"\"\"\n self._headers = headers\n\n def info(self):\n return self._headers\n\n def getheaders(self, name):\n self._headers.getheaders(name)\n\n\ndef extract_cookies_to_jar(jar, request, response):\n \"\"\"Extract the cookies from the response into a CookieJar.\n\n :param jar: http.cookiejar.CookieJar (not necessarily a RequestsCookieJar)\n :param request: our own requests.Request object\n :param response: urllib3.HTTPResponse object\n \"\"\"\n if not (hasattr(response, \"_original_response\") and response._original_response):\n return\n # the _original_response field is the wrapped httplib.HTTPResponse object,\n req = MockRequest(request)\n # pull out the HTTPMessage with the headers and put it in the mock:\n res = MockResponse(response._original_response.msg)\n jar.extract_cookies(res, req)\n\n\ndef get_cookie_header(jar, request):\n \"\"\"\n Produce an appropriate Cookie header string to be sent with `request`, or None.\n\n :rtype: str\n \"\"\"\n r = MockRequest(request)\n jar.add_cookie_header(r)\n return r.get_new_headers().get(\"Cookie\")\n\n\ndef remove_cookie_by_name(cookiejar, name, domain=None, path=None):\n \"\"\"Unsets a cookie by name, by default over all domains and paths.\n\n Wraps CookieJar.clear(), is O(n).\n \"\"\"\n clearables = []\n for cookie in cookiejar:\n if cookie.name != name:\n continue\n if domain is not None and domain != cookie.domain:\n continue\n if path is not None and path != cookie.path:\n continue\n clearables.append((cookie.domain, cookie.path, cookie.name))\n\n for domain, path, name in clearables:\n cookiejar.clear(domain, path, name)\n\n\nclass CookieConflictError(RuntimeError):\n \"\"\"There are two cookies that meet the criteria specified in the cookie jar.\n Use .get and .set and include domain and path args in order to be more specific.\n \"\"\"\n\n\nclass RequestsCookieJar(cookielib.CookieJar, MutableMapping):\n \"\"\"Compatibility class; is a http.cookiejar.CookieJar, but exposes a dict\n interface.\n\n This is the CookieJar we create by default for requests and sessions that\n don't specify one, since some clients may expect response.cookies and\n session.cookies to support dict operations.\n\n Requests does not use the dict interface internally; it's just for\n compatibility with external client code. All requests code should work\n out of the box with externally provided instances of ``CookieJar``, e.g.\n ``LWPCookieJar`` and ``FileCookieJar``.\n\n Unlike a regular CookieJar, this class is pickleable.\n\n .. warning:: dictionary operations that are normally O(1) may be O(n).\n \"\"\"\n\n def get(self, name, default=None, domain=None, path=None):\n \"\"\"Dict-like get() that also supports optional domain and path args in\n order to resolve naming collisions from using one cookie jar over\n multiple domains.\n\n .. warning:: operation is O(n), not O(1).\n \"\"\"\n try:\n return self._find_no_duplicates(name, domain, path)\n except KeyError:\n return default\n\n def set(self, name, value, **kwargs):\n \"\"\"Dict-like set() that also supports optional domain and path args in\n order to resolve naming collisions from using one cookie jar over\n multiple domains.\n \"\"\"\n # support client code that unsets cookies by assignment of a None value:\n if value is None:\n remove_cookie_by_name(\n self, name, domain=kwargs.get(\"domain\"), path=kwargs.get(\"path\")\n )\n return\n\n if isinstance(value, Morsel):\n c = morsel_to_cookie(value)\n else:\n c = create_cookie(name, value, **kwargs)\n self.set_cookie(c)\n return c\n\n def iterkeys(self):\n \"\"\"Dict-like iterkeys() that returns an iterator of names of cookies\n from the jar.\n\n .. seealso:: itervalues() and iteritems().\n \"\"\"\n for cookie in iter(self):\n yield cookie.name\n\n def keys(self):\n \"\"\"Dict-like keys() that returns a list of names of cookies from the\n jar.\n\n .. seealso:: values() and items().\n \"\"\"\n return list(self.iterkeys())\n\n def itervalues(self):\n \"\"\"Dict-like itervalues() that returns an iterator of values of cookies\n from the jar.\n\n .. seealso:: iterkeys() and iteritems().\n \"\"\"\n for cookie in iter(self):\n yield cookie.value\n\n def values(self):\n \"\"\"Dict-like values() that returns a list of values of cookies from the\n jar.\n\n .. seealso:: keys() and items().\n \"\"\"\n return list(\n# \u2026 (truncated at 8000 chars)"}} {"sample_id": "locustio__locust__useInterval__upstream__1hop_4bac50", "repo": "locustio/locust", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["useFetchWorkerCount", "useFetchTasks", "useLogViewer", "useFetchExceptions", "useFetchStats"], "call_files": ["private/tmp/repos/locustio__locust/locust/webui/src/hooks/useFetchWorkerCount.ts", "private/tmp/repos/locustio__locust/locust/webui/src/hooks/useFetchTasks.ts", "private/tmp/repos/locustio__locust/locust/webui/src/components/LogViewer/useLogViewer.ts", "private/tmp/repos/locustio__locust/locust/webui/src/hooks/useFetchExceptions.ts", "private/tmp/repos/locustio__locust/locust/webui/src/hooks/useFetchStats.ts"]}, "metadata": {"anchor": "useInterval", "anchor_file": "private/tmp/repos/locustio__locust/locust/webui/src/hooks/useInterval.ts", "anchor_source": "export default function useInterval(\n callback: () => void,\n delay: number,\n { shouldRunInterval, immediate }: { shouldRunInterval?: boolean; immediate?: boolean } = {\n shouldRunInterval: true,\n immediate: false,\n },\n) {\n const savedCallback = useRef(callback);\n\n useEffect(() => {\n savedCallback.current = callback;\n }, [callback]);\n\n useEffect(() => {\n if (!shouldRunInterval) {\n return;\n }\n\n if (immediate) {\n savedCallback.current();\n }\n\n const interval = setInterval(() => savedCallback.current(), delay);\n\n return () => {\n clearInterval(interval);\n };\n }, [delay, shouldRunInterval]);\n}", "result_size": 5, "created_at": "2026-03-20T16:58:16.951273+00:00", "file_content": ""}} {"sample_id": "sindresorhus__got__#createHeadersProxy__upstream__2hop_f4f22b", "repo": "sindresorhus/got", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["headers", "constructor"], "hop_1_files": ["private/tmp/repos/got/source/core/options.ts", "private/tmp/repos/got/source/core/options.ts"], "hop_2": ["constructor", "headers", "_onResponseBase", "extend", "fn"], "hop_2_files": ["private/tmp/repos/got/source/core/index.ts", "private/tmp/repos/got/source/core/options.ts", "private/tmp/repos/got/source/core/index.ts", "private/tmp/repos/got/source/create.ts", "private/tmp/repos/got/benchmark/index.ts"]}, "metadata": {"anchor": "#createHeadersProxy", "anchor_file": "private/tmp/repos/got/source/core/options.ts", "anchor_source": "#createHeadersProxy(): Headers {\n\t\treturn new Proxy(this.#internals.headers, {\n\t\t\tget(target, property, receiver): unknown {\n\t\t\t\tif (typeof property === 'string') {\n\t\t\t\t\tif (Reflect.has(target, property)) {\n\t\t\t\t\t\treturn Reflect.get(target, property, receiver);\n\t\t\t\t\t}\n\n\t\t\t\t\tconst normalizedProperty = property.toLowerCase();\n\t\t\t\t\treturn Reflect.get(target, normalizedProperty, receiver);\n\t\t\t\t}\n\n\t\t\t\treturn Reflect.get(target, property, receiver);\n\t\t\t},\n\t\t\tset: (target, property, value): boolean => {\n\t\t\t\tif (typeof property === 'string') {\n\t\t\t\t\tconst normalizedProperty = property.toLowerCase();\n\t\t\t\t\tconst isSuccess = Reflect.set(target, normalizedProperty, value);\n\n\t\t\t\t\tif (isSuccess) {\n\t\t\t\t\t\tthis.#explicitHeaders.add(normalizedProperty);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn isSuccess;\n\t\t\t\t}\n\n\t\t\t\treturn Reflect.set(target, property, value);\n\t\t\t},\n\t\t\tdeleteProperty: (target, property): boolean => {\n\t\t\t\tif (typeof property === 'string') {\n\t\t\t\t\tconst normalizedProperty = property.toLowerCase();\n\t\t\t\t\tconst isSuccess = Reflect.deleteProperty(target, normalizedProperty);\n\n\t\t\t\t\tif (isSuccess) {\n\t\t\t\t\t\tthis.#explicitHeaders.delete(normalizedProperty);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn isSuccess;\n\t\t\t\t}\n\n\t\t\t\treturn Reflect.deleteProperty(target, property);\n\t\t\t},\n\t\t});\n\t}", "result_size": 6, "created_at": "2026-03-20T16:58:18.104721+00:00", "file_content": "import process from 'node:process';\nimport {promisify, inspect, type InspectOptions} from 'node:util';\nimport {checkServerIdentity, type SecureContextOptions, type DetailedPeerCertificate} from 'node:tls';\n// DO NOT use destructuring for `https.request` and `http.request` as it's not compatible with `nock`.\nimport https, {\n\ttype RequestOptions as HttpsRequestOptions,\n\ttype Agent as HttpsAgent,\n} from 'node:https';\nimport http, {\n\ttype Agent as HttpAgent,\n\ttype ClientRequest,\n} from 'node:http';\nimport type {Readable} from 'node:stream';\nimport type {Socket, LookupFunction} from 'node:net';\nimport is, {assert} from '@sindresorhus/is';\nimport lowercaseKeys from 'lowercase-keys';\nimport CacheableLookup from 'cacheable-lookup';\nimport http2wrapper, {type ClientHttp2Session} from 'http2-wrapper';\nimport type {KeyvStoreAdapter} from 'keyv';\nimport type KeyvType from 'keyv';\nimport type ResponseLike from 'responselike';\nimport type {RequestPromise} from '../as-promise/types.js';\nimport type {IncomingMessageWithTimings} from './utils/timer.js';\nimport parseLinkHeader from './parse-link-header.js';\nimport type {PlainResponse, Response} from './response.js';\nimport type {RequestError} from './errors.js';\nimport type {Delays} from './timed-out.js';\n\ntype StorageAdapter = KeyvStoreAdapter | KeyvType | Map;\n\ntype Promisable = T | Promise;\n\nconst [major, minor] = process.versions.node.split('.').map(Number) as [number, number, number];\n\nexport type DnsLookupIpVersion = undefined | 4 | 6;\n\ntype Except = Pick>;\n\nexport type NativeRequestOptions = HttpsRequestOptions & CacheOptions & {checkServerIdentity?: CheckServerIdentityFunction};\n\ntype AcceptableResponse = IncomingMessageWithTimings | ResponseLike;\ntype AcceptableRequestResult = Promisable;\nexport type RequestFunction = (url: URL, options: NativeRequestOptions, callback?: (response: AcceptableResponse) => void) => AcceptableRequestResult;\n\nexport type Agents = {\n\thttp?: HttpAgent | false;\n\thttps?: HttpsAgent | false;\n\thttp2?: unknown | false;\n};\n\nexport type Headers = Record;\n\nexport type ToughCookieJar = {\n\tgetCookieString: ((currentUrl: string, options: Record, callback: (error: Error | undefined, cookies: string) => void) => void)\n\t\t& ((url: string, callback: (error: Error | undefined, cookieHeader: string) => void) => void);\n\tsetCookie: ((cookieOrString: unknown, currentUrl: string, options: Record, callback: (error: Error | undefined, cookie: unknown) => void) => void)\n\t\t& ((rawCookie: string, url: string, callback: (error: Error | undefined, result: unknown) => void) => void);\n};\n\nexport type PromiseCookieJar = {\n\tgetCookieString: (url: string) => Promise;\n\tsetCookie: (rawCookie: string, url: string) => Promise;\n};\n\n/**\nUtility type to override specific properties in a type.\n\nUses `Omit` to remove properties before adding them back to ensure proper type replacement rather than intersection, which handles edge cases with optional/required properties correctly.\n*/\ntype OverrideProperties = Omit & U;\n\n/**\nRepresents the runtime state of Options as seen by hooks after normalization.\n\nSome Options properties accept multiple input types but are normalized to a single type internally by the Options class setters. This type reflects the actual runtime types that hooks receive, ensuring type safety when accessing options within hook functions.\n*/\nexport type NormalizedOptions = OverrideProperties;\n\nexport type InitHook = (init: OptionsInit, self: Options) => void;\n\nexport type BeforeRequestHookContext = {\n\t/**\n\tThe current retry count.\n\n\tIt will be `0` for the initial request and increment for each retry.\n\t*/\n\tretryCount: number;\n};\n\nexport type BeforeRequestHook = (options: NormalizedOptions, context: BeforeRequestHookContext) => Promisable;\nexport type BeforeRedirectHook = (updatedOptions: NormalizedOptions, plainResponse: PlainResponse) => Promisable;\nexport type BeforeErrorHook = (error: RequestError) => Promisable;\nexport type BeforeRetryHook = (error: RequestError, retryCount: number) => Promisable;\nexport type BeforeCacheHook = (response: PlainResponse) => false | void;\nexport type AfterResponseHook = (response: Response, retryWithMergedOptions: (options: OptionsInit) => never) => Promisable>;\n\n/**\nAll available hooks of Got.\n*/\nexport type Hooks = {\n\t/**\n\tCalled with the plain request options, right before their normalization.\n\n\tThe second argument represents the current `Options` instance.\n\n\t@default []\n\n\t**Note:**\n\t> - This hook must be synchronous.\n\n\t**Note:**\n\t> - This is called every time options are merged.\n\n\t**Note:**\n\t> - The `options` object may not have the `url` property. To modify it, use a `beforeRequest` hook instead.\n\n\t**Note:**\n\t> - This hook is called when a new instance of `Options` is created.\n\t> - Do not confuse this with the creation of `Request` or `got(\u2026)`.\n\n\t**Note:**\n\t> - When using `got(url)` or `got(url, undefined, defaults)` this hook will **not** be called.\n\n\tThis is especially useful in conjunction with `got.extend()` when the input needs custom handling.\n\n\tFor example, this can be used to fix typos to migrate from older versions faster.\n\n\t@example\n\t```\n\timport got from 'got';\n\n\tconst instance = got.extend({\n\t\thooks: {\n\t\t\tinit: [\n\t\t\t\tplain => {\n\t\t\t\t\tif ('followRedirects' in plain) {\n\t\t\t\t\t\tplain.followRedirect = plain.followRedirects;\n\t\t\t\t\t\tdelete plain.followRedirects;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t});\n\n\t// Normally, the following would throw:\n\tconst response = await instance(\n\t\t'https://example.com',\n\t\t{\n\t\t\tfollowRedirects: true\n\t\t}\n\t);\n\n\t// There is no option named `followRedirects`, but we correct it in an `init` hook.\n\t```\n\n\tOr you can create your own option and store it in a context:\n\n\t```\n\timport got from 'got';\n\n\tconst instance = got.extend({\n\t\thooks: {\n\t\t\tinit: [\n\t\t\t\t(plain, options) => {\n\t\t\t\t\tif ('secret' in plain) {\n\t\t\t\t\t\toptions.context.secret = plain.secret;\n\t\t\t\t\t\tdelete plain.secret;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t],\n\t\t\tbeforeRequest: [\n\t\t\t\toptions => {\n\t\t\t\t\toptions.headers.secret = options.context.secret;\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t});\n\n\tconst {headers} = await instance(\n\t\t'https://httpbin.org/anything',\n\t\t{\n\t\t\tsecret: 'passphrase'\n\t\t}\n\t).json();\n\n\tconsole.log(headers.Secret);\n\t//=> 'passphrase'\n\t```\n\t*/\n\tinit: InitHook[];\n\n\t/**\n\tCalled right before making the request with `options.createNativeRequestOptions()`.\n\n\tThe second argument is a context object containing request state information.\n\n\tThis hook is especially useful in conjunction with `got.extend()` when you want to sign your request.\n\n\t@default []\n\n\t**Note:**\n\t> - Got will make no further changes to the request before it is sent.\n\n\t**Note:**\n\t> - Changing `options.json` or `options.form` has no effect on the request. You should change `options.body` instead. If needed, update the `options.headers` accordingly.\n\n\t@example\n\t```\n\timport got from 'got';\n\n\tconst response = await got.post(\n\t\t'https://httpbin.org/anything',\n\t\t{\n\t\t\tjson: {payload: 'old'},\n\t\t\thooks: {\n\t\t\t\tbeforeRequest: [\n\t\t\t\t\t(options, context) => {\n\t\t\t\t\t\toptions.body = JSON.stringify({payload: 'new'});\n\t\t\n# \u2026 (truncated at 8000 chars)"}} {"sample_id": "scrapy__scrapy__dataReceived__downstream__1hop_c8b940", "repo": "scrapy/scrapy", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["_lose_connection_with_error", "_handle_events", "_check_received_data", "_write_to_transport"], "call_files": ["private/tmp/repos/scrapy__scrapy/scrapy/core/http2/protocol.py", "private/tmp/repos/scrapy__scrapy/scrapy/core/http2/protocol.py", "private/tmp/repos/scrapy__scrapy/scrapy/core/http2/protocol.py", "private/tmp/repos/scrapy__scrapy/scrapy/core/http2/protocol.py"]}, "metadata": {"anchor": "dataReceived", "anchor_file": "private/tmp/repos/scrapy__scrapy/scrapy/core/http2/protocol.py", "anchor_source": "def dataReceived(self, data: bytes) -> None:\n # Reset the idle timeout as connection is still actively receiving data\n self.resetTimeout()\n\n try:\n self._check_received_data(data)\n events = self.conn.receive_data(data)\n self._handle_events(events)\n except H2Error as e:\n if isinstance(e, FrameTooLargeError):\n # hyper-h2 does not drop the connection in this scenario, we\n # need to abort the connection manually.\n self._conn_lost_errors += [e]\n assert self.transport is not None # typing\n self.transport.abortConnection()\n return\n\n # Save this error as ultimately the connection will be dropped\n # internally by hyper-h2. Saved error will be passed to all the streams\n # closed with the connection.\n self._lose_connection_with_error([e])\n finally:\n self._write_to_transport()", "result_size": 4, "created_at": "2026-03-20T16:58:17.996583+00:00"}} {"sample_id": "immerjs__immer__handleInsertedValues__downstream__2hop_619ef8", "repo": "immerjs/immer", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["handleCrossReference"], "hop_1_files": ["private/tmp/repos/immerjs__immer/src/core/finalize.ts"], "hop_2": ["prepareCopy", "handleValue", "isDraftable", "crossReferenceCleanup", "updateDraftInParent", "nestedDraftCleanup"], "hop_2_files": ["private/tmp/repos/immerjs__immer/src/core/proxy.ts", "private/tmp/repos/immerjs__immer/src/core/finalize.ts", "private/tmp/repos/immerjs__immer/src/utils/common.ts", "private/tmp/repos/immerjs__immer/src/core/finalize.ts", "private/tmp/repos/immerjs__immer/src/core/finalize.ts", "private/tmp/repos/immerjs__immer/src/core/finalize.ts"]}, "metadata": {"anchor": "handleInsertedValues", "anchor_file": "private/tmp/repos/immerjs__immer/src/plugins/arrayMethods.ts", "anchor_source": "function handleInsertedValues(\n\t\tstate: ProxyArrayState,\n\t\tstartIndex: number,\n\t\tvalues: any[]\n\t) {\n\t\tfor (let i = 0; i < values.length; i++) {\n\t\t\tconst index = startIndex + i\n\t\t\tstate.assigned_!.set(index, true)\n\t\t\thandleCrossReference(state, index, values[i])\n\t\t}\n\t}", "result_size": 6, "created_at": "2026-03-20T16:58:16.801413+00:00"}} {"sample_id": "trpc__trpc__from__downstream__2hop_4d13aa", "repo": "trpc/trpc", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["isTRPCErrorResponse", "getMessageFromUnknownError", "isTRPCClientError", "TRPCClientError", "constructor"], "hop_1_files": ["private/tmp/repos/trpc__trpc/packages/client/src/TRPCClientError.ts", "private/tmp/repos/trpc__trpc/packages/client/src/TRPCClientError.ts", "private/tmp/repos/trpc__trpc/packages/client/src/TRPCClientError.ts", "private/tmp/repos/trpc__trpc/packages/client/src/TRPCClientError.ts", "private/tmp/repos/trpc__trpc/packages/client/src/TRPCClientError.ts"], "hop_2": ["isObject"], "hop_2_files": ["private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/utils.ts"]}, "metadata": {"anchor": "from", "anchor_file": "private/tmp/repos/trpc__trpc/packages/client/src/TRPCClientError.ts", "anchor_source": "public static from(\n _cause: Error | TRPCErrorResponse | object,\n opts: { meta?: Record; cause?: Error } = {},\n ): TRPCClientError {\n const cause = _cause as unknown;\n\n if (isTRPCClientError(cause)) {\n if (opts.meta) {\n // Decorate with meta error data\n cause.meta = {\n ...cause.meta,\n ...opts.meta,\n };\n }\n return cause;\n }\n if (isTRPCErrorResponse(cause)) {\n return new TRPCClientError(cause.error.message, {\n ...opts,\n result: cause,\n cause: opts.cause,\n });\n }\n return new TRPCClientError(\n getMessageFromUnknownError(cause, 'Unknown error'),\n {\n ...opts,\n cause: cause as any,\n },\n );\n }", "result_size": 1, "created_at": "2026-03-20T16:58:18.199328+00:00"}} {"sample_id": "encode__httpx__handle_async_request__downstream__2hop_af88cc", "repo": "encode/httpx", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["aread"], "hop_1_files": ["private/tmp/repos/encode__httpx/httpx/_models.py"], "hop_2": ["ByteStream"], "hop_2_files": ["private/tmp/repos/encode__httpx/httpx/_content.py"]}, "metadata": {"anchor": "handle_async_request", "anchor_file": "private/tmp/repos/encode__httpx/httpx/_transports/mock.py", "anchor_source": "async def handle_async_request(\n self,\n request: Request,\n ) -> Response:\n await request.aread()\n response = self.handler(request)\n\n # Allow handler to *optionally* be an `async` function.\n # If it is, then the `response` variable need to be awaited to actually\n # return the result.\n\n if not isinstance(response, Response):\n response = await response\n\n return response", "result_size": 1, "created_at": "2026-03-20T16:58:16.700579+00:00"}} {"sample_id": "rq__rq__enqueue_job__upstream__2hop_0a3935", "repo": "rq/rq", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["enqueue_call"], "hop_1_files": ["private/tmp/repos/rq__rq/rq/queue.py"], "hop_2": ["delay", "enqueue"], "hop_2_files": ["private/tmp/repos/rq__rq/rq/decorators.py", "private/tmp/repos/rq__rq/rq/queue.py"]}, "metadata": {"anchor": "enqueue_job", "anchor_file": "private/tmp/repos/rq__rq/rq/queue.py", "anchor_source": "def enqueue_job(self, job: 'Job', pipeline: Optional['Pipeline'] = None, at_front: bool = False) -> Job:\n \"\"\"Enqueues a job for delayed execution checking dependencies.\n\n Args:\n job (Job): The job to enqueue\n pipeline (Optional[Pipeline], optional): The Redis pipeline to use. Defaults to None.\n at_front (bool, optional): Whether should enqueue at the front of the queue. Defaults to False.\n\n Returns:\n Job: The enqueued job\n \"\"\"\n job.origin = self.name\n job = self.setup_dependencies(job, pipeline=pipeline)\n # Add Queue key set\n pipe = pipeline if pipeline is not None else self.connection.pipeline()\n pipe.sadd(self.redis_queues_keys, self.key)\n if pipeline is None:\n pipe.execute()\n # If we do not depend on an unfinished job, enqueue the job.\n if job.get_status(refresh=False) != JobStatus.DEFERRED:\n return self._enqueue_job(job, pipeline=pipeline, at_front=at_front)\n return job", "result_size": 2, "created_at": "2026-03-20T16:58:17.875204+00:00", "file_content": ""}} {"sample_id": "rq__rq__dependencies_are_met__upstream__1hop_b23910", "repo": "rq/rq", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["enqueue_dependents", "get_jobs_with_met_dependencies"], "call_files": ["private/tmp/repos/rq__rq/rq/queue.py", "private/tmp/repos/rq__rq/rq/dependency.py"]}, "metadata": {"anchor": "dependencies_are_met", "anchor_file": "private/tmp/repos/rq__rq/rq/job.py", "anchor_source": "def dependencies_are_met(\n self,\n parent_job: Optional['Job'] = None,\n pipeline: Optional['Pipeline'] = None,\n exclude_job_id: Optional[str] = None,\n refresh_job_status: bool = True,\n ) -> bool:\n \"\"\"Returns a boolean indicating if all of this job's dependencies are `FINISHED`\n\n If a pipeline is passed, all dependencies are WATCHed.\n\n `parent_job` allows us to directly pass parent_job for the status check.\n This is useful when enqueueing the dependents of a _successful_ job -- that status of\n `FINISHED` may not be yet set in redis, but said job is indeed _done_ and this\n method is _called_ in the _stack_ of its dependents are being enqueued.\n\n Args:\n parent_job (Optional[Job], optional): The parent Job. Defaults to None.\n pipeline (Optional[Pipeline], optional): The Redis' pipeline. Defaults to None.\n exclude_job_id (Optional[str], optional): Whether to exclude the job id. Defaults to None.\n refresh_job_status (bool): whether to refresh job status when checking for dependencies. Defaults to True.\n\n Returns:\n are_met (bool): Whether the dependencies were met.\n \"\"\"\n connection = pipeline if pipeline is not None else self.connection\n\n if pipeline is not None:\n connection.watch(*[self.key_for(dependency_id) for dependency_id in self._dependency_ids])\n\n dependencies_ids = {_id.decode() for _id in connection.smembers(self.dependencies_key)}\n\n if exclude_job_id:\n dependencies_ids.discard(exclude_job_id)\n if parent_job and parent_job.id == exclude_job_id:\n parent_job = None\n\n if parent_job:\n # If parent job is canceled, treat dependency as failed\n # If parent job is not finished, we should only continue\n # if this job allows parent job to fail\n dependencies_ids.discard(parent_job.id)\n parent_status = parent_job.get_status(refresh=refresh_job_status)\n self.log.debug(\n 'Job %s parent job %s status: %s, allow_dependency_failures: %s',\n self.id,\n parent_job.id,\n parent_status,\n self.allow_dependency_failures,\n )\n\n if parent_status in (JobStatus.CANCELED, JobStatus.STOPPED):\n return False\n elif parent_status == JobStatus.FAILED and not self.allow_dependency_failures:\n return False\n\n # If the only dependency is parent job, dependency has been met\n if not dependencies_ids:\n return True\n\n with connection.pipeline() as pipeline:\n for key in dependencies_ids:\n pipeline.hget(self.key_for(key), 'status')\n\n dependencies_statuses = pipeline.execute()\n\n allowed_statuses = [JobStatus.FINISHED]\n if self.allow_dependency_failures:\n allowed_statuses.append(JobStatus.FAILED)\n\n return all(status.decode() in allowed_statuses for status in dependencies_statuses if status)", "result_size": 2, "created_at": "2026-03-20T16:58:17.875204+00:00", "file_content": ""}} {"sample_id": "rq__rq__heartbeat__upstream__1hop_de1022", "repo": "rq/rq", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["dequeue_job_and_maintain_ttl", "work", "prepare_job_execution", "monitor_work_horse", "maintain_heartbeats"], "call_files": ["private/tmp/repos/rq__rq/rq/worker/base.py", "private/tmp/repos/rq__rq/rq/worker/base.py", "private/tmp/repos/rq__rq/rq/worker/base.py", "private/tmp/repos/rq__rq/rq/worker/worker_classes.py", "private/tmp/repos/rq__rq/rq/worker/base.py"]}, "metadata": {"anchor": "heartbeat", "anchor_file": "private/tmp/repos/rq__rq/rq/worker/base.py", "anchor_source": "def heartbeat(self, timeout: Optional[int] = None, pipeline: Optional['Pipeline'] = None):\n \"\"\"Specifies a new worker timeout, typically by extending the\n expiration time of the worker, effectively making this a \"heartbeat\"\n to not expire the worker until the timeout passes.\n\n The next heartbeat should come before this time, or the worker will\n die (at least from the monitoring dashboards).\n\n If no timeout is given, the worker_ttl will be used to update\n the expiration time of the worker.\n\n Args:\n timeout (Optional[int]): Timeout\n pipeline (Optional[Redis]): A Redis pipeline\n \"\"\"\n timeout = timeout or self.worker_ttl + 60\n connection: Union[Redis, Pipeline] = pipeline if pipeline is not None else self.connection\n connection.expire(self.key, timeout)\n connection.hset(self.key, 'last_heartbeat', utcformat(now()))\n self.log.debug(\n 'Worker %s: sent heartbeat to prevent worker timeout. Next one should arrive in %s seconds.',\n self.name,\n timeout,\n )", "result_size": 5, "created_at": "2026-03-20T16:58:17.875204+00:00", "file_content": ""}} {"sample_id": "encode__httpx__iter_bytes__upstream__1hop_13a022", "repo": "encode/httpx", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["read", "download_response", "iter_text"], "call_files": ["private/tmp/repos/encode__httpx/httpx/_models.py", "private/tmp/repos/encode__httpx/httpx/_main.py", "private/tmp/repos/encode__httpx/httpx/_models.py"]}, "metadata": {"anchor": "iter_bytes", "anchor_file": "private/tmp/repos/encode__httpx/httpx/_models.py", "anchor_source": "def iter_bytes(self, chunk_size: int | None = None) -> typing.Iterator[bytes]:\n \"\"\"\n A byte-iterator over the decoded response content.\n This allows us to handle gzip, deflate, brotli, and zstd encoded responses.\n \"\"\"\n if hasattr(self, \"_content\"):\n chunk_size = len(self._content) if chunk_size is None else chunk_size\n for i in range(0, len(self._content), max(chunk_size, 1)):\n yield self._content[i : i + chunk_size]\n else:\n decoder = self._get_content_decoder()\n chunker = ByteChunker(chunk_size=chunk_size)\n with request_context(request=self._request):\n for raw_bytes in self.iter_raw():\n decoded = decoder.decode(raw_bytes)\n for chunk in chunker.decode(decoded):\n yield chunk\n decoded = decoder.flush()\n for chunk in chunker.decode(decoded):\n yield chunk # pragma: no cover\n for chunk in chunker.flush():\n yield chunk", "result_size": 3, "created_at": "2026-03-20T16:58:16.700579+00:00", "file_content": ""}} {"sample_id": "sindresorhus__got__hooks__downstream__2hop_a27a78", "repo": "sindresorhus/got", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["hooks"], "hop_1_files": ["private/tmp/repos/got/source/core/options.ts"], "hop_2": ["assertAny"], "hop_2_files": ["private/tmp/repos/got/source/core/options.ts"]}, "metadata": {"anchor": "hooks", "anchor_file": "private/tmp/repos/got/source/core/options.ts", "anchor_source": "get hooks(): Hooks {\n\t\treturn this.#internals.hooks;\n\t}", "result_size": 1, "created_at": "2026-03-20T16:58:18.104721+00:00"}} {"sample_id": "node-fetch__node-fetch__clone__downstream__2hop_a633bc", "repo": "node-fetch/node-fetch", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["constructor", "Request"], "hop_1_files": ["private/tmp/repos/node-fetch__node-fetch/src/request.js", "private/tmp/repos/node-fetch__node-fetch/src/request.js"], "hop_2": ["constructor", "Body", "Headers"], "hop_2_files": ["private/tmp/repos/node-fetch__node-fetch/src/headers.js", "private/tmp/repos/node-fetch__node-fetch/src/body.js", "private/tmp/repos/node-fetch__node-fetch/src/headers.js"]}, "metadata": {"anchor": "clone", "anchor_file": "private/tmp/repos/node-fetch__node-fetch/src/request.js", "anchor_source": "clone() {\n\t\treturn new Request(this);\n\t}", "result_size": 5, "created_at": "2026-03-20T16:58:17.058449+00:00"}} {"sample_id": "trpc__trpc__unwrapLazyArg__upstream__1hop_278c28", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["trpcMutationOptions", "trpcQueryOptions", "createTRPCOptionsProxy"], "call_files": ["private/tmp/repos/trpc__trpc/packages/tanstack-react-query/src/internals/mutationOptions.ts", "private/tmp/repos/trpc__trpc/packages/tanstack-react-query/src/internals/queryOptions.ts", "private/tmp/repos/trpc__trpc/packages/tanstack-react-query/src/internals/createOptionsProxy.ts"]}, "metadata": {"anchor": "unwrapLazyArg", "anchor_file": "private/tmp/repos/trpc__trpc/packages/tanstack-react-query/src/internals/utils.ts", "anchor_source": "export function unwrapLazyArg(valueOrLazy: T | (() => T)): T {\n return (isFunction(valueOrLazy) ? valueOrLazy() : valueOrLazy) as T;\n}", "result_size": 5, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "locustio__locust__get_stripped_report__downstream__2hop_f5dc08", "repo": "locustio/locust", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["reset", "serialize"], "hop_1_files": ["private/tmp/repos/locustio__locust/locust/stats.py", "private/tmp/repos/locustio__locust/locust/stats.py"], "hop_2": ["_cache_response_times"], "hop_2_files": ["private/tmp/repos/locustio__locust/locust/stats.py"]}, "metadata": {"anchor": "get_stripped_report", "anchor_file": "private/tmp/repos/locustio__locust/locust/stats.py", "anchor_source": "def get_stripped_report(self) -> StatsEntryDict:\n \"\"\"\n Return the serialized version of this StatsEntry, and then clear the current stats.\n \"\"\"\n report = self.serialize()\n self.reset()\n return report", "result_size": 1, "created_at": "2026-03-20T16:58:16.951273+00:00"}} {"sample_id": "trpc__trpc__createDeferred__upstream__2hop_71a569", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["jsonlStreamConsumer", "write", "initIterable", "mergeAsyncIterables"], "hop_1_files": ["private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/jsonl.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/jsonl.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/utils/mergeAsyncIterables.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/utils/mergeAsyncIterables.ts"], "hop_2": ["add", "fetch", "httpBatchStreamLink", "transform"], "hop_2_files": ["private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/utils/mergeAsyncIterables.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/httpBatchStreamLink.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/httpBatchStreamLink.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/jsonl.ts"]}, "metadata": {"anchor": "createDeferred", "anchor_file": "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/utils/createDeferred.ts", "anchor_source": "export function createDeferred() {\n let resolve: (value: TValue) => void;\n let reject: (error: unknown) => void;\n const promise = new Promise((res, rej) => {\n resolve = res;\n reject = rej;\n });\n\n return { promise, resolve: resolve!, reject: reject! };\n}", "result_size": 7, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "psf__requests__prepare_request__upstream__2hop_e78bea", "repo": "psf/requests", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["request"], "hop_1_files": ["private/tmp/repos/requests/src/requests/sessions.py"], "hop_2": ["delete", "get", "head", "patch", "put", "request", "post", "options"], "hop_2_files": ["private/tmp/repos/requests/src/requests/sessions.py", "private/tmp/repos/requests/src/requests/sessions.py", "private/tmp/repos/requests/src/requests/sessions.py", "private/tmp/repos/requests/src/requests/sessions.py", "private/tmp/repos/requests/src/requests/sessions.py", "private/tmp/repos/requests/src/requests/api.py", "private/tmp/repos/requests/src/requests/sessions.py", "private/tmp/repos/requests/src/requests/sessions.py"]}, "metadata": {"anchor": "prepare_request", "anchor_file": "private/tmp/repos/requests/src/requests/sessions.py", "anchor_source": "def prepare_request(self, request):\n \"\"\"Constructs a :class:`PreparedRequest ` for\n transmission and returns it. The :class:`PreparedRequest` has settings\n merged from the :class:`Request ` instance and those of the\n :class:`Session`.\n\n :param request: :class:`Request` instance to prepare with this\n session's settings.\n :rtype: requests.PreparedRequest\n \"\"\"\n cookies = request.cookies or {}\n\n # Bootstrap CookieJar.\n if not isinstance(cookies, cookielib.CookieJar):\n cookies = cookiejar_from_dict(cookies)\n\n # Merge with session cookies\n merged_cookies = merge_cookies(\n merge_cookies(RequestsCookieJar(), self.cookies), cookies\n )\n\n # Set environment's basic authentication if not explicitly set.\n auth = request.auth\n if self.trust_env and not auth and not self.auth:\n auth = get_netrc_auth(request.url)\n\n p = PreparedRequest()\n p.prepare(\n method=request.method.upper(),\n url=request.url,\n files=request.files,\n data=request.data,\n json=request.json,\n headers=merge_setting(\n request.headers, self.headers, dict_class=CaseInsensitiveDict\n ),\n params=merge_setting(request.params, self.params),\n auth=merge_setting(auth, self.auth),\n cookies=merged_cookies,\n hooks=merge_hooks(request.hooks, self.hooks),\n )\n return p", "result_size": 8, "created_at": "2026-03-20T16:58:17.570287+00:00", "file_content": "\"\"\"\nrequests.sessions\n~~~~~~~~~~~~~~~~~\n\nThis module provides a Session object to manage and persist settings across\nrequests (cookies, auth, proxies).\n\"\"\"\n\nimport os\nimport sys\nimport time\nfrom collections import OrderedDict\nfrom datetime import timedelta\n\nfrom ._internal_utils import to_native_string\nfrom .adapters import HTTPAdapter\nfrom .auth import _basic_auth_str\nfrom .compat import Mapping, cookielib, urljoin, urlparse\nfrom .cookies import (\n RequestsCookieJar,\n cookiejar_from_dict,\n extract_cookies_to_jar,\n merge_cookies,\n)\nfrom .exceptions import (\n ChunkedEncodingError,\n ContentDecodingError,\n InvalidSchema,\n TooManyRedirects,\n)\nfrom .hooks import default_hooks, dispatch_hook\n\n# formerly defined here, reexposed here for backward compatibility\nfrom .models import ( # noqa: F401\n DEFAULT_REDIRECT_LIMIT,\n REDIRECT_STATI,\n PreparedRequest,\n Request,\n)\nfrom .status_codes import codes\nfrom .structures import CaseInsensitiveDict\nfrom .utils import ( # noqa: F401\n DEFAULT_PORTS,\n default_headers,\n get_auth_from_url,\n get_environ_proxies,\n get_netrc_auth,\n requote_uri,\n resolve_proxies,\n rewind_body,\n should_bypass_proxies,\n to_key_val_list,\n)\n\n# Preferred clock, based on which one is more accurate on a given system.\nif sys.platform == \"win32\":\n preferred_clock = time.perf_counter\nelse:\n preferred_clock = time.time\n\n\ndef merge_setting(request_setting, session_setting, dict_class=OrderedDict):\n \"\"\"Determines appropriate setting for a given request, taking into account\n the explicit setting on that request, and the setting in the session. If a\n setting is a dictionary, they will be merged together using `dict_class`\n \"\"\"\n\n if session_setting is None:\n return request_setting\n\n if request_setting is None:\n return session_setting\n\n # Bypass if not a dictionary (e.g. verify)\n if not (\n isinstance(session_setting, Mapping) and isinstance(request_setting, Mapping)\n ):\n return request_setting\n\n merged_setting = dict_class(to_key_val_list(session_setting))\n merged_setting.update(to_key_val_list(request_setting))\n\n # Remove keys that are set to None. Extract keys first to avoid altering\n # the dictionary during iteration.\n none_keys = [k for (k, v) in merged_setting.items() if v is None]\n for key in none_keys:\n del merged_setting[key]\n\n return merged_setting\n\n\ndef merge_hooks(request_hooks, session_hooks, dict_class=OrderedDict):\n \"\"\"Properly merges both requests and session hooks.\n\n This is necessary because when request_hooks == {'response': []}, the\n merge breaks Session hooks entirely.\n \"\"\"\n if session_hooks is None or session_hooks.get(\"response\") == []:\n return request_hooks\n\n if request_hooks is None or request_hooks.get(\"response\") == []:\n return session_hooks\n\n return merge_setting(request_hooks, session_hooks, dict_class)\n\n\nclass SessionRedirectMixin:\n def get_redirect_target(self, resp):\n \"\"\"Receives a Response. Returns a redirect URI or ``None``\"\"\"\n # Due to the nature of how requests processes redirects this method will\n # be called at least once upon the original response and at least twice\n # on each subsequent redirect response (if any).\n # If a custom mixin is used to handle this logic, it may be advantageous\n # to cache the redirect location onto the response object as a private\n # attribute.\n if resp.is_redirect:\n location = resp.headers[\"location\"]\n # Currently the underlying http module on py3 decode headers\n # in latin1, but empirical evidence suggests that latin1 is very\n # rarely used with non-ASCII characters in HTTP headers.\n # It is more likely to get UTF8 header rather than latin1.\n # This causes incorrect handling of UTF8 encoded location headers.\n # To solve this, we re-encode the location in latin1.\n location = location.encode(\"latin1\")\n return to_native_string(location, \"utf8\")\n return None\n\n def should_strip_auth(self, old_url, new_url):\n \"\"\"Decide whether Authorization header should be removed when redirecting\"\"\"\n old_parsed = urlparse(old_url)\n new_parsed = urlparse(new_url)\n if old_parsed.hostname != new_parsed.hostname:\n return True\n # Special case: allow http -> https redirect when using the standard\n # ports. This isn't specified by RFC 7235, but is kept to avoid\n # breaking backwards compatibility with older versions of requests\n # that allowed any redirects on the same host.\n if (\n old_parsed.scheme == \"http\"\n and old_parsed.port in (80, None)\n and new_parsed.scheme == \"https\"\n and new_parsed.port in (443, None)\n ):\n return False\n\n # Handle default port usage corresponding to scheme.\n changed_port = old_parsed.port != new_parsed.port\n changed_scheme = old_parsed.scheme != new_parsed.scheme\n default_port = (DEFAULT_PORTS.get(old_parsed.scheme, None), None)\n if (\n not changed_scheme\n and old_parsed.port in default_port\n and new_parsed.port in default_port\n ):\n return False\n\n # Standard case: root URI must match\n return changed_port or changed_scheme\n\n def resolve_redirects(\n self,\n resp,\n req,\n stream=False,\n timeout=None,\n verify=True,\n cert=None,\n proxies=None,\n yield_requests=False,\n **adapter_kwargs,\n ):\n \"\"\"Receives a Response. Returns a generator of Responses or Requests.\"\"\"\n\n hist = [] # keep track of history\n\n url = self.get_redirect_target(resp)\n previous_fragment = urlparse(req.url).fragment\n while url:\n prepared_request = req.copy()\n\n # Update history and keep track of redirects.\n # resp.history must ignore the original request in this loop\n hist.append(resp)\n resp.history = hist[1:]\n\n try:\n resp.content # Consume socket so it can be released\n except (ChunkedEncodingError, ContentDecodingError, RuntimeError):\n resp.raw.read(decode_content=False)\n\n if len(resp.history) >= self.max_redirects:\n raise TooManyRedirects(\n f\"Exceeded {self.max_redirects} redirects.\", response=resp\n )\n\n # Release the connection back into the pool.\n resp.close()\n\n # Handle redirection without scheme (see: RFC 1808 Section 4)\n if url.startswith(\"//\"):\n parsed_rurl = urlparse(resp.url)\n url = \":\".join([to_native_string(parsed_rurl.scheme), url])\n\n # Normalize url case and attach previous fragment if needed (RFC 7231 7.1.2)\n parsed = urlparse(url)\n if parsed.fragment == \"\" and previous_fragment:\n parsed = parsed._replace(fragment=previous_fragment)\n elif parsed.fragment:\n previous_fragment = parsed.fragment\n url = parsed.geturl()\n\n # Facilitate relative 'location' headers, as allowed by RFC 7231.\n # (e.g. '/path/to/resource' instead of 'http://domain.tld/path/to/resource')\n # Compliant with RFC3986, we percent encode the url.\n if not parsed.netloc:\n url = urljoin(resp.url, requote_uri(url))\n else:\n url = requote_uri(url)\n\n prepared_request.url = to_native_string(url)\n\n self.rebuild_method(prepared_request, resp)\n\n # https://github.com/psf/requests/issues/1084\n if resp.status_code not in (\n codes.temporary_redirect,\n codes.permanent_redirect,\n ):\n \n# \u2026 (truncated at 8000 chars)"}} {"sample_id": "locustio__locust__get_worker_index__upstream__2hop_f3e2ee", "repo": "locustio/locust", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["quit", "handle_message"], "hop_1_files": ["private/tmp/repos/locustio__locust/locust/runners.py", "private/tmp/repos/locustio__locust/locust/runners.py"], "hop_2": ["on_quitting", "start_automatic_run", "stop_and_optionally_quit", "start", "client_listener", "main", "shutdown"], "hop_2_files": ["private/tmp/repos/locustio__locust/locust/runners.py", "private/tmp/repos/locustio__locust/locust/main.py", "private/tmp/repos/locustio__locust/locust/main.py", "private/tmp/repos/locustio__locust/locust/runners.py", "private/tmp/repos/locustio__locust/locust/runners.py", "private/tmp/repos/locustio__locust/locust/main.py", "private/tmp/repos/locustio__locust/locust/main.py"]}, "metadata": {"anchor": "get_worker_index", "anchor_file": "private/tmp/repos/locustio__locust/locust/runners.py", "anchor_source": "def get_worker_index(self, client_id):\n \"\"\"\n Get the worker index for the specified client ID;\n this is a deterministic 0-based ordinal number and guaranteed to not change\n while Master is alive.\n \"\"\"\n if client_id in self.worker_indexes:\n return self.worker_indexes[client_id]\n index = self.worker_index_max\n self.worker_indexes[client_id] = index\n self.worker_index_max += 1\n return index", "result_size": 7, "created_at": "2026-03-20T16:58:16.951273+00:00", "file_content": ""}} {"sample_id": "trpc__trpc__isFunction__upstream__2hop_d0f614", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["isPromise", "unwrapLazyArg", "createCallerFactory", "createCallerInner", "createCaller"], "hop_1_files": ["private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/jsonl.ts", "private/tmp/repos/trpc__trpc/packages/tanstack-react-query/src/internals/utils.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/router.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/router.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/router.ts"], "hop_2": ["trpcMutationOptions", "trpcQueryOptions", "encodeAsync", "createTRPCOptionsProxy", "createBatchStreamProducer"], "hop_2_files": ["private/tmp/repos/trpc__trpc/packages/tanstack-react-query/src/internals/mutationOptions.ts", "private/tmp/repos/trpc__trpc/packages/tanstack-react-query/src/internals/queryOptions.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/jsonl.ts", "private/tmp/repos/trpc__trpc/packages/tanstack-react-query/src/internals/createOptionsProxy.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/jsonl.ts"]}, "metadata": {"anchor": "isFunction", "anchor_file": "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/utils.ts", "anchor_source": "export function isFunction(fn: unknown): fn is AnyFn {\n return typeof fn === 'function';\n}", "result_size": 7, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "psf__requests__get_full_url__downstream__1hop_9fc316", "repo": "psf/requests", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["to_native_string"], "call_files": ["private/tmp/repos/requests/src/requests/_internal_utils.py"]}, "metadata": {"anchor": "get_full_url", "anchor_file": "private/tmp/repos/requests/src/requests/cookies.py", "anchor_source": "def get_full_url(self):\n # Only return the response's URL if the user hadn't set the Host\n # header\n if not self._r.headers.get(\"Host\"):\n return self._r.url\n # If they did set it, retrieve it and reconstruct the expected domain\n host = to_native_string(self._r.headers[\"Host\"], encoding=\"utf-8\")\n parsed = urlparse(self._r.url)\n # Reconstruct the URL as we expect it\n return urlunparse(\n [\n parsed.scheme,\n host,\n parsed.path,\n parsed.params,\n parsed.query,\n parsed.fragment,\n ]\n )", "result_size": 1, "created_at": "2026-03-20T16:58:17.570287+00:00"}} {"sample_id": "rq__rq__handle_job_success__upstream__2hop_c60850", "repo": "rq/rq", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["perform_job"], "hop_1_files": ["private/tmp/repos/rq__rq/rq/worker/base.py"], "hop_2": ["execute_job", "main_work_horse"], "hop_2_files": ["private/tmp/repos/rq__rq/rq/worker/worker_classes.py", "private/tmp/repos/rq__rq/rq/worker/base.py"]}, "metadata": {"anchor": "handle_job_success", "anchor_file": "private/tmp/repos/rq__rq/rq/worker/base.py", "anchor_source": "def handle_job_success(self, job: 'Job', queue: 'Queue', started_job_registry: StartedJobRegistry):\n \"\"\"Handles the successful execution of certain job.\n It will remove the job from the `StartedJobRegistry`, adding it to the `SuccessfulJobRegistry`,\n and run a few maintenance tasks including:\n - Resting the current job ID\n - Enqueue dependents\n - Incrementing the job count and working time\n - Handling of the job successful execution\n - If job.repeats_left > 0, it will be scheduled for the next execution.\n\n Runs within a loop with the `watch` method so that protects interactions\n with dependents keys.\n\n Args:\n job (Job): The job that was successful.\n queue (Queue): The queue\n started_job_registry (StartedJobRegistry): The started registry\n \"\"\"\n self.log.debug('Worker %s: handling successful execution of job %s', self.name, job.id)\n\n with self.connection.pipeline() as pipeline:\n while True:\n try:\n # if dependencies are inserted after enqueue_dependents\n # a WatchError is thrown by execute()\n pipeline.watch(job.dependents_key)\n # enqueue_dependents might call multi() on the pipeline\n self.log.debug('Worker %s: enqueueing dependents of job %s', self.name, job.id)\n queue.enqueue_dependents(job, pipeline=pipeline)\n\n if not pipeline.explicit_transaction:\n # enqueue_dependents didn't call multi after all!\n # We have to do it ourselves to make sure everything runs in a transaction\n self.log.debug('Worker %s: calling multi() on pipeline for job %s', self.name, job.id)\n pipeline.multi()\n\n self.increment_successful_job_count(pipeline=pipeline)\n self.increment_total_working_time(job.ended_at - job.started_at, pipeline) # type: ignore\n\n result_ttl = job.get_result_ttl(self.default_result_ttl)\n if result_ttl != 0:\n self.log.debug(\"Worker %s: saving job %s's successful execution result\", self.name, job.id)\n job._handle_success(result_ttl, pipeline=pipeline, worker_name=self.name)\n\n if job.repeats_left is not None and job.repeats_left > 0:\n from ..repeat import Repeat\n\n self.log.info(\n 'Worker %s: job %s scheduled to repeat (%s left)', self.name, job.id, job.repeats_left\n )\n Repeat.schedule(job, queue, pipeline=pipeline)\n else:\n job.cleanup(result_ttl, pipeline=pipeline, remove_from_queue=False)\n\n self.log.debug('Cleaning up execution of job %s', job.id)\n self.cleanup_execution(job, pipeline=pipeline)\n\n pipeline.execute()\n\n assert job.started_at\n assert job.ended_at\n time_taken = job.ended_at - job.started_at\n\n if self.log_job_description:\n self.log.info(\n 'Successfully completed %s job in %ss on worker %s', job.description, time_taken, self.name\n )\n else:\n self.log.info(\n 'Successfully completed job %s in %ss on worker %s', job.id, time_taken, self.name\n )\n\n self.log.debug('Worker %s: finished handling successful execution of job %s', self.name, job.id)\n break\n except redis.exceptions.WatchError:\n continue", "result_size": 2, "created_at": "2026-03-20T16:58:17.875204+00:00", "file_content": ""}} {"sample_id": "trpc__trpc__hasPendingRequests__upstream__2hop_5f5916", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["constructor", "reconnect"], "hop_1_files": ["private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/wsClient.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/wsClient.ts"], "hop_2": ["createWSClient", "setupWebSocketListeners", "open", "handleIncomingRequest"], "hop_2_files": ["private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/createWsClient.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/wsClient.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/wsClient.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/wsClient.ts"]}, "metadata": {"anchor": "hasPendingRequests", "anchor_file": "private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/requestManager.ts", "anchor_source": "public hasPendingRequests() {\n return this.getPendingRequests().length > 0;\n }", "result_size": 6, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "immerjs__immer__handleCrossReference__downstream__1hop_62ac87", "repo": "immerjs/immer", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["prepareCopy", "handleValue", "isDraftable", "crossReferenceCleanup", "updateDraftInParent", "nestedDraftCleanup"], "call_files": ["private/tmp/repos/immerjs__immer/src/core/proxy.ts", "private/tmp/repos/immerjs__immer/src/core/finalize.ts", "private/tmp/repos/immerjs__immer/src/utils/common.ts", "private/tmp/repos/immerjs__immer/src/core/finalize.ts", "private/tmp/repos/immerjs__immer/src/core/finalize.ts", "private/tmp/repos/immerjs__immer/src/core/finalize.ts"]}, "metadata": {"anchor": "handleCrossReference", "anchor_file": "private/tmp/repos/immerjs__immer/src/core/finalize.ts", "anchor_source": "export function handleCrossReference(\n\ttarget: ImmerState,\n\tkey: string | number | symbol,\n\tvalue: any\n) {\n\tconst {scope_} = target\n\t// Check if value is a draft from this scope\n\tif (isDraft(value)) {\n\t\tconst state: ImmerState = value[DRAFT_STATE]\n\t\tif (isSameScope(state, scope_)) {\n\t\t\t// Register callback to update this location when the draft finalizes\n\n\t\t\tstate.callbacks_.push(function crossReferenceCleanup() {\n\t\t\t\t// Update the target location with finalized value\n\t\t\t\tprepareCopy(target)\n\n\t\t\t\tconst finalizedValue = getFinalValue(state)\n\n\t\t\t\tupdateDraftInParent(target, value, finalizedValue, key)\n\t\t\t})\n\t\t}\n\t} else if (isDraftable(value)) {\n\t\t// Handle non-draft objects that might contain drafts\n\t\ttarget.callbacks_.push(function nestedDraftCleanup() {\n\t\t\tconst targetCopy = latest(target)\n\n\t\t\t// For Sets, check if value is still in the set\n\t\t\tif (target.type_ === ArchType.Set) {\n\t\t\t\tif (targetCopy.has(value)) {\n\t\t\t\t\t// Process the value to replace any nested drafts\n\t\t\t\t\thandleValue(value, scope_.handledSet_, scope_)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Maps/objects\n\t\t\t\tif (get(targetCopy, key, target.type_) === value) {\n\t\t\t\t\tif (\n\t\t\t\t\t\tscope_.drafts_.length > 1 &&\n\t\t\t\t\t\t((target as Exclude).assigned_!.get(key) ??\n\t\t\t\t\t\t\tfalse) === true &&\n\t\t\t\t\t\ttarget.copy_\n\t\t\t\t\t) {\n\t\t\t\t\t\t// This might be a non-draft value that has drafts\n\t\t\t\t\t\t// inside. We do need to recurse here to handle those.\n\t\t\t\t\t\thandleValue(\n\t\t\t\t\t\t\tget(target.copy_, key, target.type_),\n\t\t\t\t\t\t\tscope_.handledSet_,\n\t\t\t\t\t\t\tscope_\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n}", "result_size": 6, "created_at": "2026-03-20T16:58:16.801413+00:00"}} {"sample_id": "pytest-dev__pytest___opentestcase__downstream__2hop_cdad1b", "repo": "pytest-dev/pytest", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["node_reporter", "record_testreport"], "hop_1_files": ["private/tmp/repos/pytest-dev__pytest/src/_pytest/junitxml.py", "private/tmp/repos/pytest-dev__pytest/src/_pytest/junitxml.py"], "hop_2": ["_NodeReporter", "mangle_test_address", "bin_xml_escape"], "hop_2_files": ["private/tmp/repos/pytest-dev__pytest/src/_pytest/junitxml.py", "private/tmp/repos/pytest-dev__pytest/src/_pytest/junitxml.py", "private/tmp/repos/pytest-dev__pytest/src/_pytest/junitxml.py"]}, "metadata": {"anchor": "_opentestcase", "anchor_file": "private/tmp/repos/pytest-dev__pytest/src/_pytest/junitxml.py", "anchor_source": "def _opentestcase(self, report: TestReport) -> _NodeReporter:\n reporter = self.node_reporter(report)\n reporter.record_testreport(report)\n return reporter", "result_size": 3, "created_at": "2026-03-20T16:58:17.641689+00:00"}} {"sample_id": "trpc__trpc__getUntypedClient__upstream__1hop_0de9df", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["createUseProxy", "createServerSideHelpers", "createRootHooks", "createUtilityFunctions", "createTRPCOptionsProxy", "createUseQueries"], "call_files": ["private/tmp/repos/trpc__trpc/packages/next/src/app-dir/shared.ts", "private/tmp/repos/trpc__trpc/packages/react-query/src/server/ssgProxy.ts", "private/tmp/repos/trpc__trpc/packages/react-query/src/shared/hooks/createHooksInternal.tsx", "private/tmp/repos/trpc__trpc/packages/react-query/src/utils/createUtilityFunctions.ts", "private/tmp/repos/trpc__trpc/packages/tanstack-react-query/src/internals/createOptionsProxy.ts", "private/tmp/repos/trpc__trpc/packages/react-query/src/shared/proxy/useQueriesProxy.ts"]}, "metadata": {"anchor": "getUntypedClient", "anchor_file": "private/tmp/repos/trpc__trpc/packages/client/src/createTRPCClient.ts", "anchor_source": "export function getUntypedClient(\n client: TRPCClient,\n): TRPCUntypedClient {\n return client[untypedClientSymbol];\n}", "result_size": 8, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "trpc__trpc__generateCacheTag__upstream__1hop_b4ed48", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["experimental_nextHttpLink", "experimental_createTRPCNextAppDirServer", "experimental_nextCacheLink"], "call_files": ["private/tmp/repos/trpc__trpc/packages/next/src/app-dir/links/nextHttp.ts", "private/tmp/repos/trpc__trpc/packages/next/src/app-dir/server.ts", "private/tmp/repos/trpc__trpc/packages/next/src/app-dir/links/nextCache.ts"]}, "metadata": {"anchor": "generateCacheTag", "anchor_file": "private/tmp/repos/trpc__trpc/packages/next/src/app-dir/shared.ts", "anchor_source": "export function generateCacheTag(procedurePath: string, input: any) {\n return input\n ? `${procedurePath}?input=${JSON.stringify(input)}`\n : procedurePath;\n}", "result_size": 7, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "node-fetch__node-fetch__consumeBody__downstream__2hop_ef7771", "repo": "node-fetch/node-fetch", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["constructor", "FetchError"], "hop_1_files": ["private/tmp/repos/node-fetch__node-fetch/src/errors/fetch-error.js", "private/tmp/repos/node-fetch__node-fetch/src/errors/fetch-error.js"], "hop_2": ["FetchBaseError", "constructor"], "hop_2_files": ["private/tmp/repos/node-fetch__node-fetch/src/errors/base.js", "private/tmp/repos/node-fetch__node-fetch/src/errors/base.js"]}, "metadata": {"anchor": "consumeBody", "anchor_file": "private/tmp/repos/node-fetch__node-fetch/src/body.js", "anchor_source": "async function consumeBody(data) {\n\tif (data[INTERNALS].disturbed) {\n\t\tthrow new TypeError(`body used already for: ${data.url}`);\n\t}\n\n\tdata[INTERNALS].disturbed = true;\n\n\tif (data[INTERNALS].error) {\n\t\tthrow data[INTERNALS].error;\n\t}\n\n\tconst {body} = data;\n\n\t// Body is null\n\tif (body === null) {\n\t\treturn Buffer.alloc(0);\n\t}\n\n\t/* c8 ignore next 3 */\n\tif (!(body instanceof Stream)) {\n\t\treturn Buffer.alloc(0);\n\t}\n\n\t// Body is stream\n\t// get ready to actually consume the body\n\tconst accum = [];\n\tlet accumBytes = 0;\n\n\ttry {\n\t\tfor await (const chunk of body) {\n\t\t\tif (data.size > 0 && accumBytes + chunk.length > data.size) {\n\t\t\t\tconst error = new FetchError(`content size at ${data.url} over limit: ${data.size}`, 'max-size');\n\t\t\t\tbody.destroy(error);\n\t\t\t\tthrow error;\n\t\t\t}\n\n\t\t\taccumBytes += chunk.length;\n\t\t\taccum.push(chunk);\n\t\t}\n\t} catch (error) {\n\t\tconst error_ = error instanceof FetchBaseError ? error : new FetchError(`Invalid response body while trying to fetch ${data.url}: ${error.message}`, 'system', error);\n\t\tthrow error_;\n\t}\n\n\tif (body.readableEnded === true || body._readableState.ended === true) {\n\t\ttry {\n\t\t\tif (accum.every(c => typeof c === 'string')) {\n\t\t\t\treturn Buffer.from(accum.join(''));\n\t\t\t}\n\n\t\t\treturn Buffer.concat(accum, accumBytes);\n\t\t} catch (error) {\n\t\t\tthrow new FetchError(`Could not create Buffer from response body for ${data.url}: ${error.message}`, 'system', error);\n\t\t}\n\t} else {\n\t\tthrow new FetchError(`Premature close of server response while trying to fetch ${data.url}`);\n\t}\n}", "result_size": 2, "created_at": "2026-03-20T16:58:17.058449+00:00"}} {"sample_id": "rq__rq__retry__upstream__1hop_b366ad", "repo": "rq/rq", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["handle_job_failure", "cleanup"], "call_files": ["private/tmp/repos/rq__rq/rq/worker/base.py", "private/tmp/repos/rq__rq/rq/registry.py"]}, "metadata": {"anchor": "retry", "anchor_file": "private/tmp/repos/rq__rq/rq/job.py", "anchor_source": "def retry(self, queue: 'Queue', pipeline: 'Pipeline'):\n \"\"\"Should be called when a job was enqueued with queue.enqueue(retry=Retry(...)) raises an exception.\n\n Requeues or schedules the job for execution. If retry_interval was set,\n the job will be scheduled for later; otherwise it will be enqueued immediately.\n\n Args:\n queue (Queue): The queue to retry the job on\n pipeline (Pipeline): The Redis' pipeline to use\n \"\"\"\n retry_interval = self.get_retry_interval()\n assert self.retries_left\n self.retries_left = self.retries_left - 1\n if retry_interval:\n scheduled_datetime = now() + timedelta(seconds=retry_interval)\n self.set_status(JobStatus.SCHEDULED)\n queue.schedule_job(self, scheduled_datetime, pipeline=pipeline)\n self.log.info(\n 'Job %s: scheduled for retry at %s, %s remaining', self.id, scheduled_datetime, self.retries_left\n )\n else:\n queue._enqueue_job(self, pipeline=pipeline)\n self.log.info('Job %s: enqueued for retry, %s remaining', self.id, self.retries_left)", "result_size": 2, "created_at": "2026-03-20T16:58:17.875204+00:00", "file_content": ""}} {"sample_id": "pallets__jinja__import_string__upstream__1hop_5ff0ba", "repo": "pallets/jinja", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["babel_extract", "load_extensions"], "call_files": ["private/tmp/repos/pallets__jinja/src/jinja2/ext.py", "private/tmp/repos/pallets__jinja/src/jinja2/environment.py"]}, "metadata": {"anchor": "import_string", "anchor_file": "private/tmp/repos/pallets__jinja/src/jinja2/utils.py", "anchor_source": "def import_string(import_name: str, silent: bool = False) -> t.Any:\n \"\"\"Imports an object based on a string. This is useful if you want to\n use import paths as endpoints or something similar. An import path can\n be specified either in dotted notation (``xml.sax.saxutils.escape``)\n or with a colon as object delimiter (``xml.sax.saxutils:escape``).\n\n If the `silent` is True the return value will be `None` if the import\n fails.\n\n :return: imported object\n \"\"\"\n try:\n if \":\" in import_name:\n module, obj = import_name.split(\":\", 1)\n elif \".\" in import_name:\n module, _, obj = import_name.rpartition(\".\")\n else:\n return __import__(import_name)\n return getattr(__import__(module, None, None, [obj]), obj)\n except (ImportError, AttributeError):\n if not silent:\n raise", "result_size": 2, "created_at": "2026-03-20T16:58:17.229656+00:00", "file_content": ""}} {"sample_id": "trpc__trpc__timerResource__upstream__1hop_ab4544", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["withTimeout", "takeWithGrace", "withPing"], "call_files": ["private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/sse.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/utils/asyncIterable.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/utils/withPing.ts"]}, "metadata": {"anchor": "timerResource", "anchor_file": "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/utils/timerResource.ts", "anchor_source": "export function timerResource(ms: number) {\n let timer: ReturnType | null = null;\n\n return makeResource(\n {\n start() {\n if (timer) {\n throw new Error('Timer already started');\n }\n\n const promise = new Promise(\n (resolve) => {\n timer = setTimeout(() => resolve(disposablePromiseTimerResult), ms);\n },\n );\n return promise;\n },\n },\n () => {\n if (timer) {\n clearTimeout(timer);\n }\n },\n );\n}", "result_size": 3, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "colinhacks__zod__required__downstream__1hop_d8407b", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["assignProp", "shape", "mergeDefs"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/util.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/util.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/util.ts"]}, "metadata": {"anchor": "required", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/util.ts", "anchor_source": "export function required(\n Class: SchemaClass,\n schema: schemas.$ZodObject,\n mask: object | undefined\n): any {\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const oldShape = schema._zod.def.shape;\n const shape: Writeable = { ...oldShape };\n\n if (mask) {\n for (const key in mask) {\n if (!(key in shape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!(mask as any)[key]) continue;\n // overwrite with non-optional\n shape[key] = new Class({\n type: \"nonoptional\",\n innerType: oldShape[key]!,\n });\n }\n } else {\n for (const key in oldShape) {\n // overwrite with non-optional\n shape[key] = new Class({\n type: \"nonoptional\",\n innerType: oldShape[key]!,\n });\n }\n }\n\n assignProp(this, \"shape\", shape); // self-caching\n return shape;\n },\n });\n\n return clone(schema, def) as any;\n}", "result_size": 3, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "pallets__jinja__get_all__upstream__1hop_5028f4", "repo": "pallets/jinja", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["_dict_method_all", "_render", "f_all", "derived", "get_template_locals"], "call_files": ["private/tmp/repos/pallets__jinja/src/jinja2/runtime.py", "private/tmp/repos/pallets__jinja/src/jinja2/ext.py", "private/tmp/repos/pallets__jinja/src/jinja2/runtime.py", "private/tmp/repos/pallets__jinja/src/jinja2/runtime.py", "private/tmp/repos/pallets__jinja/src/jinja2/debug.py"]}, "metadata": {"anchor": "get_all", "anchor_file": "private/tmp/repos/pallets__jinja/src/jinja2/runtime.py", "anchor_source": "def get_all(self) -> dict[str, t.Any]:\n \"\"\"Return the complete context as dict including the exported\n variables. For optimizations reasons this might not return an\n actual copy so be careful with using it.\n \"\"\"\n if not self.vars:\n return self.parent\n if not self.parent:\n return self.vars\n return dict(self.parent, **self.vars)", "result_size": 5, "created_at": "2026-03-20T16:58:17.229656+00:00", "file_content": ""}} {"sample_id": "agronholm__apscheduler___deserialize_schedules__downstream__2hop_8266b2", "repo": "agronholm/apscheduler", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["unmarshal", "publish", "_convert_incoming_fire_times", "ScheduleDeserializationFailed"], "hop_1_files": ["private/tmp/repos/agronholm__apscheduler/src/apscheduler/_structures.py", "private/tmp/repos/agronholm__apscheduler/src/apscheduler/abc.py", "private/tmp/repos/agronholm__apscheduler/src/apscheduler/datastores/sqlalchemy.py", "private/tmp/repos/agronholm__apscheduler/src/apscheduler/_events.py"], "hop_2": ["deserialize"], "hop_2_files": ["private/tmp/repos/agronholm__apscheduler/src/apscheduler/abc.py"]}, "metadata": {"anchor": "_deserialize_schedules", "anchor_file": "private/tmp/repos/agronholm__apscheduler/src/apscheduler/datastores/sqlalchemy.py", "anchor_source": "async def _deserialize_schedules(self, result: Result) -> list[Schedule]:\n schedules: list[Schedule] = []\n for row in result:\n try:\n schedules.append(\n Schedule.unmarshal(\n self.serializer,\n self._convert_incoming_fire_times(row._asdict()),\n )\n )\n except SerializationError as exc:\n await self._event_broker.publish(\n ScheduleDeserializationFailed(schedule_id=row.id, exception=exc)\n )\n\n return schedules", "result_size": 1, "created_at": "2026-03-20T16:58:16.252821+00:00"}} {"sample_id": "colinhacks__zod___emoji__downstream__1hop_1bb239", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["normalizeParams"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/util.ts"]}, "metadata": {"anchor": "_emoji", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/api.ts", "anchor_source": "export function _emoji(\n Class: util.SchemaClass,\n params?: string | $ZodEmojiParams | $ZodCheckEmojiParams\n): T {\n return new Class({\n type: \"string\",\n format: \"emoji\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}", "result_size": 1, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "colinhacks__zod__safeParse__downstream__1hop_5cbe26", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["_parseSync"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"]}, "metadata": {"anchor": "safeParse", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "anchor_source": "safeParse(data: unknown, params?: util.InexactPartial): SafeParseReturnType {\n const ctx: ParseContext = {\n common: {\n issues: [],\n async: params?.async ?? false,\n contextualErrorMap: params?.errorMap,\n },\n path: params?.path || [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: getParsedType(data),\n };\n const result = this._parseSync({ data, path: ctx.path, parent: ctx });\n\n return handleResult(ctx, result);\n }", "result_size": 1, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "psf__requests__get_auth_from_url__upstream__1hop_f15312", "repo": "psf/requests", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["proxy_headers", "proxy_manager_for", "rebuild_proxies", "prepare_auth"], "call_files": ["private/tmp/repos/requests/src/requests/adapters.py", "private/tmp/repos/requests/src/requests/adapters.py", "private/tmp/repos/requests/src/requests/sessions.py", "private/tmp/repos/requests/src/requests/models.py"]}, "metadata": {"anchor": "get_auth_from_url", "anchor_file": "private/tmp/repos/requests/src/requests/utils.py", "anchor_source": "def get_auth_from_url(url):\n \"\"\"Given a url with authentication components, extract them into a tuple of\n username,password.\n\n :rtype: (str,str)\n \"\"\"\n parsed = urlparse(url)\n\n try:\n auth = (unquote(parsed.username), unquote(parsed.password))\n except (AttributeError, TypeError):\n auth = (\"\", \"\")\n\n return auth", "result_size": 4, "created_at": "2026-03-20T16:58:17.570287+00:00", "file_content": "\"\"\"\nrequests.utils\n~~~~~~~~~~~~~~\n\nThis module provides utility functions that are used within Requests\nthat are also useful for external consumption.\n\"\"\"\n\nimport codecs\nimport contextlib\nimport io\nimport os\nimport re\nimport socket\nimport struct\nimport sys\nimport tempfile\nimport warnings\nimport zipfile\nfrom collections import OrderedDict\n\nfrom urllib3.util import make_headers, parse_url\n\nfrom . import certs\nfrom .__version__ import __version__\n\n# to_native_string is unused here, but imported here for backwards compatibility\nfrom ._internal_utils import ( # noqa: F401\n _HEADER_VALIDATORS_BYTE,\n _HEADER_VALIDATORS_STR,\n HEADER_VALIDATORS,\n to_native_string,\n)\nfrom .compat import (\n Mapping,\n basestring,\n bytes,\n getproxies,\n getproxies_environment,\n integer_types,\n is_urllib3_1,\n proxy_bypass,\n proxy_bypass_environment,\n quote,\n str,\n unquote,\n urlparse,\n urlunparse,\n)\nfrom .compat import parse_http_list as _parse_list_header\nfrom .cookies import cookiejar_from_dict\nfrom .exceptions import (\n FileModeWarning,\n InvalidHeader,\n InvalidURL,\n UnrewindableBodyError,\n)\nfrom .structures import CaseInsensitiveDict\n\nNETRC_FILES = (\".netrc\", \"_netrc\")\n\nDEFAULT_CA_BUNDLE_PATH = certs.where()\n\nDEFAULT_PORTS = {\"http\": 80, \"https\": 443}\n\n# Ensure that ', ' is used to preserve previous delimiter behavior.\nDEFAULT_ACCEPT_ENCODING = \", \".join(\n re.split(r\",\\s*\", make_headers(accept_encoding=True)[\"accept-encoding\"])\n)\n\n\nif sys.platform == \"win32\":\n # provide a proxy_bypass version on Windows without DNS lookups\n\n def proxy_bypass_registry(host):\n try:\n import winreg\n except ImportError:\n return False\n\n try:\n internetSettings = winreg.OpenKey(\n winreg.HKEY_CURRENT_USER,\n r\"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\",\n )\n # ProxyEnable could be REG_SZ or REG_DWORD, normalizing it\n proxyEnable = int(winreg.QueryValueEx(internetSettings, \"ProxyEnable\")[0])\n # ProxyOverride is almost always a string\n proxyOverride = winreg.QueryValueEx(internetSettings, \"ProxyOverride\")[0]\n except (OSError, ValueError):\n return False\n if not proxyEnable or not proxyOverride:\n return False\n\n # make a check value list from the registry entry: replace the\n # '' string by the localhost entry and the corresponding\n # canonical entry.\n proxyOverride = proxyOverride.split(\";\")\n # filter out empty strings to avoid re.match return true in the following code.\n proxyOverride = filter(None, proxyOverride)\n # now check if we match one of the registry values.\n for test in proxyOverride:\n if test == \"\":\n if \".\" not in host:\n return True\n test = test.replace(\".\", r\"\\.\") # mask dots\n test = test.replace(\"*\", r\".*\") # change glob sequence\n test = test.replace(\"?\", r\".\") # change glob char\n if re.match(test, host, re.I):\n return True\n return False\n\n def proxy_bypass(host): # noqa\n \"\"\"Return True, if the host should be bypassed.\n\n Checks proxy settings gathered from the environment, if specified,\n or the registry.\n \"\"\"\n if getproxies_environment():\n return proxy_bypass_environment(host)\n else:\n return proxy_bypass_registry(host)\n\n\ndef dict_to_sequence(d):\n \"\"\"Returns an internal sequence dictionary update.\"\"\"\n\n if hasattr(d, \"items\"):\n d = d.items()\n\n return d\n\n\ndef super_len(o):\n total_length = None\n current_position = 0\n\n if not is_urllib3_1 and isinstance(o, str):\n # urllib3 2.x+ treats all strings as utf-8 instead\n # of latin-1 (iso-8859-1) like http.client.\n o = o.encode(\"utf-8\")\n\n if hasattr(o, \"__len__\"):\n total_length = len(o)\n\n elif hasattr(o, \"len\"):\n total_length = o.len\n\n elif hasattr(o, \"fileno\"):\n try:\n fileno = o.fileno()\n except (io.UnsupportedOperation, AttributeError):\n # AttributeError is a surprising exception, seeing as how we've just checked\n # that `hasattr(o, 'fileno')`. It happens for objects obtained via\n # `Tarfile.extractfile()`, per issue 5229.\n pass\n else:\n total_length = os.fstat(fileno).st_size\n\n # Having used fstat to determine the file length, we need to\n # confirm that this file was opened up in binary mode.\n if \"b\" not in o.mode:\n warnings.warn(\n (\n \"Requests has determined the content-length for this \"\n \"request using the binary size of the file: however, the \"\n \"file has been opened in text mode (i.e. without the 'b' \"\n \"flag in the mode). This may lead to an incorrect \"\n \"content-length. In Requests 3.0, support will be removed \"\n \"for files in text mode.\"\n ),\n FileModeWarning,\n )\n\n if hasattr(o, \"tell\"):\n try:\n current_position = o.tell()\n except OSError:\n # This can happen in some weird situations, such as when the file\n # is actually a special file descriptor like stdin. In this\n # instance, we don't know what the length is, so set it to zero and\n # let requests chunk it instead.\n if total_length is not None:\n current_position = total_length\n else:\n if hasattr(o, \"seek\") and total_length is None:\n # StringIO and BytesIO have seek but no usable fileno\n try:\n # seek to end of file\n o.seek(0, 2)\n total_length = o.tell()\n\n # seek back to current position to support\n # partially read file-like objects\n o.seek(current_position or 0)\n except OSError:\n total_length = 0\n\n if total_length is None:\n total_length = 0\n\n return max(0, total_length - current_position)\n\n\ndef get_netrc_auth(url, raise_errors=False):\n \"\"\"Returns the Requests tuple auth for a given url from netrc.\"\"\"\n\n netrc_file = os.environ.get(\"NETRC\")\n if netrc_file is not None:\n netrc_locations = (netrc_file,)\n else:\n netrc_locations = (f\"~/{f}\" for f in NETRC_FILES)\n\n try:\n from netrc import NetrcParseError, netrc\n\n netrc_path = None\n\n for f in netrc_locations:\n loc = os.path.expanduser(f)\n if os.path.exists(loc):\n netrc_path = loc\n break\n\n # Abort early if there isn't one.\n if netrc_path is None:\n return\n\n ri = urlparse(url)\n host = ri.hostname\n\n try:\n _netrc = netrc(netrc_path).authenticators(host)\n if _netrc and any(_netrc):\n # Return with login / password\n login_i = 0 if _netrc[0] else 1\n return (_netrc[login_i], _netrc[2])\n except (NetrcParseError, OSError):\n # If there was a parsing error or a permissions issue reading the file,\n # we'll just skip netrc auth unless explicitly asked to raise errors.\n if raise_errors:\n raise\n\n # App Engine hackiness.\n except (ImportError, AttributeError):\n pass\n\n\ndef guess_filename(obj):\n \"\"\"Tries to guess the filename of the given object.\"\"\"\n name = getattr(obj, \"name\", None)\n if name and isinstance(name, basestring) and name[0] != \"<\" and name[-1] != \">\":\n return os.path.basename(name)\n\n\ndef extract_zipped_paths(path):\n \"\"\"Replace nonexistent paths that look \n# \u2026 (truncated at 8000 chars)"}} {"sample_id": "colinhacks__zod___coercedBigint__downstream__1hop_b80083", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["normalizeParams"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/util.ts"]}, "metadata": {"anchor": "_coercedBigint", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/api.ts", "anchor_source": "export function _coercedBigint(\n Class: util.SchemaClass,\n params?: string | $ZodBigIntParams\n): T {\n return new Class({\n type: \"bigint\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}", "result_size": 1, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "rq__rq__fetch_job__upstream__2hop_2728be", "repo": "rq/rq", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["get_jobs", "cleanup"], "hop_1_files": ["private/tmp/repos/rq__rq/rq/queue.py", "private/tmp/repos/rq__rq/rq/intermediate_queue.py"], "hop_2": ["clean_intermediate_queue", "jobs", "clean_registries"], "hop_2_files": ["private/tmp/repos/rq__rq/rq/maintenance.py", "private/tmp/repos/rq__rq/rq/queue.py", "private/tmp/repos/rq__rq/rq/worker/base.py"]}, "metadata": {"anchor": "fetch_job", "anchor_file": "private/tmp/repos/rq__rq/rq/queue.py", "anchor_source": "def fetch_job(self, job_id: str) -> Optional['Job']:\n \"\"\"Fetch a single job by Job ID.\n If the job key is not found, will run the `remove` method, to exclude the key.\n If the job has the same name as as the current job origin, returns the Job\n\n Args:\n job_id (str): The Job ID\n\n Returns:\n job (Optional[Job]): The job if found\n \"\"\"\n try:\n job = self.job_class.fetch(job_id, connection=self.connection, serializer=self.serializer)\n except NoSuchJobError:\n self.remove(job_id)\n else:\n if job.origin == self.name:\n return job\n\n return None", "result_size": 3, "created_at": "2026-03-20T16:58:17.875204+00:00", "file_content": ""}} {"sample_id": "trpc__trpc__awsLambdaStreamingRequestHandler__downstream__1hop_407eff", "repo": "trpc/trpc", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["resolveResponse", "getPlanner"], "call_files": ["private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/http/resolveResponse.ts", "private/tmp/repos/trpc__trpc/packages/server/src/adapters/aws-lambda/getPlanner.ts"]}, "metadata": {"anchor": "awsLambdaStreamingRequestHandler", "anchor_file": "private/tmp/repos/trpc__trpc/packages/server/src/adapters/aws-lambda/index.ts", "anchor_source": "export function awsLambdaStreamingRequestHandler<\n TRouter extends AnyRouter,\n TEvent extends LambdaEvent,\n>(opts: AWSLambdaOptions): StreamifyHandler {\n return async (event, responseStream, context) => {\n const planner = getPlanner(event);\n\n const createContext: ResolveHTTPRequestOptionsContextFn = async (\n innerOpts,\n ) => {\n return await opts.createContext?.({ event, context, ...innerOpts });\n };\n\n const response = await resolveResponse({\n ...opts,\n createContext,\n req: planner.request,\n path: planner.path,\n error: null,\n onError(o) {\n opts?.onError?.({\n ...o,\n req: event,\n });\n },\n });\n\n await planner.toStream(response, responseStream);\n };\n}", "result_size": 2, "created_at": "2026-03-20T16:58:18.199328+00:00"}} {"sample_id": "rq__rq__save__upstream__1hop_96a212", "repo": "rq/rq", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["schedule", "setup_dependencies", "schedule_job", "_handle_success", "add", "enqueue_many", "requeue", "_prepare_for_queue"], "call_files": ["private/tmp/repos/rq__rq/rq/repeat.py", "private/tmp/repos/rq__rq/rq/queue.py", "private/tmp/repos/rq__rq/rq/queue.py", "private/tmp/repos/rq__rq/rq/job.py", "private/tmp/repos/rq__rq/rq/registry.py", "private/tmp/repos/rq__rq/rq/queue.py", "private/tmp/repos/rq__rq/rq/registry.py", "private/tmp/repos/rq__rq/rq/queue.py"]}, "metadata": {"anchor": "save", "anchor_file": "private/tmp/repos/rq__rq/rq/job.py", "anchor_source": "def save(self, pipeline: Optional['Pipeline'] = None, include_meta: bool = True, include_result: bool = True):\n \"\"\"Dumps the current job instance to its corresponding Redis key.\n\n Exclude saving the `meta` dictionary by setting\n `include_meta=False`. This is useful to prevent clobbering\n user metadata without an expensive `refresh()` call first.\n\n Redis key persistence may be altered by `cleanup()` method.\n\n Args:\n pipeline (Optional[Pipeline], optional): The Redis' pipeline to use. Defaults to None.\n include_meta (bool, optional): Whether to include the job's metadata. Defaults to True.\n include_result (bool, optional): Whether to include the job's result. Defaults to True.\n TODO: Remove this parameter in RQ 3.0 - results are now always saved to Redis streams.\n \"\"\"\n key = self.key\n connection = pipeline if pipeline is not None else self.connection\n\n mapping = self.to_dict(include_meta=include_meta, include_result=include_result)\n connection.hset(key, mapping=mapping)", "result_size": 8, "created_at": "2026-03-20T16:58:17.875204+00:00", "file_content": ""}} {"sample_id": "rq__rq__perform__upstream__2hop_fbf38b", "repo": "rq/rq", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["run_job", "perform_job"], "hop_1_files": ["private/tmp/repos/rq__rq/rq/queue.py", "private/tmp/repos/rq__rq/rq/worker/base.py"], "hop_2": ["run_sync", "execute_job", "main_work_horse"], "hop_2_files": ["private/tmp/repos/rq__rq/rq/queue.py", "private/tmp/repos/rq__rq/rq/worker/worker_classes.py", "private/tmp/repos/rq__rq/rq/worker/base.py"]}, "metadata": {"anchor": "perform", "anchor_file": "private/tmp/repos/rq__rq/rq/job.py", "anchor_source": "def perform(self) -> Any: # noqa\n \"\"\"The main execution method. Invokes the job function with the job arguments.\n This is the method that actually performs the job - it's what its called by the worker.\n\n Returns:\n result (Any): The job result\n \"\"\"\n self.connection.persist(self.key)\n _job_stack.push(self)\n try:\n self._result = self._execute()\n finally:\n assert self is _job_stack.pop()\n return self._result", "result_size": 3, "created_at": "2026-03-20T16:58:17.875204+00:00", "file_content": ""}} {"sample_id": "sindresorhus__got__stripUrlAuth__upstream__2hop_6e671e", "repo": "sindresorhus/got", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["constructor", "_onResponseBase"], "hop_1_files": ["private/tmp/repos/got/source/core/errors.ts", "private/tmp/repos/got/source/core/index.ts"], "hop_2": ["_onResponse", "asPromise"], "hop_2_files": ["private/tmp/repos/got/source/core/index.ts", "private/tmp/repos/got/source/as-promise/index.ts"]}, "metadata": {"anchor": "stripUrlAuth", "anchor_file": "private/tmp/repos/got/source/core/utils/strip-url-auth.ts", "anchor_source": "export default function stripUrlAuth(url: URL | string): string {\n\tconst sanitized = new URL(url);\n\tsanitized.username = '';\n\tsanitized.password = '';\n\treturn sanitized.toString();\n}", "result_size": 4, "created_at": "2026-03-20T16:58:18.104721+00:00", "file_content": "/*\nReturns the URL as a string with `username` and `password` stripped.\n*/\nexport default function stripUrlAuth(url: URL | string): string {\n\tconst sanitized = new URL(url);\n\tsanitized.username = '';\n\tsanitized.password = '';\n\treturn sanitized.toString();\n}\n"}} {"sample_id": "celery__celery__banner__downstream__1hop_66e214", "repo": "celery/celery", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["startup_info"], "call_files": ["private/tmp/repos/celery/celery/apps/beat.py"]}, "metadata": {"anchor": "banner", "anchor_file": "private/tmp/repos/celery/celery/apps/beat.py", "anchor_source": "def banner(self, service: beat.Service) -> str:\n c = self.colored\n return str(\n c.blue('__ ', c.magenta('-'),\n c.blue(' ... __ '), c.magenta('-'),\n c.blue(' _\\n'),\n c.reset(self.startup_info(service))),\n )", "result_size": 1, "created_at": "2026-03-20T16:58:16.326235+00:00"}} {"sample_id": "pytest-dev__pytest___get_flag_lookup__downstream__1hop_66cfa5", "repo": "pytest-dev/pytest", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["_get_number_flag", "_get_allow_unicode_flag", "_get_allow_bytes_flag"], "call_files": ["private/tmp/repos/pytest-dev__pytest/src/_pytest/doctest.py", "private/tmp/repos/pytest-dev__pytest/src/_pytest/doctest.py", "private/tmp/repos/pytest-dev__pytest/src/_pytest/doctest.py"]}, "metadata": {"anchor": "_get_flag_lookup", "anchor_file": "private/tmp/repos/pytest-dev__pytest/src/_pytest/doctest.py", "anchor_source": "def _get_flag_lookup() -> dict[str, int]:\n import doctest\n\n return dict(\n DONT_ACCEPT_TRUE_FOR_1=doctest.DONT_ACCEPT_TRUE_FOR_1,\n DONT_ACCEPT_BLANKLINE=doctest.DONT_ACCEPT_BLANKLINE,\n NORMALIZE_WHITESPACE=doctest.NORMALIZE_WHITESPACE,\n ELLIPSIS=doctest.ELLIPSIS,\n IGNORE_EXCEPTION_DETAIL=doctest.IGNORE_EXCEPTION_DETAIL,\n COMPARISON_FLAGS=doctest.COMPARISON_FLAGS,\n ALLOW_UNICODE=_get_allow_unicode_flag(),\n ALLOW_BYTES=_get_allow_bytes_flag(),\n NUMBER=_get_number_flag(),\n )", "result_size": 3, "created_at": "2026-03-20T16:58:17.641689+00:00"}} {"sample_id": "colinhacks__zod___parse__downstream__2hop_a7089e", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["_getInvalidInput", "addIssueToContext", "ParseStatus", "_getOrReturnCtx", "_getType", "assertNever", "dirty"], "hop_1_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/helpers/parseUtil.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/helpers/parseUtil.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/helpers/util.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/helpers/parseUtil.ts"], "hop_2": ["getErrorMap"], "hop_2_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/errors.ts"]}, "metadata": {"anchor": "_parse", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "anchor_source": "_parse(input: ParseInput): ParseReturnType {\n if (this._def.coerce) {\n try {\n input.data = BigInt(input.data);\n } catch {\n return this._getInvalidInput(input);\n }\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.bigint) {\n return this._getInvalidInput(input);\n }\n\n let ctx: undefined | ParseContext = undefined;\n const status = new ParseStatus();\n\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;\n if (tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n type: \"bigint\",\n minimum: check.value,\n inclusive: check.inclusive,\n message: check.message,\n });\n status.dirty();\n }\n } else if (check.kind === \"max\") {\n const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;\n if (tooBig) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n type: \"bigint\",\n maximum: check.value,\n inclusive: check.inclusive,\n message: check.message,\n });\n status.dirty();\n }\n } else if (check.kind === \"multipleOf\") {\n if (input.data % check.value !== BigInt(0)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.not_multiple_of,\n multipleOf: check.value,\n message: check.message,\n });\n status.dirty();\n }\n } else {\n util.assertNever(check);\n }\n }\n\n return { status: status.value, value: input.data };\n }", "result_size": 1, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "encode__httpx____setstate____downstream__1hop_b48f08", "repo": "encode/httpx", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["UnattachedStream"], "call_files": ["private/tmp/repos/encode__httpx/httpx/_content.py"]}, "metadata": {"anchor": "__setstate__", "anchor_file": "private/tmp/repos/encode__httpx/httpx/_models.py", "anchor_source": "def __setstate__(self, state: dict[str, typing.Any]) -> None:\n for name, value in state.items():\n setattr(self, name, value)\n self.extensions = {}\n self.stream = UnattachedStream()", "result_size": 1, "created_at": "2026-03-20T16:58:16.700579+00:00"}} {"sample_id": "colinhacks__zod__isObject__upstream__2hop_e5654d", "repo": "colinhacks/zod", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["parse", "isPlainObject"], "hop_1_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/schemas.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/util.ts"], "hop_2": ["safeExtend", "extend", "parse", "shallowClone", "mergeValues"], "hop_2_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/util.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/util.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/schemas.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/util.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/schemas.ts"]}, "metadata": {"anchor": "isObject", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/util.ts", "anchor_source": "export function isObject(data: any): data is Record {\n return typeof data === \"object\" && data !== null && !Array.isArray(data);\n}", "result_size": 6, "created_at": "2026-03-20T16:58:16.474869+00:00", "file_content": ""}} {"sample_id": "sindresorhus__got__flush__upstream__1hop_f08b6d", "repo": "sindresorhus/got", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["fn", "_beforeError", "asPromise"], "call_files": ["private/tmp/repos/got/benchmark/index.ts", "private/tmp/repos/got/source/core/index.ts", "private/tmp/repos/got/source/as-promise/index.ts"]}, "metadata": {"anchor": "flush", "anchor_file": "private/tmp/repos/got/source/core/index.ts", "anchor_source": "async flush() {\n\t\tif (this._flushed) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._flushed = true;\n\n\t\ttry {\n\t\t\tawait this._finalizeBody();\n\n\t\t\tif (this.destroyed) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tawait this._makeRequest();\n\n\t\t\tif (this.destroyed) {\n\t\t\t\tthis._request?.destroy();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Queued writes etc.\n\t\t\tfor (const job of this._jobs) {\n\t\t\t\tjob();\n\t\t\t}\n\n\t\t\t// Prevent memory leak\n\t\t\tthis._jobs.length = 0;\n\n\t\t\tthis._requestInitialized = true;\n\t\t} catch (error: unknown) {\n\t\t\tthis._beforeError(normalizeError(error));\n\t\t}\n\t}", "result_size": 7, "created_at": "2026-03-20T16:58:18.104721+00:00", "file_content": "import process from 'node:process';\nimport {Buffer} from 'node:buffer';\nimport {Duplex, type Readable} from 'node:stream';\nimport {addAbortListener} from 'node:events';\nimport http, {ServerResponse, type ClientRequest, type RequestOptions} from 'node:http';\nimport type {Socket} from 'node:net';\nimport {byteLength} from 'byte-counter';\nimport {chunk} from 'chunk-data';\nimport CacheableRequest, {\n\tCacheError as CacheableCacheError,\n\ttype CacheableRequestFunction,\n\ttype CacheableOptions,\n} from 'cacheable-request';\nimport decompressResponse from 'decompress-response';\nimport type {KeyvStoreAdapter} from 'keyv';\nimport type KeyvType from 'keyv';\nimport is, {isBuffer} from '@sindresorhus/is';\nimport type ResponseLike from 'responselike';\nimport timer, {type ClientRequestWithTimings, type Timings, type IncomingMessageWithTimings} from './utils/timer.js';\nimport getBodySize from './utils/get-body-size.js';\nimport proxyEvents from './utils/proxy-events.js';\nimport timedOut, {TimeoutError as TimedOutTimeoutError} from './timed-out.js';\nimport stripUrlAuth from './utils/strip-url-auth.js';\nimport WeakableMap from './utils/weakable-map.js';\nimport calculateRetryDelay from './calculate-retry-delay.js';\nimport Options, {\n\ttype PromiseCookieJar,\n\ttype NativeRequestOptions,\n\ttype RetryOptions,\n\ttype OptionsError,\n\ttype OptionsInit,\n\ttype NormalizedOptions,\n} from './options.js';\nimport {\n\tcacheDecodedBody,\n\tisResponseOk,\n\ttype PlainResponse,\n\ttype Response,\n} from './response.js';\nimport isClientRequest from './utils/is-client-request.js';\nimport isUnixSocketURL, {getUnixSocketPath} from './utils/is-unix-socket-url.js';\nimport {\n\tRequestError,\n\tReadError,\n\tMaxRedirectsError,\n\tHTTPError,\n\tTimeoutError,\n\tUploadError,\n\tCacheError,\n\tAbortError,\n} from './errors.js';\nimport {\n\tgenerateRequestId,\n\tpublishRequestCreate,\n\tpublishRequestStart,\n\tpublishResponseStart,\n\tpublishResponseEnd,\n\tpublishRetry,\n\tpublishError,\n\tpublishRedirect,\n} from './diagnostics-channel.js';\n\ntype Error = NodeJS.ErrnoException;\n\nexport type Progress = {\n\tpercent: number;\n\ttransferred: number;\n\ttotal?: number;\n};\n\nconst supportsBrotli = is.string(process.versions.brotli);\nconst supportsZstd = is.string(process.versions.zstd);\nconst isUtf8Encoding = (encoding?: BufferEncoding): boolean => encoding === undefined || encoding.toLowerCase().replace('-', '') === 'utf8';\nconst textEncoder = new TextEncoder();\nconst concatUint8Arrays = (chunks: readonly Uint8Array[]): Uint8Array => {\n\tlet totalLength = 0;\n\tfor (const chunk of chunks) {\n\t\ttotalLength += chunk.byteLength;\n\t}\n\n\tconst result = new Uint8Array(totalLength);\n\tlet offset = 0;\n\n\tfor (const chunk of chunks) {\n\t\tresult.set(chunk, offset);\n\t\toffset += chunk.byteLength;\n\t}\n\n\treturn result;\n};\n\nconst methodsWithoutBody: ReadonlySet = new Set(['GET', 'HEAD']);\n\nexport type GotEventFunction =\n\t/**\n\t`request` event to get the request object of the request.\n\n\t __Tip__: You can use `request` event to abort requests.\n\n\t@example\n\t```\n\timport got from 'got';\n\n\tgot.stream('https://github.com')\n\t\t.on('request', request => setTimeout(() => request.destroy(), 50));\n\t```\n\t*/\n\t((name: 'request', listener: (request: ClientRequest) => void) => T)\n\n\t/**\n\tThe `response` event to get the response object of the final request.\n\t*/\n\t& ((name: 'response', listener: (response: R) => void) => T)\n\n\t/**\n\tThe `redirect` event to get the response object of a redirect. The second argument is options for the next request to the redirect location.\n\t*/\n\t& ((name: 'redirect', listener: (response: R, nextOptions: N) => void) => T)\n\n\t/**\n\tProgress events for uploading (sending a request) and downloading (receiving a response).\n\tThe `progress` argument is an object like:\n\n\t```\n\t{\n\t\tpercent: 0.1,\n\t\ttransferred: 1024,\n\t\ttotal: 10240\n\t}\n\t```\n\n\tIf the `content-length` header is missing, `total` will be `undefined`.\n\n\t@example\n\t```\n\timport got from 'got';\n\n\tconst response = await got('https://sindresorhus.com')\n\t\t.on('downloadProgress', progress => {\n\t\t\t// Report download progress\n\t\t})\n\t\t.on('uploadProgress', progress => {\n\t\t\t// Report upload progress\n\t\t});\n\n\tconsole.log(response);\n\t```\n\t*/\n\t& ((name: 'uploadProgress' | 'downloadProgress', listener: (progress: Progress) => void) => T)\n\t/**\n\tTo enable retrying on a Got stream, it is required to have a `retry` handler attached.\n\n\tWhen this event is emitted, you should reset the stream you were writing to and prepare the body again.\n\n\tSee `got.options.retry` for more information.\n\t*/\n\t& ((name: 'retry', listener: (retryCount: number, error: RequestError, createRetryStream: (options?: OptionsInit) => Request) => void) => T);\n\nexport type RequestEvents = {\n\ton: GotEventFunction;\n\tonce: GotEventFunction;\n\toff: GotEventFunction;\n};\n\ntype StorageAdapter = KeyvStoreAdapter | KeyvType | Map;\n\nconst cacheableStore = new WeakableMap();\n\nconst redirectCodes: ReadonlySet = new Set([300, 301, 302, 303, 304, 307, 308]);\nconst transientWriteErrorCodes: ReadonlySet = new Set(['EPIPE', 'ECONNRESET']);\n\n// Track errors that have been processed by beforeError hooks to preserve custom error types\nconst errorsProcessedByHooks = new WeakSet();\n\nconst proxiedRequestEvents = [\n\t'socket',\n\t'connect',\n\t'continue',\n\t'information',\n\t'upgrade',\n] as const;\n\nconst noop = (): void => {};\n\nconst isTransientWriteError = (error: Error): boolean => {\n\tconst {code} = error;\n\treturn typeof code === 'string' && transientWriteErrorCodes.has(code);\n};\n\nconst normalizeError = (error: unknown): Error => {\n\tif (error instanceof globalThis.Error) {\n\t\treturn error;\n\t}\n\n\tif (is.object(error)) {\n\t\tconst errorLike = error as Partial;\n\t\tconst message = typeof errorLike.message === 'string' ? errorLike.message : 'Non-error object thrown';\n\t\tconst normalizedError = new globalThis.Error(message, {cause: error}) as Error & {code?: string; input?: string};\n\n\t\tif (typeof errorLike.stack === 'string') {\n\t\t\tnormalizedError.stack = errorLike.stack;\n\t\t}\n\n\t\tif (typeof errorLike.code === 'string') {\n\t\t\tnormalizedError.code = errorLike.code;\n\t\t}\n\n\t\tif (typeof errorLike.input === 'string') {\n\t\t\tnormalizedError.input = errorLike.input;\n\t\t}\n\n\t\treturn normalizedError;\n\t}\n\n\treturn new globalThis.Error(String(error));\n};\n\ntype UrlType = ConstructorParameters[0];\ntype OptionsType = ConstructorParameters[1];\ntype DefaultsType = ConstructorParameters[2];\nconst getSanitizedUrl = (options?: Options): string => options?.url ? stripUrlAuth(options.url) : '';\n\nexport default class Request extends Duplex implements RequestEvents {\n\t// @ts-expect-error - Ignoring for now.\n\toverride ['constructor']: typeof Request;\n\n\t_noPipe?: boolean;\n\n\t// @ts-expect-error https://github.com/microsoft/TypeScript/issues/9568\n\toptions: Options;\n\tresponse?: PlainResponse;\n\trequestUrl?: URL;\n\tredirectUrls: URL[] = [];\n\tretryCount = 0;\n\t_stopReading = false;\n\n\tdeclare private _requestOptions: NativeRequestOptions;\n\n\tprivate _stopRetry = noop;\n\tprivate _downloadedSize = 0;\n\tprivate _uploadedSize = 0;\n\tprivate readonly _pipedServerResponses = new Set();\n\tprivate _request?: ClientRequest;\n\tprivate _responseSize?: number;\n\tprivate _bodySize?: number;\n\tprivate _unproxyEvents = noop;\n\tprivate _isFromCache?: boolean;\n\tprivate _triggerRead = false;\n\tprivate readonly _jobs: Array<() => void> = [];\n\tprivate _cancelTimeouts = noop;\n\tprivate readonly _removeListeners = noop;\n\tprivate _nativeResponse?: IncomingMessageWithTimings;\n\tprivate _flushed = false;\n\tprivate _aborted = false;\n\tprivate _expectedContentLength?: number;\n\tprivate _compressedBytesCount?: number;\n\tprivate _skipRequestEndInFinal = false;\n\tprivate _incrementalBodyDecoder?: TextDecoder;\n\tprivate _incrementalDecodedBodyChunks: string[] = [];\n\tprivate readonly _requestId = generateRequestId();\n\n\t// We need thi\n# \u2026 (truncated at 8000 chars)"}} {"sample_id": "pallets__jinja__do_list__downstream__2hop_a4276c", "repo": "pallets/jinja", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["auto_to_list", "async_variant"], "hop_1_files": ["private/tmp/repos/pallets__jinja/src/jinja2/async_utils.py", "private/tmp/repos/pallets__jinja/src/jinja2/async_utils.py"], "hop_2": ["from_obj", "pass_eval_context", "is_async", "decorator"], "hop_2_files": ["private/tmp/repos/pallets__jinja/src/jinja2/utils.py", "private/tmp/repos/pallets__jinja/src/jinja2/utils.py", "private/tmp/repos/pallets__jinja/src/jinja2/async_utils.py", "private/tmp/repos/pallets__jinja/src/jinja2/async_utils.py"]}, "metadata": {"anchor": "do_list", "anchor_file": "private/tmp/repos/pallets__jinja/src/jinja2/filters.py", "anchor_source": "@async_variant(sync_do_list) # type: ignore\nasync def do_list(value: \"t.AsyncIterable[V] | t.Iterable[V]\") -> \"list[V]\":\n return await auto_to_list(value)", "result_size": 4, "created_at": "2026-03-20T16:58:17.229656+00:00"}} {"sample_id": "trpc__trpc__isObservable__upstream__1hop_c52492", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["resolveResponse", "getWSConnectionHandler", "handleRequest"], "call_files": ["private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/http/resolveResponse.ts", "private/tmp/repos/trpc__trpc/packages/server/src/adapters/ws.ts", "private/tmp/repos/trpc__trpc/packages/server/src/adapters/ws.ts"]}, "metadata": {"anchor": "isObservable", "anchor_file": "private/tmp/repos/trpc__trpc/packages/server/src/observable/observable.ts", "anchor_source": "export function isObservable(x: unknown): x is Observable {\n return typeof x === 'object' && x !== null && 'subscribe' in x;\n}", "result_size": 7, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "sindresorhus__got__headers__downstream__2hop_b1772f", "repo": "sindresorhus/got", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["#createHeadersProxy", "assertPlainObject", "headers"], "hop_1_files": ["private/tmp/repos/got/source/core/options.ts", "private/tmp/repos/got/source/core/options.ts", "private/tmp/repos/got/source/core/options.ts"], "hop_2": ["wrapAssertionWithContext"], "hop_2_files": ["private/tmp/repos/got/source/core/options.ts"]}, "metadata": {"anchor": "headers", "anchor_file": "private/tmp/repos/got/source/core/options.ts", "anchor_source": "set headers(value: Headers) {\n\t\tassertPlainObject('headers', value);\n\t\tconst normalizedHeaders = lowercaseKeys(value);\n\n\t\tif (this.#merging) {\n\t\t\tObject.assign(this.#internals.headers, normalizedHeaders);\n\t\t} else {\n\t\t\tthis.#internals.headers = normalizedHeaders;\n\t\t\tthis.#headersProxy = this.#createHeadersProxy();\n\t\t\tthis.#explicitHeaders.clear();\n\t\t}\n\n\t\tfor (const header of Object.keys(normalizedHeaders)) {\n\t\t\tthis.#explicitHeaders.add(header);\n\t\t}\n\t}", "result_size": 1, "created_at": "2026-03-20T16:58:18.104721+00:00"}} {"sample_id": "sindresorhus__got__stripUrlAuth__upstream__1hop_932827", "repo": "sindresorhus/got", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["constructor", "_onResponseBase"], "call_files": ["private/tmp/repos/got/source/core/errors.ts", "private/tmp/repos/got/source/core/index.ts"]}, "metadata": {"anchor": "stripUrlAuth", "anchor_file": "private/tmp/repos/got/source/core/utils/strip-url-auth.ts", "anchor_source": "export default function stripUrlAuth(url: URL | string): string {\n\tconst sanitized = new URL(url);\n\tsanitized.username = '';\n\tsanitized.password = '';\n\treturn sanitized.toString();\n}", "result_size": 3, "created_at": "2026-03-20T16:58:18.104721+00:00", "file_content": "/*\nReturns the URL as a string with `username` and `password` stripped.\n*/\nexport default function stripUrlAuth(url: URL | string): string {\n\tconst sanitized = new URL(url);\n\tsanitized.username = '';\n\tsanitized.password = '';\n\treturn sanitized.toString();\n}\n"}} {"sample_id": "rq__rq__prepare_job_execution__upstream__2hop_64ad94", "repo": "rq/rq", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["perform_job"], "hop_1_files": ["private/tmp/repos/rq__rq/rq/worker/base.py"], "hop_2": ["execute_job", "main_work_horse"], "hop_2_files": ["private/tmp/repos/rq__rq/rq/worker/worker_classes.py", "private/tmp/repos/rq__rq/rq/worker/base.py"]}, "metadata": {"anchor": "prepare_job_execution", "anchor_file": "private/tmp/repos/rq__rq/rq/worker/base.py", "anchor_source": "def prepare_job_execution(self, job: 'Job', remove_from_intermediate_queue: bool = False) -> None:\n \"\"\"Performs misc bookkeeping like updating states prior to\n job execution.\n \"\"\"\n self.log.debug('Worker %s: preparing for execution of job ID %s', self.name, job.id)\n with self.connection.pipeline() as pipeline:\n self.set_current_job_id(job.id, pipeline=pipeline)\n self.set_current_job_working_time(0, pipeline=pipeline)\n\n heartbeat_ttl = self.get_heartbeat_ttl(job)\n self.heartbeat(heartbeat_ttl, pipeline=pipeline)\n job.heartbeat(now(), heartbeat_ttl, pipeline=pipeline)\n\n job.prepare_for_execution(self.name, pipeline=pipeline)\n if remove_from_intermediate_queue:\n from ..queue import Queue\n\n queue = Queue(job.origin, connection=self.connection)\n pipeline.lrem(queue.intermediate_queue_key, 1, job.id)\n pipeline.execute()\n self.log.debug('Worker %s: job preparation finished.', self.name)\n\n msg = 'Processing {0} from {1} since {2}'\n self.procline(msg.format(job.func_name, job.origin, time.time()))", "result_size": 2, "created_at": "2026-03-20T16:58:17.875204+00:00", "file_content": ""}} {"sample_id": "colinhacks__zod__initializeContext__upstream__1hop_55110f", "repo": "colinhacks/zod", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["toJSONSchema", "constructor"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/json-schema-processors.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/json-schema-generator.ts"]}, "metadata": {"anchor": "initializeContext", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/to-json-schema.ts", "anchor_source": "export function initializeContext(params: JSONSchemaGeneratorParams): ToJSONSchemaContext {\n // Normalize target: convert old non-hyphenated versions to hyphenated versions\n let target: ToJSONSchemaContext[\"target\"] = params?.target ?? \"draft-2020-12\";\n if (target === \"draft-4\") target = \"draft-04\";\n if (target === \"draft-7\") target = \"draft-07\";\n\n return {\n processors: params.processors ?? {},\n metadataRegistry: params?.metadata ?? globalRegistry,\n target,\n unrepresentable: params?.unrepresentable ?? \"throw\",\n override: (params?.override as any) ?? (() => {}),\n io: params?.io ?? \"output\",\n counter: 0,\n seen: new Map(),\n cycles: params?.cycles ?? \"ref\",\n reused: params?.reused ?? \"inline\",\n external: params?.external ?? undefined,\n };\n}", "result_size": 3, "created_at": "2026-03-20T16:58:16.474869+00:00", "file_content": ""}} {"sample_id": "trpc__trpc__query__upstream__2hop_31bf06", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["fetchQuery", "fetchInfiniteQuery", "prefetchQuery", "queryFn", "createServerSideHelpers", "infiniteQueryOptions", "createUseQueries", "createUseProxy", "ensureQueryData", "queryOptions", "trpcQueryOptions", "query", "prefetchInfiniteQuery", "createUtilityFunctions", "trpcInfiniteQueryOptions"], "hop_1_files": ["private/tmp/repos/trpc__trpc/packages/react-query/src/utils/createUtilityFunctions.ts", "private/tmp/repos/trpc__trpc/packages/react-query/src/utils/createUtilityFunctions.ts", "private/tmp/repos/trpc__trpc/packages/react-query/src/utils/createUtilityFunctions.ts", "private/tmp/repos/trpc__trpc/packages/react-query/src/utils/createUtilityFunctions.ts", "private/tmp/repos/trpc__trpc/packages/react-query/src/server/ssgProxy.ts", "private/tmp/repos/trpc__trpc/packages/react-query/src/utils/createUtilityFunctions.ts", "private/tmp/repos/trpc__trpc/packages/react-query/src/shared/proxy/useQueriesProxy.ts", "private/tmp/repos/trpc__trpc/packages/next/src/app-dir/shared.ts", "private/tmp/repos/trpc__trpc/packages/react-query/src/utils/createUtilityFunctions.ts", "private/tmp/repos/trpc__trpc/packages/react-query/src/utils/createUtilityFunctions.ts", "private/tmp/repos/trpc__trpc/packages/tanstack-react-query/src/internals/queryOptions.ts", "private/tmp/repos/trpc__trpc/packages/react-query/src/server/ssgProxy.ts", "private/tmp/repos/trpc__trpc/packages/react-query/src/utils/createUtilityFunctions.ts", "private/tmp/repos/trpc__trpc/packages/react-query/src/utils/createUtilityFunctions.ts", "private/tmp/repos/trpc__trpc/packages/tanstack-react-query/src/internals/infiniteQueryOptions.ts"], "hop_2": ["_dehydrate", "createRootHooks", "createTRPCQueryUtils"], "hop_2_files": ["private/tmp/repos/trpc__trpc/packages/react-query/src/server/ssgProxy.ts", "private/tmp/repos/trpc__trpc/packages/react-query/src/shared/hooks/createHooksInternal.tsx", "private/tmp/repos/trpc__trpc/packages/react-query/src/createTRPCQueryUtils.tsx"]}, "metadata": {"anchor": "query", "anchor_file": "private/tmp/repos/trpc__trpc/packages/client/src/internals/TRPCUntypedClient.ts", "anchor_source": "public query(path: string, input?: unknown, opts?: TRPCRequestOptions) {\n return this.requestAsPromise({\n type: 'query',\n path,\n input,\n context: opts?.context,\n signal: opts?.signal,\n });\n }", "result_size": 5, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "immerjs__immer__scenario_sortById_reverse__downstream__2hop_e154ad", "repo": "immerjs/immer", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["createInitialState"], "hop_1_files": ["private/tmp/repos/immerjs__immer/perf-testing/immutability-profiling.mjs"], "hop_2": ["createLargeObject"], "hop_2_files": ["private/tmp/repos/immerjs__immer/perf-testing/immutability-profiling.mjs"]}, "metadata": {"anchor": "scenario_sortById_reverse", "anchor_file": "private/tmp/repos/immerjs__immer/perf-testing/immutability-profiling.mjs", "anchor_source": "function scenario_sortById_reverse() {\n\tconst initialState = createInitialState()\n\tfor (let j = 0; j < MAX; j++) {\n\t\timmerReducer(initialState, actions[\"sortById-reverse\"]())\n\t}\n}", "result_size": 1, "created_at": "2026-03-20T16:58:16.801413+00:00"}} {"sample_id": "colinhacks__zod___isoDateTime__upstream__2hop_a3017d", "repo": "colinhacks/zod", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["datetime"], "hop_1_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/iso.ts"], "hop_2": ["convertBaseSchema", "datetime"], "hop_2_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/from-json-schema.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/schemas.ts"]}, "metadata": {"anchor": "_isoDateTime", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/api.ts", "anchor_source": "export function _isoDateTime(\n Class: util.SchemaClass,\n params?: string | $ZodISODateTimeParams | $ZodCheckISODateTimeParams\n): T {\n return new Class({\n type: \"string\",\n format: \"datetime\",\n check: \"string_format\",\n offset: false,\n local: false,\n precision: null,\n ...util.normalizeParams(params),\n });\n}", "result_size": 3, "created_at": "2026-03-20T16:58:16.474869+00:00", "file_content": ""}} {"sample_id": "pallets__jinja__from_code__upstream__1hop_1eae1d", "repo": "pallets/jinja", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["load", "from_string"], "call_files": ["private/tmp/repos/pallets__jinja/src/jinja2/loaders.py", "private/tmp/repos/pallets__jinja/src/jinja2/environment.py"]}, "metadata": {"anchor": "from_code", "anchor_file": "private/tmp/repos/pallets__jinja/src/jinja2/environment.py", "anchor_source": "@classmethod\n def from_code(\n cls,\n environment: Environment,\n code: CodeType,\n globals: t.MutableMapping[str, t.Any],\n uptodate: t.Callable[[], bool] | None = None,\n ) -> \"Template\":\n \"\"\"Creates a template object from compiled code and the globals. This\n is used by the loaders and environment to create a template object.\n \"\"\"\n namespace = {\"environment\": environment, \"__file__\": code.co_filename}\n exec(code, namespace)\n rv = cls._from_namespace(environment, namespace, globals)\n rv._uptodate = uptodate\n return rv", "result_size": 2, "created_at": "2026-03-20T16:58:17.229656+00:00", "file_content": ""}} {"sample_id": "paramiko__paramiko__all___downstream__1hop_99c8c0", "repo": "paramiko/paramiko", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["publish_"], "call_files": ["private/tmp/repos/paramiko/tasks.py"]}, "metadata": {"anchor": "all_", "anchor_file": "private/tmp/repos/paramiko/tasks.py", "anchor_source": "@task(name=\"all\", default=True)\ndef all_(c, dry_run=False):\n release_coll[\"prepare\"](c, dry_run=dry_run)\n publish_(c, dry_run=dry_run)\n release_coll[\"push\"](c, dry_run=dry_run)", "result_size": 1, "created_at": "2026-03-20T16:58:17.364834+00:00"}} {"sample_id": "pallets__click__write_usage__downstream__2hop_52b244", "repo": "pallets/click", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["write", "term_len", "wrap_text"], "hop_1_files": ["private/tmp/repos/pallets__click/src/click/formatting.py", "private/tmp/repos/pallets__click/src/click/_compat.py", "private/tmp/repos/pallets__click/src/click/formatting.py"], "hop_2": ["TextWrapper", "extra_indent", "indent_only", "_flush_par", "strip_ansi"], "hop_2_files": ["private/tmp/repos/pallets__click/src/click/_textwrap.py", "private/tmp/repos/pallets__click/src/click/_textwrap.py", "private/tmp/repos/pallets__click/src/click/_textwrap.py", "private/tmp/repos/pallets__click/src/click/formatting.py", "private/tmp/repos/pallets__click/src/click/_compat.py"]}, "metadata": {"anchor": "write_usage", "anchor_file": "private/tmp/repos/pallets__click/src/click/formatting.py", "anchor_source": "def write_usage(self, prog: str, args: str = \"\", prefix: str | None = None) -> None:\n \"\"\"Writes a usage line into the buffer.\n\n :param prog: the program name.\n :param args: whitespace separated list of arguments.\n :param prefix: The prefix for the first line. Defaults to\n ``\"Usage: \"``.\n \"\"\"\n if prefix is None:\n prefix = f\"{_('Usage:')} \"\n\n usage_prefix = f\"{prefix:>{self.current_indent}}{prog} \"\n text_width = self.width - self.current_indent\n\n if text_width >= (term_len(usage_prefix) + 20):\n # The arguments will fit to the right of the prefix.\n indent = \" \" * term_len(usage_prefix)\n self.write(\n wrap_text(\n args,\n text_width,\n initial_indent=usage_prefix,\n subsequent_indent=indent,\n )\n )\n else:\n # The prefix is too long, put the arguments on the next line.\n self.write(usage_prefix)\n self.write(\"\\n\")\n indent = \" \" * (max(self.current_indent, term_len(prefix)) + 4)\n self.write(\n wrap_text(\n args, text_width, initial_indent=indent, subsequent_indent=indent\n )\n )\n\n self.write(\"\\n\")", "result_size": 5, "created_at": "2026-03-20T16:58:17.078639+00:00"}} {"sample_id": "colinhacks__zod__add__upstream__1hop_ac8ea0", "repo": "colinhacks/zod", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["describe", "convertSchema", "meta"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/schemas.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/from-json-schema.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/api.ts"]}, "metadata": {"anchor": "add", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/registries.ts", "anchor_source": "add(\n schema: S,\n ..._meta: undefined extends Meta ? [$replace?] : [$replace]\n ): this {\n const meta: any = _meta[0];\n this._map.set(schema, meta!);\n if (meta && typeof meta === \"object\" && \"id\" in meta) {\n this._idmap.set(meta.id!, schema);\n }\n return this as any;\n }", "result_size": 7, "created_at": "2026-03-20T16:58:16.474869+00:00", "file_content": ""}} {"sample_id": "colinhacks__zod___parseSync__downstream__1hop_6fbb41", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["_parse"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"]}, "metadata": {"anchor": "_parseSync", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "anchor_source": "_parseSync(input: ParseInput): SyncParseReturnType {\n const result = this._parse(input);\n if (isAsync(result)) {\n throw new Error(\"Synchronous parse encountered promise.\");\n }\n return result;\n }", "result_size": 1, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "immerjs__immer__prepareSetCopy__downstream__2hop_972f5e", "repo": "immerjs/immer", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["isDraftable", "createProxy"], "hop_1_files": ["private/tmp/repos/immerjs__immer/src/utils/common.ts", "private/tmp/repos/immerjs__immer/src/core/immerClass.ts"], "hop_2": ["isPlainObject", "createProxyProxy", "registerChildFinalizationCallback", "getPlugin", "rootDraftCleanup"], "hop_2_files": ["private/tmp/repos/immerjs__immer/src/utils/common.ts", "private/tmp/repos/immerjs__immer/src/core/proxy.ts", "private/tmp/repos/immerjs__immer/src/core/finalize.ts", "private/tmp/repos/immerjs__immer/src/utils/plugins.ts", "private/tmp/repos/immerjs__immer/src/core/immerClass.ts"]}, "metadata": {"anchor": "prepareSetCopy", "anchor_file": "private/tmp/repos/immerjs__immer/src/plugins/mapset.ts", "anchor_source": "function prepareSetCopy(state: SetState) {\n\t\tif (!state.copy_) {\n\t\t\t// create drafts for all entries to preserve insertion order\n\t\t\tstate.copy_ = new Set()\n\t\t\tstate.base_.forEach(value => {\n\t\t\t\tif (isDraftable(value)) {\n\t\t\t\t\tconst draft = createProxy(state.scope_, value, state, value)\n\t\t\t\t\tstate.drafts_.set(value, draft)\n\t\t\t\t\tstate.copy_!.add(draft)\n\t\t\t\t} else {\n\t\t\t\t\tstate.copy_!.add(value)\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t}", "result_size": 5, "created_at": "2026-03-20T16:58:16.801413+00:00"}} {"sample_id": "psf__black__do_transform__downstream__2hop_915f28", "repo": "psf/black", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["_merge_string_group", "CannotTransform", "_remove_backslash_line_continuation_chars"], "hop_1_files": ["private/tmp/repos/psf__black/src/black/trans.py", "private/tmp/repos/psf__black/src/black/trans.py", "private/tmp/repos/psf__black/src/black/trans.py"], "hop_2": ["is_valid_index_factory", "_validate_msg", "_merge_one_string_group"], "hop_2_files": ["private/tmp/repos/psf__black/src/black/trans.py", "private/tmp/repos/psf__black/src/black/trans.py", "private/tmp/repos/psf__black/src/black/trans.py"]}, "metadata": {"anchor": "do_transform", "anchor_file": "private/tmp/repos/psf__black/src/black/trans.py", "anchor_source": "def do_transform(\n self, line: Line, string_indices: list[int]\n ) -> Iterator[TResult[Line]]:\n new_line = line\n\n rblc_result = self._remove_backslash_line_continuation_chars(\n new_line, string_indices\n )\n if isinstance(rblc_result, Ok):\n new_line = rblc_result.ok()\n\n msg_result = self._merge_string_group(new_line, string_indices)\n if isinstance(msg_result, Ok):\n new_line = msg_result.ok()\n\n if isinstance(rblc_result, Err) and isinstance(msg_result, Err):\n msg_cant_transform = msg_result.err()\n rblc_cant_transform = rblc_result.err()\n cant_transform = CannotTransform(\n \"StringMerger failed to merge any strings in this line.\"\n )\n\n # Chain the errors together using `__cause__`.\n msg_cant_transform.__cause__ = rblc_cant_transform\n cant_transform.__cause__ = msg_cant_transform\n\n yield Err(cant_transform)\n else:\n yield Ok(new_line)", "result_size": 3, "created_at": "2026-03-20T16:58:17.494246+00:00"}} {"sample_id": "pallets__jinja__parse_tuple__upstream__1hop_9a8b4f", "repo": "pallets/jinja", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["subparse", "parse", "parse_primary", "parse_for", "parse_set", "parse_assign_target", "parse_if"], "call_files": ["private/tmp/repos/pallets__jinja/src/jinja2/parser.py", "private/tmp/repos/pallets__jinja/src/jinja2/ext.py", "private/tmp/repos/pallets__jinja/src/jinja2/parser.py", "private/tmp/repos/pallets__jinja/src/jinja2/parser.py", "private/tmp/repos/pallets__jinja/src/jinja2/parser.py", "private/tmp/repos/pallets__jinja/src/jinja2/parser.py", "private/tmp/repos/pallets__jinja/src/jinja2/parser.py"]}, "metadata": {"anchor": "parse_tuple", "anchor_file": "private/tmp/repos/pallets__jinja/src/jinja2/parser.py", "anchor_source": "def parse_tuple(\n self,\n simplified: bool = False,\n with_condexpr: bool = True,\n extra_end_rules: tuple[str, ...] | None = None,\n explicit_parentheses: bool = False,\n with_namespace: bool = False,\n ) -> nodes.Tuple | nodes.Expr:\n \"\"\"Works like `parse_expression` but if multiple expressions are\n delimited by a comma a :class:`~jinja2.nodes.Tuple` node is created.\n This method could also return a regular expression instead of a tuple\n if no commas where found.\n\n The default parsing mode is a full tuple. If `simplified` is `True`\n only names and literals are parsed; ``with_namespace`` allows namespace\n attr refs as well. The `no_condexpr` parameter is forwarded to\n :meth:`parse_expression`.\n\n Because tuples do not require delimiters and may end in a bogus comma\n an extra hint is needed that marks the end of a tuple. For example\n for loops support tuples between `for` and `in`. In that case the\n `extra_end_rules` is set to ``['name:in']``.\n\n `explicit_parentheses` is true if the parsing was triggered by an\n expression in parentheses. This is used to figure out if an empty\n tuple is a valid expression or not.\n \"\"\"\n lineno = self.stream.current.lineno\n if simplified:\n\n def parse() -> nodes.Expr:\n return self.parse_primary(with_namespace=with_namespace)\n\n else:\n\n def parse() -> nodes.Expr:\n return self.parse_expression(with_condexpr=with_condexpr)\n\n args: list[nodes.Expr] = []\n is_tuple = False\n\n while True:\n if args:\n self.stream.expect(\"comma\")\n if self.is_tuple_end(extra_end_rules):\n break\n args.append(parse())\n if self.stream.current.type == \"comma\":\n is_tuple = True\n else:\n break\n lineno = self.stream.current.lineno\n\n if not is_tuple:\n if args:\n return args[0]\n\n # if we don't have explicit parentheses, an empty tuple is\n # not a valid expression. This would mean nothing (literally\n # nothing) in the spot of an expression would be an empty\n # tuple.\n if not explicit_parentheses:\n self.fail(\n \"Expected an expression,\"\n f\" got {describe_token(self.stream.current)!r}\"\n )\n\n return nodes.Tuple(args, \"load\", lineno=lineno)", "result_size": 7, "created_at": "2026-03-20T16:58:17.229656+00:00", "file_content": ""}} {"sample_id": "immerjs__immer__handleCrossReference__upstream__1hop_c3f0f7", "repo": "immerjs/immer", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["add", "enableArrayMethods", "set", "handleInsertedValues", "enableMapSet"], "call_files": ["private/tmp/repos/immerjs__immer/src/plugins/mapset.ts", "private/tmp/repos/immerjs__immer/src/plugins/arrayMethods.ts", "private/tmp/repos/immerjs__immer/src/plugins/mapset.ts", "private/tmp/repos/immerjs__immer/src/plugins/arrayMethods.ts", "private/tmp/repos/immerjs__immer/src/plugins/mapset.ts"]}, "metadata": {"anchor": "handleCrossReference", "anchor_file": "private/tmp/repos/immerjs__immer/src/core/finalize.ts", "anchor_source": "export function handleCrossReference(\n\ttarget: ImmerState,\n\tkey: string | number | symbol,\n\tvalue: any\n) {\n\tconst {scope_} = target\n\t// Check if value is a draft from this scope\n\tif (isDraft(value)) {\n\t\tconst state: ImmerState = value[DRAFT_STATE]\n\t\tif (isSameScope(state, scope_)) {\n\t\t\t// Register callback to update this location when the draft finalizes\n\n\t\t\tstate.callbacks_.push(function crossReferenceCleanup() {\n\t\t\t\t// Update the target location with finalized value\n\t\t\t\tprepareCopy(target)\n\n\t\t\t\tconst finalizedValue = getFinalValue(state)\n\n\t\t\t\tupdateDraftInParent(target, value, finalizedValue, key)\n\t\t\t})\n\t\t}\n\t} else if (isDraftable(value)) {\n\t\t// Handle non-draft objects that might contain drafts\n\t\ttarget.callbacks_.push(function nestedDraftCleanup() {\n\t\t\tconst targetCopy = latest(target)\n\n\t\t\t// For Sets, check if value is still in the set\n\t\t\tif (target.type_ === ArchType.Set) {\n\t\t\t\tif (targetCopy.has(value)) {\n\t\t\t\t\t// Process the value to replace any nested drafts\n\t\t\t\t\thandleValue(value, scope_.handledSet_, scope_)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Maps/objects\n\t\t\t\tif (get(targetCopy, key, target.type_) === value) {\n\t\t\t\t\tif (\n\t\t\t\t\t\tscope_.drafts_.length > 1 &&\n\t\t\t\t\t\t((target as Exclude).assigned_!.get(key) ??\n\t\t\t\t\t\t\tfalse) === true &&\n\t\t\t\t\t\ttarget.copy_\n\t\t\t\t\t) {\n\t\t\t\t\t\t// This might be a non-draft value that has drafts\n\t\t\t\t\t\t// inside. We do need to recurse here to handle those.\n\t\t\t\t\t\thandleValue(\n\t\t\t\t\t\t\tget(target.copy_, key, target.type_),\n\t\t\t\t\t\t\tscope_.handledSet_,\n\t\t\t\t\t\t\tscope_\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n}", "result_size": 6, "created_at": "2026-03-20T16:58:16.801413+00:00", "file_content": ""}} {"sample_id": "pallets__jinja___tokenize__downstream__1hop_bec21d", "repo": "pallets/jinja", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["tokenize", "filter_stream", "TokenStream", "preprocess", "iter_extensions"], "call_files": ["private/tmp/repos/pallets__jinja/src/jinja2/lexer.py", "private/tmp/repos/pallets__jinja/src/jinja2/ext.py", "private/tmp/repos/pallets__jinja/src/jinja2/lexer.py", "private/tmp/repos/pallets__jinja/src/jinja2/environment.py", "private/tmp/repos/pallets__jinja/src/jinja2/environment.py"]}, "metadata": {"anchor": "_tokenize", "anchor_file": "private/tmp/repos/pallets__jinja/src/jinja2/environment.py", "anchor_source": "def _tokenize(\n self,\n source: str,\n name: str | None,\n filename: str | None = None,\n state: str | None = None,\n ) -> TokenStream:\n \"\"\"Called by the parser to do the preprocessing and filtering\n for all the extensions. Returns a :class:`~jinja2.lexer.TokenStream`.\n \"\"\"\n source = self.preprocess(source, name, filename)\n stream = self.lexer.tokenize(source, name, filename, state)\n\n for ext in self.iter_extensions():\n stream = ext.filter_stream(stream) # type: ignore\n\n if not isinstance(stream, TokenStream):\n stream = TokenStream(stream, name, filename)\n\n return stream", "result_size": 5, "created_at": "2026-03-20T16:58:17.229656+00:00"}} {"sample_id": "trpc__trpc__readableStreamFrom__upstream__1hop_de7590", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["sseStreamProducer", "jsonlStreamProducer"], "call_files": ["private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/sse.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/jsonl.ts"]}, "metadata": {"anchor": "readableStreamFrom", "anchor_file": "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/utils/readableStreamFrom.ts", "anchor_source": "export function readableStreamFrom(\n iterable: AsyncIterable,\n): ReadableStream {\n const iterator = iterable[Symbol.asyncIterator]();\n\n return new ReadableStream({\n async cancel() {\n await iterator.return?.();\n },\n\n async pull(controller) {\n const result = await iterator.next();\n\n if (result.done) {\n controller.close();\n return;\n }\n\n controller.enqueue(result.value);\n },\n });\n}", "result_size": 4, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "immerjs__immer__nestedDraftCleanup__upstream__2hop_e3a010", "repo": "immerjs/immer", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["handleCrossReference"], "hop_1_files": ["private/tmp/repos/immerjs__immer/src/core/finalize.ts"], "hop_2": ["add", "enableArrayMethods", "set", "handleInsertedValues", "enableMapSet"], "hop_2_files": ["private/tmp/repos/immerjs__immer/src/plugins/mapset.ts", "private/tmp/repos/immerjs__immer/src/plugins/arrayMethods.ts", "private/tmp/repos/immerjs__immer/src/plugins/mapset.ts", "private/tmp/repos/immerjs__immer/src/plugins/arrayMethods.ts", "private/tmp/repos/immerjs__immer/src/plugins/mapset.ts"]}, "metadata": {"anchor": "nestedDraftCleanup", "anchor_file": "private/tmp/repos/immerjs__immer/src/core/finalize.ts", "anchor_source": "target.callbacks_.push(function nestedDraftCleanup() {\n\t\t\tconst targetCopy = latest(target)\n\n\t\t\t// For Sets, check if value is still in the set\n\t\t\tif (target.type_ === ArchType.Set) {\n\t\t\t\tif (targetCopy.has(value)) {\n\t\t\t\t\t// Process the value to replace any nested drafts\n\t\t\t\t\thandleValue(value, scope_.handledSet_, scope_)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Maps/objects\n\t\t\t\tif (get(targetCopy, key, target.type_) === value) {\n\t\t\t\t\tif (\n\t\t\t\t\t\tscope_.drafts_.length > 1 &&\n\t\t\t\t\t\t((target as Exclude).assigned_!.get(key) ??\n\t\t\t\t\t\t\tfalse) === true &&\n\t\t\t\t\t\ttarget.copy_\n\t\t\t\t\t) {\n\t\t\t\t\t\t// This might be a non-draft value that has drafts\n\t\t\t\t\t\t// inside. We do need to recurse here to handle those.\n\t\t\t\t\t\thandleValue(\n\t\t\t\t\t\t\tget(target.copy_, key, target.type_),\n\t\t\t\t\t\t\tscope_.handledSet_,\n\t\t\t\t\t\t\tscope_\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t})", "result_size": 6, "created_at": "2026-03-20T16:58:16.801413+00:00", "file_content": ""}} {"sample_id": "rq__rq__get_keys__upstream__1hop_642896", "repo": "rq/rq", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["clean_worker_registry", "all_keys", "all", "count"], "call_files": ["private/tmp/repos/rq__rq/rq/worker_registration.py", "private/tmp/repos/rq__rq/rq/worker/base.py", "private/tmp/repos/rq__rq/rq/worker/base.py", "private/tmp/repos/rq__rq/rq/worker/base.py"]}, "metadata": {"anchor": "get_keys", "anchor_file": "private/tmp/repos/rq__rq/rq/worker_registration.py", "anchor_source": "def get_keys(queue: Optional['Queue'] = None, connection: Optional['Redis'] = None) -> set[str]:\n \"\"\"Returns a list of worker keys for a given queue.\n\n Args:\n queue (Optional['Queue'], optional): The Queue. Defaults to None.\n connection (Optional['Redis'], optional): The Redis Connection. Defaults to None.\n\n Raises:\n ValueError: If no Queue or Connection is provided.\n\n Returns:\n set: A Set with keys.\n \"\"\"\n if queue is None and connection is None:\n raise ValueError('\"Queue\" or \"connection\" argument is required')\n\n if queue:\n redis = queue.connection\n redis_key = WORKERS_BY_QUEUE_KEY % queue.name\n else:\n redis = connection # type: ignore\n redis_key = REDIS_WORKER_KEYS\n\n return {as_text(key) for key in redis.smembers(redis_key)}", "result_size": 4, "created_at": "2026-03-20T16:58:17.875204+00:00", "file_content": ""}} {"sample_id": "pytest-dev__pytest__pytest_collect_file__downstream__1hop_ee29ef", "repo": "pytest-dev/pytest", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["_is_setup_py", "_is_main_py"], "call_files": ["private/tmp/repos/pytest-dev__pytest/src/_pytest/doctest.py", "private/tmp/repos/pytest-dev__pytest/src/_pytest/doctest.py"]}, "metadata": {"anchor": "pytest_collect_file", "anchor_file": "private/tmp/repos/pytest-dev__pytest/src/_pytest/doctest.py", "anchor_source": "def pytest_collect_file(\n file_path: Path,\n parent: Collector,\n) -> DoctestModule | DoctestTextfile | None:\n config = parent.config\n if file_path.suffix == \".py\":\n if config.option.doctestmodules and not any(\n (_is_setup_py(file_path), _is_main_py(file_path))\n ):\n return DoctestModule.from_parent(parent, path=file_path)\n elif _is_doctest(config, file_path, parent):\n return DoctestTextfile.from_parent(parent, path=file_path)\n return None", "result_size": 2, "created_at": "2026-03-20T16:58:17.641689+00:00"}} {"sample_id": "trpc__trpc__createTRPCOptionsResult__upstream__2hop_5b7ffd", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["createUtilityFunctions", "infiniteQueryOptions", "queryOptions", "useHookResult"], "hop_1_files": ["private/tmp/repos/trpc__trpc/packages/react-query/src/utils/createUtilityFunctions.ts", "private/tmp/repos/trpc__trpc/packages/react-query/src/utils/createUtilityFunctions.ts", "private/tmp/repos/trpc__trpc/packages/react-query/src/utils/createUtilityFunctions.ts", "private/tmp/repos/trpc__trpc/packages/react-query/src/internals/trpcResult.ts"], "hop_2": ["useInfiniteQuery", "useQuery", "useMutation", "createRootHooks", "useSuspenseQuery", "useSuspenseInfiniteQuery", "createTRPCQueryUtils"], "hop_2_files": ["private/tmp/repos/trpc__trpc/packages/react-query/src/shared/hooks/createHooksInternal.tsx", "private/tmp/repos/trpc__trpc/packages/react-query/src/shared/hooks/createHooksInternal.tsx", "private/tmp/repos/trpc__trpc/packages/react-query/src/shared/hooks/createHooksInternal.tsx", "private/tmp/repos/trpc__trpc/packages/react-query/src/shared/hooks/createHooksInternal.tsx", "private/tmp/repos/trpc__trpc/packages/react-query/src/shared/hooks/createHooksInternal.tsx", "private/tmp/repos/trpc__trpc/packages/react-query/src/shared/hooks/createHooksInternal.tsx", "private/tmp/repos/trpc__trpc/packages/react-query/src/createTRPCQueryUtils.tsx"]}, "metadata": {"anchor": "createTRPCOptionsResult", "anchor_file": "private/tmp/repos/trpc__trpc/packages/react-query/src/internals/trpcResult.ts", "anchor_source": "export function createTRPCOptionsResult(value: {\n path: readonly string[];\n}): TRPCQueryOptionsResult['trpc'] {\n const path = value.path.join('.');\n\n return {\n path,\n };\n}", "result_size": 8, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "trpc__trpc__useEnv__upstream__1hop_db9d37", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["DocItemMetadata", "BlogPostPageMetadata", "Page"], "call_files": ["private/tmp/repos/trpc__trpc/www/src/theme/DocItem/Metadata/index.tsx", "private/tmp/repos/trpc__trpc/www/src/theme/BlogPostPage/Metadata/index.tsx", "private/tmp/repos/trpc__trpc/www/src/pages/pricing.tsx"]}, "metadata": {"anchor": "useEnv", "anchor_file": "private/tmp/repos/trpc__trpc/www/src/utils/useEnv.ts", "anchor_source": "export function useEnv() {\n const { siteConfig } = useDocusaurusContext();\n const customFields = siteConfig.customFields!;\n\n const env = customFields.env;\n\n return env as Env;\n}", "result_size": 3, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "colinhacks__zod___number__upstream__2hop_106319", "repo": "colinhacks/zod", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["number"], "hop_1_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/mini/schemas.ts"], "hop_2": ["json", "convertBaseSchema"], "hop_2_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/schemas.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/from-json-schema.ts"]}, "metadata": {"anchor": "_number", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/api.ts", "anchor_source": "export function _number(\n Class: util.SchemaClass,\n params?: string | $ZodNumberParams\n): T {\n return new Class({\n type: \"number\",\n checks: [],\n ...util.normalizeParams(params),\n });\n}", "result_size": 5, "created_at": "2026-03-20T16:58:16.474869+00:00", "file_content": ""}} {"sample_id": "pytest-dev__pytest__derive_importpath__downstream__1hop_53c609", "repo": "pytest-dev/pytest", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["resolve", "annotated_getattr"], "call_files": ["private/tmp/repos/pytest-dev__pytest/src/_pytest/monkeypatch.py", "private/tmp/repos/pytest-dev__pytest/src/_pytest/monkeypatch.py"]}, "metadata": {"anchor": "derive_importpath", "anchor_file": "private/tmp/repos/pytest-dev__pytest/src/_pytest/monkeypatch.py", "anchor_source": "def derive_importpath(import_path: str, raising: bool) -> tuple[str, object]:\n if not isinstance(import_path, str) or \".\" not in import_path:\n raise TypeError(f\"must be absolute import path string, not {import_path!r}\")\n module, attr = import_path.rsplit(\".\", 1)\n target = resolve(module)\n if raising:\n annotated_getattr(target, attr, ann=module)\n return attr, target", "result_size": 2, "created_at": "2026-03-20T16:58:17.641689+00:00"}} {"sample_id": "colinhacks__zod__defaultValue__downstream__1hop_5db302", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["shallowClone"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/util.ts"]}, "metadata": {"anchor": "defaultValue", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/api.ts", "anchor_source": "get defaultValue() {\n return typeof defaultValue === \"function\" ? (defaultValue as Function)() : util.shallowClone(defaultValue);\n },", "result_size": 1, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "celery__celery___client__downstream__1hop_14722d", "repo": "celery/celery", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["_create_database_if_not_exists", "_create_collection_if_not_exists"], "call_files": ["private/tmp/repos/celery/celery/backends/cosmosdbsql.py", "private/tmp/repos/celery/celery/backends/cosmosdbsql.py"]}, "metadata": {"anchor": "_client", "anchor_file": "private/tmp/repos/celery/celery/backends/cosmosdbsql.py", "anchor_source": "@cached_property\n def _client(self):\n \"\"\"Return the CosmosDB/SQL client.\n\n If this is the first call to the property, the client is created and\n the database and collection are initialized if they don't yet exist.\n\n \"\"\"\n connection_policy = ConnectionPolicy()\n connection_policy.RetryOptions = RetryOptions(\n max_retry_attempt_count=self._max_retry_attempts,\n max_wait_time_in_seconds=self._max_retry_wait_time)\n\n client = DocumentClient(\n self._endpoint,\n {\"masterKey\": self._key},\n connection_policy=connection_policy,\n consistency_level=self._consistency_level)\n\n self._create_database_if_not_exists(client)\n self._create_collection_if_not_exists(client)\n\n return client", "result_size": 2, "created_at": "2026-03-20T16:58:16.326235+00:00"}} {"sample_id": "sindresorhus__got__extend__downstream__1hop_940cf3", "repo": "sindresorhus/got", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["merge", "constructor", "Options"], "call_files": ["private/tmp/repos/got/source/core/options.ts", "private/tmp/repos/got/source/core/options.ts", "private/tmp/repos/got/source/core/options.ts"]}, "metadata": {"anchor": "extend", "anchor_file": "private/tmp/repos/got/source/create.ts", "anchor_source": "got.extend = (...instancesOrOptions) => {\n\t\tconst options = new Options(undefined, undefined, defaults.options);\n\t\tconst handlers = [...defaults.handlers];\n\n\t\tlet mutableDefaults: boolean | undefined;\n\n\t\tfor (const value of instancesOrOptions) {\n\t\t\tif (isGotInstance(value)) {\n\t\t\t\toptions.merge(value.defaults.options);\n\t\t\t\thandlers.push(...value.defaults.handlers);\n\t\t\t\tmutableDefaults = value.defaults.mutableDefaults;\n\t\t\t} else {\n\t\t\t\tassertNoUrlInOptionsObject(value);\n\t\t\t\toptions.merge(value);\n\n\t\t\t\tif (value.handlers) {\n\t\t\t\t\thandlers.push(...value.handlers);\n\t\t\t\t}\n\n\t\t\t\tmutableDefaults = value.mutableDefaults;\n\t\t\t}\n\t\t}\n\n\t\treturn create({\n\t\t\toptions,\n\t\t\thandlers,\n\t\t\tmutableDefaults: Boolean(mutableDefaults),\n\t\t});\n\t};", "result_size": 3, "created_at": "2026-03-20T16:58:18.104721+00:00"}} {"sample_id": "trpc__trpc__createURL__upstream__1hop_e26d6b", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["createHandler", "getWSConnectionHandler", "incomingMessageToRequest"], "call_files": ["private/tmp/repos/trpc__trpc/packages/server/src/adapters/standalone.ts", "private/tmp/repos/trpc__trpc/packages/server/src/adapters/ws.ts", "private/tmp/repos/trpc__trpc/packages/server/src/adapters/node-http/incomingMessageToRequest.ts"]}, "metadata": {"anchor": "createURL", "anchor_file": "private/tmp/repos/trpc__trpc/packages/server/src/adapters/node-http/incomingMessageToRequest.ts", "anchor_source": "export function createURL(req: NodeHTTPRequest): URL {\n try {\n const protocol =\n // http2\n (req.headers[':scheme'] && req.headers[':scheme'] === 'https') ||\n // http1\n (req.socket && 'encrypted' in req.socket && req.socket.encrypted)\n ? 'https:'\n : 'http:';\n\n const host = req.headers.host ?? req.headers[':authority'] ?? 'localhost';\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return new URL(req.url!, `${protocol}//${host}`);\n } catch (cause) {\n throw new TRPCError({\n code: 'BAD_REQUEST',\n message: 'Invalid URL',\n cause,\n });\n }\n}", "result_size": 6, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "trpc__trpc__error__downstream__1hop_56b378", "repo": "trpc/trpc", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["register"], "call_files": ["private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/requestManager.ts"]}, "metadata": {"anchor": "error", "anchor_file": "private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/requestManager.ts", "anchor_source": "error: (e) => {\n callbacks.error(e);\n resolve();\n },", "result_size": 1, "created_at": "2026-03-20T16:58:18.199328+00:00"}} {"sample_id": "trpc__trpc__resolveHTTPLinkOptions__upstream__1hop_2cb78b", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["httpLink", "httpBatchLink", "httpBatchStreamLink"], "call_files": ["private/tmp/repos/trpc__trpc/packages/client/src/links/httpLink.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/httpBatchLink.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/httpBatchStreamLink.ts"]}, "metadata": {"anchor": "resolveHTTPLinkOptions", "anchor_file": "private/tmp/repos/trpc__trpc/packages/client/src/links/internals/httpUtils.ts", "anchor_source": "export function resolveHTTPLinkOptions(\n opts: HTTPLinkBaseOptions,\n): ResolvedHTTPLinkOptions {\n return {\n url: opts.url.toString(),\n fetch: opts.fetch,\n transformer: getTransformer(opts.transformer),\n methodOverride: opts.methodOverride,\n };\n}", "result_size": 3, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "pallets__click__get_help_option__upstream__2hop_a00a7f", "repo": "pallets/click", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["get_params", "show"], "hop_1_files": ["private/tmp/repos/pallets__click/src/click/core.py", "private/tmp/repos/pallets__click/src/click/exceptions.py"], "hop_2": ["collect_usage_pieces", "command_path", "format_options", "shell_complete", "to_info_dict", "parse_args", "make_parser", "_resolve_incomplete"], "hop_2_files": ["private/tmp/repos/pallets__click/src/click/core.py", "private/tmp/repos/pallets__click/src/click/core.py", "private/tmp/repos/pallets__click/src/click/core.py", "private/tmp/repos/pallets__click/src/click/core.py", "private/tmp/repos/pallets__click/src/click/core.py", "private/tmp/repos/pallets__click/src/click/core.py", "private/tmp/repos/pallets__click/src/click/core.py", "private/tmp/repos/pallets__click/src/click/shell_completion.py"]}, "metadata": {"anchor": "get_help_option", "anchor_file": "private/tmp/repos/pallets__click/src/click/core.py", "anchor_source": "def get_help_option(self, ctx: Context) -> Option | None:\n \"\"\"Returns the help option object.\n\n Skipped if :attr:`add_help_option` is ``False``.\n\n .. versionchanged:: 8.1.8\n The help option is now cached to avoid creating it multiple times.\n \"\"\"\n help_option_names = self.get_help_option_names(ctx)\n\n if not help_option_names or not self.add_help_option:\n return None\n\n # Cache the help option object in private _help_option attribute to\n # avoid creating it multiple times. Not doing this will break the\n # callback odering by iter_params_for_processing(), which relies on\n # object comparison.\n if self._help_option is None:\n # Avoid circular import.\n from .decorators import help_option\n\n # Apply help_option decorator and pop resulting option\n help_option(*help_option_names)(self)\n self._help_option = self.params.pop() # type: ignore[assignment]\n\n return self._help_option", "result_size": 8, "created_at": "2026-03-20T16:58:17.078639+00:00", "file_content": ""}} {"sample_id": "immerjs__immer__getArchtype__upstream__1hop_a8abf6", "repo": "immerjs/immer", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["each", "enablePatches", "applyPatches_", "freeze"], "call_files": ["private/tmp/repos/immerjs__immer/src/utils/common.ts", "private/tmp/repos/immerjs__immer/src/plugins/patches.ts", "private/tmp/repos/immerjs__immer/src/plugins/patches.ts", "private/tmp/repos/immerjs__immer/src/utils/common.ts"]}, "metadata": {"anchor": "getArchtype", "anchor_file": "private/tmp/repos/immerjs__immer/src/utils/common.ts", "anchor_source": "export function getArchtype(thing: any): ArchType {\n\tconst state: undefined | ImmerState = thing[DRAFT_STATE]\n\treturn state\n\t\t? state.type_\n\t\t: isArray(thing)\n\t\t? ArchType.Array\n\t\t: isMap(thing)\n\t\t? ArchType.Map\n\t\t: isSet(thing)\n\t\t? ArchType.Set\n\t\t: ArchType.Object\n}", "result_size": 5, "created_at": "2026-03-20T16:58:16.801413+00:00", "file_content": ""}} {"sample_id": "trpc__trpc__takeWithGrace__upstream__2hop_4e5ea5", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["sseStreamProducer", "generator"], "hop_1_files": ["private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/sse.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/sse.ts"], "hop_2": ["resolveResponse", "generatorWithErrorHandling"], "hop_2_files": ["private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/http/resolveResponse.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/sse.ts"]}, "metadata": {"anchor": "takeWithGrace", "anchor_file": "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/utils/asyncIterable.ts", "anchor_source": "export async function* takeWithGrace(\n iterable: AsyncIterable,\n opts: {\n count: number;\n gracePeriodMs: number;\n },\n): AsyncGenerator {\n await using iterator = iteratorResource(iterable);\n\n // declaration outside the loop for garbage collection reasons\n let result: null | IteratorResult | typeof disposablePromiseTimerResult;\n\n using timer = timerResource(opts.gracePeriodMs);\n\n let count = opts.count;\n\n let timerPromise = new Promise(() => {\n // never resolves\n });\n\n while (true) {\n result = await Unpromise.race([iterator.next(), timerPromise]);\n if (result === disposablePromiseTimerResult) {\n throwAbortError();\n }\n if (result.done) {\n return result.value;\n }\n yield result.value;\n if (--count === 0) {\n timerPromise = timer.start();\n }\n // free up reference for garbage collection\n result = null;\n }\n}", "result_size": 5, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "getpelican__pelican__generate_context__downstream__2hop_74bad5", "repo": "getpelican/pelican", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["add_source_path", "_process", "_add_failed_source_path", "add_static_links", "_update_context", "get_files"], "hop_1_files": ["private/tmp/repos/getpelican__pelican/pelican/generators.py", "private/tmp/repos/getpelican__pelican/pelican/generators.py", "private/tmp/repos/getpelican__pelican/pelican/generators.py", "private/tmp/repos/getpelican__pelican/pelican/generators.py", "private/tmp/repos/getpelican__pelican/pelican/generators.py", "private/tmp/repos/getpelican__pelican/pelican/generators.py"], "hop_2": ["_include_path"], "hop_2_files": ["private/tmp/repos/getpelican__pelican/pelican/generators.py"]}, "metadata": {"anchor": "generate_context", "anchor_file": "private/tmp/repos/getpelican__pelican/pelican/generators.py", "anchor_source": "def generate_context(self):\n all_pages = []\n hidden_pages = []\n draft_pages = []\n for f in self.get_files(\n self.settings[\"PAGE_PATHS\"], exclude=self.settings[\"PAGE_EXCLUDES\"]\n ):\n page = self.get_cached_data(f, None)\n if page is None:\n try:\n page = self.readers.read_file(\n base_path=self.path,\n path=f,\n content_class=Page,\n context=self.context,\n preread_signal=signals.page_generator_preread,\n preread_sender=self,\n context_signal=signals.page_generator_context,\n context_sender=self,\n )\n except Exception:\n logger.exception(\n \"Could not process %s\",\n f,\n exc_info=self.settings.get(\"DEBUG\", False),\n )\n self._add_failed_source_path(f)\n continue\n\n if isinstance(page, SkipStub):\n logger.debug(\"Safely skipping %s\", f)\n continue\n\n if not page.is_valid():\n self._add_failed_source_path(f)\n continue\n\n self.cache_data(f, page)\n\n if page.status == \"published\":\n all_pages.append(page)\n elif page.status == \"hidden\":\n hidden_pages.append(page)\n elif page.status == \"draft\":\n draft_pages.append(page)\n elif page.status == \"skip\":\n raise AssertionError(\"Documents with 'skip' status should be skipped\")\n\n self.add_source_path(page)\n self.add_static_links(page)\n\n def _process(pages):\n origs, translations = process_translations(\n pages, translation_id=self.settings[\"PAGE_TRANSLATION_ID\"]\n )\n origs = order_content(origs, self.settings[\"PAGE_ORDER_BY\"])\n return origs, translations\n\n self.pages, self.translations = _process(all_pages)\n self.hidden_pages, self.hidden_translations = _process(hidden_pages)\n self.draft_pages, self.draft_translations = _process(draft_pages)\n\n self._update_context((\"pages\", \"hidden_pages\", \"draft_pages\"))\n\n self.save_cache()\n self.readers.save_cache()\n signals.page_generator_finalized.send(self)", "result_size": 1, "created_at": "2026-03-20T16:58:16.756586+00:00"}} {"sample_id": "trpc__trpc__getInitialProps__downstream__2hop_ba4cc1", "repo": "trpc/trpc", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["shouldDehydrateQuery", "serialize", "createTRPCUntypedClient"], "hop_1_files": ["private/tmp/repos/trpc__trpc/packages/next/src/ssrPrepass.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/transformer.ts", "private/tmp/repos/trpc__trpc/packages/client/src/createTRPCUntypedClient.ts"], "hop_2": ["constructor", "TRPCUntypedClient"], "hop_2_files": ["private/tmp/repos/trpc__trpc/packages/client/src/internals/TRPCUntypedClient.ts", "private/tmp/repos/trpc__trpc/packages/client/src/internals/TRPCUntypedClient.ts"]}, "metadata": {"anchor": "getInitialProps", "anchor_file": "private/tmp/repos/trpc__trpc/packages/next/src/ssrPrepass.ts", "anchor_source": "WithTRPC.getInitialProps = async (appOrPageCtx: AppContextType) => {\n const shouldSsr = async () => {\n if (typeof window !== 'undefined') {\n return false;\n }\n if (typeof parent.ssr === 'function') {\n try {\n return await parent.ssr({ ctx: appOrPageCtx.ctx });\n } catch {\n return false;\n }\n }\n return parent.ssr;\n };\n const ssrEnabled = await shouldSsr();\n const AppTree = appOrPageCtx.AppTree;\n\n // Determine if we are wrapping an App component or a Page component.\n const isApp = !!appOrPageCtx.Component;\n const ctx: NextPageContext = isApp\n ? appOrPageCtx.ctx\n : (appOrPageCtx as any as NextPageContext);\n\n // Run the wrapped component's getInitialProps function.\n let pageProps: Dict = {};\n if (AppOrPage.getInitialProps) {\n const originalProps = await AppOrPage.getInitialProps(\n appOrPageCtx as any,\n );\n const originalPageProps = isApp\n ? (originalProps.pageProps ?? {})\n : originalProps;\n\n pageProps = {\n ...originalPageProps,\n ...pageProps,\n };\n }\n const getAppTreeProps = (props: Record) =>\n isApp ? { pageProps: props } : props;\n\n if (typeof window !== 'undefined' || !ssrEnabled) {\n return getAppTreeProps(pageProps);\n }\n\n const config = parent.config({ ctx });\n const trpcClient = createTRPCUntypedClient(config);\n const queryClient = getQueryClient(config);\n\n const trpcProp: $PrepassProps = {\n config,\n trpcClient,\n queryClient,\n ssrState: 'prepass',\n ssrContext: ctx,\n };\n const prepassProps = {\n pageProps,\n trpc: trpcProp,\n };\n\n const reactDomServer = await import('react-dom/server');\n\n // Run the prepass step on AppTree. This will run all trpc queries on the server.\n // multiple prepass ensures that we can do batching on the server\n while (true) {\n // render full tree\n reactDomServer.renderToString(createElement(AppTree, prepassProps));\n if (!queryClient.isFetching()) {\n // the render didn't cause the queryClient to fetch anything\n break;\n }\n\n // wait until the query cache has settled it's promises\n await new Promise((resolve) => {\n const unsub = queryClient.getQueryCache().subscribe((event) => {\n if (event?.query.getObserversCount() === 0) {\n resolve();\n unsub();\n }\n });\n });\n }\n const dehydratedCache = dehydrate(queryClient, {\n shouldDehydrateQuery(query) {\n // filter out queries that are marked as trpc: { ssr: false } or are not enabled, but make sure errors are dehydrated\n const isExcludedFromSSr =\n query.state.fetchStatus === 'idle' &&\n query.state.status === 'pending';\n return !isExcludedFromSSr;\n },\n });\n // since error instances can't be serialized, let's make them into `TRPCClientErrorLike`-objects\n const dehydratedCacheWithErrors = {\n ...dehydratedCache,\n queries: dehydratedCache.queries.map(transformQueryOrMutationCacheErrors),\n mutations: dehydratedCache.mutations.map(\n transformQueryOrMutationCacheErrors,\n ),\n };\n\n // dehydrate query client's state and add it to the props\n pageProps['trpcState'] = transformer.input.serialize(\n dehydratedCacheWithErrors,\n );\n\n const appTreeProps = getAppTreeProps(pageProps);\n\n const meta =\n parent.responseMeta?.({\n ctx,\n clientErrors: [...dehydratedCache.queries, ...dehydratedCache.mutations]\n .map((v) => v.state.error)\n .flatMap((err) =>\n err instanceof Error && err.name === 'TRPCClientError'\n ? [err as TRPCClientError]\n : [],\n ),\n }) ?? {};\n\n for (const [key, value] of Object.entries(meta.headers ?? {})) {\n if (typeof value === 'string') {\n ctx.res?.setHeader(key, value);\n }\n }\n if (meta.status && ctx.res) {\n ctx.res.statusCode = meta.status;\n }\n\n return appTreeProps;\n };", "result_size": 2, "created_at": "2026-03-20T16:58:18.199328+00:00"}} {"sample_id": "encode__httpx__get_list__upstream__1hop_5e9a9c", "repo": "encode/httpx", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["_get_content_decoder", "auth_flow"], "call_files": ["private/tmp/repos/encode__httpx/httpx/_models.py", "private/tmp/repos/encode__httpx/httpx/_auth.py"]}, "metadata": {"anchor": "get_list", "anchor_file": "private/tmp/repos/encode__httpx/httpx/_models.py", "anchor_source": "def get_list(self, key: str, split_commas: bool = False) -> list[str]:\n \"\"\"\n Return a list of all header values for a given key.\n If `split_commas=True` is passed, then any comma separated header\n values are split into multiple return strings.\n \"\"\"\n get_header_key = key.lower().encode(self.encoding)\n\n values = [\n item_value.decode(self.encoding)\n for _, item_key, item_value in self._list\n if item_key.lower() == get_header_key\n ]\n\n if not split_commas:\n return values\n\n split_values = []\n for value in values:\n split_values.extend([item.strip() for item in value.split(\",\")])\n return split_values", "result_size": 2, "created_at": "2026-03-20T16:58:16.700579+00:00", "file_content": ""}} {"sample_id": "trpc__trpc__next__downstream__1hop_751935", "repo": "trpc/trpc", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["execute"], "call_files": ["private/tmp/repos/trpc__trpc/packages/client/src/links/internals/createChain.ts"]}, "metadata": {"anchor": "next", "anchor_file": "private/tmp/repos/trpc__trpc/packages/client/src/links/internals/createChain.ts", "anchor_source": "next(nextOp) {\n const nextObserver = execute(index + 1, nextOp);\n\n return nextObserver;\n },", "result_size": 1, "created_at": "2026-03-20T16:58:18.199328+00:00"}} {"sample_id": "immerjs__immer__scenario_remove__downstream__2hop_b73056", "repo": "immerjs/immer", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["createInitialState"], "hop_1_files": ["private/tmp/repos/immerjs__immer/perf-testing/immutability-profiling.mjs"], "hop_2": ["createLargeObject"], "hop_2_files": ["private/tmp/repos/immerjs__immer/perf-testing/immutability-profiling.mjs"]}, "metadata": {"anchor": "scenario_remove", "anchor_file": "private/tmp/repos/immerjs__immer/perf-testing/immutability-profiling.mjs", "anchor_source": "function scenario_remove() {\n\tconst initialState = createInitialState()\n\tfor (let j = 0; j < MAX; j++) {\n\t\timmerReducer(initialState, actions.remove(j))\n\t}\n}", "result_size": 1, "created_at": "2026-03-20T16:58:16.801413+00:00"}} {"sample_id": "pallets__click___process_args_for_args__downstream__2hop_6b9d41", "repo": "pallets/click", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["process", "_unpack_args"], "hop_1_files": ["private/tmp/repos/pallets__click/src/click/parser.py", "private/tmp/repos/pallets__click/src/click/parser.py"], "hop_2": ["_fetch"], "hop_2_files": ["private/tmp/repos/pallets__click/src/click/parser.py"]}, "metadata": {"anchor": "_process_args_for_args", "anchor_file": "private/tmp/repos/pallets__click/src/click/parser.py", "anchor_source": "def _process_args_for_args(self, state: _ParsingState) -> None:\n pargs, args = _unpack_args(\n state.largs + state.rargs, [x.nargs for x in self._args]\n )\n\n for idx, arg in enumerate(self._args):\n arg.process(pargs[idx], state)\n\n state.largs = args\n state.rargs = []", "result_size": 1, "created_at": "2026-03-20T16:58:17.078639+00:00"}} {"sample_id": "paramiko__paramiko___request_failed__downstream__1hop_3cd821", "repo": "paramiko/paramiko", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["_close_internal"], "call_files": ["private/tmp/repos/paramiko/paramiko/channel.py"]}, "metadata": {"anchor": "_request_failed", "anchor_file": "private/tmp/repos/paramiko/paramiko/channel.py", "anchor_source": "def _request_failed(self, m):\n self.lock.acquire()\n try:\n msgs = self._close_internal()\n finally:\n self.lock.release()\n for m in msgs:\n if m is not None:\n self.transport._send_user_message(m)", "result_size": 1, "created_at": "2026-03-20T16:58:17.364834+00:00"}} {"sample_id": "pallets__jinja__getattr__upstream__1hop_b447d3", "repo": "pallets/jinja", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["do_attr", "as_const", "get_field"], "call_files": ["private/tmp/repos/pallets__jinja/src/jinja2/filters.py", "private/tmp/repos/pallets__jinja/src/jinja2/nodes.py", "private/tmp/repos/pallets__jinja/src/jinja2/sandbox.py"]}, "metadata": {"anchor": "getattr", "anchor_file": "private/tmp/repos/pallets__jinja/src/jinja2/environment.py", "anchor_source": "def getattr(self, obj: t.Any, attribute: str) -> t.Any:\n \"\"\"Get an item or attribute of an object but prefer the attribute.\n Unlike :meth:`getitem` the attribute *must* be a string.\n \"\"\"\n try:\n return getattr(obj, attribute)\n except AttributeError:\n pass\n try:\n return obj[attribute]\n except (TypeError, LookupError, AttributeError):\n return self.undefined(obj=obj, name=attribute)", "result_size": 3, "created_at": "2026-03-20T16:58:17.229656+00:00", "file_content": ""}} {"sample_id": "rq__rq__setup_loghandlers__upstream__2hop_e6c10f", "repo": "rq/rq", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["bootstrap", "start"], "hop_1_files": ["private/tmp/repos/rq__rq/rq/worker/base.py", "private/tmp/repos/rq__rq/rq/worker_pool.py"], "hop_2": ["work", "connection", "queues"], "hop_2_files": ["private/tmp/repos/rq__rq/rq/worker/base.py", "private/tmp/repos/rq__rq/rq/scheduler.py", "private/tmp/repos/rq__rq/rq/worker_pool.py"]}, "metadata": {"anchor": "setup_loghandlers", "anchor_file": "private/tmp/repos/rq__rq/rq/logutils.py", "anchor_source": "def setup_loghandlers(\n level: Union[int, str, None] = None,\n date_format: str = DEFAULT_LOGGING_DATE_FORMAT,\n log_format: str = DEFAULT_LOGGING_FORMAT,\n name: str = 'rq.worker',\n):\n \"\"\"Sets up a log handler.\n\n Args:\n level (Union[int, str, None], optional): The log level.\n Access an integer level (10-50) or a string level (\"info\", \"debug\" etc). Defaults to None.\n date_format (str, optional): The date format to use. Defaults to DEFAULT_LOGGING_DATE_FORMAT ('%H:%M:%S').\n log_format (str, optional): The log format to use.\n Defaults to DEFAULT_LOGGING_FORMAT ('%(asctime)s %(message)s').\n name (str, optional): The logger name. Defaults to 'rq.worker'.\n \"\"\"\n logger = logging.getLogger(name)\n\n if not _has_effective_handler(logger):\n formatter = logging.Formatter(fmt=log_format, datefmt=date_format)\n handler = ColorizingStreamHandler(stream=sys.stdout)\n handler.setFormatter(formatter)\n handler.addFilter(lambda record: record.levelno < logging.ERROR)\n error_handler = ColorizingStreamHandler(stream=sys.stderr)\n error_handler.setFormatter(formatter)\n error_handler.addFilter(lambda record: record.levelno >= logging.ERROR)\n logger.addHandler(handler)\n logger.addHandler(error_handler)\n\n if level is not None:\n # The level may be a numeric value (e.g. when using the logging module constants)\n # Or a string representation of the logging level\n logger.setLevel(level if isinstance(level, int) else level.upper())", "result_size": 3, "created_at": "2026-03-20T16:58:17.875204+00:00", "file_content": ""}} {"sample_id": "colinhacks__zod__refine__downstream__1hop_ea60c7", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["_refinement"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"]}, "metadata": {"anchor": "refine", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "anchor_source": "refine(\n check: (arg: Output) => unknown,\n message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)\n ): ZodEffects {\n const getIssueProperties = (val: Output) => {\n if (typeof message === \"string\" || typeof message === \"undefined\") {\n return { message };\n } else if (typeof message === \"function\") {\n return message(val);\n } else {\n return message;\n }\n };\n return this._refinement((val, ctx) => {\n const result = check(val);\n const setError = () =>\n ctx.addIssue({\n code: ZodIssueCode.custom,\n ...getIssueProperties(val),\n });\n if (typeof Promise !== \"undefined\" && result instanceof Promise) {\n return result.then((data) => {\n if (!data) {\n setError();\n return false;\n } else {\n return true;\n }\n });\n }\n if (!result) {\n setError();\n return false;\n } else {\n return true;\n }\n });\n }", "result_size": 2, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "pytest-dev__pytest__pytest_fixture_setup__downstream__1hop_0f8393", "repo": "pytest-dev/pytest", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["_show_fixture_action"], "call_files": ["private/tmp/repos/pytest-dev__pytest/src/_pytest/setuponly.py"]}, "metadata": {"anchor": "pytest_fixture_setup", "anchor_file": "private/tmp/repos/pytest-dev__pytest/src/_pytest/setuponly.py", "anchor_source": "@pytest.hookimpl(wrapper=True)\ndef pytest_fixture_setup(\n fixturedef: FixtureDef[object], request: SubRequest\n) -> Generator[None, object, object]:\n try:\n return (yield)\n finally:\n if request.config.option.setupshow:\n if hasattr(request, \"param\"):\n # Save the fixture parameter so ._show_fixture_action() can\n # display it now and during the teardown (in .finish()).\n if fixturedef.ids:\n if callable(fixturedef.ids):\n param = fixturedef.ids(request.param)\n else:\n param = fixturedef.ids[request.param_index]\n else:\n param = request.param\n fixturedef.cached_param = param # type: ignore[attr-defined]\n _show_fixture_action(fixturedef, request.config, \"SETUP\")", "result_size": 1, "created_at": "2026-03-20T16:58:17.641689+00:00"}} {"sample_id": "colinhacks__zod___isoTime__upstream__2hop_d8ddf9", "repo": "colinhacks/zod", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["time"], "hop_1_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/mini/iso.ts"], "hop_2": ["time", "convertBaseSchema"], "hop_2_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/schemas.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/from-json-schema.ts"]}, "metadata": {"anchor": "_isoTime", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/api.ts", "anchor_source": "export function _isoTime(\n Class: util.SchemaClass,\n params?: string | $ZodISOTimeParams | $ZodCheckISOTimeParams\n): T {\n return new Class({\n type: \"string\",\n format: \"time\",\n check: \"string_format\",\n precision: null,\n ...util.normalizeParams(params),\n });\n}", "result_size": 3, "created_at": "2026-03-20T16:58:16.474869+00:00", "file_content": ""}} {"sample_id": "trpc__trpc__share__upstream__1hop_995b22", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["$request", "dedupeLink"], "call_files": ["private/tmp/repos/trpc__trpc/packages/client/src/internals/TRPCUntypedClient.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/internals/dedupeLink.ts"]}, "metadata": {"anchor": "share", "anchor_file": "private/tmp/repos/trpc__trpc/packages/server/src/observable/operators.ts", "anchor_source": "export function share(\n _opts?: ShareConfig,\n): MonoTypeOperatorFunction {\n return (source) => {\n let refCount = 0;\n\n let subscription: Unsubscribable | null = null;\n const observers: Partial>[] = [];\n\n function startIfNeeded() {\n if (subscription) {\n return;\n }\n subscription = source.subscribe({\n next(value) {\n for (const observer of observers) {\n observer.next?.(value);\n }\n },\n error(error) {\n for (const observer of observers) {\n observer.error?.(error);\n }\n },\n complete() {\n for (const observer of observers) {\n observer.complete?.();\n }\n },\n });\n }\n function resetIfNeeded() {\n // \"resetOnRefCountZero\"\n if (refCount === 0 && subscription) {\n const _sub = subscription;\n subscription = null;\n _sub.unsubscribe();\n }\n }\n\n return observable((subscriber) => {\n refCount++;\n\n observers.push(subscriber);\n startIfNeeded();\n return {\n unsubscribe() {\n refCount--;\n resetIfNeeded();\n\n const index = observers.findIndex((v) => v === subscriber);\n\n if (index > -1) {\n observers.splice(index, 1);\n }\n },\n };\n });\n };\n}", "result_size": 7, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "locustio__locust__greenlet_exception_logger__upstream__1hop_e3c304", "repo": "locustio/locust", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["main", "locust_exception_handler"], "call_files": ["private/tmp/repos/locustio__locust/locust/main.py", "private/tmp/repos/locustio__locust/locust/runners.py"]}, "metadata": {"anchor": "greenlet_exception_logger", "anchor_file": "private/tmp/repos/locustio__locust/locust/log.py", "anchor_source": "def greenlet_exception_logger(logger, level=logging.CRITICAL):\n \"\"\"\n Return a function that can be used as argument to Greenlet.link_exception() that will log the\n unhandled exception to the given logger.\n \"\"\"\n\n def exception_handler(greenlet):\n if greenlet.exc_info[0] is SystemExit:\n logger.log(\n min(logging.INFO, level), # dont use higher than INFO for this, because it sounds way to urgent\n f\"sys.exit({greenlet.exc_info[1]}) called (use log level DEBUG for callstack)\",\n )\n logger.log(logging.DEBUG, \"Unhandled exception in greenlet: %s\", greenlet, exc_info=greenlet.exc_info)\n else:\n logger.log(level, \"Unhandled exception in greenlet: %s\", greenlet, exc_info=greenlet.exc_info)\n global unhandled_greenlet_exception\n unhandled_greenlet_exception = True\n\n return exception_handler", "result_size": 2, "created_at": "2026-03-20T16:58:16.951273+00:00", "file_content": ""}} {"sample_id": "trpc__trpc__next__downstream__1hop_c59c43", "repo": "trpc/trpc", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["map"], "call_files": ["private/tmp/repos/trpc__trpc/packages/server/src/observable/operators.ts"]}, "metadata": {"anchor": "next", "anchor_file": "private/tmp/repos/trpc__trpc/packages/server/src/observable/operators.ts", "anchor_source": "next(value) {\n destination.next(project(value, index++));\n },", "result_size": 1, "created_at": "2026-03-20T16:58:18.199328+00:00"}} {"sample_id": "agronholm__apscheduler__reconstitute_event__downstream__2hop_19d7c1", "repo": "agronholm/apscheduler", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["_reconstitute_event"], "hop_1_files": ["private/tmp/repos/agronholm__apscheduler/src/apscheduler/eventbrokers/base.py"], "hop_2": ["deserialize"], "hop_2_files": ["private/tmp/repos/agronholm__apscheduler/src/apscheduler/abc.py"]}, "metadata": {"anchor": "reconstitute_event", "anchor_file": "private/tmp/repos/agronholm__apscheduler/src/apscheduler/eventbrokers/base.py", "anchor_source": "def reconstitute_event(self, payload: bytes) -> Event | None:\n try:\n event_type_bytes, serialized = payload.split(b\" \", 1)\n except ValueError:\n self._logger.error(\n \"Received malformatted notification\", extra={\"payload\": payload}\n )\n return None\n\n event_type = event_type_bytes.decode(\"ascii\", errors=\"replace\")\n return self._reconstitute_event(event_type, serialized)", "result_size": 1, "created_at": "2026-03-20T16:58:16.252821+00:00"}} {"sample_id": "celery__celery___after_fork__upstream__2hop_b4ff51", "repo": "celery/celery", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["on_state_change", "_after_fork"], "hop_1_files": ["private/tmp/repos/celery/celery/backends/asynchronous.py", "private/tmp/repos/celery/celery/backends/rpc.py"], "hop_2": ["on_state_change", "on_out_of_band_result"], "hop_2_files": ["private/tmp/repos/celery/celery/backends/redis.py", "private/tmp/repos/celery/celery/backends/asynchronous.py"]}, "metadata": {"anchor": "_after_fork", "anchor_file": "private/tmp/repos/celery/celery/backends/asynchronous.py", "anchor_source": "def _after_fork(self):\n self.buckets.clear()\n self.buckets = WeakKeyDictionary()\n self.on_message = None\n self.on_after_fork()", "result_size": 2, "created_at": "2026-03-20T16:58:16.326235+00:00", "file_content": "\"\"\"Async I/O backend support utilities.\"\"\"\n\nimport logging\nimport socket\nimport threading\nimport time\nfrom collections import deque\nfrom contextlib import contextmanager\nfrom queue import Empty\nfrom time import sleep\nfrom weakref import WeakKeyDictionary\n\nfrom kombu.utils.compat import detect_environment\n\nfrom celery import states\nfrom celery.exceptions import TimeoutError\nfrom celery.utils.log import get_logger\nfrom celery.utils.threads import THREAD_TIMEOUT_MAX\n\nE_CELERY_RESTART_REQUIRED = \"Celery must be restarted because a shutdown signal was detected.\"\n\nE_RETRY_LIMIT_EXCEEDED = \"\"\"\nRetry limit exceeded while trying to reconnect to the Celery result store\nbackend. The Celery application must be restarted.\n\"\"\"\n\nlogger = get_logger(__name__)\n\n__all__ = (\n 'AsyncBackendMixin', 'BaseResultConsumer', 'Drainer',\n 'register_drainer',\n)\n\n\nclass EventletAdaptedEvent:\n \"\"\"\n An adapted eventlet event, designed to match the API of `threading.Event` and\n `gevent.event.Event`.\n \"\"\"\n\n def __init__(self):\n import eventlet\n self.evt = eventlet.Event()\n\n def is_set(self):\n return self.evt.ready()\n\n def set(self):\n return self.evt.send()\n\n def wait(self, timeout=None):\n return self.evt.wait(timeout)\n\n\ndrainers = {}\n\n\ndef register_drainer(name):\n \"\"\"Decorator used to register a new result drainer type.\"\"\"\n def _inner(cls):\n drainers[name] = cls\n return cls\n return _inner\n\n\n@register_drainer('default')\nclass Drainer:\n \"\"\"Result draining service.\"\"\"\n\n def __init__(self, result_consumer):\n self.result_consumer = result_consumer\n\n def start(self):\n pass\n\n def stop(self):\n pass\n\n def drain_events_until(self, p, timeout=None, interval=1, on_interval=None, wait=None):\n wait = wait or self.result_consumer.drain_events\n time_start = time.monotonic()\n\n while 1:\n # Total time spent may exceed a single call to wait()\n if timeout and time.monotonic() - time_start >= timeout:\n raise socket.timeout()\n try:\n yield self.wait_for(p, wait, timeout=interval)\n except socket.timeout:\n pass\n except OSError:\n # Recoverable connection error (e.g. broker restart).\n # drain_events handles reconnection internally; if an\n # OSError still leaks through, we log, sleep for one\n # interval, and continue rather than spinning hot.\n logging.warning(\n 'Drainer: connection error during drain_events, '\n 'will retry on next loop iteration.',\n exc_info=True,\n )\n time.sleep(interval)\n\n if on_interval:\n on_interval()\n if p.ready: # got event on the wanted channel.\n break\n\n def wait_for(self, p, wait, timeout=None):\n wait(timeout=timeout)\n\n def _event(self):\n return threading.Event()\n\n\nclass greenletDrainer(Drainer):\n spawn = None\n _exc = None\n _g = None\n _drain_complete_event = None # event, sended (and recreated) after every drain_events iteration\n\n def _send_drain_complete_event(self):\n self._drain_complete_event.set()\n self._drain_complete_event = self._event()\n\n def __init__(self, *args, **kwargs):\n super().__init__(*args, **kwargs)\n\n self._started = self._event()\n self._stopped = self._event()\n self._shutdown = self._event()\n self._drain_complete_event = self._event()\n\n def run(self):\n self._started.set()\n\n try:\n while not self._stopped.is_set():\n try:\n self.result_consumer.drain_events(timeout=1)\n self._send_drain_complete_event()\n except socket.timeout:\n pass\n except OSError:\n # Recoverable connection errors (e.g. broker restart)\n # are handled inside drain_events via reconnection.\n # If something still leaks through, we log, back off\n # briefly, and retry instead of spinning hot.\n logging.warning(\n 'Drainer: connection error during drain_events, '\n 'will retry on next loop iteration.',\n exc_info=True,\n )\n time.sleep(1)\n except Exception as e:\n self._exc = e\n raise\n finally:\n self._send_drain_complete_event()\n try:\n self._shutdown.set()\n except RuntimeError as e:\n logging.error(f\"Failed to set shutdown event: {e}\")\n\n def start(self):\n self._ensure_not_shut_down()\n\n if not self._started.is_set():\n self._g = self.spawn(self.run)\n self._started.wait()\n\n def stop(self):\n self._stopped.set()\n self._shutdown.wait(THREAD_TIMEOUT_MAX)\n\n def wait_for(self, p, wait, timeout=None):\n self.start()\n if not p.ready:\n self._drain_complete_event.wait(timeout=timeout)\n\n self._ensure_not_shut_down()\n\n def _ensure_not_shut_down(self):\n \"\"\"Currently used to ensure the drainer has not run to completion.\n\n Raises if the shutdown event has been signaled (either due to an exception\n or stop() being called).\n\n The _shutdown event acts as synchronization to ensure _exc is properly\n set before it is read from, avoiding need for locks.\n \"\"\"\n if self._shutdown.is_set():\n if self._exc is not None:\n raise self._exc\n else:\n raise Exception(E_CELERY_RESTART_REQUIRED)\n\n\n@register_drainer('eventlet')\nclass eventletDrainer(greenletDrainer):\n\n def spawn(self, func):\n from eventlet import sleep, spawn\n g = spawn(func)\n sleep(0)\n return g\n\n def _event(self):\n return EventletAdaptedEvent()\n\n\n@register_drainer('gevent')\nclass geventDrainer(greenletDrainer):\n\n def spawn(self, func):\n import gevent\n g = gevent.spawn(func)\n gevent.sleep(0)\n return g\n\n def _event(self):\n from gevent.event import Event\n return Event()\n\n\nclass AsyncBackendMixin:\n \"\"\"Mixin for backends that enables the async API.\"\"\"\n\n def _collect_into(self, result, bucket):\n self.result_consumer.buckets[result] = bucket\n\n def iter_native(self, result, no_ack=True, **kwargs):\n self._ensure_not_eager()\n\n results = result.results\n if not results:\n raise StopIteration()\n\n # we tell the result consumer to put consumed results\n # into these buckets.\n bucket = deque()\n for node in results:\n if not hasattr(node, '_cache'):\n bucket.append(node)\n elif node._cache:\n bucket.append(node)\n else:\n self._collect_into(node, bucket)\n\n for _ in self._wait_for_pending(result, no_ack=no_ack, **kwargs):\n while bucket:\n node = bucket.popleft()\n if not hasattr(node, '_cache'):\n yield node.id, node.children\n else:\n yield node.id, node._cache\n while bucket:\n node = bucket.popleft()\n yield node.id, node._cache\n\n def add_pending_result(self, result, weak=False, start_drainer=True):\n if start_drainer:\n self.result_consumer.drainer.start()\n try:\n self._maybe_resolve_from_buffer(result)\n except Empty:\n self._add_pending_result(result.id, result, weak=weak)\n return result\n\n def _maybe_resolve_from_buffer(self, result):\n result._maybe_set_cache(self._pending_messages.take(result.id))\n\n def _add_pending_result(self\n# \u2026 (truncated at 8000 chars)"}} {"sample_id": "psf__black__do_splitter_match__downstream__2hop_5414f2", "repo": "psf/black", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["_assign_match", "_else_match", "_trailing_comma_tuple_match", "_assert_match", "_return_match", "_prefer_paren_wrap_match", "has_custom_splits", "_dict_or_lambda_match"], "hop_1_files": ["private/tmp/repos/psf__black/src/black/trans.py", "private/tmp/repos/psf__black/src/black/trans.py", "private/tmp/repos/psf__black/src/black/trans.py", "private/tmp/repos/psf__black/src/black/trans.py", "private/tmp/repos/psf__black/src/black/trans.py", "private/tmp/repos/psf__black/src/black/trans.py", "private/tmp/repos/psf__black/src/black/trans.py", "private/tmp/repos/psf__black/src/black/trans.py"], "hop_2": ["is_valid_index_factory", "_get_key", "StringParser", "parse"], "hop_2_files": ["private/tmp/repos/psf__black/src/black/trans.py", "private/tmp/repos/psf__black/src/black/trans.py", "private/tmp/repos/psf__black/src/black/trans.py", "private/tmp/repos/psf__black/src/black/trans.py"]}, "metadata": {"anchor": "do_splitter_match", "anchor_file": "private/tmp/repos/psf__black/src/black/trans.py", "anchor_source": "def do_splitter_match(self, line: Line) -> TMatchResult:\n LL = line.leaves\n\n if line.leaves[-1].type in OPENING_BRACKETS:\n return TErr(\n \"Cannot wrap parens around a line that ends in an opening bracket.\"\n )\n\n string_idx = (\n self._return_match(LL)\n or self._else_match(LL)\n or self._assert_match(LL)\n or self._assign_match(LL)\n or self._dict_or_lambda_match(LL)\n )\n\n if string_idx is None:\n string_idx = self._trailing_comma_tuple_match(line)\n\n if string_idx is None:\n string_idx = self._prefer_paren_wrap_match(LL)\n\n if string_idx is not None:\n string_value = line.leaves[string_idx].value\n # If the string has neither spaces nor East Asian stops...\n if not any(\n char == \" \" or char in SPLIT_SAFE_CHARS for char in string_value\n ):\n # And will still violate the line length limit when split...\n max_string_width = self.line_length - ((line.depth + 1) * 4)\n if str_width(string_value) > max_string_width:\n # And has no associated custom splits...\n if not self.has_custom_splits(string_value):\n # Then we should NOT put this string on its own line.\n return TErr(\n \"We do not wrap long strings in parentheses when the\"\n \" resultant line would still be over the specified line\"\n \" length and can't be split further by StringSplitter.\"\n )\n return Ok([string_idx])\n\n return TErr(\"This line does not contain any non-atomic strings.\")", "result_size": 4, "created_at": "2026-03-20T16:58:17.494246+00:00"}} {"sample_id": "celery__celery___expire_chord_key__downstream__1hop_2c32d9", "repo": "celery/celery", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["_firestore_document"], "call_files": ["private/tmp/repos/celery/celery/backends/gcs.py"]}, "metadata": {"anchor": "_expire_chord_key", "anchor_file": "private/tmp/repos/celery/celery/backends/gcs.py", "anchor_source": "def _expire_chord_key(self, key, expires):\n \"\"\"Set TTL policy for a Firestore document.\n\n Firestore ttl data is typically deleted within 24 hours after its\n expiration date.\n \"\"\"\n val_expires = datetime.utcnow() + timedelta(seconds=expires)\n doc = self._firestore_document(key)\n doc.set({self._field_expires: val_expires}, merge=True)", "result_size": 1, "created_at": "2026-03-20T16:58:16.326235+00:00"}} {"sample_id": "immerjs__immer__benchMethod__downstream__1hop_173e1a", "repo": "immerjs/immer", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["createInitialState"], "call_files": ["private/tmp/repos/immerjs__immer/perf-testing/immutability-benchmarks.mjs"]}, "metadata": {"anchor": "benchMethod", "anchor_file": "private/tmp/repos/immerjs__immer/perf-testing/immutability-benchmarks.mjs", "anchor_source": "function benchMethod() {\n\t\t\t\tsetAutoFreezes[version](freeze)\n\t\t\t\tsetStrictIteration[version](false)\n\t\t\t\tsetEnableArrayMethods[version]()\n\n\t\t\t\tlet state = createInitialState()\n\t\t\t\t// Use smaller array size for RTKQ benchmark due to exponential scaling\n\t\t\t\t// 100 items = ~15ms, 200 items = ~32ms, so 10000 would be impractical\n\t\t\t\tconst arraySize = 100\n\n\t\t\t\t// Phase 1: Execute all pending actions\n\t\t\t\tfor (let i = 0; i < arraySize; i++) {\n\t\t\t\t\tstate = reducers[version](state, rtkqPending(i))\n\t\t\t\t}\n\n\t\t\t\t// Phase 2: Execute all resolved actions\n\t\t\t\tfor (let i = 0; i < arraySize; i++) {\n\t\t\t\t\tstate = reducers[version](state, rtkqResolved(i))\n\t\t\t\t}\n\n\t\t\t\tsetAutoFreezes[version](false)\n\t\t\t}", "result_size": 1, "created_at": "2026-03-20T16:58:16.801413+00:00"}} {"sample_id": "locustio__locust__gt_zero__upstream__2hop_145840", "repo": "locustio/locust", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["checker", "setup_parser_arguments"], "hop_1_files": ["private/tmp/repos/locustio__locust/locust/argument_parser.py", "private/tmp/repos/locustio__locust/locust/argument_parser.py"], "hop_2": ["default_args_dict", "get_parser", "handle_message"], "hop_2_files": ["private/tmp/repos/locustio__locust/locust/argument_parser.py", "private/tmp/repos/locustio__locust/locust/argument_parser.py", "private/tmp/repos/locustio__locust/locust/runners.py"]}, "metadata": {"anchor": "gt_zero", "anchor_file": "private/tmp/repos/locustio__locust/locust/argument_parser.py", "anchor_source": "def gt_zero(t):\n def checker(value):\n v = t(value)\n if v <= 0:\n raise argparse.ArgumentTypeError(\"must be > 0\")\n return v\n\n return checker", "result_size": 3, "created_at": "2026-03-20T16:58:16.951273+00:00", "file_content": ""}} {"sample_id": "rq__rq__prepare_for_execution__upstream__2hop_c02f9f", "repo": "rq/rq", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["run_sync", "prepare_job_execution"], "hop_1_files": ["private/tmp/repos/rq__rq/rq/queue.py", "private/tmp/repos/rq__rq/rq/worker/base.py"], "hop_2": ["_enqueue_sync_job", "perform_job"], "hop_2_files": ["private/tmp/repos/rq__rq/rq/queue.py", "private/tmp/repos/rq__rq/rq/worker/base.py"]}, "metadata": {"anchor": "prepare_for_execution", "anchor_file": "private/tmp/repos/rq__rq/rq/job.py", "anchor_source": "def prepare_for_execution(self, worker_name: str, pipeline: 'Pipeline') -> None:\n \"\"\"Prepares the job for execution, setting the worker name,\n heartbeat information, status and other metadata before execution begins.\n\n Args:\n worker_name (str): The worker that will perform the job\n pipeline (Pipeline): The Redis' pipeline to use\n \"\"\"\n self.worker_name = worker_name\n self.last_heartbeat = now()\n self.started_at = self.last_heartbeat\n self._status = JobStatus.STARTED\n mapping: Mapping = {\n 'last_heartbeat': utcformat(self.last_heartbeat),\n 'status': self._status,\n 'started_at': utcformat(self.started_at),\n 'worker_name': worker_name,\n }\n pipeline.hset(self.key, mapping=mapping)", "result_size": 2, "created_at": "2026-03-20T16:58:17.875204+00:00", "file_content": ""}} {"sample_id": "trpc__trpc__createBody__downstream__1hop_1bc7bd", "repo": "trpc/trpc", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["TRPCError", "constructor"], "call_files": ["private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/error/TRPCError.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/error/TRPCError.ts"]}, "metadata": {"anchor": "createBody", "anchor_file": "private/tmp/repos/trpc__trpc/packages/server/src/adapters/node-http/incomingMessageToRequest.ts", "anchor_source": "function createBody(\n req: NodeHTTPRequest,\n opts: {\n /**\n * Max body size in bytes. If the body is larger than this, the request will be aborted\n */\n maxBodySize: number | null;\n },\n): RequestInit['body'] {\n // Some adapters will pre-parse the body and add it to the request object\n if ('body' in req) {\n if (req.body === undefined) {\n // If body property exists but is undefined, return undefined\n return undefined;\n }\n // If the body is already a string, return it directly\n if (typeof req.body === 'string') {\n return req.body;\n }\n // formData use\n if (req.body instanceof IncomingMessage) {\n return req.body as any;\n }\n // If body exists but isn't a string, stringify it as JSON\n return JSON.stringify(req.body);\n }\n let size = 0;\n let hasClosed = false;\n\n return new ReadableStream({\n start(controller) {\n const onData = (chunk: Buffer) => {\n size += chunk.length;\n if (!opts.maxBodySize || size <= opts.maxBodySize) {\n controller.enqueue(\n new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength),\n );\n return;\n }\n controller.error(\n new TRPCError({\n code: 'PAYLOAD_TOO_LARGE',\n }),\n );\n hasClosed = true;\n req.off('data', onData);\n req.off('end', onEnd);\n };\n\n const onEnd = () => {\n if (hasClosed) {\n return;\n }\n hasClosed = true;\n req.off('data', onData);\n req.off('end', onEnd);\n controller.close();\n };\n\n req.on('data', onData);\n req.on('end', onEnd);\n },\n cancel() {\n req.destroy();\n },\n });\n}", "result_size": 2, "created_at": "2026-03-20T16:58:18.199328+00:00"}} {"sample_id": "agronholm__apscheduler__marshal__upstream__2hop_6bb95c", "repo": "agronholm/apscheduler", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["_release_job"], "hop_1_files": ["private/tmp/repos/agronholm__apscheduler/src/apscheduler/datastores/sqlalchemy.py"], "hop_2": ["acquire_jobs", "cleanup", "reap_abandoned_jobs", "release_job"], "hop_2_files": ["private/tmp/repos/agronholm__apscheduler/src/apscheduler/datastores/sqlalchemy.py", "private/tmp/repos/agronholm__apscheduler/src/apscheduler/datastores/sqlalchemy.py", "private/tmp/repos/agronholm__apscheduler/src/apscheduler/datastores/sqlalchemy.py", "private/tmp/repos/agronholm__apscheduler/src/apscheduler/datastores/mongodb.py"]}, "metadata": {"anchor": "marshal", "anchor_file": "private/tmp/repos/agronholm__apscheduler/src/apscheduler/_structures.py", "anchor_source": "def marshal(self, serializer: Serializer) -> dict[str, Any]:\n marshalled = attrs.asdict(self, value_serializer=serialize)\n if self.outcome is JobOutcome.error:\n marshalled[\"exception\"] = serializer.serialize(self.exception)\n else:\n del marshalled[\"exception\"]\n\n if self.outcome is JobOutcome.success:\n marshalled[\"return_value\"] = serializer.serialize(self.return_value)\n else:\n del marshalled[\"return_value\"]\n\n return marshalled", "result_size": 8, "created_at": "2026-03-20T16:58:16.252821+00:00", "file_content": ""}} {"sample_id": "python-poetry__poetry__create_venv__downstream__2hop_717f83", "repo": "python-poetry/poetry", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["get_system_env", "build_venv", "use_in_project_venv", "get", "generate_env_name", "remove_venv"], "hop_1_files": ["private/tmp/repos/python-poetry__poetry/src/poetry/utils/env/env_manager.py", "private/tmp/repos/python-poetry__poetry/src/poetry/utils/env/env_manager.py", "private/tmp/repos/python-poetry__poetry/src/poetry/utils/env/env_manager.py", "private/tmp/repos/python-poetry__poetry/src/poetry/utils/env/env_manager.py", "private/tmp/repos/python-poetry__poetry/src/poetry/utils/env/env_manager.py", "private/tmp/repos/python-poetry__poetry/src/poetry/utils/env/env_manager.py"], "hop_2": ["in_project_venv_exists", "get_base_prefix"], "hop_2_files": ["private/tmp/repos/python-poetry__poetry/src/poetry/utils/env/env_manager.py", "private/tmp/repos/python-poetry__poetry/src/poetry/utils/env/env_manager.py"]}, "metadata": {"anchor": "create_venv", "anchor_file": "private/tmp/repos/python-poetry__poetry/src/poetry/utils/env/env_manager.py", "anchor_source": "def create_venv(\n self,\n name: str | None = None,\n python: Python | None = None,\n force: bool = False,\n ) -> Env:\n if self._env is not None and not force:\n return self._env\n\n cwd = self._poetry.file.path.parent\n env = self.get(reload=True)\n\n if not env.is_sane():\n force = True\n\n if env.is_venv() and not force:\n # Already inside a virtualenv.\n current_python = Version.parse(\n \".\".join(str(c) for c in env.version_info[:3])\n )\n if not self._poetry.package.python_constraint.allows(current_python):\n raise InvalidCurrentPythonVersionError(\n self._poetry.package.python_versions, str(current_python)\n )\n return env\n\n create_venv = self._poetry.config.get(\"virtualenvs.create\")\n in_project_venv = self.use_in_project_venv()\n venv_prompt = self._poetry.config.get(\"virtualenvs.prompt\")\n\n specific_python_requested = python is not None\n if not python:\n python = Python.get_preferred_python(\n config=self._poetry.config, io=self._io\n )\n\n venv_path = (\n self.in_project_venv\n if in_project_venv\n else self._poetry.config.virtualenvs_path\n )\n if not name:\n name = self._poetry.package.name\n\n supported_python = self._poetry.package.python_constraint\n if not supported_python.allows(python.patch_version):\n # The currently activated or chosen Python version\n # is not compatible with the Python constraint specified\n # for the project.\n # If an executable has been specified, we stop there\n # and notify the user of the incompatibility.\n # Otherwise, we try to find a compatible Python version.\n if specific_python_requested:\n raise NoCompatiblePythonVersionFoundError(\n self._poetry.package.python_versions,\n python.patch_version.to_string(),\n )\n\n self._io.write_error_line(\n f\"The currently activated Python version {python.patch_version.to_string()} is not\"\n f\" supported by the project ({self._poetry.package.python_versions}).\\n\"\n \"Trying to find and use a compatible version. \"\n )\n\n python = Python.get_compatible_python(poetry=self._poetry, io=self._io)\n\n if in_project_venv:\n venv = venv_path\n else:\n name = self.generate_env_name(name, str(cwd))\n name = f\"{name}-py{python.minor_version.to_string()}\"\n venv = venv_path / name\n\n if venv_prompt is not None:\n try:\n venv_prompt = venv_prompt.format(\n project_name=self._poetry.package.name or \"virtualenv\",\n python_version=python.minor_version.to_string(),\n )\n except KeyError as e:\n raise PoetryConsoleError(\n f\"Invalid template variable '{e.args[0]}' in 'virtualenvs.prompt' setting.\\n\"\n f\"Valid variables are: {{project_name}}, {{python_version}}\"\n ) from e\n except ValueError as e:\n raise PoetryConsoleError(\n f\"Invalid template string in 'virtualenvs.prompt' setting: {e}\"\n ) from e\n\n if not venv.exists():\n if create_venv is False:\n self._io.write_error_line(\n \"\"\n \"Skipping virtualenv creation, \"\n \"as specified in config file.\"\n \"\"\n )\n\n return self.get_system_env()\n\n self._io.write_error_line(\n f\"Creating virtualenv {name} in\"\n f\" {venv_path if not WINDOWS else get_real_windows_path(venv_path)!s}\"\n )\n else:\n create_venv = False\n if force:\n if not env.is_sane():\n self._io.write_error_line(\n f\"The virtual environment found in {env.path} seems to\"\n \" be broken.\"\n )\n self._io.write_error_line(\n f\"Recreating virtualenv {name} in {venv!s}\"\n )\n self.remove_venv(venv)\n create_venv = True\n elif self._io.is_very_verbose():\n self._io.write_error_line(f\"Virtualenv {name} already exists.\")\n\n if create_venv:\n self.build_venv(\n venv,\n executable=python.executable,\n flags=self._poetry.config.get(\"virtualenvs.options\"),\n prompt=venv_prompt,\n )\n\n # venv detection:\n # stdlib venv may symlink sys.executable, so we can't use realpath.\n # but others can symlink *to* the venv Python,\n # so we can't just use sys.executable.\n # So we just check every item in the symlink tree (generally <= 3)\n p = os.path.normcase(sys.executable)\n paths = [p]\n while os.path.islink(p):\n p = os.path.normcase(os.path.join(os.path.dirname(p), os.readlink(p)))\n paths.append(p)\n\n p_venv = os.path.normcase(str(venv))\n if any(p.startswith(p_venv) for p in paths):\n # Running properly in the virtualenv, don't need to do anything\n return self.get_system_env()\n\n return VirtualEnv(venv)", "result_size": 2, "created_at": "2026-03-20T16:58:17.758794+00:00"}} {"sample_id": "pallets__click___split_opt__upstream__1hop_faeb06", "repo": "pallets/click", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["get_help_extra", "_parse_decls", "join_options", "_normalize_opt"], "call_files": ["private/tmp/repos/pallets__click/src/click/core.py", "private/tmp/repos/pallets__click/src/click/core.py", "private/tmp/repos/pallets__click/src/click/formatting.py", "private/tmp/repos/pallets__click/src/click/parser.py"]}, "metadata": {"anchor": "_split_opt", "anchor_file": "private/tmp/repos/pallets__click/src/click/parser.py", "anchor_source": "def _split_opt(opt: str) -> tuple[str, str]:\n first = opt[:1]\n if first.isalnum():\n return \"\", opt\n if opt[1:2] == first:\n return opt[:2], opt[2:]\n return first, opt[1:]", "result_size": 4, "created_at": "2026-03-20T16:58:17.078639+00:00", "file_content": ""}} {"sample_id": "colinhacks__zod___null__upstream__2hop_c487ca", "repo": "colinhacks/zod", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["_null"], "hop_1_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/mini/schemas.ts"], "hop_2": ["json", "convertBaseSchema"], "hop_2_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/schemas.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/from-json-schema.ts"]}, "metadata": {"anchor": "_null", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/api.ts", "anchor_source": "export function _null(Class: util.SchemaClass, params?: string | $ZodNullParams): T {\n return new Class({\n type: \"null\",\n ...util.normalizeParams(params),\n });\n}", "result_size": 5, "created_at": "2026-03-20T16:58:16.474869+00:00", "file_content": ""}} {"sample_id": "colinhacks__zod___stringFormat__upstream__1hop_0a5d24", "repo": "colinhacks/zod", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["hostname", "stringFormat", "hash", "hex"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/mini/schemas.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/mini/schemas.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/schemas.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/mini/schemas.ts"]}, "metadata": {"anchor": "_stringFormat", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/api.ts", "anchor_source": "export function _stringFormat(\n Class: typeof schemas.$ZodCustomStringFormat,\n format: Format,\n fnOrRegex: ((arg: string) => util.MaybeAsync) | RegExp,\n _params: string | $ZodStringFormatParams = {}\n): schemas.$ZodCustomStringFormat {\n const params = util.normalizeParams(_params);\n const def: schemas.$ZodCustomStringFormatDef = {\n ...util.normalizeParams(_params),\n check: \"string_format\",\n type: \"string\",\n format,\n fn: typeof fnOrRegex === \"function\" ? fnOrRegex : (val) => fnOrRegex.test(val),\n ...params,\n };\n if (fnOrRegex instanceof RegExp) {\n def.pattern = fnOrRegex;\n }\n\n const inst = new Class(def);\n return inst as any;\n}", "result_size": 8, "created_at": "2026-03-20T16:58:16.474869+00:00", "file_content": ""}} {"sample_id": "psf__requests__requote_uri__upstream__2hop_c2881d", "repo": "psf/requests", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["prepare_url", "resolve_redirects"], "hop_1_files": ["private/tmp/repos/requests/src/requests/models.py", "private/tmp/repos/requests/src/requests/sessions.py"], "hop_2": ["send", "prepare"], "hop_2_files": ["private/tmp/repos/requests/src/requests/sessions.py", "private/tmp/repos/requests/src/requests/models.py"]}, "metadata": {"anchor": "requote_uri", "anchor_file": "private/tmp/repos/requests/src/requests/utils.py", "anchor_source": "def requote_uri(uri):\n \"\"\"Re-quote the given URI.\n\n This function passes the given URI through an unquote/quote cycle to\n ensure that it is fully and consistently quoted.\n\n :rtype: str\n \"\"\"\n safe_with_percent = \"!#$%&'()*+,/:;=?@[]~\"\n safe_without_percent = \"!#$&'()*+,/:;=?@[]~\"\n try:\n # Unquote only the unreserved characters\n # Then quote only illegal characters (do not quote reserved,\n # unreserved, or '%')\n return quote(unquote_unreserved(uri), safe=safe_with_percent)\n except InvalidURL:\n # We couldn't unquote the given URI, so let's try quoting it, but\n # there may be unquoted '%'s in the URI. We need to make sure they're\n # properly quoted so they do not cause issues elsewhere.\n return quote(uri, safe=safe_without_percent)", "result_size": 2, "created_at": "2026-03-20T16:58:17.570287+00:00", "file_content": "\"\"\"\nrequests.utils\n~~~~~~~~~~~~~~\n\nThis module provides utility functions that are used within Requests\nthat are also useful for external consumption.\n\"\"\"\n\nimport codecs\nimport contextlib\nimport io\nimport os\nimport re\nimport socket\nimport struct\nimport sys\nimport tempfile\nimport warnings\nimport zipfile\nfrom collections import OrderedDict\n\nfrom urllib3.util import make_headers, parse_url\n\nfrom . import certs\nfrom .__version__ import __version__\n\n# to_native_string is unused here, but imported here for backwards compatibility\nfrom ._internal_utils import ( # noqa: F401\n _HEADER_VALIDATORS_BYTE,\n _HEADER_VALIDATORS_STR,\n HEADER_VALIDATORS,\n to_native_string,\n)\nfrom .compat import (\n Mapping,\n basestring,\n bytes,\n getproxies,\n getproxies_environment,\n integer_types,\n is_urllib3_1,\n proxy_bypass,\n proxy_bypass_environment,\n quote,\n str,\n unquote,\n urlparse,\n urlunparse,\n)\nfrom .compat import parse_http_list as _parse_list_header\nfrom .cookies import cookiejar_from_dict\nfrom .exceptions import (\n FileModeWarning,\n InvalidHeader,\n InvalidURL,\n UnrewindableBodyError,\n)\nfrom .structures import CaseInsensitiveDict\n\nNETRC_FILES = (\".netrc\", \"_netrc\")\n\nDEFAULT_CA_BUNDLE_PATH = certs.where()\n\nDEFAULT_PORTS = {\"http\": 80, \"https\": 443}\n\n# Ensure that ', ' is used to preserve previous delimiter behavior.\nDEFAULT_ACCEPT_ENCODING = \", \".join(\n re.split(r\",\\s*\", make_headers(accept_encoding=True)[\"accept-encoding\"])\n)\n\n\nif sys.platform == \"win32\":\n # provide a proxy_bypass version on Windows without DNS lookups\n\n def proxy_bypass_registry(host):\n try:\n import winreg\n except ImportError:\n return False\n\n try:\n internetSettings = winreg.OpenKey(\n winreg.HKEY_CURRENT_USER,\n r\"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\",\n )\n # ProxyEnable could be REG_SZ or REG_DWORD, normalizing it\n proxyEnable = int(winreg.QueryValueEx(internetSettings, \"ProxyEnable\")[0])\n # ProxyOverride is almost always a string\n proxyOverride = winreg.QueryValueEx(internetSettings, \"ProxyOverride\")[0]\n except (OSError, ValueError):\n return False\n if not proxyEnable or not proxyOverride:\n return False\n\n # make a check value list from the registry entry: replace the\n # '' string by the localhost entry and the corresponding\n # canonical entry.\n proxyOverride = proxyOverride.split(\";\")\n # filter out empty strings to avoid re.match return true in the following code.\n proxyOverride = filter(None, proxyOverride)\n # now check if we match one of the registry values.\n for test in proxyOverride:\n if test == \"\":\n if \".\" not in host:\n return True\n test = test.replace(\".\", r\"\\.\") # mask dots\n test = test.replace(\"*\", r\".*\") # change glob sequence\n test = test.replace(\"?\", r\".\") # change glob char\n if re.match(test, host, re.I):\n return True\n return False\n\n def proxy_bypass(host): # noqa\n \"\"\"Return True, if the host should be bypassed.\n\n Checks proxy settings gathered from the environment, if specified,\n or the registry.\n \"\"\"\n if getproxies_environment():\n return proxy_bypass_environment(host)\n else:\n return proxy_bypass_registry(host)\n\n\ndef dict_to_sequence(d):\n \"\"\"Returns an internal sequence dictionary update.\"\"\"\n\n if hasattr(d, \"items\"):\n d = d.items()\n\n return d\n\n\ndef super_len(o):\n total_length = None\n current_position = 0\n\n if not is_urllib3_1 and isinstance(o, str):\n # urllib3 2.x+ treats all strings as utf-8 instead\n # of latin-1 (iso-8859-1) like http.client.\n o = o.encode(\"utf-8\")\n\n if hasattr(o, \"__len__\"):\n total_length = len(o)\n\n elif hasattr(o, \"len\"):\n total_length = o.len\n\n elif hasattr(o, \"fileno\"):\n try:\n fileno = o.fileno()\n except (io.UnsupportedOperation, AttributeError):\n # AttributeError is a surprising exception, seeing as how we've just checked\n # that `hasattr(o, 'fileno')`. It happens for objects obtained via\n # `Tarfile.extractfile()`, per issue 5229.\n pass\n else:\n total_length = os.fstat(fileno).st_size\n\n # Having used fstat to determine the file length, we need to\n # confirm that this file was opened up in binary mode.\n if \"b\" not in o.mode:\n warnings.warn(\n (\n \"Requests has determined the content-length for this \"\n \"request using the binary size of the file: however, the \"\n \"file has been opened in text mode (i.e. without the 'b' \"\n \"flag in the mode). This may lead to an incorrect \"\n \"content-length. In Requests 3.0, support will be removed \"\n \"for files in text mode.\"\n ),\n FileModeWarning,\n )\n\n if hasattr(o, \"tell\"):\n try:\n current_position = o.tell()\n except OSError:\n # This can happen in some weird situations, such as when the file\n # is actually a special file descriptor like stdin. In this\n # instance, we don't know what the length is, so set it to zero and\n # let requests chunk it instead.\n if total_length is not None:\n current_position = total_length\n else:\n if hasattr(o, \"seek\") and total_length is None:\n # StringIO and BytesIO have seek but no usable fileno\n try:\n # seek to end of file\n o.seek(0, 2)\n total_length = o.tell()\n\n # seek back to current position to support\n # partially read file-like objects\n o.seek(current_position or 0)\n except OSError:\n total_length = 0\n\n if total_length is None:\n total_length = 0\n\n return max(0, total_length - current_position)\n\n\ndef get_netrc_auth(url, raise_errors=False):\n \"\"\"Returns the Requests tuple auth for a given url from netrc.\"\"\"\n\n netrc_file = os.environ.get(\"NETRC\")\n if netrc_file is not None:\n netrc_locations = (netrc_file,)\n else:\n netrc_locations = (f\"~/{f}\" for f in NETRC_FILES)\n\n try:\n from netrc import NetrcParseError, netrc\n\n netrc_path = None\n\n for f in netrc_locations:\n loc = os.path.expanduser(f)\n if os.path.exists(loc):\n netrc_path = loc\n break\n\n # Abort early if there isn't one.\n if netrc_path is None:\n return\n\n ri = urlparse(url)\n host = ri.hostname\n\n try:\n _netrc = netrc(netrc_path).authenticators(host)\n if _netrc and any(_netrc):\n # Return with login / password\n login_i = 0 if _netrc[0] else 1\n return (_netrc[login_i], _netrc[2])\n except (NetrcParseError, OSError):\n # If there was a parsing error or a permissions issue reading the file,\n # we'll just skip netrc auth unless explicitly asked to raise errors.\n if raise_errors:\n raise\n\n # App Engine hackiness.\n except (ImportError, AttributeError):\n pass\n\n\ndef guess_filename(obj):\n \"\"\"Tries to guess the filename of the given object.\"\"\"\n name = getattr(obj, \"name\", None)\n if name and isinstance(name, basestring) and name[0] != \"<\" and name[-1] != \">\":\n return os.path.basename(name)\n\n\ndef extract_zipped_paths(path):\n \"\"\"Replace nonexistent paths that look \n# \u2026 (truncated at 8000 chars)"}} {"sample_id": "celery__celery__OK__downstream__1hop_8ba42f", "repo": "celery/celery", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["style"], "call_files": ["private/tmp/repos/celery/celery/bin/base.py"]}, "metadata": {"anchor": "OK", "anchor_file": "private/tmp/repos/celery/celery/bin/base.py", "anchor_source": "@cached_property\n def OK(self):\n return self.style(\"OK\", fg=\"green\", bold=True)", "result_size": 1, "created_at": "2026-03-20T16:58:16.326235+00:00"}} {"sample_id": "colinhacks__zod___boolean__upstream__2hop_25d52d", "repo": "colinhacks/zod", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["boolean"], "hop_1_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/mini/schemas.ts"], "hop_2": ["json", "convertBaseSchema"], "hop_2_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/schemas.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/from-json-schema.ts"]}, "metadata": {"anchor": "_boolean", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/api.ts", "anchor_source": "export function _boolean(\n Class: util.SchemaClass,\n params?: string | $ZodBooleanParams\n): T {\n return new Class({\n type: \"boolean\",\n ...util.normalizeParams(params),\n });\n}", "result_size": 5, "created_at": "2026-03-20T16:58:16.474869+00:00", "file_content": ""}} {"sample_id": "colinhacks__zod___stringFormat__downstream__1hop_602023", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["normalizeParams"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/util.ts"]}, "metadata": {"anchor": "_stringFormat", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/api.ts", "anchor_source": "export function _stringFormat(\n Class: typeof schemas.$ZodCustomStringFormat,\n format: Format,\n fnOrRegex: ((arg: string) => util.MaybeAsync) | RegExp,\n _params: string | $ZodStringFormatParams = {}\n): schemas.$ZodCustomStringFormat {\n const params = util.normalizeParams(_params);\n const def: schemas.$ZodCustomStringFormatDef = {\n ...util.normalizeParams(_params),\n check: \"string_format\",\n type: \"string\",\n format,\n fn: typeof fnOrRegex === \"function\" ? fnOrRegex : (val) => fnOrRegex.test(val),\n ...params,\n };\n if (fnOrRegex instanceof RegExp) {\n def.pattern = fnOrRegex;\n }\n\n const inst = new Class(def);\n return inst as any;\n}", "result_size": 1, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "celery__celery__on_apply__downstream__1hop_f73f55", "repo": "celery/celery", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["_make_killable_target", "on_start", "TaskPool", "_add_to_pool_map"], "call_files": ["private/tmp/repos/celery/celery/concurrency/eventlet.py", "private/tmp/repos/celery/celery/concurrency/eventlet.py", "private/tmp/repos/celery/celery/concurrency/eventlet.py", "private/tmp/repos/celery/celery/concurrency/eventlet.py"]}, "metadata": {"anchor": "on_apply", "anchor_file": "private/tmp/repos/celery/celery/concurrency/eventlet.py", "anchor_source": "def on_apply(self, target, args=None, kwargs=None, callback=None,\n accept_callback=None, **_):\n target = TaskPool._make_killable_target(target)\n self._quick_apply_sig(sender=self, target=target, args=args, kwargs=kwargs,)\n greenlet = self._quick_put(\n apply_target,\n target, args,\n kwargs,\n callback,\n accept_callback,\n self.getpid\n )\n self._add_to_pool_map(id(greenlet), greenlet)", "result_size": 4, "created_at": "2026-03-20T16:58:16.326235+00:00"}} {"sample_id": "encode__django-rest-framework__get_responses__downstream__1hop_122c99", "repo": "encode/django-rest-framework", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["get_response_serializer", "get_reference", "get_paginator", "map_renderers"], "call_files": ["private/tmp/repos/django-rest-framework/rest_framework/schemas/openapi.py", "private/tmp/repos/django-rest-framework/rest_framework/schemas/openapi.py", "private/tmp/repos/django-rest-framework/rest_framework/schemas/openapi.py", "private/tmp/repos/django-rest-framework/rest_framework/schemas/openapi.py"]}, "metadata": {"anchor": "get_responses", "anchor_file": "private/tmp/repos/django-rest-framework/rest_framework/schemas/openapi.py", "anchor_source": "def get_responses(self, path, method):\n if method == 'DELETE':\n return {\n '204': {\n 'description': ''\n }\n }\n\n self.response_media_types = self.map_renderers(path, method)\n\n serializer = self.get_response_serializer(path, method)\n\n if not isinstance(serializer, serializers.Serializer):\n item_schema = {}\n else:\n item_schema = self.get_reference(serializer)\n\n if is_list_view(path, method, self.view):\n response_schema = {\n 'type': 'array',\n 'items': item_schema,\n }\n paginator = self.get_paginator()\n if paginator:\n response_schema = paginator.get_paginated_response_schema(response_schema)\n else:\n response_schema = item_schema\n status_code = '201' if method == 'POST' else '200'\n return {\n status_code: {\n 'content': {\n ct: {'schema': response_schema}\n for ct in self.response_media_types\n },\n # description is a mandatory property,\n # https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#responseObject\n # TODO: put something meaningful into it\n 'description': \"\"\n }\n }", "result_size": 4, "created_at": "2026-03-20T16:58:16.616316+00:00"}} {"sample_id": "locustio__locust__error__upstream__1hop_b736e2", "repo": "locustio/locust", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["main", "parse_options"], "call_files": ["private/tmp/repos/locustio__locust/locust/main.py", "private/tmp/repos/locustio__locust/locust/argument_parser.py"]}, "metadata": {"anchor": "error", "anchor_file": "private/tmp/repos/locustio__locust/locust/argument_parser.py", "anchor_source": "def error(self, message):\n if \"unrecognized arguments:\" in message:\n bad_arg = message.split(\"unrecognized arguments:\")[1].strip().split()[0]\n options = [opt for action in self._actions for opt in action.option_strings]\n suggestion = difflib.get_close_matches(bad_arg, options, n=1)\n if suggestion:\n message += f\"\\nDid you mean '{suggestion[0]}'?\"\n self.exit(2, f\"{self.prog}: error: {message}\\n\")", "result_size": 2, "created_at": "2026-03-20T16:58:16.951273+00:00", "file_content": ""}} {"sample_id": "immerjs__immer__getPlugin__upstream__1hop_153b7e", "repo": "immerjs/immer", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["createProxy", "usePatchesInScope", "applyPatches"], "call_files": ["private/tmp/repos/immerjs__immer/src/core/immerClass.ts", "private/tmp/repos/immerjs__immer/src/core/scope.ts", "private/tmp/repos/immerjs__immer/src/core/immerClass.ts"]}, "metadata": {"anchor": "getPlugin", "anchor_file": "private/tmp/repos/immerjs__immer/src/utils/plugins.ts", "anchor_source": "export function getPlugin(\n\tpluginKey: K\n): Exclude {\n\tconst plugin = plugins[pluginKey]\n\tif (!plugin) {\n\t\tdie(0, pluginKey)\n\t}\n\t// @ts-ignore\n\treturn plugin\n}", "result_size": 3, "created_at": "2026-03-20T16:58:16.801413+00:00", "file_content": ""}} {"sample_id": "trpc__trpc__dataLoader__upstream__1hop_0f5461", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["dispatch", "httpBatchStreamLink", "httpBatchLink"], "call_files": ["private/tmp/repos/trpc__trpc/packages/client/src/internals/dataLoader.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/httpBatchStreamLink.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/httpBatchLink.ts"]}, "metadata": {"anchor": "dataLoader", "anchor_file": "private/tmp/repos/trpc__trpc/packages/client/src/internals/dataLoader.ts", "anchor_source": "export function dataLoader(\n batchLoader: BatchLoader,\n) {\n let pendingItems: BatchItem[] | null = null;\n let dispatchTimer: ReturnType | null = null;\n\n const destroyTimerAndPendingItems = () => {\n clearTimeout(dispatchTimer as any);\n dispatchTimer = null;\n pendingItems = null;\n };\n\n /**\n * Iterate through the items and split them into groups based on the `batchLoader`'s validate function\n */\n function groupItems(items: BatchItem[]) {\n const groupedItems: BatchItem[][] = [[]];\n let index = 0;\n while (true) {\n const item = items[index];\n if (!item) {\n // we're done\n break;\n }\n const lastGroup = groupedItems[groupedItems.length - 1]!;\n\n if (item.aborted) {\n // Item was aborted before it was dispatched\n item.reject?.(new Error('Aborted'));\n index++;\n continue;\n }\n\n const isValid = batchLoader.validate(\n lastGroup.concat(item).map((it) => it.key),\n );\n\n if (isValid) {\n lastGroup.push(item);\n index++;\n continue;\n }\n\n if (lastGroup.length === 0) {\n item.reject?.(new Error('Input is too big for a single dispatch'));\n index++;\n continue;\n }\n // Create new group, next iteration will try to add the item to that\n groupedItems.push([]);\n }\n return groupedItems;\n }\n\n function dispatch() {\n const groupedItems = groupItems(pendingItems!);\n destroyTimerAndPendingItems();\n\n // Create batches for each group of items\n for (const items of groupedItems) {\n if (!items.length) {\n continue;\n }\n const batch: Batch = {\n items,\n };\n for (const item of items) {\n item.batch = batch;\n }\n const promise = batchLoader.fetch(batch.items.map((_item) => _item.key));\n\n promise\n .then(async (result) => {\n await Promise.all(\n result.map(async (valueOrPromise, index) => {\n const item = batch.items[index]!;\n try {\n const value = await Promise.resolve(valueOrPromise);\n\n item.resolve?.(value);\n } catch (cause) {\n item.reject?.(cause as Error);\n }\n\n item.batch = null;\n item.reject = null;\n item.resolve = null;\n }),\n );\n\n for (const item of batch.items) {\n item.reject?.(new Error('Missing result'));\n item.batch = null;\n }\n })\n .catch((cause) => {\n for (const item of batch.items) {\n item.reject?.(cause);\n item.batch = null;\n }\n });\n }\n }\n function load(key: TKey): Promise {\n const item: BatchItem = {\n aborted: false,\n key,\n batch: null,\n resolve: throwFatalError,\n reject: throwFatalError,\n };\n\n const promise = new Promise((resolve, reject) => {\n item.reject = reject;\n item.resolve = resolve;\n\n pendingItems ??= [];\n pendingItems.push(item);\n });\n\n dispatchTimer ??= setTimeout(dispatch);\n\n return promise;\n }\n\n return {\n load,\n };\n}", "result_size": 7, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "psf__requests__get_auth_from_url__upstream__2hop_6ad47f", "repo": "psf/requests", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["proxy_headers", "proxy_manager_for", "rebuild_proxies", "prepare_auth"], "hop_1_files": ["private/tmp/repos/requests/src/requests/adapters.py", "private/tmp/repos/requests/src/requests/adapters.py", "private/tmp/repos/requests/src/requests/sessions.py", "private/tmp/repos/requests/src/requests/models.py"], "hop_2": ["get_connection_with_tls_context", "get_connection", "resolve_redirects", "prepare"], "hop_2_files": ["private/tmp/repos/requests/src/requests/adapters.py", "private/tmp/repos/requests/src/requests/adapters.py", "private/tmp/repos/requests/src/requests/sessions.py", "private/tmp/repos/requests/src/requests/models.py"]}, "metadata": {"anchor": "get_auth_from_url", "anchor_file": "private/tmp/repos/requests/src/requests/utils.py", "anchor_source": "def get_auth_from_url(url):\n \"\"\"Given a url with authentication components, extract them into a tuple of\n username,password.\n\n :rtype: (str,str)\n \"\"\"\n parsed = urlparse(url)\n\n try:\n auth = (unquote(parsed.username), unquote(parsed.password))\n except (AttributeError, TypeError):\n auth = (\"\", \"\")\n\n return auth", "result_size": 4, "created_at": "2026-03-20T16:58:17.570287+00:00", "file_content": "\"\"\"\nrequests.utils\n~~~~~~~~~~~~~~\n\nThis module provides utility functions that are used within Requests\nthat are also useful for external consumption.\n\"\"\"\n\nimport codecs\nimport contextlib\nimport io\nimport os\nimport re\nimport socket\nimport struct\nimport sys\nimport tempfile\nimport warnings\nimport zipfile\nfrom collections import OrderedDict\n\nfrom urllib3.util import make_headers, parse_url\n\nfrom . import certs\nfrom .__version__ import __version__\n\n# to_native_string is unused here, but imported here for backwards compatibility\nfrom ._internal_utils import ( # noqa: F401\n _HEADER_VALIDATORS_BYTE,\n _HEADER_VALIDATORS_STR,\n HEADER_VALIDATORS,\n to_native_string,\n)\nfrom .compat import (\n Mapping,\n basestring,\n bytes,\n getproxies,\n getproxies_environment,\n integer_types,\n is_urllib3_1,\n proxy_bypass,\n proxy_bypass_environment,\n quote,\n str,\n unquote,\n urlparse,\n urlunparse,\n)\nfrom .compat import parse_http_list as _parse_list_header\nfrom .cookies import cookiejar_from_dict\nfrom .exceptions import (\n FileModeWarning,\n InvalidHeader,\n InvalidURL,\n UnrewindableBodyError,\n)\nfrom .structures import CaseInsensitiveDict\n\nNETRC_FILES = (\".netrc\", \"_netrc\")\n\nDEFAULT_CA_BUNDLE_PATH = certs.where()\n\nDEFAULT_PORTS = {\"http\": 80, \"https\": 443}\n\n# Ensure that ', ' is used to preserve previous delimiter behavior.\nDEFAULT_ACCEPT_ENCODING = \", \".join(\n re.split(r\",\\s*\", make_headers(accept_encoding=True)[\"accept-encoding\"])\n)\n\n\nif sys.platform == \"win32\":\n # provide a proxy_bypass version on Windows without DNS lookups\n\n def proxy_bypass_registry(host):\n try:\n import winreg\n except ImportError:\n return False\n\n try:\n internetSettings = winreg.OpenKey(\n winreg.HKEY_CURRENT_USER,\n r\"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\",\n )\n # ProxyEnable could be REG_SZ or REG_DWORD, normalizing it\n proxyEnable = int(winreg.QueryValueEx(internetSettings, \"ProxyEnable\")[0])\n # ProxyOverride is almost always a string\n proxyOverride = winreg.QueryValueEx(internetSettings, \"ProxyOverride\")[0]\n except (OSError, ValueError):\n return False\n if not proxyEnable or not proxyOverride:\n return False\n\n # make a check value list from the registry entry: replace the\n # '' string by the localhost entry and the corresponding\n # canonical entry.\n proxyOverride = proxyOverride.split(\";\")\n # filter out empty strings to avoid re.match return true in the following code.\n proxyOverride = filter(None, proxyOverride)\n # now check if we match one of the registry values.\n for test in proxyOverride:\n if test == \"\":\n if \".\" not in host:\n return True\n test = test.replace(\".\", r\"\\.\") # mask dots\n test = test.replace(\"*\", r\".*\") # change glob sequence\n test = test.replace(\"?\", r\".\") # change glob char\n if re.match(test, host, re.I):\n return True\n return False\n\n def proxy_bypass(host): # noqa\n \"\"\"Return True, if the host should be bypassed.\n\n Checks proxy settings gathered from the environment, if specified,\n or the registry.\n \"\"\"\n if getproxies_environment():\n return proxy_bypass_environment(host)\n else:\n return proxy_bypass_registry(host)\n\n\ndef dict_to_sequence(d):\n \"\"\"Returns an internal sequence dictionary update.\"\"\"\n\n if hasattr(d, \"items\"):\n d = d.items()\n\n return d\n\n\ndef super_len(o):\n total_length = None\n current_position = 0\n\n if not is_urllib3_1 and isinstance(o, str):\n # urllib3 2.x+ treats all strings as utf-8 instead\n # of latin-1 (iso-8859-1) like http.client.\n o = o.encode(\"utf-8\")\n\n if hasattr(o, \"__len__\"):\n total_length = len(o)\n\n elif hasattr(o, \"len\"):\n total_length = o.len\n\n elif hasattr(o, \"fileno\"):\n try:\n fileno = o.fileno()\n except (io.UnsupportedOperation, AttributeError):\n # AttributeError is a surprising exception, seeing as how we've just checked\n # that `hasattr(o, 'fileno')`. It happens for objects obtained via\n # `Tarfile.extractfile()`, per issue 5229.\n pass\n else:\n total_length = os.fstat(fileno).st_size\n\n # Having used fstat to determine the file length, we need to\n # confirm that this file was opened up in binary mode.\n if \"b\" not in o.mode:\n warnings.warn(\n (\n \"Requests has determined the content-length for this \"\n \"request using the binary size of the file: however, the \"\n \"file has been opened in text mode (i.e. without the 'b' \"\n \"flag in the mode). This may lead to an incorrect \"\n \"content-length. In Requests 3.0, support will be removed \"\n \"for files in text mode.\"\n ),\n FileModeWarning,\n )\n\n if hasattr(o, \"tell\"):\n try:\n current_position = o.tell()\n except OSError:\n # This can happen in some weird situations, such as when the file\n # is actually a special file descriptor like stdin. In this\n # instance, we don't know what the length is, so set it to zero and\n # let requests chunk it instead.\n if total_length is not None:\n current_position = total_length\n else:\n if hasattr(o, \"seek\") and total_length is None:\n # StringIO and BytesIO have seek but no usable fileno\n try:\n # seek to end of file\n o.seek(0, 2)\n total_length = o.tell()\n\n # seek back to current position to support\n # partially read file-like objects\n o.seek(current_position or 0)\n except OSError:\n total_length = 0\n\n if total_length is None:\n total_length = 0\n\n return max(0, total_length - current_position)\n\n\ndef get_netrc_auth(url, raise_errors=False):\n \"\"\"Returns the Requests tuple auth for a given url from netrc.\"\"\"\n\n netrc_file = os.environ.get(\"NETRC\")\n if netrc_file is not None:\n netrc_locations = (netrc_file,)\n else:\n netrc_locations = (f\"~/{f}\" for f in NETRC_FILES)\n\n try:\n from netrc import NetrcParseError, netrc\n\n netrc_path = None\n\n for f in netrc_locations:\n loc = os.path.expanduser(f)\n if os.path.exists(loc):\n netrc_path = loc\n break\n\n # Abort early if there isn't one.\n if netrc_path is None:\n return\n\n ri = urlparse(url)\n host = ri.hostname\n\n try:\n _netrc = netrc(netrc_path).authenticators(host)\n if _netrc and any(_netrc):\n # Return with login / password\n login_i = 0 if _netrc[0] else 1\n return (_netrc[login_i], _netrc[2])\n except (NetrcParseError, OSError):\n # If there was a parsing error or a permissions issue reading the file,\n # we'll just skip netrc auth unless explicitly asked to raise errors.\n if raise_errors:\n raise\n\n # App Engine hackiness.\n except (ImportError, AttributeError):\n pass\n\n\ndef guess_filename(obj):\n \"\"\"Tries to guess the filename of the given object.\"\"\"\n name = getattr(obj, \"name\", None)\n if name and isinstance(name, basestring) and name[0] != \"<\" and name[-1] != \">\":\n return os.path.basename(name)\n\n\ndef extract_zipped_paths(path):\n \"\"\"Replace nonexistent paths that look \n# \u2026 (truncated at 8000 chars)"}} {"sample_id": "colinhacks__zod__addIssueToContext__downstream__1hop_090cc2", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["getErrorMap"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/errors.ts"]}, "metadata": {"anchor": "addIssueToContext", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/helpers/parseUtil.ts", "anchor_source": "export function addIssueToContext(ctx: ParseContext, issueData: IssueData): void {\n const overrideMap = getErrorMap();\n const issue = makeIssue({\n issueData: issueData,\n data: ctx.data,\n path: ctx.path,\n errorMaps: [\n ctx.common.contextualErrorMap, // contextual error map is first priority\n ctx.schemaErrorMap, // then schema-bound map if available\n overrideMap, // then global override map\n overrideMap === defaultErrorMap ? undefined : defaultErrorMap, // then global default map\n ].filter((x) => !!x),\n });\n ctx.common.issues.push(issue);\n}", "result_size": 1, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "trpc__trpc__withPing__upstream__2hop_785a90", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["generator", "createBatchStreamProducer", "sseStreamProducer"], "hop_1_files": ["private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/sse.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/jsonl.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/sse.ts"], "hop_2": ["jsonlStreamProducer", "resolveResponse", "generatorWithErrorHandling"], "hop_2_files": ["private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/jsonl.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/http/resolveResponse.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/sse.ts"]}, "metadata": {"anchor": "withPing", "anchor_file": "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/utils/withPing.ts", "anchor_source": "export async function* withPing(\n iterable: AsyncIterable,\n pingIntervalMs: number,\n): AsyncGenerator {\n await using iterator = iteratorResource(iterable);\n\n // declaration outside the loop for garbage collection reasons\n let result:\n | null\n | IteratorResult\n | typeof disposablePromiseTimerResult;\n\n let nextPromise = iterator.next();\n\n while (true) {\n using pingPromise = timerResource(pingIntervalMs);\n\n result = await Unpromise.race([nextPromise, pingPromise.start()]);\n\n if (result === disposablePromiseTimerResult) {\n // cancelled\n\n yield PING_SYM;\n continue;\n }\n\n if (result.done) {\n return result.value;\n }\n\n nextPromise = iterator.next();\n yield result.value;\n\n // free up reference for garbage collection\n result = null;\n }\n}", "result_size": 6, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "colinhacks__zod__shallowClone__downstream__1hop_017ba3", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["isPlainObject"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/util.ts"]}, "metadata": {"anchor": "shallowClone", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/util.ts", "anchor_source": "export function shallowClone(o: any): any {\n if (isPlainObject(o)) return { ...o };\n if (Array.isArray(o)) return [...o];\n return o;\n}", "result_size": 1, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "colinhacks__zod__safeParse__downstream__2hop_641106", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["_parseSync"], "hop_1_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"], "hop_2": ["_parse"], "hop_2_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"]}, "metadata": {"anchor": "safeParse", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "anchor_source": "safeParse(data: unknown, params?: util.InexactPartial): SafeParseReturnType {\n const ctx: ParseContext = {\n common: {\n issues: [],\n async: params?.async ?? false,\n contextualErrorMap: params?.errorMap,\n },\n path: params?.path || [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: getParsedType(data),\n };\n const result = this._parseSync({ data, path: ctx.path, parent: ctx });\n\n return handleResult(ctx, result);\n }", "result_size": 1, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "locustio__locust__raise_argument_type_error__upstream__2hop_2757c1", "repo": "locustio/locust", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["setup_parser_arguments"], "hop_1_files": ["private/tmp/repos/locustio__locust/locust/argument_parser.py"], "hop_2": ["default_args_dict", "get_parser", "handle_message"], "hop_2_files": ["private/tmp/repos/locustio__locust/locust/argument_parser.py", "private/tmp/repos/locustio__locust/locust/argument_parser.py", "private/tmp/repos/locustio__locust/locust/runners.py"]}, "metadata": {"anchor": "raise_argument_type_error", "anchor_file": "private/tmp/repos/locustio__locust/locust/argument_parser.py", "anchor_source": "def raise_argument_type_error(err_msg):\n class ErrorRaisingAction(configargparse.Action):\n def __call__(self, parser, namespace, values, option_string=None):\n raise configargparse.ArgumentError(self, err_msg)\n\n return ErrorRaisingAction", "result_size": 3, "created_at": "2026-03-20T16:58:16.951273+00:00", "file_content": ""}} {"sample_id": "sindresorhus__got__proxyEvents__upstream__1hop_b2a259", "repo": "sindresorhus/got", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["_onRequest", "asPromise"], "call_files": ["private/tmp/repos/got/source/core/index.ts", "private/tmp/repos/got/source/as-promise/index.ts"]}, "metadata": {"anchor": "proxyEvents", "anchor_file": "private/tmp/repos/got/source/core/utils/proxy-events.ts", "anchor_source": "export default function proxyEvents(from: EventEmitter, to: EventEmitter, events: readonly string[]): () => void {\n\tconst eventFunctions: Functions = {};\n\n\tfor (const event of events) {\n\t\tconst eventFunction = (...arguments_: unknown[]) => {\n\t\t\tto.emit(event, ...arguments_);\n\t\t};\n\n\t\teventFunctions[event] = eventFunction;\n\n\t\tfrom.on(event, eventFunction);\n\t}\n\n\treturn () => {\n\t\tfor (const [event, eventFunction] of Object.entries(eventFunctions)) {\n\t\t\tfrom.off(event, eventFunction);\n\t\t}\n\t};\n}", "result_size": 4, "created_at": "2026-03-20T16:58:18.104721+00:00", "file_content": "import type {EventEmitter} from 'node:events';\n\ntype AnyFunction = (...arguments_: unknown[]) => void;\ntype Functions = Record;\n\nexport default function proxyEvents(from: EventEmitter, to: EventEmitter, events: readonly string[]): () => void {\n\tconst eventFunctions: Functions = {};\n\n\tfor (const event of events) {\n\t\tconst eventFunction = (...arguments_: unknown[]) => {\n\t\t\tto.emit(event, ...arguments_);\n\t\t};\n\n\t\teventFunctions[event] = eventFunction;\n\n\t\tfrom.on(event, eventFunction);\n\t}\n\n\treturn () => {\n\t\tfor (const [event, eventFunction] of Object.entries(eventFunctions)) {\n\t\t\tfrom.off(event, eventFunction);\n\t\t}\n\t};\n}\n"}} {"sample_id": "pallets__click___split_opt__upstream__2hop_d90116", "repo": "pallets/click", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["get_help_extra", "_parse_decls", "join_options", "_normalize_opt"], "hop_1_files": ["private/tmp/repos/pallets__click/src/click/core.py", "private/tmp/repos/pallets__click/src/click/core.py", "private/tmp/repos/pallets__click/src/click/formatting.py", "private/tmp/repos/pallets__click/src/click/parser.py"], "hop_2": ["get_help_record", "add_option", "_match_short_opt", "_process_opts", "_write_opts"], "hop_2_files": ["private/tmp/repos/pallets__click/src/click/core.py", "private/tmp/repos/pallets__click/src/click/parser.py", "private/tmp/repos/pallets__click/src/click/parser.py", "private/tmp/repos/pallets__click/src/click/parser.py", "private/tmp/repos/pallets__click/src/click/core.py"]}, "metadata": {"anchor": "_split_opt", "anchor_file": "private/tmp/repos/pallets__click/src/click/parser.py", "anchor_source": "def _split_opt(opt: str) -> tuple[str, str]:\n first = opt[:1]\n if first.isalnum():\n return \"\", opt\n if opt[1:2] == first:\n return opt[:2], opt[2:]\n return first, opt[1:]", "result_size": 5, "created_at": "2026-03-20T16:58:17.078639+00:00", "file_content": ""}} {"sample_id": "rq__rq__schedule_job__upstream__1hop_010521", "repo": "rq/rq", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["retry", "_handle_retry_result", "enqueue_at", "schedule"], "call_files": ["private/tmp/repos/rq__rq/rq/job.py", "private/tmp/repos/rq__rq/rq/job.py", "private/tmp/repos/rq__rq/rq/queue.py", "private/tmp/repos/rq__rq/rq/repeat.py"]}, "metadata": {"anchor": "schedule_job", "anchor_file": "private/tmp/repos/rq__rq/rq/queue.py", "anchor_source": "def schedule_job(self, job: 'Job', datetime: datetime, pipeline: Optional['Pipeline'] = None):\n \"\"\"Puts job on ScheduledJobRegistry\n\n Args:\n job (Job): _description_\n datetime (datetime): _description_\n pipeline (Optional[Pipeline], optional): _description_. Defaults to None.\n\n Returns:\n _type_: _description_\n \"\"\"\n from .registry import ScheduledJobRegistry\n\n registry = ScheduledJobRegistry(queue=self)\n\n pipe = pipeline if pipeline is not None else self.connection.pipeline()\n\n # Add Queue key set\n pipe.sadd(self.redis_queues_keys, self.key)\n job.save(pipeline=pipe)\n registry.schedule(job, datetime, pipeline=pipe)\n if pipeline is None:\n pipe.execute()\n return job", "result_size": 4, "created_at": "2026-03-20T16:58:17.875204+00:00", "file_content": ""}} {"sample_id": "psf__requests__set_cookie__upstream__2hop_f75911", "repo": "psf/requests", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["set", "cookiejar_from_dict", "update"], "hop_1_files": ["private/tmp/repos/requests/src/requests/cookies.py", "private/tmp/repos/requests/src/requests/cookies.py", "private/tmp/repos/requests/src/requests/cookies.py"], "hop_2": ["__setitem__", "copy", "prepare_cookies", "merge_cookies", "prepare_request"], "hop_2_files": ["private/tmp/repos/requests/src/requests/cookies.py", "private/tmp/repos/requests/src/requests/cookies.py", "private/tmp/repos/requests/src/requests/models.py", "private/tmp/repos/requests/src/requests/cookies.py", "private/tmp/repos/requests/src/requests/sessions.py"]}, "metadata": {"anchor": "set_cookie", "anchor_file": "private/tmp/repos/requests/src/requests/cookies.py", "anchor_source": "def set_cookie(self, cookie, *args, **kwargs):\n if (\n hasattr(cookie.value, \"startswith\")\n and cookie.value.startswith('\"')\n and cookie.value.endswith('\"')\n ):\n cookie.value = cookie.value.replace('\\\\\"', \"\")\n return super().set_cookie(cookie, *args, **kwargs)", "result_size": 5, "created_at": "2026-03-20T16:58:17.570287+00:00", "file_content": "\"\"\"\nrequests.cookies\n~~~~~~~~~~~~~~~~\n\nCompatibility code to be able to use `http.cookiejar.CookieJar` with requests.\n\nrequests.utils imports from here, so be careful with imports.\n\"\"\"\n\nimport calendar\nimport copy\nimport time\n\nfrom ._internal_utils import to_native_string\nfrom .compat import Morsel, MutableMapping, cookielib, urlparse, urlunparse\n\ntry:\n import threading\nexcept ImportError:\n import dummy_threading as threading\n\n\nclass MockRequest:\n \"\"\"Wraps a `requests.Request` to mimic a `urllib2.Request`.\n\n The code in `http.cookiejar.CookieJar` expects this interface in order to correctly\n manage cookie policies, i.e., determine whether a cookie can be set, given the\n domains of the request and the cookie.\n\n The original request object is read-only. The client is responsible for collecting\n the new headers via `get_new_headers()` and interpreting them appropriately. You\n probably want `get_cookie_header`, defined below.\n \"\"\"\n\n def __init__(self, request):\n self._r = request\n self._new_headers = {}\n self.type = urlparse(self._r.url).scheme\n\n def get_type(self):\n return self.type\n\n def get_host(self):\n return urlparse(self._r.url).netloc\n\n def get_origin_req_host(self):\n return self.get_host()\n\n def get_full_url(self):\n # Only return the response's URL if the user hadn't set the Host\n # header\n if not self._r.headers.get(\"Host\"):\n return self._r.url\n # If they did set it, retrieve it and reconstruct the expected domain\n host = to_native_string(self._r.headers[\"Host\"], encoding=\"utf-8\")\n parsed = urlparse(self._r.url)\n # Reconstruct the URL as we expect it\n return urlunparse(\n [\n parsed.scheme,\n host,\n parsed.path,\n parsed.params,\n parsed.query,\n parsed.fragment,\n ]\n )\n\n def is_unverifiable(self):\n return True\n\n def has_header(self, name):\n return name in self._r.headers or name in self._new_headers\n\n def get_header(self, name, default=None):\n return self._r.headers.get(name, self._new_headers.get(name, default))\n\n def add_header(self, key, val):\n \"\"\"cookiejar has no legitimate use for this method; add it back if you find one.\"\"\"\n raise NotImplementedError(\n \"Cookie headers should be added with add_unredirected_header()\"\n )\n\n def add_unredirected_header(self, name, value):\n self._new_headers[name] = value\n\n def get_new_headers(self):\n return self._new_headers\n\n @property\n def unverifiable(self):\n return self.is_unverifiable()\n\n @property\n def origin_req_host(self):\n return self.get_origin_req_host()\n\n @property\n def host(self):\n return self.get_host()\n\n\nclass MockResponse:\n \"\"\"Wraps a `httplib.HTTPMessage` to mimic a `urllib.addinfourl`.\n\n ...what? Basically, expose the parsed HTTP headers from the server response\n the way `http.cookiejar` expects to see them.\n \"\"\"\n\n def __init__(self, headers):\n \"\"\"Make a MockResponse for `cookiejar` to read.\n\n :param headers: a httplib.HTTPMessage or analogous carrying the headers\n \"\"\"\n self._headers = headers\n\n def info(self):\n return self._headers\n\n def getheaders(self, name):\n self._headers.getheaders(name)\n\n\ndef extract_cookies_to_jar(jar, request, response):\n \"\"\"Extract the cookies from the response into a CookieJar.\n\n :param jar: http.cookiejar.CookieJar (not necessarily a RequestsCookieJar)\n :param request: our own requests.Request object\n :param response: urllib3.HTTPResponse object\n \"\"\"\n if not (hasattr(response, \"_original_response\") and response._original_response):\n return\n # the _original_response field is the wrapped httplib.HTTPResponse object,\n req = MockRequest(request)\n # pull out the HTTPMessage with the headers and put it in the mock:\n res = MockResponse(response._original_response.msg)\n jar.extract_cookies(res, req)\n\n\ndef get_cookie_header(jar, request):\n \"\"\"\n Produce an appropriate Cookie header string to be sent with `request`, or None.\n\n :rtype: str\n \"\"\"\n r = MockRequest(request)\n jar.add_cookie_header(r)\n return r.get_new_headers().get(\"Cookie\")\n\n\ndef remove_cookie_by_name(cookiejar, name, domain=None, path=None):\n \"\"\"Unsets a cookie by name, by default over all domains and paths.\n\n Wraps CookieJar.clear(), is O(n).\n \"\"\"\n clearables = []\n for cookie in cookiejar:\n if cookie.name != name:\n continue\n if domain is not None and domain != cookie.domain:\n continue\n if path is not None and path != cookie.path:\n continue\n clearables.append((cookie.domain, cookie.path, cookie.name))\n\n for domain, path, name in clearables:\n cookiejar.clear(domain, path, name)\n\n\nclass CookieConflictError(RuntimeError):\n \"\"\"There are two cookies that meet the criteria specified in the cookie jar.\n Use .get and .set and include domain and path args in order to be more specific.\n \"\"\"\n\n\nclass RequestsCookieJar(cookielib.CookieJar, MutableMapping):\n \"\"\"Compatibility class; is a http.cookiejar.CookieJar, but exposes a dict\n interface.\n\n This is the CookieJar we create by default for requests and sessions that\n don't specify one, since some clients may expect response.cookies and\n session.cookies to support dict operations.\n\n Requests does not use the dict interface internally; it's just for\n compatibility with external client code. All requests code should work\n out of the box with externally provided instances of ``CookieJar``, e.g.\n ``LWPCookieJar`` and ``FileCookieJar``.\n\n Unlike a regular CookieJar, this class is pickleable.\n\n .. warning:: dictionary operations that are normally O(1) may be O(n).\n \"\"\"\n\n def get(self, name, default=None, domain=None, path=None):\n \"\"\"Dict-like get() that also supports optional domain and path args in\n order to resolve naming collisions from using one cookie jar over\n multiple domains.\n\n .. warning:: operation is O(n), not O(1).\n \"\"\"\n try:\n return self._find_no_duplicates(name, domain, path)\n except KeyError:\n return default\n\n def set(self, name, value, **kwargs):\n \"\"\"Dict-like set() that also supports optional domain and path args in\n order to resolve naming collisions from using one cookie jar over\n multiple domains.\n \"\"\"\n # support client code that unsets cookies by assignment of a None value:\n if value is None:\n remove_cookie_by_name(\n self, name, domain=kwargs.get(\"domain\"), path=kwargs.get(\"path\")\n )\n return\n\n if isinstance(value, Morsel):\n c = morsel_to_cookie(value)\n else:\n c = create_cookie(name, value, **kwargs)\n self.set_cookie(c)\n return c\n\n def iterkeys(self):\n \"\"\"Dict-like iterkeys() that returns an iterator of names of cookies\n from the jar.\n\n .. seealso:: itervalues() and iteritems().\n \"\"\"\n for cookie in iter(self):\n yield cookie.name\n\n def keys(self):\n \"\"\"Dict-like keys() that returns a list of names of cookies from the\n jar.\n\n .. seealso:: values() and items().\n \"\"\"\n return list(self.iterkeys())\n\n def itervalues(self):\n \"\"\"Dict-like itervalues() that returns an iterator of values of cookies\n from the jar.\n\n .. seealso:: iterkeys() and iteritems().\n \"\"\"\n for cookie in iter(self):\n yield cookie.value\n\n def values(self):\n \"\"\"Dict-like values() that returns a list of values of cookies from the\n jar.\n\n .. seealso:: keys() and items().\n \"\"\"\n return list(\n# \u2026 (truncated at 8000 chars)"}} {"sample_id": "trpc__trpc__parseConnectionParamsFromUnknown__upstream__2hop_2eed98", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["getWSConnectionHandler"], "hop_1_files": ["private/tmp/repos/trpc__trpc/packages/server/src/adapters/ws.ts"], "hop_2": ["fastifyTRPCPlugin", "applyWSSHandler"], "hop_2_files": ["private/tmp/repos/trpc__trpc/packages/server/src/adapters/fastify/fastifyTRPCPlugin.ts", "private/tmp/repos/trpc__trpc/packages/server/src/adapters/ws.ts"]}, "metadata": {"anchor": "parseConnectionParamsFromUnknown", "anchor_file": "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/http/parseConnectionParams.ts", "anchor_source": "export function parseConnectionParamsFromUnknown(\n parsed: unknown,\n): TRPCRequestInfo['connectionParams'] {\n try {\n if (parsed === null) {\n return null;\n }\n if (!isObject(parsed)) {\n throw new Error('Expected object');\n }\n const nonStringValues = Object.entries(parsed).filter(\n ([_key, value]) => typeof value !== 'string',\n );\n\n if (nonStringValues.length > 0) {\n throw new Error(\n `Expected connectionParams to be string values. Got ${nonStringValues\n .map(([key, value]) => `${key}: ${typeof value}`)\n .join(', ')}`,\n );\n }\n return parsed as Record;\n } catch (cause) {\n throw new TRPCError({\n code: 'PARSE_ERROR',\n message: 'Invalid connection params shape',\n cause,\n });\n }\n}", "result_size": 4, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "rq__rq__fetch_many__downstream__2hop_d9db86", "repo": "rq/rq", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["key_for", "parse_job_id", "restore"], "hop_1_files": ["private/tmp/repos/rq__rq/rq/job.py", "private/tmp/repos/rq__rq/rq/job.py", "private/tmp/repos/rq__rq/rq/job.py"], "hop_2": ["now", "str_to_date", "loads", "as_text", "parse_timeout", "decode_redis_hash", "JobStatus"], "hop_2_files": ["private/tmp/repos/rq__rq/rq/utils.py", "private/tmp/repos/rq__rq/rq/utils.py", "private/tmp/repos/rq__rq/rq/serializers.py", "private/tmp/repos/rq__rq/rq/utils.py", "private/tmp/repos/rq__rq/rq/utils.py", "private/tmp/repos/rq__rq/rq/utils.py", "private/tmp/repos/rq__rq/rq/job.py"]}, "metadata": {"anchor": "fetch_many", "anchor_file": "private/tmp/repos/rq__rq/rq/job.py", "anchor_source": "@classmethod\n def fetch_many(cls, job_ids: Iterable[str], connection: 'Redis', serializer=None) -> list[Optional['Job']]:\n \"\"\"\n Bulk version of Job.fetch\n\n For any job_ids which a job does not exist, the corresponding item in\n the returned list will be None.\n\n Args:\n job_ids (Iterable[str]): A list of job ids.\n connection (Redis): Redis connection\n serializer (Callable): A serializer\n\n Returns:\n jobs (list[Optional[Job]]): A list of Jobs instances, elements are None if a job_id does not exist.\n \"\"\"\n parsed_ids = [parse_job_id(job_id) for job_id in job_ids]\n with connection.pipeline() as pipeline:\n for job_id in parsed_ids:\n pipeline.hgetall(cls.key_for(job_id))\n results = pipeline.execute()\n\n jobs: list[Optional[Job]] = []\n for i, job_id in enumerate(parsed_ids):\n if not results[i]:\n jobs.append(None)\n continue\n\n job = cls(job_id, connection=connection, serializer=serializer)\n job.restore(results[i])\n jobs.append(job)\n\n return jobs", "result_size": 7, "created_at": "2026-03-20T16:58:17.875204+00:00"}} {"sample_id": "colinhacks__zod__shallowClone__upstream__1hop_67ff3c", "repo": "colinhacks/zod", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["_default", "defaultValue", "prefault"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/schemas.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/schemas.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/mini/schemas.ts"]}, "metadata": {"anchor": "shallowClone", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/util.ts", "anchor_source": "export function shallowClone(o: any): any {\n if (isPlainObject(o)) return { ...o };\n if (Array.isArray(o)) return [...o];\n return o;\n}", "result_size": 8, "created_at": "2026-03-20T16:58:16.474869+00:00", "file_content": ""}} {"sample_id": "colinhacks__zod__min__downstream__2hop_4196f6", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["_addCheck"], "hop_1_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"], "hop_2": ["ZodDate", "constructor"], "hop_2_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"]}, "metadata": {"anchor": "min", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "anchor_source": "min(minDate: Date, message?: errorUtil.ErrMessage) {\n return this._addCheck({\n kind: \"min\",\n value: minDate.getTime(),\n message: errorUtil.toString(message),\n });\n }", "result_size": 2, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "trpc__trpc__isFunction__upstream__1hop_98050a", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["isPromise", "unwrapLazyArg", "createCallerFactory", "createCallerInner", "createCaller"], "call_files": ["private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/jsonl.ts", "private/tmp/repos/trpc__trpc/packages/tanstack-react-query/src/internals/utils.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/router.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/router.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/router.ts"]}, "metadata": {"anchor": "isFunction", "anchor_file": "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/utils.ts", "anchor_source": "export function isFunction(fn: unknown): fn is AnyFn {\n return typeof fn === 'function';\n}", "result_size": 6, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "trpc__trpc__mergeWithoutOverrides__upstream__1hop_4f4361", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["mergeRouters", "createNewBuilder"], "call_files": ["private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/router.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/procedureBuilder.ts"]}, "metadata": {"anchor": "mergeWithoutOverrides", "anchor_file": "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/utils.ts", "anchor_source": "export function mergeWithoutOverrides>(\n obj1: TType,\n ...objs: Partial[]\n): TType {\n const newObj: TType = Object.assign(emptyObject(), obj1);\n\n for (const overrides of objs) {\n for (const key in overrides) {\n if (key in newObj && newObj[key] !== overrides[key]) {\n throw new Error(`Duplicate key ${key}`);\n }\n newObj[key as keyof TType] = overrides[key] as TType[keyof TType];\n }\n }\n return newObj;\n}", "result_size": 2, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "agronholm__apscheduler__start_in_background__downstream__1hop_94898a", "repo": "agronholm/apscheduler", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["_ensure_services_ready"], "call_files": ["private/tmp/repos/agronholm__apscheduler/src/apscheduler/_schedulers/sync.py"]}, "metadata": {"anchor": "start_in_background", "anchor_file": "private/tmp/repos/agronholm__apscheduler/src/apscheduler/_schedulers/sync.py", "anchor_source": "def start_in_background(self) -> None:\n \"\"\"\n Launch the scheduler in a new thread.\n\n This method registers :mod:`atexit` hooks to shut down the scheduler and wait\n for the thread to finish.\n\n :raises RuntimeError: if the scheduler is not in the ``stopped`` state\n\n \"\"\"\n # Check if we're running under uWSGI with threads disabled\n uwsgi_module = sys.modules.get(\"uwsgi\")\n if not getattr(uwsgi_module, \"has_threads\", True):\n raise RuntimeError(\n \"The scheduler seems to be running under uWSGI, but threads have \"\n \"been disabled. You must run uWSGI with the --enable-threads \"\n \"option for the scheduler to work.\"\n )\n\n portal = self._ensure_services_ready()\n portal.call(self._async_scheduler.start_in_background)", "result_size": 1, "created_at": "2026-03-20T16:58:16.252821+00:00"}} {"sample_id": "rq__rq__cleanup_execution__downstream__1hop_7bfde3", "repo": "rq/rq", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["delete", "set_current_job_id"], "call_files": ["private/tmp/repos/rq__rq/rq/executions.py", "private/tmp/repos/rq__rq/rq/worker/base.py"]}, "metadata": {"anchor": "cleanup_execution", "anchor_file": "private/tmp/repos/rq__rq/rq/executions.py", "anchor_source": "def cleanup_execution(worker: 'BaseWorker', job: Job, pipeline: 'Pipeline') -> None:\n \"\"\"Cleans up the execution of a job.\n It will remove the job execution record from the StartedJobRegistry and delete the Execution object.\n\n Args:\n worker: The worker to clean up execution for\n job: The job whose execution is being cleaned up\n pipeline: Redis pipeline to use for the cleanup\n \"\"\"\n logger.debug('Cleaning up execution of job %s', job.id)\n worker.set_current_job_id(None, pipeline=pipeline)\n if worker.execution is not None:\n worker.execution.delete(job=job, pipeline=pipeline)\n worker.execution = None", "result_size": 2, "created_at": "2026-03-20T16:58:17.875204+00:00"}} {"sample_id": "agronholm__apscheduler__publish_local__upstream__1hop_9e7948", "repo": "agronholm/apscheduler", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["_listen_notifications", "publish", "_listen_messages"], "call_files": ["private/tmp/repos/agronholm__apscheduler/src/apscheduler/eventbrokers/psycopg.py", "private/tmp/repos/agronholm__apscheduler/src/apscheduler/eventbrokers/local.py", "private/tmp/repos/agronholm__apscheduler/src/apscheduler/eventbrokers/redis.py"]}, "metadata": {"anchor": "publish_local", "anchor_file": "private/tmp/repos/agronholm__apscheduler/src/apscheduler/eventbrokers/base.py", "anchor_source": "async def publish_local(self, event: Event) -> None:\n event_type = type(event)\n one_shot_tokens: list[object] = []\n for subscription in self._subscriptions.values():\n if (\n subscription.event_types is None\n or event_type in subscription.event_types\n ):\n self._task_group.start_soon(self._deliver_event, subscription, event)\n if subscription.one_shot:\n one_shot_tokens.append(subscription.token)\n\n for token in one_shot_tokens:\n self.unsubscribe(token)", "result_size": 3, "created_at": "2026-03-20T16:58:16.252821+00:00", "file_content": ""}} {"sample_id": "encode__django-rest-framework___get_dynamic_route__downstream__1hop_258480", "repo": "encode/django-rest-framework", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["escape_curly_brackets"], "call_files": ["private/tmp/repos/django-rest-framework/rest_framework/routers.py"]}, "metadata": {"anchor": "_get_dynamic_route", "anchor_file": "private/tmp/repos/django-rest-framework/rest_framework/routers.py", "anchor_source": "def _get_dynamic_route(self, route, action):\n initkwargs = route.initkwargs.copy()\n initkwargs.update(action.kwargs)\n\n url_path = escape_curly_brackets(action.url_path)\n\n return Route(\n url=route.url.replace('{url_path}', url_path),\n mapping=action.mapping,\n name=route.name.replace('{url_name}', action.url_name),\n detail=route.detail,\n initkwargs=initkwargs,\n )", "result_size": 1, "created_at": "2026-03-20T16:58:16.616316+00:00"}} {"sample_id": "trpc__trpc__configureTRPCHeyApiClient__downstream__2hop_714ef9", "repo": "trpc/trpc", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["createTRPCHeyApiClientConfig", "createTRPCErrorInterceptor"], "hop_1_files": ["private/tmp/repos/trpc__trpc/packages/openapi/src/heyapi/index.ts", "private/tmp/repos/trpc__trpc/packages/openapi/src/heyapi/index.ts"], "hop_2": ["resolveTransformer", "serialize", "deserialize"], "hop_2_files": ["private/tmp/repos/trpc__trpc/packages/openapi/src/heyapi/index.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/transformer.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/transformer.ts"]}, "metadata": {"anchor": "configureTRPCHeyApiClient", "anchor_file": "private/tmp/repos/trpc__trpc/packages/openapi/src/heyapi/index.ts", "anchor_source": "export function configureTRPCHeyApiClient(\n client: HeyApiFetchClient,\n opts: TRPCHeyApiClientOptions &\n Omit,\n) {\n const { transformer, ...heyConfig } = opts;\n const trpcConfig = createTRPCHeyApiClientConfig({ transformer });\n\n client.setConfig({ ...heyConfig, ...trpcConfig });\n\n if (transformer) {\n client.interceptors.error.use(createTRPCErrorInterceptor(transformer));\n }\n}", "result_size": 3, "created_at": "2026-03-20T16:58:18.199328+00:00"}} {"sample_id": "trpc__trpc__timerResource__upstream__2hop_51570a", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["withTimeout", "takeWithGrace", "withPing"], "hop_1_files": ["private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/sse.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/utils/asyncIterable.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/utils/withPing.ts"], "hop_2": ["generator", "createBatchStreamProducer", "sseStreamProducer", "sseStreamConsumer"], "hop_2_files": ["private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/sse.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/jsonl.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/sse.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/sse.ts"]}, "metadata": {"anchor": "timerResource", "anchor_file": "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/utils/timerResource.ts", "anchor_source": "export function timerResource(ms: number) {\n let timer: ReturnType | null = null;\n\n return makeResource(\n {\n start() {\n if (timer) {\n throw new Error('Timer already started');\n }\n\n const promise = new Promise(\n (resolve) => {\n timer = setTimeout(() => resolve(disposablePromiseTimerResult), ms);\n },\n );\n return promise;\n },\n },\n () => {\n if (timer) {\n clearTimeout(timer);\n }\n },\n );\n}", "result_size": 7, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "psf__requests__to_native_string__upstream__2hop_86b716", "repo": "psf/requests", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["_basic_auth_str", "prepare_headers", "prepare_url", "resolve_redirects", "get_full_url", "prepare_method"], "hop_1_files": ["private/tmp/repos/requests/src/requests/auth.py", "private/tmp/repos/requests/src/requests/models.py", "private/tmp/repos/requests/src/requests/models.py", "private/tmp/repos/requests/src/requests/sessions.py", "private/tmp/repos/requests/src/requests/cookies.py", "private/tmp/repos/requests/src/requests/models.py"], "hop_2": ["send", "proxy_headers", "rebuild_proxies", "prepare"], "hop_2_files": ["private/tmp/repos/requests/src/requests/sessions.py", "private/tmp/repos/requests/src/requests/adapters.py", "private/tmp/repos/requests/src/requests/sessions.py", "private/tmp/repos/requests/src/requests/models.py"]}, "metadata": {"anchor": "to_native_string", "anchor_file": "private/tmp/repos/requests/src/requests/_internal_utils.py", "anchor_source": "def to_native_string(string, encoding=\"ascii\"):\n \"\"\"Given a string object, regardless of type, returns a representation of\n that string in the native string type, encoding and decoding where\n necessary. This assumes ASCII unless told otherwise.\n \"\"\"\n if isinstance(string, builtin_str):\n out = string\n else:\n out = string.decode(encoding)\n\n return out", "result_size": 4, "created_at": "2026-03-20T16:58:17.570287+00:00", "file_content": "\"\"\"\nrequests._internal_utils\n~~~~~~~~~~~~~~\n\nProvides utility functions that are consumed internally by Requests\nwhich depend on extremely few external helpers (such as compat)\n\"\"\"\n\nimport re\n\nfrom .compat import builtin_str\n\n_VALID_HEADER_NAME_RE_BYTE = re.compile(rb\"^[^:\\s][^:\\r\\n]*$\")\n_VALID_HEADER_NAME_RE_STR = re.compile(r\"^[^:\\s][^:\\r\\n]*$\")\n_VALID_HEADER_VALUE_RE_BYTE = re.compile(rb\"^\\S[^\\r\\n]*$|^$\")\n_VALID_HEADER_VALUE_RE_STR = re.compile(r\"^\\S[^\\r\\n]*$|^$\")\n\n_HEADER_VALIDATORS_STR = (_VALID_HEADER_NAME_RE_STR, _VALID_HEADER_VALUE_RE_STR)\n_HEADER_VALIDATORS_BYTE = (_VALID_HEADER_NAME_RE_BYTE, _VALID_HEADER_VALUE_RE_BYTE)\nHEADER_VALIDATORS = {\n bytes: _HEADER_VALIDATORS_BYTE,\n str: _HEADER_VALIDATORS_STR,\n}\n\n\ndef to_native_string(string, encoding=\"ascii\"):\n \"\"\"Given a string object, regardless of type, returns a representation of\n that string in the native string type, encoding and decoding where\n necessary. This assumes ASCII unless told otherwise.\n \"\"\"\n if isinstance(string, builtin_str):\n out = string\n else:\n out = string.decode(encoding)\n\n return out\n\n\ndef unicode_is_ascii(u_string):\n \"\"\"Determine if unicode string only contains ASCII characters.\n\n :param str u_string: unicode string to check. Must be unicode\n and not Python 2 `str`.\n :rtype: bool\n \"\"\"\n assert isinstance(u_string, str)\n try:\n u_string.encode(\"ascii\")\n return True\n except UnicodeEncodeError:\n return False\n"}} {"sample_id": "colinhacks__zod__shallowClone__downstream__2hop_fcd540", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["isPlainObject"], "hop_1_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/util.ts"], "hop_2": ["isObject"], "hop_2_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/util.ts"]}, "metadata": {"anchor": "shallowClone", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/util.ts", "anchor_source": "export function shallowClone(o: any): any {\n if (isPlainObject(o)) return { ...o };\n if (Array.isArray(o)) return [...o];\n return o;\n}", "result_size": 1, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "scrapy__scrapy___get_project_only_cmds__downstream__2hop_b7dee4", "repo": "scrapy/scrapy", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["_get_commands_dict"], "hop_1_files": ["private/tmp/repos/scrapy__scrapy/scrapy/cmdline.py"], "hop_2": ["_get_commands_from_entry_points", "_get_commands_from_module"], "hop_2_files": ["private/tmp/repos/scrapy__scrapy/scrapy/cmdline.py", "private/tmp/repos/scrapy__scrapy/scrapy/cmdline.py"]}, "metadata": {"anchor": "_get_project_only_cmds", "anchor_file": "private/tmp/repos/scrapy__scrapy/scrapy/cmdline.py", "anchor_source": "def _get_project_only_cmds(settings: BaseSettings) -> set[str]:\n return set(_get_commands_dict(settings, inproject=True)) - set(\n _get_commands_dict(settings, inproject=False)\n )", "result_size": 2, "created_at": "2026-03-20T16:58:17.996583+00:00"}} {"sample_id": "colinhacks__zod__nonnegative__downstream__1hop_46cf96", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["_addCheck"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"]}, "metadata": {"anchor": "nonnegative", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "anchor_source": "nonnegative(message?: errorUtil.ErrMessage) {\n return this._addCheck({\n kind: \"min\",\n value: 0,\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }", "result_size": 1, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "rq__rq__handle_job_retry__upstream__2hop_4405fc", "repo": "rq/rq", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["perform_job"], "hop_1_files": ["private/tmp/repos/rq__rq/rq/worker/base.py"], "hop_2": ["execute_job", "main_work_horse"], "hop_2_files": ["private/tmp/repos/rq__rq/rq/worker/worker_classes.py", "private/tmp/repos/rq__rq/rq/worker/base.py"]}, "metadata": {"anchor": "handle_job_retry", "anchor_file": "private/tmp/repos/rq__rq/rq/worker/base.py", "anchor_source": "def handle_job_retry(self, job: 'Job', queue: 'Queue', retry: Retry, started_job_registry: StartedJobRegistry):\n \"\"\"Handles the retry of certain job.\n It will remove the job from the `StartedJobRegistry` and requeue or reschedule the job.\n\n Args:\n job (Job): The job that will be retried.\n queue (Queue): The queue\n started_job_registry (StartedJobRegistry): The started registry\n \"\"\"\n self.log.debug('Worker %s: handling retry of job %s', self.name, job.id)\n\n # Check if job has exceeded max retries\n if job.number_of_retries and job.number_of_retries >= retry.max:\n # If max retries exceeded, treat as failure\n self.log.warning('Worker %s: job %s has exceeded maximum retry attempts (%d)', self.name, job.id, retry.max)\n exc_string = f'Job failed after {retry.max} retry attempts'\n self.handle_job_failure(job, queue=queue, exc_string=exc_string)\n return\n\n with self.connection.pipeline() as pipeline:\n self.increment_failed_job_count(pipeline=pipeline)\n self.increment_total_working_time(job.ended_at - job.started_at, pipeline) # type: ignore\n job._handle_retry_result(queue=queue, pipeline=pipeline, retry=retry, worker_name=self.name)\n self.cleanup_execution(job, pipeline=pipeline)\n pipeline.execute()\n\n self.log.debug('Worker %s: finished handling retry of job %s', self.name, job.id)", "result_size": 2, "created_at": "2026-03-20T16:58:17.875204+00:00", "file_content": ""}} {"sample_id": "pytest-dev__pytest__saferepr__downstream__2hop_cfb590", "repo": "pytest-dev/pytest", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["repr"], "hop_1_files": ["private/tmp/repos/pytest-dev__pytest/src/_pytest/_io/saferepr.py"], "hop_2": ["_ellipsize", "_format_repr_exception"], "hop_2_files": ["private/tmp/repos/pytest-dev__pytest/src/_pytest/_io/saferepr.py", "private/tmp/repos/pytest-dev__pytest/src/_pytest/_io/saferepr.py"]}, "metadata": {"anchor": "saferepr", "anchor_file": "private/tmp/repos/pytest-dev__pytest/src/_pytest/_io/saferepr.py", "anchor_source": "def saferepr(\n obj: object, maxsize: int | None = DEFAULT_REPR_MAX_SIZE, use_ascii: bool = False\n) -> str:\n \"\"\"Return a size-limited safe repr-string for the given object.\n\n Failing __repr__ functions of user instances will be represented\n with a short exception info and 'saferepr' generally takes\n care to never raise exceptions itself.\n\n This function is a wrapper around the Repr/reprlib functionality of the\n stdlib.\n \"\"\"\n return SafeRepr(maxsize, use_ascii).repr(obj)", "result_size": 2, "created_at": "2026-03-20T16:58:17.641689+00:00"}} {"sample_id": "psf__requests__get_encoding_from_headers__upstream__1hop_6202d0", "repo": "psf/requests", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["get_unicode_from_response", "build_response"], "call_files": ["private/tmp/repos/requests/src/requests/utils.py", "private/tmp/repos/requests/src/requests/adapters.py"]}, "metadata": {"anchor": "get_encoding_from_headers", "anchor_file": "private/tmp/repos/requests/src/requests/utils.py", "anchor_source": "def get_encoding_from_headers(headers):\n \"\"\"Returns encodings from given HTTP Header Dict.\n\n :param headers: dictionary to extract encoding from.\n :rtype: str\n \"\"\"\n\n content_type = headers.get(\"content-type\")\n\n if not content_type:\n return None\n\n content_type, params = _parse_content_type_header(content_type)\n\n if \"charset\" in params:\n return params[\"charset\"].strip(\"'\\\"\")\n\n if \"text\" in content_type:\n return \"ISO-8859-1\"\n\n if \"application/json\" in content_type:\n # Assume UTF-8 based on RFC 4627: https://www.ietf.org/rfc/rfc4627.txt since the charset was unset\n return \"utf-8\"", "result_size": 2, "created_at": "2026-03-20T16:58:17.570287+00:00", "file_content": "\"\"\"\nrequests.utils\n~~~~~~~~~~~~~~\n\nThis module provides utility functions that are used within Requests\nthat are also useful for external consumption.\n\"\"\"\n\nimport codecs\nimport contextlib\nimport io\nimport os\nimport re\nimport socket\nimport struct\nimport sys\nimport tempfile\nimport warnings\nimport zipfile\nfrom collections import OrderedDict\n\nfrom urllib3.util import make_headers, parse_url\n\nfrom . import certs\nfrom .__version__ import __version__\n\n# to_native_string is unused here, but imported here for backwards compatibility\nfrom ._internal_utils import ( # noqa: F401\n _HEADER_VALIDATORS_BYTE,\n _HEADER_VALIDATORS_STR,\n HEADER_VALIDATORS,\n to_native_string,\n)\nfrom .compat import (\n Mapping,\n basestring,\n bytes,\n getproxies,\n getproxies_environment,\n integer_types,\n is_urllib3_1,\n proxy_bypass,\n proxy_bypass_environment,\n quote,\n str,\n unquote,\n urlparse,\n urlunparse,\n)\nfrom .compat import parse_http_list as _parse_list_header\nfrom .cookies import cookiejar_from_dict\nfrom .exceptions import (\n FileModeWarning,\n InvalidHeader,\n InvalidURL,\n UnrewindableBodyError,\n)\nfrom .structures import CaseInsensitiveDict\n\nNETRC_FILES = (\".netrc\", \"_netrc\")\n\nDEFAULT_CA_BUNDLE_PATH = certs.where()\n\nDEFAULT_PORTS = {\"http\": 80, \"https\": 443}\n\n# Ensure that ', ' is used to preserve previous delimiter behavior.\nDEFAULT_ACCEPT_ENCODING = \", \".join(\n re.split(r\",\\s*\", make_headers(accept_encoding=True)[\"accept-encoding\"])\n)\n\n\nif sys.platform == \"win32\":\n # provide a proxy_bypass version on Windows without DNS lookups\n\n def proxy_bypass_registry(host):\n try:\n import winreg\n except ImportError:\n return False\n\n try:\n internetSettings = winreg.OpenKey(\n winreg.HKEY_CURRENT_USER,\n r\"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\",\n )\n # ProxyEnable could be REG_SZ or REG_DWORD, normalizing it\n proxyEnable = int(winreg.QueryValueEx(internetSettings, \"ProxyEnable\")[0])\n # ProxyOverride is almost always a string\n proxyOverride = winreg.QueryValueEx(internetSettings, \"ProxyOverride\")[0]\n except (OSError, ValueError):\n return False\n if not proxyEnable or not proxyOverride:\n return False\n\n # make a check value list from the registry entry: replace the\n # '' string by the localhost entry and the corresponding\n # canonical entry.\n proxyOverride = proxyOverride.split(\";\")\n # filter out empty strings to avoid re.match return true in the following code.\n proxyOverride = filter(None, proxyOverride)\n # now check if we match one of the registry values.\n for test in proxyOverride:\n if test == \"\":\n if \".\" not in host:\n return True\n test = test.replace(\".\", r\"\\.\") # mask dots\n test = test.replace(\"*\", r\".*\") # change glob sequence\n test = test.replace(\"?\", r\".\") # change glob char\n if re.match(test, host, re.I):\n return True\n return False\n\n def proxy_bypass(host): # noqa\n \"\"\"Return True, if the host should be bypassed.\n\n Checks proxy settings gathered from the environment, if specified,\n or the registry.\n \"\"\"\n if getproxies_environment():\n return proxy_bypass_environment(host)\n else:\n return proxy_bypass_registry(host)\n\n\ndef dict_to_sequence(d):\n \"\"\"Returns an internal sequence dictionary update.\"\"\"\n\n if hasattr(d, \"items\"):\n d = d.items()\n\n return d\n\n\ndef super_len(o):\n total_length = None\n current_position = 0\n\n if not is_urllib3_1 and isinstance(o, str):\n # urllib3 2.x+ treats all strings as utf-8 instead\n # of latin-1 (iso-8859-1) like http.client.\n o = o.encode(\"utf-8\")\n\n if hasattr(o, \"__len__\"):\n total_length = len(o)\n\n elif hasattr(o, \"len\"):\n total_length = o.len\n\n elif hasattr(o, \"fileno\"):\n try:\n fileno = o.fileno()\n except (io.UnsupportedOperation, AttributeError):\n # AttributeError is a surprising exception, seeing as how we've just checked\n # that `hasattr(o, 'fileno')`. It happens for objects obtained via\n # `Tarfile.extractfile()`, per issue 5229.\n pass\n else:\n total_length = os.fstat(fileno).st_size\n\n # Having used fstat to determine the file length, we need to\n # confirm that this file was opened up in binary mode.\n if \"b\" not in o.mode:\n warnings.warn(\n (\n \"Requests has determined the content-length for this \"\n \"request using the binary size of the file: however, the \"\n \"file has been opened in text mode (i.e. without the 'b' \"\n \"flag in the mode). This may lead to an incorrect \"\n \"content-length. In Requests 3.0, support will be removed \"\n \"for files in text mode.\"\n ),\n FileModeWarning,\n )\n\n if hasattr(o, \"tell\"):\n try:\n current_position = o.tell()\n except OSError:\n # This can happen in some weird situations, such as when the file\n # is actually a special file descriptor like stdin. In this\n # instance, we don't know what the length is, so set it to zero and\n # let requests chunk it instead.\n if total_length is not None:\n current_position = total_length\n else:\n if hasattr(o, \"seek\") and total_length is None:\n # StringIO and BytesIO have seek but no usable fileno\n try:\n # seek to end of file\n o.seek(0, 2)\n total_length = o.tell()\n\n # seek back to current position to support\n # partially read file-like objects\n o.seek(current_position or 0)\n except OSError:\n total_length = 0\n\n if total_length is None:\n total_length = 0\n\n return max(0, total_length - current_position)\n\n\ndef get_netrc_auth(url, raise_errors=False):\n \"\"\"Returns the Requests tuple auth for a given url from netrc.\"\"\"\n\n netrc_file = os.environ.get(\"NETRC\")\n if netrc_file is not None:\n netrc_locations = (netrc_file,)\n else:\n netrc_locations = (f\"~/{f}\" for f in NETRC_FILES)\n\n try:\n from netrc import NetrcParseError, netrc\n\n netrc_path = None\n\n for f in netrc_locations:\n loc = os.path.expanduser(f)\n if os.path.exists(loc):\n netrc_path = loc\n break\n\n # Abort early if there isn't one.\n if netrc_path is None:\n return\n\n ri = urlparse(url)\n host = ri.hostname\n\n try:\n _netrc = netrc(netrc_path).authenticators(host)\n if _netrc and any(_netrc):\n # Return with login / password\n login_i = 0 if _netrc[0] else 1\n return (_netrc[login_i], _netrc[2])\n except (NetrcParseError, OSError):\n # If there was a parsing error or a permissions issue reading the file,\n # we'll just skip netrc auth unless explicitly asked to raise errors.\n if raise_errors:\n raise\n\n # App Engine hackiness.\n except (ImportError, AttributeError):\n pass\n\n\ndef guess_filename(obj):\n \"\"\"Tries to guess the filename of the given object.\"\"\"\n name = getattr(obj, \"name\", None)\n if name and isinstance(name, basestring) and name[0] != \"<\" and name[-1] != \">\":\n return os.path.basename(name)\n\n\ndef extract_zipped_paths(path):\n \"\"\"Replace nonexistent paths that look \n# \u2026 (truncated at 8000 chars)"}} {"sample_id": "pallets__jinja__parse_call__downstream__1hop_b80e17", "repo": "pallets/jinja", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["parse_call_args", "Call"], "call_files": ["private/tmp/repos/pallets__jinja/src/jinja2/parser.py", "private/tmp/repos/pallets__jinja/src/jinja2/nodes.py"]}, "metadata": {"anchor": "parse_call", "anchor_file": "private/tmp/repos/pallets__jinja/src/jinja2/parser.py", "anchor_source": "def parse_call(self, node: nodes.Expr) -> nodes.Call:\n # The lparen will be expected in parse_call_args, but the lineno\n # needs to be recorded before the stream is advanced.\n token = self.stream.current\n args, kwargs, dyn_args, dyn_kwargs = self.parse_call_args()\n return nodes.Call(node, args, kwargs, dyn_args, dyn_kwargs, lineno=token.lineno)", "result_size": 2, "created_at": "2026-03-20T16:58:17.229656+00:00"}} {"sample_id": "PyCQA__flake8__load_config__downstream__1hop_db78c4", "repo": "PyCQA/flake8", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["_find_config_file"], "call_files": ["private/tmp/repos/PyCQA__flake8/src/flake8/options/config.py"]}, "metadata": {"anchor": "load_config", "anchor_file": "private/tmp/repos/PyCQA__flake8/src/flake8/options/config.py", "anchor_source": "def load_config(\n config: str | None,\n extra: list[str],\n *,\n isolated: bool = False,\n) -> tuple[configparser.RawConfigParser, str]:\n \"\"\"Load the configuration given the user options.\n\n - in ``isolated`` mode, return an empty configuration\n - if a config file is given in ``config`` use that, otherwise attempt to\n discover a configuration using ``tox.ini`` / ``setup.cfg`` / ``.flake8``\n - finally, load any ``extra`` configuration files\n \"\"\"\n pwd = os.path.abspath(\".\")\n\n if isolated:\n return configparser.RawConfigParser(), pwd\n\n if config is None:\n config = _find_config_file(pwd)\n\n cfg = configparser.RawConfigParser()\n if config is not None:\n if not cfg.read(config, encoding=\"UTF-8\"):\n raise exceptions.ExecutionError(\n f\"The specified config file does not exist: {config}\",\n )\n cfg_dir = os.path.dirname(config)\n else:\n cfg_dir = pwd\n\n # TODO: remove this and replace it with configuration modifying plugins\n # read the additional configs afterwards\n for filename in extra:\n if not cfg.read(filename, encoding=\"UTF-8\"):\n raise exceptions.ExecutionError(\n f\"The specified config file does not exist: {filename}\",\n )\n\n return cfg, cfg_dir", "result_size": 1, "created_at": "2026-03-20T16:58:16.229163+00:00"}} {"sample_id": "colinhacks__zod__jwt__downstream__2hop_c50ae7", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["_addCheck"], "hop_1_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"], "hop_2": ["ZodString", "constructor"], "hop_2_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"]}, "metadata": {"anchor": "jwt", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "anchor_source": "jwt(options?: { alg?: string; message?: string | undefined }) {\n return this._addCheck({ kind: \"jwt\", ...errorUtil.errToObj(options) });\n }", "result_size": 2, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "paramiko__paramiko__shutdown__downstream__1hop_9941de", "repo": "paramiko/paramiko", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["_send_eof"], "call_files": ["private/tmp/repos/paramiko/paramiko/channel.py"]}, "metadata": {"anchor": "shutdown", "anchor_file": "private/tmp/repos/paramiko/paramiko/channel.py", "anchor_source": "def shutdown(self, how):\n \"\"\"\n Shut down one or both halves of the connection. If ``how`` is 0,\n further receives are disallowed. If ``how`` is 1, further sends\n are disallowed. If ``how`` is 2, further sends and receives are\n disallowed. This closes the stream in one or both directions.\n\n :param int how:\n 0 (stop receiving), 1 (stop sending), or 2 (stop receiving and\n sending).\n \"\"\"\n if (how == 0) or (how == 2):\n # feign \"read\" shutdown\n self.eof_received = 1\n if (how == 1) or (how == 2):\n self.lock.acquire()\n try:\n m = self._send_eof()\n finally:\n self.lock.release()\n if m is not None and self.transport is not None:\n self.transport._send_user_message(m)", "result_size": 1, "created_at": "2026-03-20T16:58:17.364834+00:00"}} {"sample_id": "pallets__flask__url_for__downstream__2hop_d08993", "repo": "pallets/flask", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["url_for"], "hop_1_files": ["private/tmp/repos/flask/src/flask/app.py"], "hop_2": ["handle_url_build_error", "create_url_adapter", "inject_url_defaults"], "hop_2_files": ["private/tmp/repos/flask/src/flask/sansio/app.py", "private/tmp/repos/flask/src/flask/app.py", "private/tmp/repos/flask/src/flask/sansio/app.py"]}, "metadata": {"anchor": "url_for", "anchor_file": "private/tmp/repos/flask/src/flask/helpers.py", "anchor_source": "def url_for(\n endpoint: str,\n *,\n _anchor: str | None = None,\n _method: str | None = None,\n _scheme: str | None = None,\n _external: bool | None = None,\n **values: t.Any,\n) -> str:\n \"\"\"Generate a URL to the given endpoint with the given values.\n\n This requires an active request or application context, and calls\n :meth:`current_app.url_for() `. See that method\n for full documentation.\n\n :param endpoint: The endpoint name associated with the URL to\n generate. If this starts with a ``.``, the current blueprint\n name (if any) will be used.\n :param _anchor: If given, append this as ``#anchor`` to the URL.\n :param _method: If given, generate the URL associated with this\n method for the endpoint.\n :param _scheme: If given, the URL will have this scheme if it is\n external.\n :param _external: If given, prefer the URL to be internal (False) or\n require it to be external (True). External URLs include the\n scheme and domain. When not in an active request, URLs are\n external by default.\n :param values: Values to use for the variable parts of the URL rule.\n Unknown keys are appended as query string arguments, like\n ``?a=b&c=d``.\n\n .. versionchanged:: 2.2\n Calls ``current_app.url_for``, allowing an app to override the\n behavior.\n\n .. versionchanged:: 0.10\n The ``_scheme`` parameter was added.\n\n .. versionchanged:: 0.9\n The ``_anchor`` and ``_method`` parameters were added.\n\n .. versionchanged:: 0.9\n Calls ``app.handle_url_build_error`` on build errors.\n \"\"\"\n return current_app.url_for(\n endpoint,\n _anchor=_anchor,\n _method=_method,\n _scheme=_scheme,\n _external=_external,\n **values,\n )", "result_size": 3, "created_at": "2026-03-20T16:58:17.167063+00:00"}} {"sample_id": "immerjs__immer__deleteProperty__downstream__2hop_ebc126", "repo": "immerjs/immer", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["markChanged", "peek", "prepareCopy"], "hop_1_files": ["private/tmp/repos/immerjs__immer/src/core/proxy.ts", "private/tmp/repos/immerjs__immer/src/core/proxy.ts", "private/tmp/repos/immerjs__immer/src/core/proxy.ts"], "hop_2": ["shallowCopy"], "hop_2_files": ["private/tmp/repos/immerjs__immer/src/utils/common.ts"]}, "metadata": {"anchor": "deleteProperty", "anchor_file": "private/tmp/repos/immerjs__immer/src/core/proxy.ts", "anchor_source": "deleteProperty(state, prop: string) {\n\t\tprepareCopy(state)\n\t\t// The `undefined` check is a fast path for pre-existing keys.\n\t\tif (peek(state.base_, prop) !== undefined || prop in state.base_) {\n\t\t\tstate.assigned_!.set(prop, false)\n\t\t\tmarkChanged(state)\n\t\t} else {\n\t\t\t// if an originally not assigned property was deleted\n\t\t\tstate.assigned_!.delete(prop)\n\t\t}\n\t\tif (state.copy_) {\n\t\t\tdelete state.copy_[prop]\n\t\t}\n\t\treturn true\n\t},", "result_size": 1, "created_at": "2026-03-20T16:58:16.801413+00:00"}} {"sample_id": "colinhacks__zod___parse__downstream__1hop_1d9af9", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["addIssueToContext", "_getOrReturnCtx", "_getType"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/helpers/parseUtil.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"]}, "metadata": {"anchor": "_parse", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "anchor_source": "_parse(input: ParseInput): ParseReturnType {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.undefined) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.void,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }", "result_size": 3, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "trpc__trpc__destroy__downstream__1hop_fa3b17", "repo": "trpc/trpc", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["cleanup"], "call_files": ["private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/utils/mergeAsyncIterables.ts"]}, "metadata": {"anchor": "destroy", "anchor_file": "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/utils/mergeAsyncIterables.ts", "anchor_source": "destroy: async () => {\n cleanup();\n await iterator.return?.();\n },", "result_size": 1, "created_at": "2026-03-20T16:58:18.199328+00:00"}} {"sample_id": "trpc__trpc__createServerAction__downstream__2hop_8dae44", "repo": "trpc/trpc", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["formDataToObject", "getTRPCErrorFromUnknown", "actionHandler", "TRPCError", "constructor", "deserialize", "getErrorShape", "isFormData", "transformTRPCResponse"], "hop_1_files": ["private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/http/formDataToObject.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/error/TRPCError.ts", "private/tmp/repos/trpc__trpc/packages/next/src/app-dir/server.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/error/TRPCError.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/error/TRPCError.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/transformer.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/error/getErrorShape.ts", "private/tmp/repos/trpc__trpc/packages/next/src/app-dir/shared.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/transformer.ts"], "hop_2": ["transformTRPCResponseItem", "set", "emptyObject", "getHTTPStatusCodeFromError", "getCauseFromUnknown"], "hop_2_files": ["private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/transformer.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/http/formDataToObject.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/utils.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/error/TRPCError.ts"]}, "metadata": {"anchor": "createServerAction", "anchor_file": "private/tmp/repos/trpc__trpc/packages/next/src/app-dir/server.ts", "anchor_source": "return function createServerAction(\n proc: TProc,\n ): TRPCActionHandler<\n Simplify, TProc>>\n > {\n return async function actionHandler(\n rawInput: FormData | inferProcedureInput,\n ) {\n let ctx: TInstance['_config']['$types']['ctx'] | undefined = undefined;\n try {\n ctx = (await createContext?.()) ?? {};\n if (normalizeFormData && isFormData(rawInput)) {\n // Normalizes FormData so we can use `z.object({})` etc on the server\n try {\n rawInput = formDataToObject(rawInput);\n } catch {\n throw new TRPCError({\n code: 'INTERNAL_SERVER_ERROR',\n message: 'Failed to convert FormData to an object',\n });\n }\n } else if (rawInput && !isFormData(rawInput)) {\n rawInput = transformer.input.deserialize(rawInput);\n }\n\n const data = proc._def.experimental_caller\n ? await proc(rawInput as any)\n : await proc({\n input: undefined,\n ctx,\n path: '',\n getRawInput: async () => rawInput,\n type: proc._def.type,\n // is it possible to get the AbortSignal from the request?\n signal: undefined,\n batchIndex: 0,\n });\n\n const transformedJSON = transformTRPCResponse(config, {\n result: {\n data,\n },\n });\n return transformedJSON;\n } catch (cause) {\n const error = getTRPCErrorFromUnknown(cause);\n\n opts.onError?.({\n ctx,\n error,\n input: rawInput,\n path: '',\n type: proc._def.type,\n });\n\n if (shouldRethrowNextErrors) {\n rethrowNextErrors(error);\n }\n\n const shape = getErrorShape({\n config,\n ctx,\n error,\n input: rawInput,\n path: '',\n type: proc._def.type,\n });\n\n return transformTRPCResponse(t._config, {\n error: shape,\n });\n }\n } as TRPCActionHandler<\n inferActionDef\n >;\n };", "result_size": 5, "created_at": "2026-03-20T16:58:18.199328+00:00"}} {"sample_id": "pallets__jinja__visit_Test__downstream__2hop_c575ca", "repo": "pallets/jinja", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["_filter_test_common", "visit"], "hop_1_files": ["private/tmp/repos/pallets__jinja/src/jinja2/compiler.py", "private/tmp/repos/pallets__jinja/src/jinja2/visitor.py"], "hop_2": ["write", "fail", "from_obj", "get_visitor", "generic_visit", "signature"], "hop_2_files": ["private/tmp/repos/pallets__jinja/src/jinja2/compiler.py", "private/tmp/repos/pallets__jinja/src/jinja2/compiler.py", "private/tmp/repos/pallets__jinja/src/jinja2/utils.py", "private/tmp/repos/pallets__jinja/src/jinja2/visitor.py", "private/tmp/repos/pallets__jinja/src/jinja2/visitor.py", "private/tmp/repos/pallets__jinja/src/jinja2/compiler.py"]}, "metadata": {"anchor": "visit_Test", "anchor_file": "private/tmp/repos/pallets__jinja/src/jinja2/compiler.py", "anchor_source": "@optimizeconst\n def visit_Test(self, node: nodes.Test, frame: Frame) -> None:\n with self._filter_test_common(node, frame, False):\n self.visit(node.node, frame)", "result_size": 6, "created_at": "2026-03-20T16:58:17.229656+00:00"}} {"sample_id": "colinhacks__zod___maxSize__downstream__1hop_0e0308", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["normalizeParams"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/util.ts"]}, "metadata": {"anchor": "_maxSize", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/api.ts", "anchor_source": "export function _maxSize(\n maximum: number,\n params?: string | $ZodCheckMaxSizeParams\n): checks.$ZodCheckMaxSize {\n return new checks.$ZodCheckMaxSize({\n check: \"max_size\",\n ...util.normalizeParams(params),\n maximum,\n });\n}", "result_size": 1, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "pallets__jinja___generate__upstream__2hop_c68aa6", "repo": "pallets/jinja", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["compile"], "hop_1_files": ["private/tmp/repos/pallets__jinja/src/jinja2/environment.py"], "hop_2": ["load", "from_string", "compile_templates"], "hop_2_files": ["private/tmp/repos/pallets__jinja/src/jinja2/loaders.py", "private/tmp/repos/pallets__jinja/src/jinja2/environment.py", "private/tmp/repos/pallets__jinja/src/jinja2/environment.py"]}, "metadata": {"anchor": "_generate", "anchor_file": "private/tmp/repos/pallets__jinja/src/jinja2/environment.py", "anchor_source": "def _generate(\n self,\n source: nodes.Template,\n name: str | None,\n filename: str | None,\n defer_init: bool = False,\n ) -> str:\n \"\"\"Internal hook that can be overridden to hook a different generate\n method in.\n\n .. versionadded:: 2.5\n \"\"\"\n return generate( # type: ignore\n source,\n self,\n name,\n filename,\n defer_init=defer_init,\n optimized=self.optimized,\n )", "result_size": 3, "created_at": "2026-03-20T16:58:17.229656+00:00", "file_content": ""}} {"sample_id": "pallets__click__get_short_help_str__downstream__1hop_783063", "repo": "pallets/click", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["make_default_short_help"], "call_files": ["private/tmp/repos/pallets__click/src/click/utils.py"]}, "metadata": {"anchor": "get_short_help_str", "anchor_file": "private/tmp/repos/pallets__click/src/click/core.py", "anchor_source": "def get_short_help_str(self, limit: int = 45) -> str:\n \"\"\"Gets short help for the command or makes it by shortening the\n long help string.\n \"\"\"\n if self.short_help:\n text = inspect.cleandoc(self.short_help)\n elif self.help:\n text = make_default_short_help(self.help, limit)\n else:\n text = \"\"\n\n if self.deprecated:\n deprecated_message = (\n f\"(DEPRECATED: {self.deprecated})\"\n if isinstance(self.deprecated, str)\n else \"(DEPRECATED)\"\n )\n text = _(\"{text} {deprecated_message}\").format(\n text=text, deprecated_message=deprecated_message\n )\n\n return text.strip()", "result_size": 1, "created_at": "2026-03-20T16:58:17.078639+00:00"}} {"sample_id": "sindresorhus__got__cacheOptions__downstream__2hop_765a71", "repo": "sindresorhus/got", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["assertAny", "assertPlainObject", "cacheOptions"], "hop_1_files": ["private/tmp/repos/got/source/core/options.ts", "private/tmp/repos/got/source/core/options.ts", "private/tmp/repos/got/source/core/options.ts"], "hop_2": ["wrapAssertionWithContext"], "hop_2_files": ["private/tmp/repos/got/source/core/options.ts"]}, "metadata": {"anchor": "cacheOptions", "anchor_file": "private/tmp/repos/got/source/core/options.ts", "anchor_source": "set cacheOptions(value: CacheOptions) {\n\t\tassertPlainObject('cacheOptions', value);\n\n\t\tassertAny('cacheOptions.shared', [is.boolean, is.undefined], value.shared);\n\t\tassertAny('cacheOptions.cacheHeuristic', [is.number, is.undefined], value.cacheHeuristic);\n\t\tassertAny('cacheOptions.immutableMinTimeToLive', [is.number, is.undefined], value.immutableMinTimeToLive);\n\t\tassertAny('cacheOptions.ignoreCargoCult', [is.boolean, is.undefined], value.ignoreCargoCult);\n\n\t\tfor (const key in value) {\n\t\t\tif (!(key in this.#internals.cacheOptions)) {\n\t\t\t\tthrow new Error(`Cache option \\`${key}\\` does not exist`);\n\t\t\t}\n\t\t}\n\n\t\tif (this.#merging) {\n\t\t\tObject.assign(this.#internals.cacheOptions, value);\n\t\t} else {\n\t\t\tthis.#internals.cacheOptions = {...value};\n\t\t}\n\t}", "result_size": 1, "created_at": "2026-03-20T16:58:18.104721+00:00"}} {"sample_id": "agronholm__apscheduler__from_job__upstream__1hop_d64ef2", "repo": "agronholm/apscheduler", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["reap_abandoned_jobs", "_run_job", "acquire_jobs", "cleanup"], "call_files": ["private/tmp/repos/agronholm__apscheduler/src/apscheduler/datastores/sqlalchemy.py", "private/tmp/repos/agronholm__apscheduler/src/apscheduler/_schedulers/async_.py", "private/tmp/repos/agronholm__apscheduler/src/apscheduler/datastores/mongodb.py", "private/tmp/repos/agronholm__apscheduler/src/apscheduler/datastores/memory.py"]}, "metadata": {"anchor": "from_job", "anchor_file": "private/tmp/repos/agronholm__apscheduler/src/apscheduler/_structures.py", "anchor_source": "@classmethod\n def from_job(\n cls,\n job: Job,\n outcome: JobOutcome,\n *,\n finished_at: datetime | None = None,\n started_at: datetime | None = None,\n exception: BaseException | None = None,\n return_value: Any = None,\n ) -> JobResult:\n real_finished_at = finished_at or datetime.now(timezone.utc)\n expires_at = real_finished_at + job.result_expiration_time\n return cls(\n job_id=job.id,\n outcome=outcome,\n started_at=started_at,\n finished_at=real_finished_at,\n expires_at=expires_at,\n exception=exception,\n return_value=return_value,\n )", "result_size": 6, "created_at": "2026-03-20T16:58:16.252821+00:00", "file_content": ""}} {"sample_id": "paramiko__paramiko___parse_kexecdh_init__downstream__1hop_8499df", "repo": "paramiko/paramiko", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["_perform_exchange", "KexCurve25519"], "call_files": ["private/tmp/repos/paramiko/paramiko/kex_curve25519.py", "private/tmp/repos/paramiko/paramiko/kex_curve25519.py"]}, "metadata": {"anchor": "_parse_kexecdh_init", "anchor_file": "private/tmp/repos/paramiko/paramiko/kex_curve25519.py", "anchor_source": "def _parse_kexecdh_init(self, m):\n peer_key_bytes = m.get_string()\n peer_key = X25519PublicKey.from_public_bytes(peer_key_bytes)\n K = self._perform_exchange(peer_key)\n K = int(binascii.hexlify(K), 16)\n # compute exchange hash\n hm = Message()\n hm.add(\n self.transport.remote_version,\n self.transport.local_version,\n self.transport.remote_kex_init,\n self.transport.local_kex_init,\n )\n server_key_bytes = self.transport.get_server_key().asbytes()\n exchange_key_bytes = self.key.public_key().public_bytes(\n serialization.Encoding.Raw, serialization.PublicFormat.Raw\n )\n hm.add_string(server_key_bytes)\n hm.add_string(peer_key_bytes)\n hm.add_string(exchange_key_bytes)\n hm.add_mpint(K)\n H = self.hash_algo(hm.asbytes()).digest()\n self.transport._set_K_H(K, H)\n sig = self.transport.get_server_key().sign_ssh_data(\n H, self.transport.host_key_type\n )\n # construct reply\n m = Message()\n m.add_byte(c_MSG_KEXECDH_REPLY)\n m.add_string(server_key_bytes)\n m.add_string(exchange_key_bytes)\n m.add_string(sig)\n self.transport._send_message(m)\n self.transport._activate_outbound()", "result_size": 2, "created_at": "2026-03-20T16:58:17.364834+00:00"}} {"sample_id": "trpc__trpc__formDataToObject__downstream__1hop_e9f533", "repo": "trpc/trpc", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["set", "emptyObject"], "call_files": ["private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/http/formDataToObject.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/utils.ts"]}, "metadata": {"anchor": "formDataToObject", "anchor_file": "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/http/formDataToObject.ts", "anchor_source": "export function formDataToObject(formData: FormData) {\n const obj: Record = emptyObject();\n\n for (const [key, value] of formData.entries()) {\n const parts = key.split(/[\\.\\[\\]]/).filter(Boolean);\n set(obj, parts, value);\n }\n\n return obj;\n}", "result_size": 2, "created_at": "2026-03-20T16:58:18.199328+00:00"}} {"sample_id": "locustio__locust__SwarmRatiosTab__downstream__2hop_90c642", "repo": "locustio/locust", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["useFetchTasks"], "hop_1_files": ["private/tmp/repos/locustio__locust/locust/webui/src/hooks/useFetchTasks.ts"], "hop_2": ["useAction", "useInterval"], "hop_2_files": ["private/tmp/repos/locustio__locust/locust/webui/src/redux/hooks.ts", "private/tmp/repos/locustio__locust/locust/webui/src/hooks/useInterval.ts"]}, "metadata": {"anchor": "SwarmRatiosTab", "anchor_file": "private/tmp/repos/locustio__locust/locust/webui/src/components/SwarmRatiosTab/SwarmRatiosTab.tsx", "anchor_source": "export default function SwarmRatiosTab() {\n useFetchTasks();\n\n return ;\n}", "result_size": 2, "created_at": "2026-03-20T16:58:16.951273+00:00"}} {"sample_id": "agronholm__apscheduler__unmarshal__upstream__1hop_6e58d7", "repo": "agronholm/apscheduler", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["get_schedules", "acquire_schedules", "_deserialize_schedules"], "call_files": ["private/tmp/repos/agronholm__apscheduler/src/apscheduler/datastores/mongodb.py", "private/tmp/repos/agronholm__apscheduler/src/apscheduler/datastores/mongodb.py", "private/tmp/repos/agronholm__apscheduler/src/apscheduler/datastores/sqlalchemy.py"]}, "metadata": {"anchor": "unmarshal", "anchor_file": "private/tmp/repos/agronholm__apscheduler/src/apscheduler/_structures.py", "anchor_source": "@classmethod\n def unmarshal(cls, serializer: Serializer, marshalled: dict[str, Any]) -> Schedule:\n marshalled[\"trigger\"] = serializer.deserialize(marshalled[\"trigger\"])\n marshalled[\"args\"] = serializer.deserialize(marshalled[\"args\"])\n marshalled[\"kwargs\"] = serializer.deserialize(marshalled[\"kwargs\"])\n return cls(**marshalled)", "result_size": 3, "created_at": "2026-03-20T16:58:16.252821+00:00", "file_content": ""}} {"sample_id": "psf__black__generate_matches__downstream__2hop_3e2c9f", "repo": "psf/black", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["generate_matches"], "hop_1_files": ["private/tmp/repos/psf__black/src/blib2to3/pytree.py"], "hop_2": ["match"], "hop_2_files": ["private/tmp/repos/psf__black/src/blib2to3/pytree.py"]}, "metadata": {"anchor": "generate_matches", "anchor_file": "private/tmp/repos/psf__black/src/blib2to3/pytree.py", "anchor_source": "def generate_matches(\n patterns: list[BasePattern], nodes: list[NL]\n) -> Iterator[tuple[int, _Results]]:\n \"\"\"\n Generator yielding matches for a sequence of patterns and nodes.\n\n Args:\n patterns: a sequence of patterns\n nodes: a sequence of nodes\n\n Yields:\n (count, results) tuples where:\n count: the entire sequence of patterns matches nodes[:count];\n results: dict containing named submatches.\n \"\"\"\n if not patterns:\n yield 0, {}\n else:\n p, rest = patterns[0], patterns[1:]\n for c0, r0 in p.generate_matches(nodes):\n if not rest:\n yield c0, r0\n else:\n for c1, r1 in generate_matches(rest, nodes[c0:]):\n r = {}\n r.update(r0)\n r.update(r1)\n yield c0 + c1, r", "result_size": 1, "created_at": "2026-03-20T16:58:17.494246+00:00"}} {"sample_id": "trpc__trpc__createNextApiHandler__downstream__2hop_706d09", "repo": "trpc/trpc", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["TRPCError", "internal_exceptionHandler", "constructor", "nodeHTTPRequestHandler"], "hop_1_files": ["private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/error/TRPCError.ts", "private/tmp/repos/trpc__trpc/packages/server/src/adapters/node-http/nodeHTTPRequestHandler.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/error/TRPCError.ts", "private/tmp/repos/trpc__trpc/packages/server/src/adapters/node-http/nodeHTTPRequestHandler.ts"], "hop_2": ["resolveResponse", "getTRPCErrorFromUnknown", "incomingMessageToRequest", "writeResponse", "getCauseFromUnknown", "getErrorShape", "transformTRPCResponse"], "hop_2_files": ["private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/http/resolveResponse.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/error/TRPCError.ts", "private/tmp/repos/trpc__trpc/packages/server/src/adapters/node-http/incomingMessageToRequest.ts", "private/tmp/repos/trpc__trpc/packages/server/src/adapters/node-http/writeResponse.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/error/TRPCError.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/error/getErrorShape.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/transformer.ts"]}, "metadata": {"anchor": "createNextApiHandler", "anchor_file": "private/tmp/repos/trpc__trpc/packages/server/src/adapters/next.ts", "anchor_source": "export function createNextApiHandler(\n opts: NodeHTTPHandlerOptions,\n): NextApiHandler {\n return async (req, res) => {\n let path = '';\n\n await run(async () => {\n path = run(() => {\n if (typeof req.query['trpc'] === 'string') {\n return req.query['trpc'];\n }\n if (Array.isArray(req.query['trpc'])) {\n return req.query['trpc'].join('/');\n }\n throw new TRPCError({\n message:\n 'Query \"trpc\" not found - is the file named `[trpc]`.ts or `[...trpc].ts`?',\n code: 'INTERNAL_SERVER_ERROR',\n });\n });\n\n await nodeHTTPRequestHandler({\n ...(opts as any),\n req,\n res,\n path,\n });\n }).catch(\n internal_exceptionHandler({\n req,\n res,\n path,\n ...opts,\n }),\n );\n };\n}", "result_size": 8, "created_at": "2026-03-20T16:58:18.199328+00:00"}} {"sample_id": "sindresorhus__got__form__downstream__2hop_37df6c", "repo": "sindresorhus/got", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["form"], "hop_1_files": ["private/tmp/repos/got/source/core/options.ts"], "hop_2": ["assertAny"], "hop_2_files": ["private/tmp/repos/got/source/core/options.ts"]}, "metadata": {"anchor": "form", "anchor_file": "private/tmp/repos/got/source/core/options.ts", "anchor_source": "get form(): Record | undefined {\n\t\treturn this.#internals.form;\n\t}", "result_size": 1, "created_at": "2026-03-20T16:58:18.104721+00:00"}} {"sample_id": "colinhacks__zod___minLength__upstream__1hop_aca2d3", "repo": "colinhacks/zod", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["min", "nonempty", "convertBaseSchema"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/schemas.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/schemas.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/from-json-schema.ts"]}, "metadata": {"anchor": "_minLength", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/api.ts", "anchor_source": "export function _minLength(\n minimum: number,\n params?: string | $ZodCheckMinLengthParams\n): checks.$ZodCheckMinLength {\n return new checks.$ZodCheckMinLength({\n check: \"min_length\",\n ...util.normalizeParams(params),\n minimum,\n });\n}", "result_size": 5, "created_at": "2026-03-20T16:58:16.474869+00:00", "file_content": ""}} {"sample_id": "trpc__trpc__hasOutgoingRequests__upstream__2hop_dc8a81", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["constructor", "batchSend"], "hop_1_files": ["private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/wsClient.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/wsClient.ts"], "hop_2": ["request", "createWSClient"], "hop_2_files": ["private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/wsClient.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/createWsClient.ts"]}, "metadata": {"anchor": "hasOutgoingRequests", "anchor_file": "private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/requestManager.ts", "anchor_source": "public hasOutgoingRequests() {\n return this.outgoingRequests.length > 0;\n }", "result_size": 3, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "colinhacks__zod___templateLiteral__downstream__1hop_16b183", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["normalizeParams"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/util.ts"]}, "metadata": {"anchor": "_templateLiteral", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/api.ts", "anchor_source": "export function _templateLiteral(\n Class: util.SchemaClass,\n parts: Parts,\n params?: string | $ZodTemplateLiteralParams\n): schemas.$ZodTemplateLiteral> {\n return new Class({\n type: \"template_literal\",\n parts,\n ...util.normalizeParams(params),\n }) as any;\n}", "result_size": 1, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "encode__httpx__aread__upstream__1hop_ed448b", "repo": "encode/httpx", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["async_auth_flow", "_send_handling_auth", "send", "_send_handling_redirects"], "call_files": ["private/tmp/repos/encode__httpx/httpx/_auth.py", "private/tmp/repos/encode__httpx/httpx/_client.py", "private/tmp/repos/encode__httpx/httpx/_client.py", "private/tmp/repos/encode__httpx/httpx/_client.py"]}, "metadata": {"anchor": "aread", "anchor_file": "private/tmp/repos/encode__httpx/httpx/_models.py", "anchor_source": "async def aread(self) -> bytes:\n \"\"\"\n Read and return the response content.\n \"\"\"\n if not hasattr(self, \"_content\"):\n self._content = b\"\".join([part async for part in self.aiter_bytes()])\n return self._content", "result_size": 4, "created_at": "2026-03-20T16:58:16.700579+00:00", "file_content": ""}} {"sample_id": "pallets__click__style__upstream__1hop_364d1a", "repo": "pallets/click", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["secho", "invoke", "handle_parse_result"], "call_files": ["private/tmp/repos/pallets__click/src/click/termui.py", "private/tmp/repos/pallets__click/src/click/core.py", "private/tmp/repos/pallets__click/src/click/core.py"]}, "metadata": {"anchor": "style", "anchor_file": "private/tmp/repos/pallets__click/src/click/termui.py", "anchor_source": "def style(\n text: t.Any,\n fg: int | tuple[int, int, int] | str | None = None,\n bg: int | tuple[int, int, int] | str | None = None,\n bold: bool | None = None,\n dim: bool | None = None,\n underline: bool | None = None,\n overline: bool | None = None,\n italic: bool | None = None,\n blink: bool | None = None,\n reverse: bool | None = None,\n strikethrough: bool | None = None,\n reset: bool = True,\n) -> str:\n \"\"\"Styles a text with ANSI styles and returns the new string. By\n default the styling is self contained which means that at the end\n of the string a reset code is issued. This can be prevented by\n passing ``reset=False``.\n\n Examples::\n\n click.echo(click.style('Hello World!', fg='green'))\n click.echo(click.style('ATTENTION!', blink=True))\n click.echo(click.style('Some things', reverse=True, fg='cyan'))\n click.echo(click.style('More colors', fg=(255, 12, 128), bg=117))\n\n Supported color names:\n\n * ``black`` (might be a gray)\n * ``red``\n * ``green``\n * ``yellow`` (might be an orange)\n * ``blue``\n * ``magenta``\n * ``cyan``\n * ``white`` (might be light gray)\n * ``bright_black``\n * ``bright_red``\n * ``bright_green``\n * ``bright_yellow``\n * ``bright_blue``\n * ``bright_magenta``\n * ``bright_cyan``\n * ``bright_white``\n * ``reset`` (reset the color code only)\n\n If the terminal supports it, color may also be specified as:\n\n - An integer in the interval [0, 255]. The terminal must support\n 8-bit/256-color mode.\n - An RGB tuple of three integers in [0, 255]. The terminal must\n support 24-bit/true-color mode.\n\n See https://en.wikipedia.org/wiki/ANSI_color and\n https://gist.github.com/XVilka/8346728 for more information.\n\n :param text: the string to style with ansi codes.\n :param fg: if provided this will become the foreground color.\n :param bg: if provided this will become the background color.\n :param bold: if provided this will enable or disable bold mode.\n :param dim: if provided this will enable or disable dim mode. This is\n badly supported.\n :param underline: if provided this will enable or disable underline.\n :param overline: if provided this will enable or disable overline.\n :param italic: if provided this will enable or disable italic.\n :param blink: if provided this will enable or disable blinking.\n :param reverse: if provided this will enable or disable inverse\n rendering (foreground becomes background and the\n other way round).\n :param strikethrough: if provided this will enable or disable\n striking through text.\n :param reset: by default a reset-all code is added at the end of the\n string which means that styles do not carry over. This\n can be disabled to compose styles.\n\n .. versionchanged:: 8.0\n A non-string ``message`` is converted to a string.\n\n .. versionchanged:: 8.0\n Added support for 256 and RGB color codes.\n\n .. versionchanged:: 8.0\n Added the ``strikethrough``, ``italic``, and ``overline``\n parameters.\n\n .. versionchanged:: 7.0\n Added support for bright colors.\n\n .. versionadded:: 2.0\n \"\"\"\n if not isinstance(text, str):\n text = str(text)\n\n bits = []\n\n if fg:\n try:\n bits.append(f\"\\033[{_interpret_color(fg)}m\")\n except KeyError:\n raise TypeError(f\"Unknown color {fg!r}\") from None\n\n if bg:\n try:\n bits.append(f\"\\033[{_interpret_color(bg, 10)}m\")\n except KeyError:\n raise TypeError(f\"Unknown color {bg!r}\") from None\n\n if bold is not None:\n bits.append(f\"\\033[{1 if bold else 22}m\")\n if dim is not None:\n bits.append(f\"\\033[{2 if dim else 22}m\")\n if underline is not None:\n bits.append(f\"\\033[{4 if underline else 24}m\")\n if overline is not None:\n bits.append(f\"\\033[{53 if overline else 55}m\")\n if italic is not None:\n bits.append(f\"\\033[{3 if italic else 23}m\")\n if blink is not None:\n bits.append(f\"\\033[{5 if blink else 25}m\")\n if reverse is not None:\n bits.append(f\"\\033[{7 if reverse else 27}m\")\n if strikethrough is not None:\n bits.append(f\"\\033[{9 if strikethrough else 29}m\")\n bits.append(text)\n if reset:\n bits.append(_ansi_reset_all)\n return \"\".join(bits)", "result_size": 3, "created_at": "2026-03-20T16:58:17.078639+00:00", "file_content": ""}} {"sample_id": "pallets__jinja__visit_MarkSafe__downstream__1hop_3f59e9", "repo": "pallets/jinja", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["write", "visit"], "call_files": ["private/tmp/repos/pallets__jinja/src/jinja2/compiler.py", "private/tmp/repos/pallets__jinja/src/jinja2/visitor.py"]}, "metadata": {"anchor": "visit_MarkSafe", "anchor_file": "private/tmp/repos/pallets__jinja/src/jinja2/compiler.py", "anchor_source": "def visit_MarkSafe(self, node: nodes.MarkSafe, frame: Frame) -> None:\n self.write(\"Markup(\")\n self.visit(node.expr, frame)\n self.write(\")\")", "result_size": 2, "created_at": "2026-03-20T16:58:17.229656+00:00"}} {"sample_id": "colinhacks__zod__handleResults__downstream__2hop_4059af", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["ZodError", "addIssueToContext", "constructor"], "hop_1_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/ZodError.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/helpers/parseUtil.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/ZodError.ts"], "hop_2": ["getErrorMap"], "hop_2_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/errors.ts"]}, "metadata": {"anchor": "handleResults", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "anchor_source": "function handleResults(results: { ctx: ParseContext; result: SyncParseReturnType }[]) {\n // return first issue-free validation if it exists\n for (const result of results) {\n if (result.result.status === \"valid\") {\n return result.result;\n }\n }\n\n for (const result of results) {\n if (result.result.status === \"dirty\") {\n // add issues from dirty option\n\n ctx.common.issues.push(...result.ctx.common.issues);\n return result.result;\n }\n }\n\n // return invalid\n const unionErrors = results.map((result) => new ZodError(result.ctx.common.issues));\n\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_union,\n unionErrors,\n });\n return INVALID;\n }", "result_size": 1, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "psf__requests__extract_cookies_to_jar__upstream__1hop_6fe510", "repo": "psf/requests", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["resolve_redirects", "send", "build_response", "handle_401"], "call_files": ["private/tmp/repos/requests/src/requests/sessions.py", "private/tmp/repos/requests/src/requests/sessions.py", "private/tmp/repos/requests/src/requests/adapters.py", "private/tmp/repos/requests/src/requests/auth.py"]}, "metadata": {"anchor": "extract_cookies_to_jar", "anchor_file": "private/tmp/repos/requests/src/requests/cookies.py", "anchor_source": "def extract_cookies_to_jar(jar, request, response):\n \"\"\"Extract the cookies from the response into a CookieJar.\n\n :param jar: http.cookiejar.CookieJar (not necessarily a RequestsCookieJar)\n :param request: our own requests.Request object\n :param response: urllib3.HTTPResponse object\n \"\"\"\n if not (hasattr(response, \"_original_response\") and response._original_response):\n return\n # the _original_response field is the wrapped httplib.HTTPResponse object,\n req = MockRequest(request)\n # pull out the HTTPMessage with the headers and put it in the mock:\n res = MockResponse(response._original_response.msg)\n jar.extract_cookies(res, req)", "result_size": 4, "created_at": "2026-03-20T16:58:17.570287+00:00", "file_content": "\"\"\"\nrequests.cookies\n~~~~~~~~~~~~~~~~\n\nCompatibility code to be able to use `http.cookiejar.CookieJar` with requests.\n\nrequests.utils imports from here, so be careful with imports.\n\"\"\"\n\nimport calendar\nimport copy\nimport time\n\nfrom ._internal_utils import to_native_string\nfrom .compat import Morsel, MutableMapping, cookielib, urlparse, urlunparse\n\ntry:\n import threading\nexcept ImportError:\n import dummy_threading as threading\n\n\nclass MockRequest:\n \"\"\"Wraps a `requests.Request` to mimic a `urllib2.Request`.\n\n The code in `http.cookiejar.CookieJar` expects this interface in order to correctly\n manage cookie policies, i.e., determine whether a cookie can be set, given the\n domains of the request and the cookie.\n\n The original request object is read-only. The client is responsible for collecting\n the new headers via `get_new_headers()` and interpreting them appropriately. You\n probably want `get_cookie_header`, defined below.\n \"\"\"\n\n def __init__(self, request):\n self._r = request\n self._new_headers = {}\n self.type = urlparse(self._r.url).scheme\n\n def get_type(self):\n return self.type\n\n def get_host(self):\n return urlparse(self._r.url).netloc\n\n def get_origin_req_host(self):\n return self.get_host()\n\n def get_full_url(self):\n # Only return the response's URL if the user hadn't set the Host\n # header\n if not self._r.headers.get(\"Host\"):\n return self._r.url\n # If they did set it, retrieve it and reconstruct the expected domain\n host = to_native_string(self._r.headers[\"Host\"], encoding=\"utf-8\")\n parsed = urlparse(self._r.url)\n # Reconstruct the URL as we expect it\n return urlunparse(\n [\n parsed.scheme,\n host,\n parsed.path,\n parsed.params,\n parsed.query,\n parsed.fragment,\n ]\n )\n\n def is_unverifiable(self):\n return True\n\n def has_header(self, name):\n return name in self._r.headers or name in self._new_headers\n\n def get_header(self, name, default=None):\n return self._r.headers.get(name, self._new_headers.get(name, default))\n\n def add_header(self, key, val):\n \"\"\"cookiejar has no legitimate use for this method; add it back if you find one.\"\"\"\n raise NotImplementedError(\n \"Cookie headers should be added with add_unredirected_header()\"\n )\n\n def add_unredirected_header(self, name, value):\n self._new_headers[name] = value\n\n def get_new_headers(self):\n return self._new_headers\n\n @property\n def unverifiable(self):\n return self.is_unverifiable()\n\n @property\n def origin_req_host(self):\n return self.get_origin_req_host()\n\n @property\n def host(self):\n return self.get_host()\n\n\nclass MockResponse:\n \"\"\"Wraps a `httplib.HTTPMessage` to mimic a `urllib.addinfourl`.\n\n ...what? Basically, expose the parsed HTTP headers from the server response\n the way `http.cookiejar` expects to see them.\n \"\"\"\n\n def __init__(self, headers):\n \"\"\"Make a MockResponse for `cookiejar` to read.\n\n :param headers: a httplib.HTTPMessage or analogous carrying the headers\n \"\"\"\n self._headers = headers\n\n def info(self):\n return self._headers\n\n def getheaders(self, name):\n self._headers.getheaders(name)\n\n\ndef extract_cookies_to_jar(jar, request, response):\n \"\"\"Extract the cookies from the response into a CookieJar.\n\n :param jar: http.cookiejar.CookieJar (not necessarily a RequestsCookieJar)\n :param request: our own requests.Request object\n :param response: urllib3.HTTPResponse object\n \"\"\"\n if not (hasattr(response, \"_original_response\") and response._original_response):\n return\n # the _original_response field is the wrapped httplib.HTTPResponse object,\n req = MockRequest(request)\n # pull out the HTTPMessage with the headers and put it in the mock:\n res = MockResponse(response._original_response.msg)\n jar.extract_cookies(res, req)\n\n\ndef get_cookie_header(jar, request):\n \"\"\"\n Produce an appropriate Cookie header string to be sent with `request`, or None.\n\n :rtype: str\n \"\"\"\n r = MockRequest(request)\n jar.add_cookie_header(r)\n return r.get_new_headers().get(\"Cookie\")\n\n\ndef remove_cookie_by_name(cookiejar, name, domain=None, path=None):\n \"\"\"Unsets a cookie by name, by default over all domains and paths.\n\n Wraps CookieJar.clear(), is O(n).\n \"\"\"\n clearables = []\n for cookie in cookiejar:\n if cookie.name != name:\n continue\n if domain is not None and domain != cookie.domain:\n continue\n if path is not None and path != cookie.path:\n continue\n clearables.append((cookie.domain, cookie.path, cookie.name))\n\n for domain, path, name in clearables:\n cookiejar.clear(domain, path, name)\n\n\nclass CookieConflictError(RuntimeError):\n \"\"\"There are two cookies that meet the criteria specified in the cookie jar.\n Use .get and .set and include domain and path args in order to be more specific.\n \"\"\"\n\n\nclass RequestsCookieJar(cookielib.CookieJar, MutableMapping):\n \"\"\"Compatibility class; is a http.cookiejar.CookieJar, but exposes a dict\n interface.\n\n This is the CookieJar we create by default for requests and sessions that\n don't specify one, since some clients may expect response.cookies and\n session.cookies to support dict operations.\n\n Requests does not use the dict interface internally; it's just for\n compatibility with external client code. All requests code should work\n out of the box with externally provided instances of ``CookieJar``, e.g.\n ``LWPCookieJar`` and ``FileCookieJar``.\n\n Unlike a regular CookieJar, this class is pickleable.\n\n .. warning:: dictionary operations that are normally O(1) may be O(n).\n \"\"\"\n\n def get(self, name, default=None, domain=None, path=None):\n \"\"\"Dict-like get() that also supports optional domain and path args in\n order to resolve naming collisions from using one cookie jar over\n multiple domains.\n\n .. warning:: operation is O(n), not O(1).\n \"\"\"\n try:\n return self._find_no_duplicates(name, domain, path)\n except KeyError:\n return default\n\n def set(self, name, value, **kwargs):\n \"\"\"Dict-like set() that also supports optional domain and path args in\n order to resolve naming collisions from using one cookie jar over\n multiple domains.\n \"\"\"\n # support client code that unsets cookies by assignment of a None value:\n if value is None:\n remove_cookie_by_name(\n self, name, domain=kwargs.get(\"domain\"), path=kwargs.get(\"path\")\n )\n return\n\n if isinstance(value, Morsel):\n c = morsel_to_cookie(value)\n else:\n c = create_cookie(name, value, **kwargs)\n self.set_cookie(c)\n return c\n\n def iterkeys(self):\n \"\"\"Dict-like iterkeys() that returns an iterator of names of cookies\n from the jar.\n\n .. seealso:: itervalues() and iteritems().\n \"\"\"\n for cookie in iter(self):\n yield cookie.name\n\n def keys(self):\n \"\"\"Dict-like keys() that returns a list of names of cookies from the\n jar.\n\n .. seealso:: values() and items().\n \"\"\"\n return list(self.iterkeys())\n\n def itervalues(self):\n \"\"\"Dict-like itervalues() that returns an iterator of values of cookies\n from the jar.\n\n .. seealso:: iterkeys() and iteritems().\n \"\"\"\n for cookie in iter(self):\n yield cookie.value\n\n def values(self):\n \"\"\"Dict-like values() that returns a list of values of cookies from the\n jar.\n\n .. seealso:: keys() and items().\n \"\"\"\n return list(\n# \u2026 (truncated at 8000 chars)"}} {"sample_id": "immerjs__immer__createInitialState__downstream__1hop_45ff79", "repo": "immerjs/immer", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["createLargeObject"], "call_files": ["private/tmp/repos/immerjs__immer/perf-testing/immutability-profiling.mjs"]}, "metadata": {"anchor": "createInitialState", "anchor_file": "private/tmp/repos/immerjs__immer/perf-testing/immutability-profiling.mjs", "anchor_source": "function createInitialState(arraySize = BENCHMARK_CONFIG.arraySize) {\n\tconst initialState = {\n\t\tlargeArray: Array.from({length: arraySize}, (_, i) => ({\n\t\t\tid: i,\n\t\t\tvalue: Math.random(),\n\t\t\tnested: {key: `key-${i}`, data: Math.random()},\n\t\t\tmoreNested: {\n\t\t\t\titems: Array.from(\n\t\t\t\t\t{length: BENCHMARK_CONFIG.nestedArraySize},\n\t\t\t\t\t(_, i) => ({id: i, name: String(i)})\n\t\t\t\t)\n\t\t\t}\n\t\t})),\n\t\totherData: Array.from({length: arraySize}, (_, i) => ({\n\t\t\tid: i,\n\t\t\tname: `name-${i}`,\n\t\t\tisActive: i % 2 === 0\n\t\t})),\n\t\tlargeObject1: createLargeObject(BENCHMARK_CONFIG.largeObjectSize1),\n\t\tlargeObject2: createLargeObject(BENCHMARK_CONFIG.largeObjectSize2),\n\t\tapi: {\n\t\t\tqueries: {},\n\t\t\tprovided: {\n\t\t\t\tkeys: {}\n\t\t\t},\n\t\t\tsubscriptions: {}\n\t\t}\n\t}\n\treturn initialState\n}", "result_size": 1, "created_at": "2026-03-20T16:58:16.801413+00:00"}} {"sample_id": "trpc__trpc__isAbortError__upstream__1hop_1b1fa5", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["writeResponseBody", "onErrorCallback", "sseStreamProducer", "unstable_localLink", "generatorWithErrorHandling"], "call_files": ["private/tmp/repos/trpc__trpc/packages/server/src/adapters/node-http/writeResponse.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/localLink.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/sse.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/localLink.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/stream/sse.ts"]}, "metadata": {"anchor": "isAbortError", "anchor_file": "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/http/abortError.ts", "anchor_source": "export function isAbortError(\n error: unknown,\n): error is DOMException | Error | { name: 'AbortError' } {\n return isObject(error) && error['name'] === 'AbortError';\n}", "result_size": 8, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "trpc__trpc__createTRPCHeyApiClientConfig__downstream__1hop_ec471a", "repo": "trpc/trpc", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["resolveTransformer", "serialize", "deserialize"], "call_files": ["private/tmp/repos/trpc__trpc/packages/openapi/src/heyapi/index.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/transformer.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/transformer.ts"]}, "metadata": {"anchor": "createTRPCHeyApiClientConfig", "anchor_file": "private/tmp/repos/trpc__trpc/packages/openapi/src/heyapi/index.ts", "anchor_source": "export function createTRPCHeyApiClientConfig(opts?: TRPCHeyApiClientOptions) {\n const transformer = opts?.transformer\n ? resolveTransformer(opts.transformer)\n : undefined;\n\n return {\n querySerializer: (query: Record) => {\n const params = new URLSearchParams();\n\n for (const [key, value] of Object.entries(query)) {\n if (value === undefined) {\n continue;\n }\n\n if (key === 'input' && transformer) {\n params.append(\n key,\n JSON.stringify(transformer.input.serialize(value)),\n );\n } else {\n params.append(key, JSON.stringify(value));\n }\n }\n\n return params.toString();\n },\n\n ...(transformer && {\n bodySerializer: (body: unknown) => {\n return JSON.stringify(transformer.input.serialize(body));\n },\n\n responseTransformer: async (data: unknown) => {\n if (!!data && typeof data === 'object' && 'result' in data) {\n const result = (data as any).result;\n if (!result.type || result.type === 'data') {\n result.data = transformer.output.deserialize(result.data);\n }\n }\n\n return data;\n },\n }),\n } as const satisfies TRPCHeyApiClientConfig;\n}", "result_size": 3, "created_at": "2026-03-20T16:58:18.199328+00:00"}} {"sample_id": "sindresorhus__got__maxHeaderSize__downstream__2hop_e8cb2e", "repo": "sindresorhus/got", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["maxHeaderSize"], "hop_1_files": ["private/tmp/repos/got/source/core/options.ts"], "hop_2": ["assertAny"], "hop_2_files": ["private/tmp/repos/got/source/core/options.ts"]}, "metadata": {"anchor": "maxHeaderSize", "anchor_file": "private/tmp/repos/got/source/core/options.ts", "anchor_source": "get maxHeaderSize() {\n\t\treturn this.#internals.maxHeaderSize;\n\t}", "result_size": 1, "created_at": "2026-03-20T16:58:18.104721+00:00"}} {"sample_id": "colinhacks__zod__string__downstream__1hop_d0bbdc", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["_coercedString"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/api.ts"]}, "metadata": {"anchor": "string", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/coerce.ts", "anchor_source": "export function string(params?: string | core.$ZodStringParams): ZodCoercedString {\n return core._coercedString(schemas.ZodString, params) as any;\n}", "result_size": 1, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "locustio__locust__reset_all__upstream__1hop_43dbac", "repo": "locustio/locust", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["reset_stats", "on_spawning_complete"], "call_files": ["private/tmp/repos/locustio__locust/locust/web.py", "private/tmp/repos/locustio__locust/locust/runners.py"]}, "metadata": {"anchor": "reset_all", "anchor_file": "private/tmp/repos/locustio__locust/locust/stats.py", "anchor_source": "def reset_all(self) -> None:\n \"\"\"\n Go through all stats entries and reset them to zero\n \"\"\"\n self.total.reset()\n self.errors = {}\n for r in self.entries.values():\n r.reset()\n self.history = []", "result_size": 2, "created_at": "2026-03-20T16:58:16.951273+00:00", "file_content": ""}} {"sample_id": "trpc__trpc__readQueryKey__upstream__2hop_e042b7", "repo": "trpc/trpc", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["getClientArgs"], "hop_1_files": ["private/tmp/repos/trpc__trpc/packages/tanstack-react-query/src/internals/utils.ts"], "hop_2": ["trpcQueryOptions", "trpcInfiniteQueryOptions", "trpcMutationOptions"], "hop_2_files": ["private/tmp/repos/trpc__trpc/packages/tanstack-react-query/src/internals/queryOptions.ts", "private/tmp/repos/trpc__trpc/packages/tanstack-react-query/src/internals/infiniteQueryOptions.ts", "private/tmp/repos/trpc__trpc/packages/tanstack-react-query/src/internals/mutationOptions.ts"]}, "metadata": {"anchor": "readQueryKey", "anchor_file": "private/tmp/repos/trpc__trpc/packages/tanstack-react-query/src/internals/utils.ts", "anchor_source": "export function readQueryKey(queryKey: AnyTRPCQueryKey) {\n if (isPrefixedQueryKey(queryKey)) {\n return {\n type: 'prefixed' as const,\n prefix: queryKey[0],\n path: queryKey[1],\n args: queryKey[2],\n };\n } else {\n return {\n type: 'unprefixed' as const,\n prefix: undefined,\n path: queryKey[0],\n args: queryKey[1],\n };\n }\n}", "result_size": 3, "created_at": "2026-03-20T16:58:18.199328+00:00", "file_content": ""}} {"sample_id": "trpc__trpc__createTRPCQueryUtils__downstream__2hop_d4dcce", "repo": "trpc/trpc", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["createUtilityFunctions"], "hop_1_files": ["private/tmp/repos/trpc__trpc/packages/react-query/src/utils/createUtilityFunctions.ts"], "hop_2": ["query", "setMutationDefaults", "getClientArgs", "createTRPCOptionsResult", "mutation", "isAsyncIterable", "getUntypedClient"], "hop_2_files": ["private/tmp/repos/trpc__trpc/packages/client/src/internals/TRPCUntypedClient.ts", "private/tmp/repos/trpc__trpc/packages/react-query/src/utils/createUtilityFunctions.ts", "private/tmp/repos/trpc__trpc/packages/react-query/src/internals/getClientArgs.ts", "private/tmp/repos/trpc__trpc/packages/react-query/src/internals/trpcResult.ts", "private/tmp/repos/trpc__trpc/packages/client/src/internals/TRPCUntypedClient.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/utils.ts", "private/tmp/repos/trpc__trpc/packages/client/src/createTRPCClient.ts"]}, "metadata": {"anchor": "createTRPCQueryUtils", "anchor_file": "private/tmp/repos/trpc__trpc/packages/react-query/src/createTRPCQueryUtils.tsx", "anchor_source": "export function createTRPCQueryUtils(\n opts: CreateQueryUtilsOptions,\n) {\n const utils = createUtilityFunctions(opts);\n return createQueryUtilsProxy(utils);\n}", "result_size": 7, "created_at": "2026-03-20T16:58:18.199328+00:00"}} {"sample_id": "agronholm__apscheduler__callable_from_ref__upstream__2hop_150769", "repo": "agronholm/apscheduler", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["_get_task_callable", "unmarshal_object"], "hop_1_files": ["private/tmp/repos/agronholm__apscheduler/src/apscheduler/_schedulers/async_.py", "private/tmp/repos/agronholm__apscheduler/src/apscheduler/_marshalling.py"], "hop_2": ["_process_jobs", "__setstate__"], "hop_2_files": ["private/tmp/repos/agronholm__apscheduler/src/apscheduler/_schedulers/async_.py", "private/tmp/repos/agronholm__apscheduler/src/apscheduler/triggers/combining.py"]}, "metadata": {"anchor": "callable_from_ref", "anchor_file": "private/tmp/repos/agronholm__apscheduler/src/apscheduler/_marshalling.py", "anchor_source": "def callable_from_ref(ref: str) -> Callable:\n \"\"\"\n Return the callable pointed to by ``ref``.\n\n :raises DeserializationError: if the reference could not be resolved or the looked\n up object is not callable\n\n \"\"\"\n if \":\" not in ref:\n raise ValueError(f\"Invalid reference: {ref}\")\n\n modulename, rest = ref.split(\":\", 1)\n try:\n obj = __import__(modulename, fromlist=[rest])\n except ImportError as exc:\n raise LookupError(\n f\"Error resolving reference {ref!r}: could not import module\"\n ) from exc\n\n try:\n for name in rest.split(\".\"):\n obj = getattr(obj, name)\n except Exception as exc:\n raise DeserializationError(\n f\"Error resolving reference {ref!r}: error looking up object\"\n ) from exc\n\n if not callable(obj):\n raise DeserializationError(\n f\"{ref!r} points to an object of type \"\n f\"{obj.__class__.__qualname__} which is not callable\"\n )\n\n return obj", "result_size": 2, "created_at": "2026-03-20T16:58:16.252821+00:00", "file_content": ""}} {"sample_id": "rq__rq__dependents_key_for__upstream__2hop_81d29e", "repo": "rq/rq", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["register_dependency", "dependents_key"], "hop_1_files": ["private/tmp/repos/rq__rq/rq/job.py", "private/tmp/repos/rq__rq/rq/job.py"], "hop_2": ["get_jobs_with_met_dependencies", "setup_dependencies"], "hop_2_files": ["private/tmp/repos/rq__rq/rq/dependency.py", "private/tmp/repos/rq__rq/rq/queue.py"]}, "metadata": {"anchor": "dependents_key_for", "anchor_file": "private/tmp/repos/rq__rq/rq/job.py", "anchor_source": "@classmethod\n def dependents_key_for(cls, job_id: str) -> str:\n \"\"\"The Redis key that is used to store job dependents hash under.\n\n Args:\n job_id (str): The \"parent\" job id\n\n Returns:\n dependents_key (str): The dependents key\n \"\"\"\n return f'{cls.redis_job_namespace_prefix}{job_id}:dependents'", "result_size": 2, "created_at": "2026-03-20T16:58:17.875204+00:00", "file_content": ""}} {"sample_id": "celery__celery__on_state_change__upstream__2hop_d7c313", "repo": "celery/celery", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["on_state_change", "on_out_of_band_result"], "hop_1_files": ["private/tmp/repos/celery/celery/backends/redis.py", "private/tmp/repos/celery/celery/backends/asynchronous.py"], "hop_2": ["drain_events", "_reconnect_pubsub", "on_out_of_band_result", "on_wait_for_pending"], "hop_2_files": ["private/tmp/repos/celery/celery/backends/redis.py", "private/tmp/repos/celery/celery/backends/redis.py", "private/tmp/repos/celery/celery/backends/rpc.py", "private/tmp/repos/celery/celery/backends/redis.py"]}, "metadata": {"anchor": "on_state_change", "anchor_file": "private/tmp/repos/celery/celery/backends/asynchronous.py", "anchor_source": "def on_state_change(self, meta, message):\n if self.on_message:\n self.on_message(meta)\n if meta['status'] in states.READY_STATES:\n task_id = meta['task_id']\n try:\n result = self._get_pending_result(task_id)\n except KeyError:\n # send to buffer in case we received this result\n # before it was added to _pending_results.\n self._pending_messages.put(task_id, meta)\n else:\n result._maybe_set_cache(meta)\n buckets = self.buckets\n try:\n # remove bucket for this result, since it's fulfilled\n bucket = buckets.pop(result)\n except KeyError:\n pass\n else:\n # send to waiter via bucket\n bucket.append(result)\n sleep(0)", "result_size": 4, "created_at": "2026-03-20T16:58:16.326235+00:00", "file_content": "\"\"\"Async I/O backend support utilities.\"\"\"\n\nimport logging\nimport socket\nimport threading\nimport time\nfrom collections import deque\nfrom contextlib import contextmanager\nfrom queue import Empty\nfrom time import sleep\nfrom weakref import WeakKeyDictionary\n\nfrom kombu.utils.compat import detect_environment\n\nfrom celery import states\nfrom celery.exceptions import TimeoutError\nfrom celery.utils.log import get_logger\nfrom celery.utils.threads import THREAD_TIMEOUT_MAX\n\nE_CELERY_RESTART_REQUIRED = \"Celery must be restarted because a shutdown signal was detected.\"\n\nE_RETRY_LIMIT_EXCEEDED = \"\"\"\nRetry limit exceeded while trying to reconnect to the Celery result store\nbackend. The Celery application must be restarted.\n\"\"\"\n\nlogger = get_logger(__name__)\n\n__all__ = (\n 'AsyncBackendMixin', 'BaseResultConsumer', 'Drainer',\n 'register_drainer',\n)\n\n\nclass EventletAdaptedEvent:\n \"\"\"\n An adapted eventlet event, designed to match the API of `threading.Event` and\n `gevent.event.Event`.\n \"\"\"\n\n def __init__(self):\n import eventlet\n self.evt = eventlet.Event()\n\n def is_set(self):\n return self.evt.ready()\n\n def set(self):\n return self.evt.send()\n\n def wait(self, timeout=None):\n return self.evt.wait(timeout)\n\n\ndrainers = {}\n\n\ndef register_drainer(name):\n \"\"\"Decorator used to register a new result drainer type.\"\"\"\n def _inner(cls):\n drainers[name] = cls\n return cls\n return _inner\n\n\n@register_drainer('default')\nclass Drainer:\n \"\"\"Result draining service.\"\"\"\n\n def __init__(self, result_consumer):\n self.result_consumer = result_consumer\n\n def start(self):\n pass\n\n def stop(self):\n pass\n\n def drain_events_until(self, p, timeout=None, interval=1, on_interval=None, wait=None):\n wait = wait or self.result_consumer.drain_events\n time_start = time.monotonic()\n\n while 1:\n # Total time spent may exceed a single call to wait()\n if timeout and time.monotonic() - time_start >= timeout:\n raise socket.timeout()\n try:\n yield self.wait_for(p, wait, timeout=interval)\n except socket.timeout:\n pass\n except OSError:\n # Recoverable connection error (e.g. broker restart).\n # drain_events handles reconnection internally; if an\n # OSError still leaks through, we log, sleep for one\n # interval, and continue rather than spinning hot.\n logging.warning(\n 'Drainer: connection error during drain_events, '\n 'will retry on next loop iteration.',\n exc_info=True,\n )\n time.sleep(interval)\n\n if on_interval:\n on_interval()\n if p.ready: # got event on the wanted channel.\n break\n\n def wait_for(self, p, wait, timeout=None):\n wait(timeout=timeout)\n\n def _event(self):\n return threading.Event()\n\n\nclass greenletDrainer(Drainer):\n spawn = None\n _exc = None\n _g = None\n _drain_complete_event = None # event, sended (and recreated) after every drain_events iteration\n\n def _send_drain_complete_event(self):\n self._drain_complete_event.set()\n self._drain_complete_event = self._event()\n\n def __init__(self, *args, **kwargs):\n super().__init__(*args, **kwargs)\n\n self._started = self._event()\n self._stopped = self._event()\n self._shutdown = self._event()\n self._drain_complete_event = self._event()\n\n def run(self):\n self._started.set()\n\n try:\n while not self._stopped.is_set():\n try:\n self.result_consumer.drain_events(timeout=1)\n self._send_drain_complete_event()\n except socket.timeout:\n pass\n except OSError:\n # Recoverable connection errors (e.g. broker restart)\n # are handled inside drain_events via reconnection.\n # If something still leaks through, we log, back off\n # briefly, and retry instead of spinning hot.\n logging.warning(\n 'Drainer: connection error during drain_events, '\n 'will retry on next loop iteration.',\n exc_info=True,\n )\n time.sleep(1)\n except Exception as e:\n self._exc = e\n raise\n finally:\n self._send_drain_complete_event()\n try:\n self._shutdown.set()\n except RuntimeError as e:\n logging.error(f\"Failed to set shutdown event: {e}\")\n\n def start(self):\n self._ensure_not_shut_down()\n\n if not self._started.is_set():\n self._g = self.spawn(self.run)\n self._started.wait()\n\n def stop(self):\n self._stopped.set()\n self._shutdown.wait(THREAD_TIMEOUT_MAX)\n\n def wait_for(self, p, wait, timeout=None):\n self.start()\n if not p.ready:\n self._drain_complete_event.wait(timeout=timeout)\n\n self._ensure_not_shut_down()\n\n def _ensure_not_shut_down(self):\n \"\"\"Currently used to ensure the drainer has not run to completion.\n\n Raises if the shutdown event has been signaled (either due to an exception\n or stop() being called).\n\n The _shutdown event acts as synchronization to ensure _exc is properly\n set before it is read from, avoiding need for locks.\n \"\"\"\n if self._shutdown.is_set():\n if self._exc is not None:\n raise self._exc\n else:\n raise Exception(E_CELERY_RESTART_REQUIRED)\n\n\n@register_drainer('eventlet')\nclass eventletDrainer(greenletDrainer):\n\n def spawn(self, func):\n from eventlet import sleep, spawn\n g = spawn(func)\n sleep(0)\n return g\n\n def _event(self):\n return EventletAdaptedEvent()\n\n\n@register_drainer('gevent')\nclass geventDrainer(greenletDrainer):\n\n def spawn(self, func):\n import gevent\n g = gevent.spawn(func)\n gevent.sleep(0)\n return g\n\n def _event(self):\n from gevent.event import Event\n return Event()\n\n\nclass AsyncBackendMixin:\n \"\"\"Mixin for backends that enables the async API.\"\"\"\n\n def _collect_into(self, result, bucket):\n self.result_consumer.buckets[result] = bucket\n\n def iter_native(self, result, no_ack=True, **kwargs):\n self._ensure_not_eager()\n\n results = result.results\n if not results:\n raise StopIteration()\n\n # we tell the result consumer to put consumed results\n # into these buckets.\n bucket = deque()\n for node in results:\n if not hasattr(node, '_cache'):\n bucket.append(node)\n elif node._cache:\n bucket.append(node)\n else:\n self._collect_into(node, bucket)\n\n for _ in self._wait_for_pending(result, no_ack=no_ack, **kwargs):\n while bucket:\n node = bucket.popleft()\n if not hasattr(node, '_cache'):\n yield node.id, node.children\n else:\n yield node.id, node._cache\n while bucket:\n node = bucket.popleft()\n yield node.id, node._cache\n\n def add_pending_result(self, result, weak=False, start_drainer=True):\n if start_drainer:\n self.result_consumer.drainer.start()\n try:\n self._maybe_resolve_from_buffer(result)\n except Empty:\n self._add_pending_result(result.id, result, weak=weak)\n return result\n\n def _maybe_resolve_from_buffer(self, result):\n result._maybe_set_cache(self._pending_messages.take(result.id))\n\n def _add_pending_result(self\n# \u2026 (truncated at 8000 chars)"}} {"sample_id": "locustio__locust___format_user_classes_count_for_log__upstream__2hop_fc21bb", "repo": "locustio/locust", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["start", "_start"], "hop_1_files": ["private/tmp/repos/locustio__locust/locust/runners.py", "private/tmp/repos/locustio__locust/locust/runners.py"], "hop_2": ["main", "heartbeat_worker", "start", "handle_message"], "hop_2_files": ["private/tmp/repos/locustio__locust/locust/main.py", "private/tmp/repos/locustio__locust/locust/runners.py", "private/tmp/repos/locustio__locust/locust/runners.py", "private/tmp/repos/locustio__locust/locust/runners.py"]}, "metadata": {"anchor": "_format_user_classes_count_for_log", "anchor_file": "private/tmp/repos/locustio__locust/locust/runners.py", "anchor_source": "def _format_user_classes_count_for_log(user_classes_count: dict[str, int]) -> str:\n return \"{} ({} total users)\".format( # noqa: UP032\n json.dumps(dict(sorted(user_classes_count.items(), key=itemgetter(0)))),\n sum(user_classes_count.values()),\n )", "result_size": 4, "created_at": "2026-03-20T16:58:16.951273+00:00", "file_content": ""}} {"sample_id": "rq__rq__add__upstream__2hop_7b31cd", "repo": "rq/rq", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["_handle_failure"], "hop_1_files": ["private/tmp/repos/rq__rq/rq/job.py"], "hop_2": ["run_sync", "handle_job_failure", "cleanup"], "hop_2_files": ["private/tmp/repos/rq__rq/rq/queue.py", "private/tmp/repos/rq__rq/rq/worker/base.py", "private/tmp/repos/rq__rq/rq/registry.py"]}, "metadata": {"anchor": "add", "anchor_file": "private/tmp/repos/rq__rq/rq/registry.py", "anchor_source": "def add( # type: ignore[override]\n self,\n job: 'Job',\n ttl=None,\n exc_string: str = '',\n pipeline: Optional['Pipeline'] = None,\n ):\n \"\"\"\n Adds a job to a registry with expiry time of now + ttl.\n `ttl` defaults to DEFAULT_FAILURE_TTL if not specified.\n \"\"\"\n if ttl is None:\n ttl = DEFAULT_FAILURE_TTL\n score = ttl if ttl < 0 else current_timestamp() + ttl\n\n if pipeline:\n p = pipeline\n else:\n p = self.connection.pipeline()\n\n job._exc_info = exc_string\n job.save(pipeline=p, include_meta=False, include_result=False)\n job.cleanup(ttl=ttl, pipeline=p)\n p.zadd(self.key, {job.id: score})\n\n if not pipeline:\n p.execute()", "result_size": 3, "created_at": "2026-03-20T16:58:17.875204+00:00", "file_content": ""}} {"sample_id": "pallets__click__get_current_context__upstream__1hop_87f956", "repo": "pallets/click", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["new_func", "decorator", "pass_context", "make_pass_decorator", "pass_obj", "pass_meta_key", "resolve_color_default"], "call_files": ["private/tmp/repos/pallets__click/src/click/decorators.py", "private/tmp/repos/pallets__click/src/click/decorators.py", "private/tmp/repos/pallets__click/src/click/decorators.py", "private/tmp/repos/pallets__click/src/click/decorators.py", "private/tmp/repos/pallets__click/src/click/decorators.py", "private/tmp/repos/pallets__click/src/click/decorators.py", "private/tmp/repos/pallets__click/src/click/globals.py"]}, "metadata": {"anchor": "get_current_context", "anchor_file": "private/tmp/repos/pallets__click/src/click/globals.py", "anchor_source": "def get_current_context(silent: bool = False) -> Context | None:\n \"\"\"Returns the current click context. This can be used as a way to\n access the current context object from anywhere. This is a more implicit\n alternative to the :func:`pass_context` decorator. This function is\n primarily useful for helpers such as :func:`echo` which might be\n interested in changing its behavior based on the current context.\n\n To push the current context, :meth:`Context.scope` can be used.\n\n .. versionadded:: 5.0\n\n :param silent: if set to `True` the return value is `None` if no context\n is available. The default behavior is to raise a\n :exc:`RuntimeError`.\n \"\"\"\n try:\n return t.cast(\"Context\", _local.stack[-1])\n except (AttributeError, IndexError) as e:\n if not silent:\n raise RuntimeError(\"There is no active click context.\") from e\n\n return None", "result_size": 7, "created_at": "2026-03-20T16:58:17.078639+00:00", "file_content": ""}} {"sample_id": "colinhacks__zod___isoDate__upstream__2hop_153813", "repo": "colinhacks/zod", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["date"], "hop_1_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/iso.ts"], "hop_2": ["convertBaseSchema", "date"], "hop_2_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/from-json-schema.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/schemas.ts"]}, "metadata": {"anchor": "_isoDate", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/api.ts", "anchor_source": "export function _isoDate(\n Class: util.SchemaClass,\n params?: string | $ZodISODateParams | $ZodCheckISODateParams\n): T {\n return new Class({\n type: \"string\",\n format: \"date\",\n check: \"string_format\",\n ...util.normalizeParams(params),\n });\n}", "result_size": 3, "created_at": "2026-03-20T16:58:16.474869+00:00", "file_content": ""}} {"sample_id": "immerjs__immer__prepareSetCopy__downstream__1hop_9c7fe5", "repo": "immerjs/immer", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["isDraftable", "createProxy"], "call_files": ["private/tmp/repos/immerjs__immer/src/utils/common.ts", "private/tmp/repos/immerjs__immer/src/core/immerClass.ts"]}, "metadata": {"anchor": "prepareSetCopy", "anchor_file": "private/tmp/repos/immerjs__immer/src/plugins/mapset.ts", "anchor_source": "function prepareSetCopy(state: SetState) {\n\t\tif (!state.copy_) {\n\t\t\t// create drafts for all entries to preserve insertion order\n\t\t\tstate.copy_ = new Set()\n\t\t\tstate.base_.forEach(value => {\n\t\t\t\tif (isDraftable(value)) {\n\t\t\t\t\tconst draft = createProxy(state.scope_, value, state, value)\n\t\t\t\t\tstate.drafts_.set(value, draft)\n\t\t\t\t\tstate.copy_!.add(draft)\n\t\t\t\t} else {\n\t\t\t\t\tstate.copy_!.add(value)\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t}", "result_size": 2, "created_at": "2026-03-20T16:58:16.801413+00:00"}} {"sample_id": "colinhacks__zod__isPlainObject__upstream__1hop_4c62ae", "repo": "colinhacks/zod", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["safeExtend", "extend", "parse", "shallowClone", "mergeValues"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/util.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/util.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/schemas.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/util.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/schemas.ts"]}, "metadata": {"anchor": "isPlainObject", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/util.ts", "anchor_source": "export function isPlainObject(o: any): o is Record {\n if (isObject(o) === false) return false;\n\n // modified constructor\n const ctor = o.constructor;\n if (ctor === undefined) return true;\n\n if (typeof ctor !== \"function\") return true;\n\n // modified prototype\n const prot = ctor.prototype;\n if (isObject(prot) === false) return false;\n\n // ctor doesn't have static `isPrototypeOf`\n if (Object.prototype.hasOwnProperty.call(prot, \"isPrototypeOf\") === false) {\n return false;\n }\n\n return true;\n}", "result_size": 6, "created_at": "2026-03-20T16:58:16.474869+00:00", "file_content": ""}} {"sample_id": "sindresorhus__got__#getFallbackRequestFunction__upstream__2hop_69a26d", "repo": "sindresorhus/got", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["getRequestFunction", "#callFallbackRequest"], "hop_1_files": ["private/tmp/repos/got/source/core/options.ts", "private/tmp/repos/got/source/core/options.ts"], "hop_2": ["#resolveRequestWithFallback", "_makeRequest"], "hop_2_files": ["private/tmp/repos/got/source/core/options.ts", "private/tmp/repos/got/source/core/index.ts"]}, "metadata": {"anchor": "#getFallbackRequestFunction", "anchor_file": "private/tmp/repos/got/source/core/options.ts", "anchor_source": "#getFallbackRequestFunction() {\n\t\tconst url = this.#internals.url as (URL | undefined);\n\n\t\tif (!url) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (url.protocol === 'https:') {\n\t\t\tif (this.#internals.http2) {\n\t\t\t\tif (major < 15 || (major === 15 && minor < 10)) {\n\t\t\t\t\tconst error = new Error('To use the `http2` option, install Node.js 15.10.0 or above');\n\t\t\t\t\t(error as NodeJS.ErrnoException).code = 'EUNSUPPORTED';\n\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\n\t\t\t\treturn http2wrapper.auto as RequestFunction;\n\t\t\t}\n\n\t\t\treturn https.request;\n\t\t}\n\n\t\treturn http.request;\n\t}", "result_size": 2, "created_at": "2026-03-20T16:58:18.104721+00:00", "file_content": "import process from 'node:process';\nimport {promisify, inspect, type InspectOptions} from 'node:util';\nimport {checkServerIdentity, type SecureContextOptions, type DetailedPeerCertificate} from 'node:tls';\n// DO NOT use destructuring for `https.request` and `http.request` as it's not compatible with `nock`.\nimport https, {\n\ttype RequestOptions as HttpsRequestOptions,\n\ttype Agent as HttpsAgent,\n} from 'node:https';\nimport http, {\n\ttype Agent as HttpAgent,\n\ttype ClientRequest,\n} from 'node:http';\nimport type {Readable} from 'node:stream';\nimport type {Socket, LookupFunction} from 'node:net';\nimport is, {assert} from '@sindresorhus/is';\nimport lowercaseKeys from 'lowercase-keys';\nimport CacheableLookup from 'cacheable-lookup';\nimport http2wrapper, {type ClientHttp2Session} from 'http2-wrapper';\nimport type {KeyvStoreAdapter} from 'keyv';\nimport type KeyvType from 'keyv';\nimport type ResponseLike from 'responselike';\nimport type {RequestPromise} from '../as-promise/types.js';\nimport type {IncomingMessageWithTimings} from './utils/timer.js';\nimport parseLinkHeader from './parse-link-header.js';\nimport type {PlainResponse, Response} from './response.js';\nimport type {RequestError} from './errors.js';\nimport type {Delays} from './timed-out.js';\n\ntype StorageAdapter = KeyvStoreAdapter | KeyvType | Map;\n\ntype Promisable = T | Promise;\n\nconst [major, minor] = process.versions.node.split('.').map(Number) as [number, number, number];\n\nexport type DnsLookupIpVersion = undefined | 4 | 6;\n\ntype Except = Pick>;\n\nexport type NativeRequestOptions = HttpsRequestOptions & CacheOptions & {checkServerIdentity?: CheckServerIdentityFunction};\n\ntype AcceptableResponse = IncomingMessageWithTimings | ResponseLike;\ntype AcceptableRequestResult = Promisable;\nexport type RequestFunction = (url: URL, options: NativeRequestOptions, callback?: (response: AcceptableResponse) => void) => AcceptableRequestResult;\n\nexport type Agents = {\n\thttp?: HttpAgent | false;\n\thttps?: HttpsAgent | false;\n\thttp2?: unknown | false;\n};\n\nexport type Headers = Record;\n\nexport type ToughCookieJar = {\n\tgetCookieString: ((currentUrl: string, options: Record, callback: (error: Error | undefined, cookies: string) => void) => void)\n\t\t& ((url: string, callback: (error: Error | undefined, cookieHeader: string) => void) => void);\n\tsetCookie: ((cookieOrString: unknown, currentUrl: string, options: Record, callback: (error: Error | undefined, cookie: unknown) => void) => void)\n\t\t& ((rawCookie: string, url: string, callback: (error: Error | undefined, result: unknown) => void) => void);\n};\n\nexport type PromiseCookieJar = {\n\tgetCookieString: (url: string) => Promise;\n\tsetCookie: (rawCookie: string, url: string) => Promise;\n};\n\n/**\nUtility type to override specific properties in a type.\n\nUses `Omit` to remove properties before adding them back to ensure proper type replacement rather than intersection, which handles edge cases with optional/required properties correctly.\n*/\ntype OverrideProperties = Omit & U;\n\n/**\nRepresents the runtime state of Options as seen by hooks after normalization.\n\nSome Options properties accept multiple input types but are normalized to a single type internally by the Options class setters. This type reflects the actual runtime types that hooks receive, ensuring type safety when accessing options within hook functions.\n*/\nexport type NormalizedOptions = OverrideProperties;\n\nexport type InitHook = (init: OptionsInit, self: Options) => void;\n\nexport type BeforeRequestHookContext = {\n\t/**\n\tThe current retry count.\n\n\tIt will be `0` for the initial request and increment for each retry.\n\t*/\n\tretryCount: number;\n};\n\nexport type BeforeRequestHook = (options: NormalizedOptions, context: BeforeRequestHookContext) => Promisable;\nexport type BeforeRedirectHook = (updatedOptions: NormalizedOptions, plainResponse: PlainResponse) => Promisable;\nexport type BeforeErrorHook = (error: RequestError) => Promisable;\nexport type BeforeRetryHook = (error: RequestError, retryCount: number) => Promisable;\nexport type BeforeCacheHook = (response: PlainResponse) => false | void;\nexport type AfterResponseHook = (response: Response, retryWithMergedOptions: (options: OptionsInit) => never) => Promisable>;\n\n/**\nAll available hooks of Got.\n*/\nexport type Hooks = {\n\t/**\n\tCalled with the plain request options, right before their normalization.\n\n\tThe second argument represents the current `Options` instance.\n\n\t@default []\n\n\t**Note:**\n\t> - This hook must be synchronous.\n\n\t**Note:**\n\t> - This is called every time options are merged.\n\n\t**Note:**\n\t> - The `options` object may not have the `url` property. To modify it, use a `beforeRequest` hook instead.\n\n\t**Note:**\n\t> - This hook is called when a new instance of `Options` is created.\n\t> - Do not confuse this with the creation of `Request` or `got(\u2026)`.\n\n\t**Note:**\n\t> - When using `got(url)` or `got(url, undefined, defaults)` this hook will **not** be called.\n\n\tThis is especially useful in conjunction with `got.extend()` when the input needs custom handling.\n\n\tFor example, this can be used to fix typos to migrate from older versions faster.\n\n\t@example\n\t```\n\timport got from 'got';\n\n\tconst instance = got.extend({\n\t\thooks: {\n\t\t\tinit: [\n\t\t\t\tplain => {\n\t\t\t\t\tif ('followRedirects' in plain) {\n\t\t\t\t\t\tplain.followRedirect = plain.followRedirects;\n\t\t\t\t\t\tdelete plain.followRedirects;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t});\n\n\t// Normally, the following would throw:\n\tconst response = await instance(\n\t\t'https://example.com',\n\t\t{\n\t\t\tfollowRedirects: true\n\t\t}\n\t);\n\n\t// There is no option named `followRedirects`, but we correct it in an `init` hook.\n\t```\n\n\tOr you can create your own option and store it in a context:\n\n\t```\n\timport got from 'got';\n\n\tconst instance = got.extend({\n\t\thooks: {\n\t\t\tinit: [\n\t\t\t\t(plain, options) => {\n\t\t\t\t\tif ('secret' in plain) {\n\t\t\t\t\t\toptions.context.secret = plain.secret;\n\t\t\t\t\t\tdelete plain.secret;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t],\n\t\t\tbeforeRequest: [\n\t\t\t\toptions => {\n\t\t\t\t\toptions.headers.secret = options.context.secret;\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t});\n\n\tconst {headers} = await instance(\n\t\t'https://httpbin.org/anything',\n\t\t{\n\t\t\tsecret: 'passphrase'\n\t\t}\n\t).json();\n\n\tconsole.log(headers.Secret);\n\t//=> 'passphrase'\n\t```\n\t*/\n\tinit: InitHook[];\n\n\t/**\n\tCalled right before making the request with `options.createNativeRequestOptions()`.\n\n\tThe second argument is a context object containing request state information.\n\n\tThis hook is especially useful in conjunction with `got.extend()` when you want to sign your request.\n\n\t@default []\n\n\t**Note:**\n\t> - Got will make no further changes to the request before it is sent.\n\n\t**Note:**\n\t> - Changing `options.json` or `options.form` has no effect on the request. You should change `options.body` instead. If needed, update the `options.headers` accordingly.\n\n\t@example\n\t```\n\timport got from 'got';\n\n\tconst response = await got.post(\n\t\t'https://httpbin.org/anything',\n\t\t{\n\t\t\tjson: {payload: 'old'},\n\t\t\thooks: {\n\t\t\t\tbeforeRequest: [\n\t\t\t\t\t(options, context) => {\n\t\t\t\t\t\toptions.body = JSON.stringify({payload: 'new'});\n\t\t\n# \u2026 (truncated at 8000 chars)"}} {"sample_id": "paramiko__paramiko__put__downstream__2hop_9d37fe", "repo": "paramiko/paramiko", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["putfo"], "hop_1_files": ["private/tmp/repos/paramiko/paramiko/sftp_client.py"], "hop_2": ["_transfer_with_callback", "SFTPClient", "stat"], "hop_2_files": ["private/tmp/repos/paramiko/paramiko/sftp_client.py", "private/tmp/repos/paramiko/paramiko/sftp_client.py", "private/tmp/repos/paramiko/paramiko/sftp_client.py"]}, "metadata": {"anchor": "put", "anchor_file": "private/tmp/repos/paramiko/paramiko/sftp_client.py", "anchor_source": "def put(self, localpath, remotepath, callback=None, confirm=True):\n \"\"\"\n Copy a local file (``localpath``) to the SFTP server as ``remotepath``.\n Any exception raised by operations will be passed through. This\n method is primarily provided as a convenience.\n\n The SFTP operations use pipelining for speed.\n\n :param str localpath: the local file to copy\n :param str remotepath: the destination path on the SFTP server. Note\n that the filename should be included. Only specifying a directory\n may result in an error.\n :param callable callback:\n optional callback function (form: ``func(int, int)``) that accepts\n the bytes transferred so far and the total bytes to be transferred\n :param bool confirm:\n whether to do a stat() on the file afterwards to confirm the file\n size\n\n :return: an `.SFTPAttributes` object containing attributes about the\n given file\n\n .. versionadded:: 1.4\n .. versionchanged:: 1.7.4\n ``callback`` and rich attribute return value added.\n .. versionchanged:: 1.7.7\n ``confirm`` param added.\n \"\"\"\n file_size = os.stat(localpath).st_size\n with open(localpath, \"rb\") as fl:\n return self.putfo(fl, remotepath, file_size, callback, confirm)", "result_size": 3, "created_at": "2026-03-20T16:58:17.364834+00:00"}} {"sample_id": "locustio__locust___filter_tasks_by_tags__upstream__2hop_9c003f", "repo": "locustio/locust", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["start", "handle_message", "_start"], "hop_1_files": ["private/tmp/repos/locustio__locust/locust/runners.py", "private/tmp/repos/locustio__locust/locust/runners.py", "private/tmp/repos/locustio__locust/locust/runners.py"], "hop_2": ["heartbeat_worker", "start", "handle_message", "worker", "main"], "hop_2_files": ["private/tmp/repos/locustio__locust/locust/runners.py", "private/tmp/repos/locustio__locust/locust/runners.py", "private/tmp/repos/locustio__locust/locust/runners.py", "private/tmp/repos/locustio__locust/locust/runners.py", "private/tmp/repos/locustio__locust/locust/main.py"]}, "metadata": {"anchor": "_filter_tasks_by_tags", "anchor_file": "private/tmp/repos/locustio__locust/locust/env.py", "anchor_source": "def _filter_tasks_by_tags(self) -> None:\n \"\"\"\n Filter the tasks on all the user_classes recursively, according to the tags and\n exclude_tags attributes\n \"\"\"\n if getattr(self, \"_tasks_filtered\", False):\n return # only filter once\n self._tasks_filtered = True\n\n if self.tags is not None:\n tags = set(self.tags)\n elif self.parsed_options and getattr(self.parsed_options, \"tags\", False):\n tags = set(self.parsed_options.tags)\n else:\n tags = None\n\n if self.exclude_tags is not None:\n exclude_tags = set(self.exclude_tags)\n elif self.parsed_options and getattr(self.parsed_options, \"exclude_tags\", False):\n exclude_tags = set(self.parsed_options.exclude_tags)\n else:\n exclude_tags = None\n\n for user_class in self.user_classes:\n filter_tasks_by_tags(user_class, tags, exclude_tags)", "result_size": 5, "created_at": "2026-03-20T16:58:16.951273+00:00", "file_content": ""}} {"sample_id": "rq__rq__failure_callback__upstream__2hop_7d6962", "repo": "rq/rq", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["run_sync", "execute_failure_callback"], "hop_1_files": ["private/tmp/repos/rq__rq/rq/queue.py", "private/tmp/repos/rq__rq/rq/job.py"], "hop_2": ["cleanup", "_enqueue_sync_job", "perform_job"], "hop_2_files": ["private/tmp/repos/rq__rq/rq/registry.py", "private/tmp/repos/rq__rq/rq/queue.py", "private/tmp/repos/rq__rq/rq/worker/base.py"]}, "metadata": {"anchor": "failure_callback", "anchor_file": "private/tmp/repos/rq__rq/rq/job.py", "anchor_source": "@property\n def failure_callback(self) -> Optional[FailureCallbackType]:\n if self._failure_callback is UNEVALUATED:\n if self._failure_callback_name:\n self._failure_callback = import_attribute(self._failure_callback_name)\n else:\n return None\n\n return self._failure_callback # type: ignore[return-value]", "result_size": 3, "created_at": "2026-03-20T16:58:17.875204+00:00", "file_content": ""}} {"sample_id": "trpc__trpc__handleIncomingRequest__downstream__2hop_951fde", "repo": "trpc/trpc", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["constructor", "TRPCWebSocketClosedError", "reconnect"], "hop_1_files": ["private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/utils.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/utils.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/wsClient.ts"], "hop_2": ["sleep", "close", "open", "hasPendingRequests", "getPendingRequests", "WsClient", "send", "from"], "hop_2_files": ["private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/utils.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/wsConnection.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/wsConnection.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/requestManager.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/requestManager.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/wsClient.ts", "private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/wsClient.ts", "private/tmp/repos/trpc__trpc/packages/client/src/TRPCClientError.ts"]}, "metadata": {"anchor": "handleIncomingRequest", "anchor_file": "private/tmp/repos/trpc__trpc/packages/client/src/links/wsLink/wsClient/wsClient.ts", "anchor_source": "private handleIncomingRequest(message: TRPCClientIncomingRequest) {\n if (message.method === 'reconnect') {\n this.reconnect(\n new TRPCWebSocketClosedError({\n message: 'Server requested reconnect',\n }),\n );\n }\n }", "result_size": 8, "created_at": "2026-03-20T16:58:18.199328+00:00"}} {"sample_id": "pallets__click__get_current_context__upstream__2hop_2ef152", "repo": "pallets/click", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["new_func", "decorator", "pass_context", "make_pass_decorator", "pass_obj", "pass_meta_key", "resolve_color_default"], "hop_1_files": ["private/tmp/repos/pallets__click/src/click/decorators.py", "private/tmp/repos/pallets__click/src/click/decorators.py", "private/tmp/repos/pallets__click/src/click/decorators.py", "private/tmp/repos/pallets__click/src/click/decorators.py", "private/tmp/repos/pallets__click/src/click/decorators.py", "private/tmp/repos/pallets__click/src/click/decorators.py", "private/tmp/repos/pallets__click/src/click/globals.py"], "hop_2": ["echo_via_pager", "progressbar", "echo"], "hop_2_files": ["private/tmp/repos/pallets__click/src/click/termui.py", "private/tmp/repos/pallets__click/src/click/termui.py", "private/tmp/repos/pallets__click/src/click/utils.py"]}, "metadata": {"anchor": "get_current_context", "anchor_file": "private/tmp/repos/pallets__click/src/click/globals.py", "anchor_source": "def get_current_context(silent: bool = False) -> Context | None:\n \"\"\"Returns the current click context. This can be used as a way to\n access the current context object from anywhere. This is a more implicit\n alternative to the :func:`pass_context` decorator. This function is\n primarily useful for helpers such as :func:`echo` which might be\n interested in changing its behavior based on the current context.\n\n To push the current context, :meth:`Context.scope` can be used.\n\n .. versionadded:: 5.0\n\n :param silent: if set to `True` the return value is `None` if no context\n is available. The default behavior is to raise a\n :exc:`RuntimeError`.\n \"\"\"\n try:\n return t.cast(\"Context\", _local.stack[-1])\n except (AttributeError, IndexError) as e:\n if not silent:\n raise RuntimeError(\"There is no active click context.\") from e\n\n return None", "result_size": 3, "created_at": "2026-03-20T16:58:17.078639+00:00", "file_content": ""}} {"sample_id": "psf__requests__create_cookie__upstream__2hop_363361", "repo": "psf/requests", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["set", "cookiejar_from_dict"], "hop_1_files": ["private/tmp/repos/requests/src/requests/cookies.py", "private/tmp/repos/requests/src/requests/cookies.py"], "hop_2": ["__setitem__", "prepare_cookies", "merge_cookies", "prepare_request"], "hop_2_files": ["private/tmp/repos/requests/src/requests/cookies.py", "private/tmp/repos/requests/src/requests/models.py", "private/tmp/repos/requests/src/requests/cookies.py", "private/tmp/repos/requests/src/requests/sessions.py"]}, "metadata": {"anchor": "create_cookie", "anchor_file": "private/tmp/repos/requests/src/requests/cookies.py", "anchor_source": "def create_cookie(name, value, **kwargs):\n \"\"\"Make a cookie from underspecified parameters.\n\n By default, the pair of `name` and `value` will be set for the domain ''\n and sent on every request (this is sometimes called a \"supercookie\").\n \"\"\"\n result = {\n \"version\": 0,\n \"name\": name,\n \"value\": value,\n \"port\": None,\n \"domain\": \"\",\n \"path\": \"/\",\n \"secure\": False,\n \"expires\": None,\n \"discard\": True,\n \"comment\": None,\n \"comment_url\": None,\n \"rest\": {\"HttpOnly\": None},\n \"rfc2109\": False,\n }\n\n badargs = set(kwargs) - set(result)\n if badargs:\n raise TypeError(\n f\"create_cookie() got unexpected keyword arguments: {list(badargs)}\"\n )\n\n result.update(kwargs)\n result[\"port_specified\"] = bool(result[\"port\"])\n result[\"domain_specified\"] = bool(result[\"domain\"])\n result[\"domain_initial_dot\"] = result[\"domain\"].startswith(\".\")\n result[\"path_specified\"] = bool(result[\"path\"])\n\n return cookielib.Cookie(**result)", "result_size": 4, "created_at": "2026-03-20T16:58:17.570287+00:00", "file_content": "\"\"\"\nrequests.cookies\n~~~~~~~~~~~~~~~~\n\nCompatibility code to be able to use `http.cookiejar.CookieJar` with requests.\n\nrequests.utils imports from here, so be careful with imports.\n\"\"\"\n\nimport calendar\nimport copy\nimport time\n\nfrom ._internal_utils import to_native_string\nfrom .compat import Morsel, MutableMapping, cookielib, urlparse, urlunparse\n\ntry:\n import threading\nexcept ImportError:\n import dummy_threading as threading\n\n\nclass MockRequest:\n \"\"\"Wraps a `requests.Request` to mimic a `urllib2.Request`.\n\n The code in `http.cookiejar.CookieJar` expects this interface in order to correctly\n manage cookie policies, i.e., determine whether a cookie can be set, given the\n domains of the request and the cookie.\n\n The original request object is read-only. The client is responsible for collecting\n the new headers via `get_new_headers()` and interpreting them appropriately. You\n probably want `get_cookie_header`, defined below.\n \"\"\"\n\n def __init__(self, request):\n self._r = request\n self._new_headers = {}\n self.type = urlparse(self._r.url).scheme\n\n def get_type(self):\n return self.type\n\n def get_host(self):\n return urlparse(self._r.url).netloc\n\n def get_origin_req_host(self):\n return self.get_host()\n\n def get_full_url(self):\n # Only return the response's URL if the user hadn't set the Host\n # header\n if not self._r.headers.get(\"Host\"):\n return self._r.url\n # If they did set it, retrieve it and reconstruct the expected domain\n host = to_native_string(self._r.headers[\"Host\"], encoding=\"utf-8\")\n parsed = urlparse(self._r.url)\n # Reconstruct the URL as we expect it\n return urlunparse(\n [\n parsed.scheme,\n host,\n parsed.path,\n parsed.params,\n parsed.query,\n parsed.fragment,\n ]\n )\n\n def is_unverifiable(self):\n return True\n\n def has_header(self, name):\n return name in self._r.headers or name in self._new_headers\n\n def get_header(self, name, default=None):\n return self._r.headers.get(name, self._new_headers.get(name, default))\n\n def add_header(self, key, val):\n \"\"\"cookiejar has no legitimate use for this method; add it back if you find one.\"\"\"\n raise NotImplementedError(\n \"Cookie headers should be added with add_unredirected_header()\"\n )\n\n def add_unredirected_header(self, name, value):\n self._new_headers[name] = value\n\n def get_new_headers(self):\n return self._new_headers\n\n @property\n def unverifiable(self):\n return self.is_unverifiable()\n\n @property\n def origin_req_host(self):\n return self.get_origin_req_host()\n\n @property\n def host(self):\n return self.get_host()\n\n\nclass MockResponse:\n \"\"\"Wraps a `httplib.HTTPMessage` to mimic a `urllib.addinfourl`.\n\n ...what? Basically, expose the parsed HTTP headers from the server response\n the way `http.cookiejar` expects to see them.\n \"\"\"\n\n def __init__(self, headers):\n \"\"\"Make a MockResponse for `cookiejar` to read.\n\n :param headers: a httplib.HTTPMessage or analogous carrying the headers\n \"\"\"\n self._headers = headers\n\n def info(self):\n return self._headers\n\n def getheaders(self, name):\n self._headers.getheaders(name)\n\n\ndef extract_cookies_to_jar(jar, request, response):\n \"\"\"Extract the cookies from the response into a CookieJar.\n\n :param jar: http.cookiejar.CookieJar (not necessarily a RequestsCookieJar)\n :param request: our own requests.Request object\n :param response: urllib3.HTTPResponse object\n \"\"\"\n if not (hasattr(response, \"_original_response\") and response._original_response):\n return\n # the _original_response field is the wrapped httplib.HTTPResponse object,\n req = MockRequest(request)\n # pull out the HTTPMessage with the headers and put it in the mock:\n res = MockResponse(response._original_response.msg)\n jar.extract_cookies(res, req)\n\n\ndef get_cookie_header(jar, request):\n \"\"\"\n Produce an appropriate Cookie header string to be sent with `request`, or None.\n\n :rtype: str\n \"\"\"\n r = MockRequest(request)\n jar.add_cookie_header(r)\n return r.get_new_headers().get(\"Cookie\")\n\n\ndef remove_cookie_by_name(cookiejar, name, domain=None, path=None):\n \"\"\"Unsets a cookie by name, by default over all domains and paths.\n\n Wraps CookieJar.clear(), is O(n).\n \"\"\"\n clearables = []\n for cookie in cookiejar:\n if cookie.name != name:\n continue\n if domain is not None and domain != cookie.domain:\n continue\n if path is not None and path != cookie.path:\n continue\n clearables.append((cookie.domain, cookie.path, cookie.name))\n\n for domain, path, name in clearables:\n cookiejar.clear(domain, path, name)\n\n\nclass CookieConflictError(RuntimeError):\n \"\"\"There are two cookies that meet the criteria specified in the cookie jar.\n Use .get and .set and include domain and path args in order to be more specific.\n \"\"\"\n\n\nclass RequestsCookieJar(cookielib.CookieJar, MutableMapping):\n \"\"\"Compatibility class; is a http.cookiejar.CookieJar, but exposes a dict\n interface.\n\n This is the CookieJar we create by default for requests and sessions that\n don't specify one, since some clients may expect response.cookies and\n session.cookies to support dict operations.\n\n Requests does not use the dict interface internally; it's just for\n compatibility with external client code. All requests code should work\n out of the box with externally provided instances of ``CookieJar``, e.g.\n ``LWPCookieJar`` and ``FileCookieJar``.\n\n Unlike a regular CookieJar, this class is pickleable.\n\n .. warning:: dictionary operations that are normally O(1) may be O(n).\n \"\"\"\n\n def get(self, name, default=None, domain=None, path=None):\n \"\"\"Dict-like get() that also supports optional domain and path args in\n order to resolve naming collisions from using one cookie jar over\n multiple domains.\n\n .. warning:: operation is O(n), not O(1).\n \"\"\"\n try:\n return self._find_no_duplicates(name, domain, path)\n except KeyError:\n return default\n\n def set(self, name, value, **kwargs):\n \"\"\"Dict-like set() that also supports optional domain and path args in\n order to resolve naming collisions from using one cookie jar over\n multiple domains.\n \"\"\"\n # support client code that unsets cookies by assignment of a None value:\n if value is None:\n remove_cookie_by_name(\n self, name, domain=kwargs.get(\"domain\"), path=kwargs.get(\"path\")\n )\n return\n\n if isinstance(value, Morsel):\n c = morsel_to_cookie(value)\n else:\n c = create_cookie(name, value, **kwargs)\n self.set_cookie(c)\n return c\n\n def iterkeys(self):\n \"\"\"Dict-like iterkeys() that returns an iterator of names of cookies\n from the jar.\n\n .. seealso:: itervalues() and iteritems().\n \"\"\"\n for cookie in iter(self):\n yield cookie.name\n\n def keys(self):\n \"\"\"Dict-like keys() that returns a list of names of cookies from the\n jar.\n\n .. seealso:: values() and items().\n \"\"\"\n return list(self.iterkeys())\n\n def itervalues(self):\n \"\"\"Dict-like itervalues() that returns an iterator of values of cookies\n from the jar.\n\n .. seealso:: iterkeys() and iteritems().\n \"\"\"\n for cookie in iter(self):\n yield cookie.value\n\n def values(self):\n \"\"\"Dict-like values() that returns a list of values of cookies from the\n jar.\n\n .. seealso:: keys() and items().\n \"\"\"\n return list(\n# \u2026 (truncated at 8000 chars)"}} {"sample_id": "colinhacks__zod___parse__downstream__2hop_caa5ea", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["isValidCidr", "isValidJWT", "addIssueToContext", "timeRegex", "ParseStatus", "_getOrReturnCtx", "_getType", "isValidIP", "assertNever", "datetimeRegex", "dirty"], "hop_1_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/helpers/parseUtil.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/helpers/parseUtil.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/helpers/util.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/helpers/parseUtil.ts"], "hop_2": ["timeRegexSource", "getErrorMap"], "hop_2_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/errors.ts"]}, "metadata": {"anchor": "_parse", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "anchor_source": "_parse(input: ParseInput): ParseReturnType {\n if (this._def.coerce) {\n input.data = String(input.data);\n }\n const parsedType = this._getType(input);\n\n if (parsedType !== ZodParsedType.string) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.string,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n\n const status = new ParseStatus();\n let ctx: undefined | ParseContext = undefined;\n\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n if (input.data.length < check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: check.value,\n type: \"string\",\n inclusive: true,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n } else if (check.kind === \"max\") {\n if (input.data.length > check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: check.value,\n type: \"string\",\n inclusive: true,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n } else if (check.kind === \"length\") {\n const tooBig = input.data.length > check.value;\n const tooSmall = input.data.length < check.value;\n if (tooBig || tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n if (tooBig) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: check.value,\n type: \"string\",\n inclusive: true,\n exact: true,\n message: check.message,\n });\n } else if (tooSmall) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: check.value,\n type: \"string\",\n inclusive: true,\n exact: true,\n message: check.message,\n });\n }\n status.dirty();\n }\n } else if (check.kind === \"email\") {\n if (!emailRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"email\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n } else if (check.kind === \"emoji\") {\n if (!emojiRegex) {\n emojiRegex = new RegExp(_emojiRegex, \"u\");\n }\n if (!emojiRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"emoji\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n } else if (check.kind === \"uuid\") {\n if (!uuidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"uuid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n } else if (check.kind === \"nanoid\") {\n if (!nanoidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"nanoid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n } else if (check.kind === \"cuid\") {\n if (!cuidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"cuid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n } else if (check.kind === \"cuid2\") {\n if (!cuid2Regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"cuid2\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n } else if (check.kind === \"ulid\") {\n if (!ulidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"ulid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n } else if (check.kind === \"url\") {\n try {\n // @ts-ignore\n new URL(input.data);\n } catch {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"url\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n } else if (check.kind === \"regex\") {\n check.regex.lastIndex = 0;\n const testResult = check.regex.test(input.data);\n if (!testResult) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"regex\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n } else if (check.kind === \"trim\") {\n input.data = input.data.trim();\n } else if (check.kind === \"includes\") {\n if (!(input.data as string).includes(check.value, check.position)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: { includes: check.value, position: check.position },\n message: check.message,\n });\n status.dirty();\n }\n } else if (check.kind === \"toLowerCase\") {\n input.data = input.data.toLowerCase();\n } else if (check.kind === \"toUpperCase\") {\n input.data = input.data.toUpperCase();\n } else if (check.kind === \"startsWith\") {\n if (!(input.data as string).startsWith(check.value)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: { startsWith: check.value },\n message: check.message,\n });\n status.dirty();\n }\n } else if (check.kind === \"endsWith\") {\n if (!(input.data as string).endsWith(check.value)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: { endsWith: check.value },\n message: check.message,\n });\n status.dirty();\n }\n } else if (check.kind === \"datetime\") {\n const regex = datetimeRegex(check);\n\n if (!regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: \"datetime\",\n message: check.message,\n });\n status.dirty();\n }\n } else if (check.kind === \"date\") {\n const regex = dateRegex;\n\n if (!regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: \"date\",\n message: check.message,\n });\n status.dirty();\n }\n } else if (check.kind === \"time\") {\n const regex = timeRegex(check);\n\n if (!regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: \"time\",\n message: check.message,\n });\n status.dirty();\n }\n } else if (check.kind === \"duration\") {\n if (!durationRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"duration\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n } else if (check.kind === \"ip\") {\n if (!isValidIP(input.data, check.version)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"ip\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n } else if (check.kind === \"jwt\") {\n if (!isValidJWT(input.data, check.alg)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"jwt\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n } else if (check.kind === \"cidr\") {\n if (!isValidCidr(input.data, check.version)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"cidr\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n } else if (check.kind === \"base64\") {\n if (!base64Regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"base64\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n } else if (check.kind === \"base64url\") {\n if (!base64urlRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"base64url\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n } else {\n util.assertNever(check);\n }\n }\n\n return { status: status.value, value: input.data };\n }", "result_size": 2, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "trpc__trpc__internal_exceptionHandler__downstream__2hop_6dd472", "repo": "trpc/trpc", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["getErrorShape", "transformTRPCResponse", "getTRPCErrorFromUnknown"], "hop_1_files": ["private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/error/getErrorShape.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/transformer.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/error/TRPCError.ts"], "hop_2": ["transformTRPCResponseItem", "getHTTPStatusCodeFromError", "TRPCError", "constructor"], "hop_2_files": ["private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/transformer.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/error/TRPCError.ts", "private/tmp/repos/trpc__trpc/packages/server/src/unstable-core-do-not-import/error/TRPCError.ts"]}, "metadata": {"anchor": "internal_exceptionHandler", "anchor_file": "private/tmp/repos/trpc__trpc/packages/server/src/adapters/node-http/nodeHTTPRequestHandler.ts", "anchor_source": "export function internal_exceptionHandler<\n TRouter extends AnyRouter,\n TRequest extends NodeHTTPRequest,\n TResponse extends NodeHTTPResponse,\n>(opts: NodeHTTPRequestHandlerOptions) {\n return (cause: unknown) => {\n const { res, req } = opts;\n const error = getTRPCErrorFromUnknown(cause);\n\n const shape = getErrorShape({\n config: opts.router._def._config,\n error,\n type: 'unknown',\n path: undefined,\n input: undefined,\n ctx: undefined,\n });\n\n opts.onError?.({\n req,\n error,\n type: 'unknown',\n path: undefined,\n input: undefined,\n ctx: undefined,\n });\n\n const transformed = transformTRPCResponse(opts.router._def._config, {\n error: shape,\n });\n\n res.statusCode = shape.data.httpStatus;\n res.end(JSON.stringify(transformed));\n };\n}", "result_size": 4, "created_at": "2026-03-20T16:58:18.199328+00:00"}} {"sample_id": "rq__rq__remove__upstream__1hop_a93f5a", "repo": "rq/rq", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["_remove_from_registries", "fetch_job"], "call_files": ["private/tmp/repos/rq__rq/rq/job.py", "private/tmp/repos/rq__rq/rq/queue.py"]}, "metadata": {"anchor": "remove", "anchor_file": "private/tmp/repos/rq__rq/rq/queue.py", "anchor_source": "def remove(self, job_or_id: Union['Job', str], pipeline: Optional['Pipeline'] = None):\n \"\"\"Removes Job from queue, accepts either a Job instance or ID.\n\n Args:\n job_or_id (Union[Job, str]): The Job instance or Job ID string.\n pipeline (Optional[Pipeline], optional): The Redis Pipeline. Defaults to None.\n\n Returns:\n _type_: _description_\n \"\"\"\n job_id = cast(str, job_or_id.id if isinstance(job_or_id, self.job_class) else job_or_id)\n\n if pipeline is not None:\n return pipeline.lrem(self.key, 1, job_id)\n\n return self.connection.lrem(self.key, 1, job_id)", "result_size": 2, "created_at": "2026-03-20T16:58:17.875204+00:00", "file_content": ""}} {"sample_id": "locustio__locust__measure__downstream__1hop_fcfdb5", "repo": "locustio/locust", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["fire"], "call_files": ["private/tmp/repos/locustio__locust/locust/event.py"]}, "metadata": {"anchor": "measure", "anchor_file": "private/tmp/repos/locustio__locust/locust/event.py", "anchor_source": "@contextmanager\n def measure(\n self, request_type: str, name: str, response_length: int = 0, context=None\n ) -> Generator[dict[str, Any]]:\n \"\"\"Convenience method for firing the event with automatically calculated response time and automatically marking the request as failed if an exception is raised (this is really only useful for the *request* event)\n\n Example usage (in a task):\n\n .. code-block:: python\n\n with self.environment.events.request.measure(\"requestType\", \"requestName\") as request_meta:\n # do the stuff you want to measure\n\n You can optionally add/overwrite entries in the request_meta dict and they will be passed to the request event.\n\n Experimental.\n \"\"\"\n start_time = time.time()\n start_perf_counter = time.perf_counter()\n request_meta = {\n \"request_type\": request_type,\n \"name\": name,\n \"response_length\": response_length,\n \"context\": context or {},\n \"exception\": None,\n \"start_time\": start_time,\n }\n try:\n yield request_meta\n except Exception as e:\n request_meta[\"exception\"] = e\n finally:\n request_meta[\"response_time\"] = (time.perf_counter() - start_perf_counter) * 1000\n self.fire(**request_meta)", "result_size": 1, "created_at": "2026-03-20T16:58:16.951273+00:00"}} {"sample_id": "sindresorhus__got__shouldCopyPipedHeader__upstream__2hop_32b798", "repo": "sindresorhus/got", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["constructor"], "hop_1_files": ["private/tmp/repos/got/source/core/index.ts"], "hop_2": ["fn", "_beforeError", "asPromise"], "hop_2_files": ["private/tmp/repos/got/benchmark/index.ts", "private/tmp/repos/got/source/core/index.ts", "private/tmp/repos/got/source/as-promise/index.ts"]}, "metadata": {"anchor": "shouldCopyPipedHeader", "anchor_file": "private/tmp/repos/got/source/core/options.ts", "anchor_source": "shouldCopyPipedHeader(name: string): boolean {\n\t\tconst normalizedHeader = name.toLowerCase();\n\n\t\tif (this.isHeaderExplicitlySet(normalizedHeader)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "result_size": 6, "created_at": "2026-03-20T16:58:18.104721+00:00", "file_content": "import process from 'node:process';\nimport {promisify, inspect, type InspectOptions} from 'node:util';\nimport {checkServerIdentity, type SecureContextOptions, type DetailedPeerCertificate} from 'node:tls';\n// DO NOT use destructuring for `https.request` and `http.request` as it's not compatible with `nock`.\nimport https, {\n\ttype RequestOptions as HttpsRequestOptions,\n\ttype Agent as HttpsAgent,\n} from 'node:https';\nimport http, {\n\ttype Agent as HttpAgent,\n\ttype ClientRequest,\n} from 'node:http';\nimport type {Readable} from 'node:stream';\nimport type {Socket, LookupFunction} from 'node:net';\nimport is, {assert} from '@sindresorhus/is';\nimport lowercaseKeys from 'lowercase-keys';\nimport CacheableLookup from 'cacheable-lookup';\nimport http2wrapper, {type ClientHttp2Session} from 'http2-wrapper';\nimport type {KeyvStoreAdapter} from 'keyv';\nimport type KeyvType from 'keyv';\nimport type ResponseLike from 'responselike';\nimport type {RequestPromise} from '../as-promise/types.js';\nimport type {IncomingMessageWithTimings} from './utils/timer.js';\nimport parseLinkHeader from './parse-link-header.js';\nimport type {PlainResponse, Response} from './response.js';\nimport type {RequestError} from './errors.js';\nimport type {Delays} from './timed-out.js';\n\ntype StorageAdapter = KeyvStoreAdapter | KeyvType | Map;\n\ntype Promisable = T | Promise;\n\nconst [major, minor] = process.versions.node.split('.').map(Number) as [number, number, number];\n\nexport type DnsLookupIpVersion = undefined | 4 | 6;\n\ntype Except = Pick>;\n\nexport type NativeRequestOptions = HttpsRequestOptions & CacheOptions & {checkServerIdentity?: CheckServerIdentityFunction};\n\ntype AcceptableResponse = IncomingMessageWithTimings | ResponseLike;\ntype AcceptableRequestResult = Promisable;\nexport type RequestFunction = (url: URL, options: NativeRequestOptions, callback?: (response: AcceptableResponse) => void) => AcceptableRequestResult;\n\nexport type Agents = {\n\thttp?: HttpAgent | false;\n\thttps?: HttpsAgent | false;\n\thttp2?: unknown | false;\n};\n\nexport type Headers = Record;\n\nexport type ToughCookieJar = {\n\tgetCookieString: ((currentUrl: string, options: Record, callback: (error: Error | undefined, cookies: string) => void) => void)\n\t\t& ((url: string, callback: (error: Error | undefined, cookieHeader: string) => void) => void);\n\tsetCookie: ((cookieOrString: unknown, currentUrl: string, options: Record, callback: (error: Error | undefined, cookie: unknown) => void) => void)\n\t\t& ((rawCookie: string, url: string, callback: (error: Error | undefined, result: unknown) => void) => void);\n};\n\nexport type PromiseCookieJar = {\n\tgetCookieString: (url: string) => Promise;\n\tsetCookie: (rawCookie: string, url: string) => Promise;\n};\n\n/**\nUtility type to override specific properties in a type.\n\nUses `Omit` to remove properties before adding them back to ensure proper type replacement rather than intersection, which handles edge cases with optional/required properties correctly.\n*/\ntype OverrideProperties = Omit & U;\n\n/**\nRepresents the runtime state of Options as seen by hooks after normalization.\n\nSome Options properties accept multiple input types but are normalized to a single type internally by the Options class setters. This type reflects the actual runtime types that hooks receive, ensuring type safety when accessing options within hook functions.\n*/\nexport type NormalizedOptions = OverrideProperties;\n\nexport type InitHook = (init: OptionsInit, self: Options) => void;\n\nexport type BeforeRequestHookContext = {\n\t/**\n\tThe current retry count.\n\n\tIt will be `0` for the initial request and increment for each retry.\n\t*/\n\tretryCount: number;\n};\n\nexport type BeforeRequestHook = (options: NormalizedOptions, context: BeforeRequestHookContext) => Promisable;\nexport type BeforeRedirectHook = (updatedOptions: NormalizedOptions, plainResponse: PlainResponse) => Promisable;\nexport type BeforeErrorHook = (error: RequestError) => Promisable;\nexport type BeforeRetryHook = (error: RequestError, retryCount: number) => Promisable;\nexport type BeforeCacheHook = (response: PlainResponse) => false | void;\nexport type AfterResponseHook = (response: Response, retryWithMergedOptions: (options: OptionsInit) => never) => Promisable>;\n\n/**\nAll available hooks of Got.\n*/\nexport type Hooks = {\n\t/**\n\tCalled with the plain request options, right before their normalization.\n\n\tThe second argument represents the current `Options` instance.\n\n\t@default []\n\n\t**Note:**\n\t> - This hook must be synchronous.\n\n\t**Note:**\n\t> - This is called every time options are merged.\n\n\t**Note:**\n\t> - The `options` object may not have the `url` property. To modify it, use a `beforeRequest` hook instead.\n\n\t**Note:**\n\t> - This hook is called when a new instance of `Options` is created.\n\t> - Do not confuse this with the creation of `Request` or `got(\u2026)`.\n\n\t**Note:**\n\t> - When using `got(url)` or `got(url, undefined, defaults)` this hook will **not** be called.\n\n\tThis is especially useful in conjunction with `got.extend()` when the input needs custom handling.\n\n\tFor example, this can be used to fix typos to migrate from older versions faster.\n\n\t@example\n\t```\n\timport got from 'got';\n\n\tconst instance = got.extend({\n\t\thooks: {\n\t\t\tinit: [\n\t\t\t\tplain => {\n\t\t\t\t\tif ('followRedirects' in plain) {\n\t\t\t\t\t\tplain.followRedirect = plain.followRedirects;\n\t\t\t\t\t\tdelete plain.followRedirects;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t});\n\n\t// Normally, the following would throw:\n\tconst response = await instance(\n\t\t'https://example.com',\n\t\t{\n\t\t\tfollowRedirects: true\n\t\t}\n\t);\n\n\t// There is no option named `followRedirects`, but we correct it in an `init` hook.\n\t```\n\n\tOr you can create your own option and store it in a context:\n\n\t```\n\timport got from 'got';\n\n\tconst instance = got.extend({\n\t\thooks: {\n\t\t\tinit: [\n\t\t\t\t(plain, options) => {\n\t\t\t\t\tif ('secret' in plain) {\n\t\t\t\t\t\toptions.context.secret = plain.secret;\n\t\t\t\t\t\tdelete plain.secret;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t],\n\t\t\tbeforeRequest: [\n\t\t\t\toptions => {\n\t\t\t\t\toptions.headers.secret = options.context.secret;\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t});\n\n\tconst {headers} = await instance(\n\t\t'https://httpbin.org/anything',\n\t\t{\n\t\t\tsecret: 'passphrase'\n\t\t}\n\t).json();\n\n\tconsole.log(headers.Secret);\n\t//=> 'passphrase'\n\t```\n\t*/\n\tinit: InitHook[];\n\n\t/**\n\tCalled right before making the request with `options.createNativeRequestOptions()`.\n\n\tThe second argument is a context object containing request state information.\n\n\tThis hook is especially useful in conjunction with `got.extend()` when you want to sign your request.\n\n\t@default []\n\n\t**Note:**\n\t> - Got will make no further changes to the request before it is sent.\n\n\t**Note:**\n\t> - Changing `options.json` or `options.form` has no effect on the request. You should change `options.body` instead. If needed, update the `options.headers` accordingly.\n\n\t@example\n\t```\n\timport got from 'got';\n\n\tconst response = await got.post(\n\t\t'https://httpbin.org/anything',\n\t\t{\n\t\t\tjson: {payload: 'old'},\n\t\t\thooks: {\n\t\t\t\tbeforeRequest: [\n\t\t\t\t\t(options, context) => {\n\t\t\t\t\t\toptions.body = JSON.stringify({payload: 'new'});\n\t\t\n# \u2026 (truncated at 8000 chars)"}} {"sample_id": "rq__rq__add_execution__downstream__2hop_f7c8cd", "repo": "rq/rq", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["current_timestamp"], "hop_1_files": ["private/tmp/repos/rq__rq/rq/utils.py"], "hop_2": ["now"], "hop_2_files": ["private/tmp/repos/rq__rq/rq/utils.py"]}, "metadata": {"anchor": "add_execution", "anchor_file": "private/tmp/repos/rq__rq/rq/registry.py", "anchor_source": "def add_execution(self, execution: 'Execution', pipeline: 'Pipeline', ttl: int = 0, xx: bool = False) -> int:\n \"\"\"Adds an execution to a registry with expiry time of now + ttl, unless it's -1 which is set to +inf\n\n Args:\n execution (Execution): The Execution to add.\n pipeline (Pipeline): The Redis Pipeline.\n ttl (int, optional): The time to live. Defaults to 0.\n xx (bool, optional): .... Defaults to False.\n\n Returns:\n result (int): The ZADD command result\n \"\"\"\n score: Union[int, str] = ttl if ttl < 0 else current_timestamp() + ttl\n if score == -1:\n score = '+inf'\n\n return pipeline.zadd(self.key, {execution.composite_key: score}, xx=xx) # type: ignore", "result_size": 1, "created_at": "2026-03-20T16:58:17.875204+00:00"}} {"sample_id": "pallets__flask__add_template_filter__upstream__1hop_e48e4f", "repo": "pallets/flask", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["register_template_filter", "decorator", "template_filter", "add_app_template_filter"], "call_files": ["private/tmp/repos/flask/src/flask/sansio/blueprints.py", "private/tmp/repos/flask/src/flask/sansio/app.py", "private/tmp/repos/flask/src/flask/sansio/app.py", "private/tmp/repos/flask/src/flask/sansio/blueprints.py"]}, "metadata": {"anchor": "add_template_filter", "anchor_file": "private/tmp/repos/flask/src/flask/sansio/app.py", "anchor_source": "@setupmethod\n def add_template_filter(\n self, f: ft.TemplateFilterCallable, name: str | None = None\n ) -> None:\n \"\"\"Register a function to use as a custom Jinja filter.\n\n The :meth:`template_filter` decorator can be used to register a function\n by decorating instead.\n\n :param f: The function to register.\n :param name: The name to register the filter as. If not given, uses the\n function's name.\n \"\"\"\n self.jinja_env.filters[name or f.__name__] = f", "result_size": 4, "created_at": "2026-03-20T16:58:17.167063+00:00", "file_content": "from __future__ import annotations\n\nimport logging\nimport os\nimport sys\nimport typing as t\nfrom datetime import timedelta\nfrom itertools import chain\n\nfrom werkzeug.exceptions import Aborter\nfrom werkzeug.exceptions import BadRequest\nfrom werkzeug.exceptions import BadRequestKeyError\nfrom werkzeug.routing import BuildError\nfrom werkzeug.routing import Map\nfrom werkzeug.routing import Rule\nfrom werkzeug.sansio.response import Response\nfrom werkzeug.utils import cached_property\nfrom werkzeug.utils import redirect as _wz_redirect\n\nfrom .. import typing as ft\nfrom ..config import Config\nfrom ..config import ConfigAttribute\nfrom ..ctx import _AppCtxGlobals\nfrom ..helpers import _split_blueprint_path\nfrom ..helpers import get_debug_flag\nfrom ..json.provider import DefaultJSONProvider\nfrom ..json.provider import JSONProvider\nfrom ..logging import create_logger\nfrom ..templating import DispatchingJinjaLoader\nfrom ..templating import Environment\nfrom .scaffold import _endpoint_from_view_func\nfrom .scaffold import find_package\nfrom .scaffold import Scaffold\nfrom .scaffold import setupmethod\n\nif t.TYPE_CHECKING: # pragma: no cover\n from werkzeug.wrappers import Response as BaseResponse\n\n from ..testing import FlaskClient\n from ..testing import FlaskCliRunner\n from .blueprints import Blueprint\n\nT_shell_context_processor = t.TypeVar(\n \"T_shell_context_processor\", bound=ft.ShellContextProcessorCallable\n)\nT_teardown = t.TypeVar(\"T_teardown\", bound=ft.TeardownCallable)\nT_template_filter = t.TypeVar(\"T_template_filter\", bound=ft.TemplateFilterCallable)\nT_template_global = t.TypeVar(\"T_template_global\", bound=ft.TemplateGlobalCallable)\nT_template_test = t.TypeVar(\"T_template_test\", bound=ft.TemplateTestCallable)\n\n\ndef _make_timedelta(value: timedelta | int | None) -> timedelta | None:\n if value is None or isinstance(value, timedelta):\n return value\n\n return timedelta(seconds=value)\n\n\nclass App(Scaffold):\n \"\"\"The flask object implements a WSGI application and acts as the central\n object. It is passed the name of the module or package of the\n application. Once it is created it will act as a central registry for\n the view functions, the URL rules, template configuration and much more.\n\n The name of the package is used to resolve resources from inside the\n package or the folder the module is contained in depending on if the\n package parameter resolves to an actual python package (a folder with\n an :file:`__init__.py` file inside) or a standard module (just a ``.py`` file).\n\n For more information about resource loading, see :func:`open_resource`.\n\n Usually you create a :class:`Flask` instance in your main module or\n in the :file:`__init__.py` file of your package like this::\n\n from flask import Flask\n app = Flask(__name__)\n\n .. admonition:: About the First Parameter\n\n The idea of the first parameter is to give Flask an idea of what\n belongs to your application. This name is used to find resources\n on the filesystem, can be used by extensions to improve debugging\n information and a lot more.\n\n So it's important what you provide there. If you are using a single\n module, `__name__` is always the correct value. If you however are\n using a package, it's usually recommended to hardcode the name of\n your package there.\n\n For example if your application is defined in :file:`yourapplication/app.py`\n you should create it with one of the two versions below::\n\n app = Flask('yourapplication')\n app = Flask(__name__.split('.')[0])\n\n Why is that? The application will work even with `__name__`, thanks\n to how resources are looked up. However it will make debugging more\n painful. Certain extensions can make assumptions based on the\n import name of your application. For example the Flask-SQLAlchemy\n extension will look for the code in your application that triggered\n an SQL query in debug mode. If the import name is not properly set\n up, that debugging information is lost. (For example it would only\n pick up SQL queries in `yourapplication.app` and not\n `yourapplication.views.frontend`)\n\n .. versionadded:: 0.7\n The `static_url_path`, `static_folder`, and `template_folder`\n parameters were added.\n\n .. versionadded:: 0.8\n The `instance_path` and `instance_relative_config` parameters were\n added.\n\n .. versionadded:: 0.11\n The `root_path` parameter was added.\n\n .. versionadded:: 1.0\n The ``host_matching`` and ``static_host`` parameters were added.\n\n .. versionadded:: 1.0\n The ``subdomain_matching`` parameter was added. Subdomain\n matching needs to be enabled manually now. Setting\n :data:`SERVER_NAME` does not implicitly enable it.\n\n :param import_name: the name of the application package\n :param static_url_path: can be used to specify a different path for the\n static files on the web. Defaults to the name\n of the `static_folder` folder.\n :param static_folder: The folder with static files that is served at\n ``static_url_path``. Relative to the application ``root_path``\n or an absolute path. Defaults to ``'static'``.\n :param static_host: the host to use when adding the static route.\n Defaults to None. Required when using ``host_matching=True``\n with a ``static_folder`` configured.\n :param host_matching: set ``url_map.host_matching`` attribute.\n Defaults to False.\n :param subdomain_matching: consider the subdomain relative to\n :data:`SERVER_NAME` when matching routes. Defaults to False.\n :param template_folder: the folder that contains the templates that should\n be used by the application. Defaults to\n ``'templates'`` folder in the root path of the\n application.\n :param instance_path: An alternative instance path for the application.\n By default the folder ``'instance'`` next to the\n package or module is assumed to be the instance\n path.\n :param instance_relative_config: if set to ``True`` relative filenames\n for loading the config are assumed to\n be relative to the instance path instead\n of the application root.\n :param root_path: The path to the root of the application files.\n This should only be set manually when it can't be detected\n automatically, such as for namespace packages.\n \"\"\"\n\n #: The class of the object assigned to :attr:`aborter`, created by\n #: :meth:`create_aborter`. That object is called by\n #: :func:`flask.abort` to raise HTTP errors, and can be\n #: called directly as well.\n #:\n #: Defaults to :class:`werkzeug.exceptions.Aborter`.\n #:\n #: .. versionadded:: 2.2\n aborter_class = Aborter\n\n #: The class that is used for the Jinja environment.\n #:\n #: .. versionadded:: 0.11\n jinja_environment = Environment\n\n #: The class that is used for the :data:`~flask.g` instance.\n #:\n #: Example use cases for a custom class:\n #:\n #: 1. Store arbitrary attributes on flask.g.\n #: 2. Add a property for lazy per-request database connectors.\n #: 3. Return None instead of AttributeError on unexpected attributes.\n #: 4. Raise exception if an unexpected attr is set, a \"controlled\" flask.g.\n #:\n #: .. versionadded:: 0.10\n #: Renamed from ``request_globals_class`.\n app_ctx_globals_class = _AppCtxGlobals\n\n #: The class that is used for the ``config`` attribute of this app.\n #: Defaults to :class:`~flask.Config`.\n #:\n #: Example use cases for a custom class:\n #:\n #: 1. Default values for certain config\n# \u2026 (truncated at 8000 chars)"}} {"sample_id": "pallets__click___process_result__downstream__2hop_44c9d2", "repo": "pallets/click", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["invoke", "Context"], "hop_1_files": ["private/tmp/repos/pallets__click/src/click/core.py", "private/tmp/repos/pallets__click/src/click/core.py"], "hop_2": ["Parameter", "type_cast_value", "get_default", "_make_sub_context"], "hop_2_files": ["private/tmp/repos/pallets__click/src/click/core.py", "private/tmp/repos/pallets__click/src/click/core.py", "private/tmp/repos/pallets__click/src/click/core.py", "private/tmp/repos/pallets__click/src/click/core.py"]}, "metadata": {"anchor": "_process_result", "anchor_file": "private/tmp/repos/pallets__click/src/click/core.py", "anchor_source": "def _process_result(value: t.Any) -> t.Any:\n if self._result_callback is not None:\n value = ctx.invoke(self._result_callback, value, **ctx.params)\n return value", "result_size": 4, "created_at": "2026-03-20T16:58:17.078639+00:00"}} {"sample_id": "colinhacks__zod___array__upstream__2hop_d6ca14", "repo": "colinhacks/zod", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["array"], "hop_1_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/schemas.ts"], "hop_2": ["json", "_function", "convertBaseSchema", "array"], "hop_2_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/schemas.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/schemas.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/from-json-schema.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/classic/schemas.ts"]}, "metadata": {"anchor": "_array", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/api.ts", "anchor_source": "export function _array(\n Class: util.SchemaClass,\n element: T,\n params?: string | $ZodArrayParams\n): schemas.$ZodArray {\n return new Class({\n type: \"array\",\n element,\n // get element() {\n // return element;\n // },\n ...util.normalizeParams(params),\n }) as any;\n}", "result_size": 6, "created_at": "2026-03-20T16:58:16.474869+00:00", "file_content": ""}} {"sample_id": "rq__rq__check_workers__downstream__2hop_042820", "repo": "rq/rq", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["start_worker", "reap_workers"], "hop_1_files": ["private/tmp/repos/rq__rq/rq/worker_pool.py", "private/tmp/repos/rq__rq/rq/worker_pool.py"], "hop_2": ["WorkerData", "get_worker_process", "handle_dead_worker"], "hop_2_files": ["private/tmp/repos/rq__rq/rq/worker_pool.py", "private/tmp/repos/rq__rq/rq/worker_pool.py", "private/tmp/repos/rq__rq/rq/worker_pool.py"]}, "metadata": {"anchor": "check_workers", "anchor_file": "private/tmp/repos/rq__rq/rq/worker_pool.py", "anchor_source": "def check_workers(self, respawn: bool = True) -> None:\n \"\"\"\n Check whether workers are still alive\n \"\"\"\n self.log.debug('Checking worker processes')\n self.reap_workers()\n # If we have less number of workers than num_workers,\n # respawn the difference\n if respawn and self.status != self.Status.STOPPED:\n delta = self.num_workers - len(self.worker_dict)\n if delta:\n for i in range(delta):\n self.start_worker(burst=self._burst, _sleep=self._sleep)", "result_size": 3, "created_at": "2026-03-20T16:58:17.875204+00:00"}} {"sample_id": "locustio__locust__useInterval__upstream__2hop_989045", "repo": "locustio/locust", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["useFetchWorkerCount", "useFetchTasks", "useLogViewer", "useFetchExceptions", "useFetchStats"], "hop_1_files": ["private/tmp/repos/locustio__locust/locust/webui/src/hooks/useFetchWorkerCount.ts", "private/tmp/repos/locustio__locust/locust/webui/src/hooks/useFetchTasks.ts", "private/tmp/repos/locustio__locust/locust/webui/src/components/LogViewer/useLogViewer.ts", "private/tmp/repos/locustio__locust/locust/webui/src/hooks/useFetchExceptions.ts", "private/tmp/repos/locustio__locust/locust/webui/src/hooks/useFetchStats.ts"], "hop_2": ["SwarmRatiosTab", "Dashboard", "ExceptionsTab"], "hop_2_files": ["private/tmp/repos/locustio__locust/locust/webui/src/components/SwarmRatiosTab/SwarmRatiosTab.tsx", "private/tmp/repos/locustio__locust/locust/webui/src/pages/Dashboard.tsx", "private/tmp/repos/locustio__locust/locust/webui/src/components/ExceptionsTab/ExceptionsTab.tsx"]}, "metadata": {"anchor": "useInterval", "anchor_file": "private/tmp/repos/locustio__locust/locust/webui/src/hooks/useInterval.ts", "anchor_source": "export default function useInterval(\n callback: () => void,\n delay: number,\n { shouldRunInterval, immediate }: { shouldRunInterval?: boolean; immediate?: boolean } = {\n shouldRunInterval: true,\n immediate: false,\n },\n) {\n const savedCallback = useRef(callback);\n\n useEffect(() => {\n savedCallback.current = callback;\n }, [callback]);\n\n useEffect(() => {\n if (!shouldRunInterval) {\n return;\n }\n\n if (immediate) {\n savedCallback.current();\n }\n\n const interval = setInterval(() => savedCallback.current(), delay);\n\n return () => {\n clearInterval(interval);\n };\n }, [delay, shouldRunInterval]);\n}", "result_size": 8, "created_at": "2026-03-20T16:58:16.951273+00:00", "file_content": ""}} {"sample_id": "python-poetry__poetry___sort_key__downstream__1hop_12c7ad", "repo": "python-poetry/poetry", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["_is_link_hash_allowed_for_package"], "call_files": ["private/tmp/repos/python-poetry__poetry/src/poetry/installation/chooser.py"]}, "metadata": {"anchor": "_sort_key", "anchor_file": "private/tmp/repos/python-poetry__poetry/src/poetry/installation/chooser.py", "anchor_source": "def _sort_key(\n self, package: Package, link: Link\n ) -> tuple[int, int, int, Version, tuple[Any, ...], int]:\n \"\"\"\n Function to pass as the `key` argument to a call to sorted() to sort\n InstallationCandidates by preference.\n Returns a tuple such that tuples sorting as greater using Python's\n default comparison operator are more preferred.\n The preference is as follows:\n First and foremost, candidates with allowed (matching) hashes are\n always preferred over candidates without matching hashes. This is\n because e.g. if the only candidate with an allowed hash is yanked,\n we still want to use that candidate.\n Second, excepting hash considerations, candidates that have been\n yanked (in the sense of PEP 592) are always less preferred than\n candidates that haven't been yanked. Then:\n If not finding wheels, they are sorted by version only.\n If finding wheels, then the sort order is by version, then:\n 1. existing installs\n 2. wheels ordered via Wheel.support_index_min(self._supported_tags)\n 3. source archives\n If prefer_binary was set, then all wheels are sorted above sources.\n Note: it was considered to embed this logic into the Link\n comparison operators, but then different sdist links\n with the same version, would have to be considered equal\n \"\"\"\n build_tag: tuple[Any, ...] = ()\n binary_preference = 0\n if link.is_wheel:\n wheel = Wheel(link.filename)\n if not wheel.is_supported_by_environment(self._env):\n raise RuntimeError(\n f\"{wheel.filename} is not a supported wheel for this platform. It \"\n \"can't be sorted.\"\n )\n\n # TODO: Binary preference\n pri = -(wheel.get_minimum_supported_index(self._env.supported_tags) or 0)\n if wheel.build_tag is not None:\n match = re.match(r\"^(\\d+)(.*)$\", wheel.build_tag)\n if not match:\n raise ValueError(f\"Unable to parse build tag: {wheel.build_tag}\")\n build_tag_groups = match.groups()\n build_tag = (int(build_tag_groups[0]), build_tag_groups[1])\n else: # sdist\n support_num = len(self._env.supported_tags)\n pri = -support_num\n\n has_allowed_hash = int(self._is_link_hash_allowed_for_package(link, package))\n\n yank_value = int(not link.yanked)\n\n return (\n has_allowed_hash,\n yank_value,\n binary_preference,\n package.version,\n build_tag,\n pri,\n )", "result_size": 1, "created_at": "2026-03-20T16:58:17.758794+00:00"}} {"sample_id": "colinhacks__zod__\"~validate\"__downstream__1hop_1668ba", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["_parseSync", "_parseAsync"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"]}, "metadata": {"anchor": "\"~validate\"", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "anchor_source": "\"~validate\"(data: unknown): StandardSchemaV1.Result | Promise> {\n const ctx: ParseContext = {\n common: {\n issues: [],\n async: !!(this[\"~standard\"] as any).async,\n },\n path: [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: getParsedType(data),\n };\n\n if (!(this[\"~standard\"] as any).async) {\n try {\n const result = this._parseSync({ data, path: [], parent: ctx });\n return isValid(result)\n ? {\n value: result.value,\n }\n : {\n issues: ctx.common.issues,\n };\n } catch (err: any) {\n if ((err as Error)?.message?.toLowerCase()?.includes(\"encountered\")) {\n (this[\"~standard\"] as any).async = true;\n }\n (ctx as any).common = {\n issues: [],\n async: true,\n };\n }\n }\n\n return this._parseAsync({ data, path: [], parent: ctx }).then((result) =>\n isValid(result)\n ? {\n value: result.value,\n }\n : {\n issues: ctx.common.issues,\n }\n );\n }", "result_size": 2, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "colinhacks__zod__toJSONSchema__downstream__1hop_0eefd6", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["finalize", "process", "initializeContext", "extractDefs"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/to-json-schema.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/to-json-schema.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/to-json-schema.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/to-json-schema.ts"]}, "metadata": {"anchor": "toJSONSchema", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v4/core/json-schema-processors.ts", "anchor_source": "export function toJSONSchema(\n input: schemas.$ZodType | $ZodRegistry<{ id?: string | undefined }>,\n params?: ToJSONSchemaParams | RegistryToJSONSchemaParams\n): any {\n if (\"_idmap\" in input) {\n // Registry case\n const registry = input as $ZodRegistry<{ id?: string | undefined }>;\n const ctx = initializeContext({ ...params, processors: allProcessors });\n const defs: any = {};\n\n // First pass: process all schemas to build the seen map\n for (const entry of registry._idmap.entries()) {\n const [_, schema] = entry;\n process(schema, ctx as any);\n }\n\n const schemas: Record = {};\n const external = {\n registry,\n uri: (params as RegistryToJSONSchemaParams)?.uri,\n defs,\n };\n\n // Update the context with external configuration\n ctx.external = external;\n\n // Second pass: emit each schema\n for (const entry of registry._idmap.entries()) {\n const [key, schema] = entry;\n extractDefs(ctx as any, schema);\n schemas[key] = finalize(ctx as any, schema);\n }\n\n if (Object.keys(defs).length > 0) {\n const defsSegment = ctx.target === \"draft-2020-12\" ? \"$defs\" : \"definitions\";\n schemas.__shared = {\n [defsSegment]: defs,\n };\n }\n\n return { schemas };\n }\n\n // Single schema case\n const ctx = initializeContext({ ...params, processors: allProcessors });\n process(input, ctx as any);\n extractDefs(ctx as any, input);\n return finalize(ctx as any, input);\n}", "result_size": 4, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "trpc__trpc__next__downstream__2hop_866de7", "repo": "trpc/trpc", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["onDone"], "hop_1_files": ["private/tmp/repos/trpc__trpc/packages/server/src/observable/observable.ts"], "hop_2": ["subscribe", "unsubscribe"], "hop_2_files": ["private/tmp/repos/trpc__trpc/packages/server/src/observable/types.ts", "private/tmp/repos/trpc__trpc/packages/server/src/observable/types.ts"]}, "metadata": {"anchor": "next", "anchor_file": "private/tmp/repos/trpc__trpc/packages/server/src/observable/observable.ts", "anchor_source": "next(data) {\n isDone = true;\n resolve(data);\n onDone();\n },", "result_size": 2, "created_at": "2026-03-20T16:58:18.199328+00:00"}} {"sample_id": "encode__httpx__aread__upstream__1hop_1cb22b", "repo": "encode/httpx", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["async_auth_flow", "handle_async_request"], "call_files": ["private/tmp/repos/encode__httpx/httpx/_auth.py", "private/tmp/repos/encode__httpx/httpx/_transports/mock.py"]}, "metadata": {"anchor": "aread", "anchor_file": "private/tmp/repos/encode__httpx/httpx/_models.py", "anchor_source": "async def aread(self) -> bytes:\n \"\"\"\n Read and return the request content.\n \"\"\"\n if not hasattr(self, \"_content\"):\n assert isinstance(self.stream, typing.AsyncIterable)\n self._content = b\"\".join([part async for part in self.stream])\n if not isinstance(self.stream, ByteStream):\n # If a streaming request has been read entirely into memory, then\n # we can replace the stream with a raw bytes implementation,\n # to ensure that any non-replayable streams can still be used.\n self.stream = ByteStream(self._content)\n return self._content", "result_size": 2, "created_at": "2026-03-20T16:58:16.700579+00:00", "file_content": ""}} {"sample_id": "paramiko__paramiko__listdir_attr__downstream__2hop_1736ea", "repo": "paramiko/paramiko", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["_request", "_adjust_cwd", "_log"], "hop_1_files": ["private/tmp/repos/paramiko/paramiko/sftp_client.py", "private/tmp/repos/paramiko/paramiko/sftp_client.py", "private/tmp/repos/paramiko/paramiko/sftp_client.py"], "hop_2": ["_read_response", "_async_request"], "hop_2_files": ["private/tmp/repos/paramiko/paramiko/sftp_client.py", "private/tmp/repos/paramiko/paramiko/sftp_client.py"]}, "metadata": {"anchor": "listdir_attr", "anchor_file": "private/tmp/repos/paramiko/paramiko/sftp_client.py", "anchor_source": "def listdir_attr(self, path=\".\"):\n \"\"\"\n Return a list containing `.SFTPAttributes` objects corresponding to\n files in the given ``path``. The list is in arbitrary order. It does\n not include the special entries ``'.'`` and ``'..'`` even if they are\n present in the folder.\n\n The returned `.SFTPAttributes` objects will each have an additional\n field: ``longname``, which may contain a formatted string of the file's\n attributes, in unix format. The content of this string will probably\n depend on the SFTP server implementation.\n\n :param str path: path to list (defaults to ``'.'``)\n :return: list of `.SFTPAttributes` objects\n\n .. versionadded:: 1.2\n \"\"\"\n path = self._adjust_cwd(path)\n self._log(DEBUG, \"listdir({!r})\".format(path))\n t, msg = self._request(CMD_OPENDIR, path)\n if t != CMD_HANDLE:\n raise SFTPError(\"Expected handle\")\n handle = msg.get_binary()\n filelist = []\n while True:\n try:\n t, msg = self._request(CMD_READDIR, handle)\n except EOFError:\n # done with handle\n break\n if t != CMD_NAME:\n raise SFTPError(\"Expected name response\")\n count = msg.get_int()\n for i in range(count):\n filename = msg.get_text()\n longname = msg.get_text()\n attr = SFTPAttributes._from_msg(msg, filename, longname)\n if (filename != \".\") and (filename != \"..\"):\n filelist.append(attr)\n self._request(CMD_CLOSE, handle)\n return filelist", "result_size": 2, "created_at": "2026-03-20T16:58:17.364834+00:00"}} {"sample_id": "getpelican__pelican__decode_wp_content__downstream__1hop_85e4bf", "repo": "getpelican/pelican", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["_multi_replace"], "call_files": ["private/tmp/repos/getpelican__pelican/pelican/tools/pelican_import.py"]}, "metadata": {"anchor": "decode_wp_content", "anchor_file": "private/tmp/repos/getpelican__pelican/pelican/tools/pelican_import.py", "anchor_source": "def decode_wp_content(content, br=True):\n pre_tags = {}\n if content is None or content.strip() == \"\":\n return \"\"\n\n content += \"\\n\"\n if \"\")\n last_pre = pre_parts.pop()\n content = \"\"\n pre_index = 0\n\n for pre_part in pre_parts:\n start = pre_part.find(\"\"\n pre_tags[name] = pre_part[start:] + \"\"\n content = content + pre_part[0:start] + name\n pre_index += 1\n content = content + last_pre\n\n content = re.sub(r\"
\\s*
\", \"\\n\\n\", content)\n allblocks = (\n \"(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|\"\n \"td|th|div|dl|dd|dt|ul|ol|li|pre|select|option|form|\"\n \"map|area|blockquote|address|math|style|p|h[1-6]|hr|\"\n \"fieldset|noscript|samp|legend|section|article|aside|\"\n \"hgroup|header|footer|nav|figure|figcaption|details|\"\n \"menu|summary)\"\n )\n content = re.sub(r\"(<\" + allblocks + r\"[^>]*>)\", \"\\n\\\\1\", content)\n content = re.sub(r\"()\", \"\\\\1\\n\\n\", content)\n # content = content.replace(\"\\r\\n\", \"\\n\")\n if \" inside object/embed\n content = re.sub(r\"\\s*]*)>\\s*\", \"\", content)\n content = re.sub(r\"\\s*\\s*\", \"\", content)\n # content = re.sub(r'/\\n\\n+/', '\\n\\n', content)\n pgraphs = filter(lambda s: s != \"\", re.split(r\"\\n\\s*\\n\", content))\n content = \"\"\n for p in pgraphs:\n content = content + \"

\" + p.strip() + \"

\\n\"\n # under certain strange conditions it could create\n # a P of entirely whitespace\n content = re.sub(r\"

\\s*

\", \"\", content)\n content = re.sub(r\"

([^<]+)\", \"

\\\\1

\", content)\n # don't wrap tags\n content = re.sub(r\"

\\s*(]*>)\\s*

\", \"\\\\1\", content)\n # problem with nested lists\n content = re.sub(r\"

(\", \"\\\\1\", content)\n content = re.sub(r\"

]*)>\", \"

\", content)\n content = content.replace(\"

\", \"

\")\n content = re.sub(r\"

\\s*(]*>)\", \"\\\\1\", content)\n content = re.sub(r\"(]*>)\\s*

\", \"\\\\1\", content)\n if br:\n\n def _preserve_newline(match):\n return match.group(0).replace(\"\\n\", \"\")\n\n content = re.sub(r\"/<(script|style).*?<\\/\\\\1>/s\", _preserve_newline, content)\n # optionally make line breaks\n content = re.sub(r\"(?)\\s*\\n\", \"
\\n\", content)\n content = content.replace(\"\", \"\\n\")\n content = re.sub(r\"(]*>)\\s*
\", \"\\\\1\", content)\n content = re.sub(\n r\"
(\\s*]*>)\", \"\\\\1\", content\n )\n content = re.sub(r\"\\n

\", \"

\", content)\n\n if pre_tags:\n\n def _multi_replace(dic, string):\n pattern = r\"|\".join(map(re.escape, dic.keys()))\n return re.sub(pattern, lambda m: dic[m.group()], string)\n\n content = _multi_replace(pre_tags, content)\n\n # convert [caption] tags into
\n content = re.sub(\n r\"\\[caption(?:.*?)(?:caption=\\\"(.*?)\\\")?\\]\"\n r\"((?:\\)?(?:\\)(?:\\<\\/a\\>)?)\\s?(.*?)\\[\\/caption\\]\",\n r\"
\\n\\2\\n
\\1\\3
\\n
\",\n content,\n )\n\n return content", "result_size": 1, "created_at": "2026-03-20T16:58:16.756586+00:00"}} {"sample_id": "immerjs__immer__benchMethod__downstream__1hop_024d07", "repo": "immerjs/immer", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["createInitialState"], "call_files": ["private/tmp/repos/immerjs__immer/perf-testing/immutability-benchmarks.mjs"]}, "metadata": {"anchor": "benchMethod", "anchor_file": "private/tmp/repos/immerjs__immer/perf-testing/immutability-benchmarks.mjs", "anchor_source": "function benchMethod() {\n\t\t\t\t\tsetAutoFreezes[version](freeze)\n\t\t\t\t\tsetStrictIteration[version](false)\n\t\t\t\t\tsetEnableArrayMethods[version]()\n\n\t\t\t\t\tlet currentState = createInitialState()\n\n\t\t\t\t\t// Perform multiple operations on the same evolving state\n\t\t\t\t\tfor (let i = 0; i < BENCHMARK_CONFIG.reuseStateIterations; i++) {\n\t\t\t\t\t\tcurrentState = reducers[version](currentState, actions[action](i))\n\t\t\t\t\t}\n\t\t\t\t\tsetAutoFreezes[version](false)\n\t\t\t\t}", "result_size": 1, "created_at": "2026-03-20T16:58:16.801413+00:00"}} {"sample_id": "rq__rq__restore__upstream__2hop_d87e51", "repo": "rq/rq", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["refresh", "fetch_many"], "hop_1_files": ["private/tmp/repos/rq__rq/rq/job.py", "private/tmp/repos/rq__rq/rq/job.py"], "hop_2": ["get_jobs", "enqueue_dependents", "enqueue_scheduled_jobs", "fetch_dependencies", "fetch"], "hop_2_files": ["private/tmp/repos/rq__rq/rq/group.py", "private/tmp/repos/rq__rq/rq/queue.py", "private/tmp/repos/rq__rq/rq/scheduler.py", "private/tmp/repos/rq__rq/rq/job.py", "private/tmp/repos/rq__rq/rq/job.py"]}, "metadata": {"anchor": "restore", "anchor_file": "private/tmp/repos/rq__rq/rq/job.py", "anchor_source": "def restore(self, raw_data) -> Any:\n \"\"\"Overwrite properties with the provided values stored in Redis.\n\n Args:\n raw_data (_type_): The raw data to load the job data from\n\n Raises:\n NoSuchJobError: If there way an error getting the job data\n \"\"\"\n obj = decode_redis_hash(raw_data)\n try:\n raw_data = obj['data']\n except KeyError:\n raise NoSuchJobError(f'Unexpected job format: {obj}')\n\n try:\n self.data = zlib.decompress(raw_data)\n except zlib.error:\n # Fallback to uncompressed string\n self.data = raw_data\n\n self.created_at = str_to_date(v) if (v := obj.get('created_at')) else now()\n self.origin = as_text(obj['origin']) if obj.get('origin') else ''\n self.worker_name = obj['worker_name'].decode() if obj.get('worker_name') else None\n self.description = as_text(obj['description']) if obj.get('description') else None\n\n self.enqueued_at = str_to_date(v) if (v := obj.get('enqueued_at')) else None\n self.started_at = str_to_date(v) if (v := obj.get('started_at')) else None\n self.ended_at = str_to_date(v) if (v := obj.get('ended_at')) else None\n\n self.last_heartbeat = str_to_date(v) if (v := obj.get('last_heartbeat')) else None\n self.group_id = as_text(obj['group_id']) if obj.get('group_id') else None\n result = obj.get('result')\n if result:\n try:\n self._result = self.serializer.loads(result)\n except Exception:\n self._result = UNSERIALIZABLE_RETURN_VALUE_PAYLOAD\n self.timeout = parse_timeout(obj.get('timeout')) if obj.get('timeout') else None\n self.result_ttl = int(obj['result_ttl']) if obj.get('result_ttl') else None\n self.failure_ttl = int(obj['failure_ttl']) if obj.get('failure_ttl') else None\n\n # Beginning from v2.4.1, jobs are created with a status, so the fallback to CREATED\n # is not needed, but we keep it for backwards compatibility\n # In future versions, if a job has no status, an error should be raised\n self._status = JobStatus(as_text(obj['status'])) if obj.get('status') else JobStatus.CREATED\n\n if obj.get('success_callback_name'):\n self._success_callback_name = obj['success_callback_name'].decode()\n\n if 'success_callback_timeout' in obj:\n self._success_callback_timeout = int(obj['success_callback_timeout'])\n\n if obj.get('failure_callback_name'):\n self._failure_callback_name = obj['failure_callback_name'].decode()\n\n if 'failure_callback_timeout' in obj:\n self._failure_callback_timeout = int(obj['failure_callback_timeout'])\n\n if obj.get('stopped_callback_name'):\n self._stopped_callback_name = obj['stopped_callback_name'].decode()\n\n if 'stopped_callback_timeout' in obj:\n self._stopped_callback_timeout = int(obj['stopped_callback_timeout'])\n\n dep_ids = obj.get('dependency_ids')\n dep_id = obj.get('dependency_id') # for backwards compatibility\n self._dependency_ids = json.loads(dep_ids.decode()) if dep_ids else [dep_id.decode()] if dep_id else []\n allow_failures = obj.get('allow_dependency_failures')\n self.allow_dependency_failures = bool(int(allow_failures)) if allow_failures else None\n self.enqueue_at_front = bool(int(obj['enqueue_at_front'])) if 'enqueue_at_front' in obj else None\n self.ttl = int(obj['ttl']) if obj.get('ttl') else None\n try:\n self.meta = self.serializer.loads(obj['meta']) if obj.get('meta') else {}\n except Exception: # depends on the serializer\n self.meta = {'unserialized': obj.get('meta', {})}\n\n self.number_of_retries = int(obj['number_of_retries']) if obj.get('number_of_retries') else None\n self.retries_left = int(obj['retries_left']) if obj.get('retries_left') else None\n if obj.get('retry_intervals'):\n self.retry_intervals = json.loads(obj['retry_intervals'].decode())\n\n self.repeats_left = int(obj['repeats_left']) if obj.get('repeats_left') else None\n if obj.get('repeat_intervals'):\n self.repeat_intervals = json.loads(obj['repeat_intervals'].decode())\n\n raw_exc_info = obj.get('exc_info')\n if raw_exc_info:\n try:\n self._exc_info = as_text(zlib.decompress(raw_exc_info))\n except zlib.error:\n # Fallback to uncompressed string\n self._exc_info = as_text(raw_exc_info)", "result_size": 5, "created_at": "2026-03-20T16:58:17.875204+00:00", "file_content": ""}} {"sample_id": "colinhacks__zod__cuid__downstream__1hop_b9d2c3", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["_addCheck"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"]}, "metadata": {"anchor": "cuid", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "anchor_source": "cuid(message?: errorUtil.ErrMessage) {\n return this._addCheck({ kind: \"cuid\", ...errorUtil.errToObj(message) });\n }", "result_size": 1, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "colinhacks__zod__deepPartialify__downstream__1hop_db9d39", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["ZodNullable", "unwrap", "constructor", "ZodOptional", "ZodObject", "ZodArray", "ZodTuple"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"]}, "metadata": {"anchor": "deepPartialify", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "anchor_source": "function deepPartialify(schema: ZodTypeAny): any {\n if (schema instanceof ZodObject) {\n const newShape: any = {};\n\n for (const key in schema.shape) {\n const fieldSchema = schema.shape[key];\n newShape[key] = ZodOptional.create(deepPartialify(fieldSchema));\n }\n return new ZodObject({\n ...schema._def,\n shape: () => newShape,\n }) as any;\n } else if (schema instanceof ZodArray) {\n return new ZodArray({\n ...schema._def,\n type: deepPartialify(schema.element),\n });\n } else if (schema instanceof ZodOptional) {\n return ZodOptional.create(deepPartialify(schema.unwrap()));\n } else if (schema instanceof ZodNullable) {\n return ZodNullable.create(deepPartialify(schema.unwrap()));\n } else if (schema instanceof ZodTuple) {\n return ZodTuple.create(schema.items.map((item: any) => deepPartialify(item)));\n } else {\n return schema;\n }\n}", "result_size": 7, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "immerjs__immer__createBenchmarks__downstream__2hop_d56f5a", "repo": "immerjs/immer", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["benchMethod", "createInitialState"], "hop_1_files": ["private/tmp/repos/immerjs__immer/perf-testing/immutability-benchmarks.mjs", "private/tmp/repos/immerjs__immer/perf-testing/immutability-benchmarks.mjs"], "hop_2": ["createLargeObject"], "hop_2_files": ["private/tmp/repos/immerjs__immer/perf-testing/immutability-benchmarks.mjs"]}, "metadata": {"anchor": "createBenchmarks", "anchor_file": "private/tmp/repos/immerjs__immer/perf-testing/immutability-benchmarks.mjs", "anchor_source": "function createBenchmarks() {\n\t// All single-operation benchmarks (fresh state each time)\n\tfor (const action in actions) {\n\t\tsummary(function() {\n\t\t\tbench(`$action: $version (freeze: $freeze)`, function*(args) {\n\t\t\t\tconst version = args.get(\"version\")\n\t\t\t\tconst freeze = args.get(\"freeze\")\n\t\t\t\tconst action = args.get(\"action\")\n\n\t\t\t\tconst initialState = createInitialState()\n\n\t\t\t\tfunction benchMethod() {\n\t\t\t\t\tsetAutoFreezes[version](freeze)\n\t\t\t\t\tsetStrictIteration[version](false)\n\t\t\t\t\tsetEnableArrayMethods[version]()\n\t\t\t\t\tfor (let i = 0; i < MAX; i++) {\n\t\t\t\t\t\treducers[version](initialState, actions[action](i))\n\t\t\t\t\t}\n\t\t\t\t\tsetAutoFreezes[version](false)\n\t\t\t\t}\n\n\t\t\t\tyield benchMethod\n\t\t\t}).args({\n\t\t\t\tversion: Object.keys(reducers),\n\t\t\t\tfreeze,\n\t\t\t\taction: [action]\n\t\t\t})\n\t\t})\n\t}\n\n\t// State reuse benchmarks (tests performance on frozen/evolved state)\n\tconst reuseActions = [\n\t\t\"update\",\n\t\t\"update-high\",\n\t\t\"remove\",\n\t\t\"remove-high\",\n\t\t\"update-largeObject1\",\n\t\t\"update-largeObject2\"\n\t]\n\tfor (const action of reuseActions) {\n\t\tsummary(function() {\n\t\t\tbench(`$action-reuse: $version (freeze: $freeze)`, function*(args) {\n\t\t\t\tconst version = args.get(\"version\")\n\t\t\t\tconst freeze = args.get(\"freeze\")\n\t\t\t\tconst action = args.get(\"action\")\n\n\t\t\t\tfunction benchMethod() {\n\t\t\t\t\tsetAutoFreezes[version](freeze)\n\t\t\t\t\tsetStrictIteration[version](false)\n\t\t\t\t\tsetEnableArrayMethods[version]()\n\n\t\t\t\t\tlet currentState = createInitialState()\n\n\t\t\t\t\t// Perform multiple operations on the same evolving state\n\t\t\t\t\tfor (let i = 0; i < BENCHMARK_CONFIG.reuseStateIterations; i++) {\n\t\t\t\t\t\tcurrentState = reducers[version](currentState, actions[action](i))\n\t\t\t\t\t}\n\t\t\t\t\tsetAutoFreezes[version](false)\n\t\t\t\t}\n\n\t\t\t\tyield benchMethod\n\t\t\t}).args({\n\t\t\t\tversion: Object.keys(reducers),\n\t\t\t\tfreeze,\n\t\t\t\taction: [action]\n\t\t\t})\n\t\t})\n\t}\n\n\t// Mixed operations sequence benchmark\n\tsummary(function() {\n\t\tbench(`mixed-sequence: $version (freeze: $freeze)`, function*(args) {\n\t\t\tconst version = args.get(\"version\")\n\t\t\tconst freeze = args.get(\"freeze\")\n\n\t\t\tfunction benchMethod() {\n\t\t\t\tsetAutoFreezes[version](freeze)\n\t\t\t\tsetStrictIteration[version](false)\n\t\t\t\tsetEnableArrayMethods[version]()\n\n\t\t\t\tlet state = createInitialState()\n\n\t\t\t\t// Perform a sequence of different operations (typical workflow)\n\t\t\t\tstate = reducers[version](state, actions.add(1))\n\t\t\t\tstate = reducers[version](state, actions.update(getValidId()))\n\t\t\t\tstate = reducers[version](state, actions[\"update-high\"](2))\n\t\t\t\tstate = reducers[version](state, actions[\"update-multiple\"](3))\n\t\t\t\tstate = reducers[version](state, actions.remove(getValidIndex()))\n\n\t\t\t\tsetAutoFreezes[version](false)\n\t\t\t}\n\n\t\t\tyield benchMethod\n\t\t}).args({\n\t\t\tversion: Object.keys(reducers),\n\t\t\tfreeze\n\t\t})\n\t})\n\n\t// RTKQ-style benchmark - executes multiple reducer calls in sequence\n\tsummary(function() {\n\t\tbench(`rtkq-sequence: $version (freeze: $freeze)`, function*(args) {\n\t\t\tconst version = args.get(\"version\")\n\t\t\tconst freeze = args.get(\"freeze\")\n\n\t\t\tfunction benchMethod() {\n\t\t\t\tsetAutoFreezes[version](freeze)\n\t\t\t\tsetStrictIteration[version](false)\n\t\t\t\tsetEnableArrayMethods[version]()\n\n\t\t\t\tlet state = createInitialState()\n\t\t\t\t// Use smaller array size for RTKQ benchmark due to exponential scaling\n\t\t\t\t// 100 items = ~15ms, 200 items = ~32ms, so 10000 would be impractical\n\t\t\t\tconst arraySize = 100\n\n\t\t\t\t// Phase 1: Execute all pending actions\n\t\t\t\tfor (let i = 0; i < arraySize; i++) {\n\t\t\t\t\tstate = reducers[version](state, rtkqPending(i))\n\t\t\t\t}\n\n\t\t\t\t// Phase 2: Execute all resolved actions\n\t\t\t\tfor (let i = 0; i < arraySize; i++) {\n\t\t\t\t\tstate = reducers[version](state, rtkqResolved(i))\n\t\t\t\t}\n\n\t\t\t\tsetAutoFreezes[version](false)\n\t\t\t}\n\n\t\t\tyield benchMethod\n\t\t}).args({\n\t\t\tversion: Object.keys(reducers),\n\t\t\tfreeze\n\t\t})\n\t})\n}", "result_size": 1, "created_at": "2026-03-20T16:58:16.801413+00:00"}} {"sample_id": "colinhacks__zod___parse__downstream__1hop_df57d9", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["_parseSync", "_processInputParams", "addIssueToContext", "mergeValues", "_parseAsync", "dirty"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/helpers/parseUtil.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/helpers/parseUtil.ts"]}, "metadata": {"anchor": "_parse", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "anchor_source": "_parse(input: ParseInput): ParseReturnType {\n const { status, ctx } = this._processInputParams(input);\n const handleParsed = (\n parsedLeft: SyncParseReturnType,\n parsedRight: SyncParseReturnType\n ): SyncParseReturnType => {\n if (isAborted(parsedLeft) || isAborted(parsedRight)) {\n return INVALID;\n }\n\n const merged = mergeValues(parsedLeft.value, parsedRight.value);\n\n if (!merged.valid) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_intersection_types,\n });\n return INVALID;\n }\n\n if (isDirty(parsedLeft) || isDirty(parsedRight)) {\n status.dirty();\n }\n\n return { status: status.value, value: merged.data };\n };\n\n if (ctx.common.async) {\n return Promise.all([\n this._def.left._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }),\n this._def.right._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }),\n ]).then(([left, right]: any) => handleParsed(left, right));\n } else {\n return handleParsed(\n this._def.left._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }),\n this._def.right._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n })\n );\n }\n }", "result_size": 6, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "trpc__trpc__attempt__downstream__2hop_bf977e", "repo": "trpc/trpc", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["opWithLastEventId", "subscribe"], "hop_1_files": ["private/tmp/repos/trpc__trpc/packages/client/src/links/retryLink.ts", "private/tmp/repos/trpc__trpc/packages/server/src/observable/types.ts"], "hop_2": ["inputWithTrackedEventId"], "hop_2_files": ["private/tmp/repos/trpc__trpc/packages/client/src/internals/inputWithTrackedEventId.ts"]}, "metadata": {"anchor": "attempt", "anchor_file": "private/tmp/repos/trpc__trpc/packages/client/src/links/retryLink.ts", "anchor_source": "function attempt(attempts: number) {\n const op = opWithLastEventId();\n\n next$ = callOpts.next(op).subscribe({\n error(error) {\n const shouldRetry = opts.retry({\n op,\n attempts,\n error,\n });\n if (!shouldRetry) {\n observer.error(error);\n return;\n }\n const delayMs = opts.retryDelayMs?.(attempts) ?? 0;\n\n if (delayMs <= 0) {\n attempt(attempts + 1);\n return;\n }\n callNextTimeout = setTimeout(\n () => attempt(attempts + 1),\n delayMs,\n );\n },\n next(envelope) {\n //\n if (\n (!envelope.result.type || envelope.result.type === 'data') &&\n envelope.result.id\n ) {\n //\n lastEventId = envelope.result.id;\n }\n\n observer.next(envelope);\n },\n complete() {\n observer.complete();\n },\n });\n }", "result_size": 1, "created_at": "2026-03-20T16:58:18.199328+00:00"}} {"sample_id": "colinhacks__zod__optional__downstream__1hop_473e98", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["ZodOptional"], "call_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"]}, "metadata": {"anchor": "optional", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "anchor_source": "optional(): ZodOptional {\n return ZodOptional.create(this, this._def) as any;\n }", "result_size": 1, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "psf__black__append_safe__downstream__1hop_c6b08e", "repo": "psf/black", "question_type": "downstream", "hop_depth": 1, "gold": {"calls": ["append"], "call_files": ["private/tmp/repos/psf__black/src/black/lines.py"]}, "metadata": {"anchor": "append_safe", "anchor_file": "private/tmp/repos/psf__black/src/black/lines.py", "anchor_source": "def append_safe(self, leaf: Leaf, preformatted: bool = False) -> None:\n \"\"\"Like :func:`append()` but disallow invalid standalone comment structure.\n\n Raises ValueError when any `leaf` is appended after a standalone comment\n or when a standalone comment is not the first leaf on the line.\n \"\"\"\n if (\n self.bracket_tracker.depth == 0\n or self.bracket_tracker.any_open_for_or_lambda()\n ):\n if self.is_comment:\n raise ValueError(\"cannot append to standalone comments\")\n\n if self.leaves and leaf.type == STANDALONE_COMMENT:\n raise ValueError(\n \"cannot append standalone comments to a populated line\"\n )\n\n self.append(leaf, preformatted=preformatted)", "result_size": 1, "created_at": "2026-03-20T16:58:17.494246+00:00"}} {"sample_id": "immerjs__immer__isFrozen__upstream__1hop_208d2c", "repo": "immerjs/immer", "question_type": "upstream", "hop_depth": 1, "gold": {"calls": ["handleValue", "finalize", "freeze", "currentImpl"], "call_files": ["private/tmp/repos/immerjs__immer/src/core/finalize.ts", "private/tmp/repos/immerjs__immer/src/core/finalize.ts", "private/tmp/repos/immerjs__immer/src/utils/common.ts", "private/tmp/repos/immerjs__immer/src/core/current.ts"]}, "metadata": {"anchor": "isFrozen", "anchor_file": "private/tmp/repos/immerjs__immer/src/utils/common.ts", "anchor_source": "export function isFrozen(obj: any): boolean {\n\t// Fast path: primitives and null/undefined are always \"frozen\"\n\tif (obj === null || !isObjectish(obj)) return true\n\treturn O.isFrozen(obj)\n}", "result_size": 4, "created_at": "2026-03-20T16:58:16.801413+00:00", "file_content": ""}} {"sample_id": "pallets__click__show__downstream__2hop_6a1878", "repo": "pallets/click", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["format_message", "get_text_stderr", "echo"], "hop_1_files": ["private/tmp/repos/pallets__click/src/click/exceptions.py", "private/tmp/repos/pallets__click/src/click/_compat.py", "private/tmp/repos/pallets__click/src/click/utils.py"], "hop_2": ["_get_windows_console_stream", "_find_binary_writer", "auto_wrap_for_ansi", "strip_ansi", "resolve_color_default"], "hop_2_files": ["private/tmp/repos/pallets__click/src/click/_winconsole.py", "private/tmp/repos/pallets__click/src/click/_compat.py", "private/tmp/repos/pallets__click/src/click/_compat.py", "private/tmp/repos/pallets__click/src/click/_compat.py", "private/tmp/repos/pallets__click/src/click/globals.py"]}, "metadata": {"anchor": "show", "anchor_file": "private/tmp/repos/pallets__click/src/click/exceptions.py", "anchor_source": "def show(self, file: t.IO[t.Any] | None = None) -> None:\n if file is None:\n file = get_text_stderr()\n\n echo(\n _(\"Error: {message}\").format(message=self.format_message()),\n file=file,\n color=self.show_color,\n )", "result_size": 6, "created_at": "2026-03-20T16:58:17.078639+00:00"}} {"sample_id": "rq__rq__get_jobs_to_schedule__upstream__2hop_a5369e", "repo": "rq/rq", "question_type": "upstream", "hop_depth": 2, "gold": {"hop_1": ["enqueue_scheduled_jobs"], "hop_1_files": ["private/tmp/repos/rq__rq/rq/scheduler.py"], "hop_2": ["_start_scheduler", "work"], "hop_2_files": ["private/tmp/repos/rq__rq/rq/worker/base.py", "private/tmp/repos/rq__rq/rq/scheduler.py"]}, "metadata": {"anchor": "get_jobs_to_schedule", "anchor_file": "private/tmp/repos/rq__rq/rq/registry.py", "anchor_source": "def get_jobs_to_schedule(self, timestamp: Optional[int] = None, chunk_size: int = 1000) -> list[str]:\n \"\"\"Get's a list of job IDs that should be scheduled.\n\n Args:\n timestamp (Optional[int]): _description_. Defaults to None.\n chunk_size (int, optional): _description_. Defaults to 1000.\n\n Returns:\n jobs (List[str]): A list of Job ids\n \"\"\"\n score: int = timestamp if timestamp is not None else current_timestamp()\n jobs_to_schedule = self.connection.zrangebyscore(self.key, 0, score, start=0, num=chunk_size)\n return [as_text(job_id) for job_id in jobs_to_schedule]", "result_size": 2, "created_at": "2026-03-20T16:58:17.875204+00:00", "file_content": ""}} {"sample_id": "agronholm__apscheduler__cleanup__downstream__2hop_8371b7", "repo": "agronholm/apscheduler", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["_release_job", "publish", "_retry", "ScheduleRemoved", "_begin_transaction", "_execute", "JobResult"], "hop_1_files": ["private/tmp/repos/agronholm__apscheduler/src/apscheduler/datastores/sqlalchemy.py", "private/tmp/repos/agronholm__apscheduler/src/apscheduler/abc.py", "private/tmp/repos/agronholm__apscheduler/src/apscheduler/datastores/sqlalchemy.py", "private/tmp/repos/agronholm__apscheduler/src/apscheduler/_events.py", "private/tmp/repos/agronholm__apscheduler/src/apscheduler/datastores/sqlalchemy.py", "private/tmp/repos/agronholm__apscheduler/src/apscheduler/datastores/sqlalchemy.py", "private/tmp/repos/agronholm__apscheduler/src/apscheduler/_structures.py"], "hop_2": ["marshal", "from_result"], "hop_2_files": ["private/tmp/repos/agronholm__apscheduler/src/apscheduler/_structures.py", "private/tmp/repos/agronholm__apscheduler/src/apscheduler/_events.py"]}, "metadata": {"anchor": "cleanup", "anchor_file": "private/tmp/repos/agronholm__apscheduler/src/apscheduler/datastores/sqlalchemy.py", "anchor_source": "async def cleanup(self) -> None:\n async for attempt in self._retry():\n with attempt:\n events: list[Event] = []\n async with self._begin_transaction() as conn:\n # Purge expired job results\n delete = self._t_job_results.delete().where(\n self._t_job_results.c.expires_at <= datetime.now(timezone.utc)\n )\n await self._execute(conn, delete)\n\n # Finish any jobs whose leases have expired\n now = datetime.now(timezone.utc)\n query = select(\n self._t_jobs.c.id,\n self._t_jobs.c.task_id,\n self._t_jobs.c.schedule_id,\n self._t_jobs.c.scheduled_fire_time,\n self._t_jobs.c.acquired_by,\n self._t_jobs.c.result_expiration_time,\n ).where(\n self._t_jobs.c.acquired_by.isnot(None),\n self._t_jobs.c.acquired_until < now,\n )\n for row in await self._execute(conn, query):\n result = JobResult(\n job_id=row.id,\n outcome=JobOutcome.abandoned,\n finished_at=now,\n expires_at=now + row.result_expiration_time,\n )\n events.append(\n await self._release_job(\n conn,\n result,\n row.acquired_by,\n row.task_id,\n row.schedule_id,\n row.scheduled_fire_time,\n )\n )\n\n # Clean up finished schedules that have no running jobs\n query = (\n select(self._t_schedules.c.id, self._t_schedules.c.task_id)\n .outerjoin(\n self._t_jobs,\n self._t_jobs.c.schedule_id == self._t_schedules.c.id,\n )\n .where(\n self._t_schedules.c.next_fire_time.is_(None),\n self._t_jobs.c.id.is_(None),\n )\n )\n results = await self._execute(conn, query)\n if finished_schedule_ids := dict(results.all()):\n delete = self._t_schedules.delete().where(\n self._t_schedules.c.id.in_(finished_schedule_ids)\n )\n await self._execute(conn, delete)\n\n for schedule_id, task_id in finished_schedule_ids.items():\n events.append(\n ScheduleRemoved(\n schedule_id=schedule_id,\n task_id=task_id,\n finished=True,\n )\n )\n\n # Publish any events produced from the operations\n for event in events:\n await self._event_broker.publish(event)", "result_size": 2, "created_at": "2026-03-20T16:58:16.252821+00:00"}} {"sample_id": "colinhacks__zod__nanoid__downstream__2hop_1f7168", "repo": "colinhacks/zod", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["_addCheck"], "hop_1_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"], "hop_2": ["ZodString", "constructor"], "hop_2_files": ["private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts"]}, "metadata": {"anchor": "nanoid", "anchor_file": "private/tmp/repos/colinhacks__zod/packages/zod/src/v3/types.ts", "anchor_source": "nanoid(message?: errorUtil.ErrMessage) {\n return this._addCheck({ kind: \"nanoid\", ...errorUtil.errToObj(message) });\n }", "result_size": 2, "created_at": "2026-03-20T16:58:16.474869+00:00"}} {"sample_id": "locustio__locust__stats_reporter__downstream__2hop_eb49b2", "repo": "locustio/locust", "question_type": "downstream", "hop_depth": 2, "gold": {"hop_1": ["_send_stats"], "hop_1_files": ["private/tmp/repos/locustio__locust/locust/runners.py"], "hop_2": ["send", "Message", "fire"], "hop_2_files": ["private/tmp/repos/locustio__locust/locust/rpc/zmqrpc.py", "private/tmp/repos/locustio__locust/locust/rpc/protocol.py", "private/tmp/repos/locustio__locust/locust/event.py"]}, "metadata": {"anchor": "stats_reporter", "anchor_file": "private/tmp/repos/locustio__locust/locust/runners.py", "anchor_source": "def stats_reporter(self) -> NoReturn:\n while True:\n try:\n self._send_stats()\n except RPCError as e:\n logger.error(f\"Temporary connection lost to master server: {e}, will retry later.\")\n gevent.sleep(WORKER_REPORT_INTERVAL)", "result_size": 3, "created_at": "2026-03-20T16:58:16.951273+00:00"}}