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,289,900 | tui.py | lauratheq_lazywp/src/tui.py | #!/usr/bin/python3
import curses, sys
from curses.textpad import Textbox
from math import floor
def draw_menu_window(lazywp) -> None:
'''
Draws the window for the menu pad
Returns:
void
'''
# set dimensions
height = lazywp.rows - 2
width = 23
# set color based on context
... | 12,805 | Python | .py | 394 | 25.408629 | 86 | 0.609758 | lauratheq/lazywp | 8 | 1 | 0 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,901 | dashboard.py | lauratheq_lazywp/src/dashboard.py | #!/usr/bin/python3
def get_content(lazywp) -> list:
content = []
content.append([" __ ___ ______ ___ _____"])
content.append([" / / / _ /_ /\\ \\/ / | /| / / _ \\ "])
content.append([" / /__/ __ |/ /_ \\ /| |/ |/ / ___/"])
content.append(["/____/_/ |_/___/ /_/ |__/|__/_/ "])
cont... | 861 | Python | .py | 18 | 42.944444 | 103 | 0.544803 | lauratheq/lazywp | 8 | 1 | 0 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,902 | plugins.py | lauratheq_lazywp/src/commands/plugins.py | #!/usr/bin/python3
import json
def config():
return {
'label': 'Plugins',
'menu': 'Plugins',
'actions': [
['a', 'toggle_activation', 'Toggle activation of a plugin'],
['i', 'install_plugin', 'Install new plugin'],
['r', 'deinstall_plugin', 'Deinstalls an... | 5,485 | Python | .py | 157 | 27.649682 | 97 | 0.603439 | lauratheq/lazywp | 8 | 1 | 0 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,903 | themes.py | lauratheq_lazywp/src/commands/themes.py | #!/usr/bin/python3
import json
def config():
return {
'label': 'Themes',
'menu': 'Themes',
'actions': [
['a', 'toggle_activation', 'Toggle activation of a theme'],
['i', 'install_theme', 'Install new theme'],
['r', 'deinstall_theme', 'Deinstalls and remo... | 5,398 | Python | .py | 157 | 27.095541 | 96 | 0.596811 | lauratheq/lazywp | 8 | 1 | 0 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,904 | setup.py | gmp007_PropertyExtractor/setup.py | """
PropertyExtractor -- LLM-based model to extract material property from unstructured dataset
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
version 3 of the License.
This program is dist... | 892 | Python | .py | 21 | 39.47619 | 92 | 0.793743 | gmp007/PropertyExtractor | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,905 | readin.py | gmp007_PropertyExtractor/src/readin.py | """
PropertyExtract -- LLM-based model to extract material property from unstructured dataset
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
version 3 of the License.
This program is distr... | 7,189 | Python | .py | 166 | 33.614458 | 143 | 0.6112 | gmp007/PropertyExtractor | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,906 | propertyextractor.py | gmp007_PropertyExtractor/src/propertyextractor.py | """
PropertyExtractor -- LLM-based model to extract material property from unstructured dataset
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
version 3 of the License.
This program is dis... | 38,409 | Python | .py | 654 | 45.466361 | 336 | 0.598107 | gmp007/PropertyExtractor | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,907 | writeout.py | gmp007_PropertyExtractor/src/writeout.py | """
PropertyExtractor -- LLM-based model to extract material property from unstructured dataset
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
version 3 of the License.
This program is dis... | 12,033 | Python | .py | 207 | 46.101449 | 195 | 0.547842 | gmp007/PropertyExtractor | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,908 | settings.py | N4GR_Fortnite-Lego-AFK-XP/settings.py | import json
class settings:
class bindings:
def __init__(self) -> None:
with open("bindings.json") as f:
self.bindings = json.load(f)
def getBindings(self) -> dict[str]:
return self.bindings
def setBindings(self, type: str, binding: ... | 1,047 | Python | .py | 23 | 32.478261 | 89 | 0.541877 | N4GR/Fortnite-Lego-AFK-XP | 8 | 1 | 1 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,909 | versioncheck.py | N4GR_Fortnite-Lego-AFK-XP/versioncheck.py | import json
import requests
from log import log
from time import sleep
class get:
def __init__(self) -> None:
with open("version.json") as f:
self.options = json.load(f)
def creatorname(self) -> str:
"""
Retrieves the creators name.
Returns:
str: Exampl... | 3,198 | Python | .py | 84 | 29.22619 | 138 | 0.602869 | N4GR/Fortnite-Lego-AFK-XP | 8 | 1 | 1 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,910 | log.py | N4GR_Fortnite-Lego-AFK-XP/log.py | from datetime import datetime
class log:
def __init__(self) -> None:
now = datetime.now()
self.current_date = now.strftime("%d-%m-%Y %H:%M:%S")
self.red = "\033[31m"
self.green = "\033[32m"
self.yellow = "\033[33m"
self.blue = "\033[34m"
self.end = "\033[0m... | 761 | Python | .py | 16 | 40.25 | 105 | 0.594595 | N4GR/Fortnite-Lego-AFK-XP | 8 | 1 | 1 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,911 | main.py | N4GR_Fortnite-Lego-AFK-XP/main.py | from character import character
from random import randint, choice
from time import sleep
from log import log
class main:
def __init__(self) -> None:
self.player = character()
def movement(self) -> list[object]:
movements = [self.player.forward, self.player.backward, self.player.left, self... | 2,686 | Python | .py | 68 | 27.632353 | 118 | 0.512641 | N4GR/Fortnite-Lego-AFK-XP | 8 | 1 | 1 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,912 | character.py | N4GR_Fortnite-Lego-AFK-XP/character.py | import pyautogui
from settings import settings
class character:
def __init__(self) -> None:
self.bindings = settings.bindings().getBindings()
def forward(self) -> bool:
try:
pyautogui.keyDown(self.bindings["forward"])
return True
except pyautogui.PyAutoGUIExcept... | 1,615 | Python | .py | 49 | 22.265306 | 57 | 0.59052 | N4GR/Fortnite-Lego-AFK-XP | 8 | 1 | 1 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,913 | demo_v3.py | shilapi_DGLAB-python-driver/demo_v3.py | # Description: This is a demo script to show how to use the pydglab library to interact with the DGLab device.
import asyncio
import logging
import pydglab
from pydglab import model_v3
logging.basicConfig(
format="%(module)s [%(levelname)s]: %(message)s", level=logging.DEBUG
)
async def _():
await pydglab.... | 1,044 | Python | .py | 28 | 32.75 | 110 | 0.71556 | shilapi/DGLAB-python-driver | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,914 | demo_v2.py | shilapi_DGLAB-python-driver/demo_v2.py | # Description: This is a demo script to show how to use the pydglab library to interact with the DGLab device.
import asyncio
import logging
import pydglab
from pydglab import model_v2
logging.basicConfig(
format="%(module)s [%(levelname)s]: %(message)s", level=logging.INFO
)
async def _():
await pydglab.s... | 919 | Python | .py | 25 | 32.48 | 110 | 0.720721 | shilapi/DGLAB-python-driver | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,915 | bthandler_v2.py | shilapi_DGLAB-python-driver/pydglab/bthandler_v2.py | import logging
from bleak import BleakClient, BleakScanner
from typing import Tuple, List
from bitstring import BitArray
from pydglab.model_v2 import *
from pydglab.uuid import *
logger = logging.getLogger(__name__)
async def scan():
"""
Scan for DGLAB v2.0 devices and return a list of tuples with the addre... | 3,556 | Python | .py | 87 | 34.954023 | 111 | 0.674688 | shilapi/DGLAB-python-driver | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,916 | uuid.py | shilapi_DGLAB-python-driver/pydglab/uuid.py | # This file contains the UUIDs for the D-LAB ESTIM01 device
from typing import Union
from bleak import BleakGATTCharacteristic
class CoyoteV2(object):
name: str = "D-LAB ESTIM01"
serviceBattery: str = "955a180a-0fe2-f5aa-a094-84b8d4f3e8ad"
characteristicBattery: Union[str, BleakGATTCharacteristic] = (
... | 1,255 | Python | .py | 30 | 36.533333 | 69 | 0.738525 | shilapi/DGLAB-python-driver | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,917 | bthandler_v3.py | shilapi_DGLAB-python-driver/pydglab/bthandler_v3.py | import logging
from bleak import BleakClient, BleakScanner
from typing import Tuple, List
from bitstring import BitArray
from pydglab.model_v3 import *
from pydglab.uuid import *
logger = logging.getLogger(__name__)
async def scan():
"""
Scan for DGLAB v3.0 devices and return a list of tuples with the addre... | 2,808 | Python | .py | 76 | 30.355263 | 111 | 0.666421 | shilapi/DGLAB-python-driver | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,918 | model_v3.py | shilapi_DGLAB-python-driver/pydglab/model_v3.py | from typing import Optional
class ChannelA(object):
def __init__(self):
self.strength: Optional[int] = None
self.wave: Optional[list[int]] = [0, 0, 0, 0]
self.waveStrenth: Optional[list[int]] = [0, 0, 0, 0]
self.coefficientStrenth: Optional[int] = None
self.coefficientFrequ... | 1,270 | Python | .py | 40 | 24.25 | 60 | 0.536825 | shilapi/DGLAB-python-driver | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,919 | __init__.py | shilapi_DGLAB-python-driver/pydglab/__init__.py | import logging, os
LOGFORMAT = "%(module)s [%(levelname)s]: %(message)s"
_logger = logging.getLogger(__name__)
if bool(os.environ.get("BLEAK_LOGGING", False)):
handler = logging.StreamHandler()
handler.setLevel(logging.DEBUG)
handler.setFormatter(logging.Formatter(fmt=LOGFORMAT))
_logger.addHandler(h... | 428 | Python | .py | 11 | 36.090909 | 58 | 0.757869 | shilapi/DGLAB-python-driver | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,920 | model_v2.py | shilapi_DGLAB-python-driver/pydglab/model_v2.py | from typing import Optional
class ChannelA(object):
def __init__(self):
self.strength: Optional[int] = None
self.wave: Optional[bytearray[int]] = bytearray((0, 0, 0))
self.waveX: Optional[int] = self.wave[0]
self.waveY: Optional[int] = self.wave[1]
self.waveZ: Optional[int]... | 1,189 | Python | .py | 39 | 23.025641 | 66 | 0.523643 | shilapi/DGLAB-python-driver | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,921 | service.py | shilapi_DGLAB-python-driver/pydglab/service.py | import logging, asyncio, time
from bleak import BleakClient
from typing import Tuple
import pydglab.model_v2 as model_v2
import pydglab.model_v3 as model_v3
from pydglab.uuid import *
import pydglab.bthandler_v2 as v2
import pydglab.bthandler_v3 as v3
logger = logging.getLogger(__name__)
class dglab(object):
coy... | 27,276 | Python | .py | 639 | 29.406886 | 163 | 0.590551 | shilapi/DGLAB-python-driver | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,922 | input_accordion_highlight.py | w-e-w_sd-webui-input-accordion-highlight/scripts/input_accordion_highlight.py | import gradio as gr
from modules import shared, ui_components
shared.options_templates.update(
shared.options_section(
('ui', 'User interface'),
{
'sd_webui_input_accordion_activate_color_light':
shared.OptionInfo(
'#e12885',
'Inp... | 2,562 | Python | .py | 43 | 46.023256 | 228 | 0.619085 | w-e-w/sd-webui-input-accordion-highlight | 8 | 0 | 0 | AGPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,923 | settings.py | The-Golden-At-SRL_CatLendar/settings.py | from enum import Enum
from cat.mad_hatter.decorators import plugin
from pydantic import BaseModel, Field, field_validator
class Languages(Enum):
English = "English"
Italian = "Italian"
class GenerateContext(Enum):
Yes = True
No = False
class MySettings(BaseModel):
language: Languages = La... | 452 | Python | .py | 15 | 26.266667 | 59 | 0.779621 | The-Golden-At-SRL/CatLendar | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,924 | CatLendar.py | The-Golden-At-SRL_CatLendar/CatLendar.py | from pydantic import BaseModel, create_model
import os
import json
from cat.experimental.form import form, CatForm, CatFormState
from cat.log import log
from .calendar import getAvailableDates, bookDate
@form
class CalendarBookingForm(CatForm):
description = "Book an appointment from those available"
js... | 6,506 | Python | .py | 137 | 34.686131 | 184 | 0.600698 | The-Golden-At-SRL/CatLendar | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,925 | calendar.py | The-Golden-At-SRL_CatLendar/calendar.py | import os
import csv
from cat.log import log
csvPath = os.path.join(
os.path.dirname(__file__), "calendar.csv"
)
# Returns available dates
def getAvailableDates():
allDates = []
with open(csvPath, "r") as csvFile:
csvCalendar = csv.DictReader(csvFile)
for row in csvCalendar:... | 1,437 | Python | .py | 42 | 24.02381 | 63 | 0.592166 | The-Golden-At-SRL/CatLendar | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,926 | scenarios.py | enriquetomasmb_nebula/nebula/scenarios.py | import glob
import hashlib
import json
import logging
import math
import os
import shutil
import subprocess
import sys
import textwrap
import time
from datetime import datetime
import docker
from nebula.addons.blockchain.blockchain_deployer import BlockchainDeployer
from nebula.addons.topologymanager import TopologyM... | 44,958 | Python | .py | 875 | 38.721143 | 320 | 0.595132 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,927 | controller.py | enriquetomasmb_nebula/nebula/controller.py | import logging
import os
import re
import signal
import subprocess
import sys
import textwrap
import threading
import time
from dotenv import load_dotenv
import psutil
from watchdog.observers import Observer
from watchdog.events import PatternMatchingEventHandler
from nebula.addons.env import check_environment
from ne... | 29,254 | Python | .py | 617 | 32.549433 | 312 | 0.540754 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,928 | __init__.py | enriquetomasmb_nebula/nebula/__init__.py | __version__ = "1.0.0"
__description__ = "NEBULA: A Platform for Decentralized Federated Learning"
__long_description__ = "NEBULA: A Platform for Decentralized Federated Learning"
__author__ = "Enrique Tomás Martínez Beltrán"
__long_description_content_type__ = "text/markdown"
__keywords__ = "federated learning, decentr... | 424 | Python | .py | 6 | 69.166667 | 143 | 0.771084 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,929 | node.py | enriquetomasmb_nebula/nebula/node.py | import os
import sys
import time
import random
import warnings
import numpy as np
import torch
torch.multiprocessing.set_start_method("spawn", force=True)
# Ignore CryptographyDeprecationWarning (datatime issues with cryptography library)
from cryptography.utils import CryptographyDeprecationWarning
warnings.filter... | 13,886 | Python | .py | 268 | 44.626866 | 203 | 0.700787 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,930 | config.py | enriquetomasmb_nebula/nebula/config/config.py | import json
import logging
import os
from logging import Formatter, FileHandler
CYAN = "\x1b[0;36m"
RESET = "\x1b[0m"
TRAINING_LOGGER = "nebula.training"
class Config:
topology = {}
participant = {}
participants = [] # Configuration of each participant (this information is stored only in the controlle... | 8,737 | Python | .py | 139 | 53.719424 | 218 | 0.674119 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,931 | mender.py | enriquetomasmb_nebula/nebula/config/mender.py | import json
import os
from typing import List
import requests
import logging
import base64
class Mender:
def __init__(self):
self.server = os.environ.get("MENDER_SERVER")
self.user = os.environ.get("MENDER_USER")
self.password = os.environ.get("MENDER_PASSWORD")
self.token = os.e... | 5,896 | Python | .py | 97 | 51.226804 | 180 | 0.619594 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,932 | app.py | enriquetomasmb_nebula/nebula/frontend/app.py | import argparse
import asyncio
import datetime
import io
import json
import logging
import multiprocessing
import os
import time
import requests
import signal
import sys
import zipfile
from urllib.parse import urlencode
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(os.path.join(os.path.di... | 48,135 | Python | .py | 947 | 41.473073 | 196 | 0.646152 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,933 | utils.py | enriquetomasmb_nebula/nebula/frontend/utils.py | import os
class Utils:
def __init__(self):
self.init()
@classmethod
def check_path(cls, base_path, relative_path):
full_path = os.path.normpath(os.path.join(base_path, relative_path))
base_path = os.path.normpath(base_path)
if not full_path.startswith(base... | 404 | Python | .py | 11 | 27.363636 | 76 | 0.641096 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,934 | database.py | enriquetomasmb_nebula/nebula/frontend/database.py | import datetime
import sqlite3
import datetime
from argon2 import PasswordHasher
import sqlite3
import asyncio
import aiosqlite
user_db_file_location = "databases/users.db"
node_db_file_location = "databases/nodes.db"
scenario_db_file_location = "databases/scenarios.db"
notes_db_file_location = "databases/notes.db"
_... | 16,617 | Python | .py | 390 | 33.448718 | 226 | 0.602303 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,935 | mobility.py | enriquetomasmb_nebula/nebula/addons/mobility.py | import asyncio
import logging
import random
import math
import time
from nebula.addons.functions import print_msg_box
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from nebula.core.network.communications import CommunicationsManager
class Mobility:
def __init__(self, config, cm: "CommunicationsManager")... | 11,702 | Python | .py | 168 | 55.982143 | 271 | 0.646315 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,936 | env.py | enriquetomasmb_nebula/nebula/addons/env.py | import logging
import os
import re
import sys
import platform
import requests
from nebula import __version__
def check_version():
# Check version of NEBULA (__version__ is defined in __init__.py) and compare with __version__ in https://raw.githubusercontent.com/enriquetomasmb/nebula/main/nebula/__init__.py
l... | 4,151 | Python | .py | 84 | 39.214286 | 181 | 0.613468 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,937 | functions.py | enriquetomasmb_nebula/nebula/addons/functions.py | import logging
def print_msg_box(msg, indent=1, width=None, title=None, logger_name=None):
"""Print message-box with optional title."""
if logger_name:
logger = logging.getLogger(logger_name)
else:
logger = logging.getLogger()
if not isinstance(msg, str):
raise TypeErr... | 1,031 | Python | .py | 24 | 34.791667 | 77 | 0.579815 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,938 | topologymanager.py | enriquetomasmb_nebula/nebula/addons/topologymanager.py | import random
import logging
import matplotlib
import matplotlib.pyplot as plt
matplotlib.use("Agg")
plt.switch_backend("Agg")
import networkx as nx
import numpy as np
from nebula.core.role import Role
class TopologyManager:
def __init__(
self,
scenario_name=None,
n_nodes=5,
b_sy... | 11,231 | Python | .py | 251 | 34.023904 | 125 | 0.577022 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,939 | reporter.py | enriquetomasmb_nebula/nebula/addons/reporter.py | import asyncio
import importlib
import json
import logging
import aiohttp
import sys
import psutil
import os
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from nebula.core.network.communications import CommunicationsManager
class Reporter:
def __init__(self, config, trainer, cm: "CommunicationsManager")... | 9,520 | Python | .py | 179 | 40.223464 | 170 | 0.599957 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,940 | attacks.py | enriquetomasmb_nebula/nebula/addons/attacks/attacks.py | from typing import Any
import torch
import numpy as np
from torchmetrics.functional import pairwise_cosine_similarity
from copy import deepcopy
import logging
# To take into account:
# - Malicious nodes do not train on their own data
# - Malicious nodes aggregate the weights of the other nodes, but not their own
# - ... | 5,210 | Python | .py | 119 | 36.554622 | 111 | 0.662584 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,941 | datapoison.py | enriquetomasmb_nebula/nebula/addons/attacks/poisoning/datapoison.py | import copy
import random
import numpy as np
import torch
from skimage.util import random_noise
def datapoison(dataset, indices, poisoned_persent, poisoned_ratio, targeted=False, target_label=3, noise_type="salt"):
"""
Function to add random noise of various types to the dataset.
"""
new_dataset = co... | 3,110 | Python | .py | 73 | 33.780822 | 130 | 0.616325 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,942 | labelflipping.py | enriquetomasmb_nebula/nebula/addons/attacks/poisoning/labelflipping.py | import copy
import random
import torch
def labelFlipping(dataset, indices, poisoned_persent=0, targeted=False, target_label=4, target_changed_label=7):
"""
select flipping_persent of labels, and change them to random values.
Args:
dataset: the dataset of training data, torch.util.data.dataset lik... | 1,501 | Python | .py | 37 | 32.756757 | 112 | 0.642466 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,943 | modelpoison.py | enriquetomasmb_nebula/nebula/addons/attacks/poisoning/modelpoison.py | from collections import OrderedDict
import torch
from skimage.util import random_noise
def modelpoison(model: OrderedDict, poisoned_ratio, noise_type="gaussian"):
"""
Function to add random noise of various types to the model parameter.
"""
poisoned_model = OrderedDict()
if type(noise_type) != ty... | 1,440 | Python | .py | 34 | 33.676471 | 126 | 0.625268 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,944 | factsheet.py | enriquetomasmb_nebula/nebula/addons/trustworthiness/factsheet.py | import json
import logging
import os
import glob
import shutil
import datetime
from json import JSONDecodeError
import pickle
import numpy as np
from numpy import NaN
import torch
import pandas as pd
import re
from nebula.core.models.mnist.mlp import MNISTTorchModelMLP, MNISTModelMLP
from nebula.core.models.mnist.cnn ... | 18,192 | Python | .py | 228 | 63.280702 | 793 | 0.617598 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,945 | pillar.py | enriquetomasmb_nebula/nebula/addons/trustworthiness/pillar.py | import logging
from nebula.addons.trustworthiness import calculation
from nebula.addons.trustworthiness.utils import get_input_value
logger = logging.getLogger(__name__)
class TrustPillar:
"""
Class to represent a trust pillar.
Args:
name (string): Name of the pillar.
metrics (dict): Me... | 3,859 | Python | .py | 86 | 33.918605 | 115 | 0.584333 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,946 | calculation.py | enriquetomasmb_nebula/nebula/addons/trustworthiness/calculation.py | import logging
import math
import numbers
import os.path
from datetime import datetime
from math import e
import numpy as np
import shap
import torch.nn
from art.estimators.classification import PyTorchClassifier
from art.metrics import clever_u
from scipy.stats import variation
from torch import nn, optim
import stat... | 13,965 | Python | .py | 358 | 31.307263 | 146 | 0.634484 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,947 | utils.py | enriquetomasmb_nebula/nebula/addons/trustworthiness/utils.py | import ast
import json
import logging
import os
from json import JSONDecodeError
import pickle
import torch
import yaml
from dotmap import DotMap
from scipy.stats import entropy
from torch.utils.data import DataLoader
from hashids import Hashids
import pandas as pd
from os.path import exists
import math
from nebula.add... | 6,803 | Python | .py | 186 | 28.806452 | 166 | 0.612245 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,948 | metric.py | enriquetomasmb_nebula/nebula/addons/trustworthiness/metric.py | import json
import logging
import math
import os
import shutil
from json import JSONDecodeError
import numpy as np
import pandas as pd
from numpy import NaN
from tabulate import tabulate
from nebula.addons.trustworthiness.pillar import TrustPillar
from nebula.addons.trustworthiness.utils import write_results_json
di... | 2,679 | Python | .py | 59 | 36.525424 | 104 | 0.644035 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,949 | blockchain_deployer.py | enriquetomasmb_nebula/nebula/addons/blockchain/blockchain_deployer.py | import os.path
import random
import shutil
import textwrap
import json
from datetime import datetime
from typing import Tuple
from web3 import Web3
from eth_keys import keys
w3 = Web3()
class BlockchainDeployer:
"""
Creates files (docker-compose.yaml and genesis.json) for deploying blockchain network
""... | 12,599 | Python | .py | 288 | 31.388889 | 304 | 0.564614 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,950 | app.py | enriquetomasmb_nebula/nebula/addons/blockchain/oracle/app.py | import datetime
import os
import json
from functools import wraps
from typing import Mapping, List
import requests
from retry import retry
from solcx import compile_standard, install_solc
from web3 import Web3
from eth_account import Account
from flask import Flask, jsonify, request
from web3.middleware import constru... | 15,259 | Python | .py | 330 | 38.475758 | 262 | 0.661036 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,951 | main.py | enriquetomasmb_nebula/nebula/tests/main.py | import json
import logging
import os
import sys
from datetime import datetime
import docker
# Constants
TIMEOUT = 3600
# Detect CTRL+C from parent process
def signal_handler(signal, frame):
logging.info("You pressed Ctrl+C [test]!")
sys.exit(0)
# Create nebula netbase if it does not exist
def create_docke... | 7,178 | Python | .py | 149 | 39.073826 | 147 | 0.601545 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,952 | role.py | enriquetomasmb_nebula/nebula/core/role.py | class Role:
"""
This class defines the participant roles of the platform.
"""
TRAINER = "trainer"
AGGREGATOR = "aggregator"
PROXY = "proxy"
IDLE = "idle"
SERVER = "server"
| 205 | Python | .py | 9 | 18.111111 | 61 | 0.620513 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,953 | engine.py | enriquetomasmb_nebula/nebula/core/engine.py | import asyncio
import logging
import os
import docker
from nebula.addons.functions import print_msg_box
from nebula.addons.attacks.attacks import create_attack
from nebula.addons.reporter import Reporter
from nebula.core.aggregation.aggregator import create_aggregator, create_malicious_aggregator, create_target_aggreg... | 31,053 | Python | .py | 495 | 52.127273 | 167 | 0.66914 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,954 | eventmanager.py | enriquetomasmb_nebula/nebula/core/eventmanager.py | import asyncio
from collections import defaultdict
from functools import wraps
import inspect
import logging
def event_handler(message_type, action):
"""Decorator for registering an event handler."""
def decorator(func):
@wraps(func)
async def async_wrapper(*args, **kwargs):
retu... | 3,290 | Python | .py | 69 | 37.550725 | 94 | 0.641898 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,955 | aggregator.py | enriquetomasmb_nebula/nebula/core/aggregation/aggregator.py | from abc import ABC, abstractmethod
import asyncio
from functools import partial
import logging
from nebula.core.utils.locker import Locker
from nebula.core.pb import nebula_pb2
class AggregatorException(Exception):
pass
def create_aggregator(config, engine):
from nebula.core.aggregation.fedavg import FedAv... | 12,033 | Python | .py | 206 | 48.800971 | 275 | 0.670919 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,956 | fedavg.py | enriquetomasmb_nebula/nebula/core/aggregation/fedavg.py | import gc
import torch
from nebula.core.aggregation.aggregator import Aggregator
class FedAvg(Aggregator):
"""
Aggregator: Federated Averaging (FedAvg)
Authors: McMahan et al.
Year: 2016
"""
def __init__(self, config=None, **kwargs):
super().__init__(config, **kwargs)
def run_agg... | 1,185 | Python | .py | 28 | 32.785714 | 115 | 0.635063 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,957 | krum.py | enriquetomasmb_nebula/nebula/core/aggregation/krum.py | import torch
import numpy
from nebula.core.aggregation.aggregator import Aggregator
class Krum(Aggregator):
"""
Aggregator: Krum
Authors: Peva Blanchard et al.
Year: 2017
Note: https://papers.nips.cc/paper/2017/hash/f4b9ec30ad9f68f89b29639786cb62ef-Abstract.html
"""
def __init__(self, con... | 1,512 | Python | .py | 40 | 26.55 | 98 | 0.535568 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,958 | blockchainReputation.py | enriquetomasmb_nebula/nebula/core/aggregation/blockchainReputation.py | import time
from functools import wraps
import requests
import torch
from typing import Dict, List, Tuple, OrderedDict, Mapping
from eth_account import Account
from web3 import Web3
from web3.middleware import construct_sign_and_send_raw_middleware
from web3.middleware import geth_poa_middleware
from tabulate import... | 22,013 | Python | .py | 449 | 39.536748 | 191 | 0.643464 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,959 | trimmedmean.py | enriquetomasmb_nebula/nebula/core/aggregation/trimmedmean.py | import logging
import torch
import numpy as np
from nebula.core.aggregation.aggregator import Aggregator
class TrimmedMean(Aggregator):
"""
Aggregator: TrimmedMean
Authors: Dong Yin et al et al.
Year: 2021
Note: https://arxiv.org/pdf/1803.01498.pdf
"""
def __init__(self, config=None, beta... | 2,773 | Python | .py | 64 | 31.984375 | 111 | 0.575735 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,960 | dualhistagg.py | enriquetomasmb_nebula/nebula/core/aggregation/dualhistagg.py | import logging
import torch
import torch.nn.functional as F
import numpy as np
from nebula.core.aggregation.aggregator import Aggregator
from nebula.core.utils.helper import cosine_metric
class DualHistAgg(Aggregator):
"""
Aggregator: Dual History Aggregation (DualHistAgg)
Authors: Enrique et al.
Year... | 2,192 | Python | .py | 49 | 36.285714 | 129 | 0.633333 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,961 | fedavgSVM.py | enriquetomasmb_nebula/nebula/core/aggregation/fedavgSVM.py | import numpy as np
from nebula.core.aggregation.aggregator import Aggregator
from sklearn.svm import LinearSVC
class FedAvgSVM(Aggregator):
"""
Aggregator: Federated Averaging (FedAvg)
Authors: McMahan et al.
Year: 2016
Note: This is a modified version of FedAvg for SVMs.
"""
def __init__... | 1,103 | Python | .py | 29 | 30.172414 | 57 | 0.635936 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,962 | median.py | enriquetomasmb_nebula/nebula/core/aggregation/median.py | import torch
import numpy as np
from nebula.core.aggregation.aggregator import Aggregator
class Median(Aggregator):
"""
Aggregator: Median
Authors: Dong Yin et al et al.
Year: 2021
Note: https://arxiv.org/pdf/1803.01498.pdf
"""
def __init__(self, config=None, **kwargs):
super().__... | 2,726 | Python | .py | 63 | 31.84127 | 111 | 0.565382 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,963 | nebulamodel.py | enriquetomasmb_nebula/nebula/core/models/nebulamodel.py | from abc import ABC, abstractmethod
import logging
import torch
from nebula.addons.functions import print_msg_box
import lightning as pl
from torchmetrics.classification import (
MulticlassAccuracy,
MulticlassRecall,
MulticlassPrecision,
MulticlassF1Score,
MulticlassConfusionMatrix,
)
from torchmetr... | 10,929 | Python | .py | 263 | 32.307985 | 158 | 0.609535 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,964 | cnn.py | enriquetomasmb_nebula/nebula/core/models/mnist/cnn.py | import torch
from nebula.core.models.nebulamodel import NebulaModel
class MNISTModelCNN(NebulaModel):
def __init__(
self,
input_channels=1,
num_classes=10,
learning_rate=1e-3,
metrics=None,
confusion_matrix=None,
seed=None,
):
super().__init__(in... | 1,868 | Python | .py | 47 | 30.765957 | 105 | 0.597023 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,965 | mlp.py | enriquetomasmb_nebula/nebula/core/models/mnist/mlp.py | import torch
from nebula.core.models.nebulamodel import NebulaModel
class MNISTModelMLP(NebulaModel):
def __init__(
self,
input_channels=1,
num_classes=10,
learning_rate=1e-3,
metrics=None,
confusion_matrix=None,
seed=None,
):
super().__init__(in... | 1,093 | Python | .py | 31 | 27.387097 | 101 | 0.610218 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,966 | rnn.py | enriquetomasmb_nebula/nebula/core/models/sentiment140/rnn.py | import torch
from nebula.core.models.nebulamodel import NebulaModel
class Sentiment140ModelRNN(NebulaModel):
def __init__(
self,
input_channels=3,
num_classes=10,
learning_rate=1e-3,
metrics=None,
confusion_matrix=None,
seed=None,
):
super().__in... | 1,732 | Python | .py | 40 | 34.925 | 138 | 0.625818 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,967 | cnn.py | enriquetomasmb_nebula/nebula/core/models/sentiment140/cnn.py | import torch
from nebula.core.models.nebulamodel import NebulaModel
import math
class Sentiment140ModelCNN(NebulaModel):
def __init__(
self,
input_channels=3,
num_classes=10,
learning_rate=1e-3,
metrics=None,
confusion_matrix=None,
seed=None,
):
... | 1,872 | Python | .py | 39 | 39.615385 | 154 | 0.627397 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,968 | mlp.py | enriquetomasmb_nebula/nebula/core/models/syscall/mlp.py | import torch
from nebula.core.models.nebulamodel import NebulaModel
class SyscallModelMLP(NebulaModel):
def __init__(
self,
input_channels=3,
num_classes=10,
learning_rate=1e-3,
metrics=None,
confusion_matrix=None,
seed=None,
):
super().__init__(... | 1,340 | Python | .py | 37 | 28.081081 | 101 | 0.611583 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,969 | autoencoder.py | enriquetomasmb_nebula/nebula/core/models/syscall/autoencoder.py | import torch
from nebula.core.models.nebulamodel import NebulaModel
class SyscallModelAutoencoder(NebulaModel):
def __init__(
self,
input_channels=3,
num_classes=10,
learning_rate=1e-3,
metrics=None,
confusion_matrix=None,
seed=None,
):
super()._... | 1,537 | Python | .py | 41 | 29.390244 | 101 | 0.606734 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,970 | svm.py | enriquetomasmb_nebula/nebula/core/models/syscall/svm.py | import torch
from nebula.core.models.nebulamodel import NebulaModel
import torchmetrics
class SyscallModelSGDOneClassSVM(NebulaModel):
def __init__(
self,
input_channels=3,
num_classes=10,
learning_rate=1e-3,
metrics=None,
confusion_matrix=None,
seed=None,
... | 1,966 | Python | .py | 46 | 33.608696 | 101 | 0.610471 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,971 | cnn.py | enriquetomasmb_nebula/nebula/core/models/emnist/cnn.py | import torch
from nebula.core.models.nebulamodel import NebulaModel
class EMNISTModelCNN(NebulaModel):
def __init__(
self,
input_channels=1,
num_classes=10,
learning_rate=1e-3,
metrics=None,
confusion_matrix=None,
seed=None,
):
super().__init__(i... | 1,946 | Python | .py | 48 | 31.520833 | 105 | 0.596083 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,972 | mlp.py | enriquetomasmb_nebula/nebula/core/models/emnist/mlp.py | import torch
from nebula.core.models.nebulamodel import NebulaModel
class EMNISTModelMLP(NebulaModel):
def __init__(
self,
input_channels=1,
num_classes=10,
learning_rate=1e-3,
metrics=None,
confusion_matrix=None,
seed=None,
):
super().__init__(i... | 1,174 | Python | .py | 32 | 28.71875 | 101 | 0.608811 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,973 | _blocks.py | enriquetomasmb_nebula/nebula/core/models/militarysar/_blocks.py | import torch.nn as nn
import collections
_activations = {"relu": nn.ReLU, "relu6": nn.ReLU6, "leaky_relu": nn.LeakyReLU}
class BaseBlock(nn.Module):
def __init__(self):
super(BaseBlock, self).__init__()
self._layer: nn.Sequential
def forward(self, x):
return self._layer(x)
class ... | 2,283 | Python | .py | 53 | 33.849057 | 140 | 0.575566 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,974 | cnn.py | enriquetomasmb_nebula/nebula/core/models/militarysar/cnn.py | import torch
from nebula.core.models.nebulamodel import NebulaModel
from nebula.core.models.militarysar import _blocks
class MilitarySARModelCNN(NebulaModel):
def __init__(
self,
input_channels=2,
num_classes=10,
learning_rate=1e-3,
metrics=None,
confusion_matrix=No... | 2,333 | Python | .py | 51 | 36.941176 | 133 | 0.619947 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,975 | mlp.py | enriquetomasmb_nebula/nebula/core/models/wadi/mlp.py | import torch
from nebula.core.models.nebulamodel import NebulaModel
class WADIModelMLP(NebulaModel):
def __init__(
self,
input_channels=1,
num_classes=10,
learning_rate=1e-3,
metrics=None,
confusion_matrix=None,
seed=None,
):
super().__init__(inp... | 1,760 | Python | .py | 51 | 26.117647 | 101 | 0.566471 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,976 | mlp.py | enriquetomasmb_nebula/nebula/core/models/kitsun/mlp.py | import torch
from nebula.core.models.nebulamodel import NebulaModel
class KitsunModelMLP(NebulaModel):
def __init__(
self,
input_channels=356,
num_classes=10,
learning_rate=1e-3,
metrics=None,
confusion_matrix=None,
seed=None,
):
super().__init__... | 1,561 | Python | .py | 43 | 28.069767 | 101 | 0.606883 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,977 | simplemobilenet.py | enriquetomasmb_nebula/nebula/core/models/cifar10/simplemobilenet.py | import matplotlib
import matplotlib.pyplot as plt
matplotlib.use("Agg")
plt.switch_backend("Agg")
from torch import nn
import torch
from nebula.core.models.nebulamodel import NebulaModel
class SimpleMobileNetV1(NebulaModel):
def __init__(
self,
input_channels=3,
num_classes=10,
... | 2,062 | Python | .py | 59 | 24 | 101 | 0.542671 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,978 | fastermobilenet.py | enriquetomasmb_nebula/nebula/core/models/cifar10/fastermobilenet.py | from torch import nn
from nebula.core.models.nebulamodel import NebulaModel
import torch
class FasterMobileNet(NebulaModel):
def __init__(
self,
input_channels=3,
num_classes=10,
learning_rate=1e-3,
metrics=None,
confusion_matrix=None,
seed=None,
):
... | 2,029 | Python | .py | 58 | 23.362069 | 101 | 0.524198 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,979 | cnn.py | enriquetomasmb_nebula/nebula/core/models/cifar10/cnn.py | import torch
from nebula.core.models.nebulamodel import NebulaModel
class CIFAR10ModelCNN(NebulaModel):
def __init__(
self,
input_channels=3,
num_classes=10,
learning_rate=1e-3,
metrics=None,
confusion_matrix=None,
seed=None,
):
super().__init__(... | 1,542 | Python | .py | 39 | 31 | 101 | 0.59853 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,980 | dualagg.py | enriquetomasmb_nebula/nebula/core/models/cifar10/dualagg.py | import torch
import torch.nn.functional as F
import lightning as pl
from torchmetrics.classification import MulticlassAccuracy, MulticlassRecall, MulticlassPrecision, MulticlassF1Score, MulticlassConfusionMatrix
from torchmetrics import MetricCollection
import matplotlib
import matplotlib.pyplot as plt
import seaborn a... | 19,090 | Python | .py | 380 | 39.307895 | 218 | 0.607141 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,981 | cnnV3.py | enriquetomasmb_nebula/nebula/core/models/cifar10/cnnV3.py | import torch
from nebula.core.models.nebulamodel import NebulaModel
class CIFAR10ModelCNN_V3(NebulaModel):
def __init__(
self,
input_channels=3,
num_classes=10,
learning_rate=1e-3,
metrics=None,
confusion_matrix=None,
seed=None,
):
super().__init... | 2,586 | Python | .py | 68 | 27.602941 | 101 | 0.561977 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,982 | resnet.py | enriquetomasmb_nebula/nebula/core/models/cifar10/resnet.py | from torch import nn
from torchmetrics import MetricCollection
import matplotlib
import matplotlib.pyplot as plt
from nebula.core.models.nebulamodel import NebulaModel
matplotlib.use("Agg")
plt.switch_backend("Agg")
import torch
from torchmetrics.classification import (
MulticlassAccuracy,
MulticlassRecall,
... | 5,276 | Python | .py | 127 | 29.165354 | 102 | 0.563477 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,983 | cnnV2.py | enriquetomasmb_nebula/nebula/core/models/cifar10/cnnV2.py | import torch
from nebula.core.models.nebulamodel import NebulaModel
class CIFAR10ModelCNN_V2(NebulaModel):
def __init__(
self,
input_channels=3,
num_classes=10,
learning_rate=1e-3,
metrics=None,
confusion_matrix=None,
seed=None,
):
super().__init... | 1,784 | Python | .py | 44 | 31.954545 | 101 | 0.602076 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,984 | cnn.py | enriquetomasmb_nebula/nebula/core/models/fashionmnist/cnn.py | import torch
from nebula.core.models.nebulamodel import NebulaModel
class FashionMNISTModelCNN(NebulaModel):
def __init__(
self,
input_channels=1,
num_classes=10,
learning_rate=1e-3,
metrics=None,
confusion_matrix=None,
seed=None,
):
super().__in... | 1,952 | Python | .py | 48 | 31.645833 | 105 | 0.597361 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,985 | mlp.py | enriquetomasmb_nebula/nebula/core/models/fashionmnist/mlp.py | import torch
from nebula.core.models.nebulamodel import NebulaModel
class FashionMNISTModelMLP(NebulaModel):
def __init__(
self,
input_channels=1,
num_classes=10,
learning_rate=1e-3,
metrics=None,
confusion_matrix=None,
seed=None,
):
super().__in... | 1,179 | Python | .py | 32 | 28.875 | 101 | 0.610526 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,986 | cnn.py | enriquetomasmb_nebula/nebula/core/models/cifar100/cnn.py | import torch
from nebula.core.models.nebulamodel import NebulaModel
class CIFAR100ModelCNN(NebulaModel):
def __init__(
self,
input_channels=3,
num_classes=100,
learning_rate=1e-3,
metrics=None,
confusion_matrix=None,
seed=None,
):
super().__init_... | 3,310 | Python | .py | 85 | 27.682353 | 128 | 0.55929 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,987 | nebuladataset.py | enriquetomasmb_nebula/nebula/core/datasets/nebuladataset.py | from abc import ABC, abstractmethod
from collections import defaultdict
import time
import numpy as np
from sklearn.manifold import TSNE
from torch.utils.data import Dataset
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
matplotlib.use("Agg")
plt.switch_backend("Agg")
from nebula.core.utils.de... | 24,115 | Python | .py | 452 | 42.424779 | 254 | 0.637903 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,988 | changeablesubset.py | enriquetomasmb_nebula/nebula/core/datasets/changeablesubset.py | import copy
from torch.utils.data import Subset
from nebula.addons.attacks.poisoning.datapoison import datapoison
from nebula.addons.attacks.poisoning.labelflipping import labelFlipping
class ChangeableSubset(Subset):
def __init__(self, dataset, indices, label_flipping=False, data_poisoning=False, poisoned_pers... | 1,526 | Python | .py | 28 | 46.678571 | 198 | 0.706908 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,989 | datamodule.py | enriquetomasmb_nebula/nebula/core/datasets/datamodule.py | import logging
import torch
from lightning import LightningDataModule
from torch.utils.data import DataLoader, random_split, RandomSampler
from nebula.core.datasets.changeablesubset import ChangeableSubset
from nebula.config.config import TRAINING_LOGGER
logging_training = logging.getLogger(TRAINING_LOGGER)
class Da... | 6,820 | Python | .py | 161 | 30.745342 | 132 | 0.602283 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,990 | mnist.py | enriquetomasmb_nebula/nebula/core/datasets/mnist/mnist.py | import os
from nebula.core.datasets.nebuladataset import NebulaDataset
from torchvision import transforms
from torchvision.datasets import MNIST
class MNISTDataset(NebulaDataset):
def __init__(
self,
num_classes=10,
partition_id=0,
partitions_number=1,
batch_size=32,
... | 3,988 | Python | .py | 80 | 39.7875 | 124 | 0.654906 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,991 | mnist.py | enriquetomasmb_nebula/nebula/core/datasets/mnistML/mnist.py | import os
import sys
import numpy as np
from sklearn.model_selection import train_test_split
from torchvision import transforms
from torchvision.datasets import MNIST
class MNISTDatasetScikit:
mnist_train = None
mnist_val = None
def __init__(self, partition_id=0, partitions_number=1, iid=True):
... | 2,161 | Python | .py | 47 | 35.489362 | 111 | 0.643536 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,992 | sentiment140.py | enriquetomasmb_nebula/nebula/core/datasets/sentiment140/sentiment140.py | import os
import sys
from datasets import load_dataset
from torchvision.datasets import MNIST
from sklearn.model_selection import train_test_split
from torchtext import vocab
import pandas as pd
from torch.nn.functional import pad
from string import punctuation
import random
import torch
from nebula.core.datasets.nebul... | 6,744 | Python | .py | 138 | 39.615942 | 129 | 0.654471 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,993 | syscall.py | enriquetomasmb_nebula/nebula/core/datasets/syscall/syscall.py | import os
import sys
import zipfile
import ast
import pandas as pd
from sklearn.model_selection import train_test_split
from torchvision.datasets import MNIST, utils
import torch
from nebula.core.datasets.nebuladataset import NebulaDataset
class SYSCALL(MNIST):
def __init__(
self,
partition_id,
... | 8,053 | Python | .py | 178 | 34.938202 | 153 | 0.619339 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,994 | emnist.py | enriquetomasmb_nebula/nebula/core/datasets/emnist/emnist.py | import os
from nebula.core.datasets.nebuladataset import NebulaDataset
from torchvision import transforms
from torchvision.datasets import EMNIST
class EMNISTDataset(NebulaDataset):
def __init__(
self,
num_classes=10,
partition_id=0,
partitions_number=1,
batch_size=32,
... | 4,132 | Python | .py | 87 | 37.195402 | 124 | 0.640377 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,995 | militarysar.py | enriquetomasmb_nebula/nebula/core/datasets/militarysar/militarysar.py | import glob
import json
import os
import numpy as np
import logging
import torch
from nebula.core.datasets.nebuladataset import NebulaDataset
from torchvision import transforms
from torch.utils.data import Dataset
from nebula.config.config import TRAINING_LOGGER
logging_training = logging.getLogger(TRAINING_LOGGER)
... | 8,464 | Python | .py | 180 | 37.911111 | 145 | 0.616302 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,996 | wadi.py | enriquetomasmb_nebula/nebula/core/datasets/wadi/wadi.py | import os
import sys
from torchvision.datasets import MNIST
from nebula.core.datasets.nebuladataset import NebulaDataset
import urllib.request
import numpy as np
import torch
class WADI(MNIST):
def __init__(self, partition_id, partitions_number, root_dir, train=True):
super(MNIST, self).__init__(root_dir,... | 5,969 | Python | .py | 123 | 38.073171 | 226 | 0.629063 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,997 | kitsun.py | enriquetomasmb_nebula/nebula/core/datasets/kitsun/kitsun.py | import os
import sys
from torchvision.datasets import MNIST, utils
from nebula.core.datasets.nebuladataset import NebulaDataset
import shutil
import zipfile
import torch
class KITSUN(MNIST):
def __init__(self, train=True):
self.root = f"{sys.path[0]}/data"
self.download = True
self.train =... | 5,903 | Python | .py | 122 | 38.680328 | 149 | 0.643688 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,998 | cifar10.py | enriquetomasmb_nebula/nebula/core/datasets/cifar10/cifar10.py | from nebula.core.datasets.nebuladataset import NebulaDataset
from torchvision import transforms
from torchvision.datasets import CIFAR10
import os
class CIFAR10Dataset(NebulaDataset):
def __init__(
self,
num_classes=10,
partition_id=0,
partitions_number=1,
batch_size=32,
... | 4,180 | Python | .py | 89 | 36.606742 | 124 | 0.640433 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |
2,289,999 | fashionmnist.py | enriquetomasmb_nebula/nebula/core/datasets/fashionmnist/fashionmnist.py | import os
from nebula.core.datasets.nebuladataset import NebulaDataset
from torchvision import transforms
from torchvision.datasets import FashionMNIST
class FashionMNISTDataset(NebulaDataset):
def __init__(
self,
num_classes=10,
partition_id=0,
partitions_number=1,
batch_s... | 3,926 | Python | .py | 79 | 39.64557 | 124 | 0.656381 | enriquetomasmb/nebula | 8 | 2 | 2 | GPL-3.0 | 9/5/2024, 10:48:43 PM (Europe/Amsterdam) |