id int64 0 458k | file_name stringlengths 4 119 | file_path stringlengths 14 227 | content stringlengths 24 9.96M | size int64 24 9.96M | language stringclasses 1
value | extension stringclasses 14
values | total_lines int64 1 219k | avg_line_length float64 2.52 4.63M | max_line_length int64 5 9.91M | alphanum_fraction float64 0 1 | repo_name stringlengths 7 101 | repo_stars int64 100 139k | repo_forks int64 0 26.4k | repo_open_issues int64 0 2.27k | repo_license stringclasses 12
values | repo_extraction_date stringclasses 433
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2,284,500 | transfer_results_pythia.json | rimon15_evil_twins/results_from_paper/transfer_results_pythia.json | {
"70m": {
"70m": {
"0": {
"kl": 14.989686965942383,
"std": 0.9742412567138672
},
"1": {
"kl": 12.594999313354492,
"std": 0.9528641700744629
},
"2": {
"kl": 20.962812423706055,
"std": 1.0608543395996093
},
"3": {
"kl... | 441,776 | Python | .pyt | 19,714 | 14.428477 | 34 | 0.464106 | rimon15/evil_twins | 8 | 7 | 0 | GPL-2.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,501 | __main__.py | RTnhN_aw-watcher-toggl/aw_watcher_toggl/__main__.py | import sys
import os
path = os.path.dirname(sys.modules[__name__].__file__)
path = os.path.join(path, "..")
sys.path.insert(0, path)
import aw_watcher_toggl
aw_watcher_toggl.main()
| 184 | Python | .py | 7 | 24.857143 | 54 | 0.724138 | RTnhN/aw-watcher-toggl | 8 | 0 | 0 | MPL-2.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,502 | main.py | RTnhN_aw-watcher-toggl/aw_watcher_toggl/main.py | #!/usr/bin/env python3
import sys
import logging
import traceback
from typing import Optional
from time import sleep
from datetime import datetime, timezone, timedelta
from calendar import monthrange
import json
from collections import defaultdict
import requests
from requests import ConnectionError
from aw_core imp... | 6,726 | Python | .py | 151 | 36.768212 | 132 | 0.645432 | RTnhN/aw-watcher-toggl | 8 | 0 | 0 | MPL-2.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,503 | jabagram.py | ventureoo_jabagram/jabagram.py | #!/usr/bin/env python3
"""Launcher for jabagram"""
import sys
from jabagram import runner
if __name__ == '__main__':
sys.exit(runner.main())
| 147 | Python | .py | 6 | 22.5 | 27 | 0.683453 | ventureoo/jabagram | 8 | 0 | 1 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,504 | messages.py | ventureoo_jabagram/jabagram/messages.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2024 Vasiliy Stelmachenok <ventureo@yandex.ru>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, o... | 3,644 | Python | .py | 82 | 37.707317 | 187 | 0.674379 | ventureoo/jabagram | 8 | 0 | 1 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,505 | runner.py | ventureoo_jabagram/jabagram/runner.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2024 Vasiliy Stelmachenok <ventureo@yandex.ru>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, o... | 3,857 | Python | .py | 108 | 28.972222 | 78 | 0.652558 | ventureoo/jabagram | 8 | 0 | 1 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,506 | cache.py | ventureoo_jabagram/jabagram/cache.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2024 Vasiliy Stelmachenok <ventureo@yandex.ru>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, o... | 3,083 | Python | .py | 75 | 32.893333 | 141 | 0.604341 | ventureoo/jabagram | 8 | 0 | 1 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,507 | dispatcher.py | ventureoo_jabagram/jabagram/dispatcher.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2024 Vasiliy Stelmachenok <ventureo@yandex.ru>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, o... | 3,633 | Python | .py | 81 | 35.950617 | 82 | 0.642494 | ventureoo/jabagram | 8 | 0 | 1 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,508 | xmpp.py | ventureoo_jabagram/jabagram/xmpp.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2024 Vasiliy Stelmachenok <ventureo@yandex.ru>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, o... | 15,676 | Python | .py | 392 | 28.308673 | 88 | 0.55278 | ventureoo/jabagram | 8 | 0 | 1 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,509 | telegram.py | ventureoo_jabagram/jabagram/telegram.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2024 Vasiliy Stelmachenok <ventureo@yandex.ru>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, o... | 18,935 | Python | .py | 438 | 28.926941 | 100 | 0.517417 | ventureoo/jabagram | 8 | 0 | 1 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,510 | database.py | ventureoo_jabagram/jabagram/database.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2024 Vasiliy Stelmachenok <ventureo@yandex.ru>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, o... | 4,816 | Python | .py | 119 | 31.016807 | 97 | 0.585027 | ventureoo/jabagram | 8 | 0 | 1 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,511 | model.py | ventureoo_jabagram/jabagram/model.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2024 Vasiliy Stelmachenok <ventureo@yandex.ru>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, o... | 2,398 | Python | .py | 76 | 27.460526 | 73 | 0.715588 | ventureoo/jabagram | 8 | 0 | 1 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,512 | steamlink.py | meekys_plugin_program_steamlink/steamlink.py | import getpass
import json
from subprocess import Popen, PIPE, STDOUT
import os
import pathlib
import xbmc
import xbmcgui
from xbmcvfs import translatePath
def launch(addon, hostname=None):
# Check if steamlink is installed and offer to install
if is_steamlink_installed() is False:
update(addon)
... | 10,579 | Python | .py | 228 | 38.118421 | 115 | 0.646715 | meekys/plugin.program.steamlink | 8 | 1 | 1 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,513 | addon.py | meekys_plugin_program_steamlink/addon.py | import sys
import steamlink
import xbmcaddon
# Configure addon
addon = xbmcaddon.Addon()
if (__name__ == '__main__'):
if (len(sys.argv) -1 >= 1):
if (sys.argv[1] == "update"):
steamlink.update(addon)
else:
steamlink.launch(addon) | 267 | Python | .py | 11 | 19.909091 | 37 | 0.611765 | meekys/plugin.program.steamlink | 8 | 1 | 1 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,514 | button.py | courselab_sucury/button.py | class Button():
def __init__(self, image, pos, text_input, font, base_color, hovering_color):
self.image = image
self.x_pos = pos[0]
self.y_pos = pos[1]
self.font = font
self.base_color, self.hovering_color = base_color, hovering_color
self.text_input = text_input
self.text = self.font.render(self.text_i... | 1,167 | Python | .py | 26 | 41.846154 | 117 | 0.726076 | courselab/sucury | 8 | 7 | 61 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,515 | sucury.py | courselab_sucury/sucury.py | #!/usr/bin/python3
#
# Copyright (c) 2023 by Monaco F. J. <monaco@usp.br>
# Copyright (c) 2023 by Sucury Authors
#
# This file is part of Sucury.
#
# Sucury is a derivative work of the code from KhobraPy by Monaco F. J.,
# distributed under GNU GPL vr3. KnobraPy source code can be found at
# https://github.... | 20,752 | Python | .py | 443 | 36.647856 | 126 | 0.59053 | courselab/sucury | 8 | 7 | 61 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,516 | manager_pyproject.toml | bl-sdk_oak-mod-manager/manager_pyproject.toml | # This file is primary for the mod db, the entry for the mod manager points at it
# It is also used by the release script to get the version number
# It *is* ok to edit the version in here before release, the mod db checks the version on the
# actual releases instead
[project]
name = "oak_mod_manager"
version = "1.5"
... | 579 | Python | .py | 13 | 43.384615 | 93 | 0.730496 | bl-sdk/oak-mod-manager | 8 | 2 | 0 | LGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,517 | prepare_release.py | bl-sdk_oak-mod-manager/prepare_release.py | #!/usr/bin/env python3
import re
import shutil
import subprocess
import tomllib
from collections.abc import Iterator, Sequence
from functools import cache
from io import BytesIO
from os import path
from pathlib import Path
from zipfile import ZIP_DEFLATED, ZipFile
THIS_FOLDER = Path(__file__).parent
BASE_MOD = THIS_F... | 9,724 | Python | .py | 246 | 32.146341 | 96 | 0.626434 | bl-sdk/oak-mod-manager | 8 | 2 | 0 | LGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,518 | pick_release_name.py | bl-sdk_oak-mod-manager/pick_release_name.py | #!/usr/bin/env python3
# ruff: noqa: S311
import subprocess
from functools import cache
from pathlib import Path
from random import Random
UNIQUE_ITEM_NAMES = [
"9-Volt",
"AAA",
"ASMD",
"AUTOMAGIC.exe",
"Acid Burn",
"Afterburner",
"Agonizer 1500",
"Alchemist",
"All-in",
"Amalga... | 15,299 | Python | .py | 759 | 15.084321 | 93 | 0.576317 | bl-sdk/oak-mod-manager | 8 | 2 | 0 | LGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,519 | __main__.py | bl-sdk_oak-mod-manager/src/__main__.py | # This file is part of the BL3/WL Oak Mod Manager.
# <https://github.com/bl-sdk/oak-mod-manager>
#
# The Oak Mod Manager is free software: you can redistribute it and/or modify it under the terms of
# the GNU Lesser General Public License Version 3 as published by the Free Software Foundation.
#
# The Oak Mod Manager i... | 15,180 | Python | .py | 325 | 39.636923 | 131 | 0.655567 | bl-sdk/oak-mod-manager | 8 | 2 | 0 | LGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,520 | options_setup.py | bl-sdk_oak-mod-manager/src/bl3_mod_menu/options_setup.py | import functools
from collections.abc import Iterator, Sequence
from dataclasses import dataclass
from typing import Any
import unrealsdk
from unrealsdk import logging
from unrealsdk.hooks import Type
from unrealsdk.unreal import BoundFunction, UObject, WrappedStruct
from mods_base import (
BaseOption,
BoolOp... | 13,174 | Python | .py | 355 | 28.357746 | 99 | 0.620614 | bl-sdk/oak-mod-manager | 8 | 2 | 0 | LGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,521 | outer_menu.py | bl-sdk_oak-mod-manager/src/bl3_mod_menu/outer_menu.py | import re
from typing import Any
import unrealsdk
from unrealsdk.hooks import Block, Type
from unrealsdk.unreal import BoundFunction, UObject, WrappedStruct
from mods_base import BoolOption, Mod, get_ordered_mod_list, hook
from .native.outer_menu import (
add_menu_item,
begin_configure_menu_items,
get_me... | 5,382 | Python | .py | 144 | 32.305556 | 99 | 0.691776 | bl-sdk/oak-mod-manager | 8 | 2 | 0 | LGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,522 | keybinds.py | bl-sdk_oak-mod-manager/src/bl3_mod_menu/keybinds.py | from enum import StrEnum
import unrealsdk
from unrealsdk.unreal import UObject
from keybinds import raw_keybinds
from mods_base import BoolOption, DropdownOption, EInputEvent, KeybindOption, get_pc
from .dialog_box import DialogBox
from .native.options_setup import add_binding
class ControllerIconStyle(StrEnum):
... | 4,966 | Python | .py | 128 | 31.375 | 100 | 0.655704 | bl-sdk/oak-mod-manager | 8 | 2 | 0 | LGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,523 | dialog_box.py | bl-sdk_oak-mod-manager/src/bl3_mod_menu/dialog_box.py | from __future__ import annotations
from dataclasses import InitVar, dataclass, field
from typing import TYPE_CHECKING, Any, ClassVar, Self
from unrealsdk import logging, make_struct
from unrealsdk.hooks import Block, Type
from mods_base import ENGINE, hook
from .native.dialog_box import show_dialog_box
if TYPE_CHE... | 6,326 | Python | .py | 141 | 35.858156 | 99 | 0.647786 | bl-sdk/oak-mod-manager | 8 | 2 | 0 | LGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,524 | __init__.py | bl-sdk_oak-mod-manager/src/bl3_mod_menu/__init__.py | from mods_base import Game, GroupedOption
from mods_base.mod_list import base_mod
__all__: list[str] = [
"__author__",
"__version__",
"__version_info__",
]
__version_info__: tuple[int, int] = (1, 4)
__version__: str = f"{__version_info__[0]}.{__version_info__[1]}"
__author__: str = "bl-sdk"
# Importing ... | 1,343 | Python | .py | 38 | 27.815789 | 89 | 0.601388 | bl-sdk/oak-mod-manager | 8 | 2 | 0 | LGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,525 | options_callbacks.py | bl-sdk_oak-mod-manager/src/bl3_mod_menu/options_callbacks.py | from typing import Any
from unrealsdk.hooks import Block, Type
from unrealsdk.unreal import BoundFunction, UObject, WrappedStruct
from mods_base import (
BaseOption,
BoolOption,
ButtonOption,
DropdownOption,
KeybindOption,
NestedOption,
SliderOption,
SpinnerOption,
hook,
)
from .k... | 2,434 | Python | .py | 73 | 26.315068 | 83 | 0.661708 | bl-sdk/oak-mod-manager | 8 | 2 | 0 | LGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,526 | options_setup.pyi | bl-sdk_oak-mod-manager/src/bl3_mod_menu/native/options_setup.pyi | from unrealsdk.unreal import UObject
type _GFxOptionBase = UObject
__all__: tuple[str, ...] = (
"add_binding",
"add_bool_spinner",
"add_button",
"add_dropdown",
"add_slider",
"add_spinner",
"add_title",
)
def add_title(self: _GFxOptionBase, name: str) -> None:
"""
Adds a title to ... | 4,550 | Python | .py | 137 | 26.284672 | 80 | 0.626109 | bl-sdk/oak-mod-manager | 8 | 2 | 0 | LGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,527 | dialog_box.pyi | bl-sdk_oak-mod-manager/src/bl3_mod_menu/native/dialog_box.pyi | from collections.abc import Callable
from unrealsdk.unreal import UObject, WrappedStruct
def show_dialog_box(self: UObject, callback: Callable[[WrappedStruct], None]) -> None:
"""
Displays a dialog box.
Uses a callback to configure the dialog. This callback takes a single positional
arg, a `GbxGFxDia... | 584 | Python | .py | 12 | 43.583333 | 86 | 0.746032 | bl-sdk/oak-mod-manager | 8 | 2 | 0 | LGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,528 | options_getters.pyi | bl-sdk_oak-mod-manager/src/bl3_mod_menu/native/options_getters.pyi | from unrealsdk.unreal import UObject
type _GbxGFxListItemComboBox = UObject
type _GbxGFxListItemNumber = UObject
type _GbxGFxListItemSpinner = UObject
__all__: tuple[str, ...] = (
"get_combo_box_selected_idx",
"get_number_value",
"get_spinner_selected_idx",
)
def get_combo_box_selected_idx(self: _GbxGFxL... | 889 | Python | .py | 27 | 28.518519 | 69 | 0.701405 | bl-sdk/oak-mod-manager | 8 | 2 | 0 | LGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,529 | outer_menu.pyi | bl-sdk_oak-mod-manager/src/bl3_mod_menu/native/outer_menu.pyi | from collections.abc import Callable
from unrealsdk.unreal import UObject
__all__: tuple[str, ...] = (
"add_menu_item",
"set_add_menu_item_callback",
"begin_configure_menu_items",
"set_menu_state",
"get_menu_state",
)
type _AddMenuItemCallback = Callable[[UObject, str, str, bool, int], int]
type ... | 1,981 | Python | .py | 58 | 28.844828 | 84 | 0.672966 | bl-sdk/oak-mod-manager | 8 | 2 | 0 | LGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,530 | options_transition.pyi | bl-sdk_oak-mod-manager/src/bl3_mod_menu/native/options_transition.pyi | from collections.abc import Callable
from unrealsdk.unreal import UObject
type _GFxMainAndPauseBaseMenu = UObject
type _GFxOptionBase = UObject
__all__: tuple[str, ...] = ("open_custom_options",)
def open_custom_options(
self: _GFxMainAndPauseBaseMenu,
name: str,
callback: Callable[[_GFxOptionBase], Non... | 1,295 | Python | .py | 33 | 34.333333 | 84 | 0.709497 | bl-sdk/oak-mod-manager | 8 | 2 | 0 | LGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,531 | tutorial_message.py | bl-sdk_oak-mod-manager/src/ui_utils/tutorial_message.py | import contextlib
import warnings
from typing import Literal, overload
import unrealsdk
from unrealsdk.unreal import UObject
from mods_base import Game, get_pc
__all__: tuple[str, ...] = (
"KNOWN_BL3_IMAGE_NAMES",
"show_modal_tutorial_message",
)
type KNOWN_BL3_IMAGE_NAMES = Literal[
"ActionSkillTutoria... | 3,348 | Python | .py | 94 | 29.56383 | 98 | 0.662334 | bl-sdk/oak-mod-manager | 8 | 2 | 0 | LGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,532 | __init__.py | bl-sdk_oak-mod-manager/src/ui_utils/__init__.py | from mods_base.mod_list import base_mod
from .hud_message import show_hud_message
from .tutorial_message import show_modal_tutorial_message
__all__: tuple[str, ...] = (
"__author__",
"__version__",
"__version_info__",
"show_hud_message",
"show_modal_tutorial_message",
)
__version_info__: tuple[in... | 657 | Python | .py | 18 | 34.055556 | 81 | 0.679305 | bl-sdk/oak-mod-manager | 8 | 2 | 0 | LGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,533 | hud_message.py | bl-sdk_oak-mod-manager/src/ui_utils/hud_message.py | import threading
from typing import Any
from unrealsdk.hooks import Block, Type
from unrealsdk.unreal import BoundFunction, UObject, WrappedStruct
from mods_base import get_pc, hook
__all__: tuple[str, ...] = ("show_hud_message",)
def show_hud_message(title: str, msg: str, duration: float = 2.5) -> None:
"""
... | 2,754 | Python | .py | 62 | 39.83871 | 98 | 0.731461 | bl-sdk/oak-mod-manager | 8 | 2 | 0 | LGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,534 | raw_keybinds.py | bl-sdk_oak-mod-manager/src/keybinds/raw_keybinds.py | from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from typing import TYPE_CHECKING, cast, overload
from mods_base.keybinds import EInputEvent, KeybindBlockSignal
from .keybinds import deregister_keybind, register_keybind
if TYPE_CHECKING:
from .keybinds im... | 5,923 | Python | .py | 171 | 28.128655 | 99 | 0.664213 | bl-sdk/oak-mod-manager | 8 | 2 | 0 | LGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,535 | __init__.py | bl-sdk_oak-mod-manager/src/keybinds/__init__.py | from functools import wraps
from typing import cast
from mods_base import KeybindType
from mods_base.keybinds import KeybindCallback_Event, KeybindCallback_NoArgs
from mods_base.mod_list import base_mod
from .keybinds import deregister_keybind, register_keybind
__all__: tuple[str, ...] = (
"__author__",
"__v... | 1,991 | Python | .py | 55 | 30.472727 | 76 | 0.672071 | bl-sdk/oak-mod-manager | 8 | 2 | 0 | LGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,536 | keybinds.pyi | bl-sdk_oak-mod-manager/src/keybinds/keybinds.pyi | from __future__ import annotations
from collections.abc import Callable
from typing import NewType, overload
from unrealsdk.hooks import Block
from mods_base import EInputEvent
__all__: tuple[str, ...] = (
"register_keybind",
"deregister_keybind",
)
_KeybindHandle = NewType("_KeybindHandle", object)
type _... | 2,614 | Python | .py | 81 | 28 | 84 | 0.695151 | bl-sdk/oak-mod-manager | 8 | 2 | 0 | LGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,537 | manager_pyproject.toml | bl-sdk_oak-mod-manager/manager_pyproject.toml | # This file is primary for the mod db, the entry for the mod manager points at it
# It is also used by the release script to get the version number
# It *is* ok to edit the version in here before release, the mod db checks the version on the
# actual releases instead
[project]
name = "oak_mod_manager"
version = "1.5"
... | 579 | Python | .pyp | 13 | 43.384615 | 93 | 0.730496 | bl-sdk/oak-mod-manager | 8 | 2 | 0 | LGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,538 | noxfile.py | OpenwaterHealth_OpenLIFU-python/noxfile.py | from __future__ import annotations
import argparse
import shutil
from pathlib import Path
import nox
DIR = Path(__file__).parent.resolve()
nox.needs_version = ">=2024.3.2"
nox.options.sessions = ["lint", "pylint", "tests"]
nox.options.default_venv_backend = "uv|virtualenv"
@nox.session
def lint(session: nox.Sessi... | 2,832 | Python | .py | 93 | 25.043011 | 86 | 0.616661 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,539 | test_nifti.py | OpenwaterHealth_OpenLIFU-python/notebooks/test_nifti.py | # ---
# jupyter:
# jupytext:
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.16.2
# kernelspec:
# display_name: Python 3 (ipykernel)
# language: python
# name: python3
# ---
# %%
mod... | 3,083 | Python | .py | 89 | 32.146067 | 182 | 0.669688 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,540 | test_registers.py | OpenwaterHealth_OpenLIFU-python/notebooks/test_registers.py | # ---
# jupyter:
# jupytext:
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.16.2
# kernelspec:
# display_name: Python 3 (ipykernel)
# language: python
# name: python3
# ---
# %%
imp... | 5,673 | Python | .py | 180 | 28.666667 | 99 | 0.667763 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,541 | test_first.py | OpenwaterHealth_OpenLIFU-python/notebooks/test_first.py | # ---
# jupyter:
# jupytext:
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.16.4
# kernelspec:
# display_name: Python 3 (ipykernel)
# language: python
# name: python3
# ---
# %% [ma... | 5,505 | Python | .py | 107 | 49.336449 | 425 | 0.739349 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,542 | __init__.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/__init__.py | """
Copyright (c) 2023 Openwater. All rights reserved.
openlifu: Openwater Focused Ultrasound Toolkit
"""
from __future__ import annotations
from openlifu.bf import (
ApodizationMethod,
DelayMethod,
FocalPattern,
Pulse,
Sequence,
apod_methods,
delay_methods,
focal_patterns,
get_be... | 1,286 | Python | .py | 65 | 15.8 | 51 | 0.664198 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,543 | _version.pyi | OpenwaterHealth_OpenLIFU-python/src/openlifu/_version.pyi | from __future__ import annotations
version: str
version_tuple: tuple[int, int, int] | tuple[int, int, int, str, str]
| 118 | Python | .py | 3 | 38 | 68 | 0.72807 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,544 | geo.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/geo.py | import copy
import json
from dataclasses import dataclass, field
from typing import Any, Dict, Optional, Tuple
import numpy as np
import vtk
from openlifu.util.units import getunitconversion
@dataclass
class Point:
id: str = "point"
name: str = "Point"
color: Any = (1.0, 0.0, 0.0)
radius: float = 1.... | 5,037 | Python | .py | 118 | 33.194915 | 109 | 0.588043 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,545 | protocol.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/plan/protocol.py | import json
from dataclasses import asdict, dataclass, field
from pathlib import Path
from typing import Any, Dict
import xarray as xa
from openlifu import bf, geo, seg, sim, xdc
@dataclass
class Protocol:
id: str = "protocol"
name: str = "Protocol"
description: str = ""
pulse: bf.Pulse = field(defa... | 3,819 | Python | .py | 82 | 38.378049 | 92 | 0.639538 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,546 | run.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/plan/run.py | import json
from dataclasses import dataclass
from pathlib import Path
from typing import Optional
from openlifu.util.json import PYFUSEncoder
@dataclass
class Run:
"""
Class representing a run
"""
id: Optional[str] = None
"""id: ID of the run"""
success_flag: Optional[bool] = None
"""s... | 2,052 | Python | .py | 60 | 26.766667 | 92 | 0.612462 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,547 | __init__.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/plan/__init__.py | from .protocol import Protocol
from .run import Run
from .solution import Solution
__all__ = [
"Protocol",
"Solution",
"Run",
]
| 141 | Python | .py | 8 | 15 | 30 | 0.681818 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,548 | solution.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/plan/solution.py | import base64
import json
from dataclasses import asdict, dataclass, field
from datetime import datetime
from pathlib import Path
from typing import List, Optional
import numpy as np
import xarray as xa
from openlifu.bf import Pulse, Sequence, mask_focus
from openlifu.bf.mask_focus import MaskOp
from openlifu.geo imp... | 19,079 | Python | .py | 352 | 45.21875 | 141 | 0.637962 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,549 | ustx.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/io/ustx.py | import logging
from dataclasses import dataclass, field
from typing import Dict, List, Literal, Optional, Tuple
import numpy as np
from openlifu.util.units import getunitconversion
NUM_TRANSMITTERS = 2
ADDRESS_GLOBAL_MODE = 0x0
ADDRESS_STANDBY = 0x1
ADDRESS_DYNPWR_2 = 0x6
ADDRESS_LDO_PWR_1 = 0xB
ADDRESS_TRSW_TURNOFF... | 42,897 | Python | .py | 902 | 38.190687 | 179 | 0.64261 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,550 | __init__.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/io/__init__.py | from .ustx import (
DelayProfile,
PulseProfile,
Tx7332Registers,
TxArray,
TxModule,
print_regs,
swap_byte_order,
)
__all__ = [
"PulseProfile",
"DelayProfile",
"Tx7332Registers",
"TxModule",
"TxArray",
"print_regs",
"swap_byte_order",
]
| 293 | Python | .py | 18 | 12.111111 | 22 | 0.616788 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,551 | dict_conversion.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/io/dict_conversion.py | from dataclasses import asdict, dataclass
from typing import Any, Dict, Type, TypeVar
T = TypeVar('T', bound='DictMixin')
@dataclass
class DictMixin:
"""Mixin for basic conversion to and from dict."""
def to_dict(self) -> Dict[str,Any]:
"""
Convert the object to a dictionary
Returns: ... | 778 | Python | .py | 23 | 26.695652 | 73 | 0.633333 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,552 | subject.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/db/subject.py | import json
from dataclasses import dataclass, field
from pathlib import Path
from typing import Optional
from openlifu.io.dict_conversion import DictMixin
from openlifu.util.strings import sanitize
@dataclass
class Subject(DictMixin):
"""
Class representing a subject
ivar id: ID of the subject
ivar... | 1,357 | Python | .py | 42 | 25.47619 | 50 | 0.639357 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,553 | __init__.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/db/__init__.py | from .database import Database
from .session import Session
from .subject import Subject
__all__ = [
"Subject",
"Session",
"Database",
]
| 150 | Python | .py | 8 | 16.125 | 30 | 0.702128 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,554 | database.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/db/database.py |
import glob
import json
import logging
import os
import shutil
from enum import Enum
from pathlib import Path
from typing import List, Optional
import h5py
from openlifu.plan import Protocol, Run, Solution
from openlifu.util.json import PYFUSEncoder
from .session import Session
from .subject import Subject
OnConfl... | 34,639 | Python | .py | 597 | 47.40201 | 135 | 0.653305 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,555 | session.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/db/session.py | import json
from dataclasses import asdict, dataclass, field
from datetime import datetime
from pathlib import Path
from typing import Dict, List, Optional
import numpy as np
from openlifu.geo import Point
from openlifu.util.json import PYFUSEncoder
from openlifu.util.strings import sanitize
@dataclass
class ArrayT... | 6,504 | Python | .py | 147 | 36.442177 | 122 | 0.638032 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,556 | transducer.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/xdc/transducer.py |
import copy
import json
import logging
from dataclasses import dataclass, field
from typing import Any, Dict, List, Optional, Tuple
import numpy as np
import vtk
from openlifu.util.units import getunitconversion
from .element import Element
@dataclass
class Transducer:
id: str = "transducer"
name: str = "... | 8,954 | Python | .py | 196 | 36.163265 | 168 | 0.625186 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,557 | element.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/xdc/element.py | import copy
from collections.abc import Iterable
from dataclasses import dataclass, field
import numpy as np
from openlifu.util.units import getunitconversion
def matrix2xyz(matrix):
x = matrix[0, 3]
y = matrix[1, 3]
z = matrix[2, 3]
az = np.arctan2(matrix[0, 2], matrix[2, 2])
el = -np.arctan2(m... | 6,929 | Python | .py | 179 | 28.564246 | 91 | 0.528162 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,558 | __init__.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/xdc/__init__.py | from . import element, transducer
from .element import Element
from .transducer import Transducer
__all__ = [
"element",
"transducer",
"Element",
"Transducer",
]
| 179 | Python | .py | 9 | 17 | 34 | 0.698225 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,559 | material.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/seg/material.py | from dataclasses import dataclass, field
from typing import Tuple
@dataclass
class Material:
id: str = "material"
name: str = "Material"
sound_speed: float = 1500.0 # m/s
density: float = 1000.0 # kg/m^3
attenuation: float = 0.0 # dB/cm/MHz
specific_heat: float = 4182.0 # J/kg/K
thermal_co... | 4,077 | Python | .py | 99 | 27.181818 | 166 | 0.501639 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,560 | __init__.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/seg/__init__.py | from .material import AIR, MATERIALS, SKULL, STANDOFF, TISSUE, WATER, Material
from .seg_methods import SegmentationMethod
__all__ = [
"Material",
"MATERIALS",
"WATER",
"TISSUE",
"SKULL",
"AIR",
"STANDOFF",
"SegmentationMethod",
]
| 264 | Python | .py | 12 | 18.25 | 78 | 0.657371 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,561 | segment_mri.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/seg/seg_methods/segment_mri.py | from dataclasses import dataclass
import xarray as xa
from openlifu.seg.seg_methods.seg_method import SegmentationMethod
@dataclass
class SegmentMRI(SegmentationMethod):
def _segment(self, volume: xa.DataArray):
raise NotImplementedError
| 254 | Python | .py | 7 | 33 | 66 | 0.82716 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,562 | __init__.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/seg/seg_methods/__init__.py | from . import seg_method
from .seg_method import SegmentationMethod, UniformSegmentation
from .segment_mri import SegmentMRI
from .tissue import Tissue
from .water import Water
__all__ = [
"seg_method",
"SegmentationMethod",
"UniformSegmentation",
"Water",
"Tissue",
"SegmentMRI",
]
| 308 | Python | .py | 13 | 20.769231 | 63 | 0.738095 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,563 | seg_method.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/seg/seg_methods/seg_method.py | import copy
from abc import abstractmethod
from dataclasses import asdict, dataclass, field
from typing import Optional
import numpy as np
import xarray as xa
from openlifu.seg import seg_methods
from openlifu.seg.material import MATERIALS, Material
@dataclass
class SegmentationMethod:
materials: dict[str,Mater... | 3,797 | Python | .py | 79 | 38.746835 | 173 | 0.639946 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,564 | tissue.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/seg/seg_methods/tissue.py | from dataclasses import dataclass
from openlifu.seg.seg_methods.seg_method import UniformSegmentation
@dataclass
class Tissue(UniformSegmentation):
ref_material: str = "tissue"
| 184 | Python | .py | 5 | 34.4 | 67 | 0.840909 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,565 | water.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/seg/seg_methods/water.py | from dataclasses import dataclass
from openlifu.seg.seg_methods.seg_method import UniformSegmentation
@dataclass
class Water(UniformSegmentation):
ref_material: str = "water"
| 182 | Python | .py | 5 | 34 | 67 | 0.83908 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,566 | get_beamwidth.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/bf/get_beamwidth.py | import logging
from dataclasses import dataclass
from typing import Any, Dict
import numpy as np
from scipy.spatial import ConvexHull, QhullError # pylint: disable = no-name-in-module
from xarray import DataArray
from openlifu.bf import offset_grid
from openlifu.geo import Point
from openlifu.util.units import getun... | 5,851 | Python | .py | 122 | 39.778689 | 147 | 0.642044 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,567 | pulse.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/bf/pulse.py | from dataclasses import dataclass
import numpy as np
import pandas as pd
from openlifu.io.dict_conversion import DictMixin
@dataclass
class Pulse(DictMixin):
"""
Class for representing a sinusoidal pulse
:ivar frequency: Frequency of the pulse in Hz
:ivar amplitude: Amplitude of the pulse in Pa
... | 1,476 | Python | .py | 38 | 31.473684 | 80 | 0.625526 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,568 | sequence.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/bf/sequence.py | from dataclasses import dataclass
import pandas as pd
from openlifu.io.dict_conversion import DictMixin
@dataclass
class Sequence(DictMixin):
"""
Class for representing a sequence of pulses
:ivar pulse_interval: Interval between pulses in the sequence (s)
:ivar pulse_count: Number of pulses in the ... | 1,218 | Python | .py | 28 | 36.821429 | 94 | 0.650888 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,569 | __init__.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/bf/__init__.py | from .apod_methods import ApodizationMethod
from .delay_methods import DelayMethod
from .focal_patterns import FocalPattern, SinglePoint, Wheel
from .get_beamwidth import get_beamwidth
from .mask_focus import mask_focus
from .offset_grid import offset_grid
from .pulse import Pulse
from .sequence import Sequence
__all_... | 510 | Python | .py | 20 | 22.45 | 60 | 0.742331 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,570 | mask_focus.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/bf/mask_focus.py | from enum import Enum
from math import inf
from typing import Tuple
import numpy as np
from xarray import Dataset
from openlifu.bf.offset_grid import offset_grid
from openlifu.geo import Point
from openlifu.util.units import get_ndgrid_from_arr, rescale_coords
MaskOp = Enum("MaskOp", ["GREATER", "GREATER_EQUAL", "LE... | 2,777 | Python | .py | 64 | 36.609375 | 112 | 0.656678 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,571 | offset_grid.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/bf/offset_grid.py | import numpy as np
from xarray import Dataset
from openlifu.geo import Point
from openlifu.util.units import get_ndgrid_from_arr
def offset_grid(data_arr: Dataset, focus: Point):
"""
Calculates the distance from the focus point for each point in the coordinate system.
Distances are returned from a coord... | 959 | Python | .py | 22 | 38.227273 | 99 | 0.691066 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,572 | uniform.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/bf/apod_methods/uniform.py | from dataclasses import dataclass
from typing import Optional
import numpy as np
import xarray as xa
from openlifu.bf.apod_methods import ApodizationMethod
from openlifu.geo import Point
from openlifu.xdc import Transducer
@dataclass
class Uniform(ApodizationMethod):
value = 1
def calc_apodization(self, arr... | 461 | Python | .py | 12 | 35.75 | 120 | 0.808989 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,573 | apodmethod.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/bf/apod_methods/apodmethod.py | from abc import ABC, abstractmethod
from dataclasses import dataclass
from typing import Optional
import numpy as np
import xarray as xa
from openlifu.bf import apod_methods
from openlifu.geo import Point
from openlifu.xdc import Transducer
@dataclass
class ApodizationMethod(ABC):
@abstractmethod
def calc_a... | 801 | Python | .py | 24 | 28.291667 | 120 | 0.699092 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,574 | maxangle.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/bf/apod_methods/maxangle.py | from dataclasses import dataclass
from typing import Optional
import numpy as np
import xarray as xa
from openlifu.bf.apod_methods import ApodizationMethod
from openlifu.geo import Point
from openlifu.xdc import Transducer
@dataclass
class MaxAngle(ApodizationMethod):
max_angle: float = 30.0
units: str = "d... | 800 | Python | .py | 18 | 39.888889 | 129 | 0.733933 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,575 | __init__.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/bf/apod_methods/__init__.py | from .apodmethod import ApodizationMethod
from .maxangle import MaxAngle
from .piecewiselinear import PiecewiseLinear
from .uniform import Uniform
__all__ = [
"ApodizationMethod",
"Uniform",
"MaxAngle",
"PiecewiseLinear",
]
| 241 | Python | .py | 10 | 21.4 | 44 | 0.769565 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,576 | piecewiselinear.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/bf/apod_methods/piecewiselinear.py | from dataclasses import dataclass
from typing import Optional
import numpy as np
import xarray as xa
from openlifu.bf.apod_methods import ApodizationMethod
from openlifu.geo import Point
from openlifu.xdc import Transducer
@dataclass
class PiecewiseLinear(ApodizationMethod):
zero_angle: float = 90.0
rolloff... | 926 | Python | .py | 20 | 41.5 | 129 | 0.720621 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,577 | delaymethod.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/bf/delay_methods/delaymethod.py | from abc import ABC, abstractmethod
from dataclasses import dataclass
from typing import Optional
import numpy as np
import xarray as xa
from openlifu.bf import delay_methods
from openlifu.geo import Point
from openlifu.xdc import Transducer
@dataclass
class DelayMethod(ABC):
@abstractmethod
def calc_delays... | 792 | Python | .py | 24 | 27.916667 | 115 | 0.695538 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,578 | direct.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/bf/delay_methods/direct.py | from dataclasses import dataclass
from typing import Optional
import numpy as np
import xarray as xa
from openlifu.bf.delay_methods import DelayMethod
from openlifu.geo import Point
from openlifu.xdc import Transducer
@dataclass
class Direct(DelayMethod):
c0: float = 1480.0
def calc_delays(self, arr: Transd... | 843 | Python | .py | 21 | 34.380952 | 130 | 0.694377 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,579 | __init__.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/bf/delay_methods/__init__.py | from .delaymethod import DelayMethod
from .direct import Direct
__all__ = [
"DelayMethod",
"Direct",
]
| 112 | Python | .py | 6 | 16.166667 | 36 | 0.704762 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,580 | __init__.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/bf/focal_patterns/__init__.py | from .focal_pattern import FocalPattern
from .single import SinglePoint
from .wheel import Wheel
__all__ = [
"FocalPattern",
"SinglePoint",
"Wheel",
]
| 164 | Python | .py | 8 | 17.875 | 39 | 0.722581 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,581 | single.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/bf/focal_patterns/single.py | from dataclasses import dataclass
from openlifu.bf.focal_patterns import FocalPattern
from openlifu.geo import Point
@dataclass
class SinglePoint(FocalPattern):
"""
Class for representing a single focus
:ivar target_pressure: Target pressure of the focal pattern in Pa
"""
def get_targets(self, t... | 689 | Python | .py | 22 | 24.909091 | 69 | 0.662121 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,582 | focal_pattern.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/bf/focal_patterns/focal_pattern.py | from abc import ABC, abstractmethod
from dataclasses import dataclass
from openlifu.bf import focal_patterns
from openlifu.geo import Point
@dataclass
class FocalPattern(ABC):
"""
Abstract base class for representing a focal pattern
:ivar target_pressure: Target pressure of the focal pattern in Pa
"... | 1,444 | Python | .py | 46 | 24.217391 | 69 | 0.628427 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,583 | wheel.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/bf/focal_patterns/wheel.py | from dataclasses import dataclass
import numpy as np
from openlifu.bf.focal_patterns import FocalPattern
from openlifu.geo import Point
@dataclass
class Wheel(FocalPattern):
"""
Class for representing a wheel pattern
:ivar target_pressure: Target pressure of the focal pattern in Pa
:ivar center: Wh... | 1,929 | Python | .py | 48 | 30.583333 | 94 | 0.598291 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,584 | strings.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/util/strings.py | import re
from typing import Literal
Cases = Literal['lower', 'upper', 'same', 'snake', 'camel', 'pascal', 'cobra', 'title', 'sentence']
def sanitize(in_str, case: Cases ='snake'):
stripped = ''.join(re.findall(r'[\w\s]+', in_str))
words = re.findall(r'\w+', stripped)
if case.lower() == 'lower':
... | 1,643 | Python | .py | 35 | 40.228571 | 99 | 0.55798 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,585 | units.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/util/units.py | import numpy as np
from xarray import Dataset
#TODO: use Pint (https://github.com/hgrecco/pint) instead to manage physics units in python
def getunittype(unit):
unit = unit.lower()
if unit in ['micron', 'microns']:
return 'distance'
elif unit in ['minute', 'minutes', 'min', 'mins', 'hour', 'hours'... | 7,781 | Python | .py | 204 | 28.5 | 110 | 0.541125 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,586 | json.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/util/json.py | import json
from datetime import datetime
from pathlib import Path
import numpy as np
from openlifu.db.subject import Subject
from openlifu.geo import Point
from openlifu.seg.material import Material
from openlifu.xdc.element import Element
from openlifu.xdc.transducer import Transducer
class PYFUSEncoder(json.JSON... | 1,260 | Python | .py | 36 | 27.75 | 56 | 0.662018 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,587 | sim_setup.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/sim/sim_setup.py | import logging
from dataclasses import dataclass, field
from typing import Optional, Tuple
import numpy as np
import xarray as xa
from openlifu.io.dict_conversion import DictMixin
from openlifu.util.units import getunitconversion
from openlifu.xdc import Transducer
@dataclass
class SimSetup(DictMixin):
dims: Tu... | 5,490 | Python | .py | 98 | 48.153061 | 141 | 0.635806 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,588 | kwave_if.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/sim/kwave_if.py | import logging
from typing import List, Optional
import kwave
import kwave.data
import numpy as np
import xarray as xa
from kwave.kgrid import kWaveGrid
from kwave.kmedium import kWaveMedium
from kwave.ksensor import kSensor
from kwave.ksource import kSource
from kwave.kspaceFirstOrder3D import kspaceFirstOrder3D
from... | 5,474 | Python | .py | 118 | 35.474576 | 85 | 0.596409 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,589 | __init__.py | OpenwaterHealth_OpenLIFU-python/src/openlifu/sim/__init__.py | from . import kwave_if
from .kwave_if import run_simulation
from .sim_setup import SimSetup
__all__ = [
"SimSetup",
"run_simulation",
"kwave_if",
]
| 161 | Python | .py | 8 | 17.5 | 36 | 0.684211 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,590 | conf.py | OpenwaterHealth_OpenLIFU-python/docs/conf.py | # Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master... | 2,068 | Python | .py | 61 | 31.377049 | 87 | 0.68656 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,591 | test_point.py | OpenwaterHealth_OpenLIFU-python/tests/test_point.py |
import numpy as np
import pytest
from helpers import dataclasses_are_equal
from openlifu import Point
@pytest.fixture()
def example_point() -> Point:
return Point(
id = "example_point",
name="Example point",
color=(0.,0.7, 0.2),
radius=1.5,
position=np.array([-10.,0,25]),... | 922 | Python | .py | 22 | 37.045455 | 111 | 0.698324 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,592 | test_package.py | OpenwaterHealth_OpenLIFU-python/tests/test_package.py | from __future__ import annotations
import importlib.metadata
import openlifu as m
def test_version():
assert importlib.metadata.version("openlifu") == m.__version__
| 173 | Python | .py | 5 | 32 | 66 | 0.77439 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,593 | test_transducer.py | OpenwaterHealth_OpenLIFU-python/tests/test_transducer.py | from pathlib import Path
import numpy as np
import pytest
from helpers import dataclasses_are_equal
from openlifu import Transducer
@pytest.fixture()
def example_transducer() -> Transducer:
return Transducer.from_file(Path(__file__).parent/'resources/example_db/transducers/example_transducer/example_transducer.... | 1,791 | Python | .py | 41 | 38.170732 | 132 | 0.713957 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,594 | test_offset_grid.py | OpenwaterHealth_OpenLIFU-python/tests/test_offset_grid.py | import numpy as np
import pytest
from xarray import DataArray, Dataset
from openlifu.bf import offset_grid
from openlifu.geo import Point
@pytest.fixture()
def example_focus() -> DataArray:
return Point(
id="test_focus_point",
radius=1.,
position=np.array([0.5, 0.5, 0.5]),
dims=("... | 2,412 | Python | .py | 54 | 35.62963 | 93 | 0.5629 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,595 | test_geo.py | OpenwaterHealth_OpenLIFU-python/tests/test_geo.py | import numpy as np
from openlifu.geo import Point
def test_point_from_dict():
point = Point.from_dict({'position' : [10,20,30],})
assert (point.position == np.array([10,20,30], dtype=float)).all()
| 208 | Python | .py | 5 | 38.4 | 70 | 0.69 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,596 | test_protocol.py | OpenwaterHealth_OpenLIFU-python/tests/test_protocol.py | from pathlib import Path
import pytest
from openlifu import Protocol
@pytest.fixture()
def example_protocol() -> Protocol:
return Protocol.from_file(Path(__file__).parent/'resources/example_db/protocols/example_protocol/example_protocol.json')
@pytest.mark.parametrize("compact_representation", [True, False])
d... | 636 | Python | .py | 12 | 50.166667 | 124 | 0.79288 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,597 | test_database.py | OpenwaterHealth_OpenLIFU-python/tests/test_database.py | import logging
import shutil
from contextlib import nullcontext as does_not_raise
from pathlib import Path
from typing import Optional
import pytest
from helpers import dataclasses_are_equal
from openlifu import Point, Solution
from openlifu.db import Session, Subject
from openlifu.db.database import Database, OnConf... | 17,041 | Python | .py | 285 | 54.761404 | 131 | 0.750524 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,598 | test_sequence.py | OpenwaterHealth_OpenLIFU-python/tests/test_sequence.py | from helpers import dataclasses_are_equal
from openlifu import Sequence
def test_dict_undict_sequence():
"""Test that conversion between Sequence and dict works"""
sequence = Sequence(pulse_interval=2, pulse_count=5, pulse_train_interval=1.5, pulse_train_count=3)
reconstructed_sequence = Sequence.from_di... | 410 | Python | .py | 7 | 54.857143 | 103 | 0.785 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,599 | test_units.py | OpenwaterHealth_OpenLIFU-python/tests/test_units.py | import numpy as np
import pytest
from xarray import DataArray, Dataset
from openlifu.util.units import (
get_ndgrid_from_arr,
getsiscale,
rescale_coords,
rescale_data_arr,
)
@pytest.fixture()
def example_xarr() -> Dataset:
rng = np.random.default_rng(147)
return Dataset(
{
... | 2,923 | Python | .py | 67 | 35.955224 | 92 | 0.593805 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |