text stringlengths 24 1.04M | metadata stringlengths 233 497 |
|---|---|
### File: tests/trigger_tests.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch_all.hpp>
using namespace sqlite_orm;
TEST_CASE("triggers_basics") {
struct TestInsert {
int id;
std::string text;
int x = 0;
int y = 0;
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "tests/trigger_tests.cpp", "license": "mit", "size": 4725} |
### File: tests/tuple_iteration.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch_all.hpp>
#include <typeindex> // std::type_index
#include <string> // std::string
#include <type_traits> // std::remove_pointer
using namespace sqlite_orm;
TEST_CASE("tuple iteration") {
using namespace internal;
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "tests/tuple_iteration.cpp", "license": "mit", "size": 2906} |
### File: tests/unique_cases/delete_with_two_fields.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch_all.hpp>
using namespace sqlite_orm;
TEST_CASE("delete with two fields") {
struct Device {
std::string serialNumber;
std::string deviceId;
};
auto storage = make_storage({},
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "tests/unique_cases/delete_with_two_fields.cpp", "license": "mit", "size": 2181} |
### File: tests/unique_cases/get_all_with_two_tables.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch_all.hpp>
using namespace sqlite_orm;
namespace {
struct Pattern {
std::string value;
#ifndef SQLITE_ORM_AGGREGATE_PAREN_INIT_SUPPORTED
Pattern() = default;
Pattern(std::strin... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "tests/unique_cases/get_all_with_two_tables.cpp", "license": "mit", "size": 3183} |
### File: tests/unique_cases/index_named_table_with_fk.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch_all.hpp>
using namespace sqlite_orm;
TEST_CASE("index named table") {
using std::string;
struct OrderTable {
string order_number;
string start_time;
string end_time;
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "tests/unique_cases/index_named_table_with_fk.cpp", "license": "mit", "size": 3796} |
### File: tests/unique_cases/issue525.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch_all.hpp>
using namespace sqlite_orm;
TEST_CASE("issue525") {
struct User {
int id;
std::string firstName;
std::string lastName;
int birthDate;
std::unique_ptr<std::string> im... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "tests/unique_cases/issue525.cpp", "license": "mit", "size": 1362} |
### File: tests/unique_cases/issue663.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch_all.hpp>
using namespace sqlite_orm;
namespace {
namespace primary_key_case {
template<typename TUser, typename S>
void insertSection(S& storage) {
TUser user{};
user.id = -... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "tests/unique_cases/issue663.cpp", "license": "mit", "size": 6305} |
### File: tests/unique_cases/issue86.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch_all.hpp>
using namespace sqlite_orm;
TEST_CASE("Issue 86") {
struct Data {
uint8_t mUsed = 0;
int mId = 0;
int mCountryId = 0;
int mLangId = 0;
std::string mName;
};
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "tests/unique_cases/issue86.cpp", "license": "mit", "size": 923} |
### File: tests/unique_cases/issue937.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch_all.hpp>
using namespace sqlite_orm;
#ifdef SQLITE_ORM_OPTIONAL_SUPPORTED
TEST_CASE("issue937") {
struct Employee {
int m_empno;
std::string m_ename;
std::string m_job;
std::optional<... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "tests/unique_cases/issue937.cpp", "license": "mit", "size": 4349} |
### File: tests/unique_cases/join_iterator_ctor_compilation_error.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch_all.hpp>
using namespace sqlite_orm;
TEST_CASE("Join iterator ctor compilation error") {
struct Tag {
int objectId;
std::string text;
};
auto storage =
m... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "tests/unique_cases/join_iterator_ctor_compilation_error.cpp", "license": "mit", "size": 1486} |
### File: tests/unique_cases/prepare_get_all_with_case.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch_all.hpp>
using namespace sqlite_orm;
TEST_CASE("Prepare with case") {
struct UserProfile {
int id = 0;
std::string firstName;
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
U... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "tests/unique_cases/prepare_get_all_with_case.cpp", "license": "mit", "size": 1835} |
### File: vcpkg/triplets/x64-linux.cmake
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE dynamic)
set(VCPKG_CMAKE_SYSTEM_NAME Linux)
| {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/sqlite_orm", "path": "vcpkg/triplets/x64-linux.cmake", "license": "mit", "size": 137} |
### File: vcpkg/triplets/x64-osx.cmake
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE dynamic)
set(VCPKG_CMAKE_SYSTEM_NAME Darwin)
set(VCPKG_OSX_ARCHITECTURES x86_64)
| {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/sqlite_orm", "path": "vcpkg/triplets/x64-osx.cmake", "license": "mit", "size": 174} |
### File: scripts/autoencoder/rvae/feature_caching_rvae.sh
JOB_NAME=feature_caching
AUTOENCODER_CACHE_PATH=/path/to/exp/caches/autoencoder_cache
USE_CACHE_WITHOUT_DATASET=True
SEED=0
for MAP in "filter_pgh" "filter_lav" "filter_sgp" "filter_bos"
do
python $SLEDGE_DEVKIT_ROOT/sledge/script/run_autoencoder.py \
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Shell", "repo_name": "minhanghuang/sledge", "path": "scripts/autoencoder/rvae/feature_caching_rvae.sh", "license": "apache-2.0", "size": 575} |
### File: scripts/autoencoder/rvae/latent_caching_rvae.sh
JOB_NAME=latent_caching
AUTOENCODER_CACHE_PATH=/path/to/exp/caches/autoencoder_cache
AUTOENCODER_CHECKPOINT=/path/to/rvae_checkpoint.ckpt
USE_CACHE_WITHOUT_DATASET=True
SEED=0
python $SLEDGE_DEVKIT_ROOT/sledge/script/run_autoencoder.py \
py_func=latent_caching... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Shell", "repo_name": "minhanghuang/sledge", "path": "scripts/autoencoder/rvae/latent_caching_rvae.sh", "license": "apache-2.0", "size": 589} |
### File: scripts/autoencoder/rvae/training_rvae.sh
JOB_NAME=training_rvae_model
AUTOENCODER_CACHE_PATH=/path/to/exp/caches/autoencoder_cache
AUTOENCODER_CHECKPOINT=null # set for weight intialization / continue training
USE_CACHE_WITHOUT_DATASET=True
SEED=0
python $SLEDGE_DEVKIT_ROOT/sledge/script/run_autoencoder.py ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Shell", "repo_name": "minhanghuang/sledge", "path": "scripts/autoencoder/rvae/training_rvae.sh", "license": "apache-2.0", "size": 647} |
### File: scripts/autoencoder/vae/training_vae.sh
JOB_NAME=training_vae_model
AUTOENCODER_CACHE_PATH=/path/to/exp/caches/autoencoder_cache
USE_CACHE_WITHOUT_DATASET=True
SEED=0
python $SLEDGE_DEVKIT_ROOT/sledge/script/run_autoencoder.py \
py_func=training \
seed=$SEED \
job_name=$JOB_NAME \
+autoencoder=training_vae_... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Shell", "repo_name": "minhanghuang/sledge", "path": "scripts/autoencoder/vae/training_vae.sh", "license": "apache-2.0", "size": 517} |
### File: scripts/diffusion/scenario_caching_diffusion.sh
JOB_NAME=scenario_caching
AUTOENCODER_CHECKPOINT=/path/to/rvae_checkpoint.ckpt
DIFFUSION_CHECKPOINT=/path/to/diffusion/checkpoint
DIFFUSION_MODEL=dit_b_model # [dit_s_model, dit_b_model, dit_l_model, dit_xl_model]
SEED=0
python $SLEDGE_DEVKIT_ROOT/sledge/scrip... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Shell", "repo_name": "minhanghuang/sledge", "path": "scripts/diffusion/scenario_caching_diffusion.sh", "license": "apache-2.0", "size": 528} |
### File: scripts/diffusion/training_diffusion.sh
JOB_NAME=training_dit_diffusion
AUTOENCODER_CACHE_PATH=/path/to/exp/caches/autoencoder_cache
AUTOENCODER_CHECKPOINT=/path/to/rvae_checkpoint.ckpt
DIFFUSION_CHECKPOINT=null # set for weight intialization / continue training
DIFFUSION_MODEL=dit_b_model # [dit_s_model, dit... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Shell", "repo_name": "minhanghuang/sledge", "path": "scripts/diffusion/training_diffusion.sh", "license": "apache-2.0", "size": 741} |
### File: scripts/download/download_cache.sh
# autoencoder cache
wget https://s3.eu-central-1.amazonaws.com/avg-projects-2/sledge/caches/autoencoder_cache.zip | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Shell", "repo_name": "minhanghuang/sledge", "path": "scripts/download/download_cache.sh", "license": "apache-2.0", "size": 113} |
### File: scripts/download/download_nuplan.sh
# NOTE: Please check the LICENSE file when downloading the nuPlan dataset
wget https://motional-nuplan.s3-ap-northeast-1.amazonaws.com/LICENSE
# maps
wget https://motional-nuplan.s3-ap-northeast-1.amazonaws.com/public/nuplan-v1.1/nuplan-maps-v1.1.zip
# train
wget https://... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Shell", "repo_name": "minhanghuang/sledge", "path": "scripts/download/download_nuplan.sh", "license": "apache-2.0", "size": 1069} |
### File: scripts/simulation/simple_simulation.sh
CHALLENGE=sledge_reactive_agents
python $SLEDGE_DEVKIT_ROOT/sledge/script/run_simulation.py \
+simulation=$CHALLENGE \
planner=pdm_closed_planner \
observation=sledge_agents_observation \
scenario_builder=nuplan | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Shell", "repo_name": "minhanghuang/sledge", "path": "scripts/simulation/simple_simulation.sh", "license": "apache-2.0", "size": 214} |
### File: setup.py
import os
import setuptools
# Change directory to allow installation from anywhere
script_folder = os.path.dirname(os.path.realpath(__file__))
os.chdir(script_folder)
with open("requirements.txt") as f:
requirements = f.read().splitlines()
# Installs
setuptools.setup(
name="sledge",
ve... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "setup.py", "license": "apache-2.0", "size": 866} |
### File: sledge/autoencoder/callbacks/rvae_visualization_callback.py
from typing import Any, List, Optional
import numpy as np
import numpy.typing as npt
import torch
import torch.utils.data
import pytorch_lightning as pl
from nuplan.planning.training.modeling.types import FeaturesType, TargetsType, move_features_t... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/autoencoder/callbacks/rvae_visualization_callback.py", "license": "apache-2.0", "size": 8970} |
### File: sledge/autoencoder/callbacks/vae_visualization_callback.py
from typing import Any, List, Optional
import numpy as np
import numpy.typing as npt
import torch
import torch.utils.data
import pytorch_lightning as pl
from nuplan.planning.training.modeling.types import FeaturesType, TargetsType, move_features_ty... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/autoencoder/callbacks/vae_visualization_callback.py", "license": "apache-2.0", "size": 8293} |
### File: sledge/autoencoder/data_augmentation/augmentation_utils.py
import numpy as np
import numpy.typing as npt
from nuplan.common.actor_state.state_representation import StateSE2
from sledge.simulation.planner.pdm_planner.utils.pdm_geometry_utils import normalize_angle
from sledge.autoencoder.preprocessing.featur... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/autoencoder/data_augmentation/augmentation_utils.py", "license": "apache-2.0", "size": 4487} |
### File: sledge/autoencoder/data_augmentation/rvae_augmentation.py
from typing import List, Optional, Tuple
import numpy as np
from nuplan.planning.scenario_builder.abstract_scenario import AbstractScenario
from nuplan.planning.training.data_augmentation.abstract_data_augmentation import AbstractAugmentor
from nupla... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/autoencoder/data_augmentation/rvae_augmentation.py", "license": "apache-2.0", "size": 3987} |
### File: sledge/autoencoder/data_augmentation/vae_augmentation.py
from typing import List, Optional, Tuple
import numpy as np
from nuplan.planning.scenario_builder.abstract_scenario import AbstractScenario
from nuplan.planning.training.data_augmentation.abstract_data_augmentation import AbstractAugmentor
from nuplan... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/autoencoder/data_augmentation/vae_augmentation.py", "license": "apache-2.0", "size": 3969} |
### File: sledge/autoencoder/data_loader/autoencoder_datamodule.py
import logging
from typing import Any, Dict, List, Optional, Tuple
from omegaconf import DictConfig
import torch
from nuplan.planning.training.modeling.types import FeaturesType, move_features_type_to_device
from nuplan.planning.scenario_builder.abstr... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/autoencoder/data_loader/autoencoder_datamodule.py", "license": "apache-2.0", "size": 5136} |
### File: sledge/autoencoder/experiments/feature_caching.py
import gc
import itertools
import logging
import os
import uuid
from pathlib import Path
from typing import Dict, List, Optional, Union
from omegaconf import DictConfig
from nuplan.common.utils.distributed_scenario_filter import DistributedMode, DistributedS... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/autoencoder/experiments/feature_caching.py", "license": "apache-2.0", "size": 8516} |
### File: sledge/autoencoder/experiments/latent_caching.py
import logging
from pathlib import Path
from omegaconf import DictConfig
import torch
from tqdm import tqdm
from nuplan.planning.utils.multithreading.worker_pool import WorkerPool
from nuplan.planning.training.preprocessing.utils.feature_cache import FeatureC... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/autoencoder/experiments/latent_caching.py", "license": "apache-2.0", "size": 2976} |
### File: sledge/autoencoder/experiments/training.py
import logging
from omegaconf import DictConfig
from torch.optim.lr_scheduler import OneCycleLR
import pytorch_lightning as pl
from nuplan.planning.utils.multithreading.worker_pool import WorkerPool
from nuplan.planning.training.experiments.training import Training... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/autoencoder/experiments/training.py", "license": "apache-2.0", "size": 2497} |
### File: sledge/autoencoder/modeling/autoencoder_lightning_module_wrapper.py
import logging
from typing import Any, Dict, List, Optional, Tuple, Union
from hydra.utils import instantiate
from omegaconf import DictConfig
import torch
from torch.optim import Optimizer
from torch.optim.lr_scheduler import _LRScheduler
i... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/autoencoder/modeling/autoencoder_lightning_module_wrapper.py", "license": "apache-2.0", "size": 9868} |
### File: sledge/autoencoder/modeling/autoencoder_torch_module_wrapper.py
import abc
from typing import List
import torch.nn as nn
from nuplan.planning.training.modeling.types import FeaturesType, TargetsType
from nuplan.planning.training.modeling.torch_module_wrapper import TorchModuleWrapper
from nuplan.planning.tr... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/autoencoder/modeling/autoencoder_torch_module_wrapper.py", "license": "apache-2.0", "size": 2249} |
### File: sledge/autoencoder/modeling/matching/abstract_matching.py
from abc import ABC, abstractmethod
import torch
from nuplan.planning.training.modeling.types import FeaturesType, TargetsType
class AbstractMatching(ABC):
"""Matching interface used in for hungarian matching losses during training."""
@abs... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/autoencoder/modeling/matching/abstract_matching.py", "license": "apache-2.0", "size": 686} |
### File: sledge/autoencoder/modeling/matching/rvae_matching.py
import torch
from scipy.optimize import linear_sum_assignment
from nuplan.planning.training.modeling.types import FeaturesType, TargetsType
from sledge.autoencoder.modeling.matching.abstract_matching import AbstractMatching
from sledge.autoencoder.modeli... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/autoencoder/modeling/matching/rvae_matching.py", "license": "apache-2.0", "size": 5782} |
### File: sledge/autoencoder/modeling/metrics/abstract_custom_metric.py
from abc import ABC, abstractmethod
from typing import Dict
import torch
from nuplan.planning.training.modeling.types import FeaturesType, TargetsType, ScenarioListType
class AbstractCustomMetric(ABC):
"""Custom abstract class for metric de... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/autoencoder/modeling/metrics/abstract_custom_metric.py", "license": "apache-2.0", "size": 1002} |
### File: sledge/autoencoder/modeling/metrics/kl_metric.py
from typing import Dict
import torch
from nuplan.planning.training.modeling.types import FeaturesType, ScenarioListType, TargetsType
from sledge.autoencoder.preprocessing.features.latent_feature import Latent
from sledge.autoencoder.modeling.metrics.abstract... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/autoencoder/modeling/metrics/kl_metric.py", "license": "apache-2.0", "size": 1059} |
### File: sledge/autoencoder/modeling/models/rvae/rvae_config.py
from typing import List, Tuple
from dataclasses import dataclass
from sledge.autoencoder.preprocessing.features.sledge_vector_feature import SledgeConfig
@dataclass
class RVAEConfig(SledgeConfig):
"""Configuration dataclass for Raster-Vector-Autoen... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/autoencoder/modeling/models/rvae/rvae_config.py", "license": "apache-2.0", "size": 3384} |
### File: sledge/autoencoder/modeling/models/rvae/rvae_decoder.py
from __future__ import annotations
import json
from pathlib import PosixPath
from typing import Any, Dict, Optional, Tuple, Union
import dataclasses
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import diffusers... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/autoencoder/modeling/models/rvae/rvae_decoder.py", "license": "apache-2.0", "size": 15517} |
### File: sledge/autoencoder/modeling/models/rvae/rvae_encoder.py
# Code mainly from: https://github.com/facebookresearch/detr (Apache-2.0 license)
# TODO: Refactor & add docstring's
from typing import Union
import torch
import torchvision
from torch import nn
from torchvision.models._utils import IntermediateLayerGe... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/autoencoder/modeling/models/rvae/rvae_encoder.py", "license": "apache-2.0", "size": 3407} |
### File: sledge/autoencoder/modeling/models/rvae/rvae_model.py
import torch
import torch.nn as nn
from nuplan.planning.training.modeling.types import FeaturesType, TargetsType
from sledge.autoencoder.modeling.autoencoder_torch_module_wrapper import AutoencoderTorchModuleWrapper
from sledge.autoencoder.modeling.model... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/autoencoder/modeling/models/rvae/rvae_model.py", "license": "apache-2.0", "size": 2545} |
### File: sledge/autoencoder/modeling/models/rvae/utils/rvae_position_encoding.py
# Code mainly from: https://github.com/facebookresearch/detr (Apache-2.0 license)
# TODO: Refactor & add docstring's
from typing import Optional, Union
import numpy as np
import torch
from torch import nn
from sledge.autoencoder.modelin... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/autoencoder/modeling/models/rvae/utils/rvae_position_encoding.py", "license": "apache-2.0", "size": 3756} |
### File: sledge/autoencoder/modeling/models/rvae/utils/rvae_transformer.py
# Code mainly from: https://github.com/facebookresearch/detr (Apache-2.0 license)
# TODO: Refactor & add docstring's
import copy
from typing import Callable, Optional
import torch
import torch.nn.functional as F
from torch import nn
class Tr... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/autoencoder/modeling/models/rvae/utils/rvae_transformer.py", "license": "apache-2.0", "size": 11713} |
### File: sledge/autoencoder/modeling/models/vae/vae_config.py
from typing import Tuple
from dataclasses import dataclass
from sledge.autoencoder.preprocessing.features.sledge_vector_feature import SledgeConfig
@dataclass
class VAEConfig(SledgeConfig):
"""Configuration dataclass for Raster VAE."""
# 1. feat... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/autoencoder/modeling/models/vae/vae_config.py", "license": "apache-2.0", "size": 1488} |
### File: sledge/autoencoder/modeling/models/vae/vae_model.py
import torch
import torch.nn as nn
from nuplan.planning.training.modeling.types import FeaturesType, TargetsType
from sledge.autoencoder.modeling.autoencoder_torch_module_wrapper import AutoencoderTorchModuleWrapper
from sledge.autoencoder.modeling.models.... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/autoencoder/modeling/models/vae/vae_model.py", "license": "apache-2.0", "size": 4193} |
### File: sledge/autoencoder/modeling/objectives/abstract_custom_objective.py
from abc import ABC, abstractmethod
from typing import Dict
import torch
from nuplan.planning.training.modeling.types import FeaturesType, ScenarioListType, TargetsType
class AbstractCustomObjective(ABC):
"""Abstract class for custom o... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/autoencoder/modeling/objectives/abstract_custom_objective.py", "license": "apache-2.0", "size": 1016} |
### File: sledge/autoencoder/modeling/objectives/kl_objective.py
from typing import Dict
import torch
from nuplan.planning.training.modeling.types import FeaturesType, ScenarioListType, TargetsType
from sledge.autoencoder.preprocessing.features.latent_feature import Latent
from sledge.autoencoder.modeling.objectives... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/autoencoder/modeling/objectives/kl_objective.py", "license": "apache-2.0", "size": 1263} |
### File: sledge/autoencoder/modeling/objectives/rvae_objective.py
from typing import Dict, Tuple
import torch
import torch.nn.functional as F
from nuplan.planning.training.modeling.types import FeaturesType, ScenarioListType, TargetsType
from sledge.autoencoder.modeling.models.rvae.rvae_config import RVAEConfig
fro... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/autoencoder/modeling/objectives/rvae_objective.py", "license": "apache-2.0", "size": 5357} |
### File: sledge/autoencoder/modeling/objectives/vae_objective.py
from typing import Dict
import torch
import torch.nn.functional as F
from nuplan.planning.training.modeling.types import FeaturesType, ScenarioListType, TargetsType
from sledge.autoencoder.preprocessing.features.sledge_raster_feature import SledgeRast... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/autoencoder/modeling/objectives/vae_objective.py", "license": "apache-2.0", "size": 2319} |
### File: sledge/autoencoder/preprocessing/feature_builders/sledge/sledge_agent_feature.py
from typing import List, Optional
import numpy as np
import numpy.typing as npt
from nuplan.common.actor_state.agent import Agent
from nuplan.common.actor_state.ego_state import EgoState
from nuplan.common.actor_state.tracked_o... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/autoencoder/preprocessing/feature_builders/sledge/sledge_agent_feature.py", "license": "apache-2.0", "size"... |
### File: sledge/autoencoder/preprocessing/feature_builders/sledge/sledge_feature_processing.py
import copy
from typing import List, Optional, Tuple
import cv2
import numpy as np
import numpy.typing as npt
from nuplan.common.actor_state.oriented_box import OrientedBox
from nuplan.common.actor_state.vehicle_parameters... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/autoencoder/preprocessing/feature_builders/sledge/sledge_feature_processing.py", "license": "apache-2.0", "... |
### File: sledge/autoencoder/preprocessing/feature_builders/sledge/sledge_line_feature.py
# TODO: Refactor
from typing import Dict, List, Tuple
import numpy as np
import numpy.typing as npt
import networkx as nx
from nuplan.common.maps.abstract_map_objects import LaneGraphEdgeMapObject
from nuplan.common.maps.abstrac... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/autoencoder/preprocessing/feature_builders/sledge/sledge_line_feature.py", "license": "apache-2.0", "size":... |
### File: sledge/autoencoder/preprocessing/feature_builders/sledge/sledge_utils.py
# TODO: Move these functions for general use.
# eg. sledge.common.visualization
from typing import Tuple
import cv2
import numpy as np
import numpy.typing as npt
from nuplan.common.actor_state.oriented_box import OrientedBox
from sled... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/autoencoder/preprocessing/feature_builders/sledge/sledge_utils.py", "license": "apache-2.0", "size": 3335} |
### File: sledge/autoencoder/preprocessing/feature_builders/sledge_raw_feature_builder.py
from typing import List, Type
from shapely.geometry import Polygon
from nuplan.common.maps.abstract_map import AbstractMap
from nuplan.common.actor_state.ego_state import EgoState
from nuplan.planning.simulation.observation.obser... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/autoencoder/preprocessing/feature_builders/sledge_raw_feature_builder.py", "license": "apache-2.0", "size":... |
### File: sledge/autoencoder/preprocessing/features/latent_feature.py
from __future__ import annotations
from typing import Any, Dict, List
from dataclasses import dataclass
import torch
from nuplan.planning.script.builders.utils.utils_type import validate_type
from nuplan.planning.training.preprocessing.feature_buil... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/autoencoder/preprocessing/features/latent_feature.py", "license": "apache-2.0", "size": 1756} |
### File: sledge/autoencoder/preprocessing/features/map_id_feature.py
from __future__ import annotations
from dataclasses import dataclass
from typing import Any, Dict, List
import torch
from nuplan.planning.script.builders.utils.utils_type import validate_type
from nuplan.planning.training.preprocessing.feature_bui... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/autoencoder/preprocessing/features/map_id_feature.py", "license": "apache-2.0", "size": 1831} |
### File: sledge/autoencoder/preprocessing/features/rvae_matching_feature.py
from __future__ import annotations
from dataclasses import dataclass
from typing import Any, Dict, List
import torch
from nuplan.planning.script.builders.utils.utils_type import validate_type
from nuplan.planning.training.preprocessing.featu... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/autoencoder/preprocessing/features/rvae_matching_feature.py", "license": "apache-2.0", "size": 1350} |
### File: sledge/autoencoder/preprocessing/features/sledge_raster_feature.py
from __future__ import annotations
from dataclasses import dataclass
from typing import Any, Dict, List, Union, Optional
import torch
import torchvision
from torch import Tensor
import numpy as np
from numpy import ndarray
from nuplan.plan... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/autoencoder/preprocessing/features/sledge_raster_feature.py", "license": "apache-2.0", "size": 7036} |
### File: sledge/autoencoder/preprocessing/features/sledge_vector_feature.py
from __future__ import annotations
import torch
from dataclasses import dataclass
from typing import Any, Dict, List, Tuple, Union
from enum import Enum
from nuplan.planning.script.builders.utils.utils_type import validate_type
from nuplan.... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/autoencoder/preprocessing/features/sledge_vector_feature.py", "license": "apache-2.0", "size": 13522} |
### File: sledge/autoencoder/preprocessing/target_builders/map_id_target_builder.py
from typing import Type
import numpy as np
from nuplan.planning.scenario_builder.abstract_scenario import AbstractScenario
from nuplan.planning.training.preprocessing.feature_builders.abstract_feature_builder import AbstractModelFeatur... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/autoencoder/preprocessing/target_builders/map_id_target_builder.py", "license": "apache-2.0", "size": 1020} |
### File: sledge/common/helper/cache_helper.py
from typing import List
from pathlib import Path
def find_feature_paths(root_path: Path, feature_name: str) -> List[Path]:
"""
Simple helper function, collecting all available gzip files in a cache.
:param root_path: path of feature cache
:param feature_n... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/common/helper/cache_helper.py", "license": "apache-2.0", "size": 829} |
### File: sledge/common/visualization/sledge_colors.py
from dataclasses import dataclass
from typing import Any, Dict, Tuple
from PIL import ImageColor
from nuplan.common.maps.abstract_map import SemanticMapLayer
from nuplan.common.maps.maps_datatypes import TrafficLightStatusType
from nuplan.common.actor_state.tracke... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/common/visualization/sledge_colors.py", "license": "apache-2.0", "size": 7718} |
### File: sledge/common/visualization/sledge_visualization_utils.py
from typing import Optional, Tuple
import cv2
import numpy as np
import numpy.typing as npt
from nuplan.common.actor_state.oriented_box import OrientedBox
from sledge.common.visualization.sledge_colors import Color, BLACK, WHITE, SLEDGE_ELEMENTS
fro... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/common/visualization/sledge_visualization_utils.py", "license": "apache-2.0", "size": 9033} |
### File: sledge/diffusion/dataset/rvae_latent_builder_config.py
from dataclasses import dataclass
from pathlib import Path
from typing import List
from datasets.builder import BuilderConfig
from sledge.autoencoder.modeling.models.rvae.rvae_config import RVAEConfig
@dataclass
class RVAELatentBuilderConfig(BuilderConf... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/diffusion/dataset/rvae_latent_builder_config.py", "license": "apache-2.0", "size": 1156} |
### File: sledge/diffusion/dataset/rvae_latent_dataset.py
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Li... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/diffusion/dataset/rvae_latent_dataset.py", "license": "apache-2.0", "size": 6014} |
### File: sledge/diffusion/experiments/scenario_caching.py
from pathlib import Path
from tqdm import tqdm
from omegaconf import DictConfig
from accelerate.logging import get_logger
from nuplan.planning.training.preprocessing.utils.feature_cache import FeatureCachePickle
from sledge.autoencoder.preprocessing.features.... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/diffusion/experiments/scenario_caching.py", "license": "apache-2.0", "size": 2270} |
### File: sledge/diffusion/experiments/training.py
import math
import os
from pathlib import Path
import numpy as np
import torch
import torch.nn.functional as F
from packaging import version
from tqdm.auto import tqdm
import accelerate
from accelerate.logging import get_logger
import datasets
import diffusers
from... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/diffusion/experiments/training.py", "license": "apache-2.0", "size": 11885} |
### File: sledge/diffusion/modelling/ldm_pipeline.py
import inspect
from typing import List, Optional, Union
import torch
from diffusers.models import DiTTransformer2DModel
from diffusers.schedulers import DDPMScheduler
from diffusers import DiffusionPipeline
from sledge.autoencoder.modeling.models.rvae.rvae_decoder... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/diffusion/modelling/ldm_pipeline.py", "license": "apache-2.0", "size": 4317} |
### File: sledge/script/builders/autoencoder_builder.py
import logging
from typing import List, cast
import pytorch_lightning as pl
from omegaconf import DictConfig
from hydra.utils import instantiate
from nuplan.planning.training.preprocessing.feature_preprocessor import FeaturePreprocessor
from nuplan.planning.scr... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/script/builders/autoencoder_builder.py", "license": "apache-2.0", "size": 5283} |
### File: sledge/script/builders/diffusion_builder.py
import logging
import os
from shutil import rmtree
from pathlib import Path
from omegaconf import DictConfig
from hydra.utils import instantiate
import torch
import torch.nn as nn
import accelerate
import diffusers
from datasets import load_dataset
from nuplan.pl... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/script/builders/diffusion_builder.py", "license": "apache-2.0", "size": 5938} |
### File: sledge/script/builders/matching_builder.py
import logging
from typing import List
from hydra.utils import instantiate
from omegaconf import DictConfig
from nuplan.planning.script.builders.utils.utils_type import validate_type
from sledge.autoencoder.modeling.matching.abstract_matching import AbstractMatchi... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/script/builders/matching_builder.py", "license": "apache-2.0", "size": 858} |
### File: sledge/script/builders/metric_builder.py
import logging
from typing import List
from hydra.utils import instantiate
from omegaconf import DictConfig
from nuplan.planning.script.builders.utils.utils_type import validate_type
from sledge.autoencoder.modeling.metrics.abstract_custom_metric import AbstractCust... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/script/builders/metric_builder.py", "license": "apache-2.0", "size": 2039} |
### File: sledge/script/builders/model_builder.py
import logging
from hydra.utils import instantiate
from omegaconf import DictConfig
from nuplan.planning.script.builders.utils.utils_type import validate_type
from sledge.autoencoder.modeling.autoencoder_torch_module_wrapper import AutoencoderTorchModuleWrapper
from ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/script/builders/model_builder.py", "license": "apache-2.0", "size": 1178} |
### File: sledge/script/builders/simulation_builder.py
import logging
from pathlib import Path
from typing import List, Optional
from hydra.utils import instantiate
from omegaconf import DictConfig
from nuplan.planning.utils.multithreading.worker_pool import WorkerPool
from nuplan.planning.script.builders.metric_buil... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/script/builders/simulation_builder.py", "license": "apache-2.0", "size": 5159} |
### File: sledge/script/builders/utils/utils_config.py
import logging
from pathlib import Path
from shutil import rmtree
from omegaconf import DictConfig, OmegaConf
logger = logging.getLogger(__name__)
# TODO: maybe remove this function
def update_config_for_autoencoder_training(cfg: DictConfig) -> None:
"""
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/script/builders/utils/utils_config.py", "license": "apache-2.0", "size": 1521} |
### File: sledge/script/run_autoencoder.py
import logging
import os
from typing import Optional
import hydra
import pytorch_lightning as pl
from omegaconf import DictConfig
from nuplan.planning.script.builders.folder_builder import build_training_experiment_folder
from nuplan.planning.script.builders.logging_builder ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/script/run_autoencoder.py", "license": "apache-2.0", "size": 3597} |
### File: sledge/script/run_diffusion.py
import logging
import os
from typing import Optional
import hydra
import pytorch_lightning as pl
from omegaconf import DictConfig
from nuplan.planning.training.experiments.training import TrainingEngine
from nuplan.planning.script.builders.folder_builder import build_training_... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/script/run_diffusion.py", "license": "apache-2.0", "size": 1931} |
### File: sledge/script/run_simulation.py
import logging
import os
from typing import List, Optional, Union
import hydra
import pytorch_lightning as pl
from omegaconf import DictConfig, OmegaConf
from nuplan.planning.script.builders.simulation_callback_builder import (
build_callbacks_worker,
build_simulation... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/script/run_simulation.py", "license": "apache-2.0", "size": 3710} |
### File: sledge/script/run_sledgeboard.py
import logging
import os
from pathlib import Path
import hydra
import nest_asyncio
from hydra.utils import instantiate
from omegaconf import DictConfig
from nuplan.common.actor_state.vehicle_parameters import VehicleParameters
from sledge.sledgeboard.sledgeboard import Sledg... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/script/run_sledgeboard.py", "license": "apache-2.0", "size": 2600} |
### File: sledge/simulation/maps/sledge_map/sledge_lane.py
from functools import cached_property
from typing import List, Optional, Tuple
from shapely.geometry import Polygon, LineString
from nuplan.common.actor_state.state_representation import Point2D
from nuplan.common.maps.abstract_map_objects import (
Lane,
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/simulation/maps/sledge_map/sledge_lane.py", "license": "apache-2.0", "size": 4813} |
### File: sledge/simulation/maps/sledge_map/sledge_map.py
from __future__ import annotations
from collections import defaultdict
from typing import Any, Callable, Dict, List, Optional, Tuple, Type
import numpy as np
import numpy.typing as npt
import shapely.geometry as geom
from shapely.geometry import Point
from n... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/simulation/maps/sledge_map/sledge_map.py", "license": "apache-2.0", "size": 13050} |
### File: sledge/simulation/maps/sledge_map/sledge_map_graph.py
from dataclasses import dataclass
from typing import Dict, List, Tuple
import numpy as np
import numpy.typing as npt
import networkx as nx
from shapely.geometry import Polygon, LineString, Point
from shapely.geometry.base import CAP_STYLE
from nuplan.c... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/simulation/maps/sledge_map/sledge_map_graph.py", "license": "apache-2.0", "size": 9030} |
### File: sledge/simulation/maps/sledge_map/sledge_path.py
# TODO: remove class and merge with PDMPath in sledge.common
from typing import Any, List, Union
import numpy as np
import numpy.typing as npt
from scipy.interpolate import interp1d
from shapely.creation import linestrings
from shapely.geometry import LineSt... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/simulation/maps/sledge_map/sledge_path.py", "license": "apache-2.0", "size": 3689} |
### File: sledge/simulation/maps/sledge_map/sledge_polyline.py
import math
from functools import cached_property
from typing import List, cast
from shapely.geometry import LineString, Point
from nuplan.common.actor_state.state_representation import Point2D, StateSE2
from nuplan.common.maps.abstract_map_objects import... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/simulation/maps/sledge_map/sledge_polyline.py", "license": "apache-2.0", "size": 3445} |
### File: sledge/simulation/maps/sledge_map/sledge_roadblock.py
from functools import cached_property
from typing import List
from shapely.geometry import Polygon
from nuplan.common.maps.abstract_map_objects import LaneGraphEdgeMapObject, RoadBlockGraphEdgeMapObject, StopLine
from sledge.simulation.maps.sledge_map.s... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/simulation/maps/sledge_map/sledge_roadblock.py", "license": "apache-2.0", "size": 2361} |
### File: sledge/simulation/observation/sledge_idm/sledge_idm_agent.py
from collections import deque
from dataclasses import dataclass
from typing import Deque, Dict, List, Optional
import numpy as np
from shapely.geometry import Polygon
from shapely.geometry.base import CAP_STYLE
from shapely.ops import unary_union
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/simulation/observation/sledge_idm/sledge_idm_agent.py", "license": "apache-2.0", "size": 15895} |
### File: sledge/simulation/observation/sledge_idm/sledge_idm_agent_manager.py
from typing import Dict, List
import numpy as np
from shapely.geometry.base import CAP_STYLE
from nuplan.common.actor_state.ego_state import EgoState
from nuplan.common.actor_state.state_representation import StateSE2
from nuplan.common.ac... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/simulation/observation/sledge_idm/sledge_idm_agent_manager.py", "license": "apache-2.0", "size": 9373} |
### File: sledge/simulation/observation/sledge_idm/sledge_idm_agents_builder.py
import logging
from typing import Dict, List, Optional, Tuple
import numpy as np
from nuplan.common.actor_state.agent import Agent
from nuplan.common.actor_state.oriented_box import OrientedBox
from nuplan.common.actor_state.state_represe... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/simulation/observation/sledge_idm/sledge_idm_agents_builder.py", "license": "apache-2.0", "size": 6921} |
### File: sledge/simulation/observation/sledge_idm/utils.py
# from functools import lru_cache
# from typing import Callable, List, Optional, Set, Tuple, cast
# import numpy as np
# import numpy.typing as npt
# from scipy.spatial.transform import Rotation as R
# from shapely.geometry import LineString
# from nuplan.co... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/simulation/observation/sledge_idm/utils.py", "license": "apache-2.0", "size": 8325} |
### File: sledge/simulation/observation/sledge_idm_agents.py
from collections import defaultdict
from typing import Dict, List, Optional, Type
from nuplan.common.actor_state.tracked_objects_types import TrackedObjectType
from nuplan.common.maps.maps_datatypes import TrafficLightStatusType
from nuplan.planning.scenario... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/simulation/observation/sledge_idm_agents.py", "license": "apache-2.0", "size": 6093} |
### File: sledge/simulation/planner/pdm_planner/abstract_pdm_closed_planner.py
from typing import List, Optional
import numpy as np
from nuplan.common.actor_state.ego_state import EgoState
from nuplan.common.maps.abstract_map_objects import LaneGraphEdgeMapObject
from nuplan.planning.simulation.planner.abstract_planne... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/simulation/planner/pdm_planner/abstract_pdm_closed_planner.py", "license": "apache-2.0", "size": 6656} |
### File: sledge/simulation/planner/pdm_planner/abstract_pdm_planner.py
from abc import ABC
from typing import Dict, List, Optional, Tuple
import numpy as np
import numpy.typing as npt
from shapely.geometry import Point
from nuplan.common.actor_state.ego_state import EgoState
from nuplan.common.actor_state.state_repr... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/simulation/planner/pdm_planner/abstract_pdm_planner.py", "license": "apache-2.0", "size": 7181} |
### File: sledge/simulation/planner/pdm_planner/observation/pdm_object_manager.py
import copy
from typing import Dict, Tuple
import numpy as np
import numpy.typing as npt
from nuplan.common.actor_state.state_representation import Point2D
from nuplan.common.actor_state.tracked_objects import TrackedObject
from nuplan.c... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/simulation/planner/pdm_planner/observation/pdm_object_manager.py", "license": "apache-2.0", "size": 8379} |
### File: sledge/simulation/planner/pdm_planner/observation/pdm_observation.py
from typing import Dict, List, Optional, Tuple
import numpy as np
import shapely.creation
from shapely.geometry import Polygon
from nuplan.common.actor_state.ego_state import EgoState
from nuplan.common.actor_state.tracked_objects import T... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/simulation/planner/pdm_planner/observation/pdm_observation.py", "license": "apache-2.0", "size": 10310} |
### File: sledge/simulation/planner/pdm_planner/observation/pdm_observation_utils.py
from typing import List
from shapely.geometry import Polygon
from nuplan.common.actor_state.ego_state import EgoState
from nuplan.common.actor_state.state_representation import Point2D
from nuplan.common.maps.abstract_map import Abst... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/simulation/planner/pdm_planner/observation/pdm_observation_utils.py", "license": "apache-2.0", "size": 1610... |
### File: sledge/simulation/planner/pdm_planner/observation/pdm_occupancy_map.py
from typing import Dict, List
import numpy as np
import numpy.typing as npt
import shapely.vectorized
from nuplan.planning.simulation.occupancy_map.abstract_occupancy_map import Geometry
from shapely.strtree import STRtree
class PDMOccu... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/simulation/planner/pdm_planner/observation/pdm_occupancy_map.py", "license": "apache-2.0", "size": 3253} |
### File: sledge/simulation/planner/pdm_planner/pdm_closed_planner.py
import gc
import logging
import warnings
from typing import List, Optional, Type
from nuplan.planning.simulation.observation.observation_type import DetectionsTracks, Observation
from nuplan.planning.simulation.planner.abstract_planner import Planne... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/simulation/planner/pdm_planner/pdm_closed_planner.py", "license": "apache-2.0", "size": 3051} |
### File: sledge/simulation/planner/pdm_planner/proposal/batch_idm_policy.py
from typing import List, Union
import numpy as np
import numpy.typing as npt
from sledge.simulation.planner.pdm_planner.utils.pdm_enums import LeadingAgentIndex, StateIDMIndex
class BatchIDMPolicy:
"""
IDM policies operating on a b... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/simulation/planner/pdm_planner/proposal/batch_idm_policy.py", "license": "apache-2.0", "size": 7054} |
### File: sledge/simulation/planner/pdm_planner/proposal/pdm_generator.py
import copy
from typing import Dict, List, Optional
import numpy as np
import numpy.typing as npt
from shapely.geometry import Point, Polygon
from shapely.geometry.base import CAP_STYLE
from nuplan.common.actor_state.agent import Agent
from nu... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/simulation/planner/pdm_planner/proposal/pdm_generator.py", "license": "apache-2.0", "size": 17882} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.