# Path: veidt/utils/general_utils.py
# def serialize_veidt_object(instance):
#     if instance is None:
#         return None
#     if hasattr(instance, 'get_config'):
#         return {
#             'class_name': instance.__class__.__name__,
#             'config': instance.get_config()
#         }
#     if hasattr(instance, '__name__'):
#         return instance.__name__
#     else:
#         raise ValueError('Cannot serialize', instance)
# 
# def deserialize_veidt_object(identifier, module_objects=None,
#                              printable_module_name='object'):
#     if isinstance(identifier, dict):
#         # dealing with configuration dictionary
#         config = identifier
#         if 'class_name' not in config or 'config' not in config:
#             raise ValueError('Improper config format: ' + str(config))
#         class_name = config['class_name']
#         module_objects = module_objects or {}
#         cls = module_objects.get(class_name)
#         if cls is None:
#             raise ValueError('Unknown ' + printable_module_name +
#                              ': ' + class_name)
#         return cls(**config['config'])
# 
#     elif isinstance(identifier, str):
#         function_name = identifier
#         fn = module_objects.get(function_name)
#         if fn is None:
#             raise ValueError('Unknown ' + printable_module_name +
#                              ':' + function_name)
#         return fn


import unittest
import numpy as np
import os
from veidt.utils.general_utils import serialize_veidt_object, deserialize_veidt_object

file_path = os.path.dirname(__file__)


def test_func():
    return 1


class DummyClass:
    def __init__(self):
        self.name = 'dummy'

    def get_config(self):
        return {"config": "Dummyclass config"}

class TestGeneralUtil(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        cls.x1 = np.array([1, 2, 3])
        cls.x2 = np.array([4, 5, 6])
        cls.x3 = np.array([1, 1, 1])
        cls.x4 = np.array([1, 2, 3])

    def test_serialization(self):

# Path: veidt/utils/general_utils.py
# def serialize_veidt_object(instance):
#     if instance is None:
#         return None
#     if hasattr(instance, 'get_config'):
#         return {
#             'class_name': instance.__class__.__name__,
#             'config': instance.get_config()
#         }
#     if hasattr(instance, '__name__'):
#         return instance.__name__
#     else:
#         raise ValueError('Cannot serialize', instance)
# 
# def deserialize_veidt_object(identifier, module_objects=None,
#                              printable_module_name='object'):
#     if isinstance(identifier, dict):
#         # dealing with configuration dictionary
#         config = identifier
#         if 'class_name' not in config or 'config' not in config:
#             raise ValueError('Improper config format: ' + str(config))
#         class_name = config['class_name']
#         module_objects = module_objects or {}
#         cls = module_objects.get(class_name)
#         if cls is None:
#             raise ValueError('Unknown ' + printable_module_name +
#                              ': ' + class_name)
#         return cls(**config['config'])
# 
#     elif isinstance(identifier, str):
#         function_name = identifier
#         fn = module_objects.get(function_name)
#         if fn is None:
#             raise ValueError('Unknown ' + printable_module_name +
#                              ':' + function_name)
#         return fn


# Path: veidt/tests/test_utils.py
import unittest
import numpy as np
import os
from veidt.utils.general_utils import serialize_veidt_object, deserialize_veidt_object


file_path = os.path.dirname(__file__)


def test_func():
    return 1


class DummyClass:
    def __init__(self):
        self.name = 'dummy'

    def get_config(self):
        return {"config": "Dummyclass config"}

class TestGeneralUtil(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        cls.x1 = np.array([1, 2, 3])
        cls.x2 = np.array([4, 5, 6])
        cls.x3 = np.array([1, 1, 1])
        cls.x4 = np.array([1, 2, 3])

    def test_serialization(self):

        self.assertEqual(serialize_veidt_object(test_func), "test_func")