sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
fc8a61c94107310aace0d674d1541cf1e0d96f125e77179f5958ee001f11eb6c
C/C++
12,896
374
/******************************************************************************* Infomap software package for multi-level network clustering Copyright (c) 2013, 2014 Daniel Edler, Anton Holmgren, Martin Rosvall This file is part of the Infomap software package. See file LICENSE_GPLv3.txt for full license details. ...
fba053b6b03d9f49becd93d5ef838aa480bef004295459539ffec931d4c299ef
C/C++
12,957
378
/* igraph library. Copyright (C) 2013 Gabor Csardi <csardi.gabor@gmail.com> 334 Harvard street, Cambridge, MA 02139 USA This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either versi...
892c1e4a9cb3253678619de369dc45f762907ada4c9254b8767588ea618cddb4
C/C++
13,237
563
/*<html><pre> -<a href="qh-stat_r.htm" >-------------------------------</a><a name="TOP">-</a> stat_r.h contains all statistics that are collected for qhull see qh-stat_r.htm and stat_r.c Copyright (c) 1993-2020 The Geometry Center. $Id: //main/2019/qhull/src/libqhull_...
af7e0cf1fb7506809e1cc92d0640c03db26cbd90b00fc59cdb15543450a2d8ff
C/C++
13,239
229
/* igraph library. Copyright (C) 2009-2025 The igraph development team <igraph@igraph.org> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at y...
60258a0fdb9139047e2a908f6ed744410db0ed97d76a7c5d151e57c2baf3d32e
C/C++
13,298
418
/********************************************************************************** Infomap software package for multi-level network clustering Copyright (c) 2013, 2014 Daniel Edler, Martin Rosvall For more information, see <http://www.mapequation.org> This file is part of Infomap software package. Infomap s...
fa53896a31772666137136db89496117bda0f86668e55ebb302452aa5a3d3d5a
C/C++
13,330
251
/* igraph library. Copyright (C) 2007-2025 The igraph development team <igraph@igraph.org> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at y...
1520f8072ea1da819708c68b49c9e86c70cb612a5e6cdd0847901eb8b7cbaf02
C/C++
13,487
315
/* This is a MODIFIED version of the original CXSparse/Include/cs.h file from * SuiteSparse 5.12.0 (CXSparse version 3.2.0). The modifications are outlined * here: * * - Dependency on SuiteSparse_long was removed * - CXSparse is configured to use igraph_int_t as cs_long_t * - CXSparse function prefix is set to c...
de71268e3757eb79276668c3fc5df38fc624e0cb0b0690fe9d2b52e73c61eacb
C/C++
13,521
339
/******************************************************************************* Infomap software package for multi-level network clustering Copyright (c) 2013, 2014 Daniel Edler, Anton Holmgren, Martin Rosvall This file is part of the Infomap software package. See file LICENSE_GPLv3.txt for full license details. ...
b1b056dba251ff8f80f815f9895dd7e366b1561d18e1e689afbb372c9ab5698e
C/C++
14,238
416
/* igraph library. Copyright (C) 2009-2025 The igraph development team <igraph@igraph.org> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at y...
99dbaafa8e449d68f5b42fa652f35a0364885d8e95ef33b23c0b1ab3c3678794
C/C++
14,635
423
/******************************************************************************* Infomap software package for multi-level network clustering Copyright (c) 2013, 2014 Daniel Edler, Anton Holmgren, Martin Rosvall This file is part of the Infomap software package. See file LICENSE_GPLv3.txt for full license details. ...
7630488412df5fec6918668df6b151c0bb2630dadaafa48610fb42f61b420409
C/C++
14,656
282
/* igraph library. Copyright (C) 2009-2025 The igraph development team <igraph@igraph.org> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at y...
ee597277ae915df9005e1b3f84f9a6b5c9b3b7d0f9025e1d9beb0f0dc8d506a8
C/C++
14,876
734
/********************************************************************************** Infomap software package for multi-level network clustering Copyright (c) 2013, 2014 Daniel Edler, Martin Rosvall For more information, see <http://www.mapequation.org> This file is part of Infomap software package. Infomap...
e05008dbb64cba295771ce50a6f9da87280b20325d07af88d74f9bbc2bcd7230
C/C++
15,207
376
#ifndef __DIAGCVR_FILETOOLS_H__ #define __DIAGCVR_FILETOOLS_H__ #include "core_export.h" #include <string> #include <vector> namespace core { // FUNCTION GROUP: file utility functions: ///////////////////// // Returns true iff file exists (it is not checked if the file can be opened) bool CORE_EXPOR...
6b1ad19ba8009a1005b9287a94050c528e78ed5b42c82bb333d35e3ef7fd37d4
C/C++
15,242
280
/* igraph library. Copyright (C) 2009-2025 The igraph development team <igraph@igraph.org> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at y...
8af100e3ee674cb80440002da55d0234461aaee1c81fffed7125d883c7f0cb03
C/C++
15,461
502
/********************************************************************************** Infomap software package for multi-level network clustering Copyright (c) 2013, 2014 Daniel Edler, Martin Rosvall For more information, see <http://www.mapequation.org> This file is part of Infomap software package. Infomap s...
31c3955de43adcbbb141ef41f758dfd0151f21ce0fbf152a4069f060dc17ecfa
C/C++
15,484
287
/* igraph library. Copyright (C) 2010-2025 The igraph development team <igraph@igraph.org> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at y...
7ce86d74c9e2ffe7d419bbcb140611eeeeddf7511b42f30fab2fec550b1c4005
C/C++
15,609
422
#ifndef SURVIVAL_FOREST_UTILITY_H_ #define SURVIVAL_FOREST_UTILITY_H_ #include <vector> #include <iostream> #include <fstream> #include <algorithm> #include <random> #include <unordered_set> #include <unordered_map> #include <cstddef> #include <memory> #include <type_traits> #include <utility> #ifdef R_BUILD #inc...
983dce408fefe6ccfdf67c0b5ecee955f7631422a679b3c917a2421141125569
C/C++
16,066
515
/*<html><pre> -<a href="qh-set_r.htm" >-------------------------------</a><a name="TOP">-</a> qset_r.h header file for qset_r.c that implements set see qh-set_r.htm and qset_r.c only uses mem_r.c, malloc/free for error handling, writes message and calls qh_errex...
ff2657519e6bcc16eb92280a9e96f1187620acbe17ecac6b76d9e39945ab2b8b
C/C++
16,280
293
/* igraph library. Copyright (C) 2009-2025 The igraph development team <igraph@igraph.org> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at y...
03cfcf0a4fda90f412344f07754efbcdeb060cf44cb1ba31cce8362205c46534
C/C++
16,302
628
/******************************************************************************* Infomap software package for multi-level network clustering Copyright (c) 2013, 2014 Daniel Edler, Anton Holmgren, Martin Rosvall This file is part of the Infomap software package. See file LICENSE_GPLv3.txt for full license details. ...
1fdf6b2c42f8c3b58d1ca639fe9e646067508088a1cb6e90879205a9874402f4
C/C++
16,428
567
/* igraph library. Copyright (C) 2006-2012 Gabor Csardi <csardi.gabor@gmail.com> 334 Harvard street, Cambridge, MA 02139 USA This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either ...
a256ad0da4344afa13b49093dd07d8038d4cd8814726b7b506f77f60de2e1a75
C/C++
16,457
313
/* igraph library. Copyright (C) 2007-2025 The igraph development team <igraph@igraph.org> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at y...
9503f33e465b9c6229831310ce42dae8408137ed84057a8f72b97e08f88cd325
C/C++
16,499
479
/*Copyright (c) 2018 Miguel Monteiro, Andrew Adams, Jongmin Baek, Abe Davis Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights ...
fd44d49f8299fbbdaf5519155070fdcf66a51277beaca99b40f9b68d9ff4efe2
C/C++
16,604
301
/* igraph library. Copyright (C) 2009-2025 The igraph development team <igraph@igraph.org> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at y...
23ee652878d5b8f005e3a982e4f4ceb658969dbabef88449d9b4b064f975ed69
C/C++
16,731
434
/* glpssx.h (simplex method, rational arithmetic) */ /*********************************************************************** * This code is part of GLPK (GNU Linear Programming Kit). * Copyright (C) 2003-2013 Free Software Foundation, Inc. * Written by Andrew Makhorin <mao@gnu.org>. * * GLPK is free software: you...
f5db1414cb0b409334b76a65d62140782ec6294688dfe4e360fb8a1f90cca40b
C/C++
16,960
716
/********************************************************************************** Infomap software package for multi-level network clustering Copyright (c) 2013, 2014 Daniel Edler, Martin Rosvall For more information, see <http://www.mapequation.org> This file is part of Infomap software package. Infomap s...
da3d34bdd839576b921c20c8e04a4fc6add1356bb3d66aa7287e4c5550615891
C/C++
17,461
395
/* igraph library. Copyright (C) 2007-2025 The igraph development team <igraph@igraph.org> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at y...
c768fda23d9dc1a5d6b8d96ce59aad7a587dd119a69b5c6aeb857d05330d753a
C/C++
17,576
537
/********************************************************************************** Infomap software package for multi-level network clustering Copyright (c) 2013, 2014 Daniel Edler, Martin Rosvall For more information, see <http://www.mapequation.org> This file is part of Infomap software package. Infomap s...
b5f849171d8bc8115d18bc822ff947417a727358b1a261ca4d68b2d991f5305b
C/C++
18,004
509
/* SPDX-License-Identifier: BSD-3-Clause */ /* Copyright (c) 2020-2026, Christian Gaser. See LICENSE. */ /* * Exact TFCE via a max-tree (component tree) built with union-find. * * Shared core for tfceMex_maxtree (one map) and tfceMex_maxtree_batch (many * maps in parallel). The TFCE integral * * TFCE(v) = int...
dff17bb68d67014ecaa9835a29eefedd293557c184e0725a316a367416bf11b2
C/C++
19,111
468
/********************************************************************************** Infomap software package for multi-level network clustering Copyright (c) 2013, 2014 Daniel Edler, Martin Rosvall For more information, see <http://www.mapequation.org> This file is part of Infomap software package. Infomap s...
f94f31b8b8080dabca4b6e5f3aa85e092e5ef315e0b092cbe780d1461b3a4688
C/C++
19,592
586
/******************************************************************************* Infomap software package for multi-level network clustering Copyright (c) 2013, 2014 Daniel Edler, Anton Holmgren, Martin Rosvall This file is part of the Infomap software package. See file LICENSE_GPLv3.txt for full license details. ...
e2d7730b31f11aa39dbfe1ccfd97124b3bbbabf135ba524a8d745a58bcb1977f
C/C++
20,070
640
/********************************************************************************** Infomap software package for multi-level network clustering Copyright (c) 2013, 2014 Daniel Edler, Martin Rosvall For more information, see <http://www.mapequation.org> This file is part of Infomap software package. Infomap s...
b4942569b96cb630cd0b911549a0107d4eb8a3e5452049c109f4ac85c16c4e36
C/C++
20,591
544
/* ios.h (integer optimization suite) */ /*********************************************************************** * This code is part of GLPK (GNU Linear Programming Kit). * Copyright (C) 2003-2018 Free Software Foundation, Inc. * Written by Andrew Makhorin <mao@gnu.org>. * * GLPK is free software: you can redistr...
f63f045dee59942ac64918d6a91ddb39cbb8324e8056e86126153147d885e31f
C/C++
22,187
643
/* npp.h (LP/MIP preprocessor) */ /*********************************************************************** * This code is part of GLPK (GNU Linear Programming Kit). * Copyright (C) 2009-2017 Free Software Foundation, Inc. * Written by Andrew Makhorin <mao@gnu.org>. * * GLPK is free software: you can redistribute i...
abdd2ce9f5aac471782b13f033c497d3cb577e7df9e24aedc9378d29254ad00e
C/C++
22,294
957
/********************************************************************************** Infomap software package for multi-level network clustering Copyright (c) 2013, 2014 Daniel Edler, Martin Rosvall For more information, see <http://www.mapequation.org> This file is part of Infomap software package. Infomap s...
b968c1b36b3d6529979665efe78f74c33813df5dccb23794bae0ef7d5651ddb6
C/C++
23,526
734
/** @file bigfeta_dist.h * * */ #include <petscsys.h> #include <petscksp.h> #include <stdio.h> #include <stdlib.h> #include <petscviewerhdf5.h> #include <libgen.h> #include <hdf5.h> /*! Rank 0 process counts the number of files from index.txt and broadcasts the result * @param[in] COMM The MPI communicator, prob...
13da8a66a5a576e8fed04d294233b5cd497cb27d5a14cdf1f5dd31c9a6c97bf1
C/C++
28,334
766
/******************************************************************************* Infomap software package for multi-level network clustering Copyright (c) 2013, 2014 Daniel Edler, Anton Holmgren, Martin Rosvall This file is part of the Infomap software package. See file LICENSE_GPLv3.txt for full license details. ...
3e63b404938c7b2ac4aeae954e1401f197f8116084ac885f30120ae4bb9711fa
C/C++
32,766
753
/* * C library of Limited memory BFGS (L-BFGS). * * Copyright (c) 1990, Jorge Nocedal * Copyright (c) 2007-2010 Naoaki Okazaki * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to d...
63b9c67a5ca4439a3087d55b10e103cf7caaf5c7ab417451acb0f88f685628c5
C/C++
36,648
1,061
/*<html><pre> -<a href="qh-user_r.htm" >-------------------------------</a><a name="TOP">-</a> user_r.h user redefinable constants for each source file, user_r.h is included first see qh-user_r.htm. see COPYING for copyright information. See user_r.c for sample code. ...
daccf5d3819546df1728f20d99426ba81e12ceaff8f25bd7c9aa50c3006acfad
C/C++
36,678
932
/* igraph library. Copyright (C) 2003-2025 The igraph development team <igraph@igraph.org> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at y...
37da8b2cf33ad97be54c77d36780bc1c3b39385cf60fad41adb4db3b4bac0be8
C/C++
39,881
1,173
/* glpk.h */ /*********************************************************************** * This code is part of GLPK (GNU Linear Programming Kit). * Copyright (C) 2000-2020 Free Software Foundation, Inc. * Written by Andrew Makhorin <mao@gnu.org>. * * GLPK is free software: you can redistribute it and/or modify it * ...
ecc6ab36fbc73d6fb32ecf075e46af1a8907bf49b76a5fc0ab97d75e69916dc9
C/C++
42,769
931
/* igraph library. Copyright (C) 2005-2025 The igraph development team <igraph@igraph.org> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at y...
8f3b0628fad573b0e690b0ba1faf09d93a7e912adfda9e4bbfb4407cb40b6995
C/C++
45,579
1,132
/********************************************************************************** Infomap software package for multi-level network clustering Copyright (c) 2013, 2014 Daniel Edler, Martin Rosvall For more information, see <http://www.mapequation.org> This file is part of Infomap software package. Infomap s...
51e285a8ac00a7440a3565b15a4004ccd0b18146f84617e059ae1cd61cc07a72
C/C++
50,961
1,469
/********************************************************************************** Infomap software package for multi-level network clustering Copyright (c) 2013, 2014 Daniel Edler, Martin Rosvall For more information, see <http://www.mapequation.org> This file is part of Infomap software package. Infomap s...
d17eb1c067d0f46915d1bc20e55c17bd38e69c9f2d82d9416a1de1a4a4d3e432
C/C++
62,856
1,281
/*<html><pre> -<a href="qh-qhull_r.htm" >-------------------------------</a><a name="TOP">-</a> libqhull_r.h user-level header file for using qhull.a library see qh-qhull_r.htm, qhull_ra.h Copyright (c) 1993-2020 The Geometry Center. $Id: //main/2019/qhull/src/libqhull_r...
4c2663bb94b9daf07d2ec6143655d780c6d79c9d89d71d01216f3e36b81b2d80
C/C++
75,810
2,557
/* * PCG Random Number Generation for C. * * Copyright 2014-2019 Melissa O'Neill <oneill@pcg-random.org>, * and the PCG Project contributors. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) * * Licensed under the Apache License, Version 2.0 (provided in * LICENSE-APACHE.txt and at http://w...
75bd9cbf63a4ed25442e192bd2a9056879828ee262b1797a2fa95512bfbe3a4b
C/C++
85,657
1,880
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Softwa...
ccf91c604eb3c42adfbb41bb3c6ecfb5e6f7e973b7a903ee43829273c5cd56e3
C/C++
85,979
1,889
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Softwa...
36e058080efd7d03497013e39debd1b21e6e34f5fda0df9b2b3179f611030308
C/C++
89,902
2,596
/* mpl.h (GNU MathProg translator) */ /*********************************************************************** * This code is part of GLPK (GNU Linear Programming Kit). * Copyright (C) 2003-2016 Free Software Foundation, Inc. * Written by Andrew Makhorin <mao@gnu.org>. * * GLPK is free software: you can redistribu...
7d3c28179e4aec48e9faca9ff47d418a8a017487aca6ebff6e5a0032fef9592f
C/C++
96,520
1,291
/* igraph library. Copyright (C) 2006-2012 Gabor Csardi <csardi.gabor@gmail.com> 334 Harvard street, Cambridge, MA 02139 USA This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either ...
a56616de420af10940fcfc8aa02d746d9e5f41de5331b8ac0cfdfcf7d249bdf0
C/C++
200,000
3,662
/* # # File : CImg.h # ( C++ header file ) # # Description : The C++ Template Image Processing Toolkit. # This file is the main component of the CImg Library project. # ( http://cimg.eu ) # # Project manager : David Tschumperle. # ...
4bc7663a49f2c00ad16c182544e0747ecbfb47222a9db3689addfb345d4f7ae7
CUDA
2,201
58
// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless requir...
0be3ac60f2316ae9120205ccb71c19ae7275913bc8edfaafc95abecf4db9465c
CUDA
3,439
81
#include "cuda_runtime.h" #include "../src/PermutohedralLatticeGPU.cuh" #include "../src/DeviceMemoryAllocator.h" //input and positions should be device pointers by this point void lattice_filter_gpu(float * output, const float *input, const float *positions, int pd, int vd, int n) { auto allocator = DeviceMemory...
db67e489cb74cebc9c0d9379def651fd3300bb96571699b40b08fefe61498a41
CUDA
3,923
96
// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless requir...
7b117205956b0729e4f937ed07929b7e7ef0d23fad8cda63083bc34435a4e80f
CUDA
4,309
109
// Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless requir...
870b2294d7a95b94e9c61f8ca86d2c7c1d8a57eca8613ca95c14d7d870d94369
CUDA
4,762
112
/*Copyright (c) 2018 Miguel Monteiro, Andrew Adams, Jongmin Baek, Abe Davis Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights ...
5df09fdbd1395a3f65caf0687772dba92575cc03407a96c500135d07d0586fa4
CUDA
5,736
130
#include "sync_cuda.h" #include <ATen/cuda/CUDAContext.h> #include "../thread.h" Thread &getThread() { static Thread thread; return thread; } void synchronize_cuda() { getThread().synchronize(); } void read_async_cuda(torch::Tensor src, torch::optional<torch::Tensor> optional_offset, ...
00cc97bfdfd00155e8bbd0bd1ef12b3fa843e92ce24016a32f2475b5492eb14c
CUDA
7,898
289
#include <vector> #include <torch/extension.h> #include <cuda.h> #include <cuda_runtime.h> #include <defs.h> __device__ int find_root(const int* __restrict__ labels, int a) { int l = labels[a]; while (l != a) { a = l; l = labels[a]; } return a; } __device__ void tree_union(int* __re...
838c7eca1b404b2f90ca543dca2284f7495c4deccf992728b934ab611c455c33
CUDA
10,586
344
/** * Copyright 2017-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the license found in the * LICENSE file in the root directory of this source tree. */ #include "edit_dist.h" #include <THC/THC.h> #include <cuda.h> #include <cuda_runtime.h> #include <device_launch_paramet...
93512d4c1ccfd9e5045088e6abb380e6680a9459001e15bd4b36ca13747b51c6
CUDA
12,148
355
#include <torch/extension.h> #include <cuda.h> #include <cuda_runtime.h> #include <defs.h> __device__ float sum_mad( int ti_start, int tj_start, int tk_start, int ai_start, int aj_start, int ak_start, int i_range, int j_range, int k_range, int aj_size, int ak_size, float *array, int tj_size, int...
37d16816e1c6c2072c0189a92c71bfcc7c2f663f20f704423e5ee799a30e487c
CUDA
30,720
794
// Multiple GPU version of cuFFT_check that uses multiple GPU's // This program creates a real-valued 3D function sin(x)*cos(y)*cos(z) and then // takes the forward and inverse Fourier Transform, with the necessary scaling included. // The output of this process should match the input function // includes, system #i...
b4ff5360263de38363f7ff9e27e2777b8a792503a5fb826d8846ee56b8171246
CUDA
47,270
1,073
/* Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or ag...
da844ab422f36f8871b757bdc3efd4c3561bc50bea255a8ff2762eb4ac030102
Go
144
7
package common // Compoent is the base class for difference components of the system type Component interface { Start() error Stop() error }
d248d24abf2fcdb63bffebc0aeaac687ad47e866e2baae639c1a0298cf6aeaa7
Go
269
15
package flag import ( "fmt" "github.com/spf13/cobra" ) const ( DefaultGRPCPort = 50051 ) func GRPCAddr(cmd *cobra.Command, conf *string) { cmd.Flags().StringVarP(conf, "grpc-addr", "g", fmt.Sprintf("0.0.0.0:%d", DefaultGRPCPort), "GRPC service bind address") }
98c301758164a74528d9d7030fd8b19305bad7b479904ecf9ba5e3906f951560
Go
270
19
package utils import ( "io" "github.com/rs/zerolog/log" ) func RunProcess(startProcess func() (io.Closer, error)) { process, err := startProcess() if err != nil { log.Fatal().Err(err). Msg("Failed to start the process") } WaitUntilSignal( process, ) }
3062e6cc3709d4e8f08a6dde7c21bd738036e694e1d69a5094bde49b1f6293d4
Go
300
17
package model const ( NotificationTypeCreateCollection = "create_collection" NotificationTypeDeleteCollection = "delete_collection" ) const ( NotificationStatusPending = "pending" ) type Notification struct { ID int64 CollectionID string Type string Status string }
4ab3829e1eec354a03edb4bea9d8a21602fef7eb42a51ddde64d6851d7277ff3
Go
359
11
package common const ( DefaultTenant = "default_tenant" DefaultDatabase = "default_database" // SourceAttachedFunctionIDKey is the schema field name used to mark output collections // and link them to their attached function. This is stored in the collection schema, // not in metadata. SourceAttachedFunctionI...
29fcbe2f5c63e8bbb3c4700bb2fc9d989565dc5f3b4d4227a9cccf6850cfc580
Go
364
18
package grpcutils type GrpcConfig struct { // BindAddress is the address to bind the GRPC server to. BindAddress string MaxConcurrentStreams uint32 NumStreamWorkers uint32 // GRPC mTLS config CertPath string KeyPath string CAPath string } func (c *GrpcConfig) MTLSEnabled() bool { return c.CertPath !...
d68bfc93d06e3ec2c01282435b04bd90de9ab67c39d7d7ff53f89019c3de7c95
Go
409
23
package model import "github.com/chroma-core/chroma/go/pkg/types" type Tenant struct { Name string ResourceName *string // Represents a human readable, globally unique identifier for the tenant. } type CreateTenant struct { Name string Ts types.Timestamp } type GetTenant struct { Name string Ts ty...
ae629d6b748472fbdc83b8a959e25587a0172c2e8b63c375e631867c51db2d7a
Go
562
38
package model import "github.com/chroma-core/chroma/go/pkg/types" type Database struct { ID string Name string Tenant string Ts types.Timestamp } type CreateDatabase struct { ID string Name string Tenant string Ts types.Timestamp } type GetDatabase struct { ID string Name string ...
239fcc8bf3f6bc756c2c33390378cabdedda6150989122c0bf64f12b66286c3f
Go
566
35
package utils import ( "io" "os" "os/signal" "syscall" "github.com/rs/zerolog/log" ) func WaitUntilSignal(closers ...io.Closer) { c := make(chan os.Signal, 1) signal.Notify(c, os.Interrupt, syscall.SIGTERM) sig := <-c log.Info(). Str("signal", sig.String()). Msg("Received signal, exiting") code := 0 ...
b3a2e87e526fd68296f7364b01d02d1699b6adcd80358a34f62de002754b4bd6
Go
610
36
package main import ( "fmt" "os" "github.com/chroma-core/chroma/go/pkg/utils" "github.com/rs/zerolog" "github.com/spf13/cobra" "go.uber.org/automaxprocs/maxprocs" ) var ( rootCmd = &cobra.Command{ Use: "chroma", Short: "Chroma root command", Long: `Chroma root command`, } ) func init() { rootCmd.A...
da0edbb56821110b88c798f9c1f5c03dcd3e7bdb6e1233bd1e5ae38fce864b06
Go
719
24
package dbmodel import ( "context" _ "ariga.io/atlas-provider-gorm/gormschema" ) //go:generate mockery --name=IMetaDomain type IMetaDomain interface { DatabaseDb(ctx context.Context) IDatabaseDb TenantDb(ctx context.Context) ITenantDb CollectionDb(ctx context.Context) ICollectionDb CollectionMetadataDb(ctx con...
1c2fb9aeb23a7e0cbfbb4fca88236c36a65594569d648775ecec12c8d113bd1a
Go
723
37
package grpcutils import "testing" func TestGrpcConfig_TLSEnabled(t *testing.T) { // Create a list of configs and expected check result (true/false) cfgs := []*GrpcConfig{ { CertPath: "cert", KeyPath: "key", CAPath: "ca", }, { CertPath: "", KeyPath: "", CAPath: "", }, { CertPath...
c9c3beb206cbda66f17567603cb5420c936c0254a0e4abeb3ea305a541666b2b
Go
744
25
package dbmodel import ( "github.com/google/uuid" ) type Function struct { ID uuid.UUID `gorm:"column:id;primaryKey;unique"` Name string `gorm:"column:name;type:text;not null;unique"` IsIncremental bool `gorm:"column:is_incremental;type:bool;not null"` ReturnType string `gorm:"c...
23a87b98fb92ef761085eef48077623d335c58a227405dc648dfc5bbc37d0f1a
Go
829
25
package utils import ( "os" "testing" ) const environmentVariable = "CHROMA_KUBERNETES_INTEGRATION" // ShouldRunIntegrationTests checks if the tests should be run based on an environment variable. func ShouldRunIntegrationTests() bool { // Get the environment variable. envVarValue := os.Getenv(environmentVariabl...
e532b1844b714140320ba1328deafbc64b134c9c11ef3a3d833e193917a5a0df
Go
841
26
package grpc import "testing" func TestMemberlistManagerConfigsIncludesFnConsumer(t *testing.T) { config := Config{ FnConsumerMemberlistName: "fn-consumer-memberlist", FnConsumerPodLabel: "fn-consumer", } managers := memberlistManagerConfigs(config) if len(managers) != 5 { t.Fatalf("expected 5 member...
d65a303c8fea562f1a8442c7839608bd73f1584390ebda73543f8d99c62e14b8
Go
967
58
package types import ( "math" "github.com/google/uuid" ) type Timestamp = int64 const MaxTimestamp = Timestamp(math.MaxInt64) type UniqueID uuid.UUID func NewUniqueID() UniqueID { return UniqueID(uuid.New()) } func (id UniqueID) String() string { return uuid.UUID(id).String() } func MustParse(s string) Uniq...
bf8a7b456fd6eeabd5f659c0bfa0e797d1135f6c4fbe06535fe72fe7a15ad966
Go
992
51
package utils import ( "encoding/json" "os" "time" "github.com/rs/zerolog" "github.com/rs/zerolog/log" "github.com/rs/zerolog/pkgerrors" "google.golang.org/protobuf/encoding/protojson" pb "google.golang.org/protobuf/proto" ) const DefaultLogLevel = zerolog.InfoLevel var ( // LogLevel Used for flags LogLev...
8046bdc4ca0ca314f0dd592ec33577dd17d07cad0d882468282327ad82bcbe33
Go
1,001
31
package dbmodel import ( "time" "github.com/chroma-core/chroma/go/pkg/types" ) type SegmentMetadata struct { SegmentID string `gorm:"segment_id;primaryKey"` Key *string `gorm:"key;primaryKey"` StrValue *string `gorm:"str_value"` IntValue *int64 `gorm:"int_value"` ...
7a3daa087abf16b4b5d23679b33ef8091cbf00eb2a2139962981854be88658e0
Go
1,005
35
package dao import ( "github.com/chroma-core/chroma/go/pkg/sysdb/metastore/db/dbmodel" "gorm.io/gorm" "gorm.io/gorm/clause" ) type segmentMetadataDb struct { db *gorm.DB } func (s *segmentMetadataDb) DeleteAll() error { return s.db.Where("1 = 1").Delete(&dbmodel.SegmentMetadata{}).Error } func (s *segmentMetad...
1493ad26f1ab90dab70f1cbc956f8e4c358bb7e162b537273be9d9f5160f5c73
Go
1,063
31
package dbmodel import ( "time" "github.com/chroma-core/chroma/go/pkg/types" ) type CollectionMetadata struct { CollectionID string `gorm:"collection_id;primaryKey"` Key *string `gorm:"key;primaryKey"` StrValue *string `gorm:"str_value"` IntValue *int64 `gorm:...
d5101abd1fcc971fa06af131c87b7efc3ceaba7ff147c85965c42a91d3a19a19
Go
1,072
50
package utils import ( "k8s.io/client-go/dynamic" "k8s.io/client-go/kubernetes" "k8s.io/client-go/kubernetes/fake" "k8s.io/client-go/rest" ) func GetTestKubenertesInterface() (kubernetes.Interface, error) { clientset := fake.NewSimpleClientset() return clientset, nil } func getKubernetesConfig() (*rest.Config,...
372628b2a13a2595e21776f1a37aa0f9795021e6b79f11c7d3a7d87e7d66dbb1
Go
1,102
34
package dao import ( "github.com/chroma-core/chroma/go/pkg/sysdb/metastore/db/dbmodel" "gorm.io/gorm" "gorm.io/gorm/clause" ) type collectionMetadataDb struct { db *gorm.DB } func (s *collectionMetadataDb) DeleteAll() error { return s.db.Where("1 = 1").Delete(&dbmodel.CollectionMetadata{}).Error } func (s *col...
c57399fddfe913f32ca6daf7188c8813aee997f4abd07d0b9feb2fd3cfd34517
Go
1,111
46
// Code generated by mockery v2.53.5. DO NOT EDIT. package mocks import ( context "context" mock "github.com/stretchr/testify/mock" ) // ITransaction is an autogenerated mock type for the ITransaction type type ITransaction struct { mock.Mock } // Transaction provides a mock function with given fields: ctx, fn ...
1c43dd431bdf2b862446ffd8cac390297f38744fe68954001e8ad1f87e904340
Go
1,211
32
package dbmodel import ( "time" "github.com/chroma-core/chroma/go/pkg/types" ) type Tenant struct { ID string `gorm:"id;primaryKey;unique"` Ts types.Timestamp `gorm:"ts;type:bigint;default:0"` IsDeleted bool `gorm:"is_deleted;type:bool;default:false"`...
88403847e290d8e17baa21b862a2844d9fb57ed5e600129a4518e1949b118660
Go
1,251
54
package model import ( "github.com/chroma-core/chroma/go/pkg/types" ) type Segment struct { ID types.UniqueID Type string Scope string CollectionID types.UniqueID Metadata *SegmentMetadata[SegmentMetadataValueType] Ts types.Timestamp FilePaths map[string][]string } t...
e6389d28da194c5332f09e470f191755082d3da724bd808b6199cb431973b7d9
Go
1,270
46
package dao import ( "context" "github.com/chroma-core/chroma/go/pkg/sysdb/metastore/db/dbcore" "github.com/chroma-core/chroma/go/pkg/sysdb/metastore/db/dbmodel" ) type MetaDomain struct{} func NewMetaDomain() *MetaDomain { return &MetaDomain{} } func (*MetaDomain) DatabaseDb(ctx context.Context) dbmodel.IData...
0836972802fc83d02c9d00522860ee6f91e28acf0c59e6726110356476162d2e
Go
1,332
63
package model type SegmentMetadataValueType interface { IsSegmentMetadataValueType() } type SegmentMetadataValueStringType struct { Value string } func (s *SegmentMetadataValueStringType) IsSegmentMetadataValueType() {} type SegmentMetadataValueInt64Type struct { Value int64 } func (s *SegmentMetadataValueInt64...
ed90cf75da7d36e74709ad12b68d2c2bc5aafdc7c6a81f2ab41e9e6f91ba2c7d
Go
1,349
62
package utils import ( "fmt" "math" "testing" ) func mockHasher(member string, key string) uint64 { members := []string{"a", "b", "c"} for i, m := range members { if m == member { return uint64(i) } } return 0 } func TestRendezvousHash(t *testing.T) { members := []string{"a", "b", "c"} key := "key" ...
6cf3638ef3da626de08bac04ece862b8b89b506e796a18df7f9134514bfdb956
Go
1,439
34
package dbmodel import ( "time" "github.com/chroma-core/chroma/go/pkg/types" ) type Database struct { ID string `gorm:"id;primaryKey;unique;index:idx_databases_list,priority:4"` Name string `gorm:"name;type:varchar(128);not null;uniqueIndex:idx_tenantid_name"` TenantID string ...
1358f49510bcb77eefe9bd8d1acac9033d72a1977c882030e92f62b5fde8ed87
Go
1,504
62
package utils import ( "errors" "github.com/spaolacci/murmur3" ) type Hasher = func(member string, key string) uint64 type Member = string type Members = []Member type Key = string // assign assigns a key to a member using the rendezvous hashing algorithm. func Assign(key Key, members Members, hasher Hasher) (Mem...
c0bba95cd2739e678ff45314a8573fa9b20f896a0d02a327422890c5098135b3
Go
1,514
55
package libs import ( "context" "fmt" "github.com/docker/go-connections/nat" "github.com/testcontainers/testcontainers-go" "github.com/testcontainers/testcontainers-go/modules/postgres" "github.com/testcontainers/testcontainers-go/wait" "os/exec" "path" "runtime" "time" ) func StartPgContainer(ctx context.C...
5afc146aefe16cef5b328e1e2911e99667057a888f603ef64fc19524fd17d9cc
Go
1,595
77
package dao import ( "errors" "github.com/chroma-core/chroma/go/pkg/sysdb/metastore/db/dbmodel" "github.com/google/uuid" "github.com/pingcap/log" "go.uber.org/zap" "gorm.io/gorm" ) type functionDb struct { db *gorm.DB } var _ dbmodel.IFunctionDb = &functionDb{} func (s *functionDb) GetByName(name string) (*...
dd9f13a30c4ba3d846ef05d22021664155c8f617c0ebd81be14a2d7b06d5ad79
Go
1,739
61
package grpcutils import ( "github.com/chroma-core/chroma/go/pkg/types" "github.com/pingcap/log" "go.uber.org/zap" "google.golang.org/genproto/googleapis/rpc/errdetails" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) func BuildInvalidArgumentGrpcError(fieldName string, desc string) (error, err...
73df170a2506a5b81dee334cbd16c1f1747d0880887e26df46dca938e667051d
Go
1,911
51
package dbmodel import ( "time" "github.com/chroma-core/chroma/go/pkg/sysdb/coordinator/model" "github.com/chroma-core/chroma/go/pkg/types" ) type Segment struct { /* Making CollectionID the primary key allows fast search when we have CollectionID. This requires us to push down CollectionID from the caller....
ad32da13d033c05ffa5e2660f40082ee367040ed7b9e1faede62798ead650f31
Go
2,050
71
package coordinator import ( "context" "github.com/chroma-core/chroma/go/pkg/sysdb/metastore/db/dao" "github.com/chroma-core/chroma/go/shared/otel" "github.com/pingcap/log" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/metric" "go.uber.org/zap" ) // StartDLQMetrics registers a callback that r...
c4a02f048e4cf986a60ee548adabea6e987ac0df212666aea211dc9603149c5b
Go
2,072
64
package dao import ( "testing" "time" "github.com/stretchr/testify/require" "github.com/chroma-core/chroma/go/pkg/sysdb/metastore/db/dao/daotest" "github.com/chroma-core/chroma/go/pkg/sysdb/metastore/db/dbcore" "github.com/chroma-core/chroma/go/pkg/sysdb/metastore/db/dbmodel" ) func TestCollectionMetadataUpda...
2fe105286ac9504ef284e238ec90e643216059e43cf669f8cbeec4acf5597395
Go
2,149
91
// Code generated by mockery v2.53.5. DO NOT EDIT. package mocks import ( dbmodel "github.com/chroma-core/chroma/go/pkg/sysdb/metastore/db/dbmodel" mock "github.com/stretchr/testify/mock" ) // ICollectionMetadataDb is an autogenerated mock type for the ICollectionMetadataDb type type ICollectionMetadataDb struct {...
109051200fe88ee0d0448df1b1369bb996522e9b528b31c96dd06ec61c7be6c7
Go
2,327
99
// Code generated by mockery v2.53.5. DO NOT EDIT. package mocks import ( dbmodel "github.com/chroma-core/chroma/go/pkg/sysdb/metastore/db/dbmodel" mock "github.com/stretchr/testify/mock" ) // ISegmentMetadataDb is an autogenerated mock type for the ISegmentMetadataDb type type ISegmentMetadataDb struct { mock.Mo...