import hashlib import io import os import random import string import pandas as pd from github import Github, GithubObject, UnknownObjectException from uuid import UUID from lxml import etree from sqlalchemy import desc from sqlalchemy.exc import IntegrityError from crc import session, app from crc.api.common import ApiError from crc.models.data_store import DataStoreModel from crc.models.file import FileType, FileDataModel, FileModel, LookupFileModel, LookupDataModel from crc.models.workflow import WorkflowModel from crc.services.cache_service import cache from crc.services.user_service import UserService import re def camel_to_snake(camel): """ make a camelcase from a snakecase with a few things thrown in - we had a case where we were parsing a spreadsheet and using the headings as keys in an object one of the headings was "Who Uploads?" """ camel = camel.strip() camel = re.sub(' ', '', camel) camel = re.sub('?', '', camel) return re.sub(r'(?' dmn_file = prefix + etree.tostring(root) return dmn_file