<commit_before>import synapseclient
from synapseclient import File, Project, Folder, Table, Schema, Link, Wiki, Activity, exceptions
import time
from synapseclient.exceptions import *
import tempfile
import re
############################################################
##                 Copy Functions                         ##
############################################################

def copy(syn, entity, destinationId=None, copyWikiPage=True, **kwargs):
    """
    Copies synapse entities including the wikis

    :param entity:          A synapse entity ID

    :param destinationId:   Synapse ID of a folder/project that the copied entity is being copied to

    :param copyWikiPage:    Determines whether the wiki of the entity is copied over
                            Default is True

    :param copyTable:       Determines whether tables are copied
                            Default is True

    :param kwargs:          Parameters that can be passed to the hidden copy functions called
    """
    mapping = kwargs.get('mapping', dict())
    updateLinks = kwargs.get('updateLinks', True)
    updateSynIds = kwargs.get('updateSynIds', True)

    mapping = _copyRecursive(syn, entity, destinationId, mapping=mapping,**kwargs)
    if copyWikiPage:
        for oldEnt in mapping:
            newWikig = copyWiki(syn, oldEnt, mapping[oldEnt], updateLinks=updateLinks, updateSynIds=updateSynIds, entityMap=mapping)
    return(mapping)

#Recursive copy function to return mapping    
def _copyRecursive(syn, entity, destinationId, mapping = dict(), **kwargs):<commit_msg>Add to kwargs<commit_after>import synapseclient
from synapseclient import File, Project, Folder, Table, Schema, Link, Wiki, Activity, exceptions
import time
from synapseclient.exceptions import *
import tempfile
import re
############################################################
##                 Copy Functions                         ##
############################################################

def copy(syn, entity, destinationId=None, copyWikiPage=True, **kwargs):
    """
    Copies synapse entities including the wikis

    :param entity:          A synapse entity ID

    :param destinationId:   Synapse ID of a folder/project that the copied entity is being copied to

    :param copyWikiPage:    Determines whether the wiki of the entity is copied over
                            Default is True

    :param copyTable:       Determines whether tables are copied
                            Default is True

    :param kwargs:          Parameters that can be passed to the hidden copy functions called
    """
    mapping = kwargs.get('mapping', dict())
    updateLinks = kwargs.get('updateLinks', True)
    updateSynIds = kwargs.get('updateSynIds', True)
    entitySubPageId = kwargs.get('entitySubPageId',None)
    destinationSubPageId = kwargs.get('destinationSubPageId',None)

    mapping = _copyRecursive(syn, entity, destinationId, mapping=mapping,**kwargs)
    if copyWikiPage:
        for oldEnt in mapping:
            newWikig = copyWiki(syn, oldEnt, mapping[oldEnt], entitySubPageId=entitySubPageId, destinationSubPageId=destinationSubPageId, updateLinks=updateLinks, updateSynIds=updateSynIds, entityMap=mapping)
    return(mapping)

#Recursive copy function to return mapping    
def _copyRecursive(syn, entity, destinationId, mapping = dict(), **kwargs):
{'fraction_non_alphanumeric': 0.14056939501779359, 'fraction_numerical': 0.0, 'mean_word_length': 3.467549668874172, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1638875', 'n_tokens_mistral': 851, 'n_tokens_neox': 823, 'n_words': 281}