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18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
[
  {
    "function_name": "__init__",
    "file_path": "presto/atom.py",
    "function_calls": [
      {
        "function_call_name": "isinstance",
        "functionality": "Checks if an object is an instance of a class or of a type.",
        "input": "object, classinfo",
        "output": "bool",
        "location_or_namespace": "builtins"
      },
      {
        "function_call_name": "self._load_data_from_folder",
        "functionality": "Load data from a folder containing individual pickle files.",
        "input": "folder_path (str)",
        "output": "list",
        "location_or_namespace": "presto/atom.py"
      },
      {
        "function_call_name": "TypeError",
        "functionality": "Raised when an operation or function is applied to an object of inappropriate type.",
        "input": "message (str)",
        "output": "TypeError object",
        "location_or_namespace": "builtins"
      },
      {
        "function_call_name": "len",
        "functionality": "Return the length (the number of items) of an object.",
        "input": "object",
        "output": "int",
        "location_or_namespace": "builtins"
      }
    ]
  },
  {
    "function_name": "MMS (setter)",
    "file_path": "presto/atom.py",
    "function_calls": [
      {
        "function_call_name": "isinstance",
        "functionality": "Checks if an object is an instance of a class or of a type.",
        "input": "object, classinfo",
        "output": "bool",
        "location_or_namespace": "builtins"
      },
      {
        "function_call_name": "self._load_data",
        "functionality": "Load the MMS matrix from a file.",
        "input": "path (str)",
        "output": "object (loaded data)",
        "location_or_namespace": "presto/atom.py"
      },
      {
        "function_call_name": "TypeError",
        "functionality": "Raised when an operation or function is applied to an object of inappropriate type.",
        "input": "message (str)",
        "output": "TypeError object",
        "location_or_namespace": "builtins"
      },
      {
        "function_call_name": "self.validate_distance_matrix",
        "functionality": "Validate a distance matrix. The matrix must be symmetric, have zeros on the diagonal, and have the correct shape.",
        "input": "M (numpy.ndarray), shape (tuple)",
        "output": "M (numpy.ndarray)",
        "location_or_namespace": "presto/atom.py"
      }
    ]
  },
  {
    "function_name": "compute_mms",
    "file_path": "presto/atom.py",
    "function_calls": [
      {
        "function_call_name": "NotImplementedError",
        "functionality": "This exception is derived from RuntimeError. In user defined base classes, abstract methods should raise this exception when they require derived classes to override the method, or while the class is being developed to indicate that the real implementation still needs to be added.",
        "input": "message (str)",
        "output": "NotImplementedError object",
        "location_or_namespace": "builtins"
      },
      {
        "function_call_name": "list",
        "functionality": "Return a new list object.",
        "input": "iterable (optional)",
        "output": "list",
        "location_or_namespace": "builtins"
      },
      {
        "function_call_name": "range",
        "functionality": "Rather than being a function, range is actually an immutable sequence type.",
        "input": "stop (int) or start (int), stop (int), step (int, optional)",
        "output": "range object",
        "location_or_namespace": "builtins"
      },
      {
        "function_call_name": "itertools.combinations",
        "functionality": "Return r length subsequences of elements from the input iterable.",
        "input": "iterable, r (int)",
        "output": "iterator",
        "location_or_namespace": "itertools"
      },
      {
        "function_call_name": "len",
        "functionality": "Return the length (the number of items) of an object.",
        "input": "object",
        "output": "int",
        "location_or_namespace": "builtins"
      },
      {
        "function_call_name": "np.isnan",
        "functionality": "Test element-wise for NaN and return result as a boolean array.",
        "input": "x (array_like)",
        "output": "ndarray or bool",
        "location_or_namespace": "numpy"
      },
      {
        "function_call_name": "Presto",
        "functionality": "Initialize Presto object for topological analysis.",
        "input": "projector (class), max_homology_dim (int), resolution (int)",
        "output": "Presto object",
        "location_or_namespace": "presto.presto"
      },
      {
        "function_call_name": "presto_instance.fit_transform",
        "functionality": "Computes the Presto distance/score between two datasets X and Y.",
        "input": "X, Y, n_components (int), normalize (bool), n_projections (int), score_type (str), normalization_approx_iterations (int), seed (int)",
        "output": "float (Presto score)",
        "location_or_namespace": "presto.presto.Presto"
      },
      {
        "function_call_name": "ThreadPoolExecutor",
        "functionality": "An Executor subclass that uses a pool of at most max_workers threads to execute calls asynchronously.",
        "input": "max_workers (int, optional), thread_name_prefix (str, optional), initializer (callable, optional), initargs (tuple, optional)",
        "output": "ThreadPoolExecutor object",
        "location_or_namespace": "concurrent.futures"
      },
      {
        "function_call_name": "os.cpu_count",
        "functionality": "Return the number of CPUs in the system. Returns None if undetermined.",
        "input": "",
        "output": "int or None",
        "location_or_namespace": "os"
      },
      {
        "function_call_name": "executor.map",
        "functionality": "Applies a function to every item of iterable, yielding a sequence of results.",
        "input": "func (callable), *iterables",
        "output": "iterator",
        "location_or_namespace": "concurrent.futures.ThreadPoolExecutor"
      },
      {
        "function_call_name": "tqdm",
        "functionality": "A fast, extensible progress bar for Python and CLI.",
        "input": "iterable (optional), desc (str, optional), total (int or float, optional), leave (bool, optional), file (io.TextIOWrapper or io.StringIO, optional), ncols (int, optional), mininterval (float, optional), maxinterval (float, optional), miniters (int or float, optional), ascii (bool or str, optional), disable (bool, optional), unit (str, optional), unit_scale (bool or int or float, optional), dynamic_ncols (bool, optional), smoothing (float, optional), bar_format (str, optional), initial (int or float, optional), position (int, optional), postfix (dict, optional), unit_divisor (float, optional), write_bytes (bool, optional), lock_args (tuple, optional), nrows (int, optional), colour (str, optional), delay (float, optional), gui (bool, optional), **kwargs",
        "output": "iterable",
        "location_or_namespace": "tqdm"
      },
      {
        "function_call_name": "map",
        "functionality": "Return an iterator that applies function to every item of iterable, yielding the results.",
        "input": "function, iterable, ...",
        "output": "iterator",
        "location_or_namespace": "builtins"
      },
      {
        "function_call_name": "coo_array",
        "functionality": "A sparse matrix in COOrdinate format.",
        "input": "(data, (row, col)), shape (tuple, optional), dtype (dtype, optional), copy (bool, optional)",
        "output": "coo_array object",
        "location_or_namespace": "scipy.sparse"
      },
      {
        "function_call_name": "mms_sparse.todense",
        "functionality": "Return a dense matrix representation of this matrix.",
        "input": "order (str, optional, {'C', 'F'}), out (ndarray, optional)",
        "output": "numpy.matrix",
        "location_or_namespace": "scipy.sparse.coo_array"
      }
    ]
  },
  {
    "function_name": "save_mms",
    "file_path": "presto/atom.py",
    "function_calls": [
      {
        "function_call_name": "open",
        "functionality": "Open file and return a corresponding file object.",
        "input": "file, mode (str, optional), buffering (int, optional), encoding (str, optional), errors (str, optional), newline (str, optional), closefd (bool, optional), opener (callable, optional)",
        "output": "file object",
        "location_or_namespace": "builtins"
      },
      {
        "function_call_name": "pickle.dump",
        "functionality": "Write a pickled representation of obj to the open file object file.",
        "input": "obj, file, protocol (int, optional), fix_imports (bool, optional), buffer_callback (callable, optional)",
        "output": "None",
        "location_or_namespace": "pickle"
      }
    ]
  },
  {
    "function_name": "cluster",
    "file_path": "presto/atom.py",
    "function_calls": [
      {
        "function_call_name": "self.compute_mms",
        "functionality": "Compute a multiverse metric space (MMS) based on the `presto` score between embeddings.",
        "input": "projector (class, optional), n_projections (int, optional), score_type (str, optional), n_components (int, optional), normalize (bool, optional), max_homology_dim (int, optional), resolution (int, optional), normalization_approx_iterations (int, optional), parallelize (bool, optional)",
        "output": "None (sets self.MMS)",
        "location_or_namespace": "presto/atom.py"
      },
      {
        "function_call_name": "AgglomerativeClustering",
        "functionality": "Agglomerative Clustering.",
        "input": "n_clusters (int or None, optional), metric (str or callable, optional), memory (str or joblib.Memory, optional), connectivity (array-like or callable, optional), compute_full_tree (str or bool, optional), linkage (str, optional), distance_threshold (float, optional), compute_distances (bool, optional)",
        "output": "AgglomerativeClustering object",
        "location_or_namespace": "sklearn.cluster"
      },
      {
        "function_call_name": "clustering_instance.fit",
        "functionality": "Fit the agglomerative clustering from features or distance matrix.",
        "input": "X (array-like of shape (n_samples, n_features) or (n_samples, n_samples)), y (Ignored)",
        "output": "self (AgglomerativeClustering object)",
        "location_or_namespace": "sklearn.cluster.AgglomerativeClustering"
      }
    ]
  },
  {
    "function_name": "compute_set_cover",
    "file_path": "presto/atom.py",
    "function_calls": [
      {
        "function_call_name": "self.compute_mms",
        "functionality": "Compute a multiverse metric space (MMS) based on the `presto` score between embeddings.",
        "input": "projector (class, optional), n_projections (int, optional), score_type (str, optional), n_components (int, optional), normalize (bool, optional), max_homology_dim (int, optional), resolution (int, optional), normalization_approx_iterations (int, optional), parallelize (bool, optional)",
        "output": "None (sets self.MMS)",
        "location_or_namespace": "presto/atom.py"
      },
      {
        "function_call_name": "self._set_cover_graph",
        "functionality": "Construct a bipartite graph for set-cover approximation.",
        "input": "MMS (numpy.ndarray), epsilon (float)",
        "output": "networkx.DiGraph",
        "location_or_namespace": "presto/atom.py"
      },
      {
        "function_call_name": "self._compute_set_cover",
        "functionality": "Compute a set-cover approximation based on a greedy bipartite-graph heuristic.",
        "input": "G_original (networkx.DiGraph)",
        "output": "dict",
        "location_or_namespace": "presto/atom.py"
      }
    ]
  },
  {
    "function_name": "_compute_set_cover",
    "file_path": "presto/atom.py",
    "function_calls": [
      {
        "function_call_name": "G_original.copy",
        "functionality": "Return a copy of the graph.",
        "input": "as_view (bool, optional)",
        "output": "Graph object",
        "location_or_namespace": "networkx.DiGraph"
      },
      {
        "function_call_name": "G.nodes",
        "functionality": "A NodeView of the Graph as G.nodes or G.nodes().",
        "input": "data (bool or str, optional), default (any, optional)",
        "output": "NodeView",
        "location_or_namespace": "networkx.DiGraph"
      },
      {
        "function_call_name": "max",
        "functionality": "Return the largest item in an iterable or the largest of two or more arguments.",
        "input": "iterable, *[, key, default] or arg1, arg2, *args[, key]",
        "output": "any",
        "location_or_namespace": "builtins"
      },
      {
        "function_call_name": "G.out_degree",
        "functionality": "Return the out-degree of a single node or out-degrees of several nodes.",
        "input": "nbunch (single node or iterable, optional), weight (string or None, optional)",
        "output": "int or DiDegreeView",
        "location_or_namespace": "networkx.DiGraph"
      },
      {
        "function_call_name": "sorted",
        "functionality": "Return a new sorted list from the items in iterable.",
        "input": "iterable, /, *, key=None, reverse=False",
        "output": "list",
        "location_or_namespace": "builtins"
      },
      {
        "function_call_name": "G_original.successors",
        "functionality": "Return an iterator over successor nodes of n.",
        "input": "n (node)",
        "output": "iterator",
        "location_or_namespace": "networkx.DiGraph"
      },
      {
        "function_call_name": "list",
        "functionality": "Return a new list object.",
        "input": "iterable (optional)",
        "output": "list",
        "location_or_namespace": "builtins"
      },
      {
        "function_call_name": "G.remove_nodes_from",
        "functionality": "Remove multiple nodes.",
        "input": "nodes_for_removal (iterable)",
        "output": "None",
        "location_or_namespace": "networkx.DiGraph"
      },
      {
        "function_call_name": "set",
        "functionality": "Return a new set object, optionally with elements taken from iterable.",
        "input": "iterable (optional)",
        "output": "set",
        "location_or_namespace": "builtins"
      }
    ]
  },
  {
    "function_name": "_set_cover_graph",
    "file_path": "presto/atom.py",
    "function_calls": [
      {
        "function_call_name": "nx.DiGraph",
        "functionality": "Base class for directed graphs.",
        "input": "incoming_graph_data (input graph, optional), **attr",
        "output": "DiGraph object",
        "location_or_namespace": "networkx"
      },
      {
        "function_call_name": "G.add_nodes_from",
        "functionality": "Add multiple nodes.",
        "input": "nodes_for_adding (iterable of nodes), **attr",
        "output": "None",
        "location_or_namespace": "networkx.DiGraph"
      },
      {
        "function_call_name": "range",
        "functionality": "Rather than being a function, range is actually an immutable sequence type.",
        "input": "stop (int) or start (int), stop (int), step (int, optional)",
        "output": "range object",
        "location_or_namespace": "builtins"
      },
      {
        "function_call_name": "np.argwhere",
        "functionality": "Find the indices of array elements that are non-zero, grouped by element.",
        "input": "a (array_like)",
        "output": "ndarray",
        "location_or_namespace": "numpy"
      },
      {
        "function_call_name": "G.add_edges_from",
        "functionality": "Add all the edges in ebunch.",
        "input": "ebunch_to_add (container of edges), **attr",
        "output": "None",
        "location_or_namespace": "networkx.DiGraph"
      }
    ]
  },
  {
    "function_name": "_load_data_from_folder",
    "file_path": "presto/atom.py",
    "function_calls": [
      {
        "function_call_name": "glob.glob",
        "functionality": "Return a possibly-empty list of path names that match pathname, which must be a string containing a path specification.",
        "input": "pathname (str), *, root_dir (None or str), dir_fd (None or int), recursive (bool), include_hidden (bool)",
        "output": "list",
        "location_or_namespace": "glob"
      },
      {
        "function_call_name": "os.path.join",
        "functionality": "Join one or more path components intelligently.",
        "input": "path, *paths",
        "output": "str",
        "location_or_namespace": "os.path"
      },
      {
        "function_call_name": "files.sort",
        "functionality": "Sort the list in ascending order and return None.",
        "input": "*, key=None, reverse=False",
        "output": "None",
        "location_or_namespace": "list"
      },
      {
        "function_call_name": "Atom.file_id_sorter",
        "functionality": "Extract the integer ID from a file path. Helper function for sorting embedding files.",
        "input": "file_name (str)",
        "output": "int",
        "location_or_namespace": "presto/atom.py"
      },
      {
        "function_call_name": "Atom._load_data",
        "functionality": "Load the MMS matrix from a file.",
        "input": "path (str)",
        "output": "object (loaded data)",
        "location_or_namespace": "presto/atom.py"
      },
      {
        "function_call_name": "data.append",
        "functionality": "Append object to the end of the list.",
        "input": "object",
        "output": "None",
        "location_or_namespace": "list"
      }
    ]
  },
  {
    "function_name": "_load_data",
    "file_path": "presto/atom.py",
    "function_calls": [
      {
        "function_call_name": "os.path.exists",
        "functionality": "Return True if path refers to an existing path or an open file descriptor. Returns False for broken symbolic links.",
        "input": "path",
        "output": "bool",
        "location_or_namespace": "os.path"
      },
      {
        "function_call_name": "FileNotFoundError",
        "functionality": "Raised when a file or directory is requested but doesn’t exist.",
        "input": "message (str)",
        "output": "FileNotFoundError object",
        "location_or_namespace": "builtins"
      },
      {
        "function_call_name": "open",
        "functionality": "Open file and return a corresponding file object.",
        "input": "file, mode (str, optional), buffering (int, optional), encoding (str, optional), errors (str, optional), newline (str, optional), closefd (bool, optional), opener (callable, optional)",
        "output": "file object",
        "location_or_namespace": "builtins"
      },
      {
        "function_call_name": "pickle.load",
        "functionality": "Read a pickled object representation from the open file object file and return the reconstituted object hierarchy specified therein.",
        "input": "file, *, fix_imports=True, encoding='ASCII', errors='strict', buffers=None",
        "output": "object",
        "location_or_namespace": "pickle"
      }
    ]
  },
  {
    "function_name": "validate_distance_matrix",
    "file_path": "presto/atom.py",
    "function_calls": [
      {
        "function_call_name": "is_valid_dm",
        "functionality": "Return True if the given array is a valid distance matrix.",
        "input": "D (array_like), tol (float, optional), throw (bool, optional), name (str, optional), return_ waarom (bool, optional)",
        "output": "bool",
        "location_or_namespace": "scipy.spatial.distance"
      }
    ]
  },
  {
    "function_name": "file_id_sorter",
    "file_path": "presto/atom.py",
    "function_calls": [
      {
        "function_call_name": "re.search",
        "functionality": "Scan through string looking for the first location where the regular expression pattern produces a match, and return a corresponding match object.",
        "input": "pattern, string, flags=0",
        "output": "match object or None",
        "location_or_namespace": "re"
      },
      {
        "function_call_name": "int",
        "functionality": "Return an integer object constructed from a number or string x, or return 0 if no arguments are given.",
        "input": "x=0, base=10",
        "output": "int",
        "location_or_namespace": "builtins"
      },
      {
        "function_call_name": "float",
        "functionality": "Return a floating point number constructed from a number or string x.",
        "input": "x=0.0, /",
        "output": "float",
        "location_or_namespace": "builtins"
      }
    ]
  }
]