Team Ai
Datasetpublic

Code-TREAT/code_summarization_lite

sourceHugging Faceapache-2.0updated 1y agoView on Hugging Face
0likes14downloads
code_summarization_gh_2023.jsonl2001 linesDownload Raw Back to raw
1{"repo_name": "BugChecker", "dataset": "github_2023", "owner": "vitoplantamura", "lang": "c", "func_name": "put_bits", "code": "static inline void put_bits(limb_t *tab, limb_t len, slimb_t pos, limb_t val)\n{\n    limb_t i;\n    int p;\n\n    i = pos >> LIMB_LOG2_BITS;\n    p = pos & (LIMB_BITS - 1);\n    if (i < len)\n        tab[i] |= val << p;\n    if (p != 0) {\n        i++;\n        if (i < len) {\n            tab[i] |= val >> (LIMB_BITS - p);\n        }\n    }\n}", "docstring": "/***************************************************************/\n/* Integer multiplication with FFT */\n/* or LIMB_BITS at bit position 'pos' in tab */", "url": "https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/BugChecker/QuickJS/libbf.c#L7241-L7256", "sha": "8b81e76efe457b59be3a6e752efd43916ba0cabb"}2{"repo_name": "BugChecker", "dataset": "github_2023", "owner": "vitoplantamura", "lang": "c", "func_name": "ZyanBitsetPerformByteOperation", "code": "ZyanStatus ZyanBitsetPerformByteOperation(ZyanBitset* destination, const ZyanBitset* source,\n    ZyanBitsetByteOperation operation)\n{\n    if (!destination || !source || !operation)\n    {\n        return ZYAN_STATUS_INVALID_ARGUMENT;\n    }\n\n    ZyanUSize s1;\n    ZyanUSize s2;\n    ZYAN_CHECK(ZyanVectorGetSize(&destination->bits, &s1));\n    ZYAN_CHECK(ZyanVectorGetSize(&source->bits, &s2));\n\n    const ZyanUSize min = ZYAN_MIN(s1, s2);\n    for (ZyanUSize i = 0; i < min; ++i)\n    {\n        ZyanU8* v1;\n        const ZyanU8* v2;\n        ZYAN_CHECK(ZyanVectorGetPointerMutable(&destination->bits, i, (void**)&v1));\n        ZYAN_CHECK(ZyanVectorGetPointer(&source->bits, i, (const void**)&v2));\n\n        ZYAN_ASSERT(v1);\n        ZYAN_ASSERT(v2);\n\n        ZYAN_CHECK(operation(v1, v2));\n    }\n\n    return ZYAN_STATUS_SUCCESS;\n}", "docstring": "/* ---------------------------------------------------------------------------------------------- */\n/* Logical operations                                                                             */\n/* ---------------------------------------------------------------------------------------------- */", "url": "https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/Bitset.c#L196-L224", "sha": "8b81e76efe457b59be3a6e752efd43916ba0cabb"}3{"repo_name": "LenovoLegionLinux", "dataset": "github_2023", "owner": "johnfanv2", "lang": "c", "func_name": "eval_gbmd", "code": "static int eval_gbmd(acpi_handle handle, unsigned long *res)\n{\n\treturn eval_int(handle, \"VPC0.GBMD\", res);\n}", "docstring": "//static int eval_qcho(acpi_handle handle, unsigned long *res)\n//{\n//\t// \\_SB.PCI0.LPC0.EC0.QCHO\n//\treturn eval_int(handle, \"QCHO\", res);\n//}", "url": "https://github.com/johnfanv2/LenovoLegionLinux/blob/ae96a82adb879e729c5727c8769888b47ee1181f/kernel_module/legion-laptop.c#L1391-L1394", "sha": "ae96a82adb879e729c5727c8769888b47ee1181f"}4{"repo_name": "teddycloud", "dataset": "github_2023", "owner": "toniebox-reverse-engineering", "lang": "c", "func_name": "f_sync", "code": "FRESULT f_sync (\n\tFIL* fp\t\t/* Open file to be synced */\n)\n{\n\tFRESULT res;\n\tFATFS *fs;\n\tDWORD tm;\n\tBYTE *dir;\n\n\n\tres = validate(&fp->obj, &fs);\t/* Check validity of the file object */\n\tif (res == FR_OK) {\n\t\tif (fp->flag & FA_MODIFIED) {\t/* Is there any change to the file? */\n#if !FF_FS_TINY\n\t\t\tif (fp->flag & FA_DIRTY) {\t/* Write-back cached data if needed */\n\t\t\t\tif (disk_write(fs->pdrv, fp->buf, fp->sect, 1) != RES_OK) LEAVE_FF(fs, FR_DISK_ERR);\n\t\t\t\tfp->flag &= (BYTE)~FA_DIRTY;\n\t\t\t}\n#endif\n\t\t\t/* Update the directory entry */\n\t\t\ttm = GET_FATTIME();\t\t\t\t/* Modified time */\n#if FF_FS_EXFAT\n\t\t\tif (fs->fs_type == FS_EXFAT) {\n\t\t\t\tres = fill_first_frag(&fp->obj);\t/* Fill first fragment on the FAT if needed */\n\t\t\t\tif (res == FR_OK) {\n\t\t\t\t\tres = fill_last_frag(&fp->obj, fp->clust, 0xFFFFFFFF);\t/* Fill last fragment on the FAT if needed */\n\t\t\t\t}\n\t\t\t\tif (res == FR_OK) {\n\t\t\t\t\tDIR dj;\n\t\t\t\t\tDEF_NAMBUF\n\n\t\t\t\t\tINIT_NAMBUF(fs);\n\t\t\t\t\tres = load_obj_xdir(&dj, &fp->obj);\t/* Load directory entry block */\n\t\t\t\t\tif (res == FR_OK) {\n\t\t\t\t\t\tfs->dirbuf[XDIR_Attr] |= AM_ARC;\t\t\t\t/* Set archive attribute to indicate that the file has been changed */\n\t\t\t\t\t\tfs->dirbuf[XDIR_GenFlags] = fp->obj.stat | 1;\t/* Update file allocation information */\n\t\t\t\t\t\tst_dword(fs->dirbuf + XDIR_FstClus, fp->obj.sclust);\t\t/* Update start cluster */\n\t\t\t\t\t\tst_qword(fs->dirbuf + XDIR_FileSize, fp->obj.objsize);\t\t/* Update file size */\n\t\t\t\t\t\tst_qword(fs->dirbuf + XDIR_ValidFileSize, fp->obj.objsize);\t/* (FatFs does not support Valid File Size feature) */\n\t\t\t\t\t\tst_dword(fs->dirbuf + XDIR_ModTime, tm);\t\t/* Update modified time */\n\t\t\t\t\t\tfs->dirbuf[XDIR_ModTime10] = 0;\n\t\t\t\t\t\tst_dword(fs->dirbuf + XDIR_AccTime, 0);\n\t\t\t\t\t\tres = store_xdir(&dj);\t/* Restore it to the directory */\n\t\t\t\t\t\tif (res == FR_OK) {\n\t\t\t\t\t\t\tres = sync_fs(fs);\n\t\t\t\t\t\t\tfp->flag &= (BYTE)~FA_MODIFIED;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tFREE_NAMBUF();\n\t\t\t\t}\n\t\t\t} else\n#endif\n\t\t\t{\n\t\t\t\tres = move_window(fs, fp->dir_sect);\n\t\t\t\tif (res == FR_OK) {\n\t\t\t\t\tdir = fp->dir_ptr;\n\t\t\t\t\tdir[DIR_Attr] |= AM_ARC;\t\t\t\t\t\t/* Set archive attribute to indicate that the file has been changed */\n\t\t\t\t\tst_clust(fp->obj.fs, dir, fp->obj.sclust);\t\t/* Update file allocation information  */\n\t\t\t\t\tst_dword(dir + DIR_FileSize, (DWORD)fp->obj.objsize);\t/* Update file size */\n\t\t\t\t\tst_dword(dir + DIR_ModTime, tm);\t\t\t\t/* Update modified time */\n\t\t\t\t\tst_word(dir + DIR_LstAccDate, 0);\n\t\t\t\t\tfs->wflag = 1;\n\t\t\t\t\tres = sync_fs(fs);\t\t\t\t\t/* Restore it to the directory */\n\t\t\t\t\tfp->flag &= (BYTE)~FA_MODIFIED;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tLEAVE_FF(fs, res);\n}", "docstring": "/*-----------------------------------------------------------------------*/\n/* Synchronize the File                                                  */\n/*-----------------------------------------------------------------------*/", "url": "https://github.com/toniebox-reverse-engineering/teddycloud/blob/83d3b29cbfc74e8f76f48f8782646c8e464055b2/fat/source/ff.c#L4135-L4205", "sha": "83d3b29cbfc74e8f76f48f8782646c8e464055b2"}5{"repo_name": "teddycloud", "dataset": "github_2023", "owner": "toniebox-reverse-engineering", "lang": "c", "func_name": "putc_bfd", "code": "static void putc_bfd (putbuff* pb, TCHAR c)\n{\n\tUINT n;\n\tint i, nc;\n#if FF_USE_LFN && FF_LFN_UNICODE\n\tWCHAR hs, wc;\n#if FF_LFN_UNICODE == 2\n\tDWORD dc;\n\tconst TCHAR* tp;\n#endif\n#endif\n\n\tif (FF_USE_STRFUNC == 2 && c == '\\n') {\t /* LF -> CRLF conversion */\n\t\tputc_bfd(pb, '\\r');\n\t}\n\n\ti = pb->idx;\t\t\t/* Write index of pb->buf[] */\n\tif (i < 0) return;\t\t/* In write error? */\n\tnc = pb->nchr;\t\t\t/* Write unit counter */\n\n#if FF_USE_LFN && FF_LFN_UNICODE\n#if FF_LFN_UNICODE == 1\t\t/* UTF-16 input */\n\tif (IsSurrogateH(c)) {\t/* Is this a high-surrogate? */\n\t\tpb->hs = c; return;\t/* Save it for next */\n\t}\n\ths = pb->hs; pb->hs = 0;\n\tif (hs != 0) {\t\t\t/* Is there a leading high-surrogate? */\n\t\tif (!IsSurrogateL(c)) hs = 0;\t/* Discard high-surrogate if not a surrogate pair */\n\t} else {\n\t\tif (IsSurrogateL(c)) return;\t/* Discard stray low-surrogate */\n\t}\n\twc = c;\n#elif FF_LFN_UNICODE == 2\t/* UTF-8 input */\n\tfor (;;) {\n\t\tif (pb->ct == 0) {\t/* Out of multi-byte sequence? */\n\t\t\tpb->bs[pb->wi = 0] = (BYTE)c;\t/* Save 1st byte */\n\t\t\tif ((BYTE)c < 0x80) break;\t\t\t\t\t/* Single byte code? */\n\t\t\tif (((BYTE)c & 0xE0) == 0xC0) pb->ct = 1;\t/* 2-byte sequence? */\n\t\t\tif (((BYTE)c & 0xF0) == 0xE0) pb->ct = 2;\t/* 3-byte sequence? */\n\t\t\tif (((BYTE)c & 0xF8) == 0xF0) pb->ct = 3;\t/* 4-byte sequence? */\n\t\t\treturn;\t\t\t\t\t\t\t\t\t\t/* Wrong leading byte (discard it) */\n\t\t} else {\t\t\t\t/* In the multi-byte sequence */\n\t\t\tif (((BYTE)c & 0xC0) != 0x80) {\t/* Broken sequence? */\n\t\t\t\tpb->ct = 0; continue;\t\t/* Discard the sequense */\n\t\t\t}\n\t\t\tpb->bs[++pb->wi] = (BYTE)c;\t/* Save the trailing byte */\n\t\t\tif (--pb->ct == 0) break;\t/* End of the sequence? */\n\t\t\treturn;\n\t\t}\n\t}\n\ttp = (const TCHAR*)pb->bs;\n\tdc = tchar2uni(&tp);\t\t\t/* UTF-8 ==> UTF-16 */\n\tif (dc == 0xFFFFFFFF) return;\t/* Wrong code? */\n\ths = (WCHAR)(dc >> 16);\n\twc = (WCHAR)dc;\n#elif FF_LFN_UNICODE == 3\t/* UTF-32 input */\n\tif (IsSurrogate(c) || c >= 0x110000) return;\t/* Discard invalid code */\n\tif (c >= 0x10000) {\t\t/* Out of BMP? */\n\t\ths = (WCHAR)(0xD800 | ((c >> 10) - 0x40)); \t/* Make high surrogate */\n\t\twc = 0xDC00 | (c & 0x3FF);\t\t\t\t\t/* Make low surrogate */\n\t} else {\n\t\ths = 0;\n\t\twc = (WCHAR)c;\n\t}\n#endif\n\t/* A code point in UTF-16 is available in hs and wc */\n\n#if FF_STRF_ENCODE == 1\t\t/* Write a code point in UTF-16LE */\n\tif (hs != 0) {\t/* Surrogate pair? */\n\t\tst_word(&pb->buf[i], hs);\n\t\ti += 2;\n\t\tnc++;\n\t}\n\tst_word(&pb->buf[i], wc);\n\ti += 2;\n#elif FF_STRF_ENCODE == 2\t/* Write a code point in UTF-16BE */\n\tif (hs != 0) {\t/* Surrogate pair? */\n\t\tpb->buf[i++] = (BYTE)(hs >> 8);\n\t\tpb->buf[i++] = (BYTE)hs;\n\t\tnc++;\n\t}\n\tpb->buf[i++] = (BYTE)(wc >> 8);\n\tpb->buf[i++] = (BYTE)wc;\n#elif FF_STRF_ENCODE == 3\t/* Write a code point in UTF-8 */\n\tif (hs != 0) {\t/* 4-byte sequence? */\n\t\tnc += 3;\n\t\ths = (hs & 0x3FF) + 0x40;\n\t\tpb->buf[i++] = (BYTE)(0xF0 | hs >> 8);\n\t\tpb->buf[i++] = (BYTE)(0x80 | (hs >> 2 & 0x3F));\n\t\tpb->buf[i++] = (BYTE)(0x80 | (hs & 3) << 4 | (wc >> 6 & 0x0F));\n\t\tpb->buf[i++] = (BYTE)(0x80 | (wc & 0x3F));\n\t} else {\n\t\tif (wc < 0x80) {\t/* Single byte? */\n\t\t\tpb->buf[i++] = (BYTE)wc;\n\t\t} else {\n\t\t\tif (wc < 0x800) {\t/* 2-byte sequence? */\n\t\t\t\tnc += 1;\n\t\t\t\tpb->buf[i++] = (BYTE)(0xC0 | wc >> 6);\n\t\t\t} else {\t\t\t/* 3-byte sequence */\n\t\t\t\tnc += 2;\n\t\t\t\tpb->buf[i++] = (BYTE)(0xE0 | wc >> 12);\n\t\t\t\tpb->buf[i++] = (BYTE)(0x80 | (wc >> 6 & 0x3F));\n\t\t\t}\n\t\t\tpb->buf[i++] = (BYTE)(0x80 | (wc & 0x3F));\n\t\t}\n\t}\n#else\t\t\t\t\t\t/* Write a code point in ANSI/OEM */\n\tif (hs != 0) return;\n\twc = ff_uni2oem(wc, CODEPAGE);\t/* UTF-16 ==> ANSI/OEM */\n\tif (wc == 0) return;\n\tif (wc >= 0x100) {\n\t\tpb->buf[i++] = (BYTE)(wc >> 8); nc++;\n\t}\n\tpb->buf[i++] = (BYTE)wc;\n#endif\n\n#else\t\t\t\t\t\t\t/* ANSI/OEM input (without re-encoding) */\n\tpb->buf[i++] = (BYTE)c;\n#endif\n\n\tif (i >= (int)(sizeof pb->buf) - 4) {\t/* Write buffered characters to the file */\n\t\tf_write(pb->fp, pb->buf, (UINT)i, &n);\n\t\ti = (n == (UINT)i) ? 0 : -1;\n\t}\n\tpb->idx = i;\n\tpb->nchr = nc + 1;\n}", "docstring": "/* Buffered file write with code conversion */", "url": "https://github.com/toniebox-reverse-engineering/teddycloud/blob/83d3b29cbfc74e8f76f48f8782646c8e464055b2/fat/source/ff.c#L6578-L6704", "sha": "83d3b29cbfc74e8f76f48f8782646c8e464055b2"}6{"repo_name": "flipper-zero-tutorials", "dataset": "github_2023", "owner": "jamisonderek", "lang": "c", "func_name": "gpio_7segment_disconnect_pin", "code": "void gpio_7segment_disconnect_pin(const GpioPin* pin) {\n    furi_hal_gpio_init(pin, GpioModeOutputOpenDrain, GpioPullNo, GpioSpeedLow);\n    furi_hal_gpio_write(pin, true);\n}", "docstring": "// Disconnects a GpioPin via OutputOpenDrive, PushPullNo, output true.\n// @pin pointer to GpioPin to disconnect.", "url": "https://github.com/jamisonderek/flipper-zero-tutorials/blob/89716a9b00eacce7055a75fddb5a3adde93f265f/gpio/gpio_7segment/gpio_7segment_app.c#L171-L174", "sha": "89716a9b00eacce7055a75fddb5a3adde93f265f"}7{"repo_name": "flipper-zero-tutorials", "dataset": "github_2023", "owner": "jamisonderek", "lang": "c", "func_name": "rgbleds_reset", "code": "void rgbleds_reset(RgbLeds* leds) {\n    for(int i = 0; i < leds->num_leds; i++) {\n        leds->color[i] = 0x000000;\n    }\n}", "docstring": "/**\n * @brief Resets the LEDs to their default color pattern (off).\n * @details This method resets the LEDs data to their default color pattern (off).\n * You must still call rgbleds_update to update the LEDs.\n * @param leds The RgbLeds struct to reset.\n*/", "url": "https://github.com/jamisonderek/flipper-zero-tutorials/blob/89716a9b00eacce7055a75fddb5a3adde93f265f/js/flipboard/modules/js_rgbleds/rgbleds.c#L52-L56", "sha": "89716a9b00eacce7055a75fddb5a3adde93f265f"}8{"repo_name": "SBEMU", "dataset": "github_2023", "owner": "crazii", "lang": "c", "func_name": "ct_timer_interrupt", "code": "static void ct_timer_interrupt(void *data, unsigned int status)\n{\n\tstruct ct_timer *timer = data;\n\n\t/* Interval timer interrupt */\n\tif ((status & IT_INT) && timer->ops->interrupt)\n\t\ttimer->ops->interrupt(timer);\n}", "docstring": "/*\n * timer manager\n */", "url": "https://github.com/crazii/SBEMU/blob/f0cbde063396deb2c1246c9b3108a37755c68e9a/drivers/ctxfi/cttimer.c#L405-L412", "sha": "f0cbde063396deb2c1246c9b3108a37755c68e9a"}9{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "c", "func_name": "curlx_uztosi", "code": "int curlx_uztosi(size_t uznum)\n{\n#ifdef __INTEL_COMPILER\n#  pragma warning(push)\n#  pragma warning(disable:810) /* conversion may lose significant bits */\n#endif\n\n  DEBUGASSERT(uznum <= (size_t) CURL_MASK_SINT);\n  return (int)(uznum & (size_t) CURL_MASK_SINT);\n\n#ifdef __INTEL_COMPILER\n#  pragma warning(pop)\n#endif\n}", "docstring": "/*\n** unsigned size_t to signed int\n*/", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/lib/warnless.c#L181-L194", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}10{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "c", "func_name": "Curl_ipvalid", "code": "bool Curl_ipvalid(struct connectdata *conn)\n{\n  if(conn->ip_version == CURL_IPRESOLVE_V6)\n    return Curl_ipv6works();\n  return TRUE;\n}", "docstring": "/*\n * Curl_ipvalid() checks what CURL_IPRESOLVE_* requirements that might've\n * been set and returns TRUE if they are OK.\n */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/lib/hostip6.c#L126-L131", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}11{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "c", "func_name": "Curl_infof", "code": "void Curl_infof(struct SessionHandle *data, const char *fmt, ...)\n{\n  if(data && data->set.verbose) {\n    va_list ap;\n    size_t len;\n    char print_buffer[2048 + 1];\n    va_start(ap, fmt);\n    vsnprintf(print_buffer, sizeof(print_buffer), fmt, ap);\n    va_end(ap);\n    len = strlen(print_buffer);\n    Curl_debug(data, CURLINFO_TEXT, print_buffer, len, NULL);\n  }\n}", "docstring": "/* CURL_DO_LINEEND_CONV */\n/* Curl_infof() is for info message along the way */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/lib/sendf.c#L136-L148", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}12{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "c", "func_name": "Curl_single_getsock", "code": "int Curl_single_getsock(const struct connectdata *conn,\n                        curl_socket_t *sock, /* points to numsocks number\n                                                of sockets */\n                        int numsocks)\n{\n  const struct SessionHandle *data = conn->data;\n  int bitmap = GETSOCK_BLANK;\n  unsigned sockindex = 0;\n\n  if(conn->handler->perform_getsock)\n    return conn->handler->perform_getsock(conn, sock, numsocks);\n\n  if(numsocks < 2)\n    /* simple check but we might need two slots */\n    return GETSOCK_BLANK;\n\n  /* don't include HOLD and PAUSE connections */\n  if((data->req.keepon & KEEP_RECVBITS) == KEEP_RECV) {\n\n    DEBUGASSERT(conn->sockfd != CURL_SOCKET_BAD);\n\n    bitmap |= GETSOCK_READSOCK(sockindex);\n    sock[sockindex] = conn->sockfd;\n  }\n\n  /* don't include HOLD and PAUSE connections */\n  if((data->req.keepon & KEEP_SENDBITS) == KEEP_SEND) {\n\n    if((conn->sockfd != conn->writesockfd) ||\n       !(data->req.keepon & KEEP_RECV)) {\n      /* only if they are not the same socket or we didn't have a readable\n         one, we increase index */\n      if(data->req.keepon & KEEP_RECV)\n        sockindex++; /* increase index if we need two entries */\n\n      DEBUGASSERT(conn->writesockfd != CURL_SOCKET_BAD);\n\n      sock[sockindex] = conn->writesockfd;\n    }\n\n    bitmap |= GETSOCK_WRITESOCK(sockindex);\n  }\n\n  return bitmap;\n}", "docstring": "/*\n * Curl_single_getsock() gets called by the multi interface code when the app\n * has requested to get the sockets for the current connection. This function\n * will then be called once for every connection that the multi interface\n * keeps track of. This function will only be called for connections that are\n * in the proper state to have this information available.\n */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/lib/transfer.c#L1148-L1192", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}13{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "c", "func_name": "Curl_close", "code": "CURLcode Curl_close(struct SessionHandle *data)\n{\n  struct Curl_multi *m;\n\n  if(!data)\n    return CURLE_OK;\n\n  Curl_expire(data, 0); /* shut off timers */\n\n  m = data->multi;\n\n  if(m)\n    /* This handle is still part of a multi handle, take care of this first\n       and detach this handle from there. */\n    curl_multi_remove_handle(data->multi, data);\n\n  if(data->multi_easy)\n    /* when curl_easy_perform() is used, it creates its own multi handle to\n       use and this is the one */\n    curl_multi_cleanup(data->multi_easy);\n\n  /* Destroy the timeout list that is held in the easy handle. It is\n     /normally/ done by curl_multi_remove_handle() but this is \"just in\n     case\" */\n  if(data->state.timeoutlist) {\n    Curl_llist_destroy(data->state.timeoutlist, NULL);\n    data->state.timeoutlist = NULL;\n  }\n\n  data->magic = 0; /* force a clear AFTER the possibly enforced removal from\n                      the multi handle, since that function uses the magic\n                      field! */\n\n  if(data->state.rangestringalloc)\n    free(data->state.range);\n\n  /* Free the pathbuffer */\n  Curl_safefree(data->state.pathbuffer);\n  data->state.path = NULL;\n\n  Curl_safefree(data->state.proto.generic);\n\n  /* Close down all open SSL info and sessions */\n  Curl_ssl_close_all(data);\n  Curl_safefree(data->state.first_host);\n  Curl_safefree(data->state.scratch);\n  Curl_ssl_free_certinfo(data);\n\n  if(data->change.referer_alloc) {\n    Curl_safefree(data->change.referer);\n    data->change.referer_alloc = FALSE;\n  }\n  data->change.referer = NULL;\n\n  if(data->change.url_alloc) {\n    Curl_safefree(data->change.url);\n    data->change.url_alloc = FALSE;\n  }\n  data->change.url = NULL;\n\n  Curl_safefree(data->state.headerbuff);\n\n  Curl_flush_cookies(data, 1);\n\n  Curl_digest_cleanup(data);\n\n  Curl_safefree(data->info.contenttype);\n  Curl_safefree(data->info.wouldredirect);\n\n  /* this destroys the channel and we cannot use it anymore after this */\n  Curl_resolver_cleanup(data->state.resolver);\n\n  Curl_convert_close(data);\n\n  /* No longer a dirty share, if it exists */\n  if(data->share) {\n    Curl_share_lock(data, CURL_LOCK_DATA_SHARE, CURL_LOCK_ACCESS_SINGLE);\n    data->share->dirty--;\n    Curl_share_unlock(data, CURL_LOCK_DATA_SHARE);\n  }\n\n  Curl_freeset(data);\n  free(data);\n  return CURLE_OK;\n}", "docstring": "/*\n * This is the internal function curl_easy_cleanup() calls. This should\n * cleanup and free all resources associated with this sessionhandle.\n *\n * NOTE: if we ever add something that attempts to write to a socket or\n * similar here, we must ignore SIGPIPE first. It is currently only done\n * when curl_easy_perform() is invoked.\n */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/lib/url.c#L366-L450", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}14{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "c", "func_name": "get_request", "code": "static int get_request(curl_socket_t sock, struct httprequest *req)\n{\n  int error;\n  int fail = 0;\n  int done_processing = 0;\n  char *reqbuf = req->reqbuf;\n  ssize_t got = 0;\n\n  char *pipereq = NULL;\n  size_t pipereq_length = 0;\n\n  if(req->pipelining) {\n    pipereq = reqbuf + req->checkindex;\n    pipereq_length = req->offset - req->checkindex;\n  }\n\n  /*** Init the httprequest structure properly for the upcoming request ***/\n\n  req->checkindex = 0;\n  req->offset = 0;\n  req->testno = DOCNUMBER_NOTHING;\n  req->partno = 0;\n  req->open = TRUE;\n  req->auth_req = FALSE;\n  req->auth = FALSE;\n  req->cl = 0;\n  req->digest = FALSE;\n  req->ntlm = FALSE;\n  req->pipe = 0;\n  req->skip = 0;\n  req->rcmd = RCMD_NORMALREQ;\n  req->protocol = RPROT_NONE;\n  req->prot_version = 0;\n  req->pipelining = FALSE;\n  req->rtp_buffer = NULL;\n  req->rtp_buffersize = 0;\n\n  /*** end of httprequest init ***/\n\n  while(!done_processing && (req->offset < REQBUFSIZ-1)) {\n    if(pipereq_length && pipereq) {\n      memmove(reqbuf, pipereq, pipereq_length);\n      got = curlx_uztosz(pipereq_length);\n      pipereq_length = 0;\n    }\n    else {\n      if(req->skip)\n        /* we are instructed to not read the entire thing, so we make sure to only\n           read what we're supposed to and NOT read the enire thing the client\n           wants to send! */\n        got = sread(sock, reqbuf + req->offset, req->cl);\n      else\n        got = sread(sock, reqbuf + req->offset, REQBUFSIZ-1 - req->offset);\n    }\n    if(got_exit_signal)\n      return 1;\n    if(got == 0) {\n      logmsg(\"Connection closed by client\");\n      fail = 1;\n    }\n    else if(got < 0) {\n      error = SOCKERRNO;\n      logmsg(\"recv() returned error: (%d) %s\", error, strerror(error));\n      fail = 1;\n    }\n    if(fail) {\n      /* dump the request received so far to the external file */\n      reqbuf[req->offset] = '\\0';\n      storerequest(reqbuf, req->offset);\n      return 1;\n    }\n\n    logmsg(\"Read %zd bytes\", got);\n\n    req->offset += (size_t)got;\n    reqbuf[req->offset] = '\\0';\n\n    done_processing = ProcessRequest(req);\n    if(got_exit_signal)\n      return 1;\n    if(done_processing && req->pipe) {\n      logmsg(\"Waiting for another piped request\");\n      done_processing = 0;\n      req->pipe--;\n    }\n  }\n\n  if((req->offset == REQBUFSIZ-1) && (got > 0)) {\n    logmsg(\"Request would overflow buffer, closing connection\");\n    /* dump request received so far to external file anyway */\n    reqbuf[REQBUFSIZ-1] = '\\0';\n    fail = 1;\n  }\n  else if(req->offset > REQBUFSIZ-1) {\n    logmsg(\"Request buffer overflow, closing connection\");\n    /* dump request received so far to external file anyway */\n    reqbuf[REQBUFSIZ-1] = '\\0';\n    fail = 1;\n  }\n  else\n    reqbuf[req->offset] = '\\0';\n\n  /* dump the request to an external file */\n  storerequest(reqbuf, req->pipelining ? req->checkindex : req->offset);\n  if(got_exit_signal)\n    return 1;\n\n  return fail; /* return 0 on success */\n}", "docstring": "/* return 0 on success, non-zero on failure */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/tests/server/rtspd.c#L772-L880", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}15{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "c", "func_name": "pkey_cb", "code": "static int pkey_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,\n\t\t\t\t\t\t\tvoid *exarg)\n{\n\t/* Since the structure must still be valid use ASN1_OP_FREE_PRE */\n\tif(operation == ASN1_OP_FREE_PRE) {\n\t\tPKCS8_PRIV_KEY_INFO *key = (PKCS8_PRIV_KEY_INFO *)*pval;\n\t\tif (key->pkey->value.octet_string)\n\t\tOPENSSL_cleanse(key->pkey->value.octet_string->data,\n\t\t\tkey->pkey->value.octet_string->length);\n\t}\n\treturn 1;\n}", "docstring": "/* Minor tweak to operation: zero private key data */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/openssl/crypto/asn1/p8_pkey.c#L65-L76", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}16{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "c", "func_name": "asn1_do_lock", "code": "int asn1_do_lock(ASN1_VALUE **pval, int op, const ASN1_ITEM *it)\n\t{\n\tconst ASN1_AUX *aux;\n\tint *lck, ret;\n\tif ((it->itype != ASN1_ITYPE_SEQUENCE)\n\t   && (it->itype != ASN1_ITYPE_NDEF_SEQUENCE))\n\t\treturn 0;\n\taux = it->funcs;\n\tif (!aux || !(aux->flags & ASN1_AFLG_REFCOUNT))\n\t\treturn 0;\n\tlck = offset2ptr(*pval, aux->ref_offset);\n\tif (op == 0)\n\t\t{\n\t\t*lck = 1;\n\t\treturn 1;\n\t\t}\n\tret = CRYPTO_add(lck, op, aux->ref_lock);\n#ifdef REF_PRINT\n\tfprintf(stderr, \"%s: Reference Count: %d\\n\", it->sname, *lck);\n#endif\n#ifdef REF_CHECK\n\tif (ret < 0) \n\t\tfprintf(stderr, \"%s, bad reference count\\n\", it->sname);\n#endif\n\treturn ret;\n\t}", "docstring": "/* Do reference counting. The value 'op' decides what to do. \n * if it is +1 then the count is incremented. If op is 0 count is\n * set to 1. If op is -1 count is decremented and the return value\n * is the current refrence count or 0 if no reference count exists.\n */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/openssl/crypto/asn1/tasn_utl.c#L101-L126", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}17{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "c", "func_name": "TS_RESP_CTX_cleanup", "code": "static void TS_RESP_CTX_cleanup(TS_RESP_CTX *ctx)\n\t{\n\tTS_REQ_free(ctx->request);\n\tctx->request = NULL;\n\tTS_RESP_free(ctx->response);\n\tctx->response = NULL;\n\tTS_TST_INFO_free(ctx->tst_info);\n\tctx->tst_info = NULL;\n\t}", "docstring": "/* Cleans up the variable part of the context. */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/openssl/crypto/ts/ts_rsp_sign.c#L495-L503", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}18{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "c", "func_name": "X509_STORE_CTX_trusted_stack", "code": "void X509_STORE_CTX_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk)\n{\n\tctx->other_ctx = sk;\n\tctx->get_issuer = get_issuer_sk;\n}", "docstring": "/* Set alternative lookup method: just a STACK of trusted certificates.\n * This avoids X509_STORE nastiness where it isn't needed.\n */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/openssl/crypto/x509/x509_vfy.c#L2128-L2132", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}19{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "c", "func_name": "app_info_free", "code": "static void app_info_free(APP_INFO *inf)\n\t{\n\tif (--(inf->references) <= 0)\n\t\t{\n\t\tif (inf->next != NULL)\n\t\t\t{\n\t\t\tapp_info_free(inf->next);\n\t\t\t}\n\t\tOPENSSL_free(inf);\n\t\t}\n\t}", "docstring": "/* Valid iff num_disable > 0.\n                                            * CRYPTO_LOCK_MALLOC2 is locked\n                                            * exactly in this case (by the\n                                            * thread named in disabling_thread).\n                                            */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/openssl_android/crypto/mem_dbg.c#L145-L155", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}20{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "c", "func_name": "asn1_collate_primitive", "code": "static int asn1_collate_primitive(ASN1_STRING *a, ASN1_const_CTX *c)\n\t{\n\tASN1_STRING *os=NULL;\n\tBUF_MEM b;\n\tint num;\n\n\tb.length=0;\n\tb.max=0;\n\tb.data=NULL;\n\n\tif (a == NULL)\n\t\t{\n\t\tc->error=ERR_R_PASSED_NULL_PARAMETER;\n\t\tgoto err;\n\t\t}\n\n\tnum=0;\n\tfor (;;)\n\t\t{\n\t\tif (c->inf & 1)\n\t\t\t{\n\t\t\tc->eos=ASN1_const_check_infinite_end(&c->p,\n\t\t\t\t(long)(c->max-c->p));\n\t\t\tif (c->eos) break;\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tif (c->slen <= 0) break;\n\t\t\t}\n\n\t\tc->q=c->p;\n\t\tif (d2i_ASN1_bytes(&os,&c->p,c->max-c->p,c->tag,c->xclass)\n\t\t\t== NULL)\n\t\t\t{\n\t\t\tc->error=ERR_R_ASN1_LIB;\n\t\t\tgoto err;\n\t\t\t}\n\n\t\tif (!BUF_MEM_grow_clean(&b,num+os->length))\n\t\t\t{\n\t\t\tc->error=ERR_R_BUF_LIB;\n\t\t\tgoto err;\n\t\t\t}\n\t\tmemcpy(&(b.data[num]),os->data,os->length);\n\t\tif (!(c->inf & 1))\n\t\t\tc->slen-=(c->p-c->q);\n\t\tnum+=os->length;\n\t\t}\n\n\tif (!asn1_const_Finish(c)) goto err;\n\n\ta->length=num;\n\tif (a->data != NULL) OPENSSL_free(a->data);\n\ta->data=(unsigned char *)b.data;\n\tif (os != NULL) ASN1_STRING_free(os);\n\treturn(1);\nerr:\n\tASN1err(ASN1_F_ASN1_COLLATE_PRIMITIVE,c->error);\n\tif (os != NULL) ASN1_STRING_free(os);\n\tif (b.data != NULL) OPENSSL_free(b.data);\n\treturn(0);\n\t}", "docstring": "/* We are about to parse 0..n d2i_ASN1_bytes objects, we are to collapse\n * them into the one structure that is then returned */\n/* There have been a few bug fixes for this function from\n * Paul Keogh <paul.keogh@sse.ie>, many thanks to him */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/openssl_android/crypto/asn1/a_bytes.c#L252-L313", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}21{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "c", "func_name": "BN_POOL_init", "code": "static void BN_POOL_init(BN_POOL *p)\n\t{\n\tp->head = p->current = p->tail = NULL;\n\tp->used = p->size = 0;\n\t}", "docstring": "/***********/\n/* BN_POOL */\n/***********/", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/openssl_android/crypto/bn/bn_ctx.c#L360-L364", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}22{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "c", "func_name": "dynamic_data_ctx_free_func", "code": "static void dynamic_data_ctx_free_func(void *parent, void *ptr,\n\t\t\tCRYPTO_EX_DATA *ad, int idx, long argl, void *argp)\n\t{\n\tif(ptr)\n\t\t{\n\t\tdynamic_data_ctx *ctx = (dynamic_data_ctx *)ptr;\n\t\tif(ctx->dynamic_dso)\n\t\t\tDSO_free(ctx->dynamic_dso);\n\t\tif(ctx->DYNAMIC_LIBNAME)\n\t\t\tOPENSSL_free((void*)ctx->DYNAMIC_LIBNAME);\n\t\tif(ctx->engine_id)\n\t\t\tOPENSSL_free((void*)ctx->engine_id);\n\t\tif(ctx->dirs)\n\t\t\tsk_pop_free(ctx->dirs, int_free_str);\n\t\tOPENSSL_free(ctx);\n\t\t}\n\t}", "docstring": "/* Because our ex_data element may or may not get allocated depending on whether\n * a \"first-use\" occurs before the ENGINE is freed, we have a memory leak\n * problem to solve. We can't declare a \"new\" handler for the ex_data as we\n * don't want a dynamic_data_ctx in *all* ENGINE structures of all types (this\n * is a bug in the design of CRYPTO_EX_DATA). As such, we just declare a \"free\"\n * handler and that will get called if an ENGINE is being destroyed and there\n * was an ex_data element corresponding to our context type. */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/openssl_android/crypto/engine/eng_dyn.c#L164-L180", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}23{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "c", "func_name": "png_destroy_write_struct", "code": "void PNGAPI\npng_destroy_write_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr)\n{\n   png_debug(1, \"in png_destroy_write_struct\");\n\n   if (png_ptr_ptr != NULL)\n   {\n      png_structrp png_ptr = *png_ptr_ptr;\n\n      if (png_ptr != NULL) /* added in libpng 1.6.0 */\n      {\n         png_destroy_info_struct(png_ptr, info_ptr_ptr);\n\n         *png_ptr_ptr = NULL;\n         png_write_destroy(png_ptr);\n         png_destroy_png_struct(png_ptr);\n      }\n   }\n}", "docstring": "/* Free all memory used by the write.\n * In libpng 1.6.0 this API changed quietly to no longer accept a NULL value for\n * *png_ptr_ptr.  Prior to 1.6.0 it would accept such a value and it would free\n * the passed in info_structs but it would quietly fail to free any of the data\n * inside them.  In 1.6.0 it quietly does nothing (it has to be quiet because it\n * has no png_ptr.)\n */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/png/pngwrite.c#L900-L918", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}24{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "c", "func_name": "png_write_pHYs", "code": "void /* PRIVATE */\npng_write_pHYs(png_structrp png_ptr, png_uint_32 x_pixels_per_unit,\n    png_uint_32 y_pixels_per_unit,\n    int unit_type)\n{\n   png_byte buf[9];\n\n   png_debug(1, \"in png_write_pHYs\");\n\n   if (unit_type >= PNG_RESOLUTION_LAST)\n      png_warning(png_ptr, \"Unrecognized unit type for pHYs chunk\");\n\n   png_save_uint_32(buf, x_pixels_per_unit);\n   png_save_uint_32(buf + 4, y_pixels_per_unit);\n   buf[8] = (png_byte)unit_type;\n\n   png_write_complete_chunk(png_ptr, png_pHYs, buf, (png_size_t)9);\n}", "docstring": "/* Write the pHYs chunk */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/png/pngwutil.c#L1887-L1904", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}25{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "c", "func_name": "writepng_encode_image", "code": "int writepng_encode_image(mainprog_info *mainprog_ptr)\n{\n    png_structp png_ptr = (png_structp)mainprog_ptr->png_ptr;\n    png_infop info_ptr = (png_infop)mainprog_ptr->info_ptr;\n\n\n    /* as always, setjmp() must be called in every function that calls a\n     * PNG-writing libpng function */\n\n    if (setjmp(mainprog_ptr->jmpbuf)) {\n        png_destroy_write_struct(&png_ptr, &info_ptr);\n        mainprog_ptr->png_ptr = NULL;\n        mainprog_ptr->info_ptr = NULL;\n        return 2;\n    }\n\n\n    /* and now we just write the whole image; libpng takes care of interlacing\n     * for us */\n\n    png_write_image(png_ptr, mainprog_ptr->row_pointers);\n\n\n    /* since that's it, we also close out the end of the PNG file now--if we\n     * had any text or time info to write after the IDATs, second argument\n     * would be info_ptr, but we optimize slightly by sending NULL pointer: */\n\n    png_write_end(png_ptr, NULL);\n\n    return 0;\n}", "docstring": "/* returns 0 for success, 2 for libpng (longjmp) problem */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/png/contrib/gregbook/writepng.c#L259-L289", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}26{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "c", "func_name": "gpc_sRGB", "code": "static void\ngpc_sRGB(Pixel *out, const Pixel *in, const Background *back)\n{\n   (void)back;\n\n   out->r = isRGB(in->r);\n\n   if (in->g == in->r)\n   {\n      out->g = out->r;\n\n      if (in->b == in->r)\n         out->b = out->r;\n\n      else\n         out->b = isRGB(in->b);\n   }\n\n   else\n   {\n      out->g = isRGB(in->g);\n\n      if (in->b == in->r)\n         out->b = out->r;\n\n      else if (in->b == in->g)\n         out->b = out->g;\n\n      else\n         out->b = isRGB(in->b);\n   }\n\n   out->a = 255;\n}", "docstring": "/* 16-bit to 8-bit conversions */\n/* sRGB: convert linear components to sRGB, alpha := 255 */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/png/contrib/libtests/pngstest.c#L1598-L1631", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}27{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "c", "func_name": "is_leap", "code": "static int\nis_leap(int year)\n{\n    /* Cast year to unsigned.  The result is the same either way, but\n     * C can generate faster code for unsigned mod than for signed\n     * mod (especially for % 4 -- a good compiler should just grab\n     * the last 2 bits when the LHS is unsigned).\n     */\n    const unsigned int ayear = (unsigned int)year;\n    return ayear % 4 == 0 && (ayear % 100 != 0 || ayear % 400 == 0);\n}", "docstring": "/* year -> 1 if leap year, else 0. */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/python/Modules/datetimemodule.c#L176-L186", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}28{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "c", "func_name": "move_finalizers", "code": "static void\nmove_finalizers(PyGC_Head *unreachable, PyGC_Head *finalizers)\n{\n    PyGC_Head *gc;\n    PyGC_Head *next;\n\n    /* March over unreachable.  Move objects with finalizers into\n     * `finalizers`.\n     */\n    for (gc = unreachable->gc.gc_next; gc != unreachable; gc = next) {\n        PyObject *op = FROM_GC(gc);\n\n        assert(IS_TENTATIVELY_UNREACHABLE(op));\n        next = gc->gc.gc_next;\n\n        if (has_finalizer(op)) {\n            gc_list_move(gc, finalizers);\n            gc->gc.gc_refs = GC_REACHABLE;\n        }\n    }\n}", "docstring": "/* Move the objects in unreachable with __del__ methods into `finalizers`.\n * Objects moved into `finalizers` have gc_refs set to GC_REACHABLE; the\n * objects remaining in unreachable are left at GC_TENTATIVELY_UNREACHABLE.\n */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/python/Modules/gcmodule.c#L536-L556", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}29{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "c", "func_name": "sha_transform", "code": "static void\nsha_transform(SHAobject *sha_info)\n{\n    int i;\n    SHA_INT32 T, A, B, C, D, E, W[80], *WP;\n\n    memcpy(W, sha_info->data, sizeof(sha_info->data));\n    longReverse(W, (int)sizeof(sha_info->data), sha_info->Endianness);\n\n    for (i = 16; i < 80; ++i) {\n        W[i] = W[i-3] ^ W[i-8] ^ W[i-14] ^ W[i-16];\n\n        /* extra rotation fix */\n        W[i] = R32(W[i], 1);\n    }\n    A = sha_info->digest[0];\n    B = sha_info->digest[1];\n    C = sha_info->digest[2];\n    D = sha_info->digest[3];\n    E = sha_info->digest[4];\n    WP = W;\n#ifdef UNRAVEL\n    FA(1); FB(1); FC(1); FD(1); FE(1); FT(1); FA(1); FB(1); FC(1); FD(1);\n    FE(1); FT(1); FA(1); FB(1); FC(1); FD(1); FE(1); FT(1); FA(1); FB(1);\n    FC(2); FD(2); FE(2); FT(2); FA(2); FB(2); FC(2); FD(2); FE(2); FT(2);\n    FA(2); FB(2); FC(2); FD(2); FE(2); FT(2); FA(2); FB(2); FC(2); FD(2);\n    FE(3); FT(3); FA(3); FB(3); FC(3); FD(3); FE(3); FT(3); FA(3); FB(3);\n    FC(3); FD(3); FE(3); FT(3); FA(3); FB(3); FC(3); FD(3); FE(3); FT(3);\n    FA(4); FB(4); FC(4); FD(4); FE(4); FT(4); FA(4); FB(4); FC(4); FD(4);\n    FE(4); FT(4); FA(4); FB(4); FC(4); FD(4); FE(4); FT(4); FA(4); FB(4);\n    sha_info->digest[0] += E;\n    sha_info->digest[1] += T;\n    sha_info->digest[2] += A;\n    sha_info->digest[3] += B;\n    sha_info->digest[4] += C;\n#else /* !UNRAVEL */\n#ifdef UNROLL_LOOPS\n    FG(1); FG(1); FG(1); FG(1); FG(1); FG(1); FG(1); FG(1); FG(1); FG(1);\n    FG(1); FG(1); FG(1); FG(1); FG(1); FG(1); FG(1); FG(1); FG(1); FG(1);\n    FG(2); FG(2); FG(2); FG(2); FG(2); FG(2); FG(2); FG(2); FG(2); FG(2);\n    FG(2); FG(2); FG(2); FG(2); FG(2); FG(2); FG(2); FG(2); FG(2); FG(2);\n    FG(3); FG(3); FG(3); FG(3); FG(3); FG(3); FG(3); FG(3); FG(3); FG(3);\n    FG(3); FG(3); FG(3); FG(3); FG(3); FG(3); FG(3); FG(3); FG(3); FG(3);\n    FG(4); FG(4); FG(4); FG(4); FG(4); FG(4); FG(4); FG(4); FG(4); FG(4);\n    FG(4); FG(4); FG(4); FG(4); FG(4); FG(4); FG(4); FG(4); FG(4); FG(4);\n#else /* !UNROLL_LOOPS */\n    for (i =  0; i < 20; ++i) { FG(1); }\n    for (i = 20; i < 40; ++i) { FG(2); }\n    for (i = 40; i < 60; ++i) { FG(3); }\n    for (i = 60; i < 80; ++i) { FG(4); }\n#endif /* !UNROLL_LOOPS */\n    sha_info->digest[0] += A;\n    sha_info->digest[1] += B;\n    sha_info->digest[2] += C;\n    sha_info->digest[3] += D;\n    sha_info->digest[4] += E;\n#endif /* !UNRAVEL */\n}", "docstring": "/* do SHA transformation */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/python/Modules/shamodule.c#L160-L217", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}30{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "c", "func_name": "deflate_slow", "code": "local block_state deflate_slow(s, flush)\n    deflate_state *s;\n    int flush;\n{\n    IPos hash_head = NIL;    /* head of hash chain */\n    int bflush;              /* set if current block must be flushed */\n\n    /* Process the input block. */\n    for (;;) {\n        /* Make sure that we always have enough lookahead, except\n         * at the end of the input file. We need MAX_MATCH bytes\n         * for the next match, plus MIN_MATCH bytes to insert the\n         * string following the next match.\n         */\n        if (s->lookahead < MIN_LOOKAHEAD) {\n            fill_window(s);\n            if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {\n                return need_more;\n            }\n            if (s->lookahead == 0) break; /* flush the current block */\n        }\n\n        /* Insert the string window[strstart .. strstart+2] in the\n         * dictionary, and set hash_head to the head of the hash chain:\n         */\n        if (s->lookahead >= MIN_MATCH) {\n            INSERT_STRING(s, s->strstart, hash_head);\n        }\n\n        /* Find the longest match, discarding those <= prev_length.\n         */\n        s->prev_length = s->match_length, s->prev_match = s->match_start;\n        s->match_length = MIN_MATCH-1;\n\n        if (hash_head != NIL && s->prev_length < s->max_lazy_match &&\n            s->strstart - hash_head <= MAX_DIST(s)) {\n            /* To simplify the code, we prevent matches with the string\n             * of window index 0 (in particular we have to avoid a match\n             * of the string with itself at the start of the input file).\n             */\n            if (s->strategy != Z_HUFFMAN_ONLY && s->strategy != Z_RLE) {\n                s->match_length = longest_match (s, hash_head);\n            } else if (s->strategy == Z_RLE && s->strstart - hash_head == 1) {\n                s->match_length = longest_match_fast (s, hash_head);\n            }\n            /* longest_match() or longest_match_fast() sets match_start */\n\n            if (s->match_length <= 5 && (s->strategy == Z_FILTERED\n#if TOO_FAR <= 32767\n                || (s->match_length == MIN_MATCH &&\n                    s->strstart - s->match_start > TOO_FAR)\n#endif\n                )) {\n\n                /* If prev_match is also MIN_MATCH, match_start is garbage\n                 * but we will ignore the current match anyway.\n                 */\n                s->match_length = MIN_MATCH-1;\n            }\n        }\n        /* If there was a match at the previous step and the current\n         * match is not better, output the previous match:\n         */\n        if (s->prev_length >= MIN_MATCH && s->match_length <= s->prev_length) {\n            uInt max_insert = s->strstart + s->lookahead - MIN_MATCH;\n            /* Do not insert strings in hash table beyond this. */\n\n            check_match(s, s->strstart-1, s->prev_match, s->prev_length);\n\n            _tr_tally_dist(s, s->strstart -1 - s->prev_match,\n                           s->prev_length - MIN_MATCH, bflush);\n\n            /* Insert in hash table all strings up to the end of the match.\n             * strstart-1 and strstart are already inserted. If there is not\n             * enough lookahead, the last two strings are not inserted in\n             * the hash table.\n             */\n            s->lookahead -= s->prev_length-1;\n            s->prev_length -= 2;\n            do {\n                if (++s->strstart <= max_insert) {\n                    INSERT_STRING(s, s->strstart, hash_head);\n                }\n            } while (--s->prev_length != 0);\n            s->match_available = 0;\n            s->match_length = MIN_MATCH-1;\n            s->strstart++;\n\n            if (bflush) FLUSH_BLOCK(s, 0);\n\n        } else if (s->match_available) {\n            /* If there was no match at the previous position, output a\n             * single literal. If there was a match but the current match\n             * is longer, truncate the previous match to a single literal.\n             */\n            Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n            _tr_tally_lit(s, s->window[s->strstart-1], bflush);\n            if (bflush) {\n                FLUSH_BLOCK_ONLY(s, 0);\n            }\n            s->strstart++;\n            s->lookahead--;\n            if (s->strm->avail_out == 0) return need_more;\n        } else {\n            /* There is no previous match to compare with, wait for\n             * the next step to decide.\n             */\n            s->match_available = 1;\n            s->strstart++;\n            s->lookahead--;\n        }\n    }\n    Assert (flush != Z_NO_FLUSH, \"no flush?\");\n    if (s->match_available) {\n        Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n        _tr_tally_lit(s, s->window[s->strstart-1], bflush);\n        s->match_available = 0;\n    }\n    FLUSH_BLOCK(s, flush == Z_FINISH);\n    return flush == Z_FINISH ? finish_done : block_done;\n}", "docstring": "/* ===========================================================================\n * Same as above, but achieves better compression. We use a lazy\n * evaluation for matches: a match is finally adopted only if there is\n * no better match at the next window position.\n */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/python/Modules/zlib/deflate.c#L1554-L1674", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}31{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "c", "func_name": "int_print", "code": "static int\nint_print(PyIntObject *v, FILE *fp, int flags)\n     /* flags -- not used but required by interface */\n{\n    long int_val = v->ob_ival;\n    Py_BEGIN_ALLOW_THREADS\n    fprintf(fp, \"%ld\", int_val);\n    Py_END_ALLOW_THREADS\n    return 0;\n}", "docstring": "/* ARGSUSED */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/python/Objects/intobject.c#L442-L451", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}32{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "c", "func_name": "out_of_memory", "code": "LOCAL(void)\nout_of_memory (j_common_ptr cinfo, int which)\n/* Report an out-of-memory error and stop execution */\n/* If we compiled MEM_STATS support, report alloc requests before dying */\n{\n#ifdef MEM_STATS\n  cinfo->err->trace_level = 2;\t/* force self_destruct to report stats */\n#endif\n  ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, which);\n}", "docstring": "/* MEM_STATS */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/python_modules/tools/jpeg-6b/jmemmgr.c#L216-L225", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}33{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "c", "func_name": "checkTreePage", "code": "static int checkTreePage(\n  IntegrityCk *pCheck,  /* Context for the sanity check */\n  int iPage,            /* Page number of the page to check */\n  char *zParentContext, /* Parent context */\n  i64 *pnParentMinKey, \n  i64 *pnParentMaxKey\n){\n  MemPage *pPage;\n  int i, rc, depth, d2, pgno, cnt;\n  int hdr, cellStart;\n  int nCell;\n  u8 *data;\n  BtShared *pBt;\n  int usableSize;\n  char zContext[100];\n  char *hit = 0;\n  i64 nMinKey = 0;\n  i64 nMaxKey = 0;\n\n  sqlite3_snprintf(sizeof(zContext), zContext, \"Page %d: \", iPage);\n\n  /* Check that the page exists\n  */\n  pBt = pCheck->pBt;\n  usableSize = pBt->usableSize;\n  if( iPage==0 ) return 0;\n  if( checkRef(pCheck, iPage, zParentContext) ) return 0;\n  if( (rc = btreeGetPage(pBt, (Pgno)iPage, &pPage, 0))!=0 ){\n    checkAppendMsg(pCheck, zContext,\n       \"unable to get the page. error code=%d\", rc);\n    return 0;\n  }\n\n  /* Clear MemPage.isInit to make sure the corruption detection code in\n  ** btreeInitPage() is executed.  */\n  pPage->isInit = 0;\n  if( (rc = btreeInitPage(pPage))!=0 ){\n    assert( rc==SQLITE_CORRUPT );  /* The only possible error from InitPage */\n    checkAppendMsg(pCheck, zContext, \n                   \"btreeInitPage() returns error code %d\", rc);\n    releasePage(pPage);\n    return 0;\n  }\n\n  /* Check out all the cells.\n  */\n  depth = 0;\n  for(i=0; i<pPage->nCell && pCheck->mxErr; i++){\n    u8 *pCell;\n    u32 sz;\n    CellInfo info;\n\n    /* Check payload overflow pages\n    */\n    sqlite3_snprintf(sizeof(zContext), zContext,\n             \"On tree page %d cell %d: \", iPage, i);\n    pCell = findCell(pPage,i);\n    btreeParseCellPtr(pPage, pCell, &info);\n    sz = info.nData;\n    if( !pPage->intKey ) sz += (int)info.nKey;\n    /* For intKey pages, check that the keys are in order.\n    */\n    else if( i==0 ) nMinKey = nMaxKey = info.nKey;\n    else{\n      if( info.nKey <= nMaxKey ){\n        checkAppendMsg(pCheck, zContext, \n            \"Rowid %lld out of order (previous was %lld)\", info.nKey, nMaxKey);\n      }\n      nMaxKey = info.nKey;\n    }\n    assert( sz==info.nPayload );\n    if( (sz>info.nLocal) \n     && (&pCell[info.iOverflow]<=&pPage->aData[pBt->usableSize])\n    ){\n      int nPage = (sz - info.nLocal + usableSize - 5)/(usableSize - 4);\n      Pgno pgnoOvfl = get4byte(&pCell[info.iOverflow]);\n#ifndef SQLITE_OMIT_AUTOVACUUM\n      if( pBt->autoVacuum ){\n        checkPtrmap(pCheck, pgnoOvfl, PTRMAP_OVERFLOW1, iPage, zContext);\n      }\n#endif\n      checkList(pCheck, 0, pgnoOvfl, nPage, zContext);\n    }\n\n    /* Check sanity of left child page.\n    */\n    if( !pPage->leaf ){\n      pgno = get4byte(pCell);\n#ifndef SQLITE_OMIT_AUTOVACUUM\n      if( pBt->autoVacuum ){\n        checkPtrmap(pCheck, pgno, PTRMAP_BTREE, iPage, zContext);\n      }\n#endif\n      d2 = checkTreePage(pCheck, pgno, zContext, &nMinKey, i==0 ? NULL : &nMaxKey);\n      if( i>0 && d2!=depth ){\n        checkAppendMsg(pCheck, zContext, \"Child page depth differs\");\n      }\n      depth = d2;\n    }\n  }\n\n  if( !pPage->leaf ){\n    pgno = get4byte(&pPage->aData[pPage->hdrOffset+8]);\n    sqlite3_snprintf(sizeof(zContext), zContext, \n                     \"On page %d at right child: \", iPage);\n#ifndef SQLITE_OMIT_AUTOVACUUM\n    if( pBt->autoVacuum ){\n      checkPtrmap(pCheck, pgno, PTRMAP_BTREE, iPage, zContext);\n    }\n#endif\n    checkTreePage(pCheck, pgno, zContext, NULL, !pPage->nCell ? NULL : &nMaxKey);\n  }\n \n  /* For intKey leaf pages, check that the min/max keys are in order\n  ** with any left/parent/right pages.\n  */\n  if( pPage->leaf && pPage->intKey ){\n    /* if we are a left child page */\n    if( pnParentMinKey ){\n      /* if we are the left most child page */\n      if( !pnParentMaxKey ){\n        if( nMaxKey > *pnParentMinKey ){\n          checkAppendMsg(pCheck, zContext, \n              \"Rowid %lld out of order (max larger than parent min of %lld)\",\n              nMaxKey, *pnParentMinKey);\n        }\n      }else{\n        if( nMinKey <= *pnParentMinKey ){\n          checkAppendMsg(pCheck, zContext, \n              \"Rowid %lld out of order (min less than parent min of %lld)\",\n              nMinKey, *pnParentMinKey);\n        }\n        if( nMaxKey > *pnParentMaxKey ){\n          checkAppendMsg(pCheck, zContext, \n              \"Rowid %lld out of order (max larger than parent max of %lld)\",\n              nMaxKey, *pnParentMaxKey);\n        }\n        *pnParentMinKey = nMaxKey;\n      }\n    /* else if we're a right child page */\n    } else if( pnParentMaxKey ){\n      if( nMinKey <= *pnParentMaxKey ){\n        checkAppendMsg(pCheck, zContext, \n            \"Rowid %lld out of order (min less than parent max of %lld)\",\n            nMinKey, *pnParentMaxKey);\n      }\n    }\n  }\n\n  /* Check for complete coverage of the page\n  */\n  data = pPage->aData;\n  hdr = pPage->hdrOffset;\n  hit = sqlite3PageMalloc( pBt->pageSize );\n  if( hit==0 ){\n    pCheck->mallocFailed = 1;\n  }else{\n    u16 contentOffset = get2byte(&data[hdr+5]);\n    assert( contentOffset<=usableSize );  /* Enforced by btreeInitPage() */\n    memset(hit+contentOffset, 0, usableSize-contentOffset);\n    memset(hit, 1, contentOffset);\n    nCell = get2byte(&data[hdr+3]);\n    cellStart = hdr + 12 - 4*pPage->leaf;\n    for(i=0; i<nCell; i++){\n      int pc = get2byte(&data[cellStart+i*2]);\n      u16 size = 1024;\n      int j;\n      if( pc<=usableSize-4 ){\n        size = cellSizePtr(pPage, &data[pc]);\n      }\n      if( (pc+size-1)>=usableSize ){\n        checkAppendMsg(pCheck, 0, \n            \"Corruption detected in cell %d on page %d\",i,iPage);\n      }else{\n        for(j=pc+size-1; j>=pc; j--) hit[j]++;\n      }\n    }\n    i = get2byte(&data[hdr+1]);\n    while( i>0 ){\n      int size, j;\n      assert( i<=usableSize-4 );     /* Enforced by btreeInitPage() */\n      size = get2byte(&data[i+2]);\n      assert( i+size<=usableSize );  /* Enforced by btreeInitPage() */\n      for(j=i+size-1; j>=i; j--) hit[j]++;\n      j = get2byte(&data[i]);\n      assert( j==0 || j>i+size );  /* Enforced by btreeInitPage() */\n      assert( j<=usableSize-4 );   /* Enforced by btreeInitPage() */\n      i = j;\n    }\n    for(i=cnt=0; i<usableSize; i++){\n      if( hit[i]==0 ){\n        cnt++;\n      }else if( hit[i]>1 ){\n        checkAppendMsg(pCheck, 0,\n          \"Multiple uses for byte %d of page %d\", i, iPage);\n        break;\n      }\n    }\n    if( cnt!=data[hdr+7] ){\n      checkAppendMsg(pCheck, 0, \n          \"Fragmentation of %d bytes reported as %d on page %d\",\n          cnt, data[hdr+7], iPage);\n    }\n  }\n  sqlite3PageFree(hit);\n  releasePage(pPage);\n  return depth+1;\n}", "docstring": "/*\n** Do various sanity checks on a single page of a tree.  Return\n** the tree depth.  Root pages return 0.  Parents of root pages\n** return 1, and so forth.\n** \n** These checks are done:\n**\n**      1.  Make sure that cells and freeblocks do not overlap\n**          but combine to completely cover the page.\n**  NO  2.  Make sure cell keys are in order.\n**  NO  3.  Make sure no key is less than or equal to zLowerBound.\n**  NO  4.  Make sure no key is greater than or equal to zUpperBound.\n**      5.  Check the integrity of overflow pages.\n**      6.  Recursively call checkTreePage on all children.\n**      7.  Verify that the depth of all children is the same.\n**      8.  Make sure this page is at least 33% full or else it is\n**          the root of the tree.\n*/", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/sqlite/sqlite3.c#L45990-L46197", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}34{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "c", "func_name": "removeFromBlockedList", "code": "static void removeFromBlockedList(sqlite3 *db){\n  sqlite3 **pp;\n  assertMutexHeld();\n  for(pp=&sqlite3BlockedList; *pp; pp = &(*pp)->pNextBlocked){\n    if( *pp==db ){\n      *pp = (*pp)->pNextBlocked;\n      break;\n    }\n  }\n}", "docstring": "/*\n** Remove connection db from the blocked connections list. If connection\n** db is not currently a part of the list, this function is a no-op.\n*/", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/sqlite/sqlite3.c#L98900-L98909", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}35{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "c", "func_name": "fts3OffsetsFunc", "code": "static void fts3OffsetsFunc(\n  sqlite3_context *pContext,      /* SQLite function call context */\n  int nVal,                       /* Size of argument array */\n  sqlite3_value **apVal           /* Array of arguments */\n){\n  Fts3Cursor *pCsr;               /* Cursor handle passed through apVal[0] */\n\n  UNUSED_PARAMETER(nVal);\n\n  assert( nVal==1 );\n  if( fts3FunctionArg(pContext, \"offsets\", apVal[0], &pCsr) ) return;\n  assert( pCsr );\n  if( SQLITE_OK==fts3CursorSeek(pContext, pCsr) ){\n    sqlite3Fts3Offsets(pContext, pCsr);\n  }\n}", "docstring": "/*\n** Implementation of the offsets() function for FTS3\n*/", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/sqlite/sqlite3.c#L102042-L102057", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}36{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "c", "func_name": "deflatePending", "code": "int ZEXPORT deflatePending (strm, pending, bits)\n    unsigned *pending;\n    int *bits;\n    z_streamp strm;\n{\n    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;\n    if (pending != Z_NULL)\n        *pending = strm->state->pending;\n    if (bits != Z_NULL)\n        *bits = strm->state->bi_valid;\n    return Z_OK;\n}", "docstring": "/* ========================================================================= */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/zip/deflate.c#L450-L461", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}37{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "c", "func_name": "gen_bitlen", "code": "local void gen_bitlen(s, desc)\n    deflate_state *s;\n    tree_desc *desc;    /* the tree descriptor */\n{\n    ct_data *tree        = desc->dyn_tree;\n    int max_code         = desc->max_code;\n    const ct_data *stree = desc->stat_desc->static_tree;\n    const intf *extra    = desc->stat_desc->extra_bits;\n    int base             = desc->stat_desc->extra_base;\n    int max_length       = desc->stat_desc->max_length;\n    int h;              /* heap index */\n    int n, m;           /* iterate over the tree elements */\n    int bits;           /* bit length */\n    int xbits;          /* extra bits */\n    ush f;              /* frequency */\n    int overflow = 0;   /* number of elements with bit length too large */\n\n    for (bits = 0; bits <= MAX_BITS; bits++) s->bl_count[bits] = 0;\n\n    /* In a first pass, compute the optimal bit lengths (which may\n     * overflow in the case of the bit length tree).\n     */\n    tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */\n\n    for (h = s->heap_max+1; h < HEAP_SIZE; h++) {\n        n = s->heap[h];\n        bits = tree[tree[n].Dad].Len + 1;\n        if (bits > max_length) bits = max_length, overflow++;\n        tree[n].Len = (ush)bits;\n        /* We overwrite tree[n].Dad which is no longer needed */\n\n        if (n > max_code) continue; /* not a leaf node */\n\n        s->bl_count[bits]++;\n        xbits = 0;\n        if (n >= base) xbits = extra[n-base];\n        f = tree[n].Freq;\n        s->opt_len += (ulg)f * (bits + xbits);\n        if (stree) s->static_len += (ulg)f * (stree[n].Len + xbits);\n    }\n    if (overflow == 0) return;\n\n    Trace((stderr,\"\\nbit length overflow\\n\"));\n    /* This happens for example on obj2 and pic of the Calgary corpus */\n\n    /* Find the first bit length which could increase: */\n    do {\n        bits = max_length-1;\n        while (s->bl_count[bits] == 0) bits--;\n        s->bl_count[bits]--;      /* move one leaf down the tree */\n        s->bl_count[bits+1] += 2; /* move one overflow item as its brother */\n        s->bl_count[max_length]--;\n        /* The brother of the overflow item also moves one step up,\n         * but this does not affect bl_count[max_length]\n         */\n        overflow -= 2;\n    } while (overflow > 0);\n\n    /* Now recompute all bit lengths, scanning in increasing frequency.\n     * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n     * lengths instead of fixing only the wrong ones. This idea is taken\n     * from 'ar' written by Haruhiko Okumura.)\n     */\n    for (bits = max_length; bits != 0; bits--) {\n        n = s->bl_count[bits];\n        while (n != 0) {\n            m = s->heap[--h];\n            if (m > max_code) continue;\n            if ((unsigned) tree[m].Len != (unsigned) bits) {\n                Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n                s->opt_len += ((long)bits - (long)tree[m].Len)\n                              *(long)tree[m].Freq;\n                tree[m].Len = (ush)bits;\n            }\n            n--;\n        }\n    }\n}", "docstring": "/* ===========================================================================\n * Compute the optimal bit lengths for a tree and update the total bit length\n * for the current block.\n * IN assertion: the fields freq and dad are set, heap[heap_max] and\n *    above are the tree nodes sorted by increasing frequency.\n * OUT assertions: the field len is set to the optimal bit length, the\n *     array bl_count contains the frequencies for each bit length.\n *     The length opt_len is updated; static_len is also updated if stree is\n *     not null.\n */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/zip/trees.c#L488-L565", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}38{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "c", "func_name": "inflate_table9", "code": "int inflate_table9(type, lens, codes, table, bits, work)\ncodetype type;\nunsigned short FAR *lens;\nunsigned codes;\ncode FAR * FAR *table;\nunsigned FAR *bits;\nunsigned short FAR *work;\n{\n    unsigned len;               /* a code's length in bits */\n    unsigned sym;               /* index of code symbols */\n    unsigned min, max;          /* minimum and maximum code lengths */\n    unsigned root;              /* number of index bits for root table */\n    unsigned curr;              /* number of index bits for current table */\n    unsigned drop;              /* code bits to drop for sub-table */\n    int left;                   /* number of prefix codes available */\n    unsigned used;              /* code entries in table used */\n    unsigned huff;              /* Huffman code */\n    unsigned incr;              /* for incrementing code, index */\n    unsigned fill;              /* index for replicating entries */\n    unsigned low;               /* low bits for current root entry */\n    unsigned mask;              /* mask for low root bits */\n    code this;                  /* table entry for duplication */\n    code FAR *next;             /* next available space in table */\n    const unsigned short FAR *base;     /* base value table to use */\n    const unsigned short FAR *extra;    /* extra bits table to use */\n    int end;                    /* use base and extra for symbol > end */\n    unsigned short count[MAXBITS+1];    /* number of codes of each length */\n    unsigned short offs[MAXBITS+1];     /* offsets in table for each length */\n    static const unsigned short lbase[31] = { /* Length codes 257..285 base */\n        3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17,\n        19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115,\n        131, 163, 195, 227, 3, 0, 0};\n    static const unsigned short lext[31] = { /* Length codes 257..285 extra */\n        128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129,\n        130, 130, 130, 130, 131, 131, 131, 131, 132, 132, 132, 132,\n        133, 133, 133, 133, 144, 72, 78};\n    static const unsigned short dbase[32] = { /* Distance codes 0..31 base */\n        1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49,\n        65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073,\n        4097, 6145, 8193, 12289, 16385, 24577, 32769, 49153};\n    static const unsigned short dext[32] = { /* Distance codes 0..31 extra */\n        128, 128, 128, 128, 129, 129, 130, 130, 131, 131, 132, 132,\n        133, 133, 134, 134, 135, 135, 136, 136, 137, 137, 138, 138,\n        139, 139, 140, 140, 141, 141, 142, 142};\n\n    /*\n       Process a set of code lengths to create a canonical Huffman code.  The\n       code lengths are lens[0..codes-1].  Each length corresponds to the\n       symbols 0..codes-1.  The Huffman code is generated by first sorting the\n       symbols by length from short to long, and retaining the symbol order\n       for codes with equal lengths.  Then the code starts with all zero bits\n       for the first code of the shortest length, and the codes are integer\n       increments for the same length, and zeros are appended as the length\n       increases.  For the deflate format, these bits are stored backwards\n       from their more natural integer increment ordering, and so when the\n       decoding tables are built in the large loop below, the integer codes\n       are incremented backwards.\n\n       This routine assumes, but does not check, that all of the entries in\n       lens[] are in the range 0..MAXBITS.  The caller must assure this.\n       1..MAXBITS is interpreted as that code length.  zero means that that\n       symbol does not occur in this code.\n\n       The codes are sorted by computing a count of codes for each length,\n       creating from that a table of starting indices for each length in the\n       sorted table, and then entering the symbols in order in the sorted\n       table.  The sorted table is work[], with that space being provided by\n       the caller.\n\n       The length counts are used for other purposes as well, i.e. finding\n       the minimum and maximum length codes, determining if there are any\n       codes at all, checking for a valid set of lengths, and looking ahead\n       at length counts to determine sub-table sizes when building the\n       decoding tables.\n     */\n\n    /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */\n    for (len = 0; len <= MAXBITS; len++)\n        count[len] = 0;\n    for (sym = 0; sym < codes; sym++)\n        count[lens[sym]]++;\n\n    /* bound code lengths, force root to be within code lengths */\n    root = *bits;\n    for (max = MAXBITS; max >= 1; max--)\n        if (count[max] != 0) break;\n    if (root > max) root = max;\n    if (max == 0) return -1;            /* no codes! */\n    for (min = 1; min <= MAXBITS; min++)\n        if (count[min] != 0) break;\n    if (root < min) root = min;\n\n    /* check for an over-subscribed or incomplete set of lengths */\n    left = 1;\n    for (len = 1; len <= MAXBITS; len++) {\n        left <<= 1;\n        left -= count[len];\n        if (left < 0) return -1;        /* over-subscribed */\n    }\n    if (left > 0 && (type == CODES || max != 1))\n        return -1;                      /* incomplete set */\n\n    /* generate offsets into symbol table for each length for sorting */\n    offs[1] = 0;\n    for (len = 1; len < MAXBITS; len++)\n        offs[len + 1] = offs[len] + count[len];\n\n    /* sort symbols by length, by symbol order within each length */\n    for (sym = 0; sym < codes; sym++)\n        if (lens[sym] != 0) work[offs[lens[sym]]++] = (unsigned short)sym;\n\n    /*\n       Create and fill in decoding tables.  In this loop, the table being\n       filled is at next and has curr index bits.  The code being used is huff\n       with length len.  That code is converted to an index by dropping drop\n       bits off of the bottom.  For codes where len is less than drop + curr,\n       those top drop + curr - len bits are incremented through all values to\n       fill the table with replicated entries.\n\n       root is the number of index bits for the root table.  When len exceeds\n       root, sub-tables are created pointed to by the root entry with an index\n       of the low root bits of huff.  This is saved in low to check for when a\n       new sub-table should be started.  drop is zero when the root table is\n       being filled, and drop is root when sub-tables are being filled.\n\n       When a new sub-table is needed, it is necessary to look ahead in the\n       code lengths to determine what size sub-table is needed.  The length\n       counts are used for this, and so count[] is decremented as codes are\n       entered in the tables.\n\n       used keeps track of how many table entries have been allocated from the\n       provided *table space.  It is checked for LENS and DIST tables against\n       the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in\n       the initial root table size constants.  See the comments in inftree9.h\n       for more information.\n\n       sym increments through all symbols, and the loop terminates when\n       all codes of length max, i.e. all codes, have been processed.  This\n       routine permits incomplete codes, so another loop after this one fills\n       in the rest of the decoding tables with invalid code markers.\n     */\n\n    /* set up for code type */\n    switch (type) {\n    case CODES:\n        base = extra = work;    /* dummy value--not used */\n        end = 19;\n        break;\n    case LENS:\n        base = lbase;\n        base -= 257;\n        extra = lext;\n        extra -= 257;\n        end = 256;\n        break;\n    default:            /* DISTS */\n        base = dbase;\n        extra = dext;\n        end = -1;\n    }\n\n    /* initialize state for loop */\n    huff = 0;                   /* starting code */\n    sym = 0;                    /* starting code symbol */\n    len = min;                  /* starting code length */\n    next = *table;              /* current table to fill in */\n    curr = root;                /* current table index bits */\n    drop = 0;                   /* current bits to drop from code for index */\n    low = (unsigned)(-1);       /* trigger new sub-table when len > root */\n    used = 1U << root;          /* use root table entries */\n    mask = used - 1;            /* mask for comparing low */\n\n    /* check available table space */\n    if ((type == LENS && used >= ENOUGH_LENS) ||\n        (type == DISTS && used >= ENOUGH_DISTS))\n        return 1;\n\n    /* process all codes and make table entries */\n    for (;;) {\n        /* create table entry */\n        this.bits = (unsigned char)(len - drop);\n        if ((int)(work[sym]) < end) {\n            this.op = (unsigned char)0;\n            this.val = work[sym];\n        }\n        else if ((int)(work[sym]) > end) {\n            this.op = (unsigned char)(extra[work[sym]]);\n            this.val = base[work[sym]];\n        }\n        else {\n            this.op = (unsigned char)(32 + 64);         /* end of block */\n            this.val = 0;\n        }\n\n        /* replicate for those indices with low len bits equal to huff */\n        incr = 1U << (len - drop);\n        fill = 1U << curr;\n        do {\n            fill -= incr;\n            next[(huff >> drop) + fill] = this;\n        } while (fill != 0);\n\n        /* backwards increment the len-bit code huff */\n        incr = 1U << (len - 1);\n        while (huff & incr)\n            incr >>= 1;\n        if (incr != 0) {\n            huff &= incr - 1;\n            huff += incr;\n        }\n        else\n            huff = 0;\n\n        /* go to next symbol, update count, len */\n        sym++;\n        if (--(count[len]) == 0) {\n            if (len == max) break;\n            len = lens[work[sym]];\n        }\n\n        /* create new sub-table if needed */\n        if (len > root && (huff & mask) != low) {\n            /* if first time, transition to sub-tables */\n            if (drop == 0)\n                drop = root;\n\n            /* increment past last table */\n            next += 1U << curr;\n\n            /* determine length of next table */\n            curr = len - drop;\n            left = (int)(1 << curr);\n            while (curr + drop < max) {\n                left -= count[curr + drop];\n                if (left <= 0) break;\n                curr++;\n                left <<= 1;\n            }\n\n            /* check for enough space */\n            used += 1U << curr;\n            if ((type == LENS && used >= ENOUGH_LENS) ||\n                (type == DISTS && used >= ENOUGH_DISTS))\n                return 1;\n\n            /* point entry in root table to sub-table */\n            low = huff & mask;\n            (*table)[low].op = (unsigned char)curr;\n            (*table)[low].bits = (unsigned char)root;\n            (*table)[low].val = (unsigned short)(next - *table);\n        }\n    }\n\n    /*\n       Fill in rest of table for incomplete codes.  This loop is similar to the\n       loop above in incrementing huff for table indices.  It is assumed that\n       len is equal to curr + drop, so there is no loop needed to increment\n       through high index bits.  When the current sub-table is filled, the loop\n       drops back to the root table to fill in any remaining entries there.\n     */\n    this.op = (unsigned char)64;                /* invalid code marker */\n    this.bits = (unsigned char)(len - drop);\n    this.val = (unsigned short)0;\n    while (huff != 0) {\n        /* when done with sub-table, drop back to root table */\n        if (drop != 0 && (huff & mask) != low) {\n            drop = 0;\n            len = root;\n            next = *table;\n            curr = root;\n            this.bits = (unsigned char)len;\n        }\n\n        /* put invalid code marker in table */\n        next[huff >> drop] = this;\n\n        /* backwards increment the len-bit code huff */\n        incr = 1U << (len - 1);\n        while (huff & incr)\n            incr >>= 1;\n        if (incr != 0) {\n            huff &= incr - 1;\n            huff += incr;\n        }\n        else\n            huff = 0;\n    }\n\n    /* set return parameters */\n    *table += used;\n    *bits = root;\n    return 0;\n}", "docstring": "/*\n  If you use the zlib library in a product, an acknowledgment is welcome\n  in the documentation of your product. If for some reason you cannot\n  include such an acknowledgment, I would appreciate that you keep this\n  copyright string in the executable of your product.\n */\n/*\n   Build a set of tables to decode the provided canonical Huffman code.\n   The code lengths are lens[0..codes-1].  The result starts at *table,\n   whose indices are 0..2^bits-1.  work is a writable array of at least\n   lens shorts, which is used as a work area.  type is the type of code\n   to be generated, CODES, LENS, or DISTS.  On return, zero is success,\n   -1 is an invalid code, and +1 means that ENOUGH isn't enough.  table\n   on return points to the next available entry's address.  bits is the\n   requested root table index bits, and on return it is the actual root\n   table index bits.  It will differ if the request is greater than the\n   longest code or if it is less than the shortest code.\n */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/zip/contrib/infback9/inftree9.c#L32-L324", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}39{"repo_name": "audioFlux", "dataset": "github_2023", "owner": "libAudioFlux", "lang": "c", "func_name": "_conv_direct", "code": "static int _conv_direct(float *vArr1,int length1,float *vArr2,int length2, \n\t\t\t\tConvModeType mode,float *vArr3){\n\tint len=0;\n\tint start=0;\n\n\tif(mode==ConvMode_Full){\n\t\tlen=length1+length2-1;\n\t\tstart=-length2+1;\n\t\tfor(int i=start,n=0;i<length1;i++,n++){\n\t\t\tfor(int j=length2-1,k=i;j>=0;j--,k++){\n\t\t\t\tfloat _value=0;\n\n\t\t\t\tif(k>=0&&k<length1){\n\t\t\t\t\t_value=vArr1[k];\n\t\t\t\t}\n\t\t\t\tvArr3[n]+=_value*vArr2[j];\n\t\t\t}\n\t\t}\n\t}\n\telse{\n\t\tlen=length1;\n\t\tstart=length2/2-(length2&1?0:1);\n\t\tif(mode==ConvMode_Valid){\n\t\t\tlen=length1-length2+1;\n\t\t\tstart=0;\n\t\t}\n\n\t\t\n\t\tfor(int i=-start,n=0;i<len-start;i++,n++){\n\t\t\tfor(int j=length2-1,k=i;j>=0;j--,k++){\n\t\t\t\tfloat _value=0;\n\n\t\t\t\tif(k>=0&&k<length1){\n\t\t\t\t\t_value=vArr1[k];\n\t\t\t\t}\n\t\t\t\tvArr3[n]+=_value*vArr2[j];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn len;\n}", "docstring": "/***\n\tๅ…ณไบŽmode ไปฅvArr1ไธบๅ‡† N/M\n\tfull N+M-1\n\tsame N\n\tvalid N-M+1\n****/", "url": "https://github.com/libAudioFlux/audioFlux/blob/824f76d5f19d0358779e513d708a987e4fb9224e/src/dsp/conv_algorithm.c#L214-L255", "sha": "824f76d5f19d0358779e513d708a987e4fb9224e"}40{"repo_name": "fenster", "dataset": "github_2023", "owner": "zserge", "lang": "c", "func_name": "G_SecretExitLevel", "code": "void G_SecretExitLevel (void) \n{ \n    // IF NO WOLF3D LEVELS, NO SECRET EXIT!\n    if ( (gamemode == commercial)\n      && (W_CheckNumForName(\"map31\")<0))\n\tsecretexit = false;\n    else\n\tsecretexit = true; \n    gameaction = ga_completed; \n}", "docstring": "// Here's for the german edition.", "url": "https://github.com/zserge/fenster/blob/e700581dfb7956dd161aee44fc0cff0663e789a1/examples/doom-c/g_game.c#L1335-L1344", "sha": "e700581dfb7956dd161aee44fc0cff0663e789a1"}41{"repo_name": "fenster", "dataset": "github_2023", "owner": "zserge", "lang": "c", "func_name": "G_VanillaVersionCode", "code": "int G_VanillaVersionCode(void)\n{\n    switch (gameversion)\n    {\n        case exe_doom_1_2:\n            I_Error(\"Doom 1.2 does not have a version code!\");\n        case exe_doom_1_666:\n            return 106;\n        case exe_doom_1_7:\n            return 107;\n        case exe_doom_1_8:\n            return 108;\n        case exe_doom_1_9:\n        default:  // All other versions are variants on v1.9:\n            return 109;\n    }\n}", "docstring": "// Get the demo version code appropriate for the version set in gameversion.", "url": "https://github.com/zserge/fenster/blob/e700581dfb7956dd161aee44fc0cff0663e789a1/examples/doom-c/g_game.c#L2040-L2056", "sha": "e700581dfb7956dd161aee44fc0cff0663e789a1"}42{"repo_name": "fenster", "dataset": "github_2023", "owner": "zserge", "lang": "c", "func_name": "I_InitScale", "code": "void I_InitScale(byte *_src_buffer, byte *_dest_buffer, int _dest_pitch)\n{\n    src_buffer = _src_buffer;\n    dest_buffer = _dest_buffer;\n    dest_pitch = _dest_pitch;\n}", "docstring": "// Called to set the source and destination buffers before doing the\n// scale.", "url": "https://github.com/zserge/fenster/blob/e700581dfb7956dd161aee44fc0cff0663e789a1/examples/doom-c/i_scale.c#L61-L66", "sha": "e700581dfb7956dd161aee44fc0cff0663e789a1"}43{"repo_name": "fenster", "dataset": "github_2023", "owner": "zserge", "lang": "c", "func_name": "P_FindLowestCeilingSurrounding", "code": "fixed_t\nP_FindLowestCeilingSurrounding(sector_t* sec)\n{\n    int\t\t\ti;\n    line_t*\t\tcheck;\n    sector_t*\t\tother;\n    fixed_t\t\theight = INT_MAX;\n\t\n    for (i=0 ;i < sec->linecount ; i++)\n    {\n\tcheck = sec->lines[i];\n\tother = getNextSector(check,sec);\n\n\tif (!other)\n\t    continue;\n\n\tif (other->ceilingheight < height)\n\t    height = other->ceilingheight;\n    }\n    return height;\n}", "docstring": "//\n// FIND LOWEST CEILING IN THE SURROUNDING SECTORS\n//", "url": "https://github.com/zserge/fenster/blob/e700581dfb7956dd161aee44fc0cff0663e789a1/examples/doom-c/p_spec.c#L391-L411", "sha": "e700581dfb7956dd161aee44fc0cff0663e789a1"}44{"repo_name": "openvpn-ui", "dataset": "github_2023", "owner": "d3vilh", "lang": "c", "func_name": "unixOpen", "code": "static int unixOpen(\n  sqlite3_vfs *pVfs,           /* The VFS for which this is the xOpen method */\n  const char *zPath,           /* Pathname of file to be opened */\n  sqlite3_file *pFile,         /* The file descriptor to be filled in */\n  int flags,                   /* Input flags to control the opening */\n  int *pOutFlags               /* Output flags returned to SQLite core */\n){\n  unixFile *p = (unixFile *)pFile;\n  int fd = -1;                   /* File descriptor returned by open() */\n  int openFlags = 0;             /* Flags to pass to open() */\n  int eType = flags&0x0FFF00;  /* Type of file to open */\n  int noLock;                    /* True to omit locking primitives */\n  int rc = SQLITE_OK;            /* Function Return Code */\n  int ctrlFlags = 0;             /* UNIXFILE_* flags */\n\n  int isExclusive  = (flags & SQLITE_OPEN_EXCLUSIVE);\n  int isDelete     = (flags & SQLITE_OPEN_DELETEONCLOSE);\n  int isCreate     = (flags & SQLITE_OPEN_CREATE);\n  int isReadonly   = (flags & SQLITE_OPEN_READONLY);\n  int isReadWrite  = (flags & SQLITE_OPEN_READWRITE);\n#if SQLITE_ENABLE_LOCKING_STYLE\n  int isAutoProxy  = (flags & SQLITE_OPEN_AUTOPROXY);\n#endif\n#if defined(__APPLE__) || SQLITE_ENABLE_LOCKING_STYLE\n  struct statfs fsInfo;\n#endif\n\n  /* If creating a super- or main-file journal, this function will open\n  ** a file-descriptor on the directory too. The first time unixSync()\n  ** is called the directory file descriptor will be fsync()ed and close()d.\n  */\n  int isNewJrnl = (isCreate && (\n        eType==SQLITE_OPEN_SUPER_JOURNAL\n     || eType==SQLITE_OPEN_MAIN_JOURNAL\n     || eType==SQLITE_OPEN_WAL\n  ));\n\n  /* If argument zPath is a NULL pointer, this function is required to open\n  ** a temporary file. Use this buffer to store the file name in.\n  */\n  char zTmpname[MAX_PATHNAME+2];\n  const char *zName = zPath;\n\n  /* Check the following statements are true:\n  **\n  **   (a) Exactly one of the READWRITE and READONLY flags must be set, and\n  **   (b) if CREATE is set, then READWRITE must also be set, and\n  **   (c) if EXCLUSIVE is set, then CREATE must also be set.\n  **   (d) if DELETEONCLOSE is set, then CREATE must also be set.\n  */\n  assert((isReadonly==0 || isReadWrite==0) && (isReadWrite || isReadonly));\n  assert(isCreate==0 || isReadWrite);\n  assert(isExclusive==0 || isCreate);\n  assert(isDelete==0 || isCreate);\n\n  /* The main DB, main journal, WAL file and super-journal are never\n  ** automatically deleted. Nor are they ever temporary files.  */\n  assert( (!isDelete && zName) || eType!=SQLITE_OPEN_MAIN_DB );\n  assert( (!isDelete && zName) || eType!=SQLITE_OPEN_MAIN_JOURNAL );\n  assert( (!isDelete && zName) || eType!=SQLITE_OPEN_SUPER_JOURNAL );\n  assert( (!isDelete && zName) || eType!=SQLITE_OPEN_WAL );\n\n  /* Assert that the upper layer has set one of the \"file-type\" flags. */\n  assert( eType==SQLITE_OPEN_MAIN_DB      || eType==SQLITE_OPEN_TEMP_DB\n       || eType==SQLITE_OPEN_MAIN_JOURNAL || eType==SQLITE_OPEN_TEMP_JOURNAL\n       || eType==SQLITE_OPEN_SUBJOURNAL   || eType==SQLITE_OPEN_SUPER_JOURNAL\n       || eType==SQLITE_OPEN_TRANSIENT_DB || eType==SQLITE_OPEN_WAL\n  );\n\n  /* Detect a pid change and reset the PRNG.  There is a race condition\n  ** here such that two or more threads all trying to open databases at\n  ** the same instant might all reset the PRNG.  But multiple resets\n  ** are harmless.\n  */\n  if( randomnessPid!=osGetpid(0) ){\n    randomnessPid = osGetpid(0);\n    sqlite3_randomness(0,0);\n  }\n  memset(p, 0, sizeof(unixFile));\n\n#ifdef SQLITE_ASSERT_NO_FILES\n  /* Applications that never read or write a persistent disk files */\n  assert( zName==0 );\n#endif\n\n  if( eType==SQLITE_OPEN_MAIN_DB ){\n    UnixUnusedFd *pUnused;\n    pUnused = findReusableFd(zName, flags);\n    if( pUnused ){\n      fd = pUnused->fd;\n    }else{\n      pUnused = sqlite3_malloc64(sizeof(*pUnused));\n      if( !pUnused ){\n        return SQLITE_NOMEM_BKPT;\n      }\n    }\n    p->pPreallocatedUnused = pUnused;\n\n    /* Database filenames are double-zero terminated if they are not\n    ** URIs with parameters.  Hence, they can always be passed into\n    ** sqlite3_uri_parameter(). */\n    assert( (flags & SQLITE_OPEN_URI) || zName[strlen(zName)+1]==0 );\n\n  }else if( !zName ){\n    /* If zName is NULL, the upper layer is requesting a temp file. */\n    assert(isDelete && !isNewJrnl);\n    rc = unixGetTempname(pVfs->mxPathname, zTmpname);\n    if( rc!=SQLITE_OK ){\n      return rc;\n    }\n    zName = zTmpname;\n\n    /* Generated temporary filenames are always double-zero terminated\n    ** for use by sqlite3_uri_parameter(). */\n    assert( zName[strlen(zName)+1]==0 );\n  }\n\n  /* Determine the value of the flags parameter passed to POSIX function\n  ** open(). These must be calculated even if open() is not called, as\n  ** they may be stored as part of the file handle and used by the\n  ** 'conch file' locking functions later on.  */\n  if( isReadonly )  openFlags |= O_RDONLY;\n  if( isReadWrite ) openFlags |= O_RDWR;\n  if( isCreate )    openFlags |= O_CREAT;\n  if( isExclusive ) openFlags |= (O_EXCL|O_NOFOLLOW);\n  openFlags |= (O_LARGEFILE|O_BINARY|O_NOFOLLOW);\n\n  if( fd<0 ){\n    mode_t openMode;              /* Permissions to create file with */\n    uid_t uid;                    /* Userid for the file */\n    gid_t gid;                    /* Groupid for the file */\n    rc = findCreateFileMode(zName, flags, &openMode, &uid, &gid);\n    if( rc!=SQLITE_OK ){\n      assert( !p->pPreallocatedUnused );\n      assert( eType==SQLITE_OPEN_WAL || eType==SQLITE_OPEN_MAIN_JOURNAL );\n      return rc;\n    }\n    fd = robust_open(zName, openFlags, openMode);\n    OSTRACE((\"OPENX   %-3d %s 0%o\\n\", fd, zName, openFlags));\n    assert( !isExclusive || (openFlags & O_CREAT)!=0 );\n    if( fd<0 ){\n      if( isNewJrnl && errno==EACCES && osAccess(zName, F_OK) ){\n        /* If unable to create a journal because the directory is not\n        ** writable, change the error code to indicate that. */\n        rc = SQLITE_READONLY_DIRECTORY;\n      }else if( errno!=EISDIR && isReadWrite ){\n        /* Failed to open the file for read/write access. Try read-only. */\n        UnixUnusedFd *pReadonly = 0;\n        flags &= ~(SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE);\n        openFlags &= ~(O_RDWR|O_CREAT);\n        flags |= SQLITE_OPEN_READONLY;\n        openFlags |= O_RDONLY;\n        isReadonly = 1;\n        pReadonly = findReusableFd(zName, flags);\n        if( pReadonly ){\n          fd = pReadonly->fd;\n          sqlite3_free(pReadonly);\n        }else{\n          fd = robust_open(zName, openFlags, openMode);\n        }\n      }\n    }\n    if( fd<0 ){\n      int rc2 = unixLogError(SQLITE_CANTOPEN_BKPT, \"open\", zName);\n      if( rc==SQLITE_OK ) rc = rc2;\n      goto open_finished;\n    }\n\n    /* The owner of the rollback journal or WAL file should always be the\n    ** same as the owner of the database file.  Try to ensure that this is\n    ** the case.  The chown() system call will be a no-op if the current\n    ** process lacks root privileges, be we should at least try.  Without\n    ** this step, if a root process opens a database file, it can leave\n    ** behinds a journal/WAL that is owned by root and hence make the\n    ** database inaccessible to unprivileged processes.\n    **\n    ** If openMode==0, then that means uid and gid are not set correctly\n    ** (probably because SQLite is configured to use 8+3 filename mode) and\n    ** in that case we do not want to attempt the chown().\n    */\n    if( openMode && (flags & (SQLITE_OPEN_WAL|SQLITE_OPEN_MAIN_JOURNAL))!=0 ){\n      robustFchown(fd, uid, gid);\n    }\n  }\n  assert( fd>=0 );\n  if( pOutFlags ){\n    *pOutFlags = flags;\n  }\n\n  if( p->pPreallocatedUnused ){\n    p->pPreallocatedUnused->fd = fd;\n    p->pPreallocatedUnused->flags =\n                          flags & (SQLITE_OPEN_READONLY|SQLITE_OPEN_READWRITE);\n  }\n\n  if( isDelete ){\n#if OS_VXWORKS\n    zPath = zName;\n#elif defined(SQLITE_UNLINK_AFTER_CLOSE)\n    zPath = sqlite3_mprintf(\"%s\", zName);\n    if( zPath==0 ){\n      robust_close(p, fd, __LINE__);\n      return SQLITE_NOMEM_BKPT;\n    }\n#else\n    osUnlink(zName);\n#endif\n  }\n#if SQLITE_ENABLE_LOCKING_STYLE\n  else{\n    p->openFlags = openFlags;\n  }\n#endif\n\n#if defined(__APPLE__) || SQLITE_ENABLE_LOCKING_STYLE\n  if( fstatfs(fd, &fsInfo) == -1 ){\n    storeLastErrno(p, errno);\n    robust_close(p, fd, __LINE__);\n    return SQLITE_IOERR_ACCESS;\n  }\n  if (0 == strncmp(\"msdos\", fsInfo.f_fstypename, 5)) {\n    ((unixFile*)pFile)->fsFlags |= SQLITE_FSFLAGS_IS_MSDOS;\n  }\n  if (0 == strncmp(\"exfat\", fsInfo.f_fstypename, 5)) {\n    ((unixFile*)pFile)->fsFlags |= SQLITE_FSFLAGS_IS_MSDOS;\n  }\n#endif\n\n  /* Set up appropriate ctrlFlags */\n  if( isDelete )                ctrlFlags |= UNIXFILE_DELETE;\n  if( isReadonly )              ctrlFlags |= UNIXFILE_RDONLY;\n  noLock = eType!=SQLITE_OPEN_MAIN_DB;\n  if( noLock )                  ctrlFlags |= UNIXFILE_NOLOCK;\n  if( isNewJrnl )               ctrlFlags |= UNIXFILE_DIRSYNC;\n  if( flags & SQLITE_OPEN_URI ) ctrlFlags |= UNIXFILE_URI;\n\n#if SQLITE_ENABLE_LOCKING_STYLE\n#if SQLITE_PREFER_PROXY_LOCKING\n  isAutoProxy = 1;\n#endif\n  if( isAutoProxy && (zPath!=NULL) && (!noLock) && pVfs->xOpen ){\n    char *envforce = getenv(\"SQLITE_FORCE_PROXY_LOCKING\");\n    int useProxy = 0;\n\n    /* SQLITE_FORCE_PROXY_LOCKING==1 means force always use proxy, 0 means\n    ** never use proxy, NULL means use proxy for non-local files only.  */\n    if( envforce!=NULL ){\n      useProxy = atoi(envforce)>0;\n    }else{\n      useProxy = !(fsInfo.f_flags&MNT_LOCAL);\n    }\n    if( useProxy ){\n      rc = fillInUnixFile(pVfs, fd, pFile, zPath, ctrlFlags);\n      if( rc==SQLITE_OK ){\n        rc = proxyTransformUnixFile((unixFile*)pFile, \":auto:\");\n        if( rc!=SQLITE_OK ){\n          /* Use unixClose to clean up the resources added in fillInUnixFile\n          ** and clear all the structure's references.  Specifically,\n          ** pFile->pMethods will be NULL so sqlite3OsClose will be a no-op\n          */\n          unixClose(pFile);\n          return rc;\n        }\n      }\n      goto open_finished;\n    }\n  }\n#endif\n\n  assert( zPath==0 || zPath[0]=='/'\n      || eType==SQLITE_OPEN_SUPER_JOURNAL || eType==SQLITE_OPEN_MAIN_JOURNAL\n  );\n  rc = fillInUnixFile(pVfs, fd, pFile, zPath, ctrlFlags);\n\nopen_finished:\n  if( rc!=SQLITE_OK ){\n    sqlite3_free(p->pPreallocatedUnused);\n  }\n  return rc;\n}", "docstring": "/*\n** Open the file zPath.\n**\n** Previously, the SQLite OS layer used three functions in place of this\n** one:\n**\n**     sqlite3OsOpenReadWrite();\n**     sqlite3OsOpenReadOnly();\n**     sqlite3OsOpenExclusive();\n**\n** These calls correspond to the following combinations of flags:\n**\n**     ReadWrite() ->     (READWRITE | CREATE)\n**     ReadOnly()  ->     (READONLY)\n**     OpenExclusive() -> (READWRITE | CREATE | EXCLUSIVE)\n**\n** The old OpenExclusive() accepted a boolean argument - \"delFlag\". If\n** true, the file was configured to be automatically deleted when the\n** file handle closed. To achieve the same effect using this new\n** interface, add the DELETEONCLOSE flag to those specified above for\n** OpenExclusive().\n*/", "url": "https://github.com/d3vilh/openvpn-ui/blob/690f84df426c13ad4742b61fd23e52fcdc489aa0/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c#L44613-L44892", "sha": "690f84df426c13ad4742b61fd23e52fcdc489aa0"}45{"repo_name": "openvpn-ui", "dataset": "github_2023", "owner": "d3vilh", "lang": "c", "func_name": "sqlite3PagerSetSpillsize", "code": "SQLITE_PRIVATE int sqlite3PagerSetSpillsize(Pager *pPager, int mxPage){\n  return sqlite3PcacheSetSpillsize(pPager->pPCache, mxPage);\n}", "docstring": "/*\n** Change the maximum number of in-memory pages that are allowed\n** before attempting to spill pages to journal.\n*/", "url": "https://github.com/d3vilh/openvpn-ui/blob/690f84df426c13ad4742b61fd23e52fcdc489aa0/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c#L60624-L60626", "sha": "690f84df426c13ad4742b61fd23e52fcdc489aa0"}46{"repo_name": "openvpn-ui", "dataset": "github_2023", "owner": "d3vilh", "lang": "c", "func_name": "sqlite3PagerSetFlags", "code": "SQLITE_PRIVATE void sqlite3PagerSetFlags(\n  Pager *pPager,        /* The pager to set safety level for */\n  unsigned pgFlags      /* Various flags */\n){\n  unsigned level = pgFlags & PAGER_SYNCHRONOUS_MASK;\n  if( pPager->tempFile ){\n    pPager->noSync = 1;\n    pPager->fullSync = 0;\n    pPager->extraSync = 0;\n  }else{\n    pPager->noSync =  level==PAGER_SYNCHRONOUS_OFF ?1:0;\n    pPager->fullSync = level>=PAGER_SYNCHRONOUS_FULL ?1:0;\n    pPager->extraSync = level==PAGER_SYNCHRONOUS_EXTRA ?1:0;\n  }\n  if( pPager->noSync ){\n    pPager->syncFlags = 0;\n  }else if( pgFlags & PAGER_FULLFSYNC ){\n    pPager->syncFlags = SQLITE_SYNC_FULL;\n  }else{\n    pPager->syncFlags = SQLITE_SYNC_NORMAL;\n  }\n  pPager->walSyncFlags = (pPager->syncFlags<<2);\n  if( pPager->fullSync ){\n    pPager->walSyncFlags |= pPager->syncFlags;\n  }\n  if( (pgFlags & PAGER_CKPT_FULLFSYNC) && !pPager->noSync ){\n    pPager->walSyncFlags |= (SQLITE_SYNC_FULL<<2);\n  }\n  if( pgFlags & PAGER_CACHESPILL ){\n    pPager->doNotSpill &= ~SPILLFLAG_OFF;\n  }else{\n    pPager->doNotSpill |= SPILLFLAG_OFF;\n  }\n}", "docstring": "/*\n** Adjust settings of the pager to those specified in the pgFlags parameter.\n**\n** The \"level\" in pgFlags & PAGER_SYNCHRONOUS_MASK sets the robustness\n** of the database to damage due to OS crashes or power failures by\n** changing the number of syncs()s when writing the journals.\n** There are four levels:\n**\n**    OFF       sqlite3OsSync() is never called.  This is the default\n**              for temporary and transient files.\n**\n**    NORMAL    The journal is synced once before writes begin on the\n**              database.  This is normally adequate protection, but\n**              it is theoretically possible, though very unlikely,\n**              that an inopertune power failure could leave the journal\n**              in a state which would cause damage to the database\n**              when it is rolled back.\n**\n**    FULL      The journal is synced twice before writes begin on the\n**              database (with some additional information - the nRec field\n**              of the journal header - being written in between the two\n**              syncs).  If we assume that writing a\n**              single disk sector is atomic, then this mode provides\n**              assurance that the journal will not be corrupted to the\n**              point of causing damage to the database during rollback.\n**\n**    EXTRA     This is like FULL except that is also syncs the directory\n**              that contains the rollback journal after the rollback\n**              journal is unlinked.\n**\n** The above is for a rollback-journal mode.  For WAL mode, OFF continues\n** to mean that no syncs ever occur.  NORMAL means that the WAL is synced\n** prior to the start of checkpoint and that the database file is synced\n** at the conclusion of the checkpoint if the entire content of the WAL\n** was written back into the database.  But no sync operations occur for\n** an ordinary commit in NORMAL mode with WAL.  FULL means that the WAL\n** file is synced following each commit operation, in addition to the\n** syncs associated with NORMAL.  There is no difference between FULL\n** and EXTRA for WAL mode.\n**\n** Do not confuse synchronous=FULL with SQLITE_SYNC_FULL.  The\n** SQLITE_SYNC_FULL macro means to use the MacOSX-style full-fsync\n** using fcntl(F_FULLFSYNC).  SQLITE_SYNC_NORMAL means to do an\n** ordinary fsync() call.  There is no difference between SQLITE_SYNC_FULL\n** and SQLITE_SYNC_NORMAL on platforms other than MacOSX.  But the\n** synchronous=FULL versus synchronous=NORMAL setting determines when\n** the xSync primitive is called and is relevant to all platforms.\n**\n** Numeric values associated with these states are OFF==1, NORMAL=2,\n** and FULL=3.\n*/", "url": "https://github.com/d3vilh/openvpn-ui/blob/690f84df426c13ad4742b61fd23e52fcdc489aa0/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c#L60710-L60743", "sha": "690f84df426c13ad4742b61fd23e52fcdc489aa0"}47{"repo_name": "openvpn-ui", "dataset": "github_2023", "owner": "d3vilh", "lang": "c", "func_name": "sqlite3WalWriteLock", "code": "SQLITE_PRIVATE int sqlite3WalWriteLock(Wal *pWal, int bLock){\n  int rc = SQLITE_OK;\n  assert( pWal->readLock<0 || bLock==0 );\n  if( bLock ){\n    assert( pWal->db );\n    if( walEnableBlocking(pWal) ){\n      rc = walLockExclusive(pWal, WAL_WRITE_LOCK, 1);\n      if( rc==SQLITE_OK ){\n        pWal->writeLock = 1;\n      }\n      walDisableBlocking(pWal);\n    }\n  }else if( pWal->writeLock ){\n    walUnlockExclusive(pWal, WAL_WRITE_LOCK, 1);\n    pWal->writeLock = 0;\n  }\n  return rc;\n}", "docstring": "/*\n** If parameter bLock is true, attempt to enable blocking locks, take\n** the WRITER lock, and then disable blocking locks. If blocking locks\n** cannot be enabled, no attempt to obtain the WRITER lock is made. Return\n** an SQLite error code if an error occurs, or SQLITE_OK otherwise. It is not\n** an error if blocking locks can not be enabled.\n**\n** If the bLock parameter is false and the WRITER lock is held, release it.\n*/", "url": "https://github.com/d3vilh/openvpn-ui/blob/690f84df426c13ad4742b61fd23e52fcdc489aa0/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c#L66966-L66983", "sha": "690f84df426c13ad4742b61fd23e52fcdc489aa0"}48{"repo_name": "openvpn-ui", "dataset": "github_2023", "owner": "d3vilh", "lang": "c", "func_name": "sqlite3VdbeAssertMayAbort", "code": "SQLITE_PRIVATE int sqlite3VdbeAssertMayAbort(Vdbe *v, int mayAbort){\n  int hasAbort = 0;\n  int hasFkCounter = 0;\n  int hasCreateTable = 0;\n  int hasCreateIndex = 0;\n  int hasInitCoroutine = 0;\n  Op *pOp;\n  VdbeOpIter sIter;\n\n  if( v==0 ) return 0;\n  memset(&sIter, 0, sizeof(sIter));\n  sIter.v = v;\n\n  while( (pOp = opIterNext(&sIter))!=0 ){\n    int opcode = pOp->opcode;\n    if( opcode==OP_Destroy || opcode==OP_VUpdate || opcode==OP_VRename\n     || opcode==OP_VDestroy\n     || opcode==OP_VCreate\n     || opcode==OP_ParseSchema\n     || opcode==OP_Function || opcode==OP_PureFunc\n     || ((opcode==OP_Halt || opcode==OP_HaltIfNull)\n      && ((pOp->p1)!=SQLITE_OK && pOp->p2==OE_Abort))\n    ){\n      hasAbort = 1;\n      break;\n    }\n    if( opcode==OP_CreateBtree && pOp->p3==BTREE_INTKEY ) hasCreateTable = 1;\n    if( mayAbort ){\n      /* hasCreateIndex may also be set for some DELETE statements that use\n      ** OP_Clear. So this routine may end up returning true in the case\n      ** where a \"DELETE FROM tbl\" has a statement-journal but does not\n      ** require one. This is not so bad - it is an inefficiency, not a bug. */\n      if( opcode==OP_CreateBtree && pOp->p3==BTREE_BLOBKEY ) hasCreateIndex = 1;\n      if( opcode==OP_Clear ) hasCreateIndex = 1;\n    }\n    if( opcode==OP_InitCoroutine ) hasInitCoroutine = 1;\n#ifndef SQLITE_OMIT_FOREIGN_KEY\n    if( opcode==OP_FkCounter && pOp->p1==0 && pOp->p2==1 ){\n      hasFkCounter = 1;\n    }\n#endif\n  }\n  sqlite3DbFree(v->db, sIter.apSub);\n\n  /* Return true if hasAbort==mayAbort. Or if a malloc failure occurred.\n  ** If malloc failed, then the while() loop above may not have iterated\n  ** through all opcodes and hasAbort may be set incorrectly. Return\n  ** true for this case to prevent the assert() in the callers frame\n  ** from failing.  */\n  return ( v->db->mallocFailed || hasAbort==mayAbort || hasFkCounter\n        || (hasCreateTable && hasInitCoroutine) || hasCreateIndex\n  );\n}", "docstring": "/*\n** Check if the program stored in the VM associated with pParse may\n** throw an ABORT exception (causing the statement, but not entire transaction\n** to be rolled back). This condition is true if the main program or any\n** sub-programs contains any of the following:\n**\n**   *  OP_Halt with P1=SQLITE_CONSTRAINT and P2=OE_Abort.\n**   *  OP_HaltIfNull with P1=SQLITE_CONSTRAINT and P2=OE_Abort.\n**   *  OP_Destroy\n**   *  OP_VUpdate\n**   *  OP_VCreate\n**   *  OP_VRename\n**   *  OP_FkCounter with P2==0 (immediate foreign key constraint)\n**   *  OP_CreateBtree/BTREE_INTKEY and OP_InitCoroutine\n**      (for CREATE TABLE AS SELECT ...)\n**\n** Then check that the value of Parse.mayAbort is true if an\n** ABORT may be thrown, or false otherwise. Return true if it does\n** match, or false otherwise. This function is intended to be used as\n** part of an assert statement in the compiler. Similar to:\n**\n**   assert( sqlite3VdbeAssertMayAbort(pParse->pVdbe, pParse->mayAbort) );\n*/", "url": "https://github.com/d3vilh/openvpn-ui/blob/690f84df426c13ad4742b61fd23e52fcdc489aa0/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c#L85609-L85661", "sha": "690f84df426c13ad4742b61fd23e52fcdc489aa0"}49{"repo_name": "openvpn-ui", "dataset": "github_2023", "owner": "d3vilh", "lang": "c", "func_name": "sessionStat1Sql", "code": "static int sessionStat1Sql(sqlite3 *db, SessionApplyCtx *p){\n  int rc = sessionSelectRow(db, \"sqlite_stat1\", p);\n  if( rc==SQLITE_OK ){\n    rc = sessionPrepare(db, &p->pInsert,\n        \"INSERT INTO main.sqlite_stat1 VALUES(?1, \"\n        \"CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END, \"\n        \"?3)\"\n    );\n  }\n  if( rc==SQLITE_OK ){\n    rc = sessionPrepare(db, &p->pDelete,\n        \"DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS \"\n        \"CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END \"\n        \"AND (?4 OR stat IS ?3)\"\n    );\n  }\n  return rc;\n}", "docstring": "/*\n** Prepare statements for applying changes to the sqlite_stat1 table.\n** These are similar to those created by sessionSelectRow(),\n** sessionInsertRow(), sessionUpdateRow() and sessionDeleteRow() for\n** other tables.\n*/", "url": "https://github.com/d3vilh/openvpn-ui/blob/690f84df426c13ad4742b61fd23e52fcdc489aa0/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c#L229415-L229432", "sha": "690f84df426c13ad4742b61fd23e52fcdc489aa0"}50{"repo_name": "openvpn-ui", "dataset": "github_2023", "owner": "d3vilh", "lang": "c", "func_name": "fts5structEofMethod", "code": "static int fts5structEofMethod(sqlite3_vtab_cursor *cur){\n  Fts5StructVcsr *pCsr = (Fts5StructVcsr*)cur;\n  return pCsr->pStruct==0;\n}", "docstring": "/*\n** Return TRUE if the cursor has been moved off of the last\n** row of output.\n*/", "url": "https://github.com/d3vilh/openvpn-ui/blob/690f84df426c13ad4742b61fd23e52fcdc489aa0/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c#L249422-L249425", "sha": "690f84df426c13ad4742b61fd23e52fcdc489aa0"}51{"repo_name": "Project-Alice", "dataset": "github_2023", "owner": "schombert", "lang": "c", "func_name": "ZSTD_findFrameCompressedSize", "code": "size_t ZSTD_findFrameCompressedSize(const void *src, size_t srcSize)\n{\n    return ZSTD_findFrameCompressedSize_advanced(src, srcSize, ZSTD_f_zstd1);\n}", "docstring": "/** ZSTD_findFrameCompressedSize() :\n * See docs in zstd.h\n * Note: compatible with legacy mode */", "url": "https://github.com/schombert/Project-Alice/blob/ad0c795edf7aab314439dbf68afca7a9a4c24bfb/src/zstd/decompress/zstd_decompress.c#L807-L810", "sha": "ad0c795edf7aab314439dbf68afca7a9a4c24bfb"}52{"repo_name": "Project-Alice", "dataset": "github_2023", "owner": "schombert", "lang": "c", "func_name": "ZSTD_resetDStream", "code": "size_t ZSTD_resetDStream(ZSTD_DStream* dctx)\n{\n    DEBUGLOG(4, \"ZSTD_resetDStream\");\n    FORWARD_IF_ERROR(ZSTD_DCtx_reset(dctx, ZSTD_reset_session_only), \"\");\n    return ZSTD_startingInputLength(dctx->format);\n}", "docstring": "/* ZSTD_resetDStream() :\n * return : expected size, aka ZSTD_startingInputLength().\n * this function cannot fail */", "url": "https://github.com/schombert/Project-Alice/blob/ad0c795edf7aab314439dbf68afca7a9a4c24bfb/src/zstd/decompress/zstd_decompress.c#L1770-L1775", "sha": "ad0c795edf7aab314439dbf68afca7a9a4c24bfb"}53{"repo_name": "Project-Alice", "dataset": "github_2023", "owner": "schombert", "lang": "c", "func_name": "COVER_best_destroy", "code": "void COVER_best_destroy(COVER_best_t *best) {\n  if (!best) {\n    return;\n  }\n  COVER_best_wait(best);\n  if (best->dict) {\n    free(best->dict);\n  }\n  ZSTD_pthread_mutex_destroy(&best->mutex);\n  ZSTD_pthread_cond_destroy(&best->cond);\n}", "docstring": "/**\n * Call COVER_best_wait() and then destroy the COVER_best_t.\n */", "url": "https://github.com/schombert/Project-Alice/blob/ad0c795edf7aab314439dbf68afca7a9a4c24bfb/src/zstd/dictBuilder/cover.c#L882-L892", "sha": "ad0c795edf7aab314439dbf68afca7a9a4c24bfb"}54{"repo_name": "llvmbox", "dataset": "github_2023", "owner": "rsms", "lang": "c", "func_name": "fts_palloc", "code": "static int\nfts_palloc(FTS *sp, size_t size)\n{\n\tchar *new;\n\n\t_DIAGASSERT(sp != NULL);\n\n#ifdef __FTS_COMPAT_LENGTH\n\t/* Protect against fts_pathlen overflow. */\n\tif (size > USHRT_MAX + 1) {\n\t\terrno = ENAMETOOLONG;\n\t\treturn (1);\n\t}\n#endif\n\tsize = fts_pow2(size);\n\tnew = realloc(sp->fts_path, size);\n\tif (new == 0)\n\t\treturn (1);\n\tsp->fts_path = new;\n\tsp->fts_pathlen = fts_pathlen_truncate(size);\n\treturn (0);\n}", "docstring": "/*\n * Allow essentially unlimited paths; find, rm, ls should all work on any tree.\n * Most systems will allow creation of paths much longer than MAXPATHLEN, even\n * though the kernel won't resolve them.  Round up the new size to a power of 2,\n * so we don't realloc the path 2 bytes at a time.\n */", "url": "https://github.com/rsms/llvmbox/blob/45b9a5a62f556bf8ec92899c18091109a14bbe2d/musl-fts/fts.c#L1153-L1174", "sha": "45b9a5a62f556bf8ec92899c18091109a14bbe2d"}55{"repo_name": "llvmbox", "dataset": "github_2023", "owner": "rsms", "lang": "c", "func_name": "__eqsf2", "code": "int __eqsf2(fp_t a, fp_t b) { return __lesf2(a, b); }", "docstring": "// The alias mechanism doesn't work on Windows except for MinGW, so emit\n// wrapper functions.", "url": "https://github.com/rsms/llvmbox/blob/45b9a5a62f556bf8ec92899c18091109a14bbe2d/sysroots/compiler-rt/builtins/comparesf2.c#L73-L73", "sha": "45b9a5a62f556bf8ec92899c18091109a14bbe2d"}56{"repo_name": "llvmbox", "dataset": "github_2023", "owner": "rsms", "lang": "c", "func_name": "csinhl", "code": "long double complex csinhl(long double complex z)\n{\n\treturn csinh(z);\n}", "docstring": "//FIXME", "url": "https://github.com/rsms/llvmbox/blob/45b9a5a62f556bf8ec92899c18091109a14bbe2d/sysroots/libc/musl/src/complex/csinhl.c#L4-L7", "sha": "45b9a5a62f556bf8ec92899c18091109a14bbe2d"}57{"repo_name": "llvmbox", "dataset": "github_2023", "owner": "rsms", "lang": "c", "func_name": "tre_make_trans", "code": "static reg_errcode_t\ntre_make_trans(tre_pos_and_tags_t *p1, tre_pos_and_tags_t *p2,\n\t       tre_tnfa_transition_t *transitions,\n\t       int *counts, int *offs)\n{\n  tre_pos_and_tags_t *orig_p2 = p2;\n  tre_tnfa_transition_t *trans;\n  int i, j, k, l, dup, prev_p2_pos;\n\n  if (transitions != NULL)\n    while (p1->position >= 0)\n      {\n\tp2 = orig_p2;\n\tprev_p2_pos = -1;\n\twhile (p2->position >= 0)\n\t  {\n\t    /* Optimization: if this position was already handled, skip it. */\n\t    if (p2->position == prev_p2_pos)\n\t      {\n\t\tp2++;\n\t\tcontinue;\n\t      }\n\t    prev_p2_pos = p2->position;\n\t    /* Set `trans' to point to the next unused transition from\n\t       position `p1->position'. */\n\t    trans = transitions + offs[p1->position];\n\t    while (trans->state != NULL)\n\t      {\n#if 0\n\t\t/* If we find a previous transition from `p1->position' to\n\t\t   `p2->position', it is overwritten.  This can happen only\n\t\t   if there are nested loops in the regexp, like in \"((a)*)*\".\n\t\t   In POSIX.2 repetition using the outer loop is always\n\t\t   preferred over using the inner loop.\t Therefore the\n\t\t   transition for the inner loop is useless and can be thrown\n\t\t   away. */\n\t\t/* XXX - The same position is used for all nodes in a bracket\n\t\t   expression, so this optimization cannot be used (it will\n\t\t   break bracket expressions) unless I figure out a way to\n\t\t   detect it here. */\n\t\tif (trans->state_id == p2->position)\n\t\t  {\n\t\t    break;\n\t\t  }\n#endif\n\t\ttrans++;\n\t      }\n\n\t    if (trans->state == NULL)\n\t      (trans + 1)->state = NULL;\n\t    /* Use the character ranges, assertions, etc. from `p1' for\n\t       the transition from `p1' to `p2'. */\n\t    trans->code_min = p1->code_min;\n\t    trans->code_max = p1->code_max;\n\t    trans->state = transitions + offs[p2->position];\n\t    trans->state_id = p2->position;\n\t    trans->assertions = p1->assertions | p2->assertions\n\t      | (p1->class ? ASSERT_CHAR_CLASS : 0)\n\t      | (p1->neg_classes != NULL ? ASSERT_CHAR_CLASS_NEG : 0);\n\t    if (p1->backref >= 0)\n\t      {\n\t\tassert((trans->assertions & ASSERT_CHAR_CLASS) == 0);\n\t\tassert(p2->backref < 0);\n\t\ttrans->u.backref = p1->backref;\n\t\ttrans->assertions |= ASSERT_BACKREF;\n\t      }\n\t    else\n\t      trans->u.class = p1->class;\n\t    if (p1->neg_classes != NULL)\n\t      {\n\t\tfor (i = 0; p1->neg_classes[i] != (tre_ctype_t)0; i++);\n\t\ttrans->neg_classes =\n\t\t  xmalloc(sizeof(*trans->neg_classes) * (i + 1));\n\t\tif (trans->neg_classes == NULL)\n\t\t  return REG_ESPACE;\n\t\tfor (i = 0; p1->neg_classes[i] != (tre_ctype_t)0; i++)\n\t\t  trans->neg_classes[i] = p1->neg_classes[i];\n\t\ttrans->neg_classes[i] = (tre_ctype_t)0;\n\t      }\n\t    else\n\t      trans->neg_classes = NULL;\n\n\t    /* Find out how many tags this transition has. */\n\t    i = 0;\n\t    if (p1->tags != NULL)\n\t      while(p1->tags[i] >= 0)\n\t\ti++;\n\t    j = 0;\n\t    if (p2->tags != NULL)\n\t      while(p2->tags[j] >= 0)\n\t\tj++;\n\n\t    /* If we are overwriting a transition, free the old tag array. */\n\t    if (trans->tags != NULL)\n\t      xfree(trans->tags);\n\t    trans->tags = NULL;\n\n\t    /* If there were any tags, allocate an array and fill it. */\n\t    if (i + j > 0)\n\t      {\n\t\ttrans->tags = xmalloc(sizeof(*trans->tags) * (i + j + 1));\n\t\tif (!trans->tags)\n\t\t  return REG_ESPACE;\n\t\ti = 0;\n\t\tif (p1->tags != NULL)\n\t\t  while(p1->tags[i] >= 0)\n\t\t    {\n\t\t      trans->tags[i] = p1->tags[i];\n\t\t      i++;\n\t\t    }\n\t\tl = i;\n\t\tj = 0;\n\t\tif (p2->tags != NULL)\n\t\t  while (p2->tags[j] >= 0)\n\t\t    {\n\t\t      /* Don't add duplicates. */\n\t\t      dup = 0;\n\t\t      for (k = 0; k < i; k++)\n\t\t\tif (trans->tags[k] == p2->tags[j])\n\t\t\t  {\n\t\t\t    dup = 1;\n\t\t\t    break;\n\t\t\t  }\n\t\t      if (!dup)\n\t\t\ttrans->tags[l++] = p2->tags[j];\n\t\t      j++;\n\t\t    }\n\t\ttrans->tags[l] = -1;\n\t      }\n\n\t    p2++;\n\t  }\n\tp1++;\n      }\n  else\n    /* Compute a maximum limit for the number of transitions leaving\n       from each state. */\n    while (p1->position >= 0)\n      {\n\tp2 = orig_p2;\n\twhile (p2->position >= 0)\n\t  {\n\t    counts[p1->position]++;\n\t    p2++;\n\t  }\n\tp1++;\n      }\n  return REG_OK;\n}", "docstring": "/* Adds a transition from each position in `p1' to each position in `p2'. */", "url": "https://github.com/rsms/llvmbox/blob/45b9a5a62f556bf8ec92899c18091109a14bbe2d/sysroots/libc/musl/src/regex/regcomp.c#L2469-L2617", "sha": "45b9a5a62f556bf8ec92899c18091109a14bbe2d"}58{"repo_name": "Flipper-Zero-RogueMaster-Firmware", "dataset": "github_2023", "owner": "Kaliroot10", "lang": "c", "func_name": "getRandomMove", "code": "Move getRandomMove(Position* position) {\n    Move moves[MAX_BRANCHING_FACTOR];\n    int totalMoves = legalMoves(moves, position, position->toMove);\n    int chosenMove = rand() % totalMoves;\n    return moves[chosenMove];\n}", "docstring": "/* _WIN32 */", "url": "https://github.com/Kaliroot10/Flipper-Zero-RogueMaster-Firmware/blob/f8b6725eac77eb4c833293d2c3be0b89a8a1678f/applications/plugins/.chess/fast_chess.c#L2806-L2811", "sha": "f8b6725eac77eb4c833293d2c3be0b89a8a1678f"}59{"repo_name": "Flipper-Zero-RogueMaster-Firmware", "dataset": "github_2023", "owner": "Kaliroot10", "lang": "c", "func_name": "rfalNfcDepPSL", "code": "ReturnCode rfalNfcDepPSL(uint8_t BRS, uint8_t FSL) {\n    ReturnCode ret;\n    uint16_t rxLen;\n    uint8_t msgIt;\n    uint8_t txBuf[NFCIP_PSLREQ_LEN + NFCIP_PSLPAY_LEN];\n    uint8_t rxBuf[NFCIP_PSLRES_LEN];\n\n    msgIt = NFCIP_PSLREQ_LEN;\n\n    txBuf[msgIt++] = BRS;\n    txBuf[msgIt++] = FSL;\n\n    /*******************************************************************************/\n    /* Send PSL REQ and wait for response                                          */\n    /*******************************************************************************/\n    EXIT_ON_ERR(\n        ret,\n        nfcipTxRx(\n            NFCIP_CMD_PSL_REQ,\n            txBuf,\n            nfcipRWTActivation(),\n            &txBuf[NFCIP_PSLREQ_LEN],\n            (msgIt - NFCIP_PSLREQ_LEN),\n            rxBuf,\n            NFCIP_PSLRES_LEN,\n            &rxLen));\n\n    /*******************************************************************************/\n    /* PSL sent, check response                                                    */\n    /*******************************************************************************/\n    msgIt = 0;\n    rxLen = (uint16_t)(rxBuf[msgIt++]); /* use LEN byte                   */\n\n    if(rxLen < NFCIP_PSLRES_LEN) /* Checking length: LEN + RLS_RES */\n    {\n        return ERR_PROTO;\n    }\n\n    if(rxBuf[msgIt++] != NFCIP_RES) /* Checking if is a response      */\n    {\n        return ERR_PROTO;\n    }\n\n    if(rxBuf[msgIt++] != (uint8_t)NFCIP_CMD_PSL_RES) /* Checking if is a PSL RES       */\n    {\n        return ERR_PROTO;\n    }\n\n    if(rxBuf[msgIt++] != gNfcip.cfg.did) /* Checking DID                   */\n    {\n        return ERR_PROTO;\n    }\n\n    return ERR_NONE;\n}", "docstring": "/*******************************************************************************/", "url": "https://github.com/Kaliroot10/Flipper-Zero-RogueMaster-Firmware/blob/f8b6725eac77eb4c833293d2c3be0b89a8a1678f/lib/ST25RFAL002/source/rfal_nfcDep.c#L2078-L2132", "sha": "f8b6725eac77eb4c833293d2c3be0b89a8a1678f"}60{"repo_name": "Flipper-Zero-RogueMaster-Firmware", "dataset": "github_2023", "owner": "Kaliroot10", "lang": "c", "func_name": "rfalST25xVPollerGetRandomNumber", "code": "ReturnCode rfalST25xVPollerGetRandomNumber(\n    uint8_t flags,\n    const uint8_t* uid,\n    uint8_t* rxBuf,\n    uint16_t rxBufLen,\n    uint16_t* rcvLen) {\n    rfalFieldOff();\n    platformDelay(RFAL_ST25TV02K_TRF_OFF);\n    rfalNfcvPollerInitialize();\n    rfalFieldOnAndStartGT();\n    platformDelay(RFAL_ST25TV02K_TBOOT_RF);\n    return rfalNfcvPollerTransceiveReq(\n        RFAL_NFCV_CMD_GET_RANDOM_NUMBER,\n        flags,\n        RFAL_NFCV_ST_IC_MFG_CODE,\n        uid,\n        NULL,\n        0U,\n        rxBuf,\n        rxBufLen,\n        rcvLen);\n}", "docstring": "/*******************************************************************************/", "url": "https://github.com/Kaliroot10/Flipper-Zero-RogueMaster-Firmware/blob/f8b6725eac77eb4c833293d2c3be0b89a8a1678f/lib/ST25RFAL002/source/rfal_st25xv.c#L733-L754", "sha": "f8b6725eac77eb4c833293d2c3be0b89a8a1678f"}61{"repo_name": "Flipper-Zero-RogueMaster-Firmware", "dataset": "github_2023", "owner": "Kaliroot10", "lang": "c", "func_name": "rfalTransceiveRunBlockingTx", "code": "static ReturnCode rfalTransceiveRunBlockingTx(void) {\n    ReturnCode ret;\n\n    do {\n        rfalWorker();\n        ret = rfalGetTransceiveStatus();\n    } while(rfalIsTransceiveInTx() && (ret == ERR_BUSY));\n\n    if(rfalIsTransceiveInRx()) {\n        return ERR_NONE;\n    }\n\n    return ret;\n}", "docstring": "/*******************************************************************************/", "url": "https://github.com/Kaliroot10/Flipper-Zero-RogueMaster-Firmware/blob/f8b6725eac77eb4c833293d2c3be0b89a8a1678f/lib/ST25RFAL002/source/st25r3916/rfal_rfst25r3916.c#L1560-L1573", "sha": "f8b6725eac77eb4c833293d2c3be0b89a8a1678f"}62{"repo_name": "Flipper-Zero-RogueMaster-Firmware", "dataset": "github_2023", "owner": "Kaliroot10", "lang": "c", "func_name": "u8g2_SetupBuffer", "code": "void u8g2_SetupBuffer(\n    u8g2_t* u8g2,\n    uint8_t* buf,\n    uint8_t tile_buf_height,\n    u8g2_draw_ll_hvline_cb ll_hvline_cb,\n    const u8g2_cb_t* u8g2_cb) {\n    u8g2->font = NULL;\n    //u8g2->kerning = NULL;\n    //u8g2->get_kerning_cb = u8g2_GetNullKerning;\n\n    //u8g2->ll_hvline = u8g2_ll_hvline_vertical_top_lsb;\n    u8g2->ll_hvline = ll_hvline_cb;\n\n    u8g2->tile_buf_ptr = buf;\n    u8g2->tile_buf_height = tile_buf_height;\n\n    u8g2->tile_curr_row = 0;\n\n    u8g2->font_decode.is_transparent = 0; /* issue 443 */\n    u8g2->bitmap_transparency = 0;\n\n    u8g2->draw_color = 1;\n    u8g2->is_auto_page_clear = 1;\n\n    u8g2->cb = u8g2_cb;\n    u8g2->cb->update_dimension(u8g2);\n#ifdef U8G2_WITH_CLIP_WINDOW_SUPPORT\n    u8g2_SetMaxClipWindow(u8g2); /* assign a clip window and call the update() procedure */\n#else\n    u8g2->cb->update_page_win(u8g2);\n#endif\n\n    u8g2_SetFontPosBaseline(u8g2); /* issue 195 */\n\n#ifdef U8G2_WITH_FONT_ROTATION\n    u8g2->font_decode.dir = 0;\n#endif\n}", "docstring": "/*============================================*/\n/*\n  This procedure is called after setting up the display (u8x8 structure).\n  --> This is the central init procedure for u8g2 object\n*/", "url": "https://github.com/Kaliroot10/Flipper-Zero-RogueMaster-Firmware/blob/f8b6725eac77eb4c833293d2c3be0b89a8a1678f/lib/u8g2/u8g2_setup.c#L72-L109", "sha": "f8b6725eac77eb4c833293d2c3be0b89a8a1678f"}63{"repo_name": "PaxOS-8", "dataset": "github_2023", "owner": "paxo-phone", "lang": "c", "func_name": "iscleared", "code": "static int iscleared (global_State *g, const GCObject *o) {\n  if (o == NULL) return 0;  /* non-collectable value */\n  else if (novariant(o->tt) == LUA_TSTRING) {\n    markobject(g, o);  /* strings are 'values', so are never weak */\n    return 0;\n  }\n  else return iswhite(o);\n}", "docstring": "/*\n** tells whether a key or value can be cleared from a weak\n** table. Non-collectable objects are never removed from weak\n** tables. Strings behave as 'values', so are never removed too. for\n** other objects: if really collected, cannot keep them; for objects\n** being finalized, keep them in keys, but not in values\n*/", "url": "https://github.com/paxo-phone/PaxOS-8/blob/ffa7fcb96f42632a2d6d61e7137d53bf809e673a/src/lib/lua/lgc.c#L185-L192", "sha": "ffa7fcb96f42632a2d6d61e7137d53bf809e673a"}64{"repo_name": "PaxOS-8", "dataset": "github_2023", "owner": "paxo-phone", "lang": "c", "func_name": "traverseLclosure", "code": "static int traverseLclosure (global_State *g, LClosure *cl) {\n  int i;\n  markobjectN(g, cl->p);  /* mark its prototype */\n  for (i = 0; i < cl->nupvalues; i++) {  /* visit its upvalues */\n    UpVal *uv = cl->upvals[i];\n    markobjectN(g, uv);  /* mark upvalue */\n  }\n  return 1 + cl->nupvalues;\n}", "docstring": "/*\n** Traverse a Lua closure, marking its prototype and its upvalues.\n** (Both can be NULL while closure is being created.)\n*/", "url": "https://github.com/paxo-phone/PaxOS-8/blob/ffa7fcb96f42632a2d6d61e7137d53bf809e673a/src/lib/lua/lgc.c#L604-L612", "sha": "ffa7fcb96f42632a2d6d61e7137d53bf809e673a"}65{"repo_name": "PaxOS-8", "dataset": "github_2023", "owner": "paxo-phone", "lang": "c", "func_name": "report", "code": "static int report (lua_State *L, int status) {\n  if (status != LUA_OK) {\n    const char *msg = lua_tostring(L, -1);\n    l_message(progname, msg);\n    lua_pop(L, 1);  /* remove message */\n  }\n  return status;\n}", "docstring": "/*\n** Check whether 'status' is not OK and, if so, prints the error\n** message on the top of the stack. It assumes that the error object\n** is a string, as it was either generated by Lua or by 'msghandler'.\n*/", "url": "https://github.com/paxo-phone/PaxOS-8/blob/ffa7fcb96f42632a2d6d61e7137d53bf809e673a/src/lib/lua/lua.c#L121-L128", "sha": "ffa7fcb96f42632a2d6d61e7137d53bf809e673a"}66{"repo_name": "GateEngine", "dataset": "github_2023", "owner": "STREGAsGate", "lang": "c", "func_name": "vorbis_analysis_wrote", "code": "int vorbis_analysis_wrote(vorbis_dsp_state *v, int vals){\n  vorbis_info *vi=v->vi;\n  codec_setup_info *ci=vi->codec_setup;\n\n  if(vals<=0){\n    int order=32;\n    int i;\n    float *lpc=alloca(order*sizeof(*lpc));\n\n    /* if it wasn't done earlier (very short sample) */\n    if(!v->preextrapolate)\n      _preextrapolate_helper(v);\n\n    /* We're encoding the end of the stream.  Just make sure we have\n       [at least] a few full blocks of zeroes at the end. */\n    /* actually, we don't want zeroes; that could drop a large\n       amplitude off a cliff, creating spread spectrum noise that will\n       suck to encode.  Extrapolate for the sake of cleanliness. */\n\n    vorbis_analysis_buffer(v,ci->blocksizes[1]*3);\n    v->eofflag=v->pcm_current;\n    v->pcm_current+=ci->blocksizes[1]*3;\n\n    for(i=0;i<vi->channels;i++){\n      if(v->eofflag>order*2){\n        /* extrapolate with LPC to fill in */\n        long n;\n\n        /* make a predictor filter */\n        n=v->eofflag;\n        if(n>ci->blocksizes[1])n=ci->blocksizes[1];\n        vorbis_lpc_from_data(v->pcm[i]+v->eofflag-n,lpc,n,order);\n\n        /* run the predictor filter */\n        vorbis_lpc_predict(lpc,v->pcm[i]+v->eofflag-order,order,\n                           v->pcm[i]+v->eofflag,v->pcm_current-v->eofflag);\n      }else{\n        /* not enough data to extrapolate (unlikely to happen due to\n           guarding the overlap, but bulletproof in case that\n           assumtion goes away). zeroes will do. */\n        memset(v->pcm[i]+v->eofflag,0,\n               (v->pcm_current-v->eofflag)*sizeof(*v->pcm[i]));\n\n      }\n    }\n  }else{\n\n    if(v->pcm_current+vals>v->pcm_storage)\n      return(OV_EINVAL);\n\n    v->pcm_current+=vals;\n\n    /* we may want to reverse extrapolate the beginning of a stream\n       too... in case we're beginning on a cliff! */\n    /* clumsy, but simple.  It only runs once, so simple is good. */\n    if(!v->preextrapolate && v->pcm_current-v->centerW>ci->blocksizes[1])\n      _preextrapolate_helper(v);\n\n  }\n  return(0);\n}", "docstring": "/* call with val<=0 to set eof */", "url": "https://github.com/STREGAsGate/GateEngine/blob/f755456c313b7e1b8686fd6fd599c29fcc732d64/Dependencies/Vorbis/block.c#L460-L520", "sha": "f755456c313b7e1b8686fd6fd599c29fcc732d64"}67{"repo_name": "bread", "dataset": "github_2023", "owner": "Theldus", "lang": "c", "func_name": "handle_gdb_write_register", "code": "static int handle_gdb_write_register(const char *buff, size_t len)\n{\n\tuint32_t reg_num_gdb, reg_num_rm;\n\tconst char *ptr, *dec;\n\tunion minibuf value;\n\n\tstatic const int gdb_to_rm[] =\n\t\t/* EAX. */                           /* GS. */\n\t\t   {7,6,5,4,3,2,1,0,13,15,14,12,11,10,9,8};\n\n\tptr = buff;\n\n\texpect_char('P', ptr, len);\n\treg_num_gdb = read_int(ptr, &len, &ptr, 16);\n\texpect_char('=', ptr, len);\n\tdec = decode_hex(ptr, 4);\n\n\tmemcpy(&value, dec, 4);\n\n\t/* Validate register. */\n\tif (reg_num_gdb >= 16)\n\t{\n\t\tsend_gdb_error();\n\t\treturn (-1);\n\t}\n\n\treg_num_rm = gdb_to_rm[reg_num_gdb];\n\n\t/*\n\t * Validate value: 16-bit registers should not\n\t * receive values greater than 16-bit =)\n\t */\n\tif (reg_num_rm >= 8 && value.b32 > ((1<<16)-1))\n\t{\n\t\tsend_gdb_error();\n\t\treturn (-1);\n\t}\n\n\t/* Update our 'cache'. */\n\tx86_regs.r32[reg_num_gdb] = value.b32;\n\n\t/* Send to our serial device. */\n\tsend_serial_byte(SERIAL_STATE_REG_WRITE);\n\tsend_serial_byte(reg_num_rm);\n\tsend_serial_dword(value.b32);\n\treturn (0);\n}", "docstring": "/**\n * @brief Handles the 'write register (P)' GDB command;\n *\n * Please note the the segment registers and EIP,EFLAGS\n * are 16-bit. An attempt to write a 32-bit value on them\n * will emit an error.\n *\n * Also note that the mapping from what we receive from\n * the serial device and the mapping expected by GDB\n * differs, so there is a need to a conversion.\n *\n * @param buff Buffer to be parsed.\n * @param len Buffer length.\n *\n * @return Returns 0 if the command is valid, -1 otherwise.\n */", "url": "https://github.com/Theldus/bread/blob/c4bb9efcae563481c31fa865b64e230d9888e627/gdb.c#L658-L704", "sha": "c4bb9efcae563481c31fa865b64e230d9888e627"}68{"repo_name": "Hanshow-Auto-Updater", "dataset": "github_2023", "owner": "MakersFunDuck", "lang": "c", "func_name": "xTaskCheckForTimeOut", "code": "BaseType_t xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut, TickType_t * const pxTicksToWait )\n{\nBaseType_t xReturn;\n\n\tconfigASSERT( pxTimeOut );\n\tconfigASSERT( pxTicksToWait );\n\n\ttaskENTER_CRITICAL();\n\t{\n\t\t/* Minor optimisation.  The tick count cannot change in this block. */\n\t\tconst TickType_t xConstTickCount = xTickCount;\n\t\tconst TickType_t xElapsedTime = xConstTickCount - pxTimeOut->xTimeOnEntering;\n\n\t\t#if( INCLUDE_xTaskAbortDelay == 1 )\n\t\t\tif( pxCurrentTCB->ucDelayAborted != ( uint8_t ) pdFALSE )\n\t\t\t{\n\t\t\t\t/* The delay was aborted, which is not the same as a time out,\n\t\t\t\tbut has the same result. */\n\t\t\t\tpxCurrentTCB->ucDelayAborted = pdFALSE;\n\t\t\t\txReturn = pdTRUE;\n\t\t\t}\n\t\t\telse\n\t\t#endif\n\n\t\t#if ( INCLUDE_vTaskSuspend == 1 )\n\t\t\tif( *pxTicksToWait == portMAX_DELAY )\n\t\t\t{\n\t\t\t\t/* If INCLUDE_vTaskSuspend is set to 1 and the block time\n\t\t\t\tspecified is the maximum block time then the task should block\n\t\t\t\tindefinitely, and therefore never time out. */\n\t\t\t\txReturn = pdFALSE;\n\t\t\t}\n\t\t\telse\n\t\t#endif\n\n\t\tif( ( xNumOfOverflows != pxTimeOut->xOverflowCount ) && ( xConstTickCount >= pxTimeOut->xTimeOnEntering ) ) /*lint !e525 Indentation preferred as is to make code within pre-processor directives clearer. */\n\t\t{\n\t\t\t/* The tick count is greater than the time at which\n\t\t\tvTaskSetTimeout() was called, but has also overflowed since\n\t\t\tvTaskSetTimeOut() was called.  It must have wrapped all the way\n\t\t\taround and gone past again. This passed since vTaskSetTimeout()\n\t\t\twas called. */\n\t\t\txReturn = pdTRUE;\n\t\t}\n\t\telse if( xElapsedTime < *pxTicksToWait ) /*lint !e961 Explicit casting is only redundant with some compilers, whereas others require it to prevent integer conversion errors. */\n\t\t{\n\t\t\t/* Not a genuine timeout. Adjust parameters for time remaining. */\n\t\t\t*pxTicksToWait -= xElapsedTime;\n\t\t\tvTaskInternalSetTimeOutState( pxTimeOut );\n\t\t\txReturn = pdFALSE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t*pxTicksToWait = 0;\n\t\t\txReturn = pdTRUE;\n\t\t}\n\t}\n\ttaskEXIT_CRITICAL();\n\n\treturn xReturn;\n}", "docstring": "/*-----------------------------------------------------------*/", "url": "https://github.com/MakersFunDuck/Hanshow-Auto-Updater/blob/69306b53088f38eb913f933f63fce38946124457/ATC_TLSR_Paper-/Firmware/components/freertos/tasks.c#L3169-L3229", "sha": "69306b53088f38eb913f933f63fce38946124457"}69{"repo_name": "Hanshow-Auto-Updater", "dataset": "github_2023", "owner": "MakersFunDuck", "lang": "c", "func_name": "MPU_xEventGroupSync", "code": "EventBits_t MPU_xEventGroupSync( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet, const EventBits_t uxBitsToWaitFor, TickType_t xTicksToWait )\n{\nEventBits_t xReturn;\nBaseType_t xRunningPrivileged = xPortRaisePrivilege();\n\n\txReturn = xEventGroupSync( xEventGroup, uxBitsToSet, uxBitsToWaitFor, xTicksToWait );\n\tvPortResetPrivilege( xRunningPrivileged );\n\n\treturn xReturn;\n}", "docstring": "/*-----------------------------------------------------------*/", "url": "https://github.com/MakersFunDuck/Hanshow-Auto-Updater/blob/69306b53088f38eb913f933f63fce38946124457/ATC_TLSR_Paper-/Firmware/components/freertos/portable/Common/mpu_wrappers.c#L1094-L1103", "sha": "69306b53088f38eb913f933f63fce38946124457"}70{"repo_name": "WinDiskWriter", "dataset": "github_2023", "owner": "TechUnRestricted", "lang": "c", "func_name": "wimlib_export_image", "code": "WIMLIBAPI int\nwimlib_export_image(WIMStruct *src_wim,\n\t\t    int src_image,\n\t\t    WIMStruct *dest_wim,\n\t\t    const tchar *dest_name,\n\t\t    const tchar *dest_description,\n\t\t    int export_flags)\n{\n\tint ret;\n\tint start_src_image;\n\tint end_src_image;\n\tint orig_dest_image_count;\n\tint image;\n\tbool all_images = (src_image == WIMLIB_ALL_IMAGES);\n\n\t/* Check for sane parameters.  */\n\tif (export_flags & ~(WIMLIB_EXPORT_FLAG_BOOT |\n\t\t\t     WIMLIB_EXPORT_FLAG_NO_NAMES |\n\t\t\t     WIMLIB_EXPORT_FLAG_NO_DESCRIPTIONS |\n\t\t\t     WIMLIB_EXPORT_FLAG_GIFT |\n\t\t\t     WIMLIB_EXPORT_FLAG_WIMBOOT))\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\tif (!src_wim || !dest_wim)\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\tif (!wim_has_metadata(src_wim) || !wim_has_metadata(dest_wim))\n\t\treturn WIMLIB_ERR_METADATA_NOT_FOUND;\n\n\tif (all_images) {\n\t\t/* Multi-image export.  */\n\t\tif ((!(export_flags & WIMLIB_EXPORT_FLAG_NO_NAMES) &&\n\t\t\tdest_name) ||\n\t\t    (!(export_flags & WIMLIB_EXPORT_FLAG_NO_DESCRIPTIONS) &&\n\t\t\tdest_description))\n\t\t{\n\t\t\tERROR(\"Image name and description must be \"\n\t\t\t      \"left NULL for multi-image export\");\n\t\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\t\t}\n\t\tstart_src_image = 1;\n\t\tend_src_image = src_wim->hdr.image_count;\n\t} else {\n\t\tstart_src_image = src_image;\n\t\tend_src_image = src_image;\n\t}\n\torig_dest_image_count = dest_wim->hdr.image_count;\n\n\t/* We don't yet support having a single WIMStruct contain duplicate\n\t * 'image_metadata' structures, so we must forbid this from happening.\n\t * A duplication is possible if 'src_wim == dest_wim', if the same image\n\t * is exported to the same destination WIMStruct multiple times, or if\n\t * an image is exported in an A => B => A manner.  */\n\tfor (src_image = start_src_image;\n\t     src_image <= end_src_image; src_image++)\n\t{\n\t\tconst struct wim_image_metadata *src_imd =\n\t\t\t\tsrc_wim->image_metadata[src_image - 1];\n\t\tfor (int i = 0; i < dest_wim->hdr.image_count; i++)\n\t\t\tif (dest_wim->image_metadata[i] == src_imd)\n\t\t\t\treturn WIMLIB_ERR_DUPLICATE_EXPORTED_IMAGE;\n\t}\n\n\t/* Blob checksums must be known before proceeding.  */\n\tret = wim_checksum_unhashed_blobs(src_wim);\n\tif (ret)\n\t\treturn ret;\n\tret = wim_checksum_unhashed_blobs(dest_wim);\n\tif (ret)\n\t\treturn ret;\n\n\t/* Enable rollbacks  */\n\tfor_blob_in_table(dest_wim->blob_table, blob_set_not_exported, NULL);\n\n\t/* Forbid exports where the destination WIM already contains image(s)\n\t * with the requested name(s).  However, allow multi-image exports where\n\t * there is a duplication among the source names only.  */\n\tif (!(export_flags & WIMLIB_EXPORT_FLAG_NO_NAMES)) {\n\t\tfor (src_image = start_src_image;\n\t\t     src_image <= end_src_image;\n\t\t     src_image++)\n\t\t{\n\t\t\tconst tchar *name = dest_name ? dest_name :\n\t\t\t\twimlib_get_image_name(src_wim, src_image);\n\n\t\t\tif (wimlib_image_name_in_use(dest_wim, name)) {\n\t\t\t\tERROR(\"There is already an image named \\\"%\"TS\"\\\" \"\n\t\t\t\t      \"in the destination WIM\", name);\n\t\t\t\tret = WIMLIB_ERR_IMAGE_NAME_COLLISION;\n\t\t\t\tgoto out_rollback;\n\t\t\t}\n\t\t}\n\t}\n\n\t/* Export each requested image.  */\n\tfor (src_image = start_src_image;\n\t     src_image <= end_src_image;\n\t     src_image++)\n\t{\n\t\tconst tchar *next_dest_name, *next_dest_description;\n\t\tstruct wim_image_metadata *src_imd;\n\t\tstruct wim_inode *inode;\n\n\t\t/* Determine destination image name and description.  */\n\n\t\tif (export_flags & WIMLIB_EXPORT_FLAG_NO_NAMES)\n\t\t\tnext_dest_name = NULL;\n\t\telse if (dest_name)\n\t\t\tnext_dest_name = dest_name;\n\t\telse\n\t\t\tnext_dest_name = wimlib_get_image_name(src_wim, src_image);\n\n\t\tif (export_flags & WIMLIB_EXPORT_FLAG_NO_DESCRIPTIONS)\n\t\t\tnext_dest_description = NULL;\n\t\telse if (dest_description)\n\t\t\tnext_dest_description = dest_description;\n\t\telse\n\t\t\tnext_dest_description = wimlib_get_image_description(src_wim, src_image);\n\n\t\t/* Load metadata for source image into memory.  */\n\t\tret = select_wim_image(src_wim, src_image);\n\t\tif (ret)\n\t\t\tgoto out_rollback;\n\n\t\tsrc_imd = wim_get_current_image_metadata(src_wim);\n\n\t\t/* Iterate through inodes in the source image and export their\n\t\t * blobs into the destination WIM.  */\n\t\timage_for_each_inode(inode, src_imd) {\n\t\t\tret = inode_export_blobs(inode,\n\t\t\t\t\t\t src_wim->blob_table,\n\t\t\t\t\t\t dest_wim->blob_table,\n\t\t\t\t\t\t export_flags & WIMLIB_EXPORT_FLAG_GIFT);\n\t\t\tif (ret)\n\t\t\t\tgoto out_rollback;\n\t\t}\n\n\t\t/* Export XML information into the destination WIM.  */\n\t\tret = xml_export_image(src_wim->xml_info, src_image,\n\t\t\t\t       dest_wim->xml_info, next_dest_name,\n\t\t\t\t       next_dest_description,\n\t\t\t\t       export_flags & WIMLIB_EXPORT_FLAG_WIMBOOT);\n\t\tif (ret)\n\t\t\tgoto out_rollback;\n\n\t\t/* Reference the source image metadata from the destination WIM.\n\t\t */\n\t\tret = append_image_metadata(dest_wim, src_imd);\n\t\tif (ret)\n\t\t\tgoto out_rollback;\n\t\tsrc_imd->refcnt++;\n\t}\n\n\t/* Image export complete.  Finish by setting any needed special metadata\n\t * on the destination WIM.  */\n\n\tif (src_wim->hdr.flags & WIM_HDR_FLAG_RP_FIX)\n\t\tdest_wim->hdr.flags |= WIM_HDR_FLAG_RP_FIX;\n\n\tfor (src_image = start_src_image;\n\t     src_image <= end_src_image;\n\t     src_image++)\n\t{\n\t\tint dst_image = orig_dest_image_count + 1 +\n\t\t\t\t(src_image - start_src_image);\n\n\t\tif ((export_flags & WIMLIB_EXPORT_FLAG_BOOT) &&\n\t\t    (!all_images || src_image == src_wim->hdr.boot_idx))\n\t\t\tdest_wim->hdr.boot_idx = dst_image;\n\t}\n\n\treturn 0;\n\nout_rollback:\n\twhile ((image = xml_get_image_count(dest_wim->xml_info))\n\t       > orig_dest_image_count)\n\t{\n\t\txml_delete_image(dest_wim->xml_info, image);\n\t}\n\twhile (dest_wim->hdr.image_count > orig_dest_image_count)\n\t{\n\t\tput_image_metadata(dest_wim->image_metadata[\n\t\t\t\t\t--dest_wim->hdr.image_count]);\n\t}\n\tfor_blob_in_table(dest_wim->blob_table, blob_rollback_export,\n\t\t\t  dest_wim->blob_table);\n\treturn ret;\n}", "docstring": "/* API function documented in wimlib.h  */", "url": "https://github.com/TechUnRestricted/WinDiskWriter/blob/86a003b84ecf0e3e4edd315b202eca3f01c6c0cc/WinDiskWriter/libs/wimlib/src/export_image.c#L108-L295", "sha": "86a003b84ecf0e3e4edd315b202eca3f01c6c0cc"}71{"repo_name": "WinDiskWriter", "dataset": "github_2023", "owner": "TechUnRestricted", "lang": "c", "func_name": "lzms_remove_bits", "code": "static forceinline void\nlzms_remove_bits(struct lzms_input_bitstream *is, unsigned num_bits)\n{\n\tis->bitbuf <<= num_bits;\n\tis->bitsleft -= num_bits;\n}", "docstring": "/* Remove @num_bits bits from the bitbuffer variable.  */", "url": "https://github.com/TechUnRestricted/WinDiskWriter/blob/86a003b84ecf0e3e4edd315b202eca3f01c6c0cc/WinDiskWriter/libs/wimlib/src/lzms_decompress.c#L418-L423", "sha": "86a003b84ecf0e3e4edd315b202eca3f01c6c0cc"}72{"repo_name": "WinDiskWriter", "dataset": "github_2023", "owner": "TechUnRestricted", "lang": "c", "func_name": "extract_encrypted_file", "code": "static int\nextract_encrypted_file(const struct wim_dentry *dentry,\n\t\t       struct win32_apply_ctx *ctx)\n{\n\tvoid *rawctx;\n\tDWORD err;\n\tULONG flags;\n\tbool retried;\n\n\t/* Temporarily build a Win32 path for OpenEncryptedFileRaw()  */\n\tbuild_win32_extraction_path(dentry, ctx);\n\n\tflags = CREATE_FOR_IMPORT | OVERWRITE_HIDDEN;\n\tif (dentry->d_inode->i_attributes & FILE_ATTRIBUTE_DIRECTORY)\n\t\tflags |= CREATE_FOR_DIR;\n\n\tretried = false;\nretry:\n\terr = OpenEncryptedFileRaw(ctx->pathbuf.Buffer, flags, &rawctx);\n\tif (err == ERROR_SHARING_VIOLATION && !retried) {\n\t\t/* This can be caused by the handle we have open to the target\n\t\t * directory.  Try closing it temporarily.  */\n\t\tclose_target_directory(ctx);\n\t\tretried = true;\n\t\tgoto retry;\n\t}\n\n\t/* Restore the NT namespace path  */\n\tbuild_extraction_path(dentry, ctx);\n\n\tif (err != ERROR_SUCCESS) {\n\t\twin32_error(err, L\"Can't open \\\"%ls\\\" for encrypted import\",\n\t\t\t    current_path(ctx));\n\t\treturn WIMLIB_ERR_OPEN;\n\t}\n\n\tctx->encrypted_offset = 0;\n\n\terr = WriteEncryptedFileRaw(import_encrypted_data, ctx, rawctx);\n\n\tCloseEncryptedFileRaw(rawctx);\n\n\tif (err != ERROR_SUCCESS) {\n\t\twin32_error(err, L\"Can't import encrypted file \\\"%ls\\\"\",\n\t\t\t    current_path(ctx));\n\t\treturn WIMLIB_ERR_WRITE;\n\t}\n\n\treturn 0;\n}", "docstring": "/*\n * Write the raw encrypted data to the already-created file (or directory)\n * corresponding to @dentry.\n *\n * The raw encrypted data is provided in ctx->data_buffer, and its size is\n * ctx->encrypted_size.\n *\n * This function may close the target directory, in which case the caller needs\n * to re-open it if needed.\n */", "url": "https://github.com/TechUnRestricted/WinDiskWriter/blob/86a003b84ecf0e3e4edd315b202eca3f01c6c0cc/WinDiskWriter/libs/wimlib/src/win32_apply.c#L2264-L2313", "sha": "86a003b84ecf0e3e4edd315b202eca3f01c6c0cc"}73{"repo_name": "WinDiskWriter", "dataset": "github_2023", "owner": "TechUnRestricted", "lang": "c", "func_name": "generate_random_sid", "code": "static size_t\ngenerate_random_sid(wimlib_SID *sid, struct generation_context *ctx)\n{\n\tu32 r = rand32();\n\n\tsid->revision = 1;\n\n\tif (r & 1) {\n\t\t/* Common SID  */\n\t\tr = (r >> 1) % ARRAY_LEN(common_sids);\n\n\t\tsid->sub_authority_count = common_sids[r].num_subauthorities;\n\t\tfor (int i = 0; i < 6; i++) {\n\t\t\tsid->identifier_authority[i] =\n\t\t\t\tcommon_sids[r].identifier_authority >> (40 - i * 8);\n\t\t}\n\t\tfor (int i = 0; i < common_sids[r].num_subauthorities; i++)\n\t\t\tsid->sub_authority[i] = cpu_to_le32(common_sids[r].subauthorities[i]);\n\t} else {\n\t\t/* Random SID  */\n\n\t\tsid->sub_authority_count = 1 + ((r >> 1) % 15);\n\n\t\tfor (int i = 0; i < 6; i++)\n\t\t\tsid->identifier_authority[i] = rand8();\n\n\t\tfor (int i = 0; i < sid->sub_authority_count; i++)\n\t\t\tsid->sub_authority[i] = cpu_to_le32(rand32());\n\t}\n\treturn (u8 *)&sid->sub_authority[sid->sub_authority_count] - (u8 *)sid;\n}", "docstring": "/* Generate a SID and return its size in bytes.  */", "url": "https://github.com/TechUnRestricted/WinDiskWriter/blob/86a003b84ecf0e3e4edd315b202eca3f01c6c0cc/WinDiskWriter/libs/wimlib/src/test_support/test_support.c#L270-L300", "sha": "86a003b84ecf0e3e4edd315b202eca3f01c6c0cc"}74{"repo_name": "rebar", "dataset": "github_2023", "owner": "BurntSushi", "lang": "c", "func_name": "show_parsed", "code": "static void show_parsed(compile_block *cb)\n{\nuint32_t *pptr = cb->parsed_pattern;\n\nfor (;;)\n  {\n  int max, min;\n  PCRE2_SIZE offset;\n  uint32_t i;\n  uint32_t length;\n  uint32_t meta_arg = META_DATA(*pptr);\n\n  fprintf(stderr, \"+++ %02d %.8x \", (int)(pptr - cb->parsed_pattern), *pptr);\n\n  if (*pptr < META_END)\n    {\n    if (*pptr > 32 && *pptr < 128) fprintf(stderr, \"%c\", *pptr);\n    pptr++;\n    }\n\n  else switch (META_CODE(*pptr++))\n    {\n    default:\n    fprintf(stderr, \"**** OOPS - unknown META value - giving up ****\\n\");\n    return;\n\n    case META_END:\n    fprintf(stderr, \"META_END\\n\");\n    return;\n\n    case META_CAPTURE:\n    fprintf(stderr, \"META_CAPTURE %d\", meta_arg);\n    break;\n\n    case META_RECURSE:\n    GETOFFSET(offset, pptr);\n    fprintf(stderr, \"META_RECURSE %d %zd\", meta_arg, offset);\n    break;\n\n    case META_BACKREF:\n    if (meta_arg < 10)\n      offset = cb->small_ref_offset[meta_arg];\n    else\n      GETOFFSET(offset, pptr);\n    fprintf(stderr, \"META_BACKREF %d %zd\", meta_arg, offset);\n    break;\n\n    case META_ESCAPE:\n    if (meta_arg == ESC_P || meta_arg == ESC_p)\n      {\n      uint32_t ptype = *pptr >> 16;\n      uint32_t pvalue = *pptr++ & 0xffff;\n      fprintf(stderr, \"META \\\\%c %d %d\", (meta_arg == ESC_P)? 'P':'p',\n        ptype, pvalue);\n      }\n    else\n      {\n      uint32_t cc;\n      /* There's just one escape we might have here that isn't negated in the\n      escapes table. */\n      if (meta_arg == ESC_g) cc = CHAR_g;\n      else for (cc = ESCAPES_FIRST; cc <= ESCAPES_LAST; cc++)\n        {\n        if (meta_arg == (uint32_t)(-escapes[cc - ESCAPES_FIRST])) break;\n        }\n      if (cc > ESCAPES_LAST) cc = CHAR_QUESTION_MARK;\n      fprintf(stderr, \"META \\\\%c\", cc);\n      }\n    break;\n\n    case META_MINMAX:\n    min = *pptr++;\n    max = *pptr++;\n    if (max != REPEAT_UNLIMITED)\n      fprintf(stderr, \"META {%d,%d}\", min, max);\n    else\n      fprintf(stderr, \"META {%d,}\", min);\n    break;\n\n    case META_MINMAX_QUERY:\n    min = *pptr++;\n    max = *pptr++;\n    if (max != REPEAT_UNLIMITED)\n      fprintf(stderr, \"META {%d,%d}?\", min, max);\n    else\n      fprintf(stderr, \"META {%d,}?\", min);\n    break;\n\n    case META_MINMAX_PLUS:\n    min = *pptr++;\n    max = *pptr++;\n    if (max != REPEAT_UNLIMITED)\n      fprintf(stderr, \"META {%d,%d}+\", min, max);\n    else\n      fprintf(stderr, \"META {%d,}+\", min);\n    break;\n\n    case META_BIGVALUE: fprintf(stderr, \"META_BIGVALUE %.8x\", *pptr++); break;\n    case META_CIRCUMFLEX: fprintf(stderr, \"META_CIRCUMFLEX\"); break;\n    case META_COND_ASSERT: fprintf(stderr, \"META_COND_ASSERT\"); break;\n    case META_DOLLAR: fprintf(stderr, \"META_DOLLAR\"); break;\n    case META_DOT: fprintf(stderr, \"META_DOT\"); break;\n    case META_ASTERISK: fprintf(stderr, \"META *\"); break;\n    case META_ASTERISK_QUERY: fprintf(stderr, \"META *?\"); break;\n    case META_ASTERISK_PLUS: fprintf(stderr, \"META *+\"); break;\n    case META_PLUS: fprintf(stderr, \"META +\"); break;\n    case META_PLUS_QUERY: fprintf(stderr, \"META +?\"); break;\n    case META_PLUS_PLUS: fprintf(stderr, \"META ++\"); break;\n    case META_QUERY: fprintf(stderr, \"META ?\"); break;\n    case META_QUERY_QUERY: fprintf(stderr, \"META ??\"); break;\n    case META_QUERY_PLUS: fprintf(stderr, \"META ?+\"); break;\n\n    case META_ATOMIC: fprintf(stderr, \"META (?>\"); break;\n    case META_NOCAPTURE: fprintf(stderr, \"META (?:\"); break;\n    case META_LOOKAHEAD: fprintf(stderr, \"META (?=\"); break;\n    case META_LOOKAHEADNOT: fprintf(stderr, \"META (?!\"); break;\n    case META_LOOKAHEAD_NA: fprintf(stderr, \"META (*napla:\"); break;\n    case META_SCRIPT_RUN: fprintf(stderr, \"META (*sr:\"); break;\n    case META_KET: fprintf(stderr, \"META )\"); break;\n    case META_ALT: fprintf(stderr, \"META | %d\", meta_arg); break;\n\n    case META_CLASS: fprintf(stderr, \"META [\"); break;\n    case META_CLASS_NOT: fprintf(stderr, \"META [^\"); break;\n    case META_CLASS_END: fprintf(stderr, \"META ]\"); break;\n    case META_CLASS_EMPTY: fprintf(stderr, \"META []\"); break;\n    case META_CLASS_EMPTY_NOT: fprintf(stderr, \"META [^]\"); break;\n\n    case META_RANGE_LITERAL: fprintf(stderr, \"META - (literal)\"); break;\n    case META_RANGE_ESCAPED: fprintf(stderr, \"META - (escaped)\"); break;\n\n    case META_POSIX: fprintf(stderr, \"META_POSIX %d\", *pptr++); break;\n    case META_POSIX_NEG: fprintf(stderr, \"META_POSIX_NEG %d\", *pptr++); break;\n\n    case META_ACCEPT: fprintf(stderr, \"META (*ACCEPT)\"); break;\n    case META_FAIL: fprintf(stderr, \"META (*FAIL)\"); break;\n    case META_COMMIT: fprintf(stderr, \"META (*COMMIT)\"); break;\n    case META_PRUNE: fprintf(stderr, \"META (*PRUNE)\"); break;\n    case META_SKIP: fprintf(stderr, \"META (*SKIP)\"); break;\n    case META_THEN: fprintf(stderr, \"META (*THEN)\"); break;\n\n    case META_OPTIONS: fprintf(stderr, \"META_OPTIONS 0x%02x\", *pptr++); break;\n\n    case META_LOOKBEHIND:\n    fprintf(stderr, \"META (?<= %d offset=\", meta_arg);\n    GETOFFSET(offset, pptr);\n    fprintf(stderr, \"%zd\", offset);\n    break;\n\n    case META_LOOKBEHIND_NA:\n    fprintf(stderr, \"META (*naplb: %d offset=\", meta_arg);\n    GETOFFSET(offset, pptr);\n    fprintf(stderr, \"%zd\", offset);\n    break;\n\n    case META_LOOKBEHINDNOT:\n    fprintf(stderr, \"META (?<! %d offset=\", meta_arg);\n    GETOFFSET(offset, pptr);\n    fprintf(stderr, \"%zd\", offset);\n    break;\n\n    case META_CALLOUT_NUMBER:\n    fprintf(stderr, \"META (?C%d) next=%d/%d\", pptr[2], pptr[0],\n       pptr[1]);\n    pptr += 3;\n    break;\n\n    case META_CALLOUT_STRING:\n      {\n      uint32_t patoffset = *pptr++;    /* Offset of next pattern item */\n      uint32_t patlength = *pptr++;    /* Length of next pattern item */\n      fprintf(stderr, \"META (?Cstring) length=%d offset=\", *pptr++);\n      GETOFFSET(offset, pptr);\n      fprintf(stderr, \"%zd next=%d/%d\", offset, patoffset, patlength);\n      }\n    break;\n\n    case META_RECURSE_BYNAME:\n    fprintf(stderr, \"META (?(&name) length=%d offset=\", *pptr++);\n    GETOFFSET(offset, pptr);\n    fprintf(stderr, \"%zd\", offset);\n    break;\n\n    case META_BACKREF_BYNAME:\n    fprintf(stderr, \"META_BACKREF_BYNAME length=%d offset=\", *pptr++);\n    GETOFFSET(offset, pptr);\n    fprintf(stderr, \"%zd\", offset);\n    break;\n\n    case META_COND_NUMBER:\n    fprintf(stderr, \"META_COND_NUMBER %d offset=\", pptr[SIZEOFFSET]);\n    GETOFFSET(offset, pptr);\n    fprintf(stderr, \"%zd\", offset);\n    pptr++;\n    break;\n\n    case META_COND_DEFINE:\n    fprintf(stderr, \"META (?(DEFINE) offset=\");\n    GETOFFSET(offset, pptr);\n    fprintf(stderr, \"%zd\", offset);\n    break;\n\n    case META_COND_VERSION:\n    fprintf(stderr, \"META (?(VERSION%s\", (*pptr++ == 0)? \"=\" : \">=\");\n    fprintf(stderr, \"%d.\", *pptr++);\n    fprintf(stderr, \"%d)\", *pptr++);\n    break;\n\n    case META_COND_NAME:\n    fprintf(stderr, \"META (?(<name>) length=%d offset=\", *pptr++);\n    GETOFFSET(offset, pptr);\n    fprintf(stderr, \"%zd\", offset);\n    break;\n\n    case META_COND_RNAME:\n    fprintf(stderr, \"META (?(R&name) length=%d offset=\", *pptr++);\n    GETOFFSET(offset, pptr);\n    fprintf(stderr, \"%zd\", offset);\n    break;\n\n    /* This is kept as a name, because it might be. */\n\n    case META_COND_RNUMBER:\n    fprintf(stderr, \"META (?(Rnumber) length=%d offset=\", *pptr++);\n    GETOFFSET(offset, pptr);\n    fprintf(stderr, \"%zd\", offset);\n    break;\n\n    case META_MARK:\n    fprintf(stderr, \"META (*MARK:\");\n    goto SHOWARG;\n\n    case META_COMMIT_ARG:\n    fprintf(stderr, \"META (*COMMIT:\");\n    goto SHOWARG;\n\n    case META_PRUNE_ARG:\n    fprintf(stderr, \"META (*PRUNE:\");\n    goto SHOWARG;\n\n    case META_SKIP_ARG:\n    fprintf(stderr, \"META (*SKIP:\");\n    goto SHOWARG;\n\n    case META_THEN_ARG:\n    fprintf(stderr, \"META (*THEN:\");\n    SHOWARG:\n    length = *pptr++;\n    for (i = 0; i < length; i++)\n      {\n      uint32_t cc = *pptr++;\n      if (cc > 32 && cc < 128) fprintf(stderr, \"%c\", cc);\n        else fprintf(stderr, \"\\\\x{%x}\", cc);\n      }\n    fprintf(stderr, \") length=%u\", length);\n    break;\n    }\n  fprintf(stderr, \"\\n\");\n  }\nreturn;\n}", "docstring": "/*************************************************\n*     Show the parsed pattern for debugging      *\n*************************************************/\n/* For debugging the pre-scan, this code, which outputs the parsed data vector,\ncan be enabled. */", "url": "https://github.com/BurntSushi/rebar/blob/19aa8e8e3bd3a4bc0ef6e07774d900e5f4840fad/engines/pcre2/upstream/src/pcre2_compile.c#L922-L1181", "sha": "19aa8e8e3bd3a4bc0ef6e07774d900e5f4840fad"}75{"repo_name": "rebar", "dataset": "github_2023", "owner": "BurntSushi", "lang": "c", "func_name": "convert_glob_char_in_class", "code": "static BOOL\nconvert_glob_char_in_class(int class_index, PCRE2_UCHAR c)\n{\nswitch (class_index)\n  {\n  case 1: return isalnum(c);\n  case 2: return isalpha(c);\n  case 3: return 1;\n  case 4: return c == CHAR_HT || c == CHAR_SPACE;\n  case 5: return iscntrl(c);\n  case 6: return isdigit(c);\n  case 7: return isgraph(c);\n  case 8: return islower(c);\n  case 9: return isprint(c);\n  case 10: return ispunct(c);\n  case 11: return isspace(c);\n  case 12: return isupper(c);\n  case 13: return isalnum(c) || c == CHAR_UNDERSCORE;\n  default: return isxdigit(c);\n  }\n}", "docstring": "/* Checks whether the character is in the class.\n\nArguments:\n  class_index    class index\n  c              character\n\nReturns:   !0 => character is found in the class\n            0 => otherwise\n*/", "url": "https://github.com/BurntSushi/rebar/blob/19aa8e8e3bd3a4bc0ef6e07774d900e5f4840fad/engines/pcre2/upstream/src/pcre2_convert.c#L540-L560", "sha": "19aa8e8e3bd3a4bc0ef6e07774d900e5f4840fad"}76{"repo_name": "GEARdrones", "dataset": "github_2023", "owner": "Excitablecell", "lang": "c", "func_name": "arm_cmplx_mult_real_f32", "code": "void arm_cmplx_mult_real_f32(\n  float32_t * pSrcCmplx,\n  float32_t * pSrcReal,\n  float32_t * pCmplxDst,\n  uint32_t numSamples)\n{\n  float32_t in;                                  /* Temporary variable to store input value */\n  uint32_t blkCnt;                               /* loop counters */\n\n#if defined (ARM_MATH_DSP)\n\n  /* Run the below code for Cortex-M4 and Cortex-M3 */\n  float32_t inA1, inA2, inA3, inA4;              /* Temporary variables to hold input data */\n  float32_t inA5, inA6, inA7, inA8;              /* Temporary variables to hold input data */\n  float32_t inB1, inB2, inB3, inB4;              /* Temporary variables to hold input data */\n  float32_t out1, out2, out3, out4;              /* Temporary variables to hold output data */\n  float32_t out5, out6, out7, out8;              /* Temporary variables to hold output data */\n\n  /* loop Unrolling */\n  blkCnt = numSamples >> 2U;\n\n  /* First part of the processing with loop unrolling.  Compute 4 outputs at a time.\n   ** a second loop below computes the remaining 1 to 3 samples. */\n  while (blkCnt > 0U)\n  {\n    /* C[2 * i] = A[2 * i] * B[i].            */\n    /* C[2 * i + 1] = A[2 * i + 1] * B[i].        */\n    /* read input from complex input buffer */\n    inA1 = pSrcCmplx[0];\n    inA2 = pSrcCmplx[1];\n    /* read input from real input buffer */\n    inB1 = pSrcReal[0];\n\n    /* read input from complex input buffer */\n    inA3 = pSrcCmplx[2];\n\n    /* multiply complex buffer real input with real buffer input */\n    out1 = inA1 * inB1;\n\n    /* read input from complex input buffer */\n    inA4 = pSrcCmplx[3];\n\n    /* multiply complex buffer imaginary input with real buffer input */\n    out2 = inA2 * inB1;\n\n    /* read input from real input buffer */\n    inB2 = pSrcReal[1];\n    /* read input from complex input buffer */\n    inA5 = pSrcCmplx[4];\n\n    /* multiply complex buffer real input with real buffer input */\n    out3 = inA3 * inB2;\n\n    /* read input from complex input buffer */\n    inA6 = pSrcCmplx[5];\n    /* read input from real input buffer */\n    inB3 = pSrcReal[2];\n\n    /* multiply complex buffer imaginary input with real buffer input */\n    out4 = inA4 * inB2;\n\n    /* read input from complex input buffer */\n    inA7 = pSrcCmplx[6];\n\n    /* multiply complex buffer real input with real buffer input */\n    out5 = inA5 * inB3;\n\n    /* read input from complex input buffer */\n    inA8 = pSrcCmplx[7];\n\n    /* multiply complex buffer imaginary input with real buffer input */\n    out6 = inA6 * inB3;\n\n    /* read input from real input buffer */\n    inB4 = pSrcReal[3];\n\n    /* store result to destination bufer */\n    pCmplxDst[0] = out1;\n\n    /* multiply complex buffer real input with real buffer input */\n    out7 = inA7 * inB4;\n\n    /* store result to destination bufer */\n    pCmplxDst[1] = out2;\n\n    /* multiply complex buffer imaginary input with real buffer input */\n    out8 = inA8 * inB4;\n\n    /* store result to destination bufer */\n    pCmplxDst[2] = out3;\n    pCmplxDst[3] = out4;\n    pCmplxDst[4] = out5;\n\n    /* incremnet complex input buffer by 8 to process next samples */\n    pSrcCmplx += 8U;\n\n    /* store result to destination bufer */\n    pCmplxDst[5] = out6;\n\n    /* increment real input buffer by 4 to process next samples */\n    pSrcReal += 4U;\n\n    /* store result to destination bufer */\n    pCmplxDst[6] = out7;\n    pCmplxDst[7] = out8;\n\n    /* increment destination buffer by 8 to process next sampels */\n    pCmplxDst += 8U;\n\n    /* Decrement the numSamples loop counter */\n    blkCnt--;\n  }\n\n  /* If the numSamples is not a multiple of 4, compute any remaining output samples here.\n   ** No loop unrolling is used. */\n  blkCnt = numSamples % 0x4U;\n\n#else\n\n  /* Run the below code for Cortex-M0 */\n  blkCnt = numSamples;\n\n#endif /* #if defined (ARM_MATH_DSP) */\n\n  while (blkCnt > 0U)\n  {\n    /* C[2 * i] = A[2 * i] * B[i].            */\n    /* C[2 * i + 1] = A[2 * i + 1] * B[i].        */\n    in = *pSrcReal++;\n    /* store the result in the destination buffer. */\n    *pCmplxDst++ = (*pSrcCmplx++) * (in);\n    *pCmplxDst++ = (*pSrcCmplx++) * (in);\n\n    /* Decrement the numSamples loop counter */\n    blkCnt--;\n  }\n}", "docstring": "/**\n * @ingroup groupCmplxMath\n */\n/**\n * @defgroup CmplxByRealMult Complex-by-Real Multiplication\n *\n * Multiplies a complex vector by a real vector and generates a complex result.\n * The data in the complex arrays is stored in an interleaved fashion\n * (real, imag, real, imag, ...).\n * The parameter <code>numSamples</code> represents the number of complex\n * samples processed.  The complex arrays have a total of <code>2*numSamples</code>\n * real values while the real array has a total of <code>numSamples</code>\n * real values.\n *\n * The underlying algorithm is used:\n *\n * <pre>\n * for(n=0; n<numSamples; n++) {\n *     pCmplxDst[(2*n)+0] = pSrcCmplx[(2*n)+0] * pSrcReal[n];\n *     pCmplxDst[(2*n)+1] = pSrcCmplx[(2*n)+1] * pSrcReal[n];\n * }\n * </pre>\n *\n * There are separate functions for floating-point, Q15, and Q31 data types.\n */\n/**\n * @addtogroup CmplxByRealMult\n * @{\n */\n/**\n * @brief  Floating-point complex-by-real multiplication\n * @param[in]  *pSrcCmplx points to the complex input vector\n * @param[in]  *pSrcReal points to the real input vector\n * @param[out]  *pCmplxDst points to the complex output vector\n * @param[in]  numSamples number of samples in each vector\n * @return none.\n */", "url": "https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone-F4/Drivers/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mult_real_f32.c#L73-L209", "sha": "489001958d76c251128a953a47555c68bfe65fd8"}77{"repo_name": "GEARdrones", "dataset": "github_2023", "owner": "Excitablecell", "lang": "c", "func_name": "HAL_DCMI_EnableCrop", "code": "HAL_StatusTypeDef HAL_DCMI_EnableCrop(DCMI_HandleTypeDef *hdcmi)\n{\n  /* Process Locked */\n  __HAL_LOCK(hdcmi);\n\n  /* Lock the DCMI peripheral state */\n  hdcmi->State = HAL_DCMI_STATE_BUSY;\n\n  /* Enable DCMI Crop feature */\n  hdcmi->Instance->CR |= (uint32_t)DCMI_CR_CROP;\n\n  /* Change the DCMI state*/\n  hdcmi->State = HAL_DCMI_STATE_READY;\n\n  /* Process Unlocked */\n  __HAL_UNLOCK(hdcmi);\n\n  return HAL_OK;\n}", "docstring": "/**\n  * @brief  Enable the Crop feature.\n  * @param  hdcmi pointer to a DCMI_HandleTypeDef structure that contains\n  *                the configuration information for DCMI.\n  * @retval HAL status\n  */", "url": "https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone-F4/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dcmi.c#L795-L813", "sha": "489001958d76c251128a953a47555c68bfe65fd8"}78{"repo_name": "GEARdrones", "dataset": "github_2023", "owner": "Excitablecell", "lang": "c", "func_name": "HAL_DSI_Start", "code": "HAL_StatusTypeDef HAL_DSI_Start(DSI_HandleTypeDef *hdsi)\n{\n  /* Process locked */\n  __HAL_LOCK(hdsi);\n\n  /* Enable the DSI host */\n  __HAL_DSI_ENABLE(hdsi);\n\n  /* Enable the DSI wrapper */\n  __HAL_DSI_WRAPPER_ENABLE(hdsi);\n\n  /* Process unlocked */\n  __HAL_UNLOCK(hdsi);\n\n  return HAL_OK;\n}", "docstring": "/**\n  * @brief  Start the DSI module\n  * @param  hdsi  pointer to a DSI_HandleTypeDef structure that contains\n  *               the configuration information for the DSI.\n  * @retval HAL status\n  */", "url": "https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone-F4/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dsi.c#L1452-L1467", "sha": "489001958d76c251128a953a47555c68bfe65fd8"}79{"repo_name": "GEARdrones", "dataset": "github_2023", "owner": "Excitablecell", "lang": "c", "func_name": "HAL_FMPI2C_Master_Transmit_IT", "code": "HAL_StatusTypeDef HAL_FMPI2C_Master_Transmit_IT(FMPI2C_HandleTypeDef *hfmpi2c, uint16_t DevAddress, uint8_t *pData,\n                                             uint16_t Size)\n{\n  uint32_t xfermode;\n\n  if (hfmpi2c->State == HAL_FMPI2C_STATE_READY)\n  {\n    if (__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_BUSY) == SET)\n    {\n      return HAL_BUSY;\n    }\n\n    /* Process Locked */\n    __HAL_LOCK(hfmpi2c);\n\n    hfmpi2c->State       = HAL_FMPI2C_STATE_BUSY_TX;\n    hfmpi2c->Mode        = HAL_FMPI2C_MODE_MASTER;\n    hfmpi2c->ErrorCode   = HAL_FMPI2C_ERROR_NONE;\n\n    /* Prepare transfer parameters */\n    hfmpi2c->pBuffPtr    = pData;\n    hfmpi2c->XferCount   = Size;\n    hfmpi2c->XferOptions = FMPI2C_NO_OPTION_FRAME;\n    hfmpi2c->XferISR     = FMPI2C_Master_ISR_IT;\n\n    if (hfmpi2c->XferCount > MAX_NBYTE_SIZE)\n    {\n      hfmpi2c->XferSize = MAX_NBYTE_SIZE;\n      xfermode = FMPI2C_RELOAD_MODE;\n    }\n    else\n    {\n      hfmpi2c->XferSize = hfmpi2c->XferCount;\n      xfermode = FMPI2C_AUTOEND_MODE;\n    }\n\n    /* Send Slave Address */\n    /* Set NBYTES to write and reload if hfmpi2c->XferCount > MAX_NBYTE_SIZE */\n    FMPI2C_TransferConfig(hfmpi2c, DevAddress, (uint8_t)hfmpi2c->XferSize, xfermode, FMPI2C_GENERATE_START_WRITE);\n\n    /* Process Unlocked */\n    __HAL_UNLOCK(hfmpi2c);\n\n    /* Note : The FMPI2C interrupts must be enabled after unlocking current process\n              to avoid the risk of FMPI2C interrupt handle execution before current\n              process unlock */\n\n    /* Enable ERR, TC, STOP, NACK, TXI interrupt */\n    /* possible to enable all of these */\n    /* FMPI2C_IT_ERRI | FMPI2C_IT_TCI | FMPI2C_IT_STOPI | FMPI2C_IT_NACKI |\n      FMPI2C_IT_ADDRI | FMPI2C_IT_RXI | FMPI2C_IT_TXI */\n    FMPI2C_Enable_IRQ(hfmpi2c, FMPI2C_XFER_TX_IT);\n\n    return HAL_OK;\n  }\n  else\n  {\n    return HAL_BUSY;\n  }\n}", "docstring": "/**\n  * @brief  Transmit in master mode an amount of data in non-blocking mode with Interrupt\n  * @param  hfmpi2c Pointer to a FMPI2C_HandleTypeDef structure that contains\n  *                the configuration information for the specified FMPI2C.\n  * @param  DevAddress Target device address: The device 7 bits address value\n  *         in datasheet must be shifted to the left before calling the interface\n  * @param  pData Pointer to data buffer\n  * @param  Size Amount of data to be sent\n  * @retval HAL status\n  */", "url": "https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone-F4/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_fmpi2c.c#L1614-L1673", "sha": "489001958d76c251128a953a47555c68bfe65fd8"}80{"repo_name": "GEARdrones", "dataset": "github_2023", "owner": "Excitablecell", "lang": "c", "func_name": "HAL_I2SEx_TransmitReceive_DMA", "code": "HAL_StatusTypeDef HAL_I2SEx_TransmitReceive_DMA(I2S_HandleTypeDef *hi2s,\n                                                uint16_t *pTxData,\n                                                uint16_t *pRxData,\n                                                uint16_t Size)\n{\n  uint32_t *tmp = NULL;\n  uint32_t tmp1 = 0U;\n  HAL_StatusTypeDef errorcode = HAL_OK;\n\n  if (hi2s->State != HAL_I2S_STATE_READY)\n  {\n    errorcode = HAL_BUSY;\n    goto error;\n  }\n\n  if ((pTxData == NULL) || (pRxData == NULL) || (Size == 0U))\n  {\n    return  HAL_ERROR;\n  }\n\n  /* Process Locked */\n  __HAL_LOCK(hi2s);\n\n  hi2s->pTxBuffPtr = pTxData;\n  hi2s->pRxBuffPtr = pRxData;\n\n  tmp1 = hi2s->Instance->I2SCFGR & (SPI_I2SCFGR_DATLEN | SPI_I2SCFGR_CHLEN);\n  /* Check the Data format: When a 16-bit data frame or a 16-bit data frame extended\n  is selected during the I2S configuration phase, the Size parameter means the number\n  of 16-bit data length in the transaction and when a 24-bit data frame or a 32-bit data\n  frame is selected the Size parameter means the number of 16-bit data length. */\n  if ((tmp1 == I2S_DATAFORMAT_24B) || (tmp1 == I2S_DATAFORMAT_32B))\n  {\n    hi2s->TxXferSize  = (Size << 1U);\n    hi2s->TxXferCount = (Size << 1U);\n    hi2s->RxXferSize  = (Size << 1U);\n    hi2s->RxXferCount = (Size << 1U);\n  }\n  else\n  {\n    hi2s->TxXferSize  = Size;\n    hi2s->TxXferCount = Size;\n    hi2s->RxXferSize  = Size;\n    hi2s->RxXferCount = Size;\n  }\n\n  hi2s->ErrorCode = HAL_I2S_ERROR_NONE;\n  hi2s->State     = HAL_I2S_STATE_BUSY_TX_RX;\n\n  /* Set the I2S Rx DMA Half transfer complete callback */\n  hi2s->hdmarx->XferHalfCpltCallback = I2SEx_TxRxDMAHalfCplt;\n\n  /* Set the I2S Rx DMA transfer complete callback */\n  hi2s->hdmarx->XferCpltCallback  = I2SEx_TxRxDMACplt;\n\n  /* Set the I2S Rx DMA error callback */\n  hi2s->hdmarx->XferErrorCallback = I2SEx_TxRxDMAError;\n\n  /* Set the I2S Tx DMA Half transfer complete callback as NULL */\n  hi2s->hdmatx->XferHalfCpltCallback  = NULL;\n\n  /* Set the I2S Tx DMA transfer complete callback as NULL */\n  hi2s->hdmatx->XferCpltCallback  = NULL;\n\n  /* Set the I2S Tx DMA error callback */\n  hi2s->hdmatx->XferErrorCallback = I2SEx_TxRxDMAError;\n\n  tmp1 = hi2s->Instance->I2SCFGR & SPI_I2SCFGR_I2SCFG;\n  /* Check if the I2S_MODE_MASTER_TX or I2S_MODE_SLAVE_TX Mode is selected */\n  if ((tmp1 == I2S_MODE_MASTER_TX) || (tmp1 == I2S_MODE_SLAVE_TX))\n  {\n    /* Enable the Rx DMA Stream */\n    tmp = (uint32_t *)&pRxData;\n    HAL_DMA_Start_IT(hi2s->hdmarx, (uint32_t)&I2SxEXT(hi2s->Instance)->DR, *(uint32_t *)tmp, hi2s->RxXferSize);\n\n    /* Enable Rx DMA Request */\n    SET_BIT(I2SxEXT(hi2s->Instance)->CR2, SPI_CR2_RXDMAEN);\n\n    /* Enable the Tx DMA Stream */\n    tmp = (uint32_t *)&pTxData;\n    HAL_DMA_Start_IT(hi2s->hdmatx, *(uint32_t *)tmp, (uint32_t)&hi2s->Instance->DR, hi2s->TxXferSize);\n\n    /* Enable Tx DMA Request */\n    SET_BIT(hi2s->Instance->CR2, SPI_CR2_TXDMAEN);\n\n    /* Check if the I2S is already enabled */\n    if ((hi2s->Instance->I2SCFGR & SPI_I2SCFGR_I2SE) != SPI_I2SCFGR_I2SE)\n    {\n      /* Enable I2Sext(receiver) before enabling I2Sx peripheral */\n      __HAL_I2SEXT_ENABLE(hi2s);\n\n      /* Enable I2S peripheral after the I2Sext */\n      __HAL_I2S_ENABLE(hi2s);\n    }\n  }\n  else\n  {\n    /* Check if Master Receiver mode is selected */\n    if ((hi2s->Instance->I2SCFGR & SPI_I2SCFGR_I2SCFG) == I2S_MODE_MASTER_RX)\n    {\n      /* Clear the Overrun Flag by a read operation on the SPI_DR register followed by a read\n      access to the SPI_SR register. */\n      __HAL_I2S_CLEAR_OVRFLAG(hi2s);\n    }\n    /* Enable the Tx DMA Stream */\n    tmp = (uint32_t *)&pTxData;\n    HAL_DMA_Start_IT(hi2s->hdmatx, *(uint32_t *)tmp, (uint32_t)&I2SxEXT(hi2s->Instance)->DR, hi2s->TxXferSize);\n\n    /* Enable Tx DMA Request */\n    SET_BIT(I2SxEXT(hi2s->Instance)->CR2, SPI_CR2_TXDMAEN);\n\n    /* Enable the Rx DMA Stream */\n    tmp = (uint32_t *)&pRxData;\n    HAL_DMA_Start_IT(hi2s->hdmarx, (uint32_t)&hi2s->Instance->DR, *(uint32_t *)tmp, hi2s->RxXferSize);\n\n    /* Enable Rx DMA Request */\n    SET_BIT(hi2s->Instance->CR2, SPI_CR2_RXDMAEN);\n\n    /* Check if the I2S is already enabled */\n    if ((hi2s->Instance->I2SCFGR & SPI_I2SCFGR_I2SE) != SPI_I2SCFGR_I2SE)\n    {\n      /* Enable I2Sext(transmitter) before enabling I2Sx peripheral */\n      __HAL_I2SEXT_ENABLE(hi2s);\n      /* Enable I2S peripheral before the I2Sext */\n      __HAL_I2S_ENABLE(hi2s);\n    }\n  }\n\nerror :\n  __HAL_UNLOCK(hi2s);\n  return errorcode;\n}", "docstring": "/**\n  * @brief  Full-Duplex Transmit/Receive data in non-blocking mode using DMA\n  * @param  hi2s pointer to a I2S_HandleTypeDef structure that contains\n  *         the configuration information for I2S module\n  * @param  pTxData a 16-bit pointer to the Transmit data buffer.\n  * @param  pRxData a 16-bit pointer to the Receive data buffer.\n  * @param  Size number of data sample to be sent:\n  * @note   When a 16-bit data frame or a 16-bit data frame extended is selected during the I2S\n  *         configuration phase, the Size parameter means the number of 16-bit data length\n  *         in the transaction and when a 24-bit data frame or a 32-bit data frame is selected\n  *         the Size parameter means the number of 16-bit data length.\n  * @note   The I2S is kept enabled at the end of transaction to avoid the clock de-synchronization\n  *         between Master and Slave(example: audio streaming).\n  * @retval HAL status\n  */", "url": "https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone-F4/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2s_ex.c#L541-L672", "sha": "489001958d76c251128a953a47555c68bfe65fd8"}81{"repo_name": "GEARdrones", "dataset": "github_2023", "owner": "Excitablecell", "lang": "c", "func_name": "HAL_LTDC_EnableDither", "code": "HAL_StatusTypeDef HAL_LTDC_EnableDither(LTDC_HandleTypeDef *hltdc)\n{\n  /* Process locked */\n  __HAL_LOCK(hltdc);\n\n  /* Change LTDC peripheral state */\n  hltdc->State = HAL_LTDC_STATE_BUSY;\n\n  /* Enable Dither by setting DTEN bit */\n  LTDC->GCR |= (uint32_t)LTDC_GCR_DEN;\n\n  /* Change the LTDC state*/\n  hltdc->State = HAL_LTDC_STATE_READY;\n\n  /* Process unlocked */\n  __HAL_UNLOCK(hltdc);\n\n  return HAL_OK;\n}", "docstring": "/**\n  * @brief  Enable Dither.\n  * @param  hltdc  pointer to a LTDC_HandleTypeDef structure that contains\n  *                the configuration information for the LTDC.\n  * @retval  HAL status\n  */", "url": "https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone-F4/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_ltdc.c#L1059-L1077", "sha": "489001958d76c251128a953a47555c68bfe65fd8"}82{"repo_name": "GEARdrones", "dataset": "github_2023", "owner": "Excitablecell", "lang": "c", "func_name": "HAL_PCCARD_ITCallback", "code": "__weak void HAL_PCCARD_ITCallback(PCCARD_HandleTypeDef *hpccard)\n{\n  /* Prevent unused argument(s) compilation warning */\n  UNUSED(hpccard);\n  /* NOTE : This function Should not be modified, when the callback is needed,\n            the HAL_PCCARD_ITCallback could be implemented in the user file\n   */\n}", "docstring": "/**\n  * @brief  PCCARD interrupt feature callback\n  * @param  hpccard pointer to a PCCARD_HandleTypeDef structure that contains\n  *                the configuration information for PCCARD module.\n  * @retval None\n  */", "url": "https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone-F4/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pccard.c#L678-L685", "sha": "489001958d76c251128a953a47555c68bfe65fd8"}83{"repo_name": "GEARdrones", "dataset": "github_2023", "owner": "Excitablecell", "lang": "c", "func_name": "HAL_PWREx_DisableMainRegulatorLowVoltage", "code": "void HAL_PWREx_DisableMainRegulatorLowVoltage(void)\n{\n  *(__IO uint32_t *) CR_MRLVDS_BB = (uint32_t)DISABLE;\n}", "docstring": "/**\n  * @brief Disables Main Regulator low voltage mode.\n  * @note  This mode is only available for STM32F401xx/STM32F410xx/STM32F411xx/STM32F412Zx/STM32F412Rx/STM32F412Vx/STM32F412Cx/\n  *        STM32F413xx/STM32F423xxdevices. \n  * @retval None\n  */", "url": "https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone-F4/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c#L372-L375", "sha": "489001958d76c251128a953a47555c68bfe65fd8"}84{"repo_name": "GEARdrones", "dataset": "github_2023", "owner": "Excitablecell", "lang": "c", "func_name": "HAL_RNG_ReadLastRandomNumber", "code": "uint32_t HAL_RNG_ReadLastRandomNumber(RNG_HandleTypeDef *hrng)\n{\n  return (hrng->RandomNumber);\n}", "docstring": "/**\n  * @brief  Read latest generated random number.\n  * @param  hrng pointer to a RNG_HandleTypeDef structure that contains\n  *                the configuration information for RNG.\n  * @retval random value\n  */", "url": "https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone-F4/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rng.c#L771-L774", "sha": "489001958d76c251128a953a47555c68bfe65fd8"}85{"repo_name": "GEARdrones", "dataset": "github_2023", "owner": "Excitablecell", "lang": "c", "func_name": "HAL_SMBUS_UnRegisterCallback", "code": "HAL_StatusTypeDef HAL_SMBUS_UnRegisterCallback(SMBUS_HandleTypeDef *hsmbus, HAL_SMBUS_CallbackIDTypeDef CallbackID)\n{\n  HAL_StatusTypeDef status = HAL_OK;\n\n  /* Process locked */\n  __HAL_LOCK(hsmbus);\n\n  if (HAL_SMBUS_STATE_READY == hsmbus->State)\n  {\n    switch (CallbackID)\n    {\n      case HAL_SMBUS_MASTER_TX_COMPLETE_CB_ID :\n        hsmbus->MasterTxCpltCallback = HAL_SMBUS_MasterTxCpltCallback; /* Legacy weak MasterTxCpltCallback */\n        break;\n\n      case HAL_SMBUS_MASTER_RX_COMPLETE_CB_ID :\n        hsmbus->MasterRxCpltCallback = HAL_SMBUS_MasterRxCpltCallback; /* Legacy weak MasterRxCpltCallback */\n        break;\n\n      case HAL_SMBUS_SLAVE_TX_COMPLETE_CB_ID :\n        hsmbus->SlaveTxCpltCallback = HAL_SMBUS_SlaveTxCpltCallback;   /* Legacy weak SlaveTxCpltCallback  */\n        break;\n\n      case HAL_SMBUS_SLAVE_RX_COMPLETE_CB_ID :\n        hsmbus->SlaveRxCpltCallback = HAL_SMBUS_SlaveRxCpltCallback;   /* Legacy weak SlaveRxCpltCallback  */\n        break;\n\n      case HAL_SMBUS_LISTEN_COMPLETE_CB_ID :\n        hsmbus->ListenCpltCallback = HAL_SMBUS_ListenCpltCallback;     /* Legacy weak ListenCpltCallback   */\n        break;\n\n      case HAL_SMBUS_ERROR_CB_ID :\n        hsmbus->ErrorCallback = HAL_SMBUS_ErrorCallback;               /* Legacy weak ErrorCallback        */\n        break;\n\n      case HAL_SMBUS_ABORT_CB_ID :\n        hsmbus->AbortCpltCallback = HAL_SMBUS_AbortCpltCallback;       /* Legacy weak AbortCpltCallback    */\n        break;\n\n      case HAL_SMBUS_MSPINIT_CB_ID :\n        hsmbus->MspInitCallback = HAL_SMBUS_MspInit;                   /* Legacy weak MspInit              */\n        break;\n\n      case HAL_SMBUS_MSPDEINIT_CB_ID :\n        hsmbus->MspDeInitCallback = HAL_SMBUS_MspDeInit;               /* Legacy weak MspDeInit            */\n        break;\n\n      default :\n        /* Update the error code */\n        hsmbus->ErrorCode |= HAL_SMBUS_ERROR_INVALID_CALLBACK;\n\n        /* Return error status */\n        status =  HAL_ERROR;\n        break;\n    }\n  }\n  else if (HAL_SMBUS_STATE_RESET == hsmbus->State)\n  {\n    switch (CallbackID)\n    {\n      case HAL_SMBUS_MSPINIT_CB_ID :\n        hsmbus->MspInitCallback = HAL_SMBUS_MspInit;                   /* Legacy weak MspInit              */\n        break;\n\n      case HAL_SMBUS_MSPDEINIT_CB_ID :\n        hsmbus->MspDeInitCallback = HAL_SMBUS_MspDeInit;               /* Legacy weak MspDeInit            */\n        break;\n\n      default :\n        /* Update the error code */\n        hsmbus->ErrorCode |= HAL_SMBUS_ERROR_INVALID_CALLBACK;\n\n        /* Return error status */\n        status =  HAL_ERROR;\n        break;\n    }\n  }\n  else\n  {\n    /* Update the error code */\n    hsmbus->ErrorCode |= HAL_SMBUS_ERROR_INVALID_CALLBACK;\n\n    /* Return error status */\n    status =  HAL_ERROR;\n  }\n\n  /* Release Lock */\n  __HAL_UNLOCK(hsmbus);\n  return status;\n}", "docstring": "/**\n  * @brief  Unregister an SMBUS Callback\n  *         SMBUS callback is redirected to the weak predefined callback\n  * @param  hsmbus Pointer to a SMBUS_HandleTypeDef structure that contains\n  *                the configuration information for the specified SMBUS.\n  * @param  CallbackID ID of the callback to be unregistered\n  *         This parameter can be one of the following values:\n  *         This parameter can be one of the following values:\n  *          @arg @ref HAL_SMBUS_MASTER_TX_COMPLETE_CB_ID Master Tx Transfer completed callback ID\n  *          @arg @ref HAL_SMBUS_MASTER_RX_COMPLETE_CB_ID Master Rx Transfer completed callback ID\n  *          @arg @ref HAL_SMBUS_SLAVE_TX_COMPLETE_CB_ID Slave Tx Transfer completed callback ID\n  *          @arg @ref HAL_SMBUS_SLAVE_RX_COMPLETE_CB_ID Slave Rx Transfer completed callback ID\n  *          @arg @ref HAL_SMBUS_LISTEN_COMPLETE_CB_ID Listen Complete callback ID\n  *          @arg @ref HAL_SMBUS_ERROR_CB_ID Error callback ID\n  *          @arg @ref HAL_SMBUS_ABORT_CB_ID Abort callback ID\n  *          @arg @ref HAL_SMBUS_MSPINIT_CB_ID MspInit callback ID\n  *          @arg @ref HAL_SMBUS_MSPDEINIT_CB_ID MspDeInit callback ID\n  * @retval HAL status\n  */", "url": "https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone-F4/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_smbus.c#L687-L776", "sha": "489001958d76c251128a953a47555c68bfe65fd8"}86{"repo_name": "GEARdrones", "dataset": "github_2023", "owner": "Excitablecell", "lang": "c", "func_name": "LL_DMA_Init", "code": "uint32_t LL_DMA_Init(DMA_TypeDef *DMAx, uint32_t Stream, LL_DMA_InitTypeDef *DMA_InitStruct)\n{\n  /* Check the DMA Instance DMAx and Stream parameters*/\n  assert_param(IS_LL_DMA_ALL_STREAM_INSTANCE(DMAx, Stream));\n\n  /* Check the DMA parameters from DMA_InitStruct */\n  assert_param(IS_LL_DMA_DIRECTION(DMA_InitStruct->Direction));\n  assert_param(IS_LL_DMA_MODE(DMA_InitStruct->Mode));\n  assert_param(IS_LL_DMA_PERIPHINCMODE(DMA_InitStruct->PeriphOrM2MSrcIncMode));\n  assert_param(IS_LL_DMA_MEMORYINCMODE(DMA_InitStruct->MemoryOrM2MDstIncMode));\n  assert_param(IS_LL_DMA_PERIPHDATASIZE(DMA_InitStruct->PeriphOrM2MSrcDataSize));\n  assert_param(IS_LL_DMA_MEMORYDATASIZE(DMA_InitStruct->MemoryOrM2MDstDataSize));\n  assert_param(IS_LL_DMA_NBDATA(DMA_InitStruct->NbData));\n  assert_param(IS_LL_DMA_CHANNEL(DMA_InitStruct->Channel));\n  assert_param(IS_LL_DMA_PRIORITY(DMA_InitStruct->Priority));\n  assert_param(IS_LL_DMA_FIFO_MODE_STATE(DMA_InitStruct->FIFOMode));\n  /* Check the memory burst, peripheral burst and FIFO threshold parameters only\n     when FIFO mode is enabled */\n  if(DMA_InitStruct->FIFOMode != LL_DMA_FIFOMODE_DISABLE)\n  {\n    assert_param(IS_LL_DMA_FIFO_THRESHOLD(DMA_InitStruct->FIFOThreshold));\n    assert_param(IS_LL_DMA_MEMORY_BURST(DMA_InitStruct->MemBurst));\n    assert_param(IS_LL_DMA_PERIPHERAL_BURST(DMA_InitStruct->PeriphBurst));\n  }\n\n  /*---------------------------- DMAx SxCR Configuration ------------------------\n   * Configure DMAx_Streamy: data transfer direction, data transfer mode,\n   *                          peripheral and memory increment mode,\n   *                          data size alignment and  priority level with parameters :\n   * - Direction:      DMA_SxCR_DIR[1:0] bits\n   * - Mode:           DMA_SxCR_CIRC bit\n   * - PeriphOrM2MSrcIncMode:  DMA_SxCR_PINC bit\n   * - MemoryOrM2MDstIncMode:  DMA_SxCR_MINC bit\n   * - PeriphOrM2MSrcDataSize: DMA_SxCR_PSIZE[1:0] bits\n   * - MemoryOrM2MDstDataSize: DMA_SxCR_MSIZE[1:0] bits\n   * - Priority:               DMA_SxCR_PL[1:0] bits\n   */\n  LL_DMA_ConfigTransfer(DMAx, Stream, DMA_InitStruct->Direction | \\\n                        DMA_InitStruct->Mode                    | \\\n                        DMA_InitStruct->PeriphOrM2MSrcIncMode   | \\\n                        DMA_InitStruct->MemoryOrM2MDstIncMode   | \\\n                        DMA_InitStruct->PeriphOrM2MSrcDataSize  | \\\n                        DMA_InitStruct->MemoryOrM2MDstDataSize  | \\\n                        DMA_InitStruct->Priority\n                        );\n\n  if(DMA_InitStruct->FIFOMode != LL_DMA_FIFOMODE_DISABLE)\n  {\n    /*---------------------------- DMAx SxFCR Configuration ------------------------\n     * Configure DMAx_Streamy:  fifo mode and fifo threshold with parameters :\n     * - FIFOMode:                DMA_SxFCR_DMDIS bit\n     * - FIFOThreshold:           DMA_SxFCR_FTH[1:0] bits\n     */\n    LL_DMA_ConfigFifo(DMAx, Stream, DMA_InitStruct->FIFOMode, DMA_InitStruct->FIFOThreshold);   \n\n    /*---------------------------- DMAx SxCR Configuration --------------------------\n     * Configure DMAx_Streamy:  memory burst transfer with parameters :\n     * - MemBurst:                DMA_SxCR_MBURST[1:0] bits\n     */\n    LL_DMA_SetMemoryBurstxfer(DMAx,Stream,DMA_InitStruct->MemBurst); \n\n    /*---------------------------- DMAx SxCR Configuration --------------------------\n     * Configure DMAx_Streamy:  peripheral burst transfer with parameters :\n     * - PeriphBurst:             DMA_SxCR_PBURST[1:0] bits\n     */\n    LL_DMA_SetPeriphBurstxfer(DMAx,Stream,DMA_InitStruct->PeriphBurst);\n  }\n\n  /*-------------------------- DMAx SxM0AR Configuration --------------------------\n   * Configure the memory or destination base address with parameter :\n   * - MemoryOrM2MDstAddress:     DMA_SxM0AR_M0A[31:0] bits\n   */\n  LL_DMA_SetMemoryAddress(DMAx, Stream, DMA_InitStruct->MemoryOrM2MDstAddress);\n\n  /*-------------------------- DMAx SxPAR Configuration ---------------------------\n   * Configure the peripheral or source base address with parameter :\n   * - PeriphOrM2MSrcAddress:     DMA_SxPAR_PA[31:0] bits\n   */\n  LL_DMA_SetPeriphAddress(DMAx, Stream, DMA_InitStruct->PeriphOrM2MSrcAddress);\n\n  /*--------------------------- DMAx SxNDTR Configuration -------------------------\n   * Configure the peripheral base address with parameter :\n   * - NbData:                    DMA_SxNDT[15:0] bits\n   */\n  LL_DMA_SetDataLength(DMAx, Stream, DMA_InitStruct->NbData);\n\n  /*--------------------------- DMA SxCR_CHSEL Configuration ----------------------\n   * Configure the peripheral base address with parameter :\n   * - PeriphRequest:             DMA_SxCR_CHSEL[2:0] bits\n   */\n  LL_DMA_SetChannelSelection(DMAx, Stream, DMA_InitStruct->Channel);\n\n  return SUCCESS;\n}", "docstring": "/**\n  * @brief  Initialize the DMA registers according to the specified parameters in DMA_InitStruct.\n  * @note   To convert DMAx_Streamy Instance to DMAx Instance and Streamy, use helper macros :\n  *         @arg @ref __LL_DMA_GET_INSTANCE\n  *         @arg @ref __LL_DMA_GET_STREAM\n  * @param  DMAx DMAx Instance\n  * @param  Stream This parameter can be one of the following values:\n  *         @arg @ref LL_DMA_STREAM_0\n  *         @arg @ref LL_DMA_STREAM_1\n  *         @arg @ref LL_DMA_STREAM_2\n  *         @arg @ref LL_DMA_STREAM_3\n  *         @arg @ref LL_DMA_STREAM_4\n  *         @arg @ref LL_DMA_STREAM_5\n  *         @arg @ref LL_DMA_STREAM_6\n  *         @arg @ref LL_DMA_STREAM_7\n  * @param  DMA_InitStruct pointer to a @ref LL_DMA_InitTypeDef structure.\n  * @retval An ErrorStatus enumeration value:\n  *          - SUCCESS: DMA registers are initialized\n  *          - ERROR: Not applicable\n  */", "url": "https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone-F4/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_dma.c#L285-L378", "sha": "489001958d76c251128a953a47555c68bfe65fd8"}87{"repo_name": "GEARdrones", "dataset": "github_2023", "owner": "Excitablecell", "lang": "c", "func_name": "FMC_NAND_Init", "code": "HAL_StatusTypeDef FMC_NAND_Init(FMC_NAND_TypeDef *Device, FMC_NAND_InitTypeDef *Init)\n{\n  uint32_t tmpr  = 0U; \n    \n  /* Check the parameters */\n  assert_param(IS_FMC_NAND_DEVICE(Device));\n  assert_param(IS_FMC_NAND_BANK(Init->NandBank));\n  assert_param(IS_FMC_WAIT_FEATURE(Init->Waitfeature));\n  assert_param(IS_FMC_NAND_MEMORY_WIDTH(Init->MemoryDataWidth));\n  assert_param(IS_FMC_ECC_STATE(Init->EccComputation));\n  assert_param(IS_FMC_ECCPAGE_SIZE(Init->ECCPageSize));\n  assert_param(IS_FMC_TCLR_TIME(Init->TCLRSetupTime));\n  assert_param(IS_FMC_TAR_TIME(Init->TARSetupTime));   \n\n  if(Init->NandBank == FMC_NAND_BANK2)\n  {\n    /* Get the NAND bank 2 register value */\n    tmpr = Device->PCR2;\n  }\n  else\n  {\n    /* Get the NAND bank 3 register value */\n    tmpr = Device->PCR3;\n  }\n  \n  /* Clear PWAITEN, PBKEN, PTYP, PWID, ECCEN, TCLR, TAR and ECCPS bits */\n  tmpr &= ((uint32_t)~(FMC_PCR2_PWAITEN  | FMC_PCR2_PBKEN | FMC_PCR2_PTYP | \\\n                       FMC_PCR2_PWID | FMC_PCR2_ECCEN | FMC_PCR2_TCLR | \\\n                       FMC_PCR2_TAR | FMC_PCR2_ECCPS));  \n  \n  /* Set NAND device control parameters */\n  tmpr |= (uint32_t)(Init->Waitfeature                 |\\\n                     FMC_PCR_MEMORY_TYPE_NAND          |\\\n                     Init->MemoryDataWidth             |\\\n                     Init->EccComputation              |\\\n                     Init->ECCPageSize                 |\\\n                     ((Init->TCLRSetupTime) << 9U)     |\\\n                     ((Init->TARSetupTime) << 13U));   \n  \n  if(Init->NandBank == FMC_NAND_BANK2)\n  {\n    /* NAND bank 2 registers configuration */\n    Device->PCR2  = tmpr;\n  }\n  else\n  {\n    /* NAND bank 3 registers configuration */\n    Device->PCR3  = tmpr;\n  }\n  \n  return HAL_OK;\n\n}", "docstring": "/* defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) */\n/** @defgroup HAL_FMC_NAND_Group1 Initialization/de-initialization functions \n *  @brief    Initialization and Configuration functions \n *\n@verbatim    \n  ==============================================================================\n              ##### Initialization and de_initialization functions #####\n  ==============================================================================\n  [..]  \n    This section provides functions allowing to:\n    (+) Initialize and configure the FMC NAND interface\n    (+) De-initialize the FMC NAND interface \n    (+) Configure the FMC clock and associated GPIOs\n        \n@endverbatim\n  * @{\n  */\n/**\n  * @brief  Initializes the FMC_NAND device according to the specified\n  *         control parameters in the FMC_NAND_HandleTypeDef\n  * @param  Device Pointer to NAND device instance\n  * @param  Init Pointer to NAND Initialization structure\n  * @retval HAL status\n  */", "url": "https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone-F4/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_fmc.c#L754-L806", "sha": "489001958d76c251128a953a47555c68bfe65fd8"}88{"repo_name": "GEARdrones", "dataset": "github_2023", "owner": "Excitablecell", "lang": "c", "func_name": "LL_LPTIM_StructInit", "code": "void LL_LPTIM_StructInit(LL_LPTIM_InitTypeDef *LPTIM_InitStruct)\n{\n  /* Set the default configuration */\n  LPTIM_InitStruct->ClockSource = LL_LPTIM_CLK_SOURCE_INTERNAL;\n  LPTIM_InitStruct->Prescaler   = LL_LPTIM_PRESCALER_DIV1;\n  LPTIM_InitStruct->Waveform    = LL_LPTIM_OUTPUT_WAVEFORM_PWM;\n  LPTIM_InitStruct->Polarity    = LL_LPTIM_OUTPUT_POLARITY_REGULAR;\n}", "docstring": "/**\n  * @brief  Set each fields of the LPTIM_InitStruct structure to its default\n  *         value.\n  * @param  LPTIM_InitStruct pointer to a @ref LL_LPTIM_InitTypeDef structure\n  * @retval None\n  */", "url": "https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone-F4/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_lptim.c#L122-L129", "sha": "489001958d76c251128a953a47555c68bfe65fd8"}89{"repo_name": "GEARdrones", "dataset": "github_2023", "owner": "Excitablecell", "lang": "c", "func_name": "USB_DisableGlobalInt", "code": "HAL_StatusTypeDef USB_DisableGlobalInt(USB_OTG_GlobalTypeDef *USBx)\n{\n  USBx->GAHBCFG &= ~USB_OTG_GAHBCFG_GINT;\n  return HAL_OK;\n}", "docstring": "/**\n  * @brief  USB_DisableGlobalInt\n  *         Disable the controller's Global Int in the AHB Config reg\n  * @param  USBx  Selected device\n  * @retval HAL status\n  */", "url": "https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone-F4/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c#L234-L238", "sha": "489001958d76c251128a953a47555c68bfe65fd8"}90{"repo_name": "GEARdrones", "dataset": "github_2023", "owner": "Excitablecell", "lang": "c", "func_name": "USB_ResetPort", "code": "HAL_StatusTypeDef USB_ResetPort(USB_OTG_GlobalTypeDef *USBx)\n{\n  uint32_t USBx_BASE = (uint32_t)USBx;\n\n  __IO uint32_t hprt0 = 0U;\n\n  hprt0 = USBx_HPRT0;\n\n  hprt0 &= ~(USB_OTG_HPRT_PENA | USB_OTG_HPRT_PCDET |\n             USB_OTG_HPRT_PENCHNG | USB_OTG_HPRT_POCCHNG);\n\n  USBx_HPRT0 = (USB_OTG_HPRT_PRST | hprt0);\n  HAL_Delay(100U);                                 /* See Note #1 */\n  USBx_HPRT0 = ((~USB_OTG_HPRT_PRST) & hprt0);\n  HAL_Delay(10U);\n\n  return HAL_OK;\n}", "docstring": "/**\n  * @brief  USB_OTG_ResetPort : Reset Host Port\n  * @param  USBx  Selected device\n  * @retval HAL status\n  * @note (1)The application must wait at least 10 ms\n  *   before clearing the reset bit.\n  */", "url": "https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone-F4/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c#L1532-L1549", "sha": "489001958d76c251128a953a47555c68bfe65fd8"}91{"repo_name": "GEARdrones", "dataset": "github_2023", "owner": "Excitablecell", "lang": "c", "func_name": "mpu_set_accel_fsr", "code": "int mpu_set_accel_fsr(unsigned char fsr)\n{\n    unsigned char data;\n\n    if (!(st.chip_cfg.sensors))\n        return -1;\n\n    switch (fsr) {\n    case 2:\n        data = INV_FSR_2G << 3;\n        break;\n    case 4:\n        data = INV_FSR_4G << 3;\n        break;\n    case 8:\n        data = INV_FSR_8G << 3;\n        break;\n    case 16:\n        data = INV_FSR_16G << 3;\n        break;\n    default:\n        return -1;\n    }\n\n    if (st.chip_cfg.accel_fsr == (data >> 3))\n        return 0;\n    if (i2c_write( st.reg->accel_cfg, 1, &data))\n        return -1;\n    st.chip_cfg.accel_fsr = data >> 3;\n    return 0;\n}", "docstring": "/**\n *  @brief      Set the accel full-scale range.\n *  @param[in]  fsr Desired full-scale range.\n *  @return     0 if successful.\n */", "url": "https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone-F4/GearLL/Drivers/Devices/MPU6050/inv_mpu.c#L1248-L1278", "sha": "489001958d76c251128a953a47555c68bfe65fd8"}92{"repo_name": "GEARdrones", "dataset": "github_2023", "owner": "Excitablecell", "lang": "c", "func_name": "mpu_set_int_level", "code": "int mpu_set_int_level(unsigned char active_low)\n{\n    st.chip_cfg.active_low_int = active_low;\n    return 0;\n}", "docstring": "/**\n *  @brief      Set interrupt level.\n *  @param[in]  active_low  1 for active low, 0 for active high.\n *  @return     0 if successful.\n */", "url": "https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone-F4/GearLL/Drivers/Devices/MPU6050/inv_mpu.c#L1869-L1873", "sha": "489001958d76c251128a953a47555c68bfe65fd8"}93{"repo_name": "GEARdrones", "dataset": "github_2023", "owner": "Excitablecell", "lang": "c", "func_name": "mpu_get_compass_fsr", "code": "int mpu_get_compass_fsr(unsigned short *fsr)\n{\n#ifdef AK89xx_SECONDARY\n    fsr[0] = st.hw->compass_fsr;\n    return 0;\n#else\n    return -1;\n#endif\n}", "docstring": "/**\n *  @brief      Get the compass full-scale range.\n *  @param[out] fsr Current full-scale range.\n *  @return     0 if successful.\n */", "url": "https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone-F4/GearLL/Drivers/Devices/MPU6050/inv_mpu.c#L2590-L2598", "sha": "489001958d76c251128a953a47555c68bfe65fd8"}94{"repo_name": "GEARdrones", "dataset": "github_2023", "owner": "Excitablecell", "lang": "c", "func_name": "SEGGER_SYSVIEW_RecordU32x4", "code": "void SEGGER_SYSVIEW_RecordU32x4(unsigned int EventID, U32 Para0, U32 Para1, U32 Para2, U32 Para3) {\n  U8* pPayload;\n  U8* pPayloadStart;\n  RECORD_START(SEGGER_SYSVIEW_INFO_SIZE + 4 * SEGGER_SYSVIEW_QUANTA_U32);\n  //\n  pPayload = pPayloadStart;\n  ENCODE_U32(pPayload, Para0);\n  ENCODE_U32(pPayload, Para1);\n  ENCODE_U32(pPayload, Para2);\n  ENCODE_U32(pPayload, Para3);\n  _SendPacket(pPayloadStart, pPayload, EventID);\n  RECORD_END();\n}", "docstring": "/*********************************************************************\n*\n*       SEGGER_SYSVIEW_RecordU32x4()\n*\n*  Function description\n*    Formats and sends a SystemView packet containing 4 U32 parameter payload.\n*\n*  Parameters\n*    EventID - SystemView event ID.\n*    Para0   - The 32-bit parameter encoded to SystemView packet payload.\n*    Para1   - The 32-bit parameter encoded to SystemView packet payload.\n*    Para2   - The 32-bit parameter encoded to SystemView packet payload.\n*    Para3   - The 32-bit parameter encoded to SystemView packet payload.\n*/", "url": "https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone-F4/Middlewares/SEGGER/SEGGER_SYSVIEW.c#L1389-L1401", "sha": "489001958d76c251128a953a47555c68bfe65fd8"}95{"repo_name": "GEARdrones", "dataset": "github_2023", "owner": "Excitablecell", "lang": "c", "func_name": "I2C_MasterReceive_RXNE", "code": "static void I2C_MasterReceive_RXNE(I2C_HandleTypeDef *hi2c)\n{\n  if (hi2c->State == HAL_I2C_STATE_BUSY_RX)\n  {\n    uint32_t tmp;\n\n    tmp = hi2c->XferCount;\n    if (tmp > 3U)\n    {\n      /* Read data from DR */\n      *hi2c->pBuffPtr = (uint8_t)hi2c->Instance->DR;\n\n      /* Increment Buffer pointer */\n      hi2c->pBuffPtr++;\n\n      /* Update counter */\n      hi2c->XferCount--;\n\n      if (hi2c->XferCount == (uint16_t)3)\n      {\n        /* Disable BUF interrupt, this help to treat correctly the last 4 bytes\n        on BTF subroutine */\n        /* Disable BUF interrupt */\n        __HAL_I2C_DISABLE_IT(hi2c, I2C_IT_BUF);\n      }\n    }\n    else if ((hi2c->XferOptions != I2C_FIRST_AND_NEXT_FRAME) && ((tmp == 1U) || (tmp == 0U)))\n    {\n      if (I2C_WaitOnSTOPRequestThroughIT(hi2c) == HAL_OK)\n      {\n        /* Disable Acknowledge */\n        CLEAR_BIT(hi2c->Instance->CR1, I2C_CR1_ACK);\n\n        /* Disable EVT, BUF and ERR interrupt */\n        __HAL_I2C_DISABLE_IT(hi2c, I2C_IT_EVT | I2C_IT_BUF | I2C_IT_ERR);\n\n        /* Read data from DR */\n        *hi2c->pBuffPtr = (uint8_t)hi2c->Instance->DR;\n\n        /* Increment Buffer pointer */\n        hi2c->pBuffPtr++;\n\n        /* Update counter */\n        hi2c->XferCount--;\n\n        hi2c->State = HAL_I2C_STATE_READY;\n\n        if (hi2c->Mode == HAL_I2C_MODE_MEM)\n        {\n          hi2c->Mode = HAL_I2C_MODE_NONE;\n          hi2c->PreviousState = I2C_STATE_NONE;\n\n#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1)\n          hi2c->MemRxCpltCallback(hi2c);\n#else\n          HAL_I2C_MemRxCpltCallback(hi2c);\n#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */\n        }\n        else\n        {\n          hi2c->Mode = HAL_I2C_MODE_NONE;\n          hi2c->PreviousState = I2C_STATE_MASTER_BUSY_RX;\n\n#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1)\n          hi2c->MasterRxCpltCallback(hi2c);\n#else\n          HAL_I2C_MasterRxCpltCallback(hi2c);\n#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */\n        }\n      }\n      else\n      {\n        /* Disable EVT, BUF and ERR interrupt */\n        __HAL_I2C_DISABLE_IT(hi2c, I2C_IT_EVT | I2C_IT_BUF | I2C_IT_ERR);\n\n        /* Read data from DR */\n        *hi2c->pBuffPtr = (uint8_t)hi2c->Instance->DR;\n\n        /* Increment Buffer pointer */\n        hi2c->pBuffPtr++;\n\n        /* Update counter */\n        hi2c->XferCount--;\n\n        hi2c->State = HAL_I2C_STATE_READY;\n        hi2c->Mode = HAL_I2C_MODE_NONE;\n\n        /* Call user error callback */\n#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1)\n        hi2c->ErrorCallback(hi2c);\n#else\n        HAL_I2C_ErrorCallback(hi2c);\n#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */\n      }\n    }\n    else\n    {\n      /* Do nothing */\n    }\n  }\n}", "docstring": "/**\n  * @brief  Handle RXNE flag for Master\n  * @param  hi2c Pointer to a I2C_HandleTypeDef structure that contains\n  *         the configuration information for I2C module\n  * @retval None\n  */", "url": "https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone_Lite/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.c#L5615-L5715", "sha": "489001958d76c251128a953a47555c68bfe65fd8"}96{"repo_name": "GEARdrones", "dataset": "github_2023", "owner": "Excitablecell", "lang": "c", "func_name": "UART_WaitOnFlagUntilTimeout", "code": "static HAL_StatusTypeDef UART_WaitOnFlagUntilTimeout(UART_HandleTypeDef *huart, uint32_t Flag, FlagStatus Status, uint32_t Tickstart, uint32_t Timeout)\n{\n  /* Wait until flag is set */\n  while ((__HAL_UART_GET_FLAG(huart, Flag) ? SET : RESET) == Status)\n  {\n    /* Check for the Timeout */\n    if (Timeout != HAL_MAX_DELAY)\n    {\n      if ((Timeout == 0U) || ((HAL_GetTick() - Tickstart) > Timeout))\n      {\n        /* Disable TXE, RXNE, PE and ERR (Frame error, noise error, overrun error) interrupts for the interrupt process */\n        CLEAR_BIT(huart->Instance->CR1, (USART_CR1_RXNEIE | USART_CR1_PEIE | USART_CR1_TXEIE));\n        CLEAR_BIT(huart->Instance->CR3, USART_CR3_EIE);\n\n        huart->gState  = HAL_UART_STATE_READY;\n        huart->RxState = HAL_UART_STATE_READY;\n\n        /* Process Unlocked */\n        __HAL_UNLOCK(huart);\n\n        return HAL_TIMEOUT;\n      }\n    }\n  }\n  return HAL_OK;\n}", "docstring": "/**\n  * @brief  This function handles UART Communication Timeout.\n  * @param  huart  Pointer to a UART_HandleTypeDef structure that contains\n  *                the configuration information for the specified UART module.\n  * @param  Flag specifies the UART flag to check.\n  * @param  Status The new Flag status (SET or RESET).\n  * @param  Tickstart Tick start value\n  * @param  Timeout Timeout duration\n  * @retval HAL status\n  */", "url": "https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone_Lite/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.c#L3167-L3192", "sha": "489001958d76c251128a953a47555c68bfe65fd8"}97{"repo_name": "GEARdrones", "dataset": "github_2023", "owner": "Excitablecell", "lang": "c", "func_name": "SEGGER_RTT_WriteNoLock", "code": "unsigned SEGGER_RTT_WriteNoLock(unsigned BufferIndex, const void* pBuffer, unsigned NumBytes) {\n  unsigned              Status;\n  unsigned              Avail;\n  const char*           pData;\n  SEGGER_RTT_BUFFER_UP* pRing;\n\n  pData = (const char *)pBuffer;\n  //\n  // Get \"to-host\" ring buffer.\n  //\n  pRing = &_SEGGER_RTT.aUp[BufferIndex];\n  //\n  // How we output depends upon the mode...\n  //\n  switch (pRing->Flags) {\n  case SEGGER_RTT_MODE_NO_BLOCK_SKIP:\n    //\n    // If we are in skip mode and there is no space for the whole\n    // of this output, don't bother.\n    //\n    Avail = _GetAvailWriteSpace(pRing);\n    if (Avail < NumBytes) {\n      Status = 0u;\n    } else {\n      Status = NumBytes;\n      _WriteNoCheck(pRing, pData, NumBytes);\n    }\n    break;\n  case SEGGER_RTT_MODE_NO_BLOCK_TRIM:\n    //\n    // If we are in trim mode, trim to what we can output without blocking.\n    //\n    Avail = _GetAvailWriteSpace(pRing);\n    Status = Avail < NumBytes ? Avail : NumBytes;\n    _WriteNoCheck(pRing, pData, Status);\n    break;\n  case SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL:\n    //\n    // If we are in blocking mode, output everything.\n    //\n    Status = _WriteBlocking(pRing, pData, NumBytes);\n    break;\n  default:\n    Status = 0u;\n    break;\n  }\n  //\n  // Finish up.\n  //\n  return Status;\n}", "docstring": "/*********************************************************************\n*\n*       SEGGER_RTT_WriteNoLock\n*\n*  Function description\n*    Stores a specified number of characters in SEGGER RTT\n*    control block which is then read by the host.\n*    SEGGER_RTT_WriteNoLock does not lock the application.\n*\n*  Parameters\n*    BufferIndex  Index of \"Up\"-buffer to be used (e.g. 0 for \"Terminal\").\n*    pBuffer      Pointer to character array. Does not need to point to a \\0 terminated string.\n*    NumBytes     Number of bytes to be stored in the SEGGER RTT control block.\n*\n*  Return value\n*    Number of bytes which have been stored in the \"Up\"-buffer.\n*\n*  Notes\n*    (1) Data is stored according to buffer flags.\n*    (2) For performance reasons this function does not call Init()\n*        and may only be called after RTT has been initialized.\n*        Either by calling SEGGER_RTT_Init() or calling another RTT API function first.\n*/", "url": "https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone_Lite/Middlewares/SEGGER/SEGGER_RTT.c#L895-L945", "sha": "489001958d76c251128a953a47555c68bfe65fd8"}98{"repo_name": "GEARdrones", "dataset": "github_2023", "owner": "Excitablecell", "lang": "c", "func_name": "SEGGER_SYSVIEW_RecordU32x4", "code": "void SEGGER_SYSVIEW_RecordU32x4(unsigned int EventID, U32 Para0, U32 Para1, U32 Para2, U32 Para3) {\n  U8* pPayload;\n  U8* pPayloadStart;\n  RECORD_START(SEGGER_SYSVIEW_INFO_SIZE + 4 * SEGGER_SYSVIEW_QUANTA_U32);\n  //\n  pPayload = pPayloadStart;\n  ENCODE_U32(pPayload, Para0);\n  ENCODE_U32(pPayload, Para1);\n  ENCODE_U32(pPayload, Para2);\n  ENCODE_U32(pPayload, Para3);\n  _SendPacket(pPayloadStart, pPayload, EventID);\n  RECORD_END();\n}", "docstring": "/*********************************************************************\n*\n*       SEGGER_SYSVIEW_RecordU32x4()\n*\n*  Function description\n*    Formats and sends a SystemView packet containing 4 U32 parameter payload.\n*\n*  Parameters\n*    EventID - SystemView event ID.\n*    Para0   - The 32-bit parameter encoded to SystemView packet payload.\n*    Para1   - The 32-bit parameter encoded to SystemView packet payload.\n*    Para2   - The 32-bit parameter encoded to SystemView packet payload.\n*    Para3   - The 32-bit parameter encoded to SystemView packet payload.\n*/", "url": "https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone_Lite/Middlewares/SEGGER/SEGGER_SYSVIEW.c#L1389-L1401", "sha": "489001958d76c251128a953a47555c68bfe65fd8"}99{"repo_name": "GEARdrones", "dataset": "github_2023", "owner": "Excitablecell", "lang": "c", "func_name": "HAL_I2C_MspDeInit", "code": "void HAL_I2C_MspDeInit(I2C_HandleTypeDef* hi2c)\n{\n  if(hi2c->Instance==I2C1)\n  {\n  /* USER CODE BEGIN I2C1_MspDeInit 0 */\n\n  /* USER CODE END I2C1_MspDeInit 0 */\n    /* Peripheral clock disable */\n    __HAL_RCC_I2C1_CLK_DISABLE();\n\n    /**I2C1 GPIO Configuration\n    PB6     ------> I2C1_SCL\n    PB7     ------> I2C1_SDA\n    */\n    HAL_GPIO_DeInit(GPIOB, GPIO_PIN_6);\n\n    HAL_GPIO_DeInit(GPIOB, GPIO_PIN_7);\n\n  /* USER CODE BEGIN I2C1_MspDeInit 1 */\n\n  /* USER CODE END I2C1_MspDeInit 1 */\n  }\n\n}", "docstring": "/**\n* @brief I2C MSP De-Initialization\n* This function freeze the hardware resources used in this example\n* @param hi2c: I2C handle pointer\n* @retval None\n*/", "url": "https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone_Lite/Src/stm32f1xx_hal_msp.c#L218-L241", "sha": "489001958d76c251128a953a47555c68bfe65fd8"}100{"repo_name": "GEARdrones", "dataset": "github_2023", "owner": "Excitablecell", "lang": "c", "func_name": "I2C_WaitOnBTFFlagUntilTimeout", "code": "static HAL_StatusTypeDef I2C_WaitOnBTFFlagUntilTimeout(I2C_HandleTypeDef *hi2c, uint32_t Timeout, uint32_t Tickstart)\n{\n  while (__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_BTF) == RESET)\n  {\n    /* Check if a NACK is detected */\n    if (I2C_IsAcknowledgeFailed(hi2c) != HAL_OK)\n    {\n      return HAL_ERROR;\n    }\n\n    /* Check for the Timeout */\n    if (Timeout != HAL_MAX_DELAY)\n    {\n      if (((HAL_GetTick() - Tickstart) > Timeout) || (Timeout == 0U))\n      {\n        hi2c->PreviousState       = I2C_STATE_NONE;\n        hi2c->State               = HAL_I2C_STATE_READY;\n        hi2c->Mode                = HAL_I2C_MODE_NONE;\n        hi2c->ErrorCode           |= HAL_I2C_ERROR_TIMEOUT;\n\n        /* Process Unlocked */\n        __HAL_UNLOCK(hi2c);\n\n        return HAL_ERROR;\n      }\n    }\n  }\n  return HAL_OK;\n}", "docstring": "/**\n  * @brief  This function handles I2C Communication Timeout for specific usage of BTF flag.\n  * @param  hi2c Pointer to a I2C_HandleTypeDef structure that contains\n  *                the configuration information for the specified I2C.\n  * @param  Timeout Timeout duration\n  * @param  Tickstart Tick start value\n  * @retval HAL status\n  */", "url": "https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARremote/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.c#L7412-L7440", "sha": "489001958d76c251128a953a47555c68bfe65fd8"}101{"repo_name": "FPGA_Library", "dataset": "github_2023", "owner": "suisuisi", "lang": "c", "func_name": "XIic_SetOptions", "code": "void XIic_SetOptions(XIic *InstancePtr, u32 NewOptions)\n{\n\tu32 CntlReg;\n\n\tXil_AssertVoid(InstancePtr != NULL);\n\n\tXIic_IntrGlobalDisable(InstancePtr->BaseAddress);\n\n\t/*\n\t * Update the options in the instance and get the contents of the\n\t * control register such that the general call option can be modified.\n\t */\n\tInstancePtr->Options = NewOptions;\n\tCntlReg = XIic_ReadReg(InstancePtr->BaseAddress, XIIC_CR_REG_OFFSET);\n\n\t/*\n\t * The general call option is the only option that maps directly to\n\t * a hardware register feature.\n\t */\n\tif (NewOptions & XII_GENERAL_CALL_OPTION) {\n\t\tCntlReg |= XIIC_CR_GENERAL_CALL_MASK;\n\t} else {\n\t\tCntlReg &= ~XIIC_CR_GENERAL_CALL_MASK;\n\t}\n\n\t/*\n\t * Write the new control register value to the register.\n\t */\n\tXIic_WriteReg(InstancePtr->BaseAddress, XIIC_CR_REG_OFFSET, CntlReg);\n\n\tXIic_IntrGlobalEnable(InstancePtr->BaseAddress);\n}", "docstring": "/************************** Constant Definitions ***************************/\n/**************************** Type Definitions *****************************/\n/***************** Macros (Inline Functions) Definitions *******************/\n/************************** Function Prototypes ****************************/\n/************************** Variable Definitions **************************/\n/*****************************************************************************/\n/**\n*\n* This function sets the options for the IIC device driver. The options control\n* how the device behaves relative to the IIC bus. If an option applies to\n* how messages are sent or received on the IIC bus, it must be set prior to\n* calling functions which send or receive data.\n*\n* To set multiple options, the values must be ORed together. To not change\n* existing options, read/modify/write with the current options using\n* XIic_GetOptions().\n*\n* <b>USAGE EXAMPLE:</b>\n*\n* Read/modify/write to enable repeated start:\n* <pre>\n*   u8 Options;\n*   Options = XIic_GetOptions(&Iic);\n*   XIic_SetOptions(&Iic, Options | XII_REPEATED_START_OPTION);\n* </pre>\n*\n* Disabling General Call:\n* <pre>\n*   Options = XIic_GetOptions(&Iic);\n*   XIic_SetOptions(&Iic, Options &= ~XII_GENERAL_CALL_OPTION);\n* </pre>\n*\n* @param\tInstancePtr is a pointer to the XIic instance to be worked on.\n* @param\tNewOptions are the options to be set.  See xiic.h for a list of\n*\t\tthe available options.\n*\n* @return\tNone.\n*\n* @note\n*\n* Sending or receiving messages with repeated start enabled, and then\n* disabling repeated start, will not take effect until another master\n* transaction is completed. i.e. After using repeated start, the bus will\n* continue to be throttled after repeated start is disabled until a master\n* transaction occurs allowing the IIC to release the bus.\n* <br><br>\n* Options enabled will have a 1 in its appropriate bit position.\n*\n****************************************************************************/", "url": "https://github.com/suisuisi/FPGA_Library/blob/1e33525198872d63ced48e8f0cebaa2419b9eb22/ThreePart/digilent_ip/ip/Pmods/PmodHYGRO_v1_0/drivers/PmodHYGRO_v1_0/src/xiic_options.c#L116-L147", "sha": "1e33525198872d63ced48e8f0cebaa2419b9eb22"}102{"repo_name": "FPGA_Library", "dataset": "github_2023", "owner": "suisuisi", "lang": "c", "func_name": "NAV_ReadRegister", "code": "void NAV_ReadRegister(PmodNAV *InstancePtr, uint8_t bInst, uint8_t bAddr,\n      uint8_t bCntBytes, uint8_t *pData) {\n   u8 recv[bCntBytes + 1];\n   int i = 0;\n\n   for (i = 0; i < bCntBytes; i++) {\n      recv[i + 1] = 0;\n   }\n\n   // Add write bit\n   if (bInst == NAV_INST_AG)\n      recv[0] = bAddr | 0x80;\n   else\n      recv[0] = bAddr | 0xC0;\n\n   // Select a slave\n   XSpi_SetSlaveSelect(&InstancePtr->NAVSpi, bInst);\n\n   XSpi_Transfer(&InstancePtr->NAVSpi, recv, recv, bCntBytes + 1);\n\n   // Set chip select high\n   XSpi_SetSlaveSelect(&InstancePtr->NAVSpi, 0b000);\n\n   for (i = 0; i < bCntBytes; i++) {\n      pData[i] = recv[i + 1];\n   }\n}", "docstring": "/* ------------------------------------------------------------ */\n/*** void NAV_ReadRegister(PmodNAV *InstancePtr, uint8_t bInst, uint8_t bAddr, uint8_t bCntBytes, uint8_t *pData)\n**\n**   Parameters:\n**      InstancePtr - instance of PmodNAV\n**      bInst       - instrument Chip Select to be used: Accelerometer/Gyro,\n**                    Magnetometer or Altimeter\n**      bAddr       - register address to start reading bytes from\n**      bCntBytes   - number of bytes to be read\n**      pData       - pointer to the 16 bit data array to be read\n**\n**   Return Value:\n**      None\n**\n**   Errors:\n**      None\n**\n**   Description:\n**      Reads bCntBytes bytes from device via SPI, from register having\n**      consecutive addresses, starting with bAddr.\n*/", "url": "https://github.com/suisuisi/FPGA_Library/blob/1e33525198872d63ced48e8f0cebaa2419b9eb22/ThreePart/digilent_ip/ip/Pmods/PmodNAV_v1_0/drivers/PmodNAV_v1_0/src/PmodNAV.c#L565-L591", "sha": "1e33525198872d63ced48e8f0cebaa2419b9eb22"}103{"repo_name": "FPGA_Library", "dataset": "github_2023", "owner": "suisuisi", "lang": "c", "func_name": "NAV_SetIntThresholdALT", "code": "void NAV_SetIntThresholdALT(PmodNAV *InstancePtr, float thVal) {\n   u8 buffer[2];\n   u16 bthVal;\n   // Converts the float value in gauss to raw magnetic field data to be written\n   // in NAV_MAG_INT_THS_L/NAV_MAG_INT_THS_H registers\n   bthVal = (u16) (thVal * 4096);\n   // Split bytes\n   // Make sure the first bit of the High byte is 0, for correct functionality\n   // of the device\n   buffer[0] = (bthVal & 0xFF00) >> 8;\n   buffer[1] = (bthVal & 0x00FF);\n   NAV_WriteSPI(InstancePtr, NAV_INST_ALT, NAV_ALT_THS_P_H, buffer[0]);\n   NAV_WriteSPI(InstancePtr, NAV_INST_ALT, NAV_ALT_THS_P_L, buffer[1]);\n}", "docstring": "/* ------------------------------------------------------------ */\n/*** void NAV_SetIntThresholdALT(PmodNAV *InstancePtr, float thVal)\n**\n**   Parameters:\n**      InstancePtr - instance of PmodNAV\n**      thVal       - the interrupt threshold parameter for alt instrument\n**\n**   Return Value:\n**      None\n**\n**   Errors:\n**      None\n**\n**   Description:\n**      The function sets the interrupt threshold for the altimeter instrument\n*/", "url": "https://github.com/suisuisi/FPGA_Library/blob/1e33525198872d63ced48e8f0cebaa2419b9eb22/ThreePart/digilent_ip/ip/Pmods/PmodNAV_v1_0/drivers/PmodNAV_v1_0/src/PmodNAV.c#L2100-L2113", "sha": "1e33525198872d63ced48e8f0cebaa2419b9eb22"}104{"repo_name": "FPGA_Library", "dataset": "github_2023", "owner": "suisuisi", "lang": "c", "func_name": "DynRecvMasterData", "code": "static void DynRecvMasterData(XIic *InstancePtr)\n{\n\tu8 LoopCnt;\n\tu8 BytesInFifo;\n\tu8 BytesToRead;\n\tu32 CntlReg;\n\n\t/*\n\t * Device is a master receiving, get the contents of the control\n\t * register and determine the number of bytes in fifo to be read out.\n\t */\n\tCntlReg = XIic_ReadReg(InstancePtr->BaseAddress, XIIC_CR_REG_OFFSET);\n\tBytesInFifo = (u8) XIic_ReadReg(InstancePtr->BaseAddress,\n\t\t\t\t\t XIIC_RFO_REG_OFFSET) + 1;\n\n\t/*\n\t * If data in FIFO holds all data to be retrieved - 1, set NOACK and\n\t * disable the Tx error.\n\t */\n\tif ((InstancePtr->RecvByteCount - BytesInFifo) == 1) {\n\t\t/*\n\t\t * Disable Tx error interrupt to prevent interrupt as this\n\t\t * device will cause it when it set NO ACK next.\n\t\t */\n\t\tXIic_DisableIntr(InstancePtr->BaseAddress,\n\t\t\t\t  XIIC_INTR_TX_ERROR_MASK);\n\t\tXIic_ClearIntr(InstancePtr->BaseAddress,\n\t\t\t\tXIIC_INTR_TX_ERROR_MASK);\n\n\t\t/*\n\t\t * Read one byte to clear a place for the last byte to be read\n\t\t * which will set the NO ACK.\n\t\t */\n\t\tXIic_ReadRecvByte(InstancePtr);\n\t}\n\n\t/*\n\t * If data in FIFO is all the data to be received then get the data and\n\t * also leave the device in a good state for the next transaction.\n\t */\n\telse if ((InstancePtr->RecvByteCount - BytesInFifo) == 0) {\n\t\tif (InstancePtr->Options & XII_REPEATED_START_OPTION) {\n\t\t\tCntlReg |= XIIC_CR_REPEATED_START_MASK;\n\t\t\tXIic_WriteReg(InstancePtr->BaseAddress,\n\t\t\t\t\tXIIC_CR_REG_OFFSET,\n\t\t\t\t\tCntlReg);\n\t\t}\n\n\t\t/*\n\t\t * Read data from the FIFO then set zero based FIFO read depth\n\t\t * for a byte.\n\t\t */\n\t\tfor (LoopCnt = 0; LoopCnt < BytesInFifo; LoopCnt++) {\n\t\t\tXIic_ReadRecvByte(InstancePtr);\n\t\t}\n\n\t\tXIic_WriteReg(InstancePtr->BaseAddress,\n\t\t\t\tXIIC_RFD_REG_OFFSET, 0);\n\n\t\t/*\n\t\t * Disable Rx full interrupt and write the control reg with ACK\n\t\t * allowing next byte sent to be acknowledged automatically.\n\t\t */\n\t\tXIic_DisableIntr(InstancePtr->BaseAddress,\n\t\t\t\t  XIIC_INTR_RX_FULL_MASK);\n\n\t\t/*\n\t\t * Send notification of msg Rx complete in RecvHandler callback.\n\t\t */\n\t\tInstancePtr->RecvHandler(InstancePtr->RecvCallBackRef, 0);\n\t}\n\telse {\n\t\t/*\n\t\t * Fifo data not at n-1, read all but the last byte of data\n\t\t * from the slave, if more than a FIFO full yet to receive\n\t\t * read a FIFO full.\n\t\t */\n\t\tBytesToRead = InstancePtr->RecvByteCount - BytesInFifo - 1;\n\t\tif (BytesToRead > IIC_RX_FIFO_DEPTH) {\n\t\t\tBytesToRead = IIC_RX_FIFO_DEPTH;\n\t\t}\n\n\t\t/*\n\t\t * Read in data from the FIFO.\n\t\t */\n\t\tfor (LoopCnt = 0; LoopCnt < BytesToRead; LoopCnt++) {\n\t\t\tXIic_ReadRecvByte(InstancePtr);\n\t\t}\n\t}\n}", "docstring": "/*****************************************************************************/\n/**\n*\n* This function is called when the receive register is full. The number\n* of bytes received to cause the interrupt is adjustable using the Receive FIFO\n* Depth register. The number of bytes in the register is read in the Receive\n* FIFO occupancy register. Both these registers are zero based values (0-15)\n* such that a value of zero indicates 1 byte.\n*\n* For a Master Receiver to properly signal the end of a message, the data must\n* be read in up to the message length - 1, where control register bits will be\n* set for bus controls to occur on reading of the last byte.\n*\n* @param\tInstancePtr is a pointer to the XIic instance to be worked on.\n*\n* @return\tNone.\n*\n* @note\t\tNone.\n*\n******************************************************************************/", "url": "https://github.com/suisuisi/FPGA_Library/blob/1e33525198872d63ced48e8f0cebaa2419b9eb22/ThreePart/digilent_ip/ip/Pmods/PmodRTCC_v1_0/drivers/PmodRTCC_v1_0/src/xiic_dyn_master.c#L466-L555", "sha": "1e33525198872d63ced48e8f0cebaa2419b9eb22"}105{"repo_name": "FPGA_Library", "dataset": "github_2023", "owner": "suisuisi", "lang": "c", "func_name": "DynSendMasterData", "code": "static void DynSendMasterData(XIic *InstancePtr)\n{\n\tu32 CntlReg;\n\n\t/*\n\t * In between 1st and last byte of message, fill the FIFO with more data\n\t * to send, disable the 1/2 empty interrupt based upon data left to\n\t * send.\n\t */\n\tif (InstancePtr->SendByteCount > 1) {\n\t\tXIic_TransmitFifoFill(InstancePtr, XIIC_MASTER_ROLE);\n\n\t\tif (InstancePtr->SendByteCount < 2) {\n\t\t\tXIic_DisableIntr(InstancePtr->BaseAddress,\n\t\t\t\t\t  XIIC_INTR_TX_HALF_MASK);\n\t\t}\n\t}\n\n\t/*\n\t * If there is only one byte left to send, processing differs between\n\t * repeated start and normal messages.\n\t */\n\telse if (InstancePtr->SendByteCount == 1) {\n\t\t/*\n\t\t * When using repeated start, another interrupt is expected\n\t\t * after the last byte has been sent, so the message is not\n\t\t * done yet.\n\t\t */\n\t\tif (InstancePtr->Options & XII_REPEATED_START_OPTION) {\n\t\t\tXIic_WriteSendByte(InstancePtr);\n\t\t} else {\n\t\t\tXIic_DynSendStop(InstancePtr->BaseAddress,\n\t\t\t\t\t  *InstancePtr->SendBufferPtr);\n\n\t\t\t/*\n\t\t\t * Wait for bus to not be busy before declaring message\n\t\t\t * has been sent for the no repeated start operation.\n\t\t\t * The callback will be called from the BusNotBusy part\n\t\t\t * of the Interrupt handler to ensure that the message\n\t\t\t * is completely sent. Disable the Tx interrupts and\n\t\t\t * enable the BNB interrupt.\n\t\t\t */\n\t\t\tInstancePtr->BNBOnly = FALSE;\n\t\t\tXIic_DisableIntr(InstancePtr->BaseAddress,\n\t\t\t\t\t  XIIC_TX_INTERRUPTS);\n\t\t\tXIic_EnableIntr(InstancePtr->BaseAddress,\n\t\t\t\t\t XIIC_INTR_BNB_MASK);\n\t\t}\n\t} else {\n\t\tif (InstancePtr->Options & XII_REPEATED_START_OPTION) {\n\t\t\t/*\n\t\t\t * The message being sent has completed. When using\n\t\t\t * repeated start with no more bytes to send repeated\n\t\t\t * start needs to be set in the control register so\n\t\t\t * that the bus will still be held by this master.\n\t\t\t */\n\t\t\tCntlReg = XIic_ReadReg(InstancePtr->BaseAddress,\n\t\t\t\t\tXIIC_CR_REG_OFFSET);\n\t\t\tCntlReg |= XIIC_CR_REPEATED_START_MASK;\n\t\t\tXIic_WriteReg(InstancePtr->BaseAddress,\n\t\t\t\t\tXIIC_CR_REG_OFFSET, CntlReg);\n\n\t\t\t/*\n\t\t\t * If the message that was being sent has finished,\n\t\t\t * disable all transmit interrupts and call the callback\n\t\t\t * that was setup to indicate the message was sent,\n\t\t\t * with 0 bytes remaining.\n\t\t\t */\n\t\t\tXIic_DisableIntr(InstancePtr->BaseAddress,\n\t\t\t\t\t  XIIC_TX_INTERRUPTS);\n\t\t\tInstancePtr->SendHandler(InstancePtr->SendCallBackRef,\n\t\t\t\t\t\t 0);\n\t\t}\n\t}\n\n\treturn;\n}", "docstring": "/******************************************************************************\n*\n* When the IIC Tx FIFO/register goes empty, this routine is called by the\n* interrupt service routine to fill the transmit FIFO with data to be sent.\n*\n* This function also is called by the Tx ๏ฟฝ empty interrupt as the data handling\n* is identical when you don't assume the FIFO is empty but use the Tx_FIFO_OCY\n* register to indicate the available free FIFO bytes.\n*\n* @param\tInstancePtr is a pointer to the XIic instance to be worked on.\n*\n* @return\tNone.\n*\n* @note\t\tNone.\n*\n******************************************************************************/", "url": "https://github.com/suisuisi/FPGA_Library/blob/1e33525198872d63ced48e8f0cebaa2419b9eb22/ThreePart/digilent_ip/ip/Pmods/PmodTMP3_v1_0/drivers/PmodTMP3_v1_0/src/xiic_dyn_master.c#L218-L294", "sha": "1e33525198872d63ced48e8f0cebaa2419b9eb22"}106{"repo_name": "FPGA_Library", "dataset": "github_2023", "owner": "suisuisi", "lang": "c", "func_name": "WF_SecurityWpaSet", "code": "void WF_SecurityWpaSet(t_wpaContext* p_context)\n{\n#if defined(WF_ERROR_CHECKING)\n    uint32_t errorCode;\n\n    errorCode = UdSetSecurityWpa(p_context);\n    if (errorCode != UD_SUCCESS)\n    {\n        EventEnqueue(WF_EVENT_ERROR, errorCode);\n        return;\n    }\n#endif /* WF_ERROR_CHECKING */\n\n    WF_SetSecurity(p_context->wpaSecurityType,\n                   0, // not used\n                   p_context->keyInfo.key,\n                   p_context->keyInfo.keyLength);\n}", "docstring": "//============================================================================", "url": "https://github.com/suisuisi/FPGA_Library/blob/1e33525198872d63ced48e8f0cebaa2419b9eb22/ThreePart/digilent_ip/ip/Pmods/PmodWIFI_v1_0/drivers/PmodWIFI_v1_0/src/MRF24G/utility/wf_connection_profile.c#L367-L384", "sha": "1e33525198872d63ced48e8f0cebaa2419b9eb22"}107{"repo_name": "MCUViewer", "dataset": "github_2023", "owner": "klonyyy", "lang": "c", "func_name": "HAL_DMAEx_ConfigMuxRequestGenerator", "code": "HAL_StatusTypeDef HAL_DMAEx_ConfigMuxRequestGenerator(DMA_HandleTypeDef *hdma,\n                                                      HAL_DMA_MuxRequestGeneratorConfigTypeDef *pRequestGeneratorConfig)\n{\n  /* Check the parameters */\n  assert_param(IS_DMA_ALL_INSTANCE(hdma->Instance));\n\n  assert_param(IS_DMAMUX_REQUEST_GEN_SIGNAL_ID(pRequestGeneratorConfig->SignalID));\n\n  assert_param(IS_DMAMUX_REQUEST_GEN_POLARITY(pRequestGeneratorConfig->Polarity));\n  assert_param(IS_DMAMUX_REQUEST_GEN_REQUEST_NUMBER(pRequestGeneratorConfig->RequestNumber));\n\n  /* check if the DMA state is ready\n     and DMA is using a DMAMUX request generator block\n  */\n  if ((hdma->State == HAL_DMA_STATE_READY) && (hdma->DMAmuxRequestGen != 0U))\n  {\n    /* Process Locked */\n    __HAL_LOCK(hdma);\n\n    /* Set the request generator new parameters */\n    hdma->DMAmuxRequestGen->RGCR = pRequestGeneratorConfig->SignalID | \\\n                                   ((pRequestGeneratorConfig->RequestNumber - 1U) << (POSITION_VAL(DMAMUX_RGxCR_GNBREQ) & 0x1FU)) | \\\n                                   pRequestGeneratorConfig->Polarity;\n    /* Process UnLocked */\n    __HAL_UNLOCK(hdma);\n\n    return HAL_OK;\n  }\n  else\n  {\n    return HAL_ERROR;\n  }\n}", "docstring": "/**\n  * @brief  Configure the DMAMUX request generator block used by the given DMA channel (instance).\n  * @param  hdma:       pointer to a DMA_HandleTypeDef structure that contains\n  *                     the configuration information for the specified DMA channel.\n  * @param  pRequestGeneratorConfig : pointer to HAL_DMA_MuxRequestGeneratorConfigTypeDef :\n  *         contains the request generator parameters.\n  *\n  * @retval HAL status\n  */", "url": "https://github.com/klonyyy/MCUViewer/blob/3650ed7feaff963ca76abcb72423ee220cdbfa69/example/MCUViewer_test/Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_dma_ex.c#L141-L173", "sha": "3650ed7feaff963ca76abcb72423ee220cdbfa69"}108{"repo_name": "MCUViewer", "dataset": "github_2023", "owner": "klonyyy", "lang": "c", "func_name": "HAL_EXTI_GetConfigLine", "code": "HAL_StatusTypeDef HAL_EXTI_GetConfigLine(EXTI_HandleTypeDef *hexti, EXTI_ConfigTypeDef *pExtiConfig)\n{\n  __IO uint32_t *regaddr;\n  uint32_t regval;\n  uint32_t linepos;\n  uint32_t maskline;\n  uint32_t offset;\n\n  /* Check null pointer */\n  if ((hexti == NULL) || (pExtiConfig == NULL))\n  {\n    return HAL_ERROR;\n  }\n\n  /* Check the parameter */\n  assert_param(IS_EXTI_LINE(hexti->Line));\n\n  /* Store handle line number to configuration structure */\n  pExtiConfig->Line = hexti->Line;\n\n  /* Compute line register offset and line mask */\n  offset = ((pExtiConfig->Line & EXTI_REG_MASK) >> EXTI_REG_SHIFT);\n  /* Compute line position */\n  linepos = (pExtiConfig->Line & EXTI_PIN_MASK);\n  /* Compute mask */\n  maskline = (1uL << linepos);\n\n  /* 1] Get core mode : interrupt */\n  regaddr = (&EXTI->IMR1 + (EXTI_MODE_OFFSET * offset));\n  regval = *regaddr;\n\n  /* Check if selected line is enable */\n  if ((regval & maskline) != 0x00u)\n  {\n    pExtiConfig->Mode = EXTI_MODE_INTERRUPT;\n  }\n  else\n  {\n    pExtiConfig->Mode = EXTI_MODE_NONE;\n  }\n\n  /* Get event mode */\n  regaddr = (&EXTI->EMR1 + (EXTI_MODE_OFFSET * offset));\n  regval = *regaddr;\n\n  /* Check if selected line is enable */\n  if ((regval & maskline) != 0x00u)\n  {\n    pExtiConfig->Mode |= EXTI_MODE_EVENT;\n  }\n\n  /* Get default Trigger and GPIOSel configuration */\n  pExtiConfig->Trigger = EXTI_TRIGGER_NONE;\n  pExtiConfig->GPIOSel = 0x00u;\n\n  /* 2] Get trigger for configurable lines : rising */\n  if ((pExtiConfig->Line & EXTI_CONFIG) != 0x00u)\n  {\n    regaddr = (&EXTI->RTSR1 + (EXTI_CONFIG_OFFSET * offset));\n    regval = *regaddr;\n\n    /* Check if configuration of selected line is enable */\n    if ((regval & maskline) != 0x00u)\n    {\n      pExtiConfig->Trigger = EXTI_TRIGGER_RISING;\n    }\n\n    /* Get falling configuration */\n    regaddr = (&EXTI->FTSR1 + (EXTI_CONFIG_OFFSET * offset));\n    regval = *regaddr;\n\n    /* Check if configuration of selected line is enable */\n    if ((regval & maskline) != 0x00u)\n    {\n      pExtiConfig->Trigger |= EXTI_TRIGGER_FALLING;\n    }\n\n    /* Get Gpio port selection for gpio lines */\n    if ((pExtiConfig->Line & EXTI_GPIO) == EXTI_GPIO)\n    {\n      assert_param(IS_EXTI_GPIO_PIN(linepos));\n\n      regval = SYSCFG->EXTICR[linepos >> 2u];\n      pExtiConfig->GPIOSel = (regval >> (SYSCFG_EXTICR1_EXTI1_Pos * (linepos & 0x03u))) & SYSCFG_EXTICR1_EXTI0;\n    }\n  }\n\n  return HAL_OK;\n}", "docstring": "/**\n  * @brief  Get configuration of a dedicated Exti line.\n  * @param  hexti Exti handle.\n  * @param  pExtiConfig Pointer on structure to store Exti configuration.\n  * @retval HAL Status.\n  */", "url": "https://github.com/klonyyy/MCUViewer/blob/3650ed7feaff963ca76abcb72423ee220cdbfa69/example/MCUViewer_test/Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_exti.c#L268-L356", "sha": "3650ed7feaff963ca76abcb72423ee220cdbfa69"}109{"repo_name": "MCUViewer", "dataset": "github_2023", "owner": "klonyyy", "lang": "c", "func_name": "FLASH_OB_BootLockConfig", "code": "static HAL_StatusTypeDef FLASH_OB_BootLockConfig(uint32_t BootLockConfig)\n{\n  HAL_StatusTypeDef status;\n\n  /* Check the parameters */\n  assert_param(IS_OB_BOOT_LOCK(BootLockConfig));\n\n  /* Wait for last operation to be completed */\n  status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE);\n\n  if (status == HAL_OK)\n  {\n    MODIFY_REG(FLASH->SEC1R, FLASH_SEC1R_BOOT_LOCK, BootLockConfig);\n\n    /* Set OPTSTRT Bit */\n    SET_BIT(FLASH->CR, FLASH_CR_OPTSTRT);\n\n    /* Wait for last operation to be completed */\n    status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE);\n  }\n\n  return status;\n}", "docstring": "/**\n  * @brief  Configure the Boot Lock into Option Bytes.\n  * @note   To configure any option bytes, the option lock bit OPTLOCK must be\n  *         cleared with the call of HAL_FLASH_OB_Unlock() function.\n  * @note   New option bytes configuration will be taken into account in two cases:\n  *         - after an option bytes launch through the call of HAL_FLASH_OB_Launch()\n  *         - after a power reset (BOR reset or exit from Standby/Shutdown modes)\n  * @param  BootLockConfig specifies the boot lock configuration.\n  *          This parameter can be one of the following values:\n  *            @arg OB_BOOT_LOCK_ENABLE: Enable Boot Lock\n  *            @arg OB_BOOT_LOCK_DISABLE: Disable Boot Lock\n  *\n  * @retval HAL_Status\n  */", "url": "https://github.com/klonyyy/MCUViewer/blob/3650ed7feaff963ca76abcb72423ee220cdbfa69/example/MCUViewer_test/Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_flash_ex.c#L1175-L1197", "sha": "3650ed7feaff963ca76abcb72423ee220cdbfa69"}110{"repo_name": "MCUViewer", "dataset": "github_2023", "owner": "klonyyy", "lang": "c", "func_name": "HAL_TIM_PWM_Start_IT", "code": "HAL_StatusTypeDef HAL_TIM_PWM_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel)\n{\n  HAL_StatusTypeDef status = HAL_OK;\n  uint32_t tmpsmcr;\n\n  /* Check the parameters */\n  assert_param(IS_TIM_CCX_CHANNEL(htim->Instance, Channel));\n\n  /* Check the TIM channel state */\n  if (TIM_CHANNEL_STATE_GET(htim, Channel) != HAL_TIM_CHANNEL_STATE_READY)\n  {\n    return HAL_ERROR;\n  }\n\n  /* Set the TIM channel state */\n  TIM_CHANNEL_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_BUSY);\n\n  switch (Channel)\n  {\n    case TIM_CHANNEL_1:\n    {\n      /* Enable the TIM Capture/Compare 1 interrupt */\n      __HAL_TIM_ENABLE_IT(htim, TIM_IT_CC1);\n      break;\n    }\n\n    case TIM_CHANNEL_2:\n    {\n      /* Enable the TIM Capture/Compare 2 interrupt */\n      __HAL_TIM_ENABLE_IT(htim, TIM_IT_CC2);\n      break;\n    }\n\n    case TIM_CHANNEL_3:\n    {\n      /* Enable the TIM Capture/Compare 3 interrupt */\n      __HAL_TIM_ENABLE_IT(htim, TIM_IT_CC3);\n      break;\n    }\n\n    case TIM_CHANNEL_4:\n    {\n      /* Enable the TIM Capture/Compare 4 interrupt */\n      __HAL_TIM_ENABLE_IT(htim, TIM_IT_CC4);\n      break;\n    }\n\n    default:\n      status = HAL_ERROR;\n      break;\n  }\n\n  if (status == HAL_OK)\n  {\n    /* Enable the Capture compare channel */\n    TIM_CCxChannelCmd(htim->Instance, Channel, TIM_CCx_ENABLE);\n\n    if (IS_TIM_BREAK_INSTANCE(htim->Instance) != RESET)\n    {\n      /* Enable the main output */\n      __HAL_TIM_MOE_ENABLE(htim);\n    }\n\n    /* Enable the Peripheral, except in trigger mode where enable is automatically done with trigger */\n    if (IS_TIM_SLAVE_INSTANCE(htim->Instance))\n    {\n      tmpsmcr = htim->Instance->SMCR & TIM_SMCR_SMS;\n      if (!IS_TIM_SLAVEMODE_TRIGGER_ENABLED(tmpsmcr))\n      {\n        __HAL_TIM_ENABLE(htim);\n      }\n    }\n    else\n    {\n      __HAL_TIM_ENABLE(htim);\n    }\n  }\n\n  /* Return function status */\n  return status;\n}", "docstring": "/**\n  * @brief  Starts the PWM signal generation in interrupt mode.\n  * @param  htim TIM PWM handle\n  * @param  Channel TIM Channel to be enabled\n  *          This parameter can be one of the following values:\n  *            @arg TIM_CHANNEL_1: TIM Channel 1 selected\n  *            @arg TIM_CHANNEL_2: TIM Channel 2 selected\n  *            @arg TIM_CHANNEL_3: TIM Channel 3 selected\n  *            @arg TIM_CHANNEL_4: TIM Channel 4 selected\n  * @retval HAL status\n  */", "url": "https://github.com/klonyyy/MCUViewer/blob/3650ed7feaff963ca76abcb72423ee220cdbfa69/example/MCUViewer_test/Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_tim.c#L1566-L1646", "sha": "3650ed7feaff963ca76abcb72423ee220cdbfa69"}111{"repo_name": "MCUViewer", "dataset": "github_2023", "owner": "klonyyy", "lang": "c", "func_name": "HAL_TIM_IC_Stop_DMA", "code": "HAL_StatusTypeDef HAL_TIM_IC_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel)\n{\n  HAL_StatusTypeDef status = HAL_OK;\n\n  /* Check the parameters */\n  assert_param(IS_TIM_CCX_CHANNEL(htim->Instance, Channel));\n  assert_param(IS_TIM_DMA_CC_INSTANCE(htim->Instance));\n\n  /* Disable the Input Capture channel */\n  TIM_CCxChannelCmd(htim->Instance, Channel, TIM_CCx_DISABLE);\n\n  switch (Channel)\n  {\n    case TIM_CHANNEL_1:\n    {\n      /* Disable the TIM Capture/Compare 1 DMA request */\n      __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_CC1);\n      (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC1]);\n      break;\n    }\n\n    case TIM_CHANNEL_2:\n    {\n      /* Disable the TIM Capture/Compare 2 DMA request */\n      __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_CC2);\n      (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC2]);\n      break;\n    }\n\n    case TIM_CHANNEL_3:\n    {\n      /* Disable the TIM Capture/Compare 3  DMA request */\n      __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_CC3);\n      (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC3]);\n      break;\n    }\n\n    case TIM_CHANNEL_4:\n    {\n      /* Disable the TIM Capture/Compare 4  DMA request */\n      __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_CC4);\n      (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC4]);\n      break;\n    }\n\n    default:\n      status = HAL_ERROR;\n      break;\n  }\n\n  if (status == HAL_OK)\n  {\n    /* Disable the Peripheral */\n    __HAL_TIM_DISABLE(htim);\n\n    /* Set the TIM channel state */\n    TIM_CHANNEL_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_READY);\n    TIM_CHANNEL_N_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_READY);\n  }\n\n  /* Return function status */\n  return status;\n}", "docstring": "/**\n  * @brief  Stops the TIM Input Capture measurement in DMA mode.\n  * @param  htim TIM Input Capture handle\n  * @param  Channel TIM Channels to be disabled\n  *          This parameter can be one of the following values:\n  *            @arg TIM_CHANNEL_1: TIM Channel 1 selected\n  *            @arg TIM_CHANNEL_2: TIM Channel 2 selected\n  *            @arg TIM_CHANNEL_3: TIM Channel 3 selected\n  *            @arg TIM_CHANNEL_4: TIM Channel 4 selected\n  * @retval HAL status\n  */", "url": "https://github.com/klonyyy/MCUViewer/blob/3650ed7feaff963ca76abcb72423ee220cdbfa69/example/MCUViewer_test/Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_tim.c#L2546-L2608", "sha": "3650ed7feaff963ca76abcb72423ee220cdbfa69"}112{"repo_name": "kui.nvim", "dataset": "github_2023", "owner": "romgrk", "lang": "c", "func_name": "cairo_xlib_surface_set_size", "code": "void\ncairo_xlib_surface_set_size (cairo_surface_t *abstract_surface,\n\t\t\t     int              width,\n\t\t\t     int              height)\n{\n    cairo_xlib_surface_t *surface = (cairo_xlib_surface_t *) abstract_surface;\n    cairo_status_t status;\n\n    if (unlikely (abstract_surface->status))\n\treturn;\n    if (unlikely (abstract_surface->finished)) {\n\t_cairo_surface_set_error (abstract_surface,\n\t\t\t\t  _cairo_error (CAIRO_STATUS_SURFACE_FINISHED));\n\treturn;\n    }\n\n    if (! _cairo_surface_is_xlib (abstract_surface)) {\n\t_cairo_surface_set_error (abstract_surface,\n\t\t\t\t  _cairo_error (CAIRO_STATUS_SURFACE_TYPE_MISMATCH));\n\treturn;\n    }\n\n    if (surface->width == width && surface->height == height)\n\treturn;\n\n    if (! valid_size (width, height)) {\n\t_cairo_surface_set_error (abstract_surface,\n\t\t\t\t  _cairo_error (CAIRO_STATUS_INVALID_SIZE));\n\treturn;\n    }\n\n    status = _cairo_surface_flush (abstract_surface, 0);\n    if (unlikely (status)) {\n\t_cairo_surface_set_error (abstract_surface, status);\n\treturn;\n    }\n\n    _cairo_xlib_surface_discard_shm (surface);\n\n    surface->width = width;\n    surface->height = height;\n}", "docstring": "/**\n * cairo_xlib_surface_set_size:\n * @surface: a #cairo_surface_t for the XLib backend\n * @width: the new width of the surface\n * @height: the new height of the surface\n *\n * Informs cairo of the new size of the X Drawable underlying the\n * surface. For a surface created for a Window (rather than a Pixmap),\n * this function must be called each time the size of the window\n * changes. (For a subwindow, you are normally resizing the window\n * yourself, but for a toplevel window, it is necessary to listen for\n * ConfigureNotify events.)\n *\n * A Pixmap can never change size, so it is never necessary to call\n * this function on a surface created for a Pixmap.\n *\n * Since: 1.0\n **/", "url": "https://github.com/romgrk/kui.nvim/blob/b3b2f53d6678dce86acc91043b32eab6059ce0cf/lua/kui/cairo/csrc/cairo/src/cairo-xlib-surface.c#L2090-L2131", "sha": "b3b2f53d6678dce86acc91043b32eab6059ce0cf"}113{"repo_name": "QCVM", "dataset": "github_2023", "owner": "erysdren", "lang": "c", "func_name": "qcvm_set_parm_int", "code": "void qcvm_set_parm_int(qcvm_t *qcvm, int parm, int val)\n{\n\tGET_INT(OFS_PARM0 + (parm * 3)) = val;\n}", "docstring": "/* set integer parameter */", "url": "https://github.com/erysdren/QCVM/blob/acd27d22c040f0636df61b4c8fb92a81e455262a/qcvm/qcvm_parameters.c#L68-L71", "sha": "acd27d22c040f0636df61b4c8fb92a81e455262a"}114{"repo_name": "ps4-ezremote-client", "dataset": "github_2023", "owner": "cy33hc", "lang": "c", "func_name": "terminate_jbc", "code": "void terminate_jbc()\n{\n    if (!is_jailbroken())\n        return;\n\n    // Restores original creds\n    jbc_set_cred(&g_Cred);\n}", "docstring": "// Unload libjbc libraries", "url": "https://github.com/cy33hc/ps4-ezremote-client/blob/b7fe46cb94310f8591275d3c34107b5944137a4a/source/orbis_jbc.c#L115-L122", "sha": "b7fe46cb94310f8591275d3c34107b5944137a4a"}115{"repo_name": "GlobalSfMpy", "dataset": "github_2023", "owner": "zhangganlin", "lang": "c", "func_name": "LZ4HC_Insert", "code": "FORCE_INLINE void LZ4HC_Insert (LZ4HC_Data_Structure* hc4, const BYTE* ip)\n{\n    U16* chainTable = hc4->chainTable;\n    U32* HashTable  = hc4->hashTable;\n    const BYTE* const base = hc4->base;\n    const U32 target = (U32)(ip - base);\n    U32 idx = hc4->nextToUpdate;\n\n    while(idx < target)\n    {\n        U32 h = LZ4HC_hashPtr(base+idx);\n        size_t delta = idx - HashTable[h];\n        if (delta>MAX_DISTANCE) delta = MAX_DISTANCE;\n        DELTANEXTU16(idx) = (U16)delta;\n        HashTable[h] = idx;\n        idx++;\n    }\n\n    hc4->nextToUpdate = target;\n}", "docstring": "/* Update chains up to ip (excluded) */", "url": "https://github.com/zhangganlin/GlobalSfMpy/blob/ac6a0564d84e1d6e9a4077195e384d379aa20492/thirdparty/TheiaSfM/libraries/flann/src/cpp/flann/ext/lz4hc.c#L130-L149", "sha": "ac6a0564d84e1d6e9a4077195e384d379aa20492"}116{"repo_name": "PumpkinOS", "dataset": "github_2023", "owner": "migueletto", "lang": "c", "func_name": "calcrate", "code": "static speed_t\ncalcrate(int baudrate)\n{\n#ifdef B50\n\tif (baudrate == 50)\n\t\treturn B50;\n#endif\n#ifdef B75\n\tif (baudrate == 75)\n\t\treturn B75;\n#endif\n#ifdef B110\n\tif (baudrate == 110)\n\t\treturn B110;\n#endif\n#ifdef B134\n\tif (baudrate == 134)\n\t\treturn B134;\n#endif\n#ifdef B150\n\tif (baudrate == 150)\n\t\treturn B150;\n#endif\n#ifdef B200\n\tif (baudrate == 200)\n\t\treturn B200;\n#endif\n#ifdef B300\n\tif (baudrate == 300)\n\t\treturn B300;\n#endif\n#ifdef B600\n\tif (baudrate == 600)\n\t\treturn B600;\n#endif\n#ifdef B1200\n\tif (baudrate == 1200)\n\t\treturn B1200;\n#endif\n#ifdef B1800\n\tif (baudrate == 1800)\n\t\treturn B1800;\n#endif\n#ifdef B2400\n\tif (baudrate == 2400)\n\t\treturn B2400;\n#endif\n#ifdef B4800\n\tif (baudrate == 4800)\n\t\treturn B4800;\n#endif\n#ifdef B9600\n\tif (baudrate == 9600)\n\t\treturn B9600;\n#endif\n#ifdef B19200\n\telse if (baudrate == 19200)\n\t\treturn B19200;\n#endif\n#ifdef B38400\n\telse if (baudrate == 38400)\n\t\treturn B38400;\n#endif\n#ifdef B57600\n\telse if (baudrate == 57600)\n\t\treturn B57600;\n#endif\n#ifdef B76800\n\telse if (baudrate == 76800)\n\t\treturn B76800;\n#endif\n#ifdef B115200\n\telse if (baudrate == 115200)\n\t\treturn B115200;\n#endif\n#ifdef B230400\n\telse if (baudrate == 230400)\n\t\treturn B230400;\n#endif\n#ifdef B460800\n\telse if (baudrate == 460800)\n\t\treturn B460800;\n#endif\n\n\tLOG((PI_DBG_DEV, PI_DBG_LVL_ERR,\n\t\t\"DEV Serial CHANGEBAUD Unable to set baud rate %d\\n\",\n\t\tbaudrate));\n\tabort();\t/* invalid baud rate */\n\treturn 0;\n}", "docstring": "/***********************************************************************\n *\n * Function:    calcrate\n *\n * Summary:     validates the selected baudrate\n *\n * Paramters:\tbuadrate\n *\n * Returns:     POSIX defined baudrate constant or terminates the process\n *\t\tif the requested baudrate is not supported.\n *\n ***********************************************************************/", "url": "https://github.com/migueletto/PumpkinOS/blob/d31ba3aca31b73c8f1ce40dbf812ddffe44c22de/src/Hotsync/unixserial.c#L649-L738", "sha": "d31ba3aca31b73c8f1ce40dbf812ddffe44c22de"}117{"repo_name": "PumpkinOS", "dataset": "github_2023", "owner": "migueletto", "lang": "c", "func_name": "ListViewLoadTable", "code": "static void ListViewLoadTable (FormPtr frm)\n{\n\tUInt16\t\t\trow;\n\tUInt16\t\t\trecordNum;\n\tUInt16\t\t\tlineHeight;\n\tUInt16\t\t\tdataHeight;\n\tUInt16\t\t\ttableHeight;\n\tUInt16\t\t\tnumRows;\n\tUInt32\t\t\tuniqueID;\n\tFontID\t\t\tcurrFont;\n\tTablePtr \t\ttable;\n\tMemHandle\t\t\trecordH;\n\tRectangleType\tr;\n\n\n\ttable = GetObjectPtr (ListTable);\n\n\tTblGetBounds (table, &r);\n\ttableHeight = r.extent.y;\n\n\tcurrFont = FntSetFont (ListFont);\n\tlineHeight = FntLineHeight ();\n\tFntSetFont (currFont);\n\n\tdataHeight = 0;\n\n\trecordNum = TopVisibleRecord;\n\n\t// For each row in the table, store the record number in the table item\n\t// that will dispaly the record.\n\tnumRows = TblGetNumberOfRows (table);\n\tfor (row = 0; row < numRows; row++)\n\t{\n\t\t// Get the next record in the currunt category.\n\t\trecordH = DmQueryNextInCategory (MemoDB, &recordNum, CurrentCategory);\n\t\tif(row == 0)\n\t\t{\n\t\t\t// store the position of the first row so we can use TopRowPositionInCategory+row\n\t\t\t// when drawing\n\t\t\tTopRowPositionInCategory = recordH ? DmPositionInCategory(MemoDB, recordNum, CurrentCategory) : 0;\n\t\t}\n\n\t\t// If the record was found, store the record number in the table item,\n\t\t// otherwise set the table row unusable.\n\t\tif (recordH && (tableHeight >= dataHeight + lineHeight))\n\t\t{\n\t\t\tTblSetRowID (table, row, recordNum);\n\t\t\tTblSetItemStyle (table, row, 0, customTableItem);\n\t\t\tTblSetItemFont (table, row, 0, ListFont);\n\n\t\t\tTblSetRowHeight (table, row, lineHeight);\n\n\t\t\tDmRecordInfo (MemoDB, recordNum, NULL, &uniqueID, NULL);\n\t\t\tif ((TblGetRowData (table, row) != uniqueID) ||\n\t\t\t\t( ! TblRowUsable (table, row)))\n\t\t\t{\n\t\t\t\tTblSetRowUsable (table, row, true);\n\n\t\t\t\t// Store the unique id of the record in the row.\n\t\t\t\tTblSetRowData (table, row, uniqueID);\n\n\t\t\t\t// Mark the row invalid so that it will draw when we call the\n\t\t\t\t// draw routine.\n\t\t\t\tTblMarkRowInvalid (table, row);\n\t\t\t}\n\n\t\t\tif (row+1 < numRows) recordNum++;\n\n\t\t\tdataHeight += lineHeight;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Set the row height - when scrolling winDown, the heights of the last rows of\n\t\t\t// the table are used to determine how far to scroll.  As rows are deleted\n\t\t\t// from the top of the table, formerly unused rows scroll into view, and the\n\t\t\t// height is used before the next call to ListViewLoadTable (which would set\n\t\t\t// the height correctly).\n\t\t\tTblSetRowHeight (table, row, lineHeight);\n\n\t\t\tTblSetRowUsable (table, row, false);\n\t\t}\n\t}\n\n\n\t// Update the scroll arrows.\n\tListViewUpdateScrollers (frm);\n}", "docstring": "/***********************************************************************\n *\n * FUNCTION:    ListViewLoadTable\n *\n * DESCRIPTION: This routine loads memo database records into\n *              the list view form.\n *\n * PARAMETERS:  recordNum index of the first record to display.\n *\n * RETURNED:    nothing\n *\n * REVISION HISTORY:\n *\t\t\tName\tDate\t\tDescription\n *\t\t\t----\t----\t\t-----------\n *\t\t\tart\t2/16/95\tInitial Revision\n *\t\t\tgrant\t1/29/99\tSet the heights of unused rows\n *\t\t\tryw\t1/11/01\tupdate global TopRowPositionInCategory on table load\n *\n ***********************************************************************/", "url": "https://github.com/migueletto/PumpkinOS/blob/d31ba3aca31b73c8f1ce40dbf812ddffe44c22de/src/MemoPad/MemoMain.c#L3046-L3132", "sha": "d31ba3aca31b73c8f1ce40dbf812ddffe44c22de"}118{"repo_name": "PumpkinOS", "dataset": "github_2023", "owner": "migueletto", "lang": "c", "func_name": "duk_get_top_require_min", "code": "DUK_INTERNAL duk_idx_t duk_get_top_require_min(duk_hthread *thr, duk_idx_t min_top) {\n\tduk_idx_t ret;\n\n\tDUK_ASSERT_API_ENTRY(thr);\n\n\tret = (duk_idx_t) (thr->valstack_top - thr->valstack_bottom);\n\tif (DUK_UNLIKELY(ret < min_top)) {\n\t\tDUK_ERROR_TYPE_INVALID_ARGS(thr);\n\t\tDUK_WO_NORETURN(return 0;);\n\t}\n\treturn ret;\n}", "docstring": "/* Internal helper to get current top but to require a minimum top value\n * (TypeError if not met).\n */", "url": "https://github.com/migueletto/PumpkinOS/blob/d31ba3aca31b73c8f1ce40dbf812ddffe44c22de/src/duktape/duk_api_stack.c#L412-L423", "sha": "d31ba3aca31b73c8f1ce40dbf812ddffe44c22de"}119{"repo_name": "PumpkinOS", "dataset": "github_2023", "owner": "migueletto", "lang": "c", "func_name": "duk_join", "code": "DUK_EXTERNAL void duk_join(duk_hthread *thr, duk_idx_t count) {\n\tDUK_ASSERT_API_ENTRY(thr);\n\n\tduk__concat_and_join_helper(thr, count, 1 /*is_join*/);\n}", "docstring": "/* DUK_USE_PREFER_SIZE */", "url": "https://github.com/migueletto/PumpkinOS/blob/d31ba3aca31b73c8f1ce40dbf812ddffe44c22de/src/duktape/duk_api_string.c#L161-L165", "sha": "d31ba3aca31b73c8f1ce40dbf812ddffe44c22de"}120{"repo_name": "PumpkinOS", "dataset": "github_2023", "owner": "migueletto", "lang": "c", "func_name": "duk_debug_write_uint", "code": "DUK_INTERNAL void duk_debug_write_uint(duk_hthread *thr, duk_uint32_t x) {\n\t/* The debugger protocol doesn't support a plain integer encoding for\n\t * the full 32-bit unsigned range (only 32-bit signed).  For now,\n\t * unsigned 32-bit values simply written as signed ones.  This is not\n\t * a concrete issue except for 32-bit heaphdr fields.  Proper solutions\n\t * would be to (a) write such integers as IEEE doubles or (b) add an\n\t * unsigned 32-bit dvalue.\n\t */\n\tif (x >= 0x80000000UL) {\n\t\tDUK_D(DUK_DPRINT(\"writing unsigned integer 0x%08lx as signed integer\",\n\t\t                 (long) x));\n\t}\n\tduk_debug_write_int(thr, (duk_int32_t) x);\n}", "docstring": "/* Write unsigned 32-bit integer. */", "url": "https://github.com/migueletto/PumpkinOS/blob/d31ba3aca31b73c8f1ce40dbf812ddffe44c22de/src/duktape/duk_debugger.c#L758-L771", "sha": "d31ba3aca31b73c8f1ce40dbf812ddffe44c22de"}121{"repo_name": "PumpkinOS", "dataset": "github_2023", "owner": "migueletto", "lang": "c", "func_name": "duk__bi_mul", "code": "DUK_LOCAL void duk__bi_mul(duk__bigint *x, duk__bigint *y, duk__bigint *z) {\n\tduk_small_int_t i, j, nx, nz;\n\n\tDUK_ASSERT(duk__bi_is_valid(y));\n\tDUK_ASSERT(duk__bi_is_valid(z));\n\n\tnx = y->n + z->n;  /* max possible */\n\tDUK_ASSERT(nx <= DUK__BI_MAX_PARTS);\n\n\tif (nx == 0) {\n\t\t/* Both inputs are zero; cases where only one is zero can go\n\t\t * through main algorithm.\n\t\t */\n\t\tx->n = 0;\n\t\treturn;\n\t}\n\n\tduk_memzero((void *) x->v, (size_t) (sizeof(duk_uint32_t) * (size_t) nx));\n\tx->n = nx;\n\n\tnz = z->n;\n\tfor (i = 0; i < y->n; i++) {\n#if defined(DUK_USE_64BIT_OPS)\n\t\tduk_uint64_t tmp = 0U;\n\t\tfor (j = 0; j < nz; j++) {\n\t\t\ttmp += (duk_uint64_t) y->v[i] * (duk_uint64_t) z->v[j] + x->v[i+j];\n\t\t\tx->v[i+j] = (duk_uint32_t) (tmp & 0xffffffffUL);\n\t\t\ttmp = tmp >> 32;\n\t\t}\n\t\tif (tmp > 0) {\n\t\t\tDUK_ASSERT(i + j < nx);\n\t\t\tDUK_ASSERT(i + j < DUK__BI_MAX_PARTS);\n\t\t\tDUK_ASSERT(x->v[i+j] == 0U);\n\t\t\tx->v[i+j] = (duk_uint32_t) tmp;\n\t\t}\n#else\n\t\t/*\n\t\t *  Multiply + add + carry for 32-bit components using only 16x16->32\n\t\t *  multiplies and carry detection based on unsigned overflow.\n\t\t *\n\t\t *    1st mult, 32-bit: (A*2^16 + B)\n\t\t *    2nd mult, 32-bit: (C*2^16 + D)\n\t\t *    3rd add, 32-bit: E\n\t\t *    4th add, 32-bit: F\n\t\t *\n\t\t *      (AC*2^16 + B) * (C*2^16 + D) + E + F\n\t\t *    = AC*2^32 + AD*2^16 + BC*2^16 + BD + E + F\n\t\t *    = AC*2^32 + (AD + BC)*2^16 + (BD + E + F)\n\t\t *    = AC*2^32 + AD*2^16 + BC*2^16 + (BD + E + F)\n\t\t */\n\t\tduk_uint32_t a, b, c, d, e, f;\n\t\tduk_uint32_t r, s, t;\n\n\t\ta = y->v[i]; b = a & 0xffffUL; a = a >> 16;\n\n\t\tf = 0;\n\t\tfor (j = 0; j < nz; j++) {\n\t\t\tc = z->v[j]; d = c & 0xffffUL; c = c >> 16;\n\t\t\te = x->v[i+j];\n\n\t\t\t/* build result as: (r << 32) + s: start with (BD + E + F) */\n\t\t\tr = 0;\n\t\t\ts = b * d;\n\n\t\t\t/* add E */\n\t\t\tt = s + e;\n\t\t\tif (t < s) { r++; }  /* carry */\n\t\t\ts = t;\n\n\t\t\t/* add F */\n\t\t\tt = s + f;\n\t\t\tif (t < s) { r++; }  /* carry */\n\t\t\ts = t;\n\n\t\t\t/* add BC*2^16 */\n\t\t\tt = b * c;\n\t\t\tr += (t >> 16);\n\t\t\tt = s + ((t & 0xffffUL) << 16);\n\t\t\tif (t < s) { r++; }  /* carry */\n\t\t\ts = t;\n\n\t\t\t/* add AD*2^16 */\n\t\t\tt = a * d;\n\t\t\tr += (t >> 16);\n\t\t\tt = s + ((t & 0xffffUL) << 16);\n\t\t\tif (t < s) { r++; }  /* carry */\n\t\t\ts = t;\n\n\t\t\t/* add AC*2^32 */\n\t\t\tt = a * c;\n\t\t\tr += t;\n\n\t\t\tDUK_DDD(DUK_DDDPRINT(\"ab=%08lx cd=%08lx ef=%08lx -> rs=%08lx %08lx\",\n\t\t\t                     (unsigned long) y->v[i], (unsigned long) z->v[j],\n\t\t\t                     (unsigned long) x->v[i+j], (unsigned long) r,\n\t\t\t                     (unsigned long) s));\n\n\t\t\tx->v[i+j] = s;\n\t\t\tf = r;\n\t\t}\n\t\tif (f > 0U) {\n\t\t\tDUK_ASSERT(i + j < nx);\n\t\t\tDUK_ASSERT(i + j < DUK__BI_MAX_PARTS);\n\t\t\tDUK_ASSERT(x->v[i+j] == 0U);\n\t\t\tx->v[i+j] = (duk_uint32_t) f;\n\t\t}\n#endif  /* DUK_USE_64BIT_OPS */\n\t}\n\n\tduk__bi_normalize(x);\n\tDUK_ASSERT(duk__bi_is_valid(x));\n}", "docstring": "/* x <- y * z */", "url": "https://github.com/migueletto/PumpkinOS/blob/d31ba3aca31b73c8f1ce40dbf812ddffe44c22de/src/duktape/duk_numconv.c#L396-L507", "sha": "d31ba3aca31b73c8f1ce40dbf812ddffe44c22de"}122{"repo_name": "PumpkinOS", "dataset": "github_2023", "owner": "migueletto", "lang": "c", "func_name": "read_restart_marker", "code": "METHODDEF(boolean)\nread_restart_marker (j_decompress_ptr cinfo)\n{\n  /* Obtain a marker unless we already did. */\n  /* Note that next_marker will complain if it skips any data. */\n  if (cinfo->unread_marker == 0) {\n    if (! next_marker(cinfo))\n      return FALSE;\n  }\n\n  if (cinfo->unread_marker ==\n      ((int) M_RST0 + cinfo->marker->next_restart_num)) {\n    /* Normal case --- swallow the marker and let entropy decoder continue */\n    TRACEMS1(cinfo, 3, JTRC_RST, cinfo->marker->next_restart_num);\n    cinfo->unread_marker = 0;\n  } else {\n    /* Uh-oh, the restart markers have been messed up. */\n    /* Let the data source manager determine how to resync. */\n    if (! (*cinfo->src->resync_to_restart) (cinfo,\n\t\t\t\t\t    cinfo->marker->next_restart_num))\n      return FALSE;\n  }\n\n  /* Update next-restart state */\n  cinfo->marker->next_restart_num = (cinfo->marker->next_restart_num + 1) & 7;\n\n  return TRUE;\n}", "docstring": "/*\n * Read a restart marker, which is expected to appear next in the datastream;\n * if the marker is not there, take appropriate recovery action.\n * Returns FALSE if suspension is required.\n *\n * This is called by the entropy decoder after it has read an appropriate\n * number of MCUs.  cinfo->unread_marker may be nonzero if the entropy decoder\n * has already read a marker from the data source.  Under normal conditions\n * cinfo->unread_marker will be reset to 0 before returning; if not reset,\n * it holds a marker which the decoder will be unable to read past.\n */", "url": "https://github.com/migueletto/PumpkinOS/blob/d31ba3aca31b73c8f1ce40dbf812ddffe44c22de/src/jpeg-8d/jdmarker.c#L1158-L1185", "sha": "d31ba3aca31b73c8f1ce40dbf812ddffe44c22de"}123{"repo_name": "PumpkinOS", "dataset": "github_2023", "owner": "migueletto", "lang": "c", "func_name": "absx6502", "code": "void absx6502(m6502_t *m6502) {\n  SAVEPC = RM16(PC);\n  PC++;\n  PC++;\n  if (m6502_cycles[m6502->opcode] == 4)\n    if ((SAVEPC >> 8) != ((SAVEPC + X) >> 8))\n      m6502->clockticks6502++;\n  SAVEPC += X;\n}", "docstring": "// ABS,X", "url": "https://github.com/migueletto/PumpkinOS/blob/d31ba3aca31b73c8f1ce40dbf812ddffe44c22de/src/libemulation/m6502.c#L224-L232", "sha": "d31ba3aca31b73c8f1ce40dbf812ddffe44c22de"}124{"repo_name": "PumpkinOS", "dataset": "github_2023", "owner": "migueletto", "lang": "c", "func_name": "andcc", "code": "static void andcc(m6809_t *m6809)\n{\n  uint8_t t;\n  IMMBYTE(t);\n  CC &= t;\n  CHECK_IRQ_LINES;\n}", "docstring": "// case 0x1B: //ILLEGAL\n// case 0x1C: //ANDCC immediate #####", "url": "https://github.com/migueletto/PumpkinOS/blob/d31ba3aca31b73c8f1ce40dbf812ddffe44c22de/src/libemulation/m6809ops.c#L223-L229", "sha": "d31ba3aca31b73c8f1ce40dbf812ddffe44c22de"}125{"repo_name": "PumpkinOS", "dataset": "github_2023", "owner": "migueletto", "lang": "c", "func_name": "sys_country", "code": "int sys_country(char *country, int len) {\n  int r = -1;\n\n#ifdef WINDOWS\n  char buf[32];\n  GEOID myGEO = GetUserGeoID(GEOCLASS_NATION);\n  if (GetGeoInfoA(myGEO, GEO_ISO2, buf, sizeof(buf), 0)) {\n    sys_strncpy(country, buf, len-1);\n    r = 0;\n  }\n#else\n  char *s, *p, buf[32];\n  if ((s = getenv(\"LANG\")) != NULL) {\n    sys_strncpy(buf, s, sizeof(buf)-1);\n    if ((p = sys_strchr(buf, '.')) != NULL) {\n      // \"pt_BR.UTF-8\" -> \"pt_BR\"\n      *p = 0;\n    }\n    if (!sys_strcmp(buf, \"C\")) {\n      sys_strncpy(buf, EN_US, sizeof(buf)-1);\n    }\n    if ((p = sys_strchr(buf, '_')) != NULL) {\n      // \"pt_BR\" -> \"BR\"\n      sys_strncpy(country, p+1, len-1);\n      r = 0;\n    }\n  }\n#endif\n\n  return r;\n}", "docstring": "/*\nThe name of a locale consists of language codes, character encoding, and the description of a selected variant.\n\nA name starts with an ISO 639-1 lowercase two-letter language code, or an ISO 639-2 three-letter language code if the language has no two-letter code. For example, it is de for German, fr for French, and cel for Celtic. The code is followed for many but not all languages by an underscore _ and by an ISO 3166 uppercase two-letter country code. For example, this leads to de_CH for Swiss German, and fr_CA for a French-speaking system for a Canadian user likely to be located in Quebec.\n\nOptionally, a dot . follows the name of the character encoding such as UTF-8, or ISO-8859-1, and the @ sign followed by the name of a variant. For example, the name en_IE.UTF-8@euro describes the setup for an English system for Ireland with UTF-8 character encoding, and the Euro as the currency symbol.\n*/", "url": "https://github.com/migueletto/PumpkinOS/blob/d31ba3aca31b73c8f1ce40dbf812ddffe44c22de/src/libpit/sys.c#L344-L374", "sha": "d31ba3aca31b73c8f1ce40dbf812ddffe44c22de"}126{"repo_name": "PumpkinOS", "dataset": "github_2023", "owner": "migueletto", "lang": "c", "func_name": "SW_FT_Vector_Length", "code": "SW_FT_Fixed SW_FT_Vector_Length(SW_FT_Vector* vec)\n{\n    SW_FT_Int    shift;\n    SW_FT_Vector v;\n\n    v = *vec;\n\n    /* handle trivial cases */\n    if (v.x == 0) {\n        return SW_FT_ABS(v.y);\n    } else if (v.y == 0) {\n        return SW_FT_ABS(v.x);\n    }\n\n    /* general case */\n    shift = ft_trig_prenorm(&v);\n    ft_trig_pseudo_polarize(&v);\n\n    v.x = ft_trig_downscale(v.x);\n\n    if (shift > 0) return (v.x + (1 << (shift - 1))) >> shift;\n\n    return (SW_FT_Fixed)((SW_FT_UInt32)v.x << -shift);\n}", "docstring": "/* documentation is in fttrigon.h */", "url": "https://github.com/migueletto/PumpkinOS/blob/d31ba3aca31b73c8f1ce40dbf812ddffe44c22de/src/libpluto/sw_ft_math.c#L388-L411", "sha": "d31ba3aca31b73c8f1ce40dbf812ddffe44c22de"}127{"repo_name": "PumpkinOS", "dataset": "github_2023", "owner": "migueletto", "lang": "c", "func_name": "loadline", "code": "static int loadline (lua_State *L) {\n  int status;\n  lua_settop(L, 0);\n  if (!pushline(L, 1))\n    return -1;  /* no input */\n  if ((status = addreturn(L)) != LUA_OK)  /* 'return ...' did not work? */\n    status = multiline(L);  /* try as command, maybe with continuation lines */\n  lua_remove(L, 1);  /* remove line from the stack */\n  lua_assert(lua_gettop(L) == 1);\n  return status;\n}", "docstring": "/*\n** Read a line and try to load (compile) it first as an expression (by\n** adding \"return \" in front of it) and second as a statement. Return\n** the final status of load/call with the resulting function (if any)\n** in the top of the stack.\n*/", "url": "https://github.com/migueletto/PumpkinOS/blob/d31ba3aca31b73c8f1ce40dbf812ddffe44c22de/src/lua/lua.c#L372-L382", "sha": "d31ba3aca31b73c8f1ce40dbf812ddffe44c22de"}128{"repo_name": "PumpkinOS", "dataset": "github_2023", "owner": "migueletto", "lang": "c", "func_name": "SetOutFileDir", "code": "VOID\nSetOutFileDir(const char *sz)\n{\n  if (sz && strcmp(sz, \".\") == 0)\n    szOutFileDir = \"\";\n  else\n    szOutFileDir = sz;\n}", "docstring": "/*-----------------------------------------------------------------------------\n|\tSetOutFileDir\n|\t\n|\t\tSet output file path -- no trailing / or \\ \n-------------------------------------------------------------WESC------------*/", "url": "https://github.com/migueletto/PumpkinOS/blob/d31ba3aca31b73c8f1ce40dbf812ddffe44c22de/src/pilrc/util.c#L475-L482", "sha": "d31ba3aca31b73c8f1ce40dbf812ddffe44c22de"}129{"repo_name": "T-Display-S3-AMOLED", "dataset": "github_2023", "owner": "Xinyuan-LilyGO", "lang": "c", "func_name": "begin_SDA_Read", "code": "void TFT_eSPI::begin_SDA_Read(void)\n{\n  #ifdef TFT_SPI_OVERLAP\n    // Reads in overlap mode not supported\n  #else\n    spi.end();\n  #endif\n}", "docstring": "/***************************************************************************************\n** Function name:           beginSDA\n** Description:             Detach SPI from pin to permit software SPI\n***************************************************************************************/", "url": "https://github.com/Xinyuan-LilyGO/T-Display-S3-AMOLED/blob/edd133335c9f7c38d1e9be2d0eb67371f1f6428e/lib/TFT_eSPI/Processors/TFT_eSPI_ESP8266.c#L40-L47", "sha": "edd133335c9f7c38d1e9be2d0eb67371f1f6428e"}130{"repo_name": "T-Display-S3-AMOLED", "dataset": "github_2023", "owner": "Xinyuan-LilyGO", "lang": "c", "func_name": "lv_example_flex_5", "code": "void lv_example_flex_5(void)\n{\n    lv_obj_t * cont = lv_obj_create(lv_scr_act());\n    lv_obj_set_size(cont, 300, 220);\n    lv_obj_center(cont);\n    lv_obj_set_flex_flow(cont, LV_FLEX_FLOW_ROW_WRAP);\n\n    uint32_t i;\n    for(i = 0; i < 9; i++) {\n        lv_obj_t * obj = lv_obj_create(cont);\n        lv_obj_set_size(obj, 70, LV_SIZE_CONTENT);\n\n        lv_obj_t * label = lv_label_create(obj);\n        lv_label_set_text_fmt(label, \"%\"LV_PRIu32, i);\n        lv_obj_center(label);\n    }\n\n    lv_anim_t a;\n    lv_anim_init(&a);\n    lv_anim_set_var(&a, cont);\n    lv_anim_set_values(&a, 0, 10);\n    lv_anim_set_repeat_count(&a, LV_ANIM_REPEAT_INFINITE);\n\n    lv_anim_set_exec_cb(&a, row_gap_anim);\n    lv_anim_set_time(&a, 500);\n    lv_anim_set_playback_time(&a, 500);\n    lv_anim_start(&a);\n\n    lv_anim_set_exec_cb(&a, column_gap_anim);\n    lv_anim_set_time(&a, 3000);\n    lv_anim_set_playback_time(&a, 3000);\n    lv_anim_start(&a);\n}", "docstring": "/**\n * Demonstrate the effect of column and row gap style properties\n */", "url": "https://github.com/Xinyuan-LilyGO/T-Display-S3-AMOLED/blob/edd133335c9f7c38d1e9be2d0eb67371f1f6428e/lib/lvgl/examples/layouts/flex/lv_example_flex_5.c#L17-L49", "sha": "edd133335c9f7c38d1e9be2d0eb67371f1f6428e"}131{"repo_name": "T-Display-S3-AMOLED", "dataset": "github_2023", "owner": "Xinyuan-LilyGO", "lang": "c", "func_name": "lv_example_style_9", "code": "void lv_example_style_9(void)\n{\n    static lv_style_t style;\n    lv_style_init(&style);\n\n    lv_style_set_line_color(&style, lv_palette_main(LV_PALETTE_GREY));\n    lv_style_set_line_width(&style, 6);\n    lv_style_set_line_rounded(&style, true);\n\n    /*Create an object with the new style*/\n    lv_obj_t * obj = lv_line_create(lv_scr_act());\n    lv_obj_add_style(obj, &style, 0);\n\n    static lv_point_t p[] = {{10, 30}, {30, 50}, {100, 0}};\n    lv_line_set_points(obj, p, 3);\n\n    lv_obj_center(obj);\n}", "docstring": "/**\n * Using the line style properties\n */", "url": "https://github.com/Xinyuan-LilyGO/T-Display-S3-AMOLED/blob/edd133335c9f7c38d1e9be2d0eb67371f1f6428e/lib/lvgl/examples/styles/lv_example_style_9.c#L7-L24", "sha": "edd133335c9f7c38d1e9be2d0eb67371f1f6428e"}132{"repo_name": "T-Display-S3-AMOLED", "dataset": "github_2023", "owner": "Xinyuan-LilyGO", "lang": "c", "func_name": "lv_fs_fatfs_init", "code": "void lv_fs_fatfs_init(void)\n{\n    /*----------------------------------------------------\n     * Initialize your storage device and File System\n     * -------------------------------------------------*/\n    fs_init();\n\n    /*---------------------------------------------------\n     * Register the file system interface in LVGL\n     *--------------------------------------------------*/\n\n    /*Add a simple drive to open images*/\n    static lv_fs_drv_t fs_drv; /*A driver descriptor*/\n    lv_fs_drv_init(&fs_drv);\n\n    /*Set up fields...*/\n    fs_drv.letter = LV_FS_FATFS_LETTER;\n    fs_drv.cache_size = LV_FS_FATFS_CACHE_SIZE;\n\n    fs_drv.open_cb = fs_open;\n    fs_drv.close_cb = fs_close;\n    fs_drv.read_cb = fs_read;\n    fs_drv.write_cb = fs_write;\n    fs_drv.seek_cb = fs_seek;\n    fs_drv.tell_cb = fs_tell;\n\n    fs_drv.dir_close_cb = fs_dir_close;\n    fs_drv.dir_open_cb = fs_dir_open;\n    fs_drv.dir_read_cb = fs_dir_read;\n\n    lv_fs_drv_register(&fs_drv);\n}", "docstring": "/**********************\n *  STATIC VARIABLES\n **********************/\n/**********************\n *      MACROS\n **********************/\n/**********************\n *   GLOBAL FUNCTIONS\n **********************/", "url": "https://github.com/Xinyuan-LilyGO/T-Display-S3-AMOLED/blob/edd133335c9f7c38d1e9be2d0eb67371f1f6428e/lib/lvgl/src/extra/libs/fsdrv/lv_fs_fatfs.c#L53-L84", "sha": "edd133335c9f7c38d1e9be2d0eb67371f1f6428e"}133{"repo_name": "T-Display-S3-AMOLED", "dataset": "github_2023", "owner": "Xinyuan-LilyGO", "lang": "c", "func_name": "fillRectangle", "code": "static void fillRectangle(int left, int top, int width, int height, uint8_t qrcode[]) {\n\tfor (int dy = 0; dy < height; dy++) {\n\t\tfor (int dx = 0; dx < width; dx++)\n\t\t\tsetModule(qrcode, left + dx, top + dy, true);\n\t}\n}", "docstring": "// Sets every pixel in the range [left : left + width] * [top : top + height] to black.", "url": "https://github.com/Xinyuan-LilyGO/T-Display-S3-AMOLED/blob/edd133335c9f7c38d1e9be2d0eb67371f1f6428e/lib/lvgl/src/extra/libs/qrcode/qrcodegen.c#L559-L564", "sha": "edd133335c9f7c38d1e9be2d0eb67371f1f6428e"}134{"repo_name": "T-Display-S3-AMOLED", "dataset": "github_2023", "owner": "Xinyuan-LilyGO", "lang": "c", "func_name": "lv_switch_trigger_anim", "code": "static void lv_switch_trigger_anim(lv_obj_t * obj)\n{\n    LV_ASSERT_OBJ(obj, MY_CLASS);\n    lv_switch_t * sw = (lv_switch_t *)obj;\n\n    uint32_t anim_dur_full = lv_obj_get_style_anim_time(obj, LV_PART_MAIN);\n\n    if(anim_dur_full > 0) {\n        bool chk = lv_obj_get_state(obj) & LV_STATE_CHECKED;\n        int32_t anim_start;\n        int32_t anim_end;\n        /*No animation in progress -> simply set the values*/\n        if(sw->anim_state == LV_SWITCH_ANIM_STATE_INV) {\n            anim_start = chk ? LV_SWITCH_ANIM_STATE_START : LV_SWITCH_ANIM_STATE_END;\n            anim_end   = chk ? LV_SWITCH_ANIM_STATE_END : LV_SWITCH_ANIM_STATE_START;\n        }\n        /*Animation in progress. Start from the animation end value*/\n        else {\n            anim_start = sw->anim_state;\n            anim_end   = chk ? LV_SWITCH_ANIM_STATE_END : LV_SWITCH_ANIM_STATE_START;\n        }\n        /*Calculate actual animation duration*/\n        uint32_t anim_dur = (anim_dur_full * LV_ABS(anim_start - anim_end)) / LV_SWITCH_ANIM_STATE_END;\n\n        /*Stop the previous animation if it exists*/\n        lv_anim_del(sw, NULL);\n\n        lv_anim_t a;\n        lv_anim_init(&a);\n        lv_anim_set_var(&a, sw);\n        lv_anim_set_exec_cb(&a, lv_switch_anim_exec_cb);\n        lv_anim_set_values(&a, anim_start, anim_end);\n        lv_anim_set_ready_cb(&a, lv_switch_anim_ready);\n        lv_anim_set_time(&a, anim_dur);\n        lv_anim_start(&a);\n    }\n}", "docstring": "/**\n * Starts an animation for the switch knob. if the anim_time style property is greater than 0\n * @param obj the switch to animate\n */", "url": "https://github.com/Xinyuan-LilyGO/T-Display-S3-AMOLED/blob/edd133335c9f7c38d1e9be2d0eb67371f1f6428e/lib/lvgl/src/widgets/lv_switch.c#L238-L274", "sha": "edd133335c9f7c38d1e9be2d0eb67371f1f6428e"}135{"repo_name": "ch32v003fun", "dataset": "github_2023", "owner": "cnlohr", "lang": "c", "func_name": "adc_init", "code": "void adc_init( void )\n{\n\t// ADCCLK = 24 MHz => RCC_ADCPRE = 0: divide by 2\n\tRCC->CFGR0 &= ~(0x1F<<11);\n\t\n\t// Enable GPIOD and ADC\n\tRCC->APB2PCENR |= RCC_APB2Periph_GPIOD | RCC_APB2Periph_ADC1;\n\t\n\t// PD4 is analog input chl 7\n\tGPIOD->CFGLR &= ~(0xf<<(4*4));\t// CNF = 00: Analog, MODE = 00: Input\n\t\n\t// Reset the ADC to init all regs\n\tRCC->APB2PRSTR |= RCC_APB2Periph_ADC1;\n\tRCC->APB2PRSTR &= ~RCC_APB2Periph_ADC1;\n\t\n\t// Set up single conversion on chl 7\n\tADC1->RSQR1 = 0;\n\tADC1->RSQR2 = 0;\n\tADC1->RSQR3 = 7;\t// 0-9 for 8 ext inputs and two internals\n\t\n\t// set sampling time for chl 7\n\tADC1->SAMPTR2 &= ~(ADC_SMP0<<(3*7));\n\tADC1->SAMPTR2 |= 7<<(3*7);\t// 0:7 => 3/9/15/30/43/57/73/241 cycles\n\t\t\n\t// turn on ADC and set rule group to sw trig\n\tADC1->CTLR2 |= ADC_ADON | ADC_EXTSEL;\n\t\n\t// Reset calibration\n\tADC1->CTLR2 |= ADC_RSTCAL;\n\twhile(ADC1->CTLR2 & ADC_RSTCAL);\n\t\n\t// Calibrate\n\tADC1->CTLR2 |= ADC_CAL;\n\twhile(ADC1->CTLR2 & ADC_CAL);\n\t\n\t// should be ready for SW conversion now\n}", "docstring": "/*\n * initialize adc for polling\n */", "url": "https://github.com/cnlohr/ch32v003fun/blob/92b39c8984cab685ab59d6cc6c108de21e21d98a/examples/adc_polled/adc_polled.c#L12-L48", "sha": "92b39c8984cab685ab59d6cc6c108de21e21d98a"}136{"repo_name": "platform-ch32v", "dataset": "github_2023", "owner": "Community-PIO-CH32V", "lang": "c", "func_name": "EXTI_Line_Init", "code": "void EXTI_Line_Init(void)\n{\n    GPIO_InitTypeDef GPIO_InitStructure = {0};\n    EXTI_InitTypeDef EXTI_InitStructure = {0};\n    NVIC_InitTypeDef NVIC_InitStructure = {0};\n\n    RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO | RCC_APB2Periph_GPIOC, ENABLE);\n\n    GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7;\n    GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;\n    GPIO_Init(GPIOC, &GPIO_InitStructure);\n\n    /* GPIOC 7 ----> EXTI_Line7 */\n    GPIO_EXTILineConfig(GPIO_PortSourceGPIOC, GPIO_PinSource7);\n    EXTI_InitStructure.EXTI_Line = EXTI_Line7;\n    EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;\n    EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Falling;\n    EXTI_InitStructure.EXTI_LineCmd = ENABLE;\n    EXTI_Init(&EXTI_InitStructure);\n\n    NVIC_InitStructure.NVIC_IRQChannel = EXTI9_5_IRQn;\n    NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1;\n    NVIC_InitStructure.NVIC_IRQChannelSubPriority = 2;\n    NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;\n    NVIC_Init(&NVIC_InitStructure);\n}", "docstring": "/*********************************************************************\n * @fn      EXTI_Line_Init\n *\n * @brief   Configure EXTI Line7.\n *\n * @param   none.\n *\n * @return  none.\n */", "url": "https://github.com/Community-PIO-CH32V/platform-ch32v/blob/8af792530c1b16b24526f6e64e2ea1b383890047/examples/webserver-ch32v307-none-os/lib/NetLib/eth_driver_RMII.c#L172-L197", "sha": "8af792530c1b16b24526f6e64e2ea1b383890047"}137{"repo_name": "AtomLdr", "dataset": "github_2023", "owner": "NUL0x4C", "lang": "c", "func_name": "FetchAesKetAndIv", "code": "VOID FetchAesKetAndIv(IN OUT PBYTE ctAesKey, IN OUT PBYTE ctAesIv) {\n\n\tfor (int i = 0; i < IV_SIZE; i++) {\n\t\tctAesIv[i] -= 0x03;\n\t}\n\tfor (int i = 0; i < KEY_SIZE; i++) {\n\t\tctAesKey[i] -= 0x03;\n\t}\n\tfor (int i = 0; i < IV_SIZE; i++) {\n\t\tctAesIv[i] ^= (BYTE)ctAesKey[0];\n\t}\n\tfor (int i = 1; i < KEY_SIZE; i++) {\n\t\tfor (int j = 0; j < IV_SIZE; j++) {\n\t\t\tctAesKey[i] ^= (BYTE)ctAesIv[j];\n\t\t}\n\t}\n}", "docstring": "/*\n\tfunction to decrypt the aes key and iv\n*/", "url": "https://github.com/NUL0x4C/AtomLdr/blob/f18cb75c28f312fb8edaa86ea7c65f148ff26d0d/AtomLdr/dllmain.c#L83-L99", "sha": "f18cb75c28f312fb8edaa86ea7c65f148ff26d0d"}138{"repo_name": "duckdb-spatial", "dataset": "github_2023", "owner": "duckdb", "lang": "c", "func_name": "recoverTransferSettings", "code": "static void recoverTransferSettings(sqlite3_recover *p){\n  const char *aPragma[] = {\n    \"encoding\",\n    \"page_size\",\n    \"auto_vacuum\",\n    \"user_version\",\n    \"application_id\"\n  };\n  int ii;\n\n  /* Truncate the output database to 0 pages in size. This is done by \n  ** opening a new, empty, temp db, then using the backup API to clobber \n  ** any existing output db with a copy of it. */\n  if( p->errCode==SQLITE_OK ){\n    sqlite3 *db2 = 0;\n    int rc = sqlite3_open(\"\", &db2);\n    if( rc!=SQLITE_OK ){\n      recoverDbError(p, db2);\n      return;\n    }\n\n    for(ii=0; ii<sizeof(aPragma)/sizeof(aPragma[0]); ii++){\n      const char *zPrag = aPragma[ii];\n      sqlite3_stmt *p1 = 0;\n      p1 = recoverPreparePrintf(p, p->dbIn, \"PRAGMA %Q.%s\", p->zDb, zPrag);\n      if( p->errCode==SQLITE_OK && sqlite3_step(p1)==SQLITE_ROW ){\n        const char *zArg = (const char*)sqlite3_column_text(p1, 0);\n        char *z2 = recoverMPrintf(p, \"PRAGMA %s = %Q\", zPrag, zArg);\n        recoverSqlCallback(p, z2);\n        recoverExec(p, db2, z2);\n        sqlite3_free(z2);\n        if( zArg==0 ){\n          recoverError(p, SQLITE_NOMEM, 0);\n        }\n      }\n      recoverFinalize(p, p1);\n    }\n    recoverExec(p, db2, \"CREATE TABLE t1(a); DROP TABLE t1;\");\n\n    if( p->errCode==SQLITE_OK ){\n      sqlite3 *db = p->dbOut;\n      sqlite3_backup *pBackup = sqlite3_backup_init(db, \"main\", db2, \"main\");\n      if( pBackup ){\n        sqlite3_backup_step(pBackup, -1);\n        p->errCode = sqlite3_backup_finish(pBackup);\n      }else{\n        recoverDbError(p, db);\n      }\n    }\n\n    sqlite3_close(db2);\n  }\n}", "docstring": "/*\n** Transfer the following settings from the input database to the output\n** database:\n**\n**   + page-size,\n**   + auto-vacuum settings,\n**   + database encoding,\n**   + user-version (PRAGMA user_version), and\n**   + application-id (PRAGMA application_id), and\n*/", "url": "https://github.com/duckdb/duckdb-spatial/blob/aa95ed8049da630da45e763f3bb6e9aeb1891e34/deps/vendor/sqlite3/src/shell.c#L13507-L13559", "sha": "aa95ed8049da630da45e763f3bb6e9aeb1891e34"}139{"repo_name": "duckdb-spatial", "dataset": "github_2023", "owner": "duckdb", "lang": "c", "func_name": "memsys5Size", "code": "static int memsys5Size(void *p){\n  int iSize, i;\n  assert( p!=0 );\n  i = (int)(((u8 *)p-mem5.zPool)/mem5.szAtom);\n  assert( i>=0 && i<mem5.nBlock );\n  iSize = mem5.szAtom * (1 << (mem5.aCtrl[i]&CTRL_LOGSIZE));\n  return iSize;\n}", "docstring": "/*\n** Return the size of an outstanding allocation, in bytes.\n** This only works for chunks that are currently checked out.\n*/", "url": "https://github.com/duckdb/duckdb-spatial/blob/aa95ed8049da630da45e763f3bb6e9aeb1891e34/deps/vendor/sqlite3/src/sqlite3.c#L27076-L27083", "sha": "aa95ed8049da630da45e763f3bb6e9aeb1891e34"}140{"repo_name": "duckdb-spatial", "dataset": "github_2023", "owner": "duckdb", "lang": "c", "func_name": "pagerOpenWalIfPresent", "code": "static int pagerOpenWalIfPresent(Pager *pPager){\n  int rc = SQLITE_OK;\n  assert( pPager->eState==PAGER_OPEN );\n  assert( pPager->eLock>=SHARED_LOCK );\n\n  if( !pPager->tempFile ){\n    int isWal;                    /* True if WAL file exists */\n    rc = sqlite3OsAccess(\n        pPager->pVfs, pPager->zWal, SQLITE_ACCESS_EXISTS, &isWal\n    );\n    if( rc==SQLITE_OK ){\n      if( isWal ){\n        Pgno nPage;                   /* Size of the database file */\n\n        rc = pagerPagecount(pPager, &nPage);\n        if( rc ) return rc;\n        if( nPage==0 ){\n          rc = sqlite3OsDelete(pPager->pVfs, pPager->zWal, 0);\n        }else{\n          testcase( sqlite3PcachePagecount(pPager->pPCache)==0 );\n          rc = sqlite3PagerOpenWal(pPager, 0);\n        }\n      }else if( pPager->journalMode==PAGER_JOURNALMODE_WAL ){\n        pPager->journalMode = PAGER_JOURNALMODE_DELETE;\n      }\n    }\n  }\n  return rc;\n}", "docstring": "/*\n** Check if the *-wal file that corresponds to the database opened by pPager\n** exists if the database is not empy, or verify that the *-wal file does\n** not exist (by deleting it) if the database file is empty.\n**\n** If the database is not empty and the *-wal file exists, open the pager\n** in WAL mode.  If the database is empty or if no *-wal file exists and\n** if no error occurs, make sure Pager.journalMode is not set to\n** PAGER_JOURNALMODE_WAL.\n**\n** Return SQLITE_OK or an error code.\n**\n** The caller must hold a SHARED lock on the database file to call this\n** function. Because an EXCLUSIVE lock on the db file is required to delete\n** a WAL on a none-empty database, this ensures there is no race condition\n** between the xAccess() below and an xDelete() being executed by some\n** other connection.\n*/", "url": "https://github.com/duckdb/duckdb-spatial/blob/aa95ed8049da630da45e763f3bb6e9aeb1891e34/deps/vendor/sqlite3/src/sqlite3.c#L58481-L58509", "sha": "aa95ed8049da630da45e763f3bb6e9aeb1891e34"}141{"repo_name": "duckdb-spatial", "dataset": "github_2023", "owner": "duckdb", "lang": "c", "func_name": "sqlite3WalLimit", "code": "SQLITE_PRIVATE void sqlite3WalLimit(Wal *pWal, i64 iLimit){\n  if( pWal ) pWal->mxWalSize = iLimit;\n}", "docstring": "/*\n** Change the size to which the WAL file is trucated on each reset.\n*/", "url": "https://github.com/duckdb/duckdb-spatial/blob/aa95ed8049da630da45e763f3bb6e9aeb1891e34/deps/vendor/sqlite3/src/sqlite3.c#L64512-L64514", "sha": "aa95ed8049da630da45e763f3bb6e9aeb1891e34"}142{"repo_name": "duckdb-spatial", "dataset": "github_2023", "owner": "duckdb", "lang": "c", "func_name": "sqlite3WalBeginReadTransaction", "code": "SQLITE_PRIVATE int sqlite3WalBeginReadTransaction(Wal *pWal, int *pChanged){\n  int rc;                         /* Return code */\n  int cnt = 0;                    /* Number of TryBeginRead attempts */\n#ifdef SQLITE_ENABLE_SNAPSHOT\n  int bChanged = 0;\n  WalIndexHdr *pSnapshot = pWal->pSnapshot;\n#endif\n\n  assert( pWal->ckptLock==0 );\n\n#ifdef SQLITE_ENABLE_SNAPSHOT\n  if( pSnapshot ){\n    if( memcmp(pSnapshot, &pWal->hdr, sizeof(WalIndexHdr))!=0 ){\n      bChanged = 1;\n    }\n\n    /* It is possible that there is a checkpointer thread running\n    ** concurrent with this code. If this is the case, it may be that the\n    ** checkpointer has already determined that it will checkpoint\n    ** snapshot X, where X is later in the wal file than pSnapshot, but\n    ** has not yet set the pInfo->nBackfillAttempted variable to indicate\n    ** its intent. To avoid the race condition this leads to, ensure that\n    ** there is no checkpointer process by taking a shared CKPT lock\n    ** before checking pInfo->nBackfillAttempted.  */\n    (void)walEnableBlocking(pWal);\n    rc = walLockShared(pWal, WAL_CKPT_LOCK);\n    walDisableBlocking(pWal);\n\n    if( rc!=SQLITE_OK ){\n      return rc;\n    }\n    pWal->ckptLock = 1;\n  }\n#endif\n\n  do{\n    rc = walTryBeginRead(pWal, pChanged, 0, ++cnt);\n  }while( rc==WAL_RETRY );\n  testcase( (rc&0xff)==SQLITE_BUSY );\n  testcase( (rc&0xff)==SQLITE_IOERR );\n  testcase( rc==SQLITE_PROTOCOL );\n  testcase( rc==SQLITE_OK );\n\n#ifdef SQLITE_ENABLE_SNAPSHOT\n  if( rc==SQLITE_OK ){\n    if( pSnapshot && memcmp(pSnapshot, &pWal->hdr, sizeof(WalIndexHdr))!=0 ){\n      /* At this point the client has a lock on an aReadMark[] slot holding\n      ** a value equal to or smaller than pSnapshot->mxFrame, but pWal->hdr\n      ** is populated with the wal-index header corresponding to the head\n      ** of the wal file. Verify that pSnapshot is still valid before\n      ** continuing.  Reasons why pSnapshot might no longer be valid:\n      **\n      **    (1)  The WAL file has been reset since the snapshot was taken.\n      **         In this case, the salt will have changed.\n      **\n      **    (2)  A checkpoint as been attempted that wrote frames past\n      **         pSnapshot->mxFrame into the database file.  Note that the\n      **         checkpoint need not have completed for this to cause problems.\n      */\n      volatile WalCkptInfo *pInfo = walCkptInfo(pWal);\n\n      assert( pWal->readLock>0 || pWal->hdr.mxFrame==0 );\n      assert( pInfo->aReadMark[pWal->readLock]<=pSnapshot->mxFrame );\n\n      /* Check that the wal file has not been wrapped. Assuming that it has\n      ** not, also check that no checkpointer has attempted to checkpoint any\n      ** frames beyond pSnapshot->mxFrame. If either of these conditions are\n      ** true, return SQLITE_ERROR_SNAPSHOT. Otherwise, overwrite pWal->hdr\n      ** with *pSnapshot and set *pChanged as appropriate for opening the\n      ** snapshot.  */\n      if( !memcmp(pSnapshot->aSalt, pWal->hdr.aSalt, sizeof(pWal->hdr.aSalt))\n       && pSnapshot->mxFrame>=pInfo->nBackfillAttempted\n      ){\n        assert( pWal->readLock>0 );\n        memcpy(&pWal->hdr, pSnapshot, sizeof(WalIndexHdr));\n        *pChanged = bChanged;\n      }else{\n        rc = SQLITE_ERROR_SNAPSHOT;\n      }\n\n      /* A client using a non-current snapshot may not ignore any frames\n      ** from the start of the wal file. This is because, for a system\n      ** where (minFrame < iSnapshot < maxFrame), a checkpointer may\n      ** have omitted to checkpoint a frame earlier than minFrame in\n      ** the file because there exists a frame after iSnapshot that\n      ** is the same database page.  */\n      pWal->minFrame = 1;\n\n      if( rc!=SQLITE_OK ){\n        sqlite3WalEndReadTransaction(pWal);\n      }\n    }\n  }\n\n  /* Release the shared CKPT lock obtained above. */\n  if( pWal->ckptLock ){\n    assert( pSnapshot );\n    walUnlockShared(pWal, WAL_CKPT_LOCK);\n    pWal->ckptLock = 0;\n  }\n#endif\n  return rc;\n}", "docstring": "/* SQLITE_ENABLE_SNAPSHOT */\n/*\n** Begin a read transaction on the database.\n**\n** This routine used to be called sqlite3OpenSnapshot() and with good reason:\n** it takes a snapshot of the state of the WAL and wal-index for the current\n** instant in time.  The current thread will continue to use this snapshot.\n** Other threads might append new content to the WAL and wal-index but\n** that extra content is ignored by the current thread.\n**\n** If the database contents have changes since the previous read\n** transaction, then *pChanged is set to 1 before returning.  The\n** Pager layer will use this to know that its cache is stale and\n** needs to be flushed.\n*/", "url": "https://github.com/duckdb/duckdb-spatial/blob/aa95ed8049da630da45e763f3bb6e9aeb1891e34/deps/vendor/sqlite3/src/sqlite3.c#L65947-L66049", "sha": "aa95ed8049da630da45e763f3bb6e9aeb1891e34"}143{"repo_name": "duckdb-spatial", "dataset": "github_2023", "owner": "duckdb", "lang": "c", "func_name": "vdbeAssertFieldCountWithinLimits", "code": "static void vdbeAssertFieldCountWithinLimits(\n  int nKey, const void *pKey,   /* The record to verify */\n  const KeyInfo *pKeyInfo       /* Compare size with this KeyInfo */\n){\n  int nField = 0;\n  u32 szHdr;\n  u32 idx;\n  u32 notUsed;\n  const unsigned char *aKey = (const unsigned char*)pKey;\n\n  if( CORRUPT_DB ) return;\n  idx = getVarint32(aKey, szHdr);\n  assert( nKey>=0 );\n  assert( szHdr<=(u32)nKey );\n  while( idx<szHdr ){\n    idx += getVarint32(aKey+idx, notUsed);\n    nField++;\n  }\n  assert( nField <= pKeyInfo->nAllField );\n}", "docstring": "/*\n** Count the number of fields (a.k.a. columns) in the record given by\n** pKey,nKey.  The verify that this count is less than or equal to the\n** limit given by pKeyInfo->nAllField.\n**\n** If this constraint is not satisfied, it means that the high-speed\n** vdbeRecordCompareInt() and vdbeRecordCompareString() routines will\n** not work correctly.  If this assert() ever fires, it probably means\n** that the KeyInfo.nKeyField or KeyInfo.nAllField values were computed\n** incorrectly.\n*/", "url": "https://github.com/duckdb/duckdb-spatial/blob/aa95ed8049da630da45e763f3bb6e9aeb1891e34/deps/vendor/sqlite3/src/sqlite3.c#L86235-L86254", "sha": "aa95ed8049da630da45e763f3bb6e9aeb1891e34"}144{"repo_name": "duckdb-spatial", "dataset": "github_2023", "owner": "duckdb", "lang": "c", "func_name": "countOfViewOptimization", "code": "static int countOfViewOptimization(Parse *pParse, Select *p){\n  Select *pSub, *pPrior;\n  Expr *pExpr;\n  Expr *pCount;\n  sqlite3 *db;\n  if( (p->selFlags & SF_Aggregate)==0 ) return 0;   /* This is an aggregate */\n  if( p->pEList->nExpr!=1 ) return 0;               /* Single result column */\n  if( p->pWhere ) return 0;\n  if( p->pGroupBy ) return 0;\n  pExpr = p->pEList->a[0].pExpr;\n  if( pExpr->op!=TK_AGG_FUNCTION ) return 0;        /* Result is an aggregate */\n  assert( ExprUseUToken(pExpr) );\n  if( sqlite3_stricmp(pExpr->u.zToken,\"count\") ) return 0;  /* Is count() */\n  assert( ExprUseXList(pExpr) );\n  if( pExpr->x.pList!=0 ) return 0;                 /* Must be count(*) */\n  if( p->pSrc->nSrc!=1 ) return 0;                  /* One table in FROM  */\n  pSub = p->pSrc->a[0].pSelect;\n  if( pSub==0 ) return 0;                           /* The FROM is a subquery */\n  if( pSub->pPrior==0 ) return 0;                   /* Must be a compound ry */\n  do{\n    if( pSub->op!=TK_ALL && pSub->pPrior ) return 0;  /* Must be UNION ALL */\n    if( pSub->pWhere ) return 0;                      /* No WHERE clause */\n    if( pSub->pLimit ) return 0;                      /* No LIMIT clause */\n    if( pSub->selFlags & SF_Aggregate ) return 0;     /* Not an aggregate */\n    pSub = pSub->pPrior;                              /* Repeat over compound */\n  }while( pSub );\n\n  /* If we reach this point then it is OK to perform the transformation */\n\n  db = pParse->db;\n  pCount = pExpr;\n  pExpr = 0;\n  pSub = p->pSrc->a[0].pSelect;\n  p->pSrc->a[0].pSelect = 0;\n  sqlite3SrcListDelete(db, p->pSrc);\n  p->pSrc = sqlite3DbMallocZero(pParse->db, sizeof(*p->pSrc));\n  while( pSub ){\n    Expr *pTerm;\n    pPrior = pSub->pPrior;\n    pSub->pPrior = 0;\n    pSub->pNext = 0;\n    pSub->selFlags |= SF_Aggregate;\n    pSub->selFlags &= ~SF_Compound;\n    pSub->nSelectRow = 0;\n    sqlite3ExprListDelete(db, pSub->pEList);\n    pTerm = pPrior ? sqlite3ExprDup(db, pCount, 0) : pCount;\n    pSub->pEList = sqlite3ExprListAppend(pParse, 0, pTerm);\n    pTerm = sqlite3PExpr(pParse, TK_SELECT, 0, 0);\n    sqlite3PExprAddSelect(pParse, pTerm, pSub);\n    if( pExpr==0 ){\n      pExpr = pTerm;\n    }else{\n      pExpr = sqlite3PExpr(pParse, TK_PLUS, pTerm, pExpr);\n    }\n    pSub = pPrior;\n  }\n  p->pEList->a[0].pExpr = pExpr;\n  p->selFlags &= ~SF_Aggregate;\n\n#if TREETRACE_ENABLED\n  if( sqlite3TreeTrace & 0x400 ){\n    SELECTTRACE(0x400,pParse,p,(\"After count-of-view optimization:\\n\"));\n    sqlite3TreeViewSelect(0, p, 0);\n  }\n#endif\n  return 1;\n}", "docstring": "/*\n** Attempt to transform a query of the form\n**\n**    SELECT count(*) FROM (SELECT x FROM t1 UNION ALL SELECT y FROM t2)\n**\n** Into this:\n**\n**    SELECT (SELECT count(*) FROM t1)+(SELECT count(*) FROM t2)\n**\n** The transformation only works if all of the following are true:\n**\n**   *  The subquery is a UNION ALL of two or more terms\n**   *  The subquery does not have a LIMIT clause\n**   *  There is no WHERE or GROUP BY or HAVING clauses on the subqueries\n**   *  The outer query is a simple count(*) with no WHERE clause or other\n**      extraneous syntax.\n**\n** Return TRUE if the optimization is undertaken.\n*/", "url": "https://github.com/duckdb/duckdb-spatial/blob/aa95ed8049da630da45e763f3bb6e9aeb1891e34/deps/vendor/sqlite3/src/sqlite3.c#L143883-L143949", "sha": "aa95ed8049da630da45e763f3bb6e9aeb1891e34"}145{"repo_name": "clr", "dataset": "github_2023", "owner": "ROCm", "lang": "c", "func_name": "khrIcdOsLibraryUnload", "code": "void khrIcdOsLibraryUnload(void *library)\n{\n    dlclose(library);\n}", "docstring": "// unload a library", "url": "https://github.com/ROCm/clr/blob/a8edb8d467ebb5678d2f4506bd01efd3aaeddcab/opencl/khronos/icd/loader/linux/icd_linux.c#L191-L194", "sha": "a8edb8d467ebb5678d2f4506bd01efd3aaeddcab"}146{"repo_name": "view.py", "dataset": "github_2023", "owner": "ZeroIntensity", "lang": "c", "func_name": "handle_result", "code": "int\nhandle_result(\n    PyObject *raw_result,\n    char **res_target,\n    int *status_target,\n    PyObject **headers_target,\n    PyObject *raw_path,\n    const char *method\n)\n{\n    /*\n     * This calls handle_result_impl() internally, but\n     * this function is the actual interface for handling a return value.\n     *\n     * The only extra thing that this does is write to the route log.\n     */\n    int res = handle_result_impl(\n        raw_result,\n        res_target,\n        status_target,\n        headers_target\n    );\n\n    return res;\n    // Calling route_log is extremely slow\n    if (res < 0)\n        return -1;\n\n    if (!route_log) return res;\n\n    PyObject *args = Py_BuildValue(\n        \"(iOs)\",\n        *status_target,\n        raw_path,\n        method\n    );\n\n    if (!args)\n        return -1;\n\n    /*\n     * A lot of errors related to memory corruption are traced\n     * to here by debuggers.\n     *\n     * This is, more or less, a false positive! It's quite\n     * unlikely that the actual cause of the issue is here.\n     */\n    PyObject *result = PyObject_Call(\n        route_log,\n        args,\n        NULL\n    );\n\n    if (!result)\n    {\n        Py_DECREF(args);\n        return -1;\n    }\n\n    Py_DECREF(result);\n    Py_DECREF(args);\n\n    return res;\n}", "docstring": "/*\n * Generate HTTP response components (i.e. the body, status, and headers) from\n * a route return value.\n *\n * The result passed should be a tuple, or body string. This function\n * does not call __view_result__(), as that is up to the caller.\n *\n * The body output parameter will be a string on the heap,\n * and is responsible for deallocating it with PyMem_Free()\n *\n * The status output parameter can be *any* integer (including non-HTTP\n * status codes). Validation is up to the caller.\n *\n * The headers will always be an ASGI headers iterable [(bytes_key, bytes_value), ...]\n *\n * If this function fails, the caller is not responsible for\n * deallocating or managing references of any of the parameters.\n */", "url": "https://github.com/ZeroIntensity/view.py/blob/7fe291b0feb5f5ae2da3fbf552010a4ee4e470ef/src/_view/results.c#L304-L367", "sha": "7fe291b0feb5f5ae2da3fbf552010a4ee4e470ef"}147{"repo_name": "doom-teletext", "dataset": "github_2023", "owner": "lukneu", "lang": "c", "func_name": "AM_rotate", "code": "void\nAM_rotate\n( fixed_t*\tx,\n  fixed_t*\ty,\n  angle_t\ta )\n{\n    fixed_t tmpx;\n\n    tmpx =\n\tFixedMul(*x,finecosine[a>>ANGLETOFINESHIFT])\n\t- FixedMul(*y,finesine[a>>ANGLETOFINESHIFT]);\n    \n    *y   =\n\tFixedMul(*x,finesine[a>>ANGLETOFINESHIFT])\n\t+ FixedMul(*y,finecosine[a>>ANGLETOFINESHIFT]);\n\n    *x = tmpx;\n}", "docstring": "//\n// Rotation in 2D.\n// Used to rotate player arrow line character.\n//", "url": "https://github.com/lukneu/doom-teletext/blob/b9f5fd1cd89a15150c4efcc02f63f6e0e7ce21f4/doom-teletext/am_map.c#L1178-L1195", "sha": "b9f5fd1cd89a15150c4efcc02f63f6e0e7ce21f4"}148{"repo_name": "CMSIS_6", "dataset": "github_2023", "owner": "ARM-software", "lang": "c", "func_name": "Default_Handler", "code": "void Default_Handler(void) {\n  while(1);\n}", "docstring": "/*----------------------------------------------------------------------------\n  Default Handler for Exceptions / Interrupts\n *----------------------------------------------------------------------------*/", "url": "https://github.com/ARM-software/CMSIS_6/blob/1a1799c6c58c47e737bb19523483344a25d29895/CMSIS/CoreValidation/Layer/Target/CA9/RTE/Device/ARMCA9/startup_ARMCA9.c#L146-L148", "sha": "1a1799c6c58c47e737bb19523483344a25d29895"}149{"repo_name": "CMSIS_6", "dataset": "github_2023", "owner": "ARM-software", "lang": "c", "func_name": "ARM_USBH_PipeTransferGetResult", "code": "uint32_t ARM_USBH_PipeTransferGetResult (ARM_USBH_PIPE_HANDLE pipe_hndl)  {\n  return 0;\n}", "docstring": "/**\n\\fn int32_t ARM_USBH_PipeTransfer (ARM_USBH_PIPE_HANDLE pipe_hndl, uint32_t packet, uint8_t *data, uint32_t num)\n\\details\nThe function \\b ARM_USBH_PipeTransfer generates packets for sending or receiving data from an USB Endpoint.\n\nThe function specifies the buffer with data to send or for data to receive and the number of bytes to transfer (must be multiple of device endpoint maximum packet size for receive).\nIt also specifies \\ref USBH_packets with parameter \\em packet.\n\nThe function is non-blocking and returns as soon as the driver starts the operation on the specified pipe. During the operation it is not allowed to call this function again on the same pipe. Also the data buffer must stay allocated and the contents of data must not be modified.\n\nOperation is completed when the the requested number of data bytes have been transferred and is indicated with \\ref ARM_USBH_EVENT_TRANSFER_COMPLETE event.\nIt can also finish earlier on reception of different handshake tokens which are also indicated through \\ref USBH_pipe_events.\n \nTransfer operation can be aborted by calling \\ref ARM_USBH_PipeTransferAbort.\n*****************************************************************************************************************/", "url": "https://github.com/ARM-software/CMSIS_6/blob/1a1799c6c58c47e737bb19523483344a25d29895/CMSIS/Documentation/Doxygen/Driver/src/Driver_USBH.c#L399-L401", "sha": "1a1799c6c58c47e737bb19523483344a25d29895"}150{"repo_name": "fdskey", "dataset": "github_2023", "owner": "ClusterM", "lang": "c", "func_name": "HAL_TIM_IC_Stop_DMA", "code": "HAL_StatusTypeDef HAL_TIM_IC_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel)\n{\n  HAL_StatusTypeDef status = HAL_OK;\n\n  /* Check the parameters */\n  assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel));\n  assert_param(IS_TIM_DMA_CC_INSTANCE(htim->Instance));\n\n  /* Disable the Input Capture channel */\n  TIM_CCxChannelCmd(htim->Instance, Channel, TIM_CCx_DISABLE);\n\n  switch (Channel)\n  {\n    case TIM_CHANNEL_1:\n    {\n      /* Disable the TIM Capture/Compare 1 DMA request */\n      __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_CC1);\n      (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC1]);\n      break;\n    }\n\n    case TIM_CHANNEL_2:\n    {\n      /* Disable the TIM Capture/Compare 2 DMA request */\n      __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_CC2);\n      (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC2]);\n      break;\n    }\n\n    case TIM_CHANNEL_3:\n    {\n      /* Disable the TIM Capture/Compare 3  DMA request */\n      __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_CC3);\n      (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC3]);\n      break;\n    }\n\n    case TIM_CHANNEL_4:\n    {\n      /* Disable the TIM Capture/Compare 4  DMA request */\n      __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_CC4);\n      (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC4]);\n      break;\n    }\n\n    default:\n      status = HAL_ERROR;\n      break;\n  }\n\n  if (status == HAL_OK)\n  {\n    /* Disable the Peripheral */\n    __HAL_TIM_DISABLE(htim);\n\n    /* Set the TIM channel state */\n    TIM_CHANNEL_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_READY);\n    TIM_CHANNEL_N_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_READY);\n  }\n\n  /* Return function status */\n  return status;\n}", "docstring": "/**\n  * @brief  Stops the TIM Input Capture measurement in DMA mode.\n  * @param  htim TIM Input Capture handle\n  * @param  Channel TIM Channels to be disabled\n  *          This parameter can be one of the following values:\n  *            @arg TIM_CHANNEL_1: TIM Channel 1 selected\n  *            @arg TIM_CHANNEL_2: TIM Channel 2 selected\n  *            @arg TIM_CHANNEL_3: TIM Channel 3 selected\n  *            @arg TIM_CHANNEL_4: TIM Channel 4 selected\n  * @retval HAL status\n  */", "url": "https://github.com/ClusterM/fdskey/blob/f07ab82864a9f4a2e7b14b37f1837715edb0d0fe/FdsKey/Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_tim.c#L2542-L2604", "sha": "f07ab82864a9f4a2e7b14b37f1837715edb0d0fe"}151{"repo_name": "fdskey", "dataset": "github_2023", "owner": "ClusterM", "lang": "c", "func_name": "HAL_TIMEx_CommutCallback", "code": "__weak void HAL_TIMEx_CommutCallback(TIM_HandleTypeDef *htim)\n{\n  /* Prevent unused argument(s) compilation warning */\n  UNUSED(htim);\n\n  /* NOTE : This function should not be modified, when the callback is needed,\n            the HAL_TIMEx_CommutCallback could be implemented in the user file\n   */\n}", "docstring": "/**\n  * @}\n  */\n/** @defgroup TIMEx_Exported_Functions_Group6 Extended Callbacks functions\n  * @brief    Extended Callbacks functions\n  *\n@verbatim\n  ==============================================================================\n                    ##### Extended Callbacks functions #####\n  ==============================================================================\n  [..]\n    This section provides Extended TIM callback functions:\n    (+) Timer Commutation callback\n    (+) Timer Break callback\n\n@endverbatim\n  * @{\n  */\n/**\n  * @brief  Hall commutation changed callback in non-blocking mode\n  * @param  htim TIM handle\n  * @retval None\n  */", "url": "https://github.com/ClusterM/fdskey/blob/f07ab82864a9f4a2e7b14b37f1837715edb0d0fe/FdsKey/Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_tim_ex.c#L2606-L2614", "sha": "f07ab82864a9f4a2e7b14b37f1837715edb0d0fe"}152{"repo_name": "nostr-signing-device", "dataset": "github_2023", "owner": "lnbits", "lang": "c", "func_name": "bn_read_le", "code": "void bn_read_le(const uint8_t *in_number, bignum256 *out_number)\n{\n\tint i;\n\tuint32_t temp = 0;\n\tfor (i = 0; i < 8; i++) {\n\t\t// invariant: temp = (in_number % 2^(32i)) >> 30i\n\t\t// get next limb = (in_number % 2^(32(i+1))) >> 32i\n\t\tuint32_t limb = read_le(in_number + i * 4);\n\t\t// temp = (in_number % 2^(32(i+1))) << 30i\n\t\ttemp |= limb << (2*i);\n\t\t// store 30 bits into val[i]\n\t\tout_number->val[i]= temp & 0x3FFFFFFF;\n\t\t// prepare temp for next round\n\t\ttemp = limb >> (30 - 2*i);\n\t}\n\tout_number->val[8] = temp;\n}", "docstring": "// convert a raw little endian 256 bit value into a normalized bignum.\n// out_number is partly reduced (since it fits in 256 bit).", "url": "https://github.com/lnbits/nostr-signing-device/blob/1956e5933b3da5e49d30db9b8597497b157a5cbc/libraries/uBitcoin/src/utility/trezor/bignum.c#L126-L142", "sha": "1956e5933b3da5e49d30db9b8597497b157a5cbc"}153{"repo_name": "llama.cpp", "dataset": "github_2023", "owner": "ggerganov", "lang": "c", "func_name": "ggml_compute_forward_sgn_f32", "code": "static void ggml_compute_forward_sgn_f32(\n        const struct ggml_compute_params * params,\n        struct ggml_tensor * dst) {\n\n    const struct ggml_tensor * src0 = dst->src[0];\n\n    if (params->ith != 0) {\n        return;\n    }\n\n    assert(ggml_is_contiguous_1(src0));\n    assert(ggml_is_contiguous_1(dst));\n    assert(ggml_are_same_shape(src0, dst));\n\n    const int n  = ggml_nrows(src0);\n    const int nc = src0->ne[0];\n\n    for (int i = 0; i < n; i++) {\n        ggml_vec_sgn_f32(nc,\n                (float *) ((char *) dst->data  + i*( dst->nb[1])),\n                (float *) ((char *) src0->data + i*(src0->nb[1])));\n    }\n}", "docstring": "// ggml_compute_forward_sgn", "url": "https://github.com/ggerganov/llama.cpp/blob/4078c77f9891831f29ffc7c315c8ec6695ba5ce7/ggml/src/ggml-cpu/ggml-cpu.c#L6205-L6227", "sha": "4078c77f9891831f29ffc7c315c8ec6695ba5ce7"}154{"repo_name": "llama.cpp", "dataset": "github_2023", "owner": "ggerganov", "lang": "c", "func_name": "ggml_compute_forward_soft_max_ext_back_f32", "code": "static void ggml_compute_forward_soft_max_ext_back_f32(\n        const struct ggml_compute_params * params,\n        struct ggml_tensor * dst) {\n\n    const struct ggml_tensor * src0 = dst->src[0];\n    const struct ggml_tensor * src1 = dst->src[1];\n\n    GGML_ASSERT(ggml_is_contiguous(src0));\n    GGML_ASSERT(ggml_is_contiguous(src1));\n    GGML_ASSERT(ggml_is_contiguous(dst));\n    GGML_ASSERT(ggml_are_same_shape(src0, dst));\n    GGML_ASSERT(ggml_are_same_shape(src1, dst));\n\n    float scale    = 1.0f;\n    float max_bias = 0.0f;\n\n    memcpy(&scale,    (const float *) dst->op_params + 0, sizeof(float));\n    memcpy(&max_bias, (const float *) dst->op_params + 1, sizeof(float));\n\n    GGML_ASSERT(max_bias == 0.0f);\n\n    // TODO: handle transposed/permuted matrices\n\n    const int ith = params->ith;\n    const int nth = params->nth;\n\n    const int nc = src0->ne[0];\n    const int nr = ggml_nrows(src0);\n\n    // rows per thread\n    const int dr = (nr + nth - 1)/nth;\n\n    // row range for this thread\n    const int ir0 = dr*ith;\n    const int ir1 = MIN(ir0 + dr, nr);\n\n    for (int i1 = ir0; i1 < ir1; i1++) {\n        float *dy = (float *)((char *) src0->data + i1*src0->nb[1]);\n        float *y  = (float *)((char *) src1->data + i1*src1->nb[1]);\n        float *dx = (float *)((char *) dst->data  + i1*dst->nb[1]);\n\n#ifndef NDEBUG\n        for (int i = 0; i < nc; ++i) {\n            //printf(\"p[%d] = %f\\n\", i, p[i]);\n            assert(!isnan(dy[i]));\n            assert(!isnan(y[i]));\n        }\n#endif\n        // Jii = yi - yi*yi\n        // Jij = -yi*yj\n        // J = diag(y)-y.T*y\n        // dx = J * dy\n        // dxk = sum_i(Jki * dyi)\n        // dxk = sum_i(-yk*yi * dyi) - (-yk*yk)*dyk + (yk - yk*yk)*dyk\n        // dxk = sum_i(-yk*yi * dyi) + yk*yk*dyk + yk*dyk - yk*yk*dyk\n        // dxk = sum_i(-yk*yi * dyi) + yk*dyk\n        // dxk = -yk * sum_i(yi * dyi) + yk*dyk\n        // dxk = -yk * dot(y, dy) + yk*dyk\n        // dxk = yk * (- dot(y, dy) + dyk)\n        // dxk = yk * (dyk - dot(y, dy))\n        //\n        // post-order:\n        // dot_y_dy := dot(y, dy)\n        // dx := dy\n        // dx := dx - dot_y_dy\n        // dx := dx * y\n\n        // linear runtime, no additional memory\n        float dot_y_dy = 0;\n        ggml_vec_dot_f32  (nc, &dot_y_dy, 0, y, 0, dy, 0, 1);\n        ggml_vec_cpy_f32  (nc, dx, dy);\n        ggml_vec_acc1_f32 (nc, dx, -dot_y_dy);\n        ggml_vec_mul_f32  (nc, dx, dx, y);\n        ggml_vec_scale_f32(nc, dx, scale);\n\n#ifndef NDEBUG\n        for (int i = 0; i < nc; ++i) {\n            assert(!isnan(dx[i]));\n            assert(!isinf(dx[i]));\n        }\n#endif\n    }\n}", "docstring": "// ggml_compute_forward_soft_max_ext_back", "url": "https://github.com/ggerganov/llama.cpp/blob/4078c77f9891831f29ffc7c315c8ec6695ba5ce7/ggml/src/ggml-cpu/ggml-cpu.c#L8967-L9049", "sha": "4078c77f9891831f29ffc7c315c8ec6695ba5ce7"}155{"repo_name": "bloomz.cpp", "dataset": "github_2023", "owner": "NouamaneTazi", "lang": "c", "func_name": "ggml_vec_set_i8", "code": "inline static void ggml_vec_set_i8(const int n, int8_t * x, const int8_t v) { for (int i = 0; i < n; ++i) x[i] = v; }", "docstring": "//\n// fundamental operations\n//", "url": "https://github.com/NouamaneTazi/bloomz.cpp/blob/9614897a272e69a64ca9e57102cd1f86b2d2e34b/Bloomer/bloomz/ggml.c#L1205-L1205", "sha": "9614897a272e69a64ca9e57102cd1f86b2d2e34b"}156{"repo_name": "RuntimeSpeechRecognizer", "dataset": "github_2023", "owner": "gtreshchev", "lang": "c", "func_name": "ggml_v_silu", "code": "inline static __m512 ggml_v_silu(__m512 x) {\n    const __m512 one = _mm512_set1_ps(1);\n    const __m512 zero = _mm512_setzero_ps();\n    const __m512 neg_x = _mm512_sub_ps(zero, x);\n    const __m512 exp_neg_x = ggml_v_expf(neg_x);\n    const __m512 one_plus_exp_neg_x = _mm512_add_ps(one, exp_neg_x);\n    return _mm512_div_ps(x, one_plus_exp_neg_x);\n}", "docstring": "// computes silu x/(1+exp(-x)) in single precision vector", "url": "https://github.com/gtreshchev/RuntimeSpeechRecognizer/blob/4faa894a1ed82e8cf4013c4adebdc8fa130471d3/Source/ThirdParty/ggml/src/ggml.c#L2705-L2712", "sha": "4faa894a1ed82e8cf4013c4adebdc8fa130471d3"}157{"repo_name": "dillo-plus", "dataset": "github_2023", "owner": "crossbowerbt", "lang": "c", "func_name": "File_serve_client", "code": "static void File_serve_client(void *data, int f_write)\n{\n   char *dpip_tag = NULL, *cmd = NULL, *url = NULL, *path;\n   ClientInfo *client = data;\n   int st;\n\n   while (1) {\n      _MSG(\"File_serve_client %p, flags=%d state=%d\\n\",\n          client, client->flags, client->state);\n      if (client->flags & (FILE_DONE | FILE_ERR))\n         break;\n      if (client->flags & FILE_READ) {\n         dpip_tag = a_Dpip_dsh_read_token(client->sh, 0);\n         _MSG(\"dpip_tag={%s}\\n\", dpip_tag);\n         if (!dpip_tag)\n            break;\n      }\n\n      if (client->flags & FILE_READ) {\n         if (!(client->flags & FILE_AUTH_OK)) {\n            /* Authenticate our client... */\n            st = a_Dpip_check_auth(dpip_tag);\n            _MSG(\"a_Dpip_check_auth returned %d\\n\", st);\n            client->flags |= (st == 1) ? FILE_AUTH_OK : FILE_ERR;\n         } else {\n            /* Get file request */\n            cmd = a_Dpip_get_attr(dpip_tag, \"cmd\");\n            url = a_Dpip_get_attr(dpip_tag, \"url\");\n            path = FileUtil_normalize_path(\"file\", url);\n            if (cmd) {\n               if (strcmp(cmd, \"DpiBye\") == 0) {\n                  DPIBYE = 1;\n                  MSG(\"(pid %d): Got DpiBye.\\n\", (int)getpid());\n                  client->flags |= FILE_DONE;\n               } else if (url && dStrnAsciiCasecmp(url, \"dpi:\", 4) == 0 &&\n                          strcmp(url+4, \"/file/toggle\") == 0) {\n                  File_toggle_html_style(client);\n               } else if (path) {\n                  File_get(client, path, url);\n               } else {\n                  client->flags |= FILE_ERR;\n                  MSG(\"ERROR: URL was %s\\n\", url);\n               }\n            }\n            dFree(path);\n            dFree(url);\n            dFree(cmd);\n            dFree(dpip_tag);\n            break;\n         }\n         dFree(dpip_tag);\n\n      } else if (f_write) {\n         /* send our answer */\n         if (client->state == st_err)\n            File_send_error_page(client);\n         else if (client->d_dir)\n            File_send_dir(client);\n         else\n            File_send_file(client);\n         break;\n      }\n   } /*while*/\n\n   client->flags |= (client->sh->status & DPIP_ERROR) ? FILE_ERR : 0;\n   client->flags |= (client->sh->status & DPIP_EOF) ? FILE_DONE : 0;\n}", "docstring": "/*\n * Serve this client.\n */", "url": "https://github.com/crossbowerbt/dillo-plus/blob/7d093e6bddcb3338938ea5959844e62ff1f9b76f/dpi/file.c#L524-L590", "sha": "7d093e6bddcb3338938ea5959844e62ff1f9b76f"}158{"repo_name": "whisper.rn", "dataset": "github_2023", "owner": "mybigday", "lang": "c", "func_name": "wsp_ggml_compute_forward_clamp_f32", "code": "static void wsp_ggml_compute_forward_clamp_f32(\n        const struct wsp_ggml_compute_params * params,\n        struct wsp_ggml_tensor * dst) {\n\n    const struct wsp_ggml_tensor * src0 = dst->src[0];\n\n    if (params->ith != 0) {\n        return;\n    }\n\n    float min;\n    float max;\n    memcpy(&min, (float *) dst->op_params + 0, sizeof(float));\n    memcpy(&max, (float *) dst->op_params + 1, sizeof(float));\n\n    const int ith = params->ith;\n    const int nth = params->nth;\n\n    const int n  = wsp_ggml_nrows(src0);\n    const int nc = src0->ne[0];\n\n    const size_t nb00 = src0->nb[0];\n    const size_t nb01 = src0->nb[1];\n\n    const size_t nb0 = dst->nb[0];\n    const size_t nb1 = dst->nb[1];\n\n    WSP_GGML_ASSERT( nb0 == sizeof(float));\n    WSP_GGML_ASSERT(nb00 == sizeof(float));\n\n    for (int j = ith; j < n; j += nth) {\n        float * dst_ptr  = (float *) ((char *)  dst->data + j*nb1);\n        float * src0_ptr = (float *) ((char *) src0->data + j*nb01);\n\n        for (int i = 0; i < nc; i++) {\n            dst_ptr[i] = MAX(MIN(src0_ptr[i], max), min);\n        }\n    }\n}", "docstring": "// wsp_ggml_compute_forward_clamp", "url": "https://github.com/mybigday/whisper.rn/blob/844cbde318fe8962d0d378e0c093f3cb8000f9a0/cpp/ggml-cpu.c#L9057-L9095", "sha": "844cbde318fe8962d0d378e0c093f3cb8000f9a0"}159{"repo_name": "nsproxy", "dataset": "github_2023", "owner": "nlzy", "lang": "c", "func_name": "pbuf_memcmp", "code": "u16_t\npbuf_memcmp(const struct pbuf *p, u16_t offset, const void *s2, u16_t n)\n{\n  u16_t start = offset;\n  const struct pbuf *q = p;\n  u16_t i;\n\n  /* pbuf long enough to perform check? */\n  if (p->tot_len < (offset + n)) {\n    return 0xffff;\n  }\n\n  /* get the correct pbuf from chain. We know it succeeds because of p->tot_len check above. */\n  while ((q != NULL) && (q->len <= start)) {\n    start = (u16_t)(start - q->len);\n    q = q->next;\n  }\n\n  /* return requested data if pbuf is OK */\n  for (i = 0; i < n; i++) {\n    /* We know pbuf_get_at() succeeds because of p->tot_len check above. */\n    u8_t a = pbuf_get_at(q, (u16_t)(start + i));\n    u8_t b = ((const u8_t *)s2)[i];\n    if (a != b) {\n      return (u16_t)LWIP_MIN(i + 1, 0xFFFF);\n    }\n  }\n  return 0;\n}", "docstring": "/**\n * @ingroup pbuf\n * Compare pbuf contents at specified offset with memory s2, both of length n\n *\n * @param p pbuf to compare\n * @param offset offset into p at which to start comparing\n * @param s2 buffer to compare\n * @param n length of buffer to compare\n * @return zero if equal, nonzero otherwise\n *         (0xffff if p is too short, diffoffset+1 otherwise)\n */", "url": "https://github.com/nlzy/nsproxy/blob/9dd996380a4d1e8edaca359cbf32969f74d0286c/lwip/pbuf.c#L1433-L1461", "sha": "9dd996380a4d1e8edaca359cbf32969f74d0286c"}160{"repo_name": "VkDoom", "dataset": "github_2023", "owner": "dpjudas", "lang": "c", "func_name": "ChunkCount", "code": "static int ChunkCount(const WebPDemuxer* const dmux, const char fourcc[4]) {\n  const uint8_t* const mem_buf = dmux->mem_.buf_;\n  const Chunk* c;\n  int count = 0;\n  for (c = dmux->chunks_; c != NULL; c = c->next_) {\n    const uint8_t* const header = mem_buf + c->data_.offset_;\n    if (!memcmp(header, fourcc, TAG_SIZE)) ++count;\n  }\n  return count;\n}", "docstring": "// -----------------------------------------------------------------------------\n// Chunk iteration", "url": "https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/libraries/webp/src/demux/demux.c#L898-L907", "sha": "bbaaa9a49db3e22e5c31787faaf790b46b8c87c4"}161{"repo_name": "VkDoom", "dataset": "github_2023", "owner": "dpjudas", "lang": "c", "func_name": "DoVerticalFilter_SSE2", "code": "static WEBP_INLINE void DoVerticalFilter_SSE2(const uint8_t* in,\n                                              int width, int height, int stride,\n                                              int row, int num_rows,\n                                              uint8_t* out) {\n  const size_t start_offset = row * stride;\n  const int last_row = row + num_rows;\n  DCHECK(in, out);\n  in += start_offset;\n  out += start_offset;\n\n  if (row == 0) {\n    // Very first top-left pixel is copied.\n    out[0] = in[0];\n    // Rest of top scan-line is left-predicted.\n    PredictLineLeft_SSE2(in + 1, out + 1, width - 1);\n    row = 1;\n    in += stride;\n    out += stride;\n  }\n\n  // Filter line-by-line.\n  while (row < last_row) {\n    PredictLineTop_SSE2(in, in - stride, out, width);\n    ++row;\n    in += stride;\n    out += stride;\n  }\n}", "docstring": "//------------------------------------------------------------------------------\n// Vertical filter.", "url": "https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/libraries/webp/src/dsp/filters_sse2.c#L110-L137", "sha": "bbaaa9a49db3e22e5c31787faaf790b46b8c87c4"}162{"repo_name": "VkDoom", "dataset": "github_2023", "owner": "dpjudas", "lang": "c", "func_name": "pthread_cond_destroy", "code": "static int pthread_cond_destroy(pthread_cond_t* const condition) {\n  int ok = 1;\n#ifdef USE_WINDOWS_CONDITION_VARIABLE\n  (void)condition;\n#else\n  ok &= (CloseHandle(condition->waiting_sem_) != 0);\n  ok &= (CloseHandle(condition->received_sem_) != 0);\n  ok &= (CloseHandle(condition->signal_event_) != 0);\n#endif\n  return !ok;\n}", "docstring": "// Condition", "url": "https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/libraries/webp/src/utils/thread_utils.c#L131-L141", "sha": "bbaaa9a49db3e22e5c31787faaf790b46b8c87c4"}163{"repo_name": "SphereSfM", "dataset": "github_2023", "owner": "json87", "lang": "c", "func_name": "vl_aib_merge_nodes", "code": "void\nvl_aib_merge_nodes (VlAIB * aib, vl_uint i, vl_uint j, vl_uint new)\n{\n  vl_uint last_entry = aib->nentries - 1 ;\n  vl_uint c, n ;\n\n  /* clear the list of nodes to update */\n  aib->nwhich = 0;\n\n  /* make sure that i is smaller than j */\n  if(i > j) { vl_uint tmp = j; j = i; i = tmp; }\n\n  /* -----------------------------------------------------------------\n   *                    Merge entries i and j, storing the result in i\n   * -------------------------------------------------------------- */\n\n  aib-> Px   [i] += aib->Px[j] ;\n  aib-> beta [i]  = BETA_MAX ;\n  aib-> nodes[i]  = new ;\n\n  for (c = 0; c < aib->nlabels; c++)\n    aib-> Pcx [i*aib->nlabels + c] += aib-> Pcx [j*aib->nlabels + c] ;\n\n  /* -----------------------------------------------------------------\n   *                                              Move last entry to j\n   * -------------------------------------------------------------- */\n\n  aib-> Px    [j]  = aib-> Px    [last_entry];\n  aib-> beta  [j]  = aib-> beta  [last_entry];\n  aib-> bidx  [j]  = aib-> bidx  [last_entry];\n  aib-> nodes [j]  = aib-> nodes [last_entry];\n\n  for (c = 0 ;  c < aib->nlabels ; c++)\n    aib-> Pcx[j*aib->nlabels + c] = aib-> Pcx [last_entry*aib->nlabels + c] ;\n\n  /* delete last entry */\n  aib-> nentries -- ;\n\n  /* -----------------------------------------------------------------\n   *                                        Scan for entries to update\n   * -------------------------------------------------------------- */\n\n  /*\n   * After mergin entries i and j, we need to update all other entries\n   * that had one of these two as closest match. We also need to\n   * update the renewend entry i. This is added by the loop below\n   * since bidx [i] = j exactly because i was merged.\n   *\n   * Additionaly, since we moved the last entry back to the entry j,\n   * we need to adjust the valeus of bidx to reflect this.\n   */\n\n  for (n = 0 ; n < aib->nentries; n++) {\n    if(aib->bidx[n] == i || aib->bidx[n] == j) {\n        aib->bidx  [n] = 0;\n        aib->beta  [n] = BETA_MAX;\n        aib->which [aib->nwhich++] = n ;\n      }\n    else if(aib->bidx[n] == last_entry) {\n      aib->bidx[n] = j ;\n    }\n  }\n}", "docstring": "/** ------------------------------------------------------------------\n ** @internal\n ** @brief Merges two nodes i,j in the internal datastructure\n **\n ** @param aib  A pointer to the internal data structure\n ** @param i    The index of one member of the pair to merge\n ** @param j    The index of the other member of the pair to merge\n ** @param new  The index of the new node which corresponds to the union of\n **             (@a i, @a j).\n **\n ** Nodes are merged by replacing the entry @a i with the union of @c\n ** ij, moving the node stored in last position (called @c lastnode)\n ** back to jth position and the entry at the end.\n **\n ** After the nodes have been merged, it updates which nodes should be\n ** considered on the next iteration based on which beta values could\n ** potentially change. The merged node will always be part of this\n ** list.\n **/", "url": "https://github.com/json87/SphereSfM/blob/1a01a12be58af8f4f3a8245ea2a0018828336ee8/lib/VLFeat/aib.c#L271-L333", "sha": "1a01a12be58af8f4f3a8245ea2a0018828336ee8"}164{"repo_name": "SphereSfM", "dataset": "github_2023", "owner": "json87", "lang": "c", "func_name": "vl_dsift_delete", "code": "VL_EXPORT void\nvl_dsift_delete (VlDsiftFilter * self)\n{\n  _vl_dsift_free_buffers (self) ;\n  if (self->convTmp2) vl_free (self->convTmp2) ;\n  if (self->convTmp1) vl_free (self->convTmp1) ;\n  vl_free (self) ;\n}", "docstring": "/** ------------------------------------------------------------------\n ** @brief Delete DSIFT filter\n ** @param self DSIFT filter.\n **/", "url": "https://github.com/json87/SphereSfM/blob/1a01a12be58af8f4f3a8245ea2a0018828336ee8/lib/VLFeat/dsift.c#L483-L490", "sha": "1a01a12be58af8f4f3a8245ea2a0018828336ee8"}165{"repo_name": "SphereSfM", "dataset": "github_2023", "owner": "json87", "lang": "c", "func_name": "vl_svm_logistic_loss", "code": "double\nvl_svm_logistic_loss (double inner,double label)\n{\n  double z = label * inner ;\n  if (z >= 0) {\n    return log(1.0 + exp(-z)) ;\n  } else {\n    return -z + log(exp(z) + 1.0) ;\n  }\n}", "docstring": "/** @brief SVM l2 loss\n ** @copydetails VlSvmLossFunction */", "url": "https://github.com/json87/SphereSfM/blob/1a01a12be58af8f4f3a8245ea2a0018828336ee8/lib/VLFeat/svm.c#L1759-L1768", "sha": "1a01a12be58af8f4f3a8245ea2a0018828336ee8"}166{"repo_name": "FreshCryptoLib", "dataset": "github_2023", "owner": "rdubois-crypto", "lang": "c", "func_name": "CheckDel", "code": "static void CheckDel(void* ptr, const char* k, size_t klen) {\n  int* state = (int*) ptr;\n  CheckCondition(*state == 2);\n  CheckEqual(\"bar\", k, klen);\n  (*state)++;\n}", "docstring": "// Callback from leveldb_writebatch_iterate()", "url": "https://github.com/rdubois-crypto/FreshCryptoLib/blob/8179e08cac72072bd260796633fec41fdfd5b441/solidity/tests/hardhat/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/c_test.c#L108-L113", "sha": "8179e08cac72072bd260796633fec41fdfd5b441"}167{"repo_name": "AlpacaChat", "dataset": "github_2023", "owner": "niw", "lang": "c", "func_name": "ggml_vec_set_i8", "code": "inline static void ggml_vec_set_i8(const int n, int8_t * x, const int8_t v) { for (int i = 0; i < n; ++i) x[i] = v; }", "docstring": "//\n// fundamental operations\n//", "url": "https://github.com/niw/AlpacaChat/blob/9b5600eb4624cb7739b6df03d3acde76cb7bd2ef/Sources/alpaca.cpp/ggml.c#L1205-L1205", "sha": "9b5600eb4624cb7739b6df03d3acde76cb7bd2ef"}168{"repo_name": "af", "dataset": "github_2023", "owner": "zeldaret", "lang": "c", "func_name": "Fado_ConstructStringVectors", "code": "void Fado_ConstructStringVectors(vc_vector** stringVectors, FairyFileInfo* fileInfo, int numFiles) {\n    int currentFile;\n    size_t currentSym;\n\n    for (currentFile = 0; currentFile < numFiles; currentFile++) {\n        FairySym* symtab = fileInfo[currentFile].symtabInfo.sectionData;\n\n        stringVectors[currentFile] = vc_vector_create(0x40, sizeof(char**), NULL);\n\n        /* Build a vector of pointers to defined symbols' names */\n        for (currentSym = 0; currentSym < fileInfo[currentFile].symtabInfo.sectionEntryCount; currentSym++) {\n            if ((symtab[currentSym].st_shndx != STN_UNDEF) &&\n                Fado_CheckInProgBitsSections(symtab[currentSym].st_shndx, fileInfo[currentFile].progBitsSections)) {\n                /* Have to pass a double pointer so it copies the pointer instead of the start of the string */\n                char* stringPtr = &fileInfo[currentFile].strtab[symtab[currentSym].st_name];\n                assert(vc_vector_push_back(stringVectors[currentFile], &stringPtr));\n            }\n        }\n    }\n}", "docstring": "/**\n * For each input file, construct a vector of pointers to the starts of the strings defined in that file.\n */", "url": "https://github.com/zeldaret/af/blob/f013a028f42a1b11134bc5f22f28e9f48236b6f0/tools/fado/src/fado.c#L33-L52", "sha": "f013a028f42a1b11134bc5f22f28e9f48236b6f0"}169{"repo_name": "tuyaZigbee", "dataset": "github_2023", "owner": "doctor64", "lang": "c", "func_name": "contactSensor_zclReportCmd", "code": "static void contactSensor_zclReportCmd(u16 clusterId, zclReportCmd_t *pReportCmd)\n{\n    printf(\"contactSensor_zclReportCmd\\n\");\n\n}", "docstring": "/*********************************************************************\n * @fn      contactSensor_zclReportCmd\n *\n * @brief   Handler for ZCL Report command.\n *\n * @param   pInHdlrMsg - incoming message to process\n *\n * @return  None\n */", "url": "https://github.com/doctor64/tuyaZigbee/blob/3a85776223ac4e689871b3b21852b9fc46325835/IASsensor/zcl_contactSensorCb.c#L248-L252", "sha": "3a85776223ac4e689871b3b21852b9fc46325835"}170{"repo_name": "tuyaZigbee", "dataset": "github_2023", "owner": "doctor64", "lang": "c", "func_name": "tuyaLight_colorTimerStop", "code": "static void tuyaLight_colorTimerStop(void)\n{\n\tif(colorTimerEvt){\n\t\tTL_ZB_TIMER_CANCEL(&colorTimerEvt);\n\t}\n}", "docstring": "/*********************************************************************\n * @fn      tuyaLight_colorTimerStop\n *\n * @brief\n *\n * @param   None\n *\n * @return  None\n */", "url": "https://github.com/doctor64/tuyaZigbee/blob/3a85776223ac4e689871b3b21852b9fc46325835/light/zcl_colorCtrlCb.c#L247-L252", "sha": "3a85776223ac4e689871b3b21852b9fc46325835"}171{"repo_name": "tuyaZigbee", "dataset": "github_2023", "owner": "doctor64", "lang": "c", "func_name": "tuyaSwitch_zclStoreSceneRspCmdHandler", "code": "static void tuyaSwitch_zclStoreSceneRspCmdHandler(storeSceneRsp_t *pStoreSceneRsp)\n{\n\n}", "docstring": "/*********************************************************************\n * @fn      tuyaSwitch_zclStoreSceneRspCmdHandler\n *\n * @brief   Handler for ZCL store scene response command.\n *\n * @param   pStoreSceneRsp\n *\n * @return  None\n */", "url": "https://github.com/doctor64/tuyaZigbee/blob/3a85776223ac4e689871b3b21852b9fc46325835/switch/zcl_tuyaSwitchCb.c#L611-L614", "sha": "3a85776223ac4e689871b3b21852b9fc46325835"}172{"repo_name": "Flipper-Zero-Game-Boy-Pokemon-Trading", "dataset": "github_2023", "owner": "kbembedded", "lang": "c", "func_name": "pokemon_stat_calc", "code": "void pokemon_stat_calc(PokemonData* pdata, DataStat stat) {\n    furi_assert(pdata);\n    uint8_t iv;\n    uint16_t ev;\n    uint8_t base;\n    uint8_t level;\n    uint16_t calc;\n\n    level = pokemon_stat_get(pdata, STAT_LEVEL, NONE);\n    base = table_stat_base_get(\n        pdata->pokemon_table, pokemon_stat_get(pdata, STAT_NUM, NONE), stat, NONE);\n    ev = pokemon_stat_get(pdata, stat + STAT_EV_OFFS, NONE);\n    iv = pokemon_stat_get(pdata, stat + STAT_IV_OFFS, NONE);\n\n    /* Gen I and II calculation */\n    // https://bulbapedia.bulbagarden.net/wiki/Stat#Generations_I_and_II\n    calc = floor((((2 * (base + iv)) + floor(sqrt(ev) / 4)) * level) / 100);\n\n    if(stat == STAT_HP)\n        calc += (level + 10);\n    else\n        calc += 5;\n\n    pokemon_stat_set(pdata, stat, NONE, calc);\n}", "docstring": "/* Calculates stat from current level */", "url": "https://github.com/kbembedded/Flipper-Zero-Game-Boy-Pokemon-Trading/blob/8769074c727ef3fa2da83e30daaf1aa964349c7e/src/pokemon_data.c#L855-L879", "sha": "8769074c727ef3fa2da83e30daaf1aa964349c7e"}173{"repo_name": "Linux0.11", "dataset": "github_2023", "owner": "TonyWriting", "lang": "c", "func_name": "rw_interrupt", "code": "static void rw_interrupt(void)\n{\n\tif (result() != 7 || (ST0 & 0xf8) || (ST1 & 0xbf) || (ST2 & 0x73)) {\n\t\tif (ST1 & 0x02) {\n\t\t\tprintk(\"Drive %d is write protected\\n\\r\",current_drive);\n\t\t\tfloppy_deselect(current_drive);\n\t\t\tend_request(0);\n\t\t} else\n\t\t\tbad_flp_intr();\n\t\tdo_fd_request();\n\t\treturn;\n\t}\n\tif (command == FD_READ && (unsigned long)(CURRENT->buffer) >= 0x100000)\n\t\tcopy_buffer(tmp_floppy_area,CURRENT->buffer);\n\tfloppy_deselect(current_drive);\n\tend_request(1);\n\tdo_fd_request();\n}", "docstring": "/*\n * Ok, this interrupt is called after a DMA read/write has succeeded,\n * so we check the results, and copy any buffers.\n */", "url": "https://github.com/TonyWriting/Linux0.11/blob/7fecb719e8261e274d827dc43dc1424bd26cc483/kernel/blk_drv/floppy.c#L250-L267", "sha": "7fecb719e8261e274d827dc43dc1424bd26cc483"}174{"repo_name": "lidar-slam-detection", "dataset": "github_2023", "owner": "w111liang222", "lang": "c", "func_name": "socket_wait", "code": "static int socket_wait(int fd, int is_read)\n{\n\tfd_set fds, *fdr = 0, *fdw = 0;\n\tstruct timeval tv;\n\tint ret;\n\ttv.tv_sec = 5; tv.tv_usec = 0; // 5 seconds time out\n\tFD_ZERO(&fds);\n\tFD_SET(fd, &fds);\n\tif (is_read) fdr = &fds;\n\telse fdw = &fds;\n\tret = select(fd+1, fdr, fdw, 0, &tv);\n#ifndef _WIN32\n\tif (ret == -1) perror(\"select\");\n#else\n\tif (ret == 0)\n\t\tfprintf(stderr, \"select time-out\\n\");\n\telse if (ret == SOCKET_ERROR)\n\t\tfprintf(stderr, \"select: %d\\n\", WSAGetLastError());\n#endif\n\treturn ret;\n}", "docstring": "/* In winsock.h, the type of a socket is SOCKET, which is: \"typedef\n * u_int SOCKET\". An invalid SOCKET is: \"(SOCKET)(~0)\", or signed\n * integer -1. In knetfile.c, I use \"int\" for socket type\n * throughout. This should be improved to avoid confusion.\n *\n * In Linux/Mac, recv() and read() do almost the same thing. You can see\n * in the header file that netread() is simply an alias of read(). In\n * Windows, however, they are different and using recv() is mandatory.\n */\n/* This function tests if the file handler is ready for reading (or\n * writing if is_read==0). */", "url": "https://github.com/w111liang222/lidar-slam-detection/blob/d57a923b3972d0a0bfdfc0016c32de53c26b9f9f/slam/thirdparty/fast_gicp/thirdparty/nvbio/contrib/htslib/knetfile.c#L60-L80", "sha": "d57a923b3972d0a0bfdfc0016c32de53c26b9f9f"}175{"repo_name": "lidar-slam-detection", "dataset": "github_2023", "owner": "w111liang222", "lang": "c", "func_name": "ss_insertionsort", "code": "static\nvoid\nss_insertionsort(const unsigned char *T, const int *PA,\n                 int *first, int *last, int depth) {\n  int *i, *j;\n  int t;\n  int r;\n\n  for(i = last - 2; first <= i; --i) {\n    for(t = *i, j = i + 1; 0 < (r = ss_compare(T, PA + t, PA + *j, depth));) {\n      do { *(j - 1) = *j; } while((++j < last) && (*j < 0));\n      if(last <= j) { break; }\n    }\n    if(r == 0) { *j = ~*j; }\n    *(j - 1) = t;\n  }\n}", "docstring": "/* Insertionsort for small size groups */", "url": "https://github.com/w111liang222/lidar-slam-detection/blob/d57a923b3972d0a0bfdfc0016c32de53c26b9f9f/slam/thirdparty/fast_gicp/thirdparty/nvbio/contrib/libdivsufsort-lite/divsufsort.c#L241-L257", "sha": "d57a923b3972d0a0bfdfc0016c32de53c26b9f9f"}176{"repo_name": "cs2-sdk", "dataset": "github_2023", "owner": "bruhmoment21", "lang": "c", "func_name": "operands_set_tsi", "code": "_INLINE_ void operands_set_tsi(_DInst* di, _Operand* op, _OperandType type, uint16_t size, unsigned int index)\n{\n\top->type = type;\n\top->index = (uint8_t)index;\n\top->size = size;\n\tdi->usedRegistersMask |= _REGISTERTORCLASS[index];\n}", "docstring": "/* A helper function to set operand's type, size and index. */", "url": "https://github.com/bruhmoment21/cs2-sdk/blob/3fdb26b0eba5a7335f011c68bb5c7ef5a3171144/cs2-sdk/libs/distorm/src/operands.c#L51-L57", "sha": "3fdb26b0eba5a7335f011c68bb5c7ef5a3171144"}177{"repo_name": "microkernel-book", "dataset": "github_2023", "owner": "nuta", "lang": "c", "func_name": "sys_task_exit", "code": "__noreturn static void sys_task_exit(void) {\n    task_exit(EXP_GRACE_EXIT);\n}", "docstring": "// ๅฎŸ่กŒไธญใ‚ฟใ‚นใ‚ฏใ‚’ๆญฃๅธธ็ต‚ไบ†ใ™ใ‚‹ใ€‚", "url": "https://github.com/nuta/microkernel-book/blob/8665ccb23eef1136f2bfcd4770e43a3388fba78a/kernel/syscall.c#L120-L122", "sha": "8665ccb23eef1136f2bfcd4770e43a3388fba78a"}178{"repo_name": "react-native-nitro-sqlite", "dataset": "github_2023", "owner": "margelo", "lang": "c", "func_name": "sqlite3TreeViewWindow", "code": "SQLITE_PRIVATE void sqlite3TreeViewWindow(TreeView* pView, const Window* pWin, u8 more) {\n  int nElement = 0;\n  if (pWin == 0)\n    return;\n  if (pWin->pFilter) {\n    sqlite3TreeViewItem(pView, \"FILTER\", 1);\n    sqlite3TreeViewExpr(pView, pWin->pFilter, 0);\n    sqlite3TreeViewPop(&pView);\n  }\n  sqlite3TreeViewPush(&pView, more);\n  if (pWin->zName) {\n    sqlite3TreeViewLine(pView, \"OVER %s (%p)\", pWin->zName, pWin);\n  } else {\n    sqlite3TreeViewLine(pView, \"OVER (%p)\", pWin);\n  }\n  if (pWin->zBase)\n    nElement++;\n  if (pWin->pOrderBy)\n    nElement++;\n  if (pWin->eFrmType)\n    nElement++;\n  if (pWin->eExclude)\n    nElement++;\n  if (pWin->zBase) {\n    sqlite3TreeViewPush(&pView, (--nElement) > 0);\n    sqlite3TreeViewLine(pView, \"window: %s\", pWin->zBase);\n    sqlite3TreeViewPop(&pView);\n  }\n  if (pWin->pPartition) {\n    sqlite3TreeViewExprList(pView, pWin->pPartition, nElement > 0, \"PARTITION-BY\");\n  }\n  if (pWin->pOrderBy) {\n    sqlite3TreeViewExprList(pView, pWin->pOrderBy, (--nElement) > 0, \"ORDER-BY\");\n  }\n  if (pWin->eFrmType) {\n    char zBuf[30];\n    const char* zFrmType = \"ROWS\";\n    if (pWin->eFrmType == TK_RANGE)\n      zFrmType = \"RANGE\";\n    if (pWin->eFrmType == TK_GROUPS)\n      zFrmType = \"GROUPS\";\n    sqlite3_snprintf(sizeof(zBuf), zBuf, \"%s%s\", zFrmType, pWin->bImplicitFrame ? \" (implied)\" : \"\");\n    sqlite3TreeViewItem(pView, zBuf, (--nElement) > 0);\n    sqlite3TreeViewBound(pView, pWin->eStart, pWin->pStart, 1);\n    sqlite3TreeViewBound(pView, pWin->eEnd, pWin->pEnd, 0);\n    sqlite3TreeViewPop(&pView);\n  }\n  if (pWin->eExclude) {\n    char zBuf[30];\n    const char* zExclude;\n    switch (pWin->eExclude) {\n      case TK_NO:\n        zExclude = \"NO OTHERS\";\n        break;\n      case TK_CURRENT:\n        zExclude = \"CURRENT ROW\";\n        break;\n      case TK_GROUP:\n        zExclude = \"GROUP\";\n        break;\n      case TK_TIES:\n        zExclude = \"TIES\";\n        break;\n      default:\n        sqlite3_snprintf(sizeof(zBuf), zBuf, \"invalid(%d)\", pWin->eExclude);\n        zExclude = zBuf;\n        break;\n    }\n    sqlite3TreeViewPush(&pView, 0);\n    sqlite3TreeViewLine(pView, \"EXCLUDE %s\", zExclude);\n    sqlite3TreeViewPop(&pView);\n  }\n  sqlite3TreeViewPop(&pView);\n}", "docstring": "/*\n** Generate a human-readable explanation for a Window object\n*/", "url": "https://github.com/margelo/react-native-nitro-sqlite/blob/09d9159c7d3aca803c69fda2b626868338acbb50/package/cpp/sqlite/sqlite3.c#L31036-L31109", "sha": "09d9159c7d3aca803c69fda2b626868338acbb50"}179{"repo_name": "react-native-nitro-sqlite", "dataset": "github_2023", "owner": "margelo", "lang": "c", "func_name": "winShmUnmap", "code": "static int winShmUnmap(sqlite3_file* fd, /* Database holding shared memory */\n                       int deleteFlag    /* Delete after closing if true */\n) {\n  winFile* pDbFd;       /* Database holding shared-memory */\n  winShm* p;            /* The connection to be closed */\n  winShmNode* pShmNode; /* The underlying shared-memory file */\n  winShm** pp;          /* For looping over sibling connections */\n\n  pDbFd = (winFile*)fd;\n  p = pDbFd->pShm;\n  if (p == 0)\n    return SQLITE_OK;\n  pShmNode = p->pShmNode;\n\n  /* Remove connection p from the set of connections associated\n  ** with pShmNode */\n  sqlite3_mutex_enter(pShmNode->mutex);\n  for (pp = &pShmNode->pFirst; (*pp) != p; pp = &(*pp)->pNext) {\n  }\n  *pp = p->pNext;\n\n  /* Free the connection p */\n  sqlite3_free(p);\n  pDbFd->pShm = 0;\n  sqlite3_mutex_leave(pShmNode->mutex);\n\n  /* If pShmNode->nRef has reached 0, then close the underlying\n  ** shared-memory file, too */\n  winShmEnterMutex();\n  assert(pShmNode->nRef > 0);\n  pShmNode->nRef--;\n  if (pShmNode->nRef == 0) {\n    winShmPurge(pDbFd->pVfs, deleteFlag);\n  }\n  winShmLeaveMutex();\n\n  return SQLITE_OK;\n}", "docstring": "/*\n** Close a connection to shared-memory.  Delete the underlying\n** storage if deleteFlag is true.\n*/", "url": "https://github.com/margelo/react-native-nitro-sqlite/blob/09d9159c7d3aca803c69fda2b626868338acbb50/package/cpp/sqlite/sqlite3.c#L47001-L47038", "sha": "09d9159c7d3aca803c69fda2b626868338acbb50"}180{"repo_name": "react-native-nitro-sqlite", "dataset": "github_2023", "owner": "margelo", "lang": "c", "func_name": "memdbDeviceCharacteristics", "code": "static int memdbDeviceCharacteristics(sqlite3_file* pFile) {\n  UNUSED_PARAMETER(pFile);\n  return SQLITE_IOCAP_ATOMIC | SQLITE_IOCAP_POWERSAFE_OVERWRITE | SQLITE_IOCAP_SAFE_APPEND | SQLITE_IOCAP_SEQUENTIAL;\n}", "docstring": "/*\n** Return the device characteristic flags supported by an memdb-file.\n*/", "url": "https://github.com/margelo/react-native-nitro-sqlite/blob/09d9159c7d3aca803c69fda2b626868338acbb50/package/cpp/sqlite/sqlite3.c#L49514-L49517", "sha": "09d9159c7d3aca803c69fda2b626868338acbb50"}181{"repo_name": "react-native-nitro-sqlite", "dataset": "github_2023", "owner": "margelo", "lang": "c", "func_name": "sqlite3PagerSharedLock", "code": "SQLITE_PRIVATE int sqlite3PagerSharedLock(Pager* pPager) {\n  int rc = SQLITE_OK; /* Return code */\n\n  /* This routine is only called from b-tree and only when there are no\n  ** outstanding pages. This implies that the pager state should either\n  ** be OPEN or READER. READER is only possible if the pager is or was in\n  ** exclusive access mode.  */\n  assert(sqlite3PcacheRefCount(pPager->pPCache) == 0);\n  assert(assert_pager_state(pPager));\n  assert(pPager->eState == PAGER_OPEN || pPager->eState == PAGER_READER);\n  assert(pPager->errCode == SQLITE_OK);\n\n  if (!pagerUseWal(pPager) && pPager->eState == PAGER_OPEN) {\n    int bHotJournal = 1; /* True if there exists a hot journal-file */\n\n    assert(!MEMDB);\n    assert(pPager->tempFile == 0 || pPager->eLock == EXCLUSIVE_LOCK);\n\n    rc = pager_wait_on_lock(pPager, SHARED_LOCK);\n    if (rc != SQLITE_OK) {\n      assert(pPager->eLock == NO_LOCK || pPager->eLock == UNKNOWN_LOCK);\n      goto failed;\n    }\n\n    /* If a journal file exists, and there is no RESERVED lock on the\n    ** database file, then it either needs to be played back or deleted.\n    */\n    if (pPager->eLock <= SHARED_LOCK) {\n      rc = hasHotJournal(pPager, &bHotJournal);\n    }\n    if (rc != SQLITE_OK) {\n      goto failed;\n    }\n    if (bHotJournal) {\n      if (pPager->readOnly) {\n        rc = SQLITE_READONLY_ROLLBACK;\n        goto failed;\n      }\n\n      /* Get an EXCLUSIVE lock on the database file. At this point it is\n      ** important that a RESERVED lock is not obtained on the way to the\n      ** EXCLUSIVE lock. If it were, another process might open the\n      ** database file, detect the RESERVED lock, and conclude that the\n      ** database is safe to read while this process is still rolling the\n      ** hot-journal back.\n      **\n      ** Because the intermediate RESERVED lock is not requested, any\n      ** other process attempting to access the database file will get to\n      ** this point in the code and fail to obtain its own EXCLUSIVE lock\n      ** on the database file.\n      **\n      ** Unless the pager is in locking_mode=exclusive mode, the lock is\n      ** downgraded to SHARED_LOCK before this function returns.\n      */\n      rc = pagerLockDb(pPager, EXCLUSIVE_LOCK);\n      if (rc != SQLITE_OK) {\n        goto failed;\n      }\n\n      /* If it is not already open and the file exists on disk, open the\n      ** journal for read/write access. Write access is required because\n      ** in exclusive-access mode the file descriptor will be kept open\n      ** and possibly used for a transaction later on. Also, write-access\n      ** is usually required to finalize the journal in journal_mode=persist\n      ** mode (and also for journal_mode=truncate on some systems).\n      **\n      ** If the journal does not exist, it usually means that some\n      ** other connection managed to get in and roll it back before\n      ** this connection obtained the exclusive lock above. Or, it\n      ** may mean that the pager was in the error-state when this\n      ** function was called and the journal file does not exist.\n      */\n      if (!isOpen(pPager->jfd) && pPager->journalMode != PAGER_JOURNALMODE_OFF) {\n        sqlite3_vfs* const pVfs = pPager->pVfs;\n        int bExists; /* True if journal file exists */\n        rc = sqlite3OsAccess(pVfs, pPager->zJournal, SQLITE_ACCESS_EXISTS, &bExists);\n        if (rc == SQLITE_OK && bExists) {\n          int fout = 0;\n          int f = SQLITE_OPEN_READWRITE | SQLITE_OPEN_MAIN_JOURNAL;\n          assert(!pPager->tempFile);\n          rc = sqlite3OsOpen(pVfs, pPager->zJournal, pPager->jfd, f, &fout);\n          assert(rc != SQLITE_OK || isOpen(pPager->jfd));\n          if (rc == SQLITE_OK && fout & SQLITE_OPEN_READONLY) {\n            rc = SQLITE_CANTOPEN_BKPT;\n            sqlite3OsClose(pPager->jfd);\n          }\n        }\n      }\n\n      /* Playback and delete the journal.  Drop the database write\n      ** lock and reacquire the read lock. Purge the cache before\n      ** playing back the hot-journal so that we don't end up with\n      ** an inconsistent cache.  Sync the hot journal before playing\n      ** it back since the process that crashed and left the hot journal\n      ** probably did not sync it and we are required to always sync\n      ** the journal before playing it back.\n      */\n      if (isOpen(pPager->jfd)) {\n        assert(rc == SQLITE_OK);\n        rc = pagerSyncHotJournal(pPager);\n        if (rc == SQLITE_OK) {\n          rc = pager_playback(pPager, !pPager->tempFile);\n          pPager->eState = PAGER_OPEN;\n        }\n      } else if (!pPager->exclusiveMode) {\n        pagerUnlockDb(pPager, SHARED_LOCK);\n      }\n\n      if (rc != SQLITE_OK) {\n        /* This branch is taken if an error occurs while trying to open\n        ** or roll back a hot-journal while holding an EXCLUSIVE lock. The\n        ** pager_unlock() routine will be called before returning to unlock\n        ** the file. If the unlock attempt fails, then Pager.eLock must be\n        ** set to UNKNOWN_LOCK (see the comment above the #define for\n        ** UNKNOWN_LOCK above for an explanation).\n        **\n        ** In order to get pager_unlock() to do this, set Pager.eState to\n        ** PAGER_ERROR now. This is not actually counted as a transition\n        ** to ERROR state in the state diagram at the top of this file,\n        ** since we know that the same call to pager_unlock() will very\n        ** shortly transition the pager object to the OPEN state. Calling\n        ** assert_pager_state() would fail now, as it should not be possible\n        ** to be in ERROR state when there are zero outstanding page\n        ** references.\n        */\n        pager_error(pPager, rc);\n        goto failed;\n      }\n\n      assert(pPager->eState == PAGER_OPEN);\n      assert((pPager->eLock == SHARED_LOCK) || (pPager->exclusiveMode && pPager->eLock > SHARED_LOCK));\n    }\n\n    if (!pPager->tempFile && pPager->hasHeldSharedLock) {\n      /* The shared-lock has just been acquired then check to\n      ** see if the database has been modified.  If the database has changed,\n      ** flush the cache.  The hasHeldSharedLock flag prevents this from\n      ** occurring on the very first access to a file, in order to save a\n      ** single unnecessary sqlite3OsRead() call at the start-up.\n      **\n      ** Database changes are detected by looking at 15 bytes beginning\n      ** at offset 24 into the file.  The first 4 of these 16 bytes are\n      ** a 32-bit counter that is incremented with each change.  The\n      ** other bytes change randomly with each file change when\n      ** a codec is in use.\n      **\n      ** There is a vanishingly small chance that a change will not be\n      ** detected.  The chance of an undetected change is so small that\n      ** it can be neglected.\n      */\n      char dbFileVers[sizeof(pPager->dbFileVers)];\n\n      IOTRACE((\"CKVERS %p %d\\n\", pPager, sizeof(dbFileVers)));\n      rc = sqlite3OsRead(pPager->fd, &dbFileVers, sizeof(dbFileVers), 24);\n      if (rc != SQLITE_OK) {\n        if (rc != SQLITE_IOERR_SHORT_READ) {\n          goto failed;\n        }\n        memset(dbFileVers, 0, sizeof(dbFileVers));\n      }\n\n      if (memcmp(pPager->dbFileVers, dbFileVers, sizeof(dbFileVers)) != 0) {\n        pager_reset(pPager);\n\n        /* Unmap the database file. It is possible that external processes\n        ** may have truncated the database file and then extended it back\n        ** to its original size while this process was not holding a lock.\n        ** In this case there may exist a Pager.pMap mapping that appears\n        ** to be the right size but is not actually valid. Avoid this\n        ** possibility by unmapping the db here. */\n        if (USEFETCH(pPager)) {\n          sqlite3OsUnfetch(pPager->fd, 0, 0);\n        }\n      }\n    }\n\n    /* If there is a WAL file in the file-system, open this database in WAL\n    ** mode. Otherwise, the following function call is a no-op.\n    */\n    rc = pagerOpenWalIfPresent(pPager);\n#ifndef SQLITE_OMIT_WAL\n    assert(pPager->pWal == 0 || rc == SQLITE_OK);\n#endif\n  }\n\n  if (pagerUseWal(pPager)) {\n    assert(rc == SQLITE_OK);\n    rc = pagerBeginReadTransaction(pPager);\n  }\n\n  if (pPager->tempFile == 0 && pPager->eState == PAGER_OPEN && rc == SQLITE_OK) {\n    rc = pagerPagecount(pPager, &pPager->dbSize);\n  }\n\nfailed:\n  if (rc != SQLITE_OK) {\n    assert(!MEMDB);\n    pager_unlock(pPager);\n    assert(pPager->eState == PAGER_OPEN);\n  } else {\n    pPager->eState = PAGER_READER;\n    pPager->hasHeldSharedLock = 1;\n  }\n  return rc;\n}", "docstring": "/*\n** This function is called to obtain a shared lock on the database file.\n** It is illegal to call sqlite3PagerGet() until after this function\n** has been successfully called. If a shared-lock is already held when\n** this function is called, it is a no-op.\n**\n** The following operations are also performed by this function.\n**\n**   1) If the pager is currently in PAGER_OPEN state (no lock held\n**      on the database file), then an attempt is made to obtain a\n**      SHARED lock on the database file. Immediately after obtaining\n**      the SHARED lock, the file-system is checked for a hot-journal,\n**      which is played back if present. Following any hot-journal\n**      rollback, the contents of the cache are validated by checking\n**      the 'change-counter' field of the database file header and\n**      discarded if they are found to be invalid.\n**\n**   2) If the pager is running in exclusive-mode, and there are currently\n**      no outstanding references to any pages, and is in the error state,\n**      then an attempt is made to clear the error state by discarding\n**      the contents of the page cache and rolling back any open journal\n**      file.\n**\n** If everything is successful, SQLITE_OK is returned. If an IO error\n** occurs while locking the database, checking for a hot-journal file or\n** rolling back a journal file, the IO error code is returned.\n*/", "url": "https://github.com/margelo/react-native-nitro-sqlite/blob/09d9159c7d3aca803c69fda2b626868338acbb50/package/cpp/sqlite/sqlite3.c#L58291-L58495", "sha": "09d9159c7d3aca803c69fda2b626868338acbb50"}182{"repo_name": "react-native-nitro-sqlite", "dataset": "github_2023", "owner": "margelo", "lang": "c", "func_name": "sqlite3BtreeSeekCount", "code": "SQLITE_PRIVATE sqlite3_uint64 sqlite3BtreeSeekCount(Btree* pBt) {\n  u64 n = pBt->nSeek;\n  pBt->nSeek = 0;\n  return n;\n}", "docstring": "/*\n** Return and reset the seek counter for a Btree object.\n*/", "url": "https://github.com/margelo/react-native-nitro-sqlite/blob/09d9159c7d3aca803c69fda2b626868338acbb50/package/cpp/sqlite/sqlite3.c#L66055-L66059", "sha": "09d9159c7d3aca803c69fda2b626868338acbb50"}183{"repo_name": "react-native-nitro-sqlite", "dataset": "github_2023", "owner": "margelo", "lang": "c", "func_name": "sqlite3VdbeIOTraceSql", "code": "SQLITE_PRIVATE void sqlite3VdbeIOTraceSql(Vdbe* p) {\n  int nOp = p->nOp;\n  VdbeOp* pOp;\n  if (sqlite3IoTrace == 0)\n    return;\n  if (nOp < 1)\n    return;\n  pOp = &p->aOp[0];\n  if (pOp->opcode == OP_Init && pOp->p4.z != 0) {\n    int i, j;\n    char z[1000];\n    sqlite3_snprintf(sizeof(z), z, \"%s\", pOp->p4.z);\n    for (i = 0; sqlite3Isspace(z[i]); i++) {\n    }\n    for (j = 0; z[i]; i++) {\n      if (sqlite3Isspace(z[i])) {\n        if (z[i - 1] != ' ') {\n          z[j++] = ' ';\n        }\n      } else {\n        z[j++] = z[i];\n      }\n    }\n    z[j] = 0;\n    sqlite3IoTrace(\"SQL %s\\n\", z);\n  }\n}", "docstring": "/*\n** Print an IOTRACE message showing SQL content.\n*/", "url": "https://github.com/margelo/react-native-nitro-sqlite/blob/09d9159c7d3aca803c69fda2b626868338acbb50/package/cpp/sqlite/sqlite3.c#L82084-L82110", "sha": "09d9159c7d3aca803c69fda2b626868338acbb50"}184{"repo_name": "react-native-nitro-sqlite", "dataset": "github_2023", "owner": "margelo", "lang": "c", "func_name": "sqlite3_blob_bytes", "code": "SQLITE_API int sqlite3_blob_bytes(sqlite3_blob* pBlob) {\n  Incrblob* p = (Incrblob*)pBlob;\n  return (p && p->pStmt) ? p->nByte : 0;\n}", "docstring": "/*\n** Query a blob handle for the size of the data.\n**\n** The Incrblob.nByte field is fixed for the lifetime of the Incrblob\n** so no mutex is required for access.\n*/", "url": "https://github.com/margelo/react-native-nitro-sqlite/blob/09d9159c7d3aca803c69fda2b626868338acbb50/package/cpp/sqlite/sqlite3.c#L96615-L96618", "sha": "09d9159c7d3aca803c69fda2b626868338acbb50"}185{"repo_name": "react-native-nitro-sqlite", "dataset": "github_2023", "owner": "margelo", "lang": "c", "func_name": "jsonIs4Hex", "code": "static int jsonIs4Hex(const char* z) {\n  int i;\n  for (i = 0; i < 4; i++)\n    if (!sqlite3Isxdigit(z[i]))\n      return 0;\n  return 1;\n}", "docstring": "/*\n** Return true if z[] begins with 4 (or more) hexadecimal digits\n*/", "url": "https://github.com/margelo/react-native-nitro-sqlite/blob/09d9159c7d3aca803c69fda2b626868338acbb50/package/cpp/sqlite/sqlite3.c#L194002-L194008", "sha": "09d9159c7d3aca803c69fda2b626868338acbb50"}186{"repo_name": "react-native-nitro-sqlite", "dataset": "github_2023", "owner": "margelo", "lang": "c", "func_name": "jsonEachColumn", "code": "static int jsonEachColumn(sqlite3_vtab_cursor* cur, /* The cursor */\n                          sqlite3_context* ctx,     /* First argument to sqlite3_result_...() */\n                          int i                     /* Which column to return */\n) {\n  JsonEachCursor* p = (JsonEachCursor*)cur;\n  JsonNode* pThis = &p->sParse.aNode[p->i];\n  switch (i) {\n    case JEACH_KEY: {\n      if (p->i == 0)\n        break;\n      if (p->eType == JSON_OBJECT) {\n        jsonReturn(pThis, ctx, 0);\n      } else if (p->eType == JSON_ARRAY) {\n        u32 iKey;\n        if (p->bRecursive) {\n          if (p->iRowid == 0)\n            break;\n          assert(p->sParse.aNode[p->sParse.aUp[p->i]].eU == 3);\n          iKey = p->sParse.aNode[p->sParse.aUp[p->i]].u.iKey;\n        } else {\n          iKey = p->iRowid;\n        }\n        sqlite3_result_int64(ctx, (sqlite3_int64)iKey);\n      }\n      break;\n    }\n    case JEACH_VALUE: {\n      if (pThis->jnFlags & JNODE_LABEL)\n        pThis++;\n      jsonReturn(pThis, ctx, 0);\n      break;\n    }\n    case JEACH_TYPE: {\n      if (pThis->jnFlags & JNODE_LABEL)\n        pThis++;\n      sqlite3_result_text(ctx, jsonType[pThis->eType], -1, SQLITE_STATIC);\n      break;\n    }\n    case JEACH_ATOM: {\n      if (pThis->jnFlags & JNODE_LABEL)\n        pThis++;\n      if (pThis->eType >= JSON_ARRAY)\n        break;\n      jsonReturn(pThis, ctx, 0);\n      break;\n    }\n    case JEACH_ID: {\n      sqlite3_result_int64(ctx, (sqlite3_int64)p->i + ((pThis->jnFlags & JNODE_LABEL) != 0));\n      break;\n    }\n    case JEACH_PARENT: {\n      if (p->i > p->iBegin && p->bRecursive) {\n        sqlite3_result_int64(ctx, (sqlite3_int64)p->sParse.aUp[p->i]);\n      }\n      break;\n    }\n    case JEACH_FULLKEY: {\n      JsonString x;\n      jsonInit(&x, ctx);\n      if (p->bRecursive) {\n        jsonEachComputePath(p, &x, p->i);\n      } else {\n        if (p->zRoot) {\n          jsonAppendRaw(&x, p->zRoot, (int)strlen(p->zRoot));\n        } else {\n          jsonAppendChar(&x, '$');\n        }\n        if (p->eType == JSON_ARRAY) {\n          jsonPrintf(30, &x, \"[%d]\", p->iRowid);\n        } else if (p->eType == JSON_OBJECT) {\n          jsonAppendObjectPathElement(&x, pThis);\n        }\n      }\n      jsonResult(&x);\n      break;\n    }\n    case JEACH_PATH: {\n      if (p->bRecursive) {\n        JsonString x;\n        jsonInit(&x, ctx);\n        jsonEachComputePath(p, &x, p->sParse.aUp[p->i]);\n        jsonResult(&x);\n        break;\n      }\n      /* For json_each() path and root are the same so fall through\n      ** into the root case */\n      /* no break */ deliberate_fall_through\n    }\n    default: {\n      const char* zRoot = p->zRoot;\n      if (zRoot == 0)\n        zRoot = \"$\";\n      sqlite3_result_text(ctx, zRoot, -1, SQLITE_STATIC);\n      break;\n    }\n    case JEACH_JSON: {\n      assert(i == JEACH_JSON);\n      sqlite3_result_text(ctx, p->sParse.zJson, -1, SQLITE_STATIC);\n      break;\n    }\n  }\n  return SQLITE_OK;\n}", "docstring": "/* Return the value of a column */", "url": "https://github.com/margelo/react-native-nitro-sqlite/blob/09d9159c7d3aca803c69fda2b626868338acbb50/package/cpp/sqlite/sqlite3.c#L195566-L195668", "sha": "09d9159c7d3aca803c69fda2b626868338acbb50"}187{"repo_name": "react-native-nitro-sqlite", "dataset": "github_2023", "owner": "margelo", "lang": "c", "func_name": "sessionDiffHooks", "code": "static void sessionDiffHooks(sqlite3_session* pSession, SessionDiffCtx* pDiffCtx) {\n  pSession->hook.pCtx = (void*)pDiffCtx;\n  pSession->hook.xOld = sessionDiffOld;\n  pSession->hook.xNew = sessionDiffNew;\n  pSession->hook.xCount = sessionDiffCount;\n  pSession->hook.xDepth = sessionDiffDepth;\n}", "docstring": "/*\n** Install the diff hooks on the session object passed as the only\n** argument.\n*/", "url": "https://github.com/margelo/react-native-nitro-sqlite/blob/09d9159c7d3aca803c69fda2b626868338acbb50/package/cpp/sqlite/sqlite3.c#L211450-L211456", "sha": "09d9159c7d3aca803c69fda2b626868338acbb50"}188{"repo_name": "Nissan-LEAF-Battery-Upgrade", "dataset": "github_2023", "owner": "dalathegreat", "lang": "c", "func_name": "HAL_CAN_RxFifo1FullCallback", "code": "__weak void HAL_CAN_RxFifo1FullCallback(CAN_HandleTypeDef *hcan)\n{\n  /* Prevent unused argument(s) compilation warning */\n  UNUSED(hcan);\n\n  /* NOTE : This function Should not be modified, when the callback is needed,\n            the HAL_CAN_RxFifo1FullCallback could be implemented in the user\n            file\n   */\n}", "docstring": "/**\n  * @brief  Rx FIFO 1 full callback.\n  * @param  hcan pointer to a CAN_HandleTypeDef structure that contains\n  *         the configuration information for the specified CAN.\n  * @retval None\n  */", "url": "https://github.com/dalathegreat/Nissan-LEAF-Battery-Upgrade/blob/96cee856d7fb38b2e72736ddfccb8e07eb7bb594/Software/CANBRIDGE-2port/source/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_can.c#L2259-L2268", "sha": "96cee856d7fb38b2e72736ddfccb8e07eb7bb594"}189{"repo_name": "Nissan-LEAF-Battery-Upgrade", "dataset": "github_2023", "owner": "dalathegreat", "lang": "c", "func_name": "HAL_RCC_GetClockConfig", "code": "void HAL_RCC_GetClockConfig(RCC_ClkInitTypeDef  *RCC_ClkInitStruct, uint32_t *pFLatency)\n{\n  /* Check the parameters */\n  assert_param(RCC_ClkInitStruct != NULL);\n  assert_param(pFLatency != NULL);\n\n  /* Set all possible values for the Clock type parameter --------------------*/\n  RCC_ClkInitStruct->ClockType = RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;\n\n  /* Get the SYSCLK configuration --------------------------------------------*/\n  RCC_ClkInitStruct->SYSCLKSource = (uint32_t)(RCC->CFGR & RCC_CFGR_SW);\n\n  /* Get the HCLK configuration ----------------------------------------------*/\n  RCC_ClkInitStruct->AHBCLKDivider = (uint32_t)(RCC->CFGR & RCC_CFGR_HPRE);\n\n  /* Get the APB1 configuration ----------------------------------------------*/\n  RCC_ClkInitStruct->APB1CLKDivider = (uint32_t)(RCC->CFGR & RCC_CFGR_PPRE1);\n\n  /* Get the APB2 configuration ----------------------------------------------*/\n  RCC_ClkInitStruct->APB2CLKDivider = (uint32_t)((RCC->CFGR & RCC_CFGR_PPRE2) >> 3);\n\n#if   defined(FLASH_ACR_LATENCY)\n  /* Get the Flash Wait State (Latency) configuration ------------------------*/\n  *pFLatency = (uint32_t)(FLASH->ACR & FLASH_ACR_LATENCY);\n#else\n  /* For VALUE lines devices, only LATENCY_0 can be set*/\n  *pFLatency = (uint32_t)FLASH_LATENCY_0;\n#endif\n}", "docstring": "/**\n  * @brief  Get the RCC_ClkInitStruct according to the internal\n  * RCC configuration registers.\n  * @param  RCC_ClkInitStruct pointer to an RCC_ClkInitTypeDef structure that\n  * contains the current clock configuration.\n  * @param  pFLatency Pointer on the Flash Latency.\n  * @retval None\n  */", "url": "https://github.com/dalathegreat/Nissan-LEAF-Battery-Upgrade/blob/96cee856d7fb38b2e72736ddfccb8e07eb7bb594/Software/CANBRIDGE-2port/source/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c#L1312-L1340", "sha": "96cee856d7fb38b2e72736ddfccb8e07eb7bb594"}190{"repo_name": "sqlwrite", "dataset": "github_2023", "owner": "plasma-umass", "lang": "c", "func_name": "zipfileColumn", "code": "static int zipfileColumn(\n  sqlite3_vtab_cursor *cur,   /* The cursor */\n  sqlite3_context *ctx,       /* First argument to sqlite3_result_...() */\n  int i                       /* Which column to return */\n){\n  ZipfileCsr *pCsr = (ZipfileCsr*)cur;\n  ZipfileCDS *pCDS = &pCsr->pCurrent->cds;\n  int rc = SQLITE_OK;\n  switch( i ){\n    case 0:   /* name */\n      sqlite3_result_text(ctx, pCDS->zFile, -1, SQLITE_TRANSIENT);\n      break;\n    case 1:   /* mode */\n      /* TODO: Whether or not the following is correct surely depends on\n      ** the platform on which the archive was created.  */\n      sqlite3_result_int(ctx, pCDS->iExternalAttr >> 16);\n      break;\n    case 2: { /* mtime */\n      sqlite3_result_int64(ctx, pCsr->pCurrent->mUnixTime);\n      break;\n    }\n    case 3: { /* sz */\n      if( sqlite3_vtab_nochange(ctx)==0 ){\n        sqlite3_result_int64(ctx, pCDS->szUncompressed);\n      }\n      break;\n    }\n    case 4:   /* rawdata */\n      if( sqlite3_vtab_nochange(ctx) ) break;\n    case 5: { /* data */\n      if( i==4 || pCDS->iCompression==0 || pCDS->iCompression==8 ){\n        int sz = pCDS->szCompressed;\n        int szFinal = pCDS->szUncompressed;\n        if( szFinal>0 ){\n          u8 *aBuf;\n          u8 *aFree = 0;\n          if( pCsr->pCurrent->aData ){\n            aBuf = pCsr->pCurrent->aData;\n          }else{\n            aBuf = aFree = sqlite3_malloc64(sz);\n            if( aBuf==0 ){\n              rc = SQLITE_NOMEM;\n            }else{\n              FILE *pFile = pCsr->pFile;\n              if( pFile==0 ){\n                pFile = ((ZipfileTab*)(pCsr->base.pVtab))->pWriteFd;\n              }\n              rc = zipfileReadData(pFile, aBuf, sz, pCsr->pCurrent->iDataOff,\n                  &pCsr->base.pVtab->zErrMsg\n              );\n            }\n          }\n          if( rc==SQLITE_OK ){\n            if( i==5 && pCDS->iCompression ){\n              zipfileInflate(ctx, aBuf, sz, szFinal);\n            }else{\n              sqlite3_result_blob(ctx, aBuf, sz, SQLITE_TRANSIENT);\n            }\n          }\n          sqlite3_free(aFree);\n        }else{\n          /* Figure out if this is a directory or a zero-sized file. Consider\n          ** it to be a directory either if the mode suggests so, or if\n          ** the final character in the name is '/'.  */\n          u32 mode = pCDS->iExternalAttr >> 16;\n          if( !(mode & S_IFDIR) && pCDS->zFile[pCDS->nFile-1]!='/' ){\n            sqlite3_result_blob(ctx, \"\", 0, SQLITE_STATIC);\n          }\n        }\n      }\n      break;\n    }\n    case 6:   /* method */\n      sqlite3_result_int(ctx, pCDS->iCompression);\n      break;\n    default:  /* z */\n      assert( i==7 );\n      sqlite3_result_int64(ctx, pCsr->iId);\n      break;\n  }\n\n  return rc;\n}", "docstring": "/*\n** Return values of columns for the row at which the series_cursor\n** is currently pointing.\n*/", "url": "https://github.com/plasma-umass/sqlwrite/blob/099aec4292676b58c179e4d6e11635e624fcd289/shell.c#L8711-L8793", "sha": "099aec4292676b58c179e4d6e11635e624fcd289"}191{"repo_name": "sqlwrite", "dataset": "github_2023", "owner": "plasma-umass", "lang": "c", "func_name": "read32bits", "code": "static int read32bits(sqlite3_file *fd, i64 offset, u32 *pRes){\n  unsigned char ac[4];\n  int rc = sqlite3OsRead(fd, ac, sizeof(ac), offset);\n  if( rc==SQLITE_OK ){\n    *pRes = sqlite3Get4byte(ac);\n  }\n  return rc;\n}", "docstring": "/*\n** Read a 32-bit integer from the given file descriptor.  Store the integer\n** that is read in *pRes.  Return SQLITE_OK if everything worked, or an\n** error code is something goes wrong.\n**\n** All values are stored on disk as big-endian.\n*/", "url": "https://github.com/plasma-umass/sqlwrite/blob/099aec4292676b58c179e4d6e11635e624fcd289/sqlite3.c#L56589-L56596", "sha": "099aec4292676b58c179e4d6e11635e624fcd289"}192{"repo_name": "sqlwrite", "dataset": "github_2023", "owner": "plasma-umass", "lang": "c", "func_name": "sqlite3PagerCommitPhaseOne", "code": "SQLITE_PRIVATE int sqlite3PagerCommitPhaseOne(\n  Pager *pPager,                  /* Pager object */\n  const char *zSuper,            /* If not NULL, the super-journal name */\n  int noSync                      /* True to omit the xSync on the db file */\n){\n  int rc = SQLITE_OK;             /* Return code */\n\n  assert( pPager->eState==PAGER_WRITER_LOCKED\n       || pPager->eState==PAGER_WRITER_CACHEMOD\n       || pPager->eState==PAGER_WRITER_DBMOD\n       || pPager->eState==PAGER_ERROR\n  );\n  assert( assert_pager_state(pPager) );\n\n  /* If a prior error occurred, report that error again. */\n  if( NEVER(pPager->errCode) ) return pPager->errCode;\n\n  /* Provide the ability to easily simulate an I/O error during testing */\n  if( sqlite3FaultSim(400) ) return SQLITE_IOERR;\n\n  PAGERTRACE((\"DATABASE SYNC: File=%s zSuper=%s nSize=%d\\n\",\n      pPager->zFilename, zSuper, pPager->dbSize));\n\n  /* If no database changes have been made, return early. */\n  if( pPager->eState<PAGER_WRITER_CACHEMOD ) return SQLITE_OK;\n\n  assert( MEMDB==0 || pPager->tempFile );\n  assert( isOpen(pPager->fd) || pPager->tempFile );\n  if( 0==pagerFlushOnCommit(pPager, 1) ){\n    /* If this is an in-memory db, or no pages have been written to, or this\n    ** function has already been called, it is mostly a no-op.  However, any\n    ** backup in progress needs to be restarted.  */\n    sqlite3BackupRestart(pPager->pBackup);\n  }else{\n    PgHdr *pList;\n    if( pagerUseWal(pPager) ){\n      PgHdr *pPageOne = 0;\n      pList = sqlite3PcacheDirtyList(pPager->pPCache);\n      if( pList==0 ){\n        /* Must have at least one page for the WAL commit flag.\n        ** Ticket [2d1a5c67dfc2363e44f29d9bbd57f] 2011-05-18 */\n        rc = sqlite3PagerGet(pPager, 1, &pPageOne, 0);\n        pList = pPageOne;\n        pList->pDirty = 0;\n      }\n      assert( rc==SQLITE_OK );\n      if( ALWAYS(pList) ){\n        rc = pagerWalFrames(pPager, pList, pPager->dbSize, 1);\n      }\n      sqlite3PagerUnref(pPageOne);\n      if( rc==SQLITE_OK ){\n        sqlite3PcacheCleanAll(pPager->pPCache);\n      }\n    }else{\n      /* The bBatch boolean is true if the batch-atomic-write commit method\n      ** should be used.  No rollback journal is created if batch-atomic-write\n      ** is enabled.\n      */\n#ifdef SQLITE_ENABLE_BATCH_ATOMIC_WRITE\n      sqlite3_file *fd = pPager->fd;\n      int bBatch = zSuper==0    /* An SQLITE_IOCAP_BATCH_ATOMIC commit */\n        && (sqlite3OsDeviceCharacteristics(fd) & SQLITE_IOCAP_BATCH_ATOMIC)\n        && !pPager->noSync\n        && sqlite3JournalIsInMemory(pPager->jfd);\n#else\n#     define bBatch 0\n#endif\n\n#ifdef SQLITE_ENABLE_ATOMIC_WRITE\n      /* The following block updates the change-counter. Exactly how it\n      ** does this depends on whether or not the atomic-update optimization\n      ** was enabled at compile time, and if this transaction meets the\n      ** runtime criteria to use the operation:\n      **\n      **    * The file-system supports the atomic-write property for\n      **      blocks of size page-size, and\n      **    * This commit is not part of a multi-file transaction, and\n      **    * Exactly one page has been modified and store in the journal file.\n      **\n      ** If the optimization was not enabled at compile time, then the\n      ** pager_incr_changecounter() function is called to update the change\n      ** counter in 'indirect-mode'. If the optimization is compiled in but\n      ** is not applicable to this transaction, call sqlite3JournalCreate()\n      ** to make sure the journal file has actually been created, then call\n      ** pager_incr_changecounter() to update the change-counter in indirect\n      ** mode.\n      **\n      ** Otherwise, if the optimization is both enabled and applicable,\n      ** then call pager_incr_changecounter() to update the change-counter\n      ** in 'direct' mode. In this case the journal file will never be\n      ** created for this transaction.\n      */\n      if( bBatch==0 ){\n        PgHdr *pPg;\n        assert( isOpen(pPager->jfd)\n            || pPager->journalMode==PAGER_JOURNALMODE_OFF\n            || pPager->journalMode==PAGER_JOURNALMODE_WAL\n            );\n        if( !zSuper && isOpen(pPager->jfd)\n         && pPager->journalOff==jrnlBufferSize(pPager)\n         && pPager->dbSize>=pPager->dbOrigSize\n         && (!(pPg = sqlite3PcacheDirtyList(pPager->pPCache)) || 0==pPg->pDirty)\n        ){\n          /* Update the db file change counter via the direct-write method. The\n          ** following call will modify the in-memory representation of page 1\n          ** to include the updated change counter and then write page 1\n          ** directly to the database file. Because of the atomic-write\n          ** property of the host file-system, this is safe.\n          */\n          rc = pager_incr_changecounter(pPager, 1);\n        }else{\n          rc = sqlite3JournalCreate(pPager->jfd);\n          if( rc==SQLITE_OK ){\n            rc = pager_incr_changecounter(pPager, 0);\n          }\n        }\n      }\n#else  /* SQLITE_ENABLE_ATOMIC_WRITE */\n#ifdef SQLITE_ENABLE_BATCH_ATOMIC_WRITE\n      if( zSuper ){\n        rc = sqlite3JournalCreate(pPager->jfd);\n        if( rc!=SQLITE_OK ) goto commit_phase_one_exit;\n        assert( bBatch==0 );\n      }\n#endif\n      rc = pager_incr_changecounter(pPager, 0);\n#endif /* !SQLITE_ENABLE_ATOMIC_WRITE */\n      if( rc!=SQLITE_OK ) goto commit_phase_one_exit;\n\n      /* Write the super-journal name into the journal file. If a\n      ** super-journal file name has already been written to the journal file,\n      ** or if zSuper is NULL (no super-journal), then this call is a no-op.\n      */\n      rc = writeSuperJournal(pPager, zSuper);\n      if( rc!=SQLITE_OK ) goto commit_phase_one_exit;\n\n      /* Sync the journal file and write all dirty pages to the database.\n      ** If the atomic-update optimization is being used, this sync will not\n      ** create the journal file or perform any real IO.\n      **\n      ** Because the change-counter page was just modified, unless the\n      ** atomic-update optimization is used it is almost certain that the\n      ** journal requires a sync here. However, in locking_mode=exclusive\n      ** on a system under memory pressure it is just possible that this is\n      ** not the case. In this case it is likely enough that the redundant\n      ** xSync() call will be changed to a no-op by the OS anyhow.\n      */\n      rc = syncJournal(pPager, 0);\n      if( rc!=SQLITE_OK ) goto commit_phase_one_exit;\n\n      pList = sqlite3PcacheDirtyList(pPager->pPCache);\n#ifdef SQLITE_ENABLE_BATCH_ATOMIC_WRITE\n      if( bBatch ){\n        rc = sqlite3OsFileControl(fd, SQLITE_FCNTL_BEGIN_ATOMIC_WRITE, 0);\n        if( rc==SQLITE_OK ){\n          rc = pager_write_pagelist(pPager, pList);\n          if( rc==SQLITE_OK ){\n            rc = sqlite3OsFileControl(fd, SQLITE_FCNTL_COMMIT_ATOMIC_WRITE, 0);\n          }\n          if( rc!=SQLITE_OK ){\n            sqlite3OsFileControlHint(fd, SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE, 0);\n          }\n        }\n\n        if( (rc&0xFF)==SQLITE_IOERR && rc!=SQLITE_IOERR_NOMEM ){\n          rc = sqlite3JournalCreate(pPager->jfd);\n          if( rc!=SQLITE_OK ){\n            sqlite3OsClose(pPager->jfd);\n            goto commit_phase_one_exit;\n          }\n          bBatch = 0;\n        }else{\n          sqlite3OsClose(pPager->jfd);\n        }\n      }\n#endif /* SQLITE_ENABLE_BATCH_ATOMIC_WRITE */\n\n      if( bBatch==0 ){\n        rc = pager_write_pagelist(pPager, pList);\n      }\n      if( rc!=SQLITE_OK ){\n        assert( rc!=SQLITE_IOERR_BLOCKED );\n        goto commit_phase_one_exit;\n      }\n      sqlite3PcacheCleanAll(pPager->pPCache);\n\n      /* If the file on disk is smaller than the database image, use\n      ** pager_truncate to grow the file here. This can happen if the database\n      ** image was extended as part of the current transaction and then the\n      ** last page in the db image moved to the free-list. In this case the\n      ** last page is never written out to disk, leaving the database file\n      ** undersized. Fix this now if it is the case.  */\n      if( pPager->dbSize>pPager->dbFileSize ){\n        Pgno nNew = pPager->dbSize - (pPager->dbSize==PAGER_SJ_PGNO(pPager));\n        assert( pPager->eState==PAGER_WRITER_DBMOD );\n        rc = pager_truncate(pPager, nNew);\n        if( rc!=SQLITE_OK ) goto commit_phase_one_exit;\n      }\n\n      /* Finally, sync the database file. */\n      if( !noSync ){\n        rc = sqlite3PagerSync(pPager, zSuper);\n      }\n      IOTRACE((\"DBSYNC %p\\n\", pPager))\n    }\n  }\n\ncommit_phase_one_exit:\n  if( rc==SQLITE_OK && !pagerUseWal(pPager) ){\n    pPager->eState = PAGER_WRITER_FINISHED;\n  }\n  return rc;\n}", "docstring": "/*\n** Sync the database file for the pager pPager. zSuper points to the name\n** of a super-journal file that should be written into the individual\n** journal file. zSuper may be NULL, which is interpreted as no\n** super-journal (a single database transaction).\n**\n** This routine ensures that:\n**\n**   * The database file change-counter is updated,\n**   * the journal is synced (unless the atomic-write optimization is used),\n**   * all dirty pages are written to the database file,\n**   * the database file is truncated (if required), and\n**   * the database file synced.\n**\n** The only thing that remains to commit the transaction is to finalize\n** (delete, truncate or zero the first part of) the journal file (or\n** delete the super-journal file if specified).\n**\n** Note that if zSuper==NULL, this does not overwrite a previous value\n** passed to an sqlite3PagerCommitPhaseOne() call.\n**\n** If the final parameter - noSync - is true, then the database file itself\n** is not synced. The caller must call sqlite3PagerSync() directly to\n** sync the database file before calling CommitPhaseTwo() to delete the\n** journal file in this case.\n*/", "url": "https://github.com/plasma-umass/sqlwrite/blob/099aec4292676b58c179e4d6e11635e624fcd289/sqlite3.c#L61867-L62079", "sha": "099aec4292676b58c179e4d6e11635e624fcd289"}193{"repo_name": "sqlwrite", "dataset": "github_2023", "owner": "plasma-umass", "lang": "c", "func_name": "sqlite3PagerWalFramesize", "code": "SQLITE_PRIVATE int sqlite3PagerWalFramesize(Pager *pPager){\n  assert( pPager->eState>=PAGER_READER );\n  return sqlite3WalFramesize(pPager->pWal);\n}", "docstring": "/*\n** A read-lock must be held on the pager when this function is called. If\n** the pager is in WAL mode and the WAL file currently contains one or more\n** frames, return the size in bytes of the page images stored within the\n** WAL frames. Otherwise, if this is not a WAL database or the WAL file\n** is empty, return 0.\n*/", "url": "https://github.com/plasma-umass/sqlwrite/blob/099aec4292676b58c179e4d6e11635e624fcd289/sqlite3.c#L63209-L63212", "sha": "099aec4292676b58c179e4d6e11635e624fcd289"}194{"repo_name": "sqlwrite", "dataset": "github_2023", "owner": "plasma-umass", "lang": "c", "func_name": "geopolyCcwFunc", "code": "static void geopolyCcwFunc(\n  sqlite3_context *context,\n  int argc,\n  sqlite3_value **argv\n){\n  GeoPoly *p = geopolyFuncParam(context, argv[0], 0);\n  (void)argc;\n  if( p ){\n    if( geopolyArea(p)<0.0 ){\n      int ii, jj;\n      for(ii=1, jj=p->nVertex-1; ii<jj; ii++, jj--){\n        GeoCoord t = GeoX(p,ii);\n        GeoX(p,ii) = GeoX(p,jj);\n        GeoX(p,jj) = t;\n        t = GeoY(p,ii);\n        GeoY(p,ii) = GeoY(p,jj);\n        GeoY(p,jj) = t;\n      }\n    }\n    sqlite3_result_blob(context, p->hdr,\n       4+8*p->nVertex, SQLITE_TRANSIENT);\n    sqlite3_free(p);\n  }\n}", "docstring": "/*\n** Implementation of the geopoly_ccw(X) function.\n**\n** If the rotation of polygon X is clockwise (incorrect) instead of\n** counter-clockwise (the correct winding order according to RFC7946)\n** then reverse the order of the vertexes in polygon X.\n**\n** In other words, this routine returns a CCW polygon regardless of the\n** winding order of its input.\n**\n** Use this routine to sanitize historical inputs that that sometimes\n** contain polygons that wind in the wrong direction.\n*/", "url": "https://github.com/plasma-umass/sqlwrite/blob/099aec4292676b58c179e4d6e11635e624fcd289/sqlite3.c#L206454-L206477", "sha": "099aec4292676b58c179e4d6e11635e624fcd289"}195{"repo_name": "sqlwrite", "dataset": "github_2023", "owner": "plasma-umass", "lang": "c", "func_name": "geopolyBBoxFunc", "code": "static void geopolyBBoxFunc(\n  sqlite3_context *context,\n  int argc,\n  sqlite3_value **argv\n){\n  GeoPoly *p = geopolyBBox(context, argv[0], 0, 0);\n  (void)argc;\n  if( p ){\n    sqlite3_result_blob(context, p->hdr,\n       4+8*p->nVertex, SQLITE_TRANSIENT);\n    sqlite3_free(p);\n  }\n}", "docstring": "/*\n** Implementation of the geopoly_bbox(X) SQL function.\n*/", "url": "https://github.com/plasma-umass/sqlwrite/blob/099aec4292676b58c179e4d6e11635e624fcd289/sqlite3.c#L206619-L206631", "sha": "099aec4292676b58c179e4d6e11635e624fcd289"}196{"repo_name": "sqlwrite", "dataset": "github_2023", "owner": "plasma-umass", "lang": "c", "func_name": "fts5DecodeStructure", "code": "static void fts5DecodeStructure(\n  int *pRc,                       /* IN/OUT: error code */\n  Fts5Buffer *pBuf,\n  const u8 *pBlob, int nBlob\n){\n  int rc;                         /* Return code */\n  Fts5Structure *p = 0;           /* Decoded structure object */\n\n  rc = fts5StructureDecode(pBlob, nBlob, 0, &p);\n  if( rc!=SQLITE_OK ){\n    *pRc = rc;\n    return;\n  }\n\n  fts5DebugStructure(pRc, pBuf, p);\n  fts5StructureRelease(p);\n}", "docstring": "/*\n** This is part of the fts5_decode() debugging aid.\n**\n** Arguments pBlob/nBlob contain a serialized Fts5Structure object. This\n** function appends a human-readable representation of the same object\n** to the buffer passed as the second argument.\n*/", "url": "https://github.com/plasma-umass/sqlwrite/blob/099aec4292676b58c179e4d6e11635e624fcd289/sqlite3.c#L237040-L237056", "sha": "099aec4292676b58c179e4d6e11635e624fcd289"}197{"repo_name": "Understanding-VITS", "dataset": "github_2023", "owner": "JunityZhan", "lang": "c", "func_name": "__Pyx_pretend_to_initialize", "code": "static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }", "docstring": "/* __GNUC__ */", "url": "https://github.com/JunityZhan/Understanding-VITS/blob/908a46a2af87606c3039a402cc7af3984ef8aafd/monotonic_align/core.c#L817-L817", "sha": "908a46a2af87606c3039a402cc7af3984ef8aafd"}198{"repo_name": "ragnar", "dataset": "github_2023", "owner": "cococry", "lang": "c", "func_name": "switchclientdesktop", "code": "void\nswitchclientdesktop(state_t* s, client_t* cl, int32_t desktop) {\n  char** names = (char**)malloc(s->monfocus->desktopcount * sizeof(char*));\n  for (size_t i = 0; i < s->monfocus->desktopcount ; i++) {\n    names[i] = strdup(s->monfocus->activedesktops[i].name);\n  }\n  // Create the desktop if it was not created yet\n  if(!strinarr(names, s->monfocus->desktopcount, s->config.desktopnames[desktop])) {\n    createdesktop(s, desktop, s->monfocus);\n  }\n  free(names);\n\n  cl->desktop = desktop;\n  if(cl == s->focus) {\n    unfocusclient(s, cl);\n  }\n  hideclient(s, cl);\n  makelayout(s, s->monfocus);\n}", "docstring": "/**\n * @brief Switches the desktop of a given client and hides that client.\n *\n * @param s The window manager's state\n * @param cl The client to switch the desktop of\n * @param desktop The desktop to set the client of \n */", "url": "https://github.com/cococry/ragnar/blob/8b95f82411d8956a29fb556cc6a9ab721492e985/src/ragnar.c#L1283-L1301", "sha": "8b95f82411d8956a29fb556cc6a9ab721492e985"}199{"repo_name": "Server", "dataset": "github_2023", "owner": "2004Scape", "lang": "c", "func_name": "makeMaps_e", "code": "static\nvoid makeMaps_e ( EState* s )\n{\n   Int32 i;\n   s->nInUse = 0;\n   for (i = 0; i < 256; i++)\n      if (s->inUse[i]) {\n         s->unseqToSeq[i] = s->nInUse;\n         s->nInUse++;\n      }\n}", "docstring": "/*---------------------------------------------------*/\n/*--- The back end proper                         ---*/\n/*---------------------------------------------------*/\n/*---------------------------------------------------*/", "url": "https://github.com/2004Scape/Server/blob/408c538428f8fb0cd7fd387ebece0a8c9cbcac57/src/3rdparty/bzip2-wasm/bzip2-1.0.8/compress.c#L105-L115", "sha": "408c538428f8fb0cd7fd387ebece0a8c9cbcac57"}200{"repo_name": "Whisper-Finetune", "dataset": "github_2023", "owner": "yeyupiaoling", "lang": "c", "func_name": "ggml_compute_forward_conv_transpose_1d_f16_f32", "code": "static void ggml_compute_forward_conv_transpose_1d_f16_f32(\n        const struct ggml_compute_params * params,\n        const struct ggml_tensor * src0,\n        const struct ggml_tensor * src1,\n              struct ggml_tensor * dst) {\n    GGML_ASSERT(src0->type == GGML_TYPE_F16);\n    GGML_ASSERT(src1->type == GGML_TYPE_F32);\n    GGML_ASSERT( dst->type == GGML_TYPE_F32);\n\n    int64_t t0 = ggml_perf_time_us();\n    UNUSED(t0);\n\n    GGML_TENSOR_BINARY_OP_LOCALS\n\n    const int ith = params->ith;\n    const int nth = params->nth;\n\n    const int nk = ne00*ne01*ne02;\n\n    GGML_ASSERT(nb00 == sizeof(ggml_fp16_t));\n    GGML_ASSERT(nb10 == sizeof(float));\n\n    if (params->type == GGML_TASK_INIT) {\n        memset(params->wdata, 0, params->wsize);\n\n        // permute kernel data (src0) from (K x Cout x Cin) to (Cin x K x Cout)\n        {\n            ggml_fp16_t * const wdata = (ggml_fp16_t *) params->wdata + 0;\n\n            for (int64_t i02 = 0; i02 < ne02; i02++) {\n                for (int64_t i01 = 0; i01 < ne01; i01++) {\n                    const ggml_fp16_t * const src = (ggml_fp16_t *)((char *) src0->data + i02*nb02 + i01*nb01);\n                    ggml_fp16_t * dst_data = wdata + i01*ne00*ne02;\n                    for (int64_t i00 = 0; i00 < ne00; i00++) {\n                        dst_data[i00*ne02 + i02] = src[i00];\n                    }\n                }\n            }\n        }\n\n        // permute source data (src1) from (L x Cin) to (Cin x L)\n        {\n            ggml_fp16_t * const wdata = (ggml_fp16_t *) params->wdata + nk;\n            ggml_fp16_t * dst_data = wdata;\n\n            for (int64_t i11 = 0; i11 < ne11; i11++) {\n                const float * const src = (float *)((char *) src1->data + i11*nb11);\n                for (int64_t i10 = 0; i10 < ne10; i10++) {\n                    dst_data[i10*ne11 + i11] = GGML_FP32_TO_FP16(src[i10]);\n                }\n            }\n        }\n\n        // need to zero dst since we are accumulating into it\n        memset(dst->data, 0, ggml_nbytes(dst));\n\n        return;\n    }\n\n    if (params->type == GGML_TASK_FINALIZE) {\n        return;\n    }\n\n    const int32_t s0 = ((const int32_t*)(dst->op_params))[0];\n\n    // total rows in dst\n    const int nr = ne1;\n\n    // rows per thread\n    const int dr = (nr + nth - 1)/nth;\n\n    // row range for this thread\n    const int ir0 = dr*ith;\n    const int ir1 = MIN(ir0 + dr, nr);\n\n    ggml_fp16_t * const wdata     = (ggml_fp16_t *) params->wdata + 0;\n    ggml_fp16_t * const wdata_src = wdata + nk;\n\n    for (int i1 = ir0; i1 < ir1; i1++) {\n        float * dst_data = (float *)((char *) dst->data + i1*nb1);\n        ggml_fp16_t * wdata_kernel = wdata + i1*ne02*ne00;\n        for (int i10 = 0; i10 < ne10; i10++) {\n            const int i1n = i10*ne11;\n            for (int i00 = 0; i00 < ne00; i00++) {\n                float v = 0;\n                ggml_vec_dot_f16(ne02, &v,\n                        (ggml_fp16_t *)    wdata_src + i1n,\n                        (ggml_fp16_t *) wdata_kernel + i00*ne02);\n                dst_data[i10*s0 + i00] += v;\n            }\n        }\n    }\n}", "docstring": "// ggml_compute_forward_conv_transpose_1d", "url": "https://github.com/yeyupiaoling/Whisper-Finetune/blob/e763980251b3307e6518ba2a352f56192bc1c43b/AndroidDemo/app/src/main/jni/whisper/libwhisper/ggml.c#L11502-L11594", "sha": "e763980251b3307e6518ba2a352f56192bc1c43b"}201{"repo_name": "BugChecker", "dataset": "github_2023", "owner": "vitoplantamura", "lang": "cpp", "func_name": "BenchmarkVector", "code": "void BenchmarkVector()\n{\n\tEASTLTest_Printf(\"Vector\\n\");\n\n\tEA::UnitTest::RandGenT<uint32_t> rng(EA::UnitTest::GetRandSeed());\n\tEA::StdC::Stopwatch              stopwatch1(EA::StdC::Stopwatch::kUnitsCPUCycles);\n\tEA::StdC::Stopwatch              stopwatch2(EA::StdC::Stopwatch::kUnitsCPUCycles);\n\n\t{\n\t\teastl::vector<uint32_t> intVector(100000);\n\t\teastl::generate(intVector.begin(), intVector.end(), rng);\n\n\t\tfor(int i = 0; i < 2; i++)\n\t\t{\n\t\t\tStdVectorUint64 stdVectorUint64;\n\t\t\tEaVectorUint64  eaVectorUint64;\n\n\n\t\t\t///////////////////////////////\n\t\t\t// Test push_back\n\t\t\t///////////////////////////////\n\n\t\t\tTestPushBack(stopwatch1, stdVectorUint64, intVector);\n\t\t\tTestPushBack(stopwatch2, eaVectorUint64,  intVector);\n\n\t\t\tif(i == 1)\n\t\t\t\tBenchmark::AddResult(\"vector<uint64>/push_back\", stopwatch1.GetUnits(), stopwatch1.GetElapsedTime(), stopwatch2.GetElapsedTime());\n\n\n\t\t\t///////////////////////////////\n\t\t\t// Test operator[].\n\t\t\t///////////////////////////////\n\n\t\t\tTestBracket(stopwatch1, stdVectorUint64);\n\t\t\tTestBracket(stopwatch2, eaVectorUint64);\n\n\t\t\tif(i == 1)\n\t\t\t\tBenchmark::AddResult(\"vector<uint64>/operator[]\", stopwatch1.GetUnits(), stopwatch1.GetElapsedTime(), stopwatch2.GetElapsedTime());\n\n\n\t\t\t///////////////////////////////\n\t\t\t// Test iteration via find().\n\t\t\t///////////////////////////////\n\n\t\t\tTestFind(stopwatch1, stdVectorUint64);\n\t\t\tTestFind(stopwatch2, eaVectorUint64);\n\t\t\tTestFind(stopwatch1, stdVectorUint64);\n\t\t\tTestFind(stopwatch2, eaVectorUint64);\n\n\t\t\tif(i == 1)\n\t\t\t\tBenchmark::AddResult(\"vector<uint64>/iteration\", stopwatch1.GetUnits(), stopwatch1.GetElapsedTime(), stopwatch2.GetElapsedTime());\n\n\n\t\t\t///////////////////////////////\n\t\t\t// Test sort\n\t\t\t///////////////////////////////\n\n\t\t\t// Currently VC++ complains about our sort function decrementing std::iterator that is already at begin(). In the strictest sense,\n\t\t\t// that's a valid complaint, but we aren't testing std STL here. We will want to revise our sort function eventually.\n\t\t\t#if !defined(_MSC_VER) || !defined(_ITERATOR_DEBUG_LEVEL) || (_ITERATOR_DEBUG_LEVEL < 2)\n\t\t\t\tTestSort(stopwatch1, stdVectorUint64);\n\t\t\t\tTestSort(stopwatch2, eaVectorUint64);\n\n\t\t\t\tif(i == 1)\n\t\t\t\t\tBenchmark::AddResult(\"vector<uint64>/sort\", stopwatch1.GetUnits(), stopwatch1.GetElapsedTime(), stopwatch2.GetElapsedTime());\n\t\t\t#endif\n\n\t\t\t///////////////////////////////\n\t\t\t// Test insert\n\t\t\t///////////////////////////////\n\n\t\t\tTestInsert(stopwatch1, stdVectorUint64);\n\t\t\tTestInsert(stopwatch2, eaVectorUint64);\n\n\t\t\tif(i == 1)\n\t\t\t\tBenchmark::AddResult(\"vector<uint64>/insert\", stopwatch1.GetUnits(), stopwatch1.GetElapsedTime(), stopwatch2.GetElapsedTime());\n\n\n\t\t\t///////////////////////////////\n\t\t\t// Test erase\n\t\t\t///////////////////////////////\n\n\t\t\tTestErase(stopwatch1, stdVectorUint64);\n\t\t\tTestErase(stopwatch2, eaVectorUint64);\n\n\t\t\tif(i == 1)\n\t\t\t\tBenchmark::AddResult(\"vector<uint64>/erase\", stopwatch1.GetUnits(), stopwatch1.GetElapsedTime(), stopwatch2.GetElapsedTime());\n\n\n\t\t\t///////////////////////////////////////////\n\t\t\t// Test move of MovableType\n\t\t\t// Should be much faster with C++11 move.\n\t\t\t///////////////////////////////////////////\n\n\t\t\tstd::vector<MovableType>   stdVectorMovableType;\n\t\t\teastl::vector<MovableType> eaVectorMovableType;\n\n\t\t\tTestMoveReallocate(stopwatch1, stdVectorMovableType);\n\t\t\tTestMoveReallocate(stopwatch2, eaVectorMovableType);\n\n\t\t\tif(i == 1)\n\t\t\t\tBenchmark::AddResult(\"vector<MovableType>/reallocate\", stopwatch1.GetUnits(), stopwatch1.GetElapsedTime(), stopwatch2.GetElapsedTime());\n\n\n\t\t\tTestMoveErase(stopwatch1, stdVectorMovableType);\n\t\t\tTestMoveErase(stopwatch2, eaVectorMovableType);\n\n\t\t\tif(i == 1)\n\t\t\t\tBenchmark::AddResult(\"vector<MovableType>/erase\", stopwatch1.GetUnits(), stopwatch1.GetElapsedTime(), stopwatch2.GetElapsedTime());\n\n\n\t\t\t///////////////////////////////////////////\n\t\t\t// Test move of AutoRefCount\n\t\t\t// Should be much faster with C++11 move.\n\t\t\t///////////////////////////////////////////\n\n\t\t\tstd::vector<AutoRefCount<RefCounted> >   stdVectorAutoRefCount;\n\t\t\teastl::vector<AutoRefCount<RefCounted> > eaVectorAutoRefCount;\n\n\t\t\tfor(size_t a = 0; a < 2048; a++)\n\t\t\t{\n\t\t\t\tstdVectorAutoRefCount.push_back(AutoRefCount<RefCounted>(new RefCounted));\n\t\t\t\teaVectorAutoRefCount.push_back(AutoRefCount<RefCounted>(new RefCounted));\n\t\t\t}\n\n\t\t\tRefCounted::msAddRefCount  = 0;\n\t\t\tRefCounted::msReleaseCount = 0;\n\t\t\tTestMoveErase(stopwatch1, stdVectorAutoRefCount);\n\t\t\tEASTLTest_Printf(\"vector<AutoRefCount>/erase std counts: %d %d\\n\", RefCounted::msAddRefCount, RefCounted::msReleaseCount);\n\n\t\t\tRefCounted::msAddRefCount  = 0;\n\t\t\tRefCounted::msReleaseCount = 0;\n\t\t\tTestMoveErase(stopwatch2, eaVectorAutoRefCount);\n\t\t\tEASTLTest_Printf(\"vector<AutoRefCount>/erase EA counts: %d %d\\n\", RefCounted::msAddRefCount, RefCounted::msReleaseCount);\n\n\t\t\tif(i == 1)\n\t\t\t\tBenchmark::AddResult(\"vector<AutoRefCount>/erase\", stopwatch1.GetUnits(), stopwatch1.GetElapsedTime(), stopwatch2.GetElapsedTime());\n\t\t}\n\t}\n}", "docstring": "// namespace", "url": "https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/EASTL/benchmark/source/BenchmarkVector.cpp#L301-L440", "sha": "8b81e76efe457b59be3a6e752efd43916ba0cabb"}202{"repo_name": "LeetCode_DailyChallenge_2023", "dataset": "github_2023", "owner": "7oSkaaa", "lang": "cpp", "func_name": "Solution.wordBreak", "code": "bool wordBreak(string s, vector < string >& wordDict) {\n        // Base case: an empty string can always be segmented (as no word is needed).\n        if (s.empty()) return true;\n    \n        // If the result for the current 's' is already computed, return it to avoid recomputation.\n        if (mp.find(s) != mp.end()) return mp[s];\n        \n        // Get the size of the word dictionary to use it in the loop.\n        int n = wordDict.size();\n        \n        // Loop through the words in the dictionary to find a match with the beginning of 's'.\n        for (int i = 0; i < n; i++) {\n            // Check if the current word from the dictionary matches the start of 's'.\n            if (wordDict[i] == s.substr(0, wordDict[i].length())) {\n                // If there is a match, recursively check the rest of the string after removing the matched word.\n                bool check = wordBreak(s.substr(wordDict[i].length()), wordDict);\n                \n                // If the rest of the string can be segmented, update the result for the current 's' to true.\n                if (check)\n                    return mp[s] = true;\n            }\n        }\n        \n        // If no match is found, update the result for the current 's' to false.\n        return mp[s] = false;\n    }", "docstring": "// The wordBreak function takes a string 's' and a vector of strings 'wordDict'.\n// It returns true if the string 's' can be segmented into words from 'wordDict', false otherwise.", "url": "https://github.com/7oSkaaa/LeetCode_DailyChallenge_2023/blob/e00960b9f5cbfaf813572c366e16d4fef5fa6b8d/08- August/04- Word Break/04- Word Break (Ahmed Hossam).cpp#L9-L34", "sha": "e00960b9f5cbfaf813572c366e16d4fef5fa6b8d"}203{"repo_name": "Whisper", "dataset": "github_2023", "owner": "Const-me", "lang": "cpp", "func_name": "MurmurHash3_x86_128", "code": "void MurmurHash3_x86_128( const void* key, const int len,\n\tuint32_t seed, void* out )\n{\n\tconst uint8_t* data = (const uint8_t*)key;\n\tconst int nblocks = len / 16;\n\n\tuint32_t h1 = seed;\n\tuint32_t h2 = seed;\n\tuint32_t h3 = seed;\n\tuint32_t h4 = seed;\n\n\tconst uint32_t c1 = 0x239b961b;\n\tconst uint32_t c2 = 0xab0e9789;\n\tconst uint32_t c3 = 0x38b34ae5;\n\tconst uint32_t c4 = 0xa1e38b93;\n\n\t//----------\n\t// body\n\n\tconst uint32_t* blocks = (const uint32_t*)( data + nblocks * 16 );\n\n\tfor( int i = -nblocks; i; i++ )\n\t{\n\t\tuint32_t k1 = getblock32( blocks, i * 4 + 0 );\n\t\tuint32_t k2 = getblock32( blocks, i * 4 + 1 );\n\t\tuint32_t k3 = getblock32( blocks, i * 4 + 2 );\n\t\tuint32_t k4 = getblock32( blocks, i * 4 + 3 );\n\n\t\tk1 *= c1; k1 = ROTL32( k1, 15 ); k1 *= c2; h1 ^= k1;\n\n\t\th1 = ROTL32( h1, 19 ); h1 += h2; h1 = h1 * 5 + 0x561ccd1b;\n\n\t\tk2 *= c2; k2 = ROTL32( k2, 16 ); k2 *= c3; h2 ^= k2;\n\n\t\th2 = ROTL32( h2, 17 ); h2 += h3; h2 = h2 * 5 + 0x0bcaa747;\n\n\t\tk3 *= c3; k3 = ROTL32( k3, 17 ); k3 *= c4; h3 ^= k3;\n\n\t\th3 = ROTL32( h3, 15 ); h3 += h4; h3 = h3 * 5 + 0x96cd1c35;\n\n\t\tk4 *= c4; k4 = ROTL32( k4, 18 ); k4 *= c1; h4 ^= k4;\n\n\t\th4 = ROTL32( h4, 13 ); h4 += h1; h4 = h4 * 5 + 0x32ac3b17;\n\t}\n\n\t//----------\n\t// tail\n\n\tconst uint8_t* tail = (const uint8_t*)( data + nblocks * 16 );\n\n\tuint32_t k1 = 0;\n\tuint32_t k2 = 0;\n\tuint32_t k3 = 0;\n\tuint32_t k4 = 0;\n\n\tswitch( len & 15 )\n\t{\n\tcase 15: k4 ^= tail[ 14 ] << 16;\n\tcase 14: k4 ^= tail[ 13 ] << 8;\n\tcase 13: k4 ^= tail[ 12 ] << 0;\n\t\tk4 *= c4; k4 = ROTL32( k4, 18 ); k4 *= c1; h4 ^= k4;\n\n\tcase 12: k3 ^= tail[ 11 ] << 24;\n\tcase 11: k3 ^= tail[ 10 ] << 16;\n\tcase 10: k3 ^= tail[ 9 ] << 8;\n\tcase  9: k3 ^= tail[ 8 ] << 0;\n\t\tk3 *= c3; k3 = ROTL32( k3, 17 ); k3 *= c4; h3 ^= k3;\n\n\tcase  8: k2 ^= tail[ 7 ] << 24;\n\tcase  7: k2 ^= tail[ 6 ] << 16;\n\tcase  6: k2 ^= tail[ 5 ] << 8;\n\tcase  5: k2 ^= tail[ 4 ] << 0;\n\t\tk2 *= c2; k2 = ROTL32( k2, 16 ); k2 *= c3; h2 ^= k2;\n\n\tcase  4: k1 ^= tail[ 3 ] << 24;\n\tcase  3: k1 ^= tail[ 2 ] << 16;\n\tcase  2: k1 ^= tail[ 1 ] << 8;\n\tcase  1: k1 ^= tail[ 0 ] << 0;\n\t\tk1 *= c1; k1 = ROTL32( k1, 15 ); k1 *= c2; h1 ^= k1;\n\t};\n\n\t//----------\n\t// finalization\n\n\th1 ^= len; h2 ^= len; h3 ^= len; h4 ^= len;\n\n\th1 += h2; h1 += h3; h1 += h4;\n\th2 += h1; h3 += h1; h4 += h1;\n\n\th1 = fmix32( h1 );\n\th2 = fmix32( h2 );\n\th3 = fmix32( h3 );\n\th4 = fmix32( h4 );\n\n\th1 += h2; h1 += h3; h1 += h4;\n\th2 += h1; h3 += h1; h4 += h1;\n\n\t( (uint32_t*)out )[ 0 ] = h1;\n\t( (uint32_t*)out )[ 1 ] = h2;\n\t( (uint32_t*)out )[ 2 ] = h3;\n\t( (uint32_t*)out )[ 3 ] = h4;\n}", "docstring": "//-----------------------------------------------------------------------------", "url": "https://github.com/Const-me/Whisper/blob/306aadd1fce4b168cd38659236f4ba7c1603cebd/Whisper/Utils/MurmurHash3.cpp#L150-L251", "sha": "306aadd1fce4b168cd38659236f4ba7c1603cebd"}204{"repo_name": "BetterRenderDragon", "dataset": "github_2023", "owner": "ddf8196", "lang": "cpp", "func_name": "ImGui_ImplWin32_VirtualKeyToImGuiKey", "code": "static ImGuiKey ImGui_ImplWin32_VirtualKeyToImGuiKey(WPARAM wParam)\n{\n    switch (wParam)\n    {\n        case VK_TAB: return ImGuiKey_Tab;\n        case VK_LEFT: return ImGuiKey_LeftArrow;\n        case VK_RIGHT: return ImGuiKey_RightArrow;\n        case VK_UP: return ImGuiKey_UpArrow;\n        case VK_DOWN: return ImGuiKey_DownArrow;\n        case VK_PRIOR: return ImGuiKey_PageUp;\n        case VK_NEXT: return ImGuiKey_PageDown;\n        case VK_HOME: return ImGuiKey_Home;\n        case VK_END: return ImGuiKey_End;\n        case VK_INSERT: return ImGuiKey_Insert;\n        case VK_DELETE: return ImGuiKey_Delete;\n        case VK_BACK: return ImGuiKey_Backspace;\n        case VK_SPACE: return ImGuiKey_Space;\n        case VK_RETURN: return ImGuiKey_Enter;\n        case VK_ESCAPE: return ImGuiKey_Escape;\n        case VK_OEM_7: return ImGuiKey_Apostrophe;\n        case VK_OEM_COMMA: return ImGuiKey_Comma;\n        case VK_OEM_MINUS: return ImGuiKey_Minus;\n        case VK_OEM_PERIOD: return ImGuiKey_Period;\n        case VK_OEM_2: return ImGuiKey_Slash;\n        case VK_OEM_1: return ImGuiKey_Semicolon;\n        case VK_OEM_PLUS: return ImGuiKey_Equal;\n        case VK_OEM_4: return ImGuiKey_LeftBracket;\n        case VK_OEM_5: return ImGuiKey_Backslash;\n        case VK_OEM_6: return ImGuiKey_RightBracket;\n        case VK_OEM_3: return ImGuiKey_GraveAccent;\n        case VK_CAPITAL: return ImGuiKey_CapsLock;\n        case VK_SCROLL: return ImGuiKey_ScrollLock;\n        case VK_NUMLOCK: return ImGuiKey_NumLock;\n        case VK_SNAPSHOT: return ImGuiKey_PrintScreen;\n        case VK_PAUSE: return ImGuiKey_Pause;\n        case VK_NUMPAD0: return ImGuiKey_Keypad0;\n        case VK_NUMPAD1: return ImGuiKey_Keypad1;\n        case VK_NUMPAD2: return ImGuiKey_Keypad2;\n        case VK_NUMPAD3: return ImGuiKey_Keypad3;\n        case VK_NUMPAD4: return ImGuiKey_Keypad4;\n        case VK_NUMPAD5: return ImGuiKey_Keypad5;\n        case VK_NUMPAD6: return ImGuiKey_Keypad6;\n        case VK_NUMPAD7: return ImGuiKey_Keypad7;\n        case VK_NUMPAD8: return ImGuiKey_Keypad8;\n        case VK_NUMPAD9: return ImGuiKey_Keypad9;\n        case VK_DECIMAL: return ImGuiKey_KeypadDecimal;\n        case VK_DIVIDE: return ImGuiKey_KeypadDivide;\n        case VK_MULTIPLY: return ImGuiKey_KeypadMultiply;\n        case VK_SUBTRACT: return ImGuiKey_KeypadSubtract;\n        case VK_ADD: return ImGuiKey_KeypadAdd;\n        case IM_VK_KEYPAD_ENTER: return ImGuiKey_KeypadEnter;\n        case VK_LSHIFT: return ImGuiKey_LeftShift;\n        case VK_LCONTROL: return ImGuiKey_LeftCtrl;\n        case VK_LMENU: return ImGuiKey_LeftAlt;\n        case VK_LWIN: return ImGuiKey_LeftSuper;\n        case VK_RSHIFT: return ImGuiKey_RightShift;\n        case VK_RCONTROL: return ImGuiKey_RightCtrl;\n        case VK_RMENU: return ImGuiKey_RightAlt;\n        case VK_RWIN: return ImGuiKey_RightSuper;\n        case VK_APPS: return ImGuiKey_Menu;\n        case '0': return ImGuiKey_0;\n        case '1': return ImGuiKey_1;\n        case '2': return ImGuiKey_2;\n        case '3': return ImGuiKey_3;\n        case '4': return ImGuiKey_4;\n        case '5': return ImGuiKey_5;\n        case '6': return ImGuiKey_6;\n        case '7': return ImGuiKey_7;\n        case '8': return ImGuiKey_8;\n        case '9': return ImGuiKey_9;\n        case 'A': return ImGuiKey_A;\n        case 'B': return ImGuiKey_B;\n        case 'C': return ImGuiKey_C;\n        case 'D': return ImGuiKey_D;\n        case 'E': return ImGuiKey_E;\n        case 'F': return ImGuiKey_F;\n        case 'G': return ImGuiKey_G;\n        case 'H': return ImGuiKey_H;\n        case 'I': return ImGuiKey_I;\n        case 'J': return ImGuiKey_J;\n        case 'K': return ImGuiKey_K;\n        case 'L': return ImGuiKey_L;\n        case 'M': return ImGuiKey_M;\n        case 'N': return ImGuiKey_N;\n        case 'O': return ImGuiKey_O;\n        case 'P': return ImGuiKey_P;\n        case 'Q': return ImGuiKey_Q;\n        case 'R': return ImGuiKey_R;\n        case 'S': return ImGuiKey_S;\n        case 'T': return ImGuiKey_T;\n        case 'U': return ImGuiKey_U;\n        case 'V': return ImGuiKey_V;\n        case 'W': return ImGuiKey_W;\n        case 'X': return ImGuiKey_X;\n        case 'Y': return ImGuiKey_Y;\n        case 'Z': return ImGuiKey_Z;\n        case VK_F1: return ImGuiKey_F1;\n        case VK_F2: return ImGuiKey_F2;\n        case VK_F3: return ImGuiKey_F3;\n        case VK_F4: return ImGuiKey_F4;\n        case VK_F5: return ImGuiKey_F5;\n        case VK_F6: return ImGuiKey_F6;\n        case VK_F7: return ImGuiKey_F7;\n        case VK_F8: return ImGuiKey_F8;\n        case VK_F9: return ImGuiKey_F9;\n        case VK_F10: return ImGuiKey_F10;\n        case VK_F11: return ImGuiKey_F11;\n        case VK_F12: return ImGuiKey_F12;\n        default: return ImGuiKey_None;\n    }\n}", "docstring": "// Map VK_xxx to ImGuiKey_xxx.", "url": "https://github.com/ddf8196/BetterRenderDragon/blob/fc4e663813e778365657a8a8aa7ad3f7c6559016/include/imgui/backends/imgui_impl_win32.cpp#L393-L503", "sha": "fc4e663813e778365657a8a8aa7ad3f7c6559016"}205{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "MouseCursor::updateMouseClipping", "code": "void MouseCursor::staticSetFocus( bool focus )\n{\n\tBW_GUARD;\n\tif ( !focus )\n\t{\n\t\tclipCursorToWindow( false );\n\t}\n}", "docstring": "/**\n *\tInforms the MouseCursor class about changes in the \n *\tapplication focus state. This function is called even\n *\twhen the mcursor is not the active InputCursor so that\n *\twe can do low-level house keeping chores related to the \n *\tmouse.\n *\n *\t@param\tfocus\t\tnew application focus state.\n */\n/* static */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/lib/ashes/mouse_cursor.cpp", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}206{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "SimpleGUI::hwnd", "code": "void SimpleGUI::hwnd( void * h )\n{\n\thwnd_ = h;\n}", "docstring": "/**\n *\tThis method sets the HWND for the main application window.\n *\tSimpleGUI needs this only if the mouse cursor is to be used.\n *\n *\t@param h\tThe HWND for the application\n */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/lib/ashes/simple_gui.cpp#L370-L373", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}207{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "SimpleGUIComponent::handleDropEvent", "code": "bool SimpleGUIComponent::handleDropEvent( SimpleGUIComponent * dragged, \n\t\tconst KeyEvent & event )\n{\n\tBW_GUARD;\n\treturn this->invokeMouseEventHandler( \n\t\tthis->pScriptObject_.getObject(), \n\t\t\"handleDropEvent\", event.cursorPosition(), dragged, \n\t\t\"SimpleGUIComponent::handleDropEvent: \",\n\t\t\"EventsSimpleGUIComponent handleDropEvent retval\" );\n}", "docstring": "/*~ function SimpleGUIComponent.handleDropEvent\n *\t@components{ client, tools }\n *\n *\tThis event handler is triggered a dragged component is dropped overa drop \n *\taccepting component. To have this handler triggered, a component must have \n *\tdropFocus enabled.\n *\n *\t@param\tcomponent\tThe drop target component.\n *\t@param\tposition\tmouse position, 2-tuple (x, y).\n *\t@param\tdropped\t\tThe dragged component being dropped.\n *\n *\t@return\tthe return value is always ignored. \n */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/lib/ashes/simple_gui_component.cpp#L4220-L4229", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}208{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "ChunkItemBase::addBorrower", "code": "void ChunkItemBase::addBorrower( Chunk* pChunk )\n{\n\tborrowers_.insert( pChunk );\n\n#if UMBRA_ENABLE\n\tif (pUmbraDrawItem_)\n\t{\n\t\tif (this->chunk()->getUmbraCell() == NULL &&\n\t\t\tpChunk->getUmbraCell() != NULL)\n\t\t{\n\t\t\tpUmbraDrawItem_->updateCell( pChunk->getUmbraCell() );\n\t\t}\n\t}\n#endif // UMBRA_ENABLE\n}", "docstring": "// MF_SERVER\n/**\n *\tThis method adds a chunk as a borrower of this item\n *\twhat this means is that the ChunkItem overlaps this chunk\n *\tas well, which means we need to render as part of this chunk\n *\tif it exists in a different umbra cell to our own cell\n *\t@param pChunk the chunk that is borrowing us\n */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/lib/chunk/chunk_item.cpp#L283-L297", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}209{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "UmbraChunkItem::init", "code": "void UmbraChunkItem::init( ChunkItem* pItem, UmbraObjectProxyPtr pObject, const Matrix& transform, Umbra::OB::Cell* pCell )\n{\n\tpItem_ = pItem;\n\n\tpObject_ = pObject;\n\tpObject_->object()->setCell( pCell );\n\tpObject_->object()->setObjectToCellMatrix( (const Umbra::Matrix4x4&)transform );\n\tpObject_->object()->setUserPointer( (void*)this );\n\tpObject_->object()->setBitmask( ChunkUmbra::SCENE_OBJECT );\n}", "docstring": "/**\n *\tThis method inits the UmbraChunkItem\n *\tIt uses the passed in umbra object\n *\t@param pItem the chunk item to use\n *\t@param pObject the umbra ubject to use\n *\t@param transform the transform of the bounding box\n *\t@param pCell the umbra cell to place this item in\n */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/lib/chunk/umbra_chunk_item.cpp#L158-L167", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}210{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "AssetList::empty", "code": "bool AssetList::empty() const\n{\n\treturn entries_.empty();\n}", "docstring": "// ----------------------------------------------------------------------------", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/lib/compiled_space/asset_list.cpp#L138-L141", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}211{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "BinaryFormat::BinaryFormat", "code": "BinaryFormat::BinaryFormat() : \n\tpHeader_(NULL),\n\tpSectionHeaders_(NULL)\n{\n\tmemset( &mappedSections_, 0, sizeof(mappedSections_) );\n}", "docstring": "// ----------------------------------------------------------------------------\n// ----------------------------------------------------------------------------", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/lib/compiled_space/binary_format.cpp#L142-L147", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}212{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "ParticleSystemWriter::addFromChunkParticles", "code": "void ParticleSystemWriter::addFromChunkParticles(\n\tconst DataSectionPtr& pDS,\n\tconst Matrix& chunkTransform,\n\tStringTableWriter& stringTable,\n\tAssetListWriter& assetList )\n{\n\tBW::string resourceID = pDS->readString( \"resource\" );\n\tif (resourceID.empty())\n\t{\n\t\treturn;\n\t}\n\n\tif (resourceID.find( '/' ) == BW::string::npos)\n\t{\n\t\tresourceID = \"particles/\" + resourceID;\n\t}\n\n\tDataSectionPtr resourceDS = BWResource::openSection( resourceID );\n\tif (!resourceDS)\n\t{\n\t\treturn;\n\t}\n\n\t// ok, we're committed to loading now.\n\tParticleSystemTypes::ParticleSystem data;\n\tmemset( &data, 0, sizeof(data) );\n\n\tdata.resourceID_ = assetList.addAsset(\n\t\tCompiledSpace::AssetListTypes::ASSET_TYPE_DATASECTION,\n\t\tresourceID, stringTable );\n\tdata.seedTime_ = resourceDS->readFloat( \"seedTime\", 0.1f );\n\tbool isReflectionVisible = pDS->readBool( \"reflectionVisible\",\n\t\tfalse );\n\n\tif (isReflectionVisible)\n\t{\n\t\tdata.flags_ |= ParticleSystemTypes::FLAG_REFLECTION_VISIBLE;\n\t}\n\n\t// Transform\n\tdata.worldTransform_ = chunkTransform;\n\tdata.worldTransform_.preMultiply(\n\t\tpDS->readMatrix34( \"transform\", Matrix::identity ) );\n\n\tsystemData_.push_back( data );\n}", "docstring": "// ----------------------------------------------------------------------------", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/lib/compiled_space/binary_writers/particle_system_writer.cpp#L71-L116", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}213{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "ReplayController::handleFinal", "code": "void ReplayController::handleFinal()\n{\n\thandler_.onReplayControllerFinish( *this );\n}", "docstring": "/**\n *\tThis method handles the 'finish' replay message, indicating end of replay.\n */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/lib/connection/replay_controller.cpp#L1384-L1387", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}214{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "Profiler::setNewHistory", "code": "bool Profiler::setNewHistory( const char * historyFileName, \n\t\t\t\t\t\t\tconst char * threadName, BW::string * msgString)\n{\n\tBW_GUARD;\n\tthis->setProfileMode( SORT_BY_NAME, false );\n\n\treturn csvOutputTask_->setNewHistory( historyFileName,\n\t\tthreadName, msgString );\n}", "docstring": "/**\n *\tSet up a new file for CSV profiling output.\n */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/lib/cstdmf/profiler.cpp#L2204-L2212", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}215{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "queueWrites", "code": "void queueWrites()\n\t{\n\t\tfor (uint32 i = 1; i <= max_; ++i)\n\t\t{\n\t\t\tpWriter_->queueWriteBlob( (const char *)&i, sizeof( i ), i );\n\t\t}\n\t}", "docstring": "/**\n\t *\tThis method queues the writes necessary to write out the integers.\n\t */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/lib/cstdmf/unit_test/test_background_file_writer.cpp#L194-L200", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}216{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "PyModel::pySet_motors", "code": "int PyModel::pySet_motors( PyObject * value )\n{\n\tBW_GUARD;\n\t// first check arguments...\n\tif (!PySequence_Check( value ))\n\t{\n\t\tPyErr_SetString( PyExc_TypeError,\n\t\t\t\"Model.motors must be set to a sequence of Motors\" );\n\t\treturn -1;\n\t}\n\n\t// ... thoroughly\n\tbool bad = false;\n\tfor (int i = 0; i < PySequence_Size( value ) && !bad; i++)\n\t{\n\t\tPyObject * pTry = PySequence_GetItem( value, i );\n\n\t\tif (!Motor::Check( pTry ))\n\t\t{\n\t\t\tPyErr_Format( PyExc_TypeError, \"Element %d of sequence replacing \"\n\t\t\t\t\" Model.motors is not a Motor\", i );\n\t\t\tbad = true;\n\t\t}\n\t\telse if (((Motor*)pTry)->pOwner() != NULL)\n\t\t{\n\t\t\tPyErr_Format( PyExc_ValueError, \"Element %d of sequence replacing \"\n\t\t\t\t\"Model.motors is already attached to a Model\", i );\n\t\t\tbad = true;\n\t\t}\n\n\t\tPy_DECREF( pTry );\n\t}\n\tif (bad) return -1;\n\n\n\t// let old motors go\n\tfor (uint i = 0; i < motors_.size(); i++)\n\t{\n\t\tmotors_[i]->detach();\n\t\tPy_DECREF( motors_[i] );\n\t}\n\tmotors_.clear();\n\n\t// fit new ones\n\tfor (int i = 0; i < PySequence_Size( value ) && !bad; i++)\n\t{\n\t\tMotor * pMotor = (Motor*)PySequence_GetItem( value, i );\n\n\t\tpMotor->attach( this );\n\t\tmotors_.push_back( pMotor );\n\t\t// We keep the reference returned by PySequence_GetItem.\n\t}\n\n\treturn 0;\n}", "docstring": "/**\n *\tSet the sequence of motors\n */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/lib/duplo/pymodel.cpp#L2247-L2301", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}217{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "FixedDictDataType::getDefaultValue", "code": "bool FixedDictDataType::getDefaultValue( DataSink & output ) const\n{\n#if defined( SCRIPT_PYTHON )\n\tconst_cast<FixedDictDataType*>(this)->initCustomClassImplOnDemand();\n#endif\n\n\tif (pDefaultSection_)\n\t{\n\t\treturn this->createFromSection( pDefaultSection_, output );\n\t}\n\telse if (allowNone_)\n\t{\n\t\treturn output.writeNone( /* isNone */ true );\n\t}\n\n\t// TODO: Better than this.\n\tScriptObject pDefault = this->createDefaultInstance();\n#if defined( SCRIPT_PYTHON )\n\tif (this->hasCustomClass())\n\t\tpDefault = this->createCustomClassFromInstance(\n\t\t\tstatic_cast<PyFixedDictDataInstance*>(pDefault.get()) );\n#endif\n\n\t// Eww...\n\tScriptDataSink & scriptOutput = static_cast< ScriptDataSink & >( output );\n\treturn scriptOutput.write( pDefault );\n}", "docstring": "/**\n *\tOverrides the DataType method.\n *\n *\t@see DataType::getDefaultValue\n */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/lib/entitydef/data_types/fixed_dict_data_type.cpp#L726-L752", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}218{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "FixedDictDataType::attach", "code": "ScriptObject FixedDictDataType::attach( ScriptObject pObject,\n\tPropertyOwnerBase * pOwner, int ownerRef )\n{\n#if defined( SCRIPT_PYTHON )\n\t// if it's None and that's ok, just return that\n\tif (allowNone_ && pObject.isNone())\n\t{\n\t\treturn ScriptObject::none();\n\t}\n\n\tinitCustomClassImplOnDemand();\n\n\tif (this->hasCustomClass())\n\t{\n\t\t// First part of isSameType() check\n\t\tif (this->hasCustomIsSameType() && !this->isSameTypeCustom( pObject ))\n\t\t{\n\t\t\tERROR_MSG( \"FixedDictDataType::attach: \"\n\t\t\t\t\t\"Trying to attach an invalid custom type\\n\" );\n\t\t\treturn ScriptObject();\n\t\t}\n\n\t\t// See if they are referencing our PyFixedDictDataInstance\n\t\tScriptObject pDict = this->getDictFromCustomClass( pObject );\n\n\t\t// Second part of isSameType() check\n\t\tif (PyFixedDictDataInstance::isSameType( pDict, *this ))\n\t\t{\n\t\t\t// Yay! isSameType() == true\n\t\t\tPyFixedDictDataInstancePtr pInst( pDict );\n\t\t\tif (pInst->hasOwner())\n\t\t\t{\n\t\t\t\t// Create copy\n\t\t\t\tpInst = PyFixedDictDataInstancePtr(\n\t\t\t\t\tnew PyFixedDictDataInstance( this, *pInst ),\n\t\t\t\t\tPyFixedDictDataInstancePtr::FROM_NEW_REFERENCE );\n\t\t\t\tpInst->setOwner( pOwner, ownerRef );\n\t\t\t\treturn this->createCustomClassFromInstance( pInst.get() );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tpInst->setOwner( pOwner, ownerRef );\n\t\t\t\treturn pObject;\n\t\t\t}\n\t\t}\n\t\telse\t// not referencing PyFixedDictDataInstance\n\t\t{\n\t\t\t// Third part of isSameType() check, for custom class without\n\t\t\t// isSameType() method and doesn't reference PyFixedDictDataInstance\n\t\t\tif (this->hasCustomIsSameType() ||\n\t\t\t\tthis->createInstanceFromMappingObj( pDict ))\n\t\t\t{\n\t\t\t\treturn pObject;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn ScriptObject();\n\t\t\t}\n\t\t}\n\t}\n\n\tPyFixedDictDataInstancePtr pInst;\n\n\t// it's easy if it's the right python + entitydef type\n\tif (PyFixedDictDataInstance::isSameType( pObject, *this ))\n\t{\n\t\tpInst = pObject;\n\t\tif (pInst->hasOwner())\n\t\t{\n\t\t\t// Create copy\n\t\t\tpInst = PyFixedDictDataInstancePtr(\n\t\t\t\tnew PyFixedDictDataInstance( this, *pInst ),\n\t\t\t\tPyFixedDictDataInstancePtr::FROM_NEW_REFERENCE );\n\t\t\t// note: up to caller to check that prop isn't being set back\n\t\t}\n\t}\n\telse\n\t{\n\t\tpInst = this->createInstanceFromMappingObj( pObject );\n\t}\n\n\tif (pInst)\n\t{\n\t\tpInst->setOwner( pOwner, ownerRef );\n\t}\n\n\treturn pInst;\n#else\n\treturn pObject;\n#endif\n}", "docstring": "/**\n *\tOverrides the DataType method.\n *\n *\t@see DataType::attach\n */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/lib/entitydef/data_types/fixed_dict_data_type.cpp#L1016-L1106", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}219{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "GizmoManager::click", "code": "bool GizmoManager::click()\n{\n\tBW_GUARD;\n\n\tif (intersectedGizmo_.hasObject())\n\t{\n\t\tintersectedGizmo_->click(lastWorldOrigin_, lastWorldRay_);\n\t\treturn true;\n\t}\n\treturn false;\n}", "docstring": "/**\n * This method should be called when the user clicks on a gizmo\n */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/lib/gizmo/gizmo_manager.cpp#L261-L271", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}220{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "OmniLight::OmniLight", "code": "OmniLight::OmniLight( const D3DXCOLOR& colour, const Vector3& position, float innerRadius, float outerRadius )\n: position_( position ),\n  innerRadius_( innerRadius ),\n  outerRadius_( outerRadius ),\n  colour_( (const Colour&)colour ),\n  priority_( 0 )\n#ifdef EDITOR_ENABLED\n  ,multiplier_(1.f)\n#endif\n{\n\t// give the worldTransformed attributes default values.\n\tworldPosition_ = position;\n\tworldInnerRadius_= innerRadius;\n\tworldOuterRadius_= outerRadius;\n}", "docstring": "/**\n *\tConstructor\n */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/lib/moo/omni_light.cpp#L37-L51", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}221{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "DynamicShadow::recreateForD3DExDevice", "code": "bool DynamicShadow::recreateForD3DExDevice() const\n    {\n        return true;\n    }", "docstring": "//----------------------------------------------------------------------------------------------", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/lib/moo/dynamic_shadow.cpp#L1496-L1499", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}222{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "HTTPHeaders::Impl::parseHeaderValue", "code": "bool HTTPHeaders::Impl::parseHeaderValue( const char ** pByteData, \n\t\tsize_t length, BW::string & headerValue )\n{\n\tconst char * byteData = *pByteData;\n\tconst char * cursor = byteData;\n\n\tconst char * headerValueChunkStart = cursor;\n\tBW::ostringstream headerValueStream;\n\tbool leadingLWS = true;\n\twhile (cursor < (byteData + length) &&\n\t\t\t!HTTPUtil::isCRLF( cursor ))\n\t{\n\t\tif (HTTPUtil::isLinearWhitespace( cursor,\n\t\t\t\tlength - (cursor - byteData) ))\n\t\t{\n\t\t\tif (!leadingLWS)\n\t\t\t{\n\t\t\t\t// Replace any non-leading LWS with a single space, as per\n\t\t\t\t// RFC2616 section 4.2.\n\t\t\t\theaderValueStream.write( headerValueChunkStart,\n\t\t\t\t\tcursor - headerValueChunkStart );\n\t\t\t\theaderValueStream.put( ' ' );\n\t\t\t}\n\n\t\t\tif (!HTTPUtil::skipLinearWhitespace( &cursor,\n\t\t\t\t\tlength - (cursor - byteData) ))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\theaderValueChunkStart = cursor;\n\t\t}\n\t\telse if (*cursor == '\"')\n\t\t{\n\t\t\tBW::string quotedString;\n\t\t\tif (!HTTPUtil::parseQuotedString( &cursor,\n\t\t\t\t\tlength - (cursor - byteData ), quotedString ))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\theaderValueStream << quotedString;\n\t\t\theaderValueChunkStart = cursor;\n\t\t}\n\t\telse if (HTTPUtil::isControlCharacter( *cursor ))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t++cursor;\n\t\t}\n\t\tleadingLWS = false;\n\t}\n\n\n\tif (cursor >= (byteData + length))\n\t{\n\t\treturn false;\n\t}\n\n\theaderValueStream.write( headerValueChunkStart,\n\t\tcursor - headerValueChunkStart );\n\n\theaderValueStream.str().swap( headerValue );\n\n\t*pByteData = cursor + 2;\n\treturn true;\n}", "docstring": "/**\n *\tThis method parses the header field value.\n *\n *\tAny non-leading linear whitespace will be replaced by a single space, as\n *\tper RFC2616. Leading linear whitespace will be ignored.\n *\n *\t@param pByteData \tThe byte pointer, moved on success to past the end of\n *\t\t\t\t\t\tthe terminating CRLF.\n *\t@param length \t\tThe length of the byte data.\n *\t@pawram headerValue The output parsed header value.\n *\n *\t@return \t\t\tTrue on success, false otherwise.\n */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/lib/network/http_messages.cpp#L699-L767", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}223{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "operator delete", "code": "void operator delete( void * ptr )\n\t\t{ bw_free( ptr ); }", "docstring": "/**\n\t *\tThe overloaded delete operator to free the memory using the same\n\t *\tmalloc/free methods\n\t */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/lib/network/logger_endpoint.cpp#L161-L162", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}224{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "TCPChannel::writeFrom", "code": "bool TCPChannel::writeFrom( BinaryIStream & input, bool shouldCork )\n{\n\tint numToSend = input.remainingLength();\n\n\tif (pSendBuffer_)\n\t{\n\t\t// We're already waiting for the socket to become available for\n\t\t// writing, add it to the end.\n\t\tpSendBuffer_->transfer( input, numToSend );\n\t\treturn true;\n\t}\n\n\tint sendResult = this->basicSend( input.retrieve( 0 ), numToSend,\n\t\tshouldCork );\n\n\tif ((sendResult == -1) && !isErrnoIgnorable())\n\t{\n\t\tNOTICE_MSG( \"TCPChannel::writeFrom( %s ): \"\n\t\t\t\t\"Write error, destroying; error: %s\\n\",\n\t\t\tthis->c_str(), lastNetworkError() );\n\n\t\tinput.finish();\n\n\t\tthis->destroy();\n\t\treturn false;\n\t}\n\telse if (sendResult == -1)\n\t{\n\t\tsendResult = 0;\n\t}\n\n\tinput.retrieve( sendResult );\n\n\tif (sendResult < numToSend)\n\t{\n\t\t// Got short count when sending. Add the rest to the send buffer,\n\t\t// creating it and registering the socket for write events if\n\t\t// necessary.\n\n\t\tconst uint8 * leftOverData =\n\t\t\treinterpret_cast< const uint8 * >( input.retrieve(\n\t\t\t\tnumToSend - sendResult ) );\n\n\t\tif (!pSendBuffer_)\n\t\t{\n\t\t\tpSendBuffer_ = new MemoryOStream( this->maxSegmentSize() );\n\n\t\t\tthis->dispatcher().registerWriteFileDescriptor(\n\t\t\t\tpEndpoint_->fileno(),\n\t\t\t\tpSendWaiter_,\n\t\t\t\t\"TCPChannel\" );\n\t\t}\n\n\t\tpSendBuffer_->addBlob( leftOverData, numToSend - sendResult );\n\t}\n\n\treturn true;\n}", "docstring": "/**\n *\tThis method writes the given input data to the channel.\n *\n *\t@param input \t\tThe input data stream.\n *\t@param shouldCork \tWhether we should send any corked data and this data\n *\t\t\t\t\t\tnow, or cork the data for sending later.\n */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/lib/network/tcp_channel.cpp#L707-L764", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}225{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "swap", "code": "void swap( UDPBundleProcessor::iterator & a, UDPBundleProcessor::iterator & b )\n{\n\tusing std::swap;\n\n\tswap( a.cursor_, b.cursor_ );\n\tswap( a.isUnpacked_, b.isUnpacked_ );\n\tswap( a.bodyEndOffset_, b.bodyEndOffset_ );\n\tswap( a.offset_, b.offset_ );\n\tswap( a.dataOffset_, b.dataOffset_ );\n\tswap( a.dataLength_, b.dataLength_ );\n\tswap( a.dataBuffer_, b.dataBuffer_ );\n\tswap( a.nextRequestOffset_, b.nextRequestOffset_ );\n\tswap( a.curHeader_, b.curHeader_ );\n\tswap( a.updatedIE_, b.updatedIE_ );\n}", "docstring": "/**\n * This function swaps the iterators.\n */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/lib/network/udp_bundle_processor.cpp#L623-L637", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}226{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "SplatPSA::lateExecute", "code": "void SplatPSA::lateExecute( ParticleSystem &particleSystem, float dTime )\n{\n\tBW_GUARD_PROFILER( SplatPSA_execute );\n\n\tconst SourcePSA * pSource = static_cast< const SourcePSA * >(\n\t\t&*particleSystem.pAction( PSA_SOURCE_TYPE_ID ) );\n\n\tif (!pSource)\n\t{\n\t\treturn;\n\t}\n\n\tconst RompColliderPtr pGS = pSource->groundSpecifier();\n\tif (!pGS)\n\t{\n\t\treturn;\n\t}\n\n\tuint64 tend = timestamp() + stampsPerSecond() / 2000;\n\n\tParticles::iterator it = particleSystem.begin();\n\tParticles::iterator end = particleSystem.end();\n\n\tWorldTriangle tri;\n\n\t//bust out of the loop if we take more than 0.5 msec\n\twhile (it != particleSystem.end() && timestamp() < tend)\n\t{\n\t\tParticle & particle = *it;\n\n\t\tif (!particle.isAlive())\n\t\t{\t\t\n\t\t\tcontinue;\n\t\t}\n\n\t\t//note - particles get moved after actions.\n\t\tVector3 velocity;\n\t\tparticle.getVelocity( velocity );\n\t\tVector3 newPos;\n\t\tparticleSystem.predictPosition( particle, dTime, newPos );\n\t\tfloat tValue = pGS->collide( particle.position(), newPos, tri );\n\t\tif (tValue >= 0.f && tValue <= 1.f)\n\t\t{\n#ifndef EDITOR_ENABLED\n\t\t\ttri.bounce( velocity, 1.f );\n\t\t\tparticle.setVelocity( velocity );\n\n\t\t\tif ( callback_ )\n\t\t\t{\n\t\t\t\tPyObject * pFn = PyObject_GetAttrString(\n\t\t\t\t\t&*callback_, \"onSplat\" );\n\t\t\t\tPyObject * pTuple = PyTuple_New( 3 );\n\t\t\t\tVector3 collidePos( particle.position() * tValue );\n\t\t\t\tcollidePos += (newPos * (1.f - tValue));\n\t\t\t\tPyTuple_SetItem( pTuple, 0, Script::getData( collidePos ) );\n\n\t\t\t\tVector3 velocity;\n\t\t\t\tparticle.getVelocity( velocity );\n\t\t\t\tPyTuple_SetItem( pTuple, 1, Script::getData( velocity ) );\n\n\t\t\t\tPyTuple_SetItem( pTuple, 2, Script::getData( \n\t\t\t\t\tColour::getVector4Normalised( particle.colour() ) ) );\n\t\t\t\tScript::callNextFrame( pFn, pTuple, \"SplatPSA::execute\" );\n\t\t\t}\n#endif\n\t\t\tit = particleSystem.removeParticle( it );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t++it;\n\t\t}\n\t}\n}", "docstring": "/**\n *\tThis method executes the action for the given frame of time. The dTime\n *\tparameter is the time elapsed since the last call.\n *\n *\t@param particleSystem\tThe particle system on which to operate.\n *\t@param dTime\t\t\tElapsed time in seconds.\n */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/lib/particle/actions/splat_psa.cpp#L50-L122", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}227{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "PyDataSection::s_length", "code": "Py_ssize_t PyDataSection::s_length( PyObject * self )\n{\n\treturn ((PyDataSection *) self)->length();\n}", "docstring": "/**\n *\tThis function returns the number of entities in the system.\n */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/lib/pyscript/py_data_section.cpp#L50-L53", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}228{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "PackedSection::asUInt64", "code": "uint64 PackedSection::asUInt64( uint64 defaultVal )\n{\n\t// TODO: store 64-bit values as TYPE_INT? Murph suggested using 9 bytes for\n\t// uint64s as a special case.\n\tDataSectionPtr pDS = getXMLSection();\n\tpDS->setString( static_cast< DataSection * >( this )->asString() );\n\treturn pDS->asUInt64( defaultVal );\n}", "docstring": "/*\n *\tOverride from DataSection.\n */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/lib/resmgr/packed_section.cpp#L856-L863", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}229{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "ZipFileSystem::LocalFile::diskName", "code": "BW::string\tZipFileSystem::LocalFile::diskName()\n{\n\treturn isFolder()? filename_ + \"/\": filename_;\n}", "docstring": "/**\n*\tThis method return the name of the file that should be written on the disk\n*\n*\t@return the name of the file\n*/", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/lib/resmgr/zip_file_system.cpp#L1546-L1549", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}230{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "GlyphReferenceHolder::report", "code": "void GlyphReferenceHolder::report() const\n{\n\tBW_GUARD;\n\tGlyphReferenceCountMap::const_iterator it = refCounts_.begin();\n\tGlyphReferenceCountMap::const_iterator en = refCounts_.end();\n\twhile (it != en)\n\t{\n\t\tDEBUG_MSG( \"%c - %d\\n\", it->first, it->second );\n\t\t++it;\n\t}\n}", "docstring": "/**\n *\tThis method lists all the reference counts as debug messages.\n */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/lib/romp/glyph_reference_holder.cpp#L84-L94", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}231{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "XConsole::print", "code": "void XConsole::print( const char* string )\n{\n\tBW_GUARD;\n\twchar_t converted[2] = {0, 0};\n\tsize_t numBytes = bw_utf8tow_incremental( string, converted );\n\twhile (numBytes > 0)\n\t{\n\t\tMF_ASSERT( !converted[1] );\n\t\tthis->print( converted );\n\t\tstring += numBytes;\n\t\tnumBytes = bw_utf8tow_incremental( string, converted );\n\t}\n}", "docstring": "/**\n *\tThis method prints the input string to the console at the current cursor\n *\tposition.\n */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/lib/romp/xconsole.cpp#L246-L258", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}232{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "ListMultiProvider::~ListMultiProvider", "code": "ListMultiProvider::~ListMultiProvider()\n{\n\tBW_GUARD;\n}", "docstring": "/**\n *\tDestructor.\n */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/lib/ual/list_multi_provider.cpp#L76-L79", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}233{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "onReplayDataFileReaderHeader", "code": "virtual bool onReplayDataFileReaderHeader( ReplayDataFileReader & reader,\n\t\tconst ReplayHeader & header, BW::string & errorString )\n\t{\n\t\theader_ = header;\n\t\treturn true;\n\t}", "docstring": "/* Override from IReplayDataFileReaderListener. */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/server/baseapp/unit_test/test_recording.cpp#L400-L405", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}234{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "ClientCaller::ClientCaller", "code": "ClientCaller::ClientCaller( Entity & entity, \n\t\t\tconst MethodDescription & methodDescription,\n\t\t\tbool isForOwn, \n\t\t\tbool isForOthers, \n\t\t\tRecordingOption recordingOption,\n\t\t\tconst BW::string & destEntityTypeName,\n\t\t\tEntityID destID,\n\t\t\tPyTypeObject * pType /* = &ClientCaller::s_type_ */ ) :\n\t\tPyObjectPlus( pType ),\n\t\tentity_( entity ),\n\t\tmethodDescription_( methodDescription ),\n\t\tisForOwn_( isForOwn ),\n\t\tisForOthers_( isForOthers ),\n\t\tisExposedForReplay_( false ),\n\t\tdestID_( destID ),\n\t\tdestEntityTypeName_( destEntityTypeName )\n{\n\tPy_INCREF( &entity_ );\n\n\tswitch (recordingOption)\n\t{\n\tcase RECORDING_OPTION_METHOD_DEFAULT:\n\t\tif (isForOwn && !isForOthers)\n\t\t{\n\t\t\tisExposedForReplay_ = \n\t\t\t\t(methodDescription.replayExposureLevel() >= \n\t\t\t\t\tMethodDescription::REPLAY_EXPOSURE_LEVEL_ALL_CLIENTS);\n\t\t}\n\t\telse if (isForOthers)\n\t\t{\n\t\t\tisExposedForReplay_ = \n\t\t\t\t(methodDescription.replayExposureLevel() >= \n\t\t\t\t\tMethodDescription::REPLAY_EXPOSURE_LEVEL_OTHER_CLIENTS);\n\t\t}\n\t\tbreak;\n\n\tcase RECORDING_OPTION_RECORD_ONLY:\n\t\tisForOwn_ = false;\n\t\tisForOthers_ = false;\n\t\t// Fall through\n\tcase RECORDING_OPTION_RECORD:\n\t\tisExposedForReplay_ = true;\n\t\tbreak;\n\n\tcase RECORDING_OPTION_DO_NOT_RECORD:\n\tdefault:\n\t\t// Leave isExposedForReplay_ to false\n\t\tbreak;\n\t}\n}", "docstring": "/**\n *\tConstructor.\n *\n *\t@param methodDescription \tThe method description.\n *\t@param isForOwn \t\t\tWhether this will be sent to the entity's own\n *\t\t\t\t\t\t\t\tclient.\n *\t@param isForOthers \t\t\tWhether this will be sent to other clients that\n *\t\t\t\t\t\t\t\thave this entity in their AoI.\n *\t@param recordingOption\t\tSee RecordingOption enum.\n *\t@param destEntityTypeName \tThe name of the destination entity's type.\n *\t@param destID \t\t\t\tThe destination entity's ID.\n *\t@param pType \t\t\t\tThe type object to initialise this Python\n *\t\t\t\t\t\t\t\tobject to.\n */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/server/cellapp/py_client.cpp#L99-L148", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}235{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "Witness::deleteFromClient", "code": "void Witness::deleteFromClient( Mercury::Bundle & bundle,\n\tEntityCache * pCache )\n{\n\tpCache->clearRefresh();\n\n\tEntityID id = pCache->pEntity()->id();\n\n\tif (!pCache->isEnterPending())\n\t{\n\t\tpCache->addLeaveAoIMessage( bundle, id );\n\t}\n\n\tthis->onLeaveAoI( pCache, id );\n\n\t// Reset client related state\n\tpCache->onEntityRemovedFromClient();\n}", "docstring": "/**\n *\tThis method informs the client that an entity has left its AoI.\n */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/server/cellapp/witness.cpp#L1922-L1938", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}236{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "CellApp::onSignalled", "code": "void CellApp::onSignalled( int sigNum )\n{\n\tif (sigNum == SIGQUIT)\n\t{\n\t\t// Just print out some information, and pass it up to EntityApp to dump\n\t\t// core.\n\n\t\tERROR_MSG( \"CellApp::onSignalled: \"\n\t\t\t\t\"load = %f. emergencyThrottle = %f. \"\n\t\t\t\t\"Time since tick = %f seconds\\n\",\n\t\t\tthis->getLoad(), this->emergencyThrottle(),\n\t\t\tstampsToSeconds( timestamp() - this->lastGameTickTime() ) );\n\t}\n\n\tthis->EntityApp::onSignalled( sigNum );\n}", "docstring": "/**\n *\tSignal handler.\n */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/server/cellapp/cellapp.cpp#L3606-L3621", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}237{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "MainApp::addBotsWithName", "code": "void MainApp::addBotsWithName( PyObjectPtr pCredentialSequence )\n{\n\tif (!pCredentialSequence || pCredentialSequence == Py_None)\n\t{\n\t\tPyErr_SetString( PyExc_TypeError,\n\t\t\t\"Bots::addBotsWithName: Empty login info. \"\n\t\t\t\"Expecting a list of tuples containing username and password.\" );\n\t\treturn;\n\t}\n\n\tif (!PySequence_Check( pCredentialSequence.get() ))\n\t{\n\t\tPyErr_SetString( PyExc_TypeError, \"Bots::addBotsWithName: \"\n\t\t\t\"Expecting a list of tuples containing username and password.\" );\n\t\treturn;\n\t}\n\n\tPy_ssize_t numCredentials = PySequence_Size(\n\t\tpCredentialSequence.get() );\n\tfor (Py_ssize_t i = 0; i < numCredentials; ++i)\n\t{\n\t\tPyObject * pCredentials = PySequence_GetItem(\n\t\t\tpCredentialSequence.get(), i );\n\t\tif (!PyTuple_Check( pCredentials ) || PyTuple_Size( pCredentials ) != 2)\n\t\t{\n\t\t\tPyErr_Format( PyExc_TypeError,\n\t\t\t\t\"Bots::addBotsWithName: Argument list item %\" PRIzd \" must \"\n\t\t\t\t\"be tuple of two strings.\", i );\n\n\t\t\tPy_XDECREF( pCredentials );\n\t\t\treturn;\n\t\t}\n\n\t\tPyObject * pClientName = PySequence_GetItem( pCredentials, 0 );\n\t\tPyObject * pClientPassword = PySequence_GetItem( pCredentials, 1 );\n\n\t\tPy_DECREF( pCredentials );\n\n\t\tif (!PyString_Check( pClientName ) ||\n\t\t\t!PyString_Check( pClientPassword ))\n\t\t{\n\t\t\tPyErr_Format( PyExc_TypeError, \"Bots::addBotsWithName: \"\n\t\t\t\t\"Invalid credentials for element %\" PRIzd \". Expecting a tuple \"\n\t\t\t\t\"containing a username and password.\", i );\n\n\t\t\tPy_XDECREF( pClientName );\n\t\t\tPy_XDECREF( pClientPassword );\n\n\t\t\treturn;\n\t\t}\n\n\t\tthis->addBotWithName( BW::string( PyString_AsString( pClientName ) ),\n\t\t\tBW::string( PyString_AsString( pClientPassword ) ) );\n\n\t\tPy_DECREF( pClientName );\n\t\tPy_DECREF( pClientPassword );\n\t}\n}", "docstring": "/**\n *\tThis method adds a set of new bot client applications to the Bots process\n *\tusing a pregenerated list of usernames and passwords.\n *\n *\t@param pCredentialSequence  The Python list containing tuples of\n *\t                            username/password pairs to be used in creating\n *\t                            the ClientApps.\n */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/server/tools/bots/main_app.cpp#L441-L498", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}238{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "~BotAdder", "code": "virtual ~BotAdder()\n\t{\n\t\ttimer_.cancel();\n\t}", "docstring": "/**\n\t *\tDestructor.\n\t */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/server/tools/bots/main_app.cpp#L1208-L1211", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}239{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "InputOptions::setMipmapFilter", "code": "void InputOptions::setMipmapFilter(MipmapFilter filter)\n{\n\tm.mipmapFilter = filter;\n}", "docstring": "/// Set mipmap filter.", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/nvtt/src/nvtt/InputOptions.cpp#L278-L281", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}240{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "setNormalMap", "code": "void setNormalMap(nvtt::InputOptions & inputOptions)\n{\n\tinputOptions.setNormalMap(true);\n\tinputOptions.setConvertToNormalMap(false);\n\tinputOptions.setGamma(1.0f, 1.0f);\n\tinputOptions.setNormalizeMipmaps(true);\n}", "docstring": "// Set options for normal maps.", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/nvtt/src/nvtt/tools/benchmark.cpp#L59-L65", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}241{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "VisualProcessor::VisualProcessor", "code": "VisualProcessor::VisualProcessor( const BW::string & params ) :\n\tConverter( params )\n{\n\tBW_GUARD;\n}", "docstring": "/* construct a converter with parameters. */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/tools/asset_pipeline/converters/visual_processor/visual_processor.cpp#L46-L50", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}242{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "Undo::updateActions", "code": "void Undo::updateActions( void )\n{\n\tif ( undoAction_ )\n    \tundoAction_->Enabled = undoEnabled_;\n\n    if ( redoAction_ )\n    \tredoAction_->Enabled = redoEnabled_;\n}", "docstring": "//---------------------------------------------------------------------------", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/tools/common/undo.cpp#L477-L484", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}243{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "CommonUtility::removePath", "code": "AnsiString __fastcall CommonUtility::removePath( AnsiString filename )\n{\n\tAnsiString name;\n    int start, backSlashPos, forewardSlashPos, end;\n\n    backSlashPos = filename.LastDelimiter( \"\\\\\" ) + 1;\n    forewardSlashPos = filename.LastDelimiter( \"/\" ) + 1;\n\n    if ( backSlashPos > forewardSlashPos )\n    \tstart = backSlashPos;\n    else\n    \tstart = forewardSlashPos;\n\n    end = filename.Length() + 1;\n\n    if ( start < end )\n    {\n\t\tfor ( int i = start; i < end; i++ )\n    \t\tname += filename[i];\n    }\n    else\n    \tname = filename;\n\n    return name;\n}", "docstring": "//---------------------------------------------------------------------------", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/tools/common/common_utility.cpp#L199-L223", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}244{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "LightingPlan::VirtualLight::drawDirectional", "code": "void LightingPlan::VirtualLight::drawDirectional()\n{\n}", "docstring": "/**\n * \tThis method draws a directional light, as a cylinder\n */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/tools/common/lighting_plan.cpp#L149-L151", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}245{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "ExpandSpaceDlg::validationChange", "code": "void ExpandSpaceDlg::validationChange( bool validationResult )\n{\n\tif ( validationResult )\n\t{\n\t\tbtnExpand_.EnableWindow( TRUE );\n\t}\n\telse\n\t{\n\t\tbtnExpand_.EnableWindow( FALSE );\n\t}\n}", "docstring": "/*virtual */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/tools/worldeditor/gui/dialogs/expand_space_dlg.cpp", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}246{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "PageTerrainImport::UpdateState", "code": "void PageTerrainImport::UpdateState()\n{\n\tBW_GUARD;\n\n    if (!pageReady_)\n        InitPage();\n\n    if (!HeightModule::hasStarted())\n        return;\n\n    HeightModule *hm = HeightModule::currentInstance();\n\n    BOOL importing = hm->hasImportData();\n    BOOL exporting = !importing;\n\n\t// Inform the height module about the mode and strengths:\n\tif (importing)\n\t\thm->mode(HeightModule::IMPORT_TERRAIN);\n\telse if (exporting)\n\t\thm->mode(HeightModule::EXPORT_TERRAIN);\n\n\t// Update subclassed controls:\n\texportBtn_           .EnableWindow(exporting);\n    heightStrengthEdit_  .EnableWindow(importing);\n    heightStrengthSlider_.EnableWindow(importing);\n    modeCB_              .EnableWindow(importing);\n    placeBtn_            .EnableWindow(importing);\n    cancelBtn_           .EnableWindow(importing);\n}", "docstring": "/**\n *\tThis is called to update the state of the controls.\n */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/tools/worldeditor/gui/pages/page_terrain_import.cpp#L909-L937", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}247{"repo_name": "BigWorld-Engine-14.4.1", "dataset": "github_2023", "owner": "v2v3v4", "lang": "cpp", "func_name": "SceneBrowserDlg::OnUpdateControls", "code": "LRESULT SceneBrowserDlg::OnUpdateControls( WPARAM wParam, LPARAM lParam )\n{\n\tBW_GUARD;\n\n\tstatic DogWatch dw( \"SceneBrowserTick\" );\n\tScopedDogWatch sdw( dw );\n\n\tuint64 startTick = timestamp();\n\n\tbool needsUpdateStatusBar = false;\n\n\tbool forceListTick = false;\n\tif (ItemInfoDB::instance().needsTick())\n\t{\n\t\t// The user must have changed something, try to spend some time updating\n\t\t// the item db, and make sure the list updated on the next frame.\n\t\tItemInfoDB::instance().tick( MAX_DB_MILLIS * MAX_DB_MILLIS_MULTIPLIER );\n\t\tforceListTick = true;\n\t}\n\n\tbool showWorkingAnim = ItemInfoDB::instance().hasChanged();\n\n\tuint64 timeSinceLastUpdate = \n\t\t(timestamp() - lastUpdate_) * 1000 / stampsPerSecond();\n\n\tif (forceListTick || list_.needsTick() || timeSinceLastUpdate > CHECK_UPDATE_LIST_MILLIS)\n\t{\n\t\t// Time to update the list.\n\t\tif (list_.tick( forceListTick ))\n\t\t{\n\t\t\tneedsUpdateStatusBar = true;\n\t\t\tshowWorkingAnim = true;\n\t\t}\n\t\tlastUpdate_ = timestamp();\n\t}\n\n\tif (showWorkingAnim)\n\t\tworkingAnim_.show();\n\telse\n\t\tworkingAnim_.hide();\n\n\tworkingAnim_.update();\n\n\tif (list_.hasSelectionChanged())\n\t{\n\t\tstatic DogWatch dw( \"SetAppSelection\" );\n\t\tScopedDogWatch sdw( dw );\n\n\t\t// Selection changed by the list after user interaction\n\t\tif (SceneBrowser::instance().callbackSelChange())\n\t\t{\n\t\t\tCWaitCursor wait;\n\t\t\t(*SceneBrowser::instance().callbackSelChange())(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlist_.selection() );\n\t\t}\n\n\t\tif (SceneBrowser::instance().callbackCurrentSel())\n\t\t{\n\t\t\tconst BW::vector<ChunkItemPtr> & cbSelection =\n\t\t\t\t\t\t\t(*SceneBrowser::instance().callbackCurrentSel())();\n\t\t\tlastSelection_ = cbSelection;\n\t\t}\n\n\t\tneedsUpdateStatusBar = true;\n\t\tlist_.clearSelectionChanged();\n\t}\n\telse if (SceneBrowser::instance().callbackCurrentSel())\n\t{\n\t\tstatic DogWatch dw( \"GetAppSelection\" );\n\t\tScopedDogWatch sdw( dw );\n\n\t\t// Selection changed from the outside\n\t\tconst BW::vector<ChunkItemPtr> & cbSelection =\n\t\t\t\t\t\t\t(*SceneBrowser::instance().callbackCurrentSel())();\n\t\tif (lastSelection_ != cbSelection)\n\t\t{\n\t\t\tlastSelection_ = cbSelection;\n\n\t\t\t// Make sure the list's and DB's items are to date.\n\t\t\tItemInfoDB::instance().tick();\n\t\t\tlist_.tick();\n\t\t\tlastUpdate_ = timestamp();\n\n\t\t\tlist_.selection( lastSelection_ );\n\t\t\tneedsUpdateStatusBar = true;\n\t\t}\n\t}\n\t\n\tif (needsUpdateStatusBar)\n\t{\n\t\tstatic DogWatch dw( \"UpdateStatusBar\" );\n\t\tScopedDogWatch sdw( dw );\n\n\t\tupdateStatusBar();\n\t}\n\n\t// Update the database if there's still remaining tick time. We do this to\n\t// reduce spikes in the frame rate.\n\tint ellapsedTickMillis =\n\t\t\tint( (timestamp() - startTick) * 1000 / stampsPerSecond() );\n\n\tint multiplier = std::min(\n\t\t\t1 + ItemInfoDB::instance().numPending() / MAX_DB_MILLIS_STEP,\n\t\t\tMAX_DB_MILLIS_MULTIPLIER );\n\tint maxMillis = MAX_DB_MILLIS * multiplier;\n\tint dbTickMaxMillis = std::max( 0, maxMillis - ellapsedTickMillis );\n\n\tItemInfoDB::instance().tick( dbTickMaxMillis );\n\n\treturn 0;\n}", "docstring": "/**\n *\tThis message is sent from the app once each frame.\n *\n *\t@param wParam\tunused.\n *\t@param lParam\tunused.\n *\t@return\t\tIgnored.\n */", "url": "https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/tools/worldeditor/gui/scene_browser/scene_browser_dlg.cpp#L472-L582", "sha": "4389085c8ce35cff887a4cc18fc47d1133d89ffb"}248{"repo_name": "airwin2rack", "dataset": "github_2023", "owner": "baconpaul", "lang": "cpp", "func_name": "pinParameter", "code": "static float pinParameter(float data)\n{\n\tif (data < 0.0f) return 0.0f;\n\tif (data > 1.0f) return 1.0f;\n\treturn data;\n}", "docstring": "//airwindows likes to ignore this stuff. Make your own programs, and make a different plugin rather than\n//trying to do versioning and preventing people from using older versions. Maybe they like the old one!", "url": "https://github.com/baconpaul/airwin2rack/blob/ecda72c1ec5211885bf4f83e61abae80e0457cd3/src/autogen_airwin/Crystal.cpp#L48-L53", "sha": "ecda72c1ec5211885bf4f83e61abae80e0457cd3"}249{"repo_name": "airwin2rack", "dataset": "github_2023", "owner": "baconpaul", "lang": "cpp", "func_name": "LRConvolve::getEffectName", "code": "bool LRConvolve::getEffectName(char* name) {\n    vst_strncpy(name, \"LRConvolve\", kVstMaxProductStrLen); return true;\n}", "docstring": "// 1 = yes, -1 = no, 0 = don't know", "url": "https://github.com/baconpaul/airwin2rack/blob/ecda72c1ec5211885bf4f83e61abae80e0457cd3/src/autogen_airwin/LRConvolve.cpp#L67-L69", "sha": "ecda72c1ec5211885bf4f83e61abae80e0457cd3"}250{"repo_name": "airwin2rack", "dataset": "github_2023", "owner": "baconpaul", "lang": "cpp", "func_name": "pinParameter", "code": "static float pinParameter(float data)\n{\n\tif (data < 0.0f) return 0.0f;\n\tif (data > 1.0f) return 1.0f;\n\treturn data;\n}", "docstring": "//airwindows likes to ignore this stuff. Make your own programs, and make a different plugin rather than\n//trying to do versioning and preventing people from using older versions. Maybe they like the old one!", "url": "https://github.com/baconpaul/airwin2rack/blob/ecda72c1ec5211885bf4f83e61abae80e0457cd3/src/autogen_airwin/TapeBias.cpp#L45-L50", "sha": "ecda72c1ec5211885bf4f83e61abae80e0457cd3"}251{"repo_name": "airwin2rack", "dataset": "github_2023", "owner": "baconpaul", "lang": "cpp", "func_name": "pinParameter", "code": "static float pinParameter(float data)\n{\n\tif (data < 0.0f) return 0.0f;\n\tif (data > 1.0f) return 1.0f;\n\treturn data;\n}", "docstring": "//airwindows likes to ignore this stuff. Make your own programs, and make a different plugin rather than\n//trying to do versioning and preventing people from using older versions. Maybe they like the old one!", "url": "https://github.com/baconpaul/airwin2rack/blob/ecda72c1ec5211885bf4f83e61abae80e0457cd3/src/autogen_airwin/PurestWarm.cpp#L42-L47", "sha": "ecda72c1ec5211885bf4f83e61abae80e0457cd3"}252{"repo_name": "airwin2rack", "dataset": "github_2023", "owner": "baconpaul", "lang": "cpp", "func_name": "BrightAmbience::getEffectName", "code": "bool BrightAmbience::getEffectName(char* name) {\n    vst_strncpy(name, \"BrightAmbience\", kVstMaxProductStrLen); return true;\n}", "docstring": "// 1 = yes, -1 = no, 0 = don't know", "url": "https://github.com/baconpaul/airwin2rack/blob/ecda72c1ec5211885bf4f83e61abae80e0457cd3/src/autogen_airwin/BrightAmbience.cpp#L101-L103", "sha": "ecda72c1ec5211885bf4f83e61abae80e0457cd3"}253{"repo_name": "airwin2rack", "dataset": "github_2023", "owner": "baconpaul", "lang": "cpp", "func_name": "BezEQ::getEffectName", "code": "bool BezEQ::getEffectName(char* name) {\n    vst_strncpy(name, \"BezEQ\", kVstMaxProductStrLen); return true;\n}", "docstring": "// 1 = yes, -1 = no, 0 = don't know", "url": "https://github.com/baconpaul/airwin2rack/blob/ecda72c1ec5211885bf4f83e61abae80e0457cd3/src/autogen_airwin/BezEQ.cpp#L115-L117", "sha": "ecda72c1ec5211885bf4f83e61abae80e0457cd3"}254{"repo_name": "GCNO", "dataset": "github_2023", "owner": "Xrvitd", "lang": "cpp", "func_name": "kdtreequerybox", "code": "ae_int_t kdtreequerybox(const kdtree &kdt,\n                        const real_1d_array &boxmin,\n                        const real_1d_array &boxmax,\n                        const xparams _xparams) {\n  jmp_buf _break_jump;\n  alglib_impl::ae_state _alglib_env_state;\n  alglib_impl::ae_state_init(&_alglib_env_state);\n  if (setjmp(_break_jump)) {\n#if !defined(AE_NO_EXCEPTIONS)\n    _ALGLIB_CPP_EXCEPTION(_alglib_env_state.error_msg);\n#else\n                                                                                                                            _ALGLIB_SET_ERROR_FLAG(_alglib_env_state.error_msg);\n        return 0;\n#endif\n  }\n  ae_state_set_break_jump(&_alglib_env_state, &_break_jump);\n  if (_xparams.flags != 0x0)\n    ae_state_set_flags(&_alglib_env_state, _xparams.flags);\n  alglib_impl::ae_int_t result = alglib_impl::kdtreequerybox(const_cast<alglib_impl::kdtree *>(kdt.c_ptr()),\n                                                             const_cast<alglib_impl::ae_vector *>(boxmin.c_ptr()),\n                                                             const_cast<alglib_impl::ae_vector *>(boxmax.c_ptr()),\n                                                             &_alglib_env_state);\n  alglib_impl::ae_state_clear(&_alglib_env_state);\n  return *(reinterpret_cast<ae_int_t *>(&result));\n}", "docstring": "/*************************************************************************\nBox query: all points within user-specified box.\n\nIMPORTANT: this function can not be used in multithreaded code because  it\n           uses internal temporary buffer of kd-tree object, which can not\n           be shared between multiple threads.  If  you  want  to  perform\n           parallel requests, use function  which  uses  external  request\n           buffer: KDTreeTsQueryBox() (\"Ts\" stands for \"thread-safe\").\n\nINPUT PARAMETERS\n    KDT         -   KD-tree\n    BoxMin      -   lower bounds, array[0..NX-1].\n    BoxMax      -   upper bounds, array[0..NX-1].\n\n\nRESULT\n    number of actual neighbors found (in [0,N]).\n\nThis  subroutine  performs  query  and  stores  its result in the internal\nstructures of the KD-tree. You can use  following  subroutines  to  obtain\nthese results:\n* KDTreeQueryResultsX() to get X-values\n* KDTreeQueryResultsXY() to get X- and Y-values\n* KDTreeQueryResultsTags() to get tag values\n* KDTreeQueryResultsDistances() returns zeros for this request\n\nNOTE: this particular query returns unordered results, because there is no\n      meaningful way of  ordering  points.  Furthermore,  no 'distance' is\n      associated with points - it is either INSIDE  or OUTSIDE (so request\n      for distances will return zeros).\n\n  -- ALGLIB --\n     Copyright 14.05.2016 by Bochkanov Sergey\n*************************************************************************/", "url": "https://github.com/Xrvitd/GCNO/blob/bcae63774a2ecd72f862a76eab570ab6d1ffe432/src/Optimization/ALGLIB/alglibmisc.cpp#L1915-L1939", "sha": "bcae63774a2ecd72f862a76eab570ab6d1ffe432"}255{"repo_name": "GCNO", "dataset": "github_2023", "owner": "Xrvitd", "lang": "cpp", "func_name": "mlpissoftmax", "code": "ae_bool mlpissoftmax(multilayerperceptron *network, ae_state *_state) {\n  ae_bool result;\n\n  result = network->structinfo.ptr.p_int[6] == 1;\n  return result;\n}", "docstring": "/*************************************************************************\nTells whether network is SOFTMAX-normalized (i.e. classifier) or not.\n\n  -- ALGLIB --\n     Copyright 04.11.2007 by Bochkanov Sergey\n*************************************************************************/", "url": "https://github.com/Xrvitd/GCNO/blob/bcae63774a2ecd72f862a76eab570ab6d1ffe432/src/Optimization/ALGLIB/dataanalysis.cpp#L22283-L22288", "sha": "bcae63774a2ecd72f862a76eab570ab6d1ffe432"}256{"repo_name": "GCNO", "dataset": "github_2023", "owner": "Xrvitd", "lang": "cpp", "func_name": "mlpeserialize", "code": "void mlpeserialize(ae_serializer *s,\n                   mlpensemble *ensemble,\n                   ae_state *_state) {\n\n  ae_serializer_serialize_int(s, getmlpeserializationcode(_state), _state);\n  ae_serializer_serialize_int(s, mlpe_mlpefirstversion, _state);\n  ae_serializer_serialize_int(s, ensemble->ensemblesize, _state);\n  serializerealarray(s, &ensemble->weights, -1, _state);\n  serializerealarray(s, &ensemble->columnmeans, -1, _state);\n  serializerealarray(s, &ensemble->columnsigmas, -1, _state);\n  mlpserialize(s, &ensemble->network, _state);\n}", "docstring": "/*************************************************************************\nSerializer: serialization\n\n  -- ALGLIB --\n     Copyright 14.03.2011 by Bochkanov Sergey\n*************************************************************************/", "url": "https://github.com/Xrvitd/GCNO/blob/bcae63774a2ecd72f862a76eab570ab6d1ffe432/src/Optimization/ALGLIB/dataanalysis.cpp#L36987-L36998", "sha": "bcae63774a2ecd72f862a76eab570ab6d1ffe432"}257{"repo_name": "GCNO", "dataset": "github_2023", "owner": "Xrvitd", "lang": "cpp", "func_name": "lsfitcreatef", "code": "void lsfitcreatef(const real_2d_array &x,\n                  const real_1d_array &y,\n                  const real_1d_array &c,\n                  const ae_int_t n,\n                  const ae_int_t m,\n                  const ae_int_t k,\n                  const double diffstep,\n                  lsfitstate &state,\n                  const xparams _xparams) {\n  jmp_buf _break_jump;\n  alglib_impl::ae_state _alglib_env_state;\n  alglib_impl::ae_state_init(&_alglib_env_state);\n  if (setjmp(_break_jump)) {\n#if !defined(AE_NO_EXCEPTIONS)\n    _ALGLIB_CPP_EXCEPTION(_alglib_env_state.error_msg);\n#else\n                                                                                                                            _ALGLIB_SET_ERROR_FLAG(_alglib_env_state.error_msg);\n        return;\n#endif\n  }\n  ae_state_set_break_jump(&_alglib_env_state, &_break_jump);\n  if (_xparams.flags != 0x0)\n    ae_state_set_flags(&_alglib_env_state, _xparams.flags);\n  alglib_impl::lsfitcreatef(const_cast<alglib_impl::ae_matrix *>(x.c_ptr()),\n                            const_cast<alglib_impl::ae_vector *>(y.c_ptr()),\n                            const_cast<alglib_impl::ae_vector *>(c.c_ptr()),\n                            n,\n                            m,\n                            k,\n                            diffstep,\n                            const_cast<alglib_impl::lsfitstate *>(state.c_ptr()),\n                            &_alglib_env_state);\n  alglib_impl::ae_state_clear(&_alglib_env_state);\n  return;\n}", "docstring": "/*************************************************************************\nNonlinear least squares fitting using function values only.\n\nCombination of numerical differentiation and secant updates is used to\nobtain function Jacobian.\n\nNonlinear task min(F(c)) is solved, where\n\n    F(c) = (f(c,x[0])-y[0])^2 + ... + (f(c,x[n-1])-y[n-1])^2,\n\n    * N is a number of points,\n    * M is a dimension of a space points belong to,\n    * K is a dimension of a space of parameters being fitted,\n    * w is an N-dimensional vector of weight coefficients,\n    * x is a set of N points, each of them is an M-dimensional vector,\n    * c is a K-dimensional vector of parameters being fitted\n\nThis subroutine uses only f(c,x[i]).\n\nINPUT PARAMETERS:\n    X       -   array[0..N-1,0..M-1], points (one row = one point)\n    Y       -   array[0..N-1], function values.\n    C       -   array[0..K-1], initial approximation to the solution,\n    N       -   number of points, N>1\n    M       -   dimension of space\n    K       -   number of parameters being fitted\n    DiffStep-   numerical differentiation step;\n                should not be very small or large;\n                large = loss of accuracy\n                small = growth of round-off errors\n\nOUTPUT PARAMETERS:\n    State   -   structure which stores algorithm state\n\n  -- ALGLIB --\n     Copyright 18.10.2008 by Bochkanov Sergey\n*************************************************************************/", "url": "https://github.com/Xrvitd/GCNO/blob/bcae63774a2ecd72f862a76eab570ab6d1ffe432/src/Optimization/ALGLIB/interpolation.cpp#L12177-L12211", "sha": "bcae63774a2ecd72f862a76eab570ab6d1ffe432"}258{"repo_name": "GCNO", "dataset": "github_2023", "owner": "Xrvitd", "lang": "cpp", "func_name": "lsfit_internalchebyshevfit", "code": "static void lsfit_internalchebyshevfit(/* Real    */ ae_vector *x,\n    /* Real    */ ae_vector *y,\n    /* Real    */ ae_vector *w,\n                                                     ae_int_t n,\n    /* Real    */ ae_vector *xc,\n    /* Real    */ ae_vector *yc,\n    /* Integer */ ae_vector *dc,\n                                                     ae_int_t k,\n                                                     ae_int_t m,\n                                                     ae_int_t *info,\n    /* Real    */ ae_vector *c,\n                                                     lsfitreport *rep,\n                                                     ae_state *_state) {\n  ae_frame _frame_block;\n  ae_vector _xc;\n  ae_vector _yc;\n  ae_vector y2;\n  ae_vector w2;\n  ae_vector tmp;\n  ae_vector tmp2;\n  ae_vector tmpdiff;\n  ae_vector bx;\n  ae_vector by;\n  ae_vector bw;\n  ae_matrix fmatrix;\n  ae_matrix cmatrix;\n  ae_int_t i;\n  ae_int_t j;\n  double mx;\n  double decay;\n\n  ae_frame_make(_state, &_frame_block);\n  memset(&_xc, 0, sizeof(_xc));\n  memset(&_yc, 0, sizeof(_yc));\n  memset(&y2, 0, sizeof(y2));\n  memset(&w2, 0, sizeof(w2));\n  memset(&tmp, 0, sizeof(tmp));\n  memset(&tmp2, 0, sizeof(tmp2));\n  memset(&tmpdiff, 0, sizeof(tmpdiff));\n  memset(&bx, 0, sizeof(bx));\n  memset(&by, 0, sizeof(by));\n  memset(&bw, 0, sizeof(bw));\n  memset(&fmatrix, 0, sizeof(fmatrix));\n  memset(&cmatrix, 0, sizeof(cmatrix));\n  ae_vector_init_copy(&_xc, xc, _state, ae_true);\n  xc = &_xc;\n  ae_vector_init_copy(&_yc, yc, _state, ae_true);\n  yc = &_yc;\n  *info = 0;\n  ae_vector_clear(c);\n  _lsfitreport_clear(rep);\n  ae_vector_init(&y2, 0, DT_REAL, _state, ae_true);\n  ae_vector_init(&w2, 0, DT_REAL, _state, ae_true);\n  ae_vector_init(&tmp, 0, DT_REAL, _state, ae_true);\n  ae_vector_init(&tmp2, 0, DT_REAL, _state, ae_true);\n  ae_vector_init(&tmpdiff, 0, DT_REAL, _state, ae_true);\n  ae_vector_init(&bx, 0, DT_REAL, _state, ae_true);\n  ae_vector_init(&by, 0, DT_REAL, _state, ae_true);\n  ae_vector_init(&bw, 0, DT_REAL, _state, ae_true);\n  ae_matrix_init(&fmatrix, 0, 0, DT_REAL, _state, ae_true);\n  ae_matrix_init(&cmatrix, 0, 0, DT_REAL, _state, ae_true);\n\n  lsfit_clearreport(rep, _state);\n\n  /*\n     * weight decay for correct handling of task which becomes\n     * degenerate after constraints are applied\n     */\n  decay = 10000 * ae_machineepsilon;\n\n  /*\n     * allocate space, initialize/fill:\n     * * FMatrix-   values of basis functions at X[]\n     * * CMatrix-   values (derivatives) of basis functions at XC[]\n     * * fill constraints matrix\n     * * fill first N rows of design matrix with values\n     * * fill next M rows of design matrix with regularizing term\n     * * append M zeros to Y\n     * * append M elements, mean(abs(W)) each, to W\n     */\n  ae_vector_set_length(&y2, n + m, _state);\n  ae_vector_set_length(&w2, n + m, _state);\n  ae_vector_set_length(&tmp, m, _state);\n  ae_vector_set_length(&tmpdiff, m, _state);\n  ae_matrix_set_length(&fmatrix, n + m, m, _state);\n  if (k > 0) {\n    ae_matrix_set_length(&cmatrix, k, m + 1, _state);\n  }\n\n  /*\n     * Fill design matrix, Y2, W2:\n     * * first N rows with basis functions for original points\n     * * next M rows with decay terms\n     */\n  for (i = 0; i <= n - 1; i++) {\n\n    /*\n         * prepare Ith row\n         * use Tmp for calculations to avoid multidimensional arrays overhead\n         */\n    for (j = 0; j <= m - 1; j++) {\n      if (j == 0) {\n        tmp.ptr.p_double[j] = (double) (1);\n      } else {\n        if (j == 1) {\n          tmp.ptr.p_double[j] = x->ptr.p_double[i];\n        } else {\n          tmp.ptr.p_double[j] = 2 * x->ptr.p_double[i] * tmp.ptr.p_double[j - 1] - tmp.ptr.p_double[j - 2];\n        }\n      }\n    }\n    ae_v_move(&fmatrix.ptr.pp_double[i][0], 1, &tmp.ptr.p_double[0], 1, ae_v_len(0, m - 1));\n  }\n  for (i = 0; i <= m - 1; i++) {\n    for (j = 0; j <= m - 1; j++) {\n      if (i == j) {\n        fmatrix.ptr.pp_double[n + i][j] = decay;\n      } else {\n        fmatrix.ptr.pp_double[n + i][j] = (double) (0);\n      }\n    }\n  }\n  ae_v_move(&y2.ptr.p_double[0], 1, &y->ptr.p_double[0], 1, ae_v_len(0, n - 1));\n  ae_v_move(&w2.ptr.p_double[0], 1, &w->ptr.p_double[0], 1, ae_v_len(0, n - 1));\n  mx = (double) (0);\n  for (i = 0; i <= n - 1; i++) {\n    mx = mx + ae_fabs(w->ptr.p_double[i], _state);\n  }\n  mx = mx / n;\n  for (i = 0; i <= m - 1; i++) {\n    y2.ptr.p_double[n + i] = (double) (0);\n    w2.ptr.p_double[n + i] = mx;\n  }\n\n  /*\n     * fill constraints matrix\n     */\n  for (i = 0; i <= k - 1; i++) {\n\n    /*\n         * prepare Ith row\n         * use Tmp for basis function values,\n         * TmpDiff for basos function derivatives\n         */\n    for (j = 0; j <= m - 1; j++) {\n      if (j == 0) {\n        tmp.ptr.p_double[j] = (double) (1);\n        tmpdiff.ptr.p_double[j] = (double) (0);\n      } else {\n        if (j == 1) {\n          tmp.ptr.p_double[j] = xc->ptr.p_double[i];\n          tmpdiff.ptr.p_double[j] = (double) (1);\n        } else {\n          tmp.ptr.p_double[j] = 2 * xc->ptr.p_double[i] * tmp.ptr.p_double[j - 1] - tmp.ptr.p_double[j - 2];\n          tmpdiff.ptr.p_double[j] = 2 * (tmp.ptr.p_double[j - 1] + xc->ptr.p_double[i] * tmpdiff.ptr.p_double[j - 1])\n              - tmpdiff.ptr.p_double[j - 2];\n        }\n      }\n    }\n    if (dc->ptr.p_int[i] == 0) {\n      ae_v_move(&cmatrix.ptr.pp_double[i][0], 1, &tmp.ptr.p_double[0], 1, ae_v_len(0, m - 1));\n    }\n    if (dc->ptr.p_int[i] == 1) {\n      ae_v_move(&cmatrix.ptr.pp_double[i][0], 1, &tmpdiff.ptr.p_double[0], 1, ae_v_len(0, m - 1));\n    }\n    cmatrix.ptr.pp_double[i][m] = yc->ptr.p_double[i];\n  }\n\n  /*\n     * Solve constrained task\n     */\n  if (k > 0) {\n\n    /*\n         * solve using regularization\n         */\n    lsfitlinearwc(&y2, &w2, &fmatrix, &cmatrix, n + m, m, k, info, c, rep, _state);\n  } else {\n\n    /*\n         * no constraints, no regularization needed\n         */\n    lsfitlinearwc(y, w, &fmatrix, &cmatrix, n, m, 0, info, c, rep, _state);\n  }\n  if (*info < 0) {\n    ae_frame_leave(_state);\n    return;\n  }\n  ae_frame_leave(_state);\n}", "docstring": "/*************************************************************************\nThis is internal function for Chebyshev fitting.\n\nIt assumes that input data are normalized:\n* X/XC belong to [-1,+1],\n* mean(Y)=0, stddev(Y)=1.\n\nIt does not checks inputs for errors.\n\nThis function is used to fit general (shifted) Chebyshev models, power\nbasis models or barycentric models.\n\nINPUT PARAMETERS:\n    X   -   points, array[0..N-1].\n    Y   -   function values, array[0..N-1].\n    W   -   weights, array[0..N-1]\n    N   -   number of points, N>0.\n    XC  -   points where polynomial values/derivatives are constrained,\n            array[0..K-1].\n    YC  -   values of constraints, array[0..K-1]\n    DC  -   array[0..K-1], types of constraints:\n            * DC[i]=0   means that P(XC[i])=YC[i]\n            * DC[i]=1   means that P'(XC[i])=YC[i]\n    K   -   number of constraints, 0<=K<M.\n            K=0 means no constraints (XC/YC/DC are not used in such cases)\n    M   -   number of basis functions (= polynomial_degree + 1), M>=1\n\nOUTPUT PARAMETERS:\n    Info-   same format as in LSFitLinearW() subroutine:\n            * Info>0    task is solved\n            * Info<=0   an error occured:\n                        -4 means inconvergence of internal SVD\n                        -3 means inconsistent constraints\n    C   -   interpolant in Chebyshev form; [-1,+1] is used as base interval\n    Rep -   report, same format as in LSFitLinearW() subroutine.\n            Following fields are set:\n            * RMSError      rms error on the (X,Y).\n            * AvgError      average error on the (X,Y).\n            * AvgRelError   average relative error on the non-zero Y\n            * MaxError      maximum error\n                            NON-WEIGHTED ERRORS ARE CALCULATED\n\nIMPORTANT:\n    this subroitine doesn't calculate task's condition number for K<>0.\n\n  -- ALGLIB PROJECT --\n     Copyright 10.12.2009 by Bochkanov Sergey\n*************************************************************************/", "url": "https://github.com/Xrvitd/GCNO/blob/bcae63774a2ecd72f862a76eab570ab6d1ffe432/src/Optimization/ALGLIB/interpolation.cpp#L38128-L38317", "sha": "bcae63774a2ecd72f862a76eab570ab6d1ffe432"}259{"repo_name": "GCNO", "dataset": "github_2023", "owner": "Xrvitd", "lang": "cpp", "func_name": "cmatrixqrunpackr", "code": "void cmatrixqrunpackr(/* Complex */ ae_matrix *a,\n                                    ae_int_t m,\n                                    ae_int_t n,\n    /* Complex */ ae_matrix *r,\n                                    ae_state *_state) {\n  ae_int_t i;\n  ae_int_t k;\n\n  ae_matrix_clear(r);\n\n  if (m <= 0 || n <= 0) {\n    return;\n  }\n  k = ae_minint(m, n, _state);\n  ae_matrix_set_length(r, m, n, _state);\n  for (i = 0; i <= n - 1; i++) {\n    r->ptr.pp_complex[0][i] = ae_complex_from_i(0);\n  }\n  for (i = 1; i <= m - 1; i++) {\n    ae_v_cmove(&r->ptr.pp_complex[i][0], 1, &r->ptr.pp_complex[0][0], 1, \"N\", ae_v_len(0, n - 1));\n  }\n  for (i = 0; i <= k - 1; i++) {\n    ae_v_cmove(&r->ptr.pp_complex[i][i], 1, &a->ptr.pp_complex[i][i], 1, \"N\", ae_v_len(i, n - 1));\n  }\n}", "docstring": "/*************************************************************************\nUnpacking of matrix R from the QR decomposition of a matrix A\n\nInput parameters:\n    A       -   matrices Q and R in compact form.\n                Output of CMatrixQR subroutine.\n    M       -   number of rows in given matrix A. M>=0.\n    N       -   number of columns in given matrix A. N>=0.\n\nOutput parameters:\n    R       -   matrix R, array[0..M-1, 0..N-1].\n\n  -- ALGLIB routine --\n     17.02.2010\n     Bochkanov Sergey\n*************************************************************************/", "url": "https://github.com/Xrvitd/GCNO/blob/bcae63774a2ecd72f862a76eab570ab6d1ffe432/src/Optimization/ALGLIB/linalg.cpp#L35642-L35666", "sha": "bcae63774a2ecd72f862a76eab570ab6d1ffe432"}260{"repo_name": "GCNO", "dataset": "github_2023", "owner": "Xrvitd", "lang": "cpp", "func_name": "minnsrestartfrom", "code": "void minnsrestartfrom(const minnsstate &state, const real_1d_array &x, const xparams _xparams)\n{\n    jmp_buf _break_jump;\n    alglib_impl::ae_state _alglib_env_state;\n    alglib_impl::ae_state_init(&_alglib_env_state);\n    if( setjmp(_break_jump) )\n    {\n#if !defined(AE_NO_EXCEPTIONS)\n        _ALGLIB_CPP_EXCEPTION(_alglib_env_state.error_msg);\n#else\n        _ALGLIB_SET_ERROR_FLAG(_alglib_env_state.error_msg);\n        return;\n#endif\n    }\n    ae_state_set_break_jump(&_alglib_env_state, &_break_jump);\n    if( _xparams.flags!=0x0 )\n        ae_state_set_flags(&_alglib_env_state, _xparams.flags);\n    alglib_impl::minnsrestartfrom(const_cast<alglib_impl::minnsstate*>(state.c_ptr()), const_cast<alglib_impl::ae_vector*>(x.c_ptr()), &_alglib_env_state);\n    alglib_impl::ae_state_clear(&_alglib_env_state);\n    return;\n}", "docstring": "/*************************************************************************\nThis subroutine restarts algorithm from new point.\nAll optimization parameters (including constraints) are left unchanged.\n\nThis  function  allows  to  solve multiple  optimization  problems  (which\nmust have  same number of dimensions) without object reallocation penalty.\n\nINPUT PARAMETERS:\n    State   -   structure previously allocated with minnscreate() call.\n    X       -   new starting point.\n\n  -- ALGLIB --\n     Copyright 18.05.2015 by Bochkanov Sergey\n*************************************************************************/", "url": "https://github.com/Xrvitd/GCNO/blob/bcae63774a2ecd72f862a76eab570ab6d1ffe432/src/Optimization/ALGLIB/optimization.cpp#L13529-L13549", "sha": "bcae63774a2ecd72f862a76eab570ab6d1ffe432"}261{"repo_name": "GCNO", "dataset": "github_2023", "owner": "Xrvitd", "lang": "cpp", "func_name": "invfdistribution", "code": "double invfdistribution(const ae_int_t a, const ae_int_t b, const double y, const xparams _xparams) {\n  jmp_buf _break_jump;\n  alglib_impl::ae_state _alglib_env_state;\n  alglib_impl::ae_state_init(&_alglib_env_state);\n  if (setjmp(_break_jump)) {\n#if !defined(AE_NO_EXCEPTIONS)\n    _ALGLIB_CPP_EXCEPTION(_alglib_env_state.error_msg);\n#else\n                                                                                                                            _ALGLIB_SET_ERROR_FLAG(_alglib_env_state.error_msg);\n        return 0;\n#endif\n  }\n  ae_state_set_break_jump(&_alglib_env_state, &_break_jump);\n  if (_xparams.flags != 0x0)\n    ae_state_set_flags(&_alglib_env_state, _xparams.flags);\n  double result = alglib_impl::invfdistribution(a, b, y, &_alglib_env_state);\n  alglib_impl::ae_state_clear(&_alglib_env_state);\n  return *(reinterpret_cast<double *>(&result));\n}", "docstring": "/*************************************************************************\nInverse of complemented F distribution\n\nFinds the F density argument x such that the integral\nfrom x to infinity of the F density is equal to the\ngiven probability p.\n\nThis is accomplished using the inverse beta integral\nfunction and the relations\n\n     z = incbi( df2/2, df1/2, p )\n     x = df2 (1-z) / (df1 z).\n\nNote: the following relations hold for the inverse of\nthe uncomplemented F distribution:\n\n     z = incbi( df1/2, df2/2, p )\n     x = df2 z / (df1 (1-z)).\n\nACCURACY:\n\nTested at random points (a,b,p).\n\n             a,b                     Relative error:\narithmetic  domain     # trials      peak         rms\n For p between .001 and 1:\n   IEEE     1,100       100000      8.3e-15     4.7e-16\n   IEEE     1,10000     100000      2.1e-11     1.4e-13\n For p between 10^-6 and 10^-3:\n   IEEE     1,100        50000      1.3e-12     8.4e-15\n   IEEE     1,10000      50000      3.0e-12     4.8e-14\n\nCephes Math Library Release 2.8:  June, 2000\nCopyright 1984, 1987, 1995, 2000 by Stephen L. Moshier\n*************************************************************************/", "url": "https://github.com/Xrvitd/GCNO/blob/bcae63774a2ecd72f862a76eab570ab6d1ffe432/src/Optimization/ALGLIB/specialfunctions.cpp#L2156-L2174", "sha": "bcae63774a2ecd72f862a76eab570ab6d1ffe432"}262{"repo_name": "DaisySeedProjects", "dataset": "github_2023", "owner": "bkshepherd", "lang": "cpp", "func_name": "DelayModule::~DelayModule", "code": "DelayModule::~DelayModule() {\n    // No Code Needed\n}", "docstring": "// Destructor", "url": "https://github.com/bkshepherd/DaisySeedProjects/blob/c95af83f75aa866f1a8e12be56920ca11d76cf93/Software/GuitarPedal/Effect-Modules/delay_module.cpp#L140-L142", "sha": "c95af83f75aa866f1a8e12be56920ca11d76cf93"}263{"repo_name": "sv06", "dataset": "github_2023", "owner": "hillsoftware", "lang": "cpp", "func_name": "FWRetract::M208", "code": "void FWRetract::M208() {\n  if (!parser.seen(\"FSRW\")) return M208_report();\n  if (parser.seen('S')) settings.retract_recover_extra              = parser.value_axis_units(E_AXIS);\n  if (parser.seen('F')) settings.retract_recover_feedrate_mm_s      = MMM_TO_MMS(parser.value_axis_units(E_AXIS));\n  if (parser.seen('R')) settings.swap_retract_recover_feedrate_mm_s = MMM_TO_MMS(parser.value_axis_units(E_AXIS));\n  if (parser.seen('W')) settings.swap_retract_recover_extra         = parser.value_axis_units(E_AXIS);\n}", "docstring": "/**\n * M208: Set firmware un-retraction values\n *\n *   S[+units]    retract_recover_extra (in addition to M207 S*)\n *   W[+units]    swap_retract_recover_extra (multi-extruder)\n *   F[units/min] retract_recover_feedrate_mm_s\n *   R[units/min] swap_retract_recover_feedrate_mm_s\n */", "url": "https://github.com/hillsoftware/sv06/blob/00d5ee302758703c9a959309716b5f720d750afc/Marlin/src/feature/fwretract.cpp#L233-L239", "sha": "00d5ee302758703c9a959309716b5f720d750afc"}264{"repo_name": "sv06", "dataset": "github_2023", "owner": "hillsoftware", "lang": "cpp", "func_name": "fontgroup_drawstring", "code": "static void fontgroup_drawstring(font_group_t *group, const font_t *fnt_default, const char *utf8_msg, read_byte_cb_t cb_read_byte, void * userdata, fontgroup_cb_draw_t cb_draw_ram) {\n  const uint8_t *p = (uint8_t*)utf8_msg;\n  for (;;) {\n    lchar_t wc;\n    p = get_utf8_value_cb(p, cb_read_byte, wc);\n    if (!wc) break;\n    fontgroup_drawwchar(group, fnt_default, wc, userdata, cb_draw_ram);\n  }\n}", "docstring": "/**\n * @brief try to process a utf8 string\n *\n * @param pu8g : U8G pointer\n * @param fnt_default : the default font\n * @param utf8_msg : the UTF-8 string\n * @param cb_read_byte : how to read the utf8_msg, from RAM or ROM (call read_byte_ram or pgm_read_byte)\n * @param userdata : User's data\n * @param cb_draw_ram : the callback function of userdata to draw a !RAM! string (actually it is to draw a one byte string in RAM)\n *\n * @return N/A\n *\n * Get the screen pixel width of a ROM UTF-8 string\n */", "url": "https://github.com/hillsoftware/sv06/blob/00d5ee302758703c9a959309716b5f720d750afc/Marlin/src/lcd/dogm/u8g_fontutf8.cpp#L106-L114", "sha": "00d5ee302758703c9a959309716b5f720d750afc"}265{"repo_name": "sv06", "dataset": "github_2023", "owner": "hillsoftware", "lang": "cpp", "func_name": "MarlinUI::init_lcd", "code": "void MarlinUI::init_lcd() { DWIN_Startup(); }", "docstring": "// Initialize or re-initialize the LCD", "url": "https://github.com/hillsoftware/sv06/blob/00d5ee302758703c9a959309716b5f720d750afc/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp#L82-L82", "sha": "00d5ee302758703c9a959309716b5f720d750afc"}266{"repo_name": "sv06", "dataset": "github_2023", "owner": "hillsoftware", "lang": "cpp", "func_name": "DWIN_Print_Header", "code": "void DWIN_Print_Header(const char *text = nullptr) {\n  static char headertxt[31] = \"\";  // Print header text\n  if (text) {\n    const int8_t size = _MIN(30U, strlen_P(text));\n    LOOP_L_N(i, size) headertxt[i] = text[i];\n    headertxt[size] = '\\0';\n  }\n  if (checkkey == PrintProcess || checkkey == PrintDone) {\n    DWIN_Draw_Rectangle(1, HMI_data.Background_Color, 0, 60, DWIN_WIDTH, 60+16);\n    DWINUI::Draw_CenteredString(60, headertxt);\n  }\n}", "docstring": "// Update filename on print", "url": "https://github.com/hillsoftware/sv06/blob/00d5ee302758703c9a959309716b5f720d750afc/Marlin/src/lcd/e3v2/proui/dwin.cpp#L601-L612", "sha": "00d5ee302758703c9a959309716b5f720d750afc"}267{"repo_name": "bemanitools", "dataset": "github_2023", "owner": "djhackersdev", "lang": "cpp", "func_name": "ImGui::DockContextNewFrameUpdateUndocking", "code": "void ImGui::DockContextNewFrameUpdateUndocking(ImGuiContext* ctx)\n{\n    ImGuiContext& g = *ctx;\n    ImGuiDockContext* dc = &ctx->DockContext;\n    if (!(g.IO.ConfigFlags & ImGuiConfigFlags_DockingEnable))\n    {\n        if (dc->Nodes.Data.Size > 0 || dc->Requests.Size > 0)\n            DockContextClearNodes(ctx, 0, true);\n        return;\n    }\n\n    // Setting NoSplit at runtime merges all nodes\n    if (g.IO.ConfigDockingNoSplit)\n        for (int n = 0; n < dc->Nodes.Data.Size; n++)\n            if (ImGuiDockNode* node = (ImGuiDockNode*)dc->Nodes.Data[n].val_p)\n                if (node->IsRootNode() && node->IsSplitNode())\n                {\n                    DockBuilderRemoveNodeChildNodes(node->ID);\n                    //dc->WantFullRebuild = true;\n                }\n\n    // Process full rebuild\n#if 0\n    if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_C)))\n        dc->WantFullRebuild = true;\n#endif\n    if (dc->WantFullRebuild)\n    {\n        DockContextRebuildNodes(ctx);\n        dc->WantFullRebuild = false;\n    }\n\n    // Process Undocking requests (we need to process them _before_ the UpdateMouseMovingWindowNewFrame call in NewFrame)\n    for (ImGuiDockRequest& req : dc->Requests)\n    {\n        if (req.Type == ImGuiDockRequestType_Undock && req.UndockTargetWindow)\n            DockContextProcessUndockWindow(ctx, req.UndockTargetWindow);\n        else if (req.Type == ImGuiDockRequestType_Undock && req.UndockTargetNode)\n            DockContextProcessUndockNode(ctx, req.UndockTargetNode);\n    }\n}", "docstring": "// Docking context update function, called by NewFrame()", "url": "https://github.com/djhackersdev/bemanitools/blob/e0ff83f664f9282bca2fd5ddf1b4dc8cfa392c0a/src/main/imgui/imgui.cpp#L16843-L16883", "sha": "e0ff83f664f9282bca2fd5ddf1b4dc8cfa392c0a"}268{"repo_name": "UltimateStarterKit", "dataset": "github_2023", "owner": "hfjooste", "lang": "cpp", "func_name": "UDialogueEntry::PreEditChange", "code": "void UDialogueEntry::PreEditChange(FProperty* PropertyAboutToChange)\n{\n\tSuper::PreEditChange(PropertyAboutToChange);\n\tif (PropertyAboutToChange->GetFName() != GET_MEMBER_NAME_CHECKED(UDialogueEntry, Transition) ||\n\t\tEdges.Num() == 0)\n\t{\n\t\treturn;\n\t}\n\n\tconst FString Message = \"Are you sure you want to update the transition type? \"\n\t\t\t\t\t\"This will break all connections from the current node\";\n\tif (FMessageDialog::Open(EAppMsgType::YesNo, FText::FromString(Message)) != EAppReturnType::Yes)\n\t{\n\t\tBlockTransitionUpdate = true;\n\t\tPreviousTransition = Transition;\n\t}\t\n}", "docstring": "/**\n * @brief This is called when a property is about to be modified externally\n * @param PropertyAboutToChange The property that is about to be modified\n */", "url": "https://github.com/hfjooste/UltimateStarterKit/blob/f8ba35499f4f9a0053abad502ff808d7a8c898ec/Plugins/USK/Source/USK/Dialogue/DialogueEntry.cpp#L40-L56", "sha": "f8ba35499f4f9a0053abad502ff808d7a8c898ec"}269{"repo_name": "UltimateStarterKit", "dataset": "github_2023", "owner": "hfjooste", "lang": "cpp", "func_name": "UFpsCounter::UpdateVisibility", "code": "void UFpsCounter::UpdateVisibility(bool IsVisible)\n{\n\tconst bool WasHidden = GetVisibility() == ESlateVisibility::Collapsed ||\n\t\tGetVisibility() == ESlateVisibility::Hidden; \n\tUSK_LOG_INFO(*FString::Format(TEXT(\"Updating visibility to {0}\"), { IsVisible }));\n\tSetVisibility(IsVisible ? ESlateVisibility::Visible : ESlateVisibility::Collapsed);\n\n\tif (WasHidden && IsVisible)\n\t{\n\t\tUpdateFramerateAfterDelay();\n\t}\n}", "docstring": "/**\n * @brief Update the visibility of the widget\n * @param IsVisible Is the widget visible?\n */", "url": "https://github.com/hfjooste/UltimateStarterKit/blob/f8ba35499f4f9a0053abad502ff808d7a8c898ec/Plugins/USK/Source/USK/Widgets/FpsCounter.cpp#L17-L28", "sha": "f8ba35499f4f9a0053abad502ff808d7a8c898ec"}270{"repo_name": "BlueSCSI-v2", "dataset": "github_2023", "owner": "BlueSCSI", "lang": "cpp", "func_name": "platform_get_buttons", "code": "uint8_t platform_get_buttons()\n{\n    return 0;\n}", "docstring": "// Called periodically to get the state of any buttons installed on the platform.\n// If none are installed the below function is fine.", "url": "https://github.com/BlueSCSI/BlueSCSI-v2/blob/24cc0fb957b984ebc756e5651e871bfdd2ad8168/lib/BlueSCSI_platform_template/BlueSCSI_platform.cpp#L64-L67", "sha": "24cc0fb957b984ebc756e5651e871bfdd2ad8168"}271{"repo_name": "BlueSCSI-v2", "dataset": "github_2023", "owner": "BlueSCSI", "lang": "cpp", "func_name": "onSendFilePrep", "code": "void onSendFilePrep(char * dir_name)\n{\n    char file_name[32+1];\n\n    scsiEnterPhase(DATA_OUT);\n    scsiRead(static_cast<uint8_t *>(static_cast<void *>(file_name)), 32+1, NULL);\n    file_name[32] = '\\0';\n\n    debuglog(\"TOOLBOX OPEN FILE FOR WRITE: '\", file_name, \"'\");\n    SD.chdir(dir_name);\n    gFile.open(file_name, FILE_WRITE);\n    SD.chdir(\"/\");\n    if(gFile.isOpen() && gFile.isWritable())\n    {\n        gFile.rewind();\n        gFile.sync();\n        // do i need to manually set phase to status here?\n        return;\n    } else {\n        gFile.close();\n        scsiDev.status = CHECK_CONDITION;\n        scsiDev.target->sense.code = ILLEGAL_REQUEST;\n        //SCSI_ASC_INVALID_FIELD_IN_CDB\n        scsiDev.phase = STATUS;\n    }\n}", "docstring": "/*\n  Prepares a file for receiving. The file name is null terminated in the scsi data.\n*/", "url": "https://github.com/BlueSCSI/BlueSCSI-v2/blob/24cc0fb957b984ebc756e5651e871bfdd2ad8168/src/BlueSCSI_Toolbox.cpp#L251-L276", "sha": "24cc0fb957b984ebc756e5651e871bfdd2ad8168"}272{"repo_name": "FPGA_Library", "dataset": "github_2023", "owner": "suisuisi", "lang": "cpp", "func_name": "MTFS::CreateDir", "code": "bool MTFS::CreateDir(char * szDir) {\n\tPRM1B\tprm;\n\n\t/* Error check that the file name length is acceptable.\n\t*/\n\tif (!mtds.FCheckName(szDir, clsCmdFs, cmdFsMkdir)) {\n\t\treturn false;\n\t}\n\n\t/* Send the command packet.\n\t*/\n\tprm.valB1 = strlen(szDir)+1;\n\n\tmtds.MtdsProcessCmdWr(clsCmdFs, cmdFsMkdir, sizeof(prm), (uint8_t *)&prm,\n\t\t\t\t\t\tprm.valB1, (uint8_t *)szDir);\n\n\t/* Check for error and return failure.\n\t*/\n\tif (prhdrMtdsRet->sta != staCmdSuccess) {\n\t\treturn false;\n\t}\n\n\t/* Return success.\n\t*/\n\treturn true;\n\n}", "docstring": "/* ------------------------------------------------------------ */\n/***\tMTFS::CreateDir(szDir)\n**\n**\tParameters:\n**\t\tszDir\t\t- path string of directory to create\n**\n**\tReturn Values:\n**\t\tnone\n**\n**\tErrors:\n**\t\tReturns true if successful, false if not.\n**\n**\tDescription:\n**\t\tCreate the specified directory.\n*/", "url": "https://github.com/suisuisi/FPGA_Library/blob/1e33525198872d63ced48e8f0cebaa2419b9eb22/ThreePart/digilent_ip/ip/Pmods/PmodMTDS_v1_0/drivers/PmodMTDS_v1_0/src/MtdsFs.cpp#L285-L311", "sha": "1e33525198872d63ced48e8f0cebaa2419b9eb22"}273{"repo_name": "FPGA_Library", "dataset": "github_2023", "owner": "suisuisi", "lang": "cpp", "func_name": "MTDS::GetTchMoveDelta", "code": "bool MTDS::GetTchMoveDelta(int16_t * pdxco, int16_t * pdyco) {\n\tRET4B *\tpret = (RET4B *)&rgbMtdsRetVal[sizeof(RHDR)];\n\n\t/* Send the command packet.\n\t*/\n\tMtdsProcessCmdWr(clsCmdUtil, cmdUtilGetTchMoveDelta, 0, 0, 0, 0);\n\n\t/* Check for error and return failure if so.\n\t*/\n\tif (prhdrMtdsRet->sta != staCmdSuccess) {\n\t\treturn false;\n\t}\n\n\t/* Return the touch panel threshold settings.\n\t*/\n\tif (pdxco != 0) {\n\t\t*pdxco = pret->valB1;\n\t}\n\tif (pdyco != 0) {\n\t\t*pdyco = pret->valB2;\n\t}\n\treturn true;\n\n}", "docstring": "/* ------------------------------------------------------------ */\n/***\tMTDS::GetTchMoveDelta(pdxco, pdyco)\n**\n**\tParameters:\n**\t\tpdxco\t- pointer to variable to receive touch dxco threshold\n**\t\tpdyco\t- pointer to variable to receive touch dyco threshold\n**\n**\tReturn Values:\n**\t\tReturns the current touch panel finger move threshold delta values\n**\n**\tErrors:\n**\t\tReturns true if successful, false if error.\n**\n**\tDescription:\n**\t\tReturns the current finger move delta thresholds for the touch panel.\n*/", "url": "https://github.com/suisuisi/FPGA_Library/blob/1e33525198872d63ced48e8f0cebaa2419b9eb22/ThreePart/digilent_ip/ip/Pmods/PmodMTDS_v1_0/drivers/PmodMTDS_v1_0/src/MtdsUtil.cpp#L661-L684", "sha": "1e33525198872d63ced48e8f0cebaa2419b9eb22"}274{"repo_name": "FPGA_Library", "dataset": "github_2023", "owner": "suisuisi", "lang": "cpp", "func_name": "MTDS::end", "code": "void MTDS::end() {\n\n\tfInitialized = false;\n\n}", "docstring": "/* ------------------------------------------------------------ */\n/***\tMTDS::end()\n**\n**\tParameters:\n**\t\tnone\n**\n**\tReturn Values:\n**\t\tnone\n**\n**\tErrors:\n**\t\tnone\n**\n**\tDescription:\n**\t\tTell the display shield that we aren't interested in talking to it anymore.\n**\t\tAfter calling this, it is necessary to call MTDS::begin() in order to start\n**\t\tusing it again.\n*/", "url": "https://github.com/suisuisi/FPGA_Library/blob/1e33525198872d63ced48e8f0cebaa2419b9eb22/ThreePart/digilent_ip/ip/Pmods/PmodMTDS_v1_0/drivers/PmodMTDS_v1_0/src/mtds.cpp#L229-L233", "sha": "1e33525198872d63ced48e8f0cebaa2419b9eb22"}275{"repo_name": "DengFOC_Lib", "dataset": "github_2023", "owner": "ToanTech", "lang": "cpp", "func_name": "readTwoBytes", "code": "word readTwoBytes(int in_adr_hi, int in_adr_lo)\n{\n  word retVal = -1;\n \n  /* ่ฏปไฝŽไฝ */\n  Wire.beginTransmission(_ams5600_Address);\n  Wire.write(in_adr_lo);\n  Wire.endTransmission();\n  Wire.requestFrom(_ams5600_Address, 1);\n  while(Wire.available() == 0);\n  int low = Wire.read();\n \n  /* ่ฏป้ซ˜ไฝ */  \n  Wire.beginTransmission(_ams5600_Address);\n  Wire.write(in_adr_hi);\n  Wire.endTransmission();\n  Wire.requestFrom(_ams5600_Address, 1);\n  while(Wire.available() == 0);\n  int high = Wire.read();\n  \n  retVal = (high << 8) | low;\n  \n  return retVal;\n}", "docstring": "//readTwoBytes(int in_adr_hi, int in_adr_lo)่ฟ™ๆฎตไปฃ็ ๆ˜ฏไธ€ไธชๅ‡ฝๆ•ฐ๏ผŒๅ…ถ็›ฎ็š„ๆ˜ฏไปŽI2C่ฎพๅค‡๏ผˆๅœจไปฃ็ ไธญ็š„ๅ˜้‡ๅไธบ_ams5600_Address๏ผ‰ไธญ่ฏปๅ–ไธคไธชๅญ—่Š‚ๆ•ฐๆฎ๏ผŒๅนถๅฐ†ๅ…ถๅˆๅนถๆˆไธ€ไธช16ไฝ็š„ๆ— ็ฌฆๅทๆ•ดๆ•ฐ่ฟ”ๅ›žใ€‚\n//ๅ…ทไฝ“ๆฅ่ฏด๏ผŒๅ‡ฝๆ•ฐๆŽฅๅ—ไธคไธชๆ•ดๅž‹ๅ‚ๆ•ฐin_adr_hiๅ’Œin_adr_lo๏ผŒๅฎƒไปฌ็”จไบŽๆŒ‡ๅฎš้œ€่ฆ่ฏปๅ–็š„ไธคไธชๅญ—่Š‚ๆ•ฐๆฎ็š„ๅœฐๅ€ใ€‚ๅ‡ฝๆ•ฐไธญ้ฆ–ๅ…ˆ้€š่ฟ‡Wireๅบ“ๅผ€ๅง‹I2Cไผ ่พ“๏ผŒๅ‘่ฎพๅค‡ๅ†™ๅ…ฅin_adr_loๅ’Œin_adr_hiๅˆ†ๅˆซไฝœไธบๆ•ฐๆฎๅœฐๅ€๏ผŒ็„ถๅŽ่ฏปๅ–็›ธๅบ”็š„ๅญ—่Š‚ๆ•ฐๆฎใ€‚\n//ๅœจๆฏไธชWire.requestFrom()่ฐƒ็”จไน‹ๅŽ๏ผŒ้€š่ฟ‡ไธ€ไธชwhileๅพช็Žฏ็ญ‰ๅพ…ๆ•ฐๆฎๆŽฅๆ”ถๅฎŒๆฏ•ใ€‚็„ถๅŽ่ฏปๅ–ๆŽฅๆ”ถๅˆฐ็š„ไฝŽๅญ—่Š‚ๅ’Œ้ซ˜ๅญ—่Š‚๏ผŒๅนถไฝฟ็”จไฝ่ฟ็ฎ—ๅฐ†ๅฎƒไปฌๅˆๅนถๆˆไธ€ไธช16ไฝ็š„ๆ— ็ฌฆๅทๆ•ดๆ•ฐใ€‚\n//ๆœ€ๅŽ๏ผŒ่ฟ”ๅ›žๅˆๅนถๅŽ็š„ๆ•ดๆ•ฐใ€‚ๅฆ‚ๆžœ่ฏปๅ–่ฟ‡็จ‹ไธญๅ‡บ็Žฐ้”™่ฏฏๆˆ–่€…ๅ‡ฝๆ•ฐๆฒกๆœ‰ๆˆๅŠŸ่ฏปๅ–ๅˆฐๆ•ฐๆฎ๏ผŒๅˆ™ๅ‡ฝๆ•ฐ่ฟ”ๅ›ž-1ใ€‚", "url": "https://github.com/ToanTech/DengFOC_Lib/blob/8494ec97ea240691472a36fe3282c00fefcf32e2/DengFOC ๅบ“/V0.1 ็”ตๅŽ‹ๅŠ›็Ÿฉ ไฝ็ฝฎ้—ญ็Žฏ/AS5600.cpp#L27-L50", "sha": "8494ec97ea240691472a36fe3282c00fefcf32e2"}276{"repo_name": "ESPectrum", "dataset": "github_2023", "owner": "EremusOne", "lang": "cpp", "func_name": "VIA6522::VIA6522", "code": "VIA6522::VIA6522(int tag)\n  : m_tag(tag)\n{\n  #if DEBUG6522\n  m_tick = 0;\n  #endif\n}", "docstring": "/////////////////////////////////////////////////////////////////////////////////////////////\n// VIA (6522 - Versatile Interface Adapter)", "url": "https://github.com/EremusOne/ESPectrum/blob/a501be723a08f3817787cd90fe77a45b476e38a4/components/fabgl/src/emudevs/VIA6522.cpp#L45-L51", "sha": "a501be723a08f3817787cd90fe77a45b476e38a4"}277{"repo_name": "ESPectrum", "dataset": "github_2023", "owner": "EremusOne", "lang": "cpp", "func_name": "OSD::pref_rom_menu", "code": "void OSD::pref_rom_menu() {\n\n    menu_curopt = 1;\n    menu_saverect = true;\n\n    while (1) {\n\n        menu_level = 2;\n        uint8_t opt2 = menuRun(MENU_ROM_PREF[Config::lang]);\n\n        if (opt2) {\n\n            menu_level = 3;\n            menu_curopt = 1;\n            menu_saverect = true;\n\n            if (opt2 == 1) {\n\n                const string menu_res[] = {\"48K\",\"48Kes\",\"48Kcs\",\"Last\"};\n\n                while (1) {\n\n                    string rpref_menu = MENU_ROM_PREF_48[Config::lang];\n\n                    menu_curopt = prepare_checkbox_menu(rpref_menu,Config::pref_romSet_48);\n\n                    int opt3 = menuRun(rpref_menu);\n                    menu_saverect = false;\n\n                    if (opt3 == 0) break;\n\n                    if (opt3 != menu_curopt) {\n                        Config::pref_romSet_48 = menu_res[opt3 - 1];\n                        Config::save(\"pref_romSet_48\");\n                    }\n\n                }\n\n            } else if (opt2 == 2) {\n\n                const string menu_res[] = {\"128K\",\"128Kes\",\"+2\",\"+2es\",\"ZX81+\",\"128Kcs\",\"Last\"};\n\n                while (1) {\n\n                    string rpref_menu = MENU_ROM_PREF_128[Config::lang];\n\n                    menu_curopt = prepare_checkbox_menu(rpref_menu,Config::pref_romSet_128);\n\n                    int opt3 = menuRun(rpref_menu);\n                    menu_saverect = false;\n\n                    if (opt3 == 0) break;\n\n                    if (opt3 != menu_curopt) {\n                        Config::pref_romSet_128 = menu_res[opt3 - 1];\n                        Config::save(\"pref_romSet_128\");\n                    }\n\n                }\n\n            } else if (opt2 == 3) {\n\n                const string menu_res[] = {\"v1es\",\"v1pt\",\"v2es\",\"v2pt\",\"v3es\",\"v3pt\",\"v3en\",\"TKcs\",\"Last\"};\n\n                while (1) {\n\n                    string rpref_menu = MENU_ROM_PREF_TK90X[Config::lang];\n\n                    menu_curopt = prepare_checkbox_menu(rpref_menu,Config::pref_romSet_TK90X);\n\n                    int opt3 = menuRun(rpref_menu);\n                    menu_saverect = false;\n\n                    if (opt3 == 0) break;\n\n                    if (opt3 != menu_curopt) {\n                        Config::pref_romSet_TK90X = menu_res[opt3 - 1];\n                        Config::save(\"pref_romSet_TK90X\");\n                    }\n\n                }\n\n            } else if (opt2 == 4) {\n\n                const string menu_res[] = {\"95es\",\"95pt\",\"Last\"};\n\n                while (1) {\n\n                    string rpref_menu = MENU_ROM_PREF_TK95[Config::lang];\n\n                    menu_curopt = prepare_checkbox_menu(rpref_menu,Config::pref_romSet_TK95);\n\n                    int opt3 = menuRun(rpref_menu);\n                    menu_saverect = false;\n\n                    if (opt3 == 0) break;\n\n                    if (opt3 != menu_curopt) {\n                        Config::pref_romSet_TK95 = menu_res[opt3 - 1];\n                        Config::save(\"pref_romSet_TK95\");\n                    }\n\n                }\n\n            }\n\n            menu_curopt = opt2;\n            menu_saverect = false;\n\n        } else\n            break;\n\n    }\n\n    menu_curopt = 3;\n\n}", "docstring": "// *******************************************************************************************************\n// PREFERRED ROM MENU\n// *******************************************************************************************************", "url": "https://github.com/EremusOne/ESPectrum/blob/a501be723a08f3817787cd90fe77a45b476e38a4/src/OSDMain.cpp#L674-L790", "sha": "a501be723a08f3817787cd90fe77a45b476e38a4"}278{"repo_name": "ps4-ezremote-client", "dataset": "github_2023", "owner": "cy33hc", "lang": "cpp", "func_name": "FtpClient::Noop", "code": "bool FtpClient::Noop()\n{\n\tif (!FtpSendCmd(\"NOOP\", \"25\", mp_ftphandle))\n\t\treturn 0;\n\treturn 1;\n}", "docstring": "/*\n * send a NOOP cmd to keep connection alive\n *\n * return 1 if successful, 0 otherwise\n */", "url": "https://github.com/cy33hc/ps4-ezremote-client/blob/b7fe46cb94310f8591275d3c34107b5944137a4a/source/clients/ftpclient.cpp#L1190-L1195", "sha": "b7fe46cb94310f8591275d3c34107b5944137a4a"}279{"repo_name": "d2gl", "dataset": "github_2023", "owner": "bayaraa", "lang": "cpp", "func_name": "ImBezierCubicClosestPoint", "code": "ImVec2 ImBezierCubicClosestPoint(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, const ImVec2& p, int num_segments)\n{\n    IM_ASSERT(num_segments > 0); // Use ImBezierCubicClosestPointCasteljau()\n    ImVec2 p_last = p1;\n    ImVec2 p_closest;\n    float p_closest_dist2 = FLT_MAX;\n    float t_step = 1.0f / (float)num_segments;\n    for (int i_step = 1; i_step <= num_segments; i_step++)\n    {\n        ImVec2 p_current = ImBezierCubicCalc(p1, p2, p3, p4, t_step * i_step);\n        ImVec2 p_line = ImLineClosestPoint(p_last, p_current, p);\n        float dist2 = ImLengthSqr(p - p_line);\n        if (dist2 < p_closest_dist2)\n        {\n            p_closest = p_line;\n            p_closest_dist2 = dist2;\n        }\n        p_last = p_current;\n    }\n    return p_closest;\n}", "docstring": "//-----------------------------------------------------------------------------\n// [SECTION] MISC HELPERS/UTILITIES (Geometry functions)\n//-----------------------------------------------------------------------------", "url": "https://github.com/bayaraa/d2gl/blob/919df3528de5c5c1b41b326cf68821cd1981c42c/d2gl/vendor/include/imgui/imgui.cpp#L1510-L1530", "sha": "919df3528de5c5c1b41b326cf68821cd1981c42c"}280{"repo_name": "d2gl", "dataset": "github_2023", "owner": "bayaraa", "lang": "cpp", "func_name": "FindHoveredWindow", "code": "static void FindHoveredWindow()\n{\n    ImGuiContext& g = *GImGui;\n\n    ImGuiWindow* hovered_window = NULL;\n    ImGuiWindow* hovered_window_ignoring_moving_window = NULL;\n    if (g.MovingWindow && !(g.MovingWindow->Flags & ImGuiWindowFlags_NoMouseInputs))\n        hovered_window = g.MovingWindow;\n\n    ImVec2 padding_regular = g.Style.TouchExtraPadding;\n    ImVec2 padding_for_resize = g.IO.ConfigWindowsResizeFromEdges ? g.WindowsHoverPadding : padding_regular;\n    for (int i = g.Windows.Size - 1; i >= 0; i--)\n    {\n        ImGuiWindow* window = g.Windows[i];\n        IM_MSVC_WARNING_SUPPRESS(28182); // [Static Analyzer] Dereferencing NULL pointer.\n        if (!window->Active || window->Hidden)\n            continue;\n        if (window->Flags & ImGuiWindowFlags_NoMouseInputs)\n            continue;\n\n        // Using the clipped AABB, a child window will typically be clipped by its parent (not always)\n        ImRect bb(window->OuterRectClipped);\n        if (window->Flags & (ImGuiWindowFlags_ChildWindow | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_AlwaysAutoResize))\n            bb.Expand(padding_regular);\n        else\n            bb.Expand(padding_for_resize);\n        if (!bb.Contains(g.IO.MousePos))\n            continue;\n\n        // Support for one rectangular hole in any given window\n        // FIXME: Consider generalizing hit-testing override (with more generic data, callback, etc.) (#1512)\n        if (window->HitTestHoleSize.x != 0)\n        {\n            ImVec2 hole_pos(window->Pos.x + (float)window->HitTestHoleOffset.x, window->Pos.y + (float)window->HitTestHoleOffset.y);\n            ImVec2 hole_size((float)window->HitTestHoleSize.x, (float)window->HitTestHoleSize.y);\n            if (ImRect(hole_pos, hole_pos + hole_size).Contains(g.IO.MousePos))\n                continue;\n        }\n\n        if (hovered_window == NULL)\n            hovered_window = window;\n        IM_MSVC_WARNING_SUPPRESS(28182); // [Static Analyzer] Dereferencing NULL pointer.\n        if (hovered_window_ignoring_moving_window == NULL && (!g.MovingWindow || window->RootWindow != g.MovingWindow->RootWindow))\n            hovered_window_ignoring_moving_window = window;\n        if (hovered_window && hovered_window_ignoring_moving_window)\n            break;\n    }\n\n    g.HoveredWindow = hovered_window;\n    g.HoveredWindowUnderMovingWindow = hovered_window_ignoring_moving_window;\n}", "docstring": "// Find window given position, search front-to-back\n// FIXME: Note that we have an inconsequential lag here: OuterRectClipped is updated in Begin(), so windows moved programmatically\n// with SetWindowPos() and not SetNextWindowPos() will have that rectangle lagging by a frame at the time FindHoveredWindow() is\n// called, aka before the next Begin(). Moving window isn't affected.", "url": "https://github.com/bayaraa/d2gl/blob/919df3528de5c5c1b41b326cf68821cd1981c42c/d2gl/vendor/include/imgui/imgui.cpp#L4988-L5038", "sha": "919df3528de5c5c1b41b326cf68821cd1981c42c"}281{"repo_name": "dingo-store", "dataset": "github_2023", "owner": "dingodb", "lang": "cpp", "func_name": "BdbRawEngine::OpenDb", "code": "int32_t BdbRawEngine::OpenDb(Db** dbpp, const char* file_name, DbEnv* envp, uint32_t extra_flags) {\n  int ret;\n  uint32_t open_flags;\n\n  DbTxn* txn = nullptr;\n  try {\n    int ret = envp->txn_begin(nullptr, &txn, 0);\n    if (ret != 0) {\n      DINGO_LOG(ERROR) << fmt::format(\"[bdb] txn begin failed ret: {}.\", ret);\n      return -1;\n    }\n\n    bdb_transaction_alive_count << 1;\n\n    Db* db = new Db(envp, 0);\n\n    // Point to the new'd Db\n    *dbpp = db;\n    db->set_pagesize(FLAGS_bdb_page_size);\n\n    if (extra_flags != 0) {\n      ret = db->set_flags(extra_flags);\n    }\n\n    // Now open the database */\n    open_flags = DB_CREATE |        // Allow database creation\n                                    //  DB_READ_UNCOMMITTED |  // Allow uncommitted reads\n                                    //  DB_AUTO_COMMIT |   // Allow autocommit\n                 DB_MULTIVERSION |  // Multiversion concurrency control\n                 DB_THREAD;         // Cause the database to be free-threade1\n\n    db->open(txn,         // Txn pointer\n             file_name,   // File name\n             nullptr,     // Logical db name\n             DB_BTREE,    // Database type (using btree)\n             open_flags,  // Open flags\n             0);          // File mode. Using defaults\n\n    // commit\n    try {\n      ret = bdb::BdbHelper::TxnCommit(&txn);\n      if (ret == 0) {\n        return 0;\n      } else {\n        DINGO_LOG(ERROR) << fmt::format(\"[bdb] txn commit failed, ret: {}.\", ret);\n      }\n    } catch (DbException& db_exception) {\n      bdb::BdbHelper::PrintEnvStat(envp);\n      DINGO_LOG(ERROR) << fmt::format(\"[bdb] error on txn commit: {} {}.\", db_exception.get_errno(),\n                                      db_exception.what());\n      ret = -1;\n    }\n\n    if (ret != 0) {\n      DINGO_LOG(ERROR) << fmt::format(\"[bdb] error on txn commit, ret: {}.\", ret);\n      return -1;\n    }\n\n  } catch (DbException& db_exception) {\n    bdb::BdbHelper::PrintEnvStat(envp);\n    DINGO_LOG(ERROR) << fmt::format(\"OpenDb: db open failed: {} {}.\", db_exception.get_errno(), db_exception.what());\n    bdb::BdbHelper::TxnAbort(&txn);\n    return -1;\n  }\n\n  return 0;\n}", "docstring": "// namespace bdb\n// Open a BDB database", "url": "https://github.com/dingodb/dingo-store/blob/6becbfa5ab7ed9327b5b260d2390b0344918c396/src/engine/bdb_raw_engine.cc#L1886-L1952", "sha": "6becbfa5ab7ed9327b5b260d2390b0344918c396"}282{"repo_name": "dingo-store", "dataset": "github_2023", "owner": "dingodb", "lang": "cpp", "func_name": "ServiceHelper::ValidateRegionState", "code": "butil::Status ServiceHelper::ValidateRegionState(store::RegionPtr region) {\n  // Check is exist region.\n  if (region == nullptr) {\n    return butil::Status(pb::error::EREGION_NOT_FOUND, \"Not found region\");\n  }\n  if (region->State() == pb::common::StoreRegionState::NEW) {\n    return butil::Status(pb::error::EREGION_UNAVAILABLE, \"Region(%lu) is new, waiting later\", region->Id());\n  }\n  if (region->State() == pb::common::StoreRegionState::STANDBY) {\n    return butil::Status(pb::error::EREGION_UNAVAILABLE, \"Region(%lu) is standby, waiting later\", region->Id());\n  }\n  if (region->State() == pb::common::StoreRegionState::DELETING) {\n    return butil::Status(pb::error::EREGION_UNAVAILABLE, \"Region(%lu) is deleting\", region->Id());\n  }\n  if (region->State() == pb::common::StoreRegionState::DELETED) {\n    return butil::Status(pb::error::EREGION_UNAVAILABLE, \"Region(%lu) is deleted\", region->Id());\n  }\n  if (region->State() == pb::common::StoreRegionState::ORPHAN) {\n    return butil::Status(pb::error::EREGION_UNAVAILABLE, \"Region(%lu) is orphan\", region->Id());\n  }\n  if (region->State() == pb::common::StoreRegionState::TOMBSTONE) {\n    return butil::Status(pb::error::EREGION_UNAVAILABLE, \"Region(%lu) is tombstone\", region->Id());\n  }\n\n  return butil::Status();\n}", "docstring": "// Validate region state", "url": "https://github.com/dingodb/dingo-store/blob/6becbfa5ab7ed9327b5b260d2390b0344918c396/src/server/service_helper.cc#L88-L113", "sha": "6becbfa5ab7ed9327b5b260d2390b0344918c396"}283{"repo_name": "GlobalSfMpy", "dataset": "github_2023", "owner": "zhangganlin", "lang": "cpp", "func_name": "GetBoolAssertionFailureMessage", "code": "std::string GetBoolAssertionFailureMessage(\n    const AssertionResult& assertion_result,\n    const char* expression_text,\n    const char* actual_predicate_value,\n    const char* expected_predicate_value) {\n  const char* actual_message = assertion_result.message();\n  Message msg;\n  msg << \"Value of: \" << expression_text\n      << \"\\n  Actual: \" << actual_predicate_value;\n  if (actual_message[0] != '\\0')\n    msg << \" (\" << actual_message << \")\";\n  msg << \"\\nExpected: \" << expected_predicate_value;\n  return msg.GetString();\n}", "docstring": "// Constructs a failure message for Boolean assertions such as EXPECT_TRUE.", "url": "https://github.com/zhangganlin/GlobalSfMpy/blob/ac6a0564d84e1d6e9a4077195e384d379aa20492/thirdparty/TheiaSfM/libraries/gtest/src/gtest.cc#L1346-L1359", "sha": "ac6a0564d84e1d6e9a4077195e384d379aa20492"}284{"repo_name": "GlobalSfMpy", "dataset": "github_2023", "owner": "zhangganlin", "lang": "cpp", "func_name": "ParseStringFlag", "code": "bool ParseStringFlag(const char* str, const char* flag, std::string* value) {\n  // Gets the value of the flag as a string.\n  const char* const value_str = ParseFlagValue(str, flag, false);\n\n  // Aborts if the parsing failed.\n  if (value_str == NULL) return false;\n\n  // Sets *value to the value of the flag.\n  *value = value_str;\n  return true;\n}", "docstring": "// Parses a string for a string flag, in the form of\n// \"--flag=value\".\n//\n// On success, stores the value of the flag in *value, and returns\n// true.  On failure, returns false without changing *value.", "url": "https://github.com/zhangganlin/GlobalSfMpy/blob/ac6a0564d84e1d6e9a4077195e384d379aa20492/thirdparty/TheiaSfM/libraries/gtest/src/gtest.cc#L5087-L5097", "sha": "ac6a0564d84e1d6e9a4077195e384d379aa20492"}285{"repo_name": "GlobalSfMpy", "dataset": "github_2023", "owner": "zhangganlin", "lang": "cpp", "func_name": "TEST", "code": "TEST(MessageTest, StreamsString) {\n  const ::std::string str(\"Hello\");\n  EXPECT_EQ(\"Hello\", (Message() << str).GetString());\n}", "docstring": "// Tests streaming std::string.", "url": "https://github.com/zhangganlin/GlobalSfMpy/blob/ac6a0564d84e1d6e9a4077195e384d379aa20492/thirdparty/TheiaSfM/libraries/gtest/test/gtest-message_test.cc#L105-L108", "sha": "ac6a0564d84e1d6e9a4077195e384d379aa20492"}286{"repo_name": "GlobalSfMpy", "dataset": "github_2023", "owner": "zhangganlin", "lang": "cpp", "func_name": "TEST_F", "code": "TEST_F(ASSERT_PRED_FORMAT2Test, FunctorOnUserTypeSuccess) {\n  ASSERT_PRED_FORMAT2(PredFormatFunctor2(),\n                      Bool(++n1_),\n                      Bool(++n2_));\n  finished_ = true;\n}", "docstring": "// Tests a successful ASSERT_PRED_FORMAT2 where the\n// predicate-formatter is a functor on a user-defined type (Bool).", "url": "https://github.com/zhangganlin/GlobalSfMpy/blob/ac6a0564d84e1d6e9a4077195e384d379aa20492/thirdparty/TheiaSfM/libraries/gtest/test/gtest_pred_impl_unittest.cc#L835-L840", "sha": "ac6a0564d84e1d6e9a4077195e384d379aa20492"}287{"repo_name": "GlobalSfMpy", "dataset": "github_2023", "owner": "zhangganlin", "lang": "cpp", "func_name": "PredFunction3Int", "code": "bool PredFunction3Int(int v1, int v2, int v3) {\n  return v1 + v2 + v3 > 0;\n}", "docstring": "// The following two functions are needed to circumvent a bug in\n// gcc 2.95.3, which sometimes has problem with the above template\n// function.", "url": "https://github.com/zhangganlin/GlobalSfMpy/blob/ac6a0564d84e1d6e9a4077195e384d379aa20492/thirdparty/TheiaSfM/libraries/gtest/test/gtest_pred_impl_unittest.cc#L900-L902", "sha": "ac6a0564d84e1d6e9a4077195e384d379aa20492"}288{"repo_name": "GlobalSfMpy", "dataset": "github_2023", "owner": "zhangganlin", "lang": "cpp", "func_name": "TEST_F", "code": "TEST_F(DoubleTest, Infinity) {\n  EXPECT_DOUBLE_EQ(values_.infinity, values_.close_to_infinity);\n  EXPECT_DOUBLE_EQ(-values_.infinity, -values_.close_to_infinity);\n#if !GTEST_OS_SYMBIAN\n  // Nokia's STLport crashes if we try to output infinity or NaN.\n  EXPECT_NONFATAL_FAILURE(EXPECT_DOUBLE_EQ(values_.infinity, -values_.infinity),\n                          \"-values_.infinity\");\n\n  // This is interesting as the representations of infinity_ and nan1_\n  // are only 1 DLP apart.\n  EXPECT_NONFATAL_FAILURE(EXPECT_DOUBLE_EQ(values_.infinity, values_.nan1),\n                          \"values_.nan1\");\n#endif  // !GTEST_OS_SYMBIAN\n}", "docstring": "// Tests comparing with infinity.\n//\n// This ensures that no overflow occurs when comparing numbers whose\n// absolute value is very large.", "url": "https://github.com/zhangganlin/GlobalSfMpy/blob/ac6a0564d84e1d6e9a4077195e384d379aa20492/thirdparty/TheiaSfM/libraries/gtest/test/gtest_unittest.cc#L2976-L2989", "sha": "ac6a0564d84e1d6e9a4077195e384d379aa20492"}289{"repo_name": "GlobalSfMpy", "dataset": "github_2023", "owner": "zhangganlin", "lang": "cpp", "func_name": "TEST", "code": "TEST(SPRTTest, CalculateSPRTDecisionThreshold) {\n  double sigma = 0.05;\n  double epsilon = 0.1;\n  double decision_threshold = CalculateSPRTDecisionThreshold(sigma, epsilon);\n  VLOG(0) << \"Decision threshold: \" << decision_threshold;\n\n  // Test with change of values for timing.\n  decision_threshold = CalculateSPRTDecisionThreshold(sigma, epsilon, 200, 3);\n  VLOG(0) << \"Decision threshold: \" << decision_threshold;\n}", "docstring": "// TODO(cmsweeney): Make this test a verification (i.e. is the value coming out\n// accurate?) instead of just a sanity check.", "url": "https://github.com/zhangganlin/GlobalSfMpy/blob/ac6a0564d84e1d6e9a4077195e384d379aa20492/thirdparty/TheiaSfM/src/theia/math/probability/sprt_test.cc#L92-L101", "sha": "ac6a0564d84e1d6e9a4077195e384d379aa20492"}290{"repo_name": "Vita3K-Android", "dataset": "github_2023", "owner": "Vita3K", "lang": "cpp", "func_name": "decode_dual_swizzle", "code": "Swizzle4 decode_dual_swizzle(Imm4 swizz, const bool extended, const bool vec4) {\n    static Swizzle4 swizz_v4_std[] = {\n        SWIZZLE_CHANNEL_4(X, X, X, X),\n        SWIZZLE_CHANNEL_4(Y, Y, Y, Y),\n        SWIZZLE_CHANNEL_4(Z, Z, Z, Z),\n        SWIZZLE_CHANNEL_4(W, W, W, W),\n        SWIZZLE_CHANNEL_4(X, Y, Z, W),\n        SWIZZLE_CHANNEL_4(Y, Z, W, W),\n        SWIZZLE_CHANNEL_4(X, Y, Z, Z),\n        SWIZZLE_CHANNEL_4(X, X, Y, Z),\n        SWIZZLE_CHANNEL_4(X, Y, X, Y),\n        SWIZZLE_CHANNEL_4(X, Y, W, Z),\n        SWIZZLE_CHANNEL_4(Z, X, Y, W),\n        SWIZZLE_CHANNEL_4(Z, W, Z, W),\n        SWIZZLE_CHANNEL_4(0, 0, 0, 0),\n        SWIZZLE_CHANNEL_4(H, H, H, H),\n        SWIZZLE_CHANNEL_4(1, 1, 1, 1),\n        SWIZZLE_CHANNEL_4(2, 2, 2, 2),\n    };\n\n    static Swizzle4 swizz_v4_ext[] = {\n        SWIZZLE_CHANNEL_4(Y, Z, X, W),\n        SWIZZLE_CHANNEL_4(Z, W, X, Y),\n        SWIZZLE_CHANNEL_4(X, Z, W, Y),\n        SWIZZLE_CHANNEL_4(Y, Y, W, W),\n        SWIZZLE_CHANNEL_4(W, Y, Z, W),\n        SWIZZLE_CHANNEL_4(W, Z, W, Z),\n        SWIZZLE_CHANNEL_4(X, Y, Z, X),\n        SWIZZLE_CHANNEL_4(Z, Z, W, W),\n        SWIZZLE_CHANNEL_4(X, W, Z, X),\n        SWIZZLE_CHANNEL_4(Y, Y, Y, X),\n        SWIZZLE_CHANNEL_4(Y, Y, Y, Z),\n        SWIZZLE_CHANNEL_4(Z, W, Z, W),\n        SWIZZLE_CHANNEL_4(Y, Z, X, Z),\n        SWIZZLE_CHANNEL_4(X, X, Y, Y),\n        SWIZZLE_CHANNEL_4(X, Z, W, W),\n        SWIZZLE_CHANNEL_4(X, Y, Z, 1),\n    };\n\n    static Swizzle3 swizz_v3_std[] = {\n        SWIZZLE_CHANNEL_3(X, X, X),\n        SWIZZLE_CHANNEL_3(Y, Y, Y),\n        SWIZZLE_CHANNEL_3(Z, Z, Z),\n        SWIZZLE_CHANNEL_3(W, W, W),\n        SWIZZLE_CHANNEL_3(X, Y, Z),\n        SWIZZLE_CHANNEL_3(Y, Z, W),\n        SWIZZLE_CHANNEL_3(X, X, Y),\n        SWIZZLE_CHANNEL_3(X, Y, X),\n        SWIZZLE_CHANNEL_3(Y, Y, X),\n        SWIZZLE_CHANNEL_3(Y, Y, Z),\n        SWIZZLE_CHANNEL_3(Z, X, Y),\n        SWIZZLE_CHANNEL_3(X, Z, Y),\n        SWIZZLE_CHANNEL_3(0, 0, 0),\n        SWIZZLE_CHANNEL_3(H, H, H),\n        SWIZZLE_CHANNEL_3(1, 1, 1),\n        SWIZZLE_CHANNEL_3(2, 2, 2),\n    };\n\n    static Swizzle3 swizz_v3_ext[] = {\n        SWIZZLE_CHANNEL_3(X, Y, Y),\n        SWIZZLE_CHANNEL_3(Y, X, Y),\n        SWIZZLE_CHANNEL_3(X, X, Z),\n        SWIZZLE_CHANNEL_3(Y, X, X),\n        SWIZZLE_CHANNEL_3(X, Y, 0),\n        SWIZZLE_CHANNEL_3(X, 1, 0),\n        SWIZZLE_CHANNEL_3(X, Z, Y),\n        SWIZZLE_CHANNEL_3(Y, Z, X),\n        SWIZZLE_CHANNEL_3(Z, Y, X),\n        SWIZZLE_CHANNEL_3(Z, Z, Y),\n        SWIZZLE_CHANNEL_3(X, Y, 1),\n        SWIZZLE_CHANNEL_3_UNDEFINED,\n        SWIZZLE_CHANNEL_3_UNDEFINED,\n        SWIZZLE_CHANNEL_3_UNDEFINED,\n        SWIZZLE_CHANNEL_3_UNDEFINED,\n        SWIZZLE_CHANNEL_3_UNDEFINED,\n    };\n\n    if (vec4) {\n        if (extended)\n            return swizz_v4_ext[swizz];\n        else\n            return swizz_v4_std[swizz];\n    } else {\n        if (extended)\n            return to_swizzle4(swizz_v3_ext[swizz]);\n        else\n            return to_swizzle4(swizz_v3_std[swizz]);\n    }\n\n    return SWIZZLE_CHANNEL_4_UNDEFINED;\n}", "docstring": "// Dual has it's own unique swizzle.", "url": "https://github.com/Vita3K/Vita3K-Android/blob/a62e232024d21ca4a74d16a5d5cacedf66bd39ea/vita3k/shader/src/usse_decode_helpers.cpp#L263-L353", "sha": "a62e232024d21ca4a74d16a5d5cacedf66bd39ea"}291{"repo_name": "tt-metal", "dataset": "github_2023", "owner": "tenstorrent", "lang": "cpp", "func_name": "create_owned_buffer_from_vector_of_floats", "code": "tt::tt_metal::OwnedBuffer create_owned_buffer_from_vector_of_floats(\n    const std::vector<float>& data, DataType data_type) {\n    switch (data_type) {\n        case DataType::BFLOAT8_B: {\n            auto uint32_vector = pack_fp32_vec_as_bfp8_tiles(data, /*row_major_input=*/false, /*is_exp_a=*/false);\n            return tt::tt_metal::owned_buffer::create<uint32_t>(std::move(uint32_vector));\n        }\n        case DataType::BFLOAT4_B: {\n            auto uint32_vector = pack_fp32_vec_as_bfp4_tiles(data, /*row_major_input=*/false, /*is_exp_a=*/false);\n            return tt::tt_metal::owned_buffer::create<uint32_t>(std::move(uint32_vector));\n        }\n        case DataType::FLOAT32: {\n            auto data_copy = data;\n            return tt::tt_metal::owned_buffer::create<float>(std::move(data_copy));\n        }\n        case DataType::BFLOAT16: {\n            std::vector<bfloat16> bfloat16_data(data.size());\n            std::transform(std::begin(data), std::end(data), std::begin(bfloat16_data), [](float value) {\n                return bfloat16(value);\n            });\n            return tt::tt_metal::owned_buffer::create<bfloat16>(std::move(bfloat16_data));\n        }\n        default: {\n            throw std::runtime_error(\"Cannot create a host buffer!\");\n        }\n    }\n}", "docstring": "// copypaste from deprecated tensor pybinds ttnn", "url": "https://github.com/tenstorrent/tt-metal/blob/941b34cff33ce2953cf984ec8898af25dbfbfbb3/tt-train/sources/ttml/core/tt_tensor_utils.cpp#L57-L83", "sha": "941b34cff33ce2953cf984ec8898af25dbfbfbb3"}292{"repo_name": "tt-metal", "dataset": "github_2023", "owner": "tenstorrent", "lang": "cpp", "func_name": "FDKernel::GetTunnelStop", "code": "uint32_t FDKernel::GetTunnelStop(chip_id_t device_id) {\n    chip_id_t mmio_device_id = tt::Cluster::instance().get_associated_mmio_device(device_id);\n    for (auto tunnel : tt::Cluster::instance().get_tunnels_from_mmio_device(mmio_device_id)) {\n        for (uint32_t idx = 0; idx < tunnel.size(); idx++) {\n            if (tunnel[idx] == device_id) {\n                return idx;\n            }\n        }\n    }\n    TT_ASSERT(false, \"Could not find tunnel stop of Device {}\", device_id);\n    return 0;\n}", "docstring": "// Helper function to get the tunnel stop of current device", "url": "https://github.com/tenstorrent/tt-metal/blob/941b34cff33ce2953cf984ec8898af25dbfbfbb3/tt_metal/impl/dispatch/kernel_config/fd_kernel.cpp#L51-L62", "sha": "941b34cff33ce2953cf984ec8898af25dbfbfbb3"}293{"repo_name": "HImGuiEditor", "dataset": "github_2023", "owner": "Half-People", "lang": "cpp", "func_name": "TextEditCallbackStub", "code": "static int TextEditCallbackStub(ImGuiInputTextCallbackData* data)\n    {\n        ExampleAppConsole* console = (ExampleAppConsole*)data->UserData;\n        return console->TextEditCallback(data);\n    }", "docstring": "// In C++11 you'd be better off using lambdas for this sort of forwarding callbacks", "url": "https://github.com/Half-People/HImGuiEditor/blob/a0d29c1ad484cafdd1410ed4bc6568bf02c14beb/HalfPeopleStudioImGuiEditor/DependentFile/API/ImGui/imgui_demo.cpp#L6944-L6948", "sha": "a0d29c1ad484cafdd1410ed4bc6568bf02c14beb"}294{"repo_name": "HImGuiEditor", "dataset": "github_2023", "owner": "Half-People", "lang": "cpp", "func_name": "ImGui_ImplGlfw_UpdateKeyModifiers", "code": "static void ImGui_ImplGlfw_UpdateKeyModifiers(GLFWwindow* window)\n{\n    ImGuiIO& io = ImGui::GetIO();\n    io.AddKeyEvent(ImGuiMod_Ctrl,  (glfwGetKey(window, GLFW_KEY_LEFT_CONTROL) == GLFW_PRESS) || (glfwGetKey(window, GLFW_KEY_RIGHT_CONTROL) == GLFW_PRESS));\n    io.AddKeyEvent(ImGuiMod_Shift, (glfwGetKey(window, GLFW_KEY_LEFT_SHIFT)   == GLFW_PRESS) || (glfwGetKey(window, GLFW_KEY_RIGHT_SHIFT)   == GLFW_PRESS));\n    io.AddKeyEvent(ImGuiMod_Alt,   (glfwGetKey(window, GLFW_KEY_LEFT_ALT)     == GLFW_PRESS) || (glfwGetKey(window, GLFW_KEY_RIGHT_ALT)     == GLFW_PRESS));\n    io.AddKeyEvent(ImGuiMod_Super, (glfwGetKey(window, GLFW_KEY_LEFT_SUPER)   == GLFW_PRESS) || (glfwGetKey(window, GLFW_KEY_RIGHT_SUPER)   == GLFW_PRESS));\n}", "docstring": "// X11 does not include current pressed/released modifier key in 'mods' flags submitted by GLFW\n// See https://github.com/ocornut/imgui/issues/6034 and https://github.com/glfw/glfw/issues/1630", "url": "https://github.com/Half-People/HImGuiEditor/blob/a0d29c1ad484cafdd1410ed4bc6568bf02c14beb/HalfPeopleStudioImGuiEditor/DependentFile/API/ImGui/backends/imgui_impl_glfw.cpp#L309-L316", "sha": "a0d29c1ad484cafdd1410ed4bc6568bf02c14beb"}295{"repo_name": "HImGuiEditor", "dataset": "github_2023", "owner": "Half-People", "lang": "cpp", "func_name": "LogTextV", "code": "static inline void LogTextV(ImGuiContext& g, const char* fmt, va_list args)\n{\n    if (g.LogFile)\n    {\n        g.LogBuffer.Buf.resize(0);\n        g.LogBuffer.appendfv(fmt, args);\n        ImFileWrite(g.LogBuffer.c_str(), sizeof(char), (ImU64)g.LogBuffer.size(), g.LogFile);\n    }\n    else\n    {\n        g.LogBuffer.appendfv(fmt, args);\n    }\n}", "docstring": "//-----------------------------------------------------------------------------\n// [SECTION] LOGGING/CAPTURING\n//-----------------------------------------------------------------------------\n// All text output from the interface can be captured into tty/file/clipboard.\n// By default, tree nodes are automatically opened during logging.\n//-----------------------------------------------------------------------------\n// Pass text data straight to log (without being displayed)", "url": "https://github.com/Half-People/HImGuiEditor/blob/a0d29c1ad484cafdd1410ed4bc6568bf02c14beb/HalfPeopleStudioImGuiEditor/ImGui/imgui.cpp#L13263-L13275", "sha": "a0d29c1ad484cafdd1410ed4bc6568bf02c14beb"}296{"repo_name": "HImGuiEditor", "dataset": "github_2023", "owner": "Half-People", "lang": "cpp", "func_name": "ImGui::CallContextHooks", "code": "void ImGui::CallContextHooks(ImGuiContext* ctx, ImGuiContextHookType hook_type)\n{\n    ImGuiContext& g = *ctx;\n    for (int n = 0; n < g.Hooks.Size; n++)\n        if (g.Hooks[n].Type == hook_type)\n            g.Hooks[n].Callback(&g, &g.Hooks[n]);\n}", "docstring": "// Call context hooks (used by e.g. test engine)\n// We assume a small number of hooks so all stored in same array", "url": "https://github.com/Half-People/HImGuiEditor/blob/a0d29c1ad484cafdd1410ed4bc6568bf02c14beb/HalfPeopleStudioImGuiEditor/Plugin/Plugin-Example/HImGuiEditorPlugin/HImGuiEditorPlugin/ImGui/imgui.cpp#L3751-L3757", "sha": "a0d29c1ad484cafdd1410ed4bc6568bf02c14beb"}297{"repo_name": "HImGuiEditor", "dataset": "github_2023", "owner": "Half-People", "lang": "cpp", "func_name": "LogTextV", "code": "static inline void LogTextV(ImGuiContext& g, const char* fmt, va_list args)\n{\n    if (g.LogFile)\n    {\n        g.LogBuffer.Buf.resize(0);\n        g.LogBuffer.appendfv(fmt, args);\n        ImFileWrite(g.LogBuffer.c_str(), sizeof(char), (ImU64)g.LogBuffer.size(), g.LogFile);\n    }\n    else\n    {\n        g.LogBuffer.appendfv(fmt, args);\n    }\n}", "docstring": "//-----------------------------------------------------------------------------\n// [SECTION] LOGGING/CAPTURING\n//-----------------------------------------------------------------------------\n// All text output from the interface can be captured into tty/file/clipboard.\n// By default, tree nodes are automatically opened during logging.\n//-----------------------------------------------------------------------------\n// Pass text data straight to log (without being displayed)", "url": "https://github.com/Half-People/HImGuiEditor/blob/a0d29c1ad484cafdd1410ed4bc6568bf02c14beb/HalfPeopleStudioImGuiEditor/Plugin/Plugin-Example/HImGuiEditorPlugin/HImGuiEditorPlugin/ImGui/imgui.cpp#L13263-L13275", "sha": "a0d29c1ad484cafdd1410ed4bc6568bf02c14beb"}298{"repo_name": "HImGuiEditor", "dataset": "github_2023", "owner": "Half-People", "lang": "cpp", "func_name": "ImGui_ImplDX12_CreateWindow", "code": "static void ImGui_ImplDX12_CreateWindow(ImGuiViewport* viewport)\n{\n    ImGui_ImplDX12_Data* bd = ImGui_ImplDX12_GetBackendData();\n    ImGui_ImplDX12_ViewportData* vd = IM_NEW(ImGui_ImplDX12_ViewportData)(bd->numFramesInFlight);\n    viewport->RendererUserData = vd;\n\n    // PlatformHandleRaw should always be a HWND, whereas PlatformHandle might be a higher-level handle (e.g. GLFWWindow*, SDL_Window*).\n    // Some backends will leave PlatformHandleRaw NULL, in which case we assume PlatformHandle will contain the HWND.\n    HWND hwnd = viewport->PlatformHandleRaw ? (HWND)viewport->PlatformHandleRaw : (HWND)viewport->PlatformHandle;\n    IM_ASSERT(hwnd != 0);\n\n    vd->FrameIndex = UINT_MAX;\n\n    // Create command queue.\n    D3D12_COMMAND_QUEUE_DESC queue_desc = {};\n    queue_desc.Flags = D3D12_COMMAND_QUEUE_FLAG_NONE;\n    queue_desc.Type = D3D12_COMMAND_LIST_TYPE_DIRECT;\n\n    HRESULT res = S_OK;\n    res = bd->pd3dDevice->CreateCommandQueue(&queue_desc, IID_PPV_ARGS(&vd->CommandQueue));\n    IM_ASSERT(res == S_OK);\n\n    // Create command allocator.\n    for (UINT i = 0; i < bd->numFramesInFlight; ++i)\n    {\n        res = bd->pd3dDevice->CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_DIRECT, IID_PPV_ARGS(&vd->FrameCtx[i].CommandAllocator));\n        IM_ASSERT(res == S_OK);\n    }\n\n    // Create command list.\n    res = bd->pd3dDevice->CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_DIRECT, vd->FrameCtx[0].CommandAllocator, nullptr, IID_PPV_ARGS(&vd->CommandList));\n    IM_ASSERT(res == S_OK);\n    vd->CommandList->Close();\n\n    // Create fence.\n    res = bd->pd3dDevice->CreateFence(0, D3D12_FENCE_FLAG_NONE, IID_PPV_ARGS(&vd->Fence));\n    IM_ASSERT(res == S_OK);\n\n    vd->FenceEvent = CreateEvent(nullptr, FALSE, FALSE, nullptr);\n    IM_ASSERT(vd->FenceEvent != nullptr);\n\n    // Create swap chain\n    // FIXME-VIEWPORT: May want to copy/inherit swap chain settings from the user/application.\n    DXGI_SWAP_CHAIN_DESC1 sd1;\n    ZeroMemory(&sd1, sizeof(sd1));\n    sd1.BufferCount = bd->numFramesInFlight;\n    sd1.Width = (UINT)viewport->Size.x;\n    sd1.Height = (UINT)viewport->Size.y;\n    sd1.Format = bd->RTVFormat;\n    sd1.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;\n    sd1.SampleDesc.Count = 1;\n    sd1.SampleDesc.Quality = 0;\n    sd1.SwapEffect = DXGI_SWAP_EFFECT_FLIP_DISCARD;\n    sd1.AlphaMode = DXGI_ALPHA_MODE_UNSPECIFIED;\n    sd1.Scaling = DXGI_SCALING_STRETCH;\n    sd1.Stereo = FALSE;\n\n    IDXGIFactory4* dxgi_factory = nullptr;\n    res = ::CreateDXGIFactory1(IID_PPV_ARGS(&dxgi_factory));\n    IM_ASSERT(res == S_OK);\n\n    IDXGISwapChain1* swap_chain = nullptr;\n    res = dxgi_factory->CreateSwapChainForHwnd(vd->CommandQueue, hwnd, &sd1, nullptr, nullptr, &swap_chain);\n    IM_ASSERT(res == S_OK);\n\n    dxgi_factory->Release();\n\n    // Or swapChain.As(&mSwapChain)\n    IM_ASSERT(vd->SwapChain == nullptr);\n    swap_chain->QueryInterface(IID_PPV_ARGS(&vd->SwapChain));\n    swap_chain->Release();\n\n    // Create the render targets\n    if (vd->SwapChain)\n    {\n        D3D12_DESCRIPTOR_HEAP_DESC desc = {};\n        desc.Type = D3D12_DESCRIPTOR_HEAP_TYPE_RTV;\n        desc.NumDescriptors = bd->numFramesInFlight;\n        desc.Flags = D3D12_DESCRIPTOR_HEAP_FLAG_NONE;\n        desc.NodeMask = 1;\n\n        HRESULT hr = bd->pd3dDevice->CreateDescriptorHeap(&desc, IID_PPV_ARGS(&vd->RtvDescHeap));\n        IM_ASSERT(hr == S_OK);\n\n        SIZE_T rtv_descriptor_size = bd->pd3dDevice->GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_RTV);\n        D3D12_CPU_DESCRIPTOR_HANDLE rtv_handle = vd->RtvDescHeap->GetCPUDescriptorHandleForHeapStart();\n        for (UINT i = 0; i < bd->numFramesInFlight; i++)\n        {\n            vd->FrameCtx[i].RenderTargetCpuDescriptors = rtv_handle;\n            rtv_handle.ptr += rtv_descriptor_size;\n        }\n\n        ID3D12Resource* back_buffer;\n        for (UINT i = 0; i < bd->numFramesInFlight; i++)\n        {\n            IM_ASSERT(vd->FrameCtx[i].RenderTarget == nullptr);\n            vd->SwapChain->GetBuffer(i, IID_PPV_ARGS(&back_buffer));\n            bd->pd3dDevice->CreateRenderTargetView(back_buffer, nullptr, vd->FrameCtx[i].RenderTargetCpuDescriptors);\n            vd->FrameCtx[i].RenderTarget = back_buffer;\n        }\n    }\n\n    for (UINT i = 0; i < bd->numFramesInFlight; i++)\n        ImGui_ImplDX12_DestroyRenderBuffers(&vd->FrameRenderBuffers[i]);\n}", "docstring": "//--------------------------------------------------------------------------------------------------------\n// MULTI-VIEWPORT / PLATFORM INTERFACE SUPPORT\n// This is an _advanced_ and _optional_ feature, allowing the backend to create and handle multiple viewports simultaneously.\n// If you are new to dear imgui or creating a new binding for dear imgui, it is recommended that you completely ignore this section first..\n//--------------------------------------------------------------------------------------------------------", "url": "https://github.com/Half-People/HImGuiEditor/blob/a0d29c1ad484cafdd1410ed4bc6568bf02c14beb/x64/Release/DependentFile/API/ImGui/backends/imgui_impl_dx12.cpp#L843-L947", "sha": "a0d29c1ad484cafdd1410ed4bc6568bf02c14beb"}299{"repo_name": "T-Display-S3-AMOLED", "dataset": "github_2023", "owner": "Xinyuan-LilyGO", "lang": "cpp", "func_name": "TFT_eSPI::setCursor", "code": "void TFT_eSPI::setCursor(int16_t x, int16_t y, uint8_t font)\n{\n  textfont = font;\n  cursor_x = x;\n  cursor_y = y;\n}", "docstring": "/***************************************************************************************\n** Function name:           setCursor\n** Description:             Set the text cursor x,y position and font\n***************************************************************************************/", "url": "https://github.com/Xinyuan-LilyGO/T-Display-S3-AMOLED/blob/edd133335c9f7c38d1e9be2d0eb67371f1f6428e/lib/TFT_eSPI/TFT_eSPI.cpp#L2866-L2871", "sha": "edd133335c9f7c38d1e9be2d0eb67371f1f6428e"}300{"repo_name": "catalyst", "dataset": "github_2023", "owner": "PennyLaneAI", "lang": "cpp", "func_name": "createGradientPostprocessingPass", "code": "std::unique_ptr<Pass> createGradientPostprocessingPass()\n{\n    return std::make_unique<gradient::GradientPostprocessingPass>();\n}", "docstring": "// namespace gradient", "url": "https://github.com/PennyLaneAI/catalyst/blob/729d468ad1bec692242c6b20560a2b9922debb31/mlir/lib/Gradient/Transforms/gradient_postprocess.cpp#L54-L57", "sha": "729d468ad1bec692242c6b20560a2b9922debb31"}301{"repo_name": "FluentUI", "dataset": "github_2023", "owner": "zhuzichu520", "lang": "cpp", "func_name": "QCPAxis::setRange", "code": "void QCPAxis::setRange(double lower, double upper)\n{\n  if (lower == mRange.lower && upper == mRange.upper)\n    return;\n  \n  if (!QCPRange::validRange(lower, upper)) return;\n  QCPRange oldRange = mRange;\n  mRange.lower = lower;\n  mRange.upper = upper;\n  if (mScaleType == stLogarithmic)\n  {\n    mRange = mRange.sanitizedForLogScale();\n  } else\n  {\n    mRange = mRange.sanitizedForLinScale();\n  }\n  emit rangeChanged(mRange);\n  emit rangeChanged(mRange, oldRange);\n}", "docstring": "/*!\n  \\overload\n  \n  Sets the lower and upper bound of the axis range.\n  \n  To invert the direction of an axis, use \\ref setRangeReversed.\n  \n  There is also a slot to set a range, see \\ref setRange(const QCPRange &range).\n*/", "url": "https://github.com/zhuzichu520/FluentUI/blob/09e04302930883c06d87a0c0e304d527f4e8c6cc/src/qmlcustomplot/qcustomplot.cpp#L8459-L8477", "sha": "09e04302930883c06d87a0c0e304d527f4e8c6cc"}302{"repo_name": "FluentUI", "dataset": "github_2023", "owner": "zhuzichu520", "lang": "cpp", "func_name": "QCPTextElement::QCPTextElement", "code": "QCPTextElement::QCPTextElement(QCustomPlot *parentPlot, const QString &text, double pointSize) :\n  QCPLayoutElement(parentPlot),\n  mText(text),\n  mTextFlags(Qt::AlignCenter),\n  mFont(QFont(QLatin1String(\"sans serif\"), int(pointSize))), // will be taken from parentPlot if available, see below\n  mTextColor(Qt::black),\n  mSelectedFont(QFont(QLatin1String(\"sans serif\"), int(pointSize))), // will be taken from parentPlot if available, see below\n  mSelectedTextColor(Qt::blue),\n  mSelectable(false),\n  mSelected(false)\n{\n  mFont.setPointSizeF(pointSize); // set here again as floating point, because constructor above only takes integer\n  if (parentPlot)\n  {\n    mFont = parentPlot->font();\n    mFont.setPointSizeF(pointSize);\n    mSelectedFont = parentPlot->font();\n    mSelectedFont.setPointSizeF(pointSize);\n  }\n  setMargins(QMargins(2, 2, 2, 2));\n}", "docstring": "/*! \\overload\n  \n  Creates a new QCPTextElement instance and sets default values.\n\n  The initial text is set to \\a text with \\a pointSize.\n*/", "url": "https://github.com/zhuzichu520/FluentUI/blob/09e04302930883c06d87a0c0e304d527f4e8c6cc/src/qmlcustomplot/qcustomplot.cpp#L19729-L19749", "sha": "09e04302930883c06d87a0c0e304d527f4e8c6cc"}303{"repo_name": "FluentUI", "dataset": "github_2023", "owner": "zhuzichu520", "lang": "cpp", "func_name": "QCPFinancial::setChartStyle", "code": "void QCPFinancial::setChartStyle(QCPFinancial::ChartStyle style)\n{\n  mChartStyle = style;\n}", "docstring": "/*!\n  Sets which representation style shall be used to display the OHLC data.\n*/", "url": "https://github.com/zhuzichu520/FluentUI/blob/09e04302930883c06d87a0c0e304d527f4e8c6cc/src/qmlcustomplot/qcustomplot.cpp#L27156-L27159", "sha": "09e04302930883c06d87a0c0e304d527f4e8c6cc"}304{"repo_name": "FluentUI", "dataset": "github_2023", "owner": "zhuzichu520", "lang": "cpp", "func_name": "QCPItemCurve::mainPen", "code": "QPen QCPItemCurve::mainPen() const\n{\n  return mSelected ? mSelectedPen : mPen;\n}", "docstring": "/*! \\internal\n\n  Returns the pen that should be used for drawing lines. Returns mPen when the\n  item is not selected and mSelectedPen when it is.\n*/", "url": "https://github.com/zhuzichu520/FluentUI/blob/09e04302930883c06d87a0c0e304d527f4e8c6cc/src/qmlcustomplot/qcustomplot.cpp#L29426-L29429", "sha": "09e04302930883c06d87a0c0e304d527f4e8c6cc"}305{"repo_name": "FluentUI", "dataset": "github_2023", "owner": "zhuzichu520", "lang": "cpp", "func_name": "QCPPolarAxisRadial::subTickLengthOut", "code": "int QCPPolarAxisRadial::subTickLengthOut() const\n{\n  return mSubTickLengthOut;\n}", "docstring": "/* No documentation as it is a property getter */", "url": "https://github.com/zhuzichu520/FluentUI/blob/09e04302930883c06d87a0c0e304d527f4e8c6cc/src/qmlcustomplot/qcustomplot.cpp#L31207-L31210", "sha": "09e04302930883c06d87a0c0e304d527f4e8c6cc"}306{"repo_name": "srsRAN_Project", "dataset": "github_2023", "owner": "srsran", "lang": "cpp", "func_name": "rx_timing_window_params_us_to_symbols", "code": "static ofh::rx_window_timing_parameters\nrx_timing_window_params_us_to_symbols(std::chrono::microseconds                Ta4_max,\n                                      std::chrono::microseconds                Ta4_min,\n                                      std::chrono::duration<double, std::nano> symbol_duration)\n{\n  ofh::rx_window_timing_parameters rx_window_timing_params;\n  rx_window_timing_params.sym_start = std::floor(Ta4_min / symbol_duration);\n  rx_window_timing_params.sym_end   = std::ceil(Ta4_max / symbol_duration);\n\n  return rx_window_timing_params;\n}", "docstring": "/// Converts reception window timing parameters from microseconds to number of symbols given the symbol duration.", "url": "https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/apps/units/flexible_o_du/split_7_2/helpers/ru_ofh_config_translator.cpp#L46-L56", "sha": "a041e3162d7ea94a7963437f32df372fae5d21ea"}307{"repo_name": "srsRAN_Project", "dataset": "github_2023", "owner": "srsran", "lang": "cpp", "func_name": "ran_param_definition_choice_c::set", "code": "void ran_param_definition_choice_c::set(types::options e)\n{\n  type_ = e;\n  switch (type_) {\n    case types::choice_list:\n      c = ran_param_definition_choice_list_s{};\n      break;\n    case types::choice_structure:\n      c = ran_param_definition_choice_structure_s{};\n      break;\n    case types::nulltype:\n      break;\n    default:\n      log_invalid_choice_id(type_, \"ran_param_definition_choice_c\");\n  }\n}", "docstring": "// RANParameter-Definition-Choice ::= CHOICE", "url": "https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/lib/asn1/e2sm/e2sm_rc_ies.cpp#L320-L335", "sha": "a041e3162d7ea94a7963437f32df372fae5d21ea"}308{"repo_name": "srsRAN_Project", "dataset": "github_2023", "owner": "srsran", "lang": "cpp", "func_name": "ran_param_value_type_choice_elem_false_s::pack", "code": "SRSASN_CODE ran_param_value_type_choice_elem_false_s::pack(bit_ref& bref) const\n{\n  bref.pack(ext, 1);\n  HANDLE_CODE(bref.pack(ran_param_value_present, 1));\n\n  if (ran_param_value_present) {\n    HANDLE_CODE(ran_param_value.pack(bref));\n  }\n\n  return SRSASN_SUCCESS;\n}", "docstring": "// RANParameter-ValueType-Choice-ElementFalse ::= SEQUENCE", "url": "https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/lib/asn1/e2sm/e2sm_rc_ies.cpp#L8579-L8589", "sha": "a041e3162d7ea94a7963437f32df372fae5d21ea"}309{"repo_name": "srsRAN_Project", "dataset": "github_2023", "owner": "srsran", "lang": "cpp", "func_name": "active_ul_bwp_s::pack", "code": "SRSASN_CODE active_ul_bwp_s::pack(bit_ref& bref) const\n{\n  HANDLE_CODE(bref.pack(shift7dot5k_hz_present, 1));\n  HANDLE_CODE(bref.pack(ie_exts_present, 1));\n\n  HANDLE_CODE(pack_integer(bref, location_and_bw, (uint16_t)0u, (uint16_t)37949u, true, true));\n  HANDLE_CODE(subcarrier_spacing.pack(bref));\n  HANDLE_CODE(cp.pack(bref));\n  HANDLE_CODE(pack_integer(bref, tx_direct_current_location, (uint16_t)0u, (uint16_t)3301u, true, true));\n  if (shift7dot5k_hz_present) {\n    HANDLE_CODE(shift7dot5k_hz.pack(bref));\n  }\n  HANDLE_CODE(srs_cfg.pack(bref));\n  if (ie_exts_present) {\n    HANDLE_CODE(ie_exts.pack(bref));\n  }\n\n  return SRSASN_SUCCESS;\n}", "docstring": "// ActiveULBWP ::= SEQUENCE", "url": "https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/lib/asn1/f1ap/f1ap_ies.cpp#L5856-L5874", "sha": "a041e3162d7ea94a7963437f32df372fae5d21ea"}310{"repo_name": "srsRAN_Project", "dataset": "github_2023", "owner": "srsran", "lang": "cpp", "func_name": "broadcast_m_rbs_failed_to_be_modified_item_s::pack", "code": "SRSASN_CODE broadcast_m_rbs_failed_to_be_modified_item_s::pack(bit_ref& bref) const\n{\n  bref.pack(ext, 1);\n  HANDLE_CODE(bref.pack(cause_present, 1));\n  HANDLE_CODE(bref.pack(ie_exts_present, 1));\n\n  HANDLE_CODE(pack_integer(bref, mrb_id, (uint16_t)1u, (uint16_t)512u, true, true));\n  if (cause_present) {\n    HANDLE_CODE(cause.pack(bref));\n  }\n  if (ie_exts_present) {\n    HANDLE_CODE(ie_exts.pack(bref));\n  }\n\n  return SRSASN_SUCCESS;\n}", "docstring": "// BroadcastMRBs-FailedToBeModified-Item ::= SEQUENCE", "url": "https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/lib/asn1/f1ap/f1ap_ies.cpp#L14385-L14400", "sha": "a041e3162d7ea94a7963437f32df372fae5d21ea"}311{"repo_name": "srsRAN_Project", "dataset": "github_2023", "owner": "srsran", "lang": "cpp", "func_name": "prs_cfg_s::pack", "code": "SRSASN_CODE prs_cfg_s::pack(bit_ref& bref) const\n{\n  HANDLE_CODE(bref.pack(ie_exts_present, 1));\n\n  HANDLE_CODE(pack_dyn_seq_of(bref, prs_res_set_list, 1, 8, true));\n  if (ie_exts_present) {\n    HANDLE_CODE(ie_exts.pack(bref));\n  }\n\n  return SRSASN_SUCCESS;\n}", "docstring": "// PRSConfiguration ::= SEQUENCE", "url": "https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/lib/asn1/f1ap/f1ap_ies.cpp#L35129-L35139", "sha": "a041e3162d7ea94a7963437f32df372fae5d21ea"}312{"repo_name": "srsRAN_Project", "dataset": "github_2023", "owner": "srsran", "lang": "cpp", "func_name": "multicast_distribution_setup_request_ies_o::idx_to_id", "code": "uint32_t multicast_distribution_setup_request_ies_o::idx_to_id(uint32_t idx)\n{\n  static const uint32_t names[] = {451, 452, 502, 503};\n  return map_enum_number(names, 4, idx, \"id\");\n}", "docstring": "// MulticastDistributionSetupRequestIEs ::= OBJECT SET OF F1AP-PROTOCOL-IES", "url": "https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/lib/asn1/f1ap/f1ap_pdu_contents.cpp#L19058-L19062", "sha": "a041e3162d7ea94a7963437f32df372fae5d21ea"}313{"repo_name": "srsRAN_Project", "dataset": "github_2023", "owner": "srsran", "lang": "cpp", "func_name": "sl_drbs_failed_to_be_modified_item_ies_o::idx_to_id", "code": "uint32_t sl_drbs_failed_to_be_modified_item_ies_o::idx_to_id(uint32_t idx)\n{\n  static const uint32_t names[] = {313};\n  return map_enum_number(names, 1, idx, \"id\");\n}", "docstring": "// SLDRBs-FailedToBeModified-ItemIEs ::= OBJECT SET OF F1AP-PROTOCOL-IES", "url": "https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/lib/asn1/f1ap/f1ap_pdu_items.cpp#L5570-L5574", "sha": "a041e3162d7ea94a7963437f32df372fae5d21ea"}314{"repo_name": "srsRAN_Project", "dataset": "github_2023", "owner": "srsran", "lang": "cpp", "func_name": "intersys_son_cfg_transfer_s::pack", "code": "SRSASN_CODE intersys_son_cfg_transfer_s::pack(bit_ref& bref) const\n{\n  bref.pack(ext, 1);\n  HANDLE_CODE(bref.pack(ie_exts_present, 1));\n\n  HANDLE_CODE(transfer_type.pack(bref));\n  HANDLE_CODE(intersys_son_info.pack(bref));\n  if (ie_exts_present) {\n    HANDLE_CODE(ie_exts.pack(bref));\n  }\n\n  return SRSASN_SUCCESS;\n}", "docstring": "// IntersystemSONConfigurationTransfer ::= SEQUENCE", "url": "https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/lib/asn1/ngap/ngap_ies.cpp#L17882-L17894", "sha": "a041e3162d7ea94a7963437f32df372fae5d21ea"}315{"repo_name": "srsRAN_Project", "dataset": "github_2023", "owner": "srsran", "lang": "cpp", "func_name": "ran_cp_relocation_ind_ies_o::value_c::set", "code": "void ran_cp_relocation_ind_ies_o::value_c::set(types::options e)\n{\n  type_ = e;\n  switch (type_) {\n    case types::ran_ue_ngap_id:\n      c = uint64_t{};\n      break;\n    case types::five_g_s_tmsi:\n      c = five_g_s_tmsi_s{};\n      break;\n    case types::eutra_cgi:\n      c = eutra_cgi_s{};\n      break;\n    case types::tai:\n      c = tai_s{};\n      break;\n    case types::ul_cp_security_info:\n      c = ul_cp_security_info_s{};\n      break;\n    case types::nulltype:\n      break;\n    default:\n      log_invalid_choice_id(type_, \"ran_cp_relocation_ind_ies_o::value_c\");\n  }\n}", "docstring": "// Value ::= OPEN TYPE", "url": "https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/lib/asn1/ngap/ngap_pdu_contents.cpp#L28248-L28272", "sha": "a041e3162d7ea94a7963437f32df372fae5d21ea"}316{"repo_name": "srsRAN_Project", "dataset": "github_2023", "owner": "srsran", "lang": "cpp", "func_name": "feature_combination_r17_s::pack", "code": "SRSASN_CODE feature_combination_r17_s::pack(bit_ref& bref) const\n{\n  HANDLE_CODE(bref.pack(red_cap_r17_present, 1));\n  HANDLE_CODE(bref.pack(small_data_r17_present, 1));\n  HANDLE_CODE(bref.pack(nsag_r17.size() > 0, 1));\n  HANDLE_CODE(bref.pack(msg3_repeats_r17_present, 1));\n  HANDLE_CODE(bref.pack(spare4_present, 1));\n  HANDLE_CODE(bref.pack(spare3_present, 1));\n  HANDLE_CODE(bref.pack(spare2_present, 1));\n  HANDLE_CODE(bref.pack(spare1_present, 1));\n\n  if (nsag_r17.size() > 0) {\n    HANDLE_CODE(pack_dyn_seq_of(bref, nsag_r17, 1, 8));\n  }\n\n  return SRSASN_SUCCESS;\n}", "docstring": "// FeatureCombination-r17 ::= SEQUENCE", "url": "https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/lib/asn1/rrc_nr/bwp_cfg.cpp#L428-L444", "sha": "a041e3162d7ea94a7963437f32df372fae5d21ea"}317{"repo_name": "srsRAN_Project", "dataset": "github_2023", "owner": "srsran", "lang": "cpp", "func_name": "pucch_res_ext_v1610_s::pack", "code": "SRSASN_CODE pucch_res_ext_v1610_s::pack(bit_ref& bref) const\n{\n  bref.pack(ext, 1);\n  HANDLE_CODE(bref.pack(interlace_alloc_r16_present, 1));\n  HANDLE_CODE(bref.pack(format_v1610_present, 1));\n\n  if (interlace_alloc_r16_present) {\n    HANDLE_CODE(pack_integer(bref, interlace_alloc_r16.rb_set_idx_r16, (uint8_t)0u, (uint8_t)4u));\n    HANDLE_CODE(interlace_alloc_r16.interlace0_r16.pack(bref));\n  }\n  if (format_v1610_present) {\n    HANDLE_CODE(format_v1610.pack(bref));\n  }\n\n  if (ext) {\n    ext_groups_packer_guard group_flags;\n    group_flags[0] |= format_v1700.is_present();\n    group_flags[0] |= pucch_repeat_nrof_slots_r17_present;\n    group_flags.pack(bref);\n\n    if (group_flags[0]) {\n      varlength_field_pack_guard varlen_scope(bref, false);\n\n      HANDLE_CODE(bref.pack(format_v1700.is_present(), 1));\n      HANDLE_CODE(bref.pack(pucch_repeat_nrof_slots_r17_present, 1));\n      if (format_v1700.is_present()) {\n        HANDLE_CODE(pack_integer(bref, format_v1700->nrof_prbs_r17, (uint8_t)1u, (uint8_t)16u));\n      }\n      if (pucch_repeat_nrof_slots_r17_present) {\n        HANDLE_CODE(pucch_repeat_nrof_slots_r17.pack(bref));\n      }\n    }\n  }\n  return SRSASN_SUCCESS;\n}", "docstring": "// PUCCH-ResourceExt-v1610 ::= SEQUENCE", "url": "https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/lib/asn1/rrc_nr/bwp_cfg.cpp#L7530-L7564", "sha": "a041e3162d7ea94a7963437f32df372fae5d21ea"}318{"repo_name": "srsRAN_Project", "dataset": "github_2023", "owner": "srsran", "lang": "cpp", "func_name": "meas_trigger_quant_offset_c::destroy_", "code": "void meas_trigger_quant_offset_c::destroy_() {}", "docstring": "// MeasTriggerQuantityOffset ::= CHOICE", "url": "https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/lib/asn1/rrc_nr/meas_cfg.cpp#L738-L738", "sha": "a041e3162d7ea94a7963437f32df372fae5d21ea"}319{"repo_name": "srsRAN_Project", "dataset": "github_2023", "owner": "srsran", "lang": "cpp", "func_name": "var_conn_est_fail_report_list_r17_s::pack", "code": "SRSASN_CODE var_conn_est_fail_report_list_r17_s::pack(bit_ref& bref) const\n{\n  HANDLE_CODE(pack_dyn_seq_of(bref, conn_est_fail_report_list_r17, 1, 4));\n\n  return SRSASN_SUCCESS;\n}", "docstring": "// VarConnEstFailReportList-r17 ::= SEQUENCE", "url": "https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/lib/asn1/rrc_nr/nr_ue_variables.cpp#L491-L496", "sha": "a041e3162d7ea94a7963437f32df372fae5d21ea"}320{"repo_name": "srsRAN_Project", "dataset": "github_2023", "owner": "srsran", "lang": "cpp", "func_name": "dummy_a_s::pack", "code": "SRSASN_CODE dummy_a_s::pack(bit_ref& bref) const\n{\n  HANDLE_CODE(pack_integer(bref, max_num_nzp_csi_rs_per_cc, (uint8_t)1u, (uint8_t)32u));\n  HANDLE_CODE(max_num_ports_across_nzp_csi_rs_per_cc.pack(bref));\n  HANDLE_CODE(max_num_cs_im_per_cc.pack(bref));\n  HANDLE_CODE(max_num_simul_csi_rs_act_bwp_all_cc.pack(bref));\n  HANDLE_CODE(total_num_ports_simul_csi_rs_act_bwp_all_cc.pack(bref));\n\n  return SRSASN_SUCCESS;\n}", "docstring": "// DummyA ::= SEQUENCE", "url": "https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/lib/asn1/rrc_nr/ue_cap.cpp#L19179-L19188", "sha": "a041e3162d7ea94a7963437f32df372fae5d21ea"}321{"repo_name": "srsRAN_Project", "dataset": "github_2023", "owner": "srsran", "lang": "cpp", "func_name": "reestab_ue_id_s::pack", "code": "SRSASN_CODE reestab_ue_id_s::pack(bit_ref& bref) const\n{\n  HANDLE_CODE(pack_integer(bref, c_rnti, (uint32_t)0u, (uint32_t)65535u));\n  HANDLE_CODE(pack_integer(bref, pci, (uint16_t)0u, (uint16_t)1007u));\n  HANDLE_CODE(short_mac_i.pack(bref));\n\n  return SRSASN_SUCCESS;\n}", "docstring": "// ReestabUE-Identity ::= SEQUENCE", "url": "https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/lib/asn1/rrc_nr/ul_ccch_msg_ies.cpp#L222-L229", "sha": "a041e3162d7ea94a7963437f32df372fae5d21ea"}322{"repo_name": "srsRAN_Project", "dataset": "github_2023", "owner": "srsran", "lang": "cpp", "func_name": "sl_qos_info_r16_s::pack", "code": "SRSASN_CODE sl_qos_info_r16_s::pack(bit_ref& bref) const\n{\n  HANDLE_CODE(bref.pack(sl_qos_profile_r16_present, 1));\n\n  HANDLE_CODE(pack_integer(bref, sl_qos_flow_id_r16, (uint16_t)1u, (uint16_t)2048u));\n  if (sl_qos_profile_r16_present) {\n    HANDLE_CODE(sl_qos_profile_r16.pack(bref));\n  }\n\n  return SRSASN_SUCCESS;\n}", "docstring": "// SL-QoS-Info-r16 ::= SEQUENCE", "url": "https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/lib/asn1/rrc_nr/ul_dcch_msg_ies.cpp#L1761-L1771", "sha": "a041e3162d7ea94a7963437f32df372fae5d21ea"}323{"repo_name": "srsRAN_Project", "dataset": "github_2023", "owner": "srsran", "lang": "cpp", "func_name": "scg_fail_info_ies_s::pack", "code": "SRSASN_CODE scg_fail_info_ies_s::pack(bit_ref& bref) const\n{\n  HANDLE_CODE(bref.pack(fail_report_scg_present, 1));\n  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));\n\n  if (fail_report_scg_present) {\n    HANDLE_CODE(fail_report_scg.pack(bref));\n  }\n  if (non_crit_ext_present) {\n    HANDLE_CODE(non_crit_ext.pack(bref));\n  }\n\n  return SRSASN_SUCCESS;\n}", "docstring": "// SCGFailureInformation-IEs ::= SEQUENCE", "url": "https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/lib/asn1/rrc_nr/ul_dcch_msg_ies.cpp#L18424-L18437", "sha": "a041e3162d7ea94a7963437f32df372fae5d21ea"}324{"repo_name": "srsRAN_Project", "dataset": "github_2023", "owner": "srsran", "lang": "cpp", "func_name": "fill_format_2_3_4_harq", "code": "static void fill_format_2_3_4_harq(fapi::uci_pucch_pdu_format_2_3_4_builder& builder, const pucch_uci_message& message)\n{\n  units::bits harq_len = units::bits(message.get_expected_nof_harq_ack_bits());\n  if (harq_len.value() == 0) {\n    return;\n  }\n\n  uci_pusch_or_pucch_f2_3_4_detection_status status =\n      to_fapi_uci_detection_status(message.get_status(), message.get_expected_nof_bits_full_payload());\n\n  // Write an empty payload on detection failure.\n  if (!is_fapi_uci_payload_valid(status)) {\n    builder.set_harq_parameters(status, harq_len.value(), {});\n    return;\n  }\n\n  builder.set_harq_parameters(status,\n                              harq_len.value(),\n                              bounded_bitset<uci_constants::MAX_NOF_HARQ_BITS>(message.get_harq_ack_bits().begin(),\n                                                                               message.get_harq_ack_bits().end()));\n}", "docstring": "/// Fills the HARQ parameters for PUCCH Format 2/3/4 using the given builder and message.", "url": "https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/lib/fapi_adaptor/phy/phy_to_fapi_results_event_translator.cpp#L429-L449", "sha": "a041e3162d7ea94a7963437f32df372fae5d21ea"}325{"repo_name": "srsRAN_Project", "dataset": "github_2023", "owner": "srsran", "lang": "cpp", "func_name": "TEST", "code": "TEST(validate_dl_tti_request, valid_request_passes)\n{\n  dl_tti_request_message msg = build_valid_dl_tti_request();\n\n  const auto& result = validate_dl_tti_request(msg);\n\n  ASSERT_TRUE(result);\n}", "docstring": "/// Tests that a valid UL_TTI.request message validates correctly.", "url": "https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/tests/unittests/fapi/validators/dl_tti_request_test.cpp#L77-L84", "sha": "a041e3162d7ea94a7963437f32df372fae5d21ea"}326{"repo_name": "srsRAN_Project", "dataset": "github_2023", "owner": "srsran", "lang": "cpp", "func_name": "TEST_F", "code": "TEST_F(DciValidatorFallbackFixture, SupplementaryUplinkNotSupported)\n{\n  dci_size_config config     = get_base_dci_config();\n  config.sul_configured      = true;\n  std::string assert_message = fmt::format(\"SUL is not currently supported by the DCI size alignment procedure.\");\n\n  test_validator(config, assert_message);\n}", "docstring": "// SUL not configured check.", "url": "https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/tests/unittests/ran/pdcch/dci_packing_validator_test.cpp#L273-L280", "sha": "a041e3162d7ea94a7963437f32df372fae5d21ea"}327{"repo_name": "srsRAN_Project", "dataset": "github_2023", "owner": "srsran", "lang": "cpp", "func_name": "get_next_candidate_alloc_slot", "code": "slot_point get_next_candidate_alloc_slot(slot_point sched_slot, unsigned nof_slot_grid_occupancy) const\n  {\n    if (nof_slot_grid_occupancy == 0) {\n      return sched_slot;\n    }\n\n    unsigned occupy_grid_slot_cnt = 0;\n\n    // The allocation must be on a DL slot.\n    do {\n      sched_slot++;\n      if (bench->cell_cfg.is_dl_enabled(sched_slot)) {\n        occupy_grid_slot_cnt++;\n      }\n    } while (occupy_grid_slot_cnt != nof_slot_grid_occupancy);\n\n    auto k1_falls_on_ul = [&cfg = bench->cell_cfg](slot_point pdsch_slot) {\n      static const std::array<uint8_t, 5> dci_1_0_k1_values = {4, 5, 6, 7};\n      return std::any_of(dci_1_0_k1_values.begin(), dci_1_0_k1_values.end(), [&cfg, pdsch_slot](uint8_t k1) {\n        return cfg.is_ul_enabled(pdsch_slot + k1);\n      });\n    };\n\n    // Make sure the final slot for the SRB0/SRB1 PDSCH is such that the corresponding PUCCH falls on a UL slot.\n    while ((not k1_falls_on_ul(sched_slot)) or (not bench->cell_cfg.is_dl_enabled(sched_slot)) or\n           csi_helper::is_csi_rs_slot(bench->cell_cfg, sched_slot)) {\n      sched_slot++;\n    }\n\n    return sched_slot;\n  }", "docstring": "// Returns the next candidate slot at which the SRB0 scheduler is expected to allocate a grant.", "url": "https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/tests/unittests/scheduler/ue_scheduling/fallback_scheduler_test.cpp#L748-L778", "sha": "a041e3162d7ea94a7963437f32df372fae5d21ea"}328{"repo_name": "clr", "dataset": "github_2023", "owner": "ROCm", "lang": "cpp", "func_name": "OCLPerfAtomicSpeed::SetKernelArguments", "code": "void OCLPerfAtomicSpeed::SetKernelArguments(const AtomicType atomicType) {\n  int Arg = 0;\n  int localSize = 0;\n  int itemsPerThread = 1;\n  cl_int status = CL_SUCCESS;\n\n  switch (atomicType) {\n    case LocalHistogram:\n      // Set arguments for the local atomics histogram kernel\n      status = _wrapper->clSetKernelArg(_kernels[0], Arg++, sizeof(cl_mem),\n                                        (void *)&_inputBuffer);\n      CHECK_RESULT(status, \"clSetKernelArg failed. (inputBuffer)\");\n\n      status |= _wrapper->clSetKernelArg(_kernels[0], Arg++, sizeof(cl_mem),\n                                         (void *)&_outputBuffer);\n      CHECK_RESULT(status, \"clSetKernelArg failed. (outputBuffer)\");\n\n      status |= _wrapper->clSetKernelArg(_kernels[0], Arg++,\n                                         sizeof(_n4VectorsPerThread),\n                                         (void *)&_n4VectorsPerThread);\n      CHECK_RESULT(status, \"clSetKernelArg failed. (n4VectorsPerThread)\");\n\n      // Set arguments for the local atomics reduce kernel\n      Arg = 0;\n      status |= _wrapper->clSetKernelArg(_kernels[1], Arg++, sizeof(cl_mem),\n                                         (void *)&_outputBuffer);\n      CHECK_RESULT(status, \"clSetKernelArg failed. (outputBuffer)\");\n\n      status |= _wrapper->clSetKernelArg(_kernels[1], Arg++, sizeof(_nGroups),\n                                         (void *)&_nGroups);\n      CHECK_RESULT(status, \"clSetKernelArg failed. (nGroups)\");\n      break;\n    case LocalReductionAtomics:\n    case LocalReductionNoAtomics:\n    case Local4ReductionNoAtomics:\n    case Local4ReductionAtomics:\n      status = _wrapper->clSetKernelArg(_kernels[0], Arg++, sizeof(cl_mem),\n                                        (void *)&_inputBuffer);\n      CHECK_RESULT(status, \"clSetKernelArg failed. (inputBuffer)\");\n\n      status |= _wrapper->clSetKernelArg(_kernels[0], Arg++, sizeof(cl_mem),\n                                         (void *)&_outputBuffer);\n      CHECK_RESULT(status, \"clSetKernelArg failed. (outputBuffer)\");\n\n      localSize = DEFAULT_WG_SIZE * sizeof(cl_uint);\n      if ((Local4ReductionNoAtomics == atomicType) ||\n          (Local4ReductionAtomics == atomicType))\n        localSize *= 4;\n      status = _wrapper->clSetKernelArg(_kernels[0], Arg++, localSize, NULL);\n      CHECK_RESULT(status, \"clSetKernelArg failed. (local memory)\");\n      break;\n    case GlobalHistogram:\n    case Global4Histogram:\n    case GlobalWGReduction:\n    case Global4WGReduction:\n    case GlobalAllToZeroReduction:\n    case Global4AllToZeroReduction:\n      // Set arguments for the global atomics histogram kernel\n      if ((Global4Histogram == atomicType) ||\n          (Global4WGReduction == atomicType) ||\n          (Global4AllToZeroReduction == atomicType))\n        itemsPerThread = 4;\n\n      status = _wrapper->clSetKernelArg(\n          _kernels[0], Arg++, sizeof(itemsPerThread), (void *)&itemsPerThread);\n      CHECK_RESULT(status, \"clSetKernelArg failed. (itemsPerThread)\");\n\n      status = _wrapper->clSetKernelArg(_kernels[0], Arg++, sizeof(cl_mem),\n                                        (void *)&_inputBuffer);\n      CHECK_RESULT(status, \"clSetKernelArg failed. (inputBuffer)\");\n\n      status |= _wrapper->clSetKernelArg(_kernels[0], Arg++, sizeof(cl_mem),\n                                         (void *)&_outputBuffer);\n      CHECK_RESULT(status, \"clSetKernelArg failed. (outputBuffer)\");\n      break;\n    default:\n      CHECK_RESULT(true, \"Atomic type not supported (clSetKernelArg)\");\n  }\n}", "docstring": "// Sets the kernel arguments based on the current test type.", "url": "https://github.com/ROCm/clr/blob/a8edb8d467ebb5678d2f4506bd01efd3aaeddcab/opencl/tests/ocltst/module/perf/OCLPerfAtomicSpeed.cpp#L381-L459", "sha": "a8edb8d467ebb5678d2f4506bd01efd3aaeddcab"}329{"repo_name": "Zygisk-ImGui-Menu", "dataset": "github_2023", "owner": "fedes1to", "lang": "cpp", "func_name": "ImGui::PushColumnsBackground", "code": "void ImGui::PushColumnsBackground()\n{\n    ImGuiWindow* window = GetCurrentWindowRead();\n    ImGuiOldColumns* columns = window->DC.CurrentColumns;\n    if (columns->Count == 1)\n        return;\n\n    // Optimization: avoid SetCurrentChannel() + PushClipRect()\n    columns->HostBackupClipRect = window->ClipRect;\n    SetWindowClipRectBeforeSetChannel(window, columns->HostInitialClipRect);\n    columns->Splitter.SetCurrentChannel(window->DrawList, 0);\n}", "docstring": "// Get into the columns background draw command (which is generally the same draw command as before we called BeginColumns)", "url": "https://github.com/fedes1to/Zygisk-ImGui-Menu/blob/faffb17a4ba56d2d208cd25b912260c79cd99089/module/src/main/cpp/ImGui/imgui_tables.cpp#L4071-L4082", "sha": "faffb17a4ba56d2d208cd25b912260c79cd99089"}330{"repo_name": "flatburn", "dataset": "github_2023", "owner": "MIT-Senseable-City-Lab", "lang": "cpp", "func_name": "Sd2Card::readEnd", "code": "void Sd2Card::readEnd(void) {\n  if (inBlock_) {\n    // skip data and crc\n    #ifdef OPTIMIZE_HARDWARE_SPI\n    // optimize skip for hardware\n    SPDR = 0XFF;\n    while (offset_++ < 513) {\n      while (!(SPSR & (1 << SPIF)))\n        ;\n      SPDR = 0XFF;\n    }\n    // wait for last crc byte\n    while (!(SPSR & (1 << SPIF)))\n      ;\n    #else  // OPTIMIZE_HARDWARE_SPI\n    while (offset_++ < 514) {\n      spiRec();\n    }\n    #endif  // OPTIMIZE_HARDWARE_SPI\n    chipSelectHigh();\n    inBlock_ = 0;\n  }\n}", "docstring": "//------------------------------------------------------------------------------\n/** Skip remaining data in a block when in partial block read mode. */", "url": "https://github.com/MIT-Senseable-City-Lab/flatburn/blob/dc5bdbfeb53ac85cb26f27325326cbd7c868c9a3/Build/Firmware/lib/sdcard/src/utility/Sd2Card.cpp#L475-L497", "sha": "dc5bdbfeb53ac85cb26f27325326cbd7c868c9a3"}331{"repo_name": "nanotube", "dataset": "github_2023", "owner": "Xilinx", "lang": "cpp", "func_name": "main", "code": "int main(int argc, char *argv[])\n{\n  llvm::InitLLVM init_llvm(argc, argv);\n\n  // Initialize passes.  See llvm/tools/opt/opt.cpp\n  llvm::PassRegistry &registry = *llvm::PassRegistry::getPassRegistry();\n  llvm::initializeCore(registry);\n  llvm::initializeAnalysis(registry);\n  llvm::initializeTransformUtils(registry);\n\n  cl::ParseCommandLineOptions(argc, argv, \"Nanotube back end\\n\");\n\n  llvm::LLVMContext context;\n  llvm::SMDiagnostic sm_diag;\n\n  llvm::legacy::PassManager pm;\n  llvm::Error err = add_passes(pm);\n  if (err) {\n    llvm::errs() << argv[0] << \": \" << toString(std::move(err)) << \"\\n\";\n    return 1;\n  }\n\n  std::unique_ptr<llvm::Module> module;\n  module = parseIRFile(opt_input_filename, sm_diag, context, false);\n  if (!module) {\n    sm_diag.print(argv[0], llvm::WithColor::error(llvm::errs(), argv[0]));\n    return 1;\n  }\n\n  Triple the_triple = Triple(module->getTargetTriple());\n  std::cout << \"Target triple: \" << the_triple.getTriple() << \"\\n\";\n\n  pm.add(create_hls_printer(opt_output_directory, opt_overwrite));\n\n  pm.run(*module);\n\n  return 0;\n}", "docstring": "///////////////////////////////////////////////////////////////////////////\n// The main program.", "url": "https://github.com/Xilinx/nanotube/blob/9ff2e920b02eb1b7df55811cf8b25f1dd410f61c/back_end/back_end_main.cpp#L110-L147", "sha": "9ff2e920b02eb1b7df55811cf8b25f1dd410f61c"}332{"repo_name": "risam", "dataset": "github_2023", "owner": "rpl-cmu", "lang": "cpp", "func_name": "RISAM2::dot", "code": "void RISAM2::dot(std::ostream& s, sharedClique clique, const KeyFormatter& keyFormatter, int parentnum) const {\n  static int num = 0;\n  bool first = true;\n  std::stringstream out;\n  out << num;\n  std::string parent = out.str();\n  parent += \"[label=\\\"\";\n\n  for (Key key : clique->conditional_->frontals()) {\n    if (!first) parent += \", \";\n    first = false;\n    parent += keyFormatter(key);\n  }\n\n  if (clique->parent()) {\n    parent += \" : \";\n    s << parentnum << \"->\" << num << \"\\n\";\n  }\n\n  first = true;\n  for (Key parentKey : clique->conditional_->parents()) {\n    if (!first) parent += \", \";\n    first = false;\n    parent += keyFormatter(parentKey);\n  }\n\n  parent += \"\\\"\";\n  bool update = false;\n  bool convex = false;\n  for (Key key : clique->conditional_->frontals()) {\n    if (last_update_info_.updateInvolvedKeys.find(key) != last_update_info_.updateInvolvedKeys.end()) update = true;\n    if (last_update_info_.affectedKeysConvex.find(key) != last_update_info_.affectedKeysConvex.end()) convex = true;\n  }\n  for (Key key : clique->conditional_->parents()) {\n    if (last_update_info_.updateInvolvedKeys.find(key) != last_update_info_.updateInvolvedKeys.end()) update = true;\n    if (last_update_info_.affectedKeysConvex.find(key) != last_update_info_.affectedKeysConvex.end()) convex = true;\n  }\n  if (update) {\n    parent += \", color=firebrick\";\n  } else if (convex) {\n    parent += \", color=dodgerblue2\";\n  }\n  parent += \"];\\n\";\n\n  s << parent;\n  parentnum = num;\n\n  for (sharedClique c : clique->children) {\n    num++;\n    dot(s, c, keyFormatter, parentnum);\n  }\n}", "docstring": "/* ************************************************************************* */", "url": "https://github.com/rpl-cmu/risam/blob/a6f9b4459e6820f81f6d2d113d57d43638ae32a3/risam/src/RISAM2.cpp#L769-L820", "sha": "a6f9b4459e6820f81f6d2d113d57d43638ae32a3"}333{"repo_name": "nostr-signing-device", "dataset": "github_2023", "owner": "lnbits", "lang": "cpp", "func_name": "main", "code": "int main() {\n  DynamicJsonDocument doc(1024);\n  doc[\"dummy\"].as<char>();\n}", "docstring": "// See issue #1498", "url": "https://github.com/lnbits/nostr-signing-device/blob/1956e5933b3da5e49d30db9b8597497b157a5cbc/libraries/ArduinoJson/extras/tests/FailingBuilds/variant_as_char.cpp#L9-L12", "sha": "1956e5933b3da5e49d30db9b8597497b157a5cbc"}334{"repo_name": "nostr-signing-device", "dataset": "github_2023", "owner": "lnbits", "lang": "cpp", "func_name": "TFT_eSPI::begin_tft_write", "code": "inline void TFT_eSPI::begin_tft_write(void){\n  if (locked) {\n    locked = false; // Flag to show SPI access now unlocked\n#if defined (SPI_HAS_TRANSACTION) && defined (SUPPORT_TRANSACTIONS) && !defined(TFT_PARALLEL_8_BIT) && !defined(RP2040_PIO_INTERFACE)\n    spi.beginTransaction(SPISettings(SPI_FREQUENCY, MSBFIRST, TFT_SPI_MODE));\n#endif\n    CS_L;\n    SET_BUS_WRITE_MODE;  // Some processors (e.g. ESP32) allow recycling the tx buffer when rx is not used\n  }\n}", "docstring": "/***************************************************************************************\n** Function name:           begin_tft_write (was called spi_begin)\n** Description:             Start SPI transaction for writes and select TFT\n***************************************************************************************/", "url": "https://github.com/lnbits/nostr-signing-device/blob/1956e5933b3da5e49d30db9b8597497b157a5cbc/libraries/TFT_eSPI/TFT_eSPI.cpp#L74-L83", "sha": "1956e5933b3da5e49d30db9b8597497b157a5cbc"}335{"repo_name": "nostr-signing-device", "dataset": "github_2023", "owner": "lnbits", "lang": "cpp", "func_name": "Cipher", "code": "static void Cipher(state_t* state, const uint8_t* RoundKey)\n{\n  uint8_t round = 0;\n\n  // Add the First round key to the state before starting the rounds.\n  AddRoundKey(0, state, RoundKey);\n\n  // There will be Nr rounds.\n  // The first Nr-1 rounds are identical.\n  // These Nr rounds are executed in the loop below.\n  // Last one without MixColumns()\n  for (round = 1; ; ++round)\n  {\n    SubBytes(state);\n    ShiftRows(state);\n    if (round == Nr) {\n      break;\n    }\n    MixColumns(state);\n    AddRoundKey(round, state, RoundKey);\n  }\n  // Add round key to last round\n  AddRoundKey(Nr, state, RoundKey);\n}", "docstring": "// #if (defined(CBC) && CBC == 1) || (defined(ECB) && ECB == 1)\n// Cipher is the main function that encrypts the PlainText.", "url": "https://github.com/lnbits/nostr-signing-device/blob/1956e5933b3da5e49d30db9b8597497b157a5cbc/libraries/tiny-AES-c/aes.cpp#L413-L436", "sha": "1956e5933b3da5e49d30db9b8597497b157a5cbc"}336{"repo_name": "llama.cpp", "dataset": "github_2023", "owner": "ggerganov", "lang": "cpp", "func_name": "dequantize_mul_mat_vec_q5_k", "code": "static void dequantize_mul_mat_vec_q5_k(const void *__restrict__ vx,\n                                        const float *__restrict__ yy,\n                                        float *__restrict__ dst,\n                                        const int ncols,\n                                        const sycl::nd_item<3> &item_ct1) {\n\n    const int row = item_ct1.get_group(2);\n    const int num_blocks_per_row = ncols / QK_K;\n    const int ib0 = row*num_blocks_per_row;\n\n    const block_q5_K * x = (const block_q5_K *)vx + ib0;\n\n    float tmp = 0; // partial sum for thread in warp\n\n#if QK_K == 256\n    const uint16_t kmask1 = 0x3f3f;\n    const uint16_t kmask2 = 0x0f0f;\n    const uint16_t kmask3 = 0xc0c0;\n\n    const int tid = item_ct1.get_local_id(2) / 2; // 0...15\n    const int ix = item_ct1.get_local_id(2) % 2;\n\n    const int il  = tid/4;     // 0...3\n    const int ir  = tid - 4*il;// 0...3\n    const int n   = 2;\n\n    const int im = il/2;  // 0 or 1. 0 computes 0,32 + 128,160, 1 computes 64,96 + 192,224\n    const int in = il%2;\n\n    const int l0 = n*(2*ir + in);\n    const int q_offset = 32*im + l0;\n    const int y_offset = 64*im + l0;\n\n    const uint8_t hm1  = 1 << (2*im);\n    const uint8_t hm2  = hm1 << 4;\n\n    uint16_t aux[4];\n    const uint8_t * sc = (const uint8_t *)aux;\n\n    uint16_t q16[8];\n    const uint8_t * q4 = (const uint8_t *)q16;\n\n    for (int i = ix; i < num_blocks_per_row; i += 2) {\n\n        const uint8_t * ql1 = x[i].qs + q_offset;\n        const uint8_t * qh  = x[i].qh + l0;\n        const float   * y1  = yy + i*QK_K + y_offset;\n        const float   * y2  = y1 + 128;\n\n        const float dall = x[i].dm[0];\n        const float dmin = x[i].dm[1];\n\n        const uint16_t * a = (const uint16_t *)x[i].scales;\n        aux[0] = a[im+0] & kmask1;\n        aux[1] = a[im+2] & kmask1;\n        aux[2] = ((a[im+4] >> 0) & kmask2) | ((a[im+0] & kmask3) >> 2);\n        aux[3] = ((a[im+4] >> 4) & kmask2) | ((a[im+2] & kmask3) >> 2);\n\n        sycl::float4 sum = {0.f, 0.f, 0.f, 0.f};\n        float smin = 0;\n        const uint16_t * q1 = (const uint16_t *)ql1;\n        const uint16_t * q2 = q1 + 32;\n        q16[0] = q1[0] & 0x0f0f;\n        q16[1] = q1[8] & 0x0f0f;\n        q16[2] = (q1[0] >> 4) & 0x0f0f;\n        q16[3] = (q1[8] >> 4) & 0x0f0f;\n        q16[4] = q2[0] & 0x0f0f;\n        q16[5] = q2[8] & 0x0f0f;\n        q16[6] = (q2[0] >> 4) & 0x0f0f;\n        q16[7] = (q2[8] >> 4) & 0x0f0f;\n        for (int l = 0; l < n; ++l) {\n            sum.x() +=\n                y1[l + 0] * (q4[l + 0] + (qh[l + 0] & (hm1 << 0) ? 16 : 0)) +\n                y1[l + 16] * (q4[l + 2] + (qh[l + 16] & (hm1 << 0) ? 16 : 0));\n            sum.y() +=\n                y1[l + 32] * (q4[l + 4] + (qh[l + 0] & (hm1 << 1) ? 16 : 0)) +\n                y1[l + 48] * (q4[l + 6] + (qh[l + 16] & (hm1 << 1) ? 16 : 0));\n            sum.z() +=\n                y2[l + 0] * (q4[l + 8] + (qh[l + 0] & (hm2 << 0) ? 16 : 0)) +\n                y2[l + 16] * (q4[l + 10] + (qh[l + 16] & (hm2 << 0) ? 16 : 0));\n            sum.w() +=\n                y2[l + 32] * (q4[l + 12] + (qh[l + 0] & (hm2 << 1) ? 16 : 0)) +\n                y2[l + 48] * (q4[l + 14] + (qh[l + 16] & (hm2 << 1) ? 16 : 0));\n            smin += (y1[l] + y1[l+16]) * sc[2] + (y1[l+32] + y1[l+48]) * sc[3]\n                  + (y2[l] + y2[l+16]) * sc[6] + (y2[l+32] + y2[l+48]) * sc[7];\n        }\n        tmp += dall * (sum.x() * sc[0] + sum.y() * sc[1] + sum.z() * sc[4] +\n                       sum.w() * sc[5]) -\n               dmin * smin;\n    }\n\n#else\n    const int tid = item_ct1.get_local_id(2)/(2*K_QUANTS_PER_ITERATION);  // 0...15\n    const int ix  = item_ct1.get_local_id(2)%(2*K_QUANTS_PER_ITERATION);\n    const int step = tid * K_QUANTS_PER_ITERATION;\n    const int im = step/8;\n    const int in = step%8;\n\n    for (int i = ix; i < num_blocks_per_row; i += 2*K_QUANTS_PER_ITERATION) {\n        const uint8_t * q = x[i].qs + step;\n        const int8_t  * s = x[i].scales;\n        const float   * y = yy + i*QK_K + step;\n        const float     d = x[i].d;\n        float sum = 0.f;\n        for (int j = 0; j < K_QUANTS_PER_ITERATION; ++j) {\n            const uint8_t h = x[i].qh[in+j] >> im;\n            sum += y[j+ 0] * d * s[0] * ((q[j+ 0] & 0xF) - ((h >> 0) & 1 ? 0 : 16))\n                 + y[j+16] * d * s[1] * ((q[j+16] & 0xF) - ((h >> 2) & 1 ? 0 : 16))\n                 + y[j+32] * d * s[2] * ((q[j+ 0] >>  4) - ((h >> 4) & 1 ? 0 : 16))\n                 + y[j+48] * d * s[3] * ((q[j+16] >>  4) - ((h >> 6) & 1 ? 0 : 16));\n        }\n        tmp += sum;\n    }\n#endif\n\n    // sum up partial sums and write back result\n#pragma unroll\n    for (int mask = QK_WARP_SIZE / 2; mask > 0; mask >>= 1) {\n        tmp +=\n            dpct::permute_sub_group_by_xor(item_ct1.get_sub_group(), tmp, mask);\n    }\n\n    if (item_ct1.get_local_id(2) == 0) {\n        dst[row] = tmp;\n    }\n}", "docstring": "/*\nDPCT1110:7: The total declared local variable size in device function\ndequantize_mul_mat_vec_q5_k exceeds 128 bytes and may cause high register\npressure. Consult with your hardware vendor to find the total register size\navailable and adjust the code, or use smaller sub-group size to avoid high\nregister pressure.\n*/", "url": "https://github.com/ggerganov/llama.cpp/blob/4078c77f9891831f29ffc7c315c8ec6695ba5ce7/ggml/src/ggml-sycl/dmmv.cpp#L520-L645", "sha": "4078c77f9891831f29ffc7c315c8ec6695ba5ce7"}337{"repo_name": "llama.cpp", "dataset": "github_2023", "owner": "ggerganov", "lang": "cpp", "func_name": "vars", "code": "std::string vars() override {\n        return VARS_TO_STR6(type, n, m, r, b, v);\n    }", "docstring": "// view (non-contiguous src1)", "url": "https://github.com/ggerganov/llama.cpp/blob/4078c77f9891831f29ffc7c315c8ec6695ba5ce7/tests/test-backend-ops.cpp#L1086-L1088", "sha": "4078c77f9891831f29ffc7c315c8ec6695ba5ce7"}338{"repo_name": "AutoDriving-Planning-Control-Algorithm-Simulation-Carla", "dataset": "github_2023", "owner": "L5Player", "lang": "cpp", "func_name": "DriveWidget::leaveEvent", "code": "void DriveWidget::leaveEvent(QEvent *event)\n{\n  stop();\n}", "docstring": "// When the mouse leaves the widget but the button is still held down,\n// we don't get the leaveEvent() because the mouse is \"grabbed\" (by\n// default from Qt).  However, when the mouse drags out of the widget\n// and then other buttons are pressed (or possibly other\n// window-manager things happen), we will get a leaveEvent() but not a\n// mouseReleaseEvent().  Without catching this event you can have a\n// robot stuck \"on\" without the user controlling it.", "url": "https://github.com/L5Player/AutoDriving-Planning-Control-Algorithm-Simulation-Carla/blob/cf02ec2e9d7df21f2a021a11880e382d654de5d8/src/ros-bridge/rviz_carla_plugin/src/drive_widget.cpp#L209-L212", "sha": "cf02ec2e9d7df21f2a021a11880e382d654de5d8"}339{"repo_name": "JsonAsAsset", "dataset": "github_2023", "owner": "JsonAsAsset", "lang": "cpp", "func_name": "detexDecompressBlockBPTC_SIGNED_FLOAT", "code": "bool detexDecompressBlockBPTC_SIGNED_FLOAT(const uint8_t * DETEX_RESTRICT bitstring,\nuint32_t mode_mask, uint32_t flags, uint8_t * DETEX_RESTRICT pixel_buffer) {\n\treturn DecompressBlockBPTCFloatShared(bitstring, mode_mask, flags, true,\n\t\tpixel_buffer);\n}", "docstring": "/* Decompress a 128-bit 4x4 pixel texture block compressed using the */\n/* BPTC_FLOAT (BC6H_FLOAT) format. The output format is */\n/* DETEX_PIXEL_FORMAT_SIGNED_FLOAT_RGBX16. */", "url": "https://github.com/JsonAsAsset/JsonAsAsset/blob/75767cc02d79923d7411546856e75e956da46d47/Source/Detex/ThirdParty/detex/decompress-bptc-float.cpp#L640-L644", "sha": "75767cc02d79923d7411546856e75e956da46d47"}340{"repo_name": "JsonAsAsset", "dataset": "github_2023", "owner": "JsonAsAsset", "lang": "cpp", "func_name": "BlockATI1::flip4", "code": "void BlockATI1::flip4()\n{\n\talpha.flip4();\n}", "docstring": "/// Flip ATI1 block vertically.", "url": "https://github.com/JsonAsAsset/JsonAsAsset/blob/75767cc02d79923d7411546856e75e956da46d47/Source/NVTT/ThirdParty/nvtt/nvimage/BlockDXT.cpp#L504-L507", "sha": "75767cc02d79923d7411546856e75e956da46d47"}341{"repo_name": "moonray", "dataset": "github_2023", "owner": "dreamworksanimation", "lang": "cpp", "func_name": "TileWorkQueue::clampToPass", "code": "void\nTileWorkQueue::clampToPass(unsigned passIdx)\n{\n    MNRY_ASSERT(mNumPasses);\n    passIdx = std::min(passIdx, mNumPasses - 1u);\n    mGroupClampIdx = mPassInfos[passIdx].mEndGroupIdx;\n}", "docstring": "// Executes the up until and including this pass and then stops.", "url": "https://github.com/dreamworksanimation/moonray/blob/540f3e757ec334bf68a0a47222ad204ed2e3de04/lib/rendering/rndr/TileWorkQueue.cc#L165-L171", "sha": "540f3e757ec334bf68a0a47222ad204ed2e3de04"}342{"repo_name": "dillo-plus", "dataset": "github_2023", "owner": "crossbowerbt", "lang": "cpp", "func_name": "CharIterator::CharIterator", "code": "CharIterator::CharIterator ()\n{\n   it = NULL;\n}", "docstring": "// -----------------\n//    CharIterator\n// -----------------", "url": "https://github.com/crossbowerbt/dillo-plus/blob/7d093e6bddcb3338938ea5959844e62ff1f9b76f/dw/iterator.cc#L736-L739", "sha": "7d093e6bddcb3338938ea5959844e62ff1f9b76f"}343{"repo_name": "dillo-plus", "dataset": "github_2023", "owner": "crossbowerbt", "lang": "cpp", "func_name": "a_Menu_bugmeter_popup", "code": "void a_Menu_bugmeter_popup(BrowserWindow *bw, const DilloUrl *url)\n{\n   static Fl_Menu_Item pm[] = {\n      {\"Validate URL with W3C\", 0, Menu_bugmeter_validate_w3c_cb,0,0,0,0,0,0},\n      {\"Validate URL with WDG\", 0, Menu_bugmeter_validate_wdg_cb, 0,\n       FL_MENU_DIVIDER,0,0,0,0},\n      {\"About bug meter\", 0, Menu_bugmeter_about_cb,0,0,0,0,0,0},\n      {0,0,0,0,0,0,0,0,0}\n   };\n\n   popup_x = Fl::event_x();\n   popup_y = Fl::event_y();\n   popup_bw = bw;\n   a_Url_free(popup_url);\n   popup_url = a_Url_dup(url);\n\n   a_Timeout_add(0.0, Menu_simple_popup_cb, (void*)pm);\n}", "docstring": "/*\n * Bugmeter popup menu (construction & popup)\n */", "url": "https://github.com/crossbowerbt/dillo-plus/blob/7d093e6bddcb3338938ea5959844e62ff1f9b76f/src/menu.cc#L614-L631", "sha": "7d093e6bddcb3338938ea5959844e62ff1f9b76f"}344{"repo_name": "ai.deploy.box", "dataset": "github_2023", "owner": "TalkUHulk", "lang": "cpp", "func_name": "ClipperBase::PopScanbeam", "code": "bool ClipperBase::PopScanbeam(cInt &Y) {\n  if (m_Scanbeam.empty())\n    return false;\n  Y = m_Scanbeam.top();\n  m_Scanbeam.pop();\n  while (!m_Scanbeam.empty() && Y == m_Scanbeam.top()) {\n    m_Scanbeam.pop();\n  } // Pop duplicates.\n  return true;\n}", "docstring": "//------------------------------------------------------------------------------", "url": "https://github.com/TalkUHulk/ai.deploy.box/blob/f937195eab6de38078d1524dae598fd5f142c8c8/source/utility/clipper.cpp#L1283-L1292", "sha": "f937195eab6de38078d1524dae598fd5f142c8c8"}345{"repo_name": "Love-Babbar-CPP-DSA-Course", "dataset": "github_2023", "owner": "kishanrajput23", "lang": "cpp", "func_name": "insertAtTail", "code": "void insertAtTail(Node* &tail, int d) {\n    Node* temp = new Node(d);\n    tail->next = temp;\n    tail = temp;\n}", "docstring": "// inserting new node at tail or ending", "url": "https://github.com/kishanrajput23/Love-Babbar-CPP-DSA-Course/blob/1876e75344fe102245dd18802d2c9540e70f5525/Lectures/Lecture_44/Lecture_Codes/Singly_Linked_List/05_deleting_node.cpp#L34-L38", "sha": "1876e75344fe102245dd18802d2c9540e70f5525"}346{"repo_name": "VkDoom", "dataset": "github_2023", "owner": "dpjudas", "lang": "cpp", "func_name": "main", "code": "int main(int argc, char** argv)\n{\n    std::vector<std::string> inputFiles;\n    std::vector<std::string> outputDirOrFiles;\n    std::string              whiteListFile;\n    int                      opts;\n    int                      verbosity;\n\n    // handle errors by exiting\n    spv::spirvbin_t::registerErrorHandler(errHandler);\n\n    // Log messages to std::cout\n    spv::spirvbin_t::registerLogHandler(logHandler);\n\n    if (argc < 2)\n        usage(argv[0]);\n\n    parseCmdLine(argc, argv, inputFiles, outputDirOrFiles, whiteListFile, opts, verbosity);\n\n    if (outputDirOrFiles.empty())\n        usage(argv[0], \"Output directory or file(s) required.\");\n\n    const bool isMultiInput      = inputFiles.size() > 1;\n    const bool isMultiOutput     = outputDirOrFiles.size() > 1;\n    const bool isSingleOutputDir = !isMultiOutput && std::filesystem::is_directory(outputDirOrFiles[0]);\n\n    if (isMultiInput && !isMultiOutput && !isSingleOutputDir)\n        usage(argv[0], \"Output is not a directory.\");\n\n\n    if (isMultiInput && isMultiOutput && (outputDirOrFiles.size() != inputFiles.size()))\n        usage(argv[0], \"Output must be either a single directory or one output file per input.\");\n\n    // Main operations: read, remap, and write.\n    execute(inputFiles, outputDirOrFiles, isSingleOutputDir, whiteListFile, opts, verbosity);\n\n    // If we get here, everything went OK!  Nothing more to be done.\n}", "docstring": "// namespace", "url": "https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/libraries/ZVulkan/src/glslang/StandAlone/spirv-remap.cpp#L365-L402", "sha": "bbaaa9a49db3e22e5c31787faaf790b46b8c87c4"}347{"repo_name": "VkDoom", "dataset": "github_2023", "owner": "dpjudas", "lang": "cpp", "func_name": "TShader::setHlslIoMapping", "code": "void TShader::setHlslIoMapping(bool hlslIoMap)          { intermediate->setHlslIoMapping(hlslIoMap); }", "docstring": "// See comment above TDefaultHlslIoMapper in iomapper.cpp:", "url": "https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/libraries/ZVulkan/src/glslang/glslang/MachineIndependent/ShaderLang.cpp#L1854-L1854", "sha": "bbaaa9a49db3e22e5c31787faaf790b46b8c87c4"}348{"repo_name": "VkDoom", "dataset": "github_2023", "owner": "dpjudas", "lang": "cpp", "func_name": "TIntermediate::addUsedLocation", "code": "int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& type, bool& typeCollision)\n{\n    typeCollision = false;\n\n    int set;\n    if (qualifier.isPipeInput())\n        set = 0;\n    else if (qualifier.isPipeOutput())\n        set = 1;\n    else if (qualifier.storage == EvqUniform)\n        set = 2;\n    else if (qualifier.storage == EvqBuffer)\n        set = 3;\n    else if (qualifier.storage == EvqTileImageEXT)\n        set = 4;\n    else if (qualifier.isAnyPayload())\n        set = 0;\n    else if (qualifier.isAnyCallable())\n        set = 1;\n    else if (qualifier.isHitObjectAttrNV())\n        set = 2;\n    else\n        return -1;\n\n    int size;\n    if (qualifier.isAnyPayload() || qualifier.isAnyCallable()) {\n        size = 1;\n    } else if (qualifier.isUniformOrBuffer() || qualifier.isTaskMemory()) {\n        if (type.isSizedArray())\n            size = type.getCumulativeArraySize();\n        else\n            size = 1;\n    } else {\n        // Strip off the outer array dimension for those having an extra one.\n        if (type.isArray() && qualifier.isArrayedIo(language)) {\n            TType elementType(type, 0);\n            size = computeTypeLocationSize(elementType, language);\n        } else\n            size = computeTypeLocationSize(type, language);\n    }\n\n    // Locations, and components within locations.\n    //\n    // Almost always, dealing with components means a single location is involved.\n    // The exception is a dvec3. From the spec:\n    //\n    // \"A dvec3 will consume all four components of the first location and components 0 and 1 of\n    // the second location. This leaves components 2 and 3 available for other component-qualified\n    // declarations.\"\n    //\n    // That means, without ever mentioning a component, a component range\n    // for a different location gets specified, if it's not a vertex shader input. (!)\n    // (A vertex shader input will show using only one location, even for a dvec3/4.)\n    //\n    // So, for the case of dvec3, we need two independent ioRanges.\n    //\n    // For raytracing IO (payloads and callabledata) each declaration occupies a single\n    // slot irrespective of type.\n    int collision = -1; // no collision\n    if (qualifier.isAnyPayload() || qualifier.isAnyCallable() || qualifier.isHitObjectAttrNV()) {\n        TRange range(qualifier.layoutLocation, qualifier.layoutLocation);\n        collision = checkLocationRT(set, qualifier.layoutLocation);\n        if (collision < 0)\n            usedIoRT[set].push_back(range);\n        return collision;\n    }\n    if (size == 2 && type.getBasicType() == EbtDouble && type.getVectorSize() == 3 &&\n        (qualifier.isPipeInput() || qualifier.isPipeOutput())) {\n        // Dealing with dvec3 in/out split across two locations.\n        // Need two io-ranges.\n        // The case where the dvec3 doesn't start at component 0 was previously caught as overflow.\n\n        // First range:\n        TRange locationRange(qualifier.layoutLocation, qualifier.layoutLocation);\n        TRange componentRange(0, 3);\n        TIoRange range(locationRange, componentRange, type.getBasicType(), 0, qualifier.centroid, qualifier.smooth, qualifier.flat);\n\n        // check for collisions\n        collision = checkLocationRange(set, range, type, typeCollision);\n        if (collision < 0) {\n            usedIo[set].push_back(range);\n\n            // Second range:\n            TRange locationRange2(qualifier.layoutLocation + 1, qualifier.layoutLocation + 1);\n            TRange componentRange2(0, 1);\n            TIoRange range2(locationRange2, componentRange2, type.getBasicType(), 0, qualifier.centroid, qualifier.smooth, qualifier.flat);\n\n            // check for collisions\n            collision = checkLocationRange(set, range2, type, typeCollision);\n            if (collision < 0)\n                usedIo[set].push_back(range2);\n        }\n        return collision;\n    }\n\n    // Not a dvec3 in/out split across two locations, generic path.\n    // Need a single IO-range block.\n\n    TRange locationRange(qualifier.layoutLocation, qualifier.layoutLocation + size - 1);\n    TRange componentRange(0, 3);\n    if (qualifier.hasComponent() || type.getVectorSize() > 0) {\n        int consumedComponents = type.getVectorSize() * (type.getBasicType() == EbtDouble ? 2 : 1);\n        if (qualifier.hasComponent())\n            componentRange.start = qualifier.layoutComponent;\n        componentRange.last  = componentRange.start + consumedComponents - 1;\n    }\n\n    // combine location and component ranges\n    TBasicType basicTy = type.getBasicType();\n    if (basicTy == EbtSampler && type.getSampler().isAttachmentEXT())\n        basicTy = type.getSampler().type;\n    TIoRange range(locationRange, componentRange, basicTy, qualifier.hasIndex() ? qualifier.getIndex() : 0, qualifier.centroid, qualifier.smooth, qualifier.flat);\n\n    // check for collisions, except for vertex inputs on desktop targeting OpenGL\n    if (! (!isEsProfile() && language == EShLangVertex && qualifier.isPipeInput()) || spvVersion.vulkan > 0)\n        collision = checkLocationRange(set, range, type, typeCollision);\n\n    if (collision < 0)\n        usedIo[set].push_back(range);\n\n    return collision;\n}", "docstring": "// Accumulate locations used for inputs, outputs, and uniforms, payload, callable data, and tileImageEXT\n// and check for collisions as the accumulation is done.\n//\n// Returns < 0 if no collision, >= 0 if collision and the value returned is a colliding value.\n//\n// typeCollision is set to true if there is no direct collision, but the types in the same location\n// are different.\n//", "url": "https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/libraries/ZVulkan/src/glslang/glslang/MachineIndependent/linkValidate.cpp#L1617-L1738", "sha": "bbaaa9a49db3e22e5c31787faaf790b46b8c87c4"}349{"repo_name": "VkDoom", "dataset": "github_2023", "owner": "dpjudas", "lang": "cpp", "func_name": "SetupGenMidi", "code": "static void SetupGenMidi()\n{\n\t// The OPL renderer should not care about where this comes from.\n\t// Note: No I_Error here - this needs to be consistent with the rest of the music code.\n\tauto lump = fileSystem.CheckNumForName(\"GENMIDI\", ns_global);\n\tif (lump < 0)\n\t{\n\t\tPrintf(\"No GENMIDI lump found. OPL playback not available.\\n\");\n\t\treturn;\n\t}\n\tauto genmidi = fileSystem.ReadFile(lump);\n\n\tif (genmidi.size() < 8 + 175 * 36 || memcmp(genmidi.data(), \"#OPL_II#\", 8)) return;\n\tZMusic_SetGenMidi(genmidi.bytes() + 8);\n}", "docstring": "//==========================================================================\n//\n// Pass some basic working data to the music backend\n// We do this once at startup for everything available.\n//\n//==========================================================================", "url": "https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/common/audio/music/i_music.cpp#L173-L187", "sha": "bbaaa9a49db3e22e5c31787faaf790b46b8c87c4"}350{"repo_name": "VkDoom", "dataset": "github_2023", "owner": "dpjudas", "lang": "cpp", "func_name": "SoundEngine::UnlinkChannel", "code": "void SoundEngine::UnlinkChannel(FSoundChan *chan)\n{\n\t*(chan->PrevChan) = chan->NextChan;\n\tif (chan->NextChan != NULL)\n\t{\n\t\tchan->NextChan->PrevChan = chan->PrevChan;\n\t}\n}", "docstring": "//==========================================================================\n//\n// S_UnlinkChannel\n//\n//==========================================================================", "url": "https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/common/audio/sound/s_sound.cpp#L252-L259", "sha": "bbaaa9a49db3e22e5c31787faaf790b46b8c87c4"}351{"repo_name": "VkDoom", "dataset": "github_2023", "owner": "dpjudas", "lang": "cpp", "func_name": "InterplayDecoder::DecodeBlock7", "code": "void InterplayDecoder::DecodeBlock7(int32_t offset)\n{\n    uint8_t* pBuffer = GetCurrentFrame() + (intptr_t)offset;\n    uint32_t flags = 0;\n\n    uint8_t P[2];\n    P[0] = *ChunkPtr++;\n    P[1] = *ChunkPtr++;\n\n    // 2-color encoding\n    if (P[0] <= P[1])\n    {\n        // need 8 more bytes from the stream\n        for (int y = 0; y < 8; y++)\n        {\n            flags = (*ChunkPtr++) | 0x100;\n            for (; flags != 1; flags >>= 1) {\n                *pBuffer++ = P[flags & 1];\n            }\n            pBuffer += (videoStride - 8);\n        }\n    }\n    else\n    {\n        // need 2 more bytes from the stream\n        flags = LE_16(ChunkPtr);\n        ChunkPtr += 2;\n\n        for (int y = 0; y < 8; y += 2)\n        {\n            for (int x = 0; x < 8; x += 2, flags >>= 1)\n            {\n                pBuffer[x] =\n                    pBuffer[x + 1] =\n                    pBuffer[x + videoStride] =\n                    pBuffer[x + 1 + videoStride] = P[flags & 1];\n            }\n            pBuffer += videoStride * 2;\n        }\n    }\n}", "docstring": "// Block6 is unknown and skipped", "url": "https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/common/cutscenes/playmve.cpp#L822-L862", "sha": "bbaaa9a49db3e22e5c31787faaf790b46b8c87c4"}352{"repo_name": "VkDoom", "dataset": "github_2023", "owner": "dpjudas", "lang": "cpp", "func_name": "Atomic", "code": "static void Atomic()\n{\n\t// Flip current white\n\tCurrentWhite = OtherWhite();\n\tSweepPos = &Root;\n\tState = GCS_Sweep;\n\tEstimate = AllocBytes;\n}", "docstring": "//==========================================================================\n//\n// Atomic\n//\n// If there were any propagations that needed to be done atomicly, they\n// would go here. It also sets things up for the sweep state.\n//\n//==========================================================================", "url": "https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/common/objects/dobjgc.cpp#L419-L426", "sha": "bbaaa9a49db3e22e5c31787faaf790b46b8c87c4"}353{"repo_name": "VkDoom", "dataset": "github_2023", "owner": "dpjudas", "lang": "cpp", "func_name": "FRawMouse::~FRawMouse", "code": "FRawMouse::~FRawMouse()\n{\n\tUngrab();\n}", "docstring": "//==========================================================================\n//\n// FRawMouse - Destructor\n//\n//==========================================================================", "url": "https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/common/platform/win32/i_mouse.cpp#L491-L494", "sha": "bbaaa9a49db3e22e5c31787faaf790b46b8c87c4"}354{"repo_name": "VkDoom", "dataset": "github_2023", "owner": "dpjudas", "lang": "cpp", "func_name": "FDInputMouse::Ungrab", "code": "void FDInputMouse::Ungrab()\n{\n\tDevice->Unacquire();\n\tGrabbed = false;\n\tSetCursorState(true);\n\tClearButtonState();\n}", "docstring": "//==========================================================================\n//\n// FDInputMouse :: Ungrab\n//\n//==========================================================================", "url": "https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/common/platform/win32/i_mouse.cpp#L862-L868", "sha": "bbaaa9a49db3e22e5c31787faaf790b46b8c87c4"}355{"repo_name": "VkDoom", "dataset": "github_2023", "owner": "dpjudas", "lang": "cpp", "func_name": "FRawPS2Manager::GetDevices", "code": "void FRawPS2Manager::GetDevices(TArray<IJoystickConfig *> &sticks)\n{\n\tfor (unsigned i = 0; i < Devices.Size(); ++i)\n\t{\n\t\tif (Devices[i]->IsConnected())\n\t\t{\n\t\t\tsticks.Push(Devices[i]);\n\t\t}\n\t}\n}", "docstring": "//===========================================================================\n//\n// FRawPS2Manager :: GetJoysticks\n//\n// Adds the IJoystick interfaces for each device we created to the sticks\n// array, if they are detected as connected.\n//\n//===========================================================================", "url": "https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/common/platform/win32/i_rawps2.cpp#L979-L988", "sha": "bbaaa9a49db3e22e5c31787faaf790b46b8c87c4"}356{"repo_name": "VkDoom", "dataset": "github_2023", "owner": "dpjudas", "lang": "cpp", "func_name": "FxBoolCast::Emit", "code": "ExpEmit FxBoolCast::Emit(VMFunctionBuilder *build)\n{\n\tExpEmit from = basex->Emit(build);\n\t\n\tif(from.Konst && from.RegType == REGT_INT)\n\t{ // this is needed here because the int const assign optimization returns a constant\n\t\tExpEmit to;\n\t\tto.Konst = true;\n\t\tto.RegType = REGT_INT;\n\t\tto.RegNum = build->GetConstantInt(!!build->FindConstantInt(from.RegNum));\n\t\treturn to;\n\t}\n\t\n\n\tassert(!from.Konst);\n\tassert(basex->ValueType->GetRegType() == REGT_INT || basex->ValueType->GetRegType() == REGT_FLOAT || basex->ValueType->GetRegType() == REGT_POINTER);\n\n\tif (NeedValue)\n\t{\n\t\tExpEmit to(build, REGT_INT);\n\t\tfrom.Free(build);\n\t\tbuild->Emit(OP_CASTB, to.RegNum, from.RegNum, from.RegType == REGT_INT ? CASTB_I : from.RegType == REGT_FLOAT ? CASTB_F : CASTB_A);\n\t\treturn to;\n\t}\n\telse\n\t{\n\t\treturn from;\n\t}\n}", "docstring": "//==========================================================================\n//\n//\n//\n//==========================================================================", "url": "https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/common/scripting/backend/codegen.cpp#L926-L954", "sha": "bbaaa9a49db3e22e5c31787faaf790b46b8c87c4"}357{"repo_name": "VkDoom", "dataset": "github_2023", "owner": "dpjudas", "lang": "cpp", "func_name": "DStatusBarCore::StatusbarToRealCoords", "code": "void DStatusBarCore::StatusbarToRealCoords(double& x, double& y, double& w, double& h) const\n{\n\tif (SBarScale.X == -1 || ForcedScale)\n\t{\n\t\tint hres = HorizontalResolution;\n\t\tint vres = VerticalResolution;\n\t\tValidateResolution(hres, vres);\n\n\t\tVirtualToRealCoords(twod, x, y, w, h, hres, vres, true, true);\n\t}\n\telse\n\t{\n\t\tx = ST_X + x * SBarScale.X;\n\t\ty = ST_Y + y * SBarScale.Y;\n\t\tw *= SBarScale.X;\n\t\th *= SBarScale.Y;\n\t}\n}", "docstring": "//============================================================================\n//\n// draw stuff\n//\n//============================================================================", "url": "https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/common/statusbar/base_sbar.cpp#L447-L464", "sha": "bbaaa9a49db3e22e5c31787faaf790b46b8c87c4"}358{"repo_name": "VkDoom", "dataset": "github_2023", "owner": "dpjudas", "lang": "cpp", "func_name": "MD5Context::Final", "code": "void MD5Context::Final(uint8_t digest[16])\n{\n\tint count = bytes[0] & 0x3f;\t/* Number of bytes in ctx->in */\n\tuint8_t *p = (uint8_t *)in + count;\n\n\t/* Set the first char of padding to 0x80.  There is always room. */\n\t*p++ = 0x80;\n\n\t/* Bytes of padding needed to make 56 bytes (-8..55) */\n\tcount = 56 - 1 - count;\n\n\tif (count < 0)\t\t/* Padding forces an extra block */\n\t{\n\t\tmemset(p, 0, count + 8);\n\t\tbyteSwap(in, 16);\n\t\tMD5Transform(buf, in);\n\t\tp = (uint8_t *)in;\n\t\tcount = 56;\n\t}\n\tmemset(p, 0, count);\n\tbyteSwap(in, 14);\n\n\t/* Append length in bits and transform */\n\tin[14] = bytes[0] << 3;\n\tin[15] = (bytes[1] << 3) | (bytes[0] >> 29);\n\tMD5Transform(buf, in);\n\n\tbyteSwap(buf, 4);\n\tmemcpy(digest, buf, 16);\n\tmemset(this, 0, sizeof(*this));\t/* In case it's sensitive */\n}", "docstring": "/*\n * Final wrapup - pad to 64-byte boundary with the bit pattern \n * 1 0* (64-bit count of bits processed, MSB-first)\n */", "url": "https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/common/thirdparty/md5.cpp#L100-L130", "sha": "bbaaa9a49db3e22e5c31787faaf790b46b8c87c4"}359{"repo_name": "VkDoom", "dataset": "github_2023", "owner": "dpjudas", "lang": "cpp", "func_name": "FMugShot::Reset", "code": "void FMugShot::Reset()\n{\n\tFaceHealthNow = FaceHealthLast = -1;\n\tbEvilGrin = false;\n\tbNormal = true;\n\tbDamageFaceActive = false;\n\tbOuchActive = false;\n\tCurrentState = NULL;\n\tRampageTimer = 0;\n\tLastDamageAngle = 1;\n}", "docstring": "//===========================================================================\n//\n// FMugShot :: Reset\n//\n//===========================================================================", "url": "https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/g_statusbar/sbar_mugshot.cpp#L223-L233", "sha": "bbaaa9a49db3e22e5c31787faaf790b46b8c87c4"}360{"repo_name": "VkDoom", "dataset": "github_2023", "owner": "dpjudas", "lang": "cpp", "func_name": "DBaseStatusBar::DrawBottomStuff", "code": "void DBaseStatusBar::DrawBottomStuff (EHudState state)\n{\n\tprimaryLevel->localEventManager->RenderUnderlay(state);\n\tDrawMessages (HUDMSGLayer_UnderHUD, (state == HUD_StatusBar) ? GetTopOfStatusbar() : twod->GetHeight());\n}", "docstring": "//---------------------------------------------------------------------------\n//\n// DrawBottomStuff\n//\n//---------------------------------------------------------------------------", "url": "https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/g_statusbar/shared_sbar.cpp#L1187-L1191", "sha": "bbaaa9a49db3e22e5c31787faaf790b46b8c87c4"}361{"repo_name": "VkDoom", "dataset": "github_2023", "owner": "dpjudas", "lang": "cpp", "func_name": "FTextureAnimator::UpdateAnimations", "code": "void FTextureAnimator::UpdateAnimations (uint64_t mstime)\n{\n\tfor (unsigned int i = 0; i < mFireTextures.Size(); i++)\n\t{\n\t\tFFireTexture* fire = &mFireTextures[i];\n\t\tbool updated = false;\n\n\t\tif (fire->SwitchTime == 0)\n\t\t{\n\t\t\tfire->SwitchTime = mstime + fire->Duration;\n\t\t}\n\t\telse while (fire->SwitchTime <= mstime)\n\t\t{\n\t\t\tstatic_cast<FireTexture*>(fire->texture->GetTexture())->Update();\n\t\t\tfire->SwitchTime = mstime + fire->Duration;\n\t\t\tupdated = true;\n\t\t}\n\n\t\tif (updated)\n\t\t{\n\t\t\tfire->texture->CleanHardwareData();\n\n\t\t\tif (fire->texture->GetSoftwareTexture())\n\t\t\t\tdelete fire->texture->GetSoftwareTexture();\n\n\t\t\tfire->texture->SetSoftwareTexture(nullptr);\n\t\t}\n\t}\n\tfor (unsigned int j = 0; j < mAnimations.Size(); ++j)\n\t{\n\t\tFAnimDef *anim = &mAnimations[j];\n\n\t\t// If this is the first time through R_UpdateAnimations, just\n\t\t// initialize the anim's switch time without actually animating.\n\t\tif (anim->SwitchTime == 0)\n\t\t{\n\t\t\tanim->SetSwitchTime (mstime);\n\t\t}\n\t\telse while (anim->SwitchTime <= mstime)\n\t\t{ // Multiple frames may have passed since the last time calling\n\t\t  // R_UpdateAnimations, so be sure to loop through them all.\n\n\t\t\tAdvanceFrame(anim->CurFrame, anim->AnimType, *anim);\n\t\t\tanim->SetSwitchTime (mstime);\n\t\t}\n\n\t\tif (anim->bDiscrete)\n\t\t{\n\t\t\tTexMan.SetTranslation (anim->BasePic, anim->Frames[anim->CurFrame].FramePic);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfor (unsigned int i = 0; i < anim->NumFrames; i++)\n\t\t\t{\n\t\t\t\tTexMan.SetTranslation (anim->BasePic + i, anim->BasePic + (i + anim->CurFrame) % anim->NumFrames);\n\t\t\t}\n\t\t}\n\t}\n}", "docstring": "//==========================================================================\n//\n// FTextureAnimator :: UpdateAnimations\n//\n// Updates texture translations for each animation and scrolls the skies.\n//\n//==========================================================================", "url": "https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/gamedata/textures/animations.cpp#L1130-L1188", "sha": "bbaaa9a49db3e22e5c31787faaf790b46b8c87c4"}362{"repo_name": "VkDoom", "dataset": "github_2023", "owner": "dpjudas", "lang": "cpp", "func_name": "DBaseDecal::SetShade", "code": "void DBaseDecal::SetShade (int r, int g, int b)\n{\n\tAlphaColor = MAKEARGB(ColorMatcher.Pick (r, g, b), r, g, b);\n}", "docstring": "//----------------------------------------------------------------------------\n//\n//\n//\n//----------------------------------------------------------------------------", "url": "https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/playsim/a_decals.cpp#L245-L248", "sha": "bbaaa9a49db3e22e5c31787faaf790b46b8c87c4"}363{"repo_name": "VkDoom", "dataset": "github_2023", "owner": "dpjudas", "lang": "cpp", "func_name": "CheckForPushSpecial", "code": "static void CheckForPushSpecial(line_t *line, int side, AActor *mobj, DVector2 *posforwindowcheck)\n{\n\tif (line->special && !(mobj->flags6 & MF6_NOTRIGGER))\n\t{\n\t\tif (posforwindowcheck && !(mobj->Level->i_compatflags2 & COMPATF2_PUSHWINDOW) && line->backsector != NULL)\n\t\t{ // Make sure this line actually blocks us and is not a window\n\t\t\t// or similar construct we are standing inside of.\n\t\t\tDVector3 pos = mobj->PosRelative(line);\n\t\t\tdouble fzt = line->frontsector->ceilingplane.ZatPoint(*posforwindowcheck);\n\t\t\tdouble fzb = line->frontsector->floorplane.ZatPoint(*posforwindowcheck);\n\t\t\tdouble bzt = line->backsector->ceilingplane.ZatPoint(*posforwindowcheck);\n\t\t\tdouble bzb = line->backsector->floorplane.ZatPoint(*posforwindowcheck);\n\t\t\tif (fzt >= mobj->Top() && bzt >= mobj->Top() &&\n\t\t\t\tfzb <= mobj->Z() && bzb <= mobj->Z())\n\t\t\t{\n\t\t\t\tif (line->flags & ML_3DMIDTEX)\n\t\t\t\t{\n\t\t\t\t\tdouble top, bot;\n\t\t\t\t\tP_GetMidTexturePosition(line, side, &top, &bot);\n\t\t\t\t\tif (bot < mobj->Top() && top > mobj->Z())\n\t\t\t\t\t{\n\t\t\t\t\t\tgoto isblocking;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// we must also check if some 3D floor in the backsector may be blocking\n\t\t\t\tfor (auto rover : line->backsector->e->XFloor.ffloors)\n\t\t\t\t{\n\t\t\t\t\tif (!(rover->flags & FF_SOLID) || !(rover->flags & FF_EXISTS)) continue;\n\n\t\t\t\t\tdouble ff_bottom = rover->bottom.plane->ZatPoint(*posforwindowcheck);\n\t\t\t\t\tdouble ff_top = rover->top.plane->ZatPoint(*posforwindowcheck);\n\n\t\t\t\t\tif (ff_bottom < mobj->Top() && ff_top > mobj->Z())\n\t\t\t\t\t{\n\t\t\t\t\t\tgoto isblocking;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\tisblocking:\n\t\tif (mobj->flags2 & MF2_PUSHWALL)\n\t\t{\n\t\t\tP_ActivateLine(line, mobj, side, SPAC_Push);\n\t\t}\n\t\telse if (mobj->flags2 & MF2_IMPACT)\n\t\t{\n\t\t\tif ((mobj->Level->flags2 & LEVEL2_MISSILESACTIVATEIMPACT) ||\n\t\t\t\t!(mobj->flags & MF_MISSILE) ||\n\t\t\t\t(mobj->target == NULL))\n\t\t\t{\n\t\t\t\tP_ActivateLine(line, mobj, side, SPAC_Impact);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tP_ActivateLine(line, mobj->target, side, SPAC_Impact);\n\t\t\t}\n\t\t}\n\t}\n}", "docstring": "//===========================================================================\n//\n// CheckForPushSpecial\n//\n//===========================================================================", "url": "https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/playsim/p_map.cpp#L2265-L2324", "sha": "bbaaa9a49db3e22e5c31787faaf790b46b8c87c4"}364{"repo_name": "VkDoom", "dataset": "github_2023", "owner": "dpjudas", "lang": "cpp", "func_name": "P_MoveThing", "code": "bool P_MoveThing(AActor *source, const DVector3 &pos, bool fog)\n{\n\tDVector3 old = source->Pos();\n\n\tsource->SetOrigin (pos, true);\n\tif (P_TestMobjLocation (source))\n\t{\n\t\tif (fog)\n\t\t{\n\t\t\tP_SpawnTeleportFog(source, pos, false, true);\n\t\t\tP_SpawnTeleportFog(source, old, true, true);\n\t\t}\n\t\tsource->ClearInterpolation();\n\t\tsource->renderflags |= RF_NOINTERPOLATEVIEW;\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\tsource->SetOrigin (old, true);\n\t\treturn false;\n\t}\n}", "docstring": "// [BC] Added\n// [RH] Fixed", "url": "https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/playsim/p_things.cpp#L117-L138", "sha": "bbaaa9a49db3e22e5c31787faaf790b46b8c87c4"}365{"repo_name": "VkDoom", "dataset": "github_2023", "owner": "dpjudas", "lang": "cpp", "func_name": "FPolyObj::CheckMobjBlocking", "code": "bool FPolyObj::CheckMobjBlocking (side_t *sd)\n{\n\tstatic TArray<AActor *> checker;\n\tFBlockNode *block;\n\tAActor *mobj;\n\tint i, j, k;\n\tint left, right, top, bottom;\n\tline_t *ld;\n\tbool blocked;\n\tbool performBlockingThrust;\n\tint bmapwidth = Level->blockmap.bmapwidth;\n\tint bmapheight = Level->blockmap.bmapheight;\n\n\tld = sd->linedef;\n\n\ttop = Level->blockmap.GetBlockY(ld->bbox[BOXTOP]);\n\tbottom = Level->blockmap.GetBlockY(ld->bbox[BOXBOTTOM]);\n\tleft = Level->blockmap.GetBlockX(ld->bbox[BOXLEFT]);\n\tright = Level->blockmap.GetBlockX(ld->bbox[BOXRIGHT]);\n\n\tblocked = false;\n\tchecker.Clear();\n\n\tbottom = bottom < 0 ? 0 : bottom;\n\tbottom = bottom >= bmapheight ? bmapheight-1 : bottom;\n\ttop = top < 0 ? 0 : top;\n\ttop = top >= bmapheight  ? bmapheight-1 : top;\n\tleft = left < 0 ? 0 : left;\n\tleft = left >= bmapwidth ? bmapwidth-1 : left;\n\tright = right < 0 ? 0 : right;\n\tright = right >= bmapwidth ?  bmapwidth-1 : right;\n\n\tfor (j = bottom*bmapwidth; j <= top*bmapwidth; j += bmapwidth)\n\t{\n\t\tfor (i = left; i <= right; i++)\n\t\t{\n\t\t\tfor (block = Level->blockmap.blocklinks[j+i]; block != nullptr; block = block->NextActor)\n\t\t\t{\n\t\t\t\tmobj = block->Me;\n\t\t\t\tfor (k = (int)checker.Size()-1; k >= 0; --k)\n\t\t\t\t{\n\t\t\t\t\tif (checker[k] == mobj)\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (k < 0)\n\t\t\t\t{\n\t\t\t\t\tchecker.Push (mobj);\n\t\t\t\t\tif ((mobj->flags&MF_SOLID) && !(mobj->flags&MF_NOCLIP))\n\t\t\t\t\t{\n\t\t\t\t\t\tFLineOpening open;\n\t\t\t\t\t\topen.top = LINEOPEN_MAX;\n\t\t\t\t\t\topen.bottom = LINEOPEN_MIN;\n\t\t\t\t\t\t// [TN] Check wether this actor gets blocked by the line.\n\t\t\t\t\t\tif (ld->backsector != nullptr && !P_IsBlockedByLine(mobj, ld) \n\t\t\t\t\t\t\t&& (!(ld->flags & ML_3DMIDTEX) ||\n\t\t\t\t\t\t\t\t(!P_LineOpening_3dMidtex(mobj, ld, open) &&\n\t\t\t\t\t\t\t\t\t(mobj->Top() < open.top)\n\t\t\t\t\t\t\t\t) || (open.abovemidtex && mobj->Z() > mobj->floorz))\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// [BL] We can't just continue here since we must\n\t\t\t\t\t\t\t// determine if the line's backsector is going to\n\t\t\t\t\t\t\t// be blocked.\n\t\t\t\t\t\t\tperformBlockingThrust = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tperformBlockingThrust = true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tDVector2 pos = mobj->PosRelative(ld).XY();\n\t\t\t\t\t\tFBoundingBox box(pos.X, pos.Y, mobj->radius);\n\n\t\t\t\t\t\tif (!inRange(box, ld) || BoxOnLineSide(box, ld) != -1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (ld->isLinePortal())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// Fixme: this still needs to figure out if the polyobject move made the player cross the portal line.\n\t\t\t\t\t\t\tif (P_TryMove(mobj, mobj->Pos().XY(), false))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// We have a two-sided linedef so we should only check one side\n\t\t\t\t\t\t// so that the thrust from both sides doesn't cancel each other out.\n\t\t\t\t\t\t// Best use the one facing the player and ignore the back side.\n\t\t\t\t\t\tif (ld->sidedef[1] != nullptr)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tint side = P_PointOnLineSidePrecise(mobj->Pos(), ld);\n\t\t\t\t\t\t\tif (ld->sidedef[side] != sd)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// [BL] See if we hit below the floor/ceiling of the poly.\n\t\t\t\t\t\t\telse if(!performBlockingThrust && (\n\t\t\t\t\t\t\t\t\tmobj->Z() < ld->sidedef[!side]->sector->GetSecPlane(sector_t::floor).ZatPoint(mobj) ||\n\t\t\t\t\t\t\t\t\tmobj->Top() > ld->sidedef[!side]->sector->GetSecPlane(sector_t::ceiling).ZatPoint(mobj)\n\t\t\t\t\t\t\t\t))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tperformBlockingThrust = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(performBlockingThrust)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tThrustMobj (mobj, sd);\n\t\t\t\t\t\t\tblocked = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn blocked;\n}", "docstring": "//==========================================================================\n//\n// CheckMobjBlocking\n//\n//==========================================================================", "url": "https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/playsim/po_man.cpp#L1028-L1149", "sha": "bbaaa9a49db3e22e5c31787faaf790b46b8c87c4"}366{"repo_name": "VkDoom", "dataset": "github_2023", "owner": "dpjudas", "lang": "cpp", "func_name": "HWDrawInfo::AddLines", "code": "void HWDrawInfo::AddLines(subsector_t * sub, sector_t * sector, FRenderState& state)\n{\n\tcurrentsector = sector;\n\tcurrentsubsector = sub;\n\n\tClipWall.Clock();\n\tif (sub->polys != nullptr)\n\t{\n\t\tAddPolyobjs(sub, state);\n\t}\n\telse\n\t{\n\t\tint count = sub->numlines;\n\t\tseg_t * seg = sub->firstline;\n\n\t\twhile (count--)\n\t\t{\n\t\t\tif (seg->linedef == nullptr)\n\t\t\t{\n\t\t\t\tif (!(sub->flags & SSECMF_DRAWN)) AddLine (seg, mClipPortal != nullptr, state);\n\t\t\t}\n\t\t\telse if (!(seg->sidedef->Flags & WALLF_POLYOBJ)) \n\t\t\t{\n\t\t\t\tAddLine (seg, mClipPortal != nullptr, state);\n\t\t\t}\n\t\t\tseg++;\n\t\t}\n\t}\n\tClipWall.Unclock();\n}", "docstring": "//==========================================================================\n//\n//\n//\n//==========================================================================", "url": "https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/rendering/hwrenderer/scene/hw_bsp.cpp#L517-L546", "sha": "bbaaa9a49db3e22e5c31787faaf790b46b8c87c4"}367{"repo_name": "VkDoom", "dataset": "github_2023", "owner": "dpjudas", "lang": "cpp", "func_name": "isLinePortal", "code": "static int isLinePortal(line_t *self)\n {\n\t return self->isLinePortal();\n }", "docstring": "//===========================================================================\n//\n//  line_t exports\n//\n//===========================================================================", "url": "https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/scripting/vmthunks.cpp#L1215-L1218", "sha": "bbaaa9a49db3e22e5c31787faaf790b46b8c87c4"}368{"repo_name": "VkDoom", "dataset": "github_2023", "owner": "dpjudas", "lang": "cpp", "func_name": "ParseActor", "code": "static void ParseActor(FScanner &sc, PNamespace *ns)\n{\n\tPClassActor *info = NULL;\n\tBaggage bag;\n\n\tbag.Namespace = ns;\n\tbag.Version = { 2, 0, 0 };\t\n\tbag.fromDecorate = true;\n\tbag.ScriptPosition = sc;\n\tinfo = ParseActorHeader(sc, &bag);\n\tsc.MustGetToken('{');\n\twhile (sc.MustGetAnyToken(), sc.TokenType != '}')\n\t{\n\t\tswitch (sc.TokenType)\n\t\t{\n\t\tcase TK_Const:\n\t\t\tParseConstant (sc, &info->VMType->Symbols, info, ns);\n\t\t\tbreak;\n\n\t\tcase TK_Enum:\n\t\t\tParseEnum (sc, &info->VMType->Symbols, info, ns);\n\t\t\tbreak;\n\n\t\tcase TK_Var:\n\t\t\tParseUserVariable (sc, &info->VMType->Symbols, info, ns);\n\t\t\tbreak;\n\n\t\tcase TK_Identifier:\n\t\t\tParseActorProperty(sc, bag);\n\t\t\tbreak;\n\n\t\tcase TK_States:\n\t\t\tParseStates(sc, bag.Info, (AActor *)bag.Info->Defaults, bag);\n\t\t\tbag.StateSet = true;\n\t\t\tbreak;\n\n\t\tcase '+':\n\t\tcase '-':\n\t\t\tParseActorFlag(sc, bag, sc.TokenType);\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tsc.ScriptError(\"Unexpected '%s' in definition of '%s'\", sc.String, bag.Info->TypeName.GetChars());\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (bag.DropItemSet)\n\t{\n\t\tbag.Info->SetDropItems(bag.DropItemList);\n\t}\n\ttry\n\t{\n\t\tFinalizeClass(info, bag.statedef);\n\t}\n\tcatch (CRecoverableError &err)\n\t{\n\t\tsc.ScriptError(\"%s\", err.GetMessage());\n\t}\n\tsc.SetCMode (false);\n}", "docstring": "//==========================================================================\n//\n// Reads an actor definition\n//\n//==========================================================================", "url": "https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/scripting/decorate/thingdef_parse.cpp#L1153-L1212", "sha": "bbaaa9a49db3e22e5c31787faaf790b46b8c87c4"}369{"repo_name": "VkDoom", "dataset": "github_2023", "owner": "dpjudas", "lang": "cpp", "func_name": "S_PrecacheLevel", "code": "void S_PrecacheLevel(FLevelLocals* Level)\n{\n\tif (GSnd && Level == primaryLevel)\n\t{\n\t\tsoundEngine->MarkAllUnused();\n\n\t\tAActor* actor;\n\t\tauto iterator = Level->GetThinkerIterator<AActor>();\n\n\t\t// Precache all sounds known to be used by the currently spawned actors.\n\t\twhile ((actor = iterator.Next()) != nullptr)\n\t\t{\n\t\t\tIFVIRTUALPTR(actor, AActor, MarkPrecacheSounds)\n\t\t\t{\n\t\t\t\tVMValue params[1] = { actor };\n\t\t\t\tVMCall(func, params, 1, nullptr, 0);\n\t\t\t}\n\t\t}\n\t\tfor (auto snd : gameinfo.PrecachedSounds)\n\t\t{\n\t\t\tsoundEngine->MarkUsed(snd);\n\t\t}\n\t\t// Precache all extra sounds requested by this map.\n\t\tfor (auto snd : primaryLevel->info->PrecacheSounds)\n\t\t{\n\t\t\tsoundEngine->MarkUsed(snd);\n\t\t}\n\t\tsoundEngine->CacheMarkedSounds();\n\t}\n}", "docstring": "//==========================================================================\n//\n// S_PrecacheLevel\n//\n// Like R_PrecacheLevel, but for sounds.\n//\n//==========================================================================", "url": "https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/sound/s_doomsound.cpp#L328-L357", "sha": "bbaaa9a49db3e22e5c31787faaf790b46b8c87c4"}370{"repo_name": "channeld-ue-plugin", "dataset": "github_2023", "owner": "channeldorg", "lang": "cpp", "func_name": "FastDecodeTag", "code": "static uint32_t FastDecodeTag(uint16_t coded_tag) {\n  uint32_t result = coded_tag;\n  result += static_cast<int8_t>(coded_tag);\n  return result >> 1;\n}", "docstring": "// On the fast path, a (matching) 2-byte tag always needs to be decoded.", "url": "https://github.com/channeldorg/channeld-ue-plugin/blob/624a5f6c51dbb898fe29a11c6afcd3eb0aaa2408/Source/ProtobufUE/ThirdParty/include/google/protobuf/generated_message_tctable_lite.cc#L150-L154", "sha": "624a5f6c51dbb898fe29a11c6afcd3eb0aaa2408"}371{"repo_name": "ReverseKit", "dataset": "github_2023", "owner": "zer0condition", "lang": "cpp", "func_name": "ImGuiIO::AddInputCharacterUTF16", "code": "void ImGuiIO::AddInputCharacterUTF16(ImWchar16 c)\n{\n    if (c == 0 && InputQueueSurrogate == 0)\n        return;\n\n    if ((c & 0xFC00) == 0xD800) // High surrogate, must save\n    {\n        if (InputQueueSurrogate != 0)\n            InputQueueCharacters.push_back(IM_UNICODE_CODEPOINT_INVALID);\n        InputQueueSurrogate = c;\n        return;\n    }\n\n    ImWchar cp = c;\n    if (InputQueueSurrogate != 0)\n    {\n        if ((c & 0xFC00) != 0xDC00) // Invalid low surrogate\n        {\n            InputQueueCharacters.push_back(IM_UNICODE_CODEPOINT_INVALID);\n        }\n        else\n        {\n#if IM_UNICODE_CODEPOINT_MAX == 0xFFFF\n            cp = IM_UNICODE_CODEPOINT_INVALID; // Codepoint will not fit in ImWchar\n#else\n            cp = (ImWchar)(((InputQueueSurrogate - 0xD800) << 10) + (c - 0xDC00) + 0x10000);\n#endif\n        }\n\n        InputQueueSurrogate = 0;\n    }\n    InputQueueCharacters.push_back(cp);\n}", "docstring": "// UTF16 strings use surrogate pairs to encode codepoints >= 0x10000, so\n// we should save the high surrogate.", "url": "https://github.com/zer0condition/ReverseKit/blob/853adbea5c13dba18cca535c28650821570ea55c/ReverseKit/ImGui/imgui.cpp#L1155-L1187", "sha": "853adbea5c13dba18cca535c28650821570ea55c"}372{"repo_name": "lidar-slam-detection", "dataset": "github_2023", "owner": "w111liang222", "lang": "cpp", "func_name": "BowVector::saveM", "code": "void BowVector::saveM(const std::string &filename, size_t W) const\n{\n  std::fstream f(filename.c_str(), std::ios::out);\n  \n  WordId last = 0;\n  BowVector::const_iterator bit;\n  for(bit = this->begin(); bit != this->end(); ++bit)\n  {\n    for(; last < bit->first; ++last)\n    {\n      f << \"0 \";\n    }\n    f << bit->second << \" \";\n    \n    last = bit->first + 1;\n  }\n  for(; last < (WordId)W; ++last)\n    f << \"0 \";\n  \n  f.close();\n}", "docstring": "// --------------------------------------------------------------------------", "url": "https://github.com/w111liang222/lidar-slam-detection/blob/d57a923b3972d0a0bfdfc0016c32de53c26b9f9f/slam/common/DBoW2/DBoW2/BowVector.cpp#L105-L125", "sha": "d57a923b3972d0a0bfdfc0016c32de53c26b9f9f"}373{"repo_name": "cs2-sdk", "dataset": "github_2023", "owner": "bruhmoment21", "lang": "cpp", "func_name": "ImGuiIO::AddInputCharacterUTF16", "code": "void ImGuiIO::AddInputCharacterUTF16(ImWchar16 c)\n{\n    if ((c == 0 && InputQueueSurrogate == 0) || !AppAcceptingEvents)\n        return;\n\n    if ((c & 0xFC00) == 0xD800) // High surrogate, must save\n    {\n        if (InputQueueSurrogate != 0)\n            AddInputCharacter(IM_UNICODE_CODEPOINT_INVALID);\n        InputQueueSurrogate = c;\n        return;\n    }\n\n    ImWchar cp = c;\n    if (InputQueueSurrogate != 0)\n    {\n        if ((c & 0xFC00) != 0xDC00) // Invalid low surrogate\n        {\n            AddInputCharacter(IM_UNICODE_CODEPOINT_INVALID);\n        }\n        else\n        {\n#if IM_UNICODE_CODEPOINT_MAX == 0xFFFF\n            cp = IM_UNICODE_CODEPOINT_INVALID; // Codepoint will not fit in ImWchar\n#else\n            cp = (ImWchar)(((InputQueueSurrogate - 0xD800) << 10) + (c - 0xDC00) + 0x10000);\n#endif\n        }\n\n        InputQueueSurrogate = 0;\n    }\n    AddInputCharacter((unsigned)cp);\n}", "docstring": "// UTF16 strings use surrogate pairs to encode codepoints >= 0x10000, so\n// we should save the high surrogate.", "url": "https://github.com/bruhmoment21/cs2-sdk/blob/3fdb26b0eba5a7335f011c68bb5c7ef5a3171144/cs2-sdk/libs/imgui/imgui.cpp#L1346-L1378", "sha": "3fdb26b0eba5a7335f011c68bb5c7ef5a3171144"}374{"repo_name": "cs2-sdk", "dataset": "github_2023", "owner": "bruhmoment21", "lang": "cpp", "func_name": "ImGui::OpenPopupEx", "code": "void ImGui::OpenPopupEx(ImGuiID id, ImGuiPopupFlags popup_flags)\n{\n    ImGuiContext& g = *GImGui;\n    ImGuiWindow* parent_window = g.CurrentWindow;\n    const int current_stack_size = g.BeginPopupStack.Size;\n\n    if (popup_flags & ImGuiPopupFlags_NoOpenOverExistingPopup)\n        if (IsPopupOpen((ImGuiID)0, ImGuiPopupFlags_AnyPopupId))\n            return;\n\n    ImGuiPopupData popup_ref; // Tagged as new ref as Window will be set back to NULL if we write this into OpenPopupStack.\n    popup_ref.PopupId = id;\n    popup_ref.Window = NULL;\n    popup_ref.BackupNavWindow = g.NavWindow;            // When popup closes focus may be restored to NavWindow (depend on window type).\n    popup_ref.OpenFrameCount = g.FrameCount;\n    popup_ref.OpenParentId = parent_window->IDStack.back();\n    popup_ref.OpenPopupPos = NavCalcPreferredRefPos();\n    popup_ref.OpenMousePos = IsMousePosValid(&g.IO.MousePos) ? g.IO.MousePos : popup_ref.OpenPopupPos;\n\n    IMGUI_DEBUG_LOG_POPUP(\"[popup] OpenPopupEx(0x%08X)\\n\", id);\n    if (g.OpenPopupStack.Size < current_stack_size + 1)\n    {\n        g.OpenPopupStack.push_back(popup_ref);\n    }\n    else\n    {\n        // Gently handle the user mistakenly calling OpenPopup() every frame. It is a programming mistake! However, if we were to run the regular code path, the ui\n        // would become completely unusable because the popup will always be in hidden-while-calculating-size state _while_ claiming focus. Which would be a very confusing\n        // situation for the programmer. Instead, we silently allow the popup to proceed, it will keep reappearing and the programming error will be more obvious to understand.\n        if (g.OpenPopupStack[current_stack_size].PopupId == id && g.OpenPopupStack[current_stack_size].OpenFrameCount == g.FrameCount - 1)\n        {\n            g.OpenPopupStack[current_stack_size].OpenFrameCount = popup_ref.OpenFrameCount;\n        }\n        else\n        {\n            // Close child popups if any, then flag popup for open/reopen\n            ClosePopupToLevel(current_stack_size, false);\n            g.OpenPopupStack.push_back(popup_ref);\n        }\n\n        // When reopening a popup we first refocus its parent, otherwise if its parent is itself a popup it would get closed by ClosePopupsOverWindow().\n        // This is equivalent to what ClosePopupToLevel() does.\n        //if (g.OpenPopupStack[current_stack_size].PopupId == id)\n        //    FocusWindow(parent_window);\n    }\n}", "docstring": "// Mark popup as open (toggle toward open state).\n// Popups are closed when user click outside, or activate a pressable item, or CloseCurrentPopup() is called within a BeginPopup()/EndPopup() block.\n// Popup identifiers are relative to the current ID-stack (so OpenPopup and BeginPopup needs to be at the same level).\n// One open popup per level of the popup hierarchy (NB: when assigning we reset the Window member of ImGuiPopupRef to NULL)", "url": "https://github.com/bruhmoment21/cs2-sdk/blob/3fdb26b0eba5a7335f011c68bb5c7ef5a3171144/cs2-sdk/libs/imgui/imgui.cpp#L10544-L10589", "sha": "3fdb26b0eba5a7335f011c68bb5c7ef5a3171144"}375{"repo_name": "DS", "dataset": "github_2023", "owner": "beixiaocai", "lang": "cpp", "func_name": "Document::isRowHidden", "code": "bool Document::isRowHidden(int row)\n{\n\tif (Worksheet *sheet = currentWorksheet())\n\t   return sheet->isRowHidden(row);\n\t return false;\n}", "docstring": "/*!\n Returns true if \\a row is hidden.\n*/", "url": "https://github.com/beixiaocai/DS/blob/25458ea1f0dbabade10969d462f3770f4b3a08a9/3rdparty/QXlsx/source/xlsxdocument.cpp#L941-L946", "sha": "25458ea1f0dbabade10969d462f3770f4b3a08a9"}376{"repo_name": "DS", "dataset": "github_2023", "owner": "beixiaocai", "lang": "cpp", "func_name": "Worksheet::saveToXmlFile", "code": "void Worksheet::saveToXmlFile(QIODevice *device) const\n{\n\tQ_D(const Worksheet);\n\td->relationships->clear();\n\n\tQXmlStreamWriter writer(device);\n\n\twriter.writeStartDocument(QStringLiteral(\"1.0\"), true);\n\twriter.writeStartElement(QStringLiteral(\"worksheet\"));\n\twriter.writeAttribute(QStringLiteral(\"xmlns\"), QStringLiteral(\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\"));\n\twriter.writeAttribute(QStringLiteral(\"xmlns:r\"), QStringLiteral(\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\"));\n\n\t//for Excel 2010\n\t//    writer.writeAttribute(\"xmlns:mc\", \"http://schemas.openxmlformats.org/markup-compatibility/2006\");\n\t//    writer.writeAttribute(\"xmlns:x14ac\", \"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac\");\n\t//    writer.writeAttribute(\"mc:Ignorable\", \"x14ac\");\n\n\twriter.writeStartElement(QStringLiteral(\"dimension\"));\n\twriter.writeAttribute(QStringLiteral(\"ref\"), d->generateDimensionString());\n\twriter.writeEndElement();//dimension\n\n\twriter.writeStartElement(QStringLiteral(\"sheetViews\"));\n\twriter.writeStartElement(QStringLiteral(\"sheetView\"));\n\tif (d->windowProtection)\n\t\twriter.writeAttribute(QStringLiteral(\"windowProtection\"), QStringLiteral(\"1\"));\n\tif (d->showFormulas)\n\t\twriter.writeAttribute(QStringLiteral(\"showFormulas\"), QStringLiteral(\"1\"));\n\tif (!d->showGridLines)\n\t\twriter.writeAttribute(QStringLiteral(\"showGridLines\"), QStringLiteral(\"0\"));\n\tif (!d->showRowColHeaders)\n\t\twriter.writeAttribute(QStringLiteral(\"showRowColHeaders\"), QStringLiteral(\"0\"));\n\tif (!d->showZeros)\n\t\twriter.writeAttribute(QStringLiteral(\"showZeros\"), QStringLiteral(\"0\"));\n\tif (d->rightToLeft)\n\t\twriter.writeAttribute(QStringLiteral(\"rightToLeft\"), QStringLiteral(\"1\"));\n\tif (d->tabSelected)\n\t\twriter.writeAttribute(QStringLiteral(\"tabSelected\"), QStringLiteral(\"1\"));\n\tif (!d->showRuler)\n\t\twriter.writeAttribute(QStringLiteral(\"showRuler\"), QStringLiteral(\"0\"));\n\tif (!d->showOutlineSymbols)\n\t\twriter.writeAttribute(QStringLiteral(\"showOutlineSymbols\"), QStringLiteral(\"0\"));\n\tif (!d->showWhiteSpace)\n\t\twriter.writeAttribute(QStringLiteral(\"showWhiteSpace\"), QStringLiteral(\"0\"));\n\twriter.writeAttribute(QStringLiteral(\"workbookViewId\"), QStringLiteral(\"0\"));\n\twriter.writeEndElement();//sheetView\n\twriter.writeEndElement();//sheetViews\n\n\twriter.writeStartElement(QStringLiteral(\"sheetFormatPr\"));\n\twriter.writeAttribute(QStringLiteral(\"defaultRowHeight\"), QString::number(d->default_row_height));\n\tif (d->default_row_height != 15)\n\t\twriter.writeAttribute(QStringLiteral(\"customHeight\"), QStringLiteral(\"1\"));\n\tif (d->default_row_zeroed)\n\t\twriter.writeAttribute(QStringLiteral(\"zeroHeight\"), QStringLiteral(\"1\"));\n\tif (d->outline_row_level)\n\t\twriter.writeAttribute(QStringLiteral(\"outlineLevelRow\"), QString::number(d->outline_row_level));\n\tif (d->outline_col_level)\n\t\twriter.writeAttribute(QStringLiteral(\"outlineLevelCol\"), QString::number(d->outline_col_level));\n\t//for Excel 2010\n\t//    writer.writeAttribute(\"x14ac:dyDescent\", \"0.25\");\n\twriter.writeEndElement();//sheetFormatPr\n\n    if (!d->colsInfo.isEmpty())\n    {\n\t\twriter.writeStartElement(QStringLiteral(\"cols\"));\n\t\tQMapIterator<int, QSharedPointer<XlsxColumnInfo> > it(d->colsInfo);\n        while (it.hasNext())\n        {\n\t\t\tit.next();\n\t\t\tQSharedPointer<XlsxColumnInfo> col_info = it.value();\n\t\t\twriter.writeStartElement(QStringLiteral(\"col\"));\n\t\t\twriter.writeAttribute(QStringLiteral(\"min\"), QString::number(col_info->firstColumn));\n\t\t\twriter.writeAttribute(QStringLiteral(\"max\"), QString::number(col_info->lastColumn));\n\t\t\tif (col_info->width)\n\t\t\t\twriter.writeAttribute(QStringLiteral(\"width\"), QString::number(col_info->width, 'g', 15));\n\t\t\tif (!col_info->format.isEmpty())\n\t\t\t\twriter.writeAttribute(QStringLiteral(\"style\"), QString::number(col_info->format.xfIndex()));\n\t\t\tif (col_info->hidden)\n\t\t\t\twriter.writeAttribute(QStringLiteral(\"hidden\"), QStringLiteral(\"1\"));\n\t\t\tif (col_info->width)\n\t\t\t\twriter.writeAttribute(QStringLiteral(\"customWidth\"), QStringLiteral(\"1\"));\n\t\t\tif (col_info->outlineLevel)\n\t\t\t\twriter.writeAttribute(QStringLiteral(\"outlineLevel\"), QString::number(col_info->outlineLevel));\n\t\t\tif (col_info->collapsed)\n\t\t\t\twriter.writeAttribute(QStringLiteral(\"collapsed\"), QStringLiteral(\"1\"));\n\t\t\twriter.writeEndElement();//col\n\t\t}\n\t\twriter.writeEndElement();//cols\n\t}\n\n\twriter.writeStartElement(QStringLiteral(\"sheetData\"));\n\tif (d->dimension.isValid())\n\t\td->saveXmlSheetData(writer);\n\twriter.writeEndElement();//sheetData\n\n\td->saveXmlMergeCells(writer);\n    for (const ConditionalFormatting &cf : d->conditionalFormattingList)\n\t\tcf.saveToXml(writer);\n\td->saveXmlDataValidations(writer);\n\n    //{{ liufeijin :  write  pagesettings  add by liufeijin 20181028\n\n    // fixed by j2doll [dev18]\n    // NOTE: empty element is not problem. but, empty structure of element is not parsed by Excel.\n\n    // pageMargins\n    if ( false == d->PMleft.isEmpty() &&\n         false == d->PMright.isEmpty() &&\n         false == d->PMtop.isEmpty() &&\n         false == d->PMbotton.isEmpty() &&\n         false == d->PMheader.isEmpty() &&\n         false == d->PMfooter.isEmpty()\n         )\n    {\n        writer.writeStartElement(QStringLiteral(\"pageMargins\"));\n\n        writer.writeAttribute(QStringLiteral(\"left\"),   d->PMleft );\n        writer.writeAttribute(QStringLiteral(\"right\"),  d->PMright );\n        writer.writeAttribute(QStringLiteral(\"top\"),    d->PMtop );\n        writer.writeAttribute(QStringLiteral(\"bottom\"), d->PMbotton );\n        writer.writeAttribute(QStringLiteral(\"header\"), d->PMheader );\n        writer.writeAttribute(QStringLiteral(\"footer\"), d->PMfooter );\n\n        writer.writeEndElement(); // pageMargins\n    }\n\n    // dev57\n    if ( !d->Prid.isEmpty() )\n    {\n        writer.writeStartElement(QStringLiteral(\"pageSetup\")); // pageSetup\n\n        writer.writeAttribute(QStringLiteral(\"r:id\"), d->Prid);\n\n        if ( !d->PverticalDpi.isEmpty() )\n        {\n            writer.writeAttribute(QStringLiteral(\"verticalDpi\"), d->PverticalDpi);\n        }\n\n        if ( !d->PhorizontalDpi.isEmpty() )\n        {\n            writer.writeAttribute(QStringLiteral(\"horizontalDpi\"), d->PhorizontalDpi);\n        }\n\n        if ( !d->PuseFirstPageNumber.isEmpty() )\n        {\n            writer.writeAttribute(QStringLiteral(\"useFirstPageNumber\"), d->PuseFirstPageNumber);\n        }\n\n        if ( !d->PfirstPageNumber.isEmpty() )\n        {\n            writer.writeAttribute(QStringLiteral(\"firstPageNumber\"), d->PfirstPageNumber);\n        }\n\n        if ( !d->Pscale.isEmpty() )\n        {\n            writer.writeAttribute(QStringLiteral(\"scale\"), d->Pscale);\n        }\n\n        if ( !d->PpaperSize.isEmpty() )\n        {\n            writer.writeAttribute(QStringLiteral(\"paperSize\"), d->PpaperSize);\n        }\n\n        if ( !d->Porientation.isEmpty() )\n        {\n            writer.writeAttribute(QStringLiteral(\"orientation\"), d->Porientation);\n        }\n\n        if(!d->Pcopies.isEmpty())\n        {\n            writer.writeAttribute(QStringLiteral(\"copies\"), d->Pcopies);\n        }\n\n        writer.writeEndElement(); // pageSetup\n\n    } // if ( !d->Prid.isEmpty() )\n\n    // headerFooter\n    if( !(d->ModdHeader.isNull()) ||\n        !(d->MoodFooter.isNull()) )\n    {\n        writer.writeStartElement(QStringLiteral(\"headerFooter\")); // headerFooter\n\n        if ( !d->MoodalignWithMargins.isEmpty() )\n        {\n            writer.writeAttribute(QStringLiteral(\"alignWithMargins\"), d->MoodalignWithMargins);\n        }\n\n        if ( !d->ModdHeader.isNull() )\n        {\n            writer.writeStartElement(QStringLiteral(\"oddHeader\"));\n            writer.writeCharacters(d->ModdHeader);\n            writer.writeEndElement(); // oddHeader\n        }\n\n        if ( !d->MoodFooter.isNull() )\n        {\n            writer.writeTextElement(QStringLiteral(\"oddFooter\"), d->MoodFooter);\n        }\n\n        writer.writeEndElement(); // headerFooter\n    }\n\n\td->saveXmlHyperlinks(writer);\n\td->saveXmlDrawings(writer);\n\n    writer.writeEndElement(); // worksheet\n\twriter.writeEndDocument();\n}", "docstring": "/*!\n * \\internal\n */", "url": "https://github.com/beixiaocai/DS/blob/25458ea1f0dbabade10969d462f3770f4b3a08a9/3rdparty/QXlsx/source/xlsxworksheet.cpp#L1308-L1515", "sha": "25458ea1f0dbabade10969d462f3770f4b3a08a9"}377{"repo_name": "Calibration-Is-All-You-Need", "dataset": "github_2023", "owner": "linClubs", "lang": "cpp", "func_name": "Mutex::ThreadSafeLazyInit", "code": "void Mutex::ThreadSafeLazyInit() {\n  // Dynamic mutexes are initialized in the constructor.\n  if (type_ == kStatic) {\n    switch (\n        ::InterlockedCompareExchange(&critical_section_init_phase_, 1L, 0L)) {\n      case 0:\n        // If critical_section_init_phase_ was 0 before the exchange, we\n        // are the first to test it and need to perform the initialization.\n        owner_thread_id_ = 0;\n        critical_section_ = new CRITICAL_SECTION;\n        ::InitializeCriticalSection(critical_section_);\n        // Updates the critical_section_init_phase_ to 2 to signal\n        // initialization complete.\n        GTEST_CHECK_(::InterlockedCompareExchange(\n                          &critical_section_init_phase_, 2L, 1L) ==\n                      1L);\n        break;\n      case 1:\n        // Somebody else is already initializing the mutex; spin until they\n        // are done.\n        while (::InterlockedCompareExchange(&critical_section_init_phase_,\n                                            2L,\n                                            2L) != 2L) {\n          // Possibly yields the rest of the thread's time slice to other\n          // threads.\n          ::Sleep(0);\n        }\n        break;\n\n      case 2:\n        break;  // The mutex is already initialized and ready for use.\n\n      default:\n        GTEST_CHECK_(false)\n            << \"Unexpected value of critical_section_init_phase_ \"\n            << \"while initializing a static mutex.\";\n    }\n  }\n}", "docstring": "// Initializes owner_thread_id_ and critical_section_ in static mutexes.", "url": "https://github.com/linClubs/Calibration-Is-All-You-Need/blob/efdad7d51644258a63ab831171576d5330024e40/Thirdparty/ceres-solver-1.14.0/internal/ceres/gmock_gtest_all.cc#L8832-L8870", "sha": "efdad7d51644258a63ab831171576d5330024e40"}378{"repo_name": "Calibration-Is-All-You-Need", "dataset": "github_2023", "owner": "linClubs", "lang": "cpp", "func_name": "ValidateRegex", "code": "bool ValidateRegex(const char* regex) {\n  if (regex == NULL) {\n    // TODO(wan@google.com): fix the source file location in the\n    // assertion failures to match where the regex is used in user\n    // code.\n    ADD_FAILURE() << \"NULL is not a valid simple regular expression.\";\n    return false;\n  }\n\n  bool is_valid = true;\n\n  // True iff ?, *, or + can follow the previous atom.\n  bool prev_repeatable = false;\n  for (int i = 0; regex[i]; i++) {\n    if (regex[i] == '\\\\') {  // An escape sequence\n      i++;\n      if (regex[i] == '\\0') {\n        ADD_FAILURE() << FormatRegexSyntaxError(regex, i - 1)\n                      << \"'\\\\' cannot appear at the end.\";\n        return false;\n      }\n\n      if (!IsValidEscape(regex[i])) {\n        ADD_FAILURE() << FormatRegexSyntaxError(regex, i - 1)\n                      << \"invalid escape sequence \\\"\\\\\" << regex[i] << \"\\\".\";\n        is_valid = false;\n      }\n      prev_repeatable = true;\n    } else {  // Not an escape sequence.\n      const char ch = regex[i];\n\n      if (ch == '^' && i > 0) {\n        ADD_FAILURE() << FormatRegexSyntaxError(regex, i)\n                      << \"'^' can only appear at the beginning.\";\n        is_valid = false;\n      } else if (ch == '$' && regex[i + 1] != '\\0') {\n        ADD_FAILURE() << FormatRegexSyntaxError(regex, i)\n                      << \"'$' can only appear at the end.\";\n        is_valid = false;\n      } else if (IsInSet(ch, \"()[]{}|\")) {\n        ADD_FAILURE() << FormatRegexSyntaxError(regex, i)\n                      << \"'\" << ch << \"' is unsupported.\";\n        is_valid = false;\n      } else if (IsRepeat(ch) && !prev_repeatable) {\n        ADD_FAILURE() << FormatRegexSyntaxError(regex, i)\n                      << \"'\" << ch << \"' can only follow a repeatable token.\";\n        is_valid = false;\n      }\n\n      prev_repeatable = !IsInSet(ch, \"^$?*+\");\n    }\n  }\n\n  return is_valid;\n}", "docstring": "// Generates non-fatal failures and returns false if regex is invalid;\n// otherwise returns true.", "url": "https://github.com/linClubs/Calibration-Is-All-You-Need/blob/efdad7d51644258a63ab831171576d5330024e40/Thirdparty/ceres-solver-1.14.0/internal/ceres/gmock_gtest_all.cc#L9230-L9284", "sha": "efdad7d51644258a63ab831171576d5330024e40"}379{"repo_name": "Calibration-Is-All-You-Need", "dataset": "github_2023", "owner": "linClubs", "lang": "cpp", "func_name": "Cardinality AtLeast", "code": "GTEST_API_ Cardinality AtLeast(int n) { return Between(n, INT_MAX); }", "docstring": "// Creates a cardinality that allows at least n calls.", "url": "https://github.com/linClubs/Calibration-Is-All-You-Need/blob/efdad7d51644258a63ab831171576d5330024e40/Thirdparty/ceres-solver-1.14.0/internal/ceres/gmock_gtest_all.cc#L10582-L10582", "sha": "efdad7d51644258a63ab831171576d5330024e40"}380{"repo_name": "Calibration-Is-All-You-Need", "dataset": "github_2023", "owner": "linClubs", "lang": "cpp", "func_name": "LogIsVisible", "code": "GTEST_API_ bool LogIsVisible(LogSeverity severity) {\n  if (GMOCK_FLAG(verbose) == kInfoVerbosity) {\n    // Always show the log if --gmock_verbose=info.\n    return true;\n  } else if (GMOCK_FLAG(verbose) == kErrorVerbosity) {\n    // Always hide it if --gmock_verbose=error.\n    return false;\n  } else {\n    // If --gmock_verbose is neither \"info\" nor \"error\", we treat it\n    // as \"warning\" (its default value).\n    return severity == kWarning;\n  }\n}", "docstring": "// Returns true iff a log with the given severity is visible according\n// to the --gmock_verbose flag.", "url": "https://github.com/linClubs/Calibration-Is-All-You-Need/blob/efdad7d51644258a63ab831171576d5330024e40/Thirdparty/ceres-solver-1.14.0/internal/ceres/gmock_gtest_all.cc#L10704-L10716", "sha": "efdad7d51644258a63ab831171576d5330024e40"}381{"repo_name": "Calibration-Is-All-You-Need", "dataset": "github_2023", "owner": "linClubs", "lang": "cpp", "func_name": "TEST", "code": "TEST(Rotation, UnitQuaternionToAngleAxis) {\n  double quaternion[4] = { 1, 0, 0, 0 };\n  double axis_angle[3];\n  double expected[3] = { 0, 0, 0 };\n  QuaternionToAngleAxis(quaternion, axis_angle);\n  EXPECT_THAT(axis_angle, IsNearAngleAxis(expected));\n}", "docstring": "// Transforms a unit quaternion to an axis angle.", "url": "https://github.com/linClubs/Calibration-Is-All-You-Need/blob/efdad7d51644258a63ab831171576d5330024e40/Thirdparty/ceres-solver-1.14.0/internal/ceres/rotation_test.cc#L271-L277", "sha": "efdad7d51644258a63ab831171576d5330024e40"}382{"repo_name": "Calibration-Is-All-You-Need", "dataset": "github_2023", "owner": "linClubs", "lang": "cpp", "func_name": "UncertainBackProjection::UncertainBackProjection", "code": "UncertainBackProjection::UncertainBackProjection(\n    const sm::kinematics::UncertainVector3 & ray)\n    : ray(ray) {\n}", "docstring": "/// \\brief the view origin is set to zero", "url": "https://github.com/linClubs/Calibration-Is-All-You-Need/blob/efdad7d51644258a63ab831171576d5330024e40/kalibr/aslam_cv/aslam_cameras/src/BackProjection.cpp#L34-L37", "sha": "efdad7d51644258a63ab831171576d5330024e40"}383{"repo_name": "Calibration-Is-All-You-Need", "dataset": "github_2023", "owner": "linClubs", "lang": "cpp", "func_name": "RotationExpression::inverse", "code": "RotationExpression RotationExpression::inverse()\n    {\n      boost::shared_ptr<RotationExpressionNode> newRoot( new RotationExpressionNodeInverse(_root) );\n      return RotationExpression(newRoot);\n    }", "docstring": "/// \\brief return the expression that inverts the rotation.", "url": "https://github.com/linClubs/Calibration-Is-All-You-Need/blob/efdad7d51644258a63ab831171576d5330024e40/kalibr/aslam_optimizer/aslam_backend_expressions/src/RotationExpression.cpp#L39-L43", "sha": "efdad7d51644258a63ab831171576d5330024e40"}384{"repo_name": "AstroSharp", "dataset": "github_2023", "owner": "deepskydetail", "lang": "cpp", "func_name": "function_namespace_env", "code": "Function function_namespace_env(){\n    Environment ns = Environment::namespace_env( \"stats\" ) ;\n    Function fun = ns[\".asSparse\"] ;  // accesses a non-exported function\n    return fun;\n}", "docstring": "// [[Rcpp::export]]", "url": "https://github.com/deepskydetail/AstroSharp/blob/b632424fa2e9749d008851cf40f49b5fcec490d3/resources/app/R-Portable-Mac/library/Rcpp/unitTests/cpp/Function.cpp#L74-L78", "sha": "b632424fa2e9749d008851cf40f49b5fcec490d3"}385{"repo_name": "AstroSharp", "dataset": "github_2023", "owner": "deepskydetail", "lang": "cpp", "func_name": "runit_SubMatrix", "code": "NumericMatrix runit_SubMatrix( ){\n    NumericMatrix xx(4, 5);\n    xx(0,0) = 3;\n    xx(0,1) = 4;\n    xx(0,2) = 5;\n    xx(1,_) = xx(0,_);\n    xx(_,3) = xx(_,2);\n    SubMatrix<REALSXP> yy = xx( Range(0,2), Range(0,3) ) ;\n    NumericMatrix res = yy ;\n    return res;\n}", "docstring": "// [[Rcpp::export]]", "url": "https://github.com/deepskydetail/AstroSharp/blob/b632424fa2e9749d008851cf40f49b5fcec490d3/resources/app/R-Portable-Mac/library/Rcpp/unitTests/cpp/Matrix.cpp#L249-L259", "sha": "b632424fa2e9749d008851cf40f49b5fcec490d3"}386{"repo_name": "AstroSharp", "dataset": "github_2023", "owner": "deepskydetail", "lang": "cpp", "func_name": "list_erase", "code": "List list_erase( List list ){\n    list.erase( list.begin() ) ;\n    return list ;\n}", "docstring": "// [[Rcpp::export]]", "url": "https://github.com/deepskydetail/AstroSharp/blob/b632424fa2e9749d008851cf40f49b5fcec490d3/resources/app/R-Portable-Mac/library/Rcpp/unitTests/cpp/Vector.cpp#L408-L411", "sha": "b632424fa2e9749d008851cf40f49b5fcec490d3"}387{"repo_name": "AstroSharp", "dataset": "github_2023", "owner": "deepskydetail", "lang": "cpp", "func_name": "vec_print_character", "code": "String vec_print_character(CharacterVector v) {\n    std::ostringstream buf;\n    buf << v;\n    return buf.str();\n}", "docstring": "// [[Rcpp::export]]", "url": "https://github.com/deepskydetail/AstroSharp/blob/b632424fa2e9749d008851cf40f49b5fcec490d3/resources/app/R-Portable-Mac/library/Rcpp/unitTests/cpp/Vector.cpp#L834-L838", "sha": "b632424fa2e9749d008851cf40f49b5fcec490d3"}388{"repo_name": "AstroSharp", "dataset": "github_2023", "owner": "deepskydetail", "lang": "cpp", "func_name": "runit_dt", "code": "List runit_dt( NumericVector xx){\n    return List::create(\n        _[\"false\"] = dt( xx, 5),\n        _[\"true\"]\t = dt( xx, 5, true ));\n}", "docstring": "// [[Rcpp::export]]", "url": "https://github.com/deepskydetail/AstroSharp/blob/b632424fa2e9749d008851cf40f49b5fcec490d3/resources/app/R-Portable-Mac/library/Rcpp/unitTests/cpp/stats.cpp#L83-L87", "sha": "b632424fa2e9749d008851cf40f49b5fcec490d3"}389{"repo_name": "XPKeygen", "dataset": "github_2023", "owner": "Endermanch", "lang": "cpp", "func_name": "formatXP", "code": "void formatXP(BOOL bUpgrade, WCHAR *pBSection, WCHAR *pCSection, WCHAR *pText) {\n    WCHAR pDashedKey[PK_LENGTH + 4 + NULL_TERMINATOR]{};\n    INT   pSSection = 0;\n\n    for (int i = 0; i < wcslen(pCSection); i++)\n        pSSection -= pCSection[i] - '0';\n\n    while (pSSection < 0)\n        pSSection += 7;\n\n    CHAR  pKey[PK_LENGTH + NULL_TERMINATOR]{};\n    DWORD nChannelID = wcstoul(pBSection, nullptr, 10),\n          nSequence = wcstoul(pCSection, nullptr, 10);\n\n    BOOL  bValid = keyXP(pKey, pBINKPreset, nChannelID, nSequence, bUpgrade);\n\n    QWORD pRaw[2]{},\n          pSignature;\n\n    DWORD pChannelID,\n          pSequence,\n          pSerial,\n          pHash;\n\n    BOOL  pUpgrade;\n\n    unbase24((BYTE *)pRaw, pKey);\n    unpackXP(pRaw, pUpgrade, pChannelID, pSequence, pHash, pSignature);\n\n    pSerial = pChannelID * 1'000'000 + pSequence;\n\n    for (int i = 0; i < 5; i++)\n        wsprintfW(pDashedKey, L\"%s%s%.5S\", pDashedKey, i != 0 ? L\"-\" : L\"\", &pKey[5 * i]);\n\n    swprintf(\n        pText,\n        L\"PRODUCT ID:\\tPPPPP-%03d-%06d%d-23XXX\\r\\n\\r\\nBYTECODE:\\t%016llX %016llX\\r\\nUPGRADE:\\t%s\\r\\nSERIAL:\\t\\t0x%lX (%d)\\r\\nHASH:\\t\\t0x%lX\\r\\nSIGNATURE:\\t0x%llX\\r\\nCURVE POINT:\\t%s\\r\\n\\r\\n\\r\\n%s\\r\\n\",\n        pChannelID,\n        pSequence,\n        pSSection,\n        pRaw[1], pRaw[0],\n        pUpgrade ? L\"TRUE\" : L\"FALSE\",\n        pSerial, pSerial,\n        pHash,\n        pSignature,\n        bValid ? L\"TRUE\" : L\"FALSE\",\n        pDashedKey\n    );\n}", "docstring": "/* Formats Windows XP key output. */", "url": "https://github.com/Endermanch/XPKeygen/blob/f0df34a8222c38ffce8a02bb107106b3d85af0f9/src/key.cpp#L76-L124", "sha": "f0df34a8222c38ffce8a02bb107106b3d85af0f9"}390{"repo_name": "Maim", "dataset": "github_2023", "owner": "ArdenButterfield", "lang": "cpp", "func_name": "CMpegAudEncPropertyPageAdv::SetDirty", "code": "void CMpegAudEncPropertyPageAdv::SetDirty()\n{\n    m_bDirty = TRUE;\n    if (m_pPageSite)\n        m_pPageSite->OnStatusChange(PROPPAGESTATUS_DIRTY);\n}", "docstring": "//\n// SetDirty\n//\n// notifies the property page site of changes", "url": "https://github.com/ArdenButterfield/Maim/blob/7f2e5f87f3e3bd7b06916343f336d94fee5f9b85/lib/lame/dshow/PropPage_adv.cpp#L361-L366", "sha": "7f2e5f87f3e3bd7b06916343f336d94fee5f9b85"}391{"repo_name": "picoTracker", "dataset": "github_2023", "owner": "xiphonics", "lang": "cpp", "func_name": "isBusyFifoRead", "code": "static bool isBusyFifoRead() {\n  return !(SDHC_PRSSTAT & SDHC_PRSSTAT_BREN);\n}", "docstring": "//------------------------------------------------------------------------------", "url": "https://github.com/xiphonics/picoTracker/blob/fa317182a9fe6642b20184a850a4ae0061263a3f/sources/Externals/SdFat/src/SdCard/SdioTeensy.cpp#L490-L492", "sha": "fa317182a9fe6642b20184a850a4ae0061263a3f"}392{"repo_name": "ark", "dataset": "github_2023", "owner": "microsoft", "lang": "cpp", "func_name": "abs", "code": "ark::bfloat16_t abs(ark::bfloat16_t const& h) { return ark::abs(h); }", "docstring": "///////////////////////////////////////////////////////////////////////////////////////////////////\n//\n// Standard Library operations and definitions\n//\n///////////////////////////////////////////////////////////////////////////////////////////////////", "url": "https://github.com/microsoft/ark/blob/d8bbaebd552f47f01b7f0b1ecde3512142435833/ark/bfloat16.cpp#L133-L133", "sha": "d8bbaebd552f47f01b7f0b1ecde3512142435833"}393{"repo_name": "DIY-Sim-Racing-Active-Pedal", "dataset": "github_2023", "owner": "tjfenwick", "lang": "cpp", "func_name": "FastAccelStepperEngine::setDebugLed", "code": "void FastAccelStepperEngine::setDebugLed(uint8_t ledPin) {\n  fas_ledPin = ledPin;\n  pinMode(fas_ledPin, OUTPUT);\n  digitalWrite(fas_ledPin, LOW);\n}", "docstring": "//*************************************************************************************************", "url": "https://github.com/tjfenwick/DIY-Sim-Racing-Active-Pedal/blob/b6dcceeb2a92c99b51f9b90c2f4379765486d204/Arduino/Library/FastAccelStepper/src/FastAccelStepper.cpp#L92-L96", "sha": "b6dcceeb2a92c99b51f9b90c2f4379765486d204"}394{"repo_name": "oss-arch-gym", "dataset": "github_2023", "owner": "srivatsankrishnan", "lang": "cpp", "func_name": "ScopedFakeTestPartResultReporter::~ScopedFakeTestPartResultReporter", "code": "ScopedFakeTestPartResultReporter::~ScopedFakeTestPartResultReporter() {\n  internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();\n  if (intercept_mode_ == INTERCEPT_ALL_THREADS) {\n    impl->SetGlobalTestPartResultReporter(old_reporter_);\n  } else {\n    impl->SetTestPartResultReporterForCurrentThread(old_reporter_);\n  }\n}", "docstring": "// The d'tor restores the test part result reporter used by Google Test\n// before.", "url": "https://github.com/srivatsankrishnan/oss-arch-gym/blob/fab6d1442541b5cdf40daf24e64e63261da2d846/sims/AstraSim/protobuf-3.12.4/third_party/googletest/googletest/fused-src/gtest/gtest-all.cc#L2096-L2103", "sha": "fab6d1442541b5cdf40daf24e64e63261da2d846"}395{"repo_name": "oss-arch-gym", "dataset": "github_2023", "owner": "srivatsankrishnan", "lang": "cpp", "func_name": "TestEventListeners::SetDefaultResultPrinter", "code": "void TestEventListeners::SetDefaultResultPrinter(TestEventListener* listener) {\n  if (default_result_printer_ != listener) {\n    // It is an error to pass this method a listener that is already in the\n    // list.\n    delete Release(default_result_printer_);\n    default_result_printer_ = listener;\n    if (listener != nullptr) Append(listener);\n  }\n}", "docstring": "// Sets the default_result_printer attribute to the provided listener.\n// The listener is also added to the listener list and previous\n// default_result_printer is removed from it and deleted. The listener can\n// also be NULL in which case it will not be added to the list. Does\n// nothing if the previous and the current listener objects are the same.", "url": "https://github.com/srivatsankrishnan/oss-arch-gym/blob/fab6d1442541b5cdf40daf24e64e63261da2d846/sims/AstraSim/protobuf-3.12.4/third_party/googletest/googletest/fused-src/gtest/gtest-all.cc#L5970-L5978", "sha": "fab6d1442541b5cdf40daf24e64e63261da2d846"}396{"repo_name": "oss-arch-gym", "dataset": "github_2023", "owner": "srivatsankrishnan", "lang": "cpp", "func_name": "CaptureStderr", "code": "void CaptureStderr() {\n  CaptureStream(kStdErrFileno, \"stderr\", &g_captured_stderr);\n}", "docstring": "// Starts capturing stderr.", "url": "https://github.com/srivatsankrishnan/oss-arch-gym/blob/fab6d1442541b5cdf40daf24e64e63261da2d846/sims/AstraSim/protobuf-3.12.4/third_party/googletest/googletest/fused-src/gtest/gtest-all.cc#L10800-L10802", "sha": "fab6d1442541b5cdf40daf24e64e63261da2d846"}397{"repo_name": "oss-arch-gym", "dataset": "github_2023", "owner": "srivatsankrishnan", "lang": "cpp", "func_name": "TEST_F", "code": "TEST_F(ASSERT_PRED_FORMAT4Test, FunctionOnUserTypeSuccess) {\n  ASSERT_PRED_FORMAT4(PredFormatFunction4,\n                      Bool(++n1_),\n                      Bool(++n2_),\n                      Bool(++n3_),\n                      Bool(++n4_));\n  finished_ = true;\n}", "docstring": "// Tests a successful ASSERT_PRED_FORMAT4 where the\n// predicate-formatter is a function on a user-defined type (Bool).", "url": "https://github.com/srivatsankrishnan/oss-arch-gym/blob/fab6d1442541b5cdf40daf24e64e63261da2d846/sims/AstraSim/protobuf-3.12.4/third_party/googletest/googletest/test/gtest_pred_impl_unittest.cc#L1787-L1794", "sha": "fab6d1442541b5cdf40daf24e64e63261da2d846"}398{"repo_name": "heir", "dataset": "github_2023", "owner": "google", "lang": "cpp", "func_name": "getNonUnitDimension", "code": "FailureOr<std::pair<unsigned, int64_t>> getNonUnitDimension(\n    RankedTensorType tensorTy) {\n  auto shape = tensorTy.getShape();\n\n  if (llvm::count_if(shape, [](auto dim) { return dim != 1; }) != 1) {\n    return failure();\n  }\n\n  unsigned nonUnitIndex = std::distance(\n      shape.begin(), llvm::find_if(shape, [&](auto dim) { return dim != 1; }));\n\n  return std::make_pair(nonUnitIndex, shape[nonUnitIndex]);\n}", "docstring": "// Returns the unique non-unit dimension of a tensor and its rank.\n// Returns failure if the tensor has more than one non-unit dimension.", "url": "https://github.com/google/heir/blob/fae5e9552a2d177da41381101d4a6c0f426eb2ee/lib/Transforms/SecretInsertMgmt/SecretInsertMgmtCKKS.cpp#L45-L57", "sha": "fae5e9552a2d177da41381101d4a6c0f426eb2ee"}399{"repo_name": "oxware", "dataset": "github_2023", "owner": "oxiKKK", "lang": "cpp", "func_name": "DetourUpdateProcessWithDll", "code": "BOOL WINAPI DetourUpdateProcessWithDll(_In_ HANDLE hProcess,\n                                       _In_reads_(nDlls) LPCSTR *rlpDlls,\n                                       _In_ DWORD nDlls)\n{\n    // Find the next memory region that contains a mapped PE image.\n    //\n    BOOL bHas64BitDll = FALSE;\n    BOOL bHas32BitExe = FALSE;\n    BOOL bIs32BitProcess;\n    HMODULE hModule = NULL;\n    HMODULE hLast = NULL;\n\n    DETOUR_TRACE((\"DetourUpdateProcessWithDll(%p,dlls=%d)\\n\", hProcess, nDlls));\n\n    for (;;) {\n        IMAGE_NT_HEADERS32 inh;\n\n        if ((hLast = EnumerateModulesInProcess(hProcess, hLast, &inh)) == NULL) {\n            break;\n        }\n\n        DETOUR_TRACE((\"%p  machine=%04x magic=%04x\\n\",\n                      hLast, inh.FileHeader.Machine, inh.OptionalHeader.Magic));\n\n        if ((inh.FileHeader.Characteristics & IMAGE_FILE_DLL) == 0) {\n            hModule = hLast;\n            if (inh.OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR32_MAGIC\n                && inh.FileHeader.Machine != 0) {\n\n                bHas32BitExe = TRUE;\n            }\n            DETOUR_TRACE((\"%p  Found EXE\\n\", hLast));\n        }\n        else {\n            if (inh.OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC\n                && inh.FileHeader.Machine != 0) {\n\n                bHas64BitDll = TRUE;\n            }\n        }\n    }\n\n    if (hModule == NULL) {\n        SetLastError(ERROR_INVALID_OPERATION);\n        return FALSE;\n    }\n\n    if (!bHas32BitExe) {\n        bIs32BitProcess = FALSE;\n    }\n    else if (!bHas64BitDll) {\n        bIs32BitProcess = TRUE;\n    }\n    else {\n        if (!IsWow64Process(hProcess, &bIs32BitProcess)) {\n            return FALSE;\n        }\n    }\n\n    DETOUR_TRACE((\"    32BitExe=%d 32BitProcess\\n\", bHas32BitExe, bIs32BitProcess));\n\n    return DetourUpdateProcessWithDllEx(hProcess,\n                                        hModule,\n                                        bIs32BitProcess,\n                                        rlpDlls,\n                                        nDlls);\n}", "docstring": "// DETOURS_64BIT\n//////////////////////////////////////////////////////////////////////////////\n//", "url": "https://github.com/oxiKKK/oxware/blob/eb81ecf3fe839b0ca01a19c41ae7e5381d13102d/src/external/detours/creatwth.cpp#L516-L582", "sha": "eb81ecf3fe839b0ca01a19c41ae7e5381d13102d"}400{"repo_name": "oxware", "dataset": "github_2023", "owner": "oxiKKK", "lang": "cpp", "func_name": "get_appdata_dir", "code": "static std::filesystem::path get_appdata_dir()\n{\n\tPWSTR pwstr_appdata_directory;\n\tHRESULT result = SHGetKnownFolderPath(FOLDERID_RoamingAppData, KF_FLAG_DEFAULT, NULL, &pwstr_appdata_directory);\n\tassert(SUCCEEDED(result));\n\tstd::filesystem::path ret = pwstr_appdata_directory;\n\tCoTaskMemFree(pwstr_appdata_directory);\n\treturn ret / \"oxware\";\n}", "docstring": "// just a little hack over the fact that this code already exists inside the FileSystem code.. since we\n// want to have the console ready right as soon as the application starts, we cannot just use the appdata manager\n// or the filesystem, so yeah.. this kinda sucks but whatever, its worth it so that we can log as soon as we start..", "url": "https://github.com/oxiKKK/oxware/blob/eb81ecf3fe839b0ca01a19c41ae7e5381d13102d/src/public/DeveloperConsole.cpp#L488-L496", "sha": "eb81ecf3fe839b0ca01a19c41ae7e5381d13102d"}401{"repo_name": "NetAdmin", "dataset": "github_2023", "owner": "nsnail", "lang": "csharp", "func_name": "ExampleService.BulkDeleteAsync", "code": "public async Task<int> BulkDeleteAsync(BulkReq<DelReq> req)\n    {\n        req.ThrowIfInvalid();\n        var ret = 0;\n\n        // ReSharper disable once LoopCanBeConvertedToQuery\n        foreach (var item in req.Items) {\n            ret += await DeleteAsync(item).ConfigureAwait(false);\n        }\n\n        return ret;\n    }", "docstring": "/// <inheritdoc />", "url": "https://github.com/nsnail/NetAdmin/blob/72cc3c42fded6f2d5a8cc43244746493c346d8f8/src/backend/NetAdmin/NetAdmin.Application/Services/Tpl/ExampleService.cs#L15-L26", "sha": "72cc3c42fded6f2d5a8cc43244746493c346d8f8"}402{"repo_name": "NetAdmin", "dataset": "github_2023", "owner": "nsnail", "lang": "csharp", "func_name": "IApplicationBuilderExtensions.UseEndpoints", "code": "public static IApplicationBuilder UseEndpoints(this IApplicationBuilder me)\n    {\n        return me.UseEndpoints(endpoints => {\n            _ = endpoints.MapControllers();\n            #if !DEBUG\n            _ = endpoints.MapMetrics();\n            #endif\n        });\n    }", "docstring": "/// <summary>\n///     ๆ‰ง่กŒๅŒน้…็š„็ซฏ็‚น\n/// </summary>", "url": "https://github.com/nsnail/NetAdmin/blob/72cc3c42fded6f2d5a8cc43244746493c346d8f8/src/backend/NetAdmin/NetAdmin.Host/Extensions/IApplicationBuilderExtensions.cs#L22-L30", "sha": "72cc3c42fded6f2d5a8cc43244746493c346d8f8"}403{"repo_name": "LANCommander", "dataset": "github_2023", "owner": "LANCommander", "lang": "csharp", "func_name": "RemoveDeprecatedServerHttpOptions.BuildTargetModel", "code": "protected override void BuildTargetModel(ModelBuilder modelBuilder)\n        {\n#pragma warning disable 612, 618\n            modelBuilder\n                .HasAnnotation(\"ProductVersion\", \"7.0.13\")\n                .HasAnnotation(\"Proxies:ChangeTracking\", false)\n                .HasAnnotation(\"Proxies:CheckEquality\", false)\n                .HasAnnotation(\"Proxies:LazyLoading\", true);\n\n            modelBuilder.Entity(\"CategoryGame\", b =>\n                {\n                    b.Property<Guid>(\"CategoriesId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"GamesId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"CategoriesId\", \"GamesId\");\n\n                    b.HasIndex(\"GamesId\");\n\n                    b.ToTable(\"CategoryGame\");\n                });\n\n            modelBuilder.Entity(\"GameDeveloper\", b =>\n                {\n                    b.Property<Guid>(\"DeveloperId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"DeveloperId\", \"GameId\");\n\n                    b.HasIndex(\"GameId\");\n\n                    b.ToTable(\"GameDeveloper\");\n                });\n\n            modelBuilder.Entity(\"GameGenre\", b =>\n                {\n                    b.Property<Guid>(\"GamesId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"GenresId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"GamesId\", \"GenresId\");\n\n                    b.HasIndex(\"GenresId\");\n\n                    b.ToTable(\"GameGenre\");\n                });\n\n            modelBuilder.Entity(\"GamePublisher\", b =>\n                {\n                    b.Property<Guid>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"PublisherId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"GameId\", \"PublisherId\");\n\n                    b.HasIndex(\"PublisherId\");\n\n                    b.ToTable(\"GamePublisher\");\n                });\n\n            modelBuilder.Entity(\"GameRedistributable\", b =>\n                {\n                    b.Property<Guid>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"RedistributableId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"GameId\", \"RedistributableId\");\n\n                    b.HasIndex(\"RedistributableId\");\n\n                    b.ToTable(\"GameRedistributable\");\n                });\n\n            modelBuilder.Entity(\"GameTag\", b =>\n                {\n                    b.Property<Guid>(\"GamesId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"TagsId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"GamesId\", \"TagsId\");\n\n                    b.HasIndex(\"TagsId\");\n\n                    b.ToTable(\"GameTag\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Data.Models.Action\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Arguments\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Path\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<bool>(\"PrimaryAction\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<int>(\"SortOrder\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"WorkingDirectory\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"GameId\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Actions\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Data.Models.Archive\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Changelog\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<long>(\"CompressedSize\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"LastVersionId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"ObjectKey\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"RedistributableId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<long>(\"UncompressedSize\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Version\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"GameId\");\n\n                    b.HasIndex(\"LastVersionId\");\n\n                    b.HasIndex(\"RedistributableId\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Archive\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Data.Models.Category\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"ParentId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"ParentId\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Categories\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Data.Models.Company\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Companies\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Data.Models.Game\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Description\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"DirectoryName\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<long?>(\"IGDBId\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<string>(\"Notes\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime?>(\"ReleasedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<bool>(\"Singleplayer\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<string>(\"SortTitle\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Title\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"ValidKeyRegex\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Games\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Data.Models.GameSave\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"UserId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"GameId\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.HasIndex(\"UserId\");\n\n                    b.ToTable(\"GameSaves\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Data.Models.Genre\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Genres\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Data.Models.Key\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<int>(\"AllocationMethod\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<string>(\"ClaimedByComputerName\")\n                        .HasMaxLength(255)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"ClaimedByIpv4Address\")\n                        .HasMaxLength(15)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"ClaimedByMacAddress\")\n                        .HasMaxLength(17)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"ClaimedByUserId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime?>(\"ClaimedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Value\")\n                        .IsRequired()\n                        .HasMaxLength(255)\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"ClaimedByUserId\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"GameId\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Keys\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Data.Models.Media\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"FileId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"MimeType\")\n                        .IsRequired()\n                        .HasMaxLength(255)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"SourceUrl\")\n                        .IsRequired()\n                        .HasMaxLength(2048)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<int>(\"Type\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"GameId\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Media\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Data.Models.MultiplayerMode\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Description\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"GameId\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<int>(\"MaxPlayers\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<int>(\"MinPlayers\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<int>(\"NetworkProtocol\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<int>(\"Spectators\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<int>(\"Type\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"GameId\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"MultiplayerModes\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Data.Models.Redistributable\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Description\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Notes\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Redistributables\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Data.Models.Role\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"ConcurrencyStamp\")\n                        .IsConcurrencyToken()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .HasMaxLength(256)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"NormalizedName\")\n                        .HasMaxLength(256)\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"NormalizedName\")\n                        .IsUnique()\n                        .HasDatabaseName(\"RoleNameIndex\");\n\n                    b.ToTable(\"AspNetRoles\", (string)null);\n                });\n\n            modelBuilder.Entity(\"LANCommander.Data.Models.SavePath\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Path\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<int>(\"Type\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"GameId\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"SavePaths\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Data.Models.Script\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Contents\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Description\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"RedistributableId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<bool>(\"RequiresAdmin\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<int>(\"Type\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"GameId\");\n\n                    b.HasIndex(\"RedistributableId\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Scripts\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Data.Models.Server\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Arguments\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<bool>(\"Autostart\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<int>(\"AutostartDelay\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"OnStartScriptPath\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"OnStopScriptPath\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Path\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<bool>(\"UseShellExecute\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<string>(\"WorkingDirectory\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"GameId\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Servers\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Data.Models.ServerConsole\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Host\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Password\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Path\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<int?>(\"Port\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid?>(\"ServerId\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"ServerId1\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<int>(\"Type\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"ServerId\");\n\n                    b.HasIndex(\"ServerId1\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"ServerConsoles\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Data.Models.ServerHttpPath\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"LocalPath\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Path\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"ServerId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"ServerId1\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"ServerId\");\n\n                    b.HasIndex(\"ServerId1\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"ServerHttpPath\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Data.Models.Tag\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Tags\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Data.Models.User\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<int>(\"AccessFailedCount\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<string>(\"Alias\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<bool>(\"Approved\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<DateTime?>(\"ApprovedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"ConcurrencyStamp\")\n                        .IsConcurrencyToken()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Email\")\n                        .HasMaxLength(256)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<bool>(\"EmailConfirmed\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<bool>(\"LockoutEnabled\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<DateTimeOffset?>(\"LockoutEnd\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"NormalizedEmail\")\n                        .HasMaxLength(256)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"NormalizedUserName\")\n                        .HasMaxLength(256)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"PasswordHash\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"PhoneNumber\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<bool>(\"PhoneNumberConfirmed\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<string>(\"RefreshToken\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"RefreshTokenExpiration\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"SecurityStamp\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<bool>(\"TwoFactorEnabled\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<string>(\"UserName\")\n                        .HasMaxLength(256)\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"NormalizedEmail\")\n                        .HasDatabaseName(\"EmailIndex\");\n\n                    b.HasIndex(\"NormalizedUserName\")\n                        .IsUnique()\n                        .HasDatabaseName(\"UserNameIndex\");\n\n                    b.ToTable(\"AspNetUsers\", (string)null);\n                });\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>\", b =>\n                {\n                    b.Property<int>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<string>(\"ClaimType\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"ClaimValue\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"RoleId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"RoleId\");\n\n                    b.ToTable(\"AspNetRoleClaims\", (string)null);\n                });\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>\", b =>\n                {\n                    b.Property<int>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<string>(\"ClaimType\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"ClaimValue\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"UserId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"UserId\");\n\n                    b.ToTable(\"AspNetUserClaims\", (string)null);\n                });\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>\", b =>\n                {\n                    b.Property<string>(\"LoginProvider\")\n                        .HasMaxLength(128)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"ProviderKey\")\n                        .HasMaxLength(128)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"ProviderDisplayName\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"UserId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"LoginProvider\", \"ProviderKey\");\n\n                    b.HasIndex(\"UserId\");\n\n                    b.ToTable(\"AspNetUserLogins\", (string)null);\n                });\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>\", b =>\n                {\n                    b.Property<Guid>(\"UserId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"RoleId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"UserId\", \"RoleId\");\n\n                    b.HasIndex(\"RoleId\");\n\n                    b.ToTable(\"AspNetUserRoles\", (string)null);\n                });\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>\", b =>\n                {\n                    b.Property<Guid>(\"UserId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"LoginProvider\")\n                        .HasMaxLength(128)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .HasMaxLength(128)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Value\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"UserId\", \"LoginProvider\", \"Name\");\n\n                    b.ToTable(\"AspNetUserTokens\", (string)null);\n                });\n\n            modelBuilder.Entity(\"CategoryGame\", b =>\n                {\n                    b.HasOne(\"LANCommander.Data.Models.Category\", null)\n                        .WithMany()\n                        .HasForeignKey(\"CategoriesId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Data.Models.Game\", null)\n                        .WithMany()\n                        .HasForeignKey(\"GamesId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"GameDeveloper\", b =>\n                {\n                    b.HasOne(\"LANCommander.Data.Models.Company\", null)\n                        .WithMany()\n                        .HasForeignKey(\"DeveloperId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Data.Models.Game\", null)\n                        .WithMany()\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"GameGenre\", b =>\n                {\n                    b.HasOne(\"LANCommander.Data.Models.Game\", null)\n                        .WithMany()\n                        .HasForeignKey(\"GamesId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Data.Models.Genre\", null)\n                        .WithMany()\n                        .HasForeignKey(\"GenresId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"GamePublisher\", b =>\n                {\n                    b.HasOne(\"LANCommander.Data.Models.Game\", null)\n                        .WithMany()\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Data.Models.Company\", null)\n                        .WithMany()\n                        .HasForeignKey(\"PublisherId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"GameRedistributable\", b =>\n                {\n                    b.HasOne(\"LANCommander.Data.Models.Game\", null)\n                        .WithMany()\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Data.Models.Redistributable\", null)\n                        .WithMany()\n                        .HasForeignKey(\"RedistributableId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"GameTag\", b =>\n                {\n                    b.HasOne(\"LANCommander.Data.Models.Game\", null)\n                        .WithMany()\n                        .HasForeignKey(\"GamesId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Data.Models.Tag\", null)\n                        .WithMany()\n                        .HasForeignKey(\"TagsId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"LANCommander.Data.Models.Action\", b =>\n                {\n                    b.HasOne(\"LANCommander.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\");\n\n                    b.HasOne(\"LANCommander.Data.Models.Game\", \"Game\")\n                        .WithMany(\"Actions\")\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\");\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Game\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Data.Models.Archive\", b =>\n                {\n                    b.HasOne(\"LANCommander.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\");\n\n                    b.HasOne(\"LANCommander.Data.Models.Game\", \"Game\")\n                        .WithMany(\"Archives\")\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.Cascade);\n\n                    b.HasOne(\"LANCommander.Data.Models.Archive\", \"LastVersion\")\n                        .WithMany()\n                        .HasForeignKey(\"LastVersionId\");\n\n                    b.HasOne(\"LANCommander.Data.Models.Redistributable\", \"Redistributable\")\n                        .WithMany(\"Archives\")\n                        .HasForeignKey(\"RedistributableId\")\n                        .OnDelete(DeleteBehavior.Cascade);\n\n                    b.HasOne(\"LANCommander.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\");\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Game\");\n\n                    b.Navigation(\"LastVersion\");\n\n                    b.Navigation(\"Redistributable\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Data.Models.Category\", b =>\n                {\n                    b.HasOne(\"LANCommander.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\");\n\n                    b.HasOne(\"LANCommander.Data.Models.Category\", \"Parent\")\n                        .WithMany(\"Children\")\n                        .HasForeignKey(\"ParentId\");\n\n                    b.HasOne(\"LANCommander.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\");\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Parent\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Data.Models.Company\", b =>\n                {\n                    b.HasOne(\"LANCommander.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\");\n\n                    b.HasOne(\"LANCommander.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\");\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Data.Models.Game\", b =>\n                {\n                    b.HasOne(\"LANCommander.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\");\n\n                    b.HasOne(\"LANCommander.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\");\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Data.Models.GameSave\", b =>\n                {\n                    b.HasOne(\"LANCommander.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\");\n\n                    b.HasOne(\"LANCommander.Data.Models.Game\", \"Game\")\n                        .WithMany(\"GameSaves\")\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.NoAction)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\");\n\n                    b.HasOne(\"LANCommander.Data.Models.User\", \"User\")\n                        .WithMany(\"GameSaves\")\n                        .HasForeignKey(\"UserId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Game\");\n\n                    b.Navigation(\"UpdatedBy\");\n\n                    b.Navigation(\"User\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Data.Models.Genre\", b =>\n                {\n                    b.HasOne(\"LANCommander.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\");\n\n                    b.HasOne(\"LANCommander.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\");\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Data.Models.Key\", b =>\n                {\n                    b.HasOne(\"LANCommander.Data.Models.User\", \"ClaimedByUser\")\n                        .WithMany()\n                        .HasForeignKey(\"ClaimedByUserId\");\n\n                    b.HasOne(\"LANCommander.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\");\n\n                    b.HasOne(\"LANCommander.Data.Models.Game\", \"Game\")\n                        .WithMany(\"Keys\")\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\");\n\n                    b.Navigation(\"ClaimedByUser\");\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Game\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Data.Models.Media\", b =>\n                {\n                    b.HasOne(\"LANCommander.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\");\n\n                    b.HasOne(\"LANCommander.Data.Models.Game\", \"Game\")\n                        .WithMany(\"Media\")\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\");\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Game\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Data.Models.MultiplayerMode\", b =>\n                {\n                    b.HasOne(\"LANCommander.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\");\n\n                    b.HasOne(\"LANCommander.Data.Models.Game\", \"Game\")\n                        .WithMany(\"MultiplayerModes\")\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\");\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Game\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Data.Models.Redistributable\", b =>\n                {\n                    b.HasOne(\"LANCommander.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\");\n\n                    b.HasOne(\"LANCommander.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\");\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Data.Models.SavePath\", b =>\n                {\n                    b.HasOne(\"LANCommander.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\");\n\n                    b.HasOne(\"LANCommander.Data.Models.Game\", \"Game\")\n                        .WithMany(\"SavePaths\")\n                        .HasForeignKey(\"GameId\");\n\n                    b.HasOne(\"LANCommander.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\");\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Game\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Data.Models.Script\", b =>\n                {\n                    b.HasOne(\"LANCommander.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\");\n\n                    b.HasOne(\"LANCommander.Data.Models.Game\", \"Game\")\n                        .WithMany(\"Scripts\")\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.Cascade);\n\n                    b.HasOne(\"LANCommander.Data.Models.Redistributable\", \"Redistributable\")\n                        .WithMany(\"Scripts\")\n                        .HasForeignKey(\"RedistributableId\")\n                        .OnDelete(DeleteBehavior.Cascade);\n\n                    b.HasOne(\"LANCommander.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\");\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Game\");\n\n                    b.Navigation(\"Redistributable\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Data.Models.Server\", b =>\n                {\n                    b.HasOne(\"LANCommander.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\");\n\n                    b.HasOne(\"LANCommander.Data.Models.Game\", \"Game\")\n                        .WithMany(\"Servers\")\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.NoAction);\n\n                    b.HasOne(\"LANCommander.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\");\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Game\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Data.Models.ServerConsole\", b =>\n                {\n                    b.HasOne(\"LANCommander.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\");\n\n                    b.HasOne(\"LANCommander.Data.Models.Server\", \"Server\")\n                        .WithMany()\n                        .HasForeignKey(\"ServerId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Data.Models.Server\", null)\n                        .WithMany(\"ServerConsoles\")\n                        .HasForeignKey(\"ServerId1\");\n\n                    b.HasOne(\"LANCommander.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\");\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Server\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Data.Models.ServerHttpPath\", b =>\n                {\n                    b.HasOne(\"LANCommander.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\");\n\n                    b.HasOne(\"LANCommander.Data.Models.Server\", \"Server\")\n                        .WithMany()\n                        .HasForeignKey(\"ServerId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Data.Models.Server\", null)\n                        .WithMany(\"HttpPaths\")\n                        .HasForeignKey(\"ServerId1\");\n\n                    b.HasOne(\"LANCommander.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\");\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Server\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Data.Models.Tag\", b =>\n                {\n                    b.HasOne(\"LANCommander.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\");\n\n                    b.HasOne(\"LANCommander.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\");\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>\", b =>\n                {\n                    b.HasOne(\"LANCommander.Data.Models.Role\", null)\n                        .WithMany()\n                        .HasForeignKey(\"RoleId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>\", b =>\n                {\n                    b.HasOne(\"LANCommander.Data.Models.User\", null)\n                        .WithMany()\n                        .HasForeignKey(\"UserId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>\", b =>\n                {\n                    b.HasOne(\"LANCommander.Data.Models.User\", null)\n                        .WithMany()\n                        .HasForeignKey(\"UserId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>\", b =>\n                {\n                    b.HasOne(\"LANCommander.Data.Models.Role\", null)\n                        .WithMany()\n                        .HasForeignKey(\"RoleId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Data.Models.User\", null)\n                        .WithMany()\n                        .HasForeignKey(\"UserId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>\", b =>\n                {\n                    b.HasOne(\"LANCommander.Data.Models.User\", null)\n                        .WithMany()\n                        .HasForeignKey(\"UserId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"LANCommander.Data.Models.Category\", b =>\n                {\n                    b.Navigation(\"Children\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Data.Models.Game\", b =>\n                {\n                    b.Navigation(\"Actions\");\n\n                    b.Navigation(\"Archives\");\n\n                    b.Navigation(\"GameSaves\");\n\n                    b.Navigation(\"Keys\");\n\n                    b.Navigation(\"Media\");\n\n                    b.Navigation(\"MultiplayerModes\");\n\n                    b.Navigation(\"SavePaths\");\n\n                    b.Navigation(\"Scripts\");\n\n                    b.Navigation(\"Servers\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Data.Models.Redistributable\", b =>\n                {\n                    b.Navigation(\"Archives\");\n\n                    b.Navigation(\"Scripts\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Data.Models.Server\", b =>\n                {\n                    b.Navigation(\"HttpPaths\");\n\n                    b.Navigation(\"ServerConsoles\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Data.Models.User\", b =>\n                {\n                    b.Navigation(\"GameSaves\");\n                });\n#pragma warning restore 612, 618\n        }", "docstring": "/// <inheritdoc />", "url": "https://github.com/LANCommander/LANCommander/blob/51bc43ac93e3008391a2c78f958cbfc1d108bd80/LANCommander.Server.Data.SQLite/Migrations/20231105210731_RemoveDeprecatedServerHttpOptions.Designer.cs#L18-L1689", "sha": "51bc43ac93e3008391a2c78f958cbfc1d108bd80"}404{"repo_name": "LANCommander", "dataset": "github_2023", "owner": "LANCommander", "lang": "csharp", "func_name": "AddGameCustomFields.BuildTargetModel", "code": "protected override void BuildTargetModel(ModelBuilder modelBuilder)\n        {\n#pragma warning disable 612, 618\n            modelBuilder.HasAnnotation(\"ProductVersion\", \"8.0.10\");\n\n            modelBuilder.Entity(\"CategoryGame\", b =>\n                {\n                    b.Property<Guid>(\"CategoriesId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"GamesId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"CategoriesId\", \"GamesId\");\n\n                    b.HasIndex(\"GamesId\");\n\n                    b.ToTable(\"CategoryGame\");\n                });\n\n            modelBuilder.Entity(\"CollectionGame\", b =>\n                {\n                    b.Property<Guid>(\"CollectionId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"CollectionId\", \"GameId\");\n\n                    b.HasIndex(\"GameId\");\n\n                    b.ToTable(\"CollectionGame\");\n                });\n\n            modelBuilder.Entity(\"GameDeveloper\", b =>\n                {\n                    b.Property<Guid>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"DeveloperId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"GameId\", \"DeveloperId\");\n\n                    b.HasIndex(\"DeveloperId\");\n\n                    b.ToTable(\"GameDeveloper\");\n                });\n\n            modelBuilder.Entity(\"GameGenre\", b =>\n                {\n                    b.Property<Guid>(\"GamesId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"GenresId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"GamesId\", \"GenresId\");\n\n                    b.HasIndex(\"GenresId\");\n\n                    b.ToTable(\"GameGenre\");\n                });\n\n            modelBuilder.Entity(\"GamePlatform\", b =>\n                {\n                    b.Property<Guid>(\"GamesId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"PlatformsId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"GamesId\", \"PlatformsId\");\n\n                    b.HasIndex(\"PlatformsId\");\n\n                    b.ToTable(\"GamePlatform\");\n                });\n\n            modelBuilder.Entity(\"GamePublisher\", b =>\n                {\n                    b.Property<Guid>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"PublisherId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"GameId\", \"PublisherId\");\n\n                    b.HasIndex(\"PublisherId\");\n\n                    b.ToTable(\"GamePublisher\");\n                });\n\n            modelBuilder.Entity(\"GameRedistributable\", b =>\n                {\n                    b.Property<Guid>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"RedistributableId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"GameId\", \"RedistributableId\");\n\n                    b.HasIndex(\"RedistributableId\");\n\n                    b.ToTable(\"GameRedistributable\");\n                });\n\n            modelBuilder.Entity(\"GameTag\", b =>\n                {\n                    b.Property<Guid>(\"GamesId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"TagsId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"GamesId\", \"TagsId\");\n\n                    b.HasIndex(\"TagsId\");\n\n                    b.ToTable(\"GameTag\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Action\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Arguments\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Path\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<bool>(\"PrimaryAction\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid?>(\"ServerId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<int>(\"SortOrder\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"WorkingDirectory\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"GameId\");\n\n                    b.HasIndex(\"ServerId\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Actions\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Archive\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Changelog\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<long>(\"CompressedSize\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"LastVersionId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"ObjectKey\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"RedistributableId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"StorageLocationId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<long>(\"UncompressedSize\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Version\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"GameId\");\n\n                    b.HasIndex(\"LastVersionId\");\n\n                    b.HasIndex(\"RedistributableId\");\n\n                    b.HasIndex(\"StorageLocationId\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Archive\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Category\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"ParentId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"ParentId\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Categories\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Collection\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Collections\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Company\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Companies\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Engine\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Engines\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Game\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"BaseGameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Description\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"DirectoryName\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"EngineId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<long?>(\"IGDBId\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<int>(\"KeyAllocationMethod\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<string>(\"Notes\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime?>(\"ReleasedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<bool>(\"Singleplayer\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<string>(\"SortTitle\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Title\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<int>(\"Type\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"ValidKeyRegex\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"BaseGameId\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"EngineId\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Games\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.GameCustomField\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .IsRequired()\n                        .HasMaxLength(64)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Value\")\n                        .IsRequired()\n                        .HasMaxLength(1024)\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"GameId\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"GameCustomField\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.GameSave\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<long>(\"Size\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid>(\"StorageLocationId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"UserId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"GameId\");\n\n                    b.HasIndex(\"StorageLocationId\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.HasIndex(\"UserId\");\n\n                    b.ToTable(\"GameSaves\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Genre\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Genres\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Issue\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Description\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"ResolvedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime?>(\"ResolvedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"GameId\");\n\n                    b.HasIndex(\"ResolvedById\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Issues\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Key\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<int>(\"AllocationMethod\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<string>(\"ClaimedByComputerName\")\n                        .HasMaxLength(255)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"ClaimedByIpv4Address\")\n                        .HasMaxLength(15)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"ClaimedByMacAddress\")\n                        .HasMaxLength(17)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"ClaimedByUserId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime?>(\"ClaimedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Value\")\n                        .IsRequired()\n                        .HasMaxLength(255)\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"ClaimedByUserId\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"GameId\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Keys\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Library\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"UserId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.HasIndex(\"UserId\")\n                        .IsUnique();\n\n                    b.ToTable(\"Libraries\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Media\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Crc32\")\n                        .IsRequired()\n                        .HasMaxLength(8)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"FileId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"MimeType\")\n                        .HasMaxLength(255)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .HasMaxLength(64)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"SourceUrl\")\n                        .HasMaxLength(2048)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"StorageLocationId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"ThumbnailId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<int>(\"Type\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UserId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"GameId\");\n\n                    b.HasIndex(\"StorageLocationId\");\n\n                    b.HasIndex(\"ThumbnailId\")\n                        .IsUnique();\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.HasIndex(\"UserId\");\n\n                    b.ToTable(\"Media\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.MultiplayerMode\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Description\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"GameId\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<int>(\"MaxPlayers\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<int>(\"MinPlayers\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<int>(\"NetworkProtocol\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<int>(\"Spectators\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<int>(\"Type\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"GameId\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"MultiplayerModes\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Page\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Contents\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"ParentId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Route\")\n                        .IsRequired()\n                        .HasMaxLength(2048)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Slug\")\n                        .IsRequired()\n                        .HasMaxLength(256)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<int>(\"SortOrder\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<string>(\"Title\")\n                        .IsRequired()\n                        .HasMaxLength(256)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"ParentId\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Pages\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Platform\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Platforms\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.PlaySession\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime?>(\"End\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime?>(\"Start\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"UserId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"GameId\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.HasIndex(\"UserId\");\n\n                    b.ToTable(\"PlaySessions\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Redistributable\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Description\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Notes\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Redistributables\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Role\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"ConcurrencyStamp\")\n                        .IsConcurrencyToken()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .HasMaxLength(256)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"NormalizedName\")\n                        .HasMaxLength(256)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"NormalizedName\")\n                        .IsUnique()\n                        .HasDatabaseName(\"RoleNameIndex\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Roles\", (string)null);\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.SavePath\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<bool>(\"IsRegex\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<string>(\"Path\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<int>(\"Type\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"WorkingDirectory\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"GameId\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"SavePaths\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Script\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Contents\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Description\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"RedistributableId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<bool>(\"RequiresAdmin\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid?>(\"ServerId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<int>(\"Type\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"GameId\");\n\n                    b.HasIndex(\"RedistributableId\");\n\n                    b.HasIndex(\"ServerId\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Scripts\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Server\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Arguments\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<bool>(\"Autostart\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<int>(\"AutostartDelay\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<int>(\"AutostartMethod\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Host\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"OnStartScriptPath\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"OnStopScriptPath\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Path\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<int>(\"Port\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<int>(\"ProcessTerminationMethod\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<bool>(\"UseShellExecute\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<string>(\"WorkingDirectory\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"GameId\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Servers\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.ServerConsole\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Host\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Password\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Path\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<int?>(\"Port\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid?>(\"ServerId\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"ServerId1\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<int>(\"Type\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"ServerId\");\n\n                    b.HasIndex(\"ServerId1\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"ServerConsoles\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.ServerHttpPath\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"LocalPath\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Path\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"ServerId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"ServerId1\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"ServerId\");\n\n                    b.HasIndex(\"ServerId1\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"ServerHttpPath\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.StorageLocation\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<bool>(\"Default\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<string>(\"Path\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<int>(\"Type\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"StorageLocations\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Tag\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Tags\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.User\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<int>(\"AccessFailedCount\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<string>(\"Alias\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<bool>(\"Approved\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<DateTime?>(\"ApprovedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"ConcurrencyStamp\")\n                        .IsConcurrencyToken()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Email\")\n                        .HasMaxLength(256)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<bool>(\"EmailConfirmed\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<bool>(\"LockoutEnabled\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<DateTimeOffset?>(\"LockoutEnd\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"NormalizedEmail\")\n                        .HasMaxLength(256)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"NormalizedUserName\")\n                        .HasMaxLength(256)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"PasswordHash\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"PhoneNumber\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<bool>(\"PhoneNumberConfirmed\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<string>(\"RefreshToken\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"RefreshTokenExpiration\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"SecurityStamp\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<bool>(\"TwoFactorEnabled\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"UserName\")\n                        .HasMaxLength(256)\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"NormalizedEmail\")\n                        .HasDatabaseName(\"EmailIndex\");\n\n                    b.HasIndex(\"NormalizedUserName\")\n                        .IsUnique()\n                        .HasDatabaseName(\"UserNameIndex\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Users\", (string)null);\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.UserCustomField\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .IsRequired()\n                        .HasMaxLength(64)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UserId\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Value\")\n                        .IsRequired()\n                        .HasMaxLength(1024)\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.HasIndex(\"UserId\");\n\n                    b.ToTable(\"UserCustomField\");\n                });\n\n            modelBuilder.Entity(\"LibraryGame\", b =>\n                {\n                    b.Property<Guid>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"LibraryId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"GameId\", \"LibraryId\");\n\n                    b.HasIndex(\"LibraryId\");\n\n                    b.ToTable(\"LibraryGame\");\n                });\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>\", b =>\n                {\n                    b.Property<int>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<string>(\"ClaimType\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"ClaimValue\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"RoleId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"RoleId\");\n\n                    b.ToTable(\"RoleClaims\", (string)null);\n                });\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>\", b =>\n                {\n                    b.Property<int>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<string>(\"ClaimType\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"ClaimValue\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"UserId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"UserId\");\n\n                    b.ToTable(\"UserClaims\", (string)null);\n                });\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>\", b =>\n                {\n                    b.Property<string>(\"LoginProvider\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"ProviderKey\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"ProviderDisplayName\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"UserId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"LoginProvider\", \"ProviderKey\");\n\n                    b.HasIndex(\"UserId\");\n\n                    b.ToTable(\"UserLogins\", (string)null);\n                });\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>\", b =>\n                {\n                    b.Property<Guid>(\"UserId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"RoleId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"UserId\", \"RoleId\");\n\n                    b.HasIndex(\"RoleId\");\n\n                    b.ToTable(\"UserRoles\", (string)null);\n                });\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>\", b =>\n                {\n                    b.Property<Guid>(\"UserId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"LoginProvider\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Value\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"UserId\", \"LoginProvider\", \"Name\");\n\n                    b.ToTable(\"UserTokens\", (string)null);\n                });\n\n            modelBuilder.Entity(\"PageGame\", b =>\n                {\n                    b.Property<Guid>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"PageId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"GameId\", \"PageId\");\n\n                    b.HasIndex(\"PageId\");\n\n                    b.ToTable(\"PageGame\");\n                });\n\n            modelBuilder.Entity(\"PageRedistributable\", b =>\n                {\n                    b.Property<Guid>(\"PageId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"RedistributableId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"PageId\", \"RedistributableId\");\n\n                    b.HasIndex(\"RedistributableId\");\n\n                    b.ToTable(\"PageRedistributable\");\n                });\n\n            modelBuilder.Entity(\"PageServer\", b =>\n                {\n                    b.Property<Guid>(\"PageId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"ServerId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"PageId\", \"ServerId\");\n\n                    b.HasIndex(\"ServerId\");\n\n                    b.ToTable(\"PageServer\");\n                });\n\n            modelBuilder.Entity(\"RoleCollection\", b =>\n                {\n                    b.Property<Guid>(\"CollectionId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"RoleId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"CollectionId\", \"RoleId\");\n\n                    b.HasIndex(\"RoleId\");\n\n                    b.ToTable(\"RoleCollection\");\n                });\n\n            modelBuilder.Entity(\"CategoryGame\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.Category\", null)\n                        .WithMany()\n                        .HasForeignKey(\"CategoriesId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", null)\n                        .WithMany()\n                        .HasForeignKey(\"GamesId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"CollectionGame\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.Collection\", null)\n                        .WithMany()\n                        .HasForeignKey(\"CollectionId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", null)\n                        .WithMany()\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"GameDeveloper\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.Company\", null)\n                        .WithMany()\n                        .HasForeignKey(\"DeveloperId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", null)\n                        .WithMany()\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"GameGenre\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", null)\n                        .WithMany()\n                        .HasForeignKey(\"GamesId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Genre\", null)\n                        .WithMany()\n                        .HasForeignKey(\"GenresId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"GamePlatform\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", null)\n                        .WithMany()\n                        .HasForeignKey(\"GamesId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Platform\", null)\n                        .WithMany()\n                        .HasForeignKey(\"PlatformsId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"GamePublisher\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", null)\n                        .WithMany()\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Company\", null)\n                        .WithMany()\n                        .HasForeignKey(\"PublisherId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"GameRedistributable\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", null)\n                        .WithMany()\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Redistributable\", null)\n                        .WithMany()\n                        .HasForeignKey(\"RedistributableId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"GameTag\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", null)\n                        .WithMany()\n                        .HasForeignKey(\"GamesId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Tag\", null)\n                        .WithMany()\n                        .HasForeignKey(\"TagsId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Action\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", \"Game\")\n                        .WithMany(\"Actions\")\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.Cascade);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Server\", \"Server\")\n                        .WithMany(\"Actions\")\n                        .HasForeignKey(\"ServerId\")\n                        .OnDelete(DeleteBehavior.Cascade);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Game\");\n\n                    b.Navigation(\"Server\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Archive\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", \"Game\")\n                        .WithMany(\"Archives\")\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.Cascade);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Archive\", \"LastVersion\")\n                        .WithMany()\n                        .HasForeignKey(\"LastVersionId\");\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Redistributable\", \"Redistributable\")\n                        .WithMany(\"Archives\")\n                        .HasForeignKey(\"RedistributableId\")\n                        .OnDelete(DeleteBehavior.Cascade);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.StorageLocation\", \"StorageLocation\")\n                        .WithMany(\"Archives\")\n                        .HasForeignKey(\"StorageLocationId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Game\");\n\n                    b.Navigation(\"LastVersion\");\n\n                    b.Navigation(\"Redistributable\");\n\n                    b.Navigation(\"StorageLocation\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Category\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Category\", \"Parent\")\n                        .WithMany(\"Children\")\n                        .HasForeignKey(\"ParentId\");\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Parent\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Collection\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Company\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Engine\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\");\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\");\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Game\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", \"BaseGame\")\n                        .WithMany(\"DependentGames\")\n                        .HasForeignKey(\"BaseGameId\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Engine\", \"Engine\")\n                        .WithMany(\"Games\")\n                        .HasForeignKey(\"EngineId\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.Navigation(\"BaseGame\");\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Engine\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.GameCustomField\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\");\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", \"Game\")\n                        .WithMany(\"CustomFields\")\n                        .HasForeignKey(\"GameId\");\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\");\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Game\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.GameSave\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", \"Game\")\n                        .WithMany(\"GameSaves\")\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.StorageLocation\", \"StorageLocation\")\n                        .WithMany(\"GameSaves\")\n                        .HasForeignKey(\"StorageLocationId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"User\")\n                        .WithMany(\"GameSaves\")\n                        .HasForeignKey(\"UserId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Game\");\n\n                    b.Navigation(\"StorageLocation\");\n\n                    b.Navigation(\"UpdatedBy\");\n\n                    b.Navigation(\"User\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Genre\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Issue\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", \"Game\")\n                        .WithMany(\"Issues\")\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"ResolvedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"ResolvedById\");\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Game\");\n\n                    b.Navigation(\"ResolvedBy\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Key\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"ClaimedByUser\")\n                        .WithMany()\n                        .HasForeignKey(\"ClaimedByUserId\");\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", \"Game\")\n                        .WithMany(\"Keys\")\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.Navigation(\"ClaimedByUser\");\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Game\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Library\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"User\")\n                        .WithOne(\"Library\")\n                        .HasForeignKey(\"LANCommander.Server.Data.Models.Library\", \"UserId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"UpdatedBy\");\n\n                    b.Navigation(\"User\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Media\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", \"Game\")\n                        .WithMany(\"Media\")\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.Cascade);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.StorageLocation\", \"StorageLocation\")\n                        .WithMany(\"Media\")\n                        .HasForeignKey(\"StorageLocationId\")\n                        .OnDelete(DeleteBehavior.SetNull)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Media\", \"Thumbnail\")\n                        .WithOne(\"Parent\")\n                        .HasForeignKey(\"LANCommander.Server.Data.Models.Media\", \"ThumbnailId\")\n                        .OnDelete(DeleteBehavior.Cascade);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"User\")\n                        .WithMany(\"Media\")\n                        .HasForeignKey(\"UserId\")\n                        .OnDelete(DeleteBehavior.Cascade);\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Game\");\n\n                    b.Navigation(\"StorageLocation\");\n\n                    b.Navigation(\"Thumbnail\");\n\n                    b.Navigation(\"UpdatedBy\");\n\n                    b.Navigation(\"User\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.MultiplayerMode\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", \"Game\")\n                        .WithMany(\"MultiplayerModes\")\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Game\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Page\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Page\", \"Parent\")\n                        .WithMany(\"Children\")\n                        .HasForeignKey(\"ParentId\")\n                        .OnDelete(DeleteBehavior.Cascade);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Parent\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Platform\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.PlaySession\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", \"Game\")\n                        .WithMany(\"PlaySessions\")\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.Cascade);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"User\")\n                        .WithMany(\"PlaySessions\")\n                        .HasForeignKey(\"UserId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Game\");\n\n                    b.Navigation(\"UpdatedBy\");\n\n                    b.Navigation(\"User\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Redistributable\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Role\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.SavePath\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", \"Game\")\n                        .WithMany(\"SavePaths\")\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.Cascade);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Game\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Script\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", \"Game\")\n                        .WithMany(\"Scripts\")\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.Cascade);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Redistributable\", \"Redistributable\")\n                        .WithMany(\"Scripts\")\n                        .HasForeignKey(\"RedistributableId\")\n                        .OnDelete(DeleteBehavior.Cascade);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Server\", \"Server\")\n                        .WithMany(\"Scripts\")\n                        .HasForeignKey(\"ServerId\")\n                        .OnDelete(DeleteBehavior.Cascade);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Game\");\n\n                    b.Navigation(\"Redistributable\");\n\n                    b.Navigation(\"Server\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Server\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", \"Game\")\n                        .WithMany(\"Servers\")\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Game\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.ServerConsole\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Server\", \"Server\")\n                        .WithMany()\n                        .HasForeignKey(\"ServerId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Server\", null)\n                        .WithMany(\"ServerConsoles\")\n                        .HasForeignKey(\"ServerId1\");\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Server\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.ServerHttpPath\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Server\", \"Server\")\n                        .WithMany()\n                        .HasForeignKey(\"ServerId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Server\", null)\n                        .WithMany(\"HttpPaths\")\n                        .HasForeignKey(\"ServerId1\");\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Server\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.StorageLocation\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\");\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\");\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Tag\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.User\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.UserCustomField\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"User\")\n                        .WithMany(\"CustomFields\")\n                        .HasForeignKey(\"UserId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"UpdatedBy\");\n\n                    b.Navigation(\"User\");\n                });\n\n            modelBuilder.Entity(\"LibraryGame\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", null)\n                        .WithMany()\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Library\", null)\n                        .WithMany()\n                        .HasForeignKey(\"LibraryId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.Role\", null)\n                        .WithMany()\n                        .HasForeignKey(\"RoleId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", null)\n                        .WithMany()\n                        .HasForeignKey(\"UserId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", null)\n                        .WithMany()\n                        .HasForeignKey(\"UserId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.Role\", null)\n                        .WithMany()\n                        .HasForeignKey(\"RoleId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", null)\n                        .WithMany()\n                        .HasForeignKey(\"UserId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", null)\n                        .WithMany()\n                        .HasForeignKey(\"UserId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"PageGame\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", null)\n                        .WithMany()\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Page\", null)\n                        .WithMany()\n                        .HasForeignKey(\"PageId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"PageRedistributable\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.Page\", null)\n                        .WithMany()\n                        .HasForeignKey(\"PageId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Redistributable\", null)\n                        .WithMany()\n                        .HasForeignKey(\"RedistributableId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"PageServer\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.Page\", null)\n                        .WithMany()\n                        .HasForeignKey(\"PageId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Server\", null)\n                        .WithMany()\n                        .HasForeignKey(\"ServerId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"RoleCollection\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.Collection\", null)\n                        .WithMany()\n                        .HasForeignKey(\"CollectionId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Role\", null)\n                        .WithMany()\n                        .HasForeignKey(\"RoleId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Category\", b =>\n                {\n                    b.Navigation(\"Children\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Engine\", b =>\n                {\n                    b.Navigation(\"Games\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Game\", b =>\n                {\n                    b.Navigation(\"Actions\");\n\n                    b.Navigation(\"Archives\");\n\n                    b.Navigation(\"CustomFields\");\n\n                    b.Navigation(\"DependentGames\");\n\n                    b.Navigation(\"GameSaves\");\n\n                    b.Navigation(\"Issues\");\n\n                    b.Navigation(\"Keys\");\n\n                    b.Navigation(\"Media\");\n\n                    b.Navigation(\"MultiplayerModes\");\n\n                    b.Navigation(\"PlaySessions\");\n\n                    b.Navigation(\"SavePaths\");\n\n                    b.Navigation(\"Scripts\");\n\n                    b.Navigation(\"Servers\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Media\", b =>\n                {\n                    b.Navigation(\"Parent\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Page\", b =>\n                {\n                    b.Navigation(\"Children\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Redistributable\", b =>\n                {\n                    b.Navigation(\"Archives\");\n\n                    b.Navigation(\"Scripts\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Server\", b =>\n                {\n                    b.Navigation(\"Actions\");\n\n                    b.Navigation(\"HttpPaths\");\n\n                    b.Navigation(\"Scripts\");\n\n                    b.Navigation(\"ServerConsoles\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.StorageLocation\", b =>\n                {\n                    b.Navigation(\"Archives\");\n\n                    b.Navigation(\"GameSaves\");\n\n                    b.Navigation(\"Media\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.User\", b =>\n                {\n                    b.Navigation(\"CustomFields\");\n\n                    b.Navigation(\"GameSaves\");\n\n                    b.Navigation(\"Library\")\n                        .IsRequired();\n\n                    b.Navigation(\"Media\");\n\n                    b.Navigation(\"PlaySessions\");\n                });\n#pragma warning restore 612, 618\n        }", "docstring": "/// <inheritdoc />", "url": "https://github.com/LANCommander/LANCommander/blob/51bc43ac93e3008391a2c78f958cbfc1d108bd80/LANCommander.Server.Data.SQLite/Migrations/20250131011110_AddGameCustomFields.Designer.cs#L18-L2792", "sha": "51bc43ac93e3008391a2c78f958cbfc1d108bd80"}405{"repo_name": "LANCommander", "dataset": "github_2023", "owner": "LANCommander", "lang": "csharp", "func_name": "AddRedistributables.Up", "code": "protected override void Up(MigrationBuilder migrationBuilder)\n        {\n            migrationBuilder.AlterColumn<Guid>(\n                name: \"GameId\",\n                table: \"Scripts\",\n                type: \"TEXT\",\n                nullable: true,\n                oldClrType: typeof(Guid),\n                oldType: \"TEXT\");\n\n            migrationBuilder.AddColumn<Guid>(\n                name: \"RedistributableId\",\n                table: \"Scripts\",\n                type: \"TEXT\",\n                nullable: true);\n\n            migrationBuilder.AlterColumn<Guid>(\n                name: \"GameId\",\n                table: \"Archive\",\n                type: \"TEXT\",\n                nullable: true,\n                oldClrType: typeof(Guid),\n                oldType: \"TEXT\");\n\n            migrationBuilder.AddColumn<Guid>(\n                name: \"RedistributableId\",\n                table: \"Archive\",\n                type: \"TEXT\",\n                nullable: true);\n\n            migrationBuilder.CreateTable(\n                name: \"Redistributables\",\n                columns: table => new\n                {\n                    Id = table.Column<Guid>(type: \"TEXT\", nullable: false),\n                    Name = table.Column<string>(type: \"TEXT\", nullable: false),\n                    Description = table.Column<string>(type: \"TEXT\", nullable: true),\n                    Notes = table.Column<string>(type: \"TEXT\", nullable: true),\n                    CreatedOn = table.Column<DateTime>(type: \"TEXT\", nullable: false),\n                    CreatedById = table.Column<Guid>(type: \"TEXT\", nullable: true),\n                    UpdatedOn = table.Column<DateTime>(type: \"TEXT\", nullable: false),\n                    UpdatedById = table.Column<Guid>(type: \"TEXT\", nullable: true)\n                },\n                constraints: table =>\n                {\n                    table.PrimaryKey(\"PK_Redistributables\", x => x.Id);\n                    table.ForeignKey(\n                        name: \"FK_Redistributables_AspNetUsers_CreatedById\",\n                        column: x => x.CreatedById,\n                        principalTable: \"AspNetUsers\",\n                        principalColumn: \"Id\");\n                    table.ForeignKey(\n                        name: \"FK_Redistributables_AspNetUsers_UpdatedById\",\n                        column: x => x.UpdatedById,\n                        principalTable: \"AspNetUsers\",\n                        principalColumn: \"Id\");\n                });\n\n            migrationBuilder.CreateIndex(\n                name: \"IX_Scripts_RedistributableId\",\n                table: \"Scripts\",\n                column: \"RedistributableId\");\n\n            migrationBuilder.CreateIndex(\n                name: \"IX_Archive_RedistributableId\",\n                table: \"Archive\",\n                column: \"RedistributableId\");\n\n            migrationBuilder.CreateIndex(\n                name: \"IX_Redistributables_CreatedById\",\n                table: \"Redistributables\",\n                column: \"CreatedById\");\n\n            migrationBuilder.CreateIndex(\n                name: \"IX_Redistributables_UpdatedById\",\n                table: \"Redistributables\",\n                column: \"UpdatedById\");\n\n            migrationBuilder.AddForeignKey(\n                name: \"FK_Archive_Redistributables_RedistributableId\",\n                table: \"Archive\",\n                column: \"RedistributableId\",\n                principalTable: \"Redistributables\",\n                principalColumn: \"Id\",\n                onDelete: ReferentialAction.Cascade);\n\n            migrationBuilder.AddForeignKey(\n                name: \"FK_Scripts_Redistributables_RedistributableId\",\n                table: \"Scripts\",\n                column: \"RedistributableId\",\n                principalTable: \"Redistributables\",\n                principalColumn: \"Id\",\n                onDelete: ReferentialAction.Cascade);\n        }", "docstring": "/// <inheritdoc />", "url": "https://github.com/LANCommander/LANCommander/blob/51bc43ac93e3008391a2c78f958cbfc1d108bd80/LANCommander.Server.Data.SQLite/Migrations/20231018060152_AddRedistributables.cs#L12-L105", "sha": "51bc43ac93e3008391a2c78f958cbfc1d108bd80"}406{"repo_name": "LANCommander", "dataset": "github_2023", "owner": "LANCommander", "lang": "csharp", "func_name": "AddStorageLocations.BuildTargetModel", "code": "protected override void BuildTargetModel(ModelBuilder modelBuilder)\n        {\n#pragma warning disable 612, 618\n            modelBuilder\n                .HasAnnotation(\"ProductVersion\", \"8.0.8\")\n                .HasAnnotation(\"Proxies:ChangeTracking\", false)\n                .HasAnnotation(\"Proxies:CheckEquality\", false)\n                .HasAnnotation(\"Proxies:LazyLoading\", true);\n\n            modelBuilder.Entity(\"CategoryGame\", b =>\n                {\n                    b.Property<Guid>(\"CategoriesId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"GamesId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"CategoriesId\", \"GamesId\");\n\n                    b.HasIndex(\"GamesId\");\n\n                    b.ToTable(\"CategoryGame\");\n                });\n\n            modelBuilder.Entity(\"CollectionGame\", b =>\n                {\n                    b.Property<Guid>(\"CollectionId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"CollectionId\", \"GameId\");\n\n                    b.HasIndex(\"GameId\");\n\n                    b.ToTable(\"CollectionGame\");\n                });\n\n            modelBuilder.Entity(\"GameDeveloper\", b =>\n                {\n                    b.Property<Guid>(\"DeveloperId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"DeveloperId\", \"GameId\");\n\n                    b.HasIndex(\"GameId\");\n\n                    b.ToTable(\"GameDeveloper\");\n                });\n\n            modelBuilder.Entity(\"GameGenre\", b =>\n                {\n                    b.Property<Guid>(\"GamesId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"GenresId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"GamesId\", \"GenresId\");\n\n                    b.HasIndex(\"GenresId\");\n\n                    b.ToTable(\"GameGenre\");\n                });\n\n            modelBuilder.Entity(\"GamePlatform\", b =>\n                {\n                    b.Property<Guid>(\"GamesId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"PlatformsId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"GamesId\", \"PlatformsId\");\n\n                    b.HasIndex(\"PlatformsId\");\n\n                    b.ToTable(\"GamePlatform\");\n                });\n\n            modelBuilder.Entity(\"GamePublisher\", b =>\n                {\n                    b.Property<Guid>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"PublisherId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"GameId\", \"PublisherId\");\n\n                    b.HasIndex(\"PublisherId\");\n\n                    b.ToTable(\"GamePublisher\");\n                });\n\n            modelBuilder.Entity(\"GameRedistributable\", b =>\n                {\n                    b.Property<Guid>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"RedistributableId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"GameId\", \"RedistributableId\");\n\n                    b.HasIndex(\"RedistributableId\");\n\n                    b.ToTable(\"GameRedistributable\");\n                });\n\n            modelBuilder.Entity(\"GameTag\", b =>\n                {\n                    b.Property<Guid>(\"GamesId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"TagsId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"GamesId\", \"TagsId\");\n\n                    b.HasIndex(\"TagsId\");\n\n                    b.ToTable(\"GameTag\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Action\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Arguments\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Path\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<bool>(\"PrimaryAction\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid?>(\"ServerId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<int>(\"SortOrder\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"WorkingDirectory\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"GameId\");\n\n                    b.HasIndex(\"ServerId\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Actions\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Archive\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Changelog\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<long>(\"CompressedSize\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"LastVersionId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"ObjectKey\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"RedistributableId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"StorageLocationId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<long>(\"UncompressedSize\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Version\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"GameId\");\n\n                    b.HasIndex(\"LastVersionId\");\n\n                    b.HasIndex(\"RedistributableId\");\n\n                    b.HasIndex(\"StorageLocationId\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Archive\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Category\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"ParentId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"ParentId\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Categories\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Collection\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Collections\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Company\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Companies\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Engine\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Engines\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Game\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"BaseGameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Description\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"DirectoryName\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"EngineId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<long?>(\"IGDBId\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<int>(\"KeyAllocationMethod\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<string>(\"Notes\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime?>(\"ReleasedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<bool>(\"Singleplayer\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<string>(\"SortTitle\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Title\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<int>(\"Type\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"ValidKeyRegex\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"BaseGameId\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"EngineId\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Games\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.GameSave\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"StorageLocationId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"UserId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"GameId\");\n\n                    b.HasIndex(\"StorageLocationId\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.HasIndex(\"UserId\");\n\n                    b.ToTable(\"GameSaves\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Genre\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Genres\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Issue\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Description\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"ResolvedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime?>(\"ResolvedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"GameId\");\n\n                    b.HasIndex(\"ResolvedById\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Issues\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Key\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<int>(\"AllocationMethod\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<string>(\"ClaimedByComputerName\")\n                        .HasMaxLength(255)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"ClaimedByIpv4Address\")\n                        .HasMaxLength(15)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"ClaimedByMacAddress\")\n                        .HasMaxLength(17)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"ClaimedByUserId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime?>(\"ClaimedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Value\")\n                        .IsRequired()\n                        .HasMaxLength(255)\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"ClaimedByUserId\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"GameId\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Keys\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Media\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Crc32\")\n                        .IsRequired()\n                        .HasMaxLength(8)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"FileId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"MimeType\")\n                        .HasMaxLength(255)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .HasMaxLength(64)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"SourceUrl\")\n                        .HasMaxLength(2048)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"StorageLocationId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"ThumbnailId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<int>(\"Type\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UserId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"GameId\");\n\n                    b.HasIndex(\"StorageLocationId\");\n\n                    b.HasIndex(\"ThumbnailId\")\n                        .IsUnique();\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.HasIndex(\"UserId\");\n\n                    b.ToTable(\"Media\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.MultiplayerMode\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Description\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"GameId\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<int>(\"MaxPlayers\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<int>(\"MinPlayers\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<int>(\"NetworkProtocol\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<int>(\"Spectators\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<int>(\"Type\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"GameId\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"MultiplayerModes\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Page\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Contents\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"ParentId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Route\")\n                        .IsRequired()\n                        .HasMaxLength(2048)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Slug\")\n                        .IsRequired()\n                        .HasMaxLength(256)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<int>(\"SortOrder\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<string>(\"Title\")\n                        .IsRequired()\n                        .HasMaxLength(256)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"ParentId\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Pages\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Platform\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Platforms\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.PlaySession\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime?>(\"End\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime?>(\"Start\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"UserId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"GameId\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.HasIndex(\"UserId\");\n\n                    b.ToTable(\"PlaySessions\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Redistributable\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Description\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Notes\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Redistributables\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Role\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"ConcurrencyStamp\")\n                        .IsConcurrencyToken()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .HasMaxLength(256)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"NormalizedName\")\n                        .HasMaxLength(256)\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"NormalizedName\")\n                        .IsUnique()\n                        .HasDatabaseName(\"RoleNameIndex\");\n\n                    b.ToTable(\"AspNetRoles\", (string)null);\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.SavePath\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<bool>(\"IsRegex\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<string>(\"Path\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<int>(\"Type\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"WorkingDirectory\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"GameId\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"SavePaths\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Script\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Contents\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Description\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"RedistributableId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<bool>(\"RequiresAdmin\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid?>(\"ServerId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<int>(\"Type\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"GameId\");\n\n                    b.HasIndex(\"RedistributableId\");\n\n                    b.HasIndex(\"ServerId\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Scripts\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Server\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Arguments\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<bool>(\"Autostart\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<int>(\"AutostartDelay\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<int>(\"AutostartMethod\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Host\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"OnStartScriptPath\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"OnStopScriptPath\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Path\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<int>(\"Port\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<int>(\"ProcessTerminationMethod\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<bool>(\"UseShellExecute\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<string>(\"WorkingDirectory\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"GameId\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Servers\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.ServerConsole\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Host\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Password\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Path\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<int?>(\"Port\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid?>(\"ServerId\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"ServerId1\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<int>(\"Type\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"ServerId\");\n\n                    b.HasIndex(\"ServerId1\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"ServerConsoles\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.ServerHttpPath\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"LocalPath\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Path\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"ServerId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"ServerId1\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"ServerId\");\n\n                    b.HasIndex(\"ServerId1\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"ServerHttpPath\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.StorageLocation\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<bool>(\"Default\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<string>(\"Path\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<int>(\"Type\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"StorageLocations\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Tag\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.ToTable(\"Tags\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.User\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<int>(\"AccessFailedCount\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<string>(\"Alias\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<bool>(\"Approved\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<DateTime?>(\"ApprovedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"ConcurrencyStamp\")\n                        .IsConcurrencyToken()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Email\")\n                        .HasMaxLength(256)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<bool>(\"EmailConfirmed\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<bool>(\"LockoutEnabled\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<DateTimeOffset?>(\"LockoutEnd\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"NormalizedEmail\")\n                        .HasMaxLength(256)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"NormalizedUserName\")\n                        .HasMaxLength(256)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"PasswordHash\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"PhoneNumber\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<bool>(\"PhoneNumberConfirmed\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<string>(\"RefreshToken\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"RefreshTokenExpiration\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"SecurityStamp\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<bool>(\"TwoFactorEnabled\")\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<string>(\"UserName\")\n                        .HasMaxLength(256)\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"NormalizedEmail\")\n                        .HasDatabaseName(\"EmailIndex\");\n\n                    b.HasIndex(\"NormalizedUserName\")\n                        .IsUnique()\n                        .HasDatabaseName(\"UserNameIndex\");\n\n                    b.ToTable(\"AspNetUsers\", (string)null);\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.UserCustomField\", b =>\n                {\n                    b.Property<Guid>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"CreatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"CreatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .IsRequired()\n                        .HasMaxLength(64)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UpdatedById\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<DateTime>(\"UpdatedOn\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid?>(\"UserId\")\n                        .IsRequired()\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Value\")\n                        .IsRequired()\n                        .HasMaxLength(1024)\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"CreatedById\");\n\n                    b.HasIndex(\"UpdatedById\");\n\n                    b.HasIndex(\"UserId\");\n\n                    b.ToTable(\"UserCustomField\");\n                });\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>\", b =>\n                {\n                    b.Property<int>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<string>(\"ClaimType\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"ClaimValue\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"RoleId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"RoleId\");\n\n                    b.ToTable(\"AspNetRoleClaims\", (string)null);\n                });\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>\", b =>\n                {\n                    b.Property<int>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"INTEGER\");\n\n                    b.Property<string>(\"ClaimType\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"ClaimValue\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"UserId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"UserId\");\n\n                    b.ToTable(\"AspNetUserClaims\", (string)null);\n                });\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>\", b =>\n                {\n                    b.Property<string>(\"LoginProvider\")\n                        .HasMaxLength(128)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"ProviderKey\")\n                        .HasMaxLength(128)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"ProviderDisplayName\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"UserId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"LoginProvider\", \"ProviderKey\");\n\n                    b.HasIndex(\"UserId\");\n\n                    b.ToTable(\"AspNetUserLogins\", (string)null);\n                });\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>\", b =>\n                {\n                    b.Property<Guid>(\"UserId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"RoleId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"UserId\", \"RoleId\");\n\n                    b.HasIndex(\"RoleId\");\n\n                    b.ToTable(\"AspNetUserRoles\", (string)null);\n                });\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>\", b =>\n                {\n                    b.Property<Guid>(\"UserId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"LoginProvider\")\n                        .HasMaxLength(128)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Name\")\n                        .HasMaxLength(128)\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<string>(\"Value\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"UserId\", \"LoginProvider\", \"Name\");\n\n                    b.ToTable(\"AspNetUserTokens\", (string)null);\n                });\n\n            modelBuilder.Entity(\"PageGame\", b =>\n                {\n                    b.Property<Guid>(\"GameId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"PageId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"GameId\", \"PageId\");\n\n                    b.HasIndex(\"PageId\");\n\n                    b.ToTable(\"PageGame\");\n                });\n\n            modelBuilder.Entity(\"PageRedistributable\", b =>\n                {\n                    b.Property<Guid>(\"PageId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"RedistributableId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"PageId\", \"RedistributableId\");\n\n                    b.HasIndex(\"RedistributableId\");\n\n                    b.ToTable(\"PageRedistributable\");\n                });\n\n            modelBuilder.Entity(\"PageServer\", b =>\n                {\n                    b.Property<Guid>(\"PageId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"ServerId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"PageId\", \"ServerId\");\n\n                    b.HasIndex(\"ServerId\");\n\n                    b.ToTable(\"PageServer\");\n                });\n\n            modelBuilder.Entity(\"RoleCollection\", b =>\n                {\n                    b.Property<Guid>(\"CollectionId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.Property<Guid>(\"RoleId\")\n                        .HasColumnType(\"TEXT\");\n\n                    b.HasKey(\"CollectionId\", \"RoleId\");\n\n                    b.HasIndex(\"RoleId\");\n\n                    b.ToTable(\"RoleCollection\");\n                });\n\n            modelBuilder.Entity(\"CategoryGame\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.Category\", null)\n                        .WithMany()\n                        .HasForeignKey(\"CategoriesId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", null)\n                        .WithMany()\n                        .HasForeignKey(\"GamesId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"CollectionGame\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.Collection\", null)\n                        .WithMany()\n                        .HasForeignKey(\"CollectionId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", null)\n                        .WithMany()\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"GameDeveloper\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.Company\", null)\n                        .WithMany()\n                        .HasForeignKey(\"DeveloperId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", null)\n                        .WithMany()\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"GameGenre\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", null)\n                        .WithMany()\n                        .HasForeignKey(\"GamesId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Genre\", null)\n                        .WithMany()\n                        .HasForeignKey(\"GenresId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"GamePlatform\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", null)\n                        .WithMany()\n                        .HasForeignKey(\"GamesId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Platform\", null)\n                        .WithMany()\n                        .HasForeignKey(\"PlatformsId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"GamePublisher\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", null)\n                        .WithMany()\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Company\", null)\n                        .WithMany()\n                        .HasForeignKey(\"PublisherId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"GameRedistributable\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", null)\n                        .WithMany()\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Redistributable\", null)\n                        .WithMany()\n                        .HasForeignKey(\"RedistributableId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"GameTag\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", null)\n                        .WithMany()\n                        .HasForeignKey(\"GamesId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Tag\", null)\n                        .WithMany()\n                        .HasForeignKey(\"TagsId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Action\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", \"Game\")\n                        .WithMany(\"Actions\")\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.Cascade);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Server\", \"Server\")\n                        .WithMany(\"Actions\")\n                        .HasForeignKey(\"ServerId\")\n                        .OnDelete(DeleteBehavior.Cascade);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Game\");\n\n                    b.Navigation(\"Server\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Archive\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", \"Game\")\n                        .WithMany(\"Archives\")\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.Cascade);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Archive\", \"LastVersion\")\n                        .WithMany()\n                        .HasForeignKey(\"LastVersionId\");\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Redistributable\", \"Redistributable\")\n                        .WithMany(\"Archives\")\n                        .HasForeignKey(\"RedistributableId\")\n                        .OnDelete(DeleteBehavior.Cascade);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.StorageLocation\", \"StorageLocation\")\n                        .WithMany(\"Archives\")\n                        .HasForeignKey(\"StorageLocationId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Game\");\n\n                    b.Navigation(\"LastVersion\");\n\n                    b.Navigation(\"Redistributable\");\n\n                    b.Navigation(\"StorageLocation\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Category\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Category\", \"Parent\")\n                        .WithMany(\"Children\")\n                        .HasForeignKey(\"ParentId\");\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Parent\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Collection\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Company\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Engine\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\");\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\");\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Game\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", \"BaseGame\")\n                        .WithMany(\"DependentGames\")\n                        .HasForeignKey(\"BaseGameId\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Engine\", \"Engine\")\n                        .WithMany(\"Games\")\n                        .HasForeignKey(\"EngineId\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.Navigation(\"BaseGame\");\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Engine\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.GameSave\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", \"Game\")\n                        .WithMany(\"GameSaves\")\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.StorageLocation\", \"StorageLocation\")\n                        .WithMany(\"GameSaves\")\n                        .HasForeignKey(\"StorageLocationId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"User\")\n                        .WithMany(\"GameSaves\")\n                        .HasForeignKey(\"UserId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Game\");\n\n                    b.Navigation(\"StorageLocation\");\n\n                    b.Navigation(\"UpdatedBy\");\n\n                    b.Navigation(\"User\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Genre\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Issue\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", \"Game\")\n                        .WithMany(\"Issues\")\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.SetNull)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"ResolvedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"ResolvedById\");\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Game\");\n\n                    b.Navigation(\"ResolvedBy\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Key\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"ClaimedByUser\")\n                        .WithMany()\n                        .HasForeignKey(\"ClaimedByUserId\");\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", \"Game\")\n                        .WithMany(\"Keys\")\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.Navigation(\"ClaimedByUser\");\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Game\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Media\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", \"Game\")\n                        .WithMany(\"Media\")\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.Cascade);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.StorageLocation\", \"StorageLocation\")\n                        .WithMany(\"Media\")\n                        .HasForeignKey(\"StorageLocationId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Media\", \"Thumbnail\")\n                        .WithOne(\"Parent\")\n                        .HasForeignKey(\"LANCommander.Server.Data.Models.Media\", \"ThumbnailId\")\n                        .OnDelete(DeleteBehavior.Cascade);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"User\")\n                        .WithMany(\"Media\")\n                        .HasForeignKey(\"UserId\")\n                        .OnDelete(DeleteBehavior.Cascade);\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Game\");\n\n                    b.Navigation(\"StorageLocation\");\n\n                    b.Navigation(\"Thumbnail\");\n\n                    b.Navigation(\"UpdatedBy\");\n\n                    b.Navigation(\"User\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.MultiplayerMode\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", \"Game\")\n                        .WithMany(\"MultiplayerModes\")\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Game\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Page\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Page\", \"Parent\")\n                        .WithMany(\"Children\")\n                        .HasForeignKey(\"ParentId\")\n                        .OnDelete(DeleteBehavior.Cascade);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Parent\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Platform\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.PlaySession\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", \"Game\")\n                        .WithMany(\"PlaySessions\")\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"User\")\n                        .WithMany(\"PlaySessions\")\n                        .HasForeignKey(\"UserId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Game\");\n\n                    b.Navigation(\"UpdatedBy\");\n\n                    b.Navigation(\"User\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Redistributable\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.SavePath\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", \"Game\")\n                        .WithMany(\"SavePaths\")\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.Cascade);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Game\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Script\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", \"Game\")\n                        .WithMany(\"Scripts\")\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.Cascade);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Redistributable\", \"Redistributable\")\n                        .WithMany(\"Scripts\")\n                        .HasForeignKey(\"RedistributableId\")\n                        .OnDelete(DeleteBehavior.Cascade);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Server\", \"Server\")\n                        .WithMany(\"Scripts\")\n                        .HasForeignKey(\"ServerId\")\n                        .OnDelete(DeleteBehavior.Cascade);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Game\");\n\n                    b.Navigation(\"Redistributable\");\n\n                    b.Navigation(\"Server\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Server\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", \"Game\")\n                        .WithMany(\"Servers\")\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Game\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.ServerConsole\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Server\", \"Server\")\n                        .WithMany()\n                        .HasForeignKey(\"ServerId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Server\", null)\n                        .WithMany(\"ServerConsoles\")\n                        .HasForeignKey(\"ServerId1\");\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Server\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.ServerHttpPath\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Server\", \"Server\")\n                        .WithMany()\n                        .HasForeignKey(\"ServerId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Server\", null)\n                        .WithMany(\"HttpPaths\")\n                        .HasForeignKey(\"ServerId1\");\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"Server\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.StorageLocation\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\");\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\");\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Tag\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\")\n                        .OnDelete(DeleteBehavior.SetNull);\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"UpdatedBy\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.UserCustomField\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"CreatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"CreatedById\");\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"UpdatedBy\")\n                        .WithMany()\n                        .HasForeignKey(\"UpdatedById\");\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", \"User\")\n                        .WithMany(\"CustomFields\")\n                        .HasForeignKey(\"UserId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.Navigation(\"CreatedBy\");\n\n                    b.Navigation(\"UpdatedBy\");\n\n                    b.Navigation(\"User\");\n                });\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.Role\", null)\n                        .WithMany()\n                        .HasForeignKey(\"RoleId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", null)\n                        .WithMany()\n                        .HasForeignKey(\"UserId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", null)\n                        .WithMany()\n                        .HasForeignKey(\"UserId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.Role\", null)\n                        .WithMany()\n                        .HasForeignKey(\"RoleId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", null)\n                        .WithMany()\n                        .HasForeignKey(\"UserId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.User\", null)\n                        .WithMany()\n                        .HasForeignKey(\"UserId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"PageGame\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.Game\", null)\n                        .WithMany()\n                        .HasForeignKey(\"GameId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Page\", null)\n                        .WithMany()\n                        .HasForeignKey(\"PageId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"PageRedistributable\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.Page\", null)\n                        .WithMany()\n                        .HasForeignKey(\"PageId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Redistributable\", null)\n                        .WithMany()\n                        .HasForeignKey(\"RedistributableId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"PageServer\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.Page\", null)\n                        .WithMany()\n                        .HasForeignKey(\"PageId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Server\", null)\n                        .WithMany()\n                        .HasForeignKey(\"ServerId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"RoleCollection\", b =>\n                {\n                    b.HasOne(\"LANCommander.Server.Data.Models.Collection\", null)\n                        .WithMany()\n                        .HasForeignKey(\"CollectionId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"LANCommander.Server.Data.Models.Role\", null)\n                        .WithMany()\n                        .HasForeignKey(\"RoleId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Category\", b =>\n                {\n                    b.Navigation(\"Children\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Engine\", b =>\n                {\n                    b.Navigation(\"Games\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Game\", b =>\n                {\n                    b.Navigation(\"Actions\");\n\n                    b.Navigation(\"Archives\");\n\n                    b.Navigation(\"DependentGames\");\n\n                    b.Navigation(\"GameSaves\");\n\n                    b.Navigation(\"Issues\");\n\n                    b.Navigation(\"Keys\");\n\n                    b.Navigation(\"Media\");\n\n                    b.Navigation(\"MultiplayerModes\");\n\n                    b.Navigation(\"PlaySessions\");\n\n                    b.Navigation(\"SavePaths\");\n\n                    b.Navigation(\"Scripts\");\n\n                    b.Navigation(\"Servers\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Media\", b =>\n                {\n                    b.Navigation(\"Parent\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Page\", b =>\n                {\n                    b.Navigation(\"Children\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Redistributable\", b =>\n                {\n                    b.Navigation(\"Archives\");\n\n                    b.Navigation(\"Scripts\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.Server\", b =>\n                {\n                    b.Navigation(\"Actions\");\n\n                    b.Navigation(\"HttpPaths\");\n\n                    b.Navigation(\"Scripts\");\n\n                    b.Navigation(\"ServerConsoles\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.StorageLocation\", b =>\n                {\n                    b.Navigation(\"Archives\");\n\n                    b.Navigation(\"GameSaves\");\n\n                    b.Navigation(\"Media\");\n                });\n\n            modelBuilder.Entity(\"LANCommander.Server.Data.Models.User\", b =>\n                {\n                    b.Navigation(\"CustomFields\");\n\n                    b.Navigation(\"GameSaves\");\n\n                    b.Navigation(\"Media\");\n\n                    b.Navigation(\"PlaySessions\");\n                });\n#pragma warning restore 612, 618\n        }", "docstring": "/// <inheritdoc />", "url": "https://github.com/LANCommander/LANCommander/blob/51bc43ac93e3008391a2c78f958cbfc1d108bd80/LANCommander.Server.Data.SQLite/Migrations/20241011014752_AddStorageLocations.Designer.cs#L18-L2573", "sha": "51bc43ac93e3008391a2c78f958cbfc1d108bd80"}407{"repo_name": "LANCommander", "dataset": "github_2023", "owner": "LANCommander", "lang": "csharp", "func_name": "AddCollections.Up", "code": "protected override void Up(MigrationBuilder migrationBuilder)\n        {\n            migrationBuilder.CreateTable(\n                name: \"Collections\",\n                columns: table => new\n                {\n                    Id = table.Column<Guid>(type: \"TEXT\", nullable: false),\n                    Name = table.Column<string>(type: \"TEXT\", nullable: false),\n                    CreatedOn = table.Column<DateTime>(type: \"TEXT\", nullable: false),\n                    CreatedById = table.Column<Guid>(type: \"TEXT\", nullable: true),\n                    UpdatedOn = table.Column<DateTime>(type: \"TEXT\", nullable: false),\n                    UpdatedById = table.Column<Guid>(type: \"TEXT\", nullable: true)\n                },\n                constraints: table =>\n                {\n                    table.PrimaryKey(\"PK_Collections\", x => x.Id);\n                    table.ForeignKey(\n                        name: \"FK_Collections_AspNetUsers_CreatedById\",\n                        column: x => x.CreatedById,\n                        principalTable: \"AspNetUsers\",\n                        principalColumn: \"Id\",\n                        onDelete: ReferentialAction.SetNull);\n                    table.ForeignKey(\n                        name: \"FK_Collections_AspNetUsers_UpdatedById\",\n                        column: x => x.UpdatedById,\n                        principalTable: \"AspNetUsers\",\n                        principalColumn: \"Id\",\n                        onDelete: ReferentialAction.SetNull);\n                });\n\n            migrationBuilder.CreateTable(\n                name: \"CollectionGame\",\n                columns: table => new\n                {\n                    CollectionId = table.Column<Guid>(type: \"TEXT\", nullable: false),\n                    GameId = table.Column<Guid>(type: \"TEXT\", nullable: false)\n                },\n                constraints: table =>\n                {\n                    table.PrimaryKey(\"PK_CollectionGame\", x => new { x.CollectionId, x.GameId });\n                    table.ForeignKey(\n                        name: \"FK_CollectionGame_Collections_CollectionId\",\n                        column: x => x.CollectionId,\n                        principalTable: \"Collections\",\n                        principalColumn: \"Id\",\n                        onDelete: ReferentialAction.Cascade);\n                    table.ForeignKey(\n                        name: \"FK_CollectionGame_Games_GameId\",\n                        column: x => x.GameId,\n                        principalTable: \"Games\",\n                        principalColumn: \"Id\",\n                        onDelete: ReferentialAction.Cascade);\n                });\n\n            migrationBuilder.CreateTable(\n                name: \"RoleCollection\",\n                columns: table => new\n                {\n                    CollectionId = table.Column<Guid>(type: \"TEXT\", nullable: false),\n                    RoleId = table.Column<Guid>(type: \"TEXT\", nullable: false)\n                },\n                constraints: table =>\n                {\n                    table.PrimaryKey(\"PK_RoleCollection\", x => new { x.CollectionId, x.RoleId });\n                    table.ForeignKey(\n                        name: \"FK_RoleCollection_AspNetRoles_RoleId\",\n                        column: x => x.RoleId,\n                        principalTable: \"AspNetRoles\",\n                        principalColumn: \"Id\",\n                        onDelete: ReferentialAction.Cascade);\n                    table.ForeignKey(\n                        name: \"FK_RoleCollection_Collections_CollectionId\",\n                        column: x => x.CollectionId,\n                        principalTable: \"Collections\",\n                        principalColumn: \"Id\",\n                        onDelete: ReferentialAction.Cascade);\n                });\n\n            migrationBuilder.CreateIndex(\n                name: \"IX_CollectionGame_GameId\",\n                table: \"CollectionGame\",\n                column: \"GameId\");\n\n            migrationBuilder.CreateIndex(\n                name: \"IX_Collections_CreatedById\",\n                table: \"Collections\",\n                column: \"CreatedById\");\n\n            migrationBuilder.CreateIndex(\n                name: \"IX_Collections_UpdatedById\",\n                table: \"Collections\",\n                column: \"UpdatedById\");\n\n            migrationBuilder.CreateIndex(\n                name: \"IX_RoleCollection_RoleId\",\n                table: \"RoleCollection\",\n                column: \"RoleId\");\n        }", "docstring": "/// <inheritdoc />", "url": "https://github.com/LANCommander/LANCommander/blob/51bc43ac93e3008391a2c78f958cbfc1d108bd80/LANCommander.Server.Data.SQLite/Migrations/20231204044928_AddCollections.cs#L12-L109", "sha": "51bc43ac93e3008391a2c78f958cbfc1d108bd80"}408{"repo_name": "handy", "dataset": "github_2023", "owner": "Shopify", "lang": "csharp", "func_name": "CylinderSurface.TransformScale", "code": "private float TransformScale(float val)\n        {\n            return val * _cylinder.transform.lossyScale.x;\n        }", "docstring": "/// <summary>\n/// Local to world transformation of a float, assuming uniform scale.\n/// </summary>", "url": "https://github.com/Shopify/handy/blob/fa8686c291b1fe80e695bd8ad2474e2e852fd58b/Handy/Assets/Oculus/Interaction/Runtime/Scripts/Interaction/Surfaces/CylinderSurface.cs#L225-L228", "sha": "fa8686c291b1fe80e695bd8ad2474e2e852fd58b"}409{"repo_name": "handy", "dataset": "github_2023", "owner": "Shopify", "lang": "csharp", "func_name": "VoipOptions.SetBitrateForNewConnections", "code": "public void SetBitrateForNewConnections(VoipBitrate value) {\n      CAPI.ovr_VoipOptions_SetBitrateForNewConnections(Handle, value);\n    }", "docstring": "/// Sets the maximum average bitrate the audio codec should use. Higher\n/// bitrates will increase audio quality at the expense of increased network\n/// usage. Use a lower bitrate if you think the quality is good but the network\n/// usage is too much. Use a higher bitrate if you think the quality is bad and\n/// you can afford to have a large streaming bitrate.", "url": "https://github.com/Shopify/handy/blob/fa8686c291b1fe80e695bd8ad2474e2e852fd58b/Handy/Assets/Oculus/Platform/Scripts/VoipOptions.cs#L22-L24", "sha": "fa8686c291b1fe80e695bd8ad2474e2e852fd58b"}410{"repo_name": "handy", "dataset": "github_2023", "owner": "Shopify", "lang": "csharp", "func_name": "AdvancedAbuseReportOptions.SetObjectType", "code": "public void SetObjectType(string value) {\n      CAPI.ovr_AdvancedAbuseReportOptions_SetObjectType(Handle, value);\n    }", "docstring": "/// If report_type is content, a string representing the type of content being\n/// reported. This should correspond to the object_type string used in the UI", "url": "https://github.com/Shopify/handy/blob/fa8686c291b1fe80e695bd8ad2474e2e852fd58b/Handy/Assets/Oculus/Platform/Scripts/AdvancedAbuseReportOptions.cs#L27-L29", "sha": "fa8686c291b1fe80e695bd8ad2474e2e852fd58b"}411{"repo_name": "handy", "dataset": "github_2023", "owner": "Shopify", "lang": "csharp", "func_name": "OVRExtensions.ToTrackingSpacePose", "code": "public static OVRPose ToTrackingSpacePose(this Transform transform, Camera camera)\n\t{\n\t\t// Initializing to identity, but for all Oculus headsets, down below the pose will be initialized to the runtime's pose value, so identity will never be returned.\n\t\tOVRPose headPose = OVRPose.identity;\n\n\t\tVector3 pos;\n\t\tQuaternion rot;\n\t\tif (OVRNodeStateProperties.GetNodeStatePropertyVector3(Node.Head, NodeStatePropertyType.Position, OVRPlugin.Node.Head, OVRPlugin.Step.Render, out pos))\n\t\t\theadPose.position = pos;\n\t\tif (OVRNodeStateProperties.GetNodeStatePropertyQuaternion(Node.Head, NodeStatePropertyType.Orientation, OVRPlugin.Node.Head, OVRPlugin.Step.Render, out rot))\n\t\t\theadPose.orientation = rot;\n\n\t\tvar ret = headPose * transform.ToHeadSpacePose(camera);\n\n\t\treturn ret;\n\t}", "docstring": "/// <summary>\n/// Converts the given world-space transform to an OVRPose in tracking space.\n/// </summary>", "url": "https://github.com/Shopify/handy/blob/fa8686c291b1fe80e695bd8ad2474e2e852fd58b/Handy/Assets/Oculus/VR/Scripts/OVRCommon.cs#L52-L67", "sha": "fa8686c291b1fe80e695bd8ad2474e2e852fd58b"}412{"repo_name": "handy", "dataset": "github_2023", "owner": "Shopify", "lang": "csharp", "func_name": "WitEditorUI.LayoutHeaderButton", "code": "public static void LayoutHeaderButton(Texture2D headerTexture, string headerURL)\n        {\n            if (headerTexture != null)\n            {\n                GUILayout.BeginHorizontal();\n                GUILayout.FlexibleSpace();\n                float maxWidth = EditorGUIUtility.currentViewWidth - WitStyles.WindowPaddingLeft - WitStyles.WindowPaddingRight - WitStyles.IconButton.CalcSize(WitStyles.HelpIcon).x;\n                float headerWidth = Mathf.Min(WitStyles.HeaderWidth, maxWidth);\n                float headerHeight = headerWidth * (float)headerTexture.height / (float)headerTexture.width;\n                if (GUILayout.Button(headerTexture, WitStyles.HeaderButton, GUILayout.Width(headerWidth), GUILayout.Height(headerHeight)) && !string.IsNullOrEmpty(headerURL))\n                {\n                    Application.OpenURL(headerURL);\n                }\n                GUILayout.FlexibleSpace();\n                if (LayoutIconButton(WitStyles.HelpIcon))\n                {\n                    Application.OpenURL(headerURL);\n                }\n                GUILayout.EndHorizontal();\n            }\n        }", "docstring": "// Layout header button", "url": "https://github.com/Shopify/handy/blob/fa8686c291b1fe80e695bd8ad2474e2e852fd58b/Handy/Assets/Oculus/Voice/Lib/Wit.ai/Scripts/Editor/WitEditorUI.cs#L115-L135", "sha": "fa8686c291b1fe80e695bd8ad2474e2e852fd58b"}413{"repo_name": "handy", "dataset": "github_2023", "owner": "Shopify", "lang": "csharp", "func_name": "AssetDatabaseUtility.FindUnityAsset", "code": "public static T FindUnityAsset<T>(string filter) where T : UnityEngine.Object\n        {\n            T[] results = FindUnityAssets<T>(filter, true);\n            if (results != null && results.Length > 0)\n            {\n                return results[0];\n            }\n            return null;\n        }", "docstring": "// Find Unity asset", "url": "https://github.com/Shopify/handy/blob/fa8686c291b1fe80e695bd8ad2474e2e852fd58b/Handy/Assets/Oculus/Voice/Lib/Wit.ai/Scripts/Editor/Utility/AssetDatabaseUtility.cs#L17-L25", "sha": "fa8686c291b1fe80e695bd8ad2474e2e852fd58b"}414{"repo_name": "oni_multiplayer", "dataset": "github_2023", "owner": "onimp", "lang": "csharp", "func_name": "DisablePopUpEffects.TargetMethods", "code": "private static IEnumerable<MethodBase> TargetMethods() =>\n        typeof(PopFXManager).GetMethods()\n            .Where(it => it.Name.StartsWith(\"SpawnFX\"));", "docstring": "// ReSharper disable once UnusedMember.Local", "url": "https://github.com/onimp/oni_multiplayer/blob/926abd3b5f177b12ab4cc6d6aa537dcdb09684b7/src/MultiplayerMod/Game/Effects/DisablePopUpEffects.cs#L15-L17", "sha": "926abd3b5f177b12ab4cc6d6aa537dcdb09684b7"}415{"repo_name": "NectarRCON", "dataset": "github_2023", "owner": "zkhssb", "lang": "csharp", "func_name": "DNSHelperTests.ATest", "code": "[TestMethod]\n        public void ATest()\n        {\n            string? ip = DNSHelpers.AQuery(\"hypixel.net\");\n            Console.WriteLine(ip);\n            Assert.IsNotNull(string.IsNullOrEmpty(ip));\n        }", "docstring": "/// <summary>\n/// A่งฃๆžๆต‹่ฏ•\n/// </summary>", "url": "https://github.com/zkhssb/NectarRCON/blob/e7349a9bd8533522b7c105fe3e0ab79325ad8e05/NectarRCON.Tests/DNSHelperTests.cs#L10-L16", "sha": "e7349a9bd8533522b7c105fe3e0ab79325ad8e05"}416{"repo_name": "NectarRCON", "dataset": "github_2023", "owner": "zkhssb", "lang": "csharp", "func_name": "GithubUpdater.GetLatestVersion", "code": "private AppVersion? GetLatestVersion(bool enablePre)\n        {\n            if (_version is null)\n                return null;\n            using(HttpRequestMessage request = new(HttpMethod.Get, \"releases/latest\"))\n            {\n                request.Headers.Add(\"User-Agent\", $\"{_version.AppName}-AppUpdater\");\n                using(HttpResponseMessage response = _client.Send(request))\n                {\n                    if (!response.IsSuccessStatusCode)\n                        throw new HttpRequestException(response.StatusCode.ToString());\n                    string resultString = string.Empty;\n                    Task.Run(async () =>\n                    {\n                        resultString = await response.Content.ReadAsStringAsync();\n                    }).Wait();\n                    Release release = JsonSerializer.Deserialize<Release>(resultString) ?? throw new JsonException();\n                    foreach(var asset in release.Assets)\n                    {\n                        string fileName = Path.GetFileNameWithoutExtension(asset.Name);\n                        try\n                        {\n                            fileName = \"NectarRcon-x86-1.0.0-beta2\";\n                            AppVersion version = AppVersion.ParseVersion(fileName);\n                            if(version.AppName.ToLower() == _version.AppName.ToLower() && version.Platform.ToLower() == _version.Platform.ToLower())\n                            {\n                                if (version.IsPreRelease && !enablePre)\n                                    continue;\n                                if (version > _version)\n                                {\n                                    return version;\n                                }\n                            }\n                        }\n                        catch (InvalidOperationException) { } // Invalid version format\n                    }\n                    return null;\n                }\n            }\n        }", "docstring": "/// <summary>\n/// ่Žทๅ–ๆœ€ๆ–ฐ็‰ˆๆœฌ, nullไธบๆฒกๆ‰พๅˆฐ\n/// </summary>\n/// <param name=\"enablePre\">ๆ˜ฏๅฆๅ…่ฎธpre็‰ˆๆœฌ</param>", "url": "https://github.com/zkhssb/NectarRCON/blob/e7349a9bd8533522b7c105fe3e0ab79325ad8e05/NectarRCON.Updater/GithubUpdater.cs#L24-L63", "sha": "e7349a9bd8533522b7c105fe3e0ab79325ad8e05"}417{"repo_name": "SmartObjectSync", "dataset": "github_2023", "owner": "MMMaellon", "lang": "csharp", "func_name": "UniTaskExtensions.AsUniTask", "code": "public static UniTask<T> AsUniTask<T>(this Task<T> task, bool useCurrentSynchronizationContext = true)\n        {\n            var promise = new UniTaskCompletionSource<T>();\n\n            task.ContinueWith((x, state) =>\n            {\n                var p = (UniTaskCompletionSource<T>)state;\n\n                switch (x.Status)\n                {\n                    case TaskStatus.Canceled:\n                        p.TrySetCanceled();\n                        break;\n                    case TaskStatus.Faulted:\n                        p.TrySetException(x.Exception);\n                        break;\n                    case TaskStatus.RanToCompletion:\n                        p.TrySetResult(x.Result);\n                        break;\n                    default:\n                        throw new NotSupportedException();\n                }\n            }, promise, useCurrentSynchronizationContext ? TaskScheduler.FromCurrentSynchronizationContext() : TaskScheduler.Current);\n\n            return promise.Task;\n        }", "docstring": "/// <summary>\n/// Convert Task[T] -> UniTask[T].\n/// </summary>", "url": "https://github.com/MMMaellon/SmartObjectSync/blob/f600f5a5df125ac4e01d35c43ed60d0d2b3c0594/Packages/com.vrchat.base/Runtime/VRCSDK/Plugins/UniTask/Runtime/UniTaskExtensions.cs#L17-L42", "sha": "f600f5a5df125ac4e01d35c43ed60d0d2b3c0594"}418{"repo_name": "SmartObjectSync", "dataset": "github_2023", "owner": "MMMaellon", "lang": "csharp", "func_name": "UnityBindingExtensions.BindTo", "code": "public static void BindTo<TSource, TObject>(this IUniTaskAsyncEnumerable<TSource> source, TObject monoBehaviour, Action<TObject, TSource> bindAction, bool rebindOnError = true)\n            where TObject : MonoBehaviour\n        {\n            BindToCore(source, monoBehaviour, bindAction, monoBehaviour.GetCancellationTokenOnDestroy(), rebindOnError).Forget();\n        }", "docstring": "// <T> -> Action", "url": "https://github.com/MMMaellon/SmartObjectSync/blob/f600f5a5df125ac4e01d35c43ed60d0d2b3c0594/Packages/com.vrchat.base/Runtime/VRCSDK/Plugins/UniTask/Runtime/UnityBindingExtensions.cs#L190-L194", "sha": "f600f5a5df125ac4e01d35c43ed60d0d2b3c0594"}419{"repo_name": "SmartObjectSync", "dataset": "github_2023", "owner": "MMMaellon", "lang": "csharp", "func_name": "AsyncUniTaskVoid.GetStatus", "code": "UniTaskStatus IUniTaskSource.GetStatus(short token)\n        {\n            return UniTaskStatus.Pending;\n        }", "docstring": "// dummy interface implementation for TaskTracker.", "url": "https://github.com/MMMaellon/SmartObjectSync/blob/f600f5a5df125ac4e01d35c43ed60d0d2b3c0594/Packages/com.vrchat.base/Runtime/VRCSDK/Plugins/UniTask/Runtime/CompilerServices/StateMachineRunner.cs#L109-L112", "sha": "f600f5a5df125ac4e01d35c43ed60d0d2b3c0594"}420{"repo_name": "SmartObjectSync", "dataset": "github_2023", "owner": "MMMaellon", "lang": "csharp", "func_name": "WeakGenericCollectionFormatter.GetUninitializedObject", "code": "protected override object GetUninitializedObject()\n        {\n            return Activator.CreateInstance(this.SerializedType);\n        }", "docstring": "/// <summary>\n/// Gets a new object of type <see cref=\"T\" />.\n/// </summary>\n/// <returns>\n/// A new object of type <see cref=\"T\" />.\n/// </returns>", "url": "https://github.com/MMMaellon/SmartObjectSync/blob/f600f5a5df125ac4e01d35c43ed60d0d2b3c0594/Packages/com.vrchat.worlds/Runtime/Udon/Serialization/OdinSerializer/Core/Formatters/GenericCollectionFormatter.cs#L229-L232", "sha": "f600f5a5df125ac4e01d35c43ed60d0d2b3c0594"}421{"repo_name": "SmartObjectSync", "dataset": "github_2023", "owner": "MMMaellon", "lang": "csharp", "func_name": "MethodInfoFormatter.DeserializeImplementation", "code": "protected override void DeserializeImplementation(ref T value, IDataReader reader)\n        {\n            #if false //vrc security patch \n            string name;\n            EntryType entry;\n\n            entry = reader.PeekEntry(out name);\n\n            if (entry == EntryType.StartOfArray)\n            {\n                // We have legacy ISerializable data for the MethodInfo, since in no case will data written by this formatter ever start with an array.\n                // In this case, get the proper legacy formatter for this type and read the data using that.\n\n                IFormatter serializableFormatter;\n                serializableFormatter = new WeakSerializableFormatter(typeof(T));\n                value = (T)(object)serializableFormatter.Deserialize(reader);\n                return;\n            }\n\n            Type declaringType = null;\n            string methodName = null;\n            Type[] signature = null;\n            Type[] genericArguments = null;\n\n            while ((entry = reader.PeekEntry(out name)) != EntryType.EndOfNode && entry != EntryType.EndOfArray && entry != EntryType.EndOfStream)\n            {\n                switch (name)\n                {\n                    case \"declaringType\":\n                        {\n                            var t = TypeSerializer.ReadValue(reader);\n\n                            if (t != null)\n                            {\n                                declaringType = t;\n                            }\n                        }\n                        break;\n\n                    case \"methodName\":\n                        {\n                            methodName = StringSerializer.ReadValue(reader);\n                        }\n                        break;\n\n                    case \"signature\":\n                        {\n                            signature = TypeArraySerializer.ReadValue(reader);\n                        }\n                        break;\n\n                    case \"genericArguments\":\n                        {\n                            genericArguments = TypeArraySerializer.ReadValue(reader);\n                        }\n                        break;\n\n                    default:\n                        reader.SkipEntry();\n                        break;\n                }\n            }\n\n            if (declaringType == null)\n            {\n                reader.Context.Config.DebugContext.LogWarning(\"Missing declaring type of MethodInfo on deserialize.\");\n                return;\n            }\n\n            if (methodName == null)\n            {\n                reader.Context.Config.DebugContext.LogError(\"Missing method name of MethodInfo on deserialize.\");\n                return;\n            }\n\n            MethodInfo methodInfo;\n            bool useSignature = false;\n            bool wasAmbiguous = false;\n\n            if (signature != null)\n            {\n                useSignature = true;\n\n                for (int i = 0; i < signature.Length; i++)\n                {\n                    if (signature[i] == null)\n                    {\n                        useSignature = false;\n                        break;\n                    }\n                }\n            }\n\n            if (useSignature)\n            {\n                try\n                {\n                    methodInfo = declaringType.GetMethod(methodName, Flags.AllMembers, null, signature, null);\n                }\n                catch (AmbiguousMatchException)\n                {\n                    methodInfo = null;\n                    wasAmbiguous = true;\n                }\n            }\n            else\n            {\n                try\n                {\n                    methodInfo = declaringType.GetMethod(methodName, Flags.AllMembers);\n                }\n                catch (AmbiguousMatchException)\n                {\n                    methodInfo = null;\n                    wasAmbiguous = true;\n                }\n            }\n\n            if (methodInfo == null)\n            {\n                if (useSignature)\n                {\n                    reader.Context.Config.DebugContext.LogWarning(\"Could not find method with signature \" + name + \"(\" + string.Join(\", \", signature.Select(p => p.GetNiceFullName()).ToArray()) + \") on type '\" + declaringType.FullName + (wasAmbiguous ? \"; resolution was ambiguous between multiple methods\" : string.Empty) + \".\");\n                }\n                else\n                {\n                    reader.Context.Config.DebugContext.LogWarning(\"Could not find method with name \" + name + \" on type '\" + declaringType.GetNiceFullName() + (wasAmbiguous ? \"; resolution was ambiguous between multiple methods\" : string.Empty) + \".\");\n                }\n\n                return;\n            }\n\n            if (methodInfo.IsGenericMethodDefinition)\n            {\n                if (genericArguments == null)\n                {\n                    reader.Context.Config.DebugContext.LogWarning(\"Method '\" + declaringType.GetNiceFullName() + \".\" + methodInfo.GetNiceName() + \"' to deserialize is a generic method definition, but no generic arguments were in the serialization data.\");\n                    return;\n                }\n\n                int argCount = methodInfo.GetGenericArguments().Length;\n\n                if (genericArguments.Length != argCount)\n                {\n                    reader.Context.Config.DebugContext.LogWarning(\"Method '\" + declaringType.GetNiceFullName() + \".\" + methodInfo.GetNiceName() + \"' to deserialize is a generic method definition, but there is the wrong number of generic arguments in the serialization data.\");\n                    return;\n                }\n\n                for (int i = 0; i < genericArguments.Length; i++)\n                {\n                    if (genericArguments[i] == null)\n                    {\n                        reader.Context.Config.DebugContext.LogWarning(\"Method '\" + declaringType.GetNiceFullName() + \".\" + methodInfo.GetNiceName() + \"' to deserialize is a generic method definition, but one of the serialized generic argument types failed to bind on deserialization.\");\n                        return;\n                    }\n                }\n\n                try\n                {\n                    methodInfo = methodInfo.MakeGenericMethod(genericArguments);\n                }\n                catch (Exception ex)\n                {\n                    reader.Context.Config.DebugContext.LogWarning(\"Method '\" + declaringType.GetNiceFullName() + \".\" + methodInfo.GetNiceName() + \"' to deserialize is a generic method definition, but failed to create generic method from definition, using generic arguments '\" + string.Join(\", \", genericArguments.Select(p => p.GetNiceFullName()).ToArray()) + \"'. Method creation failed with an exception of type \" + ex.GetType().GetNiceFullName() + \", with the message: \" + ex.Message);\n                    return;\n                }\n            }\n\n            try\n            {\n                value = (T)methodInfo;\n            }\n            catch (InvalidCastException)\n            {\n                reader.Context.Config.DebugContext.LogWarning(\"The serialized method '\" + declaringType.GetNiceFullName() + \".\" + methodInfo.GetNiceName() + \"' was successfully resolved into a MethodInfo reference of the runtime type '\" + methodInfo.GetType().GetNiceFullName() + \"', but failed to be cast to expected type '\" + typeof(T).GetNiceFullName() + \"'.\");\n                return;\n            }\n\n            this.RegisterReferenceID(value, reader);\n            #endif\n            reader.Context.Config.DebugContext.LogWarning(\"MethodInfo deserialization has been removed for security.\"); //VRC\n        }", "docstring": "/// <summary>\n/// Provides the actual implementation for deserializing a value of type <see cref=\"!:T\" />.\n/// </summary>\n/// <param name=\"value\">The uninitialized value to serialize into. This value will have been created earlier using <see cref=\"M:OdinSerializer.BaseFormatter`1.GetUninitializedObject\" />.</param>\n/// <param name=\"reader\">The reader to deserialize with.</param>", "url": "https://github.com/MMMaellon/SmartObjectSync/blob/f600f5a5df125ac4e01d35c43ed60d0d2b3c0594/Packages/com.vrchat.worlds/Runtime/Udon/Serialization/OdinSerializer/Core/Formatters/MethodInfoFormatter.cs#L46-L227", "sha": "f600f5a5df125ac4e01d35c43ed60d0d2b3c0594"}422{"repo_name": "SmartObjectSync", "dataset": "github_2023", "owner": "MMMaellon", "lang": "csharp", "func_name": "PrefabDeserializeUtility.GetSceneObjectsToKeepSet", "code": "public static HashSet<object> GetSceneObjectsToKeepSet(UnityEngine.Object unityObject, bool createIfDoesntExist)\n            {\n                HashSet<object> keep;\n\n                if (!SceneObjectsToKeepOnApply.TryGetValue(unityObject, out keep))\n                {\n                    keep = new HashSet<object>(ReferenceEqualityComparer<object>.Default);\n                    SceneObjectsToKeepOnApply.Add(unityObject, keep);\n                }\n\n                return keep;\n            }", "docstring": "/// <summary>\n/// Note: it is assumed that code calling this is holding the DeserializePrefabCaches_LOCK lock, and will continue to hold it while the returned hashset is being modified\n/// </summary>", "url": "https://github.com/MMMaellon/SmartObjectSync/blob/f600f5a5df125ac4e01d35c43ed60d0d2b3c0594/Packages/com.vrchat.worlds/Runtime/Udon/Serialization/OdinSerializer/Unity Integration/UnitySerializationUtility.cs#L137-L148", "sha": "f600f5a5df125ac4e01d35c43ed60d0d2b3c0594"}423{"repo_name": "CFScanner", "dataset": "github_2023", "owner": "MortezaBashsiz", "lang": "csharp", "func_name": "CustomConfigInfo.isDefaultConfig", "code": "public bool isDefaultConfig()\n        {\n            return fileName == content && content == \"Default\";\n        }", "docstring": "// is default config?", "url": "https://github.com/MortezaBashsiz/CFScanner/blob/bcb96dd437e9cf90350ee5581df613b92380827f/windows/Classes/Config/CustomConfigs.cs#L115-L118", "sha": "bcb96dd437e9cf90350ee5581df613b92380827f"}424{"repo_name": "CFScanner", "dataset": "github_2023", "owner": "MortezaBashsiz", "lang": "csharp", "func_name": "ScanResults.load", "code": "public bool load()\n        {\n            try\n            {\n                if (!File.Exists(resultsFileName))\n                {\n                    return false;\n                }\n\n                string jsonString = File.ReadAllText(resultsFileName);\n                loadedInstance = JsonSerializer.Deserialize<ScanResults>(jsonString)!;\n\n            }\n            catch (Exception ex)\n            {\n                Tools.logStep($\"ScanResults.load() had exception: {ex.Message}\");\n                return false;\n            }\n\n            return true;\n        }", "docstring": "// load app config", "url": "https://github.com/MortezaBashsiz/CFScanner/blob/bcb96dd437e9cf90350ee5581df613b92380827f/windows/Classes/Config/ScanResults.cs#L45-L65", "sha": "bcb96dd437e9cf90350ee5581df613b92380827f"}425{"repo_name": "FluentStorage", "dataset": "github_2023", "owner": "robinrodricks", "lang": "csharp", "func_name": "FtpFixture.InitializeAsync", "code": "public async Task InitializeAsync() {\n\t\t\tawait FtpContainer.StartAsync().ConfigureAwait(false);\n\t\t}", "docstring": "///<inheritdoc/>", "url": "https://github.com/robinrodricks/FluentStorage/blob/7bac0df391a5d8df1abe19d965e2e9b476aa37e5/FluentStorage.Tests.FTP/FtpFixture.cs#L55-L57", "sha": "7bac0df391a5d8df1abe19d965e2e9b476aa37e5"}426{"repo_name": "FluentStorage", "dataset": "github_2023", "owner": "robinrodricks", "lang": "csharp", "func_name": "GenericValidation.CheckBlobPrefix", "code": "public static void CheckBlobPrefix(string prefix) {\n\t\t\tif (prefix == null) return;\n\n\t\t\tstring[] parts = prefix.Split('/');\n\n\t\t\tforeach (string part in parts) {\n\t\t\t\tif (part.Length > MaxBlobPrefixLength)\n\t\t\t\t\tthrow new ArgumentException(\n\t\t\t\t\t   string.Format(\"blob prefix cannot exceed {0} characters\", MaxBlobPrefixLength),\n\t\t\t\t\t   nameof(prefix));\n\t\t\t}\n\t\t}", "docstring": "/// <summary>\n/// Validates blob prefix search\n/// </summary>\n/// <param name=\"prefix\"></param>", "url": "https://github.com/robinrodricks/FluentStorage/blob/7bac0df391a5d8df1abe19d965e2e9b476aa37e5/FluentStorage/GenericValidation.cs#L18-L29", "sha": "7bac0df391a5d8df1abe19d965e2e9b476aa37e5"}427{"repo_name": "ThrottlingTroll", "dataset": "github_2023", "owner": "ThrottlingTroll", "lang": "csharp", "func_name": "ThrottlingTrollExtensions.UseThrottlingTroll", "code": "public static IApplicationBuilder UseThrottlingTroll(this IApplicationBuilder builder, Action<ThrottlingTrollOptions> options = null)\n        {\n            // Need to create this instance here, so that Assemblies are correctly initialized.\n            var opt = new ThrottlingTrollOptions\n            {\n                Assemblies = new List<Assembly> { Assembly.GetCallingAssembly() }\n            };\n\n            if (options != null)\n            {\n                options(opt);\n            }\n\n            opt.GetConfigFunc = ThrottlingTrollCoreExtensions.MergeAllConfigSources(opt.Config, CollectDeclarativeConfig(opt.Assemblies), opt.GetConfigFunc, builder.ApplicationServices);\n\n            if (opt.Log == null)\n            {\n                var logger = builder.ApplicationServices.GetService<ILogger<ThrottlingTroll>>();\n                opt.Log = logger == null ? null : (l, s) => logger.Log(l, s);\n            }\n\n            // TODO: move default counter store creation into ThrottlingTroll\n            opt.CounterStore ??= builder.ApplicationServices.GetService<ICounterStore>() ?? new MemoryCacheCounterStore();\n\n            return builder.UseMiddleware<ThrottlingTrollMiddleware>(opt);\n        }", "docstring": "/// <summary>\n/// Configures ThrottlingTroll ingress throttling\n/// </summary>", "url": "https://github.com/ThrottlingTroll/ThrottlingTroll/blob/ae518fcb7b4a24633a806f389599e68457ff05fe/ThrottlingTroll.AspNet/ThrottlingTrollExtensions.cs#L24-L49", "sha": "ae518fcb7b4a24633a806f389599e68457ff05fe"}428{"repo_name": "ThrottlingTroll", "dataset": "github_2023", "owner": "ThrottlingTroll", "lang": "csharp", "func_name": "ThrottlingTrollHandlerExtensions.AddThrottlingTrollMessageHandler", "code": "public static IHttpClientBuilder AddThrottlingTrollMessageHandler(this IHttpClientBuilder builder, Action<ThrottlingTrollOptions> options = null)\n        {\n            return builder.AddThrottlingTrollMessageHandler(options == null ? null : (provider, opt) => options(opt));\n        }", "docstring": "/// <summary>\n/// Appends <see cref=\"ThrottlingTrollHandler\"/> to the given HttpClient.\n/// Optionally allows to configure options.\n/// </summary>", "url": "https://github.com/ThrottlingTroll/ThrottlingTroll/blob/ae518fcb7b4a24633a806f389599e68457ff05fe/ThrottlingTroll.Core/ThrottlingTrollHandler.cs#L533-L536", "sha": "ae518fcb7b4a24633a806f389599e68457ff05fe"}429{"repo_name": "VRTRAKILL", "dataset": "github_2023", "owner": "whateverusername0", "lang": "csharp", "func_name": "HapticRack.Awake", "code": "void Awake()\n\t\t{\n\t\t\tif ( linearMapping == null )\n\t\t\t{\n\t\t\t\tlinearMapping = GetComponent<LinearMapping>();\n\t\t\t}\n\t\t}", "docstring": "//-------------------------------------------------", "url": "https://github.com/whateverusername0/VRTRAKILL/blob/74dd472bf13baf273a8e2793712174050ff415be/VRTRAKILL.Plugin/New Unity Project/Assets/SteamVR/InteractionSystem/Core/Scripts/HapticRack.cs#L36-L42", "sha": "74dd472bf13baf273a8e2793712174050ff415be"}430{"repo_name": "VRTRAKILL", "dataset": "github_2023", "owner": "whateverusername0", "lang": "csharp", "func_name": "LinearAnimator.Awake", "code": "void Awake()\n\t\t{\n\t\t\tif ( animator == null )\n\t\t\t{\n\t\t\t\tanimator = GetComponent<Animator>();\n\t\t\t}\n\n\t\t\tanimator.speed = 0.0f;\n\n\t\t\tif ( linearMapping == null )\n\t\t\t{\n\t\t\t\tlinearMapping = GetComponent<LinearMapping>();\n\t\t\t}\n\t\t}", "docstring": "//-------------------------------------------------", "url": "https://github.com/whateverusername0/VRTRAKILL/blob/74dd472bf13baf273a8e2793712174050ff415be/VRTRAKILL.Plugin/New Unity Project/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearAnimator.cs#L23-L36", "sha": "74dd472bf13baf273a8e2793712174050ff415be"}431{"repo_name": "VRTRAKILL", "dataset": "github_2023", "owner": "whateverusername0", "lang": "csharp", "func_name": "SoundPlayOneshot.Awake", "code": "void Awake()\n\t\t{\n\t\t\tthisAudioSource = GetComponent<AudioSource>();\n\n\t\t\tif ( playOnAwake )\n\t\t\t{\n\t\t\t\tPlay();\n\t\t\t}\n\t\t}", "docstring": "//-------------------------------------------------", "url": "https://github.com/whateverusername0/VRTRAKILL/blob/74dd472bf13baf273a8e2793712174050ff415be/VRTRAKILL.Plugin/New Unity Project/Assets/SteamVR/InteractionSystem/Core/Scripts/SoundPlayOneshot.cs#L28-L36", "sha": "74dd472bf13baf273a8e2793712174050ff415be"}432{"repo_name": "VRTRAKILL", "dataset": "github_2023", "owner": "whateverusername0", "lang": "csharp", "func_name": "ArrowHand.Awake", "code": "void Awake()\n\t\t{\n\t\t\tallowTeleport = GetComponent<AllowTeleportWhileAttachedToHand>();\n\t\t\t//allowTeleport.teleportAllowed = true;\n\t\t\tallowTeleport.overrideHoverLock = false;\n\n\t\t\tarrowList = new List<GameObject>();\n\t\t}", "docstring": "//-------------------------------------------------", "url": "https://github.com/whateverusername0/VRTRAKILL/blob/74dd472bf13baf273a8e2793712174050ff415be/VRTRAKILL.Plugin/New Unity Project/Assets/SteamVR/InteractionSystem/Longbow/Scripts/ArrowHand.cs#L46-L53", "sha": "74dd472bf13baf273a8e2793712174050ff415be"}433{"repo_name": "VRTRAKILL", "dataset": "github_2023", "owner": "whateverusername0", "lang": "csharp", "func_name": "PlatformerMovementP.Update", "code": "[HarmonyPrefix] [HarmonyPatch(nameof(PlatformerMovement.Update))] static bool Update(PlatformerMovement __instance)\n        {\n            if (MonoSingleton<OptionsManager>.Instance.paused) return false;\n\n            Vector2 vector = Vector2.zero;\n            if (__instance.activated)\n            {\n                vector = Input.InputVars.MoveVector * Vars.Config.MovementMultiplier;\n                __instance.movementDirection = Vector3.ClampMagnitude(vector.x * Vector3.right + vector.y * Vector3.forward, 1f);\n                __instance.movementDirection = Quaternion.Euler(0f, __instance.platformerCamera.rotation.eulerAngles.y, 0f) * __instance.movementDirection;\n            }\n            else\n            {\n                __instance.rb.velocity = new Vector3(0f, __instance.rb.velocity.y, 0f);\n                __instance.movementDirection = Vector3.zero;\n            }\n\n            if (__instance.movementDirection.magnitude > 0f) __instance.anim.SetBool(\"Running\", true);\n            else __instance.anim.SetBool(\"Running\", false);\n\n            if (__instance.rb.velocity.y < -100f)\n                __instance.rb.velocity = new Vector3(__instance.rb.velocity.x, -100f, __instance.rb.velocity.z);\n\n            if (__instance.activated && MonoSingleton<InputManager>.Instance.InputSource.Jump.WasPerformedThisFrame\n                && !__instance.falling && !__instance.jumpCooldown) __instance.Jump(false, 1f);\n\n            if (!__instance.groundCheck.onGround)\n            {\n                if (__instance.fallTime < 1f)\n                {\n                    __instance.fallTime += Time.deltaTime * 5f;\n                    if (__instance.fallTime > 1f) __instance.falling = true;\n                }\n                else if (__instance.rb.velocity.y < -2f) __instance.fallSpeed = __instance.rb.velocity.y;\n            }\n            else __instance.fallTime = 0f;\n\n            if (__instance.groundCheck.onGround && __instance.falling && !__instance.jumpCooldown)\n            {\n                __instance.falling = false;\n                __instance.fallSpeed = 0f;\n                __instance.groundCheck.heavyFall = false;\n            }\n\n            if (MonoSingleton<InputManager>.Instance.InputSource.Slide.WasPerformedThisFrame && __instance.groundCheck.onGround\n                && __instance.activated && !__instance.sliding) __instance.StartSlide();\n\n            RaycastHit raycastHit;\n            if (MonoSingleton<InputManager>.Instance.InputSource.Slide.WasPerformedThisFrame\n                && !__instance.groundCheck.onGround && !__instance.sliding && !__instance.jumping && __instance.activated\n                && Physics.Raycast(__instance.groundCheck.transform.position + __instance.transform.up, __instance.transform.up * -1f, out raycastHit, 2f,\n                LayerMaskDefaults.Get(LMD.Environment))) __instance.StartSlide();\n\n            if (MonoSingleton<InputManager>.Instance.InputSource.Slide.WasCanceledThisFrame && __instance.sliding)\n                __instance.StopSlide();\n\n            if (__instance.sliding && __instance.activated)\n            {\n                __instance.slideLength += Time.deltaTime;\n                if (__instance.currentSlideEffect != null) __instance.currentSlideEffect.transform.position = __instance.transform.position + __instance.dodgeDirection * 10f;\n                if (__instance.slideSafety > 0f) __instance.slideSafety -= Time.deltaTime * 5f;\n                if (__instance.groundCheck.onGround) __instance.currentSlideScrape.transform.position = __instance.transform.position + __instance.dodgeDirection;\n                else __instance.currentSlideScrape.transform.position = Vector3.one * 5000f;\n            }\n\n            // Dash fix\n            if (MonoSingleton<InputManager>.Instance.InputSource.Dodge.WasPerformedThisFrame && __instance.activated)\n            {\n                if (__instance.groundProperties && !__instance.groundProperties.canDash)\n                    if (!__instance.groundProperties.silentDashFail) Object.Instantiate<GameObject>(__instance.staminaFailSound);\n                /* else */ if (__instance.boostCharge >= 100f)\n                {\n                    if (__instance.sliding) __instance.StopSlide();\n                    __instance.boostLeft = 100f;\n                    __instance.boost = true;\n                    __instance.anim.Play(\"Dash\", -1, 0f);\n\n                    __instance.dodgeDirection = __instance.movementDirection.normalized * Vars.Config.MovementMultiplier;\n                    if (__instance.dodgeDirection == Vector3.zero)\n                        __instance.dodgeDirection = __instance.playerModel.forward * Vars.Config.MovementMultiplier;\n\n                    Quaternion identity = Quaternion.identity;\n                    identity.SetLookRotation(__instance.dodgeDirection * -1f);\n                    Object.Instantiate<GameObject>\n                            (__instance.dodgeParticle, __instance.transform.position + Vector3.up * 2f + __instance.dodgeDirection * 10f, identity).transform.localScale *= 2f;\n                    if (!MonoSingleton<AssistController>.Instance.majorEnabled || !MonoSingleton<AssistController>.Instance.infiniteStamina)\n                        __instance.boostCharge -= 100f;\n\n                    __instance.aud.clip = __instance.dodgeSound;\n                    __instance.aud.volume = 1f;\n                    __instance.aud.pitch = 1f;\n                    __instance.aud.Play();\n                }\n                else Object.Instantiate<GameObject>(__instance.staminaFailSound);\n            }\n\n            if (__instance.boostCharge != 300f && !__instance.sliding && !__instance.spinning)\n            {\n                float num = 1f;\n                if (__instance.difficulty == 1) num = 1.5f;\n                else if (__instance.difficulty == 0) num = 2f;\n\n                __instance.boostCharge = Mathf.MoveTowards(__instance.boostCharge, 300f, 70f * Time.deltaTime * num);\n            }\n\n            if (__instance.spinCooldown > 0f) __instance.spinCooldown = Mathf.MoveTowards(__instance.spinCooldown, 0f, Time.deltaTime);\n\n            if (__instance.activated && !__instance.spinning && __instance.spinCooldown <= 0f && !MonoSingleton<InputManager>.Instance.PerformingCheatMenuCombo()\n                && (MonoSingleton<InputManager>.Instance.InputSource.Fire1.WasPerformedThisFrame\n                || MonoSingleton<InputManager>.Instance.InputSource.Fire2.WasPerformedThisFrame\n                || MonoSingleton<InputManager>.Instance.InputSource.Punch.WasPerformedThisFrame)\n                && !MonoSingleton<OptionsManager>.Instance.paused) __instance.Spin();\n\n            if (__instance.spinning) __instance.playerModel.Rotate(Vector3.up, Time.deltaTime * 3600f, Space.Self);\n            else if (__instance.movementDirection.magnitude != 0f || __instance.boost)\n            {\n                Quaternion quaternion = Quaternion.LookRotation(__instance.movementDirection);\n                if (__instance.boost)\n                    quaternion = Quaternion.LookRotation(__instance.dodgeDirection);\n                __instance.playerModel.rotation =\n                    Quaternion.RotateTowards(__instance.playerModel.rotation, quaternion,\n                    (Quaternion.Angle(__instance.playerModel.rotation, quaternion) + 20f) * 35f * __instance.movementDirection.magnitude * Time.deltaTime);\n            }\n\n            if (__instance.cameraTrack)\n            {\n                if (!__instance.freeCamera)\n                {\n                    __instance.CheckCameraTarget(false);\n                    __instance.platformerCamera.transform.position =\n                        Vector3.MoveTowards(__instance.platformerCamera.position, __instance.transform.position + __instance.cameraTarget,\n                        Time.deltaTime * 15f * (0.1f + Vector3.Distance(__instance.platformerCamera.position, __instance.cameraTarget)));\n\n                    __instance.platformerCamera.transform.rotation =\n                        Quaternion.RotateTowards(__instance.platformerCamera.transform.rotation,\n                        Quaternion.Euler(__instance.cameraRotation), Time.deltaTime * 15f * (0.1f + Vector3.Distance(__instance.platformerCamera.rotation.eulerAngles,\n                        __instance.cameraRotation)));\n                }\n                else if (!MonoSingleton<OptionsManager>.Instance.paused)\n                {\n                    __instance.platformerCamera.transform.position = __instance.transform.position + __instance.defaultCameraTarget;\n                    __instance.platformerCamera.transform.rotation = Quaternion.Euler(__instance.defaultCameraRotation);\n\n                    Vector2 vector2 = MonoSingleton<InputManager>.Instance.InputSource.Look.ReadValue<Vector2>();\n                    if (!MonoSingleton<CameraController>.Instance.reverseY) __instance.rotationX += vector2.y * (MonoSingleton<OptionsManager>.Instance.mouseSensitivity / 10f);\n                    else __instance.rotationX -= vector2.y * (MonoSingleton<OptionsManager>.Instance.mouseSensitivity / 10f);\n\n                    if (!MonoSingleton<CameraController>.Instance.reverseX) __instance.rotationY += vector2.x * (MonoSingleton<OptionsManager>.Instance.mouseSensitivity / 10f);\n                    else __instance.rotationY -= vector2.x * (MonoSingleton<OptionsManager>.Instance.mouseSensitivity / 10f);\n\n                    if (__instance.rotationY > 180f) __instance.rotationY -= 360f;\n                    else if (__instance.rotationY < -180f) __instance.rotationY += 360f;\n\n                    __instance.rotationX = Mathf.Clamp(__instance.rotationX, -69f, 109f);\n\n                    float num2 = 2.5f;\n                    if (__instance.sliding || Physics.Raycast(__instance.transform.position + Vector3.up * 0.625f, Vector3.up, 2.5f, LayerMaskDefaults.Get(LMD.Environment)))\n                        num2 = 0.625f;\n\n                    Vector3 vector3 = __instance.transform.position + Vector3.up * num2;\n                    __instance.platformerCamera.RotateAround(vector3, Vector3.left, __instance.rotationX);\n                    __instance.platformerCamera.RotateAround(vector3, Vector3.up, __instance.rotationY);\n\n                    RaycastHit raycastHit2;\n                    if (Physics.SphereCast(vector3, 0.25f, __instance.platformerCamera.position - vector3, out raycastHit2,\n                        Vector3.Distance(vector3, __instance.platformerCamera.position), LayerMaskDefaults.Get(LMD.Environment)))\n                        __instance.platformerCamera.position = raycastHit2.point + 0.5f * raycastHit2.normal;\n                }\n            }\n\n            RaycastHit raycastHit3;\n            if (Physics.SphereCast(__instance.transform.position + Vector3.up, 0.5f, Vector3.down, out raycastHit3, float.PositiveInfinity,\n                LayerMaskDefaults.Get(LMD.Environment), QueryTriggerInteraction.Ignore))\n            {\n                __instance.jumpShadow.position = raycastHit3.point + Vector3.up * 0.05f;\n                __instance.jumpShadow.forward = raycastHit3.normal;\n            }\n            else\n            {\n                __instance.jumpShadow.position = __instance.transform.position - Vector3.up * 1000f;\n                __instance.jumpShadow.forward = Vector3.up;\n            }\n\n            if (__instance.coinTimer > 0f) __instance.coinTimer = Mathf.MoveTowards(__instance.coinTimer, 0f, Time.deltaTime);\n            if (__instance.coinEffectTimer > 0f) __instance.coinEffectTimer = Mathf.MoveTowards(__instance.coinEffectTimer, 0f, Time.deltaTime);\n            else if (__instance.queuedCoins > 0) __instance.CoinGetEffect();\n\n            if (__instance.invincible && __instance.extraHits < 3)\n            {\n                if (__instance.blinkTimer > 0f)\n                    __instance.blinkTimer = Mathf.MoveTowards(__instance.blinkTimer, 0f, Time.deltaTime);\n                else\n                {\n                    __instance.blinkTimer = 0.05f;\n                    if (__instance.playerModel.gameObject.activeSelf) __instance.playerModel.gameObject.SetActive(false);\n                    else __instance.playerModel.gameObject.SetActive(true);\n                }\n            }\n\n            if (__instance.superTimer > 0f)\n            {\n                if (!NoWeaponCooldown.NoCooldown) __instance.superTimer = Mathf.MoveTowards(__instance.superTimer, 0f, Time.deltaTime);\n                if (__instance.superTimer == 0f) __instance.GetHit();\n            }\n\n            return false;\n        }", "docstring": "// change movement vector to vr one", "url": "https://github.com/whateverusername0/VRTRAKILL/blob/74dd472bf13baf273a8e2793712174050ff415be/VRTRAKILL.Plugin/Plugin/ULTRAKILL/Movement/Patches/PlatformerMovementP.cs#L12-L218", "sha": "74dd472bf13baf273a8e2793712174050ff415be"}434{"repo_name": "VRTRAKILL", "dataset": "github_2023", "owner": "whateverusername0", "lang": "csharp", "func_name": "HUDOptionsP.FlashImageTweak", "code": "[HarmonyPostfix] [HarmonyPatch(typeof(FlashImage), nameof(FlashImage.Flash))] static void FlashImageTweak(FlashImage __instance)\n        {\n            if (__instance.gameObject.name.Contains(\"White\") || __instance.gameObject.name.Contains(\"Black\"))\n                __instance.transform.localScale *= 20;\n        }", "docstring": "/// <summary>\n///     Fuck you\n/// </summary>", "url": "https://github.com/whateverusername0/VRTRAKILL/blob/74dd472bf13baf273a8e2793712174050ff415be/VRTRAKILL.Plugin/Plugin/ULTRAKILL/UI/Patches/HUDOptionsP.cs#L70-L74", "sha": "74dd472bf13baf273a8e2793712174050ff415be"}435{"repo_name": "Bloatynosy", "dataset": "github_2023", "owner": "builtbybel", "lang": "csharp", "func_name": "ExperienceView.CreateRoundRectRgn", "code": "[System.Runtime.InteropServices.DllImport(\"gdi32.dll\")]\n        private static extern IntPtr CreateRoundRectRgn(int nLeftRect, int nTopRect, int nRightRect, int nBottomRect, int nWidthEllipse, int nHeightEllipse);", "docstring": "// Import rounded corners", "url": "https://github.com/builtbybel/Bloatynosy/blob/48d27896be3557e1878094b86362514b8ab6cbca/src/Bloatynosy/Views/ExperienceView.cs#L137-L138", "sha": "48d27896be3557e1878094b86362514b8ab6cbca"}436{"repo_name": "Ursa.Avalonia", "dataset": "github_2023", "owner": "irihitech", "lang": "csharp", "func_name": "CalendarView.OnHeaderButtonClick", "code": "private void OnHeaderButtonClick(object? sender, RoutedEventArgs e)\n    {\n        // Header button should be hidden in Month mode.\n        if (Mode == CalendarViewMode.Month) return;\n        if (Mode == CalendarViewMode.Year)\n        {\n            Mode = CalendarViewMode.Decade;\n            var range = DateTimeHelper.GetDecadeViewRangeByYear(ContextDate.Year!.Value);\n            _dateContextSyncing = true;\n            ContextDate =  ContextDate.With(startYear: range.start, endYear: range.end);\n            _dateContextSyncing = false;\n            UpdateYearButtons();\n            return;\n        }\n\n        if (Mode == CalendarViewMode.Decade)\n        {\n            Mode = CalendarViewMode.Century;\n            var range = DateTimeHelper.GetCenturyViewRangeByYear(ContextDate.StartYear!.Value);\n            _dateContextSyncing = true;\n            ContextDate = ContextDate.With(startYear: range.start, endYear: range.end);\n            _dateContextSyncing = false;\n            UpdateYearButtons();\n        }\n    }", "docstring": "/// <summary>\n///     Rule:\n/// </summary>\n/// <param name=\"sender\"></param>\n/// <param name=\"e\"></param>", "url": "https://github.com/irihitech/Ursa.Avalonia/blob/ada538555472f8d623efda22a48c3d2ee7ed7e37/src/Ursa/Controls/DateTimePicker/CalendarView.cs#L246-L270", "sha": "ada538555472f8d623efda22a48c3d2ee7ed7e37"}437{"repo_name": "UnityFigmaBridge", "dataset": "github_2023", "owner": "simonoliver", "lang": "csharp", "func_name": "EffectManager.ApplyAllFigmaEffectsToUnityNode", "code": "public static void ApplyAllFigmaEffectsToUnityNode(GameObject nodeGameObject,Node node, \n            FigmaImportProcessData figmaImportProcessData)\n        {\n            foreach (var effect in node.effects) ApplyEffectToUnityNode(nodeGameObject,node,effect,figmaImportProcessData);\n            \n        }", "docstring": "/// <summary>\n/// Apply all effects to a given node\n/// </summary>\n/// <param name=\"nodeGameObject\"></param>\n/// <param name=\"node\"></param>\n/// <param name=\"figmaImportProcessData\"></param>", "url": "https://github.com/simonoliver/UnityFigmaBridge/blob/dbd12bff29e8bc84e2682bb19495899711651455/UnityFigmaBridge/Editor/Nodes/EffectManager.cs#L20-L25", "sha": "dbd12bff29e8bc84e2682bb19495899711651455"}438{"repo_name": "SubmersedVR", "dataset": "github_2023", "owner": "Okabintaro", "lang": "csharp", "func_name": "OffsetCalibrationTool.UnparentTarget", "code": "public void UnparentTarget(SteamVR_Action_Boolean fromAction, SteamVR_Input_Sources fromSource)\n        {\n            parent = target.parent;\n            Mod.logger.LogInfo($\"Unparenting {target.name}, remembering {parent.name}\");\n            target.SetParent(null, true);\n        }", "docstring": "// Unparent Target, so we can finetune the position", "url": "https://github.com/Okabintaro/SubmersedVR/blob/726867165cc602ba929477d1f02991fd1b1ded9a/SubmersedVR/VR/OffsetCalibrationTool.cs#L58-L63", "sha": "726867165cc602ba929477d1f02991fd1b1ded9a"}439{"repo_name": "devhome", "dataset": "github_2023", "owner": "microsoft", "lang": "csharp", "func_name": "CardProperty.ConvertMsResourceToIcon", "code": "public static unsafe BitmapImage ConvertMsResourceToIcon(Uri iconPathUri, string packageFullName)\n    {\n        try\n        {\n            var indirectPathToResource = \"@{\" + packageFullName + \"? \" + iconPathUri.AbsoluteUri + \"}\";\n            Span<char> outputBuffer = new char[MaxBufferLength];\n\n            fixed (char* outBufferPointer = outputBuffer)\n            {\n                fixed (char* resourcePathPointer = indirectPathToResource)\n                {\n                    var res = PInvoke.SHLoadIndirectString(resourcePathPointer, new PWSTR(outBufferPointer), (uint)outputBuffer.Length, null);\n                    if (res.Succeeded)\n                    {\n                        var iconImageLocation = new string(outputBuffer.TrimEnd('\\0'));\n\n                        if (File.Exists(iconImageLocation))\n                        {\n                            var bitmap = new BitmapImage();\n                            bitmap.UriSource = new Uri(iconImageLocation);\n                            return bitmap;\n                        }\n                    }\n\n                    Log.Error($\"Failed to find icon image in path: {iconPathUri} for package: {packageFullName} due to error: 0x{res.Value:X}\");\n                }\n            }\n        }\n        catch (Exception ex)\n        {\n            Log.Error(ex, $\"Failed to load icon from ms-resource: {iconPathUri} for package: {packageFullName} due to error:\");\n        }\n\n        return new BitmapImage();\n    }", "docstring": "/// <summary>\n/// Converts a passed in ms-resource URI and package full name to a BitmapImage.\n/// </summary>\n/// <param name=\"iconPathUri\">the ms-resource:// path to an image resource in an app packages pri file.</param>\n/// <returns>The bitmap image that represents the icon.</returns>", "url": "https://github.com/microsoft/devhome/blob/d52734ce0e33a82af3313d24c3c2979c37b68bab/common/Environments/Models/CardProperty.cs#L115-L149", "sha": "d52734ce0e33a82af3313d24c3c2979c37b68bab"}440{"repo_name": "devhome", "dataset": "github_2023", "owner": "microsoft", "lang": "csharp", "func_name": "ExperimentalFeaturesViewModel.IsFeaturePresent", "code": "private bool IsFeaturePresent(ExperimentalFeature experimentalFeature)\n    {\n        if (string.Equals(experimentalFeature.Id, \"FileExplorerSourceControlIntegration\", StringComparison.OrdinalIgnoreCase))\n        {\n            try\n            {\n                return ExtraFolderPropertiesWrapper.IsSupported();\n            }\n            catch (Exception)\n            {\n                return false;\n            }\n        }\n\n        throw new NotImplementedException();\n    }", "docstring": "/// <summary>\n/// Checks if the specified experimental feature is present on the machine.\n/// This method should be extended to handle new features by adding the corresponding\n/// feature check logic. If a feature is supported on the current machine, it should\n/// return false here.\n/// </summary>", "url": "https://github.com/microsoft/devhome/blob/d52734ce0e33a82af3313d24c3c2979c37b68bab/settings/DevHome.Settings/ViewModels/ExperimentalFeaturesViewModel.cs#L39-L54", "sha": "d52734ce0e33a82af3313d24c3c2979c37b68bab"}441{"repo_name": "devhome", "dataset": "github_2023", "owner": "microsoft", "lang": "csharp", "func_name": "TelemetryFactory.Get", "code": "public static T Get<T>()\n        where T : ITelemetry\n    {\n        return (T)(object)GetTelemetryInstance();\n    }", "docstring": "/// <summary>\n/// Gets a singleton instance of Telemetry\n/// This would be useful for the future when interfaces have been updated for logger like ITelemetry2, ITelemetry3 and so on", "url": "https://github.com/microsoft/devhome/blob/d52734ce0e33a82af3313d24c3c2979c37b68bab/telemetry/DevHome.Telemetry/TelemetryFactory.cs#L32-L36", "sha": "d52734ce0e33a82af3313d24c3c2979c37b68bab"}442{"repo_name": "devhome", "dataset": "github_2023", "owner": "microsoft", "lang": "csharp", "func_name": "TestSystems.ShutDownAsync", "code": "public IAsyncOperation<ComputeSystemOperationResult> ShutDownAsync(string options) => throw new NotImplementedException();", "docstring": "// Unimplemented APIs", "url": "https://github.com/microsoft/devhome/blob/d52734ce0e33a82af3313d24c3c2979c37b68bab/tools/Environments/DevHome.Environments/TestModels/TestSystems.cs#L123-L123", "sha": "d52734ce0e33a82af3313d24c3c2979c37b68bab"}443{"repo_name": "devhome", "dataset": "github_2023", "owner": "microsoft", "lang": "csharp", "func_name": "WindowsDriverExtensions.Wait", "code": "public static DefaultWait<WindowsDriver<WindowsElement>> Wait(\n        this WindowsDriver<WindowsElement> driver,\n        TimeSpan timeout,\n        TimeSpan pollingInterval)\n    {\n        return new(driver)\n        {\n            Timeout = timeout,\n            PollingInterval = pollingInterval,\n        };\n    }", "docstring": "/// <summary>\n/// Create an instance of <see cref=\"DefaultWait{T}\"/>\n/// </summary>\n/// <param name=\"driver\">Driver instance</param>\n/// <param name=\"timeout\">Wait timeout</param>\n/// <param name=\"pollingInterval\">Action interval</param>\n/// <returns>Instance of <see cref=\"DefaultWait{T}\"/></returns>", "url": "https://github.com/microsoft/devhome/blob/d52734ce0e33a82af3313d24c3c2979c37b68bab/uitest/Extensions/WindowsDriverExtensions.cs#L22-L32", "sha": "d52734ce0e33a82af3313d24c3c2979c37b68bab"}444{"repo_name": "whisper.net", "dataset": "github_2023", "owner": "sandrohanea", "lang": "csharp", "func_name": "Program.Main", "code": "public static async Task Main(string[] args)\n    {\n        // We declare for variables which we will use later, ggmlType, modelFileName, wavFileName and coreMlModelcName\n        var ggmlType = GgmlType.Base;\n        var modelFileName = \"ggml-base.bin\";\n        var wavFileName = \"kennedy.wav\";\n        var coreMlModelcName = \"ggml-base-encoder.mlmodelc\";\n\n        // This section detects whether the \"ggml-base.bin\" file exists in our project disk. If it doesn't, it downloads it from the internet\n        if (!File.Exists(modelFileName))\n        {\n            await DownloadModel(modelFileName, ggmlType);\n        }\n\n        // This sections detects whether the modelc directory (used by CoreML) is in out project disk. If it doesn't, it downloads it and extract it to the current folder.\n        if (!Directory.Exists(coreMlModelcName))\n        {\n            // Note: The modelc directory needs to be extracted at the same level as the \"ggml-base.bin\" file (and the current executable).\n            await WhisperGgmlDownloader.GetEncoderCoreMLModelAsync(ggmlType)\n                                       .ExtractToPath(\".\");\n        }\n\n        // Optional logging from the native library\n        \n        using var whisperLogger = LogProvider.AddLogger((level, message) =>\n        {\n            Console.Write($\"{level}: {message}\");\n        });\n\n        // This section creates the whisperFactory object which is used to create the processor object.\n        using var whisperFactory = WhisperFactory.FromPath(modelFileName);\n\n        // This section creates the processor object which is used to process the audio file, it uses language `auto` to detect the language of the audio file.\n        using var processor = whisperFactory.CreateBuilder()\n            .WithLanguage(\"auto\")\n            .Build();\n\n        using var fileStream = File.OpenRead(wavFileName);\n\n        // This section processes the audio file and prints the results (start time, end time and text) to the console.\n        await foreach (var result in processor.ProcessAsync(fileStream))\n        {\n            Console.WriteLine($\"{result.Start}->{result.End}: {result.Text}\");\n        }\n    }", "docstring": "// This examples shows how to use Whisper.net to create a transcription from an audio file with 16Khz sample rate, using CoreML", "url": "https://github.com/sandrohanea/whisper.net/blob/eae8f62164799288329b48c3cafd9644c295ed24/examples/CoreML/Program.cs#L13-L57", "sha": "eae8f62164799288329b48c3cafd9644c295ed24"}445{"repo_name": "whisper.net", "dataset": "github_2023", "owner": "sandrohanea", "lang": "csharp", "func_name": "Program.Main", "code": "public static async Task Main(string[] args)\n    {\n        // We declare three variables which we will use later, ggmlType, modelFileName and wavFileName\n        var ggmlType = GgmlType.LargeV3Turbo;\n        var modelFileName = \"ggml-largev3.bin\";\n        var wavFileName = \"kennedy.wav\";\n\n        using var whisperLogger = LogProvider.AddConsoleLogging(WhisperLogLevel.Debug);\n\n        // This section detects whether the \"ggml-largev3.bin\" file exists in our project disk. If it doesn't, it downloads it from the internet\n        if (!File.Exists(modelFileName))\n        {\n            await DownloadModel(modelFileName, ggmlType);\n        }\n\n        // This section creates the whisperFactory object which is used to create the processor object.\n        using var whisperFactory = WhisperFactory.FromPath(modelFileName);\n\n        // This section creates the processor object which is used to process the audio file, it uses language `auto` to detect the language of the audio file.\n        using var processor = whisperFactory.CreateBuilder()\n            .WithLanguage(\"auto\")\n            .Build();\n\n        using var fileStream = File.OpenRead(wavFileName);\n\n        // This section processes the audio file and prints the results (start time, end time and text) to the console.\n        await foreach (var result in processor.ProcessAsync(fileStream))\n        {\n            Console.WriteLine($\"{result.Start}->{result.End}: {result.Text}\");\n        }\n    }", "docstring": "// This examples shows how to use Whisper.net to create a transcription from an audio file with 16Khz sample rate.\n// It uses both Cuda (NVidia GPU) or CPU, and loads the first one that is available.", "url": "https://github.com/sandrohanea/whisper.net/blob/eae8f62164799288329b48c3cafd9644c295ed24/examples/Vulkan/Program.cs#L14-L44", "sha": "eae8f62164799288329b48c3cafd9644c295ed24"}446{"repo_name": "iMES-Factory", "dataset": "github_2023", "owner": "zmrid", "lang": "csharp", "func_name": "ServerExtension.MapPath", "code": "public static string MapPath(this string path)\n        {\n            return MapPath(path, false);\n        }", "docstring": "/// <summary>\n/// ่ฟ”ๅ›ž็š„่ทฏๅพ„ๅŽ้ขไธๅธฆ/๏ผŒๆ‹ผๆŽฅๆ—ถ้œ€่ฆ่‡ชๅทฑๅŠ ไธŠ/\n/// </summary>\n/// <param name=\"path\"></param>\n/// <returns></returns>", "url": "https://github.com/zmrid/iMES-Factory/blob/d301552bd0e953882ea0b2162c0e17b36dd3a2a9/iMES.Net/iMES.Core/Extensions/ServerExtension.cs#L16-L19", "sha": "d301552bd0e953882ea0b2162c0e17b36dd3a2a9"}447{"repo_name": "iMES-Factory", "dataset": "github_2023", "owner": "zmrid", "lang": "csharp", "func_name": "MailHelper.Send", "code": "public static void Send(string title, string content, params string[] list)\n        {\n            Console.WriteLine(AppSetting.GetSection(\"ModifyMember\")[\"DateUTCField\"]);\n            MailMessage message = new MailMessage\n            {\n                From = new MailAddress(address, name)//ๅ‘้€ไบบ้‚ฎ็ฎฑ\n            };\n            foreach (var item in list)\n            {\n                message.To.Add(item);//ๆ”ถไปถไบบๅœฐๅ€\n            }\n\n            message.Subject = title;//ๅ‘้€้‚ฎไปถ็š„ๆ ‡้ข˜\n\n            message.Body = content;//ๅ‘้€้‚ฎไปถ็š„ๅ†…ๅฎน\n            //้…็ฝฎsmtpๆœๅŠกๅœฐๅ€\n            SmtpClient client = new SmtpClient\n            {\n                Host = host,\n                Port = port,//็ซฏๅฃ587\n                EnableSsl = enableSsl,\n                //ๅ‘้€ไบบ้‚ฎ็ฎฑไธŽๆŽˆๆƒๅฏ†็ \n                Credentials = new NetworkCredential(address, authPwd)\n            };\n            client.Send(message);\n        }", "docstring": "/// <summary>\n/// ๅ‘้€้‚ฎไปถ\n/// </summary>\n/// <param name=\"title\">ๆ ‡้ข˜</param>\n/// <param name=\"content\">ๅ†…ๅฎน</param>\n/// <param name=\"list\">ๆ”ถไปถไบบ</param>", "url": "https://github.com/zmrid/iMES-Factory/blob/d301552bd0e953882ea0b2162c0e17b36dd3a2a9/iMES.Net/iMES.Core/Utilities/MailHelper.cs#L37-L62", "sha": "d301552bd0e953882ea0b2162c0e17b36dd3a2a9"}448{"repo_name": "iMES-Factory", "dataset": "github_2023", "owner": "zmrid", "lang": "csharp", "func_name": "WorkFlowManager.AddProcese", "code": "public static void AddProcese<T>(T entity, bool rewrite = false,bool changeTableStatus=true) where T:class\n        {\n            string workTable = typeof(T).GetEntityTableName();\n\n            Sys_WorkFlow workFlow = DBServerProvider.DbContext.Set<Sys_WorkFlow>()\n                .Where(x => x.WorkTable == workTable)\n                 .Include(x => x.Sys_WorkFlowStep)\n                .FirstOrDefault();\n\n            if (workFlow == null || workFlow.Sys_WorkFlowStep.Count == 0) return;\n            //้‡ๆ–ฐ็”Ÿๆˆๆต็จ‹\n            if (rewrite)\n            {\n                Rewrite(entity, workFlow,changeTableStatus);\n                return;\n            }\n\n            var userInfo = UserContext.Current.UserInfo;\n            Guid workFlowTable_Id = Guid.NewGuid();\n            Sys_WorkFlowTable workFlowTable = new Sys_WorkFlowTable()\n            {\n                WorkFlowTable_Id = workFlowTable_Id,\n                AuditStatus = (int)AuditStatus.ๅฎกๆ ธไธญ,\n                CurrentOrderId = 1,\n                Enable = 1,\n                WorkFlow_Id = workFlow.WorkFlow_Id,\n                WorkName = workFlow.WorkName,\n                WorkTable = workTable,\n                WorkTableKey = typeof(T).GetKeyProperty().GetValue(entity).ToString(),\n                WorkTableName = workFlow.WorkTableName,\n                CreateID = userInfo.User_Id,\n                CreateDate = DateTime.Now,\n                Creator = userInfo.UserTrueName,\n                Sys_WorkFlowTableStep = workFlow.Sys_WorkFlowStep.OrderBy(x => x.OrderId).Select(s => new Sys_WorkFlowTableStep()\n                {\n                    Sys_WorkFlowTableStep_Id = Guid.NewGuid(),\n                    WorkFlowTable_Id = workFlowTable_Id,\n                    WorkFlow_Id = s.WorkFlow_Id,\n                    StepId = s.StepId,\n                    StepName = s.StepName,\n                    AuditId = s.StepType == (int)AuditType.็”จๆˆทๅฎกๆ‰น ? s.StepValue : null,\n                    StepType = s.StepType,\n                    StepValue = s.StepValue,\n                    OrderId = s.OrderId,\n                    Enable = 1,\n                    CreateDate = DateTime.Now,\n                }).ToList()\n            };\n            DBServerProvider.DbContext.Set<Sys_WorkFlowTable>().Add(workFlowTable);\n            DBServerProvider.DbContext.SaveChanges();\n        }", "docstring": "/// <summary>\n/// ๅ†™ๅ…ฅๆต็จ‹\n/// </summary>\n/// <typeparam name=\"T\"></typeparam>\n/// <param name=\"entity\"></param>\n/// <param name=\"rewrite\">ๆ˜ฏๅฆ้‡ๆ–ฐ็”Ÿๆˆๆต็จ‹</param>\n/// <param name=\"changeTableStatus\">ๆ˜ฏๅฆไฟฎๆ”นๅŽŸ่กจ็š„ๅฎกๆ‰น็Šถๆ€</param>", "url": "https://github.com/zmrid/iMES-Factory/blob/d301552bd0e953882ea0b2162c0e17b36dd3a2a9/iMES.Net/iMES.Core/WorkFlow/WorkFlowManager.cs#L106-L156", "sha": "d301552bd0e953882ea0b2162c0e17b36dd3a2a9"}449{"repo_name": "shesha-framework", "dataset": "github_2023", "owner": "shesha-io", "lang": "csharp", "func_name": "FilterCriteria.AppendCriteria", "code": "public void AppendCriteria([NotNull]FilterCriteria criteria)\n        {\n            if (criteria.FilteringMethod != this.FilteringMethod)\n                throw new Exception(\"The filtering method used is incompatible and may cause problems due to differences in syntax.\");\n\n            FilterClauses.AddRange(criteria.FilterClauses);\n\n            foreach (var param in criteria.FilterParameters)\n            {\n                FilterParameters.Add(param.Key, param.Value);\n            }\n        }", "docstring": "/// <summary>\n/// Copies all the <paramref name=\"criteria\"/>'s FilterClauses and FilterParameters to this\n/// FilterCriteria.\n/// </summary>\n/// <param name=\"criteria\"></param>", "url": "https://github.com/shesha-io/shesha-framework/blob/bb69efce02d772f166ce621f6993a795f94c35df/shesha-core/src/Shesha.Framework/Domain/FilterCriteria.cs#L37-L48", "sha": "bb69efce02d772f166ce621f6993a795f94c35df"}450{"repo_name": "shesha-framework", "dataset": "github_2023", "owner": "shesha-io", "lang": "csharp", "func_name": "SwaggerOperationFilter.GetSingleAttributeOfMemberOrDeclaringTypeOrDefault", "code": "public static TAttribute GetSingleAttributeOfMemberOrDeclaringTypeOrDefault<TAttribute>(MemberInfo memberInfo, TAttribute defaultValue = default, bool inherit = true)\n            where TAttribute : class\n        {\n            return memberInfo.GetCustomAttributes(true).OfType<TAttribute>().FirstOrDefault()\n                   ?? memberInfo.ReflectedType?.GetTypeInfo().GetCustomAttributes(true).OfType<TAttribute>().FirstOrDefault()\n                   ?? defaultValue;\n        }", "docstring": "/// <summary>\n/// Copied from ABP\n/// Tries to gets an of attribute defined for a class member and it's declaring type including inherited attributes.\n/// Returns default value if it's not declared at all.\n/// </summary>\n/// <typeparam name=\"TAttribute\">Type of the attribute</typeparam>\n/// <param name=\"memberInfo\">MemberInfo</param>\n/// <param name=\"defaultValue\">Default value (null as default)</param>\n/// <param name=\"inherit\">Inherit attribute from base classes</param>", "url": "https://github.com/shesha-io/shesha-framework/blob/bb69efce02d772f166ce621f6993a795f94c35df/shesha-core/src/Shesha.Framework/Swagger/SwaggerOperationFilter.cs#L144-L150", "sha": "bb69efce02d772f166ce621f6993a795f94c35df"}451{"repo_name": "shesha-framework", "dataset": "github_2023", "owner": "shesha-io", "lang": "csharp", "func_name": "CodeNamingHelper.ValidateCodeIdentifier", "code": "public static void ValidateCodeIdentifier(string identifier)\n        {\n            if (!CSharpSyntaxHelper.IsValidIdentifier(identifier))\n                throw new IdentifierIsNotValidException(identifier);\n        }", "docstring": "/// <summary>\n/// Validate specified <paramref name=\"identifier\"/>, throws <see cref=\"IdentifierIsNotValidException\"/> if identifier is not valid\n/// </summary>\n/// <param name=\"identifier\"></param>\n/// <exception cref=\"IdentifierIsNotValidException\"></exception>", "url": "https://github.com/shesha-io/shesha-framework/blob/bb69efce02d772f166ce621f6993a795f94c35df/shesha-core/src/Shesha.Framework/Utilities/CodeNamingHelper.cs#L25-L29", "sha": "bb69efce02d772f166ce621f6993a795f94c35df"}452{"repo_name": "shesha-framework", "dataset": "github_2023", "owner": "shesha-io", "lang": "csharp", "func_name": "ModuleLocator.GetModuleName", "code": "public string GetModuleName(Type migrationType)\n        {\n            return migrationType.GetConfigurableModuleName();\n        }", "docstring": "/// inheritedDoc", "url": "https://github.com/shesha-io/shesha-framework/blob/bb69efce02d772f166ce621f6993a795f94c35df/shesha-core/src/Shesha.NHibernate/NHibernate/ModuleLocator.cs#L14-L17", "sha": "bb69efce02d772f166ce621f6993a795f94c35df"}453{"repo_name": "shesha-framework", "dataset": "github_2023", "owner": "shesha-io", "lang": "csharp", "func_name": "M20230516104216.Up", "code": "public override void Up()\n        {\n\n            Create.Table(\"SheshaFunctionalTests_Books\")\n             .WithIdAsGuid()\n             .WithFullAuditColumns()\n             .WithColumn(\"Frwk_Discriminator\").AsString(SheshaDatabaseConsts.DiscriminatorMaxSize).NotNullable()\n             .WithColumn(\"Name\").AsString().Nullable()\n             .WithColumn(\"Description\").AsString().Nullable()\n             .WithColumn(\"Price\").AsDecimal();\n\n\n            Create.Table(\"SheshaFunctionalTests_Schools\")\n             .WithIdAsGuid()\n             .WithFullAuditColumns()\n             .WithColumn(\"Frwk_Discriminator\").AsString(SheshaDatabaseConsts.DiscriminatorMaxSize).NotNullable()\n             .WithColumn(\"Name\").AsString().Nullable()\n             .WithColumn(\"Latitude\").AsDecimal().Nullable()\n             .WithColumn(\"Longitude\").AsDecimal()\n             .WithColumn(\"ContactNumber\").AsString().Nullable();\n\n\n            Create.Table(\"SheshaFunctionalTests_Subjects\")\n             .WithIdAsGuid()\n             .WithFullAuditColumns()\n             .WithColumn(\"Frwk_Discriminator\").AsString(SheshaDatabaseConsts.DiscriminatorMaxSize).NotNullable()\n             .WithColumn(\"Name\").AsString().Nullable()\n             .WithColumn(\"Description\").AsString().Nullable()\n             .WithColumn(\"Total\").AsDecimal().Nullable();\n\n\n            Alter.Table(\"SheshaFunctionalTests_Schools\").AddForeignKeyColumn(\"AddressId\", \"Core_Addresses\").Nullable();\n\n            Alter.Table(\"SheshaFunctionalTests_Schools\").AddForeignKeyColumn(\"HeadLeaderId\", \"Core_Persons\").Nullable();\n\n            Alter.Table(\"SheshaFunctionalTests_Subjects\").AddForeignKeyColumn(\"BookId\", \"SheshaFunctionalTests_Books\").Nullable();\n\n            Alter.Table(\"SheshaFunctionalTests_Subjects\").AddForeignKeyColumn(\"SchoolId\", \"SheshaFunctionalTests_Schools\").Nullable();\n\n        }", "docstring": "/// <summary>\n/// \n/// </summary>", "url": "https://github.com/shesha-io/shesha-framework/blob/bb69efce02d772f166ce621f6993a795f94c35df/shesha-functional-tests/backend/src/Module/Boxfusion.SheshaFunctionalTests.Common.Domain/Migrations/M20230516104216.cs#L14-L53", "sha": "bb69efce02d772f166ce621f6993a795f94c35df"}454{"repo_name": "shesha-framework", "dataset": "github_2023", "owner": "shesha-io", "lang": "csharp", "func_name": "M20240219144300.Up", "code": "public override void Up()\n        {\n            Alter.Table(\"SheshaFunctionalTests_MembershipPayments\").AddColumn(\"PaymentTypeLkp\").AsInt64().Nullable();\n        }", "docstring": "/// <summary>\n/// \n/// </summary>", "url": "https://github.com/shesha-io/shesha-framework/blob/bb69efce02d772f166ce621f6993a795f94c35df/shesha-functional-tests/backend/src/Module/Boxfusion.SheshaFunctionalTests.Common.Domain/Migrations/M20240219144300.cs#L14-L17", "sha": "bb69efce02d772f166ce621f6993a795f94c35df"}455{"repo_name": "g-helper", "dataset": "github_2023", "owner": "seerge", "lang": "csharp", "func_name": "AppConfig.SwappedBrightness", "code": "public static bool SwappedBrightness()\n    {\n        return ContainsModel(\"FA506IEB\") || ContainsModel(\"FA506IH\") || ContainsModel(\"FA506IC\") || ContainsModel(\"FX506LU\") || ContainsModel(\"FX506IC\") || ContainsModel(\"FX506LH\") || ContainsModel(\"FA506IV\") || ContainsModel(\"FA706IC\") || ContainsModel(\"FA706IH\");\n    }", "docstring": "// Devices with bugged bios command to change brightness", "url": "https://github.com/seerge/g-helper/blob/b5428ff2e8485e95a9ac29541dcb961337bd663c/app/AppConfig.cs#L408-L411", "sha": "b5428ff2e8485e95a9ac29541dcb961337bd663c"}456{"repo_name": "GDTask", "dataset": "github_2023", "owner": "Fractural", "lang": "csharp", "func_name": "GDTaskPlayerLoopAutoload.LocalAddContinuation", "code": "public void LocalAddContinuation(PlayerLoopTiming timing, Action continuation)\n        {\n            var q = yielders[(int)timing];\n            if (q == null)\n            {\n                ThrowInvalidLoopTiming(timing);\n            }\n            q.Enqueue(continuation);\n        }", "docstring": "// NOTE: Continuation means a asynchronous task invoked by another task after the other task finishes.", "url": "https://github.com/Fractural/GDTask/blob/661244bba9839c8633d2106457ef5be2faa228df/addons/GDTask/Autoload/GDTaskPlayerLoopAutoload.cs#L48-L56", "sha": "661244bba9839c8633d2106457ef5be2faa228df"}457{"repo_name": "minishop-composer", "dataset": "github_2023", "owner": "nichealpham", "lang": "csharp", "func_name": "EventFlags.MatchesWeekOfMonth", "code": "public static bool MatchesWeekOfMonth(this DateTime date, int recurrence)\n            => Matches(recurrence, 1 << (date.Day / 8));", "docstring": "// since day is [1,31], becomes [0,30]", "url": "https://github.com/nichealpham/minishop-composer/blob/68d2f4e875a2bd9d7c3c2c9226795d25c239ecd0/api/AppGlobal/Commons/Helpers.cs", "sha": "68d2f4e875a2bd9d7c3c2c9226795d25c239ecd0"}458{"repo_name": "DNSveil", "dataset": "github_2023", "owner": "msasanmh", "lang": "csharp", "func_name": "NetworkTool.IpToHostAsync", "code": "public static async Task<(string Host, string BaseHost)> IpToHostAsync(string ip)\n    {\n        string result = string.Empty;\n        string baseHost = string.Empty;\n        if (!OperatingSystem.IsWindows()) return (result, baseHost);\n        if (!await IsInternetAliveByNicAsync()) return (result, baseHost); // nslookup takes time when there is no internet access\n\n        string content = await ProcessManager.ExecuteAsync(\"nslookup\", null, ip, true, true);\n        if (string.IsNullOrEmpty(content)) return (result, baseHost);\n        content = content.ToLower();\n        string[] split = content.Split(Environment.NewLine);\n        for (int n = 0; n < split.Length; n++)\n        {\n            string line = split[n];\n            if (line.Contains(\"name:\"))\n            {\n                result = line.Replace(\"name:\", string.Empty).Trim();\n                if (result.Contains('.'))\n                {\n                    GetHostDetails(result, 0, out _, out _, out baseHost, out _, out _, out _);\n                }\n                break;\n            }\n        }\n\n        return (result, baseHost);\n    }", "docstring": "/// <summary>\n/// IP to Host using Nslookup (Windows Only)\n/// </summary>\n/// <param name=\"ip\"></param>\n/// <returns></returns>", "url": "https://github.com/msasanmh/DNSveil/blob/3f107516dddb1f4eba472665b925994f06a29162/MsmhToolsClass/MsmhToolsClass/NetworkTool.cs#L79-L105", "sha": "3f107516dddb1f4eba472665b925994f06a29162"}459{"repo_name": "DNSveil", "dataset": "github_2023", "owner": "msasanmh", "lang": "csharp", "func_name": "WebAPI.Github_Latest_Release_Async", "code": "public static async Task<List<string>> Github_Latest_Release_Async(string owner, string repo, int timeoutMs = 5000)\n    {\n        List<string> relaeseURLs = new();\n\n        try\n        {\n            Uri apiMain = new($\"https://api.github.com/repos/{owner}/{repo}/releases/latest\");\n            HttpRequest hr = new()\n            {\n                Method = HttpMethod.Get,\n                AllowInsecure = true,\n                TimeoutMS = timeoutMs,\n                URI = apiMain,\n                Headers =\n                {\n                    { \"accept\", \"application/json\" }\n                }\n            };\n            HttpRequestResponse hrr = await HttpRequest.SendAsync(hr).ConfigureAwait(false);\n            string json = Encoding.UTF8.GetString(hrr.Data);\n\n            List<JsonTool.JsonPath> path = new()\n            {\n                new JsonTool.JsonPath() {Key = \"assets\", Count = 1, Conditions = new()},\n                new JsonTool.JsonPath() {Key = \"browser_download_url\", Conditions = new()}\n            };\n\n            relaeseURLs = JsonTool.GetValues(json, path);\n        }\n        catch (Exception ex)\n        {\n            Debug.WriteLine(\"WebAPI Github_Latest_Release_Async: \" + ex.Message);\n        }\n\n        return relaeseURLs;\n    }", "docstring": "/// <summary>\n/// Github Latest Release\n/// </summary>\n/// <returns>Returns Download Links</returns>", "url": "https://github.com/msasanmh/DNSveil/blob/3f107516dddb1f4eba472665b925994f06a29162/MsmhToolsClass/MsmhToolsClass/WebAPI.cs#L37-L72", "sha": "3f107516dddb1f4eba472665b925994f06a29162"}460{"repo_name": "toon-rp", "dataset": "github_2023", "owner": "Delt06", "lang": "csharp", "func_name": "ToonMeshUtility.IntersectRayMesh", "code": "public static bool IntersectRayMesh(Ray ray, Mesh mesh, Matrix4x4 matrix, out RaycastHit hit)\n        {\n            object[] parameters = { ray, mesh, matrix, null };\n            bool result = (bool) MethodIntersectRayMesh.Invoke(null, parameters);\n            hit = (RaycastHit) parameters[3];\n            return result;\n        }", "docstring": "// Adapted from https://gist.github.com/MattRix/9205bc62d558fef98045", "url": "https://github.com/Delt06/toon-rp/blob/687b7b26747a8bd6b0905299e5248bbca0285a77/Packages/com.deltation.toon-rp/Editor/VertexColorPaint/ToonMeshUtility.cs#L82-L88", "sha": "687b7b26747a8bd6b0905299e5248bbca0285a77"}461{"repo_name": "Avalonia.Labs", "dataset": "github_2023", "owner": "AvaloniaUI", "lang": "csharp", "func_name": "Application.Main", "code": "static void Main(string[] args)\n    {\n        // if you want to use a different Application Delegate class from \"AppDelegate\"\n        // you can specify it here.\n        UIApplication.Main(args, null, typeof(AppDelegate));\n    }", "docstring": "// This is the main entry point of the application.", "url": "https://github.com/AvaloniaUI/Avalonia.Labs/blob/81ee313436d2305f7c169e0a099fe84d33d50624/samples/Avalonia.Labs.Catalog.iOS/Main.cs#L8-L13", "sha": "81ee313436d2305f7c169e0a099fe84d33d50624"}462{"repo_name": "Avalonia.Labs", "dataset": "github_2023", "owner": "AvaloniaUI", "lang": "csharp", "func_name": "ContentDialog.ShowAsync", "code": "public async Task<ContentDialogResult> ShowAsync() => await ShowAsyncCore(null);", "docstring": "/// <summary>\n/// Begins an asynchronous operation to show the dialog.\n/// </summary>", "url": "https://github.com/AvaloniaUI/Avalonia.Labs/blob/81ee313436d2305f7c169e0a099fe84d33d50624/src/Avalonia.Labs.Controls/ContentDialog/ContentDialog.cs#L113-L113", "sha": "81ee313436d2305f7c169e0a099fe84d33d50624"}463{"repo_name": "Avalonia.Labs", "dataset": "github_2023", "owner": "AvaloniaUI", "lang": "csharp", "func_name": "ReedSolomonEncoder.Encode", "code": "internal static byte[] Encode(byte[] dataBytes, int numECBytes, GeneratorPolynomial generatorPoly)\n\t{\n\t\tint dataLength = dataBytes.Length;\n        if (generatorPoly == null)\n            throw new ArgumentNullException(nameof(generatorPoly));\n\n        if (dataLength == 0)\n\t\t{\n\t\t\tthrow new ArgumentException(\"There is no data bytes to encode.\");\n\t\t}\n\n\t\tif (numECBytes <= 0)\n\t\t{\n\t\t\tthrow new ArgumentException(\"No Error Correction bytes.\");\n\t\t}\n\n\t\tint[] toEncode = ConvertToIntArray(dataBytes, dataLength, numECBytes);\n\n\t\tPolynomial generator = generatorPoly.GetGenerator(numECBytes);\n\n\t\tPolynomial dataPoly = new(generator.GField, toEncode);\n\n\t\tPolyDivideStruct divideResult = dataPoly.Divide(generator);\n\n\t\tint[] remainderCoeffs = divideResult.Remainder.Coefficients;\n\n\t\treturn ConvertTosByteArray(remainderCoeffs, numECBytes);\n\t}", "docstring": "/// <summary>\n/// Encode an array of data codeword with GaloisField 256.\n/// </summary>\n/// <param name=\"dataBytes\">Array of data codewords for a single block.</param>\n/// <param name=\"numECBytes\">Number of error correction codewords for data codewords</param>\n/// <param name=\"generatorPoly\">Cached or newly create GeneratorPolynomial</param>\n/// <returns>Return error correction codewords array</returns>", "url": "https://github.com/AvaloniaUI/Avalonia.Labs/blob/81ee313436d2305f7c169e0a099fe84d33d50624/src/Avalonia.Labs.Qr/Encoding/ReedSolomon/ReedSolomonEncoder.cs#L14-L41", "sha": "81ee313436d2305f7c169e0a099fe84d33d50624"}464{"repo_name": "com.doji.genesis", "dataset": "github_2023", "owner": "julienkay", "lang": "csharp", "func_name": "UrlUtility.AppendQuerytoUrl", "code": "public static void AppendQuerytoUrl(ref string url, string parameterName, string query) {\n            if (query == null) {\n                return;\n            }\n            url += parameterName + \"=\" + query + \"&\";\n        }", "docstring": "/// <summary>\n/// Appends <paramref name=\"appendix\"/> to <paramref name=\"url\"/>.\n/// </summary>", "url": "https://github.com/julienkay/com.doji.genesis/blob/696728293c8ccf78eb5114f58dfcac2516ce1c70/Packages/com.doji.genesis/Runtime/Scripts/Utils/UrlUtility.cs#L11-L16", "sha": "696728293c8ccf78eb5114f58dfcac2516ce1c70"}465{"repo_name": "semantic-kernel", "dataset": "github_2023", "owner": "microsoft", "lang": "csharp", "func_name": "OpenAIAssistant_Streaming.InvokeAgentAsync", "code": "private async Task InvokeAgentAsync(OpenAIAssistantAgent agent, string threadId, string input)\n    {\n        ChatMessageContent message = new(AuthorRole.User, input);\n        await agent.AddChatMessageAsync(threadId, message);\n        this.WriteAgentChatMessage(message);\n\n        ChatHistory history = [];\n\n        bool isFirst = false;\n        bool isCode = false;\n        await foreach (StreamingChatMessageContent response in agent.InvokeStreamingAsync(threadId, messages: history))\n        {\n            if (string.IsNullOrEmpty(response.Content))\n            {\n                StreamingFunctionCallUpdateContent? functionCall = response.Items.OfType<StreamingFunctionCallUpdateContent>().SingleOrDefault();\n                if (functionCall != null)\n                {\n                    Console.WriteLine($\"\\n# {response.Role} - {response.AuthorName ?? \"*\"}: FUNCTION CALL - {functionCall.Name}\");\n                }\n\n                continue;\n            }\n\n            // Differentiate between assistant and tool messages\n            if (isCode != (response.Metadata?.ContainsKey(OpenAIAssistantAgent.CodeInterpreterMetadataKey) ?? false))\n            {\n                isFirst = false;\n                isCode = !isCode;\n            }\n\n            if (!isFirst)\n            {\n                Console.WriteLine($\"\\n# {response.Role} - {response.AuthorName ?? \"*\"}:\");\n                isFirst = true;\n            }\n\n            Console.WriteLine($\"\\t > streamed: '{response.Content}'\");\n        }\n\n        foreach (ChatMessageContent content in history)\n        {\n            this.WriteAgentChatMessage(content);\n        }\n    }", "docstring": "// Local function to invoke agent and display the conversation messages.", "url": "https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/samples/Concepts/Agents/OpenAIAssistant_Streaming.cs#L109-L152", "sha": "cd84e877980187e62d86bb5bc6086d264e62ee83"}466{"repo_name": "semantic-kernel", "dataset": "github_2023", "owner": "microsoft", "lang": "csharp", "func_name": "ChatHistoryExtensions.GetSystemMessage", "code": "internal static ChatMessageContent? GetSystemMessage(this IReadOnlyList<ChatMessageContent> chatHistory)\n    {\n        return chatHistory.FirstOrDefault(m => m.Role == AuthorRole.System);\n    }", "docstring": "/// <summary>\n/// Returns the system prompt from the chat history.\n/// </summary>\n/// <remarks>\n/// For simplicity only a single system message is supported in these examples.\n/// </remarks>", "url": "https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/samples/Concepts/ChatCompletion/ChatHistoryReducers/ChatHistoryExtensions.cs#L22-L25", "sha": "cd84e877980187e62d86bb5bc6086d264e62ee83"}467{"repo_name": "semantic-kernel", "dataset": "github_2023", "owner": "microsoft", "lang": "csharp", "func_name": "AutoFunctionInvocationFiltering.AutoFunctionInvocationFilterAsync", "code": "[Fact]\n    public async Task AutoFunctionInvocationFilterAsync()\n    {\n        var builder = Kernel.CreateBuilder();\n\n        builder.AddOpenAIChatCompletion(\"gpt-4\", TestConfiguration.OpenAI.ApiKey);\n\n        // This filter outputs information about auto function invocation and returns overridden result.\n        builder.Services.AddSingleton<IAutoFunctionInvocationFilter>(new AutoFunctionInvocationFilter(this.Output));\n\n        var kernel = builder.Build();\n\n        var function = KernelFunctionFactory.CreateFromMethod(() => \"Result from function\", \"MyFunction\");\n\n        kernel.ImportPluginFromFunctions(\"MyPlugin\", [function]);\n\n        var executionSettings = new OpenAIPromptExecutionSettings\n        {\n            FunctionChoiceBehavior = FunctionChoiceBehavior.Required([function], autoInvoke: true)\n        };\n\n        var result = await kernel.InvokePromptAsync(\"Invoke provided function and return result\", new(executionSettings));\n\n        Console.WriteLine(result);\n\n        // Output:\n        // Request sequence number: 0\n        // Function sequence number: 0\n        // Total number of functions: 1\n        // Result from auto function invocation filter.\n    }", "docstring": "/// <summary>\n/// Shows how to use <see cref=\"IAutoFunctionInvocationFilter\"/>.\n/// </summary>", "url": "https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/samples/Concepts/Filtering/AutoFunctionInvocationFiltering.cs#L14-L44", "sha": "cd84e877980187e62d86bb5bc6086d264e62ee83"}468{"repo_name": "semantic-kernel", "dataset": "github_2023", "owner": "microsoft", "lang": "csharp", "func_name": "MethodFunctions_Advanced.MethodFunctionsChainingAsync", "code": "[Fact]\n    public async Task MethodFunctionsChainingAsync()\n    {\n        Console.WriteLine(\"Running Method Function Chaining example...\");\n\n        var kernel = new Kernel();\n\n        var functions = kernel.ImportPluginFromType<FunctionsChainingPlugin>();\n\n        var customType = await kernel.InvokeAsync<MyCustomType>(functions[\"Function1\"]);\n\n        Console.WriteLine($\"CustomType.Number: {customType!.Number}\"); // 2\n        Console.WriteLine($\"CustomType.Text: {customType.Text}\"); // From Function1 + From Function2\n    }", "docstring": "/// <summary>\n/// This example executes Function1, which in turn executes Function2.\n/// </summary>", "url": "https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/samples/Concepts/Functions/MethodFunctions_Advanced.cs#L18-L31", "sha": "cd84e877980187e62d86bb5bc6086d264e62ee83"}469{"repo_name": "semantic-kernel", "dataset": "github_2023", "owner": "microsoft", "lang": "csharp", "func_name": "VectorStore_VectorSearch_MultiVector.CreateProductRecords", "code": "private static IEnumerable<Product> CreateProductRecords()\n    {\n        yield return new Product\n        {\n            Key = 1,\n            Description = \"Premium coffee maker that allows you to make up to 20 types of drinks with one machine.\",\n            FeatureList = [\"Milk Frother\", \"Easy to use\", \"One button operation\", \"Stylish design\"]\n        };\n\n        yield return new Product\n        {\n            Key = 2,\n            Description = \"Value coffee maker that gives you what you need at a good price.\",\n            FeatureList = [\"Simple design\", \"Easy to clean\"]\n        };\n\n        yield return new Product\n        {\n            Key = 3,\n            Description = \"Efficient vacuum cleaner\",\n            FeatureList = [\"1000W power\", \"Hard floor tool\", \"Bagless\", \"Corded\"]\n        };\n\n        yield return new Product\n        {\n            Key = 4,\n            Description = \"High performance handheld vacuum cleaner\",\n            FeatureList = [\"Pet hair tool\", \"2000W power\", \"Hard floor tool\", \"Bagless\", \"Cordless\"]\n        };\n    }", "docstring": "/// <summary>\n/// Create some sample product records.\n/// </summary>\n/// <returns>A list of sample product records.</returns>", "url": "https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/samples/Concepts/Memory/VectorStore_VectorSearch_MultiVector.cs#L92-L121", "sha": "cd84e877980187e62d86bb5bc6086d264e62ee83"}470{"repo_name": "semantic-kernel", "dataset": "github_2023", "owner": "microsoft", "lang": "csharp", "func_name": "LegacyMenuPlugin.GetSpecials", "code": "[KernelFunction, Description(\"Provides a list of specials from the menu.\")]\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Design\", \"CA1024:Use properties where appropriate\", Justification = \"Too smart\")]\n    public string[] GetSpecials(KernelArguments? arguments)\n    {\n        return\n            [\n                \"Special Soup: Clam Chowder\",\n                \"Special Salad: Cobb Salad\",\n                \"Special Drink: Chai Tea\",\n            ];\n    }", "docstring": "/// <summary>\n/// Returns a mock item menu.\n/// </summary>", "url": "https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/samples/Concepts/Resources/Plugins/LegacyMenuPlugin.cs#L13-L23", "sha": "cd84e877980187e62d86bb5bc6086d264e62ee83"}471{"repo_name": "semantic-kernel", "dataset": "github_2023", "owner": "microsoft", "lang": "csharp", "func_name": "Step7_Observability.ObservabilityWithFiltersAsync", "code": "[Fact]\n    public async Task ObservabilityWithFiltersAsync()\n    {\n        // Create a kernel with OpenAI chat completion\n        IKernelBuilder kernelBuilder = Kernel.CreateBuilder();\n        kernelBuilder.AddOpenAIChatCompletion(\n                modelId: TestConfiguration.OpenAI.ChatModelId,\n                apiKey: TestConfiguration.OpenAI.ApiKey);\n\n        kernelBuilder.Plugins.AddFromType<TimeInformation>();\n\n        // Add filter using DI\n        kernelBuilder.Services.AddSingleton<ITestOutputHelper>(this.Output);\n        kernelBuilder.Services.AddSingleton<IFunctionInvocationFilter, MyFunctionFilter>();\n\n        Kernel kernel = kernelBuilder.Build();\n\n        // Add filter without DI\n        kernel.PromptRenderFilters.Add(new MyPromptFilter(this.Output));\n\n        // Invoke the kernel with a prompt and allow the AI to automatically invoke functions\n        OpenAIPromptExecutionSettings settings = new() { FunctionChoiceBehavior = FunctionChoiceBehavior.Auto() };\n        Console.WriteLine(await kernel.InvokePromptAsync(\"How many days until Christmas? Explain your thinking.\", new(settings)));\n    }", "docstring": "/// <summary>\n/// Shows how to observe the execution of a <see cref=\"KernelPlugin\"/> instance with filters.\n/// </summary>", "url": "https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/samples/GettingStarted/Step7_Observability.cs#L15-L38", "sha": "cd84e877980187e62d86bb5bc6086d264e62ee83"}472{"repo_name": "semantic-kernel", "dataset": "github_2023", "owner": "microsoft", "lang": "csharp", "func_name": "LearnBaseTest.ReadLine", "code": "public string? ReadLine()\n    {\n        if (SimulatedInputTextIndex < SimulatedInputText.Count)\n        {\n            return SimulatedInputText[SimulatedInputTextIndex++];\n        }\n\n        return null;\n    }", "docstring": "/// <summary>\n/// Simulates reading input strings from a user for the purpose of running tests.\n/// </summary>\n/// <returns>A simulate user input string, if available. Null otherwise.</returns>", "url": "https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/samples/LearnResources/MicrosoftLearn/LearnBaseTest.cs#L23-L31", "sha": "cd84e877980187e62d86bb5bc6086d264e62ee83"}473{"repo_name": "semantic-kernel", "dataset": "github_2023", "owner": "microsoft", "lang": "csharp", "func_name": "OpenAIAssistantChannel.ReceiveAsync", "code": "protected override async Task ReceiveAsync(IEnumerable<ChatMessageContent> history, CancellationToken cancellationToken)\n    {\n        foreach (ChatMessageContent message in history)\n        {\n            await AssistantThreadActions.CreateMessageAsync(this._client, this._threadId, message, cancellationToken).ConfigureAwait(false);\n        }\n    }", "docstring": "/// <inheritdoc/>", "url": "https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/Agents/OpenAI/OpenAIAssistantChannel.cs#L20-L26", "sha": "cd84e877980187e62d86bb5bc6086d264e62ee83"}474{"repo_name": "semantic-kernel", "dataset": "github_2023", "owner": "microsoft", "lang": "csharp", "func_name": "OpenAIAssistantAgentLogMessages.LogOpenAIAssistantAgentCreatingChannel", "code": "[LoggerMessage(\n        EventId = 0,\n        Level = LogLevel.Debug,\n        Message = \"[{MethodName}] Creating assistant thread for {ChannelType}.\")]\n    public static partial void LogOpenAIAssistantAgentCreatingChannel(\n        this ILogger logger,\n        string methodName,\n        string channelType);", "docstring": "/// <summary>\n/// Logs <see cref=\"OpenAIAssistantAgent\"/> creating channel (started).\n/// </summary>", "url": "https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/Agents/OpenAI/Logging/OpenAIAssistantAgentLogMessages.cs#L22-L29", "sha": "cd84e877980187e62d86bb5bc6086d264e62ee83"}475{"repo_name": "semantic-kernel", "dataset": "github_2023", "owner": "microsoft", "lang": "csharp", "func_name": "AssistantMessageFactoryTests.VerifyAssistantMessageAdapterCreateOptionsDefault", "code": "[Fact]\n    public void VerifyAssistantMessageAdapterCreateOptionsDefault()\n    {\n        // Arrange (Setup message with null metadata)\n        ChatMessageContent message = new(AuthorRole.User, \"test\");\n\n        // Act: Create options\n        MessageCreationOptions options = AssistantMessageFactory.CreateOptions(message);\n\n        // Assert\n        Assert.NotNull(options);\n        Assert.Empty(options.Metadata);\n    }", "docstring": "/// <summary>\n/// Verify options creation.\n/// </summary>", "url": "https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/Agents/UnitTests/OpenAI/Internal/AssistantMessageFactoryTests.cs#L21-L33", "sha": "cd84e877980187e62d86bb5bc6086d264e62ee83"}476{"repo_name": "semantic-kernel", "dataset": "github_2023", "owner": "microsoft", "lang": "csharp", "func_name": "HuggingFaceServiceCollectionExtensions.AddHuggingFaceTextGeneration", "code": "public static IServiceCollection AddHuggingFaceTextGeneration(\n        this IServiceCollection services,\n        string model,\n        Uri? endpoint = null,\n        string? apiKey = null,\n        string? serviceId = null,\n        HttpClient? httpClient = null)\n    {\n        Verify.NotNull(services);\n\n        return services.AddKeyedSingleton<ITextGenerationService>(serviceId, (serviceProvider, _) =>\n            new HuggingFaceTextGenerationService(\n                model,\n                endpoint,\n                apiKey,\n                HttpClientProvider.GetHttpClient(httpClient, serviceProvider),\n                serviceProvider.GetService<ILoggerFactory>()));\n    }", "docstring": "/// <summary>\n/// Adds an Hugging Face text generation service with the specified configuration.\n/// </summary>\n/// <param name=\"services\">The <see cref=\"IServiceCollection\"/> instance to augment.</param>\n/// <param name=\"model\">The name of the Hugging Face model.</param>\n/// <param name=\"endpoint\">The endpoint URL for the text generation service.</param>\n/// <param name=\"apiKey\">The API key required for accessing the Hugging Face service.</param>\n/// <param name=\"serviceId\">A local identifier for the given AI service.</param>\n/// <param name=\"httpClient\">The HttpClient to use with this service.</param>\n/// <returns>The same instance as <paramref name=\"services\"/>.</returns>", "url": "https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/Connectors/Connectors.HuggingFace/HuggingFaceServiceCollectionExtensions.cs#L31-L48", "sha": "cd84e877980187e62d86bb5bc6086d264e62ee83"}477{"repo_name": "semantic-kernel", "dataset": "github_2023", "owner": "microsoft", "lang": "csharp", "func_name": "PineconeServiceCollectionExtensions.AddPineconeVectorStore", "code": "public static IServiceCollection AddPineconeVectorStore(this IServiceCollection services, PineconeVectorStoreOptions? options = default, string? serviceId = default)\n    {\n        // If we are not constructing the PineconeClient, add the IVectorStore as transient, since we\n        // cannot make assumptions about how PineconeClient is being managed.\n        services.AddKeyedTransient<IVectorStore>(\n            serviceId,\n            (sp, obj) =>\n            {\n                var pineconeClient = sp.GetRequiredService<Sdk.PineconeClient>();\n                var selectedOptions = options ?? sp.GetService<PineconeVectorStoreOptions>();\n\n                return new PineconeVectorStore(\n                    pineconeClient,\n                    selectedOptions);\n            });\n\n        return services;\n    }", "docstring": "/// <summary>\n/// Register a Pinecone <see cref=\"IVectorStore\"/> with the specified service ID and where <see cref=\"Sdk.PineconeClient\"/> is retrieved from the dependency injection container.\n/// </summary>\n/// <param name=\"services\">The <see cref=\"IServiceCollection\"/> to register the <see cref=\"IVectorStore\"/> on.</param>\n/// <param name=\"options\">Optional options to further configure the <see cref=\"IVectorStore\"/>.</param>\n/// <param name=\"serviceId\">An optional service id to use as the service key.</param>\n/// <returns>The service collection.</returns>", "url": "https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/Connectors/Connectors.Memory.Pinecone/PineconeServiceCollectionExtensions.cs#L22-L39", "sha": "cd84e877980187e62d86bb5bc6086d264e62ee83"}478{"repo_name": "semantic-kernel", "dataset": "github_2023", "owner": "microsoft", "lang": "csharp", "func_name": "PostgresVectorStoreUtils.WrapAsyncEnumerableAsync", "code": "public static async IAsyncEnumerable<T> WrapAsyncEnumerableAsync<T>(IAsyncEnumerable<T> asyncEnumerable, string operationName, string? collectionName = null)\n    {\n        var enumerator = asyncEnumerable.ConfigureAwait(false).GetAsyncEnumerator();\n\n        var nextResult = await GetNextAsync<T>(enumerator, operationName, collectionName).ConfigureAwait(false);\n        while (nextResult.more)\n        {\n            yield return nextResult.item;\n            nextResult = await GetNextAsync(enumerator, operationName, collectionName).ConfigureAwait(false);\n        }\n    }", "docstring": "/// <summary>\n/// Wraps an <see cref=\"IAsyncEnumerable{T}\"/> in an <see cref=\"IAsyncEnumerable{T}\"/> that will throw a <see cref=\"VectorStoreOperationException\"/>\n/// if an exception is thrown while iterating over the original enumerator.\n/// </summary>\n/// <typeparam name=\"T\">The type of the items in the async enumerable.</typeparam>\n/// <param name=\"asyncEnumerable\">The async enumerable to wrap.</param>\n/// <param name=\"operationName\">The name of the operation being performed.</param>\n/// <param name=\"collectionName\">The name of the collection being operated on.</param>\n/// <returns>An async enumerable that will throw a <see cref=\"VectorStoreOperationException\"/> if an exception is thrown while iterating over the original enumerator.</returns>", "url": "https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/Connectors/Connectors.Memory.Postgres/PostgresVectorStoreUtils.cs#L22-L32", "sha": "cd84e877980187e62d86bb5bc6086d264e62ee83"}479{"repo_name": "semantic-kernel", "dataset": "github_2023", "owner": "microsoft", "lang": "csharp", "func_name": "WeaviateVectorStoreCollectionCreateMapping.MapToSchema", "code": "public static WeaviateCollectionSchema MapToSchema(\n        string collectionName,\n        IEnumerable<VectorStoreRecordDataProperty> dataProperties,\n        IEnumerable<VectorStoreRecordVectorProperty> vectorProperties,\n        IReadOnlyDictionary<string, string> storagePropertyNames)\n    {\n        var schema = new WeaviateCollectionSchema(collectionName);\n\n        // Handle data properties.\n        foreach (var property in dataProperties)\n        {\n            schema.Properties.Add(new WeaviateCollectionSchemaProperty\n            {\n                Name = storagePropertyNames[property.DataModelPropertyName],\n                DataType = [MapType(property.PropertyType)],\n                IndexFilterable = property.IsFilterable,\n                IndexSearchable = property.IsFullTextSearchable\n            });\n        }\n\n        // Handle vector properties.\n        foreach (var property in vectorProperties)\n        {\n            var vectorPropertyName = storagePropertyNames[property.DataModelPropertyName];\n            schema.VectorConfigurations.Add(vectorPropertyName, new WeaviateCollectionSchemaVectorConfig\n            {\n                VectorIndexType = MapIndexKind(property.IndexKind, vectorPropertyName),\n                VectorIndexConfig = new WeaviateCollectionSchemaVectorIndexConfig\n                {\n                    Distance = MapDistanceFunction(property.DistanceFunction, vectorPropertyName)\n                }\n            });\n        }\n\n        return schema;\n    }", "docstring": "/// <summary>\n/// Maps record type properties to Weaviate collection schema for collection creation.\n/// </summary>\n/// <param name=\"collectionName\">The name of the vector store collection.</param>\n/// <param name=\"dataProperties\">Collection of record data properties.</param>\n/// <param name=\"vectorProperties\">Collection of record vector properties.</param>\n/// <param name=\"storagePropertyNames\">A dictionary that maps from a property name to the storage name that should be used when serializing it to JSON for data and vector properties.</param>\n/// <returns>Weaviate collection schema.</returns>", "url": "https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/Connectors/Connectors.Memory.Weaviate/WeaviateVectorStoreCollectionCreateMapping.cs#L25-L60", "sha": "cd84e877980187e62d86bb5bc6086d264e62ee83"}480{"repo_name": "semantic-kernel", "dataset": "github_2023", "owner": "microsoft", "lang": "csharp", "func_name": "OnnxRuntimeGenAIPromptExecutionSettings.FromExecutionSettings", "code": "[RequiresUnreferencedCode(\"This method uses reflection to serialize and deserialize the execution settings, making it incompatible with AOT scenarios.\")]\n    [RequiresDynamicCode(\"This method uses reflection to serialize and deserialize the execution settings, making it incompatible with AOT scenarios.\")]\n    public static OnnxRuntimeGenAIPromptExecutionSettings FromExecutionSettings(PromptExecutionSettings? executionSettings)\n    {\n        if (executionSettings is null)\n        {\n            return new OnnxRuntimeGenAIPromptExecutionSettings();\n        }\n\n        if (executionSettings is OnnxRuntimeGenAIPromptExecutionSettings settings)\n        {\n            return settings;\n        }\n\n        var json = JsonSerializer.Serialize(executionSettings, executionSettings.GetType());\n\n        return JsonSerializer.Deserialize<OnnxRuntimeGenAIPromptExecutionSettings>(json, JsonOptionsCache.ReadPermissive)!;\n    }", "docstring": "/// <summary>\n/// Convert PromptExecutionSettings to OnnxRuntimeGenAIPromptExecutionSettings\n/// </summary>\n/// <param name=\"executionSettings\">The <see cref=\"PromptExecutionSettings\"/> to convert to <see cref=\"OnnxRuntimeGenAIPromptExecutionSettings\"/>.</param>\n/// <returns>Returns the <see cref=\"OnnxRuntimeGenAIPromptExecutionSettings\"/> object.</returns>", "url": "https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/Connectors/Connectors.Onnx/OnnxRuntimeGenAIPromptExecutionSettings.cs#L22-L39", "sha": "cd84e877980187e62d86bb5bc6086d264e62ee83"}481{"repo_name": "semantic-kernel", "dataset": "github_2023", "owner": "microsoft", "lang": "csharp", "func_name": "QdrantVectorStoreRecordCollectionTests.CanCreateCollectionWithMismatchedDefinitionAndType", "code": "[Fact]\n    public void CanCreateCollectionWithMismatchedDefinitionAndType()\n    {\n        // Arrange.\n        var definition = new VectorStoreRecordDefinition()\n        {\n            Properties = new List<VectorStoreRecordProperty>\n            {\n                new VectorStoreRecordKeyProperty(\"Id\", typeof(ulong)),\n                new VectorStoreRecordDataProperty(\"Text\", typeof(string)),\n                new VectorStoreRecordVectorProperty(\"Embedding\", typeof(ReadOnlyMemory<float>)) { Dimensions = 4 },\n            }\n        };\n\n        // Act.\n        var sut = new QdrantVectorStoreRecordCollection<SinglePropsModel<ulong>>(\n            this._qdrantClientMock.Object,\n            TestCollectionName,\n            new() { VectorStoreRecordDefinition = definition, PointStructCustomMapper = Mock.Of<IVectorStoreRecordMapper<SinglePropsModel<ulong>, PointStruct>>() });\n    }", "docstring": "/// <summary>\n/// Tests that the collection can be created even if the definition and the type do not match.\n/// In this case, the expectation is that a custom mapper will be provided to map between the\n/// schema as defined by the definition and the different data model.\n/// </summary>", "url": "https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/Connectors/Connectors.Qdrant.UnitTests/QdrantVectorStoreRecordCollectionTests.cs#L530-L549", "sha": "cd84e877980187e62d86bb5bc6086d264e62ee83"}482{"repo_name": "semantic-kernel", "dataset": "github_2023", "owner": "microsoft", "lang": "csharp", "func_name": "PromptTemplateConfigExtensions.SetMaxTokens", "code": "internal static void SetMaxTokens(this PromptTemplateConfig config, int maxTokens)\n    {\n        var executionSettings = config.ExecutionSettings;\n        foreach (var setting in executionSettings)\n        {\n            if (setting.Value.ExtensionData is not null)\n            {\n                setting.Value.ExtensionData[\"max_tokens\"] = maxTokens;\n            }\n        }\n    }", "docstring": "/// <summary>\n/// Set the max_tokens request setting to be used by OpenAI models\n/// </summary>\n/// <param name=\"config\">PromptTemplateConfig instance</param>\n/// <param name=\"maxTokens\">Value of max tokens to set</param>", "url": "https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/Experimental/Orchestration.Flow/Extensions/PromptTemplateConfigExtensions.cs#L15-L25", "sha": "cd84e877980187e62d86bb5bc6086d264e62ee83"}483{"repo_name": "semantic-kernel", "dataset": "github_2023", "owner": "microsoft", "lang": "csharp", "func_name": "DaprKernelProcessFactory.StartAsync", "code": "public static async Task<DaprKernelProcessContext> StartAsync(this KernelProcess process, KernelProcessEvent initialEvent, string? processId = null)\n    {\n        Verify.NotNull(process);\n        Verify.NotNullOrWhiteSpace(process.State?.Name);\n        Verify.NotNull(initialEvent);\n\n        // Assign the process Id if one is provided and the processes does not already have an Id.\n        if (!string.IsNullOrWhiteSpace(processId) && string.IsNullOrWhiteSpace(process.State.Id))\n        {\n            process = process with { State = process.State with { Id = processId } };\n        }\n\n        DaprKernelProcessContext processContext = new(process);\n        await processContext.StartWithEventAsync(initialEvent).ConfigureAwait(false);\n        return processContext;\n    }", "docstring": "/// <summary>\n/// Starts the specified process.\n/// </summary>\n/// <param name=\"process\">Required: The <see cref=\"KernelProcess\"/> to start running.</param>\n/// <param name=\"initialEvent\">Required: The initial event to start the process.</param>\n/// <param name=\"processId\">Optional: Used to specify the unique Id of the process. If the process already has an Id, it will not be overwritten and this parameter has no effect.</param>\n/// <returns>An instance of <see cref=\"KernelProcess\"/> that can be used to interrogate or stop the running process.</returns>", "url": "https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/Experimental/Process.Runtime.Dapr/DaprKernelProcessFactory.cs#L18-L33", "sha": "cd84e877980187e62d86bb5bc6086d264e62ee83"}484{"repo_name": "semantic-kernel", "dataset": "github_2023", "owner": "microsoft", "lang": "csharp", "func_name": "XunitLogger.Log", "code": "public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)\n    {\n        this._output.WriteLine(state?.ToString());\n    }", "docstring": "/// <inheritdoc/>", "url": "https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/IntegrationTests/XunitLogger.cs#L17-L20", "sha": "cd84e877980187e62d86bb5bc6086d264e62ee83"}485{"repo_name": "semantic-kernel", "dataset": "github_2023", "owner": "microsoft", "lang": "csharp", "func_name": "MixedAgentTests.OpenAIMixedAgentTestAsync", "code": "[Theory(Skip = \"OpenAI will often throttle requests. This test is for manual verification.\")]\n    [InlineData(false)]\n    [InlineData(true)]\n    public async Task OpenAIMixedAgentTestAsync(bool useNewFunctionCallingModel)\n    {\n        OpenAIConfiguration openAISettings = this._configuration.GetSection(\"OpenAI\").Get<OpenAIConfiguration>()!;\n        Assert.NotNull(openAISettings);\n\n        // Arrange, Act & Assert\n        await this.VerifyAgentExecutionAsync(\n            this.CreateChatCompletionKernel(openAISettings),\n            OpenAIClientProvider.ForOpenAI(new ApiKeyCredential(openAISettings.ApiKey)),\n            openAISettings.ChatModelId!,\n            useNewFunctionCallingModel);\n    }", "docstring": "/// <summary>\n/// Integration test for <see cref=\"OpenAIAssistantAgent\"/> using function calling\n/// and targeting Open AI services.\n/// </summary>", "url": "https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/IntegrationTests/Agents/MixedAgentTests.cs#L36-L50", "sha": "cd84e877980187e62d86bb5bc6086d264e62ee83"}486{"repo_name": "semantic-kernel", "dataset": "github_2023", "owner": "microsoft", "lang": "csharp", "func_name": "QdrantTextSearchTests.CreateTextSearchAsync", "code": "public override Task<ITextSearch> CreateTextSearchAsync()\n    {\n        if (this.VectorStore is null)\n        {\n            this.EmbeddingGenerator = fixture.EmbeddingGenerator;\n            this.VectorStore = new QdrantVectorStore(fixture.QdrantClient);\n        }\n\n        var options = new QdrantVectorStoreRecordCollectionOptions<HotelInfo>\n        {\n            HasNamedVectors = true,\n            VectorStoreRecordDefinition = fixture.HotelVectorStoreRecordDefinition,\n        };\n        var vectorSearch = new QdrantVectorStoreRecordCollection<HotelInfo>(fixture.QdrantClient, \"namedVectorsHotels\", options);\n        var stringMapper = new HotelInfoTextSearchStringMapper();\n        var resultMapper = new HotelInfoTextSearchResultMapper();\n\n        var result = new VectorStoreTextSearch<HotelInfo>(vectorSearch, this.EmbeddingGenerator!, stringMapper, resultMapper);\n        return Task.FromResult<ITextSearch>(result);\n    }", "docstring": "/// <inheritdoc/>", "url": "https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/IntegrationTests/Connectors/Memory/Qdrant/QdrantTextSearchTests.cs#L20-L39", "sha": "cd84e877980187e62d86bb5bc6086d264e62ee83"}487{"repo_name": "semantic-kernel", "dataset": "github_2023", "owner": "microsoft", "lang": "csharp", "func_name": "ClientResultExceptionExtensions.ToHttpOperationException", "code": "public static HttpOperationException ToHttpOperationException(this ClientResultException exception)\n    {\n        const int NoResponseReceived = 0;\n\n        string? responseContent = null;\n\n        try\n        {\n            responseContent = exception.GetRawResponse()?.Content.ToString();\n        }\n#pragma warning disable CA1031 // Do not catch general exception types\n        catch { } // We want to suppress any exceptions that occur while reading the content, ensuring that an HttpOperationException is thrown instead.\n#pragma warning restore CA1031\n\n        return new HttpOperationException(\n            exception.Status == NoResponseReceived ? null : (HttpStatusCode?)exception.Status,\n            responseContent,\n            exception.Message,\n            exception);\n    }", "docstring": "/// <summary>\n/// Converts a <see cref=\"ClientResultException\"/> to an <see cref=\"HttpOperationException\"/>.\n/// </summary>\n/// <param name=\"exception\">The original <see cref=\"ClientResultException\"/>.</param>\n/// <returns>An <see cref=\"HttpOperationException\"/> instance.</returns>", "url": "https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/InternalUtilities/openai/Extensions/ClientResultExceptionExtensions.cs#L19-L38", "sha": "cd84e877980187e62d86bb5bc6086d264e62ee83"}488{"repo_name": "semantic-kernel", "dataset": "github_2023", "owner": "microsoft", "lang": "csharp", "func_name": "ProcessStateMetadataFactory.KernelProcessToProcessStateMetadata", "code": "public static KernelProcessStateMetadata KernelProcessToProcessStateMetadata(KernelProcess kernelProcess)\n    {\n        KernelProcessStateMetadata metadata = new()\n        {\n            Name = kernelProcess.State.Name,\n            Id = kernelProcess.State.Id,\n            VersionInfo = kernelProcess.State.Version,\n            StepsState = [],\n        };\n\n        foreach (KernelProcessStepInfo step in kernelProcess.Steps)\n        {\n            metadata.StepsState.Add(step.State.Name, step.ToProcessStateMetadata());\n        }\n\n        return metadata;\n    }", "docstring": "/// <summary>\n/// Captures Kernel Process State into <see cref=\"KernelProcessStateMetadata\"/>\n/// </summary>\n/// <returns><see cref=\"KernelProcessStateMetadata\"/></returns>", "url": "https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/InternalUtilities/process/Abstractions/KernelProcessStateMetadataFactory.cs#L14-L30", "sha": "cd84e877980187e62d86bb5bc6086d264e62ee83"}489{"repo_name": "semantic-kernel", "dataset": "github_2023", "owner": "microsoft", "lang": "csharp", "func_name": "Verify.NotNull", "code": "[MethodImpl(MethodImplOptions.AggressiveInlining)]\n    internal static void NotNull([NotNull] object? obj, [CallerArgumentExpression(nameof(obj))] string? paramName = null)\n    {\n#if NET\n        ArgumentNullException.ThrowIfNull(obj, paramName);\n#else\n        if (obj is null)\n        {\n            ThrowArgumentNullException(paramName);\n        }\n#endif\n    }", "docstring": "/// <summary>\n/// Equivalent of ArgumentNullException.ThrowIfNull\n/// </summary>", "url": "https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/InternalUtilities/src/Diagnostics/Verify.cs#L33-L44", "sha": "cd84e877980187e62d86bb5bc6086d264e62ee83"}490{"repo_name": "semantic-kernel", "dataset": "github_2023", "owner": "microsoft", "lang": "csharp", "func_name": "MathPlugin.Add", "code": "[KernelFunction, Description(\"Adds an amount to a value\")]\n    [return: Description(\"The sum\")]\n    public int Add(\n        [Description(\"The value to add\")] int value,\n        [Description(\"Amount to add\")] int amount) =>\n        value + amount;", "docstring": "/// <summary>\n/// Returns the addition result of initial and amount values provided.\n/// </summary>\n/// <param name=\"value\">Initial value to which to add the specified amount.</param>\n/// <param name=\"amount\">The amount to add as a string.</param>\n/// <returns>The resulting sum as a string.</returns>", "url": "https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/Plugins/Plugins.Core/MathPlugin.cs#L18-L23", "sha": "cd84e877980187e62d86bb5bc6086d264e62ee83"}491{"repo_name": "semantic-kernel", "dataset": "github_2023", "owner": "microsoft", "lang": "csharp", "func_name": "GoogleTextSearch.DefaultTextSearchResultMapper.MapFromResultToTextSearchResult", "code": "public TextSearchResult MapFromResultToTextSearchResult(object result)\n        {\n            if (result is not global::Google.Apis.CustomSearchAPI.v1.Data.Result googleResult)\n            {\n                throw new ArgumentException(\"Result must be a Google Result\", nameof(result));\n            }\n\n            return new TextSearchResult(googleResult.Snippet) { Name = googleResult.Title, Link = googleResult.Link };\n        }", "docstring": "/// <inheritdoc />", "url": "https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/Plugins/Plugins.Web/Google/GoogleTextSearch.cs#L288-L296", "sha": "cd84e877980187e62d86bb5bc6086d264e62ee83"}492{"repo_name": "semantic-kernel", "dataset": "github_2023", "owner": "microsoft", "lang": "csharp", "func_name": "TextGenerationExtensions.GetTextContentAsync", "code": "public static async Task<TextContent> GetTextContentAsync(\n        this ITextGenerationService textGenerationService,\n        string prompt,\n        PromptExecutionSettings? executionSettings = null,\n        Kernel? kernel = null,\n        CancellationToken cancellationToken = default)\n        => (await textGenerationService.GetTextContentsAsync(prompt, executionSettings, kernel, cancellationToken).ConfigureAwait(false))\n            .Single();", "docstring": "/// <summary>\n/// Get a single text generation result for the prompt and settings.\n/// </summary>\n/// <param name=\"textGenerationService\">Text generation service</param>\n/// <param name=\"prompt\">The standardized prompt input.</param>\n/// <param name=\"executionSettings\">The AI execution settings (optional).</param>\n/// <param name=\"kernel\">The <see cref=\"Kernel\"/> containing services, plugins, and other state for use throughout the operation.</param>\n/// <param name=\"cancellationToken\">The <see cref=\"CancellationToken\"/> to monitor for cancellation requests. The default is <see cref=\"CancellationToken.None\"/>.</param>\n/// <returns>Single text content generated by the remote model.</returns>", "url": "https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/SemanticKernel.Abstractions/AI/TextGeneration/TextGenerationExtensions.cs#L27-L34", "sha": "cd84e877980187e62d86bb5bc6086d264e62ee83"}493{"repo_name": "semantic-kernel", "dataset": "github_2023", "owner": "microsoft", "lang": "csharp", "func_name": "RestApiOperationResponseConverter.CanConvertTo", "code": "public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType)\n    {\n        return destinationType == typeof(string) || base.CanConvertTo(context, destinationType);\n    }", "docstring": "/// <inheritdoc/>", "url": "https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/SemanticKernel.Abstractions/Functions/RestApiOperationResponseConverter.cs#L15-L18", "sha": "cd84e877980187e62d86bb5bc6086d264e62ee83"}494{"repo_name": "semantic-kernel", "dataset": "github_2023", "owner": "microsoft", "lang": "csharp", "func_name": "PromptTemplateFactoryExtensions.Create", "code": "public static IPromptTemplate Create(this IPromptTemplateFactory factory, PromptTemplateConfig templateConfig)\n    {\n        Verify.NotNull(factory);\n        Verify.NotNull(templateConfig);\n\n        if (!factory.TryCreate(templateConfig, out IPromptTemplate? result))\n        {\n            throw new KernelException($\"Prompt template format {templateConfig.TemplateFormat} is not supported.\");\n        }\n\n        return result;\n    }", "docstring": "/// <summary>\n/// Creates an instance of <see cref=\"IPromptTemplate\"/> from a <see cref=\"PromptTemplateConfig\"/>.\n/// </summary>\n/// <param name=\"factory\">The factory with which to create the template.</param>\n/// <param name=\"templateConfig\">Prompt template configuration</param>\n/// <returns>The created template.</returns>\n/// <exception cref=\"KernelException\">The factory does not support the specified configuration.</exception>", "url": "https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/SemanticKernel.Abstractions/PromptTemplate/PromptTemplateFactoryExtensions.cs#L17-L28", "sha": "cd84e877980187e62d86bb5bc6086d264e62ee83"}495{"repo_name": "Intellenum", "dataset": "github_2023", "owner": "SteveDunn", "lang": "csharp", "func_name": "IEnumerableExtensions.HasExactly", "code": "public static bool HasExactly<TSource>(this IEnumerable<TSource> source, int count)\n    {\n        if (source is null)\n        {\n            throw new ArgumentNullException(nameof(source));\n        }\n\n        if (source is ICollection<TSource> collectionoft)\n        {\n            return collectionoft.Count == count;\n        }\n\n        if (source is ICollection collection)\n        {\n            return collection.Count == count;\n        }\n\n        using var enumerator = source.GetEnumerator();\n        while (count-- > 0)\n        {\n            if (!enumerator.MoveNext())\n            {\n                return false;\n            }\n        }\n\n        return !enumerator.MoveNext();\n    }", "docstring": "/// <summary>", "url": "https://github.com/SteveDunn/Intellenum/blob/d3cdb8826f3af62856a41a6974c76a7c5288f326/src/Intellenum/Extensions/IEnumerableExtensions.cs#L110-L137", "sha": "d3cdb8826f3af62856a41a6974c76a7c5288f326"}496{"repo_name": "Software-Architecture-with-C-Sharp-12-and-.NET-8-4E", "dataset": "github_2023", "owner": "PacktPublishing", "lang": "csharp", "func_name": "initial.BuildTargetModel", "code": "protected override void BuildTargetModel(ModelBuilder modelBuilder)\n        {\n#pragma warning disable 612, 618\n            modelBuilder\n                .HasAnnotation(\"ProductVersion\", \"8.0.0-preview.6.23329.4\")\n                .HasAnnotation(\"Relational:MaxIdentifierLength\", 128);\n\n            SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityRole<int>\", b =>\n                {\n                    b.Property<int>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"int\");\n\n                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>(\"Id\"));\n\n                    b.Property<string>(\"ConcurrencyStamp\")\n                        .IsConcurrencyToken()\n                        .HasColumnType(\"nvarchar(max)\");\n\n                    b.Property<string>(\"Name\")\n                        .HasMaxLength(256)\n                        .HasColumnType(\"nvarchar(256)\");\n\n                    b.Property<string>(\"NormalizedName\")\n                        .HasMaxLength(256)\n                        .HasColumnType(\"nvarchar(256)\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"NormalizedName\")\n                        .IsUnique()\n                        .HasDatabaseName(\"RoleNameIndex\")\n                        .HasFilter(\"[NormalizedName] IS NOT NULL\");\n\n                    b.ToTable(\"AspNetRoles\", (string)null);\n                });\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityRoleClaim<int>\", b =>\n                {\n                    b.Property<int>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"int\");\n\n                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>(\"Id\"));\n\n                    b.Property<string>(\"ClaimType\")\n                        .HasColumnType(\"nvarchar(max)\");\n\n                    b.Property<string>(\"ClaimValue\")\n                        .HasColumnType(\"nvarchar(max)\");\n\n                    b.Property<int>(\"RoleId\")\n                        .HasColumnType(\"int\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"RoleId\");\n\n                    b.ToTable(\"AspNetRoleClaims\", (string)null);\n                });\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityUser<int>\", b =>\n                {\n                    b.Property<int>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"int\");\n\n                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>(\"Id\"));\n\n                    b.Property<int>(\"AccessFailedCount\")\n                        .HasColumnType(\"int\");\n\n                    b.Property<string>(\"ConcurrencyStamp\")\n                        .IsConcurrencyToken()\n                        .HasColumnType(\"nvarchar(max)\");\n\n                    b.Property<string>(\"Email\")\n                        .HasMaxLength(256)\n                        .HasColumnType(\"nvarchar(256)\");\n\n                    b.Property<bool>(\"EmailConfirmed\")\n                        .HasColumnType(\"bit\");\n\n                    b.Property<bool>(\"LockoutEnabled\")\n                        .HasColumnType(\"bit\");\n\n                    b.Property<DateTimeOffset?>(\"LockoutEnd\")\n                        .HasColumnType(\"datetimeoffset\");\n\n                    b.Property<string>(\"NormalizedEmail\")\n                        .HasMaxLength(256)\n                        .HasColumnType(\"nvarchar(256)\");\n\n                    b.Property<string>(\"NormalizedUserName\")\n                        .HasMaxLength(256)\n                        .HasColumnType(\"nvarchar(256)\");\n\n                    b.Property<string>(\"PasswordHash\")\n                        .HasColumnType(\"nvarchar(max)\");\n\n                    b.Property<string>(\"PhoneNumber\")\n                        .HasColumnType(\"nvarchar(max)\");\n\n                    b.Property<bool>(\"PhoneNumberConfirmed\")\n                        .HasColumnType(\"bit\");\n\n                    b.Property<string>(\"SecurityStamp\")\n                        .HasColumnType(\"nvarchar(max)\");\n\n                    b.Property<bool>(\"TwoFactorEnabled\")\n                        .HasColumnType(\"bit\");\n\n                    b.Property<string>(\"UserName\")\n                        .HasMaxLength(256)\n                        .HasColumnType(\"nvarchar(256)\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"NormalizedEmail\")\n                        .HasDatabaseName(\"EmailIndex\");\n\n                    b.HasIndex(\"NormalizedUserName\")\n                        .IsUnique()\n                        .HasDatabaseName(\"UserNameIndex\")\n                        .HasFilter(\"[NormalizedUserName] IS NOT NULL\");\n\n                    b.ToTable(\"AspNetUsers\", (string)null);\n                });\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityUserClaim<int>\", b =>\n                {\n                    b.Property<int>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"int\");\n\n                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>(\"Id\"));\n\n                    b.Property<string>(\"ClaimType\")\n                        .HasColumnType(\"nvarchar(max)\");\n\n                    b.Property<string>(\"ClaimValue\")\n                        .HasColumnType(\"nvarchar(max)\");\n\n                    b.Property<int>(\"UserId\")\n                        .HasColumnType(\"int\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"UserId\");\n\n                    b.ToTable(\"AspNetUserClaims\", (string)null);\n                });\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityUserLogin<int>\", b =>\n                {\n                    b.Property<string>(\"LoginProvider\")\n                        .HasColumnType(\"nvarchar(450)\");\n\n                    b.Property<string>(\"ProviderKey\")\n                        .HasColumnType(\"nvarchar(450)\");\n\n                    b.Property<string>(\"ProviderDisplayName\")\n                        .HasColumnType(\"nvarchar(max)\");\n\n                    b.Property<int>(\"UserId\")\n                        .HasColumnType(\"int\");\n\n                    b.HasKey(\"LoginProvider\", \"ProviderKey\");\n\n                    b.HasIndex(\"UserId\");\n\n                    b.ToTable(\"AspNetUserLogins\", (string)null);\n                });\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityUserRole<int>\", b =>\n                {\n                    b.Property<int>(\"UserId\")\n                        .HasColumnType(\"int\");\n\n                    b.Property<int>(\"RoleId\")\n                        .HasColumnType(\"int\");\n\n                    b.HasKey(\"UserId\", \"RoleId\");\n\n                    b.HasIndex(\"RoleId\");\n\n                    b.ToTable(\"AspNetUserRoles\", (string)null);\n                });\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityUserToken<int>\", b =>\n                {\n                    b.Property<int>(\"UserId\")\n                        .HasColumnType(\"int\");\n\n                    b.Property<string>(\"LoginProvider\")\n                        .HasColumnType(\"nvarchar(450)\");\n\n                    b.Property<string>(\"Name\")\n                        .HasColumnType(\"nvarchar(450)\");\n\n                    b.Property<string>(\"Value\")\n                        .HasColumnType(\"nvarchar(max)\");\n\n                    b.HasKey(\"UserId\", \"LoginProvider\", \"Name\");\n\n                    b.ToTable(\"AspNetUserTokens\", (string)null);\n                });\n\n            modelBuilder.Entity(\"PackagesManagementDB.Models.Destination\", b =>\n                {\n                    b.Property<int>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"int\");\n\n                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>(\"Id\"));\n\n                    b.Property<string>(\"Country\")\n                        .IsRequired()\n                        .HasMaxLength(128)\n                        .HasColumnType(\"nvarchar(128)\");\n\n                    b.Property<string>(\"Description\")\n                        .HasColumnType(\"nvarchar(max)\");\n\n                    b.Property<string>(\"Name\")\n                        .IsRequired()\n                        .HasMaxLength(128)\n                        .HasColumnType(\"nvarchar(128)\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"Country\");\n\n                    b.HasIndex(\"Name\");\n\n                    b.ToTable(\"Destinations\");\n                });\n\n            modelBuilder.Entity(\"PackagesManagementDB.Models.Package\", b =>\n                {\n                    b.Property<int>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"int\");\n\n                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>(\"Id\"));\n\n                    b.Property<string>(\"Description\")\n                        .HasMaxLength(128)\n                        .HasColumnType(\"nvarchar(128)\");\n\n                    b.Property<int>(\"DestinationId\")\n                        .HasColumnType(\"int\");\n\n                    b.Property<int>(\"DurationInDays\")\n                        .HasColumnType(\"int\");\n\n                    b.Property<DateTime?>(\"EndValidityDate\")\n                        .HasColumnType(\"datetime2\");\n\n                    b.Property<long>(\"EntityVersion\")\n                        .IsConcurrencyToken()\n                        .HasColumnType(\"bigint\");\n\n                    b.Property<string>(\"Name\")\n                        .IsRequired()\n                        .HasMaxLength(128)\n                        .HasColumnType(\"nvarchar(128)\");\n\n                    b.Property<decimal>(\"Price\")\n                        .HasColumnType(\"decimal(18,2)\");\n\n                    b.Property<DateTime?>(\"StartValidityDate\")\n                        .HasColumnType(\"datetime2\");\n\n                    b.HasKey(\"Id\");\n\n                    b.HasIndex(\"DestinationId\");\n\n                    b.HasIndex(\"Name\");\n\n                    b.HasIndex(\"StartValidityDate\", \"EndValidityDate\");\n\n                    b.ToTable(\"Packages\");\n                });\n\n            modelBuilder.Entity(\"PackagesManagementDB.Models.PackageEvent\", b =>\n                {\n                    b.Property<long>(\"Id\")\n                        .ValueGeneratedOnAdd()\n                        .HasColumnType(\"bigint\");\n\n                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>(\"Id\"));\n\n                    b.Property<decimal>(\"NewPrice\")\n                        .HasColumnType(\"decimal(18,2)\");\n\n                    b.Property<long?>(\"NewVersion\")\n                        .HasColumnType(\"bigint\");\n\n                    b.Property<long?>(\"OldVersion\")\n                        .HasColumnType(\"bigint\");\n\n                    b.Property<int>(\"PackageId\")\n                        .HasColumnType(\"int\");\n\n                    b.Property<int>(\"Type\")\n                        .HasColumnType(\"int\");\n\n                    b.HasKey(\"Id\");\n\n                    b.ToTable(\"PackageEvents\");\n                });\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityRoleClaim<int>\", b =>\n                {\n                    b.HasOne(\"Microsoft.AspNetCore.Identity.IdentityRole<int>\", null)\n                        .WithMany()\n                        .HasForeignKey(\"RoleId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityUserClaim<int>\", b =>\n                {\n                    b.HasOne(\"Microsoft.AspNetCore.Identity.IdentityUser<int>\", null)\n                        .WithMany()\n                        .HasForeignKey(\"UserId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityUserLogin<int>\", b =>\n                {\n                    b.HasOne(\"Microsoft.AspNetCore.Identity.IdentityUser<int>\", null)\n                        .WithMany()\n                        .HasForeignKey(\"UserId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityUserRole<int>\", b =>\n                {\n                    b.HasOne(\"Microsoft.AspNetCore.Identity.IdentityRole<int>\", null)\n                        .WithMany()\n                        .HasForeignKey(\"RoleId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.HasOne(\"Microsoft.AspNetCore.Identity.IdentityUser<int>\", null)\n                        .WithMany()\n                        .HasForeignKey(\"UserId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"Microsoft.AspNetCore.Identity.IdentityUserToken<int>\", b =>\n                {\n                    b.HasOne(\"Microsoft.AspNetCore.Identity.IdentityUser<int>\", null)\n                        .WithMany()\n                        .HasForeignKey(\"UserId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n                });\n\n            modelBuilder.Entity(\"PackagesManagementDB.Models.Package\", b =>\n                {\n                    b.HasOne(\"PackagesManagementDB.Models.Destination\", \"MyDestination\")\n                        .WithMany(\"Packages\")\n                        .HasForeignKey(\"DestinationId\")\n                        .OnDelete(DeleteBehavior.Cascade)\n                        .IsRequired();\n\n                    b.Navigation(\"MyDestination\");\n                });\n\n            modelBuilder.Entity(\"PackagesManagementDB.Models.Destination\", b =>\n                {\n                    b.Navigation(\"Packages\");\n                });\n#pragma warning restore 612, 618\n        }", "docstring": "/// <inheritdoc />", "url": "https://github.com/PacktPublishing/Software-Architecture-with-C-Sharp-12-and-.NET-8-4E/blob/bb5f06a93c7a6ca281f88b0e3e16fb1302ebf943/ch09/PackagesManagementWithTests/PackagesManagementDB/Migrations/20230717141854_initial.Designer.cs#L19-L401", "sha": "bb5f06a93c7a6ca281f88b0e3e16fb1302ebf943"}497{"repo_name": "node-api-dotnet", "dataset": "github_2023", "owner": "microsoft", "lang": "csharp", "func_name": "Benchmarks.Clr.DynamicCallDotnetMethod", "code": "[Benchmark]\n        public void DynamicCallDotnetMethod()\n        {\n            _jsFunctionCallMethodDynamic.CallAsStatic(_jsHost);\n        }", "docstring": "// CLR-only (non-AOT) benchmarks", "url": "https://github.com/microsoft/node-api-dotnet/blob/956d1b14426f3c41c3464d60544c5ee486241d3f/bench/Benchmarks.cs#L263-L267", "sha": "956d1b14426f3c41c3464d60544c5ee486241d3f"}498{"repo_name": "node-api-dotnet", "dataset": "github_2023", "owner": "microsoft", "lang": "csharp", "func_name": "NodeWorker.MessagePort.Unref", "code": "public void Unref()\n        {\n            _portRef.Run((port) => port.CallMethod(\"unref\"));\n        }", "docstring": "/// <summary>", "url": "https://github.com/microsoft/node-api-dotnet/blob/956d1b14426f3c41c3464d60544c5ee486241d3f/src/NodeApi/Interop/NodeWorker.cs#L299-L302", "sha": "956d1b14426f3c41c3464d60544c5ee486241d3f"}499{"repo_name": "Polyfill", "dataset": "github_2023", "owner": "SimonCropp", "lang": "csharp", "func_name": "EnumPolyfill.GetValues", "code": "public static TEnum[] GetValues<TEnum>()\n        where TEnum : struct, Enum\n    {\n#if NETCOREAPPX || NETFRAMEWORK || NETSTANDARD\n        var values = Enum.GetValues(typeof(TEnum));\n        var result = new TEnum[values.Length];\n        Array.Copy(values, result, values.Length);\n        return result;\n#else\n        return Enum.GetValues<TEnum>();\n#endif\n    }", "docstring": "/// <summary>", "url": "https://github.com/SimonCropp/Polyfill/blob/b3fc2b19ec553e6971f8bb688d0116c8b61f6788/src/Polyfill/EnumPolyfill.cs#L23-L34", "sha": "b3fc2b19ec553e6971f8bb688d0116c8b61f6788"}500{"repo_name": "Polyfill", "dataset": "github_2023", "owner": "SimonCropp", "lang": "csharp", "func_name": "Polyfill.GetStreamAsync", "code": "public static async Task<Stream> GetStreamAsync(\n        this HttpClient target,\n        string requestUri,\n        CancellationToken cancellationToken = default)\n    {\n        try\n        {\n            // Must not be disposed for the stream to be usable\n            var response = await target.GetAsync(\n                requestUri,\n                HttpCompletionOption.ResponseHeadersRead,\n                cancellationToken\n            ).ConfigureAwait(false);\n\n            response.EnsureSuccessStatusCode();\n\n            return await response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);\n        }\n        // Older versions of HttpClient methods don't propagate the cancellation token inside the exception\n        catch (OperationCanceledException ex) when (\n            ex.CancellationToken != cancellationToken &&\n            cancellationToken.IsCancellationRequested)\n        {\n            throw new OperationCanceledException(ex.Message, ex.InnerException, cancellationToken);\n        }\n    }", "docstring": "/// <summary>", "url": "https://github.com/SimonCropp/Polyfill/blob/b3fc2b19ec553e6971f8bb688d0116c8b61f6788/src/Polyfill/Polyfill_HttpClient.cs#L23-L48", "sha": "b3fc2b19ec553e6971f8bb688d0116c8b61f6788"}501{"repo_name": "Polyfill", "dataset": "github_2023", "owner": "SimonCropp", "lang": "csharp", "func_name": "Polyfill.SaveAsync", "code": "public static Task SaveAsync(\n        this XDocument target,\n        XmlWriter writer,\n        CancellationToken cancellationToken)\n    {\n        cancellationToken.ThrowIfCancellationRequested();\n        target.Save(writer);\n        return Task.CompletedTask;\n    }", "docstring": "/// <summary>", "url": "https://github.com/SimonCropp/Polyfill/blob/b3fc2b19ec553e6971f8bb688d0116c8b61f6788/src/Polyfill/Polyfill_XDocument.cs#L26-L34", "sha": "b3fc2b19ec553e6971f8bb688d0116c8b61f6788"}502{"repo_name": "Polyfill", "dataset": "github_2023", "owner": "SimonCropp", "lang": "csharp", "func_name": "OperatingSystemPolyfill.IsOSPlatform", "code": "public static bool IsOSPlatform(string platform) =>\n#if NET5_0_OR_GREATER\n        OperatingSystem.IsOSPlatform(platform);\n#else\n        RuntimeInformation.IsOSPlatform(OSPlatform.Create(platform));\n#endif\n\n    /// <summary>\n    /// Checks if the operating system version is greater than or equal to the specified platform version. This method can be used to guard APIs that were added in the specified OS version.\n    /// </summary>\n    /// <param name=\"platform\">The case-insensitive platform name. Examples: Browser, Linux, FreeBSD, Android, iOS, macOS, tvOS, watchOS, Windows.</param>\n    /// <param name=\"major\">The major release number.</param>\n    /// <param name=\"minor\">The minor release number (optional).</param>\n    /// <param name=\"build\">The build release number (optional).</param>\n    /// <param name=\"revision\">The revision release number (optional).</param>\n    /// <returns>true if the current application is running on the specified platform and is at least in the version specified in the parameters; false otherwise.</returns>\n    ///Link: https://learn.microsoft.com/en-us/dotnet/api/system.operatingsystem.isosplatformversionatleast", "docstring": "/// <summary>", "url": "https://github.com/SimonCropp/Polyfill/blob/b3fc2b19ec553e6971f8bb688d0116c8b61f6788/src/Polyfill/OperatingSystemPolyfill.cs#L52-L68", "sha": "b3fc2b19ec553e6971f8bb688d0116c8b61f6788"}503{"repo_name": "Polyfill", "dataset": "github_2023", "owner": "SimonCropp", "lang": "csharp", "func_name": "UIntPolyfill.TryParse", "code": "public static bool TryParse(string? target, IFormatProvider? provider, out uint result) =>\n#if NET7_0_OR_GREATER\n        uint.TryParse(target, provider, out result);\n#else\n        uint.TryParse(target, NumberStyles.Integer, provider, out result);\n#endif", "docstring": "/// <summary>", "url": "https://github.com/SimonCropp/Polyfill/blob/b3fc2b19ec553e6971f8bb688d0116c8b61f6788/src/Polyfill/Numbers/UIntPolyfill.cs#L23-L28", "sha": "b3fc2b19ec553e6971f8bb688d0116c8b61f6788"}504{"repo_name": "grzyClothTool", "dataset": "github_2023", "owner": "grzybeek", "lang": "csharp", "func_name": "CutFloatValueEventArgs.ReadXml", "code": "public override void ReadXml(XmlNode node)\n        {\n            base.ReadXml(node);\n            fValue = Xml.GetChildFloatAttribute(node, \"fValue\", \"value\");\n        }", "docstring": "// PsoDataType.Float, 32, 0, 0)", "url": "https://github.com/grzybeek/grzyClothTool/blob/4f0ddcfffadcf3fbf8a4529b084c90bf464a81b5/CodeWalker/CodeWalker.Core/GameFiles/FileTypes/CutFile.cs#L984-L988", "sha": "4f0ddcfffadcf3fbf8a4529b084c90bf464a81b5"}505{"repo_name": "grzyClothTool", "dataset": "github_2023", "owner": "grzybeek", "lang": "csharp", "func_name": "CutVehicleExtraEventArgs.ReadXml", "code": "public override void ReadXml(XmlNode node)\n        {\n            base.ReadXml(node);\n            pExtraBoneIds = Xml.GetChildRawIntArray(node, \"pExtraBoneIds\");\n        }", "docstring": "// PsoDataType.Array, 40, 0, (MetaName)3)//ARRAYINFO, PsoDataType.SInt, 0, 0, 0),", "url": "https://github.com/grzybeek/grzyClothTool/blob/4f0ddcfffadcf3fbf8a4529b084c90bf464a81b5/CodeWalker/CodeWalker.Core/GameFiles/FileTypes/CutFile.cs#L1181-L1185", "sha": "4f0ddcfffadcf3fbf8a4529b084c90bf464a81b5"}506{"repo_name": "grzyClothTool", "dataset": "github_2023", "owner": "grzybeek", "lang": "csharp", "func_name": "AnimSequence.EvaluateQuaternionType7", "code": "public Quaternion EvaluateQuaternionType7(int frame)\n        {\n            if (!IsType7Quat)\n            {\n                return new Quaternion(\n                    Channels[0].EvaluateFloat(frame),\n                    Channels[1].EvaluateFloat(frame),\n                    Channels[2].EvaluateFloat(frame),\n                    Channels[3].EvaluateFloat(frame)\n                );\n            }\n\n            var t7 = Channels[3] as AnimChannelCachedQuaternion;//type 1\n            if (t7 == null) t7 = Channels[4] as AnimChannelCachedQuaternion;//type 2\n\n            var x = Channels[0].EvaluateFloat(frame);\n            var y = Channels[1].EvaluateFloat(frame);\n            var z = Channels[2].EvaluateFloat(frame);\n            var normalized = t7.EvaluateFloat(frame);\n\n            switch (t7.QuatIndex)\n            {\n                case 0:\n                    return new Quaternion(normalized, x, y, z);\n                case 1:\n                    return new Quaternion(x, normalized, y, z);\n                case 2:\n                    return new Quaternion(x, y, normalized, z);\n                case 3:\n                    return new Quaternion(x, y, z, normalized);\n                default:\n                    return Quaternion.Identity;\n            }\n        }", "docstring": "//for convenience", "url": "https://github.com/grzybeek/grzyClothTool/blob/4f0ddcfffadcf3fbf8a4529b084c90bf464a81b5/CodeWalker/CodeWalker.Core/GameFiles/Resources/Clip.cs#L2171-L2204", "sha": "4f0ddcfffadcf3fbf8a4529b084c90bf464a81b5"}507{"repo_name": "grzyClothTool", "dataset": "github_2023", "owner": "grzybeek", "lang": "csharp", "func_name": "FbxIO.Read", "code": "public static FbxDocument Read(byte[] data)\n        {\n            using (var stream = new MemoryStream(data))\n            {\n                var isbinary = FbxBinary.IsBinary(stream);\n                if (isbinary)\n                {\n                    var reader = new FbxBinaryReader(stream);\n                    return reader.Read();\n                }\n                else //try ASCII\n                {\n                    var reader = new FbxAsciiReader(stream);\n                    return reader.Read();\n                }\n            }\n        }", "docstring": "/// <summary>", "url": "https://github.com/grzybeek/grzyClothTool/blob/4f0ddcfffadcf3fbf8a4529b084c90bf464a81b5/CodeWalker/CodeWalker.Core/Utils/Fbx.cs#L35-L51", "sha": "4f0ddcfffadcf3fbf8a4529b084c90bf464a81b5"}508{"repo_name": "grzyClothTool", "dataset": "github_2023", "owner": "grzybeek", "lang": "csharp", "func_name": "Program.Main", "code": "[STAThread]\n        static void Main(string[] args)\n        {\n            //Application.SetHighDpiMode(HighDpiMode.SystemAware);\n            Application.EnableVisualStyles();\n            Application.SetCompatibleTextRenderingDefault(false);\n\n            // Always check the GTA folder first thing\n            if (!GTAFolder.UpdateGTAFolder(Properties.Settings.Default.RememberGTAFolder))\n            {\n                MessageBox.Show(\"Could not load CodeWalker because no valid GTA 5 folder was selected. CodeWalker will now exit.\", \"GTA 5 Folder Not Found\", MessageBoxButtons.OK, MessageBoxIcon.Stop);\n                return;\n            }\n#if !DEBUG\n            try\n            {\n#endif\n#if !DEBUG\n            }\n            catch (Exception ex)\n            {\n                MessageBox.Show(\"An unexpected error was encountered!\\n\" + ex.ToString());\n                //this can happen if folder wasn't chosen, or in some other catastrophic error. meh.\n            }\n#endif\n        }", "docstring": "/// <summary>", "url": "https://github.com/grzybeek/grzyClothTool/blob/4f0ddcfffadcf3fbf8a4529b084c90bf464a81b5/CodeWalker/CodeWalker/Program.cs#L18-L43", "sha": "4f0ddcfffadcf3fbf8a4529b084c90bf464a81b5"}509{"repo_name": "DatasetHelpers", "dataset": "github_2023", "owner": "Particle1904", "lang": "csharp", "func_name": "PromptGeneratorService.GeneratePromptFromDataset", "code": "public string GeneratePromptFromDataset(string[] tags, string prependTags, string appendTags, int amountOfTags)\n        {\n            _stringBuilder.Clear();\n\n            if (!string.IsNullOrEmpty(prependTags))\n            {\n                _stringBuilder.Append(prependTags);\n                _stringBuilder.Append(\", \");\n            }\n\n            for (int i = 0; i < amountOfTags; i++)\n            {\n                string tag = tags[_random.Next(tags.Length)];\n                _stringBuilder.Append(tag);\n                if (i != amountOfTags - 1)\n                {\n                    _stringBuilder.Append(\", \");\n                }\n            }\n\n            if (!string.IsNullOrEmpty(appendTags))\n            {\n                _stringBuilder.Append(\", \");\n                _stringBuilder.Append(appendTags);\n            }\n\n            string prompt = _stringBuilder.ToString().Replace(\", , \", \", \").Replace(\", ,\", \", \").Replace(\"  \", \" \");\n            return prompt;\n        }", "docstring": "/// <summary>", "url": "https://github.com/Particle1904/DatasetHelpers/blob/f55d0567c227a6eec658f597384439056e47762f/SmartData.Lib/Services/PromptGeneratorService.cs#L39-L67", "sha": "f55d0567c227a6eec658f597384439056e47762f"}510{"repo_name": "DatasetHelpers", "dataset": "github_2023", "owner": "Particle1904", "lang": "csharp", "func_name": "TagProcessorService.ProcessAllTagFiles", "code": "public async Task ProcessAllTagFiles(string inputFolderPath, string tagsToAdd, string tagsToEmphasize, string tagsToRemove)\n        {\n            string[] files = Utilities.GetFilesByMultipleExtensions(inputFolderPath, _txtSearchPattern);\n            CancellationToken cancellationToken = _cancellationTokenSource.Token;\n\n            TotalFilesChanged?.Invoke(this, files.Length);\n\n            foreach (string file in files)\n            {\n                cancellationToken.ThrowIfCancellationRequested();\n\n                string readTags = await File.ReadAllTextAsync(file);\n                string processedTags = ProcessListOfTags(readTags, tagsToAdd, tagsToEmphasize, tagsToRemove);\n                await File.WriteAllTextAsync(file, processedTags);\n                ProgressUpdated?.Invoke(this, EventArgs.Empty);\n            }\n        }", "docstring": "/// <summary>", "url": "https://github.com/Particle1904/DatasetHelpers/blob/f55d0567c227a6eec658f597384439056e47762f/SmartData.Lib/Services/TagProcessorService.cs#L152-L168", "sha": "f55d0567c227a6eec658f597384439056e47762f"}511{"repo_name": "aibpm.plus", "dataset": "github_2023", "owner": "leooneone", "lang": "csharp", "func_name": "StartActivityService.Submit", "code": "public override async Task<ActivityOutput> Submit(InstanceDataInput input)\n        {\n\n            InstanceEntity instance = null;\n\n            WorkflowTemplateEntity tpl = null;\n            ActivityModel currentActivity = null;\n            var workItemId = 0l;\n            var workItem = default(WorkItemEntity);\n            if (input.Type == QueryType.WorkItem)\n            {\n                workItem = await _workItemRepository.GetAsync(input.WorkItemId);\n                if (workItem == null)\n                    throw ResultOutput.Exception(\"่ฏฅๅทฅไฝœ้กนไธๅญ˜ๅœจใ€‚\");\n                else\n                {\n                    if (workItem.ParticipantId != User.Id)\n                    {//ๅŽ็ปญ่€ƒ่™‘ๅง”ๆ‰˜ๅŠž็†ๅ’Œ็ฎก็†ๅ‘˜ๆƒ้™ๅฏไปฅไปฃไธบๆ“ไฝœ\n                        //throw ResultOutput.Exception(\"ๆ‚จไธๆ˜ฏ่ฏฅ่Š‚็‚นๅฎกๆ‰นไบบ๏ผŒๆ— ๆƒ่ฟ›่กŒๆญคๆ“ไฝœ๏ผ\");\n                    }\n                    if (workItem.State > ActivityState.UnRead)\n                    {\n                        throw ResultOutput.Exception(\"่ฏฅๅทฅไฝœ้กนๅฝ“ๅ‰ไธๅฏๆ“ไฝœใ€‚\");\n                    }\n                    tpl = await _workflowTemplateRepository.GetAsync(workItem.WorkflowTemplateId);\n                    instance = await _instanceRepository.GetAsync(workItem.InstanceId);\n                    currentActivity = _activityService.GetActivity(tpl, workItem.ActivityId);\n\n                    if (!input.IsSaveOnly)\n                        ValidInput(input, tpl);\n\n                    workItemId=input.WorkItemId;\n\n                }\n            }\n            else\n            if (input.Type == QueryType.Template)\n            {\n                tpl = await _workflowTemplateRepository.GetAsync(input.TemplateId);\n\n                if (input.InstanceId <= 0)\n                {//ๅฆ‚ๆžœ่ฟ˜ๆฒกๆœ‰ๅˆ›ๅปบๅฎžไพ‹๏ผŒๅ…ˆๅˆ›ๅปบๅฎžไพ‹\n\n                    instance = new InstanceEntity();\n                    instance.FormModel = JsonConvert.SerializeObject(input.Form);\n\n                    instance.TemplateId = input.TemplateId;\n                    instance.GroupId = tpl.GroupId;\n                    instance.Name = $\"{User.Name}ๅ‘่ตท็š„ใ€Ž{tpl.Name}ใ€ๆต็จ‹\";\n                    instance.OUId = input.OUId;\n                    instance.InitiatorId = User.Id;\n                    if (!input.IsSaveOnly)\n                    ///ไป…ไฟๅญ˜็š„่ฏไธๅญ˜ๅ‚จๆต็จ‹ๅฎžไพ‹\n                    {\n                        instance.State = InstanceState.Running;\n                        var setting = await base.GetSetting();\n                        instance.ReferenceNo = AiliCould.Core.BPM.Helper.ReferenceNoHelper.GetNo(setting.ReferenceNoSetting, \"\");\n                    }\n                    else\n                        instance.State = InstanceState.UnInitiated;\n                    var res = await _instanceRepository.InsertAsync(instance);\n\n                }\n                currentActivity = _activityService.GetActivity(tpl, input.ActivityCode);\n                {//ๆฒ’ๆœ‰ๅ‰ตๅปบ workItem ๅ‰‡ๅ‰ตๅปบ workItem\n                    workItem = await AddCurrentWorkItem(instance, tpl, currentActivity,input.IsSaveOnly);\n                    //ๅฎŒๆˆๅฝ“ๅ‰่Š‚็‚นๅทฅไฝœ้กน็›ฎ\n\n                }\n                  workItemId = workItem.Id;\n            }\n\n\n            if (string.IsNullOrEmpty(instance.ReferenceNo) && !input.IsSaveOnly)\n            {\n                var setting = await base.GetSetting();\n                 \n                instance.ReferenceNo = AiliCould.Core.BPM.Helper.ReferenceNoHelper.GetNo(setting.ReferenceNoSetting, \"\");\n                instance.State = InstanceState.Running;\n            }\n\n            ///ๆ นๆฎ่กจๅ•่ฎพ็ฝฎ็š„ๆƒ้™ๆ›ดๆ–ฐ่กจๅ•\n            var formModel = _activityService.UpdateForm(instance.FormModel, currentActivity.Permission, input.Form);\n\n            instance.FormModel = JsonConvert.SerializeObject(formModel);\n            ///ๆ›ดๆ–ฐ่กจๅ•ไฟกๆฏ\n            await _instanceRepository.UpdateAsync(instance);\n            if (input.IsSaveOnly)\n                return null;\n            else\n            {\n                await FinishWorkItem(workItemId, input.Comment, input.ApprovalResult);\n                return new ActivityOutput\n                {\n                    Instance = instance,\n                    Template = tpl,\n                    OptionalParticipants = input.OptionalParticipants,\n                    FormModel = formModel,\n                    CurrentActivity = currentActivity\n\n                };\n\n            }\n\n\n        }", "docstring": "/// <summary>", "url": "https://github.com/leooneone/aibpm.plus/blob/00b7e0f9274fbdeefd1686d65bd9ac414a1ebaf5/Modules/AI/AI.BPM/Services/BPM/Activity/Activities/StartActivityService.cs#L40-L145", "sha": "00b7e0f9274fbdeefd1686d65bd9ac414a1ebaf5"}512{"repo_name": "aibpm.plus", "dataset": "github_2023", "owner": "leooneone", "lang": "csharp", "func_name": "RoleRepository.GetChildIdListAsync", "code": "public async Task<List<long>> GetChildIdListAsync(long id)\n    {\n        return await Select\n        .Where(a => a.Id == id)\n        .AsTreeCte()\n        .ToListAsync(a => a.Id);\n    }", "docstring": "/// <summary>", "url": "https://github.com/leooneone/aibpm.plus/blob/00b7e0f9274fbdeefd1686d65bd9ac414a1ebaf5/src/platform/ZhonTai.Admin/Repositories/Role/RoleRepository.cs#L20-L26", "sha": "00b7e0f9274fbdeefd1686d65bd9ac414a1ebaf5"}513{"repo_name": "aibpm.plus", "dataset": "github_2023", "owner": "leooneone", "lang": "csharp", "func_name": "UserOrgRepository.HasUser", "code": "public async Task<bool> HasUser(long id)\n    {\n        return await Select.Where(a => a.OrgId == id).AnyAsync();\n    }", "docstring": "/// <summary>", "url": "https://github.com/leooneone/aibpm.plus/blob/00b7e0f9274fbdeefd1686d65bd9ac414a1ebaf5/src/platform/ZhonTai.Admin/Repositories/UserOrg/UserOrgRepository.cs#L20-L23", "sha": "00b7e0f9274fbdeefd1686d65bd9ac414a1ebaf5"}514{"repo_name": "aibpm.plus", "dataset": "github_2023", "owner": "leooneone", "lang": "csharp", "func_name": "CacheService.GetList", "code": "public List<dynamic> GetList()\n    {\n        var list = new List<dynamic>();\n\n        var appConfig = LazyGetRequiredService<AppConfig>();\n        Assembly[] assemblies = AssemblyHelper.GetAssemblyList(appConfig.AssemblyNames);\n\n        foreach (Assembly assembly in assemblies)\n        {\n            var types = assembly.GetExportedTypes().Where(a => a.GetCustomAttribute<ScanCacheKeysAttribute>(false) != null);\n            foreach (Type type in types)\n            {\n                var fields = type.GetFields(BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy);\n                foreach (FieldInfo field in fields)\n                {\n                    var descriptionAttribute = field.GetCustomAttributes(typeof(DescriptionAttribute), false).FirstOrDefault() as DescriptionAttribute;\n\n                    list.Add(new\n                    {\n                        field.Name,\n                        Value = field.GetRawConstantValue().ToString(),\n                        descriptionAttribute?.Description\n                    });\n                }\n            }\n        }\n\n        return list;\n    }", "docstring": "/// <summary>", "url": "https://github.com/leooneone/aibpm.plus/blob/00b7e0f9274fbdeefd1686d65bd9ac414a1ebaf5/src/platform/ZhonTai.Admin/Services/Cache/CacheService.cs#L32-L60", "sha": "00b7e0f9274fbdeefd1686d65bd9ac414a1ebaf5"}515{"repo_name": "aibpm.plus", "dataset": "github_2023", "owner": "leooneone", "lang": "csharp", "func_name": "ConfigHelper.Load", "code": "public static IConfiguration Load(string fileName, string environmentName = \"\", bool optional = true, bool reloadOnChange = false)\n    {\n        var filePath = Path.Combine(AppContext.BaseDirectory, \"Configs\");\n        if (!Directory.Exists(filePath))\n            return null;\n\n        var builder = new ConfigurationBuilder()\n            .SetBasePath(filePath)\n            .AddJsonFile(fileName.ToLower() + \".json\", optional, reloadOnChange);\n\n        if (environmentName.NotNull())\n        {\n            builder.AddJsonFile(fileName.ToLower() + \".\" + environmentName + \".json\", optional: optional, reloadOnChange: reloadOnChange);\n        }\n\n        return builder.Build();\n    }", "docstring": "/* ไฝฟ็”จ็ƒญๆ›ดๆ–ฐ\n    var uploadConfig = new ConfigHelper().Load(\"uploadconfig\", _env.EnvironmentName, true);\n    services.Configure<UploadConfig>(uploadConfig);\n\n    private readonly UploadConfig _uploadConfig;\n    public ImgController(IOptionsMonitor<UploadConfig> uploadConfig)\n    {\n        _uploadConfig = uploadConfig.CurrentValue;\n    }\n    */", "url": "https://github.com/leooneone/aibpm.plus/blob/00b7e0f9274fbdeefd1686d65bd9ac414a1ebaf5/src/platform/ZhonTai.Common/Helpers/ConfigHelper.cs#L31-L47", "sha": "00b7e0f9274fbdeefd1686d65bd9ac414a1ebaf5"}516{"repo_name": "aibpm.plus", "dataset": "github_2023", "owner": "leooneone", "lang": "csharp", "func_name": "PasswordHelper.Verify", "code": "public static bool Verify(string input)\n    {\n        if (input.IsNull())\n        {\n            return false;\n        }\n\n        return RegexPassword().IsMatch(input);\n    }", "docstring": "/// <summary>", "url": "https://github.com/leooneone/aibpm.plus/blob/00b7e0f9274fbdeefd1686d65bd9ac414a1ebaf5/src/platform/ZhonTai.Common/Helpers/PasswordHelper.cs#L19-L27", "sha": "00b7e0f9274fbdeefd1686d65bd9ac414a1ebaf5"}517{"repo_name": "RazorSlices", "dataset": "github_2023", "owner": "DamianEdwards", "lang": "csharp", "func_name": "RazorSlice.Write", "code": "protected void Write(char? value)\n    {\n        if (value.HasValue)\n        {\n            WriteUtf8SpanFormattable(value.Value);\n        }\n    }", "docstring": "/// <summary>", "url": "https://github.com/DamianEdwards/RazorSlices/blob/cf2e413551e49c3a3b40623ce020d678697f123a/src/RazorSlices/RazorSlice.Formattables.cs#L28-L34", "sha": "cf2e413551e49c3a3b40623ce020d678697f123a"}518{"repo_name": "p4vfs", "dataset": "github_2023", "owner": "microsoft", "lang": "csharp", "func_name": "ServiceInfo.IsServiceRunning", "code": "public static bool IsServiceRunning(string serviceName)\n        {\n            return IsServiceRunning(Environment.MachineName, serviceName);\n        }", "docstring": "/// <summary>", "url": "https://github.com/microsoft/p4vfs/blob/10d93293a4846b4fee3267f9a6da38f8fd5c5a66/source/P4VFS.Extensions/Source/Utilities/ServiceInfo.cs#L58-L61", "sha": "10d93293a4846b4fee3267f9a6da38f8fd5c5a66"}519{"repo_name": "VisualChatGPTStudio", "dataset": "github_2023", "owner": "jeffdapaz", "lang": "csharp", "func_name": "DiffView.ShowDiffViewAsync", "code": "public static async System.Threading.Tasks.Task ShowDiffViewAsync(string filePath, string originalCode, string optimizedCode)\n        {\n            string extension = System.IO.Path.GetExtension(filePath).TrimStart('.');\n\n            string tempFolder = System.IO.Path.GetTempPath();\n            string tempFilePath1 = System.IO.Path.Combine(tempFolder, $\"Original.{extension}\");\n            string tempFilePath2 = System.IO.Path.Combine(tempFolder, $\"Optimized.{extension}\");\n\n            System.IO.File.WriteAllText(tempFilePath1, originalCode);\n            System.IO.File.WriteAllText(tempFilePath2, optimizedCode);\n\n            DTE dte = await VS.GetServiceAsync<DTE, DTE>();\n\n            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();\n\n            dte.ExecuteCommand(\"Tools.DiffFiles\", $\"\\\"{tempFilePath1}\\\" \\\"{tempFilePath2}\\\"\");\n        }", "docstring": "/// <summary>", "url": "https://github.com/jeffdapaz/VisualChatGPTStudio/blob/b393c71d8c8ddeb12d13c5a77e63caf39cd734ab/VisualChatGPTStudioShared/Utils/DiffView.cs#L17-L33", "sha": "b393c71d8c8ddeb12d13c5a77e63caf39cd734ab"}520{"repo_name": "FramePFX", "dataset": "github_2023", "owner": "AngryCarrot789", "lang": "csharp", "func_name": "ResourceObjectUtils.AddItemAndRet", "code": "public static T AddItemAndRet<T>(this ResourceFolder folder, T item) where T : BaseResource {\n        folder.AddItem(item);\n        return item;\n    }", "docstring": "/// <summary>", "url": "https://github.com/AngryCarrot789/FramePFX/blob/73f9ddb9ddfa9a50755f78bbfcbc19ef45ce61b8/FramePFX/Editing/ResourceManaging/ResourceObjectUtils.cs#L29-L32", "sha": "73f9ddb9ddfa9a50755f78bbfcbc19ef45ce61b8"}521{"repo_name": "FramePFX", "dataset": "github_2023", "owner": "AngryCarrot789", "lang": "csharp", "func_name": "ActivityTask.GetAwaiter", "code": "public new TaskAwaiter<T> GetAwaiter() => this.Task.GetAwaiter();", "docstring": "/// <inheritdoc cref=\"ActivityTask.GetAwaiter\"/>", "url": "https://github.com/AngryCarrot789/FramePFX/blob/73f9ddb9ddfa9a50755f78bbfcbc19ef45ce61b8/FramePFX/Tasks/ActivityTask.cs#L168-L168", "sha": "73f9ddb9ddfa9a50755f78bbfcbc19ef45ce61b8"}522{"repo_name": "FramePFX", "dataset": "github_2023", "owner": "AngryCarrot789", "lang": "csharp", "func_name": "ArrayUtils.Hash", "code": "public static int Hash<T>(T[] array) {\n        if (array == null)\n            return 0;\n\n        IEqualityComparer<T> comparer = EqualityComparer<T>.Default;\n        int result = 1;\n        foreach (T t in array) {\n            result = 31 * result + comparer.GetHashCode(t);\n        }\n\n        return result;\n    }", "docstring": "// Using IEqualityComparer + generic functions is easier than having", "url": "https://github.com/AngryCarrot789/FramePFX/blob/73f9ddb9ddfa9a50755f78bbfcbc19ef45ce61b8/FramePFX/Utils/ArrayUtils.cs#L29-L40", "sha": "73f9ddb9ddfa9a50755f78bbfcbc19ef45ce61b8"}523{"repo_name": "FramePFX", "dataset": "github_2023", "owner": "AngryCarrot789", "lang": "csharp", "func_name": "TypeUtils.instanceof", "code": "public static bool instanceof(this Type left, Type right) {\n        return right.IsAssignableFrom(left);\n    }", "docstring": "/// <summary>", "url": "https://github.com/AngryCarrot789/FramePFX/blob/73f9ddb9ddfa9a50755f78bbfcbc19ef45ce61b8/FramePFX/Utils/TypeUtils.cs#L33-L35", "sha": "73f9ddb9ddfa9a50755f78bbfcbc19ef45ce61b8"}524{"repo_name": "FramePFX", "dataset": "github_2023", "owner": "AngryCarrot789", "lang": "csharp", "func_name": "InheritanceDictionary.GetEffectiveValue", "code": "public T? GetEffectiveValue(Type key) {\n        return this.GetOrCreateEntryInternal(key).inheritedItem;\n    }", "docstring": "/// <summary>", "url": "https://github.com/AngryCarrot789/FramePFX/blob/73f9ddb9ddfa9a50755f78bbfcbc19ef45ce61b8/FramePFX/Utils/Collections/InheritanceDictionary.cs#L96-L98", "sha": "73f9ddb9ddfa9a50755f78bbfcbc19ef45ce61b8"}525{"repo_name": "FramePFX", "dataset": "github_2023", "owner": "AngryCarrot789", "lang": "csharp", "func_name": "ObservableItemProcessor.MakeSimple", "code": "public static ObservableItemProcessorSimple<T> MakeSimple<T>(IObservableList<T> list, Action<T>? onItemAdded, Action<T>? onItemRemoved) {\n        return new ObservableItemProcessorSimple<T>(list, onItemAdded, onItemRemoved);\n    }", "docstring": "/// <summary>", "url": "https://github.com/AngryCarrot789/FramePFX/blob/73f9ddb9ddfa9a50755f78bbfcbc19ef45ce61b8/FramePFX/Utils/Collections/Observable/ObservableItemProcessor.cs#L40-L42", "sha": "73f9ddb9ddfa9a50755f78bbfcbc19ef45ce61b8"}526{"repo_name": "FramePFX", "dataset": "github_2023", "owner": "AngryCarrot789", "lang": "csharp", "func_name": "RateLimitedDispatchAction.InvokeAsync", "code": "public void InvokeAsync(T param) {\n        _ = Interlocked.Exchange(ref this.currentValue, new ObjectWrapper(param));\n        base.InvokeAsyncCore();\n    }", "docstring": "// An object wrapper is required in order to permit InvokeAsync being called with a null value.", "url": "https://github.com/AngryCarrot789/FramePFX/blob/73f9ddb9ddfa9a50755f78bbfcbc19ef45ce61b8/FramePFX/Utils/RDA/RateLimitedDispatchAction.cs#L321-L324", "sha": "73f9ddb9ddfa9a50755f78bbfcbc19ef45ce61b8"}527{"repo_name": "ThingsGateway", "dataset": "github_2023", "owner": "ThingsGateway", "lang": "csharp", "func_name": "ImportExportService.ExportAsync", "code": "public async Task<FileStreamResult> ExportAsync<T>(object input, string fileName, bool isDynamicExcelColumn = true) where T : class\n    {\n\n        var path = ImportExportUtil.GetFileDir(ref fileName);\n\n        fileName = CommonUtils.GetSingleId() + fileName;\n        var filePath = Path.Combine(path, fileName);\n        using (FileStream fs = new(filePath, FileMode.Create))\n        {\n            await fs.ExportExcel<T>(input, isDynamicExcelColumn).ConfigureAwait(false);\n        }\n        var result = _fileService.GetFileStreamResult(filePath, fileName);\n        return result;\n    }", "docstring": "/// <summary>", "url": "https://github.com/ThingsGateway/ThingsGateway/blob/c355968addb85577c008fc6ea9ba5b58e08ce784/src/Admin/ThingsGateway.Admin.Application/Services/ImportExport/ImportExportService.cs#L38-L51", "sha": "c355968addb85577c008fc6ea9ba5b58e08ce784"}528{"repo_name": "ThingsGateway", "dataset": "github_2023", "owner": "ThingsGateway", "lang": "csharp", "func_name": "SessionService.PageAsync", "code": "public async Task<QueryData<SessionOutput>> PageAsync(QueryPageOptions option)\n    {\n        var ret = new QueryData<SessionOutput>()\n        {\n            IsSorted = option.SortOrder != SortOrder.Unset,\n            IsFiltered = option.Filters.Count > 0,\n            IsAdvanceSearch = option.AdvanceSearches.Count > 0 || option.CustomerSearches.Count > 0,\n            IsSearch = option.Searches.Count > 0\n        };\n        var dataScope = await SysUserService.GetCurrentUserDataScopeAsync().ConfigureAwait(false);\n\n        using var db = GetDB();\n        var query = db.GetQuery<SysUser>(option)\n            .WhereIF(dataScope != null && dataScope?.Count > 0, u => dataScope.Contains(u.OrgId))//ๅœจๆŒ‡ๅฎšๆœบๆž„ๅˆ—่กจๆŸฅ่ฏข\n            .WhereIF(dataScope?.Count == 0, u => u.CreateUserId == UserManager.UserId)\n            .WhereIF(!option.SearchText.IsNullOrWhiteSpace(), a => a.Account.Contains(option.SearchText!));\n\n        if (option.IsPage)\n        {\n            RefAsync<int> totalCount = 0;\n\n            var items = await query.ToPageListAsync(option.PageIndex, option.PageItems, totalCount).ConfigureAwait(false);\n\n            var verificatInfoDicts = _verificatInfoService.GetListByUserIds(items.Select(a => a.Id).ToList()).GroupBy(a => a.UserId).ToDictionary(a => a.Key, a => a.ToList());\n\n            var r = items.Select((it) =>\n            {\n                var reuslt = it.Adapt<SessionOutput>();\n                if (verificatInfoDicts.TryGetValue(it.Id, out var verificatInfos))\n                {\n                    SessionService.GetTokenInfos(verificatInfos);//่Žทๅ–ๅ‰ฉไฝ™ๆ—ถ้—ด\n                    reuslt.VerificatCount = verificatInfos.Count;//ไปค็‰Œๆ•ฐ้‡\n                    reuslt.VerificatSignList = verificatInfos;//ไปค็‰Œๅˆ—่กจ\n\n                    //ๅฆ‚ๆžœๆœ‰mqttๅฎขๆˆท็ซฏIDๅฐฑๆ˜ฏๅœจ็บฟ\n                    reuslt.Online = verificatInfos.Any(it => it.ClientIds.Count > 0);\n                }\n\n                return reuslt;\n            }).ToList();\n\n            ret.TotalCount = totalCount;\n            ret.Items = r;\n        }\n        else if (option.IsVirtualScroll)\n        {\n            RefAsync<int> totalCount = 0;\n\n            var items = await query.ToPageListAsync(option.StartIndex, option.PageItems, totalCount).ConfigureAwait(false);\n            var verificatInfoDicts = _verificatInfoService.GetListByUserIds(items.Select(a => a.Id).ToList()).GroupBy(a => a.UserId).ToDictionary(a => a.Key, a => a.ToList());\n\n            var r = items.Select((it) =>\n            {\n                var reuslt = it.Adapt<SessionOutput>();\n                if (verificatInfoDicts.TryGetValue(it.Id, out var verificatInfos))\n                {\n                    SessionService.GetTokenInfos(verificatInfos);//่Žทๅ–ๅ‰ฉไฝ™ๆ—ถ้—ด\n                    reuslt.VerificatCount = verificatInfos.Count;//ไปค็‰Œๆ•ฐ้‡\n                    reuslt.VerificatSignList = verificatInfos;//ไปค็‰Œๅˆ—่กจ\n\n                    //ๅฆ‚ๆžœๆœ‰mqttๅฎขๆˆท็ซฏIDๅฐฑๆ˜ฏๅœจ็บฟ\n                    reuslt.Online = verificatInfos.Any(it => it.ClientIds.Count > 0);\n                }\n\n                return reuslt;\n            }).ToList();\n            ret.TotalCount = totalCount;\n            ret.Items = r;\n        }\n        else\n        {\n            var items = await query.ToListAsync().ConfigureAwait(false);\n\n            var verificatInfoDicts = _verificatInfoService.GetListByUserIds(items.Select(a => a.Id).ToList()).GroupBy(a => a.UserId).ToDictionary(a => a.Key, a => a.ToList());\n\n            var r = items.Select((it) =>\n            {\n                var reuslt = it.Adapt<SessionOutput>();\n                if (verificatInfoDicts.TryGetValue(it.Id, out var verificatInfos))\n                {\n                    SessionService.GetTokenInfos(verificatInfos);//่Žทๅ–ๅ‰ฉไฝ™ๆ—ถ้—ด\n                    reuslt.VerificatCount = verificatInfos.Count;//ไปค็‰Œๆ•ฐ้‡\n                    reuslt.VerificatSignList = verificatInfos;//ไปค็‰Œๅˆ—่กจ\n\n                    //ๅฆ‚ๆžœๆœ‰mqttๅฎขๆˆท็ซฏIDๅฐฑๆ˜ฏๅœจ็บฟ\n                    reuslt.Online = verificatInfos.Any(it => it.ClientIds.Count > 0);\n                }\n\n                return reuslt;\n            }).ToList();\n            ret.TotalCount = items.Count;\n            ret.Items = r;\n        }\n        return ret;\n    }", "docstring": "/// <summary>", "url": "https://github.com/ThingsGateway/ThingsGateway/blob/c355968addb85577c008fc6ea9ba5b58e08ce784/src/Admin/ThingsGateway.Admin.Application/Services/Session/SessionService.cs#L47-L141", "sha": "c355968addb85577c008fc6ea9ba5b58e08ce784"}529{"repo_name": "ThingsGateway", "dataset": "github_2023", "owner": "ThingsGateway", "lang": "csharp", "func_name": "ConfigurableOptionsServiceCollectionExtensions.AddConfigurableOptions", "code": "public static IServiceCollection AddConfigurableOptions<TOptions>(this IServiceCollection services)\n        where TOptions : class, IConfigurableOptions\n    {\n        var optionsType = typeof(TOptions);\n\n        // ่Žทๅ–้€‰้กน้…็ฝฎ\n        var (optionsSettings, path) = Penetrates.GetOptionsConfiguration(optionsType);\n\n        // ้…็ฝฎ้€‰้กน๏ผˆๅซ้ชŒ่ฏไฟกๆฏ๏ผ‰\n        var configurationRoot = App.Configuration;\n        var optionsConfiguration = configurationRoot.GetSection(path);\n\n        // ้…็ฝฎ้€‰้กน็›‘ๅฌ\n        if (typeof(IConfigurableOptionsListener<TOptions>).IsAssignableFrom(optionsType))\n        {\n            var onListenerMethod = optionsType.GetMethod(nameof(IConfigurableOptionsListener<TOptions>.OnListener));\n            if (onListenerMethod != null)\n            {\n                // ็›‘ๅฌๅ…จๅฑ€้…็ฝฎๆ”นๅ˜๏ผŒ็›ฎๅ‰่ฏฅๆ–นๅผๅญ˜ๅœจ่งฆๅ‘ไธคๆฌก็š„ bug๏ผšhttps://github.com/dotnet/aspnetcore/issues/2542\n                ChangeToken.OnChange(() => configurationRoot.GetReloadToken(), ((Action)(() =>\n                {\n                    var options = optionsConfiguration.Get<TOptions>();\n                    if (options != null) onListenerMethod.Invoke(options, new object[] { options, optionsConfiguration });\n                })).Debounce());\n            }\n        }\n\n        var optionsConfigure = services.AddOptions<TOptions>()\n              .Bind(optionsConfiguration, options =>\n              {\n                  options.BindNonPublicProperties = true; // ็ป‘ๅฎš็งๆœ‰ๅ˜้‡\n              })\n              .ValidateDataAnnotations()\n              .ValidateOnStart();\n\n        // ๅฎž็Žฐ Key ๆ˜ ๅฐ„\n        services.PostConfigureAll<TOptions>(options =>\n        {\n            // ๆŸฅๆ‰พๆ‰€ๆœ‰่ดดไบ† MapSettings ็š„้”ฎๅ€ผๅฏน\n            var remapKeys = optionsType.GetProperties(BindingFlags.Instance | BindingFlags.Public)\n                                                           .Where(u => u.IsDefined(typeof(MapSettingsAttribute), true));\n            if (!remapKeys.Any()) return;\n\n            foreach (var prop in remapKeys)\n            {\n                var propType = prop.PropertyType;\n                var realKey = prop.GetCustomAttribute<MapSettingsAttribute>(true).Path;\n                var realValue = configurationRoot.GetValue(propType, $\"{path}:{realKey}\");\n                prop.SetValue(options, realValue);\n            }\n        });\n\n        // ้…็ฝฎๅคๆ‚้ชŒ่ฏๅŽๅŽๆœŸ้…็ฝฎ\n        var validateInterface = optionsType.GetInterfaces()\n            .FirstOrDefault(u => u.IsGenericType && typeof(IConfigurableOptions).IsAssignableFrom(u.GetGenericTypeDefinition()));\n        if (validateInterface != null)\n        {\n            var genericArguments = validateInterface.GenericTypeArguments;\n\n            // ้…็ฝฎๅคๆ‚้ชŒ่ฏ\n            if (genericArguments.Length > 1)\n            {\n                services.TryAddEnumerable(ServiceDescriptor.Singleton(typeof(IValidateOptions<TOptions>), genericArguments.Last()));\n            }\n\n            // ้…็ฝฎๅŽๆœŸ้…็ฝฎ\n            var postConfigureMethod = optionsType.GetMethod(nameof(IConfigurableOptions<TOptions>.PostConfigure));\n            if (postConfigureMethod != null)\n            {\n                if (optionsSettings?.PostConfigureAll != true)\n                    optionsConfigure.PostConfigure(options => postConfigureMethod.Invoke(options, new object[] { options, optionsConfiguration }));\n                else\n                    services.PostConfigureAll<TOptions>(options => postConfigureMethod.Invoke(options, new object[] { options, optionsConfiguration }));\n            }\n        }\n\n        return services;\n    }", "docstring": "/// <summary>", "url": "https://github.com/ThingsGateway/ThingsGateway/blob/c355968addb85577c008fc6ea9ba5b58e08ce784/src/Admin/ThingsGateway.Furion/ConfigurableOptions/Extensions/ConfigurableOptionsServiceCollectionExtensions.cs#L37-L114", "sha": "c355968addb85577c008fc6ea9ba5b58e08ce784"}530{"repo_name": "ThingsGateway", "dataset": "github_2023", "owner": "ThingsGateway", "lang": "csharp", "func_name": "MD5Encryption.Compare", "code": "public static bool Compare(string text, string hash, bool uppercase = false, bool is16 = false)\n    {\n        return Compare(Encoding.UTF8.GetBytes(text), hash, uppercase, is16);\n    }", "docstring": "/// <summary>", "url": "https://github.com/ThingsGateway/ThingsGateway/blob/c355968addb85577c008fc6ea9ba5b58e08ce784/src/Admin/ThingsGateway.Furion/DataEncryption/Encryptions/MD5Encryption.cs#L31-L34", "sha": "c355968addb85577c008fc6ea9ba5b58e08ce784"}531{"repo_name": "ThingsGateway", "dataset": "github_2023", "owner": "ThingsGateway", "lang": "csharp", "func_name": "Scoped.Create", "code": "public static void Create(Action<IServiceScopeFactory, IServiceScope> handler, IServiceScopeFactory scopeFactory = default)\n    {\n        CreateAsync(async (fac, scope) =>\n        {\n            handler(fac, scope);\n            await Task.CompletedTask.ConfigureAwait(false);\n        }, scopeFactory).GetAwaiter().GetResult();\n    }", "docstring": "/// <summary>", "url": "https://github.com/ThingsGateway/ThingsGateway/blob/c355968addb85577c008fc6ea9ba5b58e08ce784/src/Admin/ThingsGateway.Furion/DependencyInjection/Scoped.cs#L27-L34", "sha": "c355968addb85577c008fc6ea9ba5b58e08ce784"}532{"repo_name": "ThingsGateway", "dataset": "github_2023", "owner": "ThingsGateway", "lang": "csharp", "func_name": "NewtonsoftJsonExtensions.AddDateTimeTypeConverters", "code": "public static IList<JsonConverter> AddDateTimeTypeConverters(this IList<JsonConverter> converters, string outputFormat = \"yyyy-MM-dd HH:mm:ss\", bool localized = false)\n    {\n        converters.Add(new NewtonsoftJsonDateTimeJsonConverter(outputFormat, localized));\n        converters.Add(new NewtonsoftNullableJsonDateTimeJsonConverter(outputFormat, localized));\n\n        converters.Add(new NewtonsoftJsonDateTimeOffsetJsonConverter(outputFormat, localized));\n        converters.Add(new NewtonsoftJsonNullableDateTimeOffsetJsonConverter(outputFormat, localized));\n\n        return converters;\n    }", "docstring": "/// <summary>", "url": "https://github.com/ThingsGateway/ThingsGateway/blob/c355968addb85577c008fc6ea9ba5b58e08ce784/src/Admin/ThingsGateway.Furion/JsonSerialization/Extensions/NewtonsoftJsonExtensions.cs#L29-L38", "sha": "c355968addb85577c008fc6ea9ba5b58e08ce784"}533{"repo_name": "ThingsGateway", "dataset": "github_2023", "owner": "ThingsGateway", "lang": "csharp", "func_name": "SpecificationDocumentServiceCollectionExtensions.AddSpecificationDocuments", "code": "public static IMvcBuilder AddSpecificationDocuments(this IMvcBuilder mvcBuilder, Action<SwaggerGenOptions> configure = default)\n    {\n        mvcBuilder.Services.AddSpecificationDocuments(configure);\n\n        return mvcBuilder;\n    }", "docstring": "/// <summary>", "url": "https://github.com/ThingsGateway/ThingsGateway/blob/c355968addb85577c008fc6ea9ba5b58e08ce784/src/Admin/ThingsGateway.Furion/SpecificationDocument/Extensions/SpecificationDocumentServiceCollectionExtensions.cs#L33-L38", "sha": "c355968addb85577c008fc6ea9ba5b58e08ce784"}534{"repo_name": "ThingsGateway", "dataset": "github_2023", "owner": "ThingsGateway", "lang": "csharp", "func_name": "UnifyResultServiceCollectionExtensions.AddUnifyResult", "code": "public static IMvcBuilder AddUnifyResult(this IMvcBuilder mvcBuilder)\n    {\n        mvcBuilder.Services.AddUnifyResult<RESTfulResultProvider>();\n\n        return mvcBuilder;\n    }", "docstring": "/// <summary>", "url": "https://github.com/ThingsGateway/ThingsGateway/blob/c355968addb85577c008fc6ea9ba5b58e08ce784/src/Admin/ThingsGateway.Furion/UnifyResult/Extensions/UnifyResultServiceCollectionExtensions.cs#L32-L37", "sha": "c355968addb85577c008fc6ea9ba5b58e08ce784"}535{"repo_name": "ThingsGateway", "dataset": "github_2023", "owner": "ThingsGateway", "lang": "csharp", "func_name": "NewObjectExtensions.GetAssembly", "code": "internal static Assembly? GetAssembly(this object? obj) => obj?.GetType().Assembly;", "docstring": "/// <summary>", "url": "https://github.com/ThingsGateway/ThingsGateway/blob/c355968addb85577c008fc6ea9ba5b58e08ce784/src/Admin/ThingsGateway.Furion/V5_Experience/Core/Extensions/ObjectExtensions.cs#L35-L35", "sha": "c355968addb85577c008fc6ea9ba5b58e08ce784"}536{"repo_name": "ThingsGateway", "dataset": "github_2023", "owner": "ThingsGateway", "lang": "csharp", "func_name": "HttpMultipartFormDataBuilderDeclarativeExtractor.Extract", "code": "public void Extract(HttpRequestBuilder httpRequestBuilder, HttpDeclarativeExtractorContext context)\n    {\n        // ๅฐ่ฏ•่งฃๆžๅ•ไธช Action<HttpMultipartFormDataBuilder> ็ฑปๅž‹ๅ‚ๆ•ฐ\n        if (context.Args.SingleOrDefault(u => u is Action<HttpMultipartFormDataBuilder>) is not\n            Action<HttpMultipartFormDataBuilder> multipartFormDataBuilderAction)\n        {\n            return;\n        }\n\n        // ๅค„็†ๅ’Œ [Multipart] ็‰นๆ€งๅ†ฒ็ช้—ฎ้ข˜\n        if (httpRequestBuilder.MultipartFormDataBuilder is not null)\n        {\n            multipartFormDataBuilderAction.Invoke(httpRequestBuilder.MultipartFormDataBuilder);\n        }\n        else\n        {\n            // ่ฎพ็ฝฎๅคš้ƒจๅˆ†่กจๅ•ๅ†…ๅฎน\n            httpRequestBuilder.SetMultipartContent(multipartFormDataBuilderAction);\n        }\n    }", "docstring": "/// <inheritdoc />", "url": "https://github.com/ThingsGateway/ThingsGateway/blob/c355968addb85577c008fc6ea9ba5b58e08ce784/src/Admin/ThingsGateway.Furion/V5_Experience/HttpRemote/Declarative/Extractors/HttpMultipartFormDataBuilderDeclarativeExtractor.cs#L20-L39", "sha": "c355968addb85577c008fc6ea9ba5b58e08ce784"}537{"repo_name": "ThingsGateway", "dataset": "github_2023", "owner": "ThingsGateway", "lang": "csharp", "func_name": "FileUtil.ReadFile", "code": "public static string ReadFile(string Path, Encoding? encoding = default)\n    {\n        encoding ??= Encoding.UTF8;\n        if (!File.Exists(Path))\n        {\n            return null;\n        }\n\n        StreamReader streamReader = new StreamReader(Path, encoding);\n        string result = streamReader.ReadToEnd();\n        streamReader.Close();\n        streamReader.Dispose();\n        return result;\n    }", "docstring": "/// <summary>", "url": "https://github.com/ThingsGateway/ThingsGateway/blob/c355968addb85577c008fc6ea9ba5b58e08ce784/src/Admin/ThingsGateway.NewLife.X/Common/FileUtil.cs#L23-L36", "sha": "c355968addb85577c008fc6ea9ba5b58e08ce784"}538{"repo_name": "ThingsGateway", "dataset": "github_2023", "owner": "ThingsGateway", "lang": "csharp", "func_name": "InIConfigProvider.Init", "code": "public override void Init(String value)\n    {\n        // ๅŠ ไธŠ้ป˜่ฎคๅŽ็ผ€\n        if (!value.IsNullOrEmpty() && Path.GetExtension(value).IsNullOrEmpty()) value += \".ini\";\n\n        base.Init(value);\n    }", "docstring": "/// <summary>ๅˆๅง‹ๅŒ–</summary>", "url": "https://github.com/ThingsGateway/ThingsGateway/blob/c355968addb85577c008fc6ea9ba5b58e08ce784/src/Admin/ThingsGateway.NewLife.X/Configuration/IniConfigProvider.cs#L13-L19", "sha": "c355968addb85577c008fc6ea9ba5b58e08ce784"}539{"repo_name": "ThingsGateway", "dataset": "github_2023", "owner": "ThingsGateway", "lang": "csharp", "func_name": "MD5PasswordProvider.Hash", "code": "public String Hash(String password) => password.MD5();", "docstring": "/// <summary>ๅฏนๅฏ†็ ่ฟ›่กŒๆ•ฃๅˆ—ๅค„็†๏ผŒๆญคๅค„ๅฏไปฅๅŠ ็›๏ผŒ็ป“ๆžœไฟๅญ˜ๅœจๆ•ฐๆฎๅบ“</summary>", "url": "https://github.com/ThingsGateway/ThingsGateway/blob/c355968addb85577c008fc6ea9ba5b58e08ce784/src/Admin/ThingsGateway.NewLife.X/Security/IPasswordProvider.cs#L41-L41", "sha": "c355968addb85577c008fc6ea9ba5b58e08ce784"}540{"repo_name": "ThingsGateway", "dataset": "github_2023", "owner": "ThingsGateway", "lang": "csharp", "func_name": "VariableObjectSourceGenerator.Initialize", "code": "public void Initialize(GeneratorInitializationContext context)\n    {\n        //Debugger.Launch();\n        context.RegisterForPostInitialization(a =>\n        {\n            a.AddSource(nameof(m_generatorVariableAttribute), m_generatorVariableAttribute);\n        });\n        context.RegisterForSyntaxNotifications(() => new VariableSyntaxReceiver());\n    }", "docstring": "/// <inheritdoc/>", "url": "https://github.com/ThingsGateway/ThingsGateway/blob/c355968addb85577c008fc6ea9ba5b58e08ce784/src/Foundation/ThingsGateway.Foundation.SourceGenerator/SourceGenerator/VariableObjectSourceGenerator.cs#L53-L61", "sha": "c355968addb85577c008fc6ea9ba5b58e08ce784"}541{"repo_name": "ThingsGateway", "dataset": "github_2023", "owner": "ThingsGateway", "lang": "csharp", "func_name": "RuntimeInfoController.GetChannelListAsync", "code": "[HttpGet(\"channelList\")]\n    [DisplayName(\"่Žทๅ–้€š้“ไฟกๆฏ\")]\n    public async Task<SqlSugarPagedList<ChannelRuntime>> GetChannelListAsync(ChannelPageInput input)\n    {\n\n        var channelRuntimes = await GlobalData.GetCurrentUserChannels().ConfigureAwait(false);\n\n        var data = channelRuntimes\n         .Select(a => a.Value)\n         .WhereIF(!string.IsNullOrEmpty(input.Name), u => u.Name.Contains(input.Name))\n         .WhereIF(!string.IsNullOrEmpty(input.PluginName), u => u.PluginName == input.PluginName)\n         .WhereIF(input.PluginType != null, u => u.PluginType == input.PluginType)\n         .ToPagedList(input);\n        return data;\n    }", "docstring": "/// <summary>", "url": "https://github.com/ThingsGateway/ThingsGateway/blob/c355968addb85577c008fc6ea9ba5b58e08ce784/src/Gateway/ThingsGateway.Gateway.Application/Controller/RuntimeInfoController.cs#L37-L51", "sha": "c355968addb85577c008fc6ea9ba5b58e08ce784"}542{"repo_name": "ThingsGateway", "dataset": "github_2023", "owner": "ThingsGateway", "lang": "csharp", "func_name": "UpdateZipFileInfo.OnInitialized", "code": "protected override void OnInitialized()\n    {\n        base.OnInitialized();\n        HeaderText = ManagementLocalizer[nameof(HeaderText)];\n    }", "docstring": "/// <inheritdoc/>", "url": "https://github.com/ThingsGateway/ThingsGateway/blob/c355968addb85577c008fc6ea9ba5b58e08ce784/src/Gateway/ThingsGateway.Management/Update/Update/UpdateZipFileInfo.razor.cs#L42-L46", "sha": "c355968addb85577c008fc6ea9ba5b58e08ce784"}543{"repo_name": "ExifGlass", "dataset": "github_2023", "owner": "d2phap", "lang": "csharp", "func_name": "UpdateModel.Deserialize", "code": "public static UpdateModel Deserialize(string json)\n    {\n        var obj = JsonSerializer.Deserialize(json, UpdateModelJsonContext.Default.UpdateModel);\n\n        return obj;\n    }", "docstring": "/// <summary>", "url": "https://github.com/d2phap/ExifGlass/blob/ca73fd2105de29b7f6bec9f82f715b51cdbebc82/Source/ExifGlass.Core/Settings/UpdateModel.cs#L48-L53", "sha": "ca73fd2105de29b7f6bec9f82f715b51cdbebc82"}544{"repo_name": "BONELAB-Fusion", "dataset": "github_2023", "owner": "Lakatrazz", "lang": "csharp", "func_name": "SteamServerStats.RequestUserStatsAsync", "code": "public static async Task<Result> RequestUserStatsAsync(SteamId steamid)\n        {\n            var r = await Internal.RequestUserStats(steamid);\n            if (!r.HasValue) return Result.Fail;\n            return r.Value.Result;\n        }", "docstring": "/// <summary>", "url": "https://github.com/Lakatrazz/BONELAB-Fusion/blob/8889d7008e90c36cdcb8ba6bdf15a499d8f17ebb/LabFusion/dependencies/Facepunch.Steamworks/SteamServerStats.cs#L18-L23", "sha": "8889d7008e90c36cdcb8ba6bdf15a499d8f17ebb"}545{"repo_name": "Unity-ImageLoader", "dataset": "github_2023", "owner": "IvanMurzak", "lang": "csharp", "func_name": "ImageLoader.DiskCacheContains", "code": "public static bool DiskCacheContains(string url) => File.Exists(DiskCachePath(url));", "docstring": "/// <summary>", "url": "https://github.com/IvanMurzak/Unity-ImageLoader/blob/8f9ebd0e03a8d465adfc659b9124a504fba3c177/Assets/_PackageRoot/Runtime/ImageLoader.DiskCache.cs#L52-L52", "sha": "8f9ebd0e03a8d465adfc659b9124a504fba3c177"}546{"repo_name": "XCSkillEditor_Unity", "dataset": "github_2023", "owner": "smartgrass", "lang": "csharp", "func_name": "ServerClientAttributeProcessor.InjectGuardParameters", "code": "static void InjectGuardParameters(MethodDefinition md, ILProcessor worker, Instruction top)\n        {\n            int offset = md.Resolve().IsStatic ? 0 : 1;\n            for (int index = 0; index < md.Parameters.Count; index++)\n            {\n                ParameterDefinition param = md.Parameters[index];\n                if (param.IsOut)\n                {\n                    TypeReference elementType = param.ParameterType.GetElementType();\n\n                    md.Body.Variables.Add(new VariableDefinition(elementType));\n                    md.Body.InitLocals = true;\n\n                    worker.InsertBefore(top, worker.Create(OpCodes.Ldarg, index + offset));\n                    worker.InsertBefore(top, worker.Create(OpCodes.Ldloca_S, (byte)(md.Body.Variables.Count - 1)));\n                    worker.InsertBefore(top, worker.Create(OpCodes.Initobj, elementType));\n                    worker.InsertBefore(top, worker.Create(OpCodes.Ldloc, md.Body.Variables.Count - 1));\n                    worker.InsertBefore(top, worker.Create(OpCodes.Stobj, elementType));\n                }\n            }\n        }", "docstring": "// this is required to early-out from a function with \"ref\" or \"out\" parameters", "url": "https://github.com/smartgrass/XCSkillEditor_Unity/blob/a1ea899b4504eff4ab64de33abf98681f4409f82/Assets/Mirror/Editor/Weaver/Processors/ServerClientAttributeProcessor.cs#L117-L137", "sha": "a1ea899b4504eff4ab64de33abf98681f4409f82"}547{"repo_name": "XCSkillEditor_Unity", "dataset": "github_2023", "owner": "smartgrass", "lang": "csharp", "func_name": "NetworkRoomManagerExt.OnRoomServerSceneChanged", "code": "public override void OnRoomServerSceneChanged(string sceneName)\n        {\n            // spawn the initial batch of Rewards\n            if (sceneName == GameplayScene)\n            {\n                Spawner.InitialSpawn();\n            }\n        }", "docstring": "/// <summary>", "url": "https://github.com/smartgrass/XCSkillEditor_Unity/blob/a1ea899b4504eff4ab64de33abf98681f4409f82/Assets/Mirror/Examples/Room/Scripts/NetworkRoomManagerExt.cs#L16-L23", "sha": "a1ea899b4504eff4ab64de33abf98681f4409f82"}548{"repo_name": "Blazor.WebAudio", "dataset": "github_2023", "owner": "KristofferStrube", "lang": "csharp", "func_name": "BiquadFilterNode.CreateAsync", "code": "public static new async Task<BiquadFilterNode> CreateAsync(IJSRuntime jSRuntime, IJSObjectReference jSReference)\n    {\n        return await CreateAsync(jSRuntime, jSReference, new());\n    }", "docstring": "/// <inheritdoc/>", "url": "https://github.com/KristofferStrube/Blazor.WebAudio/blob/ea1acdd530ee4dc07e3efda4bc0712447b0af18a/src/KristofferStrube.Blazor.WebAudio/AudioNodes/BiquadFilterNode.cs#L21-L24", "sha": "ea1acdd530ee4dc07e3efda4bc0712447b0af18a"}549{"repo_name": "Blazor.WebAudio", "dataset": "github_2023", "owner": "KristofferStrube", "lang": "csharp", "func_name": "ChannelSplitterNode.CreateAsync", "code": "public static new async Task<ChannelSplitterNode> CreateAsync(IJSRuntime jSRuntime, IJSObjectReference jSReference)\n    {\n        return await CreateAsync(jSRuntime, jSReference, new());\n    }", "docstring": "/// <inheritdoc/>", "url": "https://github.com/KristofferStrube/Blazor.WebAudio/blob/ea1acdd530ee4dc07e3efda4bc0712447b0af18a/src/KristofferStrube.Blazor.WebAudio/AudioNodes/ChannelSplitterNode.cs#L22-L25", "sha": "ea1acdd530ee4dc07e3efda4bc0712447b0af18a"}550{"repo_name": "Blazor.WebAudio", "dataset": "github_2023", "owner": "KristofferStrube", "lang": "csharp", "func_name": "AudioParamMap.CreateAsync", "code": "public static async Task<AudioParamMap> CreateAsync(IJSRuntime jSRuntime, IJSObjectReference jSReference)\n    {\n        return await CreateAsync(jSRuntime, jSReference, new());\n    }", "docstring": "/// <inheritdoc/>", "url": "https://github.com/KristofferStrube/Blazor.WebAudio/blob/ea1acdd530ee4dc07e3efda4bc0712447b0af18a/src/KristofferStrube.Blazor.WebAudio/AudioWorklet/AudioParamMap.cs#L14-L17", "sha": "ea1acdd530ee4dc07e3efda4bc0712447b0af18a"}551{"repo_name": "nArchitecture.Core", "dataset": "github_2023", "owner": "kodlamaio-projects", "lang": "csharp", "func_name": "HashingHelper.CreatePasswordHash", "code": "public static void CreatePasswordHash(string password, out byte[] passwordHash, out byte[] passwordSalt)\n    {\n        using HMACSHA512 hmac = new();\n\n        passwordSalt = hmac.Key;\n        passwordHash = hmac.ComputeHash(Encoding.UTF8.GetBytes(password));\n    }", "docstring": "/// <summary>", "url": "https://github.com/kodlamaio-projects/nArchitecture.Core/blob/9561d89f545169c3c2078c229c3a62dddf2886ad/src/Core.Security/Hashing/HashingHelper.cs#L11-L17", "sha": "9561d89f545169c3c2078c229c3a62dddf2886ad"}552{"repo_name": "Dumpify", "dataset": "github_2023", "owner": "MoaidHathot", "lang": "csharp", "func_name": "TestExplicit.GetEnumerator", "code": "public IEnumerator GetEnumerator() => new TestEnumerator(_list);", "docstring": "//IEnumerator<KeyValuePair<string, string>> IEnumerable<KeyValuePair<string, string>>.GetEnumerator()", "url": "https://github.com/MoaidHathot/Dumpify/blob/78ef11df642fac68e6676c08c322a79ce30e25f9/src/Dumpify.Playground/Program.cs#L717-L717", "sha": "78ef11df642fac68e6676c08c322a79ce30e25f9"}553{"repo_name": "ShaderLibrary", "dataset": "github_2023", "owner": "falseeeeeeeeee", "lang": "csharp", "func_name": "WorldNormalInputsNode.DrawProperties", "code": "public override void DrawProperties()\n\t\t{\n\t\t\tbase.DrawProperties();\n\t\t\tm_perPixel = EditorGUILayoutToggleLeft( PerPixelLabelStr, m_perPixel );\n\t\t}", "docstring": "//public override void Destroy()", "url": "https://github.com/falseeeeeeeeee/ShaderLibrary/blob/5d3931c2fd7c8478c984bb2f0be2d0875d6352d2/ShaderLib_2021/Assets/Plugins/AmplifyShaderEditor/Plugins/Editor/Nodes/SurfaceShaderInputs/WorldNormalInputsNode.cs#L45-L49", "sha": "5d3931c2fd7c8478c984bb2f0be2d0875d6352d2"}554{"repo_name": "ShaderLibrary", "dataset": "github_2023", "owner": "falseeeeeeeeee", "lang": "csharp", "func_name": "CreateCustomShader.CreateShaderTemplate", "code": "private static void CreateShaderTemplate(string templatePath, string defaultFileName)\n    {\n        ProjectWindowUtil.StartNameEditingIfProjectWindowExists(0,\n            ScriptableObject.CreateInstance<ShaderAsset>(),\n            GetSelectedPathOrFallback() + \"/\" + defaultFileName,\n            null,\n            templatePath);\n    }", "docstring": "// ้€š็”จๆ–นๆณ•๏ผŒ็”จไบŽไปŽ็ป™ๅฎš็š„ๆจกๆฟ่ทฏๅพ„ๅˆ›ๅปบShader", "url": "https://github.com/falseeeeeeeeee/ShaderLibrary/blob/5d3931c2fd7c8478c984bb2f0be2d0875d6352d2/ShaderLib_2022/Assets/Plugins/CreateCustomShader/Editor/CreateCustomShader.cs#L11-L18", "sha": "5d3931c2fd7c8478c984bb2f0be2d0875d6352d2"}555{"repo_name": "ShaderLibrary", "dataset": "github_2023", "owner": "falseeeeeeeeee", "lang": "csharp", "func_name": "MainDrawer.GetPropertyHeight", "code": "public override float GetPropertyHeight(MaterialProperty prop, string label, MaterialEditor editor)\n\t\t{\n\t\t\treturn _height;\n\t\t}", "docstring": "// Call in custom shader gui", "url": "https://github.com/falseeeeeeeeee/ShaderLibrary/blob/5d3931c2fd7c8478c984bb2f0be2d0875d6352d2/ShaderLib_2022/Assets/Plugins/LightWeightShaderGUI/Editor/ShaderDrawer.cs#L91-L94", "sha": "5d3931c2fd7c8478c984bb2f0be2d0875d6352d2"}556{"repo_name": "GDC23_PracticalMobileRendering", "dataset": "github_2023", "owner": "WeakKnight", "lang": "csharp", "func_name": "FBO.Create", "code": "public static FBO Create()\n        {\n            FBO fbo = new FBO();\n            fbo.m_width  = 0;\n            fbo.m_height = 0;\n            return fbo;\n        }", "docstring": "// Create a dummy FBO", "url": "https://github.com/WeakKnight/GDC23_PracticalMobileRendering/blob/cb8f6f4e6933abe6a3d1b72c821864f239b14338/PracticalMobileRendering/Assets/Scripts/RenderPipeline/Runtime/LowLevelGraphicsAPI/FBO.cs#L149-L155", "sha": "cb8f6f4e6933abe6a3d1b72c821864f239b14338"}557{"repo_name": "GenshinGamePlay", "dataset": "github_2023", "owner": "526077247", "lang": "csharp", "func_name": "AIDecisionTree.Think", "code": "public static void Think(AIKnowledge knowledge, AIDecision decision)\n\t\t{\n\t\t\tvar conf = ConfigAIDecisionTreeCategory.Instance.Get(knowledge.DecisionArchetype);\n\t\t\tif (conf != null)\n\t\t\t{\n\t\t\t\tif (knowledge.CombatComponent != null && knowledge.CombatComponent.IsInCombat)\n\t\t\t\t{\n\t\t\t\t\tif (conf.CombatNode != null)\n\t\t\t\t\t\tHandler(knowledge, decision, conf.CombatNode);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (conf.Node != null)\n\t\t\t\t\t\tHandler(knowledge, decision, conf.Node);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "docstring": "/// <summary>", "url": "https://github.com/526077247/GenshinGamePlay/blob/5b1e4e62ebdc0b189e158ec55b3d3b4b5e3857d7/Assets/Scripts/Code/Game/Component/AI/Decision/AIDecisionTree.cs#L13-L29", "sha": "5b1e4e62ebdc0b189e158ec55b3d3b4b5e3857d7"}558{"repo_name": "GenshinGamePlay", "dataset": "github_2023", "owner": "526077247", "lang": "csharp", "func_name": "ResourcesManager.IsProcessRunning", "code": "public bool IsProcessRunning()\n        {\n            return this.loadingOp.Count > 0;\n        }", "docstring": "/// <summary>", "url": "https://github.com/526077247/GenshinGamePlay/blob/5b1e4e62ebdc0b189e158ec55b3d3b4b5e3857d7/Assets/Scripts/Code/Module/Resource/ResourcesManager.cs#L53-L56", "sha": "5b1e4e62ebdc0b189e158ec55b3d3b4b5e3857d7"}559{"repo_name": "GenshinGamePlay", "dataset": "github_2023", "owner": "526077247", "lang": "csharp", "func_name": "Writer.WriteCommonVal", "code": "[MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public void WriteCommonVal<T>(T val) =>\n            Serializer.Serialize(typeof(T), val, this, option, false);", "docstring": "/// <summary>", "url": "https://github.com/526077247/GenshinGamePlay/blob/5b1e4e62ebdc0b189e158ec55b3d3b4b5e3857d7/Assets/Scripts/ThirdParty/Nino/Serialization/Writer.Generic.cs#L16-L18", "sha": "5b1e4e62ebdc0b189e158ec55b3d3b4b5e3857d7"}560{"repo_name": "GenshinGamePlay", "dataset": "github_2023", "owner": "526077247", "lang": "csharp", "func_name": "StringMgr.Split", "code": "public static unsafe string[] Split(this ReadOnlySpan<char> str, char separator)\n        {\n            if (str.IsEmpty)\n            {\n                return Array.Empty<string>();\n            }\n\n            var indexes = ObjectPool<ExtensibleBuffer<int>>.Request();\n            var index = 0;\n            int i = 0;\n            int max = str.Length;\n            fixed (char* ptr = &str.GetPinnableReference())\n            {\n                var cPtr = ptr;\n                while (i < max)\n                {\n                    if (*cPtr++ == separator)\n                    {\n                        indexes[index++] = i;\n                    }\n\n                    i++;\n                }\n            \n                string[] ret = new string[index + 1];\n                var retSpan = ret.AsSpan();\n                \n                int start = 0;\n                \n                for (i = 0; i < index; i++)\n                {\n                    ref int end = ref indexes.Data[i];\n                    if(start >= max || start == end)\n                    {\n                        retSpan[i] = string.Empty;\n                    }\n                    else\n                    {\n                        retSpan[i] = new string(ptr, start, end - start);\n                    }\n                    start = end + 1;\n                }\n\n                if (start < max)\n                {\n                    retSpan[index] = new string(ptr, start, max - start);\n                }\n                else\n                {\n                    retSpan[index] = string.Empty;\n                }\n            \n                ObjectPool<ExtensibleBuffer<int>>.Return(indexes);\n                return ret;\n            }\n        }", "docstring": "/// <summary>", "url": "https://github.com/526077247/GenshinGamePlay/blob/5b1e4e62ebdc0b189e158ec55b3d3b4b5e3857d7/Assets/Scripts/ThirdParty/Nino/Shared/Mgr/StringMgr.cs#L15-L70", "sha": "5b1e4e62ebdc0b189e158ec55b3d3b4b5e3857d7"}561{"repo_name": "GenshinGamePlay", "dataset": "github_2023", "owner": "526077247", "lang": "csharp", "func_name": "TaskCopyBuildinFiles.CopyBuildinFilesToStreaming", "code": "private void CopyBuildinFilesToStreaming(BuildParametersContext buildParametersContext, ManifestContext manifestContext)\n\t\t{\n\t\t\tECopyBuildinFileOption option = buildParametersContext.Parameters.CopyBuildinFileOption;\n\t\t\tstring packageOutputDirectory = buildParametersContext.GetPackageOutputDirectory();\n\t\t\tstring streamingAssetsDirectory = buildParametersContext.GetStreamingAssetsDirectory();\n\t\t\tstring buildPackageName = buildParametersContext.Parameters.PackageName;\n\t\t\tstring buildPackageVersion = buildParametersContext.Parameters.PackageVersion;\n\n\t\t\t// ๅŠ ่ฝฝ่กฅไธๆธ…ๅ•\n\t\t\tPackageManifest manifest = manifestContext.Manifest;\n\n\t\t\t// ๆธ…็ฉบๆต็›ฎๅฝ•\n\t\t\tif (option == ECopyBuildinFileOption.ClearAndCopyAll || option == ECopyBuildinFileOption.ClearAndCopyByTags)\n\t\t\t{\n\t\t\t\tEditorTools.ClearFolder(streamingAssetsDirectory);\n\t\t\t}\n\t\t\t\n\t\t\tbool copy = false;\n\t\t\t// ๆ‹ท่ดๆ–‡ไปถๅˆ—่กจ๏ผˆๆ‰€ๆœ‰ๆ–‡ไปถ๏ผ‰\n\t\t\tif (option == ECopyBuildinFileOption.ClearAndCopyAll || option == ECopyBuildinFileOption.OnlyCopyAll)\n\t\t\t{\n\t\t\t\tcopy = true;\n\t\t\t\tforeach (var packageBundle in manifest.BundleList)\n\t\t\t\t{\n\t\t\t\t\tstring sourcePath = $\"{packageOutputDirectory}/{packageBundle.FileName}\";\n\t\t\t\t\tstring destPath = $\"{streamingAssetsDirectory}/{packageBundle.FileName}\";\n\t\t\t\t\tEditorTools.CopyFile(sourcePath, destPath, true);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// ๆ‹ท่ดๆ–‡ไปถๅˆ—่กจ๏ผˆๅธฆๆ ‡็ญพ็š„ๆ–‡ไปถ๏ผ‰\n\t\t\tif (option == ECopyBuildinFileOption.ClearAndCopyByTags || option == ECopyBuildinFileOption.OnlyCopyByTags)\n\t\t\t{\n\t\t\t\tstring[] tags = buildParametersContext.Parameters.CopyBuildinFileTags.Split(';');\n\t\t\t\tforeach (var packageBundle in manifest.BundleList)\n\t\t\t\t{\n\t\t\t\t\tif (packageBundle.HasTag(tags) == false)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tcopy = true;\n\t\t\t\t\tstring sourcePath = $\"{packageOutputDirectory}/{packageBundle.FileName}\";\n\t\t\t\t\tstring destPath = $\"{streamingAssetsDirectory}/{packageBundle.FileName}\";\n\t\t\t\t\tEditorTools.CopyFile(sourcePath, destPath, true);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (copy)\n\t\t\t{\n\t\t\t\t// ๆ‹ท่ด่กฅไธๆธ…ๅ•ๆ–‡ไปถ\n\t\t\t\t{\n\t\t\t\t\tstring fileName = YooAssetSettingsData.GetManifestBinaryFileName(buildPackageName, buildPackageVersion);\n\t\t\t\t\tstring sourcePath = $\"{packageOutputDirectory}/{fileName}\";\n\t\t\t\t\tstring destPath = $\"{streamingAssetsDirectory}/{fileName}\";\n\t\t\t\t\tEditorTools.CopyFile(sourcePath, destPath, true);\n\t\t\t\t}\n\n\t\t\t\t// ๆ‹ท่ด่กฅไธๆธ…ๅ•ๅ“ˆๅธŒๆ–‡ไปถ\n\t\t\t\t{\n\t\t\t\t\tstring fileName = YooAssetSettingsData.GetPackageHashFileName(buildPackageName, buildPackageVersion);\n\t\t\t\t\tstring sourcePath = $\"{packageOutputDirectory}/{fileName}\";\n\t\t\t\t\tstring destPath = $\"{streamingAssetsDirectory}/{fileName}\";\n\t\t\t\t\tEditorTools.CopyFile(sourcePath, destPath, true);\n\t\t\t\t}\n\n\t\t\t\t// ๆ‹ท่ด่กฅไธๆธ…ๅ•็‰ˆๆœฌๆ–‡ไปถ\n\t\t\t\t{\n\t\t\t\t\tstring fileName = YooAssetSettingsData.GetPackageVersionFileName(buildPackageName);\n\t\t\t\t\tstring sourcePath = $\"{packageOutputDirectory}/{fileName}\";\n\t\t\t\t\tstring destPath = $\"{streamingAssetsDirectory}/{fileName}\";\n\t\t\t\t\tEditorTools.CopyFile(sourcePath, destPath, true);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// ๅˆทๆ–ฐ็›ฎๅฝ•\n\t\t\tAssetDatabase.Refresh();\n\t\t\tBuildLogger.Log($\"ๅ†…็ฝฎๆ–‡ไปถๆ‹ท่ดๅฎŒๆˆ๏ผš{streamingAssetsDirectory}\");\n\t\t}", "docstring": "/// <summary>", "url": "https://github.com/526077247/GenshinGamePlay/blob/5b1e4e62ebdc0b189e158ec55b3d3b4b5e3857d7/Modules/com.tuyoogame.yooasset/Editor/AssetBundleBuilder/BuildTasks/TaskCopyBuildinFiles.cs#L29-L104", "sha": "5b1e4e62ebdc0b189e158ec55b3d3b4b5e3857d7"}562{"repo_name": "GenshinGamePlay", "dataset": "github_2023", "owner": "526077247", "lang": "csharp", "func_name": "RawBundleWebLoader.Update", "code": "public override void Update()\n\t\t{\n\t\t\tif (_steps == ESteps.Done)\n\t\t\t\treturn;\n\n\t\t\tif (_steps == ESteps.None)\n\t\t\t{\n\t\t\t\tif (MainBundleInfo.LoadMode == BundleInfo.ELoadMode.LoadFromRemote)\n\t\t\t\t{\n\t\t\t\t\t_steps = ESteps.Download;\n\t\t\t\t\tFileLoadPath = MainBundleInfo.Bundle.CachedDataFilePath;\n\t\t\t\t}\n\t\t\t\telse if (MainBundleInfo.LoadMode == BundleInfo.ELoadMode.LoadFromStreaming)\n\t\t\t\t{\n\t\t\t\t\t_steps = ESteps.Website;\n\t\t\t\t\tFileLoadPath = MainBundleInfo.Bundle.CachedDataFilePath;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthrow new System.NotImplementedException(MainBundleInfo.LoadMode.ToString());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// 1. ไธ‹่ฝฝ่ฟœ็ซฏๆ–‡ไปถ\n\t\t\tif (_steps == ESteps.Download)\n\t\t\t{\n\t\t\t\tint failedTryAgain = Impl.DownloadFailedTryAgain;\n\t\t\t\t_downloader = DownloadSystem.CreateDownload(MainBundleInfo, failedTryAgain);\n\t\t\t\t_downloader.SendRequest();\n\t\t\t\t_steps = ESteps.CheckDownload;\n\t\t\t}\n\n\t\t\t// 2. ๆฃ€ๆต‹ไธ‹่ฝฝ็ป“ๆžœ\n\t\t\tif (_steps == ESteps.CheckDownload)\n\t\t\t{\n\t\t\t\tDownloadProgress = _downloader.DownloadProgress;\n\t\t\t\tDownloadedBytes = _downloader.DownloadedBytes;\n\t\t\t\tif (_downloader.IsDone() == false)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (_downloader.HasError())\n\t\t\t\t{\n\t\t\t\t\t_steps = ESteps.Done;\n\t\t\t\t\tStatus = EStatus.Failed;\n\t\t\t\t\tLastError = _downloader.GetLastError();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t_steps = ESteps.CheckFile;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// 3. ไปŽ็ซ™็‚นไธ‹่ฝฝ\n\t\t\tif (_steps == ESteps.Website)\n\t\t\t{\n\t\t\t\tint failedTryAgain = Impl.DownloadFailedTryAgain;\n\t\t\t\tvar bundleInfo = ManifestTools.ConvertToUnpackInfo(MainBundleInfo.Bundle);\n\t\t\t\t_website = DownloadSystem.CreateDownload(bundleInfo, failedTryAgain);\n\t\t\t\t_website.SendRequest();\n\t\t\t\t_steps = ESteps.CheckWebsite;\n\t\t\t}\n\n\t\t\t// 4. ๆฃ€ๆต‹็ซ™็‚นไธ‹่ฝฝ\n\t\t\tif (_steps == ESteps.CheckWebsite)\n\t\t\t{\n\t\t\t\tDownloadProgress = _website.DownloadProgress;\n\t\t\t\tDownloadedBytes = _website.DownloadedBytes;\n\t\t\t\tif (_website.IsDone() == false)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (_website.HasError())\n\t\t\t\t{\n\t\t\t\t\t_steps = ESteps.Done;\n\t\t\t\t\tStatus = EStatus.Failed;\n\t\t\t\t\tLastError = _website.GetLastError();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t_steps = ESteps.CheckFile;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// 5. ๆฃ€ๆต‹็ป“ๆžœ\n\t\t\tif (_steps == ESteps.CheckFile)\n\t\t\t{\n\t\t\t\t// ่ฎพ็ฝฎไธ‹่ฝฝ่ฟ›ๅบฆ\n\t\t\t\tDownloadProgress = 1f;\n\t\t\t\tDownloadedBytes = (ulong)MainBundleInfo.Bundle.FileSize;\n\n\t\t\t\t_steps = ESteps.Done;\n\t\t\t\tif (File.Exists(FileLoadPath))\n\t\t\t\t{\n\t\t\t\t\tStatus = EStatus.Succeed;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tStatus = EStatus.Failed;\n\t\t\t\t\tLastError = $\"Raw file not found : {FileLoadPath}\";\n\t\t\t\t}\n\t\t\t}\n\t\t}", "docstring": "/// <summary>", "url": "https://github.com/526077247/GenshinGamePlay/blob/5b1e4e62ebdc0b189e158ec55b3d3b4b5e3857d7/Modules/com.tuyoogame.yooasset/Runtime/AssetSystem/Loader/RawBundleWebLoader.cs#L33-L133", "sha": "5b1e4e62ebdc0b189e158ec55b3d3b4b5e3857d7"}563{"repo_name": "GenshinGamePlay", "dataset": "github_2023", "owner": "526077247", "lang": "csharp", "func_name": "GameManager.OnHandleEventMessage", "code": "private void OnHandleEventMessage(IEventMessage message)\n\t{\n\t\tif(message is SceneEventDefine.ChangeToHomeScene)\n\t\t{\n\t\t\t_machine.ChangeState<FsmSceneHome>();\n\t\t}\n\t\telse if(message is SceneEventDefine.ChangeToBattleScene)\n\t\t{\n\t\t\t_machine.ChangeState<FsmSceneBattle>();\n\t\t}\n\t}", "docstring": "/// <summary>", "url": "https://github.com/526077247/GenshinGamePlay/blob/5b1e4e62ebdc0b189e158ec55b3d3b4b5e3857d7/Modules/com.tuyoogame.yooasset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/GameManager.cs#L53-L63", "sha": "5b1e4e62ebdc0b189e158ec55b3d3b4b5e3857d7"}564{"repo_name": "GenshinGamePlay", "dataset": "github_2023", "owner": "526077247", "lang": "csharp", "func_name": "StreamingAssetsHelper.Init", "code": "public static void Init()\n\t{\n\t\tif (_isInit == false)\n\t\t{\n\t\t\t_isInit = true;\n\t\t\tvar manifest = Resources.Load<BuildinFileManifest>(\"BuildinFileManifest\");\n\t\t\tif (manifest != null)\n\t\t\t{\n\t\t\t\tforeach (string fileName in manifest.BuildinFiles)\n\t\t\t\t{\n\t\t\t\t\t_cacheData.Add(fileName);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "docstring": "/// <summary>", "url": "https://github.com/526077247/GenshinGamePlay/blob/5b1e4e62ebdc0b189e158ec55b3d3b4b5e3857d7/Modules/com.tuyoogame.yooasset/Samples~/Space Shooter/ThirdParty/StreamingAssetsHelper/StreamingAssetsHelper.cs#L43-L57", "sha": "5b1e4e62ebdc0b189e158ec55b3d3b4b5e3857d7"}565{"repo_name": "GenshinGamePlay", "dataset": "github_2023", "owner": "526077247", "lang": "csharp", "func_name": "Double3Drawer.PopulateGenericMenu", "code": "public void PopulateGenericMenu(InspectorProperty property, GenericMenu genericMenu)\n        {\n            double3 value = (double3)property.ValueEntry.WeakSmartValue;\n            var vec = new Vector3((float)value.x, (float)value.y, (float)value.z);\n\n            if (genericMenu.GetItemCount() > 0)\n            {\n                genericMenu.AddSeparator(\"\");\n            }\n            genericMenu.AddItem(new GUIContent(\"Normalize\"), Mathf.Approximately(vec.magnitude, 1f), () => NormalizeEntries(property));\n            genericMenu.AddItem(new GUIContent(\"Zero\", \"Set the vector to (0, 0, 0)\"), vec == Vector3.zero, () => SetVector(property, Vector3.zero));\n            genericMenu.AddItem(new GUIContent(\"One\", \"Set the vector to (1, 1, 1)\"), vec == Vector3.one, () => SetVector(property, Vector3.one));\n            genericMenu.AddSeparator(\"\");\n            genericMenu.AddItem(new GUIContent(\"Right\", \"Set the vector to (1, 0, 0)\"), vec == Vector3.right, () => SetVector(property, Vector3.right));\n            genericMenu.AddItem(new GUIContent(\"Left\", \"Set the vector to (-1, 0, 0)\"), vec == Vector3.left, () => SetVector(property, Vector3.left));\n            genericMenu.AddItem(new GUIContent(\"Up\", \"Set the vector to (0, 1, 0)\"), vec == Vector3.up, () => SetVector(property, Vector3.up));\n            genericMenu.AddItem(new GUIContent(\"Down\", \"Set the vector to (0, -1, 0)\"), vec == Vector3.down, () => SetVector(property, Vector3.down));\n            genericMenu.AddItem(new GUIContent(\"Forward\", \"Set the vector property to (0, 0, 1)\"), vec == Vector3.forward, () => SetVector(property, Vector3.forward));\n            genericMenu.AddItem(new GUIContent(\"Back\", \"Set the vector property to (0, 0, -1)\"), vec == Vector3.back, () => SetVector(property, Vector3.back));\n        }", "docstring": "/// <summary>", "url": "https://github.com/526077247/GenshinGamePlay/blob/5b1e4e62ebdc0b189e158ec55b3d3b4b5e3857d7/Packages/com.thridparty.odin/Sirenix/Odin Inspector/Modules/Unity.Mathematics/MathematicsDrawers.cs#L598-L617", "sha": "5b1e4e62ebdc0b189e158ec55b3d3b4b5e3857d7"}566{"repo_name": "GenshinGamePlay", "dataset": "github_2023", "owner": "526077247", "lang": "csharp", "func_name": "TMP_SpriteAssetEditor.DisplayPageNavigation", "code": "void DisplayPageNavigation(ref int currentPage, int arraySize, int itemsPerPage)\n        {\n            Rect pagePos = EditorGUILayout.GetControlRect(false, 20);\n            pagePos.width /= 3;\n\n            int shiftMultiplier = Event.current.shift ? 10 : 1; // Page + Shift goes 10 page forward\n\n            // Previous Page\n            GUI.enabled = currentPage > 0;\n\n            if (GUI.Button(pagePos, \"Previous Page\"))\n            {\n                currentPage -= 1 * shiftMultiplier;\n                //m_isNewPage = true;\n            }\n\n            // Page Counter\n            GUI.enabled = true;\n            pagePos.x += pagePos.width;\n            int totalPages = (int)(arraySize / (float)itemsPerPage + 0.999f);\n            GUI.Label(pagePos, \"Page \" + (currentPage + 1) + \" / \" + totalPages, TMP_UIStyleManager.centeredLabel);\n\n            // Next Page\n            pagePos.x += pagePos.width;\n            GUI.enabled = itemsPerPage * (currentPage + 1) < arraySize;\n\n            if (GUI.Button(pagePos, \"Next Page\"))\n            {\n                currentPage += 1 * shiftMultiplier;\n                //m_isNewPage = true;\n            }\n\n            // Clamp page range\n            currentPage = Mathf.Clamp(currentPage, 0, arraySize / itemsPerPage);\n\n            GUI.enabled = true;\n        }", "docstring": "/// <summary>", "url": "https://github.com/526077247/GenshinGamePlay/blob/5b1e4e62ebdc0b189e158ec55b3d3b4b5e3857d7/Packages/com.unity.textmeshpro/Scripts/Editor/TMP_SpriteAssetEditor.cs#L672-L708", "sha": "5b1e4e62ebdc0b189e158ec55b3d3b4b5e3857d7"}567{"repo_name": "GenshinGamePlay", "dataset": "github_2023", "owner": "526077247", "lang": "csharp", "func_name": "TMP_MaterialManager.GetStencilMaterial", "code": "public static Material GetStencilMaterial(Material baseMaterial, int stencilID)\n        {\n            // Check if Material supports masking\n            if (!baseMaterial.HasProperty(ShaderUtilities.ID_StencilID))\n            {\n                Debug.LogWarning(\"Selected Shader does not support Stencil Masking. Please select the Distance Field or Mobile Distance Field Shader.\");\n                return baseMaterial;\n            }\n\n            int baseMaterialID = baseMaterial.GetInstanceID();\n\n            // If baseMaterial already has a corresponding masking material, return it.\n            for (int i = 0; i < m_materialList.Count; i++)\n            {\n                if (m_materialList[i].baseMaterial.GetInstanceID() == baseMaterialID && m_materialList[i].stencilID == stencilID)\n                {\n                    m_materialList[i].count += 1;\n\n                    #if TMP_DEBUG_MODE\n                    ListMaterials();\n                    #endif\n\n                    return m_materialList[i].stencilMaterial;\n                }\n            }\n\n            // No matching masking material found. Create and return a new one.\n\n            Material stencilMaterial;\n\n            //Create new Masking Material Instance for this Base Material\n            stencilMaterial = new Material(baseMaterial);\n            stencilMaterial.hideFlags = HideFlags.HideAndDontSave;\n\n            #if UNITY_EDITOR\n                stencilMaterial.name += \" Masking ID:\" + stencilID;\n            #endif\n\n            stencilMaterial.shaderKeywords = baseMaterial.shaderKeywords;\n\n            // Set Stencil Properties\n            ShaderUtilities.GetShaderPropertyIDs();\n            stencilMaterial.SetFloat(ShaderUtilities.ID_StencilID, stencilID);\n            //stencilMaterial.SetFloat(ShaderUtilities.ID_StencilOp, 0);\n            stencilMaterial.SetFloat(ShaderUtilities.ID_StencilComp, 4);\n            //stencilMaterial.SetFloat(ShaderUtilities.ID_StencilReadMask, stencilID);\n            //stencilMaterial.SetFloat(ShaderUtilities.ID_StencilWriteMask, 0);\n\n            MaskingMaterial temp = new MaskingMaterial();\n            temp.baseMaterial = baseMaterial;\n            temp.stencilMaterial = stencilMaterial;\n            temp.stencilID = stencilID;\n            temp.count = 1;\n\n            m_materialList.Add(temp);\n\n            #if TMP_DEBUG_MODE\n            ListMaterials();\n            #endif\n\n            return stencilMaterial;\n        }", "docstring": "/// <summary>", "url": "https://github.com/526077247/GenshinGamePlay/blob/5b1e4e62ebdc0b189e158ec55b3d3b4b5e3857d7/Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_MaterialManager.cs#L43-L104", "sha": "5b1e4e62ebdc0b189e158ec55b3d3b4b5e3857d7"}568{"repo_name": "GenshinGamePlay", "dataset": "github_2023", "owner": "526077247", "lang": "csharp", "func_name": "TimelineAction.Execute", "code": "public abstract bool Execute(ActionContext context);", "docstring": "/// <summary>", "url": "https://github.com/526077247/GenshinGamePlay/blob/5b1e4e62ebdc0b189e158ec55b3d3b4b5e3857d7/Packages/com.unity.timeline/Editor/Actions/TimelineAction.cs#L25-L25", "sha": "5b1e4e62ebdc0b189e158ec55b3d3b4b5e3857d7"}569{"repo_name": "GenshinGamePlay", "dataset": "github_2023", "owner": "526077247", "lang": "csharp", "func_name": "TrackAction.Execute", "code": "public abstract bool Execute(IEnumerable<TrackAsset> tracks);", "docstring": "/// <summary>", "url": "https://github.com/526077247/GenshinGamePlay/blob/5b1e4e62ebdc0b189e158ec55b3d3b4b5e3857d7/Packages/com.unity.timeline/Editor/Actions/TrackAction.cs#L27-L27", "sha": "5b1e4e62ebdc0b189e158ec55b3d3b4b5e3857d7"}570{"repo_name": "GenshinGamePlay", "dataset": "github_2023", "owner": "526077247", "lang": "csharp", "func_name": "AnimationPlayableAssetEditor.GetClipOptions", "code": "public override ClipDrawOptions GetClipOptions(TimelineClip clip)\n        {\n            var clipOptions = base.GetClipOptions(clip);\n            var asset = clip.asset as AnimationPlayableAsset;\n\n            if (asset != null)\n                clipOptions.errorText = GetErrorText(asset, clip.GetParentTrack() as AnimationTrack, clipOptions.errorText);\n\n            if (clip.recordable)\n                clipOptions.highlightColor = DirectorStyles.Instance.customSkin.colorAnimationRecorded;\n\n            return clipOptions;\n        }", "docstring": "/// <inheritdoc/>", "url": "https://github.com/526077247/GenshinGamePlay/blob/5b1e4e62ebdc0b189e158ec55b3d3b4b5e3857d7/Packages/com.unity.timeline/Editor/Animation/AnimationPlayableAssetEditor.cs#L17-L29", "sha": "5b1e4e62ebdc0b189e158ec55b3d3b4b5e3857d7"}571{"repo_name": "GenshinGamePlay", "dataset": "github_2023", "owner": "526077247", "lang": "csharp", "func_name": "TrackAsset.OnBeforeTrackSerialize", "code": "protected virtual void OnBeforeTrackSerialize() { }", "docstring": "/// <summary>", "url": "https://github.com/526077247/GenshinGamePlay/blob/5b1e4e62ebdc0b189e158ec55b3d3b4b5e3857d7/Packages/com.unity.timeline/Runtime/AssetUpgrade/TrackUpgrade.cs#L27-L27", "sha": "5b1e4e62ebdc0b189e158ec55b3d3b4b5e3857d7"}572{"repo_name": "StructuredConcurrency", "dataset": "github_2023", "owner": "StephenCleary", "lang": "csharp", "func_name": "DisposeUtility.Wrap", "code": "public static IAsyncDisposable Wrap(object? resource) => TryWrap(resource) ?? NoopDisposable.Instance;", "docstring": "/// <summary>", "url": "https://github.com/StephenCleary/StructuredConcurrency/blob/309813256331af44f15ba8add05350428f60c846/src/Nito.StructuredConcurrency/Internals/DisposeUtility.cs#L15-L15", "sha": "309813256331af44f15ba8add05350428f60c846"}573{"repo_name": "StructuredConcurrency", "dataset": "github_2023", "owner": "StephenCleary", "lang": "csharp", "func_name": "InterlockedEx.Apply", "code": "public static T Apply<T>(ref T value, Func<T, T> transformation)\n        where T : class\n    {\n        _ = transformation ?? throw new ArgumentNullException(nameof(transformation));\n\n        while (true)\n        {\n            var localValue = Interlocked.CompareExchange(ref value, null!, null!);\n            var modified = transformation(localValue);\n            if (Interlocked.CompareExchange(ref value, modified, localValue) == localValue)\n                return modified;\n        }\n    }", "docstring": "/// <summary>", "url": "https://github.com/StephenCleary/StructuredConcurrency/blob/309813256331af44f15ba8add05350428f60c846/src/Nito.StructuredConcurrency/Internals/InterlockedEx.cs#L17-L29", "sha": "309813256331af44f15ba8add05350428f60c846"}574{"repo_name": "GameFramework-Next", "dataset": "github_2023", "owner": "Alex-Rachel", "lang": "csharp", "func_name": "LogRedirection.GetStackTrace", "code": "private static string GetStackTrace()\n        {\n            // ้€š่ฟ‡ๅๅฐ„่Žทๅ–ConsoleWindow็ฑป\n            var consoleWindowType = typeof(EditorWindow).Assembly.GetType(\"UnityEditor.ConsoleWindow\");\n            // ่Žทๅ–็ช—ๅฃๅฎžไพ‹\n            var fieldInfo = consoleWindowType.GetField(\"ms_ConsoleWindow\",\n                BindingFlags.Static |\n                BindingFlags.NonPublic);\n            if (fieldInfo != null)\n            {\n                var consoleInstance = fieldInfo.GetValue(null);\n                if (consoleInstance != null)\n                    if (EditorWindow.focusedWindow == (EditorWindow)consoleInstance)\n                    {\n                        // ่Žทๅ–m_ActiveTextๆˆๅ‘˜\n                        fieldInfo = consoleWindowType.GetField(\"m_ActiveText\",\n                            BindingFlags.Instance |\n                            BindingFlags.NonPublic);\n                        // ่Žทๅ–m_ActiveText็š„ๅ€ผ\n                        if (fieldInfo != null)\n                        {\n                            var activeText = fieldInfo.GetValue(consoleInstance).ToString();\n                            return activeText;\n                        }\n                    }\n            }\n\n            return null;\n        }", "docstring": "/// <summary>", "url": "https://github.com/Alex-Rachel/GameFramework-Next/blob/4f2fbfa6fc0eb0bfa55c92fd51df295eae3de4b3/UnityProject/Assets/GameScripts/Editor/Extension/Utility/LogRedirection.cs#L95-L123", "sha": "4f2fbfa6fc0eb0bfa55c92fd51df295eae3de4b3"}575{"repo_name": "GameFramework-Next", "dataset": "github_2023", "owner": "Alex-Rachel", "lang": "csharp", "func_name": "ReleaseTools.CreateEncryptionInstance", "code": "private static IEncryptionServices CreateEncryptionInstance(string packageName, EBuildPipeline buildPipeline)\n        {\n            var encryptionClassName = AssetBundleBuilderSetting.GetPackageEncyptionClassName(packageName, buildPipeline);\n            var encryptionClassTypes = EditorTools.GetAssignableTypes(typeof(IEncryptionServices));\n            var classType = encryptionClassTypes.Find(x => x.FullName != null && x.FullName.Equals(encryptionClassName));\n            if (classType != null)\n            {\n                Debug.Log($\"Use Encryption {classType}\");\n                return (IEncryptionServices)Activator.CreateInstance(classType);\n            }\n            else\n            {\n                return null;\n            }\n        }", "docstring": "/// <summary>", "url": "https://github.com/Alex-Rachel/GameFramework-Next/blob/4f2fbfa6fc0eb0bfa55c92fd51df295eae3de4b3/UnityProject/Assets/GameScripts/Editor/ReleaseTools/ReleaseTools.cs#L165-L179", "sha": "4f2fbfa6fc0eb0bfa55c92fd51df295eae3de4b3"}576{"repo_name": "GameFramework-Next", "dataset": "github_2023", "owner": "Alex-Rachel", "lang": "csharp", "func_name": "GameApp.Entrance", "code": "public static void Entrance(object[] objects)\n    {\n        s_HotfixAssembly = (List<Assembly>)objects[0];\n        Log.Warning(\"======= ็œ‹ๅˆฐๆญคๆกๆ—ฅๅฟ—ไปฃ่กจไฝ ๆˆๅŠŸ่ฟ่กŒไบ†็ƒญๆ›ดๆ–ฐไปฃ็  =======\");\n        Log.Warning(\"======= Entrance GameApp =======\");\n        Instance.InitSystem();\n        Instance.Start();\n        Utility.Unity.AddUpdateListener(Instance.Update);\n        Utility.Unity.AddFixedUpdateListener(Instance.FixedUpdate);\n        Utility.Unity.AddLateUpdateListener(Instance.LateUpdate);\n        Utility.Unity.AddDestroyListener(Instance.OnDestroy);\n        Utility.Unity.AddOnDrawGizmosListener(Instance.OnDrawGizmos);\n        Utility.Unity.AddOnApplicationPauseListener(Instance.OnApplicationPause);\n        Instance.StartGameLogic();\n    }", "docstring": "/// <summary>", "url": "https://github.com/Alex-Rachel/GameFramework-Next/blob/4f2fbfa6fc0eb0bfa55c92fd51df295eae3de4b3/UnityProject/Assets/GameScripts/HotFix/GameLogic/GameApp.cs#L15-L29", "sha": "4f2fbfa6fc0eb0bfa55c92fd51df295eae3de4b3"}577{"repo_name": "vertical-slice-api-template", "dataset": "github_2023", "owner": "mehdihadeli", "lang": "csharp", "func_name": "AggregateIdValueConverter.Create", "code": "private static TAggregateId Create(TId id) =>\n        (\n            Activator.CreateInstance(\n                typeof(TAggregateId),\n                BindingFlags.Instance | BindingFlags.NonPublic,\n                null,\n                new object?[] { id },\n                null,\n                null\n            ) as TAggregateId\n        )!;", "docstring": "// instantiate AggregateId and pass id to its protected or private constructor", "url": "https://github.com/mehdihadeli/vertical-slice-api-template/blob/3837aefd7d6ed6bf8e32faca932a145f25f0dfb4/src/Shared/EF/Converters/AggregateIdValueConverter.cs#L15-L25", "sha": "3837aefd7d6ed6bf8e32faca932a145f25f0dfb4"}578{"repo_name": "AcrylicView.MAUI", "dataset": "github_2023", "owner": "sswi", "lang": "csharp", "func_name": "CornerFrameLayout.SetRadius", "code": "public void SetRadius(float topLeft, float topRight, float bottomRight, float bottomLeft)\n        {\n            mRadii[0] = topLeft;\n            mRadii[1] = topLeft;\n\n            mRadii[2] = topRight;\n            mRadii[3] = topRight;\n\n            mRadii[4] = bottomRight;\n            mRadii[5] = bottomRight;\n\n            mRadii[6] = bottomLeft;\n            mRadii[7] = bottomLeft;\n            Invalidate();\n        }", "docstring": "/// <summary>", "url": "https://github.com/sswi/AcrylicView.MAUI/blob/a70ec049b39ba9f5300f27c16d4bf1539e00c373/AcrylicView/Platforms/Android/Drawable/CornerFrameLayout.cs#L47-L61", "sha": "a70ec049b39ba9f5300f27c16d4bf1539e00c373"}579{"repo_name": "Template", "dataset": "github_2023", "owner": "CSharpRedotTools", "lang": "csharp", "func_name": "StateMachineComponent.SwitchState", "code": "private void SwitchState(State newState, bool callExit = true)\n    {\n        if (callExit)\n        {\n            _curState.Exit();\n        }\n\n        _curState = newState;\n        _curState.Enter();\n    }", "docstring": "/// <summary>", "url": "https://github.com/CSharpRedotTools/Template/blob/d1b39583643c63beeda68c629ecc6c76cf98df4c/Genres/2D Top Down/Scripts/Components/StateMachineComponent.cs#L39-L48", "sha": "d1b39583643c63beeda68c629ecc6c76cf98df4c"}580{"repo_name": "PotatoVN", "dataset": "github_2023", "owner": "GoldenPotato137", "lang": "csharp", "func_name": "GalStatusSyncResultHelper.ToInfoBarSeverity", "code": "public static InfoBarSeverity ToInfoBarSeverity(this GalStatusSyncResult result)\n    {\n        switch (result)\n        {\n            case GalStatusSyncResult.Ok:\n                return InfoBarSeverity.Success;\n            case GalStatusSyncResult.UnAuthorized:\n            case GalStatusSyncResult.NoId:\n            case GalStatusSyncResult.Other:\n                return InfoBarSeverity.Error;\n            case GalStatusSyncResult.NotSupported:\n                return InfoBarSeverity.Warning;\n            default:\n                return InfoBarSeverity.Error;\n        }\n    }", "docstring": "/// <summary>", "url": "https://github.com/GoldenPotato137/PotatoVN/blob/e8db00158d27c07f868cae89d9aaa5a5bd9c3349/GalgameManager/Enums/GalStatusSyncResult.cs#L24-L39", "sha": "e8db00158d27c07f868cae89d9aaa5a5bd9c3349"}581{"repo_name": "PotatoVN", "dataset": "github_2023", "owner": "GoldenPotato137", "lang": "csharp", "func_name": "NavigationHelper.NavigateToHomePage", "code": "public static void NavigateToHomePage(INavigationService navigationService, IFilterService? filterService = null,\n        IEnumerable<FilterBase>? filters = null)\n    {\n        Debug.Assert(!(filterService is null ^ filters is null)); // ๅŒๆ—ถไธบnullๆˆ–ๅŒๆ—ถไธไธบnull\n        if (filterService is not null && filters is not null)\n        {\n            filterService.ClearFilters();\n            foreach (FilterBase filter in filters)\n            {\n                filterService.AddFilter(filter);\n                if (filter is CategoryFilter c)\n                    c.Category.LastClicked = DateTime.Now;\n                if (filter is SourceFilter s)\n                    s.Source.LastClicked = DateTime.Now;\n                    \n            }\n        }\n        navigationService.NavigateTo(typeof(HomeViewModel).FullName!);\n    }", "docstring": "/// <summary>", "url": "https://github.com/GoldenPotato137/PotatoVN/blob/e8db00158d27c07f868cae89d9aaa5a5bd9c3349/GalgameManager/Helpers/NavigationHelper.cs#L34-L52", "sha": "e8db00158d27c07f868cae89d9aaa5a5bd9c3349"}582{"repo_name": "PotatoVN", "dataset": "github_2023", "owner": "GoldenPotato137", "lang": "csharp", "func_name": "TimeToDisplayTimeConverter.Convert", "code": "public static string Convert(int value)\n    {\n        var timeAsHour = App.GetService<ILocalSettingsService>().ReadSettingAsync<bool>(KeyValues.TimeAsHour).Result;\n        if (timeAsHour)\n            return value > 60 ? $\"{value / 60}h{value % 60}m\" : $\"{value}m\";\n        return $\"{value} {\"Minute\".GetLocalized()}\";\n    }", "docstring": "//ไธ้œ€่ฆ", "url": "https://github.com/GoldenPotato137/PotatoVN/blob/e8db00158d27c07f868cae89d9aaa5a5bd9c3349/GalgameManager/Helpers/Converter/TimeToDisplayTimeConverter.cs#L24-L30", "sha": "e8db00158d27c07f868cae89d9aaa5a5bd9c3349"}583{"repo_name": "PotatoVN", "dataset": "github_2023", "owner": "GoldenPotato137", "lang": "csharp", "func_name": "ObservableCollectionExtensions.SyncCollection", "code": "public static void SyncCollection<T>(this ObservableCollection<T> collection, IList<T> other, bool sort = false)\n        where T : notnull\n    {\n        // var delta = other.Count - collection.Count;\n        // for (var i = 0; i < delta; i++)\n        //     collection.Add(other[0]); //ๅ†…ๅฎนไธๆ€ป่ฆ๏ผŒๅชๆ˜ฏ่ฆๅกซๅ……ๅˆฐๅฏนๅบ”็š„ๆ€ปๆ•ฐ\n        // for (var i = delta; i < 0; i++)\n        //     collection.RemoveAt(collection.Count - 1);\n        //\n        // for (var i = 0; i < other.Count; i++) \n        //     collection[i] = other[i];\n\n        HashSet<T> toRemove = new(collection.Where(obj => !other.Contains(obj)));\n        HashSet<T> toAdd = new(other.Where(obj => !collection.Contains(obj)));\n        foreach (T obj in toRemove)\n            collection.Remove(obj);\n        foreach (T obj in toAdd)\n            collection.Add(obj);\n\n        if (!sort) return;\n        Dictionary<T, int> index = new();\n        for (var i = 0; i < other.Count; i++)\n            index[other[i]] = i;\n        collection.Sort((a, b) => index[a].CompareTo(index[b]));\n    }", "docstring": "/// <summary>", "url": "https://github.com/GoldenPotato137/PotatoVN/blob/e8db00158d27c07f868cae89d9aaa5a5bd9c3349/GalgameManager/Helpers/Extensions/ObservableCollectionExtensions.cs#L14-L38", "sha": "e8db00158d27c07f868cae89d9aaa5a5bd9c3349"}584{"repo_name": "PotatoVN", "dataset": "github_2023", "owner": "GoldenPotato137", "lang": "csharp", "func_name": "GalgameUid.Similarity", "code": "public int Similarity(GalgameUid? rhs)\n    {\n        if (rhs is null) return 0;\n        var result = 0;\n        result += !PvnId.IsNullOrEmpty() && PvnId == rhs.PvnId ? 1 : 0;\n        result += !BangumiId.IsNullOrEmpty() && BangumiId == rhs.BangumiId ? 1 : 0;\n        result += !VndbId.IsNullOrEmpty() && VndbId == rhs.VndbId ? 1 : 0;\n        result += !CnName.IsNullOrEmpty() && CnName == rhs.CnName ? 1 : 0;\n        result += Name == rhs.Name ? 1 : 0;\n        return result;\n    }", "docstring": "/// <summary>", "url": "https://github.com/GoldenPotato137/PotatoVN/blob/e8db00158d27c07f868cae89d9aaa5a5bd9c3349/GalgameManager/Models/GalgameUid.cs#L24-L34", "sha": "e8db00158d27c07f868cae89d9aaa5a5bd9c3349"}585{"repo_name": "BarcodeScanning.Native.Maui", "dataset": "github_2023", "owner": "afriscic", "lang": "csharp", "func_name": "Program.Main", "code": "static void Main(string[] args)\n\t{\n\t\t// if you want to use a different Application Delegate class from \"AppDelegate\"\n\t\t// you can specify it here.\n\t\tUIApplication.Main(args, null, typeof(AppDelegate));\n\t}", "docstring": "// This is the main entry point of the application.", "url": "https://github.com/afriscic/BarcodeScanning.Native.Maui/blob/dd51248cb791fe8b7099b5d06b6f71c9d766ea81/BarcodeScanning.Test/Platforms/iOS/Program.cs#L9-L14", "sha": "dd51248cb791fe8b7099b5d06b6f71c9d766ea81"}586{"repo_name": "AIShell", "dataset": "github_2023", "owner": "PowerShell", "lang": "csharp", "func_name": "PSConsoleReadLine.ViReplaceLine", "code": "public static void ViReplaceLine(ConsoleKeyInfo? key = null, object arg = null)\n        {\n            _singleton._groupUndoHelper.StartGroup(ViReplaceLine, arg);\n            DeleteLine(key, arg);\n            ViInsertMode(key, arg);\n        }", "docstring": "/// <summary>", "url": "https://github.com/PowerShell/AIShell/blob/8fc4c0dc16cdcf5aaefefec24e3b10ecc85c3ad0/shell/ReadLine/Replace.vi.cs#L138-L143", "sha": "8fc4c0dc16cdcf5aaefefec24e3b10ecc85c3ad0"}587{"repo_name": "AIShell", "dataset": "github_2023", "owner": "PowerShell", "lang": "csharp", "func_name": "ReplaceCommand.RegenerateAsync", "code": "private async Task<string> RegenerateAsync()\n    {\n        ArgumentPlaceholder ap = _agent.ArgPlaceholder;\n\n        // We are doing the replacement locally, but want to fake the regeneration.\n        await Task.Delay(2000, Shell.CancellationToken);\n\n        ResponseData data = ap.ResponseData;\n        _agent.ReplaceKnownPlaceholders(data);\n\n        if (data.PlaceholderSet is null)\n        {\n            _agent.ResetArgumentPlaceholder();\n        }\n\n        return _agent.GenerateAnswer(data, Shell);\n    }", "docstring": "/// <summary>", "url": "https://github.com/PowerShell/AIShell/blob/8fc4c0dc16cdcf5aaefefec24e3b10ecc85c3ad0/shell/agents/Microsoft.Azure.Agent/Command.cs#L260-L276", "sha": "8fc4c0dc16cdcf5aaefefec24e3b10ecc85c3ad0"}588{"repo_name": "elsa-studio", "dataset": "github_2023", "owner": "elsa-workflows", "lang": "csharp", "func_name": "RenderTreeBuilderExtensions.CreateComponent", "code": "public static void CreateComponent<T>(this RenderTreeBuilder builder) where T : IComponent\n    {\n        var sequence = 0;\n        CreateComponent<T>(builder, ref sequence);\n    }", "docstring": "/// <summary>", "url": "https://github.com/elsa-workflows/elsa-studio/blob/95c37625ffcdfde09f1a3244a386b0ab005cdd82/src/framework/Elsa.Studio.Core/Extensions/RenderTreeBuilderExtensions.cs#L14-L18", "sha": "95c37625ffcdfde09f1a3244a386b0ab005cdd82"}589{"repo_name": "elsa-studio", "dataset": "github_2023", "owner": "elsa-workflows", "lang": "csharp", "func_name": "ServiceCollectionExtensions.AddLoginModuleCore", "code": "public static IServiceCollection AddLoginModuleCore(this IServiceCollection services)\n    {\n        return services\n                .AddScoped<IFeature, Feature>()\n                .AddOptions()\n                .AddAuthorizationCore()\n                .AddScoped<AuthenticatingApiHttpMessageHandler>()\n                .AddScoped<AuthenticationStateProvider, AccessTokenAuthenticationStateProvider>()\n                .AddScoped<IUnauthorizedComponentProvider, RedirectToLoginUnauthorizedComponentProvider>()\n                .AddScoped<ICredentialsValidator, DefaultCredentialsValidator>()\n            ;\n    }", "docstring": "/// <summary>", "url": "https://github.com/elsa-workflows/elsa-studio/blob/95c37625ffcdfde09f1a3244a386b0ab005cdd82/src/modules/Elsa.Studio.Login/Extensions/ServiceCollectionExtensions.cs#L20-L31", "sha": "95c37625ffcdfde09f1a3244a386b0ab005cdd82"}590{"repo_name": "elsa-studio", "dataset": "github_2023", "owner": "elsa-workflows", "lang": "csharp", "func_name": "InputDescriptorCheckListExtensions.GetCheckList", "code": "public static CheckList GetCheckList(this InputDescriptor descriptor)\n    {\n        var specifications = descriptor.UISpecifications;\n        var props = specifications != null ? specifications.TryGetValue(\"checklist\", out var propsValue) ? propsValue is JsonElement value ? value : default : default : default;\n\n        if (props.ValueKind == JsonValueKind.Undefined)\n            return new CheckList(Array.Empty<CheckListItem>());\n\n        var serializerOptions = new JsonSerializerOptions\n        {\n            PropertyNamingPolicy = JsonNamingPolicy.CamelCase,\n        };\n\n        var checkListProps = props.Deserialize<CheckListProps>(serializerOptions);\n        return checkListProps?.CheckList ?? new CheckList(Array.Empty<CheckListItem>());\n    }", "docstring": "/// <summary>", "url": "https://github.com/elsa-workflows/elsa-studio/blob/95c37625ffcdfde09f1a3244a386b0ab005cdd82/src/modules/Elsa.Studio.UIHints/Extensions/InputDescriptorCheckListExtensions.cs#L15-L30", "sha": "95c37625ffcdfde09f1a3244a386b0ab005cdd82"}591{"repo_name": "elsa-studio", "dataset": "github_2023", "owner": "elsa-workflows", "lang": "csharp", "func_name": "RemoteLogPersistenceStrategyService.GetLogPersistenceStrategiesAsync", "code": "public async Task<IEnumerable<LogPersistenceStrategyDescriptor>> GetLogPersistenceStrategiesAsync(CancellationToken cancellationToken = default)\n    {\n        if (_descriptors == null)\n        {\n            var api = await backendApiClientProvider.GetApiAsync<ILogPersistenceStrategiesApi>(cancellationToken);\n            var response = await api.ListAsync(cancellationToken);\n            _descriptors = response.Items;\n        }\n\n        return _descriptors;\n    }", "docstring": "/// <inheritdoc />", "url": "https://github.com/elsa-workflows/elsa-studio/blob/95c37625ffcdfde09f1a3244a386b0ab005cdd82/src/modules/Elsa.Studio.Workflows.Core/Domain/Services/RemoteLogPersistenceStrategyService.cs#L13-L23", "sha": "95c37625ffcdfde09f1a3244a386b0ab005cdd82"}592{"repo_name": "elsa-studio", "dataset": "github_2023", "owner": "elsa-workflows", "lang": "csharp", "func_name": "RemoteWorkflowDefinitionService.ListAsync", "code": "public async Task<PagedListResponse<WorkflowDefinitionSummary>> ListAsync(ListWorkflowDefinitionsRequest request, VersionOptions? versionOptions = null, CancellationToken cancellationToken = default)\n    {\n        var api = await GetApiAsync(cancellationToken);\n        return await api.ListAsync(request, versionOptions, cancellationToken);\n    }", "docstring": "/// <inheritdoc />", "url": "https://github.com/elsa-workflows/elsa-studio/blob/95c37625ffcdfde09f1a3244a386b0ab005cdd82/src/modules/Elsa.Studio.Workflows.Core/Domain/Services/WorkflowDefinitionService.cs#L25-L29", "sha": "95c37625ffcdfde09f1a3244a386b0ab005cdd82"}593{"repo_name": "AspNetStatic", "dataset": "github_2023", "owner": "ZarehD", "lang": "csharp", "func_name": "HttpContextExtensions.IsAspNetStaticRequest", "code": "public static bool IsAspNetStaticRequest(this HttpRequest request) =>\n\t\t\t(request is not null) &&\n\t\t\trequest.Headers.TryGetValue(HeaderNames.UserAgent, out var ua) &&\n\t\t\tua.Contains(Consts.AspNetStatic);", "docstring": "/// <summary>", "url": "https://github.com/ZarehD/AspNetStatic/blob/25aced55cddc84eaf910363ec377ffef99853e7b/src/AspNetStatic/HttpContextExtensions.cs#L33-L36", "sha": "25aced55cddc84eaf910363ec377ffef99853e7b"}594{"repo_name": "AspNetStatic", "dataset": "github_2023", "owner": "ZarehD", "lang": "csharp", "func_name": "StaticGeneratorHostExtension.GenerateStaticContent", "code": "public static void GenerateStaticContent(\n\t\t\tthis IHost host,\n\t\t\tstring destinationRoot,\n\t\t\tbool exitWhenDone = default,\n\t\t\tbool alwaysDefaultFile = default,\n\t\t\tbool dontUpdateLinks = default,\n\t\t\tbool dontOptimizeContent = default,\n\t\t\tTimeSpan? regenerationInterval = default,\n\t\t\tulong httpTimeoutSeconds = c_DefaultHttpTimeoutSeconds)\n\t\t{\n\t\t\tThrow.IfNull(host);\n\t\t\tThrow.IfNullOrWhitespace(destinationRoot);\n\n\t\t\tvar fileSystem = host.Services.GetService<IFileSystem>() ?? new FileSystem();\n\n\t\t\tThrow.DirectoryNotFoundWhen(\n\t\t\t\t() => !fileSystem.Directory.Exists(destinationRoot),\n\t\t\t\tSR.Err_InvalidDestinationRoot);\n\n\t\t\tvar loggerFactory = host.Services.GetRequiredService<ILoggerFactory>();\n\t\t\tvar logger = loggerFactory.CreateLogger(nameof(StaticGeneratorHostExtension));\n\n\t\t\tvar pageUrlProvider = host.Services.GetRequiredService<IStaticResourcesInfoProvider>();\n\n\t\t\tif (!pageUrlProvider.PageResources.Any())\n\t\t\t{\n\t\t\t\tlogger.NoPagesToProcess();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar optimizerSelector = GetOptimizerSelector(host.Services, dontOptimizeContent);\n\n\t\t\tvar lifetime = host.Services.GetRequiredService<IHostApplicationLifetime>();\n\n\t\t\tlifetime.ApplicationStopping.Register(_appShutdown.Cancel);\n\n\t\t\tlifetime.ApplicationStarted.Register(\n\t\t\t\tasync () =>\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t_httpClient.BaseAddress = new Uri(GetBaseUri(host));\n\t\t\t\t\t\t_httpClient.Timeout = TimeSpan.FromSeconds(httpTimeoutSeconds);\n\t\t\t\t\t\t_httpClient.DefaultRequestHeaders.Add(HeaderNames.UserAgent, Consts.AspNetStatic);\n\n\t\t\t\t\t\tvar generatorConfig =\n\t\t\t\t\t\t\tnew StaticGeneratorConfig(\n\t\t\t\t\t\t\t\tpageUrlProvider.Resources,\n\t\t\t\t\t\t\t\tdestinationRoot,\n\t\t\t\t\t\t\t\talwaysDefaultFile,\n\t\t\t\t\t\t\t\t!dontUpdateLinks,\n\t\t\t\t\t\t\t\tpageUrlProvider.DefaultFileName,\n\t\t\t\t\t\t\t\tpageUrlProvider.PageFileExtension.EnsureStartsWith('.'),\n\t\t\t\t\t\t\t\tpageUrlProvider.DefaultFileExclusions,\n\t\t\t\t\t\t\t\t!dontOptimizeContent, optimizerSelector,\n\t\t\t\t\t\t\t\tpageUrlProvider.SkipPageResources,\n\t\t\t\t\t\t\t\tpageUrlProvider.SkipCssResources,\n\t\t\t\t\t\t\t\tpageUrlProvider.SkipJsResources,\n\t\t\t\t\t\t\t\tpageUrlProvider.SkipBinResources);\n\n\t\t\t\t\t\tlogger.RegenerationConfig(regenerationInterval);\n\t\t\t\t\t\tvar doPeriodicRefresh = regenerationInterval is not null;\n\n#if USE_PERIODIC_TIMER\n\t\t\t\t\t\tif (!_appShutdown.IsCancellationRequested)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (doPeriodicRefresh) _timer = new(regenerationInterval!.Value);\n\t\t\t\t\t\t\tdo\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tawait StaticGenerator.Execute(\n\t\t\t\t\t\t\t\t\tgeneratorConfig,\n\t\t\t\t\t\t\t\t\t_httpClient, fileSystem,\n\t\t\t\t\t\t\t\t\tloggerFactory, _appShutdown.Token)\n\t\t\t\t\t\t\t\t.ConfigureAwait(false);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\twhile (doPeriodicRefresh && await _timer.WaitForNextTickAsync(_appShutdown.Token).ConfigureAwait(false));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (exitWhenDone && !doPeriodicRefresh && !_appShutdown.IsCancellationRequested)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlogger.Exiting();\n\t\t\t\t\t\t\tawait Task.Delay(500).ConfigureAwait(false);\n\t\t\t\t\t\t\tawait host.StopAsync().ConfigureAwait(false);\n\t\t\t\t\t\t}\n#else\n\t\t\t\t\t\tawait StaticPageGenerator.Execute(\n\t\t\t\t\t\t\tgeneratorConfig,\n\t\t\t\t\t\t\t_httpClient, fileSystem,\n\t\t\t\t\t\t\tloggerFactory, _appShutdown.Token)\n\t\t\t\t\t\t\t.ConfigureAwait(false);\n\n\t\t\t\t\t\tif (doPeriodicRefresh && !_appShutdown.IsCancellationRequested)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t_timer.Interval = regenerationInterval!.Value.TotalMilliseconds;\n\t\t\t\t\t\t\t_timer.Elapsed +=\n\t\t\t\t\t\t\t\tasync (s, e) =>\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tawait StaticPageGenerator.Execute(\n\t\t\t\t\t\t\t\t\t\tgeneratorConfig,\n\t\t\t\t\t\t\t\t\t\t_httpClient, fileSystem,\n\t\t\t\t\t\t\t\t\t\tloggerFactory, _appShutdown.Token)\n\t\t\t\t\t\t\t\t\t\t.ConfigureAwait(false);\n\n\t\t\t\t\t\t\t\t\tif (_appShutdown.IsCancellationRequested)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t_timer.Stop();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t_timer.Start();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (_appShutdown.IsCancellationRequested)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t_timer.Stop();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (exitWhenDone && !doPeriodicRefresh)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlogger.Exiting();\n\t\t\t\t\t\t\tawait Task.Delay(500).ConfigureAwait(false);\n\t\t\t\t\t\t\tawait host.StopAsync().ConfigureAwait(false);\n\t\t\t\t\t\t}\n#endif\n\t\t\t\t\t}\n\t\t\t\t\tcatch (OperationCanceledException) { }\n\t\t\t\t\tcatch (Exception ex)\n\t\t\t\t\t{\n\t\t\t\t\t\tlogger.Exception(ex);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}", "docstring": "/// <summary>", "url": "https://github.com/ZarehD/AspNetStatic/blob/25aced55cddc84eaf910363ec377ffef99853e7b/src/AspNetStatic/StaticGeneratorHostExtension.cs#L86-L215", "sha": "25aced55cddc84eaf910363ec377ffef99853e7b"}595{"repo_name": "azure-search-openai-demo-csharp", "dataset": "github_2023", "owner": "Azure-Samples", "lang": "csharp", "func_name": "StringExtensions.ToCitationUrl", "code": "internal static string ToCitationUrl(this string fileName, string baseUrl)\n    {\n        var builder = new UriBuilder(baseUrl);\n        builder.Path += $\"/{fileName}\";\n        builder.Fragment = \"view-fitV\";\n\n        return builder.Uri.AbsoluteUri;\n    }", "docstring": "/// <summary>", "url": "https://github.com/Azure-Samples/azure-search-openai-demo-csharp/blob/fd451e3cef53fe0c65ae8c283d95a389e4f203bd/app/frontend/Extensions/StringExtensions.cs#L11-L18", "sha": "fd451e3cef53fe0c65ae8c283d95a389e4f203bd"}596{"repo_name": "devhomegithubextension", "dataset": "github_2023", "owner": "microsoft", "lang": "csharp", "func_name": "DeveloperIdTests.LoginUI_ControllerPATLoginTest_Success", "code": "[TestMethod]\n    [TestCategory(\"LiveData\")]\n    public async Task LoginUI_ControllerPATLoginTest_Success()\n    {\n        // Create DataRows during Runtime since these need Env vars\n        RuntimeDataRow[] dataRows =\n                                {\n                                    new()\n                                    {\n                                        InitialState = \"EnterpriseServerPATPage\",\n                                        Actions = LoginUITestData.ConnectButtonAction,\n                                        Inputs = LoginUITestData.GoodPATEnterpriseServerPATInput,\n                                        FinalState = \"LoginSucceededPage\",\n                                        HostAddress = Environment.GetEnvironmentVariable(\"DEV_HOME_TEST_GITHUB_ENTERPRISE_SERVER\"),\n                                    },\n                                    new()\n                                    {\n                                        InitialState = \"EnterpriseServerPATPage\",\n                                        Actions = LoginUITestData.ConnectButtonAction,\n                                        Inputs = LoginUITestData.GoodPATGithubComPATInput,\n                                        FinalState = \"LoginSucceededPage\",\n                                        HostAddress = \"https://api.github.com\",\n                                    },\n                                }\n            ;\n\n        foreach (RuntimeDataRow dataRow in dataRows)\n        {\n            var testExtensionAdaptiveCard = new MockExtensionAdaptiveCard(string.Empty, string.Empty, string.Empty);\n            Assert.AreEqual(0, testExtensionAdaptiveCard.UpdateCount);\n\n            // Create a LoginUIController and initialize it with the testExtensionAdaptiveCard.\n            var controller = new LoginUIController(MockDeveloperIdProvider.GetInstance());\n            Assert.AreEqual(ProviderOperationStatus.Success, controller.Initialize(testExtensionAdaptiveCard).Status);\n            Assert.AreEqual(1, testExtensionAdaptiveCard.UpdateCount);\n\n            // Set the initial state.\n            testExtensionAdaptiveCard.State = dataRow.InitialState ?? string.Empty;\n            Assert.AreEqual(dataRow.InitialState, testExtensionAdaptiveCard.State);\n\n            // Set HostAddress for EnterpriseServerPATPage to make this a valid state\n            if (dataRow.InitialState == \"EnterpriseServerPATPage\")\n            {\n                controller.HostAddress = new Uri(dataRow.HostAddress ?? string.Empty);\n                Assert.AreEqual(dataRow.HostAddress, controller.HostAddress.OriginalString);\n            }\n\n            // Call OnAction() with the actions and inputs.\n            Assert.AreEqual(ProviderOperationStatus.Success, (await controller.OnAction(dataRow.Actions ?? string.Empty, dataRow.Inputs ?? string.Empty)).Status);\n\n            // Verify the final state\n            Assert.AreEqual(dataRow.FinalState, testExtensionAdaptiveCard.State);\n            Assert.AreEqual(2, testExtensionAdaptiveCard.UpdateCount);\n\n            controller.Dispose();\n        }\n    }", "docstring": "/* This test requires the following environment variables to be set:\n     * DEV_HOME_TEST_GITHUB_ENTERPRISE_SERVER : The host address of the GitHub Enterprise Server to test against\n     * DEV_HOME_TEST_GITHUB_COM_PAT : A valid Personal Access Token for GitHub.com (with at least repo_public permissions)\n     * DEV_HOME_TEST_GITHUB_ENTERPRISE_SERVER_PAT : A valid Personal Access Token for the GitHub Enterprise Server set in DEV_HOME_TEST_GITHUB_ENTERPRISE_SERVER (with at least repo_public permissions)\n     */", "url": "https://github.com/microsoft/devhomegithubextension/blob/054645220c7e9e71dd7c75a9781d36964af346c0/test/GitHubExtension/DeveloperId/LoginUITests.cs#L149-L205", "sha": "054645220c7e9e71dd7c75a9781d36964af346c0"}597{"repo_name": "S7CommPlusDriver", "dataset": "github_2023", "owner": "thomas-v2", "lang": "csharp", "func_name": "POffsetInfoType_FbArray.IsMDim", "code": "public override bool IsMDim() { return false; }", "docstring": "//!!! TODO", "url": "https://github.com/thomas-v2/S7CommPlusDriver/blob/76ca5e78cba06628146591277adf3dfafd62ca63/src/S7CommPlusDriver/Core/POffsetInfoType.cs#L120-L120", "sha": "76ca5e78cba06628146591277adf3dfafd62ca63"}598{"repo_name": "JitHubV2", "dataset": "github_2023", "owner": "JitHubApp", "lang": "csharp", "func_name": "WebView2Ex.RegisterDragDropEvents", "code": "void RegisterDragDropEvents()\n    {\n        var manager = CoreDragDropManager.GetForCurrentView();\n        manager.TargetRequested += TargetRequested;\n    }", "docstring": "//LinkedListNode<ICoreDropOperationTarget>? thisNode;", "url": "https://github.com/JitHubApp/JitHubV2/blob/01d7d884407b4b92a51cf0a95c08e95ed2acde5d/JitHub.WebView/UI/WebView2Ex.DragDrop.cs#L26-L30", "sha": "01d7d884407b4b92a51cf0a95c08e95ed2acde5d"}599{"repo_name": "FSR3Unity", "dataset": "github_2023", "owner": "ndepoel", "lang": "csharp", "func_name": "IntParameter.Interp", "code": "public override void Interp(int from, int to, float t)\n        {\n            // Int snapping interpolation. Don't use this for enums as they don't necessarily have\n            // contiguous values. Use the default interpolator instead (same as bool).\n            value = (int)(from + (to - from) * t);\n        }", "docstring": "/// <summary>", "url": "https://github.com/ndepoel/FSR3Unity/blob/71879e71aa72465a79bdf009d7d71f9f7ab83066/Packages/com.unity.postprocessing/PostProcessing/Runtime/ParameterOverride.cs#L233-L238", "sha": "71879e71aa72465a79bdf009d7d71f9f7ab83066"}600{"repo_name": "SqlParser-cs", "dataset": "github_2023", "owner": "TylerBrinks", "lang": "csharp", "func_name": "ParserTestBase.ParseSqlStatements", "code": "public Sequence<Statement?> ParseSqlStatements(string sql, IEnumerable<Dialect> dialects, bool unescape = false, ParserOptions? options = null)\n    {\n        options ??= new ParserOptions { Unescape = unescape };\n        return OneOfIdenticalResults(dialect =>\n        {\n            options.TrailingCommas |= dialect.SupportsTrailingCommas;\n            return new Parser().ParseSql(sql, dialect, options);\n        }, dialects)!;\n    }", "docstring": "// Ensures that `sql` parses as a single statement and returns it.", "url": "https://github.com/TylerBrinks/SqlParser-cs/blob/66aea72a1cb0ed72e3f50cc4bf83326de41b93c2/src/SqlParser.Tests/ParserTestBase.cs#L172-L180", "sha": "66aea72a1cb0ed72e3f50cc4bf83326de41b93c2"}601{"repo_name": "weaver", "dataset": "github_2023", "owner": "ServiceWeaver", "lang": "go", "func_name": "logStacks", "code": "func logStacks() {\n\ttime.Sleep(time.Second) // Hack to wait for goroutines to end\n\tbuf := make([]byte, 1<<20)\n\tn := runtime.Stack(buf, true)\n\tfmt.Fprintln(os.Stderr, string(buf[:n]))\n}", "docstring": "// logStacks prints the stacks of live goroutines. This functionality\n// is disabled by default but can be enabled to find background work that\n// is not obeying cancellation.", "url": "https://github.com/ServiceWeaver/weaver/blob/656901ccf43e1ffce053e83e573643697680c223/weavertest/init.go#L327-L332", "sha": "656901ccf43e1ffce053e83e573643697680c223"}602{"repo_name": "s3cme", "dataset": "github_2023", "owner": "mchmarny", "lang": "go", "func_name": "NewColorableStderr", "code": "func NewColorableStderr() io.Writer {\n\treturn os.Stderr\n}", "docstring": "// NewColorableStderr returns new instance of Writer which handles escape sequence for stderr.", "url": "https://github.com/mchmarny/s3cme/blob/f540c5d245ff91d37e7b4ebcf558d00fa0ecab81/vendor/github.com/mattn/go-colorable/colorable_others.go#L28-L30", "sha": "f540c5d245ff91d37e7b4ebcf558d00fa0ecab81"}603{"repo_name": "s3cme", "dataset": "github_2023", "owner": "mchmarny", "lang": "go", "func_name": "Pause", "code": "func Pause() (err error) {\n\t_, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/mchmarny/s3cme/blob/f540c5d245ff91d37e7b4ebcf558d00fa0ecab81/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go#L393-L399", "sha": "f540c5d245ff91d37e7b4ebcf558d00fa0ecab81"}604{"repo_name": "s3cme", "dataset": "github_2023", "owner": "mchmarny", "lang": "go", "func_name": "pwrite", "code": "func pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 *byte\n\tif len(p) > 0 {\n\t\t_p0 = &p[0]\n\t}\n\tvar _p1 int\n\t_p1 = len(p)\n\tr0, er := C.pwrite64(C.int(fd), C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1), C.longlong(offset))\n\tn = int(r0)\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/mchmarny/s3cme/blob/f540c5d245ff91d37e7b4ebcf558d00fa0ecab81/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc.go#L981-L994", "sha": "f540c5d245ff91d37e7b4ebcf558d00fa0ecab81"}605{"repo_name": "s3cme", "dataset": "github_2023", "owner": "mchmarny", "lang": "go", "func_name": "callfstatat", "code": "func callfstatat(dirfd int, _p0 uintptr, stat uintptr, flags int) (r1 uintptr, e1 Errno) {\n\tr1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_fstatat)), 4, uintptr(dirfd), _p0, stat, uintptr(flags), 0, 0)\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/mchmarny/s3cme/blob/f540c5d245ff91d37e7b4ebcf558d00fa0ecab81/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gc.go#L814-L817", "sha": "f540c5d245ff91d37e7b4ebcf558d00fa0ecab81"}606{"repo_name": "s3cme", "dataset": "github_2023", "owner": "mchmarny", "lang": "go", "func_name": "calltruncate", "code": "func calltruncate(_p0 uintptr, length int64) (r1 uintptr, e1 Errno) {\n\tr1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_truncate)), 2, _p0, uintptr(length), 0, 0, 0, 0)\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/mchmarny/s3cme/blob/f540c5d245ff91d37e7b4ebcf558d00fa0ecab81/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gc.go#L961-L964", "sha": "f540c5d245ff91d37e7b4ebcf558d00fa0ecab81"}607{"repo_name": "obsidian-cli", "dataset": "github_2023", "owner": "Yakitrak", "lang": "go", "func_name": "callsetsid", "code": "func callsetsid() (r1 uintptr, e1 Errno) {\n\tr1 = uintptr(C.setsid())\n\te1 = syscall.GetErrno()\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/Yakitrak/obsidian-cli/blob/0215c9cc6fdeb4d4a265bee4331837bdb9c7b7b7/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gccgo.go#L497-L501", "sha": "0215c9cc6fdeb4d4a265bee4331837bdb9c7b7b7"}608{"repo_name": "obsidian-cli", "dataset": "github_2023", "owner": "Yakitrak", "lang": "go", "func_name": "Ftruncate", "code": "func Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/Yakitrak/obsidian-cli/blob/0215c9cc6fdeb4d4a265bee4331837bdb9c7b7b7/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go#L989-L995", "sha": "0215c9cc6fdeb4d4a265bee4331837bdb9c7b7b7"}609{"repo_name": "obsidian-cli", "dataset": "github_2023", "owner": "Yakitrak", "lang": "go", "func_name": "Flock", "code": "func Flock(fd int, how int) (err error) {\n\t_, _, e1 := syscall_syscall(libc_flock_trampoline_addr, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "//go:cgo_import_dynamic libc_fchownat fchownat \"libc.so\"\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/Yakitrak/obsidian-cli/blob/0215c9cc6fdeb4d4a265bee4331837bdb9c7b7b7/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go#L951-L957", "sha": "0215c9cc6fdeb4d4a265bee4331837bdb9c7b7b7"}610{"repo_name": "obsidian-cli", "dataset": "github_2023", "owner": "Yakitrak", "lang": "go", "func_name": "Mlock", "code": "func Mlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/Yakitrak/obsidian-cli/blob/0215c9cc6fdeb4d4a265bee4331837bdb9c7b7b7/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go#L269-L281", "sha": "0215c9cc6fdeb4d4a265bee4331837bdb9c7b7b7"}611{"repo_name": "openvpn-ui", "dataset": "github_2023", "owner": "d3vilh", "lang": "go", "func_name": "ShowTablesQuery", "code": "func (d *dbBaseOracle) ShowTablesQuery() string {\n\treturn \"SELECT TABLE_NAME FROM USER_TABLES\"\n}", "docstring": "// ShowTablesQuery show All the tables in database", "url": "https://github.com/d3vilh/openvpn-ui/blob/690f84df426c13ad4742b61fd23e52fcdc489aa0/vendor/github.com/beego/beego/v2/client/orm/db_oracle.go#L84-L86", "sha": "690f84df426c13ad4742b61fd23e52fcdc489aa0"}612{"repo_name": "openvpn-ui", "dataset": "github_2023", "owner": "d3vilh", "lang": "go", "func_name": "lookupUnsafe", "code": "func (t *idnaTrie) lookupUnsafe(s []byte) uint16 {\n\tc0 := s[0]\n\tif c0 < 0x80 { // is ASCII\n\t\treturn idnaValues[c0]\n\t}\n\ti := idnaIndex[c0]\n\tif c0 < 0xE0 { // 2-byte UTF-8\n\t\treturn t.lookupValue(uint32(i), s[1])\n\t}\n\ti = idnaIndex[uint32(i)<<6+uint32(s[1])]\n\tif c0 < 0xF0 { // 3-byte UTF-8\n\t\treturn t.lookupValue(uint32(i), s[2])\n\t}\n\ti = idnaIndex[uint32(i)<<6+uint32(s[2])]\n\tif c0 < 0xF8 { // 4-byte UTF-8\n\t\treturn t.lookupValue(uint32(i), s[3])\n\t}\n\treturn 0\n}", "docstring": "// lookupUnsafe returns the trie value for the first UTF-8 encoding in s.\n// s must start with a full and valid UTF-8 encoded rune.", "url": "https://github.com/d3vilh/openvpn-ui/blob/690f84df426c13ad4742b61fd23e52fcdc489aa0/vendor/golang.org/x/net/idna/tables15.0.0.go#L602-L620", "sha": "690f84df426c13ad4742b61fd23e52fcdc489aa0"}613{"repo_name": "openvpn-ui", "dataset": "github_2023", "owner": "d3vilh", "lang": "go", "func_name": "callnrecvmsg", "code": "func callnrecvmsg(s int, msg uintptr, flags int) (r1 uintptr, e1 Errno) {\n\tr1 = uintptr(C.nrecvmsg(C.int(s), C.uintptr_t(msg), C.int(flags)))\n\te1 = syscall.GetErrno()\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/d3vilh/openvpn-ui/blob/690f84df426c13ad4742b61fd23e52fcdc489aa0/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gccgo.go#L913-L917", "sha": "690f84df426c13ad4742b61fd23e52fcdc489aa0"}614{"repo_name": "openvpn-ui", "dataset": "github_2023", "owner": "d3vilh", "lang": "go", "func_name": "Getegid", "code": "func Getegid() (egid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/d3vilh/openvpn-ui/blob/690f84df426c13ad4742b61fd23e52fcdc489aa0/vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go#L815-L819", "sha": "690f84df426c13ad4742b61fd23e52fcdc489aa0"}615{"repo_name": "openvpn-ui", "dataset": "github_2023", "owner": "d3vilh", "lang": "go", "func_name": "Fstatat", "code": "func Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FSTATAT64, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/d3vilh/openvpn-ui/blob/690f84df426c13ad4742b61fd23e52fcdc489aa0/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go#L253-L264", "sha": "690f84df426c13ad4742b61fd23e52fcdc489aa0"}616{"repo_name": "openvpn-ui", "dataset": "github_2023", "owner": "d3vilh", "lang": "go", "func_name": "sendto", "code": "func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/d3vilh/openvpn-ui/blob/690f84df426c13ad4742b61fd23e52fcdc489aa0/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go#L481-L493", "sha": "690f84df426c13ad4742b61fd23e52fcdc489aa0"}617{"repo_name": "openvpn-ui", "dataset": "github_2023", "owner": "d3vilh", "lang": "go", "func_name": "SetLogger", "code": "func SetLogger(l Logger) {\n\tinternal.LoggerV2Impl = &internal.LoggerWrapper{Logger: l}\n}", "docstring": "// SetLogger sets the logger that is used in grpc. Call only from\n// init() functions.\n//\n// Deprecated: use SetLoggerV2.", "url": "https://github.com/d3vilh/openvpn-ui/blob/690f84df426c13ad4742b61fd23e52fcdc489aa0/vendor/google.golang.org/grpc/grpclog/logger.go#L32-L34", "sha": "690f84df426c13ad4742b61fd23e52fcdc489aa0"}618{"repo_name": "openvpn-ui", "dataset": "github_2023", "owner": "d3vilh", "lang": "go", "func_name": "sizeStringPtr", "code": "func sizeStringPtr(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {\n\tv := **p.StringPtr()\n\treturn f.tagsize + protowire.SizeBytes(len(v))\n}", "docstring": "// sizeStringPtr returns the size of wire encoding a *string pointer as a String.\n// It panics if the pointer is nil.", "url": "https://github.com/d3vilh/openvpn-ui/blob/690f84df426c13ad4742b61fd23e52fcdc489aa0/vendor/google.golang.org/protobuf/internal/impl/codec_gen.go#L5129-L5132", "sha": "690f84df426c13ad4742b61fd23e52fcdc489aa0"}619{"repo_name": "katalyst-core", "dataset": "github_2023", "owner": "kubewharf", "lang": "go", "func_name": "newPluginManager", "code": "func newPluginManager(conf *katalystconfig.Configuration) (pluginmanager.PluginManager, error) {\n\t// make sure plugin registration directory already exist\n\terr := os.MkdirAll(conf.PluginRegistrationDir, os.FileMode(0o755))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"initializes plugin registration dir failed: %s\", err)\n\t}\n\n\treturn &customizedPluginManager{\n\t\tenabled: *atomic.NewBool(false),\n\t\tPluginManager: pluginmanager.NewPluginManager(\n\t\t\tconf.PluginRegistrationDir, /* sockDir */\n\t\t\t&record.FakeRecorder{},\n\t\t),\n\t}, nil\n}", "docstring": "// newPluginManager initializes the registration logic for extendable plugins.\n// all plugin manager added to generic context must use the same socket and\n// default checkpoint path, and if some plugin needs to use a different socket path,\n// it should create the plugin manager itself.", "url": "https://github.com/kubewharf/katalyst-core/blob/cdf8732c6e66119576e697193d4351dced0cddd4/cmd/katalyst-agent/app/agent/context.go#L146-L160", "sha": "cdf8732c6e66119576e697193d4351dced0cddd4"}620{"repo_name": "katalyst-core", "dataset": "github_2023", "owner": "kubewharf", "lang": "go", "func_name": "ResourceName", "code": "func (p *StaticPolicy) ResourceName() string {\n\treturn string(apiconsts.ResourceNetBandwidth)\n}", "docstring": "// ResourceName returns resource names managed by this plugin", "url": "https://github.com/kubewharf/katalyst-core/blob/cdf8732c6e66119576e697193d4351dced0cddd4/pkg/agent/qrm-plugins/network/staticpolicy/policy.go#L256-L258", "sha": "cdf8732c6e66119576e697193d4351dced0cddd4"}621{"repo_name": "katalyst-core", "dataset": "github_2023", "owner": "kubewharf", "lang": "go", "func_name": "processNextWorkItem", "code": "func (cl *CNRLifecycle) processNextWorkItem() bool {\n\tkey, quit := cl.syncQueue.Get()\n\tif quit {\n\t\treturn false\n\t}\n\tdefer cl.syncQueue.Done(key)\n\n\terr := cl.sync(key.(string))\n\tif err == nil {\n\t\tcl.syncQueue.Forget(key)\n\t\treturn true\n\t}\n\n\tutilruntime.HandleError(fmt.Errorf(\"sync %q failed with %v\", key, err))\n\tcl.syncQueue.AddRateLimited(key)\n\n\treturn true\n}", "docstring": "// processNextWorkItem dequeues items, processes them, and marks them done.\n// It enforces that the sync is never invoked concurrently with the same key.", "url": "https://github.com/kubewharf/katalyst-core/blob/cdf8732c6e66119576e697193d4351dced0cddd4/pkg/controller/lifecycle/cnr.go#L213-L230", "sha": "cdf8732c6e66119576e697193d4351dced0cddd4"}622{"repo_name": "katalyst-core", "dataset": "github_2023", "owner": "kubewharf", "lang": "go", "func_name": "filterExpiredPodMetrics", "code": "func filterExpiredPodMetrics(metrics []apimetrics.PodMetrics) []apimetrics.PodMetrics {\n\tnow := time.Now()\n\treturn lo.Filter(metrics, func(item apimetrics.PodMetrics, _ int) bool {\n\t\treturn now.Before(item.Timestamp.Time)\n\t})\n}", "docstring": "// filterExpiredPodMetrics is used to filter out metrics before the current time from the metric slice.", "url": "https://github.com/kubewharf/katalyst-core/blob/cdf8732c6e66119576e697193d4351dced0cddd4/pkg/controller/spd/indicator-plugin/plugins/resource-portrait/util.go#L107-L112", "sha": "cdf8732c6e66119576e697193d4351dced0cddd4"}623{"repo_name": "devpod", "dataset": "github_2023", "owner": "loft-sh", "lang": "go", "func_name": "WithKeyMap", "code": "func (i *Input) WithKeyMap(k *KeyMap) Field {\n\ti.keymap = k.Input\n\ti.textinput.KeyMap.AcceptSuggestion = i.keymap.AcceptSuggestion\n\treturn i\n}", "docstring": "// WithKeyMap sets the keymap on an input field.", "url": "https://github.com/loft-sh/devpod/blob/0ddf4f2cd7137dd6abaaecbab22943126a37a182/vendor/github.com/charmbracelet/huh/field_input.go#L439-L443", "sha": "0ddf4f2cd7137dd6abaaecbab22943126a37a182"}624{"repo_name": "devpod", "dataset": "github_2023", "owner": "loft-sh", "lang": "go", "func_name": "literal", "code": "func literal(s string) string {\n\treturn regexp.QuoteMeta(s)\n}", "docstring": "// literal compiles s into a literal regular expression, escaping any regexp\n// reserved characters.", "url": "https://github.com/loft-sh/devpod/blob/0ddf4f2cd7137dd6abaaecbab22943126a37a182/vendor/github.com/containers/image/v5/docker/reference/regexp.go#L121-L123", "sha": "0ddf4f2cd7137dd6abaaecbab22943126a37a182"}625{"repo_name": "devpod", "dataset": "github_2023", "owner": "loft-sh", "lang": "go", "func_name": "AddWith", "code": "func (w *Watcher) AddWith(name string, opts ...addOpt) error {\n\t_ = getOptions(opts...)\n\n\tw.mu.Lock()\n\tw.userWatches[name] = struct{}{}\n\tw.mu.Unlock()\n\t_, err := w.addWatch(name, noteAllEvents)\n\treturn err\n}", "docstring": "// AddWith is like [Watcher.Add], but allows adding options. When using Add()\n// the defaults described below are used.\n//\n// Possible options are:\n//\n//   - [WithBufferSize] sets the buffer size for the Windows backend; no-op on\n//     other platforms. The default is 64K (65536 bytes).", "url": "https://github.com/loft-sh/devpod/blob/0ddf4f2cd7137dd6abaaecbab22943126a37a182/vendor/github.com/fsnotify/fsnotify/backend_kqueue.go#L314-L322", "sha": "0ddf4f2cd7137dd6abaaecbab22943126a37a182"}626{"repo_name": "devpod", "dataset": "github_2023", "owner": "loft-sh", "lang": "go", "func_name": "OverloadID", "code": "func (zero *evalZeroArity) OverloadID() string {\n\treturn zero.overload\n}", "docstring": "// OverloadID implements the InterpretableCall interface method.", "url": "https://github.com/loft-sh/devpod/blob/0ddf4f2cd7137dd6abaaecbab22943126a37a182/vendor/github.com/google/cel-go/interpreter/interpretable.go#L391-L393", "sha": "0ddf4f2cd7137dd6abaaecbab22943126a37a182"}627{"repo_name": "devpod", "dataset": "github_2023", "owner": "loft-sh", "lang": "go", "func_name": "GetTotalMilestones", "code": "func (m *MilestoneStats) GetTotalMilestones() int {\n\tif m == nil || m.TotalMilestones == nil {\n\t\treturn 0\n\t}\n\treturn *m.TotalMilestones\n}", "docstring": "// GetTotalMilestones returns the TotalMilestones field if it's non-nil, zero value otherwise.", "url": "https://github.com/loft-sh/devpod/blob/0ddf4f2cd7137dd6abaaecbab22943126a37a182/vendor/github.com/google/go-github/v30/github/github-accessors.go#L6328-L6333", "sha": "0ddf4f2cd7137dd6abaaecbab22943126a37a182"}628{"repo_name": "devpod", "dataset": "github_2023", "owner": "loft-sh", "lang": "go", "func_name": "decompress1x_main_loop_bmi2", "code": "func decompress1x_main_loop_bmi2(ctx *decompress1xContext)", "docstring": "// decompress4x_main_loop_x86 is an x86 with BMI2 assembler implementation\n// of Decompress1X when tablelog > 8.\n//\n//go:noescape", "url": "https://github.com/loft-sh/devpod/blob/0ddf4f2cd7137dd6abaaecbab22943126a37a182/vendor/github.com/klauspost/compress/huff0/decompress_amd64.go#L158-L158", "sha": "0ddf4f2cd7137dd6abaaecbab22943126a37a182"}629{"repo_name": "devpod", "dataset": "github_2023", "owner": "loft-sh", "lang": "go", "func_name": "Hyperlink", "code": "func (o *Output) Hyperlink(link, name string) string {\n\treturn OSC + \"8;;\" + link + ST + name + OSC + \"8;;\" + ST\n}", "docstring": "// Hyperlink creates a hyperlink using OSC8.", "url": "https://github.com/loft-sh/devpod/blob/0ddf4f2cd7137dd6abaaecbab22943126a37a182/vendor/github.com/muesli/termenv/hyperlink.go#L9-L11", "sha": "0ddf4f2cd7137dd6abaaecbab22943126a37a182"}630{"repo_name": "devpod", "dataset": "github_2023", "owner": "loft-sh", "lang": "go", "func_name": "BeTrueBecause", "code": "func BeTrueBecause(format string, args ...any) types.GomegaMatcher {\n\treturn &matchers.BeTrueMatcher{Reason: fmt.Sprintf(format, args...)}\n}", "docstring": "// BeTrueBecause succeeds if actual is true and displays the provided reason if it is false\n// fmt.Sprintf is used to render the reason", "url": "https://github.com/loft-sh/devpod/blob/0ddf4f2cd7137dd6abaaecbab22943126a37a182/vendor/github.com/onsi/gomega/matchers.go#L71-L73", "sha": "0ddf4f2cd7137dd6abaaecbab22943126a37a182"}631{"repo_name": "devpod", "dataset": "github_2023", "owner": "loft-sh", "lang": "go", "func_name": "UseConcurrentReads", "code": "func UseConcurrentReads(value bool) ClientOption {\n\treturn func(c *Client) error {\n\t\tc.disableConcurrentReads = !value\n\t\treturn nil\n\t}\n}", "docstring": "// UseConcurrentReads allows the Client to perform concurrent Reads.\n//\n// Concurrent reads are generally safe to use and not using them will degrade\n// performance, so this option is enabled by default.\n//\n// When enabled, WriteTo will use Stat/Fstat to get the file size and determines\n// how many concurrent workers to use.\n// Some \"read once\" servers will delete the file if they receive a stat call on an\n// open file and then the download will fail.\n// Disabling concurrent reads you will be able to download files from these servers.\n// If concurrent reads are disabled, the UseFstat option is ignored.", "url": "https://github.com/loft-sh/devpod/blob/0ddf4f2cd7137dd6abaaecbab22943126a37a182/vendor/github.com/pkg/sftp/client.go#L127-L132", "sha": "0ddf4f2cd7137dd6abaaecbab22943126a37a182"}632{"repo_name": "devpod", "dataset": "github_2023", "owner": "loft-sh", "lang": "go", "func_name": "newValueFunc", "code": "func newValueFunc(desc *Desc, valueType ValueType, function func() float64) *valueFunc {\n\tresult := &valueFunc{\n\t\tdesc:       desc,\n\t\tvalType:    valueType,\n\t\tfunction:   function,\n\t\tlabelPairs: MakeLabelPairs(desc, nil),\n\t}\n\tresult.init(result)\n\treturn result\n}", "docstring": "// newValueFunc returns a newly allocated valueFunc with the given Desc and\n// ValueType. The value reported is determined by calling the given function\n// from within the Write method. Take into account that metric collection may\n// happen concurrently. If that results in concurrent calls to Write, like in\n// the case where a valueFunc is directly registered with Prometheus, the\n// provided function must be concurrency-safe.", "url": "https://github.com/loft-sh/devpod/blob/0ddf4f2cd7137dd6abaaecbab22943126a37a182/vendor/github.com/prometheus/client_golang/prometheus/value.go#L79-L88", "sha": "0ddf4f2cd7137dd6abaaecbab22943126a37a182"}633{"repo_name": "devpod", "dataset": "github_2023", "owner": "loft-sh", "lang": "go", "func_name": "servicePath", "code": "func (linux *systemDRecord) servicePath() string {\n\treturn \"/etc/systemd/system/\" + linux.name + \".service\"\n}", "docstring": "// Standard service path for systemD daemons", "url": "https://github.com/loft-sh/devpod/blob/0ddf4f2cd7137dd6abaaecbab22943126a37a182/vendor/github.com/takama/daemon/daemon_linux_systemd.go#L24-L26", "sha": "0ddf4f2cd7137dd6abaaecbab22943126a37a182"}634{"repo_name": "devpod", "dataset": "github_2023", "owner": "loft-sh", "lang": "go", "func_name": "WithInt64Callback", "code": "func WithInt64Callback(callback Int64Callback) Int64ObservableOption {\n\treturn int64CallbackOpt{callback}\n}", "docstring": "// WithInt64Callback adds callback to be called for an instrument.", "url": "https://github.com/loft-sh/devpod/blob/0ddf4f2cd7137dd6abaaecbab22943126a37a182/vendor/go.opentelemetry.io/otel/metric/asyncint64.go#L256-L258", "sha": "0ddf4f2cd7137dd6abaaecbab22943126a37a182"}635{"repo_name": "devpod", "dataset": "github_2023", "owner": "loft-sh", "lang": "go", "func_name": "FaaSName", "code": "func FaaSName(val string) attribute.KeyValue {\n\treturn FaaSNameKey.String(val)\n}", "docstring": "// FaaSName returns an attribute KeyValue conforming to the \"faas.name\"\n// semantic conventions. It represents the name of the single function that\n// this runtime instance executes.", "url": "https://github.com/loft-sh/devpod/blob/0ddf4f2cd7137dd6abaaecbab22943126a37a182/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/resource.go#L882-L884", "sha": "0ddf4f2cd7137dd6abaaecbab22943126a37a182"}636{"repo_name": "devpod", "dataset": "github_2023", "owner": "loft-sh", "lang": "go", "func_name": "EnduserRole", "code": "func EnduserRole(val string) attribute.KeyValue {\n\treturn EnduserRoleKey.String(val)\n}", "docstring": "// EnduserRole returns an attribute KeyValue conforming to the\n// \"enduser.role\" semantic conventions. It represents the actual/assumed role\n// the client is making the request under extracted from token or application\n// security context.", "url": "https://github.com/loft-sh/devpod/blob/0ddf4f2cd7137dd6abaaecbab22943126a37a182/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/trace.go#L1302-L1304", "sha": "0ddf4f2cd7137dd6abaaecbab22943126a37a182"}637{"repo_name": "devpod", "dataset": "github_2023", "owner": "loft-sh", "lang": "go", "func_name": "Verify", "code": "func Verify(mac *[16]byte, m []byte, key *[32]byte) bool {\n\tvar tmp [16]byte\n\tSum(&tmp, m, key)\n\treturn subtle.ConstantTimeCompare(tmp[:], mac[:]) == 1\n}", "docstring": "// Verify returns true if mac is a valid authenticator for m with the given key.", "url": "https://github.com/loft-sh/devpod/blob/0ddf4f2cd7137dd6abaaecbab22943126a37a182/vendor/golang.org/x/crypto/internal/poly1305/poly1305.go#L35-L39", "sha": "0ddf4f2cd7137dd6abaaecbab22943126a37a182"}638{"repo_name": "devpod", "dataset": "github_2023", "owner": "loft-sh", "lang": "go", "func_name": "Setdomainname", "code": "func Setdomainname(p []byte) (err error) {\n\tvar _p0 *byte\n\tif len(p) > 0 {\n\t\t_p0 = &p[0]\n\t}\n\t_, e1 := callsetdomainname(uintptr(unsafe.Pointer(_p0)), len(p))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/loft-sh/devpod/blob/0ddf4f2cd7137dd6abaaecbab22943126a37a182/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64.go#L569-L579", "sha": "0ddf4f2cd7137dd6abaaecbab22943126a37a182"}639{"repo_name": "devpod", "dataset": "github_2023", "owner": "loft-sh", "lang": "go", "func_name": "Dup2", "code": "func Dup2(from int, to int) (err error) {\n\t_, _, e1 := syscall_syscall(libc_dup2_trampoline_addr, uintptr(from), uintptr(to), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "//go:cgo_import_dynamic libc_dup dup \"libc.so\"\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/loft-sh/devpod/blob/0ddf4f2cd7137dd6abaaecbab22943126a37a182/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go#L799-L805", "sha": "0ddf4f2cd7137dd6abaaecbab22943126a37a182"}640{"repo_name": "devpod", "dataset": "github_2023", "owner": "loft-sh", "lang": "go", "func_name": "Creat", "code": "func Creat(path string, mode uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\truntime.EnterSyscall()\n\tr0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___CREAT_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(mode))\n\truntime.ExitSyscall()\n\tfd = int(r0)\n\tif int64(r0) == -1 {\n\t\terr = errnoErr2(e1, e2)\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/loft-sh/devpod/blob/0ddf4f2cd7137dd6abaaecbab22943126a37a182/vendor/golang.org/x/sys/unix/zsyscall_zos_s390x.go#L664-L678", "sha": "0ddf4f2cd7137dd6abaaecbab22943126a37a182"}641{"repo_name": "devpod", "dataset": "github_2023", "owner": "loft-sh", "lang": "go", "func_name": "callsetregid", "code": "func callsetregid(rgid int, egid int) (r1 uintptr, e1 Errno) {\n\tr1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_setregid)), 2, uintptr(rgid), uintptr(egid), 0, 0, 0, 0)\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/loft-sh/devpod/blob/0ddf4f2cd7137dd6abaaecbab22943126a37a182/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gc.go#L919-L922", "sha": "0ddf4f2cd7137dd6abaaecbab22943126a37a182"}642{"repo_name": "devpod", "dataset": "github_2023", "owner": "loft-sh", "lang": "go", "func_name": "yaml_emitter_emit_scalar", "code": "func yaml_emitter_emit_scalar(emitter *yaml_emitter_t, event *yaml_event_t) bool {\n\tif !yaml_emitter_select_scalar_style(emitter, event) {\n\t\treturn false\n\t}\n\tif !yaml_emitter_process_anchor(emitter) {\n\t\treturn false\n\t}\n\tif !yaml_emitter_process_tag(emitter) {\n\t\treturn false\n\t}\n\tif !yaml_emitter_increase_indent(emitter, true, false) {\n\t\treturn false\n\t}\n\tif !yaml_emitter_process_scalar(emitter) {\n\t\treturn false\n\t}\n\temitter.indent = emitter.indents[len(emitter.indents)-1]\n\temitter.indents = emitter.indents[:len(emitter.indents)-1]\n\temitter.state = emitter.states[len(emitter.states)-1]\n\temitter.states = emitter.states[:len(emitter.states)-1]\n\treturn true\n}", "docstring": "// Expect SCALAR.", "url": "https://github.com/loft-sh/devpod/blob/0ddf4f2cd7137dd6abaaecbab22943126a37a182/vendor/gopkg.in/yaml.v2/emitterc.go#L683-L704", "sha": "0ddf4f2cd7137dd6abaaecbab22943126a37a182"}643{"repo_name": "devpod", "dataset": "github_2023", "owner": "loft-sh", "lang": "go", "func_name": "Convert_apiextensions_CustomResourceDefinitionCondition_To_v1_CustomResourceDefinitionCondition", "code": "func Convert_apiextensions_CustomResourceDefinitionCondition_To_v1_CustomResourceDefinitionCondition(in *apiextensions.CustomResourceDefinitionCondition, out *CustomResourceDefinitionCondition, s conversion.Scope) error {\n\treturn autoConvert_apiextensions_CustomResourceDefinitionCondition_To_v1_CustomResourceDefinitionCondition(in, out, s)\n}", "docstring": "// Convert_apiextensions_CustomResourceDefinitionCondition_To_v1_CustomResourceDefinitionCondition is an autogenerated conversion function.", "url": "https://github.com/loft-sh/devpod/blob/0ddf4f2cd7137dd6abaaecbab22943126a37a182/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/zz_generated.conversion.go#L377-L379", "sha": "0ddf4f2cd7137dd6abaaecbab22943126a37a182"}644{"repo_name": "opentonapi", "dataset": "github_2023", "owner": "tonkeeper", "lang": "go", "func_name": "NewOptComputeSkipReason", "code": "func NewOptComputeSkipReason(v ComputeSkipReason) OptComputeSkipReason {\n\treturn OptComputeSkipReason{\n\t\tValue: v,\n\t\tSet:   true,\n\t}\n}", "docstring": "// NewOptComputeSkipReason returns new OptComputeSkipReason with value set to v.", "url": "https://github.com/tonkeeper/opentonapi/blob/ff7ba60485b4637dc02d96ffa62e71d6ee69f947/pkg/oas/oas_schemas_gen.go#L11936-L11941", "sha": "ff7ba60485b4637dc02d96ffa62e71d6ee69f947"}645{"repo_name": "mox", "dataset": "github_2023", "owner": "mjl-", "lang": "go", "func_name": "RecordID", "code": "func RecordID(ctx context.Context, id int64) (DomainFeedback, error) {\n\te := DomainFeedback{ID: id}\n\terr := ReportsDB.Get(ctx, &e)\n\treturn e, err\n}", "docstring": "// RecordID returns the report for the ID.", "url": "https://github.com/mjl-/mox/blob/93b627ceab9b90cb3669d0adc5d6dc208181fc7a/dmarcdb/reports.go#L111-L115", "sha": "93b627ceab9b90cb3669d0adc5d6dc208181fc7a"}646{"repo_name": "mox", "dataset": "github_2023", "owner": "mjl-", "lang": "go", "func_name": "count", "code": "func (r *elemRef) count() int {\n\tif r.node != nil {\n\t\treturn len(r.node.inodes)\n\t}\n\treturn int(r.page.count)\n}", "docstring": "// count returns the number of inodes or page elements.", "url": "https://github.com/mjl-/mox/blob/93b627ceab9b90cb3669d0adc5d6dc208181fc7a/vendor/go.etcd.io/bbolt/cursor.go#L424-L429", "sha": "93b627ceab9b90cb3669d0adc5d6dc208181fc7a"}647{"repo_name": "mox", "dataset": "github_2023", "owner": "mjl-", "lang": "go", "func_name": "ValidHostHeader", "code": "func ValidHostHeader(h string) bool {\n\t// The latest spec is actually this:\n\t//\n\t// http://tools.ietf.org/html/rfc7230#section-5.4\n\t//     Host = uri-host [ \":\" port ]\n\t//\n\t// Where uri-host is:\n\t//     http://tools.ietf.org/html/rfc3986#section-3.2.2\n\t//\n\t// But we're going to be much more lenient for now and just\n\t// search for any byte that's not a valid byte in any of those\n\t// expressions.\n\tfor i := 0; i < len(h); i++ {\n\t\tif !validHostByte[h[i]] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "docstring": "// ValidHostHeader reports whether h is a valid host header.", "url": "https://github.com/mjl-/mox/blob/93b627ceab9b90cb3669d0adc5d6dc208181fc7a/vendor/golang.org/x/net/http/httpguts/httplex.go#L209-L227", "sha": "93b627ceab9b90cb3669d0adc5d6dc208181fc7a"}648{"repo_name": "mox", "dataset": "github_2023", "owner": "mjl-", "lang": "go", "func_name": "KeyctlGetKeyringID", "code": "func KeyctlGetKeyringID(id int, create bool) (ringid int, err error) {\n\tcreateInt := 0\n\tif create {\n\t\tcreateInt = 1\n\t}\n\treturn KeyctlInt(KEYCTL_GET_KEYRING_ID, id, createInt, 0, 0)\n}", "docstring": "// Keyctl commands with special signatures.\n// KeyctlGetKeyringID implements the KEYCTL_GET_KEYRING_ID command.\n// See the full documentation at:\n// http://man7.org/linux/man-pages/man3/keyctl_get_keyring_ID.3.html", "url": "https://github.com/mjl-/mox/blob/93b627ceab9b90cb3669d0adc5d6dc208181fc7a/vendor/golang.org/x/sys/unix/syscall_linux.go#L1458-L1464", "sha": "93b627ceab9b90cb3669d0adc5d6dc208181fc7a"}649{"repo_name": "mox", "dataset": "github_2023", "owner": "mjl-", "lang": "go", "func_name": "Kill", "code": "func Kill(pid int, sig Signal) (err error) {\n\tr0, er := C.kill(C.int(pid), C.int(sig))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/mjl-/mox/blob/93b627ceab9b90cb3669d0adc5d6dc208181fc7a/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc.go#L467-L473", "sha": "93b627ceab9b90cb3669d0adc5d6dc208181fc7a"}650{"repo_name": "mox", "dataset": "github_2023", "owner": "mjl-", "lang": "go", "func_name": "read", "code": "func read(fd int, p []byte) (n int, err error) {\n\tvar _p0 *byte\n\tif len(p) > 0 {\n\t\t_p0 = &p[0]\n\t}\n\tr0, e1 := callread(fd, uintptr(unsafe.Pointer(_p0)), len(p))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/mjl-/mox/blob/93b627ceab9b90cb3669d0adc5d6dc208181fc7a/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64.go#L514-L525", "sha": "93b627ceab9b90cb3669d0adc5d6dc208181fc7a"}651{"repo_name": "mox", "dataset": "github_2023", "owner": "mjl-", "lang": "go", "func_name": "socketpair", "code": "func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/mjl-/mox/blob/93b627ceab9b90cb3669d0adc5d6dc208181fc7a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go#L435-L441", "sha": "93b627ceab9b90cb3669d0adc5d6dc208181fc7a"}652{"repo_name": "mox", "dataset": "github_2023", "owner": "mjl-", "lang": "go", "func_name": "Mount", "code": "func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(fsType)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(dir)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "//go:cgo_import_dynamic libc_mknodat mknodat \"libc.so\"\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/mjl-/mox/blob/93b627ceab9b90cb3669d0adc5d6dc208181fc7a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go#L1496-L1512", "sha": "93b627ceab9b90cb3669d0adc5d6dc208181fc7a"}653{"repo_name": "mox", "dataset": "github_2023", "owner": "mjl-", "lang": "go", "func_name": "Getrtable", "code": "func Getrtable() (rtable int, err error) {\n\tr0, _, e1 := syscall_rawSyscall(libc_getrtable_trampoline_addr, 0, 0, 0)\n\trtable = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "//go:cgo_import_dynamic libc_getrlimit getrlimit \"libc.so\"\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/mjl-/mox/blob/93b627ceab9b90cb3669d0adc5d6dc208181fc7a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go#L1171-L1178", "sha": "93b627ceab9b90cb3669d0adc5d6dc208181fc7a"}654{"repo_name": "mox", "dataset": "github_2023", "owner": "mjl-", "lang": "go", "func_name": "isTitle", "code": "func isTitle(c *context) bool {\n\tct := c.caseType()\n\tif c.info&hasMappingMask == 0 || ct == cTitle {\n\t\treturn true\n\t}\n\tif c.info&exceptionBit == 0 {\n\t\tif ct == cLower {\n\t\t\tc.err = transform.ErrEndOfSpan\n\t\t\treturn false\n\t\t}\n\t\treturn true\n\t}\n\t// Get the exception data.\n\te := exceptions[c.info>>exceptionShift:]\n\tif nTitle := e[1] & lengthMask; nTitle != noChange {\n\t\tc.err = transform.ErrEndOfSpan\n\t\treturn false\n\t}\n\tnFirst := (e[1] >> lengthBits) & lengthMask\n\tif ct == cLower && nFirst != noChange {\n\t\tc.err = transform.ErrEndOfSpan\n\t\treturn false\n\t}\n\treturn true\n}", "docstring": "// isTitle reports whether the current rune is in title case.", "url": "https://github.com/mjl-/mox/blob/93b627ceab9b90cb3669d0adc5d6dc208181fc7a/vendor/golang.org/x/text/cases/context.go#L307-L331", "sha": "93b627ceab9b90cb3669d0adc5d6dc208181fc7a"}655{"repo_name": "mox", "dataset": "github_2023", "owner": "mjl-", "lang": "go", "func_name": "lookupValue", "code": "func (t *nfcTrie) lookupValue(n uint32, b byte) uint16 {\n\tswitch {\n\tcase n < 46:\n\t\treturn uint16(nfcValues[n<<6+uint32(b)])\n\tdefault:\n\t\tn -= 46\n\t\treturn uint16(nfcSparse.lookup(n, b))\n\t}\n}", "docstring": "// lookupValue determines the type of block n and looks up the value for b.", "url": "https://github.com/mjl-/mox/blob/93b627ceab9b90cb3669d0adc5d6dc208181fc7a/vendor/golang.org/x/text/unicode/norm/tables15.0.0.go#L2956-L2964", "sha": "93b627ceab9b90cb3669d0adc5d6dc208181fc7a"}656{"repo_name": "asyncapi-codegen", "dataset": "github_2023", "owner": "lerenn", "lang": "go", "func_name": "brokerMessageToV2Issue49ChatSubscribeMessage", "code": "func brokerMessageToV2Issue49ChatSubscribeMessage(bMsg extensions.BrokerMessage) (V2Issue49ChatSubscribeMessage, error) {\n\tvar msg V2Issue49ChatSubscribeMessage\n\n\t// Convert to string\n\tpayload := string(bMsg.Payload)\n\tmsg.Payload = payload // No need for type conversion to reference\n\n\t// TODO: run checks on msg type\n\n\treturn msg, nil\n}", "docstring": "// brokerMessageToV2Issue49ChatSubscribeMessage will fill a new V2Issue49ChatSubscribeMessage with data from generic broker message", "url": "https://github.com/lerenn/asyncapi-codegen/blob/e9a7410f9c1bdead862612402fbb5c465e077f3b/test/v2/issues/49/asyncapi.gen.go#L799-L809", "sha": "e9a7410f9c1bdead862612402fbb5c465e077f3b"}657{"repo_name": "gonb", "dataset": "github_2023", "owner": "janpfeifer", "lang": "go", "func_name": "CodePath", "code": "func (s *State) CodePath() string {\n\tname := MainGo\n\tif s.CellIsTest {\n\t\tname = MainTestGo\n\t}\n\treturn path.Join(s.TempDir, name)\n}", "docstring": "// CodePath is the path to where the code is going to be saved. Either `main.go` or `main_test.go` file.", "url": "https://github.com/janpfeifer/gonb/blob/f52815182d2d551ef2647d8f53b71ee6e4e106bf/internal/goexec/execcode.go#L163-L169", "sha": "f52815182d2d551ef2647d8f53b71ee6e4e106bf"}658{"repo_name": "gonb", "dataset": "github_2023", "owner": "janpfeifer", "lang": "go", "func_name": "DeclareVariable", "code": "func DeclareVariable(decls *Declarations, name, value string) {\n\tdecls.Variables[name] = &Variable{\n\t\tCursor:          NoCursor,\n\t\tCellLines:       CellLines{},\n\t\tKey:             name,\n\t\tName:            name,\n\t\tValueDefinition: value,\n\t}\n}", "docstring": "// DeclareVariable creates a variable definition in `decls`.\n// `value` is copied verbatim, so any type of variable goes.", "url": "https://github.com/janpfeifer/gonb/blob/f52815182d2d551ef2647d8f53b71ee6e4e106bf/internal/goexec/wasm.go#L215-L223", "sha": "f52815182d2d551ef2647d8f53b71ee6e4e106bf"}659{"repo_name": "walrus", "dataset": "github_2023", "owner": "seal-io", "lang": "go", "func_name": "ExecE", "code": "func (wscb *WorkflowStepCreateBulk) ExecE(ctx context.Context, cbs ...func(ctx context.Context, mc ClientSet, created *WorkflowStep) error) error {\n\t_, err := wscb.SaveE(ctx, cbs...)\n\treturn err\n}", "docstring": "// ExecE calls the given function after executed the query,\n// which is always good for cascading create operations.", "url": "https://github.com/seal-io/walrus/blob/5aef1b7525ec717b197bdd1a2ea84ff10d10cf33/pkg/dao/model/workflowstep_create.go#L757-L760", "sha": "5aef1b7525ec717b197bdd1a2ea84ff10d10cf33"}660{"repo_name": "walrus", "dataset": "github_2023", "owner": "seal-io", "lang": "go", "func_name": "Scan", "code": "func (wss *WorkflowStageSelect) Scan(ctx context.Context, v any) error {\n\tctx = setContextOp(ctx, wss.ctx, \"Select\")\n\tif err := wss.prepareQuery(ctx); err != nil {\n\t\treturn err\n\t}\n\treturn scanWithInterceptors[*WorkflowStageQuery, *WorkflowStageSelect](ctx, wss.WorkflowStageQuery, wss, wss.inters, v)\n}", "docstring": "// Scan applies the selector query and scans the result into the given value.", "url": "https://github.com/seal-io/walrus/blob/5aef1b7525ec717b197bdd1a2ea84ff10d10cf33/pkg/dao/model/workflowstage_query.go#L803-L809", "sha": "5aef1b7525ec717b197bdd1a2ea84ff10d10cf33"}661{"repo_name": "walrus", "dataset": "github_2023", "owner": "seal-io", "lang": "go", "func_name": "NameLT", "code": "func NameLT(v string) predicate.ResourceDefinitionMatchingRule {\n\treturn predicate.ResourceDefinitionMatchingRule(sql.FieldLT(FieldName, v))\n}", "docstring": "// NameLT applies the LT predicate on the \"name\" field.", "url": "https://github.com/seal-io/walrus/blob/5aef1b7525ec717b197bdd1a2ea84ff10d10cf33/pkg/dao/model/resourcedefinitionmatchingrule/where.go#L311-L313", "sha": "5aef1b7525ec717b197bdd1a2ea84ff10d10cf33"}662{"repo_name": "walrus", "dataset": "github_2023", "owner": "seal-io", "lang": "go", "func_name": "ProjectIDIn", "code": "func ProjectIDIn(vs ...object.ID) predicate.ResourceRun {\n\treturn predicate.ResourceRun(sql.FieldIn(FieldProjectID, vs...))\n}", "docstring": "// ProjectIDIn applies the In predicate on the \"project_id\" field.", "url": "https://github.com/seal-io/walrus/blob/5aef1b7525ec717b197bdd1a2ea84ff10d10cf33/pkg/dao/model/resourcerun/where.go#L217-L219", "sha": "5aef1b7525ec717b197bdd1a2ea84ff10d10cf33"}663{"repo_name": "walrus", "dataset": "github_2023", "owner": "seal-io", "lang": "go", "func_name": "TemplateIDNotIn", "code": "func TemplateIDNotIn(vs ...object.ID) predicate.ResourceRun {\n\treturn predicate.ResourceRun(sql.FieldNotIn(FieldTemplateID, vs...))\n}", "docstring": "// TemplateIDNotIn applies the NotIn predicate on the \"template_id\" field.", "url": "https://github.com/seal-io/walrus/blob/5aef1b7525ec717b197bdd1a2ea84ff10d10cf33/pkg/dao/model/resourcerun/where.go#L562-L564", "sha": "5aef1b7525ec717b197bdd1a2ea84ff10d10cf33"}664{"repo_name": "walrus", "dataset": "github_2023", "owner": "seal-io", "lang": "go", "func_name": "CreatedByNEQ", "code": "func CreatedByNEQ(v string) predicate.ResourceRun {\n\treturn predicate.ResourceRun(sql.FieldNEQ(FieldCreatedBy, v))\n}", "docstring": "// CreatedByNEQ applies the NEQ predicate on the \"created_by\" field.", "url": "https://github.com/seal-io/walrus/blob/5aef1b7525ec717b197bdd1a2ea84ff10d10cf33/pkg/dao/model/resourcerun/where.go#L1092-L1094", "sha": "5aef1b7525ec717b197bdd1a2ea84ff10d10cf33"}665{"repo_name": "walrus", "dataset": "github_2023", "owner": "seal-io", "lang": "go", "func_name": "TypeContainsFold", "code": "func TypeContainsFold(v string) predicate.WorkflowStep {\n\treturn predicate.WorkflowStep(sql.FieldContainsFold(FieldType, v))\n}", "docstring": "// TypeContainsFold applies the ContainsFold predicate on the \"type\" field.", "url": "https://github.com/seal-io/walrus/blob/5aef1b7525ec717b197bdd1a2ea84ff10d10cf33/pkg/dao/model/workflowstep/where.go#L415-L417", "sha": "5aef1b7525ec717b197bdd1a2ea84ff10d10cf33"}666{"repo_name": "walrus", "dataset": "github_2023", "owner": "seal-io", "lang": "go", "func_name": "ValidateWith", "code": "func (i Values) ValidateWith(schema *openapi3.Schema) error {\n\tif schema == nil {\n\t\treturn nil\n\t}\n\n\t// Check required and undefined.\n\tl := sets.StringKeySet(i)\n\tr := sets.NewString(schema.Required...)\n\ta := sets.StringKeySet(schema.Properties)\n\n\tif diff := r.Difference(l).UnsortedList(); len(diff) != 0 {\n\t\treturn fmt.Errorf(\"not found required values %v\", diff)\n\t}\n\n\tif diff := l.Difference(a).UnsortedList(); len(diff) != 0 {\n\t\treturn fmt.Errorf(\"found undefiend values %v\", diff)\n\t}\n\n\t// Validate.\n\tfor n, v := range i {\n\t\tif schema.Properties[n] == nil || schema.Properties[n].Value == nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tvar (\n\t\t\ts           = schema.Properties[n].Value\n\t\t\terrTypeFunc = func(name string, ok bool, err error, expectedType string, actualValue any) error {\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"%s is not type %s, actual value: %v\", name, expectedType, actualValue)\n\t\t\t\t}\n\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"failed to convert %s to %s: %w\", name, expectedType, err)\n\t\t\t\t}\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tvalidateSchemaFunc = func(name string, val any) error {\n\t\t\t\terr := s.VisitJSON(val)\n\t\t\t\tif err != nil {\n\t\t\t\t\tvar e *openapi3.SchemaError\n\t\t\t\t\tif errors.As(err, &e) {\n\t\t\t\t\t\treturn errorx.Errorf(\"invalid %s: %v\", name, e.Reason)\n\t\t\t\t\t}\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\treturn nil\n\t\t\t}\n\t\t)\n\n\t\tvar (\n\t\t\tval any\n\t\t\tok  bool\n\t\t\terr error\n\t\t)\n\n\t\tswitch {\n\t\tdefault:\n\t\t\t_, ok, err := GetAny[any](v)\n\t\t\tif !ok || err != nil {\n\t\t\t\treturn errTypeFunc(n, ok, err, s.Type, v)\n\t\t\t}\n\n\t\t\tcontinue\n\t\tcase s.Type == openapi3.TypeString:\n\t\t\tval, ok, err = GetString(v)\n\t\t\tif !ok || err != nil {\n\t\t\t\treturn errTypeFunc(n, ok, err, s.Type, v)\n\t\t\t}\n\t\tcase s.Type == openapi3.TypeBoolean:\n\t\t\tval, ok, err = GetBool(v)\n\t\t\tif !ok || err != nil {\n\t\t\t\treturn errTypeFunc(n, ok, err, s.Type, v)\n\t\t\t}\n\t\tcase s.Type == openapi3.TypeInteger:\n\t\t\tval, ok, err = GetInt(v)\n\t\t\tif !ok || err != nil {\n\t\t\t\treturn errTypeFunc(n, ok, err, s.Type, v)\n\t\t\t}\n\t\tcase s.Type == openapi3.TypeNumber:\n\t\t\tval, ok, err = GetNumber(v)\n\t\t\tif !ok || err != nil {\n\t\t\t\treturn errTypeFunc(n, ok, err, s.Type, v)\n\t\t\t}\n\t\tcase HasAnyTypes(s):\n\t\t\t// Skip validate for any type.\n\t\t\tcontinue\n\t\tcase s.Type == openapi3.TypeArray:\n\t\t\tval, ok, err = GetSlice[any](v)\n\t\t\tif !ok || err != nil {\n\t\t\t\treturn errTypeFunc(n, ok, err, s.Type, v)\n\t\t\t}\n\t\tcase s.Type == openapi3.TypeObject:\n\t\t\tval, ok, err = GetMap[any](v)\n\t\t\tif !ok || err != nil {\n\t\t\t\treturn errTypeFunc(n, ok, err, s.Type, v)\n\t\t\t}\n\t\t}\n\n\t\terr = validateSchemaFunc(n, val)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "docstring": "// ValidateWith validates the property value with the given schemas.", "url": "https://github.com/seal-io/walrus/blob/5aef1b7525ec717b197bdd1a2ea84ff10d10cf33/pkg/dao/types/property/field.go#L43-L148", "sha": "5aef1b7525ec717b197bdd1a2ea84ff10d10cf33"}667{"repo_name": "scql", "dataset": "github_2023", "owner": "secretflow", "lang": "go", "func_name": "NewBinaryLiteralFromUint", "code": "func NewBinaryLiteralFromUint(value uint64, byteSize int) BinaryLiteral {\n\tif byteSize != -1 && (byteSize < 1 || byteSize > 8) {\n\t\tpanic(\"Invalid byteSize\")\n\t}\n\tbuf := make([]byte, 8)\n\tbinary.BigEndian.PutUint64(buf, value)\n\tif byteSize == -1 {\n\t\tbuf = trimLeadingZeroBytes(buf)\n\t} else {\n\t\tbuf = buf[8-byteSize:]\n\t}\n\treturn buf\n}", "docstring": "// NewBinaryLiteralFromUint creates a new BinaryLiteral instance by the given uint value in BitEndian.\n// byteSize will be used as the length of the new BinaryLiteral, with leading bytes filled to zero.\n// If byteSize is -1, the leading zeros in new BinaryLiteral will be trimmed.", "url": "https://github.com/secretflow/scql/blob/8ed4e6acc212b9d29b90d5dcdc91216e71424a08/pkg/types/binary_literal.go#L58-L70", "sha": "8ed4e6acc212b9d29b90d5dcdc91216e71424a08"}668{"repo_name": "scql", "dataset": "github_2023", "owner": "secretflow", "lang": "go", "func_name": "ParseDatetimeFromNum", "code": "func ParseDatetimeFromNum(sc *stmtctx.StatementContext, num int64) (Time, error) {\n\treturn ParseTimeFromNum(sc, num, mysql.TypeDatetime, DefaultFsp)\n}", "docstring": "// ParseDatetimeFromNum is a helper function wrapping ParseTimeFromNum with datetime type and default fsp.", "url": "https://github.com/secretflow/scql/blob/8ed4e6acc212b9d29b90d5dcdc91216e71424a08/pkg/types/time.go#L1536-L1538", "sha": "8ed4e6acc212b9d29b90d5dcdc91216e71424a08"}669{"repo_name": "marvin", "dataset": "github_2023", "owner": "undistro", "lang": "go", "func_name": "MatchesPodSpec", "code": "func MatchesPodSpec(rules []types.ResourceRule) bool {\n\tfor _, r := range rules {\n\t\tgr := r.ToGVR().GroupResource()\n\t\tif defaultPodSpecResources[gr] {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "docstring": "// MatchesPodSpec returns true if any rule matches a Pod spec", "url": "https://github.com/undistro/marvin/blob/9cf36105c76fb8b8548d352c031cd47e11ea8aff/pkg/validator/podspec.go#L32-L40", "sha": "9cf36105c76fb8b8548d352c031cd47e11ea8aff"}670{"repo_name": "langchaingo", "dataset": "github_2023", "owner": "tmc", "lang": "go", "func_name": "WithVectorDimensions", "code": "func WithVectorDimensions(size int) Option {\n\treturn func(p *Store) {\n\t\tp.vectorDimensions = size\n\t}\n}", "docstring": "// WithVectorDimensions is an option for specifying the vector size.", "url": "https://github.com/tmc/langchaingo/blob/0672790bb23a2c7e546a4a7aeffc9bef5bbd8c0b/vectorstores/pgvector/options.go#L83-L87", "sha": "0672790bb23a2c7e546a4a7aeffc9bef5bbd8c0b"}671{"repo_name": "beyla", "dataset": "github_2023", "owner": "grafana", "lang": "go", "func_name": "MappedBits", "code": "func MappedBits[T comparable](values []T, maps map[T]Bits, opts ...BuilderOpt[T]) Bits {\n\tbo := builderOpts[T]{}\n\tfor _, opt := range opts {\n\t\topt(&bo)\n\t}\n\n\tb := Bits(0)\n\tfor _, value := range values {\n\t\tfor _, t := range bo.transform {\n\t\t\tvalue = t(value)\n\t\t}\n\t\tif val, ok := maps[value]; ok {\n\t\t\tb |= val\n\t\t}\n\t}\n\treturn b\n}", "docstring": "// MappedBits builds a Bits map from a set of values (e.g. strings) that are mapped in the form\n// value --> corresponding Bits value\n// in the \"maps\" constructor argument", "url": "https://github.com/grafana/beyla/blob/2f2517bd9e5824bcd315292e62102f361a216434/pkg/internal/helpers/maps/bits.go#L24-L40", "sha": "2f2517bd9e5824bcd315292e62102f361a216434"}672{"repo_name": "beyla", "dataset": "github_2023", "owner": "grafana", "lang": "go", "func_name": "MarshalText", "code": "func MarshalText(w io.Writer, m Message) error { return defaultTextMarshaler.Marshal(w, m) }", "docstring": "// MarshalText writes the proto text format of m to w.", "url": "https://github.com/grafana/beyla/blob/2f2517bd9e5824bcd315292e62102f361a216434/test/integration/components/old_grpc/backend/vendor/github.com/golang/protobuf/proto/text_encode.go#L97-L97", "sha": "2f2517bd9e5824bcd315292e62102f361a216434"}673{"repo_name": "beyla", "dataset": "github_2023", "owner": "grafana", "lang": "go", "func_name": "xorInGeneric", "code": "func xorInGeneric(d *state, buf []byte) {\n\tn := len(buf) / 8\n\n\tfor i := 0; i < n; i++ {\n\t\ta := binary.LittleEndian.Uint64(buf)\n\t\td.a[i] ^= a\n\t\tbuf = buf[8:]\n\t}\n}", "docstring": "// xorInGeneric xors the bytes in buf into the state; it\n// makes no non-portable assumptions about memory layout\n// or alignment.", "url": "https://github.com/grafana/beyla/blob/2f2517bd9e5824bcd315292e62102f361a216434/test/integration/components/old_grpc/backend/vendor/golang.org/x/crypto/sha3/xor_generic.go#L12-L20", "sha": "2f2517bd9e5824bcd315292e62102f361a216434"}674{"repo_name": "beyla", "dataset": "github_2023", "owner": "grafana", "lang": "go", "func_name": "Symlink", "code": "func Symlink(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/grafana/beyla/blob/2f2517bd9e5824bcd315292e62102f361a216434/test/integration/components/old_grpc/backend/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go#L1681-L1697", "sha": "2f2517bd9e5824bcd315292e62102f361a216434"}675{"repo_name": "beyla", "dataset": "github_2023", "owner": "grafana", "lang": "go", "func_name": "Time", "code": "func Time(t *Time_t) (tt Time_t, err error) {\n\tr0, _, e1 := RawSyscall(SYS_TIME, uintptr(unsafe.Pointer(t)), 0, 0)\n\ttt = Time_t(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/grafana/beyla/blob/2f2517bd9e5824bcd315292e62102f361a216434/test/integration/components/old_grpc/backend/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc.go#L565-L572", "sha": "2f2517bd9e5824bcd315292e62102f361a216434"}676{"repo_name": "beyla", "dataset": "github_2023", "owner": "grafana", "lang": "go", "func_name": "socket", "code": "func socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/grafana/beyla/blob/2f2517bd9e5824bcd315292e62102f361a216434/test/integration/components/old_grpc/backend/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go#L81-L88", "sha": "2f2517bd9e5824bcd315292e62102f361a216434"}677{"repo_name": "beyla", "dataset": "github_2023", "owner": "grafana", "lang": "go", "func_name": "munmap", "code": "func munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := syscall_syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/grafana/beyla/blob/2f2517bd9e5824bcd315292e62102f361a216434/test/integration/components/old_grpc/backend/vendor/golang.org/x/sys/unix/zsyscall_zos_s390x.go#L250-L256", "sha": "2f2517bd9e5824bcd315292e62102f361a216434"}678{"repo_name": "beyla", "dataset": "github_2023", "owner": "grafana", "lang": "go", "func_name": "Renameat", "code": "func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(oldpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(newpath)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/grafana/beyla/blob/2f2517bd9e5824bcd315292e62102f361a216434/test/integration/components/old_grpc/backend/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go#L247-L263", "sha": "2f2517bd9e5824bcd315292e62102f361a216434"}679{"repo_name": "beyla", "dataset": "github_2023", "owner": "grafana", "lang": "go", "func_name": "NewClientTLSFromCert", "code": "func NewClientTLSFromCert(cp *x509.CertPool, serverNameOverride string) TransportCredentials {\n\treturn NewTLS(&tls.Config{ServerName: serverNameOverride, RootCAs: cp})\n}", "docstring": "// NewClientTLSFromCert constructs TLS credentials from the provided root\n// certificate authority certificate(s) to validate server connections. If\n// certificates to establish the identity of the client need to be included in\n// the credentials (eg: for mTLS), use NewTLS instead, where a complete\n// tls.Config can be specified.\n// serverNameOverride is for testing only. If set to a non empty string,\n// it will override the virtual host name of authority (e.g. :authority header\n// field) in requests.", "url": "https://github.com/grafana/beyla/blob/2f2517bd9e5824bcd315292e62102f361a216434/test/integration/components/old_grpc/backend/vendor/google.golang.org/grpc/credentials/tls.go#L156-L158", "sha": "2f2517bd9e5824bcd315292e62102f361a216434"}680{"repo_name": "beyla", "dataset": "github_2023", "owner": "grafana", "lang": "go", "func_name": "Close", "code": "func Close(fd int) (err error) {\n\t_, _, e1 := syscall_syscall(libc_close_trampoline_addr, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "//go:cgo_import_dynamic libc_clock_gettime clock_gettime \"libc.so\"\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/grafana/beyla/blob/2f2517bd9e5824bcd315292e62102f361a216434/test/integration/components/old_grpc/worker/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go#L721-L727", "sha": "2f2517bd9e5824bcd315292e62102f361a216434"}681{"repo_name": "beyla", "dataset": "github_2023", "owner": "grafana", "lang": "go", "func_name": "Swap", "code": "func (l *HandlerList) Swap(name string, replace NamedHandler) bool {\n\tvar swapped bool\n\n\tfor i := 0; i < len(l.list); i++ {\n\t\tif l.list[i].Name == name {\n\t\t\tl.list[i] = replace\n\t\t\tswapped = true\n\t\t}\n\t}\n\n\treturn swapped\n}", "docstring": "// Swap will swap out all handlers matching the name passed in. The matched\n// handlers will be swapped in. True is returned if the handlers were swapped.", "url": "https://github.com/grafana/beyla/blob/2f2517bd9e5824bcd315292e62102f361a216434/vendor/github.com/aws/aws-sdk-go/aws/request/handlers.go#L234-L245", "sha": "2f2517bd9e5824bcd315292e62102f361a216434"}682{"repo_name": "beyla", "dataset": "github_2023", "owner": "grafana", "lang": "go", "func_name": "mapassign_faststr", "code": "func mapassign_faststr(t *rt.GoType, h unsafe.Pointer, s string) unsafe.Pointer", "docstring": "//go:linkname mapassign_faststr runtime.mapassign_faststr\n//goland:noinspection GoUnusedParameter", "url": "https://github.com/grafana/beyla/blob/2f2517bd9e5824bcd315292e62102f361a216434/vendor/github.com/bytedance/sonic/internal/decoder/stubs_go120.go#L101-L101", "sha": "2f2517bd9e5824bcd315292e62102f361a216434"}683{"repo_name": "beyla", "dataset": "github_2023", "owner": "grafana", "lang": "go", "func_name": "AddHeader", "code": "func (r Response) AddHeader(header string, value string) Response {\n\tr.Header().Add(header, value)\n\treturn r\n}", "docstring": "// AddHeader is a shortcut for .Header().Add(header,value)", "url": "https://github.com/grafana/beyla/blob/2f2517bd9e5824bcd315292e62102f361a216434/vendor/github.com/emicklei/go-restful/v3/response.go#L71-L74", "sha": "2f2517bd9e5824bcd315292e62102f361a216434"}684{"repo_name": "beyla", "dataset": "github_2023", "owner": "grafana", "lang": "go", "func_name": "Any", "code": "func (group *RouterGroup) Any(relativePath string, handlers ...HandlerFunc) IRoutes {\n\tfor _, method := range anyMethods {\n\t\tgroup.handle(method, relativePath, handlers)\n\t}\n\n\treturn group.returnObj()\n}", "docstring": "// Any registers a route that matches all the HTTP methods.\n// GET, POST, PUT, PATCH, HEAD, OPTIONS, DELETE, CONNECT, TRACE.", "url": "https://github.com/grafana/beyla/blob/2f2517bd9e5824bcd315292e62102f361a216434/vendor/github.com/gin-gonic/gin/routergroup.go#L147-L153", "sha": "2f2517bd9e5824bcd315292e62102f361a216434"}685{"repo_name": "beyla", "dataset": "github_2023", "owner": "grafana", "lang": "go", "func_name": "Float64Value", "code": "func Float64Value(v *float64) float64 {\n\tif v != nil {\n\t\treturn *v\n\t}\n\treturn 0\n}", "docstring": "// Float64Value returns the value of the float64 pointer passed in or\n// 0 if the pointer is nil.", "url": "https://github.com/grafana/beyla/blob/2f2517bd9e5824bcd315292e62102f361a216434/vendor/github.com/go-openapi/swag/convert_types.go#L621-L626", "sha": "2f2517bd9e5824bcd315292e62102f361a216434"}686{"repo_name": "beyla", "dataset": "github_2023", "owner": "grafana", "lang": "go", "func_name": "isTIGER128", "code": "func isTIGER128(fl FieldLevel) bool {\n\treturn tiger128Regex.MatchString(fl.Field().String())\n}", "docstring": "// isTIGER128 is the validation function for validating if the field's value is a valid TIGER128.", "url": "https://github.com/grafana/beyla/blob/2f2517bd9e5824bcd315292e62102f361a216434/vendor/github.com/go-playground/validator/v10/baked_in.go#L589-L591", "sha": "2f2517bd9e5824bcd315292e62102f361a216434"}687{"repo_name": "beyla", "dataset": "github_2023", "owner": "grafana", "lang": "go", "func_name": "appendMerge", "code": "func appendMerge(target, sub []int) []int {\n\tlt, ls := len(target), len(sub)\n\tout := make([]int, 0, lt+ls)\n\n\tfor x, y := 0, 0; x < lt || y < ls; {\n\t\tif x >= lt {\n\t\t\tout = append(out, sub[y:]...)\n\t\t\tbreak\n\t\t}\n\n\t\tif y >= ls {\n\t\t\tout = append(out, target[x:]...)\n\t\t\tbreak\n\t\t}\n\n\t\txValue := target[x]\n\t\tyValue := sub[y]\n\n\t\tswitch {\n\n\t\tcase xValue == yValue:\n\t\t\tout = append(out, xValue)\n\t\t\tx++\n\t\t\ty++\n\n\t\tcase xValue < yValue:\n\t\t\tout = append(out, xValue)\n\t\t\tx++\n\n\t\tcase yValue < xValue:\n\t\t\tout = append(out, yValue)\n\t\t\ty++\n\n\t\t}\n\t}\n\n\ttarget = append(target[:0], out...)\n\n\treturn target\n}", "docstring": "// appendMerge merges and sorts given already SORTED and UNIQUE segments.", "url": "https://github.com/grafana/beyla/blob/2f2517bd9e5824bcd315292e62102f361a216434/vendor/github.com/gobwas/glob/match/match.go#L33-L72", "sha": "2f2517bd9e5824bcd315292e62102f361a216434"}688{"repo_name": "beyla", "dataset": "github_2023", "owner": "grafana", "lang": "go", "func_name": "cleanupSurroundingIdentical", "code": "func cleanupSurroundingIdentical(groups []diffStats, eq func(i, j int) bool) []diffStats {\n\tvar ix, iy int // indexes into sequence x and y\n\tfor i, ds := range groups {\n\t\t// Handle equal group.\n\t\tif ds.NumDiff() == 0 {\n\t\t\tix += ds.NumIdentical\n\t\t\tiy += ds.NumIdentical\n\t\t\tcontinue\n\t\t}\n\n\t\t// Handle unequal group.\n\t\tnx := ds.NumIdentical + ds.NumRemoved + ds.NumModified\n\t\tny := ds.NumIdentical + ds.NumInserted + ds.NumModified\n\t\tvar numLeadingIdentical, numTrailingIdentical int\n\t\tfor j := 0; j < nx && j < ny && eq(ix+j, iy+j); j++ {\n\t\t\tnumLeadingIdentical++\n\t\t}\n\t\tfor j := 0; j < nx && j < ny && eq(ix+nx-1-j, iy+ny-1-j); j++ {\n\t\t\tnumTrailingIdentical++\n\t\t}\n\t\tif numIdentical := numLeadingIdentical + numTrailingIdentical; numIdentical > 0 {\n\t\t\tif numLeadingIdentical > 0 {\n\t\t\t\t// Remove leading identical span from this group and\n\t\t\t\t// insert it into the preceding group.\n\t\t\t\tif i-1 >= 0 {\n\t\t\t\t\tgroups[i-1].NumIdentical += numLeadingIdentical\n\t\t\t\t} else {\n\t\t\t\t\t// No preceding group exists, so prepend a new group,\n\t\t\t\t\t// but do so after we finish iterating over all groups.\n\t\t\t\t\tdefer func() {\n\t\t\t\t\t\tgroups = append([]diffStats{{Name: groups[0].Name, NumIdentical: numLeadingIdentical}}, groups...)\n\t\t\t\t\t}()\n\t\t\t\t}\n\t\t\t\t// Increment indexes since the preceding group would have handled this.\n\t\t\t\tix += numLeadingIdentical\n\t\t\t\tiy += numLeadingIdentical\n\t\t\t}\n\t\t\tif numTrailingIdentical > 0 {\n\t\t\t\t// Remove trailing identical span from this group and\n\t\t\t\t// insert it into the succeeding group.\n\t\t\t\tif i+1 < len(groups) {\n\t\t\t\t\tgroups[i+1].NumIdentical += numTrailingIdentical\n\t\t\t\t} else {\n\t\t\t\t\t// No succeeding group exists, so append a new group,\n\t\t\t\t\t// but do so after we finish iterating over all groups.\n\t\t\t\t\tdefer func() {\n\t\t\t\t\t\tgroups = append(groups, diffStats{Name: groups[len(groups)-1].Name, NumIdentical: numTrailingIdentical})\n\t\t\t\t\t}()\n\t\t\t\t}\n\t\t\t\t// Do not increment indexes since the succeeding group will handle this.\n\t\t\t}\n\n\t\t\t// Update this group since some identical elements were removed.\n\t\t\tnx -= numIdentical\n\t\t\tny -= numIdentical\n\t\t\tgroups[i] = diffStats{Name: ds.Name, NumRemoved: nx, NumInserted: ny}\n\t\t}\n\t\tix += nx\n\t\tiy += ny\n\t}\n\treturn groups\n}", "docstring": "// cleanupSurroundingIdentical scans through all unequal groups, and\n// moves any leading sequence of equal elements to the preceding equal group and\n// moves and trailing sequence of equal elements to the succeeding equal group.\n//\n// This is necessary since coalesceInterveningIdentical may coalesce edit groups\n// together such that leading/trailing spans of equal elements becomes possible.\n// Note that this can occur even with an optimal diffing algorithm.\n//\n// Example:\n//\n//\tInput: [\n//\t\t{NumIdentical: 61},\n//\t\t{NumIdentical: 1 , NumRemoved: 11, NumInserted: 2}, // assume 3 leading identical elements\n//\t\t{NumIdentical: 67},\n//\t\t{NumIdentical: 7, NumRemoved: 12, NumInserted: 3},  // assume 10 trailing identical elements\n//\t\t{NumIdentical: 54},\n//\t]\n//\tOutput: [\n//\t\t{NumIdentical: 64}, // incremented by 3\n//\t\t{NumRemoved: 9},\n//\t\t{NumIdentical: 67},\n//\t\t{NumRemoved: 9},\n//\t\t{NumIdentical: 64}, // incremented by 10\n//\t]", "url": "https://github.com/grafana/beyla/blob/2f2517bd9e5824bcd315292e62102f361a216434/vendor/github.com/google/go-cmp/cmp/report_slices.go#L553-L614", "sha": "2f2517bd9e5824bcd315292e62102f361a216434"}689{"repo_name": "beyla", "dataset": "github_2023", "owner": "grafana", "lang": "go", "func_name": "Setns", "code": "func Setns(ns NsHandle, nstype int) (err error) {\n\treturn ErrNotImplemented\n}", "docstring": "// Setns sets namespace using golang.org/x/sys/unix.Setns on Linux. It\n// is not implemented on other platforms.\n//\n// Deprecated: Use golang.org/x/sys/unix.Setns instead.", "url": "https://github.com/grafana/beyla/blob/2f2517bd9e5824bcd315292e62102f361a216434/vendor/github.com/vishvananda/netns/netns_others.go#L18-L20", "sha": "2f2517bd9e5824bcd315292e62102f361a216434"}690{"repo_name": "beyla", "dataset": "github_2023", "owner": "grafana", "lang": "go", "func_name": "MessagingServicebusMessageEnqueuedTime", "code": "func MessagingServicebusMessageEnqueuedTime(val int) attribute.KeyValue {\n\treturn MessagingServicebusMessageEnqueuedTimeKey.Int(val)\n}", "docstring": "// MessagingServicebusMessageEnqueuedTime returns an attribute KeyValue\n// conforming to the \"messaging.servicebus.message.enqueued_time\" semantic\n// conventions. It represents the UTC epoch seconds at which the message has\n// been accepted and stored in the entity.", "url": "https://github.com/grafana/beyla/blob/2f2517bd9e5824bcd315292e62102f361a216434/vendor/go.opentelemetry.io/otel/semconv/v1.25.0/attribute_group.go#L5776-L5778", "sha": "2f2517bd9e5824bcd315292e62102f361a216434"}691{"repo_name": "beyla", "dataset": "github_2023", "owner": "grafana", "lang": "go", "func_name": "IsValid", "code": "func (t TraceID) IsValid() bool {\n\treturn !bytes.Equal(t[:], nilTraceID[:])\n}", "docstring": "// IsValid checks whether the trace TraceID is valid. A valid trace ID does\n// not consist of zeros only.", "url": "https://github.com/grafana/beyla/blob/2f2517bd9e5824bcd315292e62102f361a216434/vendor/go.opentelemetry.io/otel/trace/trace.go#L43-L45", "sha": "2f2517bd9e5824bcd315292e62102f361a216434"}692{"repo_name": "beyla", "dataset": "github_2023", "owner": "grafana", "lang": "go", "func_name": "LowercaseLevelEncoder", "code": "func LowercaseLevelEncoder(l Level, enc PrimitiveArrayEncoder) {\n\tenc.AppendString(l.String())\n}", "docstring": "// LowercaseLevelEncoder serializes a Level to a lowercase string. For example,\n// InfoLevel is serialized to \"info\".", "url": "https://github.com/grafana/beyla/blob/2f2517bd9e5824bcd315292e62102f361a216434/vendor/go.uber.org/zap/zapcore/encoder.go#L47-L49", "sha": "2f2517bd9e5824bcd315292e62102f361a216434"}693{"repo_name": "beyla", "dataset": "github_2023", "owner": "grafana", "lang": "go", "func_name": "ToUnicode", "code": "func ToUnicode(s string) (string, error) {\n\treturn Punycode.process(s, false)\n}", "docstring": "// ToUnicode is a wrapper for Punycode.ToUnicode.", "url": "https://github.com/grafana/beyla/blob/2f2517bd9e5824bcd315292e62102f361a216434/vendor/golang.org/x/net/idna/idna10.0.0.go#L51-L53", "sha": "2f2517bd9e5824bcd315292e62102f361a216434"}694{"repo_name": "beyla", "dataset": "github_2023", "owner": "grafana", "lang": "go", "func_name": "Setegid", "code": "func Setegid(egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/grafana/beyla/blob/2f2517bd9e5824bcd315292e62102f361a216434/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go#L1542-L1548", "sha": "2f2517bd9e5824bcd315292e62102f361a216434"}695{"repo_name": "beyla", "dataset": "github_2023", "owner": "grafana", "lang": "go", "func_name": "Seek", "code": "func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {\n\tr0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence))\n\tnewoffset = int64(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/grafana/beyla/blob/2f2517bd9e5824bcd315292e62102f361a216434/vendor/golang.org/x/sys/unix/zsyscall_freebsd_riscv64.go#L1520-L1527", "sha": "2f2517bd9e5824bcd315292e62102f361a216434"}696{"repo_name": "beyla", "dataset": "github_2023", "owner": "grafana", "lang": "go", "func_name": "sendto", "code": "func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/grafana/beyla/blob/2f2517bd9e5824bcd315292e62102f361a216434/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go#L168-L180", "sha": "2f2517bd9e5824bcd315292e62102f361a216434"}697{"repo_name": "beyla", "dataset": "github_2023", "owner": "grafana", "lang": "go", "func_name": "ForceCodec", "code": "func ForceCodec(codec encoding.Codec) CallOption {\n\treturn ForceCodecCallOption{Codec: codec}\n}", "docstring": "// ForceCodec returns a CallOption that will set codec to be used for all\n// request and response messages for a call. The result of calling Name() will\n// be used as the content-subtype after converting to lowercase, unless\n// CallContentSubtype is also used.\n//\n// See Content-Type on\n// https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests for\n// more details. Also see the documentation on RegisterCodec and\n// CallContentSubtype for more details on the interaction between Codec and\n// content-subtype.\n//\n// This function is provided for advanced users; prefer to use only\n// CallContentSubtype to select a registered codec instead.\n//\n// # Experimental\n//\n// Notice: This API is EXPERIMENTAL and may be changed or removed in a\n// later release.", "url": "https://github.com/grafana/beyla/blob/2f2517bd9e5824bcd315292e62102f361a216434/vendor/google.golang.org/grpc/rpc_util.go#L498-L500", "sha": "2f2517bd9e5824bcd315292e62102f361a216434"}698{"repo_name": "beyla", "dataset": "github_2023", "owner": "grafana", "lang": "go", "func_name": "IsValid", "code": "func (v Value) IsValid() bool {\n\treturn v.typ != nilType\n}", "docstring": "// IsValid reports whether v is populated with a value.", "url": "https://github.com/grafana/beyla/blob/2f2517bd9e5824bcd315292e62102f361a216434/vendor/google.golang.org/protobuf/reflect/protoreflect/value_union.go#L191-L193", "sha": "2f2517bd9e5824bcd315292e62102f361a216434"}699{"repo_name": "beyla", "dataset": "github_2023", "owner": "grafana", "lang": "go", "func_name": "addKnownTypes", "code": "func addKnownTypes(scheme *runtime.Scheme) error {\n\tscheme.AddKnownTypes(SchemeGroupVersion,\n\t\t&Ingress{},\n\t\t&IngressList{},\n\t\t&IngressClass{},\n\t\t&IngressClassList{},\n\t)\n\t// Add the watch version that applies\n\tmetav1.AddToGroupVersion(scheme, SchemeGroupVersion)\n\treturn nil\n}", "docstring": "// Adds the list of known types to the given scheme.", "url": "https://github.com/grafana/beyla/blob/2f2517bd9e5824bcd315292e62102f361a216434/vendor/k8s.io/api/networking/v1beta1/register.go#L48-L58", "sha": "2f2517bd9e5824bcd315292e62102f361a216434"}700{"repo_name": "beyla", "dataset": "github_2023", "owner": "grafana", "lang": "go", "func_name": "diffMaps", "code": "func diffMaps(original, modified map[string]interface{}, schema LookupPatchMeta, diffOptions DiffOptions) (map[string]interface{}, error) {\n\tpatch := map[string]interface{}{}\n\n\t// This will be used to build the $retainKeys directive sent in the patch\n\tretainKeysList := make([]interface{}, 0, len(modified))\n\n\t// Compare each value in the modified map against the value in the original map\n\tfor key, modifiedValue := range modified {\n\t\t// Get the underlying type for pointers\n\t\tif diffOptions.BuildRetainKeysDirective && modifiedValue != nil {\n\t\t\tretainKeysList = append(retainKeysList, key)\n\t\t}\n\n\t\toriginalValue, ok := original[key]\n\t\tif !ok {\n\t\t\t// Key was added, so add to patch\n\t\t\tif !diffOptions.IgnoreChangesAndAdditions {\n\t\t\t\tpatch[key] = modifiedValue\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\t// The patch may have a patch directive\n\t\t// TODO: figure out if we need this. This shouldn't be needed by apply. When would the original map have patch directives in it?\n\t\tfoundDirectiveMarker, err := handleDirectiveMarker(key, originalValue, modifiedValue, patch)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif foundDirectiveMarker {\n\t\t\tcontinue\n\t\t}\n\n\t\tif reflect.TypeOf(originalValue) != reflect.TypeOf(modifiedValue) {\n\t\t\t// Types have changed, so add to patch\n\t\t\tif !diffOptions.IgnoreChangesAndAdditions {\n\t\t\t\tpatch[key] = modifiedValue\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\t// Types are the same, so compare values\n\t\tswitch originalValueTyped := originalValue.(type) {\n\t\tcase map[string]interface{}:\n\t\t\tmodifiedValueTyped := modifiedValue.(map[string]interface{})\n\t\t\terr = handleMapDiff(key, originalValueTyped, modifiedValueTyped, patch, schema, diffOptions)\n\t\tcase []interface{}:\n\t\t\tmodifiedValueTyped := modifiedValue.([]interface{})\n\t\t\terr = handleSliceDiff(key, originalValueTyped, modifiedValueTyped, patch, schema, diffOptions)\n\t\tdefault:\n\t\t\treplacePatchFieldIfNotEqual(key, originalValue, modifiedValue, patch, diffOptions)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tupdatePatchIfMissing(original, modified, patch, diffOptions)\n\t// Insert the retainKeysList iff there are values present in the retainKeysList and\n\t// either of the following is true:\n\t// - the patch is not empty\n\t// - there are additional field in original that need to be cleared\n\tif len(retainKeysList) > 0 &&\n\t\t(len(patch) > 0 || hasAdditionalNewField(original, modified)) {\n\t\tpatch[retainKeysDirective] = sortScalars(retainKeysList)\n\t}\n\treturn patch, nil\n}", "docstring": "// Returns a (recursive) strategic merge patch that yields modified when applied to original.\n// Including:\n// - Adding fields to the patch present in modified, missing from original\n// - Setting fields to the patch present in modified and original with different values\n// - Delete fields present in original, missing from modified through\n// - IFF map field - set to nil in patch\n// - IFF list of maps && merge strategy - use deleteDirective for the elements\n// - IFF list of primitives && merge strategy - use parallel deletion list\n// - IFF list of maps or primitives with replace strategy (default) - set patch value to the value in modified\n// - Build $retainKeys directive for fields with retainKeys patch strategy", "url": "https://github.com/grafana/beyla/blob/2f2517bd9e5824bcd315292e62102f361a216434/vendor/k8s.io/apimachinery/pkg/util/strategicpatch/patch.go#L168-L234", "sha": "2f2517bd9e5824bcd315292e62102f361a216434"}701{"repo_name": "beyla", "dataset": "github_2023", "owner": "grafana", "lang": "go", "func_name": "ExtractReplicaSet", "code": "func ExtractReplicaSet(replicaSet *extensionsv1beta1.ReplicaSet, fieldManager string) (*ReplicaSetApplyConfiguration, error) {\n\treturn extractReplicaSet(replicaSet, fieldManager, \"\")\n}", "docstring": "// ExtractReplicaSet extracts the applied configuration owned by fieldManager from\n// replicaSet. If no managedFields are found in replicaSet for fieldManager, a\n// ReplicaSetApplyConfiguration is returned with only the Name, Namespace (if applicable),\n// APIVersion and Kind populated. It is possible that no managed fields were found for because other\n// field managers have taken ownership of all the fields previously owned by fieldManager, or because\n// the fieldManager never owned fields any fields.\n// replicaSet must be a unmodified ReplicaSet API object that was retrieved from the Kubernetes API.\n// ExtractReplicaSet provides a way to perform a extract/modify-in-place/apply workflow.\n// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously\n// applied if another fieldManager has updated or force applied any of the previously applied fields.\n// Experimental!", "url": "https://github.com/grafana/beyla/blob/2f2517bd9e5824bcd315292e62102f361a216434/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/replicaset.go#L61-L63", "sha": "2f2517bd9e5824bcd315292e62102f361a216434"}702{"repo_name": "beyla", "dataset": "github_2023", "owner": "grafana", "lang": "go", "func_name": "IsValidURI", "code": "func (r *Ref) IsValidURI(basepaths ...string) bool {\n\tif r.String() == \"\" {\n\t\treturn true\n\t}\n\n\tv := r.RemoteURI()\n\tif v == \"\" {\n\t\treturn true\n\t}\n\n\tif r.HasFullURL {\n\t\trr, err := http.Get(v)\n\t\tif err != nil {\n\t\t\treturn false\n\t\t}\n\n\t\treturn rr.StatusCode/100 == 2\n\t}\n\n\tif !(r.HasFileScheme || r.HasFullFilePath || r.HasURLPathOnly) {\n\t\treturn false\n\t}\n\n\t// check for local file\n\tpth := v\n\tif r.HasURLPathOnly {\n\t\tbase := \".\"\n\t\tif len(basepaths) > 0 {\n\t\t\tbase = filepath.Dir(filepath.Join(basepaths...))\n\t\t}\n\t\tp, e := filepath.Abs(filepath.ToSlash(filepath.Join(base, pth)))\n\t\tif e != nil {\n\t\t\treturn false\n\t\t}\n\t\tpth = p\n\t}\n\n\tfi, err := os.Stat(filepath.ToSlash(pth))\n\tif err != nil {\n\t\treturn false\n\t}\n\n\treturn !fi.IsDir()\n}", "docstring": "// IsValidURI returns true when the url the ref points to can be found", "url": "https://github.com/grafana/beyla/blob/2f2517bd9e5824bcd315292e62102f361a216434/vendor/k8s.io/kube-openapi/pkg/validation/spec/ref.go#L60-L103", "sha": "2f2517bd9e5824bcd315292e62102f361a216434"}703{"repo_name": "beyla", "dataset": "github_2023", "owner": "grafana", "lang": "go", "func_name": "MultiMutatingHandler", "code": "func MultiMutatingHandler(handlers ...Handler) Handler {\n\treturn multiMutating(handlers)\n}", "docstring": "// MultiMutatingHandler combines multiple mutating webhook handlers into a single\n// mutating webhook handler.  Handlers are called in sequential order, and the first\n// `allowed: false`\tresponse may short-circuit the rest.  Users must take care to\n// ensure patches are disjoint.", "url": "https://github.com/grafana/beyla/blob/2f2517bd9e5824bcd315292e62102f361a216434/vendor/sigs.k8s.io/controller-runtime/pkg/webhook/admission/multi.go#L67-L69", "sha": "2f2517bd9e5824bcd315292e62102f361a216434"}704{"repo_name": "beyla", "dataset": "github_2023", "owner": "grafana", "lang": "go", "func_name": "fileExists", "code": "func fileExists(filePath string) bool {\n\tif _, err := os.Stat(filePath); err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}", "docstring": "// fileExists reports whether the named file or directory exists.", "url": "https://github.com/grafana/beyla/blob/2f2517bd9e5824bcd315292e62102f361a216434/vendor/sigs.k8s.io/e2e-framework/klient/conf/config.go#L144-L152", "sha": "2f2517bd9e5824bcd315292e62102f361a216434"}705{"repo_name": "digger", "dataset": "github_2023", "owner": "diggerhq", "lang": "go", "func_name": "Save", "code": "func (u userPrivateInfoDo) Save(values ...*model.UserPrivateInfo) error {\n\tif len(values) == 0 {\n\t\treturn nil\n\t}\n\treturn u.DO.Save(values)\n}", "docstring": "// Save : !!! underlying implementation is different with GORM\n// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values)", "url": "https://github.com/diggerhq/digger/blob/aa90fe3a96c897be124388d4e47642a7b2aa765b/next/models_generated/user_private_info.gen.go#L265-L270", "sha": "aa90fe3a96c897be124388d4e47642a7b2aa765b"}706{"repo_name": "junodb", "dataset": "github_2023", "owner": "paypal", "lang": "go", "func_name": "NewDBPathsFromData", "code": "func NewDBPathsFromData(paths []string, target_sizes []uint64) []*DBPath {\n\tdbpaths := make([]*DBPath, len(paths))\n\tfor i, path := range paths {\n\t\ttargetSize := target_sizes[i]\n\t\tdbpaths[i] = NewDBPath(path, targetSize)\n\t}\n\n\treturn dbpaths\n}", "docstring": "// NewDBPathsFromData creates a slice with allocated DBPath objects\n// from paths and target_sizes.", "url": "https://github.com/paypal/junodb/blob/9750751a5335111b7a536326df5925e78cad245d/third_party/patches/forked/tecbot/gorocksdb/dbpath.go#L33-L41", "sha": "9750751a5335111b7a536326df5925e78cad245d"}707{"repo_name": "keep-sorted", "dataset": "github_2023", "owner": "google", "lang": "go", "func_name": "isNewline", "code": "func isNewline(lg lineGroup) bool {\n\treturn len(lg.comment) == 0 && len(lg.lines) == 1 && strings.TrimSpace(lg.lines[0]) == \"\"\n}", "docstring": "// isNewline determines if lg is just an empty line.", "url": "https://github.com/google/keep-sorted/blob/8d641518728d604fd965ca442704d0356912e76b/keepsorted/block.go#L328-L330", "sha": "8d641518728d604fd965ca442704d0356912e76b"}708{"repo_name": "gkit", "dataset": "github_2023", "owner": "ml444", "lang": "go", "func_name": "Validate", "code": "func (m *Fixed32NotIn) Validate() error {\n\treturn m.validate(false)\n}", "docstring": "// Validate checks the field values on Fixed32NotIn with the rules defined in\n// the proto definition for this message. If any rules are violated, the first\n// error encountered is returned, or nil if there are no violations.", "url": "https://github.com/ml444/gkit/blob/6ce63f4114065d74e1eecc6d3ab578c60d8a1681/cmd/protoc-gen-go-validate/tests/cases/numbers_validate.pb.go#L4160-L4162", "sha": "6ce63f4114065d74e1eecc6d3ab578c60d8a1681"}709{"repo_name": "cloud-provider-kind", "dataset": "github_2023", "owner": "kubernetes-sigs", "lang": "go", "func_name": "TimeValueMap", "code": "func TimeValueMap(src map[string]*time.Time) map[string]time.Time {\n\tdst := make(map[string]time.Time)\n\tfor k, val := range src {\n\t\tif val != nil {\n\t\t\tdst[k] = *val\n\t\t}\n\t}\n\treturn dst\n}", "docstring": "// TimeValueMap converts a string map of time.Time pointers into a string\n// map of time.Time values", "url": "https://github.com/kubernetes-sigs/cloud-provider-kind/blob/4b1de87e50fa9cab5d8ab80af7108cc233223620/vendor/github.com/go-openapi/swag/convert_types.go#L722-L730", "sha": "4b1de87e50fa9cab5d8ab80af7108cc233223620"}710{"repo_name": "cloud-provider-kind", "dataset": "github_2023", "owner": "kubernetes-sigs", "lang": "go", "func_name": "RegisterFieldEncoder", "code": "func RegisterFieldEncoder(typ string, field string, encoder ValEncoder) {\n\tfieldEncoders[fmt.Sprintf(\"%s/%s\", typ, field)] = encoder\n}", "docstring": "// RegisterFieldEncoder register TypeEncoder for a struct field", "url": "https://github.com/kubernetes-sigs/cloud-provider-kind/blob/4b1de87e50fa9cab5d8ab80af7108cc233223620/vendor/github.com/json-iterator/go/reflect_extension.go#L234-L236", "sha": "4b1de87e50fa9cab5d8ab80af7108cc233223620"}711{"repo_name": "cloud-provider-kind", "dataset": "github_2023", "owner": "kubernetes-sigs", "lang": "go", "func_name": "Size", "code": "func (b *Buffer) Size() int {\n\tsize := len(b.Buf)\n\tfor _, buf := range b.bufs {\n\t\tsize += len(buf)\n\t}\n\treturn size\n}", "docstring": "// Size computes the size of a buffer by adding sizes of every chunk.", "url": "https://github.com/kubernetes-sigs/cloud-provider-kind/blob/4b1de87e50fa9cab5d8ab80af7108cc233223620/vendor/github.com/mailru/easyjson/buffer/pool.go#L161-L167", "sha": "4b1de87e50fa9cab5d8ab80af7108cc233223620"}712{"repo_name": "cloud-provider-kind", "dataset": "github_2023", "owner": "kubernetes-sigs", "lang": "go", "func_name": "socket", "code": "func socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, er := C.socket(C.int(domain), C.int(typ), C.int(proto))\n\tfd = int(r0)\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/kubernetes-sigs/cloud-provider-kind/blob/4b1de87e50fa9cab5d8ab80af7108cc233223620/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc.go#L1155-L1162", "sha": "4b1de87e50fa9cab5d8ab80af7108cc233223620"}713{"repo_name": "cloud-provider-kind", "dataset": "github_2023", "owner": "kubernetes-sigs", "lang": "go", "func_name": "Fadvise", "code": "func Fadvise(fd int, offset int64, length int64, advice int) (err error) {\n\t_, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/kubernetes-sigs/cloud-provider-kind/blob/4b1de87e50fa9cab5d8ab80af7108cc233223620/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go#L65-L71", "sha": "4b1de87e50fa9cab5d8ab80af7108cc233223620"}714{"repo_name": "cloud-provider-kind", "dataset": "github_2023", "owner": "kubernetes-sigs", "lang": "go", "func_name": "Utime", "code": "func Utime(path string, buf *Utimbuf) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/kubernetes-sigs/cloud-provider-kind/blob/4b1de87e50fa9cab5d8ab80af7108cc233223620/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc.go#L575-L586", "sha": "4b1de87e50fa9cab5d8ab80af7108cc233223620"}715{"repo_name": "cloud-provider-kind", "dataset": "github_2023", "owner": "kubernetes-sigs", "lang": "go", "func_name": "IoctlGetPtmget", "code": "func IoctlGetPtmget(fd int, req uint) (*Ptmget, error) {\n\tvar value Ptmget\n\terr := ioctlPtr(fd, req, unsafe.Pointer(&value))\n\treturn &value, err\n}", "docstring": "//sys\tioctl(fd int, req uint, arg uintptr) (err error)\n//sys\tioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) = SYS_IOCTL\n//sys\tsysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL", "url": "https://github.com/kubernetes-sigs/cloud-provider-kind/blob/4b1de87e50fa9cab5d8ab80af7108cc233223620/vendor/golang.org/x/sys/unix/syscall_netbsd.go#L184-L188", "sha": "4b1de87e50fa9cab5d8ab80af7108cc233223620"}716{"repo_name": "cloud-provider-kind", "dataset": "github_2023", "owner": "kubernetes-sigs", "lang": "go", "func_name": "getgroups", "code": "func getgroups(ngid int, gid *_Gid_t) (n int, err error) {\n\tr0, _, e1 := syscall_rawSyscall(libc_getgroups_trampoline_addr, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/kubernetes-sigs/cloud-provider-kind/blob/4b1de87e50fa9cab5d8ab80af7108cc233223620/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go#L17-L24", "sha": "4b1de87e50fa9cab5d8ab80af7108cc233223620"}717{"repo_name": "cloud-provider-kind", "dataset": "github_2023", "owner": "kubernetes-sigs", "lang": "go", "func_name": "Fadvise", "code": "func Fadvise(fd int, offset int64, length int64, advice int) (err error) {\n\t_, _, e1 := Syscall9(SYS_POSIX_FADVISE, uintptr(fd), 0, uintptr(offset), uintptr(offset>>32), uintptr(length), uintptr(length>>32), uintptr(advice), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/kubernetes-sigs/cloud-provider-kind/blob/4b1de87e50fa9cab5d8ab80af7108cc233223620/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go#L828-L834", "sha": "4b1de87e50fa9cab5d8ab80af7108cc233223620"}718{"repo_name": "cloud-provider-kind", "dataset": "github_2023", "owner": "kubernetes-sigs", "lang": "go", "func_name": "lookupValue", "code": "func (t *bidiTrie) lookupValue(n uint32, b byte) uint8 {\n\tswitch {\n\tdefault:\n\t\treturn uint8(bidiValues[n<<6+uint32(b)])\n\t}\n}", "docstring": "// lookupValue determines the type of block n and looks up the value for b.", "url": "https://github.com/kubernetes-sigs/cloud-provider-kind/blob/4b1de87e50fa9cab5d8ab80af7108cc233223620/vendor/golang.org/x/text/unicode/bidi/tables9.0.0.go#L194-L199", "sha": "4b1de87e50fa9cab5d8ab80af7108cc233223620"}719{"repo_name": "cloud-provider-kind", "dataset": "github_2023", "owner": "kubernetes-sigs", "lang": "go", "func_name": "Snapshot", "code": "func (e *Encoder) Snapshot() encoderState {\n\treturn e.encoderState\n}", "docstring": "// Snapshot returns the current snapshot for use in Reset.", "url": "https://github.com/kubernetes-sigs/cloud-provider-kind/blob/4b1de87e50fa9cab5d8ab80af7108cc233223620/vendor/google.golang.org/protobuf/internal/encoding/text/encode.go#L260-L262", "sha": "4b1de87e50fa9cab5d8ab80af7108cc233223620"}720{"repo_name": "cloud-provider-kind", "dataset": "github_2023", "owner": "kubernetes-sigs", "lang": "go", "func_name": "MustParse", "code": "func MustParse(str string) Quantity {\n\tq, err := ParseQuantity(str)\n\tif err != nil {\n\t\tpanic(fmt.Errorf(\"cannot parse '%v': %v\", str, err))\n\t}\n\treturn q\n}", "docstring": "// MustParse turns the given string into a quantity or panics; for tests\n// or other cases where you know the string is valid.", "url": "https://github.com/kubernetes-sigs/cloud-provider-kind/blob/4b1de87e50fa9cab5d8ab80af7108cc233223620/vendor/k8s.io/apimachinery/pkg/api/resource/quantity.go#L138-L144", "sha": "4b1de87e50fa9cab5d8ab80af7108cc233223620"}721{"repo_name": "cloud-provider-kind", "dataset": "github_2023", "owner": "kubernetes-sigs", "lang": "go", "func_name": "RollingUpdateDeployment", "code": "func RollingUpdateDeployment() *RollingUpdateDeploymentApplyConfiguration {\n\treturn &RollingUpdateDeploymentApplyConfiguration{}\n}", "docstring": "// RollingUpdateDeploymentApplyConfiguration constructs a declarative configuration of the RollingUpdateDeployment type for use with\n// apply.", "url": "https://github.com/kubernetes-sigs/cloud-provider-kind/blob/4b1de87e50fa9cab5d8ab80af7108cc233223620/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/rollingupdatedeployment.go#L34-L36", "sha": "4b1de87e50fa9cab5d8ab80af7108cc233223620"}722{"repo_name": "cloud-provider-kind", "dataset": "github_2023", "owner": "kubernetes-sigs", "lang": "go", "func_name": "IngressTLS", "code": "func IngressTLS() *IngressTLSApplyConfiguration {\n\treturn &IngressTLSApplyConfiguration{}\n}", "docstring": "// IngressTLSApplyConfiguration constructs a declarative configuration of the IngressTLS type for use with\n// apply.", "url": "https://github.com/kubernetes-sigs/cloud-provider-kind/blob/4b1de87e50fa9cab5d8ab80af7108cc233223620/vendor/k8s.io/client-go/applyconfigurations/networking/v1/ingresstls.go#L30-L32", "sha": "4b1de87e50fa9cab5d8ab80af7108cc233223620"}723{"repo_name": "cloud-provider-kind", "dataset": "github_2023", "owner": "kubernetes-sigs", "lang": "go", "func_name": "ExtractResourceSliceStatus", "code": "func ExtractResourceSliceStatus(resourceSlice *resourcev1alpha3.ResourceSlice, fieldManager string) (*ResourceSliceApplyConfiguration, error) {\n\treturn extractResourceSlice(resourceSlice, fieldManager, \"status\")\n}", "docstring": "// ExtractResourceSliceStatus is the same as ExtractResourceSlice except\n// that it extracts the status subresource applied configuration.\n// Experimental!", "url": "https://github.com/kubernetes-sigs/cloud-provider-kind/blob/4b1de87e50fa9cab5d8ab80af7108cc233223620/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourceslice.go#L66-L68", "sha": "4b1de87e50fa9cab5d8ab80af7108cc233223620"}724{"repo_name": "chainloop", "dataset": "github_2023", "owner": "chainloop-dev", "lang": "go", "func_name": "CreatedAtIn", "code": "func CreatedAtIn(vs ...time.Time) predicate.Integration {\n\treturn predicate.Integration(sql.FieldIn(FieldCreatedAt, vs...))\n}", "docstring": "// CreatedAtIn applies the In predicate on the \"created_at\" field.", "url": "https://github.com/chainloop-dev/chainloop/blob/a5f4b377b1676bbe7fb1deb146964d13f6caf9fb/app/controlplane/pkg/data/ent/integration/where.go#L375-L377", "sha": "a5f4b377b1676bbe7fb1deb146964d13f6caf9fb"}725{"repo_name": "go-easy-utils", "dataset": "github_2023", "owner": "jefferyjob", "lang": "go", "func_name": "AnyToInt", "code": "func AnyToInt(i any) (int, error) {\n\tv, err := AnyToInt64(i)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\t// int ๅ…ผๅฎน32ไฝๅ’Œ64ไฝ็ณป็ปŸ\n\t//if int64(int(v)) != v {\n\t//\treturn 0, ErrValOut\n\t//}\n\n\treturn int(v), nil\n}", "docstring": "// AnyToInt ๅฐ†็ป™ๅฎš็š„ๅ€ผ่ฝฌๆขไธบ int", "url": "https://github.com/jefferyjob/go-easy-utils/blob/5cc229e3a6de69f3f038a8d7468a990a250a45e2/anyUtil/any_to_int_x.go#L10-L22", "sha": "5cc229e3a6de69f3f038a8d7468a990a250a45e2"}726{"repo_name": "evilginx2-TTPs", "dataset": "github_2023", "owner": "aalex954", "lang": "go", "func_name": "ChallengeBlocks", "code": "func ChallengeBlocks(domain, keyAuth string) ([]byte, []byte, error) {\n\t// Compute the SHA-256 digest of the key authorization.\n\tzBytes := sha256.Sum256([]byte(keyAuth))\n\n\tvalue, err := asn1.Marshal(zBytes[:sha256.Size])\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\t// Add the keyAuth digest as the acmeValidation-v1 extension\n\t// (marked as critical such that it won't be used by non-ACME software).\n\t// Reference: https://tools.ietf.org/html/draft-ietf-acme-tls-alpn-05#section-3\n\textensions := []pkix.Extension{\n\t\t{\n\t\t\tId:       idPeAcmeIdentifierV1,\n\t\t\tCritical: true,\n\t\t\tValue:    value,\n\t\t},\n\t}\n\n\t// Generate a new RSA key for the certificates.\n\ttempPrivateKey, err := certcrypto.GeneratePrivateKey(certcrypto.RSA2048)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\trsaPrivateKey := tempPrivateKey.(*rsa.PrivateKey)\n\n\t// Generate the PEM certificate using the provided private key, domain, and extra extensions.\n\ttempCertPEM, err := certcrypto.GeneratePemCert(rsaPrivateKey, domain, extensions)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\t// Encode the private key into a PEM format. We'll need to use it to generate the x509 keypair.\n\trsaPrivatePEM := certcrypto.PEMEncode(rsaPrivateKey)\n\n\treturn tempCertPEM, rsaPrivatePEM, nil\n}", "docstring": "// ChallengeBlocks returns PEM blocks (certPEMBlock, keyPEMBlock) with the acmeValidation-v1 extension\n// and domain name for the `tls-alpn-01` challenge.", "url": "https://github.com/aalex954/evilginx2-TTPs/blob/6813b69e5eed2c14da2a57c8627cfb2bffb2cd5b/vendor/github.com/go-acme/lego/v3/challenge/tlsalpn01/tls_alpn_challenge.go#L75-L113", "sha": "6813b69e5eed2c14da2a57c8627cfb2bffb2cd5b"}727{"repo_name": "evilginx2-TTPs", "dataset": "github_2023", "owner": "aalex954", "lang": "go", "func_name": "callgetsystemcfg", "code": "func callgetsystemcfg(label int) (r1 uintptr, e1 Errno) {\n\tr1 = uintptr(C.getsystemcfg(C.int(label)))\n\te1 = syscall.GetErrno()\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/aalex954/evilginx2-TTPs/blob/6813b69e5eed2c14da2a57c8627cfb2bffb2cd5b/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gccgo.go#L1026-L1030", "sha": "6813b69e5eed2c14da2a57c8627cfb2bffb2cd5b"}728{"repo_name": "evilginx2-TTPs", "dataset": "github_2023", "owner": "aalex954", "lang": "go", "func_name": "ExtattrListFile", "code": "func ExtattrListFile(file string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(file)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0)\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/aalex954/evilginx2-TTPs/blob/6813b69e5eed2c14da2a57c8627cfb2bffb2cd5b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go#L704-L716", "sha": "6813b69e5eed2c14da2a57c8627cfb2bffb2cd5b"}729{"repo_name": "evilginx2-TTPs", "dataset": "github_2023", "owner": "aalex954", "lang": "go", "func_name": "Setrlimit", "code": "func Setrlimit(resource int, rlim *Rlimit) (err error) {\n\t_, e1 := callsetrlimit(resource, uintptr(unsafe.Pointer(rlim)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/aalex954/evilginx2-TTPs/blob/6813b69e5eed2c14da2a57c8627cfb2bffb2cd5b/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64.go#L1414-L1420", "sha": "6813b69e5eed2c14da2a57c8627cfb2bffb2cd5b"}730{"repo_name": "evilginx2-TTPs", "dataset": "github_2023", "owner": "aalex954", "lang": "go", "func_name": "ExtattrGetFd", "code": "func ExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_GET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0)\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/aalex954/evilginx2-TTPs/blob/6813b69e5eed2c14da2a57c8627cfb2bffb2cd5b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go#L573-L585", "sha": "6813b69e5eed2c14da2a57c8627cfb2bffb2cd5b"}731{"repo_name": "evilginx2-TTPs", "dataset": "github_2023", "owner": "aalex954", "lang": "go", "func_name": "Access", "code": "func Access(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/aalex954/evilginx2-TTPs/blob/6813b69e5eed2c14da2a57c8627cfb2bffb2cd5b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go#L425-L436", "sha": "6813b69e5eed2c14da2a57c8627cfb2bffb2cd5b"}732{"repo_name": "evilginx2-TTPs", "dataset": "github_2023", "owner": "aalex954", "lang": "go", "func_name": "Kill", "code": "func Kill(pid int, signum syscall.Signal) (err error) {\n\t_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/aalex954/evilginx2-TTPs/blob/6813b69e5eed2c14da2a57c8627cfb2bffb2cd5b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go#L1173-L1179", "sha": "6813b69e5eed2c14da2a57c8627cfb2bffb2cd5b"}733{"repo_name": "evilginx2-TTPs", "dataset": "github_2023", "owner": "aalex954", "lang": "go", "func_name": "ExtattrListFd", "code": "func ExtattrListFd(fd int, attrnamespace int, data uintptr, nbytes int) (ret int, err error) {\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FD, uintptr(fd), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0)\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/aalex954/evilginx2-TTPs/blob/6813b69e5eed2c14da2a57c8627cfb2bffb2cd5b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go#L631-L638", "sha": "6813b69e5eed2c14da2a57c8627cfb2bffb2cd5b"}734{"repo_name": "evilginx2-TTPs", "dataset": "github_2023", "owner": "aalex954", "lang": "go", "func_name": "callfchown", "code": "func callfchown(fd int, uid int, gid int) (r1 uintptr, e1 Errno) {\n\tr1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_fchown)), 3, uintptr(fd), uintptr(uid), uintptr(gid), 0, 0, 0)\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/aalex954/evilginx2-TTPs/blob/6813b69e5eed2c14da2a57c8627cfb2bffb2cd5b/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gc.go#L797-L800", "sha": "6813b69e5eed2c14da2a57c8627cfb2bffb2cd5b"}735{"repo_name": "evilginx2-TTPs", "dataset": "github_2023", "owner": "aalex954", "lang": "go", "func_name": "KeyctlString", "code": "func KeyctlString(cmd int, id int) (string, error) {\n\t// We must loop as the string data may change in between the syscalls.\n\t// We could allocate a large buffer here to reduce the chance that the\n\t// syscall needs to be called twice; however, this is unnecessary as\n\t// the performance loss is negligible.\n\tvar buffer []byte\n\tfor {\n\t\t// Try to fill the buffer with data\n\t\tlength, err := KeyctlBuffer(cmd, id, buffer, 0)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\n\t\t// Check if the data was written\n\t\tif length <= len(buffer) {\n\t\t\t// Exclude the null terminator\n\t\t\treturn string(buffer[:length-1]), nil\n\t\t}\n\n\t\t// Make a bigger buffer if needed\n\t\tbuffer = make([]byte, length)\n\t}\n}", "docstring": "// Keyctl Commands (http://man7.org/linux/man-pages/man2/keyctl.2.html)\n// KeyctlInt calls keyctl commands in which each argument is an int.\n// These commands are KEYCTL_REVOKE, KEYCTL_CHOWN, KEYCTL_CLEAR, KEYCTL_LINK,\n// KEYCTL_UNLINK, KEYCTL_NEGATE, KEYCTL_SET_REQKEY_KEYRING, KEYCTL_SET_TIMEOUT,\n// KEYCTL_ASSUME_AUTHORITY, KEYCTL_SESSION_TO_PARENT, KEYCTL_REJECT,\n// KEYCTL_INVALIDATE, and KEYCTL_GET_PERSISTENT.\n//sys\tKeyctlInt(cmd int, arg2 int, arg3 int, arg4 int, arg5 int) (ret int, err error) = SYS_KEYCTL\n// KeyctlBuffer calls keyctl commands in which the third and fourth\n// arguments are a buffer and its length, respectively.\n// These commands are KEYCTL_UPDATE, KEYCTL_READ, and KEYCTL_INSTANTIATE.\n//sys\tKeyctlBuffer(cmd int, arg2 int, buf []byte, arg5 int) (ret int, err error) = SYS_KEYCTL\n// KeyctlString calls keyctl commands which return a string.\n// These commands are KEYCTL_DESCRIBE and KEYCTL_GET_SECURITY.", "url": "https://github.com/aalex954/evilginx2-TTPs/blob/6813b69e5eed2c14da2a57c8627cfb2bffb2cd5b/vendor/golang.org/x/sys/unix/syscall_linux.go#L1201-L1223", "sha": "6813b69e5eed2c14da2a57c8627cfb2bffb2cd5b"}736{"repo_name": "fleek", "dataset": "github_2023", "owner": "ublue-os", "lang": "go", "func_name": "NewError", "code": "func NewError(reason string) *Error {\n\treturn &Error{reason: reason}\n}", "docstring": "// NewError returns a new error.", "url": "https://github.com/ublue-os/fleek/blob/2beec3661ab231c03034b817b3b4ee60125e3173/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/error.go#L11-L13", "sha": "2beec3661ab231c03034b817b3b4ee60125e3173"}737{"repo_name": "fleek", "dataset": "github_2023", "owner": "ublue-os", "lang": "go", "func_name": "Changed", "code": "func (f *FlagSet) Changed(name string) bool {\n\tflag := f.Lookup(name)\n\t// If a flag doesn't exist, it wasn't changed....\n\tif flag == nil {\n\t\treturn false\n\t}\n\treturn flag.Changed\n}", "docstring": "// Changed returns true if the flag was explicitly set during Parse() and false\n// otherwise", "url": "https://github.com/ublue-os/fleek/blob/2beec3661ab231c03034b817b3b4ee60125e3173/vendor/github.com/spf13/pflag/flag.go#L508-L515", "sha": "2beec3661ab231c03034b817b3b4ee60125e3173"}738{"repo_name": "fleek", "dataset": "github_2023", "owner": "ublue-os", "lang": "go", "func_name": "Fstat", "code": "func Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/ublue-os/fleek/blob/2beec3661ab231c03034b817b3b4ee60125e3173/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go#L85-L91", "sha": "2beec3661ab231c03034b817b3b4ee60125e3173"}739{"repo_name": "fleek", "dataset": "github_2023", "owner": "ublue-os", "lang": "go", "func_name": "pread", "code": "func pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := syscall_syscall6(libc_pread_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "//go:cgo_import_dynamic libc_pathconf pathconf \"libc.so\"\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/ublue-os/fleek/blob/2beec3661ab231c03034b817b3b4ee60125e3173/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go#L1570-L1583", "sha": "2beec3661ab231c03034b817b3b4ee60125e3173"}740{"repo_name": "fleek", "dataset": "github_2023", "owner": "ublue-os", "lang": "go", "func_name": "Access", "code": "func Access(path string, mode uint32) (err error) {\n\treturn Faccessat(AT_FDCWD, path, mode, 0)\n}", "docstring": "/*\n * Wrapped\n */", "url": "https://github.com/ublue-os/fleek/blob/2beec3661ab231c03034b817b3b4ee60125e3173/vendor/golang.org/x/sys/unix/syscall_aix.go#L22-L24", "sha": "2beec3661ab231c03034b817b3b4ee60125e3173"}741{"repo_name": "fleek", "dataset": "github_2023", "owner": "ublue-os", "lang": "go", "func_name": "Sync", "code": "func Sync() {\n\tSyscallNoError(SYS_SYNC, 0, 0, 0)\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/ublue-os/fleek/blob/2beec3661ab231c03034b817b3b4ee60125e3173/vendor/golang.org/x/sys/unix/zsyscall_linux.go#L1602-L1605", "sha": "2beec3661ab231c03034b817b3b4ee60125e3173"}742{"repo_name": "insights-bot", "dataset": "github_2023", "owner": "nekomeowww", "lang": "go", "func_name": "FieldCleared", "code": "func (m *FeedbackSummarizationsReactionsMutation) FieldCleared(name string) bool {\n\t_, ok := m.clearedFields[name]\n\treturn ok\n}", "docstring": "// FieldCleared returns a boolean indicating if a field with the given name was\n// cleared in this mutation.", "url": "https://github.com/nekomeowww/insights-bot/blob/967fa028caf356b0a96eaf19d85dcaa2968bbd1f/ent/mutation.go#L3043-L3046", "sha": "967fa028caf356b0a96eaf19d85dcaa2968bbd1f"}743{"repo_name": "prometheus-plex-exporter", "dataset": "github_2023", "owner": "jsclayton", "lang": "go", "func_name": "Linkat", "code": "func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_LINKAT, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/jsclayton/prometheus-plex-exporter/blob/041ea971fadc6db467ef8f792b6f4f824cc3034e/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go#L1230-L1246", "sha": "041ea971fadc6db467ef8f792b6f4f824cc3034e"}744{"repo_name": "prometheus-plex-exporter", "dataset": "github_2023", "owner": "jsclayton", "lang": "go", "func_name": "mknodat", "code": "func mknodat(fd int, path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_MKNODAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/jsclayton/prometheus-plex-exporter/blob/041ea971fadc6db467ef8f792b6f4f824cc3034e/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go#L1335-L1346", "sha": "041ea971fadc6db467ef8f792b6f4f824cc3034e"}745{"repo_name": "prometheus-plex-exporter", "dataset": "github_2023", "owner": "jsclayton", "lang": "go", "func_name": "Tee", "code": "func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) {\n\tr0, _, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0)\n\tn = int64(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/jsclayton/prometheus-plex-exporter/blob/041ea971fadc6db467ef8f792b6f4f824cc3034e/vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go#L38-L45", "sha": "041ea971fadc6db467ef8f792b6f4f824cc3034e"}746{"repo_name": "prometheus-plex-exporter", "dataset": "github_2023", "owner": "jsclayton", "lang": "go", "func_name": "Fclonefileat", "code": "func Fclonefileat(srcDirfd int, dstDirfd int, dst string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(dst)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := syscall_syscall6(libc_fclonefileat_trampoline_addr, uintptr(srcDirfd), uintptr(dstDirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "//go:cgo_import_dynamic libc_fchownat fchownat \"/usr/lib/libSystem.B.dylib\"\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/jsclayton/prometheus-plex-exporter/blob/041ea971fadc6db467ef8f792b6f4f824cc3034e/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go#L1182-L1193", "sha": "041ea971fadc6db467ef8f792b6f4f824cc3034e"}747{"repo_name": "prometheus-plex-exporter", "dataset": "github_2023", "owner": "jsclayton", "lang": "go", "func_name": "Setresgid", "code": "func Setresgid(rgid int, egid int, sgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/jsclayton/prometheus-plex-exporter/blob/041ea971fadc6db467ef8f792b6f4f824cc3034e/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go#L1695-L1701", "sha": "041ea971fadc6db467ef8f792b6f4f824cc3034e"}748{"repo_name": "prometheus-plex-exporter", "dataset": "github_2023", "owner": "jsclayton", "lang": "go", "func_name": "RegisterExtension", "code": "func (r *Types) RegisterExtension(xt protoreflect.ExtensionType) error {\n\t// Under rare circumstances getting the descriptor might recursively\n\t// examine the registry, so fetch it before locking.\n\t//\n\t// A known case where this can happen: Fetching the TypeDescriptor for a\n\t// legacy ExtensionDesc can consult the global registry.\n\txd := xt.TypeDescriptor()\n\n\tif r == GlobalTypes {\n\t\tglobalMutex.Lock()\n\t\tdefer globalMutex.Unlock()\n\t}\n\n\tfield := xd.Number()\n\tmessage := xd.ContainingMessage().FullName()\n\tif prev := r.extensionsByMessage[message][field]; prev != nil {\n\t\terr := errors.New(\"extension number %d is already registered on message %v\", field, message)\n\t\terr = amendErrorWithCaller(err, prev, xt)\n\t\tif !(r == GlobalTypes && ignoreConflict(xd, err)) {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif err := r.register(\"extension\", xd, xt); err != nil {\n\t\treturn err\n\t}\n\tif r.extensionsByMessage == nil {\n\t\tr.extensionsByMessage = make(extensionsByMessage)\n\t}\n\tif r.extensionsByMessage[message] == nil {\n\t\tr.extensionsByMessage[message] = make(extensionsByNumber)\n\t}\n\tr.extensionsByMessage[message][field] = xt\n\tr.numExtensions++\n\treturn nil\n}", "docstring": "// RegisterExtension registers the provided extension type.\n//\n// If a naming conflict occurs, the type is not registered and an error is returned.", "url": "https://github.com/jsclayton/prometheus-plex-exporter/blob/041ea971fadc6db467ef8f792b6f4f824cc3034e/vendor/google.golang.org/protobuf/reflect/protoregistry/registry.go#L536-L571", "sha": "041ea971fadc6db467ef8f792b6f4f824cc3034e"}749{"repo_name": "wescale", "dataset": "github_2023", "owner": "wesql", "lang": "go", "func_name": "NextPosition", "code": "func (ev binlogEvent) NextPosition() uint32 {\n\treturn binary.LittleEndian.Uint32(ev.Bytes()[13 : 13+4])\n}", "docstring": "// NextPosition returns the nextPosition field from the header", "url": "https://github.com/wesql/wescale/blob/5336f06e5b14979f277b061d622ecf756f16f2c1/go/mysql/binlog_event_common.go#L113-L115", "sha": "5336f06e5b14979f277b061d622ecf756f16f2c1"}750{"repo_name": "wescale", "dataset": "github_2023", "owner": "wesql", "lang": "go", "func_name": "ConvertStateToMySQLErrorCode", "code": "func ConvertStateToMySQLErrorCode(state vterrors.State) string {\n\ts := getStateToMySQLState(state)\n\treturn strconv.Itoa(s.num)\n}", "docstring": "// ConvertStateToMySQLErrorCode returns MySQL error code for the given vterrors.State\n// If the state is == 0, an empty string is returned", "url": "https://github.com/wesql/wescale/blob/5336f06e5b14979f277b061d622ecf756f16f2c1/go/mysql/sql_error.go#L214-L217", "sha": "5336f06e5b14979f277b061d622ecf756f16f2c1"}751{"repo_name": "wescale", "dataset": "github_2023", "owner": "wesql", "lang": "go", "func_name": "checkTablesCount", "code": "func checkTablesCount(t *testing.T, tablet *cluster.Vttablet, showTableName string, expectCount int) {\n\tquery := fmt.Sprintf(`show tables like '%%%s%%';`, showTableName)\n\tqueryResult, err := tablet.VttabletProcess.QueryTablet(query, keyspaceName, true)\n\trequire.Nil(t, err)\n\tassert.Equal(t, expectCount, len(queryResult.Rows))\n}", "docstring": "// checkTablesCount checks the number of tables in the given tablet", "url": "https://github.com/wesql/wescale/blob/5336f06e5b14979f277b061d622ecf756f16f2c1/go/test/endtoend/versionupgrade/upgrade_test.go#L181-L186", "sha": "5336f06e5b14979f277b061d622ecf756f16f2c1"}752{"repo_name": "wescale", "dataset": "github_2023", "owner": "wesql", "lang": "go", "func_name": "GetToTables", "code": "func (node *TruncateTable) GetToTables() TableNames {\n\treturn nil\n}", "docstring": "// GetToTables implements the DDLStatement interface", "url": "https://github.com/wesql/wescale/blob/5336f06e5b14979f277b061d622ecf756f16f2c1/go/vt/sqlparser/ast.go#L1571-L1573", "sha": "5336f06e5b14979f277b061d622ecf756f16f2c1"}753{"repo_name": "wescale", "dataset": "github_2023", "owner": "wesql", "lang": "go", "func_name": "AndNot", "code": "func (bs Bitset) AndNot(b2 Bitset) Bitset {\n\tif len(b2) == 0 {\n\t\treturn bs\n\t}\n\n\tmerged := make([]byte, len(bs))\n\tm := 0\n\n\tfor m = 0; m < len(bs); m++ {\n\t\tif m < len(b2) {\n\t\t\tmerged[m] = bs[m] & ^b2[m]\n\t\t} else {\n\t\t\tmerged[m] = bs[m]\n\t\t}\n\t}\n\tfor ; m > 0; m-- {\n\t\tif merged[m-1] != 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn toBitset(merged[:m])\n}", "docstring": "// AndNot returns the logical AND NOT of the two Bitsets as a new Bitset", "url": "https://github.com/wesql/wescale/blob/5336f06e5b14979f277b061d622ecf756f16f2c1/go/vt/vtgate/semantics/bitset/bitset.go#L100-L121", "sha": "5336f06e5b14979f277b061d622ecf756f16f2c1"}754{"repo_name": "wescale", "dataset": "github_2023", "owner": "wesql", "lang": "go", "func_name": "GenerateInsertStatement", "code": "func GenerateInsertStatement(qr *rules.Rule, ifNotExist bool) (string, error) {\n\tinsertTemplate := getInsertSQLTemplate(ifNotExist)\n\tparsed := sqlparser.BuildParsedQuery(insertTemplate,\n\t\t\":name\",\n\t\t\":description\",\n\t\t\":priority\",\n\t\t\":status\",\n\t\t\":plans\",\n\t\t\":fully_qualified_table_names\",\n\t\t\":query_regex\",\n\t\t\":query_template\",\n\t\t\":request_ip_regex\",\n\t\t\":user_regex\",\n\t\t\":leading_comment_regex\",\n\t\t\":trailing_comment_regex\",\n\t\t\":bind_var_conds\",\n\t\t\":action\",\n\t\t\":action_args\",\n\t)\n\tbindVars, err := qr.ToBindVariable()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tbound, err := parsed.GenerateQuery(bindVars, nil)\n\treturn bound, err\n}", "docstring": "// GenerateInsertStatement returns the SQL statement to insert the rule into the database.", "url": "https://github.com/wesql/wescale/blob/5336f06e5b14979f277b061d622ecf756f16f2c1/go/vt/vttablet/customrule/util.go#L26-L51", "sha": "5336f06e5b14979f277b061d622ecf756f16f2c1"}755{"repo_name": "wescale", "dataset": "github_2023", "owner": "wesql", "lang": "go", "func_name": "buildSelectColumnList", "code": "func buildSelectColumnList(t *schema.Table) string {\n\tbuf := sqlparser.NewTrackedBuffer(nil)\n\tfor i, c := range t.MessageInfo.Fields {\n\t\t// Column names may have to be escaped.\n\t\tif i == 0 {\n\t\t\tbuf.Myprintf(\"%v\", sqlparser.NewIdentifierCI(c.Name))\n\t\t} else {\n\t\t\tbuf.Myprintf(\", %v\", sqlparser.NewIdentifierCI(c.Name))\n\t\t}\n\t}\n\treturn buf.String()\n}", "docstring": "// buildSelectColumnList is a convenience function that\n// builds a 'select' list for the user-defined columns.", "url": "https://github.com/wesql/wescale/blob/5336f06e5b14979f277b061d622ecf756f16f2c1/go/vt/vttablet/tabletserver/messager/message_manager.go#L340-L351", "sha": "5336f06e5b14979f277b061d622ecf756f16f2c1"}756{"repo_name": "kubeadmiral", "dataset": "github_2023", "owner": "kubewharf", "lang": "go", "func_name": "NewCollectedStatusLister", "code": "func NewCollectedStatusLister(indexer cache.Indexer) CollectedStatusLister {\n\treturn &collectedStatusLister{indexer: indexer}\n}", "docstring": "// NewCollectedStatusLister returns a new CollectedStatusLister.", "url": "https://github.com/kubewharf/kubeadmiral/blob/c1d6d2c17b09b129f84303e233a34514f0ace318/pkg/client/listers/core/v1alpha1/collectedstatus.go#L29-L31", "sha": "c1d6d2c17b09b129f84303e233a34514f0ace318"}757{"repo_name": "evil_minio", "dataset": "github_2023", "owner": "AbelChe", "lang": "go", "func_name": "Lstat", "code": "func Lstat(name string) (os.FileInfo, error) {\n\tdefer updateOSMetrics(osMetricLstat, name)()\n\treturn os.Lstat(name)\n}", "docstring": "// Lstat captures time taken to call os.Lstat", "url": "https://github.com/AbelChe/evil_minio/blob/d337ea171f7833d286ae351ca68fd145d8b40e86/cmd/os-instrumented.go#L169-L172", "sha": "d337ea171f7833d286ae351ca68fd145d8b40e86"}758{"repo_name": "evil_minio", "dataset": "github_2023", "owner": "AbelChe", "lang": "go", "func_name": "ParseHTTP", "code": "func (sses3) ParseHTTP(h http.Header) error {\n\tif h.Get(xhttp.AmzServerSideEncryption) != xhttp.AmzEncryptionAES {\n\t\treturn ErrInvalidEncryptionMethod\n\t}\n\treturn nil\n}", "docstring": "// ParseHTTP parses the SSE-S3 related HTTP headers and checks\n// whether they contain valid values.", "url": "https://github.com/AbelChe/evil_minio/blob/d337ea171f7833d286ae351ca68fd145d8b40e86/internal/crypto/sse-s3.go#L55-L60", "sha": "d337ea171f7833d286ae351ca68fd145d8b40e86"}759{"repo_name": "guardllama", "dataset": "github_2023", "owner": "guardllamanet", "lang": "go", "func_name": "GetFilteringEnabled", "code": "func (o *ClientFindSubEntry) GetFilteringEnabled() bool {\n\tif o == nil || o.FilteringEnabled == nil {\n\t\tvar ret bool\n\t\treturn ret\n\t}\n\treturn *o.FilteringEnabled\n}", "docstring": "// GetFilteringEnabled returns the FilteringEnabled field value if set, zero value otherwise.", "url": "https://github.com/guardllamanet/guardllama/blob/26ddaa8e627f6b2a5570f669e34976931be8db74/internal/adguard/gen/model_client_find_sub_entry.go#L152-L158", "sha": "26ddaa8e627f6b2a5570f669e34976931be8db74"}760{"repo_name": "guardllama", "dataset": "github_2023", "owner": "guardllamanet", "lang": "go", "func_name": "IsCRC32", "code": "func IsCRC32(str string) bool {\n\treturn IsHash(str, \"crc32\")\n}", "docstring": "// IsCRC32 checks is a string is a CRC32 hash. Alias for `IsHash(str, \"crc32\")`", "url": "https://github.com/guardllamanet/guardllama/blob/26ddaa8e627f6b2a5570f669e34976931be8db74/vendor/github.com/asaskevich/govalidator/validator.go#L778-L780", "sha": "26ddaa8e627f6b2a5570f669e34976931be8db74"}761{"repo_name": "guardllama", "dataset": "github_2023", "owner": "guardllamanet", "lang": "go", "func_name": "NewSignalChannel", "code": "func NewSignalChannel() (<-chan os.Signal, func()) {\n\tsignalC := make(chan os.Signal, 1)\n\tsignal.Notify(signalC, signals...)\n\treturn signalC, func() {\n\t\tsignal.Stop(signalC)\n\t\tclose(signalC)\n\t}\n}", "docstring": "// NewSignalChannel returns a new channel for interrupt signals.\n//\n// Call the returned function to cancel sending to this channel.", "url": "https://github.com/guardllamanet/guardllama/blob/26ddaa8e627f6b2a5570f669e34976931be8db74/vendor/github.com/bufbuild/buf/private/pkg/interrupt/interrupt.go#L45-L52", "sha": "26ddaa8e627f6b2a5570f669e34976931be8db74"}762{"repo_name": "guardllama", "dataset": "github_2023", "owner": "guardllamanet", "lang": "go", "func_name": "Set", "code": "func (p *PortOpt) Set(value string) error {\n\tlongSyntax, err := regexp.MatchString(`\\w+=\\w+(,\\w+=\\w+)*`, value)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif longSyntax {\n\t\tcsvReader := csv.NewReader(strings.NewReader(value))\n\t\tfields, err := csvReader.Read()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tpConfig := swarm.PortConfig{}\n\t\tfor _, field := range fields {\n\t\t\tparts := strings.SplitN(field, \"=\", 2)\n\t\t\tif len(parts) != 2 {\n\t\t\t\treturn fmt.Errorf(\"invalid field %s\", field)\n\t\t\t}\n\n\t\t\tkey := strings.ToLower(parts[0])\n\t\t\tvalue := strings.ToLower(parts[1])\n\n\t\t\tswitch key {\n\t\t\tcase portOptProtocol:\n\t\t\t\tif value != string(swarm.PortConfigProtocolTCP) && value != string(swarm.PortConfigProtocolUDP) && value != string(swarm.PortConfigProtocolSCTP) {\n\t\t\t\t\treturn fmt.Errorf(\"invalid protocol value %s\", value)\n\t\t\t\t}\n\n\t\t\t\tpConfig.Protocol = swarm.PortConfigProtocol(value)\n\t\t\tcase portOptMode:\n\t\t\t\tif value != string(swarm.PortConfigPublishModeIngress) && value != string(swarm.PortConfigPublishModeHost) {\n\t\t\t\t\treturn fmt.Errorf(\"invalid publish mode value %s\", value)\n\t\t\t\t}\n\n\t\t\t\tpConfig.PublishMode = swarm.PortConfigPublishMode(value)\n\t\t\tcase portOptTargetPort:\n\t\t\t\ttPort, err := strconv.ParseUint(value, 10, 16)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t\tpConfig.TargetPort = uint32(tPort)\n\t\t\tcase portOptPublishedPort:\n\t\t\t\tpPort, err := strconv.ParseUint(value, 10, 16)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t\tpConfig.PublishedPort = uint32(pPort)\n\t\t\tdefault:\n\t\t\t\treturn fmt.Errorf(\"invalid field key %s\", key)\n\t\t\t}\n\t\t}\n\n\t\tif pConfig.TargetPort == 0 {\n\t\t\treturn fmt.Errorf(\"missing mandatory field %q\", portOptTargetPort)\n\t\t}\n\n\t\tif pConfig.PublishMode == \"\" {\n\t\t\tpConfig.PublishMode = swarm.PortConfigPublishModeIngress\n\t\t}\n\n\t\tif pConfig.Protocol == \"\" {\n\t\t\tpConfig.Protocol = swarm.PortConfigProtocolTCP\n\t\t}\n\n\t\tp.ports = append(p.ports, pConfig)\n\t} else {\n\t\t// short syntax\n\t\tportConfigs := []swarm.PortConfig{}\n\t\tports, portBindingMap, err := nat.ParsePortSpecs([]string{value})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfor _, portBindings := range portBindingMap {\n\t\t\tfor _, portBinding := range portBindings {\n\t\t\t\tif portBinding.HostIP != \"\" {\n\t\t\t\t\treturn fmt.Errorf(\"hostip is not supported\")\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor port := range ports {\n\t\t\tportConfig, err := ConvertPortToPortConfig(port, portBindingMap)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tportConfigs = append(portConfigs, portConfig...)\n\t\t}\n\t\tp.ports = append(p.ports, portConfigs...)\n\t}\n\treturn nil\n}", "docstring": "// Set a new port value\n// nolint: gocyclo", "url": "https://github.com/guardllamanet/guardllama/blob/26ddaa8e627f6b2a5570f669e34976931be8db74/vendor/github.com/docker/cli/opts/port.go#L29-L121", "sha": "26ddaa8e627f6b2a5570f669e34976931be8db74"}763{"repo_name": "guardllama", "dataset": "github_2023", "owner": "guardllamanet", "lang": "go", "func_name": "IsDataLoss", "code": "func IsDataLoss(err error) bool {\n\t_, ok := getImplementer(err).(ErrDataLoss)\n\treturn ok\n}", "docstring": "// IsDataLoss returns if the passed in error is an ErrDataLoss", "url": "https://github.com/guardllamanet/guardllama/blob/26ddaa8e627f6b2a5570f669e34976931be8db74/vendor/github.com/docker/docker/errdefs/is.go#L104-L107", "sha": "26ddaa8e627f6b2a5570f669e34976931be8db74"}764{"repo_name": "guardllama", "dataset": "github_2023", "owner": "guardllamanet", "lang": "go", "func_name": "Marshal", "code": "func Marshal(v interface{}) ([]byte, error) {\n\treturn marshal(v, false)\n}", "docstring": "// Marshal returns the JSON encoding of v.\n//\n// Marshal traverses the value v recursively.\n// If an encountered value implements the Marshaler interface\n// and is not a nil pointer, Marshal calls its MarshalJSON method\n// to produce JSON. If no MarshalJSON method is present but the\n// value implements encoding.TextMarshaler instead, Marshal calls\n// its MarshalText method.\n// The nil pointer exception is not strictly necessary\n// but mimics a similar, necessary exception in the behavior of\n// UnmarshalJSON.\n//\n// Otherwise, Marshal uses the following type-dependent default encodings:\n//\n// Boolean values encode as JSON booleans.\n//\n// Floating point, integer, and Number values encode as JSON numbers.\n//\n// String values encode as JSON strings coerced to valid UTF-8,\n// replacing invalid bytes with the Unicode replacement rune.\n// The angle brackets \"<\" and \">\" are escaped to \"\\u003c\" and \"\\u003e\"\n// to keep some browsers from misinterpreting JSON output as HTML.\n// Ampersand \"&\" is also escaped to \"\\u0026\" for the same reason.\n//\n// Array and slice values encode as JSON arrays, except that\n// []byte encodes as a base64-encoded string, and a nil slice\n// encodes as the null JSON object.\n//\n// Struct values encode as JSON objects. Each exported struct field\n// becomes a member of the object unless\n//   - the field's tag is \"-\", or\n//   - the field is empty and its tag specifies the \"omitempty\" option.\n// The empty values are false, 0, any\n// nil pointer or interface value, and any array, slice, map, or string of\n// length zero. The object's default key string is the struct field name\n// but can be specified in the struct field's tag value. The \"json\" key in\n// the struct field's tag value is the key name, followed by an optional comma\n// and options. Examples:\n//\n//   // Field is ignored by this package.\n//   Field int `json:\"-\"`\n//\n//   // Field appears in JSON as key \"myName\".\n//   Field int `json:\"myName\"`\n//\n//   // Field appears in JSON as key \"myName\" and\n//   // the field is omitted from the object if its value is empty,\n//   // as defined above.\n//   Field int `json:\"myName,omitempty\"`\n//\n//   // Field appears in JSON as key \"Field\" (the default), but\n//   // the field is skipped if empty.\n//   // Note the leading comma.\n//   Field int `json:\",omitempty\"`\n//\n// The \"string\" option signals that a field is stored as JSON inside a\n// JSON-encoded string. It applies only to fields of string, floating point,\n// integer, or boolean types. This extra level of encoding is sometimes used\n// when communicating with JavaScript programs:\n//\n//    Int64String int64 `json:\",string\"`\n//\n// The key name will be used if it's a non-empty string consisting of\n// only Unicode letters, digits, dollar signs, percent signs, hyphens,\n// underscores and slashes.\n//\n// Anonymous struct fields are usually marshaled as if their inner exported fields\n// were fields in the outer struct, subject to the usual Go visibility rules amended\n// as described in the next paragraph.\n// An anonymous struct field with a name given in its JSON tag is treated as\n// having that name, rather than being anonymous.\n// An anonymous struct field of interface type is treated the same as having\n// that type as its name, rather than being anonymous.\n//\n// The Go visibility rules for struct fields are amended for JSON when\n// deciding which field to marshal or unmarshal. If there are\n// multiple fields at the same level, and that level is the least\n// nested (and would therefore be the nesting level selected by the\n// usual Go rules), the following extra rules apply:\n//\n// 1) Of those fields, if any are JSON-tagged, only tagged fields are considered,\n// even if there are multiple untagged fields that would otherwise conflict.\n// 2) If there is exactly one field (tagged or not according to the first rule), that is selected.\n// 3) Otherwise there are multiple fields, and all are ignored; no error occurs.\n//\n// Handling of anonymous struct fields is new in Go 1.1.\n// Prior to Go 1.1, anonymous struct fields were ignored. To force ignoring of\n// an anonymous struct field in both current and earlier versions, give the field\n// a JSON tag of \"-\".\n//\n// Map values encode as JSON objects.\n// The map's key type must be string; the map keys are used as JSON object\n// keys, subject to the UTF-8 coercion described for string values above.\n//\n// Pointer values encode as the value pointed to.\n// A nil pointer encodes as the null JSON object.\n//\n// Interface values encode as the value contained in the interface.\n// A nil interface value encodes as the null JSON object.\n//\n// Channel, complex, and function values cannot be encoded in JSON.\n// Attempting to encode such a value causes Marshal to return\n// an UnsupportedTypeError.\n//\n// JSON cannot represent cyclic data structures and Marshal does not\n// handle them.  Passing cyclic structures to Marshal will result in\n// an infinite recursion.\n//", "url": "https://github.com/guardllamanet/guardllama/blob/26ddaa8e627f6b2a5570f669e34976931be8db74/vendor/github.com/docker/go/canonical/json/encode.go#L137-L139", "sha": "26ddaa8e627f6b2a5570f669e34976931be8db74"}765{"repo_name": "guardllama", "dataset": "github_2023", "owner": "guardllamanet", "lang": "go", "func_name": "RandString", "code": "func (c Continue) RandString() string {\n\treturn randString(c.Rand)\n}", "docstring": "// RandString makes a random string up to 20 characters long. The returned string\n// may include a variety of (valid) UTF-8 encodings.", "url": "https://github.com/guardllamanet/guardllama/blob/26ddaa8e627f6b2a5570f669e34976931be8db74/vendor/github.com/google/gofuzz/fuzz.go#L431-L433", "sha": "26ddaa8e627f6b2a5570f669e34976931be8db74"}766{"repo_name": "guardllama", "dataset": "github_2023", "owner": "guardllamanet", "lang": "go", "func_name": "FieldMaskFromRequestBody", "code": "func FieldMaskFromRequestBody(r io.Reader, msg proto.Message) (*field_mask.FieldMask, error) {\n\tfm := &field_mask.FieldMask{}\n\tvar root interface{}\n\n\tif err := json.NewDecoder(r).Decode(&root); err != nil {\n\t\tif err == io.EOF {\n\t\t\treturn fm, nil\n\t\t}\n\t\treturn nil, err\n\t}\n\n\tqueue := []fieldMaskPathItem{{node: root, msg: msg.ProtoReflect()}}\n\tfor len(queue) > 0 {\n\t\t// dequeue an item\n\t\titem := queue[0]\n\t\tqueue = queue[1:]\n\n\t\tm, ok := item.node.(map[string]interface{})\n\t\tswitch {\n\t\tcase ok:\n\t\t\t// if the item is an object, then enqueue all of its children\n\t\t\tfor k, v := range m {\n\t\t\t\tif item.msg == nil {\n\t\t\t\t\treturn nil, errors.New(\"JSON structure did not match request type\")\n\t\t\t\t}\n\n\t\t\t\tfd := getFieldByName(item.msg.Descriptor().Fields(), k)\n\t\t\t\tif fd == nil {\n\t\t\t\t\treturn nil, fmt.Errorf(\"could not find field %q in %q\", k, item.msg.Descriptor().FullName())\n\t\t\t\t}\n\n\t\t\t\tif isDynamicProtoMessage(fd.Message()) {\n\t\t\t\t\tfor _, p := range buildPathsBlindly(string(fd.FullName().Name()), v) {\n\t\t\t\t\t\tnewPath := p\n\t\t\t\t\t\tif item.path != \"\" {\n\t\t\t\t\t\t\tnewPath = item.path + \".\" + newPath\n\t\t\t\t\t\t}\n\t\t\t\t\t\tqueue = append(queue, fieldMaskPathItem{path: newPath})\n\t\t\t\t\t}\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tif isProtobufAnyMessage(fd.Message()) && !fd.IsList() {\n\t\t\t\t\t_, hasTypeField := v.(map[string]interface{})[\"@type\"]\n\t\t\t\t\tif hasTypeField {\n\t\t\t\t\t\tqueue = append(queue, fieldMaskPathItem{path: k})\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn nil, fmt.Errorf(\"could not find field @type in %q in message %q\", k, item.msg.Descriptor().FullName())\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tchild := fieldMaskPathItem{\n\t\t\t\t\tnode: v,\n\t\t\t\t}\n\t\t\t\tif item.path == \"\" {\n\t\t\t\t\tchild.path = string(fd.FullName().Name())\n\t\t\t\t} else {\n\t\t\t\t\tchild.path = item.path + \".\" + string(fd.FullName().Name())\n\t\t\t\t}\n\n\t\t\t\tswitch {\n\t\t\t\tcase fd.IsList(), fd.IsMap():\n\t\t\t\t\t// As per: https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto#L85-L86\n\t\t\t\t\t// Do not recurse into repeated fields. The repeated field goes on the end of the path and we stop.\n\t\t\t\t\tfm.Paths = append(fm.Paths, child.path)\n\t\t\t\tcase fd.Message() != nil:\n\t\t\t\t\tchild.msg = item.msg.Get(fd).Message()\n\t\t\t\t\tfallthrough\n\t\t\t\tdefault:\n\t\t\t\t\tqueue = append(queue, child)\n\t\t\t\t}\n\t\t\t}\n\t\tcase len(item.path) > 0:\n\t\t\t// otherwise, it's a leaf node so print its path\n\t\t\tfm.Paths = append(fm.Paths, item.path)\n\t\t}\n\t}\n\n\t// Sort for deterministic output in the presence\n\t// of repeated fields.\n\tsort.Strings(fm.Paths)\n\n\treturn fm, nil\n}", "docstring": "// FieldMaskFromRequestBody creates a FieldMask printing all complete paths from the JSON body.", "url": "https://github.com/guardllamanet/guardllama/blob/26ddaa8e627f6b2a5570f669e34976931be8db74/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/fieldmask.go#L25-L110", "sha": "26ddaa8e627f6b2a5570f669e34976931be8db74"}767{"repo_name": "guardllama", "dataset": "github_2023", "owner": "guardllamanet", "lang": "go", "func_name": "indexNL", "code": "func (s *set) indexNL(key Key) int {\n\tfor i, k := range s.keys {\n\t\tif k == key {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn -1\n}", "docstring": "// indexNL is Index(), but without the locking", "url": "https://github.com/guardllamanet/guardllama/blob/26ddaa8e627f6b2a5570f669e34976931be8db74/vendor/github.com/lestrrat-go/jwx/jwk/set.go#L67-L74", "sha": "26ddaa8e627f6b2a5570f669e34976931be8db74"}768{"repo_name": "guardllama", "dataset": "github_2023", "owner": "guardllamanet", "lang": "go", "func_name": "BiDirectional", "code": "func BiDirectional() InitOption {\n\treturn func(g *Generator) { g.workflow = &onceWorkflow{workflow: &standardWorkflow{BiDi: true}} }\n}", "docstring": "// BiDirectional instructs the Generator to build the AST graph in both\n// directions (ie, accessing dependents of an entity, not just dependencies).", "url": "https://github.com/guardllamanet/guardllama/blob/26ddaa8e627f6b2a5570f669e34976931be8db74/vendor/github.com/lyft/protoc-gen-star/v2/init_option.go#L47-L49", "sha": "26ddaa8e627f6b2a5570f669e34976931be8db74"}769{"repo_name": "guardllama", "dataset": "github_2023", "owner": "guardllamanet", "lang": "go", "func_name": "DebugFn", "code": "func DebugFn(fn LogFunction) {\n\tstd.DebugFn(fn)\n}", "docstring": "// DebugFn logs a message from a func at level Debug on the standard logger.", "url": "https://github.com/guardllamanet/guardllama/blob/26ddaa8e627f6b2a5570f669e34976931be8db74/vendor/github.com/sirupsen/logrus/exported.go#L143-L145", "sha": "26ddaa8e627f6b2a5570f669e34976931be8db74"}770{"repo_name": "guardllama", "dataset": "github_2023", "owner": "guardllamanet", "lang": "go", "func_name": "Float64SliceVarP", "code": "func Float64SliceVarP(p *[]float64, name, shorthand string, value []float64, usage string) {\n\tCommandLine.VarP(newFloat64SliceValue(value, p), name, shorthand, usage)\n}", "docstring": "// Float64SliceVarP is like Float64SliceVar, but accepts a shorthand letter that can be used after a single dash.", "url": "https://github.com/guardllamanet/guardllama/blob/26ddaa8e627f6b2a5570f669e34976931be8db74/vendor/github.com/spf13/pflag/float64_slice.go#L138-L140", "sha": "26ddaa8e627f6b2a5570f669e34976931be8db74"}771{"repo_name": "guardllama", "dataset": "github_2023", "owner": "guardllamanet", "lang": "go", "func_name": "IPMaskVar", "code": "func IPMaskVar(p *net.IPMask, name string, value net.IPMask, usage string) {\n\tCommandLine.VarP(newIPMaskValue(value, p), name, \"\", usage)\n}", "docstring": "// IPMaskVar defines an net.IPMask flag with specified name, default value, and usage string.\n// The argument p points to an net.IPMask variable in which to store the value of the flag.", "url": "https://github.com/guardllamanet/guardllama/blob/26ddaa8e627f6b2a5570f669e34976931be8db74/vendor/github.com/spf13/pflag/ipmask.go#L89-L91", "sha": "26ddaa8e627f6b2a5570f669e34976931be8db74"}772{"repo_name": "guardllama", "dataset": "github_2023", "owner": "guardllamanet", "lang": "go", "func_name": "filterSet", "code": "func filterSet(kvs []KeyValue, filter Filter) (Set, []KeyValue) {\n\tvar excluded []KeyValue\n\n\t// Move attributes that do not match the filter so they're adjacent before\n\t// calling computeDistinct().\n\tdistinctPosition := len(kvs)\n\n\t// Swap indistinct keys forward and distinct keys toward the\n\t// end of the slice.\n\toffset := len(kvs) - 1\n\tfor ; offset >= 0; offset-- {\n\t\tif filter(kvs[offset]) {\n\t\t\tdistinctPosition--\n\t\t\tkvs[offset], kvs[distinctPosition] = kvs[distinctPosition], kvs[offset]\n\t\t\tcontinue\n\t\t}\n\t}\n\texcluded = kvs[:distinctPosition]\n\n\treturn Set{\n\t\tequivalent: computeDistinct(kvs[distinctPosition:]),\n\t}, excluded\n}", "docstring": "// filterSet reorders kvs so that included keys are contiguous at the end of\n// the slice, while excluded keys precede the included keys.", "url": "https://github.com/guardllamanet/guardllama/blob/26ddaa8e627f6b2a5570f669e34976931be8db74/vendor/go.opentelemetry.io/otel/attribute/set.go#L287-L309", "sha": "26ddaa8e627f6b2a5570f669e34976931be8db74"}773{"repo_name": "guardllama", "dataset": "github_2023", "owner": "guardllamanet", "lang": "go", "func_name": "ptracePtr", "code": "func ptracePtr(request int, pid int, addr unsafe.Pointer, data int) (err error) {\n\t_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/guardllamanet/guardllama/blob/26ddaa8e627f6b2a5570f669e34976931be8db74/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go#L427-L433", "sha": "26ddaa8e627f6b2a5570f669e34976931be8db74"}774{"repo_name": "guardllama", "dataset": "github_2023", "owner": "guardllamanet", "lang": "go", "func_name": "pread", "code": "func pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/guardllamanet/guardllama/blob/26ddaa8e627f6b2a5570f669e34976931be8db74/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go#L1353-L1366", "sha": "26ddaa8e627f6b2a5570f669e34976931be8db74"}775{"repo_name": "guardllama", "dataset": "github_2023", "owner": "guardllamanet", "lang": "go", "func_name": "Getrlimit", "code": "func Getrlimit(resource int, rlim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/guardllamanet/guardllama/blob/26ddaa8e627f6b2a5570f669e34976931be8db74/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go#L155-L161", "sha": "26ddaa8e627f6b2a5570f669e34976931be8db74"}776{"repo_name": "guardllama", "dataset": "github_2023", "owner": "guardllamanet", "lang": "go", "func_name": "pread", "code": "func pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 *byte\n\tif len(p) > 0 {\n\t\t_p0 = &p[0]\n\t}\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procpread)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/guardllamanet/guardllama/blob/26ddaa8e627f6b2a5570f669e34976931be8db74/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go#L1424-L1435", "sha": "26ddaa8e627f6b2a5570f669e34976931be8db74"}777{"repo_name": "guardllama", "dataset": "github_2023", "owner": "guardllamanet", "lang": "go", "func_name": "Namespace", "code": "func (s *EnvSettings) Namespace() string {\n\tif ns, _, err := s.config.ToRawKubeConfigLoader().Namespace(); err == nil {\n\t\treturn ns\n\t}\n\treturn \"default\"\n}", "docstring": "// Namespace gets the namespace from the configuration", "url": "https://github.com/guardllamanet/guardllama/blob/26ddaa8e627f6b2a5570f669e34976931be8db74/vendor/helm.sh/helm/v3/pkg/cli/environment.go#L222-L227", "sha": "26ddaa8e627f6b2a5570f669e34976931be8db74"}778{"repo_name": "guardllama", "dataset": "github_2023", "owner": "guardllamanet", "lang": "go", "func_name": "Resource", "code": "func Resource(resource string) schema.GroupResource {\n\treturn SchemeGroupVersion.WithResource(resource).GroupResource()\n}", "docstring": "// Resource takes an unqualified resource and returns a Group qualified GroupResource", "url": "https://github.com/guardllamanet/guardllama/blob/26ddaa8e627f6b2a5570f669e34976931be8db74/vendor/k8s.io/api/flowcontrol/v1alpha1/register.go#L37-L39", "sha": "26ddaa8e627f6b2a5570f669e34976931be8db74"}779{"repo_name": "guardllama", "dataset": "github_2023", "owner": "guardllamanet", "lang": "go", "func_name": "RegisterDefaults", "code": "func RegisterDefaults(scheme *runtime.Scheme) error {\n\tscheme.AddTypeDefaultingFunc(&CustomResourceDefinition{}, func(obj interface{}) { SetObjectDefaults_CustomResourceDefinition(obj.(*CustomResourceDefinition)) })\n\tscheme.AddTypeDefaultingFunc(&CustomResourceDefinitionList{}, func(obj interface{}) {\n\t\tSetObjectDefaults_CustomResourceDefinitionList(obj.(*CustomResourceDefinitionList))\n\t})\n\treturn nil\n}", "docstring": "// RegisterDefaults adds defaulters functions to the given scheme.\n// Public to allow building arbitrary schemes.\n// All generated defaulters are covering - they call all nested defaulters.", "url": "https://github.com/guardllamanet/guardllama/blob/26ddaa8e627f6b2a5570f669e34976931be8db74/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/zz_generated.defaults.go#L31-L37", "sha": "26ddaa8e627f6b2a5570f669e34976931be8db74"}780{"repo_name": "guardllama", "dataset": "github_2023", "owner": "guardllamanet", "lang": "go", "func_name": "UnmarshalJSON", "code": "func (r *Refable) UnmarshalJSON(d []byte) error {\n\treturn json.Unmarshal(d, &r.Ref)\n}", "docstring": "// UnmarshalJSON unmarshalss the ref from json", "url": "https://github.com/guardllamanet/guardllama/blob/26ddaa8e627f6b2a5570f669e34976931be8db74/vendor/k8s.io/kube-openapi/pkg/validation/spec/ref.go#L37-L39", "sha": "26ddaa8e627f6b2a5570f669e34976931be8db74"}781{"repo_name": "guardllama", "dataset": "github_2023", "owner": "guardllamanet", "lang": "go", "func_name": "ValidateBytes", "code": "func (c *paramVerifyingSchema) ValidateBytes(data []byte) error {\n\tobj, err := schemavalidation.Parse(data)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tgvk, errs := schemavalidation.GetObjectKind(obj)\n\tif errs != nil {\n\t\treturn utilerrors.NewAggregate(errs)\n\t}\n\n\terr = c.verifier.HasSupport(gvk)\n\tif resource.IsParamUnsupportedError(err) {\n\t\tswitch c.directive {\n\t\tcase metav1.FieldValidationStrict:\n\t\t\treturn c.schema.ValidateBytes(data)\n\t\tcase metav1.FieldValidationWarn:\n\t\t\tklog.Warningf(\"cannot perform warn validation if server-side field validation is unsupported, skipping validation\")\n\t\tdefault:\n\t\t\t// can't be reached\n\t\t\tklog.Warningf(\"unexpected field validation directive: %s, skipping validation\", c.directive)\n\t\t}\n\t\treturn nil\n\t}\n\treturn err\n}", "docstring": "// ValidateBytes validates bytes per a ParamVerifyingSchema", "url": "https://github.com/guardllamanet/guardllama/blob/26ddaa8e627f6b2a5570f669e34976931be8db74/vendor/k8s.io/kubectl/pkg/validation/schema.go#L129-L154", "sha": "26ddaa8e627f6b2a5570f669e34976931be8db74"}782{"repo_name": "guardllama", "dataset": "github_2023", "owner": "guardllamanet", "lang": "go", "func_name": "GetNode", "code": "func GetNode(root *yaml.Node, path ...string) (*yaml.Node, bool, error) {\n\tresNode, restPath, err := asCloseAsPossible(root, path...)\n\tif err != nil {\n\t\treturn nil, false, err\n\t}\n\t// more path means the node didn't exist\n\tif len(restPath) != 0 {\n\t\treturn nil, false, nil\n\t}\n\treturn resNode, true, nil\n}", "docstring": "// GetNode gets the node at the given path in the given sequence of mapping\n// nodes, or, if it doesn't exist, returning false.", "url": "https://github.com/guardllamanet/guardllama/blob/26ddaa8e627f6b2a5570f669e34976931be8db74/vendor/sigs.k8s.io/controller-tools/pkg/schemapatcher/internal/yaml/nested.go#L77-L87", "sha": "26ddaa8e627f6b2a5570f669e34976931be8db74"}783{"repo_name": "gotour", "dataset": "github_2023", "owner": "ardanlabs", "lang": "go", "func_name": "main", "code": "func main() {\n\tx := Xenia{\n\t\tHost:    \"localhost:8000\",\n\t\tTimeout: time.Second,\n\t}\n\n\tp := Pillar{\n\t\tHost:    \"localhost:9000\",\n\t\tTimeout: time.Second,\n\t}\n\n\tif err := Copy(&x, &p, 3); err != io.EOF {\n\t\tfmt.Println(err)\n\t}\n}", "docstring": "// =============================================================================", "url": "https://github.com/ardanlabs/gotour/blob/6599a0b6d88dd03619c8bc4c5f53e59c70c36208/_content/tour/eng/composition/decoupling/example6.go#L114-L128", "sha": "6599a0b6d88dd03619c8bc4c5f53e59c70c36208"}784{"repo_name": "gotour", "dataset": "github_2023", "owner": "ardanlabs", "lang": "go", "func_name": "Wait", "code": "func (s *Server) Wait() error {\n\n\t// ฮ ฮกฮŸฮฃฮ ฮŸฮ™ฮ—ฮ˜ฮ•ฮ™ฮคฮ• ฮŸฮคฮ™ ฮฅฮ ฮ‘ฮกฮงฮ•ฮ™ ฮฃฮฅฮ“ฮšฮ•ฮšฮกฮ™ฮœฮ•ฮฮ— ฮฅฮ›ฮŸฮ ฮŸฮ™ฮ—ฮฃฮ—.\n\treturn nil\n}", "docstring": "// ฮ— Wait ฮฑฯ€ฮฟฯ„ฯฮญฯ€ฮตฮน ฯ„ฮฟฮฝ server ฮฝฮฑ ฮดฮตฯ‡ฯ„ฮตฮฏ ฮฝฮญฮตฯ‚ ฯƒฯ…ฮฝฮดฮญฯƒฮตฮนฯ‚.", "url": "https://github.com/ardanlabs/gotour/blob/6599a0b6d88dd03619c8bc4c5f53e59c70c36208/_content/tour/grc/composition/pollution/example2.go#L41-L45", "sha": "6599a0b6d88dd03619c8bc4c5f53e59c70c36208"}785{"repo_name": "gotour", "dataset": "github_2023", "owner": "ardanlabs", "lang": "go", "func_name": "sendNotification", "code": "func sendNotification(n notifier) {\n\tn.notify()\n}", "docstring": "// sendNotification accepts values that implement the notifier\n// interface and sends notifications.", "url": "https://github.com/ardanlabs/gotour/blob/6599a0b6d88dd03619c8bc4c5f53e59c70c36208/_content/tour/tur/interfaces/example3.go#L46-L48", "sha": "6599a0b6d88dd03619c8bc4c5f53e59c70c36208"}786{"repo_name": "gotour", "dataset": "github_2023", "owner": "ardanlabs", "lang": "go", "func_name": "SmallestComponent", "code": "func (v PreciseVector) SmallestComponent() Axis {\n\tt := v.Abs()\n\n\tif t.X.Cmp(t.Y) < 0 {\n\t\tif t.X.Cmp(t.Z) < 0 {\n\t\t\treturn XAxis\n\t\t}\n\t\treturn ZAxis\n\t}\n\tif t.Y.Cmp(t.Z) < 0 {\n\t\treturn YAxis\n\t}\n\treturn ZAxis\n}", "docstring": "// SmallestComponent returns the axis that represents the smallest component in this vector.", "url": "https://github.com/ardanlabs/gotour/blob/6599a0b6d88dd03619c8bc4c5f53e59c70c36208/vendor/github.com/golang/geo/r3/precisevector.go#L185-L198", "sha": "6599a0b6d88dd03619c8bc4c5f53e59c70c36208"}787{"repo_name": "gotour", "dataset": "github_2023", "owner": "ardanlabs", "lang": "go", "func_name": "CheckPath", "code": "func CheckPath(path string) (err error) {\n\tdefer func() {\n\t\tif err != nil {\n\t\t\terr = &InvalidPathError{Kind: \"module\", Path: path, Err: err}\n\t\t}\n\t}()\n\n\tif err := checkPath(path, modulePath); err != nil {\n\t\treturn err\n\t}\n\ti := strings.Index(path, \"/\")\n\tif i < 0 {\n\t\ti = len(path)\n\t}\n\tif i == 0 {\n\t\treturn fmt.Errorf(\"leading slash\")\n\t}\n\tif !strings.Contains(path[:i], \".\") {\n\t\treturn fmt.Errorf(\"missing dot in first path element\")\n\t}\n\tif path[0] == '-' {\n\t\treturn fmt.Errorf(\"leading dash in first path element\")\n\t}\n\tfor _, r := range path[:i] {\n\t\tif !firstPathOK(r) {\n\t\t\treturn fmt.Errorf(\"invalid char %q in first path element\", r)\n\t\t}\n\t}\n\tif _, _, ok := SplitPathVersion(path); !ok {\n\t\treturn fmt.Errorf(\"invalid version\")\n\t}\n\treturn nil\n}", "docstring": "// CheckPath checks that a module path is valid.\n// A valid module path is a valid import path, as checked by [CheckImportPath],\n// with three additional constraints.\n// First, the leading path element (up to the first slash, if any),\n// by convention a domain name, must contain only lower-case ASCII letters,\n// ASCII digits, dots (U+002E), and dashes (U+002D);\n// it must contain at least one dot and cannot start with a dash.\n// Second, for a final path element of the form /vN, where N looks numeric\n// (ASCII digits and dots) must not begin with a leading zero, must not be /v1,\n// and must not contain any dots. For paths beginning with \"gopkg.in/\",\n// this second requirement is replaced by a requirement that the path\n// follow the gopkg.in server's conventions.\n// Third, no path element may begin with a dot.", "url": "https://github.com/ardanlabs/gotour/blob/6599a0b6d88dd03619c8bc4c5f53e59c70c36208/vendor/golang.org/x/mod/module/module.go#L309-L341", "sha": "6599a0b6d88dd03619c8bc4c5f53e59c70c36208"}788{"repo_name": "gotour", "dataset": "github_2023", "owner": "ardanlabs", "lang": "go", "func_name": "accept", "code": "func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/ardanlabs/gotour/blob/6599a0b6d88dd03619c8bc4c5f53e59c70c36208/vendor/golang.org/x/sys/unix/zsyscall_freebsd_riscv64.go#L49-L56", "sha": "6599a0b6d88dd03619c8bc4c5f53e59c70c36208"}789{"repo_name": "gotour", "dataset": "github_2023", "owner": "ardanlabs", "lang": "go", "func_name": "Adjtime", "code": "func Adjtime(delta *Timeval, olddelta *Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/ardanlabs/gotour/blob/6599a0b6d88dd03619c8bc4c5f53e59c70c36208/vendor/golang.org/x/sys/unix/zsyscall_freebsd_riscv64.go#L451-L457", "sha": "6599a0b6d88dd03619c8bc4c5f53e59c70c36208"}790{"repo_name": "gotour", "dataset": "github_2023", "owner": "ardanlabs", "lang": "go", "func_name": "Fchmodat", "code": "func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/ardanlabs/gotour/blob/6599a0b6d88dd03619c8bc4c5f53e59c70c36208/vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go#L657-L668", "sha": "6599a0b6d88dd03619c8bc4c5f53e59c70c36208"}791{"repo_name": "gotour", "dataset": "github_2023", "owner": "ardanlabs", "lang": "go", "func_name": "Setrtable", "code": "func Setrtable(rtable int) (err error) {\n\t_, _, e1 := syscall_rawSyscall(libc_setrtable_trampoline_addr, uintptr(rtable), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "//go:cgo_import_dynamic libc_setresuid setresuid \"libc.so\"\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/ardanlabs/gotour/blob/6599a0b6d88dd03619c8bc4c5f53e59c70c36208/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go#L1946-L1952", "sha": "6599a0b6d88dd03619c8bc4c5f53e59c70c36208"}792{"repo_name": "gotour", "dataset": "github_2023", "owner": "ardanlabs", "lang": "go", "func_name": "Faccessat", "code": "func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := syscall_syscall6(libc_faccessat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "docstring": "//go:cgo_import_dynamic libc_exit exit \"/usr/lib/libSystem.B.dylib\"\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT", "url": "https://github.com/ardanlabs/gotour/blob/6599a0b6d88dd03619c8bc4c5f53e59c70c36208/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go#L1137-L1148", "sha": "6599a0b6d88dd03619c8bc4c5f53e59c70c36208"}793{"repo_name": "gotour", "dataset": "github_2023", "owner": "ardanlabs", "lang": "go", "func_name": "consumeFixed32Ptr", "code": "func consumeFixed32Ptr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {\n\tif wtyp != protowire.Fixed32Type {\n\t\treturn out, errUnknown\n\t}\n\tv, n := protowire.ConsumeFixed32(b)\n\tif n < 0 {\n\t\treturn out, errDecode\n\t}\n\tvp := p.Uint32Ptr()\n\tif *vp == nil {\n\t\t*vp = new(uint32)\n\t}\n\t**vp = v\n\tout.n = n\n\treturn out, nil\n}", "docstring": "// consumeFixed32Ptr wire decodes a *uint32 pointer as a Fixed32.", "url": "https://github.com/ardanlabs/gotour/blob/6599a0b6d88dd03619c8bc4c5f53e59c70c36208/vendor/google.golang.org/protobuf/internal/impl/codec_gen.go#L3486-L3501", "sha": "6599a0b6d88dd03619c8bc4c5f53e59c70c36208"}794{"repo_name": "minder", "dataset": "github_2023", "owner": "mindersec", "lang": "go", "func_name": "ReregisterEntity", "code": "func (_ *RESTProvider) ReregisterEntity(\n\t_ context.Context, _ minderv1.Entity, _ *properties.Properties,\n) error {\n\t// TODO: implement\n\treturn nil\n}", "docstring": "// ReregisterEntity implements the Provider interface", "url": "https://github.com/mindersec/minder/blob/3cb22b6aa37dd3f54af46c3156dd09c4eda60105/internal/providers/testproviders/rest.go#L86-L91", "sha": "3cb22b6aa37dd3f54af46c3156dd09c4eda60105"}795{"repo_name": "minder", "dataset": "github_2023", "owner": "mindersec", "lang": "go", "func_name": "GetNiceStatus", "code": "func GetNiceStatus(code codes.Code) *NiceStatus {\n\ts := &NiceStatus{}\n\treturn s.SetCode(code)\n}", "docstring": "// GetNiceStatus get a nice status from the code.", "url": "https://github.com/mindersec/minder/blob/3cb22b6aa37dd3f54af46c3156dd09c4eda60105/internal/util/statuses.go#L29-L32", "sha": "3cb22b6aa37dd3f54af46c3156dd09c4eda60105"}796{"repo_name": "dendy", "dataset": "github_2023", "owner": "maxpoletaev", "lang": "go", "func_name": "nameTableIdx", "code": "func (p *PPU) nameTableIdx(addr uint16) uint {\n\tvar (\n\t\tidx  = (addr - 0x2000) / 0x0400\n\t\tmode = p.cart.MirrorMode()\n\t)\n\n\tswitch mode {\n\tcase ines.MirrorHorizontal:\n\t\tswitch idx {\n\t\tcase 0, 1:\n\t\t\treturn 0\n\t\tdefault:\n\t\t\treturn 1\n\t\t}\n\tcase ines.MirrorVertical:\n\t\tswitch idx {\n\t\tcase 0, 2:\n\t\t\treturn 0\n\t\tdefault:\n\t\t\treturn 1\n\t\t}\n\tcase ines.MirrorSingle0:\n\t\treturn 0\n\tcase ines.MirrorSingle1:\n\t\treturn 1\n\tdefault:\n\t\tpanic(fmt.Sprintf(\"invalid mirroring mode: %d\", mode))\n\t}\n}", "docstring": "// nameTableIdx returns the index of the nametable (0 or 1) for the given vram\n// address, based on the cartridgeโ€™s mirroring mode.", "url": "https://github.com/maxpoletaev/dendy/blob/19c75f9a5b6e5b891a0c458c71a5eadbb25fddab/ppu/ppu.go#L231-L259", "sha": "19c75f9a5b6e5b891a0c458c71a5eadbb25fddab"}797{"repo_name": "wasi-go", "dataset": "github_2023", "owner": "dispatchrun", "lang": "go", "func_name": "TestSystem", "code": "func TestSystem(t *testing.T, makeSystem MakeSystem) {\n\tt.Run(\"file\", file.runFunc(makeSystem))\n\tt.Run(\"proc\", proc.runFunc(makeSystem))\n\tt.Run(\"poll\", poll.runFunc(makeSystem))\n\tt.Run(\"socket\", socket.runFunc(makeSystem))\n}", "docstring": "// TestSystem is a test suite which validates the behavior of wasi.System\n// implementations.", "url": "https://github.com/dispatchrun/wasi-go/blob/038d5104aacbb966c25af43797473f03c5da3e4f/wasitest/system.go#L14-L19", "sha": "038d5104aacbb966c25af43797473f03c5da3e4f"}798{"repo_name": "ceremonyclient", "dataset": "github_2023", "owner": "QuilibriumNetwork", "lang": "go", "func_name": "AddReservation", "code": "func (c *constraints) AddReservation(p peer.ID, a ma.Multiaddr) error {\n\tc.mutex.Lock()\n\n\tnow := time.Now()\n\tc.cleanup(now)\n\n\tif len(c.total) >= c.rc.MaxReservations {\n\t\tc.mutex.Unlock()\n\t\treturn errTooManyReservations\n\t}\n\n\tip, err := manet.ToIP(a)\n\tif err != nil {\n\t\tc.mutex.Unlock()\n\t\treturn errors.New(\"no IP address associated with peer\")\n\t}\n\n\tpeerReservations := c.peers[p]\n\tif len(peerReservations) >= c.rc.MaxReservationsPerPeer {\n\t\tc.mutex.Unlock()\n\t\treturn errTooManyReservationsForPeer\n\t}\n\n\tipReservations := c.ips[ip.String()]\n\tif len(ipReservations) >= c.rc.MaxReservationsPerIP {\n\t\tc.mutex.Unlock()\n\t\treturn errTooManyReservationsForIP\n\t}\n\n\tvar asnReservations []time.Time\n\tvar asn uint32\n\tif ip.To4() == nil {\n\t\tasn = asnutil.AsnForIPv6(ip)\n\t\tif asn != 0 {\n\t\t\tasnReservations = c.asns[asn]\n\t\t\tif len(asnReservations) >= c.rc.MaxReservationsPerASN {\n\t\t\t\tc.mutex.Unlock()\n\t\t\t\treturn errTooManyReservationsForASN\n\t\t\t}\n\t\t}\n\t}\n\n\texpiry := now.Add(validity)\n\tc.total = append(c.total, expiry)\n\n\tpeerReservations = append(peerReservations, expiry)\n\tc.peers[p] = peerReservations\n\n\tipReservations = append(ipReservations, expiry)\n\tc.ips[ip.String()] = ipReservations\n\n\tif asn != 0 {\n\t\tasnReservations = append(asnReservations, expiry)\n\t\tc.asns[asn] = asnReservations\n\t}\n\tc.mutex.Unlock()\n\treturn nil\n}", "docstring": "// AddReservation adds a reservation for a given peer with a given multiaddr.\n// If adding this reservation violates IP constraints, an error is returned.", "url": "https://github.com/QuilibriumNetwork/ceremonyclient/blob/c3ebffc519ce29a88cc6fe14b3b39049c4989f34/go-libp2p/p2p/protocol/circuitv2/relay/constraints.go#L49-L106", "sha": "c3ebffc519ce29a88cc6fe14b3b39049c4989f34"}799{"repo_name": "ceremonyclient", "dataset": "github_2023", "owner": "QuilibriumNetwork", "lang": "go", "func_name": "Delete", "code": "func (set *IdSet) Delete(atom Atom) bool {\n\tswitch a := atom.(type) {\n\tcase *Vertex:\n\t\tif _, exists := set.atoms[a.GetID()]; exists {\n\t\t\tdelete(set.atoms, a.GetID())\n\t\t\treturn true\n\t\t}\n\tcase *Hyperedge:\n\t\tif _, exists := set.atoms[a.GetID()]; exists {\n\t\t\tdelete(set.atoms, a.GetID())\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "docstring": "// Delete removes an atom from the IdSet and returns true if the atom was\n// present.", "url": "https://github.com/QuilibriumNetwork/ceremonyclient/blob/c3ebffc519ce29a88cc6fe14b3b39049c4989f34/node/hypergraph/inmem/types.go#L106-L120", "sha": "c3ebffc519ce29a88cc6fe14b3b39049c4989f34"}800{"repo_name": "ceremonyclient", "dataset": "github_2023", "owner": "QuilibriumNetwork", "lang": "go", "func_name": "WithReason", "code": "func WithReason(ctx context.Context, reason Reason) context.Context {\n\tinfo := infoFromCtx(ctx)\n\tinfo.reason = reason\n\treturn withInfo(ctx, info)\n}", "docstring": "// WithReason creates a context that has an associated Reason (which ends up in\n// traces created under that context).", "url": "https://github.com/QuilibriumNetwork/ceremonyclient/blob/c3ebffc519ce29a88cc6fe14b3b39049c4989f34/pebble/objstorage/objstorageprovider/objiotracing/obj_io_tracing_on.go#L270-L274", "sha": "c3ebffc519ce29a88cc6fe14b3b39049c4989f34"}801{"repo_name": "java-interview", "dataset": "github_2023", "owner": "Top4IkRu", "lang": "java", "func_name": "SortList.getMid", "code": "public ListNode getMid(ListNode head) {\n        ListNode slow = head, fast = head.next;\n        while (fast != null && fast.next != null) {\n            fast = fast.next.next;\n            slow = slow.next;\n        }\n        return slow;\n    }", "docstring": "/**\n     * Find middle with usage slow and fast pointers\n     */", "url": "https://github.com/Top4IkRu/java-interview/blob/a26c8fdc50157108e12cc1239195b89234e4bfb4/algorithms/src/main/java/solution/linked_list/medium/SortList.java#L35-L42", "sha": "a26c8fdc50157108e12cc1239195b89234e4bfb4"}802{"repo_name": "langhaiblogs", "dataset": "github_2023", "owner": "Allenkuzma", "lang": "java", "func_name": "SystemController.index", "code": "@GetMapping(value = \"/index\")\n    public String index(HttpServletRequest httpRequest, HttpSession session, Model model) {\n        return \"system/index\";\n    }", "docstring": "/**\n     * ่ทณ่ฝฌๅˆฐๆตชๆตทๅšๅฎขๅŽๅฐ็ฎก็†้ฆ–้กต\n     *\n     * @return ๅŽๅฐ็ฎก็†้ฆ–้กต้กต้ข system/index.html\n     */", "url": "https://github.com/Allenkuzma/langhaiblogs/blob/a77bd2103800a65f11812b04afb506aeea9c9eae/src/main/java/cc/langhai/controller/system/SystemController.java#L36-L39", "sha": "a77bd2103800a65f11812b04afb506aeea9c9eae"}803{"repo_name": "cloudclient", "dataset": "github_2023", "owner": "cloudclientdev", "lang": "java", "func_name": "SettingManager.getSettingList", "code": "public ArrayList<Setting> getSettingList() {\n        return settingList;\n    }", "docstring": "/**\n     * @return Returns an Arraylist of all settings\n     */", "url": "https://github.com/cloudclientdev/cloudclient/blob/4e2752fdcb45f6f45468aee1eb247c1da41bcd8b/1.8.9/cloudclient/src/main/java/dev/cloudmc/feature/setting/SettingManager.java#L33-L35", "sha": "4e2752fdcb45f6f45468aee1eb247c1da41bcd8b"}804{"repo_name": "MoonBox", "dataset": "github_2023", "owner": "vivo", "lang": "java", "func_name": "BurlapOutput.writeBytes", "code": "public void writeBytes(byte []buffer, int offset, int length)\n    throws IOException\n  {\n    if (buffer == null) {\n      print(\"<null></null>\");\n    }\n    else {\n      print(\"<base64>\");\n\n      int i = 0;\n      for (; i + 2 < length; i += 3) {\n        if (i != 0 && (i & 0x3f) == 0)\n          print('\\n');\n\n        int v = (((buffer[offset + i] & 0xff) << 16) +\n                 ((buffer[offset + i + 1] & 0xff) << 8) + \n                 (buffer[offset + i + 2] & 0xff));\n\n        print(encode(v >> 18));\n        print(encode(v >> 12));\n        print(encode(v >> 6));\n        print(encode(v));\n      }\n\n      if (i + 1 < length) {\n        int v = (((buffer[offset + i] & 0xff) << 8) +\n                 (buffer[offset + i + 1] & 0xff));\n\n        print(encode(v >> 10));\n        print(encode(v >> 4));\n        print(encode(v << 2));\n        print('=');\n      }\n      else if (i < length) {\n        int v = buffer[offset + i] & 0xff;\n\n        print(encode(v >> 2));\n        print(encode(v << 4));\n        print('=');\n        print('=');\n      }\n      \n      print(\"</base64>\");\n    }\n  }", "docstring": "/**\n   * Writes a byte array to the stream.\n   * The array will be written with the following syntax:\n   *\n   * <code><pre>\n   * &lt;base64>bytes&lt;/base64>\n   * </pre></code>\n   *\n   * If the value is null, it will be written as\n   *\n   * <code><pre>\n   * &lt;null>&lt;/null>\n   * </pre></code>\n   *\n   * @param value the string value to write.\n   */", "url": "https://github.com/vivo/MoonBox/blob/5a462f16a21eb8515a3b2387a355e34c5fabd9de/moonbox-common/moonbox-hessian-lite/src/main/java/com/caucho/burlap/io/BurlapOutput.java#L610-L654", "sha": "5a462f16a21eb8515a3b2387a355e34c5fabd9de"}805{"repo_name": "MoonBox", "dataset": "github_2023", "owner": "vivo", "lang": "java", "func_name": "Hessian2Output.reset", "code": "public void reset()\n  {\n    if (_refs != null) {\n      _refs.clear();\n      _refCount = 0;\n    }\n\n    _classRefs.clear();\n    _typeRefs = null;\n    _offset = 0;\n    _isPacket = false;\n    _isUnshared = false;\n  }", "docstring": "/**\n   * Resets all counters and references\n   */", "url": "https://github.com/vivo/MoonBox/blob/5a462f16a21eb8515a3b2387a355e34c5fabd9de/moonbox-common/moonbox-hessian-lite/src/main/java/com/caucho/hessian/io/Hessian2Output.java#L1688-L1700", "sha": "5a462f16a21eb8515a3b2387a355e34c5fabd9de"}806{"repo_name": "MoonBox", "dataset": "github_2023", "owner": "vivo", "lang": "java", "func_name": "HessianOutput.writeInt", "code": "public void writeInt(int value)\n    throws IOException\n  {\n    os.write('I');\n    os.write(value >> 24);\n    os.write(value >> 16);\n    os.write(value >> 8);\n    os.write(value);\n  }", "docstring": "/**\n   * Writes an integer value to the stream.  The integer will be written\n   * with the following syntax:\n   *\n   * <code><pre>\n   * I b32 b24 b16 b8\n   * </pre></code>\n   *\n   * @param value the integer value to write.\n   */", "url": "https://github.com/vivo/MoonBox/blob/5a462f16a21eb8515a3b2387a355e34c5fabd9de/moonbox-common/moonbox-hessian-lite/src/main/java/com/caucho/hessian/io/HessianOutput.java#L442-L450", "sha": "5a462f16a21eb8515a3b2387a355e34c5fabd9de"}807{"repo_name": "amethyst", "dataset": "github_2023", "owner": "vitorpamplona", "lang": "java", "func_name": "Hash.getAlgorithm", "code": "public byte getAlgorithm() {\n        return algorithm;\n    }", "docstring": "/**\n     * Get Algorithm tag.\n     *\n     * @return algorithm - The algorithm tag of crypto operation.\n     */", "url": "https://github.com/vitorpamplona/amethyst/blob/f0116ad06eac2210fe9dd4ced035f78c969ad504/quartz/src/main/java/com/vitorpamplona/quartz/nip03Timestamp/ots/Hash.java#L65-L67", "sha": "f0116ad06eac2210fe9dd4ced035f78c969ad504"}808{"repo_name": "live-room-watcher", "dataset": "github_2023", "owner": "scx567888", "lang": "java", "func_name": "Room.Builder.clearLiveId", "code": "public Builder clearLiveId() {\n      bitField0_ = (bitField0_ & ~0x00000080);\n      liveId_ = 0L;\n      onChanged();\n      return this;\n    }", "docstring": "/**\n     * <code>int64 live_id = 14;</code>\n     * @return This builder for chaining.\n     */", "url": "https://github.com/scx567888/live-room-watcher/blob/eda31ba1f69d13e132f428e797ca0479d47afff7/src/main/java/cool/scx/live_room_watcher/impl/douyin_hack/proto_entity/webcast/data/Room.java#L990-L995", "sha": "eda31ba1f69d13e132f428e797ca0479d47afff7"}809{"repo_name": "live-room-watcher", "dataset": "github_2023", "owner": "scx567888", "lang": "java", "func_name": "GiftMessage.Builder.getGiftOrBuilder", "code": "public cool.scx.live_room_watcher.impl.douyin_hack.proto_entity.webcast.data.GiftStructOrBuilder getGiftOrBuilder() {\n      if (giftBuilder_ != null) {\n        return giftBuilder_.getMessageOrBuilder();\n      } else {\n        return gift_ == null ?\n            cool.scx.live_room_watcher.impl.douyin_hack.proto_entity.webcast.data.GiftStruct.getDefaultInstance() : gift_;\n      }\n    }", "docstring": "/**\n     * <code>.GiftStruct gift = 15;</code>\n     */", "url": "https://github.com/scx567888/live-room-watcher/blob/eda31ba1f69d13e132f428e797ca0479d47afff7/src/main/java/cool/scx/live_room_watcher/impl/douyin_hack/proto_entity/webcast/im/GiftMessage.java#L1164-L1171", "sha": "eda31ba1f69d13e132f428e797ca0479d47afff7"}810{"repo_name": "live-room-watcher", "dataset": "github_2023", "owner": "scx567888", "lang": "java", "func_name": "Response.Builder.addAllMessages", "code": "public Builder addAllMessages(\n        java.lang.Iterable<? extends cool.scx.live_room_watcher.impl.douyin_hack.proto_entity.webcast.im.Message> values) {\n      if (messagesBuilder_ == null) {\n        ensureMessagesIsMutable();\n        com.google.protobuf.AbstractMessageLite.Builder.addAll(\n            values, messages_);\n        onChanged();\n      } else {\n        messagesBuilder_.addAllMessages(values);\n      }\n      return this;\n    }", "docstring": "/**\n     * <code>repeated .Message messages = 1;</code>\n     */", "url": "https://github.com/scx567888/live-room-watcher/blob/eda31ba1f69d13e132f428e797ca0479d47afff7/src/main/java/cool/scx/live_room_watcher/impl/douyin_hack/proto_entity/webcast/im/Response.java#L1103-L1114", "sha": "eda31ba1f69d13e132f428e797ca0479d47afff7"}811{"repo_name": "live-room-watcher", "dataset": "github_2023", "owner": "scx567888", "lang": "java", "func_name": "RoomRankMessage.RoomRank.hasUser", "code": "@java.lang.Override\n    public boolean hasUser() {\n      return ((bitField0_ & 0x00000001) != 0);\n    }", "docstring": "/**\n     * <code>.User user = 1;</code>\n     * @return Whether the user field is set.\n     */", "url": "https://github.com/scx567888/live-room-watcher/blob/eda31ba1f69d13e132f428e797ca0479d47afff7/src/main/java/cool/scx/live_room_watcher/impl/douyin_hack/proto_entity/webcast/im/RoomRankMessage.java#L132-L135", "sha": "eda31ba1f69d13e132f428e797ca0479d47afff7"}812{"repo_name": "live-room-watcher", "dataset": "github_2023", "owner": "scx567888", "lang": "java", "func_name": "RoomRankMessage.Builder.getScoreStrBytes", "code": "public com.google.protobuf.ByteString\n          getScoreStrBytes() {\n        java.lang.Object ref = scoreStr_;\n        if (ref instanceof String) {\n          com.google.protobuf.ByteString b = \n              com.google.protobuf.ByteString.copyFromUtf8(\n                  (java.lang.String) ref);\n          scoreStr_ = b;\n          return b;\n        } else {\n          return (com.google.protobuf.ByteString) ref;\n        }\n      }", "docstring": "/**\n       * <code>string score_str = 2;</code>\n       * @return The bytes for scoreStr.\n       */", "url": "https://github.com/scx567888/live-room-watcher/blob/eda31ba1f69d13e132f428e797ca0479d47afff7/src/main/java/cool/scx/live_room_watcher/impl/douyin_hack/proto_entity/webcast/im/RoomRankMessage.java#L707-L719", "sha": "eda31ba1f69d13e132f428e797ca0479d47afff7"}813{"repo_name": "live-room-watcher", "dataset": "github_2023", "owner": "scx567888", "lang": "java", "func_name": "GiftStruct.getName", "code": "@java.lang.Override\n  public java.lang.String getName() {\n    java.lang.Object ref = name_;\n    if (ref instanceof java.lang.String) {\n      return (java.lang.String) ref;\n    } else {\n      com.google.protobuf.ByteString bs = \n          (com.google.protobuf.ByteString) ref;\n      java.lang.String s = bs.toStringUtf8();\n      name_ = s;\n      return s;\n    }\n  }", "docstring": "/**\n   * <code>string name = 16;</code>\n   * @return The name.\n   */", "url": "https://github.com/scx567888/live-room-watcher/blob/eda31ba1f69d13e132f428e797ca0479d47afff7/src/main/java/cool/scx/live_room_watcher/impl/tiktok_hack/proto_entity/webcast/data/GiftStruct.java#L57-L69", "sha": "eda31ba1f69d13e132f428e797ca0479d47afff7"}814{"repo_name": "live-room-watcher", "dataset": "github_2023", "owner": "scx567888", "lang": "java", "func_name": "ChatMessage.getEmotesList", "code": "@java.lang.Override\n  public cool.scx.live_room_watcher.impl.tiktok_hack.proto_entity.webcast.im.ChatMessage.EmoteWithIndex getEmotesList(int index) {\n    return emotesList_.get(index);\n  }", "docstring": "/**\n   * <code>repeated .tiktok_hack.ChatMessage.EmoteWithIndex emotesList = 13;</code>\n   */", "url": "https://github.com/scx567888/live-room-watcher/blob/eda31ba1f69d13e132f428e797ca0479d47afff7/src/main/java/cool/scx/live_room_watcher/impl/tiktok_hack/proto_entity/webcast/im/ChatMessage.java#L723-L726", "sha": "eda31ba1f69d13e132f428e797ca0479d47afff7"}815{"repo_name": "live-room-watcher", "dataset": "github_2023", "owner": "scx567888", "lang": "java", "func_name": "Common.getDependId", "code": "@java.lang.Override\n  public cool.scx.live_room_watcher.impl.tiktok_hack.proto_entity.webcast.data.LiveMessageID getDependId() {\n    return dependId_ == null ? cool.scx.live_room_watcher.impl.tiktok_hack.proto_entity.webcast.data.LiveMessageID.getDefaultInstance() : dependId_;\n  }", "docstring": "/**\n   * <code>.tiktok_hack.LiveMessageID dependId = 20;</code>\n   * @return The dependId.\n   */", "url": "https://github.com/scx567888/live-room-watcher/blob/eda31ba1f69d13e132f428e797ca0479d47afff7/src/main/java/cool/scx/live_room_watcher/impl/tiktok_hack/proto_entity/webcast/im/Common.java#L542-L545", "sha": "eda31ba1f69d13e132f428e797ca0479d47afff7"}816{"repo_name": "live-room-watcher", "dataset": "github_2023", "owner": "scx567888", "lang": "java", "func_name": "Common.Builder.setRoomMessageHeatLevel", "code": "public Builder setRoomMessageHeatLevel(\n        java.lang.String value) {\n      if (value == null) { throw new NullPointerException(); }\n      roomMessageHeatLevel_ = value;\n      bitField0_ |= 0x00200000;\n      onChanged();\n      return this;\n    }", "docstring": "/**\n     * <code>string roomMessageHeatLevel = 22;</code>\n     * @param value The roomMessageHeatLevel to set.\n     * @return This builder for chaining.\n     */", "url": "https://github.com/scx567888/live-room-watcher/blob/eda31ba1f69d13e132f428e797ca0479d47afff7/src/main/java/cool/scx/live_room_watcher/impl/tiktok_hack/proto_entity/webcast/im/Common.java#L3261-L3268", "sha": "eda31ba1f69d13e132f428e797ca0479d47afff7"}817{"repo_name": "live-room-watcher", "dataset": "github_2023", "owner": "scx567888", "lang": "java", "func_name": "LikeMessage.getEffectCnt", "code": "@java.lang.Override\n  public java.lang.String getEffectCnt() {\n    java.lang.Object ref = effectCnt_;\n    if (ref instanceof java.lang.String) {\n      return (java.lang.String) ref;\n    } else {\n      com.google.protobuf.ByteString bs = \n          (com.google.protobuf.ByteString) ref;\n      java.lang.String s = bs.toStringUtf8();\n      effectCnt_ = s;\n      return s;\n    }\n  }", "docstring": "/**\n   * <code>string effectCnt = 9;</code>\n   * @return The effectCnt.\n   */", "url": "https://github.com/scx567888/live-room-watcher/blob/eda31ba1f69d13e132f428e797ca0479d47afff7/src/main/java/cool/scx/live_room_watcher/impl/tiktok_hack/proto_entity/webcast/im/LikeMessage.java#L310-L322", "sha": "eda31ba1f69d13e132f428e797ca0479d47afff7"}818{"repo_name": "live-room-watcher", "dataset": "github_2023", "owner": "scx567888", "lang": "java", "func_name": "LikeMessage.getPublicAreaMessageCommonOrBuilder", "code": "@java.lang.Override\n  public cool.scx.live_room_watcher.impl.tiktok_hack.proto_entity.webcast.im.PublicAreaMessageCommonOrBuilder getPublicAreaMessageCommonOrBuilder() {\n    return publicAreaMessageCommon_ == null ? cool.scx.live_room_watcher.impl.tiktok_hack.proto_entity.webcast.im.PublicAreaMessageCommon.getDefaultInstance() : publicAreaMessageCommon_;\n  }", "docstring": "/**\n   * <code>.tiktok_hack.PublicAreaMessageCommon publicAreaMessageCommon = 11;</code>\n   */", "url": "https://github.com/scx567888/live-room-watcher/blob/eda31ba1f69d13e132f428e797ca0479d47afff7/src/main/java/cool/scx/live_room_watcher/impl/tiktok_hack/proto_entity/webcast/im/LikeMessage.java#L404-L407", "sha": "eda31ba1f69d13e132f428e797ca0479d47afff7"}819{"repo_name": "live-room-watcher", "dataset": "github_2023", "owner": "scx567888", "lang": "java", "func_name": "Response.Builder.getIsFirstBytes", "code": "public com.google.protobuf.ByteString\n        getIsFirstBytes() {\n      java.lang.Object ref = isFirst_;\n      if (ref instanceof String) {\n        com.google.protobuf.ByteString b = \n            com.google.protobuf.ByteString.copyFromUtf8(\n                (java.lang.String) ref);\n        isFirst_ = b;\n        return b;\n      } else {\n        return (com.google.protobuf.ByteString) ref;\n      }\n    }", "docstring": "/**\n     * <code>string isFirst = 11;</code>\n     * @return The bytes for isFirst.\n     */", "url": "https://github.com/scx567888/live-room-watcher/blob/eda31ba1f69d13e132f428e797ca0479d47afff7/src/main/java/cool/scx/live_room_watcher/impl/tiktok_hack/proto_entity/webcast/im/Response.java#L1882-L1894", "sha": "eda31ba1f69d13e132f428e797ca0479d47afff7"}820{"repo_name": "ruoyi-mall", "dataset": "github_2023", "owner": "zccbbg", "lang": "java", "func_name": "SysRoleController.getInfo", "code": "@PreAuthorize(\"@ss.hasPermi('system:role:query')\")\n    @GetMapping(value = \"/{roleId}\")\n    public AjaxResult getInfo(@PathVariable Long roleId)\n    {\n        roleService.checkRoleDataScope(roleId);\n        return AjaxResult.success(roleService.selectRoleById(roleId));\n    }", "docstring": "/**\n     * ๆ นๆฎ่ง’่‰ฒ็ผ–ๅท่Žทๅ–่ฏฆ็ป†ไฟกๆฏ\n     */", "url": "https://github.com/zccbbg/ruoyi-mall/blob/aef63aa6fd830fb92b01189b3ea5b6ee49662ef8/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java#L75-L81", "sha": "aef63aa6fd830fb92b01189b3ea5b6ee49662ef8"}821{"repo_name": "ruoyi-mall", "dataset": "github_2023", "owner": "zccbbg", "lang": "java", "func_name": "GenTableServiceImpl.validateEdit", "code": "@Override\n    public void validateEdit(GenTable genTable) {\n        if (GenConstants.TPL_TREE.equals(genTable.getTplCategory())) {\n            String options = JSON.toJSONString(genTable.getParams());\n            JSONObject paramsObj = JSONObject.parseObject(options);\n            if (StringUtils.isEmpty(paramsObj.getString(GenConstants.TREE_CODE))) {\n                throw new ServiceException(\"ๆ ‘็ผ–็ ๅญ—ๆฎตไธ่ƒฝไธบ็ฉบ\");\n            } else if (StringUtils.isEmpty(paramsObj.getString(GenConstants.TREE_PARENT_CODE))) {\n                throw new ServiceException(\"ๆ ‘็ˆถ็ผ–็ ๅญ—ๆฎตไธ่ƒฝไธบ็ฉบ\");\n            } else if (StringUtils.isEmpty(paramsObj.getString(GenConstants.TREE_NAME))) {\n                throw new ServiceException(\"ๆ ‘ๅ็งฐๅญ—ๆฎตไธ่ƒฝไธบ็ฉบ\");\n            } else if (GenConstants.TPL_SUB.equals(genTable.getTplCategory())) {\n                if (StringUtils.isEmpty(genTable.getSubTableName())) {\n                    throw new ServiceException(\"ๅ…ณ่”ๅญ่กจ็š„่กจๅไธ่ƒฝไธบ็ฉบ\");\n                } else if (StringUtils.isEmpty(genTable.getSubTableFkName())) {\n                    throw new ServiceException(\"ๅญ่กจๅ…ณ่”็š„ๅค–้”ฎๅไธ่ƒฝไธบ็ฉบ\");\n                }\n            }\n        }\n    }", "docstring": "/**\n     * ไฟฎๆ”นไฟๅญ˜ๅ‚ๆ•ฐๆ ก้ชŒ\n     *\n     * @param genTable ไธšๅŠกไฟกๆฏ\n     */", "url": "https://github.com/zccbbg/ruoyi-mall/blob/aef63aa6fd830fb92b01189b3ea5b6ee49662ef8/ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableServiceImpl.java#L427-L446", "sha": "aef63aa6fd830fb92b01189b3ea5b6ee49662ef8"}822{"repo_name": "cel-java", "dataset": "github_2023", "owner": "google", "lang": "java", "func_name": "Env.sanitizeFunction", "code": "private static CelFunctionDecl sanitizeFunction(CelFunctionDecl func) {\n    boolean needsSanitizing = false;\n    for (CelOverloadDecl o : func.overloads()) {\n      if (isWellKnownType(o.resultType())) {\n        needsSanitizing = true;\n        break;\n      }\n      for (CelType p : o.parameterTypes()) {\n        if (isWellKnownType(p)) {\n          needsSanitizing = true;\n          break;\n        }\n      }\n    }\n    if (!needsSanitizing) {\n      return func;\n    }\n\n    CelFunctionDecl.Builder funcBuilder = func.toBuilder();\n    ImmutableSet.Builder<CelOverloadDecl> overloadsBuilder = new ImmutableSet.Builder<>();\n    for (CelOverloadDecl overloadDecl : funcBuilder.overloads()) {\n      CelOverloadDecl.Builder overloadBuilder = overloadDecl.toBuilder();\n      CelType resultType = overloadBuilder.build().resultType();\n      if (isWellKnownType(resultType)) {\n        overloadBuilder.setResultType(getWellKnownType(resultType));\n      }\n\n      ImmutableList.Builder<CelType> parameterTypeBuilder = ImmutableList.builder();\n      for (CelType paramType : overloadBuilder.parameterTypes()) {\n        if (isWellKnownType(paramType)) {\n          parameterTypeBuilder.add(getWellKnownType(paramType));\n        } else {\n          parameterTypeBuilder.add(paramType);\n        }\n      }\n      overloadBuilder.setParameterTypes(parameterTypeBuilder.build());\n      overloadsBuilder.add(overloadBuilder.build());\n    }\n    return funcBuilder.setOverloads(overloadsBuilder.build()).build();\n  }", "docstring": "/**\n   * Sanitize the function declaration type making sure that proto-based message names appearing in\n   * the result or parameter types are mapped to the appropriate CEL types.\n   */", "url": "https://github.com/google/cel-java/blob/3819aef4d7d5e09ec59bcdfe3ff39b9bd70523e9/checker/src/main/java/dev/cel/checker/Env.java#L943-L982", "sha": "3819aef4d7d5e09ec59bcdfe3ff39b9bd70523e9"}823{"repo_name": "cel-java", "dataset": "github_2023", "owner": "google", "lang": "java", "func_name": "Exercise2.eval", "code": "@SuppressWarnings(\"DoNotCallSuggester\")\n  Object eval(CelAbstractSyntaxTree ast, Map<String, ?> parameterValues) {\n    throw new UnsupportedOperationException(\"To be implemented\");\n  }", "docstring": "/**\n   * Evaluates the compiled AST with the user provided parameter values.\n   *\n   * @throws IllegalArgumentException If the compiled expression in AST fails to evaluate.\n   */", "url": "https://github.com/google/cel-java/blob/3819aef4d7d5e09ec59bcdfe3ff39b9bd70523e9/codelab/src/main/codelab/Exercise2.java#L48-L51", "sha": "3819aef4d7d5e09ec59bcdfe3ff39b9bd70523e9"}824{"repo_name": "cel-java", "dataset": "github_2023", "owner": "google", "lang": "java", "func_name": "CelSource.getLocationOffsetImpl", "code": "private static Optional<Integer> getLocationOffsetImpl(\n      List<Integer> lineOffsets, int line, int column) {\n    if (line <= 0 || column < 0) {\n      return Optional.empty();\n    }\n    int offset = CelSourceHelper.findLineOffset(lineOffsets, line);\n    if (offset == -1) {\n      return Optional.empty();\n    }\n    return Optional.of(offset + column);\n  }", "docstring": "/**\n   * Get the code point offset within the source expression text that corresponds with the {@code\n   * line} and {@code column}.\n   *\n   * @param line the line number starting from 1\n   * @param column the column number starting from 0\n   */", "url": "https://github.com/google/cel-java/blob/3819aef4d7d5e09ec59bcdfe3ff39b9bd70523e9/common/src/main/java/dev/cel/common/CelSource.java#L123-L133", "sha": "3819aef4d7d5e09ec59bcdfe3ff39b9bd70523e9"}825{"repo_name": "cel-java", "dataset": "github_2023", "owner": "google", "lang": "java", "func_name": "CelComprehension.Builder.getEntries", "code": "public ImmutableList<CelMap.Entry> getEntries() {\n        return ImmutableList.copyOf(mutableEntries);\n      }", "docstring": "/** Returns an immutable copy of the current mutable entries present in the builder. */", "url": "https://github.com/google/cel-java/blob/3819aef4d7d5e09ec59bcdfe3ff39b9bd70523e9/common/src/main/java/dev/cel/common/ast/CelExpr.java#L800-L802", "sha": "3819aef4d7d5e09ec59bcdfe3ff39b9bd70523e9"}826{"repo_name": "cel-java", "dataset": "github_2023", "owner": "google", "lang": "java", "func_name": "CelExprFactory.fold", "code": "public final CelExpr fold(\n      String iterVar,\n      CelExpr.Builder iterRange,\n      String accuVar,\n      CelExpr accuInit,\n      CelExpr.Builder condition,\n      CelExpr step,\n      CelExpr result) {\n    return fold(iterVar, iterRange.build(), accuVar, accuInit, condition.build(), step, result);\n  }", "docstring": "/** Fold creates a fold comprehension instruction. */", "url": "https://github.com/google/cel-java/blob/3819aef4d7d5e09ec59bcdfe3ff39b9bd70523e9/common/src/main/java/dev/cel/common/ast/CelExprFactory.java#L245-L254", "sha": "3819aef4d7d5e09ec59bcdfe3ff39b9bd70523e9"}827{"repo_name": "dataService", "dataset": "github_2023", "owner": "zhugezifang", "lang": "java", "func_name": "DemoDialogController.frame1", "code": "@GetMapping(\"/frame1\")\n    public String frame1()\n    {\n        return prefix + \"/table/frame1\";\n    }", "docstring": "/**\n     * ๅคšๅฑ‚็ช—ๅฃframe1\n     */", "url": "https://github.com/zhugezifang/dataService/blob/a25f1c85f05d39b693e44f0981b791c09481a784/admin/src/main/java/com/vince/xq/web/controller/demo/controller/DemoDialogController.java#L84-L88", "sha": "a25f1c85f05d39b693e44f0981b791c09481a784"}828{"repo_name": "dataService", "dataset": "github_2023", "owner": "zhugezifang", "lang": "java", "func_name": "RuoYiConfig.getUploadPath", "code": "public static String getUploadPath()\n    {\n        return getProfile() + \"/upload\";\n    }", "docstring": "/**\n     * ่Žทๅ–ไธŠไผ ่ทฏๅพ„\n     */", "url": "https://github.com/zhugezifang/dataService/blob/a25f1c85f05d39b693e44f0981b791c09481a784/common/src/main/java/com/vince/xq/common/config/RuoYiConfig.java#L120-L123", "sha": "a25f1c85f05d39b693e44f0981b791c09481a784"}829{"repo_name": "dataService", "dataset": "github_2023", "owner": "zhugezifang", "lang": "java", "func_name": "IpUtils.getIpAddr", "code": "public static String getIpAddr(HttpServletRequest request)\n    {\n        if (request == null)\n        {\n            return \"unknown\";\n        }\n        String ip = request.getHeader(\"x-forwarded-for\");\n        if (ip == null || ip.length() == 0 || \"unknown\".equalsIgnoreCase(ip))\n        {\n            ip = request.getHeader(\"Proxy-Client-IP\");\n        }\n        if (ip == null || ip.length() == 0 || \"unknown\".equalsIgnoreCase(ip))\n        {\n            ip = request.getHeader(\"X-Forwarded-For\");\n        }\n        if (ip == null || ip.length() == 0 || \"unknown\".equalsIgnoreCase(ip))\n        {\n            ip = request.getHeader(\"WL-Proxy-Client-IP\");\n        }\n        if (ip == null || ip.length() == 0 || \"unknown\".equalsIgnoreCase(ip))\n        {\n            ip = request.getHeader(\"X-Real-IP\");\n        }\n\n        if (ip == null || ip.length() == 0 || \"unknown\".equalsIgnoreCase(ip))\n        {\n            ip = request.getRemoteAddr();\n        }\n\n        return \"0:0:0:0:0:0:0:1\".equals(ip) ? \"127.0.0.1\" : getMultistageReverseProxyIp(ip);\n    }", "docstring": "/**\n     * ่Žทๅ–ๅฎขๆˆท็ซฏIP\n     * \n     * @param request ่ฏทๆฑ‚ๅฏน่ฑก\n     * @return IPๅœฐๅ€\n     */", "url": "https://github.com/zhugezifang/dataService/blob/a25f1c85f05d39b693e44f0981b791c09481a784/common/src/main/java/com/vince/xq/common/utils/IpUtils.java#L20-L50", "sha": "a25f1c85f05d39b693e44f0981b791c09481a784"}830{"repo_name": "SLT", "dataset": "github_2023", "owner": "Enerccio", "lang": "java", "func_name": "LispLexer.ZZ_CMAP", "code": "public static int ZZ_CMAP(int ch) {\n    return ZZ_CMAP_A[ZZ_CMAP_Y[ZZ_CMAP_Z[ch>>13]|((ch>>7)&0x3f)]|(ch&0x7f)];\n  }", "docstring": "/** \n   * Translates characters to character classes\n   * Chosen bits are [8, 6, 7]\n   * Total runtime size is 1040 bytes\n   */", "url": "https://github.com/Enerccio/SLT/blob/177139b3f9d81aa108641340679b65af78073d93/src/main/gen/com/en_circle/slt/plugin/lisp/LispLexer.java#L62-L64", "sha": "177139b3f9d81aa108641340679b65af78073d93"}831{"repo_name": "lwjgl3ify", "dataset": "github_2023", "owner": "GTNewHorizons", "lang": "java", "func_name": "Keyboard.populateKeyLookupTables", "code": "public static void populateKeyLookupTables() {\n        for (int key = 0; key <= 255; key++) {\n            getKeyName(key);\n        }\n    }", "docstring": "/** Populates the key name->index lookup table with the current keyboard layout based names. */", "url": "https://github.com/GTNewHorizons/lwjgl3ify/blob/6df8300fd129ba3d1bd4c75115f79cdd43b14d69/src/main/java/org/lwjglx/input/Keyboard.java#L223-L227", "sha": "6df8300fd129ba3d1bd4c75115f79cdd43b14d69"}832{"repo_name": "lwjgl3ify", "dataset": "github_2023", "owner": "GTNewHorizons", "lang": "java", "func_name": "WaveData.create", "code": "public static WaveData create(ByteBuffer buffer) {\n        try {\n            byte[] bytes = null;\n\n            if (buffer.hasArray()) {\n                bytes = buffer.array();\n            } else {\n                bytes = new byte[buffer.capacity()];\n                buffer.get(bytes);\n            }\n            return create(bytes);\n        } catch (Exception e) {\n            org.lwjglx.LWJGLUtil.log(\"Unable to create from ByteBuffer, \" + e.getMessage());\n            return null;\n        }\n    }", "docstring": "/**\n     * Creates a WaveData container from the specified ByetBuffer. If the buffer is backed by an array, it will be used\n     * directly, else the contents of the buffer will be copied using get(byte[]).\n     *\n     * @param buffer ByteBuffer containing sound file\n     * @return WaveData containing data, or null if a failure occured\n     */", "url": "https://github.com/GTNewHorizons/lwjgl3ify/blob/6df8300fd129ba3d1bd4c75115f79cdd43b14d69/src/main/java/org/lwjglx/util/WaveData.java#L143-L158", "sha": "6df8300fd129ba3d1bd4c75115f79cdd43b14d69"}833{"repo_name": "lwjgl3ify", "dataset": "github_2023", "owner": "GTNewHorizons", "lang": "java", "func_name": "Matrix4f.invert", "code": "public Matrix invert() {\n        return invert(this, this);\n    }", "docstring": "/**\n     * Invert this matrix\n     * \n     * @return this if successful, null otherwise\n     */", "url": "https://github.com/GTNewHorizons/lwjgl3ify/blob/6df8300fd129ba3d1bd4c75115f79cdd43b14d69/src/main/java/org/lwjglx/util/vector/Matrix4f.java#L747-L749", "sha": "6df8300fd129ba3d1bd4c75115f79cdd43b14d69"}834{"repo_name": "QuranApp", "dataset": "github_2023", "owner": "AlfaazPlus", "lang": "java", "func_name": "FileUtils.viewImage", "code": "public void viewImage(@NonNull Uri imageUri) {\n        Intent intent = new Intent();\n        intent.setAction(Intent.ACTION_VIEW);\n        intent.setDataAndType(imageUri, \"image/*\");\n        intent.setFlags(FLAG_GRANT_READ_URI_PERMISSION);\n        try {\n            getContext().startActivity(intent);\n        } catch (ActivityNotFoundException e) {\n            e.printStackTrace();\n        }\n    }", "docstring": "/**\n     * Instantiates view intent to view an image in default image viewer\n     *\n     * @param imageUri The image {@link URI}, which is to be viewed\n     */", "url": "https://github.com/AlfaazPlus/QuranApp/blob/cfd95575d4ba66a5cf2313f13d03293d679d5d09/app/src/main/java/com/quranapp/android/utils/univ/FileUtils.java#L225-L235", "sha": "cfd95575d4ba66a5cf2313f13d03293d679d5d09"}835{"repo_name": "crane4j", "dataset": "github_2023", "owner": "opengoofy", "lang": "java", "func_name": "ManyToManyAssembleOperationHandler.getSourcesFromContainer", "code": "@SuppressWarnings(\"unchecked\")\n    @Override\n    protected Map<Object, Object> getSourcesFromContainer(Container<?> container, Collection<Target> targets) {\n        Set<Object> keys = targets.stream()\n            .map(Target::getKey)\n            .map(k -> (Collection<?>)k)\n            .flatMap(Collection::stream)\n            .collect(Collectors.toSet());\n        return (Map<Object, Object>)((Container<Object>)container).get(keys);\n    }", "docstring": "/**\n     * Obtain the corresponding data source object from the data source container based on the entity's key value.\n     *\n     * @param container container\n     * @param targets   targets\n     * @return source objects\n     */", "url": "https://github.com/opengoofy/crane4j/blob/bfc292cbcb272bc40f8c2fc6295ba9b8ac3efdc1/crane4j-core/src/main/java/cn/crane4j/core/executor/handler/ManyToManyAssembleOperationHandler.java#L49-L58", "sha": "bfc292cbcb272bc40f8c2fc6295ba9b8ac3efdc1"}836{"repo_name": "crane4j", "dataset": "github_2023", "owner": "opengoofy", "lang": "java", "func_name": "ClassScanner.scan", "code": "public Set<Class<?>> scan(String... basePackages) {\n        return scan(Objects::nonNull, basePackages);\n    }", "docstring": "/**\n     * <p>Scan all classes under the specified package.\n     *\n     * @param basePackages the specified package\n     * @return a set of classes\n     */", "url": "https://github.com/opengoofy/crane4j/blob/bfc292cbcb272bc40f8c2fc6295ba9b8ac3efdc1/crane4j-extension/crane4j-extension-spring/src/main/java/cn/crane4j/extension/spring/scanner/ClassScanner.java#L60-L62", "sha": "bfc292cbcb272bc40f8c2fc6295ba9b8ac3efdc1"}837{"repo_name": "YAGSL", "dataset": "github_2023", "owner": "BroncBotz3481", "lang": "java", "func_name": "SwerveModule.getState", "code": "public SwerveModuleState getState()\n  {\n    double     velocity;\n    Rotation2d azimuth;\n    if (!SwerveDriveTelemetry.isSimulation)\n    {\n      velocity = driveVelocityCache.getValue();\n      azimuth = Rotation2d.fromDegrees(getAbsolutePosition());\n    } else\n    {\n      return simModule.getState();\n    }\n    return new SwerveModuleState(velocity, azimuth);\n  }", "docstring": "/**\n   * Get the Swerve Module state.\n   *\n   * @return Current SwerveModule state.\n   */", "url": "https://github.com/BroncBotz3481/YAGSL/blob/62f8236678090186dbda41719c1cc2e8e6b38448/swervelib/SwerveModule.java#L537-L550", "sha": "62f8236678090186dbda41719c1cc2e8e6b38448"}838{"repo_name": "YAGSL", "dataset": "github_2023", "owner": "BroncBotz3481", "lang": "java", "func_name": "CANCoderSwerve.getAbsoluteEncoder", "code": "@Override\n  public Object getAbsoluteEncoder()\n  {\n    return encoder;\n  }", "docstring": "/**\n   * Get the instantiated absolute encoder Object.\n   *\n   * @return Absolute encoder object.\n   */", "url": "https://github.com/BroncBotz3481/YAGSL/blob/62f8236678090186dbda41719c1cc2e8e6b38448/swervelib/encoders/CANCoderSwerve.java#L202-L206", "sha": "62f8236678090186dbda41719c1cc2e8e6b38448"}839{"repo_name": "YAGSL", "dataset": "github_2023", "owner": "BroncBotz3481", "lang": "java", "func_name": "CanandgyroSwerve.factoryDefault", "code": "@Override\n  public void factoryDefault()\n  {\n    imu.resetFactoryDefaults(STATUS_TIMEOUT_SECONDS);\n  }", "docstring": "/**\n   * Reset {@link Canandgyro} to factory default.\n   */", "url": "https://github.com/BroncBotz3481/YAGSL/blob/62f8236678090186dbda41719c1cc2e8e6b38448/swervelib/imu/CanandgyroSwerve.java#L52-L56", "sha": "62f8236678090186dbda41719c1cc2e8e6b38448"}840{"repo_name": "chatgpt-java", "dataset": "github_2023", "owner": "Grt1228", "lang": "java", "func_name": "TikTokensTest.chatCompletionTokensTest", "code": "@Test\n    public void chatCompletionTokensTest() {\n        ChatCompletion completion = ChatCompletion.builder().messages(messages).build();\n        long tokens = completion.tokens();\n        log.info(\"Message้›†ๅˆๆ–‡ๆœฌ๏ผšใ€{}ใ€‘\", messages, tokens);\n        log.info(\"ๆ€ปtokensๆ•ฐ{}\", tokens);\n    }", "docstring": "/**\n     * gpt-3.5ๅ’Œgpt4.0่Šๅคฉๆจกๅž‹ๆŽฅๅฃ่ฎก็ฎ—ๆŽจ่่ฟ™็งๆ–นๆณ•\n     */", "url": "https://github.com/Grt1228/chatgpt-java/blob/ae761b89450812fab4cd7bba6626f9874705ca40/src/test/java/com/unfbx/chatgpt/TikTokensTest.java#L40-L46", "sha": "ae761b89450812fab4cd7bba6626f9874705ca40"}841{"repo_name": "cffu", "dataset": "github_2023", "owner": "foldright", "lang": "java", "func_name": "Cffu.get", "code": "@Blocking\n    @Nullable\n    @Override\n    public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {\n        checkMinimalStage();\n        return cf.get(timeout, unit);\n    }", "docstring": "/**\n     * Waits if necessary for at most the given time for the computation to complete,\n     * and then retrieves its result, if available.\n     *\n     * @param timeout the maximum time to wait\n     * @param unit    the time unit of the timeout argument\n     * @return the computed result\n     * @throws CancellationException if the computation was cancelled\n     * @throws ExecutionException    if the computation threw an exception\n     * @throws InterruptedException  if the current thread was interrupted while waiting\n     * @throws TimeoutException      if the wait timed out\n     */", "url": "https://github.com/foldright/cffu/blob/c4e2d4d6dae280e06a7267b9793e6d3e66c9dcee/cffu-core/src/main/java/io/foldright/cffu/Cffu.java#L2204-L2210", "sha": "c4e2d4d6dae280e06a7267b9793e6d3e66c9dcee"}842{"repo_name": "plantuml-core", "dataset": "github_2023", "owner": "plantuml", "lang": "java", "func_name": "ST_subtree_t.isSameThan", "code": "@Override\n\tpublic boolean isSameThan(__ptr__ other) {\n\t\tST_subtree_t other2 = (ST_subtree_t) other;\n\t\treturn this == other2;\n\t}", "docstring": "/* union find */", "url": "https://github.com/plantuml/plantuml-core/blob/237443772415621f188204ee61201e0d6017015f/plantuml-core/src/main/java/h/ST_subtree_t.java#L15-L19", "sha": "237443772415621f188204ee61201e0d6017015f"}843{"repo_name": "plantuml-core", "dataset": "github_2023", "owner": "plantuml", "lang": "java", "func_name": "UmlSource.getDiagramType", "code": "public DiagramType getDiagramType() {\n\t\treturn DiagramType.getTypeFromArobaseStart(source.get(0).getString());\n\t}", "docstring": "/**\n\t * Retrieve the type of the diagram. This is based on the first line\n\t * <code>@startfoo</code>.\n\t *\n\t * @return the type of the diagram.\n\t */", "url": "https://github.com/plantuml/plantuml-core/blob/237443772415621f188204ee61201e0d6017015f/plantuml-core/src/main/java/net/sourceforge/plantuml/core/UmlSource.java#L111-L113", "sha": "237443772415621f188204ee61201e0d6017015f"}844{"repo_name": "plantuml-core", "dataset": "github_2023", "owner": "plantuml", "lang": "java", "func_name": "JsonObject.set", "code": "public JsonObject set(String name, double value) {\n\t\tset(name, Json.value(value));\n\t\treturn this;\n\t}", "docstring": "/**\n\t * Sets the value of the member with the specified name to the JSON\n\t * representation of the specified <code>double</code> value. If this object\n\t * does not contain a member with this name, a new member is added at the end of\n\t * the object. If this object contains multiple members with this name, only the\n\t * last one is changed.\n\t * <p>\n\t * This method should <strong>only be used to modify existing objects</strong>.\n\t * To fill a new object with members, the method <code>add(name, value)</code>\n\t * should be preferred which is much faster (as it does not need to search for\n\t * existing members).\n\t * </p>\n\t *\n\t * @param name  the name of the member to add\n\t * @param value the value of the member to add\n\t * @return the object itself, to enable method chaining\n\t */", "url": "https://github.com/plantuml/plantuml-core/blob/237443772415621f188204ee61201e0d6017015f/plantuml-core/src/main/java/net/sourceforge/plantuml/json/JsonObject.java#L399-L402", "sha": "237443772415621f188204ee61201e0d6017015f"}845{"repo_name": "nammayatri", "dataset": "github_2023", "owner": "nammayatri", "lang": "java", "func_name": "CropImageView.isShowProgressBar", "code": "public boolean isShowProgressBar() {\n    return mShowProgressBar;\n  }", "docstring": "/**\n   * if to show progress bar when image async loading/cropping is in progress.<br>\n   * default: true, disable to provide custom progress bar UI.\n   */", "url": "https://github.com/nammayatri/nammayatri/blob/aa2f5492eaf4a0ab14f3333444ffb78c89ad63c8/Frontend/android-native/mobility-common/src/main/java/in/juspay/mobility/common/cropImage/CropImageView.java#L541-L543", "sha": "aa2f5492eaf4a0ab14f3333444ffb78c89ad63c8"}846{"repo_name": "CodeGPT", "dataset": "github_2023", "owner": "carlrobertoh", "lang": "java", "func_name": "IdentifyTraitsPersistence.getLines", "code": "protected Stream<String> getLines(Path file) throws IOException {\n        return Files.lines(file);\n    }", "docstring": "/* for testing purposes */", "url": "https://github.com/carlrobertoh/CodeGPT/blob/93c711d5da8edb409e0da641a8bb6438fbda26d4/codegpt-telemetry/src/main/java/ee/carlrobert/codegpt/telemetry/core/service/segment/IdentifyTraitsPersistence.java#L75-L77", "sha": "93c711d5da8edb409e0da641a8bb6438fbda26d4"}847{"repo_name": "Cleanroom", "dataset": "github_2023", "owner": "CleanroomMC", "lang": "java", "func_name": "Capability.getName", "code": "public String getName() { return name; }", "docstring": "/**\n     * @return The unique name of this capability, typically this is\n     * the fully qualified class name for the target interface.\n     */", "url": "https://github.com/CleanroomMC/Cleanroom/blob/fa5a17bf6c3620f4cb30932efb916349d8a96715/src/main/java/net/minecraftforge/common/capabilities/Capability.java#L89-L89", "sha": "fa5a17bf6c3620f4cb30932efb916349d8a96715"}848{"repo_name": "Cleanroom", "dataset": "github_2023", "owner": "CleanroomMC", "lang": "java", "func_name": "Property.isBooleanValue", "code": "public boolean isBooleanValue()\n    {\n        return (\"true\".equals(value.toLowerCase()) || \"false\".equals(value.toLowerCase()));\n    }", "docstring": "/**\n     * Checks if the current value held by this property is a valid boolean value.\n     *\n     * @return True if it is a boolean value\n     */", "url": "https://github.com/CleanroomMC/Cleanroom/blob/fa5a17bf6c3620f4cb30932efb916349d8a96715/src/main/java/net/minecraftforge/common/config/Property.java#L884-L887", "sha": "fa5a17bf6c3620f4cb30932efb916349d8a96715"}849{"repo_name": "Cleanroom", "dataset": "github_2023", "owner": "CleanroomMC", "lang": "java", "func_name": "AnimationStateMachine.load", "code": "@SideOnly(Side.CLIENT)\n    public static IAnimationStateMachine load(IResourceManager manager, ResourceLocation location, ImmutableMap<String, ITimeValue> customParameters)\n    {\n        try (IResource resource = manager.getResource(location))\n        {\n            ClipResolver clipResolver = new ClipResolver();\n            ParameterResolver parameterResolver = new ParameterResolver(customParameters);\n            Clips.CommonClipTypeAdapterFactory.INSTANCE.setClipResolver(clipResolver);\n            TimeValues.CommonTimeValueTypeAdapterFactory.INSTANCE.setValueResolver(parameterResolver);\n            AnimationStateMachine asm = asmGson.fromJson(new InputStreamReader(resource.getInputStream(), StandardCharsets.UTF_8), AnimationStateMachine.class);\n            clipResolver.asm = asm;\n            parameterResolver.asm = asm;\n            asm.initialize();\n            //String json = asmGson.toJson(asm);\n            //System.out.println(location + \": \" + json);\n            return asm;\n        }\n        catch(IOException | JsonParseException e)\n        {\n            FMLLog.log.error(\"Exception loading Animation State Machine {}, skipping\", location, e);\n            return missing;\n        }\n        finally\n        {\n            Clips.CommonClipTypeAdapterFactory.INSTANCE.setClipResolver(null);\n            TimeValues.CommonTimeValueTypeAdapterFactory.INSTANCE.setValueResolver(null);\n        }\n    }", "docstring": "/**\n     * Load a new instance if AnimationStateMachine at specified location, with specified custom parameters.\n     */", "url": "https://github.com/CleanroomMC/Cleanroom/blob/fa5a17bf6c3620f4cb30932efb916349d8a96715/src/main/java/net/minecraftforge/common/model/animation/AnimationStateMachine.java#L216-L243", "sha": "fa5a17bf6c3620f4cb30932efb916349d8a96715"}850{"repo_name": "Cleanroom", "dataset": "github_2023", "owner": "CleanroomMC", "lang": "java", "func_name": "GameRegistry.getFuelValue", "code": "@Deprecated\n    public static int getFuelValue(@Nonnull ItemStack itemStack)\n    {\n        return ForgeEventFactory.getItemBurnTime(itemStack);\n    }", "docstring": "/**\n     * @deprecated use {@link ForgeEventFactory#getItemBurnTime(ItemStack)}\n     */", "url": "https://github.com/CleanroomMC/Cleanroom/blob/fa5a17bf6c3620f4cb30932efb916349d8a96715/src/main/java/net/minecraftforge/fml/common/registry/GameRegistry.java#L254-L258", "sha": "fa5a17bf6c3620f4cb30932efb916349d8a96715"}851{"repo_name": "Cleanroom", "dataset": "github_2023", "owner": "CleanroomMC", "lang": "java", "func_name": "TextureLoader.get2Fold", "code": "private static int get2Fold(int fold) {\n        int ret = 2;\n        while (ret < fold) {\n            ret *= 2;\n        }\n        return ret;\n    }", "docstring": "/**\n     * Get the closest greater power of 2 to the fold number\n     *\n     * @param fold The target number\n     * @return The power of 2\n     */", "url": "https://github.com/CleanroomMC/Cleanroom/blob/fa5a17bf6c3620f4cb30932efb916349d8a96715/src/main/java/org/lwjgl/test/spaceinvaders/TextureLoader.java#L186-L192", "sha": "fa5a17bf6c3620f4cb30932efb916349d8a96715"}852{"repo_name": "Cleanroom", "dataset": "github_2023", "owner": "CleanroomMC", "lang": "java", "func_name": "Matrix4f.transpose", "code": "public Matrix transpose() {\n        return transpose(this);\n    }", "docstring": "/**\n     * Transpose this matrix\n     * \n     * @return this\n     */", "url": "https://github.com/CleanroomMC/Cleanroom/blob/fa5a17bf6c3620f4cb30932efb916349d8a96715/src/main/java/org/lwjgl/util/vector/Matrix4f.java#L431-L433", "sha": "fa5a17bf6c3620f4cb30932efb916349d8a96715"}853{"repo_name": "Cleanroom", "dataset": "github_2023", "owner": "CleanroomMC", "lang": "java", "func_name": "Vector2f.getY", "code": "public final float getY() {\n        return y;\n    }", "docstring": "/**\n     * @return y\n     */", "url": "https://github.com/CleanroomMC/Cleanroom/blob/fa5a17bf6c3620f4cb30932efb916349d8a96715/src/main/java/org/lwjgl/util/vector/Vector2f.java#L253-L255", "sha": "fa5a17bf6c3620f4cb30932efb916349d8a96715"}854{"repo_name": "campus", "dataset": "github_2023", "owner": "oddfar", "lang": "java", "func_name": "SwaggerConfig.createRestApi", "code": "@Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.OAS_30)\n                // ๆ˜ฏๅฆๅฏ็”จSwagger\n                .enable(enabled)\n                // ็”จๆฅๅˆ›ๅปบ่ฏฅAPI็š„ๅŸบๆœฌไฟกๆฏ๏ผŒๅฑ•็คบๅœจๆ–‡ๆกฃ็š„้กต้ขไธญ๏ผˆ่‡ชๅฎšไน‰ๅฑ•็คบ็š„ไฟกๆฏ๏ผ‰\n                .apiInfo(apiInfo())\n                // ่ฎพ็ฝฎๅ“ชไบ›ๆŽฅๅฃๆšด้œฒ็ป™Swaggerๅฑ•็คบ\n                .select()\n                // ๆ‰ซๆๆ‰€ๆœ‰ๆœ‰ๆณจ่งฃ็š„api๏ผŒ็”จ่ฟ™็งๆ–นๅผๆ›ด็ตๆดป\n                .apis(RequestHandlerSelectors.withMethodAnnotation(Operation.class))\n                // ๆ‰ซๆๆŒ‡ๅฎšๅŒ…ไธญ็š„swaggerๆณจ่งฃ\n                // .apis(RequestHandlerSelectors.basePackage(\"com.ruoyi.project.tool.swagger\"))\n                // ๆ‰ซๆๆ‰€ๆœ‰ .apis(RequestHandlerSelectors.any())\n                .paths(PathSelectors.any())\n                .build()\n                /* ่ฎพ็ฝฎๅฎ‰ๅ…จๆจกๅผ๏ผŒswaggerๅฏไปฅ่ฎพ็ฝฎ่ฎฟ้—ฎtoken */\n                .securitySchemes(securitySchemes())\n                .securityContexts(securityContexts());\n    }", "docstring": "/**\n     * ๅˆ›ๅปบAPI\n     */", "url": "https://github.com/oddfar/campus/blob/b1ef73868f9003f932087957cd4ef6cd4b63c1e8/campus-admin/src/main/java/com/oddfar/campus/admin/config/SwaggerConfig.java#L43-L62", "sha": "b1ef73868f9003f932087957cd4ef6cd4b63c1e8"}855{"repo_name": "campus", "dataset": "github_2023", "owner": "oddfar", "lang": "java", "func_name": "Convert.toDouble", "code": "public static Double toDouble(Object value) {\n        return toDouble(value, null);\n    }", "docstring": "/**\n     * ่ฝฌๆขไธบdouble<br>\n     * ๅฆ‚ๆžœ็ป™ๅฎš็š„ๅ€ผไธบ็ฉบ๏ผŒๆˆ–่€…่ฝฌๆขๅคฑ่ดฅ๏ผŒ่ฟ”ๅ›ž้ป˜่ฎคๅ€ผ<code>null</code><br>\n     * ่ฝฌๆขๅคฑ่ดฅไธไผšๆŠฅ้”™\n     *\n     * @param value ่ขซ่ฝฌๆข็š„ๅ€ผ\n     * @return ็ป“ๆžœ\n     */", "url": "https://github.com/oddfar/campus/blob/b1ef73868f9003f932087957cd4ef6cd4b63c1e8/campus-common/src/main/java/com/oddfar/campus/common/core/text/Convert.java#L411-L413", "sha": "b1ef73868f9003f932087957cd4ef6cd4b63c1e8"}856{"repo_name": "campus", "dataset": "github_2023", "owner": "oddfar", "lang": "java", "func_name": "StringUtils.ishttp", "code": "public static boolean ishttp(String link) {\n        return StringUtils.startsWithAny(link, Constants.HTTP, Constants.HTTPS);\n    }", "docstring": "/**\n     * ๆ˜ฏๅฆไธบhttp(s)://ๅผ€ๅคด\n     *\n     * @param link ้“พๆŽฅ\n     * @return ็ป“ๆžœ\n     */", "url": "https://github.com/oddfar/campus/blob/b1ef73868f9003f932087957cd4ef6cd4b63c1e8/campus-common/src/main/java/com/oddfar/campus/common/utils/StringUtils.java#L242-L244", "sha": "b1ef73868f9003f932087957cd4ef6cd4b63c1e8"}857{"repo_name": "campus", "dataset": "github_2023", "owner": "oddfar", "lang": "java", "func_name": "MyWebMvcConfig.addResourceHandlers", "code": "@Override\n    public void addResourceHandlers(ResourceHandlerRegistry registry) {\n\n        /** ๆœฌๅœฐๆ–‡ไปถไธŠไผ ่ทฏๅพ„ */\n        registry.addResourceHandler(Constants.RESOURCE_PREFIX + \"/**\")\n                .addResourceLocations(\"file:\" + ConfigExpander.getFileProfile() + \"/\");\n\n        /** swagger้…็ฝฎ */\n        registry.addResourceHandler(\"/swagger-ui/**\")\n                .addResourceLocations(\"classpath:/META-INF/resources/webjars/springfox-swagger-ui/\");\n    }", "docstring": "/**\n     * ๆ˜ ๅฐ„ๅˆฐ่ฎฟ้—ฎๆœฌๅœฐ็š„่ต„ๆบๆ–‡ไปถ\n     *\n     * @param registry\n     */", "url": "https://github.com/oddfar/campus/blob/b1ef73868f9003f932087957cd4ef6cd4b63c1e8/campus-framework/src/main/java/com/oddfar/campus/framework/config/MyWebMvcConfig.java#L32-L42", "sha": "b1ef73868f9003f932087957cd4ef6cd4b63c1e8"}858{"repo_name": "cool-request", "dataset": "github_2023", "owner": "houxinlin", "lang": "java", "func_name": "JavaCodeEngine.execRequest", "code": "public boolean execRequest(Request request, String code) throws Exception {\n        if (StringUtils.isEmpty(code)) {\n            return true;\n        }\n        InMemoryJavaCompiler memoryJavaCompiler = javac(prependPublicToCoolRequestScript(REQUEST_REGEX, code), REQUEST_CLASS);\n        Class<?> requestClass = memoryJavaCompiler.getClassloader().loadClass(REQUEST_CLASS);\n        return invokeRequest(requestClass, request);\n    }", "docstring": "/**\n     * ๆ‰ง่กŒๅ‰็ฝฎ่„šๆœฌ\n     *\n     * @return ๅฆ‚ๆžœ่ฟ”ๅ›žfalse๏ผŒๅˆ™่กจ็คบ่ขซ่„šๆœฌๆ‹’็ปๆ‰ง่กŒ\n     */", "url": "https://github.com/houxinlin/cool-request/blob/177c5f7de26291eacc0b28c5ade7e470886b0348/src/main/java/com/cool/request/components/http/script/JavaCodeEngine.java#L71-L78", "sha": "177c5f7de26291eacc0b28c5ade7e470886b0348"}859{"repo_name": "cool-request", "dataset": "github_2023", "owner": "houxinlin", "lang": "java", "func_name": "Schema.set$vocabulary", "code": "public void set$vocabulary(String $vocabulary) {\n        this.$vocabulary = $vocabulary;\n    }", "docstring": "/**\n     *\n     * @since 2.2.8 (OpenAPI 3.1.0)\n     */", "url": "https://github.com/houxinlin/cool-request/blob/177c5f7de26291eacc0b28c5ade7e470886b0348/src/main/java/com/cool/request/lib/openapi/media/Schema.java#L521-L523", "sha": "177c5f7de26291eacc0b28c5ade7e470886b0348"}860{"repo_name": "cool-request", "dataset": "github_2023", "owner": "houxinlin", "lang": "java", "func_name": "Schema.getXml", "code": "public XML getXml() {\n        return xml;\n    }", "docstring": "/**\n     * returns the xml property from a Schema instance.\n     *\n     * @return XML xml\n     **/", "url": "https://github.com/houxinlin/cool-request/blob/177c5f7de26291eacc0b28c5ade7e470886b0348/src/main/java/com/cool/request/lib/openapi/media/Schema.java#L1466-L1468", "sha": "177c5f7de26291eacc0b28c5ade7e470886b0348"}861{"repo_name": "cool-request", "dataset": "github_2023", "owner": "houxinlin", "lang": "java", "func_name": "Assert.isNull", "code": "public static void isNull( Object object, String message) {\n        if (object != null) {\n            throw new IllegalArgumentException(message);\n        }\n    }", "docstring": "/**\n     * Assert that an object is {@code null}.\n     * <pre class=\"code\">Assert.isNull(value, \"The value must be null\");</pre>\n     * @param object the object to check\n     * @param message the exception message to use if the assertion fails\n     * @throws IllegalArgumentException if the object is not {@code null}\n     */", "url": "https://github.com/houxinlin/cool-request/blob/177c5f7de26291eacc0b28c5ade7e470886b0348/src/main/java/com/cool/request/utils/Assert.java#L163-L167", "sha": "177c5f7de26291eacc0b28c5ade7e470886b0348"}862{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "AttackResultOuterClass.AttackResult.getUnk3300BALCPHMFIBC", "code": "@java.lang.Override\n    public int getUnk3300BALCPHMFIBC() {\n      return unk3300BALCPHMFIBC_;\n    }", "docstring": "/**\n       * <code>uint32 Unk3300_BALCPHMFIBC = 1940;</code>\n       * @return The unk3300BALCPHMFIBC.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/AttackResultOuterClass.java#L521-L524", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}863{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "AttackResultOuterClass.AttackResult.getTargetType", "code": "@java.lang.Override\n    public int getTargetType() {\n      return targetType_;\n    }", "docstring": "/**\n       * <code>uint32 targetType = 346;</code>\n       * @return The targetType.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/AttackResultOuterClass.java#L624-L627", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}864{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "ModifierPropertyOuterClass.ModifierProperty.getKey", "code": "@java.lang.Override\n    public emu.grasscutter.net.proto.AbilityStringOuterClass.AbilityString getKey() {\n      return key_ == null ? emu.grasscutter.net.proto.AbilityStringOuterClass.AbilityString.getDefaultInstance() : key_;\n    }", "docstring": "/**\n     * <code>.AbilityString key = 7;</code>\n     * @return The key.\n     */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/ModifierPropertyOuterClass.java#L151-L154", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}865{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "ModifierProperty.Builder.getKey", "code": "public emu.grasscutter.net.proto.AbilityStringOuterClass.AbilityString getKey() {\n        if (keyBuilder_ == null) {\n          return key_ == null ? emu.grasscutter.net.proto.AbilityStringOuterClass.AbilityString.getDefaultInstance() : key_;\n        } else {\n          return keyBuilder_.getMessage();\n        }\n      }", "docstring": "/**\n       * <code>.AbilityString key = 7;</code>\n       * @return The key.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/ModifierPropertyOuterClass.java#L522-L528", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}866{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "RoutePoint.Builder.setPosition", "code": "public Builder setPosition(\n          emu.grasscutter.net.proto.VectorOuterClass.Vector.Builder builderForValue) {\n        if (positionBuilder_ == null) {\n          position_ = builderForValue.build();\n          onChanged();\n        } else {\n          positionBuilder_.setMessage(builderForValue.build());\n        }\n\n        return this;\n      }", "docstring": "/**\n       * <code>.Vector position = 1;</code>\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/RoutePointOuterClass.java#L1124-L1134", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}867{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "EvtCombatSteerMotionInfo.Builder.clearFaceDir", "code": "public Builder clearFaceDir() {\n        if (faceDirBuilder_ == null) {\n          faceDir_ = null;\n          onChanged();\n        } else {\n          faceDir_ = null;\n          faceDirBuilder_ = null;\n        }\n\n        return this;\n      }", "docstring": "/**\n       * <code>.Vector face_dir = 5;</code>\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/EvtCombatSteerMotionInfoOuterClass.java#L746-L756", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}868{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "TreasureMapRegionInfo.Builder.getRegionCenterPosOrBuilder", "code": "public emu.grasscutter.net.proto.VectorOuterClass.VectorOrBuilder getRegionCenterPosOrBuilder() {\n        if (regionCenterPosBuilder_ != null) {\n          return regionCenterPosBuilder_.getMessageOrBuilder();\n        } else {\n          return regionCenterPos_ == null ?\n              emu.grasscutter.net.proto.VectorOuterClass.Vector.getDefaultInstance() : regionCenterPos_;\n        }\n      }", "docstring": "/**\n       * <code>.Vector regionCenterPos = 13;</code>\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/TreasureMapRegionInfoOuterClass.java#L1123-L1130", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}869{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "DoGachaRspOuterClass.DoGachaRsp.getWishProgress", "code": "@java.lang.Override\n    public int getWishProgress() {\n      return wishProgress_;\n    }", "docstring": "/**\n       * <code>uint32 wishProgress = 12;</code>\n       * @return The wishProgress.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/DoGachaRspOuterClass.java#L566-L569", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}870{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "AnimatorParameterValueInfoOuterClass.AnimatorParameterValueInfo.hasIntVal", "code": "@java.lang.Override\n    public boolean hasIntVal() {\n      return mMJOJNNFGCNCase_ == 2;\n    }", "docstring": "/**\n     * <code>int32 int_val = 2;</code>\n     * @return Whether the intVal field is set.\n     */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/AnimatorParameterValueInfoOuterClass.java#L218-L221", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}871{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "DungeonSettleExhibitionInfo.Builder.getCardList", "code": "public emu.grasscutter.net.proto.ExhibitionDisplayInfoOuterClass.ExhibitionDisplayInfo getCardList(int index) {\n        if (cardListBuilder_ == null) {\n          return cardList_.get(index);\n        } else {\n          return cardListBuilder_.getMessage(index);\n        }\n      }", "docstring": "/**\n       * <code>repeated .ExhibitionDisplayInfo cardList = 2;</code>\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/DungeonSettleExhibitionInfoOuterClass.java#L637-L643", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}872{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "ResinChangeNotifyOuterClass.ResinChangeNotify.getNextAddTimestamp", "code": "@java.lang.Override\n    public int getNextAddTimestamp() {\n      return nextAddTimestamp_;\n    }", "docstring": "/**\n       * <code>uint32 nextAddTimestamp = 4;</code>\n       * @return The nextAddTimestamp.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/ResinChangeNotifyOuterClass.java#L279-L282", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}873{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "ShowEquip.Builder.getWeaponBuilder", "code": "public emu.grasscutter.net.proto.WeaponOuterClass.Weapon.Builder getWeaponBuilder() {\n        return getWeaponFieldBuilder().getBuilder();\n      }", "docstring": "/**\n       * <code>.Weapon weapon = 3;</code>\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/ShowEquipOuterClass.java#L943-L945", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}874{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "SceneTeamAvatar.Builder.getWeaponAbilityInfo", "code": "public emu.grasscutter.net.proto.AbilitySyncStateInfoOuterClass.AbilitySyncStateInfo getWeaponAbilityInfo() {\n        if (weaponAbilityInfoBuilder_ == null) {\n          return weaponAbilityInfo_ == null ? emu.grasscutter.net.proto.AbilitySyncStateInfoOuterClass.AbilitySyncStateInfo.getDefaultInstance() : weaponAbilityInfo_;\n        } else {\n          return weaponAbilityInfoBuilder_.getMessage();\n        }\n      }", "docstring": "/**\n       * <code>.AbilitySyncStateInfo weaponAbilityInfo = 6;</code>\n       * @return The weaponAbilityInfo.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/SceneTeamAvatarOuterClass.java#L1906-L1912", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}875{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "DetectorData.Builder.clearMaterialId", "code": "public Builder clearMaterialId() {\n        \n        materialId_ = 0;\n        onChanged();\n        return this;\n      }", "docstring": "/**\n       * <code>uint32 materialId = 10;</code>\n       * @return This builder for chaining.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/DetectorDataOuterClass.java#L908-L913", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}876{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "RoguelikeDungeonActivityDetailInfoOuterClass.RoguelikeDungeonActivityDetailInfo.getRuneListList", "code": "@java.lang.Override\n    public java.util.List<java.lang.Integer>\n        getRuneListList() {\n      return runeList_;\n    }", "docstring": "/**\n     * <code>repeated uint32 rune_list = 3;</code>\n     * @return A list containing the runeList.\n     */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/RoguelikeDungeonActivityDetailInfoOuterClass.java#L364-L368", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}877{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "RoguelikeDungeonActivityDetailInfo.Builder.setContentCloseTime", "code": "public Builder setContentCloseTime(int value) {\n        \n        contentCloseTime_ = value;\n        onChanged();\n        return this;\n      }", "docstring": "/**\n       * <code>uint32 content_close_time = 11;</code>\n       * @param value The contentCloseTime to set.\n       * @return This builder for chaining.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/RoguelikeDungeonActivityDetailInfoOuterClass.java#L1291-L1296", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}878{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "TreasureSeelieActivityDetailInfo.Builder.getRegionDataListBuilder", "code": "public emu.grasscutter.net.proto.TreasureSeelieRegionDataOuterClass.TreasureSeelieRegionData.Builder getRegionDataListBuilder(\n          int index) {\n        return getRegionDataListFieldBuilder().getBuilder(index);\n      }", "docstring": "/**\n       * <code>repeated .TreasureSeelieRegionData region_data_list = 6;</code>\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/TreasureSeelieActivityDetailInfoOuterClass.java#L837-L840", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}879{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "BounceConjuringActivityDetailInfo.Builder.addChapterInfoListBuilder", "code": "public emu.grasscutter.net.proto.BounceConjuringChapterInfoOuterClass.BounceConjuringChapterInfo.Builder addChapterInfoListBuilder(\n          int index) {\n        return getChapterInfoListFieldBuilder().addBuilder(\n            index, emu.grasscutter.net.proto.BounceConjuringChapterInfoOuterClass.BounceConjuringChapterInfo.getDefaultInstance());\n      }", "docstring": "/**\n       * <code>repeated .BounceConjuringChapterInfo chapter_info_list = 15;</code>\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/BounceConjuringActivityDetailInfoOuterClass.java#L841-L845", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}880{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "MEIDIANHEDD.Builder.addStageInfoList", "code": "public Builder addStageInfoList(\n          int index, emu.grasscutter.net.proto.OMNAAMAIBOHOuterClass.OMNAAMAIBOH.Builder builderForValue) {\n        if (stageInfoListBuilder_ == null) {\n          ensureStageInfoListIsMutable();\n          stageInfoList_.add(index, builderForValue.build());\n          onChanged();\n        } else {\n          stageInfoListBuilder_.addMessage(index, builderForValue.build());\n        }\n        return this;\n      }", "docstring": "/**\n       * <code>repeated .OMNAAMAIBOH stageInfoList = 12;</code>\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/MEIDIANHEDDOuterClass.java#L641-L651", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}881{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "SamLampInfoOuterClass.SamLampInfo.getProgress", "code": "@java.lang.Override\n    public int getProgress() {\n      return progress_;\n    }", "docstring": "/**\n       * <code>uint32 progress = 3;</code>\n       * @return The progress.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/SamLampInfoOuterClass.java#L255-L258", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}882{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "SumoStageData.Builder.setTeamList", "code": "public Builder setTeamList(\n          int index, emu.grasscutter.net.proto.SumoTeamDataOuterClass.SumoTeamData value) {\n        if (teamListBuilder_ == null) {\n          if (value == null) {\n            throw new NullPointerException();\n          }\n          ensureTeamListIsMutable();\n          teamList_.set(index, value);\n          onChanged();\n        } else {\n          teamListBuilder_.setMessage(index, value);\n        }\n        return this;\n      }", "docstring": "/**\n       * <code>repeated .SumoTeamData team_list = 1;</code>\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/SumoStageDataOuterClass.java#L782-L795", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}883{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "WinterCampInfo.Builder.setRaceInfoList", "code": "public Builder setRaceInfoList(\n          int index, emu.grasscutter.net.proto.WinterCampRaceStageInfoOuterClass.WinterCampRaceStageInfo.Builder builderForValue) {\n        if (raceInfoListBuilder_ == null) {\n          ensureRaceInfoListIsMutable();\n          raceInfoList_.set(index, builderForValue.build());\n          onChanged();\n        } else {\n          raceInfoListBuilder_.setMessage(index, builderForValue.build());\n        }\n        return this;\n      }", "docstring": "/**\n       * <code>repeated .WinterCampRaceStageInfo raceInfoList = 5;</code>\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/WinterCampInfoOuterClass.java#L1263-L1273", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}884{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "WinterCampInfo.Builder.getExploreInfo", "code": "public emu.grasscutter.net.proto.WinterCampStageInfoOuterClass.WinterCampStageInfo getExploreInfo() {\n        if (exploreInfoBuilder_ == null) {\n          return exploreInfo_ == null ? emu.grasscutter.net.proto.WinterCampStageInfoOuterClass.WinterCampStageInfo.getDefaultInstance() : exploreInfo_;\n        } else {\n          return exploreInfoBuilder_.getMessage();\n        }\n      }", "docstring": "/**\n       * <code>.WinterCampStageInfo exploreInfo = 1;</code>\n       * @return The exploreInfo.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/WinterCampInfoOuterClass.java#L1853-L1859", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}885{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "AsterActivityDetailInfoOuterClass.AsterActivityDetailInfo.getUnk3300KFDGFFPJGJC", "code": "@java.lang.Override\n    public int getUnk3300KFDGFFPJGJC() {\n      return unk3300KFDGFFPJGJC_;\n    }", "docstring": "/**\n       * <code>uint32 Unk3300_KFDGFFPJGJC = 4;</code>\n       * @return The unk3300KFDGFFPJGJC.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/AsterActivityDetailInfoOuterClass.java#L356-L359", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}886{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "ItemAddHintNotify.Builder.setUnk3300KIOMJNHFMDE", "code": "public Builder setUnk3300KIOMJNHFMDE(boolean value) {\n        \n        unk3300KIOMJNHFMDE_ = value;\n        onChanged();\n        return this;\n      }", "docstring": "/**\n       * <code>bool Unk3300_KIOMJNHFMDE = 11;</code>\n       * @param value The unk3300KIOMJNHFMDE to set.\n       * @return This builder for chaining.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/ItemAddHintNotifyOuterClass.java#L1800-L1805", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}887{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "OpActivityInfo.Builder.setIsHasChange", "code": "public Builder setIsHasChange(boolean value) {\n        \n        isHasChange_ = value;\n        onChanged();\n        return this;\n      }", "docstring": "/**\n       * <code>bool isHasChange = 3;</code>\n       * @param value The isHasChange to set.\n       * @return This builder for chaining.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/OpActivityInfoOuterClass.java#L845-L850", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}888{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "OpActivityInfo.Builder.getBonusInfoOrBuilder", "code": "@java.lang.Override\n      public emu.grasscutter.net.proto.BonusInfoOuterClass.BonusInfoOrBuilder getBonusInfoOrBuilder() {\n        if ((detailCase_ == 11) && (bonusInfoBuilder_ != null)) {\n          return bonusInfoBuilder_.getMessageOrBuilder();\n        } else {\n          if (detailCase_ == 11) {\n            return (emu.grasscutter.net.proto.BonusInfoOuterClass.BonusInfo) detail_;\n          }\n          return emu.grasscutter.net.proto.BonusInfoOuterClass.BonusInfo.getDefaultInstance();\n        }\n      }", "docstring": "/**\n       * <code>.BonusInfo bonus_info = 11;</code>\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/OpActivityInfoOuterClass.java#L970-L980", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}889{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "PlantFlowerInfo.Builder.setDayIndex", "code": "public Builder setDayIndex(int value) {\n        \n        dayIndex_ = value;\n        onChanged();\n        return this;\n      }", "docstring": "/**\n       * <code>uint32 dayIndex = 8;</code>\n       * @param value The dayIndex to set.\n       * @return This builder for chaining.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/PlantFlowerInfoOuterClass.java#L1036-L1041", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}890{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "WinterCampRecvItemNotify.Builder.getRecvItemData", "code": "public emu.grasscutter.net.proto.WinterCampRecvItemDataOuterClass.WinterCampRecvItemData getRecvItemData() {\n        if (recvItemDataBuilder_ == null) {\n          return recvItemData_ == null ? emu.grasscutter.net.proto.WinterCampRecvItemDataOuterClass.WinterCampRecvItemData.getDefaultInstance() : recvItemData_;\n        } else {\n          return recvItemDataBuilder_.getMessage();\n        }\n      }", "docstring": "/**\n       * <code>.WinterCampRecvItemData recvItemData = 5;</code>\n       * @return The recvItemData.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/WinterCampRecvItemNotifyOuterClass.java#L612-L618", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}891{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "GetAllMailRsp.Builder.setIsTruncated", "code": "public Builder setIsTruncated(boolean value) {\n        \n        isTruncated_ = value;\n        onChanged();\n        return this;\n      }", "docstring": "/**\n       * <code>bool isTruncated = 8;</code>\n       * @param value The isTruncated to set.\n       * @return This builder for chaining.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/GetAllMailRspOuterClass.java#L1084-L1089", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}892{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "HomeBlockArrangementInfo.Builder.addDeployFurniureListBuilder", "code": "public emu.grasscutter.net.proto.HomeFurnitureDataOuterClass.HomeFurnitureData.Builder addDeployFurniureListBuilder(\n          int index) {\n        return getDeployFurniureListFieldBuilder().addBuilder(\n            index, emu.grasscutter.net.proto.HomeFurnitureDataOuterClass.HomeFurnitureData.getDefaultInstance());\n      }", "docstring": "/**\n       * <code>repeated .HomeFurnitureData deployFurniureList = 15;</code>\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/HomeBlockArrangementInfoOuterClass.java#L3508-L3512", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}893{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "PlayerWidgetInfoOuterClass.PlayerWidgetInfo.getUid", "code": "@java.lang.Override\n    public int getUid() {\n      return uid_;\n    }", "docstring": "/**\n       * <code>uint32 uid = 10;</code>\n       * @return The uid.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/PlayerWidgetInfoOuterClass.java#L193-L196", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}894{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "VintageBoothUsedItemData.Builder.clearIsOpen", "code": "public Builder clearIsOpen() {\n        \n        isOpen_ = false;\n        onChanged();\n        return this;\n      }", "docstring": "/**\n       * <code>bool isOpen = 2;</code>\n       * @return This builder for chaining.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/VintageBoothUsedItemDataOuterClass.java#L517-L522", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}895{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "ActivityInfoOuterClass.ActivityInfo.getLuminanceStoneChallengeInfoOrBuilder", "code": "@java.lang.Override\n    public emu.grasscutter.net.proto.LuminanceStoneChallengeInfoOuterClass.LuminanceStoneChallengeInfoOrBuilder getLuminanceStoneChallengeInfoOrBuilder() {\n      if (iKJIPGGMNBKCase_ == 142) {\n         return (emu.grasscutter.net.proto.LuminanceStoneChallengeInfoOuterClass.LuminanceStoneChallengeInfo) iKJIPGGMNBK_;\n      }\n      return emu.grasscutter.net.proto.LuminanceStoneChallengeInfoOuterClass.LuminanceStoneChallengeInfo.getDefaultInstance();\n    }", "docstring": "/**\n     * <code>.LuminanceStoneChallengeInfo luminance_stone_challenge_info = 142;</code>\n     */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/ActivityInfoOuterClass.java#L4751-L4757", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}896{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "ActivityInfo.Builder.mergeIrodoriInfo", "code": "public Builder mergeIrodoriInfo(emu.grasscutter.net.proto.IrodoriInfoOuterClass.IrodoriInfo value) {\n        if (irodoriInfoBuilder_ == null) {\n          if (iKJIPGGMNBKCase_ == 1014 &&\n              iKJIPGGMNBK_ != emu.grasscutter.net.proto.IrodoriInfoOuterClass.IrodoriInfo.getDefaultInstance()) {\n            iKJIPGGMNBK_ = emu.grasscutter.net.proto.IrodoriInfoOuterClass.IrodoriInfo.newBuilder((emu.grasscutter.net.proto.IrodoriInfoOuterClass.IrodoriInfo) iKJIPGGMNBK_)\n                .mergeFrom(value).buildPartial();\n          } else {\n            iKJIPGGMNBK_ = value;\n          }\n          onChanged();\n        } else {\n          if (iKJIPGGMNBKCase_ == 1014) {\n            irodoriInfoBuilder_.mergeFrom(value);\n          }\n          irodoriInfoBuilder_.setMessage(value);\n        }\n        iKJIPGGMNBKCase_ = 1014;\n        return this;\n      }", "docstring": "/**\n       * <code>.IrodoriInfo irodori_info = 1014;</code>\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/ActivityInfoOuterClass.java#L15674-L15692", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}897{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "FungusTrainingProgressDetailOuterClass.FungusTrainingProgressDetail.getMonsterPoolPreviewList", "code": "@java.lang.Override\n    public emu.grasscutter.net.proto.FungusTrainingPoolPreviewDetailOuterClass.FungusTrainingPoolPreviewDetail getMonsterPoolPreviewList(int index) {\n      return monsterPoolPreviewList_.get(index);\n    }", "docstring": "/**\n     * <code>repeated .FungusTrainingPoolPreviewDetail monsterPoolPreviewList = 9;</code>\n     */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/FungusTrainingProgressDetailOuterClass.java#L384-L387", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}898{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "EffigyActivityDetailInfo.Builder.addDailyInfoList", "code": "public Builder addDailyInfoList(\n          int index, emu.grasscutter.net.proto.EffigyDailyInfoOuterClass.EffigyDailyInfo value) {\n        if (dailyInfoListBuilder_ == null) {\n          if (value == null) {\n            throw new NullPointerException();\n          }\n          ensureDailyInfoListIsMutable();\n          dailyInfoList_.add(index, value);\n          onChanged();\n        } else {\n          dailyInfoListBuilder_.addMessage(index, value);\n        }\n        return this;\n      }", "docstring": "/**\n       * <code>repeated .EffigyDailyInfo daily_info_list = 4;</code>\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/EffigyActivityDetailInfoOuterClass.java#L944-L957", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}899{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "HomeLimitedShopBuyGoodsRspOuterClass.HomeLimitedShopBuyGoodsRsp.getBuyCount", "code": "@java.lang.Override\n    public int getBuyCount() {\n      return buyCount_;\n    }", "docstring": "/**\n       * <code>uint32 buyCount = 11;</code>\n       * @return The buyCount.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/HomeLimitedShopBuyGoodsRspOuterClass.java#L389-L392", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}900{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "CrystalLinkDungeonSettleInfoOuterClass.CrystalLinkDungeonSettleInfo.getDifficultyId", "code": "@java.lang.Override\n    public int getDifficultyId() {\n      return difficultyId_;\n    }", "docstring": "/**\n       * <code>uint32 difficulty_id = 3;</code>\n       * @return The difficultyId.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/CrystalLinkDungeonSettleInfoOuterClass.java#L203-L206", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}901{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "GetCompoundDataRsp.Builder.setRetcode", "code": "public Builder setRetcode(int value) {\n        \n        retcode_ = value;\n        onChanged();\n        return this;\n      }", "docstring": "/**\n       * <code>int32 retcode = 2;</code>\n       * @param value The retcode to set.\n       * @return This builder for chaining.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/GetCompoundDataRspOuterClass.java#L817-L822", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}902{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "MpPlayRewardInfo.Builder.setRemainUidList", "code": "public Builder setRemainUidList(\n          int index, int value) {\n        ensureRemainUidListIsMutable();\n        remainUidList_.setInt(index, value);\n        onChanged();\n        return this;\n      }", "docstring": "/**\n       * <code>repeated uint32 remainUidList = 2;</code>\n       * @param index The index to set the value at.\n       * @param value The remainUidList to set.\n       * @return This builder for chaining.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/MpPlayRewardInfoOuterClass.java#L722-L728", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}903{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "MusicGameStartRsp.Builder.setUgcGuid", "code": "public Builder setUgcGuid(long value) {\n        \n        ugcGuid_ = value;\n        onChanged();\n        return this;\n      }", "docstring": "/**\n       * <code>uint64 ugcGuid = 8;</code>\n       * @param value The ugcGuid to set.\n       * @return This builder for chaining.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/MusicGameStartRspOuterClass.java#L677-L682", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}904{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "ProfilePictureChangeNotify.Builder.getProfilePicture", "code": "public emu.grasscutter.net.proto.ProfilePictureOuterClass.ProfilePicture getProfilePicture() {\n        if (profilePictureBuilder_ == null) {\n          return profilePicture_ == null ? emu.grasscutter.net.proto.ProfilePictureOuterClass.ProfilePicture.getDefaultInstance() : profilePicture_;\n        } else {\n          return profilePictureBuilder_.getMessage();\n        }\n      }", "docstring": "/**\n       * <code>.ProfilePicture profilePicture = 13;</code>\n       * @return The profilePicture.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/ProfilePictureChangeNotifyOuterClass.java#L620-L626", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}905{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "SceneGadgetInfo.Builder.setGadgetState", "code": "public Builder setGadgetState(int value) {\n        \n        gadgetState_ = value;\n        onChanged();\n        return this;\n      }", "docstring": "/**\n       * <code>uint32 gadgetState = 6;</code>\n       * @param value The gadgetState to set.\n       * @return This builder for chaining.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/SceneGadgetInfoOuterClass.java#L3469-L3474", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}906{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "GadgetInfoOuterClass.GadgetInfo.getStatueGadgetOrBuilder", "code": "@java.lang.Override\n    public emu.grasscutter.net.proto.StatueGadgetInfoOuterClass.StatueGadgetInfoOrBuilder getStatueGadgetOrBuilder() {\n      if (contentCase_ == 19) {\n         return (emu.grasscutter.net.proto.StatueGadgetInfoOuterClass.StatueGadgetInfo) content_;\n      }\n      return emu.grasscutter.net.proto.StatueGadgetInfoOuterClass.StatueGadgetInfo.getDefaultInstance();\n    }", "docstring": "/**\n     * <code>.StatueGadgetInfo statue_gadget = 19;</code>\n     */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/GadgetInfoOuterClass.java#L1428-L1434", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}907{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "GravenInnocenceDetailInfo.Builder.setPhotoInfo", "code": "public Builder setPhotoInfo(emu.grasscutter.net.proto.GravenInnocencePhotoInfoOuterClass.GravenInnocencePhotoInfo value) {\n        if (photoInfoBuilder_ == null) {\n          if (value == null) {\n            throw new NullPointerException();\n          }\n          photoInfo_ = value;\n          onChanged();\n        } else {\n          photoInfoBuilder_.setMessage(value);\n        }\n\n        return this;\n      }", "docstring": "/**\n       * <code>.GravenInnocencePhotoInfo photo_info = 10;</code>\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/GravenInnocenceDetailInfoOuterClass.java#L1171-L1183", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}908{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "GravenInnocenceDetailInfo.Builder.setPhotoInfo", "code": "public Builder setPhotoInfo(\n          emu.grasscutter.net.proto.GravenInnocencePhotoInfoOuterClass.GravenInnocencePhotoInfo.Builder builderForValue) {\n        if (photoInfoBuilder_ == null) {\n          photoInfo_ = builderForValue.build();\n          onChanged();\n        } else {\n          photoInfoBuilder_.setMessage(builderForValue.build());\n        }\n\n        return this;\n      }", "docstring": "/**\n       * <code>.GravenInnocencePhotoInfo photo_info = 10;</code>\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/GravenInnocenceDetailInfoOuterClass.java#L1187-L1197", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}909{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "RoguelikeDungeonSettleInfoOuterClass.RoguelikeDungeonSettleInfo.getStageId", "code": "@java.lang.Override\n    public int getStageId() {\n      return stageId_;\n    }", "docstring": "/**\n       * <code>uint32 stageId = 10;</code>\n       * @return The stageId.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/RoguelikeDungeonSettleInfoOuterClass.java#L274-L277", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}910{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "AvatarFollowRouteNotify.Builder.getClientParams", "code": "public java.lang.String getClientParams() {\n        java.lang.Object ref = clientParams_;\n        if (!(ref instanceof java.lang.String)) {\n          com.google.protobuf.ByteString bs =\n              (com.google.protobuf.ByteString) ref;\n          java.lang.String s = bs.toStringUtf8();\n          clientParams_ = s;\n          return s;\n        } else {\n          return (java.lang.String) ref;\n        }\n      }", "docstring": "/**\n       * <code>string clientParams = 10;</code>\n       * @return The clientParams.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/AvatarFollowRouteNotifyOuterClass.java#L856-L867", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}911{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "BlossomBriefInfoNotify.Builder.getBriefInfoListBuilder", "code": "public emu.grasscutter.net.proto.BlossomBriefInfoOuterClass.BlossomBriefInfo.Builder getBriefInfoListBuilder(\n          int index) {\n        return getBriefInfoListFieldBuilder().getBuilder(index);\n      }", "docstring": "/**\n       * <code>repeated .BlossomBriefInfo briefInfoList = 9;</code>\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/BlossomBriefInfoNotifyOuterClass.java#L835-L838", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}912{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "LaunchFireworksReq.Builder.setSchemeData", "code": "public Builder setSchemeData(emu.grasscutter.net.proto.FireworksLaunchSchemeDataOuterClass.FireworksLaunchSchemeData value) {\n        if (schemeDataBuilder_ == null) {\n          if (value == null) {\n            throw new NullPointerException();\n          }\n          schemeData_ = value;\n          onChanged();\n        } else {\n          schemeDataBuilder_.setMessage(value);\n        }\n\n        return this;\n      }", "docstring": "/**\n       * <code>.FireworksLaunchSchemeData schemeData = 1;</code>\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/LaunchFireworksReqOuterClass.java#L630-L642", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}913{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "MonsterPointArrayRouteUpdateNotifyOuterClass.MonsterPointArrayRouteUpdateNotify.getMonsterRouteOrBuilder", "code": "@java.lang.Override\n    public emu.grasscutter.net.proto.MonsterRouteOuterClass.MonsterRouteOrBuilder getMonsterRouteOrBuilder() {\n      return getMonsterRoute();\n    }", "docstring": "/**\n     * <code>.MonsterRoute monsterRoute = 2;</code>\n     */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/MonsterPointArrayRouteUpdateNotifyOuterClass.java#L300-L303", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}914{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "RogueDiaryInfoOuterClass.RogueDiaryInfo.getIsHaveProgress", "code": "@java.lang.Override\n    public boolean getIsHaveProgress() {\n      return isHaveProgress_;\n    }", "docstring": "/**\n       * <code>bool isHaveProgress = 13;</code>\n       * @return The isHaveProgress.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/RogueDiaryInfoOuterClass.java#L269-L272", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}915{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "ServerAnnounceRevokeNotify.Builder.addConfigIdList", "code": "public Builder addConfigIdList(int value) {\n        ensureConfigIdListIsMutable();\n        configIdList_.addInt(value);\n        onChanged();\n        return this;\n      }", "docstring": "/**\n       * <code>repeated uint32 configIdList = 12;</code>\n       * @param value The configIdList to add.\n       * @return This builder for chaining.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/ServerAnnounceRevokeNotifyOuterClass.java#L681-L686", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}916{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "ServerBuffChangeNotifyOuterClass.ServerBuffChangeNotify.getServerBuffListOrBuilderList", "code": "@java.lang.Override\n    public java.util.List<? extends emu.grasscutter.net.proto.ServerBuffOuterClass.ServerBuffOrBuilder> \n        getServerBuffListOrBuilderList() {\n      return serverBuffList_;\n    }", "docstring": "/**\n     * <code>repeated .ServerBuff serverBuffList = 12;</code>\n     */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/ServerBuffChangeNotifyOuterClass.java#L369-L373", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}917{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "ServerBuffChangeNotifyOuterClass.ServerBuffChangeNotify.getAvatarGuidListCount", "code": "public int getAvatarGuidListCount() {\n      return avatarGuidList_.size();\n    }", "docstring": "/**\n       * <code>repeated uint64 avatarGuidList = 10;</code>\n       * @return The count of avatarGuidList.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/ServerBuffChangeNotifyOuterClass.java#L412-L414", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}918{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "ShopConcertProductOuterClass.ShopConcertProduct.getObtainLimit", "code": "@java.lang.Override\n    public int getObtainLimit() {\n      return obtainLimit_;\n    }", "docstring": "/**\n       * <code>uint32 obtainLimit = 4;</code>\n       * @return The obtainLimit.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/ShopConcertProductOuterClass.java#L284-L287", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}919{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "DailyTaskFilterCityRsp.Builder.setRetcode", "code": "public Builder setRetcode(int value) {\n        \n        retcode_ = value;\n        onChanged();\n        return this;\n      }", "docstring": "/**\n       * <code>int32 retcode = 5;</code>\n       * @param value The retcode to set.\n       * @return This builder for chaining.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/DailyTaskFilterCityRspOuterClass.java#L495-L500", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}920{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "GetPlayerAskFriendListRspOuterClass.GetPlayerAskFriendListRsp.getAskFriendList", "code": "@java.lang.Override\n    public emu.grasscutter.net.proto.FriendBriefOuterClass.FriendBrief getAskFriendList(int index) {\n      return askFriendList_.get(index);\n    }", "docstring": "/**\n     * <code>repeated .FriendBrief askFriendList = 6;</code>\n     */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/GetPlayerAskFriendListRspOuterClass.java#L316-L319", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}921{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "BlossomChestOuterClass.BlossomChest.getRemainUidListList", "code": "@java.lang.Override\n    public java.util.List<java.lang.Integer>\n        getRemainUidListList() {\n      return remainUidList_;\n    }", "docstring": "/**\n     * <code>repeated uint32 remainUidList = 3;</code>\n     * @return A list containing the remainUidList.\n     */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/BlossomChestOuterClass.java#L272-L276", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}922{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "WinterCampAcceptItemResultInfo.Builder.clearUnk3300ILELLFNPDFJ", "code": "public Builder clearUnk3300ILELLFNPDFJ() {\n        if (unk3300ILELLFNPDFJBuilder_ == null) {\n          unk3300ILELLFNPDFJ_ = java.util.Collections.emptyList();\n          bitField0_ = (bitField0_ & ~0x00000001);\n          onChanged();\n        } else {\n          unk3300ILELLFNPDFJBuilder_.clear();\n        }\n        return this;\n      }", "docstring": "/**\n       * <code>repeated .ItemParam Unk3300_ILELLFNPDFJ = 9;</code>\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/WinterCampAcceptItemResultInfoOuterClass.java#L872-L881", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}923{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "BlitzRushInfoOuterClass.BlitzRushInfo.getParkourLevelInfoListOrBuilderList", "code": "@java.lang.Override\n    public java.util.List<? extends emu.grasscutter.net.proto.ParkourLevelInfoOuterClass.ParkourLevelInfoOrBuilder> \n        getParkourLevelInfoListOrBuilderList() {\n      return parkourLevelInfoList_;\n    }", "docstring": "/**\n     * <code>repeated .ParkourLevelInfo parkourLevelInfoList = 6;</code>\n     */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/BlitzRushInfoOuterClass.java#L258-L262", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}924{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "HomeSceneArrangementInfo.Builder.clearMainHouse", "code": "public Builder clearMainHouse() {\n        if (mainHouseBuilder_ == null) {\n          mainHouse_ = null;\n          onChanged();\n        } else {\n          mainHouse_ = null;\n          mainHouseBuilder_ = null;\n        }\n\n        return this;\n      }", "docstring": "/**\n       * <code>.HomeFurnitureData mainHouse = 6;</code>\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/HomeSceneArrangementInfoOuterClass.java#L1957-L1967", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}925{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "VintageMarketInfo.Builder.addUnk3300ABHHACBDCFI", "code": "public Builder addUnk3300ABHHACBDCFI(int value) {\n        ensureUnk3300ABHHACBDCFIIsMutable();\n        unk3300ABHHACBDCFI_.addInt(value);\n        onChanged();\n        return this;\n      }", "docstring": "/**\n       * <code>repeated uint32 Unk3300_ABHHACBDCFI = 3;</code>\n       * @param value The unk3300ABHHACBDCFI to add.\n       * @return This builder for chaining.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/VintageMarketInfoOuterClass.java#L2282-L2287", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}926{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "VintageMarketInfo.Builder.clearUnk3300KJDEFIBKBPE", "code": "public Builder clearUnk3300KJDEFIBKBPE() {\n        \n        unk3300KJDEFIBKBPE_ = false;\n        onChanged();\n        return this;\n      }", "docstring": "/**\n       * <code>bool Unk3300_KJDEFIBKBPE = 5;</code>\n       * @return This builder for chaining.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/VintageMarketInfoOuterClass.java#L2415-L2420", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}927{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "MaterialOuterClass.Material.getCount", "code": "@java.lang.Override\n    public int getCount() {\n      return count_;\n    }", "docstring": "/**\n       * <code>uint32 count = 1;</code>\n       * @return The count.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/MaterialOuterClass.java#L143-L146", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}928{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "PlayerDataNotify.Builder.putPropMap", "code": "public Builder putPropMap(\n          int key,\n          emu.grasscutter.net.proto.PropValueOuterClass.PropValue value) {\n        \n        if (value == null) { throw new java.lang.NullPointerException(); }\n        internalGetMutablePropMap().getMutableMap()\n            .put(key, value);\n        return this;\n      }", "docstring": "/**\n       * <code>map&lt;uint32, .PropValue&gt; propMap = 5;</code>\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/PlayerDataNotifyOuterClass.java#L1176-L1184", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}929{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "PlayerLoginReq.Builder.setClientVerisonHash", "code": "public Builder setClientVerisonHash(\n          java.lang.String value) {\n        if (value == null) {\n    throw new NullPointerException();\n  }\n  \n        clientVerisonHash_ = value;\n        onChanged();\n        return this;\n      }", "docstring": "/**\n       * <code>string clientVerisonHash = 1765;</code>\n       * @param value The clientVerisonHash to set.\n       * @return This builder for chaining.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/PlayerLoginReqOuterClass.java#L4211-L4220", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}930{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "AnchorPointDataOuterClass.AnchorPointData.getRot", "code": "@java.lang.Override\n    public emu.grasscutter.net.proto.VectorOuterClass.Vector getRot() {\n      return rot_ == null ? emu.grasscutter.net.proto.VectorOuterClass.Vector.getDefaultInstance() : rot_;\n    }", "docstring": "/**\n     * <code>.Vector rot = 13;</code>\n     * @return The rot.\n     */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/AnchorPointDataOuterClass.java#L212-L215", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}931{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "RegionInfo.Builder.setResVersionConfig", "code": "public Builder setResVersionConfig(\n          emu.grasscutter.net.proto.ResVersionConfigOuterClass.ResVersionConfig.Builder builderForValue) {\n        if (resVersionConfigBuilder_ == null) {\n          resVersionConfig_ = builderForValue.build();\n          onChanged();\n        } else {\n          resVersionConfigBuilder_.setMessage(builderForValue.build());\n        }\n\n        return this;\n      }", "docstring": "/**\n       * <code>.ResVersionConfig res_version_config = 22;</code>\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/RegionInfoOuterClass.java#L3421-L3431", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}932{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "StopServerInfo.Builder.getContentMsg", "code": "public java.lang.String getContentMsg() {\n        java.lang.Object ref = contentMsg_;\n        if (!(ref instanceof java.lang.String)) {\n          com.google.protobuf.ByteString bs =\n              (com.google.protobuf.ByteString) ref;\n          java.lang.String s = bs.toStringUtf8();\n          contentMsg_ = s;\n          return s;\n        } else {\n          return (java.lang.String) ref;\n        }\n      }", "docstring": "/**\n       * <code>string contentMsg = 4;</code>\n       * @return The contentMsg.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/StopServerInfoOuterClass.java#L752-L763", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}933{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "GetMailItemRsp.Builder.setItemList", "code": "public Builder setItemList(\n          int index, emu.grasscutter.net.proto.EquipParamOuterClass.EquipParam.Builder builderForValue) {\n        if (itemListBuilder_ == null) {\n          ensureItemListIsMutable();\n          itemList_.set(index, builderForValue.build());\n          onChanged();\n        } else {\n          itemListBuilder_.setMessage(index, builderForValue.build());\n        }\n        return this;\n      }", "docstring": "/**\n       * <code>repeated .EquipParam itemList = 9;</code>\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/GetMailItemRspOuterClass.java#L865-L875", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}934{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "AvatarInfo.Builder.setExpeditionStateValue", "code": "public Builder setExpeditionStateValue(int value) {\n        \n        expeditionState_ = value;\n        onChanged();\n        return this;\n      }", "docstring": "/**\n       * <code>.AvatarExpeditionState expeditionState = 16;</code>\n       * @param value The enum numeric value on the wire for expeditionState to set.\n       * @return This builder for chaining.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/AvatarInfoOuterClass.java#L3897-L3902", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}935{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "EvtDoSkillSuccNotify.Builder.setForwardTypeValue", "code": "public Builder setForwardTypeValue(int value) {\n        \n        forwardType_ = value;\n        onChanged();\n        return this;\n      }", "docstring": "/**\n       * <code>.ForwardType forwardType = 5;</code>\n       * @param value The enum numeric value on the wire for forwardType to set.\n       * @return This builder for chaining.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/EvtDoSkillSuccNotifyOuterClass.java#L781-L786", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}936{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "EntityClientExtraInfo.Builder.getSkillAnchorPositionFieldBuilder", "code": "private com.google.protobuf.SingleFieldBuilderV3<\n          emu.grasscutter.net.proto.VectorOuterClass.Vector, emu.grasscutter.net.proto.VectorOuterClass.Vector.Builder, emu.grasscutter.net.proto.VectorOuterClass.VectorOrBuilder> \n          getSkillAnchorPositionFieldBuilder() {\n        if (skillAnchorPositionBuilder_ == null) {\n          skillAnchorPositionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<\n              emu.grasscutter.net.proto.VectorOuterClass.Vector, emu.grasscutter.net.proto.VectorOuterClass.Vector.Builder, emu.grasscutter.net.proto.VectorOuterClass.VectorOrBuilder>(\n                  getSkillAnchorPosition(),\n                  getParentForChildren(),\n                  isClean());\n          skillAnchorPosition_ = null;\n        }\n        return skillAnchorPositionBuilder_;\n      }", "docstring": "/**\n       * <code>.Vector skillAnchorPosition = 1;</code>\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/EntityClientExtraInfoOuterClass.java#L572-L584", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}937{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "SceneAvatarInfo.Builder.getReliquaryListBuilderList", "code": "public java.util.List<emu.grasscutter.net.proto.SceneReliquaryInfoOuterClass.SceneReliquaryInfo.Builder> \n           getReliquaryListBuilderList() {\n        return getReliquaryListFieldBuilder().getBuilderList();\n      }", "docstring": "/**\n       * <code>repeated .SceneReliquaryInfo reliquaryList = 9;</code>\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/SceneAvatarInfoOuterClass.java#L2753-L2756", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}938{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "SceneAvatarInfo.Builder.clearCurVehicleInfo", "code": "public Builder clearCurVehicleInfo() {\n        if (curVehicleInfoBuilder_ == null) {\n          curVehicleInfo_ = null;\n          onChanged();\n        } else {\n          curVehicleInfo_ = null;\n          curVehicleInfoBuilder_ = null;\n        }\n\n        return this;\n      }", "docstring": "/**\n       * <code>.CurVehicleInfo curVehicleInfo = 20;</code>\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/SceneAvatarInfoOuterClass.java#L3622-L3632", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}939{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "MarkMapReq.Builder.setMark", "code": "public Builder setMark(emu.grasscutter.net.proto.MapMarkPointOuterClass.MapMarkPoint value) {\n        if (markBuilder_ == null) {\n          if (value == null) {\n            throw new NullPointerException();\n          }\n          mark_ = value;\n          onChanged();\n        } else {\n          markBuilder_.setMessage(value);\n        }\n\n        return this;\n      }", "docstring": "/**\n       * <code>.MapMarkPoint mark = 10;</code>\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/MarkMapReqOuterClass.java#L927-L939", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}940{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "IrodoriChessEntranceInfo.Builder.addLhjhgbpjpkl", "code": "public Builder addLhjhgbpjpkl(\n          int index, emu.grasscutter.net.proto.IrodoriChessMonsterInfoOuterClass.IrodoriChessMonsterInfo value) {\n        if (lhjhgbpjpklBuilder_ == null) {\n          if (value == null) {\n            throw new NullPointerException();\n          }\n          ensureLhjhgbpjpklIsMutable();\n          lhjhgbpjpkl_.add(index, value);\n          onChanged();\n        } else {\n          lhjhgbpjpklBuilder_.addMessage(index, value);\n        }\n        return this;\n      }", "docstring": "/**\n       * <code>repeated .IrodoriChessMonsterInfo lhjhgbpjpkl = 8;</code>\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/IrodoriChessEntranceInfoOuterClass.java#L680-L693", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}941{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "ChapterStateNotify.Builder.hasNeedPlayerLevel", "code": "public boolean hasNeedPlayerLevel() {\n        return needPlayerLevelBuilder_ != null || needPlayerLevel_ != null;\n      }", "docstring": "/**\n       * <code>.ChapterStateNotify.NeedPlayerLevel needPlayerLevel = 2;</code>\n       * @return Whether the needPlayerLevel field is set.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/ChapterStateNotifyOuterClass.java#L1899-L1901", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}942{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "MailData.Builder.clearMailId", "code": "public Builder clearMailId() {\n        \n        mailId_ = 0;\n        onChanged();\n        return this;\n      }", "docstring": "/**\n       * <code>uint32 mailId = 1;</code>\n       * @return This builder for chaining.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/MailDataOuterClass.java#L1061-L1066", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}943{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "BartenderInfoOuterClass.BartenderInfo.getUnlockTaskListCount", "code": "@java.lang.Override\n    public int getUnlockTaskListCount() {\n      return unlockTaskList_.size();\n    }", "docstring": "/**\n     * <code>repeated .BartenderTaskInfo unlockTaskList = 15;</code>\n     */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/BartenderInfoOuterClass.java#L299-L302", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}944{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "AsterInfo.Builder.clearAsterMid", "code": "public Builder clearAsterMid() {\n        if (asterMidBuilder_ == null) {\n          asterMid_ = null;\n          onChanged();\n        } else {\n          asterMid_ = null;\n          asterMidBuilder_ = null;\n        }\n\n        return this;\n      }", "docstring": "/**\n       * <code>.AsterMidDetailInfo asterMid = 4;</code>\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/AsterInfoOuterClass.java#L1350-L1360", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}945{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "CustomGadgetTreeInfo.Builder.getNodeListBuilderList", "code": "public java.util.List<emu.grasscutter.net.proto.CustomCommonNodeInfoOuterClass.CustomCommonNodeInfo.Builder> \n           getNodeListBuilderList() {\n        return getNodeListFieldBuilder().getBuilderList();\n      }", "docstring": "/**\n       * <code>repeated .CustomCommonNodeInfo nodeList = 1;</code>\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/CustomGadgetTreeInfoOuterClass.java#L739-L742", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}946{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "TrackingIOInfo.Builder.setUnk3300NMDNLHLAKAMBytes", "code": "public Builder setUnk3300NMDNLHLAKAMBytes(\n          com.google.protobuf.ByteString value) {\n        if (value == null) {\n    throw new NullPointerException();\n  }\n  checkByteStringIsUtf8(value);\n        \n        unk3300NMDNLHLAKAM_ = value;\n        onChanged();\n        return this;\n      }", "docstring": "/**\n       * <code>string Unk3300_NMDNLHLAKAM = 11;</code>\n       * @param value The bytes for unk3300NMDNLHLAKAM to set.\n       * @return This builder for chaining.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/TrackingIOInfoOuterClass.java#L1193-L1203", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}947{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "WinterCampActivityDetailInfo.Builder.addUsedItemList", "code": "public Builder addUsedItemList(\n          int index, emu.grasscutter.net.proto.ItemParamOuterClass.ItemParam.Builder builderForValue) {\n        if (usedItemListBuilder_ == null) {\n          ensureUsedItemListIsMutable();\n          usedItemList_.add(index, builderForValue.build());\n          onChanged();\n        } else {\n          usedItemListBuilder_.addMessage(index, builderForValue.build());\n        }\n        return this;\n      }", "docstring": "/**\n       * <code>repeated .ItemParam used_item_list = 14;</code>\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/WinterCampActivityDetailInfoOuterClass.java#L1711-L1721", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}948{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "WinterCampRecvItemData.Builder.addItemList", "code": "public Builder addItemList(\n          int index, emu.grasscutter.net.proto.ItemParamOuterClass.ItemParam.Builder builderForValue) {\n        if (itemListBuilder_ == null) {\n          ensureItemListIsMutable();\n          itemList_.add(index, builderForValue.build());\n          onChanged();\n        } else {\n          itemListBuilder_.addMessage(index, builderForValue.build());\n        }\n        return this;\n      }", "docstring": "/**\n       * <code>repeated .ItemParam itemList = 9;</code>\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/WinterCampRecvItemDataOuterClass.java#L838-L848", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}949{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "GeneralRewardInfo.Builder.clearItemParam", "code": "public Builder clearItemParam() {\n        if (itemParamBuilder_ == null) {\n          itemParam_ = null;\n          onChanged();\n        } else {\n          itemParam_ = null;\n          itemParamBuilder_ = null;\n        }\n\n        return this;\n      }", "docstring": "/**\n       * <code>.ItemParam itemParam = 5;</code>\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/GeneralRewardInfoOuterClass.java#L1069-L1079", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}950{"repo_name": "Gshine-Server", "dataset": "github_2023", "owner": "AngelicPretty", "lang": "java", "func_name": "LanternProjectionInfo.Builder.clearUnk3300FAIAIJGCBJG", "code": "public Builder clearUnk3300FAIAIJGCBJG() {\n        unk3300FAIAIJGCBJG_ = java.util.Collections.emptyList();\n        bitField0_ = (bitField0_ & ~0x00000001);\n        onChanged();\n        return this;\n      }", "docstring": "/**\n       * <code>repeated .ClientInputType Unk3300_FAIAIJGCBJG = 2;</code>\n       * @return This builder for chaining.\n       */", "url": "https://github.com/AngelicPretty/Gshine-Server/blob/bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755/src/generated/main/java/emu/grasscutter/net/proto/LanternProjectionInfoOuterClass.java#L1022-L1027", "sha": "bd9801c5e1d4f0d3a0d6cade7cad5f97eb71d755"}951{"repo_name": "campus-example", "dataset": "github_2023", "owner": "oddfar", "lang": "java", "func_name": "ReflectUtils.makeAccessible", "code": "public static void makeAccessible(Field field) {\n        if ((!Modifier.isPublic(field.getModifiers()) || !Modifier.isPublic(field.getDeclaringClass().getModifiers())\n                || Modifier.isFinal(field.getModifiers())) && !field.isAccessible()) {\n            field.setAccessible(true);\n        }\n    }", "docstring": "/**\n     * ๆ”นๅ˜private/protected็š„ๆˆๅ‘˜ๅ˜้‡ไธบpublic๏ผŒๅฐฝ้‡ไธ่ฐƒ็”จๅฎž้™…ๆ”นๅŠจ็š„่ฏญๅฅ๏ผŒ้ฟๅ…JDK็š„SecurityManagerๆŠฑๆ€จใ€‚\n     */", "url": "https://github.com/oddfar/campus-example/blob/4f4b89f97e9d0eb17ae9ff86dcc9a928578aade6/campus-common/src/main/java/com/oddfar/campus/common/utils/reflect/ReflectUtils.java#L254-L259", "sha": "4f4b89f97e9d0eb17ae9ff86dcc9a928578aade6"}952{"repo_name": "campus-example", "dataset": "github_2023", "owner": "oddfar", "lang": "java", "func_name": "SysMenuServiceImpl.getChildPerms", "code": "public List<SysMenuEntity> getChildPerms(List<SysMenuEntity> list, int parentId) {\n        List<SysMenuEntity> returnList = new ArrayList<SysMenuEntity>();\n        for (Iterator<SysMenuEntity> iterator = list.iterator(); iterator.hasNext(); ) {\n            SysMenuEntity t = (SysMenuEntity) iterator.next();\n            // ไธ€ใ€ๆ นๆฎไผ ๅ…ฅ็š„ๆŸไธช็ˆถ่Š‚็‚นID,้ๅކ่ฏฅ็ˆถ่Š‚็‚น็š„ๆ‰€ๆœ‰ๅญ่Š‚็‚น\n            if (t.getParentId() == parentId) {\n                recursionFn(list, t);\n                returnList.add(t);\n            }\n        }\n        return returnList;\n    }", "docstring": "/**\n     * ๆ นๆฎ็ˆถ่Š‚็‚น็š„ID่Žทๅ–ๆ‰€ๆœ‰ๅญ่Š‚็‚น\n     *\n     * @param list     ๅˆ†็ฑป่กจ\n     * @param parentId ไผ ๅ…ฅ็š„็ˆถ่Š‚็‚นID\n     * @return String\n     */", "url": "https://github.com/oddfar/campus-example/blob/4f4b89f97e9d0eb17ae9ff86dcc9a928578aade6/campus-framework/src/main/java/com/oddfar/campus/framework/service/impl/SysMenuServiceImpl.java#L371-L382", "sha": "4f4b89f97e9d0eb17ae9ff86dcc9a928578aade6"}953{"repo_name": "Vue_BookManageSystem_backend", "dataset": "github_2023", "owner": "luoye6", "lang": "java", "func_name": "Utility.readConfirmSelection", "code": "public static char readConfirmSelection() {\n        System.out.print(\"็กฎ่ฎคๆ˜ฏๅฆ้ข„่ฎข(Y/N): \");\n        char c;\n        for (; ; ) {//ๆ— ้™ๅพช็Žฏ\n            //ๅœจ่ฟ™้‡Œ๏ผŒๅฐ†ๆŽฅๅ—ๅˆฐๅญ—็ฌฆ๏ผŒ่ฝฌๆˆไบ†ๅคงๅ†™ๅญ—ๆฏ\n            //y => Y n=>N\n            String str = readKeyBoard(1, false).toUpperCase();\n            c = str.charAt(0);\n            if (c == 'Y' || c == 'N') {\n                break;\n            } else {\n                System.out.print(\"้€‰ๆ‹ฉ้”™่ฏฏ๏ผŒ่ฏท้‡ๆ–ฐ่พ“ๅ…ฅ๏ผš\");\n            }\n        }\n        return c;\n    }", "docstring": "/**\n     * ๅŠŸ่ƒฝ๏ผš่ฏปๅ–้”ฎ็›˜่พ“ๅ…ฅ็š„็กฎ่ฎค้€‰้กน๏ผŒYๆˆ–N\n     * ๅฐ†ๅฐ็š„ๅŠŸ่ƒฝ๏ผŒๅฐ่ฃ…ๅˆฐไธ€ไธชๆ–นๆณ•ไธญ.\n     * @return Yๆˆ–N\n     */", "url": "https://github.com/luoye6/Vue_BookManageSystem_backend/blob/59de5993f9559d96825e22cf1318b60edc30c815/src/main/java/com/book/backend/utils/Utility.java#L139-L154", "sha": "59de5993f9559d96825e22cf1318b60edc30c815"}954{"repo_name": "MongoPlus", "dataset": "github_2023", "owner": "anwena", "lang": "java", "func_name": "Accumulators.min", "code": "public static <T,R> BsonField min(final SFunction<T,?> fieldName, final SFunction<R,?> expression) {\n        return min(fieldName.getFieldNameLine(),expression.getFieldNameLineOption());\n    }", "docstring": "/**\n     * ่Žทๅ– $group ๆ“ไฝœ็š„ๅญ—ๆฎตๅ็งฐ๏ผŒ่ฏฅๅญ—ๆฎตๅ็งฐ่กจ็คบๅบ”็”จไบŽ็ป„ๅ†…ๆ‰€ๆœ‰ๆˆๅ‘˜ๆ—ถ็ป™ๅฎš่กจ่พพๅผ็š„ๆœ€ๅฐๅ€ผ.\n     *\n     * @param fieldName {@link BsonField} ๅ็งฐ\n     * @param expression ่กจ่พพๅผ\n     * @return {@link BsonField}\n     * @since mongodb.driver.manual reference/operator/aggregation/min/ $min\n     */", "url": "https://github.com/anwena/MongoPlus/blob/26f982a11cc072310dbd0e02fb33275cf83c1280/mongo-plus-core/src/main/java/com/anwen/mongo/aggregate/pipeline/Accumulators.java#L841-L843", "sha": "26f982a11cc072310dbd0e02fb33275cf83c1280"}955{"repo_name": "MongoPlus", "dataset": "github_2023", "owner": "anwena", "lang": "java", "func_name": "FillField.linear", "code": "public static LinearFillOutputField linear(final String field) {\n        return new FillField(notNull(\"field\", field),\n                new Document(\"method\", \"linear\"));\n    }", "docstring": "/**\n     * ่ฟ”ๅ›žไธ€ไธชไฝฟ็”จ {@link WindowOutputFields#linearFill(String, Object) Linear} ๆ–นๆณ•็š„ {@link FillOutputField}.\n     * <p>\n     * {@linkplain FillOptions#sortBy(Bson) Sorting} ๆ˜ฏๅฟ…้œ€็š„ใ€‚</p>\n     *\n     * @param field ่ฆๅกซๅ†™็š„ๅญ—ๆฎต.\n     * @return ่ฏทๆฑ‚็š„ {@link FillOutputField}.\n     * @since mongodb.driver.manual core/document/#dot-notation Dot notation\n     */", "url": "https://github.com/anwena/MongoPlus/blob/26f982a11cc072310dbd0e02fb33275cf83c1280/mongo-plus-core/src/main/java/com/anwen/mongo/aggregate/pipeline/FillField.java#L96-L99", "sha": "26f982a11cc072310dbd0e02fb33275cf83c1280"}956{"repo_name": "MongoPlus", "dataset": "github_2023", "owner": "anwena", "lang": "java", "func_name": "Indexes.text", "code": "public static <T> Bson text(final SFunction<T,Object> fieldName) {\n        notNull(\"fieldName\", fieldName);\n        return new BsonDocument(fieldName.getFieldNameLine(), new BsonString(\"text\"));\n    }", "docstring": "/**\n     * ไธบ็ป™ๅฎšๅญ—ๆฎตไธŠ็š„ๆ–‡ๆœฌ็ดขๅผ•ๅˆ›ๅปบ็ดขๅผ•้”ฎใ€‚\n     *\n     * @param fieldName ่ฆๅœจๅ…ถไธŠๅˆ›ๅปบๆ–‡ๆœฌ็ดขๅผ•็š„ๅญ—ๆฎต\n     * @return ็ดขๅผ•่ฏฆ่ฟฐ\n     */", "url": "https://github.com/anwena/MongoPlus/blob/26f982a11cc072310dbd0e02fb33275cf83c1280/mongo-plus-core/src/main/java/com/anwen/mongo/model/Indexes.java#L246-L249", "sha": "26f982a11cc072310dbd0e02fb33275cf83c1280"}957{"repo_name": "mybatis-flex", "dataset": "github_2023", "owner": "mybatis-flex", "lang": "java", "func_name": "QueryColumn.likeRaw", "code": "public QueryCondition likeRaw(Object value, BooleanSupplier isEffective) {\n        return likeRaw(value, isEffective.getAsBoolean());\n    }", "docstring": "/**\n     * {@code LIKE value}\n     */", "url": "https://github.com/mybatis-flex/mybatis-flex/blob/0c4b0c22666f4c54275fa64b25a2780a7c72cfb5/mybatis-flex-core/src/main/java/com/mybatisflex/core/query/QueryColumn.java#L738-L740", "sha": "0c4b0c22666f4c54275fa64b25a2780a7c72cfb5"}958{"repo_name": "mybatis-flex", "dataset": "github_2023", "owner": "mybatis-flex", "lang": "java", "func_name": "QueryMethods.distinct", "code": "public static DistinctQueryColumn distinct(QueryColumn... columns) {\n        return new DistinctQueryColumn(columns);\n    }", "docstring": "/**\n     * ๅฏนๆŒ‡ๅฎšๅˆ—่ฟ›่กŒๅŽป้‡ใ€‚\n     */", "url": "https://github.com/mybatis-flex/mybatis-flex/blob/0c4b0c22666f4c54275fa64b25a2780a7c72cfb5/mybatis-flex-core/src/main/java/com/mybatisflex/core/query/QueryMethods.java#L2352-L2354", "sha": "0c4b0c22666f4c54275fa64b25a2780a7c72cfb5"}959{"repo_name": "mybatis-flex", "dataset": "github_2023", "owner": "mybatis-flex", "lang": "java", "func_name": "QueryMethods.selectCountOne", "code": "public static QueryWrapper selectCountOne() {\n        return select(count(new RawQueryColumn(\"1\")).as(\"temp_count_one\"));\n    }", "docstring": "/**\n     * SELECT COUNT(1) as temp_count_one FROM table\n     */", "url": "https://github.com/mybatis-flex/mybatis-flex/blob/0c4b0c22666f4c54275fa64b25a2780a7c72cfb5/mybatis-flex-core/src/main/java/com/mybatisflex/core/query/QueryMethods.java#L2634-L2636", "sha": "0c4b0c22666f4c54275fa64b25a2780a7c72cfb5"}960{"repo_name": "mybatis-flex", "dataset": "github_2023", "owner": "mybatis-flex", "lang": "java", "func_name": "QueryWrapper.ge", "code": "public <T> QueryWrapper ge(LambdaGetter<T> column, Object value) {\n        and(QueryMethods.column(column).ge(value));\n        return this;\n    }", "docstring": "/**\n     * ๅคงไบŽ็ญ‰ไบŽ {@code >=}\n     *\n     * @param column ๅˆ—ๅ, lambda ๅฑ•็คบ\n     * @param value  ๅ€ผ\n     */", "url": "https://github.com/mybatis-flex/mybatis-flex/blob/0c4b0c22666f4c54275fa64b25a2780a7c72cfb5/mybatis-flex-core/src/main/java/com/mybatisflex/core/query/QueryWrapper.java#L1115-L1118", "sha": "0c4b0c22666f4c54275fa64b25a2780a7c72cfb5"}961{"repo_name": "HDRSample", "dataset": "github_2023", "owner": "JonaNorman", "lang": "java", "func_name": "Builder.setRenderGL20", "code": "public Builder setRenderGL20(Boolean renderGL20) {\n            this.renderGL20 = renderGL20;\n            return this;\n        }", "docstring": "/**\n         * ๆ˜ฏๅฆๆ”ฏๆŒOpenGL2.0\n         * @param renderGL20 null ่กจ็คบ้ƒฝๅฏไปฅ๏ผŒ true่กจ็คบ่ฆๆ”ฏๆŒ๏ผŒfalse่กจ็คบไธๆ”ฏๆŒ\n         */", "url": "https://github.com/JonaNorman/HDRSample/blob/99278a14bee7b98310521629acacd79be192ea15/sample/src/main/java/com/norman/android/hdrsample/opengl/GLEnvConfigSimpleChooser.java#L93-L96", "sha": "99278a14bee7b98310521629acacd79be192ea15"}962{"repo_name": "Allay", "dataset": "github_2023", "owner": "AllayMC", "lang": "java", "func_name": "AllayNbtUtils.nbtToBase64", "code": "public static String nbtToBase64(NbtMap nbtMap) {\n        try (ByteArrayOutputStream stream = new ByteArrayOutputStream(); NBTOutputStream writer = org.cloudburstmc.nbt.NbtUtils.createWriter(stream)) {\n            writer.writeTag(nbtMap);\n            return Base64.getEncoder().encodeToString(stream.toByteArray());\n        } catch (Exception e) {\n            // Handle exceptions accordingly\n            log.error(\"Failed to convert NBT to Base64\", e);\n        }\n        return null;\n    }", "docstring": "/**\n     * Convert NBT to Base64.\n     *\n     * @param nbtMap the NBT map.\n     *\n     * @return the Base64 string.\n     */", "url": "https://github.com/AllayMC/Allay/blob/f7fcf6d9183c5216e7321510a6cd2a5017d20ca9/api/src/main/java/org/allaymc/api/utils/AllayNbtUtils.java#L45-L54", "sha": "f7fcf6d9183c5216e7321510a6cd2a5017d20ca9"}963{"repo_name": "Allay", "dataset": "github_2023", "owner": "AllayMC", "lang": "java", "func_name": "JSONUtils.fromMap", "code": "public static Map<String, Object> fromMap(String json) {\n        return GSON.fromJson(json, new TypeToken<HashMap<String, Object>>() {\n        }.getType());\n    }", "docstring": "/**\n     * Parse a JSON string to a map.\n     *\n     * @param json the JSON string.\n     *\n     * @return the map.\n     */", "url": "https://github.com/AllayMC/Allay/blob/f7fcf6d9183c5216e7321510a6cd2a5017d20ca9/api/src/main/java/org/allaymc/api/utils/JSONUtils.java#L242-L245", "sha": "f7fcf6d9183c5216e7321510a6cd2a5017d20ca9"}964{"repo_name": "Allay", "dataset": "github_2023", "owner": "AllayMC", "lang": "java", "func_name": "ParameterFormatter.countArgumentPlaceholders3", "code": "static int countArgumentPlaceholders3(final char[] messagePattern, final int length, final int[] indices) {\n        int result = 0;\n        boolean isEscaped = false;\n        for (int i = 0; i < length - 1; i++) {\n            final char curChar = messagePattern[i];\n            if (curChar == ESCAPE_CHAR) {\n                isEscaped = !isEscaped;\n            } else if (curChar == DELIM_START) {\n                if (!isEscaped && messagePattern[i + 1] == DELIM_STOP) {\n                    indices[result] = i;\n                    result++;\n                    i++;\n                }\n                isEscaped = false;\n            } else {\n                isEscaped = false;\n            }\n        }\n        return result;\n    }", "docstring": "/**\n     * Counts the number of unescaped placeholders in the given messagePattern.\n     *\n     * @param messagePattern the message pattern to be analyzed.\n     *\n     * @return the number of unescaped placeholders.\n     */", "url": "https://github.com/AllayMC/Allay/blob/f7fcf6d9183c5216e7321510a6cd2a5017d20ca9/api/src/main/java/org/allaymc/api/utils/ParameterFormatter.java#L120-L139", "sha": "f7fcf6d9183c5216e7321510a6cd2a5017d20ca9"}965{"repo_name": "MallChat", "dataset": "github_2023", "owner": "zongzibinbin", "lang": "java", "func_name": "ACTrie.initFailover", "code": "private void initFailover() {\n        //็ฌฌไธ€ๅฑ‚็š„failๆŒ‡้’ˆๆŒ‡ๅ‘root\n        Queue<ACTrieNode> queue = new LinkedList<>();\n        Map<Character, ACTrieNode> children = root.getChildren();\n        for (ACTrieNode node : children.values()) {\n            node.setFailover(root);\n            queue.offer(node);\n        }\n        //ๆž„ๅปบๅ‰ฉไฝ™ๅฑ‚ๆ•ฐ่Š‚็‚น็š„failๆŒ‡้’ˆ,ๅˆฉ็”จๅฑ‚ๆฌก้ๅކ\n        while (!queue.isEmpty()) {\n            ACTrieNode parentNode = queue.poll();\n            for (Map.Entry<Character, ACTrieNode> entry : parentNode.getChildren().entrySet()) {\n                ACTrieNode childNode = entry.getValue();\n                ACTrieNode failover = parentNode.getFailover();\n                // ๅœจๆ ‘ไธญๆ‰พๅˆฐไปฅchildNodeไธบ็ป“ๅฐพ็š„ๅญ—็ฌฆไธฒ็š„ๆœ€้•ฟๅ‰็ผ€ๅŒน้…๏ผŒfailoverๆŒ‡ๅ‘ไบ†่ฟ™ไธชๆœ€้•ฟๅ‰็ผ€ๅŒน้…็š„็ˆถ่Š‚็‚น\n                while (failover != null && (!failover.hasChild(entry.getKey()))) {\n                    failover = failover.getFailover();\n                }\n                //ๅ›žๆบฏๅˆฐไบ†root่Š‚็‚น\n                if (failover == null) {\n                    childNode.setFailover(root);\n                } else {\n                    // ๆ›ดๆ–ฐๅฝ“ๅ‰่Š‚็‚น็š„ๅ›ž้€€ๆŒ‡้’ˆ\n                    childNode.setFailover(failover.childOf(entry.getKey()));\n                }\n                queue.offer(childNode);\n            }\n        }\n    }", "docstring": "/**\n     * ๅˆๅง‹ๅŒ–่Š‚็‚นไธญ็š„ๅ›ž้€€ๆŒ‡้’ˆ\n     */", "url": "https://github.com/zongzibinbin/MallChat/blob/f2563328d4a5311a2308079025da4e637437759b/mallchat-chat-server/src/main/java/com/abin/mallchat/common/common/algorithm/sensitiveWord/ac/ACTrie.java#L45-L73", "sha": "f2563328d4a5311a2308079025da4e637437759b"}966{"repo_name": "summer-framework", "dataset": "github_2023", "owner": "michaelliao", "lang": "java", "func_name": "AnnotationConfigApplicationContext.injectProperties", "code": "void injectProperties(BeanDefinition def, Class<?> clazz, Object bean) throws ReflectiveOperationException {\n        // ๅœจๅฝ“ๅ‰็ฑปๆŸฅๆ‰พFieldๅ’ŒMethodๅนถๆณจๅ…ฅ:\n        for (Field f : clazz.getDeclaredFields()) {\n            tryInjectProperties(def, clazz, bean, f);\n        }\n        for (Method m : clazz.getDeclaredMethods()) {\n            tryInjectProperties(def, clazz, bean, m);\n        }\n        // ๅœจ็ˆถ็ฑปๆŸฅๆ‰พFieldๅ’ŒMethodๅนถๆณจๅ…ฅ:\n        Class<?> superClazz = clazz.getSuperclass();\n        if (superClazz != null) {\n            injectProperties(def, superClazz, bean);\n        }\n    }", "docstring": "/**\n     * ๆณจๅ…ฅๅฑžๆ€ง\n     */", "url": "https://github.com/michaelliao/summer-framework/blob/087b7a98cbbb8413db48ec4774a87c6f6bc47ef4/step-by-step/bean-post-processor/src/main/java/com/itranswarp/summer/context/AnnotationConfigApplicationContext.java#L333-L346", "sha": "087b7a98cbbb8413db48ec4774a87c6f6bc47ef4"}967{"repo_name": "app-space-android", "dataset": "github_2023", "owner": "appspa", "lang": "java", "func_name": "ApkUtils.install", "code": "public static boolean install(Context context, File apkFile) throws IOException {\n        return isSupportSilentInstall() ? install(context, apkFile.getCanonicalPath()) : installNormal(context, apkFile.getCanonicalPath());\n    }", "docstring": "/**\n     * ่‡ช้€‚ๅบ”apkๅฎ‰่ฃ…๏ผˆๅฆ‚ๆžœ่ฎพๅค‡ๆœ‰rootๆƒ้™ๅฐฑ่‡ชๅŠจ้™้ป˜ๅฎ‰่ฃ…๏ผ‰\n     *\n     * @param context\n     * @param apkFile apkๆ–‡ไปถ\n     * @return\n     */", "url": "https://github.com/appspa/app-space-android/blob/83823d2bd073cf785cceeb4eabf6775e2e77f7f8/app-space-update/src/main/java/com/appspa/update/utils/ApkUtils.java#L85-L87", "sha": "83823d2bd073cf785cceeb4eabf6775e2e77f7f8"}968{"repo_name": "ai-beehive", "dataset": "github_2023", "owner": "hncboy", "lang": "java", "func_name": "AbstractRegisterTypeStrategy.checkVerifyCode", "code": "public abstract void checkVerifyCode(String identity, String verifyCode);", "docstring": "/**\n     * ๆ ก้ชŒ้ชŒ่ฏ็ ๆ˜ฏๅฆ้€š่ฟ‡\n     *\n     * @param identity   ็”จๆˆท่ดฆๅท๏ผŒๅฏ่ƒฝไธบ็ฉบใ€‚ไธ€่ˆฌ้‚ฎ็ฎฑๆƒ…ๅ†ตไธ‹ไผšไธบ็ฉบ๏ผŒๆ‰‹ๆœบๆƒ…ๅ†ตไธ‹ไธไธบ็ฉบ\n     * @param verifyCode ้‚ฎ็ฎฑ็ญ–็•ฅๆ—ถไธบ้‚ฎ็ฎฑ้ชŒ่ฏ็ ๏ผ›ๆ‰‹ๆœบ็ญ–็•ฅๆ—ถไธบๆ‰‹ๆœบ็Ÿญไฟก้ชŒ่ฏ็ \n     */", "url": "https://github.com/hncboy/ai-beehive/blob/a87a815b14e82bc68c9e682b2438a728105e21a7/beehive-web/src/main/java/com/hncboy/beehive/web/service/strategy/user/AbstractRegisterTypeStrategy.java#L72-L72", "sha": "a87a815b14e82bc68c9e682b2438a728105e21a7"}969{"repo_name": "SMS4J", "dataset": "github_2023", "owner": "dromara", "lang": "java", "func_name": "SmsBanner.PrintBanner", "code": "public static void PrintBanner(String version) {\n        System.out.println(BANNER +version);\n    }", "docstring": "/** ๅˆๅง‹ๅŒ–้…็ฝฎๆ–‡ไปถๆ—ถๆ‰“ๅฐbanner*/", "url": "https://github.com/dromara/SMS4J/blob/298e7c48e5c50444a0d626c24e06ae2fe23102eb/sms4j-provider/src/main/java/org/dromara/sms4j/provider/config/SmsBanner.java#L14-L16", "sha": "298e7c48e5c50444a0d626c24e06ae2fe23102eb"}970{"repo_name": "the-algorithm", "dataset": "github_2023", "owner": "twitter", "lang": "java", "func_name": "TwitterMessage.getBCP47LanguageTag", "code": "public String getBCP47LanguageTag() {\n    if (isSetLocale()) {\n      return getLocale().toLanguageTag();\n    } else {\n      return null;\n    }\n  }", "docstring": "/**\n   * Returns the IETF BCP 47 Language Tag of the locale. E.g. zh-CN\n   */", "url": "https://github.com/twitter/the-algorithm/blob/72eda9a24f815f6d566818cbf8518138e29d83e9/src/java/com/twitter/search/common/relevance/entities/TwitterMessage.java#L616-L622", "sha": "72eda9a24f815f6d566818cbf8518138e29d83e9"}971{"repo_name": "the-algorithm", "dataset": "github_2023", "owner": "twitter", "lang": "java", "func_name": "EarlybirdThriftDocumentUtil.replaceCreatedAtAndCreatedAtCSF", "code": "public static void replaceCreatedAtAndCreatedAtCSF(ThriftDocument document, int value) {\n    removeField(document, EarlybirdFieldConstant.CREATED_AT_FIELD);\n    removeField(document, EarlybirdFieldConstant.CREATED_AT_CSF_FIELD);\n\n    addIntField(document, EarlybirdFieldConstant.CREATED_AT_FIELD, value);\n    addIntField(document, EarlybirdFieldConstant.CREATED_AT_CSF_FIELD, value);\n  }", "docstring": "/**\n   * First remove the old timestamp if they exist.\n   * Then add the created at and created at csf fields to the given thrift document.\n   */", "url": "https://github.com/twitter/the-algorithm/blob/72eda9a24f815f6d566818cbf8518138e29d83e9/src/java/com/twitter/search/common/schema/earlybird/EarlybirdThriftDocumentUtil.java#L201-L207", "sha": "72eda9a24f815f6d566818cbf8518138e29d83e9"}972{"repo_name": "the-algorithm", "dataset": "github_2023", "owner": "twitter", "lang": "java", "func_name": "LightweightLinearModel.createForSchemaBased", "code": "protected static LightweightLinearModel createForSchemaBased(\n      String modelName,\n      double bias,\n      Map<Integer, Double> binaryFeaturesById,\n      Map<Integer, Double> continuousFeaturesById,\n      Map<Integer, DiscretizedFeature> discretizedFeaturesById) {\n    return new LightweightLinearModel(modelName, bias, true,\n        null, null, null,\n        binaryFeaturesById, continuousFeaturesById, discretizedFeaturesById);\n  }", "docstring": "/**\n   * Create model for schema-based features\n   */", "url": "https://github.com/twitter/the-algorithm/blob/72eda9a24f815f6d566818cbf8518138e29d83e9/src/java/com/twitter/search/common/util/ml/prediction_engine/LightweightLinearModel.java#L113-L122", "sha": "72eda9a24f815f6d566818cbf8518138e29d83e9"}973{"repo_name": "the-algorithm", "dataset": "github_2023", "owner": "twitter", "lang": "java", "func_name": "FacetAccumulator.add", "code": "public abstract int add(long termID, int scoreIncrement, int penaltyIncrement, int tweepCred);", "docstring": "/** Called to notify the accumulator that the given termID has occurred in a document\n   *  Returns the current count of the given termID.\n   */", "url": "https://github.com/twitter/the-algorithm/blob/72eda9a24f815f6d566818cbf8518138e29d83e9/src/java/com/twitter/search/core/earlybird/facets/FacetAccumulator.java#L14-L14", "sha": "72eda9a24f815f6d566818cbf8518138e29d83e9"}974{"repo_name": "the-algorithm", "dataset": "github_2023", "owner": "twitter", "lang": "java", "func_name": "IntBlockPoolPackedLongsReader.getPackedValueIndex", "code": "public int getPackedValueIndex() {\n    return packedValueIndex;\n  }", "docstring": "/**\n   * A simple getter of {@link #packedValueIndex}.\n   */", "url": "https://github.com/twitter/the-algorithm/blob/72eda9a24f815f6d566818cbf8518138e29d83e9/src/java/com/twitter/search/core/earlybird/index/inverted/IntBlockPoolPackedLongsReader.java#L204-L206", "sha": "72eda9a24f815f6d566818cbf8518138e29d83e9"}975{"repo_name": "the-algorithm", "dataset": "github_2023", "owner": "twitter", "lang": "java", "func_name": "SkipListContainer.searchCeil", "code": "public int searchCeil(\n      K key,\n      int skipListHead,\n      SkipListComparator<K> comparator,\n      @Nullable SkipListSearchFinger searchFinger) {\n    assert comparator != null;\n\n    // Perform regular search.\n    final int foundPointer = search(key, skipListHead, comparator, searchFinger);\n\n    // Return foundPointer if it is not the list head and the pointed value has key equal to the\n    // given key; otherwise, return next pointer.\n    if (foundPointer != skipListHead\n        && comparator.compareKeyWithValue(key, getValue(foundPointer), INVALID_POSITION) == 0) {\n      return foundPointer;\n    } else {\n      return getNextPointer(foundPointer);\n    }\n  }", "docstring": "/**\n   * Ceil search on given {@param key}.\n   *\n   * @param key target key will be searched.\n   * @param skipListHead index of the header tower of the skip list will be searched.\n   * @param comparator comparator used for comparison when traversing through the skip list.\n   * @param searchFinger {@link SkipListSearchFinger} to accelerate search speed.\n   * @return index of the smallest value with key greater or equal to the given key.\n   */", "url": "https://github.com/twitter/the-algorithm/blob/72eda9a24f815f6d566818cbf8518138e29d83e9/src/java/com/twitter/search/core/earlybird/index/inverted/SkipListContainer.java#L267-L285", "sha": "72eda9a24f815f6d566818cbf8518138e29d83e9"}976{"repo_name": "the-algorithm", "dataset": "github_2023", "owner": "twitter", "lang": "java", "func_name": "SegmentManager.getSegmentMetadata", "code": "public List<String> getSegmentMetadata() {\n    List<String> segmentMetadata = new ArrayList<>();\n    for (SegmentInfo segment : getSegmentInfos(Filter.All, Order.OLD_TO_NEW)) {\n      segmentMetadata.add(segment.getSegmentMetadata());\n    }\n    return segmentMetadata;\n  }", "docstring": "/**\n   * Gets metadata for segments for debugging purposes.\n   */", "url": "https://github.com/twitter/the-algorithm/blob/72eda9a24f815f6d566818cbf8518138e29d83e9/src/java/com/twitter/search/earlybird/partition/SegmentManager.java#L712-L718", "sha": "72eda9a24f815f6d566818cbf8518138e29d83e9"}977{"repo_name": "the-algorithm", "dataset": "github_2023", "owner": "twitter", "lang": "java", "func_name": "AntiGamingFilter.newMock", "code": "@VisibleForTesting\n  public static AntiGamingFilter newMock(boolean alwaysValue) {\n    return new AntiGamingFilter(alwaysValue) {\n      @Override\n      public void startSegment(EarlybirdIndexSegmentAtomicReader reader) {\n      }\n    };\n  }", "docstring": "/**\n   * Creates an AntiGamingFilter that either accepts or rejects tweets from all users.\n   * This method should only be called in tests.\n   *\n   * @param alwaysValue Determines if tweets should always be accepted or rejected.\n   * @return An AntiGamingFilter that either accepts or rejects tweets from all users.\n   */", "url": "https://github.com/twitter/the-algorithm/blob/72eda9a24f815f6d566818cbf8518138e29d83e9/src/java/com/twitter/search/earlybird/search/AntiGamingFilter.java#L84-L91", "sha": "72eda9a24f815f6d566818cbf8518138e29d83e9"}978{"repo_name": "the-algorithm", "dataset": "github_2023", "owner": "twitter", "lang": "java", "func_name": "TermCountMonitor.getFieldStats", "code": "private Map<String, RawFieldCounter> getFieldStats() {\n    Iterable<SegmentInfo> segmentInfos = segmentManager.getSegmentInfos(\n        SegmentManager.Filter.Enabled, SegmentManager.Order.NEW_TO_OLD);\n    Map<String, RawFieldCounter> rawCounts = new HashMap<>();\n\n    ImmutableSchemaInterface schemaSnapshot =\n        segmentManager.getEarlybirdIndexConfig().getSchema().getSchemaSnapshot();\n    Set<String> missingFieldsCandidates = schemaSnapshot\n        .getFieldInfos()\n        .stream()\n        .filter(fieldInfo -> fieldInfo.getFieldType().indexOptions() != IndexOptions.NONE)\n        .map(Schema.FieldInfo::getName)\n        .collect(Collectors.toSet());\n    int segmentCount = 0;\n    for (SegmentInfo segmentInfo : segmentInfos) {\n      segmentCount++;\n      try {\n        EarlybirdSingleSegmentSearcher searcher = segmentManager.getSearcher(\n            segmentInfo.getTimeSliceID(), schemaSnapshot);\n        if (searcher != null) {\n          EarlybirdIndexSegmentAtomicReader reader = searcher.getTwitterIndexReader();\n          for (Schema.FieldInfo fieldInfo : schemaSnapshot.getFieldInfos()) {\n            if (fieldInfo.getFieldType().indexOptions() == IndexOptions.NONE) {\n              continue;\n            }\n\n            String fieldName = fieldInfo.getName();\n            RawFieldCounter count = rawCounts.get(fieldName);\n            if (count == null) {\n              count = new RawFieldCounter();\n              rawCounts.put(fieldName, count);\n            }\n            Terms terms = reader.terms(fieldName);\n            if (terms != null) {\n              missingFieldsCandidates.remove(fieldName);\n              count.numTerms.add(terms.size());\n              long sumTotalTermFreq = terms.getSumTotalTermFreq();\n              if (sumTotalTermFreq != -1) {\n                count.numTokens.add(sumTotalTermFreq);\n              }\n            }\n          }\n        }\n      } catch (Exception e) {\n        LOG.error(\"Exception getting average term count per field: \" + segmentInfo, e);\n      }\n    }\n\n    // Update missing fields stats.\n    missingFieldsCandidates.forEach(\n        field -> getOrCreateLongGauge(missingFields, field, missingFieldStatNameFunc).set(1));\n    missingFields.keySet().stream()\n        .filter(\n            field -> !missingFieldsCandidates.contains(field))\n        .forEach(\n            field -> getOrCreateLongGauge(missingFields, field, missingFieldStatNameFunc).set(0));\n\n    long totalTermCount = 0;\n    long totalTokenCount = 0;\n    if (segmentCount == 0) {\n      LOG.error(\"No segments are found to calculate per-field term counts.\");\n    } else {\n      LOG.debug(\"TermCountMonitor.getPerFieldTermCount.segmentCount = {}\", segmentCount);\n      LOG.debug(\"  field: term count (average per segment)\");\n      for (Map.Entry<String, RawFieldCounter> entry : rawCounts.entrySet()) {\n        String field = entry.getKey();\n        final long averageTermCount = entry.getValue().numTerms.longValue() / segmentCount;\n        final long averageTokenCount = entry.getValue().numTokens.longValue() / segmentCount;\n        totalTermCount += entry.getValue().numTerms.longValue();\n        totalTokenCount += entry.getValue().numTokens.longValue();\n\n        LOG.debug(\"  '{} term': {}\", field, averageTermCount);\n        LOG.debug(\"  '{} token': {}\", field, averageTokenCount);\n\n        entry.getValue().numTerms.setValue(averageTermCount);\n        entry.getValue().numTokens.setValue(averageTokenCount);\n      }\n    }\n    LOG.info(\"Total term count: {}\", totalTermCount);\n    LOG.info(\"Total token count: {}\", totalTokenCount);\n    this.termCountOnAllFields.set(totalTermCount);\n    this.tokenCountOnAllFields.set(totalTokenCount);\n\n    return rawCounts;\n  }", "docstring": "/**\n   * Loops through all segments, and for each field gets the average term/token count.\n   * Based on that, returns a map from each field to its term/token count (average per segment).\n   */", "url": "https://github.com/twitter/the-algorithm/blob/72eda9a24f815f6d566818cbf8518138e29d83e9/src/java/com/twitter/search/earlybird/util/TermCountMonitor.java#L238-L322", "sha": "72eda9a24f815f6d566818cbf8518138e29d83e9"}979{"repo_name": "timefold-solver", "dataset": "github_2023", "owner": "TimefoldAI", "lang": "java", "func_name": "PlannerBenchmarkFactory.createFromFreemarkerXmlResource", "code": "public static @NonNull PlannerBenchmarkFactory createFromFreemarkerXmlResource(@NonNull String templateResource) {\n        PlannerBenchmarkConfig benchmarkConfig = PlannerBenchmarkConfig.createFromFreemarkerXmlResource(templateResource);\n        return new DefaultPlannerBenchmarkFactory(benchmarkConfig);\n    }", "docstring": "/**\n     * Reads a Freemarker template from the classpath that generates an XML benchmark configuration\n     * and uses that {@link PlannerBenchmarkConfig} to build a {@link PlannerBenchmarkFactory}.\n     * The generated XML root element must be {@code <plannerBenchmark>}.\n     *\n     * @param templateResource a classpath resource as defined by {@link ClassLoader#getResource(String)}\n     * @see #createFromFreemarkerXmlResource(String)\n     */", "url": "https://github.com/TimefoldAI/timefold-solver/blob/f67c507a421ee113dd2e76f825480aa058b14767/benchmark/src/main/java/ai/timefold/solver/benchmark/api/PlannerBenchmarkFactory.java#L157-L160", "sha": "f67c507a421ee113dd2e76f825480aa058b14767"}980{"repo_name": "timefold-solver", "dataset": "github_2023", "owner": "TimefoldAI", "lang": "java", "func_name": "ProblemBenchmarkResult.registerProblemSizeStatistics", "code": "public void registerProblemSizeStatistics(ProblemSizeStatistics problemSizeStatistics) {\n        if (entityCount == null) {\n            entityCount = problemSizeStatistics.entityCount();\n        } else if (entityCount.longValue() != problemSizeStatistics.entityCount()) {\n            LOGGER.warn(\"The problemBenchmarkResult ({}) has different entityCount values ([{},{}]).\\n\"\n                    + \"This is normally impossible for 1 inputSolutionFile.\",\n                    getName(), entityCount, problemSizeStatistics.entityCount());\n            // The entityCount is not unknown (null), but known to be ambiguous\n            entityCount = -1L;\n        }\n        if (variableCount == null) {\n            variableCount = problemSizeStatistics.variableCount();\n        } else if (variableCount.longValue() != problemSizeStatistics.variableCount()) {\n            LOGGER.warn(\"The problemBenchmarkResult ({}) has different variableCount values ([{},{}]).\\n\"\n                    + \"This is normally impossible for 1 inputSolutionFile.\",\n                    getName(), variableCount, problemSizeStatistics.variableCount());\n            // The variableCount is not unknown (null), but known to be ambiguous\n            variableCount = -1L;\n        }\n        if (maximumValueCount == null) {\n            maximumValueCount = problemSizeStatistics.approximateValueCount();\n        } else if (maximumValueCount.longValue() != problemSizeStatistics.approximateValueCount()) {\n            LOGGER.warn(\"The problemBenchmarkResult ({}) has different approximateValueCount values ([{},{}]).\\n\"\n                    + \"This is normally impossible for 1 inputSolutionFile.\",\n                    getName(), maximumValueCount, problemSizeStatistics.approximateValueCount());\n            // The approximateValueCount is not unknown (null), but known to be ambiguous\n            maximumValueCount = -1L;\n        }\n        if (problemScale == null) {\n            problemScale = problemSizeStatistics.approximateProblemScaleLogAsFixedPointLong();\n        } else if (problemScale.longValue() != problemSizeStatistics.approximateProblemScaleLogAsFixedPointLong()) {\n            LOGGER.warn(\"The problemBenchmarkResult ({}) has different problemScale values ([{},{}]).\\n\"\n                    + \"This is normally impossible for 1 inputSolutionFile.\",\n                    getName(), problemScale, problemSizeStatistics.approximateProblemScaleLogAsFixedPointLong());\n            // The problemScale is not unknown (null), but known to be ambiguous\n            problemScale = -1L;\n        }\n    }", "docstring": "/**\n     * HACK to avoid loading the problem just to extract its problemScale.\n     * Called multiple times, for every {@link SingleBenchmarkResult} of this {@link ProblemBenchmarkResult}.\n     *\n     * @param problemSizeStatistics never null\n     */", "url": "https://github.com/TimefoldAI/timefold-solver/blob/f67c507a421ee113dd2e76f825480aa058b14767/benchmark/src/main/java/ai/timefold/solver/benchmark/impl/result/ProblemBenchmarkResult.java#L427-L464", "sha": "f67c507a421ee113dd2e76f825480aa058b14767"}981{"repo_name": "timefold-solver", "dataset": "github_2023", "owner": "TimefoldAI", "lang": "java", "func_name": "ConstraintCollectors.toMap", "code": "public static <A, B, Key, Value> @NonNull BiConstraintCollector<A, B, ?, Map<Key, Set<Value>>> toMap(\n            @NonNull BiFunction<? super A, ? super B, ? extends Key> keyMapper,\n            @NonNull BiFunction<? super A, ? super B, ? extends Value> valueMapper) {\n        return toMap(keyMapper, valueMapper, (IntFunction<Set<Value>>) LinkedHashSet::new);\n    }", "docstring": "/**\n     * As defined by {@link #toMap(Function, Function)}.\n     */", "url": "https://github.com/TimefoldAI/timefold-solver/blob/f67c507a421ee113dd2e76f825480aa058b14767/core/src/main/java/ai/timefold/solver/core/api/score/stream/ConstraintCollectors.java#L1418-L1422", "sha": "f67c507a421ee113dd2e76f825480aa058b14767"}982{"repo_name": "compass", "dataset": "github_2023", "owner": "cubefs", "lang": "java", "func_name": "JobServiceImpl.searchJobs", "code": "@Override\n    public JobsResponse searchJobs(JobsRequest request) throws Exception {\n        Map<String, Object> termQuery = request.getTermQuery();\n        Map<String, SortOrder> sort = request.getSortOrder();\n        Map<String, Object[]> rangeConditions = request.getRangeConditions();\n\n        SearchSourceBuilder builder = openSearchService.genSearchBuilder(termQuery, rangeConditions, sort, null);\n        Long count = openSearchService.count(builder, jobsIndex + \"-*\");\n        builder.from(request.getFrom()).size(request.getSize());\n\n        List<JobAnalysis> items = openSearchService.find(JobAnalysis.class, builder, jobsIndex + \"-*\");\n        List<JobInfo> jobInfos = items.stream().map(data -> JobInfo.from(data, redisService.get(String.format(\"%s:%s:%s\", data.getProjectName(), data.getFlowName(), data.getTaskName())))).collect(Collectors.toList());\n\n        JobsResponse response = new JobsResponse();\n        response.setJobInfos(jobInfos);\n        response.setCount(count);\n        return response;\n    }", "docstring": "/**\n     * Search jobs\n     */", "url": "https://github.com/cubefs/compass/blob/9d12a43fc9b5e41961f60643cf01f71f5679c5db/task-portal/src/main/java/com/oppo/cloud/portal/service/impl/JobServiceImpl.java#L90-L107", "sha": "9d12a43fc9b5e41961f60643cf01f71f5679c5db"}983{"repo_name": "crabc-api", "dataset": "github_2023", "owner": "pingapi", "lang": "java", "func_name": "SysUserController.register", "code": "@PostMapping(\"/register\")\n    public Result register(@RequestBody UserParam user){\n        String pwd = new String(Base64.decodeBase64(user.getPassword()), StandardCharsets.UTF_8);\n        String md5 = Md5Utils.hash(pwd).toUpperCase();\n        user.setPassword(md5);\n        BaseUser baseUser = new BaseUser();\n        BeanUtils.copyProperties(user, baseUser);\n        iBaseUserService.addUser(baseUser);\n        return Result.success();\n    }", "docstring": "/**\n     * ็”จๆˆทๆณจๅ†Œ\n     * @param user\n     * @return\n     */", "url": "https://github.com/pingapi/crabc-api/blob/bdc48ac634b72b849402fa367c1057d626d6f2e2/crabc-boot/crabc-core/src/main/java/cn/crabc/core/app/controller/SysUserController.java#L107-L116", "sha": "bdc48ac634b72b849402fa367c1057d626d6f2e2"}984{"repo_name": "YukeSeko-Interface", "dataset": "github_2023", "owner": "YukeSeko", "lang": "java", "func_name": "InterfaceChargingController.unlockAvailablePieces", "code": "@PostMapping(\"/unlockAvailablePieces\")\n    public BaseResponse unlockAvailablePieces(@RequestBody LockChargingVo lockChargingVo){\n        return interfaceChargingService.unlockAvailablePieces(lockChargingVo);\n    }", "docstring": "/**\n     * ่งฃ้”ๅบ“ๅญ˜\n     * @param lockChargingVo\n     * @return\n     */", "url": "https://github.com/YukeSeko/YukeSeko-Interface/blob/12f35f4828f2ed13edbc1ca004b2d71d427fcb49/api/src/main/java/com/wzy/api/controller/InterfaceChargingController.java#L26-L29", "sha": "12f35f4828f2ed13edbc1ca004b2d71d427fcb49"}985{"repo_name": "rule-engine-open", "dataset": "github_2023", "owner": "rule-engine", "lang": "java", "func_name": "PageUtils.defaultOrder", "code": "public static <T, R> void defaultOrder(List<PageRequest.OrderBy> orders, QueryWrapper<T> queryWrapper, SFunction<T, R> defaultColumnName) {\n        if (CollUtil.isEmpty(orders)) {\n            defaultOrderProcess(queryWrapper, defaultColumnName);\n            return;\n        }\n        orders.forEach(orderBy -> {\n            //้ป˜่ฎคๆ—ถ้—ดๅ€’ๅบ\n            if (StringUtils.EMPTY.equals(orderBy.getColumnName())) {\n                defaultOrderProcess(queryWrapper, defaultColumnName);\n            } else {\n                if (orderBy.isDesc()) {\n                    queryWrapper.orderByDesc(orderBy.getColumnName());\n                } else {\n                    queryWrapper.orderByAsc(orderBy.getColumnName());\n                }\n            }\n        });\n    }", "docstring": "/**\n     * ้ป˜่ฎคๆŽ’ๅบ,ๅฏไปฅๆŒ‡ๅฎš้ป˜่ฎคๆŽ’ๅบๅญ—ๆฎต\n     *\n     * @param orders            ๆŽ’ๅบๆกไปถ\n     * @param queryWrapper      ๆŸฅ่ฏขๆกไปถ\n     * @param defaultColumnName ๆŒ‡ๅฎš้ป˜่ฎคๆŽ’ๅบๅญ—ๆฎตๅˆ—\n     * @param <T>               T\n     */", "url": "https://github.com/rule-engine/rule-engine-open/blob/817661279c5c706a79ac461601c1f9c80742ac9d/rule-engine-open-web/src/main/java/cn/ruleengine/web/util/PageUtils.java#L152-L169", "sha": "817661279c5c706a79ac461601c1f9c80742ac9d"}986{"repo_name": "ginyi-spring-vue", "dataset": "github_2023", "owner": "Ginyi3705", "lang": "java", "func_name": "Convert.str", "code": "public static String str(Object obj, Charset charset) {\n        if (null == obj) {\n            return null;\n        }\n\n        if (obj instanceof String) {\n            return (String) obj;\n        } else if (obj instanceof byte[]) {\n            return str((byte[]) obj, charset);\n        } else if (obj instanceof Byte[]) {\n            byte[] bytes = ArrayUtils.toPrimitive((Byte[]) obj);\n            return str(bytes, charset);\n        } else if (obj instanceof ByteBuffer) {\n            return str((ByteBuffer) obj, charset);\n        }\n        return obj.toString();\n    }", "docstring": "/**\n     * ๅฐ†ๅฏน่ฑก่ฝฌไธบๅญ—็ฌฆไธฒ<br>\n     * 1ใ€Byteๆ•ฐ็ป„ๅ’ŒByteBufferไผš่ขซ่ฝฌๆขไธบๅฏนๅบ”ๅญ—็ฌฆไธฒ็š„ๆ•ฐ็ป„ 2ใ€ๅฏน่ฑกๆ•ฐ็ป„ไผš่ฐƒ็”จArrays.toStringๆ–นๆณ•\n     *\n     * @param obj     ๅฏน่ฑก\n     * @param charset ๅญ—็ฌฆ้›†\n     * @return ๅญ—็ฌฆไธฒ\n     */", "url": "https://github.com/Ginyi3705/ginyi-spring-vue/blob/6c07298cd34c75cc803a61af22a0af2ce6e7cf01/ginyi-springboot/ginyi-common/ginyi-common-utils/src/main/java/ginyi/common/utils/text/Convert.java#L152-L168", "sha": "6c07298cd34c75cc803a61af22a0af2ce6e7cf01"}987{"repo_name": "kronotop", "dataset": "github_2023", "owner": "kronotop", "lang": "java", "func_name": "KronotopInstance.getStatus", "code": "public KronotopInstanceStatus getStatus() {\n        return status;\n    }", "docstring": "/**\n     * Retrieves the status of the Kronotop instance.\n     *\n     * @return the status of the Kronotop instance.\n     */", "url": "https://github.com/kronotop/kronotop/blob/10b44c6dd4a39973beba45e0c2ccc73e88d21afa/kronotop/src/main/java/com/kronotop/instance/KronotopInstance.java#L322-L324", "sha": "10b44c6dd4a39973beba45e0c2ccc73e88d21afa"}988{"repo_name": "kronotop", "dataset": "github_2023", "owner": "kronotop", "lang": "java", "func_name": "RespResponse.writeInteger", "code": "@Override\n    public void writeInteger(long value) {\n        ctx.writeAndFlush(new IntegerRedisMessage(value));\n    }", "docstring": "/**\n     * Writes a long integer value as a Redis response message to the client.\n     *\n     * @param value the long integer value to be written\n     * @throws NullPointerException if the value is null\n     */", "url": "https://github.com/kronotop/kronotop/blob/10b44c6dd4a39973beba45e0c2ccc73e88d21afa/kronotop/src/main/java/com/kronotop/server/impl/RespResponse.java#L81-L84", "sha": "10b44c6dd4a39973beba45e0c2ccc73e88d21afa"}989{"repo_name": "kronotop", "dataset": "github_2023", "owner": "kronotop", "lang": "java", "func_name": "Watcher.watchKey", "code": "public Long watchKey(ChannelId channelId, String key) {\n        AtomicLong version = new AtomicLong();\n        watchedKeys.compute(key, (k, watchedKey) -> {\n            if (watchedKey == null) {\n                watchedKey = new WatchedKey();\n            }\n            version.set(watchedKey.getVersion());\n            watchedKey.getChannels().add(channelId);\n            return watchedKey;\n        });\n        return version.get();\n    }", "docstring": "/**\n     * Watches a key for changes and associates a given channelId with it.\n     *\n     * @param channelId The channelId to associate with the key\n     * @param key       The key to watch\n     * @return The version of the watched key\n     */", "url": "https://github.com/kronotop/kronotop/blob/10b44c6dd4a39973beba45e0c2ccc73e88d21afa/kronotop/src/main/java/com/kronotop/watcher/Watcher.java#L51-L62", "sha": "10b44c6dd4a39973beba45e0c2ccc73e88d21afa"}990{"repo_name": "kronotop", "dataset": "github_2023", "owner": "kronotop", "lang": "java", "func_name": "MigrateArgs.copy", "code": "public MigrateArgs<K> copy() {\n        this.copy = true;\n        return this;\n    }", "docstring": "/**\n     * Do not remove the key from the local instance by setting {@code COPY}.\n     *\n     * @return {@code this} {@link MigrateArgs}.\n     */", "url": "https://github.com/kronotop/kronotop/blob/10b44c6dd4a39973beba45e0c2ccc73e88d21afa/kronotop/src/test/java/com/kronotop/commandbuilder/redis/MigrateArgs.java#L51-L54", "sha": "10b44c6dd4a39973beba45e0c2ccc73e88d21afa"}991{"repo_name": "backend-tutorial", "dataset": "github_2023", "owner": "timerring", "lang": "java", "func_name": "Utility.readMenuSelection", "code": "public static char readMenuSelection() {\n        char c;\n        for (; ; ) {\n            String str = readKeyBoard(1, false);//ๅŒ…ๅซไธ€ไธชๅญ—็ฌฆ็š„ๅญ—็ฌฆไธฒ\n            c = str.charAt(0);//ๅฐ†ๅญ—็ฌฆไธฒ่ฝฌๆขๆˆๅญ—็ฌฆchar็ฑปๅž‹\n            if (c != '1' && c != '2' && \n                c != '3' && c != '4' && c != '5') {\n                System.out.print(\"้€‰ๆ‹ฉ้”™่ฏฏ๏ผŒ่ฏท้‡ๆ–ฐ่พ“ๅ…ฅ๏ผš\");\n            } else break;\n        }\n        return c;\n    }", "docstring": "/**\n     * ๅŠŸ่ƒฝ๏ผš่ฏปๅ–้”ฎ็›˜่พ“ๅ…ฅ็š„ไธ€ไธช่œๅ•้€‰้กน๏ผŒๅ€ผ๏ผš1โ€”โ€”5็š„่Œƒๅ›ด\n     * @return 1โ€”โ€”5\n     */", "url": "https://github.com/timerring/backend-tutorial/blob/75524f6ac554afe80f015163796026ed06e79aba/code/java-tutorial/chapter22/QQServer/src/com/hspedu/utils/Utility.java#L24-L35", "sha": "75524f6ac554afe80f015163796026ed06e79aba"}992{"repo_name": "backend-tutorial", "dataset": "github_2023", "owner": "timerring", "lang": "java", "func_name": "Utility.readMenuSelection", "code": "public static char readMenuSelection() {\n        char c;\n        for (; ; ) {\n            String str = readKeyBoard(1, false);//ๅŒ…ๅซไธ€ไธชๅญ—็ฌฆ็š„ๅญ—็ฌฆไธฒ\n            c = str.charAt(0);//ๅฐ†ๅญ—็ฌฆไธฒ่ฝฌๆขๆˆๅญ—็ฌฆchar็ฑปๅž‹\n            if (c != '1' && c != '2' && \n                c != '3' && c != '4' && c != '5') {\n                System.out.print(\"้€‰ๆ‹ฉ้”™่ฏฏ๏ผŒ่ฏท้‡ๆ–ฐ่พ“ๅ…ฅ๏ผš\");\n            } else break;\n        }\n        return c;\n    }", "docstring": "/**\n     * ๅŠŸ่ƒฝ๏ผš่ฏปๅ–้”ฎ็›˜่พ“ๅ…ฅ็š„ไธ€ไธช่œๅ•้€‰้กน๏ผŒๅ€ผ๏ผš1โ€”โ€”5็š„่Œƒๅ›ด\n     * @return 1โ€”โ€”5\n     */", "url": "https://github.com/timerring/backend-tutorial/blob/75524f6ac554afe80f015163796026ed06e79aba/code/java-tutorial/chapter26/mhl/src/com/hspedu/mhl/utils/Utility.java#L23-L34", "sha": "75524f6ac554afe80f015163796026ed06e79aba"}993{"repo_name": "openkoda", "dataset": "github_2023", "owner": "openkoda", "lang": "java", "func_name": "AuditChangeFactory.getDeleteChangeDescription", "code": "private String getDeleteChangeDescription(AuditableEntity p, String entityClass, StringBuilder change) {\n        debug(\"[getDeleteChangeDescription] entityClass: {}\", entityClass);\n        change.append(\"Deleted \").append(entityClass).append(\" \").append(p.toAuditString());\n        return change.toString();\n    }", "docstring": "/**\n     * Creates change log for object deleted.\n     */", "url": "https://github.com/openkoda/openkoda/blob/d86335959f5fb1da2fa58a9a5c7f02065d322975/openkoda/src/main/java/com/openkoda/core/audit/AuditChangeFactory.java#L90-L94", "sha": "d86335959f5fb1da2fa58a9a5c7f02065d322975"}994{"repo_name": "cloudSec", "dataset": "github_2023", "owner": "libaibaia", "lang": "java", "func_name": "Key.setName", "code": "public void setName(String name) {\n        this.name = name;\n    }", "docstring": "/**\n     * \n     */", "url": "https://github.com/libaibaia/cloudSec/blob/6bf12ac0d6428197d803efdcdb8e5bc18519dd9f/src/main/java/com/domain/Key.java#L301-L303", "sha": "6bf12ac0d6428197d803efdcdb8e5bc18519dd9f"}995{"repo_name": "cloudSec", "dataset": "github_2023", "owner": "libaibaia", "lang": "java", "func_name": "Menu.getTitle", "code": "public String getTitle() {\n        return title;\n    }", "docstring": "/**\n     * ๆ ‡้ข˜\n     */", "url": "https://github.com/libaibaia/cloudSec/blob/6bf12ac0d6428197d803efdcdb8e5bc18519dd9f/src/main/java/com/domain/Menu.java#L160-L162", "sha": "6bf12ac0d6428197d803efdcdb8e5bc18519dd9f"}996{"repo_name": "netdisk-fast-download", "dataset": "github_2023", "owner": "qaiu", "lang": "java", "func_name": "StringCase.toBigCamelCase", "code": "public static String toBigCamelCase(String str) {\n        return toCamelCase(str, true);\n    }", "docstring": "/**\n     * ๅฐ†ไธ‹ๅˆ’็บฟๆ–นๅผๅ‘ฝๅ็š„ๅญ—็ฌฆไธฒ่ฝฌๆขไธบๅคง้ฉผๅณฐๅผใ€‚ๅฆ‚ๆžœ่ฝฌๆขๅ‰็š„ไธ‹ๅˆ’็บฟๅคงๅ†™ๆ–นๅผๅ‘ฝๅ็š„ๅญ—็ฌฆไธฒไธบ็ฉบ๏ผŒๅˆ™่ฟ”ๅ›ž็ฉบๅญ—็ฌฆไธฒใ€‚<br>\n     * ไพ‹ๅฆ‚๏ผšhello_world=ใ€‹HelloWorld\n     *\n     * @param str ่ฝฌๆขๅ‰็š„ไธ‹ๅˆ’็บฟๅคงๅ†™ๆ–นๅผๅ‘ฝๅ็š„ๅญ—็ฌฆไธฒ\n     * @return ่ฝฌๆขๅŽ็š„้ฉผๅณฐๅผๅ‘ฝๅ็š„ๅญ—็ฌฆไธฒ\n     */", "url": "https://github.com/qaiu/netdisk-fast-download/blob/0637bcfd8ebe6c489726ddd500fdb0930ec7ec80/core/src/main/java/cn/qaiu/vx/core/util/StringCase.java#L73-L75", "sha": "0637bcfd8ebe6c489726ddd500fdb0930ec7ec80"}997{"repo_name": "abap-cleaner", "dataset": "github_2023", "owner": "SAP", "lang": "java", "func_name": "Command.isPragmaLine", "code": "public final boolean isPragmaLine() {\n\t\tif (!firstToken.isPragma())\n\t\t\treturn false;\n\t\t// starting from the second Token, check for pragmas and line breaks  \n\t\tToken token = firstToken.getNext();\n\t\twhile (token != null && token.isPragma() && token.lineBreaks == 0) {\n\t\t\ttoken = token.getNext();\n\t\t}\n\t\treturn (token == null || token.isComment());\n\t}", "docstring": "/**\n\t * returns true if the Command only consists of one line with one or several pragmas (and potentially a line-end comment) \n\t */", "url": "https://github.com/SAP/abap-cleaner/blob/718bd300b9997ed43f6e82c7a993bc3797ad24ea/com.sap.adt.abapcleaner/src/com/sap/adt/abapcleaner/parser/Command.java#L2815-L2824", "sha": "718bd300b9997ed43f6e82c7a993bc3797ad24ea"}998{"repo_name": "mMicroG", "dataset": "github_2023", "owner": "inotia00", "lang": "java", "func_name": "PeriodicTask.Builder.setService", "code": "public PeriodicTask.Builder setService(Class<? extends GcmTaskService> gcmTaskService) {\n            this.gcmTaskService = gcmTaskService.getName();\n            return this;\n        }", "docstring": "/**\n         * <p>Set whichever {@link com.google.android.gms.gcm.GcmTaskService} you implement to execute the logic for this task.</p>\n         *\n         * @param gcmTaskService Endpoint against which you're scheduling this task.\n         */", "url": "https://github.com/inotia00/mMicroG/blob/9067cd13a01d497f51bc5c896b7b33cc2f2032a5/play-services-gcm/src/main/java/com/google/android/gms/gcm/PeriodicTask.java#L202-L205", "sha": "9067cd13a01d497f51bc5c896b7b33cc2f2032a5"}999{"repo_name": "mMicroG", "dataset": "github_2023", "owner": "inotia00", "lang": "java", "func_name": "WifiScanner.isScanning", "code": "@RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)\n    public boolean isScanning() {\n        throw new UnsupportedOperationException();\n    }", "docstring": "/**\n     * Check whether the Wi-Fi subsystem has started a scan and is waiting for scan results.\n     *\n     * @return true if a scan initiated via\n     * {@link WifiScanner#startScan(ScanSettings, ScanListener)} or\n     * {@link WifiManager#startScan()} is in progress.\n     * false if there is currently no scanning initiated by {@link WifiScanner} or\n     * {@link WifiManager}, but it's still possible the wifi radio is scanning for\n     * another reason.\n     * @hide\n     */", "url": "https://github.com/inotia00/mMicroG/blob/9067cd13a01d497f51bc5c896b7b33cc2f2032a5/play-services-location/system-api/src/main/java/android/net/wifi/WifiScanner.java#L1171-L1174", "sha": "9067cd13a01d497f51bc5c896b7b33cc2f2032a5"}1000{"repo_name": "mMicroG", "dataset": "github_2023", "owner": "inotia00", "lang": "java", "func_name": "TileOverlayOptions.isVisible", "code": "public boolean isVisible() {\n        return visible;\n    }", "docstring": "/**\n     * Gets the visibility setting for this {@link TileOverlayOptions} object.\n     *\n     * @return {@code true} if the tile overlay is to be visible; {@code false} if it is not.\n     */", "url": "https://github.com/inotia00/mMicroG/blob/9067cd13a01d497f51bc5c896b7b33cc2f2032a5/play-services-maps/src/main/java/com/google/android/gms/maps/model/TileOverlayOptions.java#L97-L99", "sha": "9067cd13a01d497f51bc5c896b7b33cc2f2032a5"}1001{"repo_name": "langhaiblogs", "dataset": "github_2023", "owner": "Allenkuzma", "lang": "javascript", "func_name": "defaultLoading", "code": "function defaultLoading(api, opts) {\n      opts = opts || {};\n      defaults(opts, {\n        text: 'loading',\n        textColor: '#000',\n        fontSize: 12,\n        fontWeight: 'normal',\n        fontStyle: 'normal',\n        fontFamily: 'sans-serif',\n        maskColor: 'rgba(255, 255, 255, 0.8)',\n        showSpinner: true,\n        color: '#5470c6',\n        spinnerRadius: 10,\n        lineWidth: 5,\n        zlevel: 0\n      });\n      var group = new Group();\n      var mask = new Rect({\n        style: {\n          fill: opts.maskColor\n        },\n        zlevel: opts.zlevel,\n        z: 10000\n      });\n      group.add(mask);\n      var textContent = new ZRText({\n        style: {\n          text: opts.text,\n          fill: opts.textColor,\n          fontSize: opts.fontSize,\n          fontWeight: opts.fontWeight,\n          fontStyle: opts.fontStyle,\n          fontFamily: opts.fontFamily\n        },\n        zlevel: opts.zlevel,\n        z: 10001\n      });\n      var labelRect = new Rect({\n        style: {\n          fill: 'none'\n        },\n        textContent: textContent,\n        textConfig: {\n          position: 'right',\n          distance: 10\n        },\n        zlevel: opts.zlevel,\n        z: 10001\n      });\n      group.add(labelRect);\n      var arc;\n\n      if (opts.showSpinner) {\n        arc = new Arc({\n          shape: {\n            startAngle: -PI$3 / 2,\n            endAngle: -PI$3 / 2 + 0.1,\n            r: opts.spinnerRadius\n          },\n          style: {\n            stroke: opts.color,\n            lineCap: 'round',\n            lineWidth: opts.lineWidth\n          },\n          zlevel: opts.zlevel,\n          z: 10001\n        });\n        arc.animateShape(true).when(1000, {\n          endAngle: PI$3 * 3 / 2\n        }).start('circularInOut');\n        arc.animateShape(true).when(1000, {\n          startAngle: PI$3 * 3 / 2\n        }).delay(300).start('circularInOut');\n        group.add(arc);\n      } // Inject resize\n\n\n      group.resize = function () {\n        var textWidth = textContent.getBoundingRect().width;\n        var r = opts.showSpinner ? opts.spinnerRadius : 0; // cx = (containerWidth - arcDiameter - textDistance - textWidth) / 2\n        // textDistance needs to be calculated when both animation and text exist\n\n        var cx = (api.getWidth() - r * 2 - (opts.showSpinner && textWidth ? 10 : 0) - textWidth) / 2 - (opts.showSpinner && textWidth ? 0 : 5 + textWidth / 2) // only show the text\n        + (opts.showSpinner ? 0 : textWidth / 2) // only show the spinner\n        + (textWidth ? 0 : r);\n        var cy = api.getHeight() / 2;\n        opts.showSpinner && arc.setShape({\n          cx: cx,\n          cy: cy\n        });\n        labelRect.setShape({\n          x: cx - r,\n          y: cy - r,\n          width: r * 2,\n          height: r * 2\n        });\n        mask.setShape({\n          x: 0,\n          y: 0,\n          width: api.getWidth(),\n          height: api.getHeight()\n        });\n      };\n\n      group.resize();\n      return group;\n    }", "docstring": "/**\n     * @param {module:echarts/ExtensionAPI} api\n     * @param {Object} [opts]\n     * @param {string} [opts.text]\n     * @param {string} [opts.color]\n     * @param {string} [opts.textColor]\n     * @return {module:zrender/Element}\n     */", "url": "https://github.com/Allenkuzma/langhaiblogs/blob/a77bd2103800a65f11812b04afb506aeea9c9eae/src/main/resources/static/echarts/echarts.js#L25325-L25431", "sha": "a77bd2103800a65f11812b04afb506aeea9c9eae"}1002{"repo_name": "langhaiblogs", "dataset": "github_2023", "owner": "Allenkuzma", "lang": "javascript", "func_name": "radialCoordinate", "code": "function radialCoordinate(rad, r) {\n      rad -= Math.PI / 2;\n      return {\n        x: r * Math.cos(rad),\n        y: r * Math.sin(rad)\n      };\n    }", "docstring": "/**\n     * Transform the common coordinate to radial coordinate.\n     */", "url": "https://github.com/Allenkuzma/langhaiblogs/blob/a77bd2103800a65f11812b04afb506aeea9c9eae/src/main/resources/static/pear/component/pear/module/echarts.js#L54204-L54210", "sha": "a77bd2103800a65f11812b04afb506aeea9c9eae"}1003{"repo_name": "teddycloud", "dataset": "github_2023", "owner": "toniebox-reverse-engineering", "lang": "javascript", "func_name": "shouldUseClickEvent", "code": "function shouldUseClickEvent(elem) {\n    // Use the `click` event to detect changes to checkbox and radio inputs.\n    // This approach works across all browsers, whereas `change` does not fire\n    // until `blur` in IE8.\n    var nodeName = elem.nodeName;\n    return nodeName && nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');\n  }", "docstring": "/**\n   * SECTION: handle `click` event\n   */", "url": "https://github.com/toniebox-reverse-engineering/teddycloud/blob/83d3b29cbfc74e8f76f48f8782646c8e464055b2/contrib/data/www/library/react-dom.development.js#L9350-L9356", "sha": "83d3b29cbfc74e8f76f48f8782646c8e464055b2"}1004{"repo_name": "teddycloud", "dataset": "github_2023", "owner": "toniebox-reverse-engineering", "lang": "javascript", "func_name": "Component", "code": "function Component(props, context, updater) {\n    this.props = props;\n    this.context = context; // If a component has string refs, we will assign a different object later.\n\n    this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the\n    // renderer.\n\n    this.updater = updater || ReactNoopUpdateQueue;\n  }", "docstring": "/**\n   * Base class helpers for the updating state of a component.\n   */", "url": "https://github.com/toniebox-reverse-engineering/teddycloud/blob/83d3b29cbfc74e8f76f48f8782646c8e464055b2/contrib/data/www/library/react.development.js#L513-L521", "sha": "83d3b29cbfc74e8f76f48f8782646c8e464055b2"}1005{"repo_name": "praxis-ide", "dataset": "github_2023", "owner": "toblotron", "lang": "javascript", "func_name": "Var", "code": "function Var( id ) {\n\t\tthis.id = id;\n\t\tthis.ground = false;\n\t}", "docstring": "// PROLOG OBJECTS", "url": "https://github.com/toblotron/praxis-ide/blob/b4f732c28f0280ead015094bce893a378a28bec2/lib/tau-prolog.0.3.4.js#L1619-L1622", "sha": "b4f732c28f0280ead015094bce893a378a28bec2"}1006{"repo_name": "praxis-ide", "dataset": "github_2023", "owner": "toblotron", "lang": "javascript", "func_name": "buildTokenBadBidi", "code": "function buildTokenBadBidi(inner, order) {\n  return function (builder, text, style, startStyle, endStyle, title, css) {\n    style = style ? style + \" cm-force-border\" : \"cm-force-border\"\n    var start = builder.pos, end = start + text.length\n    for (;;) {\n      // Find the part that overlaps with the start of this text\n      var part = (void 0)\n      for (var i = 0; i < order.length; i++) {\n        part = order[i]\n        if (part.to > start && part.from <= start) { break }\n      }\n      if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, title, css) }\n      inner(builder, text.slice(0, part.to - start), style, startStyle, null, title, css)\n      startStyle = null\n      text = text.slice(part.to - start)\n      start = part.to\n    }\n  }\n}", "docstring": "// Work around nonsense dimensions being reported for stretches of", "url": "https://github.com/toblotron/praxis-ide/blob/b4f732c28f0280ead015094bce893a378a28bec2/lib/codemirror/lib/codemirror.js#L1949-L1967", "sha": "b4f732c28f0280ead015094bce893a378a28bec2"}1007{"repo_name": "praxis-ide", "dataset": "github_2023", "owner": "toblotron", "lang": "javascript", "func_name": "Fancytree", "code": "function Fancytree(widget) {\n\t\tthis.widget = widget;\n\t\tthis.$div = widget.element;\n\t\tthis.options = widget.options;\n\t\tif (this.options) {\n\t\t\tif (this.options.lazyload !== undefined) {\n\t\t\t\t$.error(\n\t\t\t\t\t\"The 'lazyload' event is deprecated since 2014-02-25. Use 'lazyLoad' (with uppercase L) instead.\"\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (this.options.loaderror !== undefined) {\n\t\t\t\t$.error(\n\t\t\t\t\t\"The 'loaderror' event was renamed since 2014-07-03. Use 'loadError' (with uppercase E) instead.\"\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (this.options.fx !== undefined) {\n\t\t\t\t$.error(\n\t\t\t\t\t\"The 'fx' option was replaced by 'toggleEffect' since 2014-11-30.\"\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (this.options.removeNode !== undefined) {\n\t\t\t\t$.error(\n\t\t\t\t\t\"The 'removeNode' event was replaced by 'modifyChild' since 2.20 (2016-09-10).\"\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tthis.ext = {}; // Active extension instances\n\t\tthis.types = {};\n\t\tthis.columns = {};\n\t\t// allow to init tree.data.foo from <div data-foo=''>\n\t\tthis.data = _getElementDataAsDict(this.$div);\n\t\t// TODO: use widget.uuid instead?\n\t\tthis._id = \"\" + (this.options.treeId || $.ui.fancytree._nextId++);\n\t\t// TODO: use widget.eventNamespace instead?\n\t\tthis._ns = \".fancytree-\" + this._id; // append for namespaced events\n\t\tthis.activeNode = null;\n\t\tthis.focusNode = null;\n\t\tthis._hasFocus = null;\n\t\tthis._tempCache = {};\n\t\tthis._lastMousedownNode = null;\n\t\tthis._enableUpdate = true;\n\t\tthis.lastSelectedNode = null;\n\t\tthis.systemFocusElement = null;\n\t\tthis.lastQuicksearchTerm = \"\";\n\t\tthis.lastQuicksearchTime = 0;\n\t\tthis.viewport = null; // ext-grid\n\n\t\tthis.statusClassPropName = \"span\";\n\t\tthis.ariaPropName = \"li\";\n\t\tthis.nodeContainerAttrName = \"li\";\n\n\t\t// Remove previous markup if any\n\t\tthis.$div.find(\">ul.fancytree-container\").remove();\n\n\t\t// Create a node without parent.\n\t\tvar fakeParent = { tree: this },\n\t\t\t$ul;\n\t\tthis.rootNode = new FancytreeNode(fakeParent, {\n\t\t\ttitle: \"root\",\n\t\t\tkey: \"root_\" + this._id,\n\t\t\tchildren: null,\n\t\t\texpanded: true,\n\t\t});\n\t\tthis.rootNode.parent = null;\n\n\t\t// Create root markup\n\t\t$ul = $(\"<ul>\", {\n\t\t\tid: \"ft-id-\" + this._id,\n\t\t\tclass: \"ui-fancytree fancytree-container fancytree-plain\",\n\t\t}).appendTo(this.$div);\n\t\tthis.$container = $ul;\n\t\tthis.rootNode.ul = $ul[0];\n\n\t\tif (this.options.debugLevel == null) {\n\t\t\tthis.options.debugLevel = FT.debugLevel;\n\t\t}\n\t\t// // Add container to the TAB chain\n\t\t// // See http://www.w3.org/TR/wai-aria-practices/#focus_activedescendant\n\t\t// // #577: Allow to set tabindex to \"0\", \"-1\" and \"\"\n\t\t// this.$container.attr(\"tabindex\", this.options.tabindex);\n\n\t\t// if( this.options.rtl ) {\n\t\t// \tthis.$container.attr(\"DIR\", \"RTL\").addClass(\"fancytree-rtl\");\n\t\t// // }else{\n\t\t// //\tthis.$container.attr(\"DIR\", null).removeClass(\"fancytree-rtl\");\n\t\t// }\n\t\t// if(this.options.aria){\n\t\t// \tthis.$container.attr(\"role\", \"tree\");\n\t\t// \tif( this.options.selectMode !== 1 ) {\n\t\t// \t\tthis.$container.attr(\"aria-multiselectable\", true);\n\t\t// \t}\n\t\t// }\n\t}", "docstring": "/******************************************************************************\n\t * Fancytree\n\t */", "url": "https://github.com/toblotron/praxis-ide/blob/b4f732c28f0280ead015094bce893a378a28bec2/lib/fancytree_dist/jquery.fancytree-all.js#L2632-L2724", "sha": "b4f732c28f0280ead015094bce893a378a28bec2"}1008{"repo_name": "KCloud-Platform-IoT", "dataset": "github_2023", "owner": "KouShenhai", "lang": "javascript", "func_name": "stretchSpansOverChange", "code": "function stretchSpansOverChange(doc, change) {\n  if (change.full) { return null }\n  var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n  var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n  if (!oldFirst && !oldLast) { return null }\n\n  var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n  // Get the spans that 'stick out' on both sides\n  var first = markedSpansBefore(oldFirst, startCh, isInsert);\n  var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n  // Next, merge those two ends\n  var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n  if (first) {\n    // Fix up .to properties of first\n    for (var i = 0; i < first.length; ++i) {\n      var span = first[i];\n      if (span.to == null) {\n        var found = getMarkedSpanFor(last, span.marker);\n        if (!found) { span.to = startCh; }\n        else if (sameLine) { span.to = found.to == null ? null : found.to + offset; }\n      }\n    }\n  }\n  if (last) {\n    // Fix up .from in last (or move them into first in case of sameLine)\n    for (var i$1 = 0; i$1 < last.length; ++i$1) {\n      var span$1 = last[i$1];\n      if (span$1.to != null) { span$1.to += offset; }\n      if (span$1.from == null) {\n        var found$1 = getMarkedSpanFor(first, span$1.marker);\n        if (!found$1) {\n          span$1.from = offset;\n          if (sameLine) { (first || (first = [])).push(span$1); }\n        }\n      } else {\n        span$1.from += offset;\n        if (sameLine) { (first || (first = [])).push(span$1); }\n      }\n    }\n  }\n  // Make sure we didn't create any zero-length spans\n  if (first) { first = clearEmptySpans(first); }\n  if (last && last != first) { last = clearEmptySpans(last); }\n\n  var newMarkers = [first];\n  if (!sameLine) {\n    // Fill gap with whole-line-spans\n    var gap = change.text.length - 2, gapMarkers;\n    if (gap > 0 && first)\n      { for (var i$2 = 0; i$2 < first.length; ++i$2)\n        { if (first[i$2].to == null)\n          { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } }\n    for (var i$3 = 0; i$3 < gap; ++i$3)\n      { newMarkers.push(gapMarkers); }\n    newMarkers.push(last);\n  }\n  return newMarkers\n}", "docstring": "// Given a change object, compute the new set of marker spans that", "url": "https://github.com/KouShenhai/KCloud-Platform-IoT/blob/d10ccb3e93bdec47d529e858ec31585d794700ab/laokou-cloud/laokou-nacos/src/main/resources/static/console-ui/public/js/codemirror.js#L607-L665", "sha": "d10ccb3e93bdec47d529e858ec31585d794700ab"}1009{"repo_name": "kurento", "dataset": "github_2023", "owner": "Kurento", "lang": "javascript", "func_name": "onerror", "code": "function onerror(error) {\n  if (error)\n    QUnit.pushFailure(error.message || error, error.stack);\n\n  QUnit.start();\n}", "docstring": "/**\n * Set an assert error and re-start the test so it can fail\n */", "url": "https://github.com/Kurento/kurento/blob/b04c741488b60a10692f08d01e87b8bb08ef0300/clients/javascript/client/test/_common.js", "sha": "b04c741488b60a10692f08d01e87b8bb08ef0300"}1010{"repo_name": "openvpn-ui", "dataset": "github_2023", "owner": "d3vilh", "lang": "javascript", "func_name": "isIndex", "code": "function isIndex(value, length) {\n  value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;\n  length = length == null ? MAX_SAFE_INTEGER : length;\n  return value > -1 && value % 1 == 0 && value < length;\n}", "docstring": "/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */", "url": "https://github.com/d3vilh/openvpn-ui/blob/690f84df426c13ad4742b61fd23e52fcdc489aa0/swagger/swagger-ui.js#L16318-L16322", "sha": "690f84df426c13ad4742b61fd23e52fcdc489aa0"}1011{"repo_name": "nix-installer-action", "dataset": "github_2023", "owner": "DeterminateSystems", "lang": "javascript", "func_name": "pipeResponseToStream", "code": "function pipeResponseToStream(response, output) {\n    return __awaiter(this, void 0, void 0, function* () {\n        const pipeline = util.promisify(stream.pipeline);\n        yield pipeline(response.message, output);\n    });\n}", "docstring": "/**\n * Pipes the body of a HTTP response to a stream\n *\n * @param response the HTTP response\n * @param output the writable stream\n */", "url": "https://github.com/DeterminateSystems/nix-installer-action/blob/a48face58194521af687ce7df4c802b1b558e743/dist/index.js#L814-L819", "sha": "a48face58194521af687ce7df4c802b1b558e743"}1012{"repo_name": "nix-installer-action", "dataset": "github_2023", "owner": "DeterminateSystems", "lang": "javascript", "func_name": "getOptions", "code": "function getOptions(copy) {\n    const result = {\n        followSymbolicLinks: true,\n        implicitDescendants: true,\n        omitBrokenSymbolicLinks: true\n    };\n    if (copy) {\n        if (typeof copy.followSymbolicLinks === 'boolean') {\n            result.followSymbolicLinks = copy.followSymbolicLinks;\n            core.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`);\n        }\n        if (typeof copy.implicitDescendants === 'boolean') {\n            result.implicitDescendants = copy.implicitDescendants;\n            core.debug(`implicitDescendants '${result.implicitDescendants}'`);\n        }\n        if (typeof copy.omitBrokenSymbolicLinks === 'boolean') {\n            result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks;\n            core.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`);\n        }\n    }\n    return result;\n}", "docstring": "/**\n * Returns a copy with defaults filled in.\n */", "url": "https://github.com/DeterminateSystems/nix-installer-action/blob/a48face58194521af687ce7df4c802b1b558e743/dist/index.js#L3570-L3591", "sha": "a48face58194521af687ce7df4c802b1b558e743"}1013{"repo_name": "nix-installer-action", "dataset": "github_2023", "owner": "DeterminateSystems", "lang": "javascript", "func_name": "HttpHeadersImpl.delete", "code": "delete(name) {\n        this._headersMap.delete(normalizeName(name));\n    }", "docstring": "/**\n     * Remove the header with the provided headerName.\n     * @param name - The name of the header to remove.\n     */", "url": "https://github.com/DeterminateSystems/nix-installer-action/blob/a48face58194521af687ce7df4c802b1b558e743/dist/index.js#L69795-L69797", "sha": "a48face58194521af687ce7df4c802b1b558e743"}1014{"repo_name": "nix-installer-action", "dataset": "github_2023", "owner": "DeterminateSystems", "lang": "javascript", "func_name": "defaultRetryPolicy", "code": "function defaultRetryPolicy(options = {}) {\n    var _a;\n    return {\n        name: exports.defaultRetryPolicyName,\n        sendRequest: (0, retryPolicy_js_1.retryPolicy)([(0, throttlingRetryStrategy_js_1.throttlingRetryStrategy)(), (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(options)], {\n            maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT,\n        }).sendRequest,\n    };\n}", "docstring": "/**\n * A policy that retries according to three strategies:\n * - When the server sends a 429 response with a Retry-After header.\n * - When there are errors in the underlying transport layer (e.g. DNS lookup failures).\n * - Or otherwise if the outgoing request fails, it will retry with an exponentially increasing delay.\n */", "url": "https://github.com/DeterminateSystems/nix-installer-action/blob/a48face58194521af687ce7df4c802b1b558e743/dist/index.js#L70980-L70988", "sha": "a48face58194521af687ce7df4c802b1b558e743"}1015{"repo_name": "nix-installer-action", "dataset": "github_2023", "owner": "DeterminateSystems", "lang": "javascript", "func_name": "tlsPolicy", "code": "function tlsPolicy(tlsSettings) {\n    return {\n        name: exports.tlsPolicyName,\n        sendRequest: async (req, next) => {\n            // Users may define a request tlsSettings, honor those over the client level one\n            if (!req.tlsSettings) {\n                req.tlsSettings = tlsSettings;\n            }\n            return next(req);\n        },\n    };\n}", "docstring": "/**\n * Gets a pipeline policy that adds the client certificate to the HttpClient agent for authentication.\n */", "url": "https://github.com/DeterminateSystems/nix-installer-action/blob/a48face58194521af687ce7df4c802b1b558e743/dist/index.js#L71836-L71847", "sha": "a48face58194521af687ce7df4c802b1b558e743"}1016{"repo_name": "nix-installer-action", "dataset": "github_2023", "owner": "DeterminateSystems", "lang": "javascript", "func_name": "assertBoundFunction", "code": "function assertBoundFunction(value, message) {\n    if (!isBoundFunction(value)) {\n        throw new TypeError(message ?? typeErrorMessage('Function', value));\n    }\n}", "docstring": "// eslint-disable-next-line @typescript-eslint/ban-types", "url": "https://github.com/DeterminateSystems/nix-installer-action/blob/a48face58194521af687ce7df4c802b1b558e743/dist/index.js#L76668-L76672", "sha": "a48face58194521af687ce7df4c802b1b558e743"}1017{"repo_name": "ComfyUI", "dataset": "github_2023", "owner": "comfyanonymous", "lang": "javascript", "func_name": "ScopeClass.update", "code": "update(captureContext) {\n    if (!captureContext) {\n      return this;\n    }\n    const scopeToMerge = typeof captureContext === \"function\" ? captureContext(this) : captureContext;\n    const [scopeInstance, requestSession] = scopeToMerge instanceof Scope ? (\n      // eslint-disable-next-line deprecation/deprecation\n      [scopeToMerge.getScopeData(), scopeToMerge.getRequestSession()]\n    ) : isPlainObject$5(scopeToMerge) ? [captureContext, captureContext.requestSession] : [];\n    const { tags, extra, user, contexts, level, fingerprint = [], propagationContext } = scopeInstance || {};\n    this._tags = { ...this._tags, ...tags };\n    this._extra = { ...this._extra, ...extra };\n    this._contexts = { ...this._contexts, ...contexts };\n    if (user && Object.keys(user).length) {\n      this._user = user;\n    }\n    if (level) {\n      this._level = level;\n    }\n    if (fingerprint.length) {\n      this._fingerprint = fingerprint;\n    }\n    if (propagationContext) {\n      this._propagationContext = propagationContext;\n    }\n    if (requestSession) {\n      this._requestSession = requestSession;\n    }\n    return this;\n  }", "docstring": "/**\n   * @inheritDoc\n   */", "url": "https://github.com/comfyanonymous/ComfyUI/blob/af93c8d1ee4be91f30ffd395ea6919e6f83923aa/web/assets/index-DqqhYDnY.js#L7979-L8008", "sha": "af93c8d1ee4be91f30ffd395ea6919e6f83923aa"}1018{"repo_name": "Digital-IDE", "dataset": "github_2023", "owner": "Digital-EDA", "lang": "javascript", "func_name": "renderWaveDrom", "code": "function renderWaveDrom(id, json, style) {\n    const skin = selectSkin(style);\n    const renderObj = renderAny(id, json, skin);\n    let svgString = onmlStringify(renderObj);\n    \n    // TODO: more elegant ? ่ฟ™้‡Œๆ˜ฏไธบไบ†่งฃๅ†ณ้ป‘่‰ฒๆจกๅผไธ‹้ƒจๅˆ† rect ไป็„ถๆ˜ฏ็™ฝ่‰ฒ่ƒŒๆ™ฏ\n    svgString = replaceRectsWithCustomString(svgString, style);\n\n    return svgString;\n}", "docstring": "/**\n * \n * @param {number} id \n * @param {any} json \n * @param {'dark' | 'light'} style\n * @returns {string}\n */", "url": "https://github.com/Digital-EDA/Digital-IDE/blob/2f90a87a1c9df236ee621e586d8e56ac0e7aaa57/resources/wavedrom/index.js#L34-L43", "sha": "2f90a87a1c9df236ee621e586d8e56ac0e7aaa57"}1019{"repo_name": "beginner-series", "dataset": "github_2023", "owner": "dotnet", "lang": "javascript", "func_name": "computeStyleTests", "code": "function computeStyleTests() {\n\n\t\t// This is a singleton, we need to execute it only once\n\t\tif ( !div ) {\n\t\t\treturn;\n\t\t}\n\n\t\tcontainer.style.cssText = \"position:absolute;left:-11111px;width:60px;\" +\n\t\t\t\"margin-top:1px;padding:0;border:0\";\n\t\tdiv.style.cssText =\n\t\t\t\"position:relative;display:block;box-sizing:border-box;overflow:scroll;\" +\n\t\t\t\"margin:auto;border:1px;padding:1px;\" +\n\t\t\t\"width:60%;top:1%\";\n\t\tdocumentElement.appendChild( container ).appendChild( div );\n\n\t\tvar divStyle = window.getComputedStyle( div );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\n\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\treliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;\n\n\t\t// Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3\n\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\tdiv.style.right = \"60%\";\n\t\tpixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;\n\n\t\t// Support: IE 9 - 11 only\n\t\t// Detect misreporting of content dimensions for box-sizing:border-box elements\n\t\tboxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;\n\n\t\t// Support: IE 9 only\n\t\t// Detect overflow:scroll screwiness (gh-3699)\n\t\t// Support: Chrome <=64\n\t\t// Don't get tricked when zoom affects offsetWidth (gh-4029)\n\t\tdiv.style.position = \"absolute\";\n\t\tscrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;\n\n\t\tdocumentElement.removeChild( container );\n\n\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t// it will also be a sign that checks already performed\n\t\tdiv = null;\n\t}", "docstring": "// Executing both pixelPosition & boxSizingReliable tests require only one layout", "url": "https://github.com/dotnet/beginner-series/blob/7094e2e5eed96c5a26d7aeef240a95f35201c063/Visual Studio/sample-code/RazorPagesCupcakes/wwwroot/lib/jquery/dist/jquery.js#L6439-L6481", "sha": "7094e2e5eed96c5a26d7aeef240a95f35201c063"}1020{"repo_name": "t3d.js", "dataset": "github_2023", "owner": "uinosoft", "lang": "javascript", "func_name": "DynamicFont.dispose", "code": "dispose() {\n\t\tthis._fontAtlas.clear();\n\t\tthis._font.chars.length = 0;\n\t}", "docstring": "/**\n\t * Dispose the font data and atlas.\n\t */", "url": "https://github.com/uinosoft/t3d.js/blob/b746a7f5c17a58c6711fe8ce71788301ad474363/examples/jsm/DynamicFont.js#L91-L94", "sha": "b746a7f5c17a58c6711fe8ce71788301ad474363"}1021{"repo_name": "t3d.js", "dataset": "github_2023", "owner": "uinosoft", "lang": "javascript", "func_name": "GLTFExporter.parse", "code": "parse(input, onDone, onError, options) {\n\t\tconst writer = new GLTFWriter();\n\n\t\tconst plugins = this.extensions.map(_ext => new _ext(writer));\n\n\t\twriter.setPlugins(plugins);\n\n\t\twriter.dracoOptions = this.dracoOptions;\n\t\twriter.setDRACOExporter(this._dracoExporter);\n\n\t\twriter.writeAsync(input, onDone, options).catch(onError);\n\t}", "docstring": "/**\n\t * Parse input root object(s) and generate GLTF output\n\t * @param {Object3D or [Object3D]} input root object(s)\n\t * @param {Function} onDone Callback on completed\n\t * @param {Function} onError Callback on errors\n\t * @param {Object} options options\n\t */", "url": "https://github.com/uinosoft/t3d.js/blob/b746a7f5c17a58c6711fe8ce71788301ad474363/examples/jsm/exporters/GLTFExporter.js#L60-L71", "sha": "b746a7f5c17a58c6711fe8ce71788301ad474363"}1022{"repo_name": "t3d.js", "dataset": "github_2023", "owner": "uinosoft", "lang": "javascript", "func_name": "RenderStates.updateCamera", "code": "updateCamera(camera) {\n\t\tconst sceneData = this.scene;\n\t\tconst cameraData = this.camera;\n\t\tconst projectionMatrix = camera.projectionMatrix;\n\n\t\tlet cameraNear = 0, cameraFar = 0;\n\t\tif (_isPerspectiveMatrix(projectionMatrix)) {\n\t\t\tcameraNear = projectionMatrix.elements[14] / (projectionMatrix.elements[10] - 1);\n\t\t\tcameraFar = projectionMatrix.elements[14] / (projectionMatrix.elements[10] + 1);\n\t\t} else {\n\t\t\tcameraNear = (projectionMatrix.elements[14] + 1) / projectionMatrix.elements[10];\n\t\t\tcameraFar = (projectionMatrix.elements[14] - 1) / projectionMatrix.elements[10];\n\t\t}\n\n\t\tcameraData.near = cameraNear;\n\t\tcameraData.far = cameraFar;\n\n\t\tif (sceneData.logarithmicDepthBuffer) {\n\t\t\tcameraData.logDepthCameraNear = cameraNear;\n\t\t\tcameraData.logDepthBufFC = 2.0 / (Math.log(cameraFar - cameraNear + 1.0) * Math.LOG2E);\n\t\t} else {\n\t\t\tcameraData.logDepthCameraNear = 0;\n\t\t\tcameraData.logDepthBufFC = 0;\n\t\t}\n\n\t\tcameraData.position.setFromMatrixPosition(camera.worldMatrix);\n\t\tif (sceneData.useAnchorMatrix) {\n\t\t\tcameraData.position.applyMatrix4(sceneData.anchorMatrixInverse);\n\t\t}\n\n\t\tcameraData.viewMatrix.copy(camera.viewMatrix);\n\t\tif (sceneData.useAnchorMatrix) {\n\t\t\tcameraData.viewMatrix.multiply(sceneData.anchorMatrix);\n\t\t}\n\n\t\tcameraData.projectionMatrix.copy(projectionMatrix);\n\t\tcameraData.projectionViewMatrix.copy(projectionMatrix).multiply(cameraData.viewMatrix);\n\n\t\tcameraData.rect.copy(camera.rect);\n\n\t\tcameraData.version++;\n\n\t\tthis.gammaFactor = camera.gammaFactor;\n\t\tthis.outputEncoding = camera.outputEncoding;\n\t}", "docstring": "/**\n\t * Update render states about camera.\n\t * @param {t3d.Camera}\n\t */", "url": "https://github.com/uinosoft/t3d.js/blob/b746a7f5c17a58c6711fe8ce71788301ad474363/src/render/RenderStates.js#L44-L88", "sha": "b746a7f5c17a58c6711fe8ce71788301ad474363"}1023{"repo_name": "t3d.js", "dataset": "github_2023", "owner": "uinosoft", "lang": "javascript", "func_name": "ThinRenderer.updateRenderTargetMipmap", "code": "updateRenderTargetMipmap(renderTarget) {}", "docstring": "/**\n\t * Reads the pixel data from the current render target into the provided buffer.\n\t * The Renderer.asyncReadPixel property determines whether this operation is synchronous or asynchronous.\n\t * To maintain consistency, this method always returns a Promise object.\n\t * @param {Number} x - The x coordinate of the rectangle to read from.\n\t * @param {Number} y - The y coordinate of the rectangle to read from.\n\t * @param {Number} width - The width of the rectangle to read from.\n\t * @param {Number} height - The height of the rectangle to read from.\n\t * @param {TypedArray} buffer Uint8Array is the only destination type supported in all cases, other types are renderTarget and platform dependent.\n\t * @return {Promise<TypedArray>} A promise that resolves with the passed in buffer after it has been filled with the pixel data.\n\t */", "url": "https://github.com/uinosoft/t3d.js/blob/b746a7f5c17a58c6711fe8ce71788301ad474363/src/render/ThinRenderer.js#L191-L191", "sha": "b746a7f5c17a58c6711fe8ce71788301ad474363"}1024{"repo_name": "node-sandbox", "dataset": "github_2023", "owner": "bnmgh1", "lang": "javascript", "func_name": "random", "code": "function random(sd) {\n    var d, e, k, n,\n      i = 0,\n      r = new this(1),\n      rd = [];\n\n    if (sd === void 0) sd = this.precision;\n    else checkInt32(sd, 1, MAX_DIGITS);\n\n    k = Math.ceil(sd / LOG_BASE);\n\n    if (!this.crypto) {\n      for (; i < k;) rd[i++] = Math.random() * 1e7 | 0;\n\n    // Browsers supporting crypto.getRandomValues.\n    } else if (crypto.getRandomValues) {\n      d = crypto.getRandomValues(new Uint32Array(k));\n\n      for (; i < k;) {\n        n = d[i];\n\n        // 0 <= n < 4294967296\n        // Probability n >= 4.29e9, is 4967296 / 4294967296 = 0.00116 (1 in 865).\n        if (n >= 4.29e9) {\n          d[i] = crypto.getRandomValues(new Uint32Array(1))[0];\n        } else {\n\n          // 0 <= n <= 4289999999\n          // 0 <= (n % 1e7) <= 9999999\n          rd[i++] = n % 1e7;\n        }\n      }\n\n    // Node.js supporting crypto.randomBytes.\n    } else if (crypto.randomBytes) {\n\n      // buffer\n      d = crypto.randomBytes(k *= 4);\n\n      for (; i < k;) {\n\n        // 0 <= n < 2147483648\n        n = d[i] + (d[i + 1] << 8) + (d[i + 2] << 16) + ((d[i + 3] & 0x7f) << 24);\n\n        // Probability n >= 2.14e9, is 7483648 / 2147483648 = 0.0035 (1 in 286).\n        if (n >= 2.14e9) {\n          crypto.randomBytes(4).copy(d, i);\n        } else {\n\n          // 0 <= n <= 2139999999\n          // 0 <= (n % 1e7) <= 9999999\n          rd.push(n % 1e7);\n          i += 4;\n        }\n      }\n\n      i = k / 4;\n    } else {\n      throw Error(cryptoUnavailable);\n    }\n\n    k = rd[--i];\n    sd %= LOG_BASE;\n\n    // Convert trailing digits to zeros according to sd.\n    if (k && sd) {\n      n = mathpow(10, LOG_BASE - sd);\n      rd[i] = (k / n | 0) * n;\n    }\n\n    // Remove trailing words which are zero.\n    for (; rd[i] === 0; i--) rd.pop();\n\n    // Zero?\n    if (i < 0) {\n      e = 0;\n      rd = [0];\n    } else {\n      e = -1;\n\n      // Remove leading words which are zero and adjust exponent accordingly.\n      for (; rd[0] === 0; e -= LOG_BASE) rd.shift();\n\n      // Count the digits of the first word of rd to determine leading zeros.\n      for (k = 1, n = rd[0]; n >= 10; n /= 10) k++;\n\n      // Adjust the exponent for leading zeros of the first word of rd.\n      if (k < LOG_BASE) e -= LOG_BASE - k;\n    }\n\n    r.e = e;\n    r.d = rd;\n\n    return r;\n  }", "docstring": "/*\n   * Returns a new Decimal with a random value equal to or greater than 0 and less than 1, and with\n   * `sd`, or `Decimal.precision` if `sd` is omitted, significant digits (or less if trailing zeros\n   * are produced).\n   *\n   * [sd] {number} Significant digits. Integer, 0 to MAX_DIGITS inclusive.\n   *\n   */", "url": "https://github.com/bnmgh1/node-sandbox/blob/e39d2a8e5ca530039e03055f94199f22c3248b0a/node_modules/decimal.js/decimal.js#L4659-L4753", "sha": "e39d2a8e5ca530039e03055f94199f22c3248b0a"}1025{"repo_name": "node-sandbox", "dataset": "github_2023", "owner": "bnmgh1", "lang": "javascript", "func_name": "SelectionImpl.anchorNode", "code": "get anchorNode() {\n    const anchor = this._anchor;\n    return anchor ? anchor.node : null;\n  }", "docstring": "// https://w3c.github.io/selection-api/#dom-selection-anchornode", "url": "https://github.com/bnmgh1/node-sandbox/blob/e39d2a8e5ca530039e03055f94199f22c3248b0a/node_modules/jsdom/lib/jsdom/living/selection/Selection-impl.js#L32-L35", "sha": "e39d2a8e5ca530039e03055f94199f22c3248b0a"}1026{"repo_name": "node-sandbox", "dataset": "github_2023", "owner": "bnmgh1", "lang": "javascript", "func_name": "_unmask", "code": "function _unmask(buffer, mask) {\n  for (let i = 0; i < buffer.length; i++) {\n    buffer[i] ^= mask[i & 3];\n  }\n}", "docstring": "/**\n * Unmasks a buffer using the given mask.\n *\n * @param {Buffer} buffer The buffer to unmask\n * @param {Buffer} mask The mask to use\n * @public\n */", "url": "https://github.com/bnmgh1/node-sandbox/blob/e39d2a8e5ca530039e03055f94199f22c3248b0a/node_modules/ws/lib/buffer-util.js#L58-L62", "sha": "e39d2a8e5ca530039e03055f94199f22c3248b0a"}1027{"repo_name": "Full-Stack-Web-Development-Bootcamp-Course", "dataset": "github_2023", "owner": "tweneboah", "lang": "javascript", "func_name": "createStrictSyntaxError", "code": "function createStrictSyntaxError (str, char) {\n  var index = str.indexOf(char)\n  var partial = index !== -1\n    ? str.substring(0, index) + '#'\n    : ''\n\n  try {\n    JSON.parse(partial); /* istanbul ignore next */ throw new SyntaxError('strict violation')\n  } catch (e) {\n    return normalizeJsonSyntaxError(e, {\n      message: e.message.replace('#', char),\n      stack: e.stack\n    })\n  }\n}", "docstring": "/**\n * Create strict violation syntax error matching native error.\n *\n * @param {string} str\n * @param {string} char\n * @return {Error}\n * @private\n */", "url": "https://github.com/tweneboah/Full-Stack-Web-Development-Bootcamp-Course/blob/6880262d9aa3d9e22e2a7910d7b7e727de75f590/6.EXPRESS-JS/File-Uploads2/1.Images-Upload/node_modules/body-parser/lib/types/json.js#L153-L167", "sha": "6880262d9aa3d9e22e2a7910d7b7e727de75f590"}1028{"repo_name": "Full-Stack-Web-Development-Bootcamp-Course", "dataset": "github_2023", "owner": "tweneboah", "lang": "javascript", "func_name": "mapCacheHas", "code": "function mapCacheHas(key) {\n  return getMapData(this, key).has(key);\n}", "docstring": "/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */", "url": "https://github.com/tweneboah/Full-Stack-Web-Development-Bootcamp-Course/blob/6880262d9aa3d9e22e2a7910d7b7e727de75f590/6.EXPRESS-JS/File-Uploads2/1.Images-Upload/node_modules/cloudinary-core/cloudinary-core-shrinkwrap.js#L3540-L3542", "sha": "6880262d9aa3d9e22e2a7910d7b7e727de75f590"}1029{"repo_name": "Full-Stack-Web-Development-Bootcamp-Course", "dataset": "github_2023", "owner": "tweneboah", "lang": "javascript", "func_name": "sourcetag_typeof", "code": "function sourcetag_typeof(obj) { \"@babel/helpers - typeof\"; return sourcetag_typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, sourcetag_typeof(obj); }", "docstring": "// CONCATENATED MODULE: ./src/tags/sourcetag.js", "url": "https://github.com/tweneboah/Full-Stack-Web-Development-Bootcamp-Course/blob/6880262d9aa3d9e22e2a7910d7b7e727de75f590/6.EXPRESS-JS/File-Uploads2/1.Images-Upload/node_modules/cloudinary-core/cloudinary-core-shrinkwrap.js#L11348-L11348", "sha": "6880262d9aa3d9e22e2a7910d7b7e727de75f590"}1030{"repo_name": "Full-Stack-Web-Development-Bootcamp-Course", "dataset": "github_2023", "owner": "tweneboah", "lang": "javascript", "func_name": "lazyClone", "code": "function lazyClone() {\n  var result = new LazyWrapper(this.__wrapped__);\n  result.__actions__ = copyArray(this.__actions__);\n  result.__dir__ = this.__dir__;\n  result.__filtered__ = this.__filtered__;\n  result.__iteratees__ = copyArray(this.__iteratees__);\n  result.__takeCount__ = this.__takeCount__;\n  result.__views__ = copyArray(this.__views__);\n  return result;\n}", "docstring": "/**\n * Creates a clone of the lazy wrapper object.\n *\n * @private\n * @name clone\n * @memberOf LazyWrapper\n * @returns {Object} Returns the cloned `LazyWrapper` object.\n */", "url": "https://github.com/tweneboah/Full-Stack-Web-Development-Bootcamp-Course/blob/6880262d9aa3d9e22e2a7910d7b7e727de75f590/6.EXPRESS-JS/File-Uploads2/1.Images-Upload/node_modules/lodash/_lazyClone.js#L12-L21", "sha": "6880262d9aa3d9e22e2a7910d7b7e727de75f590"}1031{"repo_name": "Full-Stack-Web-Development-Bootcamp-Course", "dataset": "github_2023", "owner": "tweneboah", "lang": "javascript", "func_name": "baseLt", "code": "function baseLt(value, other) {\n      return value < other;\n    }", "docstring": "/**\n     * The base implementation of `_.lt` which doesn't coerce arguments.\n     *\n     * @private\n     * @param {*} value The value to compare.\n     * @param {*} other The other value to compare.\n     * @returns {boolean} Returns `true` if `value` is less than `other`,\n     *  else `false`.\n     */", "url": "https://github.com/tweneboah/Full-Stack-Web-Development-Bootcamp-Course/blob/6880262d9aa3d9e22e2a7910d7b7e727de75f590/6.EXPRESS-JS/File-Uploads2/1.Images-Upload/node_modules/lodash/lodash.js#L3568-L3570", "sha": "6880262d9aa3d9e22e2a7910d7b7e727de75f590"}1032{"repo_name": "Full-Stack-Web-Development-Bootcamp-Course", "dataset": "github_2023", "owner": "tweneboah", "lang": "javascript", "func_name": "status", "code": "function status (code) {\n  if (typeof code === 'number') {\n    return getStatusMessage(code)\n  }\n\n  if (typeof code !== 'string') {\n    throw new TypeError('code must be a number or string')\n  }\n\n  // '403'\n  var n = parseInt(code, 10)\n  if (!isNaN(n)) {\n    return getStatusMessage(n)\n  }\n\n  return getStatusCode(code)\n}", "docstring": "/**\n * Get the status code.\n *\n * Given a number, this will throw if it is not a known status\n * code, otherwise the code will be returned. Given a string,\n * the string will be parsed for a number and return the code\n * if valid, otherwise will lookup the code assuming this is\n * the status message.\n *\n * @param {string|number} code\n * @returns {number}\n * @public\n */", "url": "https://github.com/tweneboah/Full-Stack-Web-Development-Bootcamp-Course/blob/6880262d9aa3d9e22e2a7910d7b7e727de75f590/6.EXPRESS-JS/File-Uploads2/1.Images-Upload/node_modules/statuses/index.js#L130-L146", "sha": "6880262d9aa3d9e22e2a7910d7b7e727de75f590"}1033{"repo_name": "Full-Stack-Web-Development-Bootcamp-Course", "dataset": "github_2023", "owner": "tweneboah", "lang": "javascript", "func_name": "useColors", "code": "function useColors() {\n  // NB: In an Electron preload script, document will be defined but not fully\n  // initialized. Since we know we're in Chrome, we'll just detect this case\n  // explicitly\n  if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {\n    return true;\n  }\n\n  // is webkit? http://stackoverflow.com/a/16459606/376773\n  // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n  return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n    // is firebug? http://stackoverflow.com/a/398120/376773\n    (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n    // is firefox >= v31?\n    // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n    (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n    // double check webkit in userAgent just in case we are in a worker\n    (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}", "docstring": "/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */", "url": "https://github.com/tweneboah/Full-Stack-Web-Development-Bootcamp-Course/blob/6880262d9aa3d9e22e2a7910d7b7e727de75f590/PROJECTS/AI-PROJECTS/DALLE-3-IMAGE-GENERATOR/backend/node_modules/debug/src/browser.js#L39-L57", "sha": "6880262d9aa3d9e22e2a7910d7b7e727de75f590"}1034{"repo_name": "Full-Stack-Web-Development-Bootcamp-Course", "dataset": "github_2023", "owner": "tweneboah", "lang": "javascript", "func_name": "baseXor", "code": "function baseXor(arrays, iteratee, comparator) {\n  var length = arrays.length;\n  if (length < 2) {\n    return length ? baseUniq(arrays[0]) : [];\n  }\n  var index = -1,\n      result = Array(length);\n\n  while (++index < length) {\n    var array = arrays[index],\n        othIndex = -1;\n\n    while (++othIndex < length) {\n      if (othIndex != index) {\n        result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);\n      }\n    }\n  }\n  return baseUniq(baseFlatten(result, 1), iteratee, comparator);\n}", "docstring": "/**\n * The base implementation of methods like `_.xor`, without support for\n * iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of values.\n */", "url": "https://github.com/tweneboah/Full-Stack-Web-Development-Bootcamp-Course/blob/6880262d9aa3d9e22e2a7910d7b7e727de75f590/PROJECTS/AI-PROJECTS/DALLE-3-IMAGE-GENERATOR/backend/node_modules/lodash/_baseXor.js#L15-L34", "sha": "6880262d9aa3d9e22e2a7910d7b7e727de75f590"}1035{"repo_name": "Full-Stack-Web-Development-Bootcamp-Course", "dataset": "github_2023", "owner": "tweneboah", "lang": "javascript", "func_name": "createCurry", "code": "function createCurry(func, bitmask, arity) {\n  var Ctor = createCtor(func);\n\n  function wrapper() {\n    var length = arguments.length,\n        args = Array(length),\n        index = length,\n        placeholder = getHolder(wrapper);\n\n    while (index--) {\n      args[index] = arguments[index];\n    }\n    var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)\n      ? []\n      : replaceHolders(args, placeholder);\n\n    length -= holders.length;\n    if (length < arity) {\n      return createRecurry(\n        func, bitmask, createHybrid, wrapper.placeholder, undefined,\n        args, holders, undefined, undefined, arity - length);\n    }\n    var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n    return apply(fn, this, args);\n  }\n  return wrapper;\n}", "docstring": "/**\n * Creates a function that wraps `func` to enable currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {number} arity The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */", "url": "https://github.com/tweneboah/Full-Stack-Web-Development-Bootcamp-Course/blob/6880262d9aa3d9e22e2a7910d7b7e727de75f590/PROJECTS/AI-PROJECTS/DALLE-3-IMAGE-GENERATOR/backend/node_modules/lodash/_createCurry.js#L18-L44", "sha": "6880262d9aa3d9e22e2a7910d7b7e727de75f590"}1036{"repo_name": "Full-Stack-Web-Development-Bootcamp-Course", "dataset": "github_2023", "owner": "tweneboah", "lang": "javascript", "func_name": "Collection.namespace", "code": "get namespace() {\n        return this.fullNamespace.toString();\n    }", "docstring": "/**\n     * The namespace of this collection, in the format `${this.dbName}.${this.collectionName}`\n     */", "url": "https://github.com/tweneboah/Full-Stack-Web-Development-Bootcamp-Course/blob/6880262d9aa3d9e22e2a7910d7b7e727de75f590/PROJECTS/AI-PROJECTS/DALLE-3-IMAGE-GENERATOR/backend/node_modules/mongodb/lib/collection.js#L95-L97", "sha": "6880262d9aa3d9e22e2a7910d7b7e727de75f590"}1037{"repo_name": "Full-Stack-Web-Development-Bootcamp-Course", "dataset": "github_2023", "owner": "tweneboah", "lang": "javascript", "func_name": "ServerSession.hasTimedOut", "code": "hasTimedOut(sessionTimeoutMinutes) {\n        // Take the difference of the lastUse timestamp and now, which will result in a value in\n        // milliseconds, and then convert milliseconds to minutes to compare to `sessionTimeoutMinutes`\n        const idleTimeMinutes = Math.round((((0, utils_1.calculateDurationInMs)(this.lastUse) % 86400000) % 3600000) / 60000);\n        return idleTimeMinutes > sessionTimeoutMinutes - 1;\n    }", "docstring": "/**\n     * Determines if the server session has timed out.\n     *\n     * @param sessionTimeoutMinutes - The server's \"logicalSessionTimeoutMinutes\"\n     */", "url": "https://github.com/tweneboah/Full-Stack-Web-Development-Bootcamp-Course/blob/6880262d9aa3d9e22e2a7910d7b7e727de75f590/PROJECTS/AI-PROJECTS/DALLE-3-IMAGE-GENERATOR/backend/node_modules/mongodb/lib/sessions.js#L555-L560", "sha": "6880262d9aa3d9e22e2a7910d7b7e727de75f590"}1038{"repo_name": "Full-Stack-Web-Development-Bootcamp-Course", "dataset": "github_2023", "owner": "tweneboah", "lang": "javascript", "func_name": "checkCharacter", "code": "function checkCharacter(inputChar, targetChar) {\n    if (inputChar !== targetChar) {\n      errors++;\n      //play error sound\n      new Audio(\"/error.mp3\").play();\n      return false;\n    } else {\n      return true;\n    }\n  }", "docstring": "//Function to check typed character", "url": "https://github.com/tweneboah/Full-Stack-Web-Development-Bootcamp-Course/blob/6880262d9aa3d9e22e2a7910d7b7e727de75f590/PROJECTS/Typing-test-project-final/script.js#L46-L55", "sha": "6880262d9aa3d9e22e2a7910d7b7e727de75f590"}1039{"repo_name": "mox", "dataset": "github_2023", "owner": "mjl-", "lang": "javascript", "func_name": "Client.DNSBLStatus", "code": "async DNSBLStatus() {\n\t\t\tconst fn = \"DNSBLStatus\";\n\t\t\tconst paramTypes = [];\n\t\t\tconst returnTypes = [[\"{}\", \"{}\", \"string\"], [\"[]\", \"Domain\"], [\"[]\", \"Domain\"]];\n\t\t\tconst params = [];\n\t\t\treturn await _sherpaCall(this.baseURL, this.authState, { ...this.options }, paramTypes, returnTypes, fn, params);\n\t\t}", "docstring": "// TLSRPTSummaries returns a summary of received TLS reports overlapping with", "url": "https://github.com/mjl-/mox/blob/93b627ceab9b90cb3669d0adc5d6dc208181fc7a/webadmin/admin.js#L714-L720", "sha": "93b627ceab9b90cb3669d0adc5d6dc208181fc7a"}1040{"repo_name": "JS-Tap", "dataset": "github_2023", "owner": "hoodoer", "lang": "javascript", "func_name": "innerMode", "code": "function innerMode(mode, state) {\n    var info;\n    while (mode.innerMode) {\n      info = mode.innerMode(state);\n      if (!info || info.mode == mode) { break }\n      state = info.state;\n      mode = info.mode;\n    }\n    return info || {mode: mode, state: state}\n  }", "docstring": "// Given a mode and a state (for that mode), find the inner mode and", "url": "https://github.com/hoodoer/JS-Tap/blob/13e455a3c5c101cac6a573677bf173b6eacc0fa4/static/node_modules/codemirror/addon/runmode/runmode-standalone.js#L208-L217", "sha": "13e455a3c5c101cac6a573677bf173b6eacc0fa4"}1041{"repo_name": "JS-Tap", "dataset": "github_2023", "owner": "hoodoer", "lang": "javascript", "func_name": "drawSelectionCursor", "code": "function drawSelectionCursor(cm, head, output) {\n    var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n    var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n    cursor.style.left = pos.left + \"px\";\n    cursor.style.top = pos.top + \"px\";\n    cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n    if (/\\bcm-fat-cursor\\b/.test(cm.getWrapperElement().className)) {\n      var charPos = charCoords(cm, head, \"div\", null, null);\n      var width = charPos.right - charPos.left;\n      cursor.style.width = (width > 0 ? width : cm.defaultCharWidth()) + \"px\";\n    }\n\n    if (pos.other) {\n      // Secondary cursor, shown when on a 'jump' in bi-directional text\n      var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n      otherCursor.style.display = \"\";\n      otherCursor.style.left = pos.other.left + \"px\";\n      otherCursor.style.top = pos.other.top + \"px\";\n      otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n    }\n  }", "docstring": "// Draws a cursor for the given range", "url": "https://github.com/hoodoer/JS-Tap/blob/13e455a3c5c101cac6a573677bf173b6eacc0fa4/static/node_modules/codemirror/lib/codemirror.js#L3192-L3214", "sha": "13e455a3c5c101cac6a573677bf173b6eacc0fa4"}1042{"repo_name": "JS-Tap", "dataset": "github_2023", "owner": "hoodoer", "lang": "javascript", "func_name": "Command.requiredOption", "code": "requiredOption(flags, description, fn, defaultValue) {\n    return this._optionEx({ mandatory: true }, flags, description, fn, defaultValue);\n  }", "docstring": "/**\n  * Add a required option which must have a value after parsing. This usually means\n  * the option must be specified on the command line. (Otherwise the same as .option().)\n  *\n  * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space.\n  *\n  * @param {string} flags\n  * @param {string} [description]\n  * @param {Function|*} [fn] - custom option processing function or default value\n  * @param {*} [defaultValue]\n  * @return {Command} `this` command for chaining\n  */", "url": "https://github.com/hoodoer/JS-Tap/blob/13e455a3c5c101cac6a573677bf173b6eacc0fa4/static/node_modules/commander/lib/command.js#L674-L676", "sha": "13e455a3c5c101cac6a573677bf173b6eacc0fa4"}1043{"repo_name": "webgpu-devtools", "dataset": "github_2023", "owner": "takahirox", "lang": "javascript", "func_name": "paddingTop", "code": "function paddingTop(display) {return display.lineSpace.offsetTop}", "docstring": "// POSITION MEASUREMENT", "url": "https://github.com/takahirox/webgpu-devtools/blob/cd7b11a54ee23df592347153d523da885e9bc975/extensions/panel.js#L2320-L2320", "sha": "cd7b11a54ee23df592347153d523da885e9bc975"}1044{"repo_name": "android-qinglong", "dataset": "github_2023", "owner": "FuShengPing", "lang": "javascript", "func_name": "visualLineContinued", "code": "function visualLineContinued(line) {\n    var merged, lines;\n    while (merged = collapsedSpanAtEnd(line)) {\n      line = merged.find(1, true).line\n      ;(lines || (lines = [])).push(line);\n    }\n    return lines\n  }", "docstring": "// Returns an array of logical lines that continue the visual line", "url": "https://github.com/FuShengPing/android-qinglong/blob/f1e50c9279ed7081f6dcd882accdbb525e5ed5fc/app/src/main/assets/web/editor/codemirror.js#L1572-L1579", "sha": "f1e50c9279ed7081f6dcd882accdbb525e5ed5fc"}1045{"repo_name": "CreArts-Obsidian-Vault", "dataset": "github_2023", "owner": "CreArts-Community", "lang": "javascript", "func_name": "Duration.reconfigure", "code": "reconfigure({ locale, numberingSystem, conversionAccuracy, matrix } = {}) {\n    const loc = this.loc.clone({ locale, numberingSystem });\n    const opts = { loc, matrix, conversionAccuracy };\n    return clone$1(this, opts);\n  }", "docstring": "/**\n   * \"Set\" the locale and/or numberingSystem.  Returns a newly-constructed Duration.\n   * @example dur.reconfigure({ locale: 'en-GB' })\n   * @return {Duration}\n   */", "url": "https://github.com/CreArts-Community/CreArts-Obsidian-Vault/blob/5092f39680b1a13289962114f9d38622fe652551/.obsidian/plugins/dataview/main.js#L3195-L3199", "sha": "5092f39680b1a13289962114f9d38622fe652551"}1046{"repo_name": "CreArts-Obsidian-Vault", "dataset": "github_2023", "owner": "CreArts-Community", "lang": "javascript", "func_name": "Duration.shiftToAll", "code": "shiftToAll() {\n    if (!this.isValid) return this;\n    return this.shiftTo(\n      \"years\",\n      \"months\",\n      \"weeks\",\n      \"days\",\n      \"hours\",\n      \"minutes\",\n      \"seconds\",\n      \"milliseconds\"\n    );\n  }", "docstring": "/**\n   * Shift this Duration to all available units.\n   * Same as shiftTo(\"years\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", \"seconds\", \"milliseconds\")\n   * @return {Duration}\n   */", "url": "https://github.com/CreArts-Community/CreArts-Obsidian-Vault/blob/5092f39680b1a13289962114f9d38622fe652551/.obsidian/plugins/dataview/main.js#L3306-L3318", "sha": "5092f39680b1a13289962114f9d38622fe652551"}1047{"repo_name": "CreArts-Obsidian-Vault", "dataset": "github_2023", "owner": "CreArts-Community", "lang": "javascript", "func_name": "DateTime.second", "code": "get second() {\n    return this.isValid ? this.c.second : NaN;\n  }", "docstring": "/**\n   * Get the hour of the day (0-23).\n   * @example DateTime.local(2017, 5, 25, 9).hour //=> 9\n   * @type {number}\n   */", "url": "https://github.com/CreArts-Community/CreArts-Obsidian-Vault/blob/5092f39680b1a13289962114f9d38622fe652551/.obsidian/plugins/dataview/main.js#L6023-L6025", "sha": "5092f39680b1a13289962114f9d38622fe652551"}1048{"repo_name": "CreArts-Obsidian-Vault", "dataset": "github_2023", "owner": "CreArts-Community", "lang": "javascript", "func_name": "DateTime.until", "code": "until(otherDateTime) {\n    return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this;\n  }", "docstring": "/**\n   * Returns a JavaScript object with this DateTime's year, month, day, and so on.\n   * @param opts - options for generating the object\n   * @param {boolean} [opts.includeConfig=false] - include configuration attributes in the output\n   * @example DateTime.now().toObject() //=> { year: 2017, month: 4, day: 22, hour: 20, minute: 49, second: 42, millisecond: 268 }\n   * @return {Object}\n   */", "url": "https://github.com/CreArts-Community/CreArts-Obsidian-Vault/blob/5092f39680b1a13289962114f9d38622fe652551/.obsidian/plugins/dataview/main.js#L6839-L6841", "sha": "5092f39680b1a13289962114f9d38622fe652551"}1049{"repo_name": "CreArts-Obsidian-Vault", "dataset": "github_2023", "owner": "CreArts-Community", "lang": "javascript", "func_name": "InlineWidget.toDOM", "code": "toDOM(view) {\n        this.el.addClasses(this.cssClasses);\n        return this.el;\n    }", "docstring": "// to prevent redraws when the editor updates.", "url": "https://github.com/CreArts-Community/CreArts-Obsidian-Vault/blob/5092f39680b1a13289962114f9d38622fe652551/.obsidian/plugins/dataview/main.js#L19172-L19175", "sha": "5092f39680b1a13289962114f9d38622fe652551"}1050{"repo_name": "CreArts-Obsidian-Vault", "dataset": "github_2023", "owner": "CreArts-Community", "lang": "javascript", "func_name": "compileGeneralSelector", "code": "function compileGeneralSelector(next, selector, options, context, compileToken) {\n    var adapter = options.adapter, equals = options.equals;\n    switch (selector.type) {\n        case css_what_1.SelectorType.PseudoElement: {\n            throw new Error(\"Pseudo-elements are not supported by css-select\");\n        }\n        case css_what_1.SelectorType.ColumnCombinator: {\n            throw new Error(\"Column combinators are not yet supported by css-select\");\n        }\n        case css_what_1.SelectorType.Attribute: {\n            if (selector.namespace != null) {\n                throw new Error(\"Namespaced attributes are not yet supported by css-select\");\n            }\n            if (!options.xmlMode || options.lowerCaseAttributeNames) {\n                selector.name = selector.name.toLowerCase();\n            }\n            return attributes.attributeRules[selector.action](next, selector, options);\n        }\n        case css_what_1.SelectorType.Pseudo: {\n            return (0, pseudoSelectors.compilePseudoSelector)(next, selector, options, context, compileToken);\n        }\n        // Tags\n        case css_what_1.SelectorType.Tag: {\n            if (selector.namespace != null) {\n                throw new Error(\"Namespaced tag names are not yet supported by css-select\");\n            }\n            var name_1 = selector.name;\n            if (!options.xmlMode || options.lowerCaseTags) {\n                name_1 = name_1.toLowerCase();\n            }\n            return function tag(elem) {\n                return adapter.getName(elem) === name_1 && next(elem);\n            };\n        }\n        // Traversal\n        case css_what_1.SelectorType.Descendant: {\n            if (options.cacheResults === false ||\n                typeof WeakSet === \"undefined\") {\n                return function descendant(elem) {\n                    var current = elem;\n                    while ((current = getElementParent(current, adapter))) {\n                        if (next(current)) {\n                            return true;\n                        }\n                    }\n                    return false;\n                };\n            }\n            // @ts-expect-error `ElementNode` is not extending object\n            var isFalseCache_1 = new WeakSet();\n            return function cachedDescendant(elem) {\n                var current = elem;\n                while ((current = getElementParent(current, adapter))) {\n                    if (!isFalseCache_1.has(current)) {\n                        if (adapter.isTag(current) && next(current)) {\n                            return true;\n                        }\n                        isFalseCache_1.add(current);\n                    }\n                }\n                return false;\n            };\n        }\n        case \"_flexibleDescendant\": {\n            // Include element itself, only used while querying an array\n            return function flexibleDescendant(elem) {\n                var current = elem;\n                do {\n                    if (next(current))\n                        return true;\n                } while ((current = getElementParent(current, adapter)));\n                return false;\n            };\n        }\n        case css_what_1.SelectorType.Parent: {\n            return function parent(elem) {\n                return adapter\n                    .getChildren(elem)\n                    .some(function (elem) { return adapter.isTag(elem) && next(elem); });\n            };\n        }\n        case css_what_1.SelectorType.Child: {\n            return function child(elem) {\n                var parent = adapter.getParent(elem);\n                return parent != null && adapter.isTag(parent) && next(parent);\n            };\n        }\n        case css_what_1.SelectorType.Sibling: {\n            return function sibling(elem) {\n                var siblings = adapter.getSiblings(elem);\n                for (var i = 0; i < siblings.length; i++) {\n                    var currentSibling = siblings[i];\n                    if (equals(elem, currentSibling))\n                        break;\n                    if (adapter.isTag(currentSibling) && next(currentSibling)) {\n                        return true;\n                    }\n                }\n                return false;\n            };\n        }\n        case css_what_1.SelectorType.Adjacent: {\n            if (adapter.prevElementSibling) {\n                return function adjacent(elem) {\n                    var previous = adapter.prevElementSibling(elem);\n                    return previous != null && next(previous);\n                };\n            }\n            return function adjacent(elem) {\n                var siblings = adapter.getSiblings(elem);\n                var lastElement;\n                for (var i = 0; i < siblings.length; i++) {\n                    var currentSibling = siblings[i];\n                    if (equals(elem, currentSibling))\n                        break;\n                    if (adapter.isTag(currentSibling)) {\n                        lastElement = currentSibling;\n                    }\n                }\n                return !!lastElement && next(lastElement);\n            };\n        }\n        case css_what_1.SelectorType.Universal: {\n            if (selector.namespace != null && selector.namespace !== \"*\") {\n                throw new Error(\"Namespaced universal selectors are not yet supported by css-select\");\n            }\n            return next;\n        }\n    }\n}", "docstring": "/*\n * All available rules\n */", "url": "https://github.com/CreArts-Community/CreArts-Obsidian-Vault/blob/5092f39680b1a13289962114f9d38622fe652551/.obsidian/plugins/simple-embeds/main.js#L6158-L6287", "sha": "5092f39680b1a13289962114f9d38622fe652551"}1051{"repo_name": "setup-micromamba", "dataset": "github_2023", "owner": "mamba-org", "lang": "javascript", "func_name": "isBlob", "code": "function isBlob(x) {\n  return typeof x.stream === \"function\";\n}", "docstring": "// node_modules/.pnpm/@azure+core-rest-pipeline@1.18.1/node_modules/@azure/core-rest-pipeline/dist/esm/util/typeGuards.js", "url": "https://github.com/mamba-org/setup-micromamba/blob/59bcdbae779c639f869cc8e3b223f36692af05c2/dist/post.js#L25942-L25944", "sha": "59bcdbae779c639f869cc8e3b223f36692af05c2"}1052{"repo_name": "embyExternalUrl", "dataset": "github_2023", "owner": "bpking1", "lang": "javascript", "func_name": "getDisableDocs", "code": "function getDisableDocs(r) {\n  const value = nginxConfig.disableDocs \n    && !ngx.shared[\"tmpDict\"].get(\"opendocs\");\n  // r.log(`getDisableDocs: ${value}`);\n  return value;\n}", "docstring": "// for js_set", "url": "https://github.com/bpking1/embyExternalUrl/blob/da18efe0009453c5ae198fc3cf44b84c6ee965f5/emby2Alist/nginx/conf.d/config/constant-nginx.js#L11-L16", "sha": "da18efe0009453c5ae198fc3cf44b84c6ee965f5"}1053{"repo_name": "chartello", "dataset": "github_2023", "owner": "chartello", "lang": "javascript", "func_name": "checkOffset", "code": "function checkOffset (offset, ext, length) {\n  if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n  if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}", "docstring": "/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */", "url": "https://github.com/chartello/chartello/blob/755b5ecf6094619da88ebe2e3e35a852de528036/public/js/app.js#L23686-L23689", "sha": "755b5ecf6094619da88ebe2e3e35a852de528036"}1054{"repo_name": "iMES-Factory", "dataset": "github_2023", "owner": "zmrid", "lang": "javascript", "func_name": "toType", "code": "function toType(obj) {\n    return {}.toString.call(obj).match(/\\s([a-z]+)/i)[1].toLowerCase();\n  }", "docstring": "// Shoutout AngusCroll (https://goo.gl/pxwQGp)", "url": "https://github.com/zmrid/iMES-Factory/blob/d301552bd0e953882ea0b2162c0e17b36dd3a2a9/iMES.Net/iMES.WebApi/wwwroot/lib/bootstrap/dist/js/bootstrap.bundle.js#L86-L88", "sha": "d301552bd0e953882ea0b2162c0e17b36dd3a2a9"}1055{"repo_name": "iMES-Factory", "dataset": "github_2023", "owner": "zmrid", "lang": "javascript", "func_name": "get", "code": "function get (url, param, loading, config) {\n    showLoading(loading);\n    axios.defaults.headers[_Authorization] = getToken();\n    return new Promise((resolve, reject) => {\n        axios.get(url, config)\n            .then(response => {\n                resolve(response.data)\n            }, err => {\n                reject(err)\n            })\n            .catch((error) => {\n                reject(error)\n            })\n    })\n}", "docstring": "//=trueๅผ‚ๆญฅ่ฏทๆฑ‚ๆ—ถไผšๆ˜พ็คบ้ฎ็ฝฉๅฑ‚,=ๅญ—็ฌฆไธฒ๏ผŒๅผ‚ๆญฅ่ฏทๆฑ‚ๆ—ถ้ฎ็ฝฉๅฑ‚ๆ˜พ็คบๅฝ“ๅ‰ๅญ—็ฌฆไธฒ", "url": "https://github.com/zmrid/iMES-Factory/blob/d301552bd0e953882ea0b2162c0e17b36dd3a2a9/iMES.Vue3/src/api/http.js#L138-L152", "sha": "d301552bd0e953882ea0b2162c0e17b36dd3a2a9"}1056{"repo_name": "3x-ui", "dataset": "github_2023", "owner": "MHSanaei", "lang": "javascript", "func_name": "includes", "code": "function includes(collection, value, fromIndex, guard) {\n      collection = isArrayLike(collection) ? collection : values(collection);\n      fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;\n\n      var length = collection.length;\n      if (fromIndex < 0) {\n        fromIndex = nativeMax(length + fromIndex, 0);\n      }\n      return isString(collection)\n        ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)\n        : (!!length && baseIndexOf(collection, value, fromIndex) > -1);\n    }", "docstring": "/**\n     * Checks if `value` is in `collection`. If `collection` is a string, it's\n     * checked for a substring of `value`, otherwise\n     * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n     * is used for equality comparisons. If `fromIndex` is negative, it's used as\n     * the offset from the end of `collection`.\n     *\n     * @static\n     * @memberOf _\n     * @since 0.1.0\n     * @category Collection\n     * @param {Array|Object|string} collection The collection to inspect.\n     * @param {*} value The value to search for.\n     * @param {number} [fromIndex=0] The index to search from.\n     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n     * @returns {boolean} Returns `true` if `value` is found, else `false`.\n     * @example\n     *\n     * _.includes([1, 2, 3], 1);\n     * // => true\n     *\n     * _.includes([1, 2, 3], 1, 2);\n     * // => false\n     *\n     * _.includes({ 'a': 1, 'b': 2 }, 1);\n     * // => true\n     *\n     * _.includes('abcd', 'bc');\n     * // => true\n     */", "url": "https://github.com/MHSanaei/3x-ui/blob/49bfff9fa5a6acb50c8f51710a3e4005daf0ca32/web/assets/codemirror/jshint.js#L10885-L10896", "sha": "49bfff9fa5a6acb50c8f51710a3e4005daf0ca32"}1057{"repo_name": "3x-ui", "dataset": "github_2023", "owner": "MHSanaei", "lang": "javascript", "func_name": "isValidArrayIndex", "code": "function isValidArrayIndex(val) {\n    const n = parseFloat(String(val));\n    return n >= 0 && Math.floor(n) === n && isFinite(val);\n}", "docstring": "/**\n * Check if val is a valid array index.\n */", "url": "https://github.com/MHSanaei/3x-ui/blob/49bfff9fa5a6acb50c8f51710a3e4005daf0ca32/web/assets/vue/vue.common.dev.js#L65-L68", "sha": "49bfff9fa5a6acb50c8f51710a3e4005daf0ca32"}1058{"repo_name": "3x-ui", "dataset": "github_2023", "owner": "MHSanaei", "lang": "javascript", "func_name": "defineReactive", "code": "function defineReactive(obj, key, val, customSetter, shallow, mock, observeEvenIfShallow = false) {\n    const dep = new Dep();\n    const property = Object.getOwnPropertyDescriptor(obj, key);\n    if (property && property.configurable === false) {\n        return;\n    }\n    // cater for pre-defined getter/setters\n    const getter = property && property.get;\n    const setter = property && property.set;\n    if ((!getter || setter) &&\n        (val === NO_INITIAL_VALUE || arguments.length === 2)) {\n        val = obj[key];\n    }\n    let childOb = shallow ? val && val.__ob__ : observe(val, false, mock);\n    Object.defineProperty(obj, key, {\n        enumerable: true,\n        configurable: true,\n        get: function reactiveGetter() {\n            const value = getter ? getter.call(obj) : val;\n            if (Dep.target) {\n                {\n                    dep.depend({\n                        target: obj,\n                        type: \"get\" /* TrackOpTypes.GET */,\n                        key\n                    });\n                }\n                if (childOb) {\n                    childOb.dep.depend();\n                    if (isArray(value)) {\n                        dependArray(value);\n                    }\n                }\n            }\n            return isRef(value) && !shallow ? value.value : value;\n        },\n        set: function reactiveSetter(newVal) {\n            const value = getter ? getter.call(obj) : val;\n            if (!hasChanged(value, newVal)) {\n                return;\n            }\n            if (customSetter) {\n                customSetter();\n            }\n            if (setter) {\n                setter.call(obj, newVal);\n            }\n            else if (getter) {\n                // #7981: for accessor properties without setter\n                return;\n            }\n            else if (!shallow && isRef(value) && !isRef(newVal)) {\n                value.value = newVal;\n                return;\n            }\n            else {\n                val = newVal;\n            }\n            childOb = shallow ? newVal && newVal.__ob__ : observe(newVal, false, mock);\n            {\n                dep.notify({\n                    type: \"set\" /* TriggerOpTypes.SET */,\n                    target: obj,\n                    key,\n                    newValue: newVal,\n                    oldValue: value\n                });\n            }\n        }\n    });\n    return dep;\n}", "docstring": "/**\n * Define a reactive property on an Object.\n */", "url": "https://github.com/MHSanaei/3x-ui/blob/49bfff9fa5a6acb50c8f51710a3e4005daf0ca32/web/assets/vue/vue.common.dev.js#L940-L1011", "sha": "49bfff9fa5a6acb50c8f51710a3e4005daf0ca32"}1059{"repo_name": "3x-ui", "dataset": "github_2023", "owner": "MHSanaei", "lang": "javascript", "func_name": "processSlotOutlet", "code": "function processSlotOutlet(el) {\n      if (el.tag === 'slot') {\n          el.slotName = getBindingAttr(el, 'name');\n          if (el.key) {\n              warn(\"`key` does not work on <slot> because slots are abstract outlets \" +\n                  \"and can possibly expand into multiple elements. \" +\n                  \"Use the key on a wrapping element instead.\", getRawBindingAttr(el, 'key'));\n          }\n      }\n  }", "docstring": "// handle <slot/> outlets", "url": "https://github.com/MHSanaei/3x-ui/blob/49bfff9fa5a6acb50c8f51710a3e4005daf0ca32/web/assets/vue/vue.js#L10389-L10398", "sha": "49bfff9fa5a6acb50c8f51710a3e4005daf0ca32"}1060{"repo_name": "an-codeAI", "dataset": "github_2023", "owner": "sparrow-js", "lang": "javascript", "func_name": "fileFlagLocal2Remote", "code": "function fileFlagLocal2Remote(flag) {\n    return {\n        type: SpecialArgType.FILEFLAG,\n        flagStr: flag.getFlagString()\n    };\n}", "docstring": "/**\n * @hidden\n */", "url": "https://github.com/sparrow-js/an-codeAI/blob/a6184f39fb36ad9cda9857f45a1226acc3cdd0b9/public/static/browserfs11/browserfs.js#L10937-L10942", "sha": "a6184f39fb36ad9cda9857f45a1226acc3cdd0b9"}1061{"repo_name": "an-codeAI", "dataset": "github_2023", "owner": "sparrow-js", "lang": "javascript", "func_name": "conditionalGroup", "code": "function conditionalGroup(states, opts) {\n    return group(states[0], Object.assign({}, opts, {\n      expandedStates: states\n    }));\n  }", "docstring": "/**\n   * @param {Doc[]} states\n   * @param {object} [opts] - TBD ???\n   * @returns Doc\n   */", "url": "https://github.com/sparrow-js/an-codeAI/blob/a6184f39fb36ad9cda9857f45a1226acc3cdd0b9/public/static/js/prettier/2.0.5/standalone.js#L14038-L14042", "sha": "a6184f39fb36ad9cda9857f45a1226acc3cdd0b9"}1062{"repo_name": "projectshut", "dataset": "github_2023", "owner": "priyankarpal", "lang": "javascript", "func_name": "RegExpRoute.constructor", "code": "constructor(regExp, handler, method) {\n        {\n          finalAssertExports.isInstance(regExp, RegExp, {\n            moduleName: 'workbox-routing',\n            className: 'RegExpRoute',\n            funcName: 'constructor',\n            paramName: 'pattern'\n          });\n        }\n        const match = ({\n          url\n        }) => {\n          const result = regExp.exec(url.href);\n          // Return immediately if there's no match.\n          if (!result) {\n            return;\n          }\n          // Require that the match start at the first character in the URL string\n          // if it's a cross-origin request.\n          // See https://github.com/GoogleChrome/workbox/issues/281 for the context\n          // behind this behavior.\n          if (url.origin !== location.origin && result.index !== 0) {\n            {\n              logger.debug(`The regular expression '${regExp.toString()}' only partially matched ` + `against the cross-origin URL '${url.toString()}'. RegExpRoute's will only ` + `handle cross-origin requests if they match the entire URL.`);\n            }\n            return;\n          }\n          // If the route matches, but there aren't any capture groups defined, then\n          // this will return [], which is truthy and therefore sufficient to\n          // indicate a match.\n          // If there are capture groups, then it will return their values.\n          return result.slice(1);\n        };\n        super(match, handler, method);\n      }", "docstring": "/**\n       * If the regular expression contains\n       * [capture groups]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#grouping-back-references},\n       * the captured values will be passed to the\n       * {@link workbox-routing~handlerCallback} `params`\n       * argument.\n       *\n       * @param {RegExp} regExp The regular expression to match against URLs.\n       * @param {workbox-routing~handlerCallback} handler A callback\n       * function that returns a Promise resulting in a Response.\n       * @param {string} [method='GET'] The HTTP method to match the Route\n       * against.\n       */", "url": "https://github.com/priyankarpal/projectshut/blob/3b38850653a70809ee8b13bd452208454daa9d79/public/workbox-8817a5e5.js#L616-L650", "sha": "3b38850653a70809ee8b13bd452208454daa9d79"}1063{"repo_name": "LibreChat", "dataset": "github_2023", "owner": "danny-avila", "lang": "javascript", "func_name": "AnthropicClient.getStreamUsage", "code": "getStreamUsage() {\n    const inputUsage = this.message_start?.message?.usage ?? {};\n    const outputUsage = this.message_delta?.usage ?? {};\n    return Object.assign({}, inputUsage, outputUsage);\n  }", "docstring": "/**\n   * Get stream usage as returned by this client's API response.\n   * @returns {AnthropicStreamUsage} The stream usage object.\n   */", "url": "https://github.com/danny-avila/LibreChat/blob/52a6de2aa756564ffe12114ebfce0e7f93ea125c/api/app/clients/AnthropicClient.js#L195-L199", "sha": "52a6de2aa756564ffe12114ebfce0e7f93ea125c"}1064{"repo_name": "transformers.js", "dataset": "github_2023", "owner": "huggingface", "lang": "javascript", "func_name": "PyAnnoteFeatureExtractor.samples_to_frames", "code": "samples_to_frames(samples) {\n        return ((samples - this.config.offset) / this.config.step);\n    }", "docstring": "/**\n     * NOTE: Can return fractional values. `Math.ceil` will ensure correct value.\n     * @param {number} samples The number of frames in the audio.\n     * @returns {number} The number of frames in the audio.\n     */", "url": "https://github.com/huggingface/transformers.js/blob/829ace02044ba19ff9fa0293b4b975f1046cb6de/src/models/pyannote/feature_extraction_pyannote.js#L34-L36", "sha": "829ace02044ba19ff9fa0293b4b975f1046cb6de"}1065{"repo_name": "ChatGPT-CodeReview", "dataset": "github_2023", "owner": "anc95", "lang": "javascript", "func_name": "getNodeRequestOptions$2", "code": "function getNodeRequestOptions$2(request) {\n\tconst parsedURL = request[INTERNALS$2$2].parsedURL;\n\tconst headers = new Headers$2(request[INTERNALS$2$2].headers);\n\n\t// fetch step 1.3\n\tif (!headers.has('Accept')) {\n\t\theaders.set('Accept', '*/*');\n\t}\n\n\t// Basic fetch\n\tif (!parsedURL.protocol || !parsedURL.hostname) {\n\t\tthrow new TypeError('Only absolute URLs are supported');\n\t}\n\n\tif (!/^https?:$/.test(parsedURL.protocol)) {\n\t\tthrow new TypeError('Only HTTP(S) protocols are supported');\n\t}\n\n\tif (request.signal && request.body instanceof Stream$2.Readable && !streamDestructionSupported$1) {\n\t\tthrow new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');\n\t}\n\n\t// HTTP-network-or-cache fetch steps 2.4-2.7\n\tlet contentLengthValue = null;\n\tif (request.body == null && /^(POST|PUT)$/i.test(request.method)) {\n\t\tcontentLengthValue = '0';\n\t}\n\tif (request.body != null) {\n\t\tconst totalBytes = getTotalBytes$2(request);\n\t\tif (typeof totalBytes === 'number') {\n\t\t\tcontentLengthValue = String(totalBytes);\n\t\t}\n\t}\n\tif (contentLengthValue) {\n\t\theaders.set('Content-Length', contentLengthValue);\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.11\n\tif (!headers.has('User-Agent')) {\n\t\theaders.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.15\n\tif (request.compress && !headers.has('Accept-Encoding')) {\n\t\theaders.set('Accept-Encoding', 'gzip,deflate');\n\t}\n\n\tlet agent = request.agent;\n\tif (typeof agent === 'function') {\n\t\tagent = agent(parsedURL);\n\t}\n\n\tif (!headers.has('Connection') && !agent) {\n\t\theaders.set('Connection', 'close');\n\t}\n\n\t// HTTP-network fetch step 4.2\n\t// chunked encoding is handled by Node.js\n\n\treturn Object.assign({}, parsedURL, {\n\t\tmethod: request.method,\n\t\theaders: exportNodeCompatibleHeaders$1(headers),\n\t\tagent\n\t});\n}", "docstring": "/**\n * Convert a Request to Node.js http request options.\n *\n * @param   Request  A Request instance\n * @return  Object   The options object to be passed to http.request\n */", "url": "https://github.com/anc95/ChatGPT-CodeReview/blob/ca9b6722ab7d015b71fe12c02ed24ac855b5d13a/action/github-action.js#L133633-L133697", "sha": "ca9b6722ab7d015b71fe12c02ed24ac855b5d13a"}1066{"repo_name": "ChatGPT-CodeReview", "dataset": "github_2023", "owner": "anc95", "lang": "javascript", "func_name": "parseipNotation", "code": "function parseipNotation (note) {\n  var pos = note.lastIndexOf('/');\n  var str = pos !== -1\n    ? note.substring(0, pos)\n    : note;\n\n  if (!isip(str)) {\n    throw new TypeError('invalid IP address: ' + str)\n  }\n\n  var ip = parseip(str);\n\n  if (pos === -1 && ip.kind() === 'ipv6' && ip.isIPv4MappedAddress()) {\n    // Store as IPv4\n    ip = ip.toIPv4Address();\n  }\n\n  var max = ip.kind() === 'ipv6'\n    ? 128\n    : 32;\n\n  var range = pos !== -1\n    ? note.substring(pos + 1, note.length)\n    : null;\n\n  if (range === null) {\n    range = max;\n  } else if (DIGIT_REGEXP.test(range)) {\n    range = parseInt(range, 10);\n  } else if (ip.kind() === 'ipv4' && isip(range)) {\n    range = parseNetmask(range);\n  } else {\n    range = null;\n  }\n\n  if (range <= 0 || range > max) {\n    throw new TypeError('invalid range on address: ' + note)\n  }\n\n  return [ip, range]\n}", "docstring": "/**\n * Parse IP notation string into range subnet.\n *\n * @param {String} note\n * @private\n */", "url": "https://github.com/anc95/ChatGPT-CodeReview/blob/ca9b6722ab7d015b71fe12c02ed24ac855b5d13a/action/github-action.js#L179070-L179110", "sha": "ca9b6722ab7d015b71fe12c02ed24ac855b5d13a"}1067{"repo_name": "FanSky_Qs", "dataset": "github_2023", "owner": "AFanSKyQs", "lang": "javascript", "func_name": "getTeyvatData", "code": "async function getTeyvatData (TBody, type = 'single') {\n  const apiMap = {\n    single: 'https://api.lelaer.com/ys/getDamageResult.php',\n    team: 'https://api.lelaer.com/ys/getTeamResult.php'\n  }\n  try {\n    const response = await fetch(apiMap[type], {\n      method: 'POST',\n      headers: {\n        'Content-Type': 'application/json',\n        ...headers // ๅ‡่ฎพๆ‚จๅทฒ็ปๅฎšไน‰ไบ† `headers` ๅฏน่ฑก\n      },\n      body: JSON.stringify(TBody),\n      timeout: 15000\n    })\n    const resJson = await response.json()\n    return resJson\n  } catch (error) {\n    console.error('ๆ็“ฆ็‰นๅฐๅŠฉๆ‰‹ๆŽฅๅฃๆ— ๆณ•่ฎฟ้—ฎๆˆ–่ฟ”ๅ›ž้”™่ฏฏ', error)\n    return {}\n  }\n}", "docstring": "/**\n * ่Žทๅ–ๅฐๅŠฉๆ‰‹ๅฏนๅบ”ๅŠŸ่ƒฝ็š„ๆ•ฐๆฎ\n * @param {String} TBody ่ฏทๆฑ‚้œ€่ฆ็š„ๆ•ฐๆฎ\n * @param {String} type ๅŠŸ่ƒฝๅฏนๅบ”api ้ป˜่ฎคไธบ Single\n * @returns ๅฐๅŠฉๆ‰‹่ฟ”ๅ›žๆ•ฐๆฎ\n */", "url": "https://github.com/AFanSKyQs/FanSky_Qs/blob/86d002866114fa1dd1c765325fde621925938adc/apps/Teyvat/GetData/getTeyvatData.js#L15-L36", "sha": "86d002866114fa1dd1c765325fde621925938adc"}1068{"repo_name": "safari", "dataset": "github_2023", "owner": "HazyResearch", "lang": "javascript", "func_name": "fixInput", "code": "function fixInput( src, dest ) {\n\tvar nodeName = dest.nodeName.toLowerCase();\n\n\t// Fails to persist the checked state of a cloned checkbox or radio button.\n\tif ( nodeName === \"input\" && rcheckableType.test( src.type ) ) {\n\t\tdest.checked = src.checked;\n\n\t// Fails to return the selected option to the default selected state when cloning options\n\t} else if ( nodeName === \"input\" || nodeName === \"textarea\" ) {\n\t\tdest.defaultValue = src.defaultValue;\n\t}\n}", "docstring": "// Fix IE bugs, see support tests", "url": "https://github.com/HazyResearch/safari/blob/02220c69d247e5473616cd053a443ad99fd2559b/csrc/fftconv/mathdx/22.02/include/cufftdx/docs/_static/jquery-3.5.1.js#L6034-L6045", "sha": "02220c69d247e5473616cd053a443ad99fd2559b"}1069{"repo_name": "win32.run", "dataset": "github_2023", "owner": "ducbao414", "lang": "javascript", "func_name": "resizeBilinear$2", "code": "function resizeBilinear$2(args) {\n\t  var inputs = args.inputs,\n\t      backend = args.backend,\n\t      attrs = args.attrs;\n\t  var images = inputs.images;\n\t  var alignCorners = attrs.alignCorners,\n\t      halfPixelCenters = attrs.halfPixelCenters,\n\t      size = attrs.size;\n\t  var newHeight = size[0],\n\t      newWidth = size[1];\n\t  var program = env().getBool('WEBGL_PACK_IMAGE_OPERATIONS') ? new ResizeBilinearPackedProgram(images.shape, newHeight, newWidth, alignCorners, halfPixelCenters) : new ResizeBilinearProgram(images.shape, newHeight, newWidth, alignCorners, halfPixelCenters);\n\t  return backend.runWebGLProgram(program, [images], 'float32');\n\t}", "docstring": "/**\n\t * @license\n\t * Copyright 2020 Google LLC. All Rights Reserved.\n\t * Licensed under the Apache License, Version 2.0 (the \"License\");\n\t * you may not use this file except in compliance with the License.\n\t * You may obtain a copy of the License at\n\t *\n\t * http://www.apache.org/licenses/LICENSE-2.0\n\t *\n\t * Unless required by applicable law or agreed to in writing, software\n\t * distributed under the License is distributed on an \"AS IS\" BASIS,\n\t * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\t * See the License for the specific language governing permissions and\n\t * limitations under the License.\n\t * =============================================================================\n\t */", "url": "https://github.com/ducbao414/win32.run/blob/05160523659c100d85802f15e164a0b9358b38b7/static/html/jspaint/lib/tracky-mouse/lib/tf.js#L119284-L119296", "sha": "05160523659c100d85802f15e164a0b9358b38b7"}1070{"repo_name": "win32.run", "dataset": "github_2023", "owner": "ducbao414", "lang": "javascript", "func_name": "getElementOffset", "code": "function getElementOffset(element) {\n    var docElem,\n        doc = element && element.ownerDocument,\n        box = { left: 0, top: 0 },\n        offset = { left: 0, top: 0 },\n        scrollLeftTop,\n        offsetAttributes = {\n          borderLeftWidth: 'left',\n          borderTopWidth:  'top',\n          paddingLeft:     'left',\n          paddingTop:      'top'\n        };\n\n    if (!doc) {\n      return offset;\n    }\n\n    for (var attr in offsetAttributes) {\n      offset[offsetAttributes[attr]] += parseInt(getElementStyle(element, attr), 10) || 0;\n    }\n\n    docElem = doc.documentElement;\n    if ( typeof element.getBoundingClientRect !== 'undefined' ) {\n      box = element.getBoundingClientRect();\n    }\n\n    scrollLeftTop = getScrollLeftTop(element);\n\n    return {\n      left: box.left + scrollLeftTop.left - (docElem.clientLeft || 0) + offset.left,\n      top: box.top + scrollLeftTop.top - (docElem.clientTop || 0)  + offset.top\n    };\n  }", "docstring": "/**\n   * Returns offset for a given element\n   * @function\n   * @memberOf fabric.util\n   * @param {HTMLElement} element Element to get offset for\n   * @return {Object} Object with \"left\" and \"top\" properties\n   */", "url": "https://github.com/ducbao414/win32.run/blob/05160523659c100d85802f15e164a0b9358b38b7/static/html/photon/dist/tui-image-editor.js#L3269-L3301", "sha": "05160523659c100d85802f15e164a0b9358b38b7"}1071{"repo_name": "openordex", "dataset": "github_2023", "owner": "orenyomtov", "lang": "javascript", "func_name": "_getAndroid", "code": "function _getAndroid() {\n\t\tvar android = false;\n\t\tvar sAgent = navigator.userAgent;\n\t\t\n\t\tif (/android/i.test(sAgent)) { // android\n\t\t\tandroid = true;\n\t\t\taMat = sAgent.toString().match(/android ([0-9]\\.[0-9])/i);\n\t\t\t\n\t\t\tif (aMat && aMat[1]) {\n\t\t\t\tandroid = parseFloat(aMat[1]);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn android;\n\t}", "docstring": "// android 2.x doesn't support Data-URI spec", "url": "https://github.com/orenyomtov/openordex/blob/44581ec727c439c15178413b1d46c8f6176f253a/js/qrcode.js#L157-L171", "sha": "44581ec727c439c15178413b1d46c8f6176f253a"}1072{"repo_name": "Ukrainian_IT_Communities", "dataset": "github_2023", "owner": "nikit0ns", "lang": "javascript", "func_name": "normalizeArray", "code": "function normalizeArray(parts, allowAboveRoot) {\n  // if the path tries to go above the root, `up` ends up > 0\n  var up = 0;\n  for (var i = parts.length - 1; i >= 0; i--) {\n    var last = parts[i];\n    if (last === '.') {\n      parts.splice(i, 1);\n    } else if (last === '..') {\n      parts.splice(i, 1);\n      up++;\n    } else if (up) {\n      parts.splice(i, 1);\n      up--;\n    }\n  }\n\n  // if the path is allowed to go above the root, restore leading ..s\n  if (allowAboveRoot) {\n    for (; up--; up) {\n      parts.unshift('..');\n    }\n  }\n\n  return parts;\n}", "docstring": "// Copyright Joyent, Inc. and other Node contributors.", "url": "https://github.com/nikit0ns/Ukrainian_IT_Communities/blob/e0cea263be2e7d1da8e0e655134d787475dee526/site/assets/javascripts/lunr/wordcut.js#L4112-L4136", "sha": "e0cea263be2e7d1da8e0e655134d787475dee526"}1073{"repo_name": "diffusion_model", "dataset": "github_2023", "owner": "wangjia184", "lang": "javascript", "func_name": "avgPoolGrad", "code": "function avgPoolGrad(args) {\n        const { inputs, backend, attrs } = args;\n        const { dy, input } = inputs;\n        const x = input;\n        assertNotComplex([dy, input], 'avgPoolGrad');\n        const { filterSize, strides, pad } = attrs;\n        const convInfo = tfjsCore.backend_util.computePool2DInfo(x.shape, filterSize, strides, 1 /* dilations */, pad);\n        const strideHeight = convInfo.strideHeight;\n        const strideWidth = convInfo.strideWidth;\n        const filterHeight = convInfo.filterHeight;\n        const filterWidth = convInfo.filterWidth;\n        const dilationHeight = convInfo.dilationHeight;\n        const dilationWidth = convInfo.dilationWidth;\n        const effectiveFilterHeight = convInfo.effectiveFilterHeight;\n        const effectiveFilterWidth = convInfo.effectiveFilterWidth;\n        const padLeft = effectiveFilterWidth - 1 - convInfo.padInfo.left;\n        const padTop = effectiveFilterHeight - 1 - convInfo.padInfo.top;\n        const dx = tfjsCore.buffer(x.shape, 'float32');\n        const avgMultiplier = 1 / (filterHeight * filterWidth);\n        const dyData = backend.data.get(dy.dataId).values;\n        const dyBuf = tfjsCore.buffer(dy.shape, 'float32', dyData);\n        for (let b = 0; b < convInfo.batchSize; ++b) {\n            for (let d = 0; d < convInfo.inChannels; ++d) {\n                for (let dxR = 0; dxR < convInfo.inHeight; ++dxR) {\n                    for (let dxC = 0; dxC < convInfo.inWidth; ++dxC) {\n                        // Shader code begins.\n                        const dyRCorner = dxR - padTop;\n                        const dyCCorner = dxC - padLeft;\n                        let dotProd = 0;\n                        for (let wR = 0; wR < effectiveFilterHeight; wR += dilationHeight) {\n                            const dyR = (dyRCorner + wR) / strideHeight;\n                            if (dyR < 0 || dyR >= convInfo.outHeight ||\n                                Math.floor(dyR) !== dyR) {\n                                continue;\n                            }\n                            for (let wC = 0; wC < effectiveFilterWidth; wC += dilationWidth) {\n                                const dyC = (dyCCorner + wC) / strideWidth;\n                                if (dyC < 0 || dyC >= convInfo.outWidth ||\n                                    Math.floor(dyC) !== dyC) {\n                                    continue;\n                                }\n                                const pixel = dyBuf.get(b, dyR, dyC, d);\n                                dotProd += pixel;\n                            }\n                        }\n                        dx.set(dotProd * avgMultiplier, b, dxR, dxC, d);\n                    }\n                }\n            }\n        }\n        return backend.makeTensorInfo(dx.shape, dx.dtype, dx.values);\n    }", "docstring": "/**\n     * @license\n     * Copyright 2020 Google LLC. All Rights Reserved.\n     * Licensed under the Apache License, Version 2.0 (the \"License\");\n     * you may not use this file except in compliance with the License.\n     * You may obtain a copy of the License at\n     *\n     * http://www.apache.org/licenses/LICENSE-2.0\n     *\n     * Unless required by applicable law or agreed to in writing, software\n     * distributed under the License is distributed on an \"AS IS\" BASIS,\n     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     * See the License for the specific language governing permissions and\n     * limitations under the License.\n     * =============================================================================\n     */", "url": "https://github.com/wangjia184/diffusion_model/blob/5ea111bd405c1f893976808b768681d61e11c979/docs/@tensorflow/tfjs-backend-cpu/dist/tf-backend-cpu.es2017.js#L4774-L4825", "sha": "5ea111bd405c1f893976808b768681d61e11c979"}1074{"repo_name": "diffusion_model", "dataset": "github_2023", "owner": "wangjia184", "lang": "javascript", "func_name": "stringToHashBucketFast", "code": "function stringToHashBucketFast(args) {\n    var inputs = args.inputs, backend = args.backend, attrs = args.attrs;\n    var numBuckets = attrs.numBuckets;\n    var input = inputs.input;\n    if (input.dtype !== 'string') {\n        throw new Error('Input must be of datatype string');\n    }\n    if (numBuckets <= 0) {\n        throw new Error(\"Number of buckets must be at least 1\");\n    }\n    var $input = backend.readSync(input.dataId);\n    var output = stringToHashBucketFastImplCPU($input, numBuckets);\n    return backend.makeTensorInfo(input.shape, 'int32', output);\n}", "docstring": "/**\n * @license\n * Copyright 2021 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */", "url": "https://github.com/wangjia184/diffusion_model/blob/5ea111bd405c1f893976808b768681d61e11c979/docs/@tensorflow/tfjs-backend-webgl/dist/tf-backend-webgl.node.js#L17270-L17283", "sha": "5ea111bd405c1f893976808b768681d61e11c979"}1075{"repo_name": "diffusion_model", "dataset": "github_2023", "owner": "wangjia184", "lang": "javascript", "func_name": "copy", "code": "function copy(f, t) {\n      t.i = f.i;\n      t.j = f.j;\n      t.S = f.S.slice();\n      return t;\n    }", "docstring": "//", "url": "https://github.com/wangjia184/diffusion_model/blob/5ea111bd405c1f893976808b768681d61e11c979/docs/@tensorflow/tfjs-converter/dist/tf-converter.es2017.js#L20137-L20142", "sha": "5ea111bd405c1f893976808b768681d61e11c979"}1076{"repo_name": "diffusion_model", "dataset": "github_2023", "owner": "wangjia184", "lang": "javascript", "func_name": "argMin_", "code": "function argMin_(x, axis = 0) {\n    const $x = convertToTensor(x, 'x', 'argMin');\n    const inputs = { x: $x };\n    const attrs = { axis };\n    return ENGINE.runKernel(ArgMin, inputs, attrs);\n}", "docstring": "/**\n * @license\n * Copyright 2020 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */", "url": "https://github.com/wangjia184/diffusion_model/blob/5ea111bd405c1f893976808b768681d61e11c979/docs/@tensorflow/tfjs-converter/dist/tf-converter.fesm.js#L12280-L12285", "sha": "5ea111bd405c1f893976808b768681d61e11c979"}1077{"repo_name": "diffusion_model", "dataset": "github_2023", "owner": "wangjia184", "lang": "javascript", "func_name": "avgPool3d_", "code": "function avgPool3d_(x, filterSize, strides, pad, dimRoundingMode, dataFormat = 'NDHWC') {\n    const $x = convertToTensor(x, 'x', 'avgPool3d', 'float32');\n    let x5D = $x;\n    let reshapedTo5D = false;\n    if ($x.rank === 4) {\n        reshapedTo5D = true;\n        x5D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2], $x.shape[3]]);\n    }\n    assert(x5D.rank === 5, () => `Error in avgPool3d: x must be rank 5 but got rank ${x5D.rank}.`);\n    assert(dataFormat === 'NDHWC', () => `Error in avgPool3d: Only NDHWC is currently supported, ` +\n        `but got dataFormat of ${dataFormat}`);\n    assert((typeof strides === 'number' && strides > 0) ||\n        (Array.isArray(strides) && strides[0] > 0 && strides[1] > 0 &&\n            strides[2] > 0), () => `Error in avgPool3d: Stride must be > 0, but got '${strides}'`);\n    checkPadOnDimRoundingMode('avgPool3d', pad, dimRoundingMode);\n    const inputs = { x: x5D };\n    const attrs = { filterSize, strides, pad, dimRoundingMode, dataFormat };\n    // tslint:disable-next-line: no-unnecessary-type-assertion\n    let res = ENGINE.runKernel(AvgPool3D, inputs, attrs);\n    res = cast(res, x5D.dtype);\n    if (reshapedTo5D) {\n        return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]);\n    }\n    return res;\n}", "docstring": "/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */", "url": "https://github.com/wangjia184/diffusion_model/blob/5ea111bd405c1f893976808b768681d61e11c979/docs/@tensorflow/tfjs-converter/dist/tf-converter.fesm.js#L12917-L12941", "sha": "5ea111bd405c1f893976808b768681d61e11c979"}1078{"repo_name": "diffusion_model", "dataset": "github_2023", "owner": "wangjia184", "lang": "javascript", "func_name": "minimum_", "code": "function minimum_(a, b) {\n    let $a = convertToTensor(a, 'a', 'minimum');\n    let $b = convertToTensor(b, 'b', 'minimum');\n    [$a, $b] = makeTypesMatch($a, $b);\n    if ($a.dtype === 'bool') {\n        $a = cast($a, 'int32');\n        $b = cast($b, 'int32');\n    }\n    assertAndGetBroadcastShape($a.shape, $b.shape);\n    const inputs = { a: $a, b: $b };\n    return ENGINE.runKernel(Minimum, inputs);\n}", "docstring": "/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */", "url": "https://github.com/wangjia184/diffusion_model/blob/5ea111bd405c1f893976808b768681d61e11c979/docs/@tensorflow/tfjs-converter/dist/tf-converter.fesm.js#L18225-L18236", "sha": "5ea111bd405c1f893976808b768681d61e11c979"}1079{"repo_name": "diffusion_model", "dataset": "github_2023", "owner": "wangjia184", "lang": "javascript", "func_name": "movingAverage_", "code": "function movingAverage_(v, x, decay, step, zeroDebias = true) {\n    const $v = convertToTensor(v, 'v', 'movingAverage');\n    const $x = convertToTensor(x, 'x', 'movingAverage');\n    const $decay = convertToTensor(decay, 'decay', 'movingAverage');\n    assertTypesMatch($v, $x);\n    assert(arraysEqual($v.shape, $x.shape), () => 'Shape mismatch in v and x');\n    const one = scalar(1);\n    const oneMinusDecay = sub(one, $decay);\n    let update = mul(sub($x, $v), oneMinusDecay);\n    if (zeroDebias) {\n        assert(step != null, () => 'When using zeroDebias: true, step is required.');\n        const $step = convertToTensor(step, 'step', 'movingAverage');\n        update = div(update, sub(one, pow($decay, $step)));\n    }\n    return add($v, update);\n}", "docstring": "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */", "url": "https://github.com/wangjia184/diffusion_model/blob/5ea111bd405c1f893976808b768681d61e11c979/docs/@tensorflow/tfjs-converter/dist/tf-converter.fesm.js#L23247-L23262", "sha": "5ea111bd405c1f893976808b768681d61e11c979"}1080{"repo_name": "diffusion_model", "dataset": "github_2023", "owner": "wangjia184", "lang": "javascript", "func_name": "conv3DBackpropInput_", "code": "function conv3DBackpropInput_(xShape, dy, filter, strides, pad) {\n        assert(xShape.length === dy.rank, function () { return \"Length of inShape \" +\n            \"(\".concat(xShape.length, \") and rank of dy (\").concat(dy.rank, \") must match\"); });\n        var xShape5D = xShape;\n        var dy5D = dy;\n        var reshapedTo5D = false;\n        if (dy.rank === 4) {\n            reshapedTo5D = true;\n            dy5D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2], dy.shape[3]]);\n            xShape5D = [1, xShape[0], xShape[1], xShape[2], xShape[3]];\n        }\n        var inDepth = xShape5D[4];\n        var outDepth = dy5D.shape[4];\n        assert(xShape5D.length === 5, function () { return \"Error in conv3dDerInput: inShape must be length 5, but got length \" +\n            \"\".concat(xShape5D.length, \".\"); });\n        assert(dy5D.rank === 5, function () { return \"Error in conv3dDerInput: dy must be rank 5, but got \" +\n            \"rank \".concat(dy5D.rank); });\n        assert(filter.rank === 5, function () { return \"Error in conv3dDerInput: filter must be rank 5, but got \" +\n            \"rank \".concat(filter.rank); });\n        assert(inDepth === filter.shape[3], function () { return \"Error in conv3dDerInput: depth of input (\".concat(inDepth, \") must \") +\n            \"match input depth for filter \".concat(filter.shape[3], \".\"); });\n        assert(outDepth === filter.shape[4], function () { return \"Error in conv3dDerInput: depth of output (\".concat(outDepth, \") must \") +\n            \"match output depth for filter \".concat(filter.shape[4], \".\"); });\n        var inputs = { dy: dy5D, filter: filter };\n        var attrs = { pad: pad, strides: strides, inputShape: xShape5D };\n        // tslint:disable-next-line: no-unnecessary-type-assertion\n        var res = ENGINE.runKernel(Conv3DBackpropInputV2, inputs, attrs);\n        if (reshapedTo5D) {\n            return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]);\n        }\n        return res;\n    }", "docstring": "/**\n     * @license\n     * Copyright 2020 Google LLC. All Rights Reserved.\n     * Licensed under the Apache License, Version 2.0 (the \"License\");\n     * you may not use this file except in compliance with the License.\n     * You may obtain a copy of the License at\n     *\n     * http://www.apache.org/licenses/LICENSE-2.0\n     *\n     * Unless required by applicable law or agreed to in writing, software\n     * distributed under the License is distributed on an \"AS IS\" BASIS,\n     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     * See the License for the specific language governing permissions and\n     * limitations under the License.\n     * =============================================================================\n     */", "url": "https://github.com/wangjia184/diffusion_model/blob/5ea111bd405c1f893976808b768681d61e11c979/docs/@tensorflow/tfjs-converter/dist/tf-converter.js#L14534-L14565", "sha": "5ea111bd405c1f893976808b768681d61e11c979"}1081{"repo_name": "diffusion_model", "dataset": "github_2023", "owner": "wangjia184", "lang": "javascript", "func_name": "meshgrid", "code": "function meshgrid(x, y, _a) {\n        var _b = _a === void 0 ? {} : _a, _c = _b.indexing, indexing = _c === void 0 ? 'xy' : _c;\n        if (indexing !== 'xy' && indexing !== 'ij') {\n            throw new TypeError(\"\".concat(indexing, \" is not a valid third argument to meshgrid\"));\n        }\n        if (x === undefined) {\n            return [];\n        }\n        var $x = convertToTensor(x, 'x', 'meshgrid', x instanceof Tensor ? x.dtype : 'float32');\n        if (y === undefined) {\n            return [$x];\n        }\n        var $y = convertToTensor(y, 'y', 'meshgrid', y instanceof Tensor ? y.dtype : 'float32');\n        var w = sizeFromShape($x.shape);\n        var h = sizeFromShape($y.shape);\n        if (indexing === 'xy') {\n            $x = reshape($x, [1, -1]);\n            $y = reshape($y, [-1, 1]);\n            return [\n                matMul$1(ones([h, 1], $x.dtype), $x),\n                matMul$1($y, ones([1, w], $y.dtype)),\n            ];\n        }\n        $x = reshape($x, [-1, 1]);\n        $y = reshape($y, [1, -1]);\n        return [\n            matMul$1($x, ones([1, h], $x.dtype)),\n            matMul$1(ones([w, 1], $y.dtype), $y),\n        ];\n    }", "docstring": "/**\n     * @license\n     * Copyright 2021 Google LLC. All Rights Reserved.\n     * Licensed under the Apache License, Version 2.0 (the \"License\");\n     * you may not use this file except in compliance with the License.\n     * You may obtain a copy of the License at\n     *\n     * http://www.apache.org/licenses/LICENSE-2.0\n     *\n     * Unless required by applicable law or agreed to in writing, software\n     * distributed under the License is distributed on an \"AS IS\" BASIS,\n     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     * See the License for the specific language governing permissions and\n     * limitations under the License.\n     * =============================================================================\n     */", "url": "https://github.com/wangjia184/diffusion_model/blob/5ea111bd405c1f893976808b768681d61e11c979/docs/@tensorflow/tfjs-converter/dist/tf-converter.js#L18081-L18110", "sha": "5ea111bd405c1f893976808b768681d61e11c979"}1082{"repo_name": "diffusion_model", "dataset": "github_2023", "owner": "wangjia184", "lang": "javascript", "func_name": "depthwiseConv2dNativeBackpropFilter_", "code": "function depthwiseConv2dNativeBackpropFilter_(x, dy, filterShape, strides, pad, dilations, dimRoundingMode) {\n        if (dilations === void 0) { dilations = [1, 1]; }\n        var x4D = x;\n        if (x.rank === 3) {\n            x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]);\n        }\n        var dy4D = dy;\n        if (dy4D.rank === 3) {\n            dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]);\n        }\n        var inputs = { x: x4D, dy: dy4D };\n        var attrs = { strides: strides, pad: pad, dimRoundingMode: dimRoundingMode, dilations: dilations, filterShape: filterShape };\n        // tslint:disable-next-line: no-unnecessary-type-assertion\n        return ENGINE.runKernel(DepthwiseConv2dNativeBackpropFilter, inputs, attrs);\n    }", "docstring": "/**\n     * @license\n     * Copyright 2020 Google LLC. All Rights Reserved.\n     * Licensed under the Apache License, Version 2.0 (the \"License\");\n     * you may not use this file except in compliance with the License.\n     * You may obtain a copy of the License at\n     *\n     * http://www.apache.org/licenses/LICENSE-2.0\n     *\n     * Unless required by applicable law or agreed to in writing, software\n     * distributed under the License is distributed on an \"AS IS\" BASIS,\n     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     * See the License for the specific language governing permissions and\n     * limitations under the License.\n     * =============================================================================\n     */", "url": "https://github.com/wangjia184/diffusion_model/blob/5ea111bd405c1f893976808b768681d61e11c979/docs/@tensorflow/tfjs-converter/dist/tf-converter.js#L23878-L23892", "sha": "5ea111bd405c1f893976808b768681d61e11c979"}1083{"repo_name": "diffusion_model", "dataset": "github_2023", "owner": "wangjia184", "lang": "javascript", "func_name": "IORouterRegistry.registerLoadRouter", "code": "static registerLoadRouter(loadRouter) {\n        IORouterRegistry.getInstance().loadRouters.push(loadRouter);\n    }", "docstring": "/**\n     * Register a load-handler router.\n     *\n     * @param loadRouter A function that maps a URL-like string onto an instance\n     * of `IOHandler` with the `load` method defined or `null`.\n     */", "url": "https://github.com/wangjia184/diffusion_model/blob/5ea111bd405c1f893976808b768681d61e11c979/docs/@tensorflow/tfjs-core/dist/tf-core.fesm.js#L6360-L6362", "sha": "5ea111bd405c1f893976808b768681d61e11c979"}1084{"repo_name": "diffusion_model", "dataset": "github_2023", "owner": "wangjia184", "lang": "javascript", "func_name": "makeTensor", "code": "function makeTensor(values, shape, inferredShape, dtype) {\n        if (dtype == null) {\n            dtype = inferDtype(values);\n        }\n        else if (dtype === 'complex64') {\n            throw new Error(\"Cannot construct a complex64 tensor directly. \" +\n                \"Please use tf.complex(real, imag).\");\n        }\n        if (typeof values === 'object' &&\n            ('texture' in values ||\n                ('buffer' in values && !(values.buffer instanceof ArrayBuffer)))) {\n            if (dtype !== 'float32' && dtype !== 'int32') {\n                throw new Error(\"Creating tensor from GPU data only supports \" +\n                    \"'float32'|'int32' dtype, while the dtype is \".concat(dtype, \".\"));\n            }\n            return ENGINE.backend.createTensorFromGPUData(values, shape || inferredShape, dtype);\n        }\n        if (!isTypedArray(values) && !Array.isArray(values) &&\n            typeof values !== 'number' && typeof values !== 'boolean' &&\n            typeof values !== 'string') {\n            throw new Error('values passed to tensor(values) must be a number/boolean/string or ' +\n                'an array of numbers/booleans/strings, or a TypedArray');\n        }\n        // Verify that the shape matches the inferred shape.\n        if (shape != null) {\n            assertNonNegativeIntegerDimensions(shape);\n            var providedSize_1 = sizeFromShape(shape);\n            var inferredSize_1 = sizeFromShape(inferredShape);\n            assert(providedSize_1 === inferredSize_1, function () { return \"Based on the provided shape, [\".concat(shape, \"], the tensor should have \") +\n                \"\".concat(providedSize_1, \" values but has \").concat(inferredSize_1); });\n            for (var i = 0; i < inferredShape.length; ++i) {\n                var inferred = inferredShape[i];\n                var flatDimsDontMatch = i === inferredShape.length - 1 ?\n                    inferred !== sizeFromShape(shape.slice(i)) :\n                    true;\n                assert(inferredShape[i] === shape[i] || !flatDimsDontMatch, function () { return \"Error creating a new Tensor. Inferred shape \" +\n                    \"(\".concat(inferredShape, \") does not match the provided \") +\n                    \"shape (\".concat(shape, \"). \"); });\n            }\n        }\n        if (!isTypedArray(values) && !Array.isArray(values)) {\n            values = [values];\n        }\n        shape = shape || inferredShape;\n        values = dtype !== 'string' ?\n            toTypedArray(values, dtype) :\n            flatten(values, [], true);\n        return ENGINE.makeTensor(values, shape, dtype);\n    }", "docstring": "/**\n     * @license\n     * Copyright 2018 Google LLC. All Rights Reserved.\n     * Licensed under the Apache License, Version 2.0 (the \"License\");\n     * you may not use this file except in compliance with the License.\n     * You may obtain a copy of the License at\n     *\n     * http://www.apache.org/licenses/LICENSE-2.0\n     *\n     * Unless required by applicable law or agreed to in writing, software\n     * distributed under the License is distributed on an \"AS IS\" BASIS,\n     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     * See the License for the specific language governing permissions and\n     * limitations under the License.\n     * =============================================================================\n     */", "url": "https://github.com/wangjia184/diffusion_model/blob/5ea111bd405c1f893976808b768681d61e11c979/docs/@tensorflow/tfjs-core/dist/tf-core.js#L5637-L5685", "sha": "5ea111bd405c1f893976808b768681d61e11c979"}1085{"repo_name": "diffusion_model", "dataset": "github_2023", "owner": "wangjia184", "lang": "javascript", "func_name": "cropAndResize_", "code": "function cropAndResize_(image, boxes, boxInd, cropSize, method, extrapolationValue) {\n        if (method === void 0) { method = 'bilinear'; }\n        if (extrapolationValue === void 0) { extrapolationValue = 0; }\n        var $image = convertToTensor(image, 'image', 'cropAndResize');\n        var $boxes = convertToTensor(boxes, 'boxes', 'cropAndResize', 'float32');\n        var $boxInd = convertToTensor(boxInd, 'boxInd', 'cropAndResize', 'int32');\n        var numBoxes = $boxes.shape[0];\n        assert($image.rank === 4, function () { return 'Error in cropAndResize: image must be rank 4,' +\n            \"but got rank \".concat($image.rank, \".\"); });\n        assert($boxes.rank === 2 && $boxes.shape[1] === 4, function () { return \"Error in cropAndResize: boxes must be have size [\".concat(numBoxes, \",4] \") +\n            \"but had shape \".concat($boxes.shape, \".\"); });\n        assert($boxInd.rank === 1 && $boxInd.shape[0] === numBoxes, function () { return \"Error in cropAndResize: boxInd must be have size [\".concat(numBoxes, \"] \") +\n            \"but had shape \".concat($boxes.shape, \".\"); });\n        assert(cropSize.length === 2, function () { return \"Error in cropAndResize: cropSize must be of length 2, but got \" +\n            \"length \".concat(cropSize.length, \".\"); });\n        assert(cropSize[0] >= 1 && cropSize[1] >= 1, function () { return \"cropSize must be atleast [1,1], but was \".concat(cropSize); });\n        assert(method === 'bilinear' || method === 'nearest', function () { return \"method must be bilinear or nearest, but was \".concat(method); });\n        var inputs = { image: $image, boxes: $boxes, boxInd: $boxInd };\n        var attrs = { method: method, extrapolationValue: extrapolationValue, cropSize: cropSize };\n        var res = ENGINE.runKernel(CropAndResize, inputs, attrs);\n        return res;\n    }", "docstring": "/**\n     * @license\n     * Copyright 2020 Google LLC. All Rights Reserved.\n     * Licensed under the Apache License, Version 2.0 (the \"License\");\n     * you may not use this file except in compliance with the License.\n     * You may obtain a copy of the License at\n     *\n     * http://www.apache.org/licenses/LICENSE-2.0\n     *\n     * Unless required by applicable law or agreed to in writing, software\n     * distributed under the License is distributed on an \"AS IS\" BASIS,\n     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     * See the License for the specific language governing permissions and\n     * limitations under the License.\n     * =============================================================================\n     */", "url": "https://github.com/wangjia184/diffusion_model/blob/5ea111bd405c1f893976808b768681d61e11c979/docs/@tensorflow/tfjs-core/dist/tf-core.js#L20861-L20882", "sha": "5ea111bd405c1f893976808b768681d61e11c979"}1086{"repo_name": "diffusion_model", "dataset": "github_2023", "owner": "wangjia184", "lang": "javascript", "func_name": "fromInt", "code": "function fromInt(value, unsigned) {\n        var obj, cachedObj, cache;\n        if (unsigned) {\n            value >>>= 0;\n            if (cache = (0 <= value && value < 256)) {\n                cachedObj = UINT_CACHE[value];\n                if (cachedObj)\n                    return cachedObj;\n            }\n            obj = fromBits(value, (value | 0) < 0 ? -1 : 0, true);\n            if (cache)\n                UINT_CACHE[value] = obj;\n            return obj;\n        }\n        else {\n            value |= 0;\n            if (cache = (-128 <= value && value < 128)) {\n                cachedObj = INT_CACHE[value];\n                if (cachedObj)\n                    return cachedObj;\n            }\n            obj = fromBits(value, value < 0 ? -1 : 0, false);\n            if (cache)\n                INT_CACHE[value] = obj;\n            return obj;\n        }\n    }", "docstring": "/**\n     * @param {number} value\n     * @param {boolean=} unsigned\n     * @returns {!Long}\n     * @inner\n     */", "url": "https://github.com/wangjia184/diffusion_model/blob/5ea111bd405c1f893976808b768681d61e11c979/docs/@tensorflow/tfjs-layers/dist/tf-layers.js#L5451-L5477", "sha": "5ea111bd405c1f893976808b768681d61e11c979"}1087{"repo_name": "diffusion_model", "dataset": "github_2023", "owner": "wangjia184", "lang": "javascript", "func_name": "softmaxCrossEntropyWithLogits_", "code": "function softmaxCrossEntropyWithLogits_(labels, logits, dim = -1) {\n        if (dim === -1) {\n            dim = logits.rank - 1;\n        }\n        if (dim !== logits.rank - 1) {\n            throw Error(`Softmax cross entropy along a non-last dimension is not yet ` +\n                `supported. Labels / logits was rank ${logits.rank} ` +\n                `and dim was ${dim}`);\n        }\n        // Use a custom gradient for numerical stability.\n        const customOp = customGrad((labels, logits, save) => {\n            // Reference:\n            //   1. http://cs231n.github.io/linear-classify/#softmax\n            //   2. https://blog.feedly.com/tricks-of-the-trade-logsumexp/\n            const keepDims = true;\n            const lse = logSumExp(logits, [dim], keepDims);\n            const logResult = sub(cast(logits, 'float32'), lse);\n            save([labels, logResult]);\n            const costVector = neg(mul(logResult, labels));\n            const value = sum$1(costVector, [dim]);\n            const gradFunc = (dy, saved) => {\n                const [labels, logResult] = saved;\n                const dyShape = expandShapeToKeepDim(dy.shape, [dim]);\n                return [\n                    mul(reshape(dy, dyShape), sub(cast(labels, 'float32'), exp(logResult))),\n                    mul(reshape(dy, dyShape), sub(exp(logResult), cast(labels, 'float32'))),\n                ];\n            };\n            return { value, gradFunc };\n        });\n        return customOp(labels, logits);\n    }", "docstring": "/**\n     * @license\n     * Copyright 2020 Google LLC. All Rights Reserved.\n     * Licensed under the Apache License, Version 2.0 (the \"License\");\n     * you may not use this file except in compliance with the License.\n     * You may obtain a copy of the License at\n     *\n     * http://www.apache.org/licenses/LICENSE-2.0\n     *\n     * Unless required by applicable law or agreed to in writing, software\n     * distributed under the License is distributed on an \"AS IS\" BASIS,\n     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     * See the License for the specific language governing permissions and\n     * limitations under the License.\n     * =============================================================================\n     */", "url": "https://github.com/wangjia184/diffusion_model/blob/5ea111bd405c1f893976808b768681d61e11c979/docs/@tensorflow/tfjs/dist/tf.es2017.js#L22957-L22988", "sha": "5ea111bd405c1f893976808b768681d61e11c979"}1088{"repo_name": "diffusion_model", "dataset": "github_2023", "owner": "wangjia184", "lang": "javascript", "func_name": "simpleRNN", "code": "function simpleRNN(args) {\n        return new SimpleRNN(args);\n    }", "docstring": "/**\n     * Fully-connected RNN where the output is to be fed back to input.\n     *\n     * This is an `RNN` layer consisting of one `SimpleRNNCell`. However, unlike\n     * the underlying `SimpleRNNCell`, the `apply` method of `SimpleRNN` operates\n     * on a sequence of inputs. The shape of the input (not including the first,\n     * batch dimension) needs to be at least 2-D, with the first dimension being\n     * time steps. For example:\n     *\n     * ```js\n     * const rnn = tf.layers.simpleRNN({units: 8, returnSequences: true});\n     *\n     * // Create an input with 10 time steps.\n     * const input = tf.input({shape: [10, 20]});\n     * const output = rnn.apply(input);\n     *\n     * console.log(JSON.stringify(output.shape));\n     * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n     * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n     * // 3rd dimension is the `SimpleRNNCell`'s number of units.\n     * ```\n     *\n     * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n     */", "url": "https://github.com/wangjia184/diffusion_model/blob/5ea111bd405c1f893976808b768681d61e11c979/docs/@tensorflow/tfjs/dist/tf.es2017.js#L53836-L53838", "sha": "5ea111bd405c1f893976808b768681d61e11c979"}1089{"repo_name": "diffusion_model", "dataset": "github_2023", "owner": "wangjia184", "lang": "javascript", "func_name": "binaryCrossentropy$2", "code": "function binaryCrossentropy$2(yTrue, yPred) {\n        return binaryCrossentropy$1(yTrue, yPred);\n    }", "docstring": "/**\n     * Binary crossentropy metric function.\n     *\n     * Example:\n     * ```js\n     * const x = tf.tensor2d([[0], [1], [1], [1]]);\n     * const y = tf.tensor2d([[0], [0], [0.5], [1]]);\n     * const crossentropy = tf.metrics.binaryCrossentropy(x, y);\n     * crossentropy.print();\n     * ```\n     *\n     * @param yTrue Binary Tensor of truth.\n     * @param yPred Binary Tensor of prediction, probabilities for the `1` case.\n     * @return Accuracy Tensor.\n     *\n     * @doc {heading: 'Metrics', namespace: 'metrics'}\n     */", "url": "https://github.com/wangjia184/diffusion_model/blob/5ea111bd405c1f893976808b768681d61e11c979/docs/@tensorflow/tfjs/dist/tf.es2017.js#L54464-L54466", "sha": "5ea111bd405c1f893976808b768681d61e11c979"}1090{"repo_name": "diffusion_model", "dataset": "github_2023", "owner": "wangjia184", "lang": "javascript", "func_name": "oneHot$2", "code": "function oneHot$2(args) {\n        const { inputs, backend, attrs } = args;\n        const { indices } = inputs;\n        const { dtype, depth, onValue, offValue } = attrs;\n        assertNotComplex(indices, 'oneHot');\n        const indicesSize = sizeFromShape(indices.shape);\n        const res = new Float32Array(indicesSize * depth);\n        res.fill(offValue);\n        const indicesVal = backend.data.get(indices.dataId).values;\n        for (let event = 0; event < indicesSize; ++event) {\n            if (indicesVal[event] >= 0 && indicesVal[event] < depth) {\n                res[event * depth + indicesVal[event]] = onValue;\n            }\n        }\n        return backend.makeTensorInfo([...indices.shape, depth], dtype, res);\n    }", "docstring": "/**\n     * @license\n     * Copyright 2020 Google LLC. All Rights Reserved.\n     * Licensed under the Apache License, Version 2.0 (the \"License\");\n     * you may not use this file except in compliance with the License.\n     * You may obtain a copy of the License at\n     *\n     * http://www.apache.org/licenses/LICENSE-2.0\n     *\n     * Unless required by applicable law or agreed to in writing, software\n     * distributed under the License is distributed on an \"AS IS\" BASIS,\n     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     * See the License for the specific language governing permissions and\n     * limitations under the License.\n     * =============================================================================\n     */", "url": "https://github.com/wangjia184/diffusion_model/blob/5ea111bd405c1f893976808b768681d61e11c979/docs/@tensorflow/tfjs/dist/tf.es2017.js#L78823-L78838", "sha": "5ea111bd405c1f893976808b768681d61e11c979"}1091{"repo_name": "diffusion_model", "dataset": "github_2023", "owner": "wangjia184", "lang": "javascript", "func_name": "transform$2", "code": "function transform$2(args) {\n        const { inputs, backend, attrs } = args;\n        const { image, transforms } = inputs;\n        const { interpolation, fillMode, fillValue, outputShape } = attrs;\n        const [batch, imageHeight, imageWidth, numChannels] = image.shape;\n        const [outHeight, outWidth] = outputShape != null ? outputShape : [imageHeight, imageWidth];\n        const outShape = [batch, outHeight, outWidth,\n            numChannels];\n        const program = new TransformProgram(imageHeight, imageWidth, interpolation, fillMode, fillValue, outShape);\n        return backend.runWebGLProgram(program, [image, transforms], 'float32');\n    }", "docstring": "/**\n     * @license\n     * Copyright 2021 Google LLC. All Rights Reserved.\n     * Licensed under the Apache License, Version 2.0 (the \"License\");\n     * you may not use this file except in compliance with the License.\n     * You may obtain a copy of the License at\n     *\n     * http://www.apache.org/licenses/LICENSE-2.0\n     *\n     * Unless required by applicable law or agreed to in writing, software\n     * distributed under the License is distributed on an \"AS IS\" BASIS,\n     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     * See the License for the specific language governing permissions and\n     * limitations under the License.\n     * =============================================================================\n     */", "url": "https://github.com/wangjia184/diffusion_model/blob/5ea111bd405c1f893976808b768681d61e11c979/docs/@tensorflow/tfjs/dist/tf.es2017.js#L101389-L101399", "sha": "5ea111bd405c1f893976808b768681d61e11c979"}1092{"repo_name": "diffusion_model", "dataset": "github_2023", "owner": "wangjia184", "lang": "javascript", "func_name": "bandPart_", "code": "function bandPart_(a, numLower, numUpper) {\n    assert(numLower % 1 === 0, () => `bandPart(): numLower must be an integer, got ${numLower}.`);\n    assert(numUpper % 1 === 0, () => `bandPart(): numUpper must be an integer, got ${numUpper}.`);\n    const $a = convertToTensor(a, 'a', 'bandPart');\n    assert($a.rank >= 2, () => `bandPart(): Rank must be at least 2, got ${$a.rank}.`);\n    const shape = $a.shape;\n    const [M, N] = $a.shape.slice(-2);\n    if (!(numLower <= M)) {\n        throw new Error(`bandPart(): numLower (${numLower})` +\n            ` must not be greater than the number of rows (${M}).`);\n    }\n    if (!(numUpper <= N)) {\n        throw new Error(`bandPart(): numUpper (${numUpper})` +\n            ` must not be greater than the number of columns (${N}).`);\n    }\n    if (numLower < 0) {\n        numLower = M;\n    }\n    if (numUpper < 0) {\n        numUpper = N;\n    }\n    const i = reshape(range(0, M, 1, 'int32'), [-1, 1]);\n    const j = range(0, N, 1, 'int32');\n    const ij = sub(i, j);\n    const inBand = logicalAnd(lessEqual(ij, scalar(+numLower, 'int32')), greaterEqual(ij, scalar(-numUpper, 'int32')));\n    const zero = zeros([M, N], $a.dtype);\n    return reshape(stack(unstack(reshape($a, [-1, M, N]))\n        .map(mat => where(inBand, mat, zero))), shape);\n}", "docstring": "/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */", "url": "https://github.com/wangjia184/diffusion_model/blob/5ea111bd405c1f893976808b768681d61e11c979/docs/@tensorflow/tfjs/dist/tf.fesm.js#L22236-L22264", "sha": "5ea111bd405c1f893976808b768681d61e11c979"}1093{"repo_name": "diffusion_model", "dataset": "github_2023", "owner": "wangjia184", "lang": "javascript", "func_name": "standardizeSampleOrClassWeights", "code": "function standardizeSampleOrClassWeights(xWeight, outputNames, weightType) {\n    const numOutputs = outputNames.length;\n    if (xWeight == null || (Array.isArray(xWeight) && xWeight.length === 0)) {\n        return outputNames.map(name => null);\n    }\n    if (numOutputs === 1) {\n        if (Array.isArray(xWeight) && xWeight.length === 1) {\n            return xWeight;\n        }\n        else if (typeof xWeight === 'object' && outputNames[0] in xWeight) {\n            return [xWeight[outputNames[0]]];\n        }\n        else {\n            return [xWeight];\n        }\n    }\n    if (Array.isArray(xWeight)) {\n        if (xWeight.length !== numOutputs) {\n            throw new Error(`Provided ${weightType} is an array of ${xWeight.length} ` +\n                `element(s), but the model has ${numOutputs} outputs. ` +\n                `Make sure a set of weights is provided for each model output.`);\n        }\n        return xWeight;\n    }\n    else if (typeof xWeight === 'object' && Object.keys(xWeight).length > 0 &&\n        typeof xWeight[Object.keys(xWeight)[0]] ===\n            'object') {\n        const output = [];\n        outputNames.forEach(outputName => {\n            if (outputName in xWeight) {\n                output.push(xWeight[outputName]);\n            }\n            else {\n                output.push(null);\n            }\n        });\n        return output;\n    }\n    else {\n        throw new Error(`The model has multiple (${numOutputs}) outputs, ` +\n            `so ${weightType} must be either an array with ` +\n            `${numOutputs} elements or an object with ${outputNames} keys. ` +\n            `Provided ${weightType} not understood: ${JSON.stringify(xWeight)}`);\n    }\n}", "docstring": "/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */", "url": "https://github.com/wangjia184/diffusion_model/blob/5ea111bd405c1f893976808b768681d61e11c979/docs/@tensorflow/tfjs/dist/tf.fesm.js#L42060-L42104", "sha": "5ea111bd405c1f893976808b768681d61e11c979"}1094{"repo_name": "diffusion_model", "dataset": "github_2023", "owner": "wangjia184", "lang": "javascript", "func_name": "gatherV2Impl", "code": "function gatherV2Impl(xBuf, indicesBuf, flattenOutputShape) {\n    const outBuf = buffer(flattenOutputShape, xBuf.dtype);\n    for (let i = 0; i < outBuf.size; ++i) {\n        const newLoc = outBuf.indexToLoc(i);\n        const originalLoc = newLoc.slice();\n        const batchIdx = originalLoc[0];\n        const indicesIdx = originalLoc[2];\n        const indicesIndex = indicesBuf.locToIndex([batchIdx, indicesIdx]);\n        originalLoc[2] = indicesBuf.values[indicesIndex];\n        const originalIndex = xBuf.locToIndex(originalLoc);\n        if (0 <= originalIndex && originalIndex < xBuf.values.length) {\n            outBuf.values[i] = xBuf.values[originalIndex];\n        } // Else, index is out of bounds, so leave the default zero val in outBuf.\n    }\n    return outBuf;\n}", "docstring": "/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */", "url": "https://github.com/wangjia184/diffusion_model/blob/5ea111bd405c1f893976808b768681d61e11c979/docs/@tensorflow/tfjs/dist/tf.fesm.js#L71298-L71313", "sha": "5ea111bd405c1f893976808b768681d61e11c979"}1095{"repo_name": "diffusion_model", "dataset": "github_2023", "owner": "wangjia184", "lang": "javascript", "func_name": "getEinsumPermutation", "code": "function getEinsumPermutation(nDims, idDims) {\n\t  var permutationIndices = new Array(nDims);\n\t  permutationIndices.fill(-1);\n\n\t  for (var i = 0; i < idDims.length; ++i) {\n\t    permutationIndices[idDims[i]] = i;\n\t  }\n\n\t  var expandDims = [];\n\n\t  for (var _i4 = 0; _i4 < nDims; ++_i4) {\n\t    if (permutationIndices[_i4] === -1) {\n\t      expandDims.push(_i4);\n\t    }\n\t  }\n\n\t  permutationIndices = permutationIndices.filter(function (d) {\n\t    return d !== -1;\n\t  });\n\t  return {\n\t    permutationIndices: permutationIndices,\n\t    expandDims: expandDims\n\t  };\n\t}", "docstring": "/**\n\t * Get the permutation for a given input tensor.\n\t *\n\t * @param nDims Total number of dimension of all tensors involved in the einsum\n\t *   operation.\n\t * @param idDims Dimension indices involve in the tensor in question.\n\t * @returns An object consisting of the following fields:\n\t *   - permutationIndices: Indices to permute the axes of the tensor with.\n\t *   - expandDims: Indices to the dimension that need to be expanded from the\n\t *     tensor after permutation.\n\t */", "url": "https://github.com/wangjia184/diffusion_model/blob/5ea111bd405c1f893976808b768681d61e11c979/docs/@tensorflow/tfjs/dist/tf.js#L48675-L48698", "sha": "5ea111bd405c1f893976808b768681d61e11c979"}1096{"repo_name": "diffusion_model", "dataset": "github_2023", "owner": "wangjia184", "lang": "javascript", "func_name": "truncatedNormal_", "code": "function truncatedNormal_(shape, mean = 0, stdDev = 1, dtype, seed) {\n    assertNonNegativeIntegerDimensions(shape);\n    if (dtype != null && dtype === 'bool') {\n        throw new Error(`Unsupported data type $ { dtype }`);\n    }\n    const randGauss = new MPRandGauss(mean, stdDev, dtype, true /* truncated */, seed);\n    const res = buffer(shape, dtype);\n    for (let i = 0; i < res.values.length; i++) {\n        res.values[i] = randGauss.nextValue();\n    }\n    return res.toTensor();\n}", "docstring": "/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */", "url": "https://github.com/wangjia184/diffusion_model/blob/5ea111bd405c1f893976808b768681d61e11c979/docs/@tensorflow/tfjs/dist/tf.node.js#L22415-L22426", "sha": "5ea111bd405c1f893976808b768681d61e11c979"}1097{"repo_name": "diffusion_model", "dataset": "github_2023", "owner": "wangjia184", "lang": "javascript", "func_name": "OptimizerConstructors.adadelta", "code": "static adadelta(learningRate = .001, rho = .95, epsilon = null) {\n        return new AdadeltaOptimizer(learningRate, rho, epsilon);\n    }", "docstring": "/**\n     * Constructs a `tf.AdadeltaOptimizer` that uses the Adadelta algorithm.\n     * See [https://arxiv.org/abs/1212.5701](https://arxiv.org/abs/1212.5701)\n     *\n     * @param learningRate The learning rate to use for the Adadelta gradient\n     * descent algorithm.\n     * @param rho The learning rate decay over each update.\n     * @param epsilon A constant epsilon used to better condition the grad\n     * update.\n     *\n     * @doc {heading: 'Training', subheading: 'Optimizers', namespace: 'train'}\n     */", "url": "https://github.com/wangjia184/diffusion_model/blob/5ea111bd405c1f893976808b768681d61e11c979/docs/@tensorflow/tfjs/dist/tf.node.js#L27574-L27576", "sha": "5ea111bd405c1f893976808b768681d61e11c979"}1098{"repo_name": "diffusion_model", "dataset": "github_2023", "owner": "wangjia184", "lang": "javascript", "func_name": "getComplexWithIndex", "code": "function getComplexWithIndex(complex, index) {\n    const real = complex[index * 2];\n    const imag = complex[index * 2 + 1];\n    return { real, imag };\n}", "docstring": "/**\n * Get the map representing a complex value in the given array.\n * @param complex The complex tensor values.\n * @param index An index of the target complex value.\n */", "url": "https://github.com/wangjia184/diffusion_model/blob/5ea111bd405c1f893976808b768681d61e11c979/docs/@tensorflow/tfjs/dist/tf.node.js#L28174-L28178", "sha": "5ea111bd405c1f893976808b768681d61e11c979"}1099{"repo_name": "diffusion_model", "dataset": "github_2023", "owner": "wangjia184", "lang": "javascript", "func_name": "Toast.Default", "code": "static get Default() {\n    return Default;\n  }", "docstring": "// Getters", "url": "https://github.com/wangjia184/diffusion_model/blob/5ea111bd405c1f893976808b768681d61e11c979/docs/bootstrap/dist/js/bootstrap.esm.js#L5031-L5033", "sha": "5ea111bd405c1f893976808b768681d61e11c979"}1100{"repo_name": "Software-Architecture-with-C-Sharp-12-and-.NET-8-4E", "dataset": "github_2023", "owner": "PacktPublishing", "lang": "javascript", "func_name": "createCache", "code": "function createCache() {\n\tvar keys = [];\n\n\tfunction cache( key, value ) {\n\n\t\t// Use (key + \" \") to avoid collision with native prototype properties (see Issue #157)\n\t\tif ( keys.push( key + \" \" ) > Expr.cacheLength ) {\n\n\t\t\t// Only keep the most recent entries\n\t\t\tdelete cache[ keys.shift() ];\n\t\t}\n\t\treturn ( cache[ key + \" \" ] = value );\n\t}\n\treturn cache;\n}", "docstring": "/**\n * Create key-value caches of limited size\n * @returns {function(string, object)} Returns the Object data after storing it on itself with\n *\tproperty name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)\n *\tdeleting the oldest entry\n */", "url": "https://github.com/PacktPublishing/Software-Architecture-with-C-Sharp-12-and-.NET-8-4E/blob/bb5f06a93c7a6ca281f88b0e3e16fb1302ebf943/ch11/MvcDockerTest/MvcDockerTest/wwwroot/lib/jquery/dist/jquery.js#L907-L921", "sha": "bb5f06a93c7a6ca281f88b0e3e16fb1302ebf943"}1101{"repo_name": "researchgpt", "dataset": "github_2023", "owner": "MrPeterJin", "lang": "javascript", "func_name": "findInsertionIndex", "code": "function findInsertionIndex(id) {\n    // the start index should be `flushIndex + 1`\n    let start = flushIndex + 1;\n    let end = queue.length;\n    while (start < end) {\n        const middle = (start + end) >>> 1;\n        const middleJobId = getId(queue[middle]);\n        middleJobId < id ? (start = middle + 1) : (end = middle);\n    }\n    return start;\n}", "docstring": "// #2768", "url": "https://github.com/MrPeterJin/researchgpt/blob/722c28ee04655cc4359c036f5186ae6b478110ee/frontend/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js#L266-L276", "sha": "722c28ee04655cc4359c036f5186ae6b478110ee"}1102{"repo_name": "researchgpt", "dataset": "github_2023", "owner": "MrPeterJin", "lang": "javascript", "func_name": "getTargetAttrs", "code": "function getTargetAttrs(tagName) {\n      if (attributes.cache[tagName]) {\n        return attributes.cache[tagName]\n      }\n      /** @type {string[]} */\n      const result = []\n      if (attributes.names[tagName]) {\n        result.push(...attributes.names[tagName])\n      }\n      for (const { name, attrs } of attributes.regexps) {\n        name.lastIndex = 0\n        if (name.test(tagName)) {\n          result.push(...attrs)\n        }\n      }\n      if (casing.isKebabCase(tagName)) {\n        result.push(...getTargetAttrs(casing.pascalCase(tagName)))\n      }\n\n      return (attributes.cache[tagName] = new Set(result))\n    }", "docstring": "/**\n     * Get the attribute to be verified from the element name.\n     * @param {string} tagName\n     * @returns {Set<string>}\n     */", "url": "https://github.com/MrPeterJin/researchgpt/blob/722c28ee04655cc4359c036f5186ae6b478110ee/frontend/node_modules/eslint-plugin-vue/lib/rules/no-bare-strings-in-template.js#L176-L196", "sha": "722c28ee04655cc4359c036f5186ae6b478110ee"}1103{"repo_name": "researchgpt", "dataset": "github_2023", "owner": "MrPeterJin", "lang": "javascript", "func_name": "isAwaitedPromise", "code": "function isAwaitedPromise(callExpression) {\n  if (callExpression.parent.type === 'AwaitExpression') {\n    // cases like `await nextTick()`\n    return true\n  }\n\n  if (callExpression.parent.type === 'ReturnStatement') {\n    // cases like `return nextTick()`\n    return true\n  }\n  if (\n    callExpression.parent.type === 'ArrowFunctionExpression' &&\n    callExpression.parent.body === callExpression\n  ) {\n    // cases like `() => nextTick()`\n    return true\n  }\n\n  if (\n    callExpression.parent.type === 'MemberExpression' &&\n    callExpression.parent.property.type === 'Identifier' &&\n    callExpression.parent.property.name === 'then'\n  ) {\n    // cases like `nextTick().then()`\n    return true\n  }\n\n  if (\n    callExpression.parent.type === 'VariableDeclarator' ||\n    callExpression.parent.type === 'AssignmentExpression'\n  ) {\n    // cases like `let foo = nextTick()` or `foo = nextTick()`\n    return true\n  }\n\n  if (\n    callExpression.parent.type === 'ArrayExpression' &&\n    callExpression.parent.parent.type === 'CallExpression' &&\n    callExpression.parent.parent.callee.type === 'MemberExpression' &&\n    callExpression.parent.parent.callee.object.type === 'Identifier' &&\n    callExpression.parent.parent.callee.object.name === 'Promise' &&\n    callExpression.parent.parent.callee.property.type === 'Identifier'\n  ) {\n    // cases like `Promise.all([nextTick()])`\n    return true\n  }\n\n  return false\n}", "docstring": "/**\n * @param {CallExpression} callExpression\n * @returns {boolean}\n */", "url": "https://github.com/MrPeterJin/researchgpt/blob/722c28ee04655cc4359c036f5186ae6b478110ee/frontend/node_modules/eslint-plugin-vue/lib/rules/valid-next-tick.js#L61-L109", "sha": "722c28ee04655cc4359c036f5186ae6b478110ee"}1104{"repo_name": "researchgpt", "dataset": "github_2023", "owner": "MrPeterJin", "lang": "javascript", "func_name": "buildVElementMatcher", "code": "function buildVElementMatcher(selectorValue, test) {\n    const val = selector.insensitive\n      ? selectorValue.toLowerCase()\n      : selectorValue\n    return (element) => {\n      const attrValue = getAttributeValue(element, key)\n      if (attrValue == null) {\n        return false\n      }\n      return test(\n        selector.insensitive ? attrValue.toLowerCase() : attrValue,\n        val\n      )\n    }\n  }", "docstring": "/**\n   * @param {string} selectorValue\n   * @param {(attrValue:string, selectorValue: string)=>boolean} test\n   * @returns {VElementMatcher}\n   */", "url": "https://github.com/MrPeterJin/researchgpt/blob/722c28ee04655cc4359c036f5186ae6b478110ee/frontend/node_modules/eslint-plugin-vue/lib/utils/selector.js#L298-L312", "sha": "722c28ee04655cc4359c036f5186ae6b478110ee"}1105{"repo_name": "researchgpt", "dataset": "github_2023", "owner": "MrPeterJin", "lang": "javascript", "func_name": "FlatESLint.constructor", "code": "constructor(options = {}) {\n\n        const defaultConfigs = [];\n        const processedOptions = processOptions(options);\n        const linter = new Linter({\n            cwd: processedOptions.cwd,\n            configType: \"flat\"\n        });\n\n        const cacheFilePath = getCacheFile(\n            processedOptions.cacheLocation,\n            processedOptions.cwd\n        );\n\n        const lintResultCache = processedOptions.cache\n            ? new LintResultCache(cacheFilePath, processedOptions.cacheStrategy)\n            : null;\n\n        privateMembers.set(this, {\n            options: processedOptions,\n            linter,\n            cacheFilePath,\n            lintResultCache,\n            defaultConfigs,\n            defaultIgnores: () => false,\n            configs: null\n        });\n\n        /**\n         * If additional plugins are passed in, add that to the default\n         * configs for this instance.\n         */\n        if (options.plugins) {\n\n            const plugins = {};\n\n            for (const [pluginName, plugin] of Object.entries(options.plugins)) {\n                plugins[naming.getShorthandName(pluginName, \"eslint-plugin\")] = plugin;\n            }\n\n            defaultConfigs.push({\n                plugins\n            });\n        }\n\n    }", "docstring": "/**\n     * Creates a new instance of the main ESLint API.\n     * @param {FlatESLintOptions} options The options for this instance.\n     */", "url": "https://github.com/MrPeterJin/researchgpt/blob/722c28ee04655cc4359c036f5186ae6b478110ee/frontend/node_modules/eslint/lib/eslint/flat-eslint.js#L589-L634", "sha": "722c28ee04655cc4359c036f5186ae6b478110ee"}1106{"repo_name": "researchgpt", "dataset": "github_2023", "owner": "MrPeterJin", "lang": "javascript", "func_name": "reportAccessingEval", "code": "function reportAccessingEval(globalScope) {\n            const variable = astUtils.getVariableByName(globalScope, \"eval\");\n\n            if (!variable) {\n                return;\n            }\n\n            const references = variable.references;\n\n            for (let i = 0; i < references.length; ++i) {\n                const reference = references[i];\n                const id = reference.identifier;\n\n                if (id.name === \"eval\" && !astUtils.isCallee(id)) {\n\n                    // Is accessing to eval (excludes direct calls to eval)\n                    report(id);\n                }\n            }\n        }", "docstring": "/**\n         * Reports all accesses of `eval` (excludes direct calls to eval).\n         * @param {eslint-scope.Scope} globalScope The global scope.\n         * @returns {void}\n         */", "url": "https://github.com/MrPeterJin/researchgpt/blob/722c28ee04655cc4359c036f5186ae6b478110ee/frontend/node_modules/eslint/lib/rules/no-eval.js#L174-L193", "sha": "722c28ee04655cc4359c036f5186ae6b478110ee"}1107{"repo_name": "researchgpt", "dataset": "github_2023", "owner": "MrPeterJin", "lang": "javascript", "func_name": "markReturnStatementsOnSegmentAsUsed", "code": "function markReturnStatementsOnSegmentAsUsed(segment) {\n            if (!segment.reachable) {\n                usedUnreachableSegments.add(segment);\n                segment.allPrevSegments\n                    .filter(isReturned)\n                    .filter(prevSegment => !usedUnreachableSegments.has(prevSegment))\n                    .forEach(markReturnStatementsOnSegmentAsUsed);\n                return;\n            }\n\n            const info = segmentInfoMap.get(segment);\n\n            for (const node of info.uselessReturns) {\n                remove(scopeInfo.uselessReturns, node);\n            }\n            info.uselessReturns = [];\n        }", "docstring": "/**\n         * Removes the return statements on the given segment from the useless return\n         * statement list.\n         *\n         * This segment may be an unreachable segment.\n         * In that case, the information object of the unreachable segment is not\n         * initialized because `onCodePathSegmentStart` event is not notified for\n         * unreachable segments.\n         * This goes to the previous segments of the unreachable segment recursively\n         * if the unreachable segment was generated by a return statement. Otherwise,\n         * this ignores the unreachable segment.\n         *\n         * This behavior would simulate code paths for the case that the return\n         * statement does not exist.\n         * @param {CodePathSegment} segment The segment to get return statements.\n         * @returns {void}\n         */", "url": "https://github.com/MrPeterJin/researchgpt/blob/722c28ee04655cc4359c036f5186ae6b478110ee/frontend/node_modules/eslint/lib/rules/no-useless-return.js#L157-L173", "sha": "722c28ee04655cc4359c036f5186ae6b478110ee"}1108{"repo_name": "researchgpt", "dataset": "github_2023", "owner": "MrPeterJin", "lang": "javascript", "func_name": "startsWithUpperCase", "code": "function startsWithUpperCase(s) {\n    return s[0] !== s[0].toLocaleLowerCase();\n}", "docstring": "/**\n * Checks whether the given string starts with uppercase or not.\n * @param {string} s The string to check.\n * @returns {boolean} `true` if the string starts with uppercase.\n */", "url": "https://github.com/MrPeterJin/researchgpt/blob/722c28ee04655cc4359c036f5186ae6b478110ee/frontend/node_modules/eslint/lib/rules/utils/ast-utils.js#L79-L81", "sha": "722c28ee04655cc4359c036f5186ae6b478110ee"}1109{"repo_name": "researchgpt", "dataset": "github_2023", "owner": "MrPeterJin", "lang": "javascript", "func_name": "isClosingParenToken", "code": "function isClosingParenToken(token) {\n    return token.value === \")\" && token.type === \"Punctuator\";\n}", "docstring": "/**\n * Checks if the given token is a closing parenthesis token or not.\n * @param {Token} token The token to check.\n * @returns {boolean} `true` if the token is a closing parenthesis token.\n */", "url": "https://github.com/MrPeterJin/researchgpt/blob/722c28ee04655cc4359c036f5186ae6b478110ee/frontend/node_modules/eslint/lib/rules/utils/ast-utils.js#L599-L601", "sha": "722c28ee04655cc4359c036f5186ae6b478110ee"}1110{"repo_name": "researchgpt", "dataset": "github_2023", "owner": "MrPeterJin", "lang": "javascript", "func_name": "isArrayLike", "code": "function isArrayLike(value) {\n  return value != null && isLength(value.length) && !isFunction(value);\n}", "docstring": "/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */", "url": "https://github.com/MrPeterJin/researchgpt/blob/722c28ee04655cc4359c036f5186ae6b478110ee/frontend/node_modules/lodash.merge/index.js#L1597-L1599", "sha": "722c28ee04655cc4359c036f5186ae6b478110ee"}1111{"repo_name": "researchgpt", "dataset": "github_2023", "owner": "MrPeterJin", "lang": "javascript", "func_name": "objectToString", "code": "function objectToString(value) {\n  return nativeObjectToString.call(value);\n}", "docstring": "/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */", "url": "https://github.com/MrPeterJin/researchgpt/blob/722c28ee04655cc4359c036f5186ae6b478110ee/frontend/node_modules/lodash/_objectToString.js#L18-L20", "sha": "722c28ee04655cc4359c036f5186ae6b478110ee"}1112{"repo_name": "researchgpt", "dataset": "github_2023", "owner": "MrPeterJin", "lang": "javascript", "func_name": "dropRightWhile", "code": "function dropRightWhile(array, predicate) {\n      return (array && array.length)\n        ? baseWhile(array, getIteratee(predicate, 3), true, true)\n        : [];\n    }", "docstring": "/**\n     * Creates a slice of `array` excluding elements dropped from the end.\n     * Elements are dropped until `predicate` returns falsey. The predicate is\n     * invoked with three arguments: (value, index, array).\n     *\n     * @static\n     * @memberOf _\n     * @since 3.0.0\n     * @category Array\n     * @param {Array} array The array to query.\n     * @param {Function} [predicate=_.identity] The function invoked per iteration.\n     * @returns {Array} Returns the slice of `array`.\n     * @example\n     *\n     * var users = [\n     *   { 'user': 'barney',  'active': true },\n     *   { 'user': 'fred',    'active': false },\n     *   { 'user': 'pebbles', 'active': false }\n     * ];\n     *\n     * _.dropRightWhile(users, function(o) { return !o.active; });\n     * // => objects for ['barney']\n     *\n     * // The `_.matches` iteratee shorthand.\n     * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });\n     * // => objects for ['barney', 'fred']\n     *\n     * // The `_.matchesProperty` iteratee shorthand.\n     * _.dropRightWhile(users, ['active', false]);\n     * // => objects for ['barney']\n     *\n     * // The `_.property` iteratee shorthand.\n     * _.dropRightWhile(users, 'active');\n     * // => objects for ['barney', 'fred', 'pebbles']\n     */", "url": "https://github.com/MrPeterJin/researchgpt/blob/722c28ee04655cc4359c036f5186ae6b478110ee/frontend/node_modules/lodash/lodash.js#L7190-L7194", "sha": "722c28ee04655cc4359c036f5186ae6b478110ee"}1113{"repo_name": "researchgpt", "dataset": "github_2023", "owner": "MrPeterJin", "lang": "javascript", "func_name": "browserConvert", "code": "function browserConvert(lodash, options) {\n  return baseConvert(lodash, lodash, options);\n}", "docstring": "/**\n * Converts `lodash` to an immutable auto-curried iteratee-first data-last\n * version with conversion `options` applied.\n *\n * @param {Function} lodash The lodash function to convert.\n * @param {Object} [options] The options object. See `baseConvert` for more details.\n * @returns {Function} Returns the converted `lodash`.\n */", "url": "https://github.com/MrPeterJin/researchgpt/blob/722c28ee04655cc4359c036f5186ae6b478110ee/frontend/node_modules/lodash/fp/_convertBrowser.js#L11-L13", "sha": "722c28ee04655cc4359c036f5186ae6b478110ee"}1114{"repo_name": "researchgpt", "dataset": "github_2023", "owner": "MrPeterJin", "lang": "javascript", "func_name": "Chunk.preRender", "code": "preRender(options, inputBase, snippets) {\n        const { _, getPropertyAccess, n } = snippets;\n        const magicString = new Bundle$1({ separator: `${n}${n}` });\n        this.usedModules = [];\n        this.indentString = getIndentString(this.orderedModules, options);\n        const renderOptions = {\n            dynamicImportFunction: options.dynamicImportFunction,\n            exportNamesByVariable: this.exportNamesByVariable,\n            format: options.format,\n            freeze: options.freeze,\n            indent: this.indentString,\n            namespaceToStringTag: options.namespaceToStringTag,\n            outputPluginDriver: this.pluginDriver,\n            snippets\n        };\n        // for static and dynamic entry points, inline the execution list to avoid loading latency\n        if (options.hoistTransitiveImports &&\n            !this.outputOptions.preserveModules &&\n            this.facadeModule !== null) {\n            for (const dep of this.dependencies) {\n                if (dep instanceof Chunk)\n                    this.inlineChunkDependencies(dep);\n            }\n        }\n        this.prepareModulesForRendering(snippets);\n        this.setIdentifierRenderResolutions(options);\n        let hoistedSource = '';\n        const renderedModules = this.renderedModules;\n        for (const module of this.orderedModules) {\n            let renderedLength = 0;\n            if (module.isIncluded() || this.includedNamespaces.has(module)) {\n                const source = module.render(renderOptions).trim();\n                renderedLength = source.length();\n                if (renderedLength) {\n                    if (options.compact && source.lastLine().includes('//'))\n                        source.append('\\n');\n                    this.renderedModuleSources.set(module, source);\n                    magicString.addSource(source);\n                    this.usedModules.push(module);\n                }\n                const namespace = module.namespace;\n                if (this.includedNamespaces.has(module) && !this.outputOptions.preserveModules) {\n                    const rendered = namespace.renderBlock(renderOptions);\n                    if (namespace.renderFirst())\n                        hoistedSource += n + rendered;\n                    else\n                        magicString.addSource(new MagicString(rendered));\n                }\n            }\n            const { renderedExports, removedExports } = module.getRenderedExports();\n            const { renderedModuleSources } = this;\n            renderedModules[module.id] = {\n                get code() {\n                    var _a, _b;\n                    return (_b = (_a = renderedModuleSources.get(module)) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : null;\n                },\n                originalLength: module.originalCode.length,\n                removedExports,\n                renderedExports,\n                renderedLength\n            };\n        }\n        if (hoistedSource)\n            magicString.prepend(hoistedSource + n + n);\n        if (this.needsExportsShim) {\n            magicString.prepend(`${n}${snippets.cnst} ${MISSING_EXPORT_SHIM_VARIABLE}${_}=${_}void 0;${n}${n}`);\n        }\n        if (options.compact) {\n            this.renderedSource = magicString;\n        }\n        else {\n            this.renderedSource = magicString.trim();\n        }\n        this.renderedHash = undefined;\n        if (this.isEmpty && this.getExportNames().length === 0 && this.dependencies.size === 0) {\n            const chunkName = this.getChunkName();\n            this.inputOptions.onwarn({\n                chunkName,\n                code: 'EMPTY_BUNDLE',\n                message: `Generated an empty chunk: \"${chunkName}\"`\n            });\n        }\n        this.setExternalRenderPaths(options, inputBase);\n        this.renderedDependencies = this.getChunkDependencyDeclarations(options, getPropertyAccess);\n        this.renderedExports =\n            this.exportMode === 'none'\n                ? []\n                : this.getChunkExportDeclarations(options.format, getPropertyAccess);\n    }", "docstring": "// prerender allows chunk hashes and names to be generated before finalizing", "url": "https://github.com/MrPeterJin/researchgpt/blob/722c28ee04655cc4359c036f5186ae6b478110ee/frontend/node_modules/rollup/dist/shared/rollup.js#L14880-L14968", "sha": "722c28ee04655cc4359c036f5186ae6b478110ee"}1115{"repo_name": "researchgpt", "dataset": "github_2023", "owner": "MrPeterJin", "lang": "javascript", "func_name": "generatedPositionAfter", "code": "function generatedPositionAfter(mappingA, mappingB) {\n  // Optimized for most common case\n  var lineA = mappingA.generatedLine;\n  var lineB = mappingB.generatedLine;\n  var columnA = mappingA.generatedColumn;\n  var columnB = mappingB.generatedColumn;\n  return lineB > lineA || lineB == lineA && columnB >= columnA ||\n         util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;\n}", "docstring": "/**\n * Determine whether mappingB is after mappingA with respect to generated\n * position.\n */", "url": "https://github.com/MrPeterJin/researchgpt/blob/722c28ee04655cc4359c036f5186ae6b478110ee/frontend/node_modules/source-map/lib/mapping-list.js#L14-L22", "sha": "722c28ee04655cc4359c036f5186ae6b478110ee"}1116{"repo_name": "researchgpt", "dataset": "github_2023", "owner": "MrPeterJin", "lang": "javascript", "func_name": "visit", "code": "function visit(cst, visitor) {\n    if ('type' in cst && cst.type === 'document')\n        cst = { start: cst.start, value: cst.value };\n    _visit(Object.freeze([]), cst, visitor);\n}", "docstring": "/**\n * Apply a visitor to a CST document or item.\n *\n * Walks through the tree (depth-first) starting from the root, calling a\n * `visitor` function with two arguments when entering each item:\n *   - `item`: The current item, which included the following members:\n *     - `start: SourceToken[]` โ€“ Source tokens before the key or value,\n *       possibly including its anchor or tag.\n *     - `key?: Token | null` โ€“ Set for pair values. May then be `null`, if\n *       the key before the `:` separator is empty.\n *     - `sep?: SourceToken[]` โ€“ Source tokens between the key and the value,\n *       which should include the `:` map value indicator if `value` is set.\n *     - `value?: Token` โ€“ The value of a sequence item, or of a map pair.\n *   - `path`: The steps from the root to the current node, as an array of\n *     `['key' | 'value', number]` tuples.\n *\n * The return value of the visitor may be used to control the traversal:\n *   - `undefined` (default): Do nothing and continue\n *   - `visit.SKIP`: Do not visit the children of this token, continue with\n *      next sibling\n *   - `visit.BREAK`: Terminate traversal completely\n *   - `visit.REMOVE`: Remove the current item, then continue with the next one\n *   - `number`: Set the index of the next step. This is useful especially if\n *     the index of the current token has changed.\n *   - `function`: Define the next visitor for this item. After the original\n *     visitor is called on item entry, next visitors are called after handling\n *     a non-empty `key` and when exiting the item.\n */", "url": "https://github.com/MrPeterJin/researchgpt/blob/722c28ee04655cc4359c036f5186ae6b478110ee/frontend/node_modules/vite/dist/node/chunks/dep-5605cfa4.js#L23806-L23810", "sha": "722c28ee04655cc4359c036f5186ae6b478110ee"}1117{"repo_name": "researchgpt", "dataset": "github_2023", "owner": "MrPeterJin", "lang": "javascript", "func_name": "VueElement._resolveDef", "code": "_resolveDef() {\n        this._resolved = true;\n        // set initial attrs\n        for (let i = 0; i < this.attributes.length; i++) {\n            this._setAttr(this.attributes[i].name);\n        }\n        // watch future attr changes\n        new MutationObserver(mutations => {\n            for (const m of mutations) {\n                this._setAttr(m.attributeName);\n            }\n        }).observe(this, { attributes: true });\n        const resolve = (def, isAsync = false) => {\n            const { props, styles } = def;\n            // cast Number-type props set before resolve\n            let numberProps;\n            if (props && !isArray(props)) {\n                for (const key in props) {\n                    const opt = props[key];\n                    if (opt === Number || (opt && opt.type === Number)) {\n                        if (key in this._props) {\n                            this._props[key] = toNumber(this._props[key]);\n                        }\n                        (numberProps || (numberProps = Object.create(null)))[camelize(key)] = true;\n                    }\n                }\n            }\n            this._numberProps = numberProps;\n            if (isAsync) {\n                // defining getter/setters on prototype\n                // for sync defs, this already happened in the constructor\n                this._resolveProps(def);\n            }\n            // apply CSS\n            this._applyStyles(styles);\n            // initial render\n            this._update();\n        };\n        const asyncDef = this._def.__asyncLoader;\n        if (asyncDef) {\n            asyncDef().then(def => resolve(def, true));\n        }\n        else {\n            resolve(this._def);\n        }\n    }", "docstring": "/**\n     * resolve inner component definition (handle possible async component)\n     */", "url": "https://github.com/MrPeterJin/researchgpt/blob/722c28ee04655cc4359c036f5186ae6b478110ee/frontend/node_modules/vue/dist/vue.esm-browser.js#L9958-L10003", "sha": "722c28ee04655cc4359c036f5186ae6b478110ee"}1118{"repo_name": "researchgpt", "dataset": "github_2023", "owner": "MrPeterJin", "lang": "javascript", "func_name": "useHydration", "code": "function useHydration() {\n  if (!IN_BROWSER) return ref(false);\n  const {\n    ssr\n  } = useDisplay();\n  if (ssr) {\n    const isMounted = ref(false);\n    onMounted(() => {\n      isMounted.value = true;\n    });\n    return isMounted;\n  } else {\n    return ref(true);\n  }\n}", "docstring": "// Utilities", "url": "https://github.com/MrPeterJin/researchgpt/blob/722c28ee04655cc4359c036f5186ae6b478110ee/frontend/node_modules/vuetify/dist/vuetify.esm.js#L9221-L9235", "sha": "722c28ee04655cc4359c036f5186ae6b478110ee"}1119{"repo_name": "ai-pr-reviewer", "dataset": "github_2023", "owner": "coderabbitai", "lang": "javascript", "func_name": "ReadableStreamDefaultReader.read", "code": "read() {\n            if (!IsReadableStreamDefaultReader(this)) {\n                return promiseRejectedWith(defaultReaderBrandCheckException('read'));\n            }\n            if (this._ownerReadableStream === undefined) {\n                return promiseRejectedWith(readerLockException('read from'));\n            }\n            let resolvePromise;\n            let rejectPromise;\n            const promise = newPromise((resolve, reject) => {\n                resolvePromise = resolve;\n                rejectPromise = reject;\n            });\n            const readRequest = {\n                _chunkSteps: chunk => resolvePromise({ value: chunk, done: false }),\n                _closeSteps: () => resolvePromise({ value: undefined, done: true }),\n                _errorSteps: e => rejectPromise(e)\n            };\n            ReadableStreamDefaultReaderRead(this, readRequest);\n            return promise;\n        }", "docstring": "/**\n         * Returns a promise that allows access to the next chunk from the stream's internal queue, if available.\n         *\n         * If reading a chunk causes the queue to become empty, more data will be pulled from the underlying source.\n         */", "url": "https://github.com/coderabbitai/ai-pr-reviewer/blob/d5ec3970b3acc4b9d673e6cd601bf4d3cf043b55/dist/index.js#L30824-L30844", "sha": "d5ec3970b3acc4b9d673e6cd601bf4d3cf043b55"}1120{"repo_name": "Jellystat", "dataset": "github_2023", "owner": "CyferShepard", "lang": "javascript", "func_name": "backup", "code": "async function backup(refLog) {\n  const config = await new configClass().getConfig();\n\n  if (config.error) {\n    refLog.logData.push({ color: \"red\", Message: \"Backup Failed: Failed to get config\" });\n    refLog.logData.push({ color: \"red\", Message: \"Backup Failed with errors\" });\n    Logging.updateLog(refLog.uuid, refLog.logData, taskstate.FAILED);\n    return;\n  }\n\n  refLog.logData.push({ color: \"lawngreen\", Message: \"Starting Backup\" });\n  const pool = new Pool({\n    user: postgresUser,\n    password: postgresPassword,\n    host: postgresIp,\n    port: postgresPort,\n    database: postgresDatabase,\n  });\n\n  // Get data from each table and append it to the backup file\n\n  try {\n    let now = moment();\n    const backuppath = \"./\" + backupfolder;\n\n    if (!fs.existsSync(backuppath)) {\n      fs.mkdirSync(backuppath);\n      console.log(\"Directory created successfully!\");\n    }\n    if (!checkFolderWritePermission(backuppath)) {\n      console.error(\"No write permissions for the folder:\", backuppath);\n      refLog.logData.push({ color: \"red\", Message: \"Backup Failed: No write permissions for the folder: \" + backuppath });\n      refLog.logData.push({ color: \"red\", Message: \"Backup Failed with errors\" });\n      Logging.updateLog(refLog.uuid, refLog.logData, taskstate.FAILED);\n      await pool.end();\n      return;\n    }\n\n    const ExcludedTables = config.settings?.ExcludedTables || [];\n\n    let filteredTables = tables.filter((table) => !ExcludedTables.includes(table.value));\n\n    if (filteredTables.length === 0) {\n      refLog.logData.push({ color: \"red\", Message: \"Backup Failed: No tables to backup\" });\n      refLog.logData.push({ color: \"red\", Message: \"Backup Failed with errors\" });\n      Logging.updateLog(refLog.uuid, refLog.logData, taskstate.FAILED);\n      await pool.end();\n      return;\n    }\n\n    // const backupPath = `../backup-data/backup_${now.format('yyyy-MM-DD HH-mm-ss')}.json`;\n    const directoryPath = path.join(__dirname, \"..\", backupfolder, `backup_${now.format(\"yyyy-MM-DD HH-mm-ss\")}.json`);\n    refLog.logData.push({ color: \"yellow\", Message: \"Begin Backup \" + directoryPath });\n    const stream = fs.createWriteStream(directoryPath, { flags: \"a\" });\n    stream.on(\"error\", (error) => {\n      refLog.logData.push({ color: \"red\", Message: \"Backup Failed: \" + error });\n      Logging.updateLog(refLog.uuid, refLog.logData, taskstate.FAILED);\n      return;\n    });\n    const backup_data = [];\n\n    for (let table of filteredTables) {\n      const query = `SELECT * FROM ${table.value}`;\n\n      const { rows } = await pool.query(query);\n      refLog.logData.push({ color: \"dodgerblue\", Message: `Saving ${rows.length} rows for table ${table.value}` });\n\n      backup_data.push({ [table.value]: rows });\n    }\n\n    await stream.write(JSON.stringify(backup_data));\n    stream.end();\n    refLog.logData.push({ color: \"lawngreen\", Message: \"Backup Complete\" });\n    refLog.logData.push({ color: \"dodgerblue\", Message: \"Removing old backups\" });\n\n    //Cleanup excess backups\n    let deleteCount = 0;\n    const directoryPathDelete = path.join(__dirname, \"..\", backupfolder);\n\n    const files = await new Promise((resolve, reject) => {\n      fs.readdir(directoryPathDelete, (err, files) => {\n        if (err) {\n          reject(err);\n        } else {\n          resolve(files);\n        }\n      });\n    });\n\n    let fileData = files\n      .filter((file) => file.endsWith(\".json\"))\n      .map((file) => {\n        const filePath = path.join(directoryPathDelete, file);\n        const stats = fs.statSync(filePath);\n        return {\n          name: file,\n          size: stats.size,\n          datecreated: stats.birthtime,\n        };\n      });\n\n    fileData = fileData.sort((a, b) => new Date(b.datecreated) - new Date(a.datecreated)).slice(5);\n\n    for (var oldBackup of fileData) {\n      const oldBackupFile = path.join(__dirname, \"..\", backupfolder, oldBackup.name);\n\n      await new Promise((resolve, reject) => {\n        fs.unlink(oldBackupFile, (err) => {\n          if (err) {\n            reject(err);\n          } else {\n            resolve();\n          }\n        });\n      });\n\n      deleteCount += 1;\n      refLog.logData.push({ color: \"yellow\", Message: `${oldBackupFile} has been deleted.` });\n    }\n\n    refLog.logData.push({ color: \"lawngreen\", Message: deleteCount + \" backups removed.\" });\n  } catch (error) {\n    console.log(error);\n    refLog.logData.push({ color: \"red\", Message: \"Backup Failed: \" + error });\n    Logging.updateLog(refLog.uuid, refLog.logData, taskstate.FAILED);\n  }\n\n  await pool.end();\n}", "docstring": "// Backup function", "url": "https://github.com/CyferShepard/Jellystat/blob/99a8c49e6e226636274d3be88f42622aa8e52880/backend/classes/backup.js#L31-L159", "sha": "99a8c49e6e226636274d3be88f42622aa8e52880"}1121{"repo_name": "internet_archive_downloader", "dataset": "github_2023", "owner": "elementdavv", "lang": "javascript", "func_name": "WritableStreamDefaultWriterAbort", "code": "function WritableStreamDefaultWriterAbort(writer, reason) {\n        const stream = writer._ownerWritableStream;\n        return WritableStreamAbort(stream, reason);\n    }", "docstring": "// A client of WritableStreamDefaultWriter may use these functions directly to bypass state check.", "url": "https://github.com/elementdavv/internet_archive_downloader/blob/c81f05f33498dbb771570cd22a2bca6fd779ebfd/moz/js/utils/ponyfill.es6.js#L2143-L2146", "sha": "c81f05f33498dbb771570cd22a2bca6fd779ebfd"}1122{"repo_name": "RazorSlices", "dataset": "github_2023", "owner": "DamianEdwards", "lang": "javascript", "func_name": "computeStyleTests", "code": "function computeStyleTests() {\n\n\t\t// This is a singleton, we need to execute it only once\n\t\tif ( !div ) {\n\t\t\treturn;\n\t\t}\n\n\t\tcontainer.style.cssText = \"position:absolute;left:-11111px;width:60px;\" +\n\t\t\t\"margin-top:1px;padding:0;border:0\";\n\t\tdiv.style.cssText =\n\t\t\t\"position:relative;display:block;box-sizing:border-box;overflow:scroll;\" +\n\t\t\t\"margin:auto;border:1px;padding:1px;\" +\n\t\t\t\"width:60%;top:1%\";\n\t\tdocumentElement.appendChild( container ).appendChild( div );\n\n\t\tvar divStyle = window.getComputedStyle( div );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\n\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\treliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;\n\n\t\t// Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3\n\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\tdiv.style.right = \"60%\";\n\t\tpixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;\n\n\t\t// Support: IE 9 - 11 only\n\t\t// Detect misreporting of content dimensions for box-sizing:border-box elements\n\t\tboxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;\n\n\t\t// Support: IE 9 only\n\t\t// Detect overflow:scroll screwiness (gh-3699)\n\t\t// Support: Chrome <=64\n\t\t// Don't get tricked when zoom affects offsetWidth (gh-4029)\n\t\tdiv.style.position = \"absolute\";\n\t\tscrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;\n\n\t\tdocumentElement.removeChild( container );\n\n\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t// it will also be a sign that checks already performed\n\t\tdiv = null;\n\t}", "docstring": "// Executing both pixelPosition & boxSizingReliable tests require only one layout", "url": "https://github.com/DamianEdwards/RazorSlices/blob/cf2e413551e49c3a3b40623ce020d678697f123a/samples/RazorSlices.Samples.WebApp/wwwroot/lib/jquery/dist/jquery.slim.js#L6522-L6564", "sha": "cf2e413551e49c3a3b40623ce020d678697f123a"}1123{"repo_name": "OpenCharacters", "dataset": "github_2023", "owner": "josephrocca", "lang": "javascript", "func_name": "escapeMarkdownV2", "code": "function escapeMarkdownV2(text) {\n  const ESCAPE_CHARACTERS = /[_*[\\]()~>#\\+\\-=|{}.!]/g;\n  return text.replace(ESCAPE_CHARACTERS, '\\\\$&');\n}", "docstring": "// Telegraf for Telegram bot integration", "url": "https://github.com/josephrocca/OpenCharacters/blob/bfc1acbc68c27434e24b6837678867cc439dbfba/plugins/telegram/server.js#L44-L47", "sha": "bfc1acbc68c27434e24b6837678867cc439dbfba"}1124{"repo_name": "socketioxide", "dataset": "github_2023", "owner": "Totodore", "lang": "javascript", "func_name": "ษตษตresolveDocument", "code": "function ษตษตresolveDocument(element) {\n    return { name: 'document', target: element.ownerDocument };\n}", "docstring": "/**\n *\n * @codeGenApi\n */", "url": "https://github.com/Totodore/socketioxide/blob/a480430ca3f611f9a550268e23d4ee455202e642/examples/angular-todomvc/dist/vendor.js#L24692-L24694", "sha": "a480430ca3f611f9a550268e23d4ee455202e642"}1125{"repo_name": "socketioxide", "dataset": "github_2023", "owner": "Totodore", "lang": "javascript", "func_name": "DomEventsPlugin.supports", "code": "supports(eventName) {\n        return true;\n    }", "docstring": "// This plugin should come last in the list of plugins, because it accepts all", "url": "https://github.com/Totodore/socketioxide/blob/a480430ca3f611f9a550268e23d4ee455202e642/examples/angular-todomvc/dist/vendor.js#L52229-L52231", "sha": "a480430ca3f611f9a550268e23d4ee455202e642"}1126{"repo_name": "socketioxide", "dataset": "github_2023", "owner": "Totodore", "lang": "javascript", "func_name": "formatCurrency", "code": "function formatCurrency(value, locale, currency, currencyCode, digitsInfo) {\n    const format = getLocaleNumberFormat(locale, NumberFormatStyle.Currency);\n    const pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));\n    pattern.minFrac = getNumberOfCurrencyDigits(currencyCode);\n    pattern.maxFrac = pattern.minFrac;\n    const res = formatNumberToLocaleString(value, pattern, locale, NumberSymbol.CurrencyGroup, NumberSymbol.CurrencyDecimal, digitsInfo);\n    return res\n        .replace(CURRENCY_CHAR, currency)\n        // if we have 2 time the currency character, the second one is ignored\n        .replace(CURRENCY_CHAR, '')\n        // If there is a spacing between currency character and the value and\n        // the currency character is supressed by passing an empty string, the\n        // spacing character would remain as part of the string. Then we\n        // should remove it.\n        .trim();\n}", "docstring": "/**\n * @ngModule CommonModule\n * @description\n *\n * Formats a number as currency using locale rules.\n *\n * @param value The number to format.\n * @param locale A locale code for the locale format rules to use.\n * @param currency A string containing the currency symbol or its name,\n * such as \"$\" or \"Canadian Dollar\". Used in output string, but does not affect the operation\n * of the function.\n * @param currencyCode The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)\n * currency code, such as `USD` for the US dollar and `EUR` for the euro.\n * Used to determine the number of digits in the decimal part.\n * @param digitInfo Decimal representation options, specified by a string in the following format:\n * `{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}`. See `DecimalPipe` for more details.\n *\n * @returns The formatted currency value.\n *\n * @see `formatNumber()`\n * @see `DecimalPipe`\n * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)\n *\n * @publicApi\n */", "url": "https://github.com/Totodore/socketioxide/blob/a480430ca3f611f9a550268e23d4ee455202e642/examples/angular-todomvc/dist/vendor.js#L57577-L57592", "sha": "a480430ca3f611f9a550268e23d4ee455202e642"}1127{"repo_name": "socketioxide", "dataset": "github_2023", "owner": "Totodore", "lang": "javascript", "func_name": "arrayIndexOfSorted", "code": "function arrayIndexOfSorted(array, value) {\n    return _arrayIndexOfSorted(array, value, 0);\n}", "docstring": "/**\n * Get an index of an `value` in a sorted `array`.\n *\n * NOTE:\n * - This uses binary search algorithm for fast removals.\n *\n * @param array A sorted array to binary search.\n * @param value The value to look for.\n * @returns index of the value.\n *   - positive index if value found.\n *   - negative index if value not found. (`~index` to get the value where it should have been\n *     located)\n */", "url": "https://github.com/Totodore/socketioxide/blob/a480430ca3f611f9a550268e23d4ee455202e642/examples/basic-crud-application/dist/vendor.js#L22443-L22445", "sha": "a480430ca3f611f9a550268e23d4ee455202e642"}1128{"repo_name": "socketioxide", "dataset": "github_2023", "owner": "Totodore", "lang": "javascript", "func_name": "createRootComponent", "code": "function createRootComponent(componentView, componentDef, rootLView, rootContext, hostFeatures) {\n    const tView = rootLView[TVIEW];\n    // Create directive instance with factory() and store at next index in viewData\n    const component = instantiateRootComponent(tView, rootLView, componentDef);\n    rootContext.components.push(component);\n    componentView[CONTEXT] = component;\n    hostFeatures && hostFeatures.forEach((feature) => feature(component, componentDef));\n    // We want to generate an empty QueryList for root content queries for backwards\n    // compatibility with ViewEngine.\n    if (componentDef.contentQueries) {\n        const tNode = getCurrentTNode();\n        ngDevMode && assertDefined(tNode, 'TNode expected');\n        componentDef.contentQueries(1 /* Create */, component, tNode.directiveStart);\n    }\n    const rootTNode = getCurrentTNode();\n    ngDevMode && assertDefined(rootTNode, 'tNode should have been already created');\n    if (tView.firstCreatePass &&\n        (componentDef.hostBindings !== null || componentDef.hostAttrs !== null)) {\n        setSelectedIndex(rootTNode.index);\n        const rootTView = rootLView[TVIEW];\n        registerHostBindingOpCodes(rootTView, rootTNode, rootLView, rootTNode.directiveStart, rootTNode.directiveEnd, componentDef);\n        invokeHostBindingsInCreationMode(componentDef, component);\n    }\n    return component;\n}", "docstring": "/**\n * Creates a root component and sets it up with features and host bindings. Shared by\n * renderComponent() and ViewContainerRef.createComponent().\n */", "url": "https://github.com/Totodore/socketioxide/blob/a480430ca3f611f9a550268e23d4ee455202e642/examples/basic-crud-application/dist/vendor.js#L30373-L30397", "sha": "a480430ca3f611f9a550268e23d4ee455202e642"}1129{"repo_name": "serverMmon", "dataset": "github_2023", "owner": "souying", "lang": "javascript", "func_name": "Plugin", "code": "function Plugin(option, _relatedTarget) {\n    return this.each(function () {\n      var $this   = $(this)\n      var data    = $this.data('bs.modal')\n      var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)\n\n      if (!data) $this.data('bs.modal', (data = new Modal(this, options)))\n      if (typeof option == 'string') data[option](_relatedTarget)\n      else if (options.show) data.show(_relatedTarget)\n    })\n  }", "docstring": "// MODAL PLUGIN DEFINITION", "url": "https://github.com/souying/serverMmon/blob/d4ab92bb36dc1e273810ba5f1e33aa209bd81335/admin/js/bootstrap.js#L1208-L1218", "sha": "d4ab92bb36dc1e273810ba5f1e33aa209bd81335"}1130{"repo_name": "FreshCryptoLib", "dataset": "github_2023", "owner": "rdubois-crypto", "lang": "javascript", "func_name": "Express", "code": "function Express(options) {\n        if (options === void 0) { options = {}; }\n        /**\n         * @inheritDoc\n         */\n        this.name = Express.id;\n        this._router = options.router || options.app;\n        this._methods = (Array.isArray(options.methods) ? options.methods : []).concat('use');\n    }", "docstring": "/**\n     * @inheritDoc\n     */", "url": "https://github.com/rdubois-crypto/FreshCryptoLib/blob/8179e08cac72072bd260796633fec41fdfd5b441/solidity/tests/hardhat/node_modules/@sentry/tracing/esm/integrations/express.js#L12-L20", "sha": "8179e08cac72072bd260796633fec41fdfd5b441"}1131{"repo_name": "FreshCryptoLib", "dataset": "github_2023", "owner": "rdubois-crypto", "lang": "javascript", "func_name": "log", "code": "function log (message, site) {\n  var haslisteners = eehaslisteners(process, 'deprecation')\n\n  // abort early if no destination\n  if (!haslisteners && this._ignored) {\n    return\n  }\n\n  var caller\n  var callFile\n  var callSite\n  var depSite\n  var i = 0\n  var seen = false\n  var stack = getStack()\n  var file = this._file\n\n  if (site) {\n    // provided site\n    depSite = site\n    callSite = callSiteLocation(stack[1])\n    callSite.name = depSite.name\n    file = callSite[0]\n  } else {\n    // get call site\n    i = 2\n    depSite = callSiteLocation(stack[i])\n    callSite = depSite\n  }\n\n  // get caller of deprecated thing in relation to file\n  for (; i < stack.length; i++) {\n    caller = callSiteLocation(stack[i])\n    callFile = caller[0]\n\n    if (callFile === file) {\n      seen = true\n    } else if (callFile === this._file) {\n      file = this._file\n    } else if (seen) {\n      break\n    }\n  }\n\n  var key = caller\n    ? depSite.join(':') + '__' + caller.join(':')\n    : undefined\n\n  if (key !== undefined && key in this._warned) {\n    // already warned\n    return\n  }\n\n  this._warned[key] = true\n\n  // generate automatic message from call site\n  var msg = message\n  if (!msg) {\n    msg = callSite === depSite || !callSite.name\n      ? defaultMessage(depSite)\n      : defaultMessage(callSite)\n  }\n\n  // emit deprecation if listeners exist\n  if (haslisteners) {\n    var err = DeprecationError(this._namespace, msg, stack.slice(i))\n    process.emit('deprecation', err)\n    return\n  }\n\n  // format and write message\n  var format = process.stderr.isTTY\n    ? formatColor\n    : formatPlain\n  var output = format.call(this, msg, caller, stack.slice(i))\n  process.stderr.write(output + '\\n', 'utf8')\n}", "docstring": "/**\n * Display deprecation message.\n */", "url": "https://github.com/rdubois-crypto/FreshCryptoLib/blob/8179e08cac72072bd260796633fec41fdfd5b441/solidity/tests/hardhat/node_modules/depd/index.js#L185-L261", "sha": "8179e08cac72072bd260796633fec41fdfd5b441"}1132{"repo_name": "FreshCryptoLib", "dataset": "github_2023", "owner": "rdubois-crypto", "lang": "javascript", "func_name": "Wordlist.split", "code": "split(mnemonic) {\n        return mnemonic.toLowerCase().split(/ +/g);\n    }", "docstring": "// Subclasses may override this", "url": "https://github.com/rdubois-crypto/FreshCryptoLib/blob/8179e08cac72072bd260796633fec41fdfd5b441/solidity/tests/hardhat/node_modules/ethers/dist/ethers.esm.js#L15522-L15524", "sha": "8179e08cac72072bd260796633fec41fdfd5b441"}1133{"repo_name": "FreshCryptoLib", "dataset": "github_2023", "owner": "rdubois-crypto", "lang": "javascript", "func_name": "dotindex", "code": "function dotindex(value) {\n  var match = lastDotRe.exec(value)\n\n  return match ? match.index + 1 : value.length\n}", "docstring": "// Get the position of the last dot in `value`.", "url": "https://github.com/rdubois-crypto/FreshCryptoLib/blob/8179e08cac72072bd260796633fec41fdfd5b441/solidity/tests/hardhat/node_modules/markdown-table/index.js#L246-L250", "sha": "8179e08cac72072bd260796633fec41fdfd5b441"}1134{"repo_name": "FreshCryptoLib", "dataset": "github_2023", "owner": "rdubois-crypto", "lang": "javascript", "func_name": "copyFromBufferString", "code": "function copyFromBufferString(n, list) {\n    var p = list.head;\n    var c = 1;\n    var ret = p.data;\n    n -= ret.length;\n    while (p = p.next) {\n      var str = p.data;\n      var nb = n > str.length ? str.length : n;\n      if (nb === str.length) ret += str;else ret += str.slice(0, n);\n      n -= nb;\n      if (n === 0) {\n        if (nb === str.length) {\n          ++c;\n          if (p.next) list.head = p.next;else list.head = list.tail = null;\n        } else {\n          list.head = p;\n          p.data = str.slice(nb);\n        }\n        break;\n      }\n      ++c;\n    }\n    list.length -= c;\n    return ret;\n  }", "docstring": "// Copies a specified amount of characters from the list of buffered data", "url": "https://github.com/rdubois-crypto/FreshCryptoLib/blob/8179e08cac72072bd260796633fec41fdfd5b441/solidity/tests/hardhat/node_modules/mocha/mocha.js#L4585-L4609", "sha": "8179e08cac72072bd260796633fec41fdfd5b441"}1135{"repo_name": "FreshCryptoLib", "dataset": "github_2023", "owner": "rdubois-crypto", "lang": "javascript", "func_name": "Sender.doPong", "code": "doPong(data, mask, readOnly, cb) {\n    this.sendFrame(\n      Sender.frame(data, {\n        fin: true,\n        rsv1: false,\n        opcode: 0x0a,\n        mask,\n        readOnly\n      }),\n      cb\n    );\n  }", "docstring": "/**\n   * Frames and sends a pong message.\n   *\n   * @param {Buffer} data The message to send\n   * @param {Boolean} [mask=false] Specifies whether or not to mask `data`\n   * @param {Boolean} [readOnly=false] Specifies whether `data` can be modified\n   * @param {Function} [cb] Callback\n   * @private\n   */", "url": "https://github.com/rdubois-crypto/FreshCryptoLib/blob/8179e08cac72072bd260796633fec41fdfd5b441/solidity/tests/hardhat/node_modules/ws/lib/sender.js#L231-L242", "sha": "8179e08cac72072bd260796633fec41fdfd5b441"}1136{"repo_name": "FreshCryptoLib", "dataset": "github_2023", "owner": "rdubois-crypto", "lang": "javascript", "func_name": "socketOnError", "code": "function socketOnError() {\n  this.destroy();\n}", "docstring": "/**\n * Handle premature socket errors.\n *\n * @private\n */", "url": "https://github.com/rdubois-crypto/FreshCryptoLib/blob/8179e08cac72072bd260796633fec41fdfd5b441/solidity/tests/hardhat/node_modules/ws/lib/websocket-server.js#L371-L373", "sha": "8179e08cac72072bd260796633fec41fdfd5b441"}1137{"repo_name": "FreshCryptoLib", "dataset": "github_2023", "owner": "rdubois-crypto", "lang": "javascript", "func_name": "Progress", "code": "function Progress(runner, options) {\n  Base.call(this, runner, options);\n\n  var self = this;\n  var width = (Base.window.width * 0.5) | 0;\n  var total = runner.total;\n  var complete = 0;\n  var lastN = -1;\n\n  // default chars\n  options = options || {};\n  var reporterOptions = options.reporterOptions || {};\n\n  options.open = reporterOptions.open || '[';\n  options.complete = reporterOptions.complete || 'โ–ฌ';\n  options.incomplete = reporterOptions.incomplete || Base.symbols.dot;\n  options.close = reporterOptions.close || ']';\n  options.verbose = reporterOptions.verbose || false;\n\n  // tests started\n  runner.on(EVENT_RUN_BEGIN, function() {\n    process.stdout.write('\\n');\n    cursor.hide();\n  });\n\n  // tests complete\n  runner.on(EVENT_TEST_END, function() {\n    complete++;\n\n    var percent = complete / total;\n    var n = (width * percent) | 0;\n    var i = width - n;\n\n    if (n === lastN && !options.verbose) {\n      // Don't re-render the line if it hasn't changed\n      return;\n    }\n    lastN = n;\n\n    cursor.CR();\n    process.stdout.write('\\u001b[J');\n    process.stdout.write(color('progress', '  ' + options.open));\n    process.stdout.write(Array(n).join(options.complete));\n    process.stdout.write(Array(i).join(options.incomplete));\n    process.stdout.write(color('progress', options.close));\n    if (options.verbose) {\n      process.stdout.write(color('progress', ' ' + complete + ' of ' + total));\n    }\n  });\n\n  // tests are complete, output some stats\n  // and the failures if any\n  runner.once(EVENT_RUN_END, function() {\n    cursor.show();\n    process.stdout.write('\\n');\n    self.epilogue();\n  });\n}", "docstring": "/**\n * Constructs a new `Progress` reporter instance.\n *\n * @public\n * @class\n * @memberof Mocha.reporters\n * @extends Mocha.reporters.Base\n * @param {Runner} runner - Instance triggers reporter actions.\n * @param {Object} [options] - runner options\n */", "url": "https://github.com/rdubois-crypto/FreshCryptoLib/blob/8179e08cac72072bd260796633fec41fdfd5b441/solidity/tests/hardhat/node_modules/eth-gas-reporter/node_modules/mocha/lib/reporters/progress.js#L40-L97", "sha": "8179e08cac72072bd260796633fec41fdfd5b441"}1138{"repo_name": "FreshCryptoLib", "dataset": "github_2023", "owner": "rdubois-crypto", "lang": "javascript", "func_name": "getAllKeys", "code": "function getAllKeys(object) {\n      return baseGetAllKeys(object, keys, getSymbols);\n    }", "docstring": "/**\n     * Creates an array of own enumerable property names and symbols of `object`.\n     *\n     * @private\n     * @param {Object} object The object to query.\n     * @returns {Array} Returns the array of property names and symbols.\n     */", "url": "https://github.com/rdubois-crypto/FreshCryptoLib/blob/8179e08cac72072bd260796633fec41fdfd5b441/solidity/tests/hardhat/node_modules/lodash/lodash.js#L5915-L5917", "sha": "8179e08cac72072bd260796633fec41fdfd5b441"}1139{"repo_name": "FreshCryptoLib", "dataset": "github_2023", "owner": "rdubois-crypto", "lang": "javascript", "func_name": "memoizeCapped", "code": "function memoizeCapped(func) {\n      var result = memoize(func, function(key) {\n        if (cache.size === MAX_MEMOIZE_SIZE) {\n          cache.clear();\n        }\n        return key;\n      });\n\n      var cache = result.cache;\n      return result;\n    }", "docstring": "/**\n     * A specialized version of `_.memoize` which clears the memoized function's\n     * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n     *\n     * @private\n     * @param {Function} func The function to have its output memoized.\n     * @returns {Function} Returns the new memoized function.\n     */", "url": "https://github.com/rdubois-crypto/FreshCryptoLib/blob/8179e08cac72072bd260796633fec41fdfd5b441/solidity/tests/hardhat/node_modules/lodash/lodash.js#L6488-L6498", "sha": "8179e08cac72072bd260796633fec41fdfd5b441"}1140{"repo_name": "FreshCryptoLib", "dataset": "github_2023", "owner": "rdubois-crypto", "lang": "javascript", "func_name": "baseLt", "code": "function baseLt(value, other) {\n  return value < other;\n}", "docstring": "/**\n * The base implementation of `_.lt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`,\n *  else `false`.\n */", "url": "https://github.com/rdubois-crypto/FreshCryptoLib/blob/8179e08cac72072bd260796633fec41fdfd5b441/solidity/tests/hardhat/node_modules/lodash/_baseLt.js#L10-L12", "sha": "8179e08cac72072bd260796633fec41fdfd5b441"}1141{"repo_name": "FreshCryptoLib", "dataset": "github_2023", "owner": "rdubois-crypto", "lang": "javascript", "func_name": "httpFetch", "code": "async function httpFetch (fetchParams) {\n  // 1. Let request be fetchParamsโ€™s request.\n  const request = fetchParams.request\n\n  // 2. Let response be null.\n  let response = null\n\n  // 3. Let actualResponse be null.\n  let actualResponse = null\n\n  // 4. Let timingInfo be fetchParamsโ€™s timing info.\n  const timingInfo = fetchParams.timingInfo\n\n  // 5. If requestโ€™s service-workers mode is \"all\", then:\n  if (request.serviceWorkers === 'all') {\n    // TODO\n  }\n\n  // 6. If response is null, then:\n  if (response === null) {\n    // 1. If makeCORSPreflight is true and one of these conditions is true:\n    // TODO\n\n    // 2. If requestโ€™s redirect mode is \"follow\", then set requestโ€™s\n    // service-workers mode to \"none\".\n    if (request.redirect === 'follow') {\n      request.serviceWorkers = 'none'\n    }\n\n    // 3. Set response and actualResponse to the result of running\n    // HTTP-network-or-cache fetch given fetchParams.\n    actualResponse = response = await httpNetworkOrCacheFetch(fetchParams)\n\n    // 4. If requestโ€™s response tainting is \"cors\" and a CORS check\n    // for request and response returns failure, then return a network error.\n    if (\n      request.responseTainting === 'cors' &&\n      corsCheck(request, response) === 'failure'\n    ) {\n      return makeNetworkError('cors failure')\n    }\n\n    // 5. If the TAO check for request and response returns failure, then set\n    // requestโ€™s timing allow failed flag.\n    if (TAOCheck(request, response) === 'failure') {\n      request.timingAllowFailed = true\n    }\n  }\n\n  // 7. If either requestโ€™s response tainting or responseโ€™s type\n  // is \"opaque\", and the cross-origin resource policy check with\n  // requestโ€™s origin, requestโ€™s client, requestโ€™s destination,\n  // and actualResponse returns blocked, then return a network error.\n  if (\n    (request.responseTainting === 'opaque' || response.type === 'opaque') &&\n    crossOriginResourcePolicyCheck(\n      request.origin,\n      request.client,\n      request.destination,\n      actualResponse\n    ) === 'blocked'\n  ) {\n    return makeNetworkError('blocked')\n  }\n\n  // 8. If actualResponseโ€™s status is a redirect status, then:\n  if (redirectStatus.includes(actualResponse.status)) {\n    // 1. If actualResponseโ€™s status is not 303, requestโ€™s body is not null,\n    // and the connection uses HTTP/2, then user agents may, and are even\n    // encouraged to, transmit an RST_STREAM frame.\n    // See, https://github.com/whatwg/fetch/issues/1288\n    if (request.redirect !== 'manual') {\n      fetchParams.controller.connection.destroy()\n    }\n\n    // 2. Switch on requestโ€™s redirect mode:\n    if (request.redirect === 'error') {\n      // Set response to a network error.\n      response = makeNetworkError('unexpected redirect')\n    } else if (request.redirect === 'manual') {\n      // Set response to an opaque-redirect filtered response whose internal\n      // response is actualResponse.\n      // NOTE(spec): On the web this would return an `opaqueredirect` response,\n      // but that doesn't make sense server side.\n      // See https://github.com/nodejs/undici/issues/1193.\n      response = actualResponse\n    } else if (request.redirect === 'follow') {\n      // Set response to the result of running HTTP-redirect fetch given\n      // fetchParams and response.\n      response = await httpRedirectFetch(fetchParams, response)\n    } else {\n      assert(false)\n    }\n  }\n\n  // 9. Set responseโ€™s timing info to timingInfo.\n  response.timingInfo = timingInfo\n\n  // 10. Return response.\n  return response\n}", "docstring": "// https://fetch.spec.whatwg.org/#http-fetch", "url": "https://github.com/rdubois-crypto/FreshCryptoLib/blob/8179e08cac72072bd260796633fec41fdfd5b441/solidity/tests/hardhat/node_modules/undici/lib/fetch/index.js#L999-L1099", "sha": "8179e08cac72072bd260796633fec41fdfd5b441"}1142{"repo_name": "FreshCryptoLib", "dataset": "github_2023", "owner": "rdubois-crypto", "lang": "javascript", "func_name": "Miner.mine", "code": "async mine(iterations = 0) {\n        const solution = await this.iterate(iterations);\n        if (solution) {\n            if (this.block) {\n                const data = this.block.toJSON();\n                data.header.mixHash = solution.mixHash;\n                data.header.nonce = solution.nonce;\n                return ethereumjs_block_1.Block.fromBlockData(data, { common: this.block._common });\n            }\n            else {\n                const data = this.blockHeader.toJSON();\n                data.mixHash = solution.mixHash;\n                data.nonce = solution.nonce;\n                return ethereumjs_block_1.BlockHeader.fromHeaderData(data, { common: this.blockHeader._common });\n            }\n        }\n    }", "docstring": "/**\n     * Iterate `iterations` time over nonces, returns a `BlockHeader` or `Block` if a solution is found, `undefined` otherwise\n     * @param iterations - Number of iterations to iterate over. If `-1` is passed, the loop runs until a solution is found\n     * @returns - `undefined` if no solution was found within the iterations, or a `BlockHeader` or `Block`\n     *           with valid PoW based upon what was passed in the constructor\n     */", "url": "https://github.com/rdubois-crypto/FreshCryptoLib/blob/8179e08cac72072bd260796633fec41fdfd5b441/solidity/tests/hardhat/node_modules/@nomicfoundation/ethereumjs-ethash/dist/index.js#L50-L66", "sha": "8179e08cac72072bd260796633fec41fdfd5b441"}1143{"repo_name": "FreshCryptoLib", "dataset": "github_2023", "owner": "rdubois-crypto", "lang": "javascript", "func_name": "trap", "code": "function trap(err) {\n    // TODO: facilitate extra data along with errors\n    throw new exceptions_1.EvmError(err);\n}", "docstring": "/**\n * Wraps error message as EvmError\n */", "url": "https://github.com/rdubois-crypto/FreshCryptoLib/blob/8179e08cac72072bd260796633fec41fdfd5b441/solidity/tests/hardhat/node_modules/@nomicfoundation/ethereumjs-evm/dist/opcodes/util.js#L27-L30", "sha": "8179e08cac72072bd260796633fec41fdfd5b441"}1144{"repo_name": "FreshCryptoLib", "dataset": "github_2023", "owner": "rdubois-crypto", "lang": "javascript", "func_name": "DefaultStateManager.getProof", "code": "async getProof(address, storageSlots = []) {\n        const account = await this.getAccount(address);\n        const accountProof = (await this._trie.createProof(address.buf)).map((p) => (0, ethereumjs_util_1.bufferToHex)(p));\n        const storageProof = [];\n        const storageTrie = await this._getStorageTrie(address);\n        for (const storageKey of storageSlots) {\n            const proof = (await storageTrie.createProof(storageKey)).map((p) => (0, ethereumjs_util_1.bufferToHex)(p));\n            let value = (0, ethereumjs_util_1.bufferToHex)(await this.getContractStorage(address, storageKey));\n            if (value === '0x') {\n                value = '0x0';\n            }\n            const proofItem = {\n                key: (0, ethereumjs_util_1.bufferToHex)(storageKey),\n                value,\n                proof,\n            };\n            storageProof.push(proofItem);\n        }\n        const returnValue = {\n            address: address.toString(),\n            balance: (0, ethereumjs_util_1.bigIntToHex)(account.balance),\n            codeHash: (0, ethereumjs_util_1.bufferToHex)(account.codeHash),\n            nonce: (0, ethereumjs_util_1.bigIntToHex)(account.nonce),\n            storageHash: (0, ethereumjs_util_1.bufferToHex)(account.storageRoot),\n            accountProof,\n            storageProof,\n        };\n        return returnValue;\n    }", "docstring": "/**\n     * Get an EIP-1186 proof\n     * @param address address to get proof of\n     * @param storageSlots storage slots to get proof of\n     */", "url": "https://github.com/rdubois-crypto/FreshCryptoLib/blob/8179e08cac72072bd260796633fec41fdfd5b441/solidity/tests/hardhat/node_modules/@nomicfoundation/ethereumjs-statemanager/dist/stateManager.js#L250-L278", "sha": "8179e08cac72072bd260796633fec41fdfd5b441"}1145{"repo_name": "FreshCryptoLib", "dataset": "github_2023", "owner": "rdubois-crypto", "lang": "javascript", "func_name": "generatorEqual", "code": "function generatorEqual(leftHandOperand, rightHandOperand, options) {\n  return iterableEqual(getGeneratorEntries(leftHandOperand), getGeneratorEntries(rightHandOperand), options);\n}", "docstring": "/*!\n * Simple equality for generator objects such as those returned by generator functions.\n *\n * @param {Iterable} leftHandOperand\n * @param {Iterable} rightHandOperand\n * @param {Object} [options] (Optional)\n * @return {Boolean} result\n */", "url": "https://github.com/rdubois-crypto/FreshCryptoLib/blob/8179e08cac72072bd260796633fec41fdfd5b441/solidity/tests/hardhat/node_modules/deep-eql/index.js#L330-L332", "sha": "8179e08cac72072bd260796633fec41fdfd5b441"}1146{"repo_name": "FreshCryptoLib", "dataset": "github_2023", "owner": "rdubois-crypto", "lang": "javascript", "func_name": "errorDiff", "code": "function errorDiff(actual, expected) {\n  return diff\n    .diffWordsWithSpace(actual, expected)\n    .map(function(str) {\n      if (str.added) {\n        return colorLines('diff added', str.value);\n      }\n      if (str.removed) {\n        return colorLines('diff removed', str.value);\n      }\n      return str.value;\n    })\n    .join('');\n}", "docstring": "/**\n * Returns character diff for `err`.\n *\n * @private\n * @param {String} actual\n * @param {String} expected\n * @return {string} the diff\n */", "url": "https://github.com/rdubois-crypto/FreshCryptoLib/blob/8179e08cac72072bd260796633fec41fdfd5b441/solidity/tests/hardhat/node_modules/solidity-coverage/node_modules/mocha/mocha.js#L2836-L2849", "sha": "8179e08cac72072bd260796633fec41fdfd5b441"}1147{"repo_name": "FreshCryptoLib", "dataset": "github_2023", "owner": "rdubois-crypto", "lang": "javascript", "func_name": "_interopRequireDefault", "code": "function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }", "docstring": "/*istanbul ignore start*/", "url": "https://github.com/rdubois-crypto/FreshCryptoLib/blob/8179e08cac72072bd260796633fec41fdfd5b441/solidity/tests/hardhat/node_modules/solidity-coverage/node_modules/mocha/mocha.js#L11230-L11230", "sha": "8179e08cac72072bd260796633fec41fdfd5b441"}1148{"repo_name": "torch-merf", "dataset": "github_2023", "owner": "ashawkey", "lang": "javascript", "func_name": "TorusGeometry", "code": "function TorusGeometry( radius, tube, radialSegments, tubularSegments, arc ) {\n\n\t\tGeometry.call( this );\n\n\t\tthis.type = 'TorusGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\ttube: tube,\n\t\t\tradialSegments: radialSegments,\n\t\t\ttubularSegments: tubularSegments,\n\t\t\tarc: arc\n\t\t};\n\n\t\tthis.fromBufferGeometry( new TorusBufferGeometry( radius, tube, radialSegments, tubularSegments, arc ) );\n\t\tthis.mergeVertices();\n\n\t}", "docstring": "/**\n\t * @author oosmoxiecode\n\t * @author mrdoob / http://mrdoob.com/\n\t * @author Mugen87 / https://github.com/Mugen87\n\t */", "url": "https://github.com/ashawkey/torch-merf/blob/a669be605349c3af5167832f8ead6f69bbf8e697/renderer/third_party/three.js#L29523-L29540", "sha": "a669be605349c3af5167832f8ead6f69bbf8e697"}1149{"repo_name": "halo-theme-dream2.0", "dataset": "github_2023", "owner": "nineya", "lang": "javascript", "func_name": "TokenTreeEmitter.addSublanguage", "code": "addSublanguage(emitter, name) {\n    /** @type DataNode */\n    const node = emitter.root;\n    node.kind = name;\n    node.sublanguage = true;\n    this.add(node);\n  }", "docstring": "/**\n   * @param {Emitter & {root: DataNode}} emitter\n   * @param {string} name\n   */", "url": "https://github.com/nineya/halo-theme-dream2.0/blob/3fdaf6a59b976a36962e905cc230bdbf2a04708f/templates/assets/lib/highlightjs@11.5.1/es/highlight.js#L346-L352", "sha": "3fdaf6a59b976a36962e905cc230bdbf2a04708f"}1150{"repo_name": "ai-codereviewer", "dataset": "github_2023", "owner": "aidar-freeed", "lang": "javascript", "func_name": "dateTimeDeserializer", "code": "function dateTimeDeserializer(key, value) {\n                    if (typeof value === 'string') {\n                        const a = new Date(value);\n                        if (!isNaN(a.valueOf())) {\n                            return a;\n                        }\n                    }\n                    return value;\n                }", "docstring": "// get the result from the body", "url": "https://github.com/aidar-freeed/ai-codereviewer/blob/a9a064dfa1db8c83f40ef63f6e247fa09c935ed6/dist/index.js#L1877-L1885", "sha": "a9a064dfa1db8c83f40ef63f6e247fa09c935ed6"}1151{"repo_name": "ai-codereviewer", "dataset": "github_2023", "owner": "aidar-freeed", "lang": "javascript", "func_name": "AbortController.signal", "code": "get signal() {\n        return getSignal(this);\n    }", "docstring": "/**\n     * Returns the `AbortSignal` object associated with this object.\n     */", "url": "https://github.com/aidar-freeed/ai-codereviewer/blob/a9a064dfa1db8c83f40ef63f6e247fa09c935ed6/dist/index.js#L4339-L4341", "sha": "a9a064dfa1db8c83f40ef63f6e247fa09c935ed6"}1152{"repo_name": "ai-codereviewer", "dataset": "github_2023", "owner": "aidar-freeed", "lang": "javascript", "func_name": "ReadableStreamDefaultController.desiredSize", "code": "get desiredSize() {\n            if (!IsReadableStreamDefaultController(this)) {\n                throw defaultControllerBrandCheckException$1('desiredSize');\n            }\n            return ReadableStreamDefaultControllerGetDesiredSize(this);\n        }", "docstring": "/**\n         * Returns the desired size to fill the controlled stream's internal queue. It can be negative, if the queue is\n         * over-full. An underlying source ought to use this information to determine when and how to apply backpressure.\n         */", "url": "https://github.com/aidar-freeed/ai-codereviewer/blob/a9a064dfa1db8c83f40ef63f6e247fa09c935ed6/dist/index.js#L12319-L12324", "sha": "a9a064dfa1db8c83f40ef63f6e247fa09c935ed6"}1153{"repo_name": "stable-diffusion-webui-vectorstudio", "dataset": "github_2023", "owner": "GeorgLegato", "lang": "javascript", "func_name": "Ellipse$1", "code": "function Ellipse$1(rx,ry,ax){if(!(this instanceof Ellipse$1)){return new Ellipse$1(rx,ry,ax);}this.rx=rx;this.ry=ry;this.ax=ax;}// Apply a linear transform m to the ellipse", "docstring": "// Class constructor :", "url": "https://github.com/GeorgLegato/stable-diffusion-webui-vectorstudio/blob/03535f64caef1de151122574cf4a39943db6e1eb/scripts/editor/Editor.js#L19848-L19848", "sha": "03535f64caef1de151122574cf4a39943db6e1eb"}1154{"repo_name": "stable-diffusion-webui-vectorstudio", "dataset": "github_2023", "owner": "GeorgLegato", "lang": "javascript", "func_name": "MainMenu.savePreferences", "code": "async savePreferences(e) {\n      const {\n        lang,\n        bgcolor,\n        bgurl,\n        gridsnappingon,\n        gridsnappingstep,\n        gridcolor,\n        showrulers,\n        baseunit\n      } = e.detail;\n      // Set background\n      this.editor.setBackground(bgcolor, bgurl);\n\n      // set language\n      if (lang && lang !== this.editor.configObj.pref('lang')) {\n        this.editor.configObj.pref('lang', lang);\n        seAlert('Changing the language needs reload');\n      }\n\n      // set grid setting\n      this.editor.configObj.curConfig.gridSnapping = gridsnappingon;\n      this.editor.configObj.curConfig.snappingStep = gridsnappingstep;\n      this.editor.configObj.curConfig.gridColor = gridcolor;\n      this.editor.configObj.curConfig.showRulers = showrulers;\n      if (this.editor.configObj.curConfig.showRulers) {\n        this.editor.rulers.updateRulers();\n      }\n      this.editor.configObj.curConfig.baseUnit = baseunit;\n      this.editor.svgCanvas.setConfig(this.editor.configObj.curConfig);\n      this.editor.updateCanvas();\n      this.hidePreferences();\n    }", "docstring": "/**\n     * Save user preferences based on current values in the UI.\n     * @param {Event} e\n     * @function module:SVGthis.savePreferences\n     * @returns {Promise<void>}\n     */", "url": "https://github.com/GeorgLegato/stable-diffusion-webui-vectorstudio/blob/03535f64caef1de151122574cf4a39943db6e1eb/scripts/editor/iife-Editor.js#L33348-L33380", "sha": "03535f64caef1de151122574cf4a39943db6e1eb"}1155{"repo_name": "stable-diffusion-webui-vectorstudio", "dataset": "github_2023", "owner": "GeorgLegato", "lang": "javascript", "func_name": "keyDown", "code": "function keyDown(e) {\n      if (e.target.value === '' && e.target !== hex && (bindedHex && e.target !== bindedHex || !bindedHex)) return undefined;\n      if (!validateKey(e)) return e;\n      switch (e.target) {\n        case red:\n          switch (e.keyCode) {\n            case 38:\n              red.value = setValueInRange.call(that, (red.value << 0) + 1, 0, 255);\n              color.val('r', red.value, e.target);\n              return false;\n            case 40:\n              red.value = setValueInRange.call(that, (red.value << 0) - 1, 0, 255);\n              color.val('r', red.value, e.target);\n              return false;\n          }\n          break;\n        case green:\n          switch (e.keyCode) {\n            case 38:\n              green.value = setValueInRange.call(that, (green.value << 0) + 1, 0, 255);\n              color.val('g', green.value, e.target);\n              return false;\n            case 40:\n              green.value = setValueInRange.call(that, (green.value << 0) - 1, 0, 255);\n              color.val('g', green.value, e.target);\n              return false;\n          }\n          break;\n        case blue:\n          switch (e.keyCode) {\n            case 38:\n              blue.value = setValueInRange.call(that, (blue.value << 0) + 1, 0, 255);\n              color.val('b', blue.value, e.target);\n              return false;\n            case 40:\n              blue.value = setValueInRange.call(that, (blue.value << 0) - 1, 0, 255);\n              color.val('b', blue.value, e.target);\n              return false;\n          }\n          break;\n        case alpha:\n          switch (e.keyCode) {\n            case 38:\n              alpha.value = setValueInRange.call(that, Number.parseFloat(alpha.value) + 1, 0, 100);\n              color.val('a', toFixedNumeric$1(alpha.value * 255 / 100, alphaPrecision), e.target);\n              return false;\n            case 40:\n              alpha.value = setValueInRange.call(that, Number.parseFloat(alpha.value) - 1, 0, 100);\n              color.val('a', toFixedNumeric$1(alpha.value * 255 / 100, alphaPrecision), e.target);\n              return false;\n          }\n          break;\n        case hue:\n          switch (e.keyCode) {\n            case 38:\n              hue.value = setValueInRange.call(that, (hue.value << 0) + 1, 0, 360);\n              color.val('h', hue.value, e.target);\n              return false;\n            case 40:\n              hue.value = setValueInRange.call(that, (hue.value << 0) - 1, 0, 360);\n              color.val('h', hue.value, e.target);\n              return false;\n          }\n          break;\n        case saturation:\n          switch (e.keyCode) {\n            case 38:\n              saturation.value = setValueInRange.call(that, (saturation.value << 0) + 1, 0, 100);\n              color.val('s', saturation.value, e.target);\n              return false;\n            case 40:\n              saturation.value = setValueInRange.call(that, (saturation.value << 0) - 1, 0, 100);\n              color.val('s', saturation.value, e.target);\n              return false;\n          }\n          break;\n        case value:\n          switch (e.keyCode) {\n            case 38:\n              value.value = setValueInRange.call(that, (value.value << 0) + 1, 0, 100);\n              color.val('v', value.value, e.target);\n              return false;\n            case 40:\n              value.value = setValueInRange.call(that, (value.value << 0) - 1, 0, 100);\n              color.val('v', value.value, e.target);\n              return false;\n          }\n          break;\n      }\n      return undefined;\n    }", "docstring": "// input box key down - use arrows to alter color", "url": "https://github.com/GeorgLegato/stable-diffusion-webui-vectorstudio/blob/03535f64caef1de151122574cf4a39943db6e1eb/scripts/editor/xdomain-Editor.js#L22339-L22429", "sha": "03535f64caef1de151122574cf4a39943db6e1eb"}1156{"repo_name": "dujiaoka", "dataset": "github_2023", "owner": "hiouttime", "lang": "javascript", "func_name": "uncurryThis", "code": "function uncurryThis( fn ) {\n            return function() {\n                return call.apply( fn, arguments );\n            };\n        }", "docstring": "// http://jsperf.com/uncurrythis", "url": "https://github.com/hiouttime/dujiaoka/blob/51538b6a7e74a67a4f92a242b1e3c6799b64f5ca/public/vendor/dcat-admin/dcat/plugins/webuploader/webuploader.nolog.js#L205-L209", "sha": "51538b6a7e74a67a4f92a242b1e3c6799b64f5ca"}1157{"repo_name": "actions-permissions", "dataset": "github_2023", "owner": "GitHubSecurityLab", "lang": "javascript", "func_name": "getStreamingResponseStatusCodes", "code": "function getStreamingResponseStatusCodes(operationSpec) {\n    const result = new Set();\n    for (const statusCode in operationSpec.responses) {\n        const operationResponse = operationSpec.responses[statusCode];\n        if (operationResponse.bodyMapper &&\n            operationResponse.bodyMapper.type.name === serializer_js_1.MapperTypeNames.Stream) {\n            result.add(Number(statusCode));\n        }\n    }\n    return result;\n}", "docstring": "/**\n * Gets the list of status codes for streaming responses.\n * @internal\n */", "url": "https://github.com/GitHubSecurityLab/actions-permissions/blob/babd69bc8d78e6cdece903dfdcfb72d4e1a4f00d/monitor/dist/index.js#L105800-L105810", "sha": "babd69bc8d78e6cdece903dfdcfb72d4e1a4f00d"}1158{"repo_name": "pyobsplot", "dataset": "github_2023", "owner": "juba", "lang": "javascript", "func_name": "array_default", "code": "function array_default(a4, b) {\n  return (isNumberArray(b) ? numberArray_default : genericArray)(a4, b);\n}", "docstring": "// node_modules/d3-interpolate/src/array.js", "url": "https://github.com/juba/pyobsplot/blob/4ae57b857091989d7f2911e052b9f3ad636e6fea/src/pyobsplot/static/static-widget.js#L4558-L4560", "sha": "4ae57b857091989d7f2911e052b9f3ad636e6fea"}1159{"repo_name": "pyobsplot", "dataset": "github_2023", "owner": "juba", "lang": "javascript", "func_name": "conicProjection", "code": "function conicProjection(projectAt) {\n  var phi02 = 0, phi12 = pi4 / 3, m3 = projectionMutator(projectAt), p = m3(phi02, phi12);\n  p.parallels = function(_) {\n    return arguments.length ? m3(phi02 = _[0] * radians2, phi12 = _[1] * radians2) : [phi02 * degrees3, phi12 * degrees3];\n  };\n  return p;\n}", "docstring": "// node_modules/d3-geo/src/projection/conic.js", "url": "https://github.com/juba/pyobsplot/blob/4ae57b857091989d7f2911e052b9f3ad636e6fea/src/pyobsplot/static/static-widget.js#L12209-L12215", "sha": "4ae57b857091989d7f2911e052b9f3ad636e6fea"}1160{"repo_name": "pianometer", "dataset": "github_2023", "owner": "wiwikuan", "lang": "javascript", "func_name": "WebMidi", "code": "function WebMidi() {\n\n    // Singleton. Prevent instantiation through WebMidi.__proto__.constructor()\n    if (WebMidi.prototype._singleton) {\n      throw new Error(\"WebMidi is a singleton, it cannot be instantiated directly.\");\n    }\n    WebMidi.prototype._singleton = this;\n\n    // MIDI inputs and outputs\n    this._inputs = [];\n    this._outputs = [];\n\n    // Object to hold all user-defined handlers for interface-wide events (connected, disconnected,\n    // etc.)\n    this._userHandlers = {};\n\n    // Array of statechange events to process. These events must be parsed synchronously so they do\n    // not override each other.\n    this._stateChangeQueue = [];\n\n    // Indicates whether we are currently processing a statechange event (in which case new events\n    // are to be queued).\n    this._processingStateChange = false;\n\n    // Events triggered at the interface level (WebMidi)\n    this._midiInterfaceEvents = [\"connected\", \"disconnected\"];\n\n    // the current nrpns being constructed, by channel\n    this._nrpnBuffer = [[],[],[],[], [],[],[],[], [],[],[],[], [],[],[],[]];\n\n    // Enable/Disable NRPN event dispatch\n    this._nrpnEventsEnabled = true;\n\n    // NRPN message types\n    this._nrpnTypes = [\"entry\", \"increment\", \"decrement\"];\n\n    // Notes and semitones for note guessing\n    this._notes = [\"C\", \"C#\", \"D\", \"D#\", \"E\", \"F\", \"F#\", \"G\", \"G#\", \"A\", \"A#\", \"B\"];\n    this._semitones = {C: 0, D: 2, E: 4, F: 5, G: 7, A: 9, B: 11 };\n\n    // Define some \"static\" properties\n    Object.defineProperties(this, {\n\n      /**\n       * [read-only] List of valid MIDI system messages and matching hexadecimal values.\n       *\n       * Note: values 249 and 253 are actually dispatched by the Web MIDI API but the MIDI 1.0 does\n       * not say what they are used for. About those values, it only states: undefined (reserved)\n       *\n       * @property MIDI_SYSTEM_MESSAGES\n       * @type Object\n       * @static\n       *\n       * @since 2.0.0\n       */\n      MIDI_SYSTEM_MESSAGES: {\n        value: {\n\n          // System common messages\n          sysex: 0xF0,            // 240\n          timecode: 0xF1,         // 241\n          songposition: 0xF2,     // 242\n          songselect: 0xF3,       // 243\n          tuningrequest: 0xF6,    // 246\n          sysexend: 0xF7,         // 247 (never actually received - simply ends a sysex)\n\n          // System real-time messages\n          clock: 0xF8,            // 248\n          start: 0xFA,            // 250\n          continue: 0xFB,         // 251\n          stop: 0xFC,             // 252\n          activesensing: 0xFE,    // 254\n          reset: 0xFF,            // 255\n\n          // Custom WebMidi.js messages\n          midimessage: 0,\n          unknownsystemmessage: -1\n        },\n        writable: false,\n        enumerable: true,\n        configurable: false\n      },\n\n      /**\n       * [read-only] An object containing properties for each MIDI channel messages and their\n       * associated hexadecimal value.\n       *\n       * @property MIDI_CHANNEL_MESSAGES\n       * @type Object\n       * @static\n       *\n       * @since 2.0.0\n       */\n      MIDI_CHANNEL_MESSAGES: {\n        value: {\n          noteoff: 0x8,           // 8\n          noteon: 0x9,            // 9\n          keyaftertouch: 0xA,     // 10\n          controlchange: 0xB,     // 11\n          channelmode: 0xB,       // 11\n          nrpn: 0xB,              // 11\n          programchange: 0xC,     // 12\n          channelaftertouch: 0xD, // 13\n          pitchbend: 0xE          // 14\n        },\n        writable: false,\n        enumerable: true,\n        configurable: false\n      },\n\n      /**\n       * [read-only] An object containing properties for each registered parameters and their\n       * associated pair of hexadecimal values. MIDI registered parameters extend the original list\n       * of control change messages (a.k.a. CC messages). Currently, there are only a limited number\n       * of them.\n       *\n       * @property MIDI_REGISTERED_PARAMETER\n       * @type Object\n       * @static\n       *\n       * @since 2.0.0\n       */\n      MIDI_REGISTERED_PARAMETER: {\n        value: {\n          pitchbendrange: [0x00, 0x00],\n          channelfinetuning: [0x00, 0x01],\n          channelcoarsetuning: [0x00, 0x02],\n          tuningprogram: [0x00, 0x03],\n          tuningbank: [0x00, 0x04],\n          modulationrange: [0x00, 0x05],\n\n          azimuthangle: [0x3D, 0x00],\n          elevationangle: [0x3D, 0x01],\n          gain: [0x3D, 0x02],\n          distanceratio: [0x3D, 0x03],\n          maximumdistance: [0x3D, 0x04],\n          maximumdistancegain: [0x3D, 0x05],\n          referencedistanceratio: [0x3D, 0x06],\n          panspreadangle: [0x3D, 0x07],\n          rollangle: [0x3D, 0x08]\n        },\n        writable: false,\n        enumerable: true,\n        configurable: false\n      },\n\n      /**\n       * [read-only] An object containing properties for each MIDI control change messages (a.k.a.\n       * CC messages) and their associated hexadecimal value.\n       *\n       * @property MIDI_CONTROL_CHANGE_MESSAGES\n       * @type Object\n       * @static\n       *\n       * @since 2.0.0\n       */\n      MIDI_CONTROL_CHANGE_MESSAGES: {\n        value: {\n          bankselectcoarse: 0,\n          modulationwheelcoarse: 1,\n          breathcontrollercoarse: 2,\n          footcontrollercoarse: 4,\n          portamentotimecoarse: 5,\n          dataentrycoarse: 6,\n          volumecoarse: 7,\n          balancecoarse: 8,\n          pancoarse: 10,\n          expressioncoarse: 11,\n          effectcontrol1coarse: 12,\n          effectcontrol2coarse: 13,\n          generalpurposeslider1: 16,\n          generalpurposeslider2: 17,\n          generalpurposeslider3: 18,\n          generalpurposeslider4: 19,\n          bankselectfine: 32,\n          modulationwheelfine: 33,\n          breathcontrollerfine: 34,\n          footcontrollerfine: 36,\n          portamentotimefine: 37,\n          dataentryfine: 38,\n          volumefine: 39,\n          balancefine: 40,\n          panfine: 42,\n          expressionfine: 43,\n          effectcontrol1fine: 44,\n          effectcontrol2fine: 45,\n          holdpedal: 64,\n          portamento: 65,\n          sustenutopedal: 66,\n          softpedal: 67,\n          legatopedal: 68,\n          hold2pedal: 69,\n          soundvariation: 70,\n          resonance: 71,\n          soundreleasetime: 72,\n          soundattacktime: 73,\n          brightness: 74,\n          soundcontrol6: 75,\n          soundcontrol7: 76,\n          soundcontrol8: 77,\n          soundcontrol9: 78,\n          soundcontrol10: 79,\n          generalpurposebutton1: 80,\n          generalpurposebutton2: 81,\n          generalpurposebutton3: 82,\n          generalpurposebutton4: 83,\n          reverblevel: 91,\n          tremololevel: 92,\n          choruslevel: 93,\n          celestelevel: 94,\n          phaserlevel: 95,\n          databuttonincrement: 96,\n          databuttondecrement: 97,\n          nonregisteredparametercoarse: 98,\n          nonregisteredparameterfine: 99,\n          registeredparametercoarse: 100,\n          registeredparameterfine: 101\n        },\n        writable: false,\n        enumerable: true,\n        configurable: false\n      },\n\n      /**\n       * [read-only] An object containing properties for MIDI control change messages\n       * that make up NRPN messages\n       *\n       * @property MIDI_NRPN_MESSAGES\n       * @type Object\n       * @static\n       *\n       * @since 2.0.0\n       */\n      MIDI_NRPN_MESSAGES: {\n        value: {\n          entrymsb: 6,\n          entrylsb: 38,\n          increment: 96,\n          decrement: 97,\n          paramlsb: 98,\n          parammsb: 99,\n          nullactiveparameter: 127\n        },\n        writable: false,\n        enumerable: true,\n        configurable: false\n      },\n\n      /**\n       * [read-only] List of MIDI channel mode messages as defined in the official MIDI\n       * specification.\n       *\n       * @property MIDI_CHANNEL_MODE_MESSAGES\n       * @type Object\n       * @static\n       *\n       * @since 2.0.0\n       */\n      MIDI_CHANNEL_MODE_MESSAGES: {\n        value: {\n          allsoundoff: 120,\n          resetallcontrollers: 121,\n          localcontrol: 122,\n          allnotesoff: 123,\n          omnimodeoff: 124,\n          omnimodeon: 125,\n          monomodeon: 126,\n          polymodeon: 127\n        },\n        writable: false,\n        enumerable: true,\n        configurable: false\n      },\n\n      /**\n       * An integer to offset the octave both in inbound and outbound messages. By default, middle C\n       * (MIDI note number 60) is placed on the 4th octave (C4).\n       *\n       * If, for example, `octaveOffset` is set to 2, MIDI note number 60 will be reported as C6. If\n       * `octaveOffset` is set to -1, MIDI note number 60 will be reported as C3.\n       *\n       * @property octaveOffset\n       * @type Number\n       * @static\n       *\n       * @since 2.1\n       */\n      octaveOffset: {\n        value: 0,\n        writable: true,\n        enumerable: true,\n        configurable: false\n      }\n\n    });\n\n    // Define getters/setters\n    Object.defineProperties(this, {\n\n      /**\n       * [read-only] Indicates whether the environment supports the Web MIDI API or not.\n       *\n       * Note: in environments that do not offer built-in MIDI support, this will report true if the\n       * `navigator.requestMIDIAccess` function is available. For example, if you have installed\n       * WebMIDIAPIShim but no plugin, this property will be true even though actual support might\n       * not be there.\n       *\n       * @property supported\n       * @type Boolean\n       * @static\n       */\n      supported: {\n        enumerable: true,\n        get: function() {\n          return \"requestMIDIAccess\" in navigator;\n        }\n      },\n\n      /**\n       * [read-only] Indicates whether the interface to the host\"s MIDI subsystem is currently\n       * enabled.\n       *\n       * @property enabled\n       * @type Boolean\n       * @static\n       */\n      enabled: {\n        enumerable: true,\n        get: function() {\n          return this.interface !== undefined;\n        }.bind(this)\n      },\n\n      /**\n       * [read-only] An array of all currently available MIDI input ports.\n       *\n       * @property inputs\n       * @type {Array}\n       * @static\n       */\n      inputs: {\n        enumerable: true,\n        get: function() {\n          return this._inputs;\n        }.bind(this)\n      },\n\n      /**\n       * [read-only] An array of all currently available MIDI output ports.\n       *\n       * @property outputs\n       * @type {Array}\n       * @static\n       */\n      outputs: {\n        enumerable: true,\n        get: function() {\n          return this._outputs;\n        }.bind(this)\n      },\n\n      /**\n       * [read-only] Indicates whether the interface to the host\"s MIDI subsystem is currently\n       * active.\n       *\n       * @property sysexEnabled\n       * @type Boolean\n       * @static\n       */\n      sysexEnabled: {\n        enumerable: true,\n        get: function() {\n          return !!(this.interface && this.interface.sysexEnabled);\n        }.bind(this)\n      },\n\n      /**\n       * [read-only] Indicates whether WebMidi should dispatch Non-Registered\n       * Parameter Number events (which are generally groups of CC messages)\n       * If correct sequences of CC messages are received, NRPN events will\n       * fire. The first out of order NRPN CC will fall through the collector\n       * logic and all CC messages buffered will be discarded as incomplete.\n       *\n       * @private\n       *\n       * @property nrpnEventsEnabled\n       * @type Boolean\n       * @static\n       */\n      nrpnEventsEnabled: {\n        enumerable: true,\n        get: function() {\n          return !!(this._nrpnEventsEnabled);\n        }.bind(this),\n        set: function(enabled) {\n          this._nrpnEventsEnabled = enabled;\n          return this._nrpnEventsEnabled;\n        }\n      },\n\n      /**\n       * [read-only] NRPN message types\n       *\n       * @property nrpnTypes\n       * @type Array\n       * @static\n       */\n      nrpnTypes: {\n        enumerable: true,\n        get: function() {\n          return this._nrpnTypes;\n        }.bind(this)\n      },\n\n      /**\n       * [read-only] Current MIDI performance time in milliseconds. This can be used to queue events\n       * in the future.\n       *\n       * @property time\n       * @type DOMHighResTimeStamp\n       * @static\n       */\n      time: {\n        enumerable: true,\n        get: function() {\n          return performance.now();\n        }\n      }\n\n    });\n\n  }", "docstring": "/**\n   * The `WebMidi` object makes it easier to work with the Web MIDI API. Basically, it simplifies\n   * two things: sending outgoing MIDI messages and reacting to incoming MIDI messages.\n   *\n   * Sending MIDI messages is done via an `Output` object. All available outputs can be accessed in\n   * the `WebMidi.outputs` array. There is one `Output` object for each output port available on\n   * your system. Similarly, reacting to MIDI messages as they are coming in is simply a matter of\n   * adding a listener to an `Input` object. Similarly, all inputs can be found in the\n   * `WebMidi.inputs` array.\n   *\n   * Please note that a single hardware device might create more than one input and/or output ports.\n   *\n   * #### Sending messages\n   *\n   * To send MIDI messages, you simply need to call the desired method (`playNote()`,\n   * `sendPitchBend()`, `stopNote()`, etc.) from an `Output` object and pass in the appropriate\n   * parameters. All the native MIDI communication will be handled for you. The only additional\n   * thing that needs to be done is to first enable `WebMidi`. Here is an example:\n   *\n   *      WebMidi.enable(function(err) {\n   *        if (err) console.log(\"An error occurred\", err);\n   *        WebMidi.outputs[0].playNote(\"C3\");\n   *      });\n   *\n   * The code above, calls the `WebMidi.enable()` method. Upon success, this method executes the\n   * callback function specified as a parameter. In this case, the callback calls the `playnote()`\n   * function to play a 3rd octave C on the first available output port.\n   *\n   * #### Receiving messages\n   *\n   * Receiving messages is just as easy. You simply have to set a callback function to be triggered\n   * when a specific MIDI message is received. For example, here\"s how to listen for pitch bend\n   * events on the first input port:\n   *\n   *      WebMidi.enable(function(err) {\n   *        if (err) console.log(\"An error occurred\", err);\n   *\n   *        WebMidi.inputs[0].addListener(\"pitchbend\", \"all\", function(e) {\n   *          console.log(\"Pitch value: \" + e.value);\n   *        });\n   *\n   *      });\n   *\n   * As you can see, this library is much easier to use than the native Web MIDI API. No need to\n   * manually craft or decode binary MIDI messages anymore!\n   *\n   * @class WebMidi\n   * @static\n   *\n   * @throws Error WebMidi is a singleton, it cannot be instantiated directly.\n   *\n   * @todo  Switch away from yuidoc (deprecated) to be able to serve doc over https\n   * @todo  Yuidoc does not allow multiple exceptions (@throws) for a single method ?!\n   *\n   */", "url": "https://github.com/wiwikuan/pianometer/blob/4122760cd710a873b12ab4d7740cf36c50df4a6a/webmidi.js#L60-L491", "sha": "4122760cd710a873b12ab4d7740cf36c50df4a6a"}1161{"repo_name": "sveltekit-lucia-starter", "dataset": "github_2023", "owner": "qwacko", "lang": "javascript", "func_name": "Router.addCacheListener", "code": "addCacheListener() {\n        // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n        self.addEventListener('message', event => {\n          // event.data is type 'any'\n          // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n          if (event.data && event.data.type === 'CACHE_URLS') {\n            // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n            const {\n              payload\n            } = event.data;\n            {\n              logger.debug(`Caching URLs from the window`, payload.urlsToCache);\n            }\n            const requestPromises = Promise.all(payload.urlsToCache.map(entry => {\n              if (typeof entry === 'string') {\n                entry = [entry];\n              }\n              const request = new Request(...entry);\n              return this.handleRequest({\n                request,\n                event\n              });\n              // TODO(philipwalton): TypeScript errors without this typecast for\n              // some reason (probably a bug). The real type here should work but\n              // doesn't: `Array<Promise<Response> | undefined>`.\n            })); // TypeScript\n            event.waitUntil(requestPromises);\n            // If a MessageChannel was used, reply to the message on success.\n            if (event.ports && event.ports[0]) {\n              void requestPromises.then(() => event.ports[0].postMessage(true));\n            }\n          }\n        });\n      }", "docstring": "/**\n       * Adds a message event listener for URLs to cache from the window.\n       * This is useful to cache resources loaded on the page prior to when the\n       * service worker started controlling it.\n       *\n       * The format of the message data sent from the window should be as follows.\n       * Where the `urlsToCache` array may consist of URL strings or an array of\n       * URL string + `requestInit` object (the same as you'd pass to `fetch()`).\n       *\n       * ```\n       * {\n       *   type: 'CACHE_URLS',\n       *   payload: {\n       *     urlsToCache: [\n       *       './script1.js',\n       *       './script2.js',\n       *       ['./script3.js', {mode: 'no-cors'}],\n       *     ],\n       *   },\n       * }\n       * ```\n       */", "url": "https://github.com/qwacko/sveltekit-lucia-starter/blob/2c01cb76c8607c2a9f4e80f78dfd1e9def43768e/dev-dist/workbox-39884a30.js#L748-L781", "sha": "2c01cb76c8607c2a9f4e80f78dfd1e9def43768e"}1162{"repo_name": "sveltekit-lucia-starter", "dataset": "github_2023", "owner": "qwacko", "lang": "javascript", "func_name": "waitUntil", "code": "function waitUntil(event, asyncFn) {\n      const returnPromise = asyncFn();\n      event.waitUntil(returnPromise);\n      return returnPromise;\n    }", "docstring": "/*\n      Copyright 2020 Google LLC\n      Use of this source code is governed by an MIT-style\n      license that can be found in the LICENSE file or at\n      https://opensource.org/licenses/MIT.\n    */", "url": "https://github.com/qwacko/sveltekit-lucia-starter/blob/2c01cb76c8607c2a9f4e80f78dfd1e9def43768e/dev-dist/workbox-39884a30.js#L1247-L1251", "sha": "2c01cb76c8607c2a9f4e80f78dfd1e9def43768e"}1163{"repo_name": "sveltekit-lucia-starter", "dataset": "github_2023", "owner": "qwacko", "lang": "javascript", "func_name": "PrecacheController.getCachedURLs", "code": "getCachedURLs() {\n        return [...this._urlsToCacheKeys.keys()];\n      }", "docstring": "/**\n       * Returns a list of all the URLs that have been precached by the current\n       * service worker.\n       *\n       * @return {Array<string>} The precached URLs.\n       */", "url": "https://github.com/qwacko/sveltekit-lucia-starter/blob/2c01cb76c8607c2a9f4e80f78dfd1e9def43768e/dev-dist/workbox-dcc48fc1.js#L2854-L2856", "sha": "2c01cb76c8607c2a9f4e80f78dfd1e9def43768e"}1164{"repo_name": "lets-form", "dataset": "github_2023", "owner": "guidone", "lang": "javascript", "func_name": "isEmpty$1", "code": "function isEmpty$1(value) {\n    if (value == null) {\n      return true;\n    }\n    if (isArrayLike(value) && (isArray$3(value) || typeof value == 'string' || typeof value.splice == 'function' || isBuffer(value) || isTypedArray(value) || isArguments$1(value))) {\n      return !value.length;\n    }\n    var tag = getTag(value);\n    if (tag == mapTag || tag == setTag) {\n      return !value.size;\n    }\n    if (isPrototype(value)) {\n      return !baseKeys(value).length;\n    }\n    for (var key in value) {\n      if (hasOwnProperty.call(value, key)) {\n        return false;\n      }\n    }\n    return true;\n  }", "docstring": "/**\n   * Checks if `value` is an empty object, collection, map, or set.\n   *\n   * Objects are considered empty if they have no own enumerable string keyed\n   * properties.\n   *\n   * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n   * jQuery-like collections are considered empty if they have a `length` of `0`.\n   * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n   *\n   * @static\n   * @memberOf _\n   * @since 0.1.0\n   * @category Lang\n   * @param {*} value The value to check.\n   * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n   * @example\n   *\n   * _.isEmpty(null);\n   * // => true\n   *\n   * _.isEmpty(true);\n   * // => true\n   *\n   * _.isEmpty(1);\n   * // => true\n   *\n   * _.isEmpty([1, 2, 3]);\n   * // => false\n   *\n   * _.isEmpty({ 'a': 1 });\n   * // => false\n   */", "url": "https://github.com/guidone/lets-form/blob/793271834cca296f28b6321d258821b8486061f1/dist/react-antd-umd/main.js#L4089-L4109", "sha": "793271834cca296f28b6321d258821b8486061f1"}1165{"repo_name": "lets-form", "dataset": "github_2023", "owner": "guidone", "lang": "javascript", "func_name": "initCloneArray$1", "code": "function initCloneArray$1(array) {\n    var length = array.length,\n      result = new array.constructor(length);\n\n    // Add properties assigned by `RegExp#exec`.\n    if (length && typeof array[0] == 'string' && hasOwnProperty$2.call(array, 'index')) {\n      result.index = array.index;\n      result.input = array.input;\n    }\n    return result;\n  }", "docstring": "/**\n   * Initializes an array clone.\n   *\n   * @private\n   * @param {Array} array The array to clone.\n   * @returns {Array} Returns the initialized clone.\n   */", "url": "https://github.com/guidone/lets-form/blob/793271834cca296f28b6321d258821b8486061f1/dist/react-bootstrap-umd/main.js#L2771-L2781", "sha": "793271834cca296f28b6321d258821b8486061f1"}1166{"repo_name": "lets-form", "dataset": "github_2023", "owner": "guidone", "lang": "javascript", "func_name": "stringToArray$2", "code": "function stringToArray$2(string) {\n    return hasUnicode$1(string) ? unicodeToArray(string) : asciiToArray(string);\n  }", "docstring": "/**\n   * Converts `string` to an array.\n   *\n   * @private\n   * @param {string} string The string to convert.\n   * @returns {Array} Returns the converted array.\n   */", "url": "https://github.com/guidone/lets-form/blob/793271834cca296f28b6321d258821b8486061f1/dist/react-bootstrap-umd/main.js#L19958-L19960", "sha": "793271834cca296f28b6321d258821b8486061f1"}1167{"repo_name": "lets-form", "dataset": "github_2023", "owner": "guidone", "lang": "javascript", "func_name": "memoize$1", "code": "function memoize$1(func, resolver) {\n    if (typeof func != 'function' || resolver != null && typeof resolver != 'function') {\n      throw new TypeError(FUNC_ERROR_TEXT);\n    }\n    var memoized = function () {\n      var args = arguments,\n        key = resolver ? resolver.apply(this, args) : args[0],\n        cache = memoized.cache;\n      if (cache.has(key)) {\n        return cache.get(key);\n      }\n      var result = func.apply(this, args);\n      memoized.cache = cache.set(key, result) || cache;\n      return result;\n    };\n    memoized.cache = new (memoize$1.Cache || MapCache$1)();\n    return memoized;\n  }", "docstring": "/**\n   * Creates a function that memoizes the result of `func`. If `resolver` is\n   * provided, it determines the cache key for storing the result based on the\n   * arguments provided to the memoized function. By default, the first argument\n   * provided to the memoized function is used as the map cache key. The `func`\n   * is invoked with the `this` binding of the memoized function.\n   *\n   * **Note:** The cache is exposed as the `cache` property on the memoized\n   * function. Its creation may be customized by replacing the `_.memoize.Cache`\n   * constructor with one whose instances implement the\n   * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n   * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n   *\n   * @static\n   * @memberOf _\n   * @since 0.1.0\n   * @category Function\n   * @param {Function} func The function to have its output memoized.\n   * @param {Function} [resolver] The function to resolve the cache key.\n   * @returns {Function} Returns the new memoized function.\n   * @example\n   *\n   * var object = { 'a': 1, 'b': 2 };\n   * var other = { 'c': 3, 'd': 4 };\n   *\n   * var values = _.memoize(_.values);\n   * values(object);\n   * // => [1, 2]\n   *\n   * values(other);\n   * // => [3, 4]\n   *\n   * object.a = 2;\n   * values(object);\n   * // => [1, 2]\n   *\n   * // Modify the result cache.\n   * values.cache.set(object, ['a', 'b']);\n   * values(object);\n   * // => ['a', 'b']\n   *\n   * // Replace `_.memoize.Cache`.\n   * _.memoize.Cache = WeakMap;\n   */", "url": "https://github.com/guidone/lets-form/blob/793271834cca296f28b6321d258821b8486061f1/dist/react-rsuite5-umd/main.js#L3333-L3350", "sha": "793271834cca296f28b6321d258821b8486061f1"}1168{"repo_name": "lets-form", "dataset": "github_2023", "owner": "guidone", "lang": "javascript", "func_name": "baseFindIndex$1", "code": "function baseFindIndex$1(array, predicate, fromIndex, fromRight) {\n  var length = array.length,\n    index = fromIndex + (fromRight ? 1 : -1);\n  while (fromRight ? index-- : ++index < length) {\n    if (predicate(array[index], index, array)) {\n      return index;\n    }\n  }\n  return -1;\n}", "docstring": "/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */", "url": "https://github.com/guidone/lets-form/blob/793271834cca296f28b6321d258821b8486061f1/dist/utils-esm/index.js#L4769-L4778", "sha": "793271834cca296f28b6321d258821b8486061f1"}1169{"repo_name": "lets-form", "dataset": "github_2023", "owner": "guidone", "lang": "javascript", "func_name": "listCacheHas$1", "code": "function listCacheHas$1(key) {\n    return assocIndexOf$1(this.__data__, key) > -1;\n  }", "docstring": "/**\n   * Checks if a list cache value for `key` exists.\n   *\n   * @private\n   * @name has\n   * @memberOf ListCache\n   * @param {string} key The key of the entry to check.\n   * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n   */", "url": "https://github.com/guidone/lets-form/blob/793271834cca296f28b6321d258821b8486061f1/dist/utils-umd/main.js#L1561-L1563", "sha": "793271834cca296f28b6321d258821b8486061f1"}1170{"repo_name": "lets-form", "dataset": "github_2023", "owner": "guidone", "lang": "javascript", "func_name": "isIndex$3", "code": "function isIndex$3(value, length) {\n    var type = typeof value;\n    length = length == null ? MAX_SAFE_INTEGER$1 : length;\n    return !!length && (type == 'number' || type != 'symbol' && reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;\n  }", "docstring": "/**\n   * Checks if `value` is a valid array-like index.\n   *\n   * @private\n   * @param {*} value The value to check.\n   * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n   * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n   */", "url": "https://github.com/guidone/lets-form/blob/793271834cca296f28b6321d258821b8486061f1/dist/utils-umd/main.js#L2047-L2051", "sha": "793271834cca296f28b6321d258821b8486061f1"}1171{"repo_name": "chatgpt-java-wx", "dataset": "github_2023", "owner": "c-ttpfx", "lang": "javascript", "func_name": "bnpFromString", "code": "function bnpFromString(s,b) {\n      var k;\n      if(b == 16) k = 4;\n      else if(b == 8) k = 3;\n      else if(b == 256) k = 8; // byte array\n      else if(b == 2) k = 1;\n      else if(b == 32) k = 5;\n      else if(b == 4) k = 2;\n      else { this.fromRadix(s,b); return; }\n      this.t = 0;\n      this.s = 0;\n      var i = s.length, mi = false, sh = 0;\n      while(--i >= 0) {\n        var x = (k==8)?s[i]&0xff:intAt(s,i);\n        if(x < 0) {\n          if(s.charAt(i) == \"-\") mi = true;\n          continue;\n        }\n        mi = false;\n        if(sh == 0)\n          this[this.t++] = x;\n        else if(sh+k > this.DB) {\n          this[this.t-1] |= (x&((1<<(this.DB-sh))-1))<<sh;\n          this[this.t++] = (x>>(this.DB-sh));\n        }\n        else\n          this[this.t-1] |= x<<sh;\n        sh += k;\n        if(sh >= this.DB) sh -= this.DB;\n      }\n      if(k == 8 && (s[0]&0x80) != 0) {\n        this.s = -1;\n        if(sh > 0) this[this.t-1] |= ((1<<(this.DB-sh))-1)<<sh;\n      }\n      this.clamp();\n      if(mi) BigInteger.ZERO.subTo(this,this);\n    }", "docstring": "// (protected) set from string and radix", "url": "https://github.com/c-ttpfx/chatgpt-java-wx/blob/2961a981e151a379ea2b877af6fe4122bc9113a2/ttpfx็š„่Šๅคฉๆœบๅ™จไบบ/miniprogram_npm/jsbn/index.js#L139-L175", "sha": "2961a981e151a379ea2b877af6fe4122bc9113a2"}1172{"repo_name": "chatgpt-java-wx", "dataset": "github_2023", "owner": "c-ttpfx", "lang": "javascript", "func_name": "op_xor", "code": "function op_xor(x,y) { return x^y; }", "docstring": "// (public) this ^ a", "url": "https://github.com/c-ttpfx/chatgpt-java-wx/blob/2961a981e151a379ea2b877af6fe4122bc9113a2/ttpfx็š„่Šๅคฉๆœบๅ™จไบบ/miniprogram_npm/jsbn/index.js#L735-L735", "sha": "2961a981e151a379ea2b877af6fe4122bc9113a2"}1173{"repo_name": "AstroSharp", "dataset": "github_2023", "owner": "deepskydetail", "lang": "javascript", "func_name": "vendorPropName", "code": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "docstring": "// Return a css property mapped to a potentially vendor prefixed property", "url": "https://github.com/deepskydetail/AstroSharp/blob/b632424fa2e9749d008851cf40f49b5fcec490d3/resources/app/R-Portable-Win/library/jquerylib/lib/2.2.4/jquery-2.2.4.js#L5882-L5899", "sha": "b632424fa2e9749d008851cf40f49b5fcec490d3"}1174{"repo_name": "AstroSharp", "dataset": "github_2023", "owner": "deepskydetail", "lang": "javascript", "func_name": "hsvToRgb", "code": "function hsvToRgb(h, s, v) {\n\n        h = bound01(h, 360) * 6;\n        s = bound01(s, 100);\n        v = bound01(v, 100);\n\n        var i = math.floor(h),\n            f = h - i,\n            p = v * (1 - s),\n            q = v * (1 - f * s),\n            t = v * (1 - (1 - f) * s),\n            mod = i % 6,\n            r = [v, q, p, p, t, v][mod],\n            g = [t, v, v, q, p, p][mod],\n            b = [p, p, t, v, v, q][mod];\n\n        return { r: r * 255, g: g * 255, b: b * 255 };\n    }", "docstring": "// `hsvToRgb`", "url": "https://github.com/deepskydetail/AstroSharp/blob/b632424fa2e9749d008851cf40f49b5fcec490d3/resources/app/R-Portable-Win/library/shinyWidgets/assets/spectrum/spectrum.js#L1683-L1700", "sha": "b632424fa2e9749d008851cf40f49b5fcec490d3"}1175{"repo_name": "gotour", "dataset": "github_2023", "owner": "ardanlabs", "lang": "javascript", "func_name": "makeChangeSingleDocInEditor", "code": "function makeChangeSingleDocInEditor(cm, change, spans) {\n  var doc = cm.doc, display = cm.display, from = change.from, to = change.to\n\n  var recomputeMaxLength = false, checkWidthStart = from.line\n  if (!cm.options.lineWrapping) {\n    checkWidthStart = lineNo(visualLine(getLine(doc, from.line)))\n    doc.iter(checkWidthStart, to.line + 1, function (line) {\n      if (line == display.maxLine) {\n        recomputeMaxLength = true\n        return true\n      }\n    })\n  }\n\n  if (doc.sel.contains(change.from, change.to) > -1)\n    { signalCursorActivity(cm) }\n\n  updateDoc(doc, change, spans, estimateHeight(cm))\n\n  if (!cm.options.lineWrapping) {\n    doc.iter(checkWidthStart, from.line + change.text.length, function (line) {\n      var len = lineLength(line)\n      if (len > display.maxLineLength) {\n        display.maxLine = line\n        display.maxLineLength = len\n        display.maxLineChanged = true\n        recomputeMaxLength = false\n      }\n    })\n    if (recomputeMaxLength) { cm.curOp.updateMaxLine = true }\n  }\n\n  // Adjust frontier, schedule worker\n  doc.frontier = Math.min(doc.frontier, from.line)\n  startWorker(cm, 400)\n\n  var lendiff = change.text.length - (to.line - from.line) - 1\n  // Remember that these lines changed, for updating the display\n  if (change.full)\n    { regChange(cm) }\n  else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change))\n    { regLineChange(cm, from.line, \"text\") }\n  else\n    { regChange(cm, from.line, to.line + 1, lendiff) }\n\n  var changesHandler = hasHandler(cm, \"changes\"), changeHandler = hasHandler(cm, \"change\")\n  if (changeHandler || changesHandler) {\n    var obj = {\n      from: from, to: to,\n      text: change.text,\n      removed: change.removed,\n      origin: change.origin\n    }\n    if (changeHandler) { signalLater(cm, \"change\", cm, obj) }\n    if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj) }\n  }\n  cm.display.selForContextMenu = null\n}", "docstring": "// Handle the interaction of a change to a document with the editor", "url": "https://github.com/ardanlabs/gotour/blob/6599a0b6d88dd03619c8bc4c5f53e59c70c36208/_content/tour/fre/static/lib/codemirror/lib/codemirror.js#L5195-L5252", "sha": "6599a0b6d88dd03619c8bc4c5f53e59c70c36208"}1176{"repo_name": "gotour", "dataset": "github_2023", "owner": "ardanlabs", "lang": "javascript", "func_name": "attachLocalSpans", "code": "function attachLocalSpans(doc, change, from, to) {\n  var existing = change[\"spans_\" + doc.id], n = 0\n  doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) {\n    if (line.markedSpans)\n      { (existing || (existing = change[\"spans_\" + doc.id] = {}))[n] = line.markedSpans }\n    ++n\n  })\n}", "docstring": "// Used to store marked span information in the history.", "url": "https://github.com/ardanlabs/gotour/blob/6599a0b6d88dd03619c8bc4c5f53e59c70c36208/_content/tour/ita/static/lib/codemirror/lib/codemirror.js#L4724-L4731", "sha": "6599a0b6d88dd03619c8bc4c5f53e59c70c36208"}1177{"repo_name": "gotour", "dataset": "github_2023", "owner": "ardanlabs", "lang": "javascript", "func_name": "countColumn", "code": "function countColumn(string, end, tabSize, startIndex, startValue) {\n  if (end == null) {\n    end = string.search(/[^\\s\\u00a0]/)\n    if (end == -1) { end = string.length }\n  }\n  for (var i = startIndex || 0, n = startValue || 0;;) {\n    var nextTab = string.indexOf(\"\\t\", i)\n    if (nextTab < 0 || nextTab >= end)\n      { return n + (end - i) }\n    n += nextTab - i\n    n += tabSize - (n % tabSize)\n    i = nextTab + 1\n  }\n}", "docstring": "// Counts the column offset in a string, taking tabs into account.", "url": "https://github.com/ardanlabs/gotour/blob/6599a0b6d88dd03619c8bc4c5f53e59c70c36208/_content/tour/pol/static/lib/codemirror/lib/codemirror.js#L161-L174", "sha": "6599a0b6d88dd03619c8bc4c5f53e59c70c36208"}1178{"repo_name": "gotour", "dataset": "github_2023", "owner": "ardanlabs", "lang": "javascript", "func_name": "handleCharBinding", "code": "function handleCharBinding(cm, e, ch) {\n  return dispatchKey(cm, \"'\" + ch + \"'\", e, function (b) { return doHandleBinding(cm, b, true); })\n}", "docstring": "// Handle a key from the keypress event", "url": "https://github.com/ardanlabs/gotour/blob/6599a0b6d88dd03619c8bc4c5f53e59c70c36208/_content/tour/por/static/lib/codemirror/lib/codemirror.js#L6858-L6860", "sha": "6599a0b6d88dd03619c8bc4c5f53e59c70c36208"}1179{"repo_name": "napari-chatgpt", "dataset": "github_2023", "owner": "royerlab", "lang": "javascript", "func_name": "LinkedList", "code": "function LinkedList() {\n\t\t/** @type {LinkedListNode<T>} */\n\t\tvar head = { value: null, prev: null, next: null };\n\t\t/** @type {LinkedListNode<T>} */\n\t\tvar tail = { value: null, prev: head, next: null };\n\t\thead.next = tail;\n\n\t\t/** @type {LinkedListNode<T>} */\n\t\tthis.head = head;\n\t\t/** @type {LinkedListNode<T>} */\n\t\tthis.tail = tail;\n\t\tthis.length = 0;\n\t}", "docstring": "/**\n\t * @typedef LinkedListNode\n\t * @property {T} value\n\t * @property {LinkedListNode<T> | null} prev The previous node.\n\t * @property {LinkedListNode<T> | null} next The next node.\n\t * @template T\n\t * @private\n\t */", "url": "https://github.com/royerlab/napari-chatgpt/blob/59b996a8547bd315004773bee942a2fae925ae43/src/napari_chatgpt/chat_server/static/prism.js#L1078-L1090", "sha": "59b996a8547bd315004773bee942a2fae925ae43"}1180{"repo_name": "lazyrepo", "dataset": "github_2023", "owner": "ds300", "lang": "javascript", "func_name": "LazyError.constructor", "code": "constructor(headline, more) {\n    super(stripAnsi(headline))\n    this.headline = headline\n    this.more = more\n  }", "docstring": "/**\n   * @param {string} headline\n   * @param {{ error?: Error, detail?: string }} [more]\n   */", "url": "https://github.com/ds300/lazyrepo/blob/c67eda9d332b85c135f8a69a23570a67b3b1f698/src/logger/LazyError.js#L9-L13", "sha": "c67eda9d332b85c135f8a69a23570a67b3b1f698"}1181{"repo_name": "x-ui", "dataset": "github_2023", "owner": "sing-web", "lang": "javascript", "func_name": "ensureCtor", "code": "function ensureCtor (comp, base) {\n    if (\n      comp.__esModule ||\n      (hasSymbol && comp[Symbol.toStringTag] === 'Module')\n    ) {\n      comp = comp.default;\n    }\n    return isObject(comp)\n      ? base.extend(comp)\n      : comp\n  }", "docstring": "/*  */", "url": "https://github.com/sing-web/x-ui/blob/0cd2536025dd3115fa3809c04fd6b370b3f48704/web/assets/vue@2.6.12/vue.runtime.js#L3584-L3594", "sha": "0cd2536025dd3115fa3809c04fd6b370b3f48704"}1182{"repo_name": "cy_jsvmp", "dataset": "github_2023", "owner": "2833844911", "lang": "javascript", "func_name": "length", "code": "function length(val) {\n  return val.toString().length;\n}", "docstring": "/**\n * Get the string length of `val`\n */", "url": "https://github.com/2833844911/cy_jsvmp/blob/f714b87f46b8c638924c697ca8ef6b3745e3a729/node_modules/expand-range/node_modules/fill-range/index.js#L406-L408", "sha": "f714b87f46b8c638924c697ca8ef6b3745e3a729"}1183{"repo_name": "cy_jsvmp", "dataset": "github_2023", "owner": "2833844911", "lang": "javascript", "func_name": "baseIndexOfWith", "code": "function baseIndexOfWith(array, value, fromIndex, comparator) {\n  var index = fromIndex - 1,\n      length = array.length;\n\n  while (++index < length) {\n    if (comparator(array[index], value)) {\n      return index;\n    }\n  }\n  return -1;\n}", "docstring": "/**\n * This function is like `baseIndexOf` except that it accepts a comparator.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */", "url": "https://github.com/2833844911/cy_jsvmp/blob/f714b87f46b8c638924c697ca8ef6b3745e3a729/node_modules/lodash/_baseIndexOfWith.js#L11-L21", "sha": "f714b87f46b8c638924c697ca8ef6b3745e3a729"}1184{"repo_name": "cy_jsvmp", "dataset": "github_2023", "owner": "2833844911", "lang": "javascript", "func_name": "isIndex", "code": "function isIndex(value, length) {\n      var type = typeof value;\n      length = length == null ? MAX_SAFE_INTEGER : length;\n\n      return !!length &&\n        (type == 'number' ||\n          (type != 'symbol' && reIsUint.test(value))) &&\n            (value > -1 && value % 1 == 0 && value < length);\n    }", "docstring": "/**\n     * Checks if `value` is a valid array-like index.\n     *\n     * @private\n     * @param {*} value The value to check.\n     * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n     * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n     */", "url": "https://github.com/2833844911/cy_jsvmp/blob/f714b87f46b8c638924c697ca8ef6b3745e3a729/node_modules/lodash/lodash.js#L6324-L6332", "sha": "f714b87f46b8c638924c697ca8ef6b3745e3a729"}1185{"repo_name": "voyager", "dataset": "github_2023", "owner": "spotify", "lang": "javascript", "func_name": "baseCreate", "code": "function baseCreate(prototype) {\n    if (!isObject(prototype)) return {};\n    if (nativeCreate) return nativeCreate(prototype);\n    var Ctor = ctor();\n    Ctor.prototype = prototype;\n    var result = new Ctor;\n    Ctor.prototype = null;\n    return result;\n  }", "docstring": "// An internal function for creating a new object that inherits from another.", "url": "https://github.com/spotify/voyager/blob/8e724398a57d4eca63d6e0dc2cd051d172fea95a/docs/python/_static/underscore-1.13.1.js#L610-L618", "sha": "8e724398a57d4eca63d6e0dc2cd051d172fea95a"}1186{"repo_name": "Hello-CTF", "dataset": "github_2023", "owner": "ProbiusOfficial", "lang": "javascript", "func_name": "preventSelection", "code": "function preventSelection(el) {\n        el.style.userSelect = 'none';\n        el.style.webkitUserSelect = 'none';\n        el.addEventListener('selectstart', preventDefault);\n    }", "docstring": "/* Selection\n    ----------------------------------------------------------------------------------------------------------------------*/", "url": "https://github.com/ProbiusOfficial/Hello-CTF/blob/d51bc86bafa737be4798db83b2a5b253f9f0842c/docs/javascripts/FullCalendar.js#L354-L358", "sha": "d51bc86bafa737be4798db83b2a5b253f9f0842c"}1187{"repo_name": "kv.js", "dataset": "github_2023", "owner": "HeyPuter", "lang": "javascript", "func_name": "kvjs.zintercard", "code": "zintercard(...keys) {\n        const intersection = this.ZINTER(...keys);\n        return intersection.size;\n    }", "docstring": "/**\n     * Get the number of members in the intersection between the given sorted sets stored at the specified keys.\n     *\n     * @param {...string} keys - The keys where the sorted sets are stored.\n     * @returns {number} - The number of members in the intersection.\n     */", "url": "https://github.com/HeyPuter/kv.js/blob/749e24c6868b3f048e8858e45a35d79b53ad7eb6/kv.js#L1852-L1855", "sha": "749e24c6868b3f048e8858e45a35d79b53ad7eb6"}1188{"repo_name": "openkoda", "dataset": "github_2023", "owner": "openkoda", "lang": "javascript", "func_name": "toType", "code": "function toType(obj) {\n    if (obj === null || typeof obj === 'undefined') {\n      return \"\" + obj;\n    }\n\n    return {}.toString.call(obj).match(/\\s([a-z]+)/i)[1].toLowerCase();\n  }", "docstring": "// Shoutout AngusCroll (https://goo.gl/pxwQGp)", "url": "https://github.com/openkoda/openkoda/blob/d86335959f5fb1da2fa58a9a5c7f02065d322975/openkoda/src/main/resources/public/vendor/bootstrap/js/bootstrap.bundle.js#L70-L76", "sha": "d86335959f5fb1da2fa58a9a5c7f02065d322975"}1189{"repo_name": "inventory", "dataset": "github_2023", "owner": "carmonabernaldiego", "lang": "javascript", "func_name": "createFxNow", "code": "function createFxNow() {\n\twindow.setTimeout( function() {\n\t\tfxNow = undefined;\n\t} );\n\treturn ( fxNow = jQuery.now() );\n}", "docstring": "// Animations created synchronously will run synchronously", "url": "https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/plugins/jquery/jquery.js#L7498-L7503", "sha": "f0fa12c3e312cab38147ff9c204945667f46da75"}1190{"repo_name": "inventory", "dataset": "github_2023", "owner": "carmonabernaldiego", "lang": "javascript", "func_name": "cleanupStylesWhenDeleting", "code": "function cleanupStylesWhenDeleting() {\n                var doc = editor.getDoc(),\n                    dom = editor.dom,\n                    selection = editor.selection;\n                var MutationObserver = window.MutationObserver,\n                    olderWebKit, dragStartRng;\n\n                // Add mini polyfill for older WebKits\n                // TODO: Remove this when old Safari versions gets updated\n                if (!MutationObserver) {\n                    olderWebKit = true;\n\n                    MutationObserver = function() {\n                        var records = [],\n                            target;\n\n                        function nodeInsert(e) {\n                            var target = e.relatedNode || e.target;\n                            records.push({ target: target, addedNodes: [target] });\n                        }\n\n                        function attrModified(e) {\n                            var target = e.relatedNode || e.target;\n                            records.push({ target: target, attributeName: e.attrName });\n                        }\n\n                        this.observe = function(node) {\n                            target = node;\n                            target.addEventListener('DOMSubtreeModified', nodeInsert, false);\n                            target.addEventListener('DOMNodeInsertedIntoDocument', nodeInsert, false);\n                            target.addEventListener('DOMNodeInserted', nodeInsert, false);\n                            target.addEventListener('DOMAttrModified', attrModified, false);\n                        };\n\n                        this.disconnect = function() {\n                            target.removeEventListener('DOMSubtreeModified', nodeInsert, false);\n                            target.removeEventListener('DOMNodeInsertedIntoDocument', nodeInsert, false);\n                            target.removeEventListener('DOMNodeInserted', nodeInsert, false);\n                            target.removeEventListener('DOMAttrModified', attrModified, false);\n                        };\n\n                        this.takeRecords = function() {\n                            return records;\n                        };\n                    };\n                }\n\n                function isTrailingBr(node) {\n                    var blockElements = dom.schema.getBlockElements(),\n                        rootNode = editor.getBody();\n\n                    if (node.nodeName != 'BR') {\n                        return false;\n                    }\n\n                    for (; node != rootNode && !blockElements[node.nodeName]; node = node.parentNode) {\n                        if (node.nextSibling) {\n                            return false;\n                        }\n                    }\n\n                    return true;\n                }\n\n                function isSiblingsIgnoreWhiteSpace(node1, node2) {\n                    var node;\n\n                    for (node = node1.nextSibling; node && node != node2; node = node.nextSibling) {\n                        if (node.nodeType == 3 && $.trim(node.data).length === 0) {\n                            continue;\n                        }\n\n                        if (node !== node2) {\n                            return false;\n                        }\n                    }\n\n                    return node === node2;\n                }\n\n                function findCaretNode(node, forward, startNode) {\n                    var walker, current, nonEmptyElements;\n\n                    nonEmptyElements = dom.schema.getNonEmptyElements();\n\n                    walker = new TreeWalker(startNode || node, node);\n\n                    while ((current = walker[forward ? 'next' : 'prev']())) {\n                        if (nonEmptyElements[current.nodeName] && !isTrailingBr(current)) {\n                            return current;\n                        }\n\n                        if (current.nodeType == 3 && current.data.length > 0) {\n                            return current;\n                        }\n                    }\n                }\n\n                function deleteRangeBetweenTextBlocks(rng) {\n                    var startBlock, endBlock, caretNodeBefore, caretNodeAfter, textBlockElements;\n\n                    if (rng.collapsed) {\n                        return;\n                    }\n\n                    startBlock = dom.getParent(RangeUtils.getNode(rng.startContainer, rng.startOffset), dom.isBlock);\n                    endBlock = dom.getParent(RangeUtils.getNode(rng.endContainer, rng.endOffset), dom.isBlock);\n                    textBlockElements = editor.schema.getTextBlockElements();\n\n                    if (startBlock == endBlock) {\n                        return;\n                    }\n\n                    if (!textBlockElements[startBlock.nodeName] || !textBlockElements[endBlock.nodeName]) {\n                        return;\n                    }\n\n                    if (dom.getContentEditable(startBlock) === \"false\" || dom.getContentEditable(endBlock) === \"false\") {\n                        return;\n                    }\n\n                    rng.deleteContents();\n\n                    caretNodeBefore = findCaretNode(startBlock, false);\n                    caretNodeAfter = findCaretNode(endBlock, true);\n\n                    if (!dom.isEmpty(endBlock)) {\n                        $(startBlock).append(endBlock.childNodes);\n                    }\n\n                    $(endBlock).remove();\n\n                    if (caretNodeBefore) {\n                        if (caretNodeBefore.nodeType == 1) {\n                            if (caretNodeBefore.nodeName == \"BR\") {\n                                rng.setStartBefore(caretNodeBefore);\n                                rng.setEndBefore(caretNodeBefore);\n                            } else {\n                                rng.setStartAfter(caretNodeBefore);\n                                rng.setEndAfter(caretNodeBefore);\n                            }\n                        } else {\n                            rng.setStart(caretNodeBefore, caretNodeBefore.data.length);\n                            rng.setEnd(caretNodeBefore, caretNodeBefore.data.length);\n                        }\n                    } else if (caretNodeAfter) {\n                        if (caretNodeAfter.nodeType == 1) {\n                            rng.setStartBefore(caretNodeAfter);\n                            rng.setEndBefore(caretNodeAfter);\n                        } else {\n                            rng.setStart(caretNodeAfter, 0);\n                            rng.setEnd(caretNodeAfter, 0);\n                        }\n                    }\n\n                    selection.setRng(rng);\n\n                    return true;\n                }\n\n                function expandBetweenBlocks(rng, isForward) {\n                    var caretNode, targetCaretNode, textBlock, targetTextBlock, container, offset;\n\n                    if (!rng.collapsed) {\n                        return rng;\n                    }\n\n                    container = rng.startContainer;\n                    offset = rng.startOffset;\n\n                    if (container.nodeType == 3) {\n                        if (isForward) {\n                            if (offset < container.data.length) {\n                                return rng;\n                            }\n                        } else {\n                            if (offset > 0) {\n                                return rng;\n                            }\n                        }\n                    }\n\n                    caretNode = RangeUtils.getNode(rng.startContainer, rng.startOffset);\n                    textBlock = dom.getParent(caretNode, dom.isBlock);\n                    targetCaretNode = findCaretNode(editor.getBody(), isForward, caretNode);\n                    targetTextBlock = dom.getParent(targetCaretNode, dom.isBlock);\n\n                    if (!caretNode || !targetCaretNode) {\n                        return rng;\n                    }\n\n                    if (targetTextBlock && textBlock != targetTextBlock) {\n                        if (!isForward) {\n                            if (!isSiblingsIgnoreWhiteSpace(targetTextBlock, textBlock)) {\n                                return rng;\n                            }\n\n                            if (targetCaretNode.nodeType == 1) {\n                                if (targetCaretNode.nodeName == \"BR\") {\n                                    rng.setStartBefore(targetCaretNode);\n                                } else {\n                                    rng.setStartAfter(targetCaretNode);\n                                }\n                            } else {\n                                rng.setStart(targetCaretNode, targetCaretNode.data.length);\n                            }\n\n                            if (caretNode.nodeType == 1) {\n                                rng.setEnd(caretNode, 0);\n                            } else {\n                                rng.setEndBefore(caretNode);\n                            }\n                        } else {\n                            if (!isSiblingsIgnoreWhiteSpace(textBlock, targetTextBlock)) {\n                                return rng;\n                            }\n\n                            if (caretNode.nodeType == 1) {\n                                if (caretNode.nodeName == \"BR\") {\n                                    rng.setStartBefore(caretNode);\n                                } else {\n                                    rng.setStartAfter(caretNode);\n                                }\n                            } else {\n                                rng.setStart(caretNode, caretNode.data.length);\n                            }\n\n                            if (targetCaretNode.nodeType == 1) {\n                                rng.setEnd(targetCaretNode, 0);\n                            } else {\n                                rng.setEndBefore(targetCaretNode);\n                            }\n                        }\n                    }\n\n                    return rng;\n                }\n\n                function handleTextBlockMergeDelete(isForward) {\n                    var rng = selection.getRng();\n\n                    rng = expandBetweenBlocks(rng, isForward);\n\n                    if (deleteRangeBetweenTextBlocks(rng)) {\n                        return true;\n                    }\n                }\n\n                /**\n                 * This retains the formatting if the last character is to be deleted.\n                 *\n                 * Backspace on this: <p><b><i>a|</i></b></p> would become <p>|</p> in WebKit.\n                 * With this patch: <p><b><i>|<br></i></b></p>\n                 */\n                function handleLastBlockCharacterDelete(isForward, rng) {\n                    var path, blockElm, newBlockElm, clonedBlockElm, sibling,\n                        container, offset, br, currentFormatNodes;\n\n                    function cloneTextBlockWithFormats(blockElm, node) {\n                        currentFormatNodes = $(node).parents().filter(function(idx, node) {\n                            return !!editor.schema.getTextInlineElements()[node.nodeName];\n                        });\n\n                        newBlockElm = blockElm.cloneNode(false);\n\n                        currentFormatNodes = Tools.map(currentFormatNodes, function(formatNode) {\n                            formatNode = formatNode.cloneNode(false);\n\n                            if (newBlockElm.hasChildNodes()) {\n                                formatNode.appendChild(newBlockElm.firstChild);\n                                newBlockElm.appendChild(formatNode);\n                            } else {\n                                newBlockElm.appendChild(formatNode);\n                            }\n\n                            newBlockElm.appendChild(formatNode);\n\n                            return formatNode;\n                        });\n\n                        if (currentFormatNodes.length) {\n                            br = dom.create('br');\n                            currentFormatNodes[0].appendChild(br);\n                            dom.replace(newBlockElm, blockElm);\n\n                            rng.setStartBefore(br);\n                            rng.setEndBefore(br);\n                            editor.selection.setRng(rng);\n\n                            return br;\n                        }\n\n                        return null;\n                    }\n\n                    function isTextBlock(node) {\n                        return node && editor.schema.getTextBlockElements()[node.tagName];\n                    }\n\n                    if (!rng.collapsed) {\n                        return;\n                    }\n\n                    container = rng.startContainer;\n                    offset = rng.startOffset;\n                    blockElm = dom.getParent(container, dom.isBlock);\n                    if (!isTextBlock(blockElm)) {\n                        return;\n                    }\n\n                    if (container.nodeType == 1) {\n                        container = container.childNodes[offset];\n                        if (container && container.tagName != 'BR') {\n                            return;\n                        }\n\n                        if (isForward) {\n                            sibling = blockElm.nextSibling;\n                        } else {\n                            sibling = blockElm.previousSibling;\n                        }\n\n                        if (dom.isEmpty(blockElm) && isTextBlock(sibling) && dom.isEmpty(sibling)) {\n                            if (cloneTextBlockWithFormats(blockElm, container)) {\n                                dom.remove(sibling);\n                                return true;\n                            }\n                        }\n                    } else if (container.nodeType == 3) {\n                        path = NodePath.create(blockElm, container);\n                        clonedBlockElm = blockElm.cloneNode(true);\n                        container = NodePath.resolve(clonedBlockElm, path);\n\n                        if (isForward) {\n                            if (offset >= container.data.length) {\n                                return;\n                            }\n\n                            container.deleteData(offset, 1);\n                        } else {\n                            if (offset <= 0) {\n                                return;\n                            }\n\n                            container.deleteData(offset - 1, 1);\n                        }\n\n                        if (dom.isEmpty(clonedBlockElm)) {\n                            return cloneTextBlockWithFormats(blockElm, container);\n                        }\n                    }\n                }\n\n                function customDelete(isForward) {\n                    var mutationObserver, rng, caretElement;\n\n                    if (handleTextBlockMergeDelete(isForward)) {\n                        return;\n                    }\n\n                    Tools.each(editor.getBody().getElementsByTagName('*'), function(elm) {\n                        // Mark existing spans\n                        if (elm.tagName == 'SPAN') {\n                            elm.setAttribute('mce-data-marked', 1);\n                        }\n\n                        // Make sure all elements has a data-mce-style attribute\n                        if (!elm.hasAttribute('data-mce-style') && elm.hasAttribute('style')) {\n                            editor.dom.setAttrib(elm, 'style', editor.dom.getAttrib(elm, 'style'));\n                        }\n                    });\n\n                    // Observe added nodes and style attribute changes\n                    mutationObserver = new MutationObserver(function() {});\n                    mutationObserver.observe(editor.getDoc(), {\n                        childList: true,\n                        attributes: true,\n                        subtree: true,\n                        attributeFilter: ['style']\n                    });\n\n                    editor.getDoc().execCommand(isForward ? 'ForwardDelete' : 'Delete', false, null);\n\n                    rng = editor.selection.getRng();\n                    caretElement = rng.startContainer.parentNode;\n\n                    Tools.each(mutationObserver.takeRecords(), function(record) {\n                        if (!dom.isChildOf(record.target, editor.getBody())) {\n                            return;\n                        }\n\n                        // Restore style attribute to previous value\n                        if (record.attributeName == \"style\") {\n                            var oldValue = record.target.getAttribute('data-mce-style');\n\n                            if (oldValue) {\n                                record.target.setAttribute(\"style\", oldValue);\n                            } else {\n                                record.target.removeAttribute(\"style\");\n                            }\n                        }\n\n                        // Remove all spans that aren't marked and retain selection\n                        Tools.each(record.addedNodes, function(node) {\n                            if (node.nodeName == \"SPAN\" && !node.getAttribute('mce-data-marked')) {\n                                var offset, container;\n\n                                if (node == caretElement) {\n                                    offset = rng.startOffset;\n                                    container = node.firstChild;\n                                }\n\n                                dom.remove(node, true);\n\n                                if (container) {\n                                    rng.setStart(container, offset);\n                                    rng.setEnd(container, offset);\n                                    editor.selection.setRng(rng);\n                                }\n                            }\n                        });\n                    });\n\n                    mutationObserver.disconnect();\n\n                    // Remove any left over marks\n                    Tools.each(editor.dom.select('span[mce-data-marked]'), function(span) {\n                        span.removeAttribute('mce-data-marked');\n                    });\n                }\n\n                editor.on('keydown', function(e) {\n                    var isForward = e.keyCode == DELETE,\n                        isMetaOrCtrl = e.ctrlKey || e.metaKey;\n\n                    if (!isDefaultPrevented(e) && (isForward || e.keyCode == BACKSPACE)) {\n                        var rng = editor.selection.getRng(),\n                            container = rng.startContainer,\n                            offset = rng.startOffset;\n\n                        // Shift+Delete is cut\n                        if (isForward && e.shiftKey) {\n                            return;\n                        }\n\n                        if (handleLastBlockCharacterDelete(isForward, rng)) {\n                            e.preventDefault();\n                            return;\n                        }\n\n                        // Ignore non meta delete in the where there is text before/after the caret\n                        if (!isMetaOrCtrl && rng.collapsed && container.nodeType == 3) {\n                            if (isForward ? offset < container.data.length : offset > 0) {\n                                return;\n                            }\n                        }\n\n                        e.preventDefault();\n\n                        if (isMetaOrCtrl) {\n                            editor.selection.getSel().modify(\"extend\", isForward ? \"forward\" : \"backward\", e.metaKey ? \"lineboundary\" : \"word\");\n                        }\n\n                        customDelete(isForward);\n                    }\n                });\n\n                // Handle case where text is deleted by typing over\n                editor.on('keypress', function(e) {\n                    if (!isDefaultPrevented(e) && !selection.isCollapsed() && e.charCode > 31 && !VK.metaKeyPressed(e)) {\n                        var rng, currentFormatNodes, fragmentNode, blockParent, caretNode, charText;\n\n                        rng = editor.selection.getRng();\n                        charText = String.fromCharCode(e.charCode);\n                        e.preventDefault();\n\n                        // Keep track of current format nodes\n                        currentFormatNodes = $(rng.startContainer).parents().filter(function(idx, node) {\n                            return !!editor.schema.getTextInlineElements()[node.nodeName];\n                        });\n\n                        customDelete(true);\n\n                        // Check if the browser removed them\n                        currentFormatNodes = currentFormatNodes.filter(function(idx, node) {\n                            return !$.contains(editor.getBody(), node);\n                        });\n\n                        // Then re-add them\n                        if (currentFormatNodes.length) {\n                            fragmentNode = dom.createFragment();\n\n                            currentFormatNodes.each(function(idx, formatNode) {\n                                formatNode = formatNode.cloneNode(false);\n\n                                if (fragmentNode.hasChildNodes()) {\n                                    formatNode.appendChild(fragmentNode.firstChild);\n                                    fragmentNode.appendChild(formatNode);\n                                } else {\n                                    caretNode = formatNode;\n                                    fragmentNode.appendChild(formatNode);\n                                }\n\n                                fragmentNode.appendChild(formatNode);\n                            });\n\n                            caretNode.appendChild(editor.getDoc().createTextNode(charText));\n\n                            // Prevent edge case where older WebKit would add an extra BR element\n                            blockParent = dom.getParent(rng.startContainer, dom.isBlock);\n                            if (dom.isEmpty(blockParent)) {\n                                $(blockParent).empty().append(fragmentNode);\n                            } else {\n                                rng.insertNode(fragmentNode);\n                            }\n\n                            rng.setStart(caretNode.firstChild, 1);\n                            rng.setEnd(caretNode.firstChild, 1);\n                            editor.selection.setRng(rng);\n                        } else {\n                            editor.selection.setContent(charText);\n                        }\n                    }\n                });\n\n                editor.addCommand('Delete', function() {\n                    customDelete();\n                });\n\n                editor.addCommand('ForwardDelete', function() {\n                    customDelete(true);\n                });\n\n                // Older WebKits doesn't properly handle the clipboard so we can't add the rest\n                if (olderWebKit) {\n                    return;\n                }\n\n                editor.on('dragstart', function(e) {\n                    dragStartRng = selection.getRng();\n                    setMceInternalContent(e);\n                });\n\n                editor.on('drop', function(e) {\n                    if (!isDefaultPrevented(e)) {\n                        var internalContent = getMceInternalContent(e);\n\n                        if (internalContent) {\n                            e.preventDefault();\n\n                            // Safari has a weird issue where drag/dropping images sometimes\n                            // produces a green plus icon. When this happens the caretRangeFromPoint\n                            // will return \"null\" even though the x, y coordinate is correct.\n                            // But if we detach the insert from the drop event we will get a proper range\n                            Delay.setEditorTimeout(editor, function() {\n                                var pointRng = RangeUtils.getCaretRangeFromPoint(e.x, e.y, doc);\n\n                                if (dragStartRng) {\n                                    selection.setRng(dragStartRng);\n                                    dragStartRng = null;\n                                }\n\n                                customDelete();\n                                selection.setRng(pointRng);\n                                insertClipboardContents(internalContent.html);\n                            });\n                        }\n                    }\n                });\n\n                editor.on('cut', function(e) {\n                    if (!isDefaultPrevented(e) && e.clipboardData && !editor.selection.isCollapsed()) {\n                        e.preventDefault();\n                        e.clipboardData.clearData();\n                        e.clipboardData.setData('text/html', editor.selection.getContent());\n                        e.clipboardData.setData('text/plain', editor.selection.getContent({ format: 'text' }));\n\n                        // Needed delay for https://code.google.com/p/chromium/issues/detail?id=363288#c3\n                        // Nested delete/forwardDelete not allowed on execCommand(\"cut\")\n                        // This is ugly but not sure how to work around it otherwise\n                        Delay.setEditorTimeout(editor, function() {\n                            customDelete(true);\n                        });\n                    }\n                });\n            }", "docstring": "/**\n             * Fixes a WebKit bug when deleting contents using backspace or delete key.\n             * WebKit will produce a span element if you delete across two block elements.\n             *\n             * Example:\n             * <h1>a</h1><p>|b</p>\n             *\n             * Will produce this on backspace:\n             * <h1>a<span style=\"<all runtime styles>\">b</span></p>\n             *\n             * This fixes the backspace to produce:\n             * <h1>a|b</p>\n             *\n             * See bug: https://bugs.webkit.org/show_bug.cgi?id=45784\n             *\n             * This fixes the following delete scenarios:\n             *  1. Delete by pressing backspace key.\n             *  2. Delete by pressing delete key.\n             *  3. Delete by pressing backspace key with ctrl/cmd (Word delete).\n             *  4. Delete by pressing delete key with ctrl/cmd (Word delete).\n             *  5. Delete by drag/dropping contents inside the editor.\n             *  6. Delete by using Cut Ctrl+X/Cmd+X.\n             *  7. Delete by selecting contents and writing a character.\n             *\n             * This code is a ugly hack since writing full custom delete logic for just this bug\n             * fix seemed like a huge task. I hope we can remove this before the year 2030.\n             */", "url": "https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/plugins/tinymce/tinymce.jquery.min.js#L32436-L33021", "sha": "f0fa12c3e312cab38147ff9c204945667f46da75"}1191{"repo_name": "inventory", "dataset": "github_2023", "owner": "carmonabernaldiego", "lang": "javascript", "func_name": "isDefaultPrevented", "code": "function isDefaultPrevented(e) {\n\t\t\treturn e.isDefaultPrevented();\n\t\t}", "docstring": "/**\n\t\t * Returns true/false if the event is prevented or not.\n\t\t *\n\t\t * @private\n\t\t * @param {Event} e Event object.\n\t\t * @return {Boolean} true/false if the event is prevented or not.\n\t\t */", "url": "https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/plugins/tinymce/tinymce.js#L31914-L31916", "sha": "f0fa12c3e312cab38147ff9c204945667f46da75"}1192{"repo_name": "inventory", "dataset": "github_2023", "owner": "carmonabernaldiego", "lang": "javascript", "func_name": "setWrapToString", "code": "function setWrapToString(wrapper, reference, bitmask) {\n      var source = (reference + '');\n      return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));\n    }", "docstring": "/**\n     * Sets the `toString` method of `wrapper` to mimic the source of `reference`\n     * with wrapper details in a comment at the top of the source body.\n     *\n     * @private\n     * @param {Function} wrapper The function to modify.\n     * @param {Function} reference The reference function.\n     * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n     * @returns {Function} Returns `wrapper`.\n     */", "url": "https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/public/js/app.js#L21044-L21047", "sha": "f0fa12c3e312cab38147ff9c204945667f46da75"}1193{"repo_name": "inventory", "dataset": "github_2023", "owner": "carmonabernaldiego", "lang": "javascript", "func_name": "forEachRight", "code": "function forEachRight(collection, iteratee) {\n      var func = isArray(collection) ? arrayEachRight : baseEachRight;\n      return func(collection, getIteratee(iteratee, 3));\n    }", "docstring": "/**\n     * This method is like `_.forEach` except that it iterates over elements of\n     * `collection` from right to left.\n     *\n     * @static\n     * @memberOf _\n     * @since 2.0.0\n     * @alias eachRight\n     * @category Collection\n     * @param {Array|Object} collection The collection to iterate over.\n     * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n     * @returns {Array|Object} Returns `collection`.\n     * @see _.forEach\n     * @example\n     *\n     * _.forEachRight([1, 2], function(value) {\n     *   console.log(value);\n     * });\n     * // => Logs `2` then `1`.\n     */", "url": "https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/public/js/app.js#L23744-L23747", "sha": "f0fa12c3e312cab38147ff9c204945667f46da75"}1194{"repo_name": "inventory", "dataset": "github_2023", "owner": "carmonabernaldiego", "lang": "javascript", "func_name": "EffectScope.off", "code": "off() {\n        activeEffectScope = this.parent;\n    }", "docstring": "/**\n     * This should only be called on non-detached scopes\n     * @internal\n     */", "url": "https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/public/js/category.js#L26469-L26471", "sha": "f0fa12c3e312cab38147ff9c204945667f46da75"}1195{"repo_name": "inventory", "dataset": "github_2023", "owner": "carmonabernaldiego", "lang": "javascript", "func_name": "noop", "code": "function noop(a, b, c) { }", "docstring": "/* eslint-disable no-unused-vars */", "url": "https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/public/js/invoice.js#L23215-L23215", "sha": "f0fa12c3e312cab38147ff9c204945667f46da75"}1196{"repo_name": "inventory", "dataset": "github_2023", "owner": "carmonabernaldiego", "lang": "javascript", "func_name": "checkKeyCodes", "code": "function checkKeyCodes(eventKeyCode, key, builtInKeyCode, eventKeyName, builtInKeyName) {\n    const mappedKeyCode = config.keyCodes[key] || builtInKeyCode;\n    if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {\n        return isKeyNotMatch(builtInKeyName, eventKeyName);\n    }\n    else if (mappedKeyCode) {\n        return isKeyNotMatch(mappedKeyCode, eventKeyCode);\n    }\n    else if (eventKeyName) {\n        return hyphenate(eventKeyName) !== key;\n    }\n    return eventKeyCode === undefined;\n}", "docstring": "/**\n * Runtime helper for checking keyCodes from config.\n * exposed as Vue.prototype._k\n * passing in eventKeyName as last argument separately for backwards compat\n */", "url": "https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/public/js/product.js#L24888-L24900", "sha": "f0fa12c3e312cab38147ff9c204945667f46da75"}1197{"repo_name": "inventory", "dataset": "github_2023", "owner": "carmonabernaldiego", "lang": "javascript", "func_name": "queueActivatedComponent", "code": "function queueActivatedComponent(vm) {\n    // setting _inactive to false here so that a render function can\n    // rely on checking whether it's in an inactive tree (e.g. router-view)\n    vm._inactive = false;\n    activatedChildren.push(vm);\n}", "docstring": "/**\n * Queue a kept-alive component that was activated during patch.\n * The queue will be processed after the entire tree has been patched.\n */", "url": "https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/public/js/role.js#L26168-L26173", "sha": "f0fa12c3e312cab38147ff9c204945667f46da75"}1198{"repo_name": "inventory", "dataset": "github_2023", "owner": "carmonabernaldiego", "lang": "javascript", "func_name": "nextTick", "code": "function nextTick(cb, ctx) {\n    let _resolve;\n    callbacks.push(() => {\n        if (cb) {\n            try {\n                cb.call(ctx);\n            }\n            catch (e) {\n                handleError(e, ctx, 'nextTick');\n            }\n        }\n        else if (_resolve) {\n            _resolve(ctx);\n        }\n    });\n    if (!pending) {\n        pending = true;\n        timerFunc();\n    }\n    // $flow-disable-line\n    if (!cb && typeof Promise !== 'undefined') {\n        return new Promise(resolve => {\n            _resolve = resolve;\n        });\n    }\n}", "docstring": "/**\n * @internal\n */", "url": "https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/public/js/user.js#L26742-L26767", "sha": "f0fa12c3e312cab38147ff9c204945667f46da75"}1199{"repo_name": "inventory", "dataset": "github_2023", "owner": "carmonabernaldiego", "lang": "javascript", "func_name": "hydrate", "code": "function hydrate(elm, vnode, insertedVnodeQueue, inVPre) {\n        let i;\n        const { tag, data, children } = vnode;\n        inVPre = inVPre || (data && data.pre);\n        vnode.elm = elm;\n        if (isTrue(vnode.isComment) && isDef(vnode.asyncFactory)) {\n            vnode.isAsyncPlaceholder = true;\n            return true;\n        }\n        // assert node match\n        {\n            if (!assertNodeMatch(elm, vnode, inVPre)) {\n                return false;\n            }\n        }\n        if (isDef(data)) {\n            if (isDef((i = data.hook)) && isDef((i = i.init)))\n                i(vnode, true /* hydrating */);\n            if (isDef((i = vnode.componentInstance))) {\n                // child component. it should have hydrated its own tree.\n                initComponent(vnode, insertedVnodeQueue);\n                return true;\n            }\n        }\n        if (isDef(tag)) {\n            if (isDef(children)) {\n                // empty element, allow client to pick up and populate children\n                if (!elm.hasChildNodes()) {\n                    createChildren(vnode, children, insertedVnodeQueue);\n                }\n                else {\n                    // v-html and domProps: innerHTML\n                    if (isDef((i = data)) &&\n                        isDef((i = i.domProps)) &&\n                        isDef((i = i.innerHTML))) {\n                        if (i !== elm.innerHTML) {\n                            /* istanbul ignore if */\n                            if (typeof console !== 'undefined' &&\n                                !hydrationBailed) {\n                                hydrationBailed = true;\n                                console.warn('Parent: ', elm);\n                                console.warn('server innerHTML: ', i);\n                                console.warn('client innerHTML: ', elm.innerHTML);\n                            }\n                            return false;\n                        }\n                    }\n                    else {\n                        // iterate and compare children lists\n                        let childrenMatch = true;\n                        let childNode = elm.firstChild;\n                        for (let i = 0; i < children.length; i++) {\n                            if (!childNode ||\n                                !hydrate(childNode, children[i], insertedVnodeQueue, inVPre)) {\n                                childrenMatch = false;\n                                break;\n                            }\n                            childNode = childNode.nextSibling;\n                        }\n                        // if childNode is not null, it means the actual childNodes list is\n                        // longer than the virtual children list.\n                        if (!childrenMatch || childNode) {\n                            /* istanbul ignore if */\n                            if (typeof console !== 'undefined' &&\n                                !hydrationBailed) {\n                                hydrationBailed = true;\n                                console.warn('Parent: ', elm);\n                                console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children);\n                            }\n                            return false;\n                        }\n                    }\n                }\n            }\n            if (isDef(data)) {\n                let fullInvoke = false;\n                for (const key in data) {\n                    if (!isRenderedModule(key)) {\n                        fullInvoke = true;\n                        invokeCreateHooks(vnode, insertedVnodeQueue);\n                        break;\n                    }\n                }\n                if (!fullInvoke && data['class']) {\n                    // ensure collecting deps for deep class bindings for future updates\n                    traverse(data['class']);\n                }\n            }\n        }\n        else if (elm.data !== vnode.text) {\n            elm.data = vnode.text;\n        }\n        return true;\n    }", "docstring": "// Note: this is a browser-only function so we can assume elms are DOM nodes.", "url": "https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/public/js/user.js#L29871-L29964", "sha": "f0fa12c3e312cab38147ff9c204945667f46da75"}1200{"repo_name": "mrjs", "dataset": "github_2023", "owner": "Volumetrics-io", "lang": "javascript", "func_name": "MRHand.constructor", "code": "constructor(handedness, scene) {\n        this.handedness = handedness;\n        this.pinch = false;\n\n        this.lastPosition = new THREE.Vector3();\n        this.active = false;\n\n        this.jointPhysicsBodies = {};\n        this.pointer = new THREE.Object3D();\n\n        this.identityPosition = new THREE.Vector3();\n\n        this.tempJointPosition = new THREE.Vector3();\n        this.tempJointOrientation = new THREE.Quaternion();\n\n        this.controllerModelFactory = new XRControllerModelFactory();\n        this.handModelFactory = new XRHandModelFactory();\n\n        this.mesh;\n        this.controller = mrjsUtils.xr.getController(HAND_MAPPING[handedness]);\n        this.controller.add(this.pointer);\n        this.pointer.position.setZ(-0.5);\n\n        this.grip = mrjsUtils.xr.getControllerGrip(HAND_MAPPING[handedness]);\n        this.grip.add(this.controllerModelFactory.createControllerModel(this.grip));\n\n        this.hand = mrjsUtils.xr.getHand(HAND_MAPPING[handedness]);\n        this.model = this.handModelFactory.createHandModel(this.hand, 'mesh');\n\n        this.hand.add(this.model);\n\n        this.hand.addEventListener('selectstart', this.onSelect);\n        this.hand.addEventListener('selectend', this.onSelect);\n\n        scene.add(this.controller);\n        scene.add(this.grip);\n        scene.add(this.hand);\n        this.initPhysicsBodies();\n    }", "docstring": "/**\n     * @class\n     * @description Constructor for the MRHand class object. Setups up all attributes for MRHand including physics, mouse/cursor information, hand tracking and state, and model\n     * @param {object} handedness - enum for the `left`` or `right` hand.\n     * @param {object} scene - the threejs scene object with information from the MRApp.\n     */", "url": "https://github.com/Volumetrics-io/mrjs/blob/8b31dbfc30f9c12ba74dd59ca44bde6e7de32f79/src/core/user/MRHand.js#L67-L105", "sha": "8b31dbfc30f9c12ba74dd59ca44bde6e7de32f79"}

Showing the first 1,200 of 2001 lines. Download the file for the rest.