<commit_before>#!/usr/bin/env python

from __future__ import unicode_literals, absolute_import

try:
    import requests
except ImportError:
    raise ImportError('The requests library is required to use the '
                      'Neo4j exporter module.')

# Alias str to unicode with unicode_literals imported
try:
    str = unicode
except NameError:
    pass


import json


# Default URI to Neo4j REST endpoint
DEFAULT_URI = 'http://localhost:7474/db/data/'

# Endpoint for the single transaction
TRANSACTION_URI_TMPL = '{}transaction/commit'

# Cypher statement template for a node
CREATE_NODE_STMT = 'CREATE ({ref}{labels}{props})'
MERGE_NODE_STMT = 'MERGE ({ref}{labels}{props}){oncreate}{onmatch}'

# Cypher statement template for a relationship
CREATE_REL_STMT = 'CREATE ({start})-[:{rtype}{props}]->({end})'
MERGE_REL_STMT = 'MERGE ({start})-[{ref}:{rtype}{props}]->({end}){oncreate}{onmatch}'  # noqa

# Supported property value types:
# http://docs.neo4j.org/chunked/2.0.0/graphdb-neo4j-properties.html
VALID_TYPES = (bool, int, float, str, bytes)


def cref(index):
    "Returns a Cypher reference name based on a positional index."
    return 'x{}'.format(index)


def stringify(value):
    if isinstance(value, list):<commit_msg>Add missing `ref` string format placeholder<commit_after>#!/usr/bin/env python

from __future__ import unicode_literals, absolute_import

try:
    import requests
except ImportError:
    raise ImportError('The requests library is required to use the '
                      'Neo4j exporter module.')

# Alias str to unicode with unicode_literals imported
try:
    str = unicode
except NameError:
    pass


import json


# Default URI to Neo4j REST endpoint
DEFAULT_URI = 'http://localhost:7474/db/data/'

# Endpoint for the single transaction
TRANSACTION_URI_TMPL = '{}transaction/commit'

# Cypher statement template for a node
CREATE_NODE_STMT = 'CREATE ({ref}{labels}{props})'
MERGE_NODE_STMT = 'MERGE ({ref}{labels}{props}){oncreate}{onmatch}'

# Cypher statement template for a relationship
CREATE_REL_STMT = 'CREATE ({start})-[{ref}:{rtype}{props}]->({end})'
MERGE_REL_STMT = 'MERGE ({start})-[{ref}:{rtype}{props}]->({end}){oncreate}{onmatch}'  # noqa

# Supported property value types:
# http://docs.neo4j.org/chunked/2.0.0/graphdb-neo4j-properties.html
VALID_TYPES = (bool, int, float, str, bytes)


def cref(index):
    "Returns a Cypher reference name based on a positional index."
    return 'x{}'.format(index)


def stringify(value):
    if isinstance(value, list):
{'fraction_non_alphanumeric': 0.12831683168316832, 'fraction_numerical': 0.008712871287128714, 'mean_word_length': 4.6891891891891895, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '5585326', 'n_tokens_mistral': 847, 'n_tokens_neox': 800, 'n_words': 222}