id
int64
0
328k
repository_name
stringlengths
7
58
file_path
stringlengths
9
302
class_name
stringlengths
5
256
human_written_code
stringlengths
16
2.16M
class_skeleton
stringlengths
18
1.49M
total_program_units
int64
1
1.76k
total_doc_str
int64
0
771
AvgCountLine
float64
0
7.89k
AvgCountLineBlank
float64
0
297
AvgCountLineCode
float64
0
7.89k
AvgCountLineComment
float64
0
7.89k
AvgCyclomatic
float64
0
130
CommentToCodeRatio
float64
0
168
CountClassBase
float64
0
40
CountClassCoupled
float64
0
583
CountClassCoupledModified
float64
0
575
CountClassDerived
float64
0
5.35k
CountDeclInstanceMethod
float64
0
529
CountDeclInstanceVariable
float64
0
296
CountDeclMethod
float64
0
599
CountDeclMethodAll
float64
0
1.12k
CountLine
float64
1
40.4k
CountLineBlank
float64
0
8.16k
CountLineCode
float64
1
25.7k
CountLineCodeDecl
float64
1
8.15k
CountLineCodeExe
float64
0
24.2k
CountLineComment
float64
0
16.5k
CountStmt
float64
1
9.71k
CountStmtDecl
float64
1
8.15k
CountStmtExe
float64
0
9.69k
MaxCyclomatic
float64
0
759
MaxInheritanceTree
float64
0
16
MaxNesting
float64
0
34
SumCyclomatic
float64
0
2.9k
326,300
khive-ai/khive.d
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/khive-ai_khive.d/src/khive/services/plan/cost_tracker.py
plan.cost_tracker.CostTracker
class CostTracker: """Track API costs and usage for planning operations.""" def __init__(self, config: dict | None=None): self.total_cost = 0.0 self.request_count = 0 self.total_input_tokens = 0 self.total_output_tokens = 0 self.total_cached_tokens = 0 self.confi...
class CostTracker: '''Track API costs and usage for planning operations.''' def __init__(self, config: dict | None=None): pass def _get_pricing(self, model_name: str | None) -> dict: '''Get pricing info from config for a given model.''' pass def add_request(self, input_tokens:...
16
15
5
0
4
2
1
0.47
0
3
0
0
10
5
10
10
66
14
38
23
25
18
34
21
23
2
0
1
11
326,301
khive-ai/khive.d
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/khive-ai_khive.d/src/khive/services/session/parts.py
session.parts.SessionRequest
from pydantic import BaseModel, Field class SessionRequest(BaseModel): """Request to the session service.""" model_config = {'extra': 'forbid'} action: str = Field(..., min_length=1, description='Session action: init, end, status (must be non-empty)') issue: int | None = Field(None, gt=0, description='...
class SessionRequest(BaseModel): '''Request to the session service.''' pass
1
1
0
0
0
0
0
0.07
1
0
0
0
0
0
0
82
18
2
15
7
14
1
7
7
6
0
5
0
0
326,302
khive-ai/khive.d
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/khive-ai_khive.d/src/khive/services/session/parts.py
session.parts.SessionResponse
from pydantic import BaseModel, Field class SessionResponse(BaseModel): """Response from the session service.""" model_config = {'extra': 'allow'} success: bool = Field(..., description='Whether session operation succeeded') summary: str = Field(..., min_length=1, description='Summary of session operat...
class SessionResponse(BaseModel): '''Response from the session service.''' pass
1
1
0
0
0
0
0
0.06
1
0
0
0
0
0
0
82
23
5
17
9
16
1
9
9
8
0
5
0
0
326,303
khive-ai/khive.d
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/khive-ai_khive.d/src/khive/services/session/session.py
session.session.DiaryWritingAssistant
from pathlib import Path from khive.core import TimePolicy from typing import Any import re class DiaryWritingAssistant: """Assistant for manual diary writing process""" def __init__(self, dry_run: bool=False, target_date: str | None=None): self.dry_run = dry_run self.target_date = target_date...
class DiaryWritingAssistant: '''Assistant for manual diary writing process''' def __init__(self, dry_run: bool=False, target_date: str | None=None): pass def find_unprocessed_summaries(self) -> dict[str, list[Path]]: '''Find summaries that haven't been processed into diaries, grouped by d...
8
7
26
4
19
3
5
0.16
0
9
1
0
7
4
7
7
193
36
137
41
127
22
112
37
104
9
0
4
35
326,304
khive-ai/khive.d
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/khive-ai_khive.d/src/khive/services/session/session.py
session.session.SessionInitializer
from pathlib import Path import shutil import logging import re import subprocess import json from khive.core import TimePolicy class SessionInitializer: """Streamlined session initialization for orchestrator""" def __init__(self, issue: int | None=None, resume: bool=False, depth: int=7, continue_session: boo...
class SessionInitializer: '''Streamlined session initialization for orchestrator''' def __init__(self, issue: int | None=None, resume: bool=False, depth: int=7, continue_session: bool=False): pass def run_command(self, cmd: list[str]) -> tuple[bool, str]: '''Execute command and return suc...
13
12
32
4
25
5
6
0.19
0
15
1
0
12
5
12
12
400
62
295
85
276
55
207
73
194
17
0
6
68
326,305
khive-ai/khive.d
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/khive-ai_khive.d/src/khive/services/session/session_service.py
session.session_service.SessionService
from .session import DiaryWritingAssistant, SessionInitializer import asyncio from .parts import SessionRequest, SessionResponse class SessionService: """ Session Management Service. Wraps the SessionInitializer and DiaryWritingAssistant to provide session management capabilities. """ def __i...
class SessionService: ''' Session Management Service. Wraps the SessionInitializer and DiaryWritingAssistant to provide session management capabilities. ''' def __init__(self): '''Initialize the session service.''' pass async def handle_request(self, request: SessionReques...
10
10
16
2
10
4
2
0.45
0
7
4
0
8
1
8
8
139
23
80
19
71
36
44
17
35
7
0
3
15
326,306
minceheid/openeo
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/minceheid_openeo/EO_comms/HomeHub.py
EO_comms.HomeHub.HomeHub
import time import RPi.GPIO as GPIO import serial import binascii class HomeHub(object): EOSerial = None NRESET = 16 @classmethod def identify_hardware(self): return True def flush_serial(self): _LOGGER.debug('EO COMMS - HomeHub Serial Flush') try: self.EOSeria...
class HomeHub(object): @classmethod def identify_hardware(self): pass def flush_serial(self): pass def __init__(self): pass def tx(self, command): pass def rx(self, recv_delay=3): pass def get_ct_readings(self): ''' Retrieves CT ...
10
1
16
2
12
2
2
0.2
1
4
0
1
6
0
7
7
134
25
92
32
82
18
79
30
70
5
1
3
16
326,307
minceheid/openeo
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/minceheid_openeo/EO_comms/MiniPro2.py
EO_comms.MiniPro2.CtSpiClass
import time import spidev import RPi.GPIO as GPIO class CtSpiClass(object): RUN = 57896 CFMODE = 58896 CONFIG = 58904 HPFDIS = 17334 GAIN = 58895 VERSION = 59143 AIGAIN = 17280 BIGAIN = 17282 CIGAIN = 17284 AIRMSOS = 17287 BIRMSOS = 17289 CIRMSOS = 17291 AIRMS = 1734...
class CtSpiClass(object): def __init__(self): pass def configure(self): pass def reg_get(self, register, size=4): pass def reg_set(self, register, value, size=4): pass
5
0
22
4
15
3
2
0.18
1
3
0
0
4
4
4
4
114
23
77
33
72
14
66
33
61
4
1
2
8
326,308
minceheid/openeo
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/minceheid_openeo/EO_comms/MiniPro2.py
EO_comms.MiniPro2.MiniPro2
import re import spidev import RPi.GPIO as GPIO import globalState import time from EO_comms.HomeHub import HomeHub class MiniPro2(HomeHub): NRESET = 16 REG_DLL = 0 REG_DLH = 1 REG_EFR = 2 REG_FCR_IIR = 2 REG_LCR = 3 REG_MCR = 4 REG_LSR = 5 REG_RXLVL = 9 REG_EFCR = 15 spi = ...
class MiniPro2(HomeHub): @classmethod def identify_hardware(self): pass def _register_set(self, reg, val): pass def _register_get(self, reg): pass def __init__(self): pass def tx(self, command): pass def rx(self, recv_delay=3): pass ...
11
1
14
2
12
1
2
0.17
1
4
1
0
7
1
8
15
160
30
114
52
103
19
107
50
97
5
2
3
19
326,309
minceheid/openeo
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/minceheid_openeo/lib/PluginSuperClass.py
lib.PluginSuperClass.PluginSuperClass
import numbers import re import json class PluginSuperClass: def _convertType(self, attribute, value, typeClass, default=None): """ Internal method used by the configure() method. This attempts to do type conversion, or if not possible, returns a default value. """ if v...
class PluginSuperClass: def _convertType(self, attribute, value, typeClass, default=None): ''' Internal method used by the configure() method. This attempts to do type conversion, or if not possible, returns a default value. ''' pass def __str__(self): pass...
7
1
9
0
7
1
3
0.17
0
6
0
6
7
0
7
7
80
12
58
16
46
10
49
16
40
14
0
3
22
326,310
minceheid/openeo
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/minceheid_openeo/lib/chargeroptions.py
lib.chargeroptions.chargeroptionsClassPlugin
import globalState from lib.PluginSuperClass import PluginSuperClass import util class chargeroptionsClassPlugin(PluginSuperClass): PRETTY_NAME = 'Charger Options' CORE_PLUGIN = True pluginParamSpec = {'enabled': {'type': 'bool', 'default': True}, 'always_supply_current': {'type': 'bool', 'default': False}...
class chargeroptionsClassPlugin(PluginSuperClass): def configure(self, configParam): pass def get_user_settings(self): pass
3
0
12
1
9
3
1
0.21
1
1
0
0
2
1
2
9
37
3
29
8
26
6
18
7
15
1
1
0
2
326,311
minceheid/openeo
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/minceheid_openeo/lib/configserver.py
lib.configserver.ThreadedServer
import http.server import socketserver import socket class ThreadedServer(socketserver.ThreadingMixIn, http.server.HTTPServer): """This child class allows us to set the REUSEADDR and REUSEPORT options on the socket which means the Python task can be started and stopped without breaking the config server du...
class ThreadedServer(socketserver.ThreadingMixIn, http.server.HTTPServer): '''This child class allows us to set the REUSEADDR and REUSEPORT options on the socket which means the Python task can be started and stopped without breaking the config server due to the previous socket being in TIME_WAIT. It's...
2
1
5
0
4
1
1
1
2
1
0
0
1
0
1
30
11
1
5
2
3
5
5
2
3
1
3
0
1
326,312
minceheid/openeo
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/minceheid_openeo/lib/configserver.py
lib.configserver.configserverClassPlugin
import threading import datetime import os import globalState import http.server import re import numbers import subprocess import util import json import copy import urllib.parse from lib.PluginSuperClass import PluginSuperClass from jinja2 import Environment, FileSystemLoader, TemplateNotFound, select_autoescape impo...
class configserverClassPlugin(PluginSuperClass): def __init__(self, configParam): pass def webserver(self): pass class CustomHandler(http.server.BaseHTTPRequestHandler): def load_config(self): pass def do_GET(self): pass def do_P...
10
3
56
7
37
15
9
0.4
1
6
2
0
2
0
2
9
479
67
305
60
295
121
267
54
257
36
1
5
71
326,313
minceheid/openeo
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/minceheid_openeo/lib/loadmanagement.py
lib.loadmanagement.loadmanagementClassPlugin
from lib.PluginSuperClass import PluginSuperClass import globalState import util class loadmanagementClassPlugin(PluginSuperClass): PRETTY_NAME = 'Site and Solar Load Management' CORE_PLUGIN = True pluginParamSpec = {'enabled': {'type': 'bool', 'default': True}, 'solar_enable': {'type': 'bool', 'default': ...
class loadmanagementClassPlugin(PluginSuperClass): def poll(self): pass def get_user_settings(self): pass
3
0
8
0
8
0
2
0
1
0
0
0
2
1
2
9
32
2
30
8
27
0
14
7
11
2
1
1
3
326,314
minceheid/openeo
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/minceheid_openeo/lib/logger.py
lib.logger.databufferClass
from datetime import datetime, timedelta from openeoCharger import openeoChargerClass import re import json class databufferClass: databuffer = {} def __str__(self): return json.dumps(self.databuffer, default=str) def get_plotly(self, since=None, seriesList=None, subplot_index=None): myDa...
class databufferClass: def __str__(self): pass def get_plotly(self, since=None, seriesList=None, subplot_index=None): pass def get_data(self, since=None, seriesList=None): pass def push(self, datapoint): pass def __init__(self, config, seriesDict): pass
6
0
31
6
19
6
7
0.33
0
6
1
0
5
5
5
5
166
39
96
28
90
32
68
28
62
19
0
6
33
326,315
minceheid/openeo
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/minceheid_openeo/lib/logger.py
lib.logger.loggerClassPlugin
from datetime import datetime, timedelta import globalState from lib.PluginSuperClass import PluginSuperClass class loggerClassPlugin(PluginSuperClass): pretty_name = 'Data Logger' CORE_PLUGIN = True pluginParamSpec = {'enabled': {'type': 'bool', 'default': True}, 'hires_interval': {'type': 'int', 'default...
class loggerClassPlugin(PluginSuperClass): def late_poll(self): pass def __init__(self, configParam): pass
3
0
11
2
8
2
2
0.38
1
4
1
0
2
0
2
9
38
6
24
7
21
9
14
7
11
2
1
1
3
326,316
minceheid/openeo
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/minceheid_openeo/lib/ocpp.py
lib.ocpp.ChargerService
from ocpp.v16 import ChargePoint, call, call_result from ocpp.routing import on from datetime import datetime import json class ChargerService(ChargePoint): """Implements the ChargePoint service for OCPP. Only one connector is supported, connector id #1, with overall charge point as id #0. This has to be...
class ChargerService(ChargePoint): '''Implements the ChargePoint service for OCPP. Only one connector is supported, connector id #1, with overall charge point as id #0. This has to be a derived class of ChargePoint, but I didn't feel comfortable merging it completely with the overall plugin servi...
24
10
17
2
13
2
3
0.18
1
5
0
0
16
3
16
16
383
51
292
70
268
52
177
61
160
11
1
6
45
326,317
minceheid/openeo
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/minceheid_openeo/lib/ocpp.py
lib.ocpp.ocppClassPlugin
import threading import util import websockets import time import globalState import traceback import logging import asyncio class ocppClassPlugin: PRETTY_NAME = 'OCPP' CORE_PLUGIN = False myName = 'ocpp' config = {} thread = None connected = False last_heartbeat = 0 last_status = 0 ...
class ocppClassPlugin: def __str__(self): pass def configure(self, configParam): pass def get_config(self): pass def sync_state(self, configParam): pass def poll(self): pass def __init__(self, configParam): pass async def process_event(...
12
2
17
2
14
1
3
0.08
0
9
1
0
11
2
11
11
232
35
183
49
171
14
169
46
157
9
0
3
38
326,318
minceheid/openeo
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/minceheid_openeo/lib/scheduler.py
lib.scheduler.schedulerClassPlugin
import datetime from lib.PluginSuperClass import PluginSuperClass class schedulerClassPlugin(PluginSuperClass): PRETTY_NAME = 'Scheduler' CORE_PLUGIN = True pluginParamSpec = {'enabled': {'type': 'bool', 'default': True}, 'schedule': {'type': 'json', 'default': '[{"start": "2200", "end": "0400", "amps": 32...
class schedulerClassPlugin(PluginSuperClass): def configure(self, configParam): pass def poll(self): pass
3
0
11
1
10
1
3
0.04
1
5
0
0
2
0
2
9
32
6
25
13
22
1
24
13
21
4
1
2
6
326,319
minceheid/openeo
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/minceheid_openeo/lib/switch.py
lib.switch.switchClassPlugin
import util from lib.PluginSuperClass import PluginSuperClass import globalState class switchClassPlugin(PluginSuperClass): PRETTY_NAME = 'Switch' CORE_PLUGIN = True pluginParamSpec = {'enabled': {'type': 'bool', 'default': True}, 'on': {'type': 'bool', 'default': False}, 'retain_state_on_startup': {'type'...
class switchClassPlugin(PluginSuperClass): def poll(self): pass def __init__(self, configParam): pass def get_user_settings(self): pass
4
0
7
0
6
1
2
0.08
1
1
0
0
3
1
3
10
33
5
26
9
22
2
21
8
17
2
1
1
5
326,320
minceheid/openeo
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/minceheid_openeo/lib/victron_ess.py
lib.victron_ess.victron_essClassPlugin
import datetime import time import threading from pyModbusTCP.client import ModbusClient import re import globalState class victron_essClassPlugin: PRETTY_NAME = 'Victron ESS Integration' CORE_PLUGIN = False pluginConfig = {} globalState.stateDict['eo_victron_ess_soc'] = 0 def __str__(self): ...
class victron_essClassPlugin: def __str__(self): pass def get_config(self): pass def configure(self, configParam): pass def poll(self): pass def __init__(self, configParam): pass def ess_poller(self): pass
7
0
10
2
7
1
2
0.18
0
7
1
0
6
1
6
6
75
17
49
21
42
9
48
21
41
6
0
3
14
326,321
minceheid/openeo
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/minceheid_openeo/openeoCharger.py
openeoCharger.openeoChargerClass
from EO_comms.HomeHub import HomeHub from EO_comms.MiniPro2 import MiniPro2 import RPi.GPIO as GPIO import globalState class openeoChargerClass: my_address = None connected = False CHARGER_STATES = {0: 'start', 1: 'settle-time', 2: 'test-incoming-mains', 3: 'mains-fault-start', 4: 'mains-fault', 5: 'idle-s...
class openeoChargerClass: def generateChecksum(self, text): pass def checkCheckSum(self, text): pass def sendSerialCommand(self, packet=''): ''' Sends a serial command to the contoller, adding a checksum. Recieves response, checks the checksum, then strips the che...
7
3
27
4
19
4
4
0.24
0
5
2
0
6
33
6
6
211
39
139
59
132
34
115
59
108
15
0
3
25
326,322
minceheid/openeo
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/minceheid_openeo/openeoConfig.py
openeoConfig.openeoConfigClass
import json import time import sqlite3 from threading import Lock import os class openeoConfigClass: DB_FILE = '/home/pi/etc/config.db' JSON_FILE = '/home/pi/etc/config.json' CONFIG_TABLE = 'configuration' LOG_TABLE = 'log' def logwrite(self, message): """ inserts an entry into a t...
class openeoConfigClass: def logwrite(self, message): ''' inserts an entry into a table called "log" in the sqlite database ''' pass def logpurge(self): ''' Purges log entries older than an hour ago ''' pass def exists(self, module): ...
10
8
20
2
13
6
3
0.43
0
4
0
0
7
4
7
7
153
21
92
30
84
40
75
28
67
9
0
5
23
326,323
minceheid/openeo
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/minceheid_openeo/openeo_download.py
openeo_download.DeploymentError
class DeploymentError(Exception): """Custom exception for deployment-related errors.""" pass
class DeploymentError(Exception): '''Custom exception for deployment-related errors.''' pass
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
10
3
0
2
1
1
1
2
1
1
0
3
0
0
326,324
minceheid/openeo
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/minceheid_openeo/pyModbusTCP/client.py
pyModbusTCP.client.DeviceIdentificationResponse
from typing import Dict from dataclasses import dataclass, field @dataclass class DeviceIdentificationResponse: """Modbus TCP client function read_device_identification() response struct. :param conformity_level: this represents supported access and object type :type conformity_level: int :param more_...
@dataclass class DeviceIdentificationResponse: '''Modbus TCP client function read_device_identification() response struct. :param conformity_level: this represents supported access and object type :type conformity_level: int :param more_follows: for stream request can be set to 0xff if other objects are...
16
1
2
0
2
0
1
0.38
0
0
0
0
7
0
7
7
44
8
26
19
11
10
19
12
11
1
0
0
7
326,325
minceheid/openeo
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/minceheid_openeo/pyModbusTCP/client.py
pyModbusTCP.client.ModbusClient
from .utils import byte_length, set_bit, valid_host import logging import random from socket import AF_UNSPEC, SOCK_STREAM import socket import struct from .constants import ENCAPSULATED_INTERFACE_TRANSPORT, EXP_DETAILS, EXP_NONE, EXP_TXT, MB_CONNECT_ERR, MB_ERR_TXT, MB_EXCEPT_ERR, MB_NO_ERR, MB_RECV_ERR, MB_SEND_ERR, ...
class ModbusClient: '''Modbus TCP client.''' class _InternalError(Exception): class _NetworkError(_InternalError): def __init__(self, code, message): pass class _ModbusExcept(_InternalError): def __init__(self, code, message): pass def __ini...
73
39
16
0
9
7
3
0.74
0
16
4
0
48
11
48
48
872
75
461
187
388
340
435
156
381
8
0
3
140
326,326
minceheid/openeo
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/minceheid_openeo/pyModbusTCP/server.py
pyModbusTCP.server.DataBank
from threading import Event, Lock, Thread from warnings import warn class DataBank: """ Data space class with thread safe access functions """ _DEPR_MSG = 'This class method is deprecated. Use DataBank instance method instead: ' @classmethod def get_bits(cls, *_args, **_kwargs): msg = DataBank...
class DataBank: ''' Data space class with thread safe access functions ''' @classmethod def get_bits(cls, *_args, **_kwargs): pass @classmethod def set_bits(cls, *_args, **_kwargs): pass @classmethod def get_words(cls, *_args, **_kwargs): pass @classmethod de...
21
12
18
1
8
9
2
1.09
0
5
0
0
12
17
16
16
309
31
133
60
108
145
117
52
100
6
0
4
39
326,327
minceheid/openeo
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/minceheid_openeo/pyModbusTCP/server.py
pyModbusTCP.server.DataHandler
from .constants import ENCAPSULATED_INTERFACE_TRANSPORT, EXP_DATA_ADDRESS, EXP_DATA_VALUE, EXP_ILLEGAL_FUNCTION, EXP_NONE, MAX_PDU_SIZE, MEI_TYPE_READ_DEVICE_ID, READ_COILS, READ_DISCRETE_INPUTS, READ_HOLDING_REGISTERS, READ_INPUT_REGISTERS, WRITE_MULTIPLE_COILS, WRITE_MULTIPLE_REGISTERS, WRITE_READ_MULTIPLE_REGISTERS,...
class DataHandler: '''Default data handler for ModbusServer, map server threads calls to DataBank. Custom handler must derive from this class. ''' class Return: def __init__(self, exp_code, data=None): pass @property def ok(self): pass ...
13
8
13
1
5
7
2
1.52
0
3
2
0
8
1
8
8
145
19
50
22
37
76
43
21
31
2
0
1
17
326,328
minceheid/openeo
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/minceheid_openeo/pyModbusTCP/server.py
pyModbusTCP.server.DeviceIdentification
from threading import Event, Lock, Thread class DeviceIdentification: """ Container class for device identification objects (MEI type 0x0E) return by function 0x2B. """ def __init__(self, vendor_name=b'', product_code=b'', major_minor_revision=b'', vendor_url=b'', product_name=b'', model_name=b'', user_applic...
class DeviceIdentification: ''' Container class for device identification objects (MEI type 0x0E) return by function 0x2B. ''' def __init__(self, vendor_name=b'', product_code=b'', major_minor_revision=b'', vendor_url=b'', product_name=b'', model_name=b'', user_application_name=b'', objects_id=None): ...
34
2
6
0
5
1
2
0.25
0
7
0
0
19
2
19
19
150
20
104
47
69
26
87
32
67
9
0
3
35
326,329
minceheid/openeo
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/minceheid_openeo/pyModbusTCP/server.py
pyModbusTCP.server.ModbusServer
from .constants import ENCAPSULATED_INTERFACE_TRANSPORT, EXP_DATA_ADDRESS, EXP_DATA_VALUE, EXP_ILLEGAL_FUNCTION, EXP_NONE, MAX_PDU_SIZE, MEI_TYPE_READ_DEVICE_ID, READ_COILS, READ_DISCRETE_INPUTS, READ_HOLDING_REGISTERS, READ_INPUT_REGISTERS, WRITE_MULTIPLE_COILS, WRITE_MULTIPLE_REGISTERS, WRITE_READ_MULTIPLE_REGISTERS,...
class ModbusServer: ''' Modbus TCP server ''' class Error(Exception): ''' Base exception for ModbusServer related errors. ''' class NetworkError(Error): ''' Exception raise by ModbusServer on I/O errors. ''' class DataFormatError(Error): ''' Exception raise by ModbusServer fo...
64
25
14
0
9
4
2
0.5
0
19
6
0
16
12
16
16
674
67
405
173
340
202
353
154
299
10
0
4
102
326,330
FalkorDB/QueryWeaver
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/FalkorDB_QueryWeaver/api/agents/analysis_agent.py
api.agents.analysis_agent.AnalysisAgent
from litellm import completion from api.config import Config from typing import List from .utils import BaseAgent, parse_response class AnalysisAgent(BaseAgent): """Agent for analyzing user queries and generating database analysis.""" def get_analysis(self, user_query: str, combined_tables: list, db_descripti...
class AnalysisAgent(BaseAgent): '''Agent for analyzing user queries and generating database analysis.''' def get_analysis(self, user_query: str, combined_tables: list, db_description: str, instructions: str | None=None, memory_context: str | None=None) -> dict: '''Get analysis of user query against da...
8
8
75
11
56
8
4
0.15
1
4
1
0
3
1
3
4
233
38
170
39
157
25
48
29
44
7
1
3
12
326,331
FalkorDB/QueryWeaver
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/FalkorDB_QueryWeaver/api/agents/follow_up_agent.py
api.agents.follow_up_agent.FollowUpAgent
from litellm import completion from api.config import Config from .utils import BaseAgent class FollowUpAgent(BaseAgent): """Agent for generating helpful follow-up questions when queries fail or are off-topic.""" def generate_follow_up_question(self, user_question: str, analysis_result: dict) -> str: ...
class FollowUpAgent(BaseAgent): '''Agent for generating helpful follow-up questions when queries fail or are off-topic.''' def generate_follow_up_question(self, user_question: str, analysis_result: dict) -> str: ''' Generate helpful follow-up questions based on failed SQL translation. ...
2
2
47
7
27
13
6
0.5
1
5
1
0
1
0
1
2
50
8
28
15
21
14
13
9
11
6
1
1
6
326,332
FalkorDB/QueryWeaver
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/FalkorDB_QueryWeaver/api/agents/relevancy_agent.py
api.agents.relevancy_agent.RelevancyAgent
import json from .utils import BaseAgent, parse_response from litellm import completion from api.config import Config class RelevancyAgent(BaseAgent): """Agent for determining relevancy of queries to database schema.""" async def get_answer(self, user_question: str, database_desc: dict) -> dict: """Ge...
class RelevancyAgent(BaseAgent): '''Agent for determining relevancy of queries to database schema.''' async def get_answer(self, user_question: str, database_desc: dict) -> dict: '''Get relevancy assessment for user question against database description.''' pass
2
2
20
1
18
1
1
0.16
1
3
1
0
1
1
1
2
24
2
19
5
17
3
7
4
5
1
1
0
1
326,333
FalkorDB/QueryWeaver
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/FalkorDB_QueryWeaver/api/agents/response_formatter_agent.py
api.agents.response_formatter_agent.ResponseFormatterAgent
from api.config import Config from litellm import completion from typing import List, Dict class ResponseFormatterAgent: """Agent for generating user-readable responses from SQL query results.""" def __init__(self): """Initialize the response formatter agent.""" def format_response(self, user_que...
class ResponseFormatterAgent: '''Agent for generating user-readable responses from SQL query results.''' def __init__(self): '''Initialize the response formatter agent.''' pass def format_response(self, user_query: str, sql_query: str, query_results: List[Dict], db_description: str='') ->...
5
5
22
5
13
5
3
0.4
0
4
1
0
4
0
4
4
94
22
52
24
45
21
38
22
33
8
0
2
13
326,334
FalkorDB/QueryWeaver
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/FalkorDB_QueryWeaver/api/agents/utils.py
api.agents.utils.BaseAgent
class BaseAgent: """Base class for agents.""" def __init__(self, queries_history: list, result_history: list): """Initialize the agent with query and result history.""" if result_history is None: self.messages = [] else: self.messages = [] for query, ...
class BaseAgent: '''Base class for agents.''' def __init__(self, queries_history: list, result_history: list): '''Initialize the agent with query and result history.''' pass
2
2
9
0
8
1
3
0.22
0
2
0
3
1
1
1
1
12
1
9
4
7
2
8
4
6
3
0
2
3
326,335
FalkorDB/QueryWeaver
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/FalkorDB_QueryWeaver/api/app_factory.py
api.app_factory.SecurityMiddleware
from starlette.middleware.base import BaseHTTPMiddleware from fastapi.responses import RedirectResponse, JSONResponse from fastapi import FastAPI, Request, HTTPException class SecurityMiddleware(BaseHTTPMiddleware): """Middleware for security checks including static file access""" STATIC_PREFIX = '/static/' ...
class SecurityMiddleware(BaseHTTPMiddleware): '''Middleware for security checks including static file access''' async def dispatch(self, request: Request, call_next): pass
2
1
14
1
10
3
3
0.33
1
0
0
0
1
0
1
1
19
3
12
5
10
4
9
5
7
3
1
2
3
326,336
FalkorDB/QueryWeaver
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/FalkorDB_QueryWeaver/api/config.py
api.config.Config
import dataclasses import os @dataclasses.dataclass class Config: """ Configuration class for the text2sql module. """ AZURE_FLAG = True if not os.getenv('OPENAI_API_KEY'): EMBEDDING_MODEL_NAME = 'azure/text-embedding-ada-002' COMPLETION_MODEL = 'azure/gpt-4.1' else: AZU...
null
2
1
0
0
0
0
0
0.06
0
0
0
0
0
0
0
0
84
17
64
11
63
4
11
11
10
0
0
0
0
326,337
FalkorDB/QueryWeaver
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/FalkorDB_QueryWeaver/api/config.py
api.config.EmbeddingsModel
from typing import Union from litellm import embedding class EmbeddingsModel: """Embeddings model wrapper for text embedding operations.""" def __init__(self, model_name: str, config: dict=None): self.model_name = model_name self.config = config def embed(self, text: Union[str, list]) -> ...
class EmbeddingsModel: '''Embeddings model wrapper for text embedding operations.''' def __init__(self, model_name: str, config: dict=None): pass def embed(self, text: Union[str, list]) -> list: ''' Get the embeddings of the text Args: text (str|list): The text...
4
3
9
2
4
4
1
1.08
0
4
0
0
3
2
3
3
33
8
12
10
8
13
12
9
8
1
0
0
3
326,338
FalkorDB/QueryWeaver
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/FalkorDB_QueryWeaver/api/graph.py
api.graph.ColumnDescription
from pydantic import BaseModel class ColumnDescription(BaseModel): """Column Description""" name: str description: str
class ColumnDescription(BaseModel): '''Column Description''' pass
1
1
0
0
0
0
0
0.33
1
0
0
0
0
0
0
82
5
1
3
1
2
1
3
1
2
0
5
0
0
326,339
FalkorDB/QueryWeaver
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/FalkorDB_QueryWeaver/api/graph.py
api.graph.Descriptions
from pydantic import BaseModel class Descriptions(BaseModel): """List of tables""" tables_descriptions: list[TableDescription] columns_descriptions: list[ColumnDescription]
class Descriptions(BaseModel): '''List of tables''' pass
1
1
0
0
0
0
0
0.33
1
0
0
0
0
0
0
82
5
1
3
1
2
1
3
1
2
0
5
0
0
326,340
FalkorDB/QueryWeaver
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/FalkorDB_QueryWeaver/api/graph.py
api.graph.TableDescription
from pydantic import BaseModel class TableDescription(BaseModel): """Table Description""" name: str description: str
class TableDescription(BaseModel): '''Table Description''' pass
1
1
0
0
0
0
0
0.33
1
0
0
0
0
0
0
82
5
1
3
1
2
1
3
1
2
0
5
0
0
326,341
FalkorDB/QueryWeaver
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/FalkorDB_QueryWeaver/api/memory/graphiti_tool.py
api.memory.graphiti_tool.AzureOpenAIConfig
from api.config import Config import os class AzureOpenAIConfig: """Configuration for Azure OpenAI integration.""" def __init__(self): os.environ['MODEL_NAME'] = 'gpt-4.1' self.api_key = os.getenv('AZURE_API_KEY') self.endpoint = os.getenv('AZURE_API_BASE') self.api_version = o...
class AzureOpenAIConfig: '''Configuration for Azure OpenAI integration.''' def __init__(self): pass
2
1
18
3
12
5
1
0.46
0
0
0
0
1
10
1
1
21
4
13
12
11
6
13
12
11
1
0
0
1
326,342
FalkorDB/QueryWeaver
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/FalkorDB_QueryWeaver/api/memory/graphiti_tool.py
api.memory.graphiti_tool.MemoryTool
from typing import List, Dict, Any, Optional from datetime import datetime from graphiti_core.search.search_config_recipes import NODE_HYBRID_SEARCH_RRF from litellm import completion import uuid from api.extensions import db from graphiti_core.nodes import EpisodeType from graphiti_core.driver.falkordb_driver import F...
class MemoryTool: '''Memory management tool for handling user memories and interactions.''' def __init__(self, user_id: str, graph_id: str): pass @classmethod async def create(cls, user_id: str, graph_id: str, use_direct_entities: bool=True) -> 'MemoryTool': '''Async factory to constru...
15
12
45
7
30
8
6
0.28
0
8
1
0
11
4
12
12
560
99
362
105
348
102
240
92
227
13
0
5
67
326,343
FalkorDB/QueryWeaver
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/FalkorDB_QueryWeaver/api/routes/database.py
api.routes.database.DatabaseConnectionRequest
from pydantic import BaseModel class DatabaseConnectionRequest(BaseModel): """Database connection request model. Args: BaseModel (_type_): _description_ """ url: str
class DatabaseConnectionRequest(BaseModel): '''Database connection request model. Args: BaseModel (_type_): _description_ ''' pass
1
1
0
0
0
0
0
2
1
0
0
0
0
0
0
82
7
1
2
1
1
4
2
1
1
0
5
0
0
326,344
FalkorDB/QueryWeaver
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/FalkorDB_QueryWeaver/api/routes/graphs.py
api.routes.graphs.ChatRequest
from pydantic import BaseModel class ChatRequest(BaseModel): """Chat request model. Args: BaseModel (_type_): _description_ """ chat: list[str] result: list[str] | None = None instructions: str | None = None
class ChatRequest(BaseModel): '''Chat request model. Args: BaseModel (_type_): _description_ ''' pass
1
1
0
0
0
0
0
1
1
0
0
0
0
0
0
82
9
1
4
3
3
4
4
3
3
0
5
0
0
326,345
FalkorDB/QueryWeaver
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/FalkorDB_QueryWeaver/api/routes/graphs.py
api.routes.graphs.ConfirmRequest
from pydantic import BaseModel class ConfirmRequest(BaseModel): """Confirmation request model. Args: BaseModel (_type_): _description_ """ sql_query: str confirmation: str = '' chat: list = []
class ConfirmRequest(BaseModel): '''Confirmation request model. Args: BaseModel (_type_): _description_ ''' pass
1
1
0
0
0
0
0
1
1
0
0
0
0
0
0
82
9
1
4
3
3
4
4
3
3
0
5
0
0
326,346
FalkorDB/QueryWeaver
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/FalkorDB_QueryWeaver/api/routes/graphs.py
api.routes.graphs.GraphData
from pydantic import BaseModel class GraphData(BaseModel): """Graph data model. Args: BaseModel (_type_): _description_ """ database: str
class GraphData(BaseModel): '''Graph data model. Args: BaseModel (_type_): _description_ ''' pass
1
1
0
0
0
0
0
2
1
0
0
0
0
0
0
82
7
1
2
1
1
4
2
1
1
0
5
0
0
326,347
FalkorDB/QueryWeaver
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/FalkorDB_QueryWeaver/api/loaders/base_loader.py
base_loader.BaseLoader
from api.config import Config from abc import ABC, abstractmethod from typing import AsyncGenerator, List, Any, Tuple, TYPE_CHECKING class BaseLoader(ABC): """Abstract base class for data loaders.""" @staticmethod @abstractmethod async def load(_graph_id: str, _data) -> AsyncGenerator[tuple[bool, str]...
class BaseLoader(ABC): '''Abstract base class for data loaders.''' @staticmethod @abstractmethod async def load(_graph_id: str, _data) -> AsyncGenerator[tuple[bool, str], None]: ''' Load the graph data into the database. This method must be implemented by any subclass. ''' ...
12
5
6
0
2
4
1
1.25
1
2
0
5
0
0
1
21
10
1
4
3
1
5
3
2
1
1
4
0
1
326,348
FalkorDB/QueryWeaver
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/FalkorDB_QueryWeaver/api/loaders/mysql_loader.py
mysql_loader.MySQLLoader
import tqdm import re from api.loaders.graph_loader import load_to_graph from pymysql.cursors import DictCursor from typing import AsyncGenerator, Tuple, Dict, Any, List from api.loaders.base_loader import BaseLoader import logging import datetime import decimal import pymysql class MySQLLoader(BaseLoader): """ ...
class MySQLLoader(BaseLoader): ''' Loader for MySQL databases that connects and extracts schema information. ''' @staticmethod def _execute_count_query(cursor, table_name: str, col_name: str) -> Tuple[int, int]: ''' Execute query to get total count and distinct count for a column. ...
25
13
47
8
27
13
5
0.44
1
12
0
0
0
0
10
31
519
91
298
80
276
130
176
67
164
10
5
3
52
326,349
FalkorDB/QueryWeaver
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/FalkorDB_QueryWeaver/api/loaders/postgres_loader.py
postgres_loader.PostgresLoader
from typing import AsyncGenerator, Tuple, Dict, Any, List import logging from api.loaders.base_loader import BaseLoader import psycopg2 import datetime import re import tqdm import decimal from api.loaders.graph_loader import load_to_graph from psycopg2 import sql class PostgresLoader(BaseLoader): """ Loader f...
class PostgresLoader(BaseLoader): ''' Loader for PostgreSQL databases that connects and extracts schema information. ''' @staticmethod def _execute_count_query(cursor, table_name: str, col_name: str) -> Tuple[int, int]: ''' Execute query to get total count and distinct count for a c...
23
12
48
7
29
12
5
0.39
1
11
0
0
0
0
9
30
474
77
286
63
266
111
140
50
129
8
5
3
41
326,350
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/docs/autodoc2_docstrings_parser.py
autodoc2_docstrings_parser.NapoleonParser
from myst_parser.parsers.sphinx_ import MystParser from sphinx.ext.napoleon.docstring import GoogleDocstring from docutils import nodes class NapoleonParser(MystParser): def parse(self, input_string: str, document: nodes.document) -> None: config = document.settings.env.config google_parsed = str(...
class NapoleonParser(MystParser): def parse(self, input_string: str, document: nodes.document) -> None: pass
2
0
8
2
4
2
1
0.4
1
2
0
0
1
0
1
1
9
2
5
4
3
2
5
4
3
1
1
0
1
326,351
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_deploy/nlp/inference/inference_base.py
inference_base.MCoreEngineWithCleanup
from megatron.bridge.training.tokenizers.tokenizer import MegatronTokenizer from typing import Any, List, Optional, Tuple, Union from megatron.core.inference.model_inference_wrappers.gpt.gpt_inference_wrapper import GPTInferenceWrapper from megatron.core.inference.engines.mcore_engine import MCoreEngine class MCoreEng...
class MCoreEngineWithCleanup: '''Wrapper around MCoreEngine that ensures proper cleanup of distributed resources. This class delegates all operations to the underlying MCoreEngine while ensuring that distributed resources are properly cleaned up when the engine is destroyed. ''' def __init__(self,...
4
2
7
0
4
3
1
0.86
0
0
0
0
3
3
3
3
31
5
14
12
5
12
9
7
5
1
0
0
3
326,352
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_deploy/deploy_base.py
nemo_deploy.deploy_base.DeployBase
from nemo_deploy.triton_deployable import ITritonDeployable from abc import ABC, abstractmethod class DeployBase(ABC): def __init__(self, triton_model_name: str, triton_model_version: int=1, model=None, max_batch_size: int=128, http_port: int=8000, grpc_port: int=8001, address='0.0.0.0', allow_grpc=True, allow_ht...
class DeployBase(ABC): def __init__(self, triton_model_name: str, triton_model_version: int=1, model=None, max_batch_size: int=128, http_port: int=8000, grpc_port: int=8001, address='0.0.0.0', allow_grpc=True, allow_http=True, streaming=False): pass @abstractmethod def deploy(self): pass ...
11
0
7
0
7
0
1
0
1
4
1
3
6
11
6
26
49
5
44
34
21
0
25
18
18
2
4
1
7
326,353
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_deploy/deploy_pytriton.py
nemo_deploy.deploy_pytriton.DeployPyTriton
from nemo_deploy.deploy_base import DeployBase from nemo_export_deploy_common.import_utils import MISSING_TRITON_MSG, UnavailableError class DeployPyTriton(DeployBase): """Deploys any models to Triton Inference Server that implements ITritonDeployable interface in nemo_deploy. Example: from nemo_deplo...
class DeployPyTriton(DeployBase): '''Deploys any models to Triton Inference Server that implements ITritonDeployable interface in nemo_deploy. Example: from nemo_deploy import DeployPyTriton, NemoQueryLLM from nemo_export.tensorrt_llm import TensorRTLLM trt_llm_exporter = TensorRTLLM(mo...
6
6
21
1
17
3
2
0.48
1
5
1
0
5
9
5
31
142
16
85
31
66
41
34
9
28
4
5
2
12
326,354
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_deploy/deploy_ray.py
nemo_deploy.deploy_ray.DeployRay
import sys from nemo_export_deploy_common.import_utils import MISSING_RAY_MSG, UnavailableError import signal from nemo_deploy.ray_utils import find_available_port from typing import Optional class DeployRay: """A class for managing Ray deployment and serving of models. This class provides functionality to in...
class DeployRay: '''A class for managing Ray deployment and serving of models. This class provides functionality to initialize Ray, start Ray Serve, deploy models, and manage the lifecycle of the Ray cluster. It supports both NeMo inframework models, Hugging Face models, and TensorRT-LLM models. At...
8
8
58
6
34
18
4
0.59
0
13
4
0
7
4
7
7
436
54
240
82
173
142
102
19
94
6
0
2
25
326,355
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_deploy/multimodal/query_multimodal.py
nemo_deploy.multimodal.query_multimodal.NemoQueryMultimodal
import requests from nemo_export_deploy_common.import_utils import MISSING_DECORD_MSG, MISSING_PIL_MSG, MISSING_TRITON_MSG, UnavailableError from nemo_deploy.utils import str_list2numpy import numpy as np from io import BytesIO class NemoQueryMultimodal: """Sends a query to Triton for Multimodal inference. Ex...
class NemoQueryMultimodal: '''Sends a query to Triton for Multimodal inference. Example: from nemo_deploy.multimodal import NemoQueryMultimodal nq = NemoQueryMultimodal(url="localhost", model_name="neva", model_type="neva") input_text = "Hi! What is in this image?" output = nq.q...
6
5
22
3
18
1
5
0.21
0
5
1
0
5
3
5
5
132
23
90
39
71
19
70
25
64
12
0
2
24
326,356
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_deploy/nlp/hf_deployable.py
nemo_deploy.nlp.hf_deployable.HuggingFaceLLMDeploy
import numpy as np from nemo_deploy.utils import broadcast_list, cast_output, str_ndarray2list from typing import Any, Dict, List, Optional from nemo_deploy import ITritonDeployable from nemo_export_deploy_common.import_utils import MISSING_TRITON_MSG, UnavailableError, null_decorator from peft import PeftModel import ...
class HuggingFaceLLMDeploy(ITritonDeployable): '''A Triton inference server compatible wrapper for HuggingFace models. This class provides a standardized interface for deploying HuggingFace models in Triton inference server. It supports various NLP tasks and handles model loading, inference, and deploy...
13
6
46
5
33
8
7
0.3
1
10
1
0
9
9
9
32
445
52
303
97
265
92
171
62
161
18
5
5
60
326,357
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_deploy/nlp/hf_deployable_ray.py
nemo_deploy.nlp.hf_deployable_ray.HFRayDeployable
import numpy as np import time from fastapi import FastAPI, HTTPException from typing import Any, Dict, Optional from nemo_deploy.ray_utils import find_available_port from ray import serve from nemo_deploy.nlp.hf_deployable import HuggingFaceLLMDeploy import torch @serve.deployment(num_replicas=1, ray_actor_options={'...
@serve.deployment(num_replicas=1, ray_actor_options={'num_gpus': 1, 'num_cpus': 8}, max_ongoing_requests=10) @serve.ingress(app) class HFRayDeployable: '''A Ray Serve compatible wrapper for deploying HuggingFace models. This class provides a standardized interface for deploying HuggingFace models in Ray Ser...
13
7
52
6
31
16
5
0.56
0
9
2
0
6
2
6
6
335
41
189
54
166
106
81
38
71
9
0
3
27
326,358
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_deploy/nlp/megatronllm_deployable.py
nemo_deploy.nlp.megatronllm_deployable.MegatronLLMDeploy
from typing import List, Optional from nemo_deploy.utils import NEMO2, broadcast_list, cast_output, nemo_checkpoint_version, str_ndarray2list class MegatronLLMDeploy: """A factory class for creating deployable instances of Megatron LLM models. This class provides a method to get the appropriate deployable ins...
class MegatronLLMDeploy: '''A factory class for creating deployable instances of Megatron LLM models. This class provides a method to get the appropriate deployable instance based on the version of the NeMo checkpoint model used. ''' @staticmethod def get_deployable(nemo_checkpoint_filepath: st...
3
2
47
2
31
14
2
0.55
0
5
1
0
0
0
1
1
55
4
33
16
17
18
5
2
3
2
0
1
2
326,359
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_deploy/nlp/megatronllm_deployable.py
nemo_deploy.nlp.megatronllm_deployable.MegatronLLMDeployableNemo2
import json from pathlib import Path from jinja2 import Template from typing import List, Optional from nemo_deploy.nlp.inference.inference_base import create_mcore_engine from nemo_deploy.utils import NEMO2, broadcast_list, cast_output, nemo_checkpoint_version, str_ndarray2list from megatron.core.inference.inference_r...
class MegatronLLMDeployableNemo2(ITritonDeployable): '''Triton inference server compatible deploy class for a .nemo model file. Args: nemo_checkpoint_filepath (str): path for the nemo checkpoint. num_devices (int): number of GPUs. num_nodes (int): number of nodes. tensor_model_p...
16
8
36
3
26
7
4
0.33
1
11
1
0
11
5
11
34
443
45
299
104
235
99
139
64
127
15
5
3
42
326,360
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_deploy/nlp/megatronllm_deployable_ray.py
nemo_deploy.nlp.megatronllm_deployable_ray.MegatronRayDeployable
import random import ray from ray import serve import time import numpy as np from fastapi import FastAPI, HTTPException from ..ray_utils import find_available_port from typing import Any, Dict, Optional @serve.deployment(num_replicas=1, ray_actor_options={'num_cpus': 8}, max_ongoing_requests=32) @serve.ingress(app) c...
@serve.deployment(num_replicas=1, ray_actor_options={'num_cpus': 8}, max_ongoing_requests=32) @serve.ingress(app) class MegatronRayDeployable: '''A Ray Serve deployment for distributed Megatron LLM models. This class coordinates model parallelism across multiple GPUs and nodes, with each shard handled by a ...
12
6
55
5
41
10
4
0.26
0
8
1
0
5
3
5
5
292
29
211
61
183
54
70
36
64
8
0
2
21
326,361
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_deploy/nlp/megatronllm_deployable_ray.py
nemo_deploy.nlp.megatronllm_deployable_ray.ModelWorker
import torch import ray from typing import Any, Dict, Optional from .megatronllm_deployable import MegatronLLMDeployableNemo2 import os @ray.remote(num_gpus=1) class ModelWorker: """Ray actor that loads and runs inference on a shard of the model. Each ModelWorker is responsible for a specific rank in the mode...
@ray.remote(num_gpus=1) class ModelWorker: '''Ray actor that loads and runs inference on a shard of the model. Each ModelWorker is responsible for a specific rank in the model parallel setup. ''' def __init__(self, nemo_checkpoint_filepath: str, rank: int, world_size: int, tensor_model_parallel_size: i...
4
2
32
2
29
3
3
0.14
0
6
1
0
2
1
2
2
71
6
58
25
35
8
21
4
18
4
0
2
5
326,362
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_deploy/nlp/query_llm.py
nemo_deploy.nlp.query_llm.NemoQueryLLM
from nemo_export_deploy_common.import_utils import MISSING_TRITON_MSG, UnavailableError import time import numpy as np from nemo_deploy.utils import str_list2numpy class NemoQueryLLM(NemoQueryLLMBase): """Sends a query to Triton for LLM inference. Example: from nemo_deploy import NemoQueryLLM ...
class NemoQueryLLM(NemoQueryLLMBase): '''Sends a query to Triton for LLM inference. Example: from nemo_deploy import NemoQueryLLM nq = NemoQueryLLM(url="localhost", model_name="GPT-2B") prompts = ["hello, testing GPT inference", "another GPT inference test?"] output = nq.query_l...
2
2
131
23
93
15
26
0.31
1
4
1
0
1
2
1
22
150
27
94
32
69
29
61
8
59
26
5
4
26
326,363
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_deploy/nlp/query_llm.py
nemo_deploy.nlp.query_llm.NemoQueryLLMBase
from abc import ABC class NemoQueryLLMBase(ABC): """Abstract base class for querying a Large Language Model (LLM). Args: url (str): The URL of the inference server. model_name (str): The name of the model to be queried. """ def __init__(self, url, model_name): self.url = url s...
class NemoQueryLLMBase(ABC): '''Abstract base class for querying a Large Language Model (LLM). Args: url (str): The URL of the inference server. model_name (str): The name of the model to be queried. ''' def __init__(self, url, model_name): pass
2
1
3
0
3
0
1
1.25
1
0
0
5
1
2
1
21
11
2
4
4
2
5
4
4
2
1
4
0
1
326,364
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_deploy/nlp/query_llm.py
nemo_deploy.nlp.query_llm.NemoQueryLLMHF
from nemo_deploy.utils import str_list2numpy from typing import List, Optional import time import numpy as np class NemoQueryLLMHF(NemoQueryLLMBase): """Sends a query to Triton for LLM inference. Example: from nemo_deploy import NemoQueryLLMHF nq = NemoQueryLLMHF(url="localhost", model_name="...
class NemoQueryLLMHF(NemoQueryLLMBase): '''Sends a query to Triton for LLM inference. Example: from nemo_deploy import NemoQueryLLMHF nq = NemoQueryLLMHF(url="localhost", model_name="GPT-2B") prompts = ["hello, testing GPT inference", "another GPT inference test?"] output = nq.q...
2
2
89
4
68
17
17
0.48
1
4
0
0
1
2
1
22
110
8
69
25
51
33
43
8
41
17
5
3
17
326,365
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_deploy/nlp/query_llm.py
nemo_deploy.nlp.query_llm.NemoQueryLLMPyTorch
from nemo_deploy.utils import str_list2numpy import numpy as np import time from typing import List, Optional import json class NemoQueryLLMPyTorch(NemoQueryLLMBase): """Sends a query to Triton for LLM inference. Example: from nemo_deploy import NemoTritonQueryLLMPyTorch nq = NemoTritonQueryL...
class NemoQueryLLMPyTorch(NemoQueryLLMBase): '''Sends a query to Triton for LLM inference. Example: from nemo_deploy import NemoTritonQueryLLMPyTorch nq = NemoTritonQueryLLMPyTorch(url="localhost", model_name="GPT-2B") prompts = ["hello, testing GPT inference", "another GPT inference te...
2
2
113
6
87
20
21
0.41
1
4
0
0
1
2
1
22
134
10
88
32
68
36
55
11
53
21
5
4
21
326,366
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_deploy/nlp/query_llm.py
nemo_deploy.nlp.query_llm.NemoQueryTRTLLMAPI
from typing import List, Optional import numpy as np from nemo_deploy.utils import str_list2numpy class NemoQueryTRTLLMAPI(NemoQueryLLMBase): """Sends a query to Triton for TensorRT-LLM API deployment inference. Example: from nemo_deploy import NemoQueryTRTLLMAPI nq = NemoQueryTRTLLMAPI(url="...
class NemoQueryTRTLLMAPI(NemoQueryLLMBase): '''Sends a query to Triton for TensorRT-LLM API deployment inference. Example: from nemo_deploy import NemoQueryTRTLLMAPI nq = NemoQueryTRTLLMAPI(url="localhost", model_name="GPT-2B") prompts = ["hello, testing GPT inference", "another GPT inf...
2
2
54
9
33
12
7
0.76
1
3
0
0
1
2
1
22
73
13
34
16
24
26
22
7
20
7
5
3
7
326,367
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_deploy/nlp/query_llm.py
nemo_deploy.nlp.query_llm.NemoQueryvLLM
import time from typing import List, Optional from nemo_deploy.utils import str_list2numpy import numpy as np class NemoQueryvLLM(NemoQueryLLMBase): """Sends a query to Triton for TensorRT-LLM API deployment inference. Example: from nemo_deploy import NemoQueryvLLM nq = NemoQueryvLLM(url="loc...
class NemoQueryvLLM(NemoQueryLLMBase): '''Sends a query to Triton for TensorRT-LLM API deployment inference. Example: from nemo_deploy import NemoQueryvLLM nq = NemoQueryvLLM(url="localhost", model_name="GPT-2B") prompts = ["hello, testing GPT inference", "another GPT inference test?"] ...
2
2
77
7
54
16
12
0.55
1
4
0
0
1
2
1
22
96
11
55
20
41
30
32
7
30
12
5
2
12
326,368
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_deploy/nlp/trtllm_api_deployable.py
nemo_deploy.nlp.trtllm_api_deployable.TensorRTLLMAPIDeployable
from nemo_export_deploy_common.import_utils import MISSING_TENSORRT_LLM_MSG, MISSING_TRITON_MSG, null_decorator from nemo_deploy import ITritonDeployable from transformers import PreTrainedTokenizerBase from nemo_deploy.utils import cast_output, str_ndarray2list from typing import List, Optional, Union import numpy as ...
class TensorRTLLMAPIDeployable(ITritonDeployable): '''A Triton inference server compatible wrapper for TensorRT-LLM LLM-API. This class provides a standardized interface for deploying TensorRT-LLM LLM-API in Triton inference server. It handles model loading, inference, and deployment configurations. Ar...
10
2
22
3
16
3
2
0.38
1
7
0
0
5
1
5
28
140
20
87
41
56
33
28
17
22
4
5
1
9
326,369
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_deploy/service/fastapi_interface_to_pytriton.py
nemo_deploy.service.fastapi_interface_to_pytriton.BaseRequest
from pydantic import BaseModel, model_validator class BaseRequest(BaseModel): """Common parameters for completions and chat requests for the server. Attributes: model (str): The name of the model to use for completion. max_tokens (int): The maximum number of tokens to generate in the response....
class BaseRequest(BaseModel): '''Common parameters for completions and chat requests for the server. Attributes: model (str): The name of the model to use for completion. max_tokens (int): The maximum number of tokens to generate in the response. temperature (float): Sampling temperatur...
3
2
6
0
5
1
2
0.75
1
0
0
2
1
0
1
83
24
3
12
7
9
9
11
6
9
2
5
1
2
326,370
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_deploy/service/fastapi_interface_to_pytriton.py
nemo_deploy.service.fastapi_interface_to_pytriton.ChatCompletionRequest
class ChatCompletionRequest(BaseRequest): """Represents a request for chat completion. Attributes: messages (list[dict]): A list of message dictionaries for chat completion. logprobs (bool): Whether to return log probabilities for output tokens. top_logprobs (int): Number of log probabi...
class ChatCompletionRequest(BaseRequest): '''Represents a request for chat completion. Attributes: messages (list[dict]): A list of message dictionaries for chat completion. logprobs (bool): Whether to return log probabilities for output tokens. top_logprobs (int): Number of log probabil...
1
1
0
0
0
0
0
3.5
1
0
0
0
0
0
0
83
11
2
2
1
1
7
2
1
1
0
6
0
0
326,371
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_deploy/service/fastapi_interface_to_pytriton.py
nemo_deploy.service.fastapi_interface_to_pytriton.CompletionRequest
class CompletionRequest(BaseRequest): """Represents a request for text completion. Attributes: prompt (str): The input text to generate a response from. logprobs (int): Number of log probabilities to include in the response, if applicable. echo (bool): Whether to return the input text a...
class CompletionRequest(BaseRequest): '''Represents a request for text completion. Attributes: prompt (str): The input text to generate a response from. logprobs (int): Number of log probabilities to include in the response, if applicable. echo (bool): Whether to return the input text as...
1
1
0
0
0
0
0
1.5
1
0
0
0
0
0
0
83
12
2
4
3
3
6
4
3
3
0
6
0
0
326,372
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_deploy/service/fastapi_interface_to_pytriton.py
nemo_deploy.service.fastapi_interface_to_pytriton.TritonSettings
import os from pydantic_settings import BaseSettings class TritonSettings(BaseSettings): """TritonSettings class that gets the values of TRITON_HTTP_ADDRESS and TRITON_PORT.""" _triton_service_port: int _triton_service_ip: str def __init__(self): super(TritonSettings, self).__init__() ...
class TritonSettings(BaseSettings): '''TritonSettings class that gets the values of TRITON_HTTP_ADDRESS and TRITON_PORT.''' def __init__(self): pass @property def triton_service_port(self): '''Returns the port number for the Triton service.''' pass @property def triton_...
6
3
6
0
5
1
1
0.15
1
3
0
0
3
0
3
3
27
4
20
7
14
3
15
4
11
2
1
1
4
326,373
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_deploy/triton_deployable.py
nemo_deploy.triton_deployable.ITritonDeployable
import numpy as np from abc import ABC, abstractmethod class ITritonDeployable(ABC): @abstractmethod def get_triton_input(self): pass @abstractmethod def get_triton_output(self): pass @abstractmethod def triton_infer_fn(self, **inputs: np.ndarray): pass
class ITritonDeployable(ABC): @abstractmethod def get_triton_input(self): pass @abstractmethod def get_triton_output(self): pass @abstractmethod def triton_infer_fn(self, **inputs: np.ndarray): pass
7
0
2
0
2
0
1
0
1
0
0
11
3
0
3
23
12
2
10
7
3
0
7
4
3
1
4
0
3
326,374
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_export/model_adapters/embedding/embedding_adapter.py
nemo_export.model_adapters.embedding.embedding_adapter.LlamaBidirectionalHFAdapter
from typing import Literal, Optional, Union import torch.nn.functional as F import torch class LlamaBidirectionalHFAdapter(torch.nn.Module): """ Wraps a text embedding model with pooling and normalization for bidirectional encoding. This adapter combines a transformer model with configurable pooling strat...
class LlamaBidirectionalHFAdapter(torch.nn.Module): ''' Wraps a text embedding model with pooling and normalization for bidirectional encoding. This adapter combines a transformer model with configurable pooling strategies and optional L2 normalization to produce fixed-size embeddings from variable-len...
5
4
26
4
13
9
2
0.93
1
5
0
0
3
3
3
3
97
16
42
25
26
39
24
13
20
5
1
2
7
326,375
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_export/model_adapters/embedding/embedding_adapter.py
nemo_export.model_adapters.embedding.embedding_adapter.Pooling
import torch import torch.nn.functional as F class Pooling(torch.nn.Module): """ Pooling layer that aggregates token-level embeddings into sequence-level embeddings. Supports multiple pooling strategies: - 'avg': Average pooling over non-padded tokens - 'cls': Uses the first token (CLS token) with...
class Pooling(torch.nn.Module): ''' Pooling layer that aggregates token-level embeddings into sequence-level embeddings. Supports multiple pooling strategies: - 'avg': Average pooling over non-padded tokens - 'cls': Uses the first token (CLS token) with right padding - 'cls__left': Uses the fir...
3
3
25
3
13
12
4
1.31
1
3
0
0
2
1
2
2
65
10
26
12
23
34
21
12
18
6
1
1
7
326,376
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_export/model_adapters/reranker/reranker_adapter.py
nemo_export.model_adapters.reranker.reranker_adapter.SequenceClassificationModelAdapterWithTypeIds
import torch from transformers import AutoModelForSequenceClassification, AutoTokenizer class SequenceClassificationModelAdapterWithTypeIds(torch.nn.Module): """Adapter for sequence classification models that use token type IDs. This adapter wraps a HuggingFace AutoModelForSequenceClassification model and...
class SequenceClassificationModelAdapterWithTypeIds(torch.nn.Module): '''Adapter for sequence classification models that use token type IDs. This adapter wraps a HuggingFace AutoModelForSequenceClassification model and provides a forward method that includes token_type_ids for models that require this ...
3
2
14
1
8
5
1
1.19
1
1
0
0
2
2
2
2
42
7
16
10
8
19
7
5
4
1
1
0
2
326,377
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_export/model_adapters/reranker/reranker_adapter.py
nemo_export.model_adapters.reranker.reranker_adapter.SequenceClassificationModelAdapterWithoutTypeIds
import torch from transformers import AutoModelForSequenceClassification, AutoTokenizer class SequenceClassificationModelAdapterWithoutTypeIds(torch.nn.Module): """Adapter for sequence classification models that don't use token type IDs. This adapter wraps a HuggingFace AutoModelForSequenceClassification mode...
class SequenceClassificationModelAdapterWithoutTypeIds(torch.nn.Module): '''Adapter for sequence classification models that don't use token type IDs. This adapter wraps a HuggingFace AutoModelForSequenceClassification model and provides a simplified forward method that only takes input_ids and attentio...
3
2
8
1
3
4
1
2.43
1
1
0
0
2
2
2
2
31
7
7
5
4
17
7
5
4
1
1
0
2
326,378
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_export/multimodal/run.py
nemo_export.multimodal.run.MultimodalModelRunner
from transformers import AutoProcessor, CLIPImageProcessor import einops import numpy as np from nemo_export.utils.constants import TRTLLM_ENGINE_DIR import torch from nemo_export_deploy_common.import_utils import MISSING_DECORD_MSG, MISSING_PIL_MSG, MISSING_TENSORRT_LLM_MSG, MISSING_TENSORRT_MSG, MISSING_TORCHVISION_M...
class MultimodalModelRunner: def __init__(self, visual_engine_dir, llm_engine_dir, modality='vision'): pass def init_tokenizer(self, llm_engine_dir): pass class return_obj: def __init__(self, visual_engine_dir, llm_engine_dir, modality='vision'): pass ...
39
0
26
3
22
1
4
0.05
0
11
2
0
26
17
27
27
894
134
732
221
652
36
495
174
454
15
0
4
140
326,379
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_export/onnx_llm_exporter.py
nemo_export.onnx_llm_exporter.OnnxLLMExporter
import numpy as np from typing import Any, Callable, Dict, List, Optional, Union from nemo_export.utils import get_example_inputs, get_model_device_type, is_nemo2_checkpoint, validate_fp8_network from transformers import AutoModel, AutoTokenizer from pathlib import Path import warnings from nemo_deploy import ITritonDe...
class OnnxLLMExporter(ITritonDeployable): '''Exports models to ONNX and run fast inference. Example: from nemo_export.onnx_llm_exporter import OnnxLLMExporter onnx_llm_exporter = OnnxLLMExporter( onnx_model_dir="/path/for/onnx_model/files", model_name_or_path="/path/for/...
24
13
23
3
17
4
4
0.28
1
14
1
0
17
9
17
40
437
66
289
101
225
82
194
54
176
19
5
4
74
326,380
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_export/sentencepiece_tokenizer.py
nemo_export.sentencepiece_tokenizer.SentencePieceTokenizer
import torch import sentencepiece from typing import Dict, List, Optional, Union import numpy as np import os class SentencePieceTokenizer: """SentencePieceTokenizer (https://github.com/google/sentencepiece). Args: model_path: path to sentence piece tokenizer model. special_tokens: either list...
class SentencePieceTokenizer: '''SentencePieceTokenizer (https://github.com/google/sentencepiece). Args: model_path: path to sentence piece tokenizer model. special_tokens: either list of special tokens or dictionary of token name to token value legacy: when set to True, the previous be...
34
2
10
1
8
0
3
0.05
0
11
0
0
23
7
23
23
264
48
206
77
166
11
161
60
137
8
0
4
61
326,381
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_export/tarutils.py
nemo_export.tarutils.TarPath
import os import fnmatch import tarfile from typing import IO, Union class TarPath: """A class that represents a path inside a TAR archive and behaves like pathlib.Path. Expected use is to create a TarPath for the root of the archive first, and then derive paths to other files or directories inside the ar...
class TarPath: '''A class that represents a path inside a TAR archive and behaves like pathlib.Path. Expected use is to create a TarPath for the root of the archive first, and then derive paths to other files or directories inside the archive like so: with TarPath('/path/to/archive.tar') as archive: ...
22
12
8
0
6
1
3
0.25
0
10
0
0
17
3
17
17
171
27
115
35
93
29
107
31
89
7
0
3
45
326,382
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_export/tarutils.py
nemo_export.tarutils.ZarrPathStore
class ZarrPathStore(BaseStore): """An implementation of read-only Store for zarr library that works with pathlib.Path or TarPath objects.""" def __init__(self, tarpath: TarPath): assert HAVE_ZARR, 'Package zarr>=2.18.2,<3.0.0 is required to use ZarrPathStore' self._path = tarpath self._...
class ZarrPathStore(BaseStore): '''An implementation of read-only Store for zarr library that works with pathlib.Path or TarPath objects.''' def __init__(self, tarpath: TarPath): pass def __getitem__(self, key): pass def __contains__(self, key): pass def __iter__(self): ...
9
2
3
0
3
0
1
0.1
1
2
1
0
8
3
8
8
31
8
21
14
12
2
21
12
12
1
1
1
8
326,383
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_export/tensorrt_llm.py
nemo_export.tensorrt_llm.TensorRTLLM
from nemo_deploy.utils import cast_output, str_ndarray2list from nemo_deploy import ITritonDeployable from transformers import AutoConfig, PreTrainedTokenizerBase import json from megatron.core.export.trtllm.model_to_trllm_mapping.default_conversion_dict import DEFAULT_CONVERSION_DICT from megatron.core.export.model_ty...
class TensorRTLLM(ITritonDeployable): '''Exports nemo and huggingface checkpoints to TensorRT-LLM and run fast inference. This class provides functionality to export NeMo and HuggingFace models to TensorRT-LLM format and run inference using the exported models. It supports various model architectures a...
28
18
47
4
34
9
5
0.27
1
19
1
0
20
10
20
43
1,001
109
705
186
592
190
290
98
268
25
5
3
103
326,384
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_export/tensorrt_llm_deployable_ray.py
nemo_export.tensorrt_llm_deployable_ray.TensorRTLLMRayDeployable
import numpy as np from fastapi import FastAPI, HTTPException from nemo_export_deploy_common.import_utils import MISSING_RAY_MSG, UnavailableError import time from typing import Any, Dict, List from nemo_export.tensorrt_llm import TensorRTLLM @serve.deployment(num_replicas=1, ray_actor_options={'num_gpus': 1, 'num_cpu...
@serve.deployment(num_replicas=1, ray_actor_options={'num_gpus': 1, 'num_cpus': 8}, max_ongoing_requests=10) @serve.ingress(app) class TensorRTLLMRayDeployable: '''A Ray Serve compatible wrapper for deploying TensorRT-LLM models. This class provides a standardized interface for deploying TensorRT-LLM models ...
12
6
44
4
32
9
5
0.35
0
8
2
0
5
2
5
5
249
28
164
47
145
58
64
31
58
10
0
3
24
326,385
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_export/tensorrt_mm_exporter.py
nemo_export.tensorrt_mm_exporter.TensorRTMMExporter
from typing import List from nemo_export.multimodal.build import build_mllama_engine, build_trtllm_engine, build_visual_engine, extract_lora_ckpt import os from nemo_deploy import ITritonDeployable import numpy as np from nemo_export.multimodal.run import MultimodalModelRunner import shutil import tempfile from pathlib...
class TensorRTMMExporter(ITritonDeployable): '''Exports nemo checkpoints to TensorRT and run fast inference. Example: from nemo_export import TensorRTMMExporter exporter = TensorRTMMExporter(model_dir="/path/for/model/files") exporter.export( visual_checkpoint_path="/path/fo...
13
4
33
2
31
1
5
0.07
1
13
2
0
8
3
8
31
302
26
260
76
200
17
124
34
113
16
5
4
42
326,386
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_export/tiktoken_tokenizer.py
nemo_export.tiktoken_tokenizer.TiktokenTokenizer
from pathlib import Path import tiktoken import torch import numpy as np class TiktokenTokenizer: def __init__(self, vocab_file: str): self.num_special_tokens = 1000 vocab_size = DEFAULT_TIKTOKEN_MAX_VOCAB pattern = PATTERN_TIKTOKEN special_tokens = SPECIAL_TOKENS.copy() in...
class TiktokenTokenizer: def __init__(self, vocab_file: str): pass def encode(self, text): pass def decode(self, tokens): pass def batch_decode(self, ids): pass @property def pad_id(self): pass @property def bos_token_id(self): pass ...
11
0
7
1
6
1
1
0.11
0
3
0
0
7
4
7
7
59
11
45
22
34
5
32
19
24
3
0
1
10
326,387
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_export/trt_llm/tensorrt_llm_run.py
nemo_export.trt_llm.tensorrt_llm_run.TensorrtLLMHostContext
from transformers import PreTrainedTokenizer from dataclasses import dataclass @dataclass class TensorrtLLMHostContext: """The host side context for TRT LLM inference.""" executor: MPIPoolExecutor = None world_size: int = 1 tokenizer: PreTrainedTokenizer = None max_batch_size: int = 0 max_input...
@dataclass class TensorrtLLMHostContext: '''The host side context for TRT LLM inference.''' pass
2
1
0
0
0
0
0
0.14
0
0
0
0
0
0
0
0
9
1
7
7
6
1
7
7
6
0
0
0
0
326,388
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_export/trt_llm/tensorrt_llm_run.py
nemo_export.trt_llm.tensorrt_llm_run.TensorrtLLMWorkerContext
from dataclasses import dataclass @dataclass class TensorrtLLMWorkerContext: """The MPI worker side context for TRT LLM inference.""" decoder: ModelRunner | ModelRunnerCpp = None sampling_config: SamplingConfig = None lora_manager: LoraManager = None max_batch_size: int = 0 max_input_len: int =...
@dataclass class TensorrtLLMWorkerContext: '''The MPI worker side context for TRT LLM inference.''' pass
2
1
0
0
0
0
0
0.17
0
0
0
0
0
0
0
0
8
1
6
6
5
1
6
6
5
0
0
0
0
326,389
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_export/utils/model_loader.py
nemo_export.utils.model_loader.TarFileSystemReader
from torch.distributed.checkpoint import FileSystemReader, load from pathlib import Path from nemo_export.tarutils import TarPath, ZarrPathStore from typing import Any, Dict, Union class TarFileSystemReader(FileSystemReader): """Reader that accepts both Path and TarPath checkpoint directory. The FileSystemRea...
class TarFileSystemReader(FileSystemReader): '''Reader that accepts both Path and TarPath checkpoint directory. The FileSystemReader works with TarPath, but expects a pure Path. It's enough to skip the Path check in __init__. ''' def __init__(self, path: Union[Path, TarPath]) -> None: '''M...
2
2
6
0
5
2
3
1
1
4
1
0
1
1
1
1
13
2
6
4
4
6
6
4
4
3
1
1
3
326,390
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_export/vllm_exporter.py
nemo_export.vllm_exporter.vLLMExporter
from typing import Any, Dict, List, Literal from nemo_deploy import ITritonDeployable import tempfile from nemo_export.utils import is_nemo2_checkpoint import numpy as np from pathlib import Path from nemo_export_deploy_common.import_utils import MISSING_NEMO_MSG, MISSING_TRITON_MSG, MISSING_VLLM_MSG, UnavailableError ...
class vLLMExporter(ITritonDeployable): ''' vLLMExporter enables deployment of Hugging Face or NeMo2 models using vLLM and Triton. This class wraps vLLM APIs to load a model and make it deployable with Triton Inference Server. It supports exporting NeMo2 checkpoints to Hugging Face format if needed, and...
15
11
37
4
22
11
5
0.56
1
11
1
0
10
2
10
33
411
53
230
73
184
129
132
38
120
13
5
5
45
326,391
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_export_deploy_common/import_utils.py
nemo_export_deploy_common.import_utils.UnavailableError
class UnavailableError(Exception): """Error thrown if a symbol is unavailable due to an issue importing it"""
class UnavailableError(Exception): '''Error thrown if a symbol is unavailable due to an issue importing it''' pass
1
1
0
0
0
0
0
1
1
0
0
0
0
0
0
10
2
0
1
1
0
1
1
1
0
0
3
0
0
326,392
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_export_deploy_common/import_utils.py
nemo_export_deploy_common.import_utils.UnavailableMeta
class UnavailableMeta(type): """A metaclass for generating placeholder objects for unavailable symbols This metaclass allows errors to be deferred from import time to the time that a symbol is actually used in order to streamline the usage of optional dependencies. This is particularly useful for attem...
class UnavailableMeta(type): '''A metaclass for generating placeholder objects for unavailable symbols This metaclass allows errors to be deferred from import time to the time that a symbol is actually used in order to streamline the usage of optional dependencies. This is particularly useful for attemp...
48
1
2
0
2
0
1
0.19
1
2
1
0
47
0
47
60
174
50
104
48
56
20
102
48
54
2
2
1
50
326,393
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_export_deploy_common/import_utils.py
nemo_export_deploy_common.import_utils.UnavailableNullContext
class UnavailableNullContext: """A placeholder class for unavailable context managers This context manager will return a value which will throw an UnavailableError if used in any way, but the context manager itself can be safely invoked. """ def __init__(self, *args, **kwargs): pass ...
class UnavailableNullContext: '''A placeholder class for unavailable context managers This context manager will return a value which will throw an UnavailableError if used in any way, but the context manager itself can be safely invoked. ''' def __init__(self, *args, **kwargs): pass ...
4
1
3
0
3
0
1
0.45
0
1
1
0
3
0
3
3
20
4
11
4
7
5
7
4
3
1
0
0
3
326,394
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_deploy/nlp/inference/tron_utils.py
tron_utils.DistributedInitConfig
from dataclasses import dataclass, field from typing import Callable, List, Literal, Optional, Union import os @dataclass class DistributedInitConfig: """Configuration settings for distributed training initialization.""" distributed_backend: Literal['nccl', 'gloo'] = 'nccl' 'Which backend to use for distri...
@dataclass class DistributedInitConfig: '''Configuration settings for distributed training initialization.''' pass
2
1
0
0
0
0
0
2.1
0
1
0
0
0
0
0
0
41
10
10
10
9
21
10
10
9
0
0
0
0
326,395
NVIDIA-NeMo/Export-Deploy
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/NVIDIA-NeMo_Export-Deploy/nemo_deploy/nlp/inference/tron_utils.py
tron_utils.RNGConfig
from dataclasses import dataclass, field @dataclass class RNGConfig: """Configuration settings for random number generation.""" seed: int = 1234 'Random seed used for python, numpy, pytorch, and cuda.' te_rng_tracker: bool = False 'Use the Transformer Engine version of the random number generator.\...
@dataclass class RNGConfig: '''Configuration settings for random number generation.''' pass
2
1
0
0
0
0
0
1.2
0
0
0
0
0
0
0
0
15
4
5
5
4
6
5
5
4
0
0
0
0
326,396
danielmeppiel/awd-cli
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/danielmeppiel_awd-cli/src/apm_cli/adapters/client/base.py
apm_cli.adapters.client.base.MCPClientAdapter
from abc import ABC, abstractmethod class MCPClientAdapter(ABC): """Base adapter for MCP clients.""" @abstractmethod def get_config_path(self): """Get the path to the MCP configuration file.""" pass @abstractmethod def update_config(self, config_updates): """Update the MCP...
class MCPClientAdapter(ABC): '''Base adapter for MCP clients.''' @abstractmethod def get_config_path(self): '''Get the path to the MCP configuration file.''' pass @abstractmethod def update_config(self, config_updates): '''Update the MCP configuration.''' pass @a...
9
5
5
1
2
3
1
0.92
1
0
0
1
4
0
4
24
31
6
13
9
4
12
9
5
4
1
4
0
4
326,397
danielmeppiel/awd-cli
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/danielmeppiel_awd-cli/src/apm_cli/adapters/client/vscode.py
apm_cli.adapters.client.vscode.VSCodeClientAdapter
import json from ...registry.client import SimpleRegistryClient from ...registry.integration import RegistryIntegration from pathlib import Path from .base import MCPClientAdapter import os class VSCodeClientAdapter(MCPClientAdapter): """VSCode implementation of MCP client adapter. This adapter handles VSCode...
class VSCodeClientAdapter(MCPClientAdapter): '''VSCode implementation of MCP client adapter. This adapter handles VSCode-specific configuration for MCP servers using a repository-level .vscode/mcp.json file, following the format specified in the VSCode documentation. ''' def __init__(self, reg...
7
7
46
7
26
13
8
0.51
1
8
2
0
6
2
6
30
286
51
156
38
149
80
124
31
117
26
5
5
50
326,398
danielmeppiel/awd-cli
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/danielmeppiel_awd-cli/src/apm_cli/adapters/package_manager/base.py
apm_cli.adapters.package_manager.base.MCPPackageManagerAdapter
from abc import ABC, abstractmethod class MCPPackageManagerAdapter(ABC): """Base adapter for MCP package managers.""" @abstractmethod def install(self, package_name, version=None): """Install an MCP package.""" pass @abstractmethod def uninstall(self, package_name): """Uni...
class MCPPackageManagerAdapter(ABC): '''Base adapter for MCP package managers.''' @abstractmethod def install(self, package_name, version=None): '''Install an MCP package.''' pass @abstractmethod def uninstall(self, package_name): '''Uninstall an MCP package.''' pass...
9
5
3
0
2
1
1
0.38
1
0
0
1
4
0
4
24
22
4
13
9
4
5
9
5
4
1
4
0
4
326,399
danielmeppiel/awd-cli
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/danielmeppiel_awd-cli/src/apm_cli/adapters/package_manager/default_manager.py
apm_cli.adapters.package_manager.default_manager.DefaultMCPPackageManager
from .base import MCPPackageManagerAdapter from ...config import get_default_client from ...registry.integration import RegistryIntegration class DefaultMCPPackageManager(MCPPackageManagerAdapter): """Implementation of the default MCP package manager.""" def install(self, package_name, version=None): ...
class DefaultMCPPackageManager(MCPPackageManagerAdapter): '''Implementation of the default MCP package manager.''' def install(self, package_name, version=None): '''Install an MCP package. Args: package_name (str): Name of the package to install. version (str, optional)...
5
5
28
6
13
9
3
0.71
1
4
2
0
4
0
4
28
116
29
51
26
43
36
50
22
42
4
5
3
12