<commit_before>#!/usr/bin/python
"""
Helper methods for database backup and restore.
"""

import subprocess
import next.constants as constants

def make_mongodump(name):
    print "in make_mongodump"
    subprocess.call(('/usr/bin/mongodump -vvvvv --host {hostname}:{port} '
                     '--out dump/mongo_dump').format(hostname=constants.MONGODB_HOST,
                                                      port=constants.MONGODB_PORT),
                    shell=True)
    subprocess.call(('tar czf {path}/{name} '
                     'dump/mongo_dump').format(path='/dump',
                                                name=name),
                    shell=True)
    
    return 'dump/{}.tar.gz'.format(name)
    
def remove_mongodump(name):
    subprocess.call(('rm {path}/{name}').format(path='/dump',
                                                name=name),
                    shell=True)<commit_msg>Having relative path issues.<commit_after>#!/usr/bin/python
"""
Helper methods for database backup and restore.
"""

import subprocess
import next.constants as constants

def make_mongodump(name):
    subprocess.call(('/usr/bin/mongodump -vvvvv --host {hostname}:{port} '
                     '--out dump/mongo_dump').format(hostname=constants.MONGODB_HOST,
                                                      port=constants.MONGODB_PORT),
                    shell=True)
    subprocess.call(('tar czf {path}/{name} '
                     'dump/mongo_dump').format(path='dump',
                                                name=name),
                    shell=True)
    
    return 'dump/{}.tar.gz'.format(name)
    
def remove_mongodump(name):
    subprocess.call(('rm {path}/{name}').format(path='/dump',
                                                name=name),
                    shell=True)
{'fraction_non_alphanumeric': 0.12609649122807018, 'fraction_numerical': 0.0, 'mean_word_length': 1.5524475524475525, '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': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7294153', 'n_tokens_mistral': 489, 'n_tokens_neox': 484, 'n_words': 81}