repo stringlengths 7 90 | file_url stringlengths 81 315 | file_path stringlengths 4 228 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 14:38:15 2026-01-05 02:33:18 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/data_layer/config.py | tests/core/data_layer/config.py | from __future__ import annotations
parallel = 4
job_timeout = 40
checkout_blocks_and_plots = True
| python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/data_layer/__init__.py | tests/core/data_layer/__init__.py | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false | |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/data_layer/test_data_store_schema.py | tests/core/data_layer/test_data_store_schema.py | from __future__ import annotations
import sqlite3
from typing import Any, Dict
import pytest
from flax.data_layer.data_layer_util import NodeType, Side, Status
from flax.data_layer.data_store import DataStore
from flax.types.blockchain_format.tree_hash import bytes32
from tests.core.data_layer.util import add_012345... | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/data_layer/test_data_store.py | tests/core/data_layer/test_data_store.py | from __future__ import annotations
import itertools
import logging
import statistics
from pathlib import Path
from random import Random
from typing import Any, Awaitable, Callable, Dict, List, Set, Tuple
import pytest
from flax.data_layer.data_layer_errors import NodeHashError, TreeGenerationIncrementingError
from f... | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | true |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/ssl/test_ssl.py | tests/core/ssl/test_ssl.py | import asyncio
import aiohttp
import pytest
from flax.protocols.shared_protocol import protocol_version, capabilities
from flax.server.outbound_message import NodeType
from flax.server.server import FlaxServer, ssl_context_for_client
from flax.server.ssl_context import flax_ssl_ca_paths, private_ssl_ca_paths
from fla... | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/ssl/config.py | tests/core/ssl/config.py | from __future__ import annotations
parallel = True
checkout_blocks_and_plots = True
| python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/ssl/__init__.py | tests/core/ssl/__init__.py | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false | |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/consensus/config.py | tests/core/consensus/config.py | from __future__ import annotations
parallel = True
| python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/consensus/__init__.py | tests/core/consensus/__init__.py | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false | |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/consensus/test_pot_iterations.py | tests/core/consensus/test_pot_iterations.py | from __future__ import annotations
from pytest import raises
from flax.consensus.default_constants import DEFAULT_CONSTANTS
from flax.consensus.pos_quality import _expected_plot_size
from flax.consensus.pot_iterations import (
calculate_ip_iters,
calculate_iterations_quality,
calculate_sp_iters,
is_ov... | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/server/test_dos.py | tests/core/server/test_dos.py | # flake8: noqa: F811, F401
import asyncio
import logging
import pytest
from aiohttp import ClientSession, ClientTimeout, ServerDisconnectedError, WSCloseCode, WSMessage, WSMsgType
from flax.full_node.full_node_api import FullNodeAPI
from flax.protocols import full_node_protocol
from flax.protocols.protocol_message_ty... | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/server/test_rate_limits.py | tests/core/server/test_rate_limits.py | import asyncio
from typing import List
import pytest
from flax.protocols.protocol_message_types import ProtocolMessageTypes
from flax.protocols.shared_protocol import Capability
from flax.server.outbound_message import make_msg
from flax.server.rate_limit_numbers import get_rate_limits_to_use, rate_limits as rl_numbe... | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/server/config.py | tests/core/server/config.py | from __future__ import annotations
checkout_blocks_and_plots = True
| python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/server/__init__.py | tests/core/server/__init__.py | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false | |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/server/test_upnp.py | tests/core/server/test_upnp.py | from __future__ import annotations
def test_miniupnpc_imports_successfully() -> None:
import miniupnpc
# use it to avoid all related warnings
assert miniupnpc is not None
| python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/full_node/test_generator_tools.py | tests/core/full_node/test_generator_tools.py | from __future__ import annotations
from typing import List
from flax.types.blockchain_format.coin import Coin
from flax.types.blockchain_format.sized_bytes import bytes32
from flax.types.spend_bundle_conditions import Spend, SpendBundleConditions
from flax.util.generator_tools import tx_removals_and_additions
from fl... | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/full_node/test_transactions.py | tests/core/full_node/test_transactions.py | from __future__ import annotations
import asyncio
from secrets import token_bytes
from typing import Optional
import pytest
from flax.consensus.block_record import BlockRecord
from flax.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward
from flax.full_node.full_node_api import FullNod... | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/full_node/test_peer_store_resolver.py | tests/core/full_node/test_peer_store_resolver.py | from __future__ import annotations
import os
from pathlib import Path
from typing import Dict
from flax.server.peer_store_resolver import PeerStoreResolver
class TestPeerStoreResolver:
# use tmp_path pytest fixture to create a temporary directory
def test_resolve_unmodified_legacy_peer_db_path(self, tmp_pat... | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/full_node/test_full_node.py | tests/core/full_node/test_full_node.py | import asyncio
import dataclasses
import random
import time
from secrets import token_bytes
from typing import Dict, Optional, List
import pytest
from blspy import G2Element, AugSchemeMPL, PrivateKey
from clvm.casts import int_to_bytes
from flax.consensus.pot_iterations import is_overflow_block
from flax.full_node.bu... | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | true |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/full_node/test_address_manager.py | tests/core/full_node/test_address_manager.py | from __future__ import annotations
import math
import time
from pathlib import Path
import pytest
from flax.server.address_manager import AddressManager, ExtendedPeerInfo
from flax.server.address_manager_store import AddressManagerStore
from flax.types.peer_info import PeerInfo, TimestampedPeerInfo
from flax.util.in... | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/full_node/test_mempool_performance.py | tests/core/full_node/test_mempool_performance.py | # flake8: noqa: F811, F401
import logging
import pytest
from flax.protocols import full_node_protocol
from flax.types.peer_info import PeerInfo
from flax.util.ints import uint16
from flax.wallet.transaction_record import TransactionRecord
from flax.wallet.wallet_node import WalletNode
from tests.connection_utils imp... | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/full_node/test_mempool.py | tests/core/full_node/test_mempool.py | import dataclasses
import logging
from typing import Dict, List, Optional, Tuple, Callable
from clvm.casts import int_to_bytes
import pytest
import flax.server.ws_connection as ws
from flax.full_node.mempool import Mempool
from flax.full_node.full_node_api import FullNodeAPI
from flax.protocols import full_node_pro... | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | true |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/full_node/test_block_height_map.py | tests/core/full_node/test_block_height_map.py | import pytest
import struct
from flax.full_node.block_height_map import BlockHeightMap, SesCache
from flax.types.blockchain_format.sub_epoch_summary import SubEpochSummary
from flax.util.db_wrapper import DBWrapper2
from tests.util.db_connection import DBConnection
from flax.types.blockchain_format.sized_bytes import ... | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/full_node/test_mempool_fee_protocol.py | tests/core/full_node/test_mempool_fee_protocol.py | from __future__ import annotations
import datetime
from typing import List, Tuple, Union
import pytest
from flax.full_node.full_node_api import FullNodeAPI
from flax.protocols import full_node_protocol, wallet_protocol
from flax.protocols.protocol_message_types import ProtocolMessageTypes
from flax.protocols.wallet_... | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/full_node/test_hint_management.py | tests/core/full_node/test_hint_management.py | from __future__ import annotations
from typing import List, Optional
import pytest
from flax.consensus.block_record import BlockRecord
from flax.consensus.blockchain import Blockchain, StateChangeSummary
from flax.consensus.cost_calculator import NPCResult
from flax.full_node.hint_management import get_hints_and_sub... | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/full_node/conftest.py | tests/core/full_node/conftest.py | from __future__ import annotations
import asyncio
from typing import Iterator
import pytest
# This is an optimization to reduce runtime by reducing setup and teardown on the
# wallet nodes fixture below.
# https://github.com/pytest-dev/pytest-asyncio/blob/v0.18.1/pytest_asyncio/plugin.py#L479-L484
@pytest.fixture(s... | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/full_node/test_node_load.py | tests/core/full_node/test_node_load.py | from __future__ import annotations
import pytest
from flax.protocols import full_node_protocol
from flax.simulator.time_out_assert import time_out_assert
from flax.types.peer_info import PeerInfo
from flax.util.ints import uint16
from tests.connection_utils import connect_and_get_peer
from tests.util.misc import asse... | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/full_node/test_conditions.py | tests/core/full_node/test_conditions.py | """
These are quick-to-run test that check spends can be added to the blockchain when they're valid
or that they're failing for the right reason when they're invalid.
"""
import logging
import time
from typing import List, Optional, Tuple
import pytest
from blspy import G2Element
from clvm_tools.binutils import as... | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/full_node/config.py | tests/core/full_node/config.py | # flake8: noqa: E501
from __future__ import annotations
parallel = True
job_timeout = 50
check_resource_usage = True
checkout_blocks_and_plots = True
os_skip = ["windows"]
| python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/full_node/__init__.py | tests/core/full_node/__init__.py | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false | |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/full_node/test_performance.py | tests/core/full_node/test_performance.py | # flake8: noqa: F811, F401
import cProfile
import dataclasses
import logging
import random
from typing import Dict
import pytest
from clvm.casts import int_to_bytes
from flax.consensus.block_record import BlockRecord
from flax.consensus.pot_iterations import is_overflow_block
from flax.full_node.full_node_api import ... | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/full_node/ram_db.py | tests/core/full_node/ram_db.py | from typing import Tuple
from pathlib import Path
import random
from flax.consensus.blockchain import Blockchain
from flax.consensus.constants import ConsensusConstants
from flax.full_node.block_store import BlockStore
from flax.full_node.coin_store import CoinStore
from flax.util.db_wrapper import DBWrapper2
async... | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/full_node/stores/test_full_node_store.py | tests/core/full_node/stores/test_full_node_store.py | import logging
from secrets import token_bytes
from typing import List, Optional
import pytest
import pytest_asyncio
from flax.consensus.blockchain import ReceiveBlockResult
from flax.consensus.find_fork_point import find_fork_point_in_chain
from flax.consensus.multiprocess_validation import PreValidationResult
from ... | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | true |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/full_node/stores/test_coin_store.py | tests/core/full_node/stores/test_coin_store.py | import logging
from typing import List, Optional, Set, Tuple
import pytest
from flax.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward
from flax.consensus.blockchain import Blockchain, ReceiveBlockResult
from flax.consensus.coinbase import create_farmer_coin, create_pool_coin
from fla... | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/full_node/stores/test_block_store.py | tests/core/full_node/stores/test_block_store.py | import asyncio
from flax.types.blockchain_format.sized_bytes import bytes32
from flax.types.full_block import FullBlock
import logging
import random
import sqlite3
import dataclasses
import pytest
from clvm.casts import int_to_bytes
from flax.consensus.blockchain import Blockchain
from flax.consensus.full_block_to_bl... | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/full_node/stores/test_hint_store.py | tests/core/full_node/stores/test_hint_store.py | import logging
import pytest
from clvm.casts import int_to_bytes
from flax.full_node.hint_store import HintStore
from flax.protocols.full_node_protocol import RespondBlock
from flax.types.blockchain_format.coin import Coin
from flax.types.blockchain_format.sized_bytes import bytes32
from flax.types.condition_opcodes i... | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/full_node/stores/test_sync_store.py | tests/core/full_node/stores/test_sync_store.py | from __future__ import annotations
import pytest
from flax.full_node.sync_store import SyncStore
from flax.util.hash import std_hash
class TestStore:
@pytest.mark.asyncio
async def test_basic_store(self):
store = SyncStore()
# Save/get sync
for sync_mode in (False, True):
... | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/full_node/stores/config.py | tests/core/full_node/stores/config.py | # flake8: noqa: E501
from __future__ import annotations
parallel = True
job_timeout = 40
check_resource_usage = True
checkout_blocks_and_plots = True
| python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/full_node/stores/__init__.py | tests/core/full_node/stores/__init__.py | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false | |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/full_node/dos/config.py | tests/core/full_node/dos/config.py | from __future__ import annotations
parallel = True
job_timeout = 60
| python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/full_node/dos/__init__.py | tests/core/full_node/dos/__init__.py | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false | |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/full_node/full_sync/config.py | tests/core/full_node/full_sync/config.py | from __future__ import annotations
job_timeout = 60
parallel = True
checkout_blocks_and_plots = True
| python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/full_node/full_sync/test_full_sync.py | tests/core/full_node/full_sync/test_full_sync.py | # flake8: noqa: F811, F401
import asyncio
import logging
import time
from typing import List
from unittest.mock import MagicMock
import pytest
from flax.protocols import full_node_protocol
from flax.types.blockchain_format.sub_epoch_summary import SubEpochSummary
from flax.types.full_block import FullBlock
from flax.... | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/full_node/full_sync/__init__.py | tests/core/full_node/full_sync/__init__.py | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false | |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/daemon/test_daemon.py | tests/core/daemon/test_daemon.py | import aiohttp
import asyncio
import json
import logging
import pytest
from dataclasses import dataclass, replace
from typing import Any, Dict, List, Optional, Type, Union, cast
from flax.daemon.keychain_server import DeleteLabelRequest, SetLabelRequest
from flax.daemon.server import WebSocketServer, service_plotter
... | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/daemon/config.py | tests/core/daemon/config.py | from __future__ import annotations
install_timelord = True
checkout_blocks_and_plots = True
| python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/daemon/__init__.py | tests/core/daemon/__init__.py | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false | |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/cmds/test_wallet.py | tests/core/cmds/test_wallet.py | from __future__ import annotations
from typing import Any, Dict, Optional, Tuple
import pytest
from flax.cmds.wallet_funcs import print_offer_summary
from flax.types.blockchain_format.sized_bytes import bytes32
from flax.util.ints import uint32
TEST_DUCKSAUCE_ASSET_ID = "10000000000000000000000000000000000000000000... | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/cmds/test_keys.py | tests/core/cmds/test_keys.py | import os
import pytest
import re
from flax.cmds.flax import cli
from flax.cmds.keys import delete_all_cmd, generate_and_print_cmd, show_cmd, sign_cmd, verify_cmd
from flax.util.config import load_config
from flax.util.file_keyring import FileKeyring
from flax.util.keychain import KeyData, DEFAULT_USER, DEFAULT_SERVIC... | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | true |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/cmds/test_beta.py | tests/core/cmds/test_beta.py | from __future__ import annotations
import zipfile
from pathlib import Path
from typing import Callable, Optional
import pytest
from click.testing import CliRunner, Result
from flax.cmds.beta_funcs import default_beta_root_path
from flax.cmds.flax import cli
from flax.util.beta_metrics import metrics_log_interval_def... | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/cmds/config.py | tests/core/cmds/config.py | from __future__ import annotations
parallel = True
| python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/cmds/__init__.py | tests/core/cmds/__init__.py | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false | |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/custom_types/test_coin.py | tests/core/custom_types/test_coin.py | from typing import List
from flax.types.blockchain_format.coin import Coin
from flax.types.blockchain_format.sized_bytes import bytes32
from flax.util.ints import uint64
from flax.util.hash import std_hash
import pytest
def coin_serialize(amount: uint64, clvm_serialize: bytes, full_serialize: bytes):
c = Coin(by... | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/custom_types/test_spend_bundle.py | tests/core/custom_types/test_spend_bundle.py | import json
import unittest
from blspy import G2Element
from flax.types.spend_bundle import SpendBundle
BLANK_SPEND_BUNDLE = SpendBundle(coin_spends=[], aggregated_signature=G2Element())
NULL_SIGNATURE = "0xc" + "0" * 191
class TestStructStream(unittest.TestCase):
def test_from_json_legacy(self):
JSON... | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/custom_types/test_proof_of_space.py | tests/core/custom_types/test_proof_of_space.py | from __future__ import annotations
from secrets import token_bytes
from flax.consensus.default_constants import DEFAULT_CONSTANTS
from flax.types.blockchain_format.proof_of_space import ProofOfSpace # pylint: disable=E0401
class TestProofOfSpace:
def test_can_create_proof(self):
"""
Tests that ... | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/custom_types/config.py | tests/core/custom_types/config.py | from __future__ import annotations
parallel = True
| python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/custom_types/__init__.py | tests/core/custom_types/__init__.py | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false | |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/mempool/test_mempool_fee_estimator.py | tests/core/mempool/test_mempool_fee_estimator.py | from __future__ import annotations
import logging
from random import Random
import pytest
from flax.consensus.cost_calculator import NPCResult
from flax.full_node.bitcoin_fee_estimator import BitcoinFeeEstimator
from flax.full_node.coin_store import CoinStore
from flax.full_node.fee_estimate_store import FeeStore
fr... | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/core/mempool/__init__.py | tests/core/mempool/__init__.py | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false | |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/farmer_harvester/config.py | tests/farmer_harvester/config.py | from __future__ import annotations
checkout_blocks_and_plots = True
| python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/farmer_harvester/__init__.py | tests/farmer_harvester/__init__.py | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false | |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/tests/farmer_harvester/test_farmer_harvester.py | tests/farmer_harvester/test_farmer_harvester.py | from __future__ import annotations
import asyncio
import pytest
from flax.farmer.farmer import Farmer
from flax.simulator.time_out_assert import time_out_assert
from flax.types.peer_info import PeerInfo
from flax.util.keychain import generate_mnemonic
def farmer_is_started(farmer):
return farmer.started
@pyt... | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/build_scripts/installer-version.py | build_scripts/installer-version.py | from __future__ import annotations
from setuptools_scm import get_version
# example: 1.0b5.dev225
def main():
scm_full_version = get_version(root="..", relative_to=__file__)
# scm_full_version = "1.0.5.dev22"
left_full_version = scm_full_version.split("+")
version = left_full_version[0].split(".")
... | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/build_scripts/check_dependency_artifacts.py | build_scripts/check_dependency_artifacts.py | from __future__ import annotations
import os
import pathlib
import platform
import subprocess
import sys
import tempfile
excepted_packages = {
"keyrings.cryptfile", # pure python
"dnslib", # pure python
}
def excepted(path: pathlib.Path) -> bool:
# TODO: This should be implemented with a real file nam... | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/build_scripts/__init__.py | build_scripts/__init__.py | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false | |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/build_scripts/npm_macos/__init__.py | build_scripts/npm_macos/__init__.py | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false | |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/build_scripts/assets/__init__.py | build_scripts/assets/__init__.py | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false | |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/build_scripts/assets/deb/__init__.py | build_scripts/assets/deb/__init__.py | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false | |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/build_scripts/assets/rpm/__init__.py | build_scripts/assets/rpm/__init__.py | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false | |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/build_scripts/assets/dmg/__init__.py | build_scripts/assets/dmg/__init__.py | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false | |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/build_scripts/npm_windows/__init__.py | build_scripts/npm_windows/__init__.py | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false | |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/build_scripts/npm_linux/__init__.py | build_scripts/npm_linux/__init__.py | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false | |
Flax-Network/flax-blockchain | https://github.com/Flax-Network/flax-blockchain/blob/bb8715f3155bb8011a04cc8c05b3fa8133e4c64b/build_scripts/npm_global/__init__.py | build_scripts/npm_global/__init__.py | python | Apache-2.0 | bb8715f3155bb8011a04cc8c05b3fa8133e4c64b | 2026-01-05T07:13:52.951017Z | false | |
bisno/WDRO | https://github.com/bisno/WDRO/blob/9e75dffe0251bc8e368997c392d8c77645a47630/10-nonlinearized-dual.py | 10-nonlinearized-dual.py | # -*- coding: utf-8 -*-
# Author xuli.shen
import tensorflow as tf
import tensorflow.contrib.slim as slim
import glob
import numpy as np
import pandas as pd
from PIL import Image
import random
import time
from data_process import *
from model import *
import sys
from cvxopt import matrix
from cvxopt.solvers import q... | python | MIT | 9e75dffe0251bc8e368997c392d8c77645a47630 | 2026-01-05T07:14:07.318150Z | false |
bisno/WDRO | https://github.com/bisno/WDRO/blob/9e75dffe0251bc8e368997c392d8c77645a47630/nonlinearized-dual-ResNet.py | nonlinearized-dual-ResNet.py | # -*- coding: utf-8 -*-
# Author xuli.shen
import tensorflow as tf
from ResNets.ResNet_minimax import network
from data_process import *
from model import *
import sys
import glob
import numpy as np
import pandas as pd
from PIL import Image
import random
import time
from cvxopt import matrix
from cvxopt.solvers impor... | python | MIT | 9e75dffe0251bc8e368997c392d8c77645a47630 | 2026-01-05T07:14:07.318150Z | false |
bisno/WDRO | https://github.com/bisno/WDRO/blob/9e75dffe0251bc8e368997c392d8c77645a47630/data_process.py | data_process.py | # -*- coding: UTF-8 -*-
# Author xuli.shen
import glob
import numpy as np
import pandas as pd
from PIL import Image
import random
# h,w = 60,50
h, w = (60, 50)
size = h * w
# Receding_Hairline Wearing_Necktie Rosy_Cheeks Eyeglasses Goatee Chubby
# Sideburns Blurry Wearing_Hat Double_Chin Pale_Skin Gray_Hair ... | python | MIT | 9e75dffe0251bc8e368997c392d8c77645a47630 | 2026-01-05T07:14:07.318150Z | false |
bisno/WDRO | https://github.com/bisno/WDRO/blob/9e75dffe0251bc8e368997c392d8c77645a47630/model.py | model.py | #-*- coding: UTF-8 -*-
# Author xuli.shen
import tensorflow as tf
def new_weights(name,shape):
return tf.get_variable(name ,shape, initializer=tf.contrib.layers.xavier_initializer())
def new_biases(length):
return tf.Variable(tf.constant(0.01, shape=[length]))
def new_fc_layer(name,
inp... | python | MIT | 9e75dffe0251bc8e368997c392d8c77645a47630 | 2026-01-05T07:14:07.318150Z | false |
bisno/WDRO | https://github.com/bisno/WDRO/blob/9e75dffe0251bc8e368997c392d8c77645a47630/WDRO_for_toydata.py | WDRO_for_toydata.py | # -*- coding: utf-8 -*-
# Author xuli.shen
import tensorflow as tf
import numpy as np
from cvxopt import matrix
from cvxopt.solvers import qp
from cvxopt import solvers
import matplotlib.pyplot as plt
tf.reset_default_graph()
np.random.seed(10)
rand_x = np.random.randn(1500)/50
np.random.seed(8)
rand_y = np.random.ra... | python | MIT | 9e75dffe0251bc8e368997c392d8c77645a47630 | 2026-01-05T07:14:07.318150Z | false |
bisno/WDRO | https://github.com/bisno/WDRO/blob/9e75dffe0251bc8e368997c392d8c77645a47630/ResNets/ResNet_minimax.py | ResNets/ResNet_minimax.py | # From https://github.com/taki0112/ResNet-Tensorflow.
import time
from ResNets.ops import *
import glob
import numpy as np
import pandas as pd
from PIL import Image
import random
import time
def network(x, res_n=18, is_training=True, reuse=False):
with tf.variable_scope("network", reuse=reuse):
if res_... | python | MIT | 9e75dffe0251bc8e368997c392d8c77645a47630 | 2026-01-05T07:14:07.318150Z | false |
bisno/WDRO | https://github.com/bisno/WDRO/blob/9e75dffe0251bc8e368997c392d8c77645a47630/ResNets/ops.py | ResNets/ops.py | # From https://github.com/taki0112/ResNet-Tensorflow.
import tensorflow as tf
import tensorflow.contrib as tf_contrib
weight_init = tf_contrib.layers.variance_scaling_initializer()
weight_regularizer = tf_contrib.layers.l2_regularizer(0.0001)
def conv(x, channels, kernel=4, stride=2, padding='SAME', use_bias=True... | python | MIT | 9e75dffe0251bc8e368997c392d8c77645a47630 | 2026-01-05T07:14:07.318150Z | false |
howardhsu/DE-CNN | https://github.com/howardhsu/DE-CNN/blob/7a3cb9325b26be8eeee85d872a13ff848f613914/script/train.py | script/train.py | import argparse
import torch
import time
import json
import numpy as np
import math
import random
np.random.seed(1337)
random.seed(1337)
torch.manual_seed(1337)
torch.cuda.manual_seed(1337)
def batch_generator(X, y, batch_size=128, return_idx=False, crf=False):
for offset in range(0, X.shape[0], batch_size):
... | python | MIT | 7a3cb9325b26be8eeee85d872a13ff848f613914 | 2026-01-05T07:14:07.694069Z | false |
howardhsu/DE-CNN | https://github.com/howardhsu/DE-CNN/blob/7a3cb9325b26be8eeee85d872a13ff848f613914/script/prep_oov.py | script/prep_oov.py | import argparse
import numpy as np
import json
import subprocess
def fill_np_embedding(emb_file, word_idx_fn, oov_fn):
with open(word_idx_fn) as f:
word_idx=json.load(f)
embedding=np.load(emb_file)
with open(oov_fn) as f:
for l in f:
rec=l.rstrip().split(' ')
if len(... | python | MIT | 7a3cb9325b26be8eeee85d872a13ff848f613914 | 2026-01-05T07:14:07.694069Z | false |
howardhsu/DE-CNN | https://github.com/howardhsu/DE-CNN/blob/7a3cb9325b26be8eeee85d872a13ff848f613914/script/evaluation.py | script/evaluation.py | import argparse
import torch
import time
import json
import numpy as np
import math
import random
import xml.etree.ElementTree as ET
from subprocess import check_output
np.random.seed(1337)
random.seed(1337)
torch.manual_seed(1337)
torch.cuda.manual_seed(1337)
class Model(torch.nn.Module):
def __init__(self, gen_... | python | MIT | 7a3cb9325b26be8eeee85d872a13ff848f613914 | 2026-01-05T07:14:07.694069Z | false |
howardhsu/DE-CNN | https://github.com/howardhsu/DE-CNN/blob/7a3cb9325b26be8eeee85d872a13ff848f613914/script/prep_embedding.py | script/prep_embedding.py | import argparse
import numpy as np
import json
import subprocess
def gen_np_embedding(fn, word_idx_fn, out_fn, dim=300):
with open(word_idx_fn) as f:
word_idx=json.load(f)
embedding=np.zeros((len(word_idx)+2, dim) )
with open(fn) as f:
for l in f:
rec=l.rstrip().split(' ')
... | python | MIT | 7a3cb9325b26be8eeee85d872a13ff848f613914 | 2026-01-05T07:14:07.694069Z | false |
ofirpress/shortformer | https://github.com/ofirpress/shortformer/blob/edc411ff896ae042c01d939a32c1e4a33e238083/train.py | train.py | #!/usr/bin/env python3 -u
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Legacy entry point. Use fairseq_cli/train.py or fairseq-train instead.
"""
from fairseq_cli.train import cli_mai... | python | MIT | edc411ff896ae042c01d939a32c1e4a33e238083 | 2026-01-05T07:14:08.244122Z | false |
ofirpress/shortformer | https://github.com/ofirpress/shortformer/blob/edc411ff896ae042c01d939a32c1e4a33e238083/setup.py | setup.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
from setuptools import setup, find_packages, Extension
import sys
if sys.version_info < (3, 6):
sys.exi... | python | MIT | edc411ff896ae042c01d939a32c1e4a33e238083 | 2026-01-05T07:14:08.244122Z | false |
ofirpress/shortformer | https://github.com/ofirpress/shortformer/blob/edc411ff896ae042c01d939a32c1e4a33e238083/hubconf.py | hubconf.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import functools
from fairseq.hub_utils import BPEHubInterface as bpe # noqa
from fairseq.hub_utils import TokenizerHubInterface as tokenize... | python | MIT | edc411ff896ae042c01d939a32c1e4a33e238083 | 2026-01-05T07:14:08.244122Z | false |
ofirpress/shortformer | https://github.com/ofirpress/shortformer/blob/edc411ff896ae042c01d939a32c1e4a33e238083/scripts/shard_docs.py | scripts/shard_docs.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Split a large file into shards while respecting document boundaries. Documents
should be separated by a single empty... | python | MIT | edc411ff896ae042c01d939a32c1e4a33e238083 | 2026-01-05T07:14:08.244122Z | false |
ofirpress/shortformer | https://github.com/ofirpress/shortformer/blob/edc411ff896ae042c01d939a32c1e4a33e238083/scripts/spm_train.py | scripts/spm_train.py | #!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import absolute_import, division, print_function, unicode_literals
import sys
impor... | python | MIT | edc411ff896ae042c01d939a32c1e4a33e238083 | 2026-01-05T07:14:08.244122Z | false |
ofirpress/shortformer | https://github.com/ofirpress/shortformer/blob/edc411ff896ae042c01d939a32c1e4a33e238083/scripts/rm_pt.py | scripts/rm_pt.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import os
import re
import shutil
import sys
pt_regexp = re.compile(r'checkpoint(\d+|_\d+_\d+|_[a-z]+... | python | MIT | edc411ff896ae042c01d939a32c1e4a33e238083 | 2026-01-05T07:14:08.244122Z | false |
ofirpress/shortformer | https://github.com/ofirpress/shortformer/blob/edc411ff896ae042c01d939a32c1e4a33e238083/scripts/count_docs.py | scripts/count_docs.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Count the number of documents and average number of lines and tokens per
document in a large file. Documents should ... | python | MIT | edc411ff896ae042c01d939a32c1e4a33e238083 | 2026-01-05T07:14:08.244122Z | false |
ofirpress/shortformer | https://github.com/ofirpress/shortformer/blob/edc411ff896ae042c01d939a32c1e4a33e238083/scripts/compare_namespaces.py | scripts/compare_namespaces.py | #!/usr/bin/env python
"""Helper script to compare two argparse.Namespace objects."""
from argparse import Namespace # noqa
def main():
ns1 = eval(input('Namespace 1: '))
ns2 = eval(input('Namespace 2: '))
def keys(ns):
ks = set()
for k in dir(ns):
if not k.startswith('_'):
... | python | MIT | edc411ff896ae042c01d939a32c1e4a33e238083 | 2026-01-05T07:14:08.244122Z | false |
ofirpress/shortformer | https://github.com/ofirpress/shortformer/blob/edc411ff896ae042c01d939a32c1e4a33e238083/scripts/build_sym_alignment.py | scripts/build_sym_alignment.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Use this script in order to build symmetric alignments for your translation
dataset.
This script depends on fast_align and mosesdecoder too... | python | MIT | edc411ff896ae042c01d939a32c1e4a33e238083 | 2026-01-05T07:14:08.244122Z | false |
ofirpress/shortformer | https://github.com/ofirpress/shortformer/blob/edc411ff896ae042c01d939a32c1e4a33e238083/scripts/__init__.py | scripts/__init__.py | python | MIT | edc411ff896ae042c01d939a32c1e4a33e238083 | 2026-01-05T07:14:08.244122Z | false | |
ofirpress/shortformer | https://github.com/ofirpress/shortformer/blob/edc411ff896ae042c01d939a32c1e4a33e238083/scripts/spm_encode.py | scripts/spm_encode.py | #!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import absolute_import, division, print_function, unicode_literals
import argparse
i... | python | MIT | edc411ff896ae042c01d939a32c1e4a33e238083 | 2026-01-05T07:14:08.244122Z | false |
ofirpress/shortformer | https://github.com/ofirpress/shortformer/blob/edc411ff896ae042c01d939a32c1e4a33e238083/scripts/average_checkpoints.py | scripts/average_checkpoints.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import collections
import torch
import os
import re
from fairseq.file_io import PathManager
def aver... | python | MIT | edc411ff896ae042c01d939a32c1e4a33e238083 | 2026-01-05T07:14:08.244122Z | false |
ofirpress/shortformer | https://github.com/ofirpress/shortformer/blob/edc411ff896ae042c01d939a32c1e4a33e238083/scripts/spm_decode.py | scripts/spm_decode.py | #!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import absolute_import, division, print_function, unicode_literals
import argparse
... | python | MIT | edc411ff896ae042c01d939a32c1e4a33e238083 | 2026-01-05T07:14:08.244122Z | false |
ofirpress/shortformer | https://github.com/ofirpress/shortformer/blob/edc411ff896ae042c01d939a32c1e4a33e238083/scripts/read_binarized.py | scripts/read_binarized.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
from fairseq.data import data_utils, Dictionary, indexed_dataset
def get_parser():
parser = argp... | python | MIT | edc411ff896ae042c01d939a32c1e4a33e238083 | 2026-01-05T07:14:08.244122Z | false |
ofirpress/shortformer | https://github.com/ofirpress/shortformer/blob/edc411ff896ae042c01d939a32c1e4a33e238083/scripts/split_train_valid_docs.py | scripts/split_train_valid_docs.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Split a large file into a train and valid set while respecting document
boundaries. Documents should be separated by... | python | MIT | edc411ff896ae042c01d939a32c1e4a33e238083 | 2026-01-05T07:14:08.244122Z | false |
ofirpress/shortformer | https://github.com/ofirpress/shortformer/blob/edc411ff896ae042c01d939a32c1e4a33e238083/scripts/constraints/validate.py | scripts/constraints/validate.py | #!/usr/bin/env python3
#
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import sys
"""Reads in a fairseq output file, and verifies that the constraints
(C- lines) are present in the output... | python | MIT | edc411ff896ae042c01d939a32c1e4a33e238083 | 2026-01-05T07:14:08.244122Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.