# Path: graphscale/check.py
# def isinst(obj: Any, ttype: Type, _msg: str=None) -> None:
# def invariant(condition: Any, msg: str) -> None:
# def failed(msg: str) -> NoReturn:
# 
# Path: graphscale/utils.py
# def is_camel_case(string: str) -> bool:
#     """Is the string potentially camel case? Only checks for capital letters currently"""
#     return bool(re.search('[A-Z]', string))
# 
# def to_snake_case(camel_case: str) -> str:
#     """Convert a camel case string to snake case. e.g. fooBar ==> foo_bar"""
#     with_underscores = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', camel_case)
#     return re.sub('([a-z0-9])([A-Z])', r'\1_\2', with_underscores).lower()


from datetime import datetime
from enum import Enum, auto
from typing import NamedTuple, List, Any, Union
from uuid import UUID
from graphql.language.ast import (
    EnumTypeDefinition, InputObjectTypeDefinition, ListType, NamedType, NonNullType,
    ObjectTypeDefinition, IntValue, StringValue, BooleanValue, Node, TypeDefinition, Value,
    InputValueDefinition, Directive, FieldDefinition, Type
)
from graphql.language.parser import parse
from graphql.language.source import Source
from graphscale import check
from graphscale.utils import is_camel_case, to_snake_case
    edge_name: str
    edge_id: int
    field: str


class DeletePentData(NamedTuple):
    type: str


FieldVarietalsUnion = Union[EdgeToStoredIdData, DeletePentData]


class GrappleFieldData(NamedTuple):
    name: str
    type_ref: GrappleTypeRef
    args: Any
    field_varietal: FieldVarietal
    field_varietal_data: FieldVarietalsUnion


class GrappleField(GrappleFieldData):
    @property
    def is_custom_field(self) -> bool:
        return self.field_varietal == FieldVarietal.CUSTOM

    @property
    def python_name(self) -> str:
        if self.name == 'id':
            return 'obj_id'
        name = self.name

# Path: graphscale/check.py
# def isinst(obj: Any, ttype: Type, _msg: str=None) -> None:
# def invariant(condition: Any, msg: str) -> None:
# def failed(msg: str) -> NoReturn:
# 
# Path: graphscale/utils.py
# def is_camel_case(string: str) -> bool:
#     """Is the string potentially camel case? Only checks for capital letters currently"""
#     return bool(re.search('[A-Z]', string))
# 
# def to_snake_case(camel_case: str) -> str:
#     """Convert a camel case string to snake case. e.g. fooBar ==> foo_bar"""
#     with_underscores = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', camel_case)
#     return re.sub('([a-z0-9])([A-Z])', r'\1_\2', with_underscores).lower()


# Path: graphscale/grapple/parser.py
from datetime import datetime
from enum import Enum, auto
from typing import NamedTuple, List, Any, Union
from uuid import UUID
from graphql.language.ast import (
    EnumTypeDefinition, InputObjectTypeDefinition, ListType, NamedType, NonNullType,
    ObjectTypeDefinition, IntValue, StringValue, BooleanValue, Node, TypeDefinition, Value,
    InputValueDefinition, Directive, FieldDefinition, Type
)
from graphql.language.parser import parse
from graphql.language.source import Source
from graphscale import check
from graphscale.utils import is_camel_case, to_snake_case

    edge_name: str
    edge_id: int
    field: str


class DeletePentData(NamedTuple):
    type: str


FieldVarietalsUnion = Union[EdgeToStoredIdData, DeletePentData]


class GrappleFieldData(NamedTuple):
    name: str
    type_ref: GrappleTypeRef
    args: Any
    field_varietal: FieldVarietal
    field_varietal_data: FieldVarietalsUnion


class GrappleField(GrappleFieldData):
    @property
    def is_custom_field(self) -> bool:
        return self.field_varietal == FieldVarietal.CUSTOM

    @property
    def python_name(self) -> str:
        if self.name == 'id':
            return 'obj_id'
        name = self.name

        if is_camel_case(name):