<commit_before># Copyright (C) 2015 <NAME>
# All rights reserved.
#
# This file is part of yambopy
#
#
from yambopy.inputfile import YamboIn
import os

def breaking_symmetries(efield1,efield2=[0,0,0],folder='.',RmTimeRev=True):
# Breaks the symmetries for a given field.
# Second field used in circular polarized pump configuration
# RmTimeRev : Remove time symmetry is set True by default
  os.system('mkdir -p %s'%folder)
  os.system('cp -r database/SAVE %s'%folder)
  ypp = YamboIn('ypp_ph -n -V all',folder=folder,filename='ypp.in')
  ypp['Efield1'] = efield1 # Field in the X-direction
  ypp['Efield2'] = efield2 # Field in the X-direction
  if RmTimeRev:
    ypp.arguments.append('RmTimeRev')   # Remove Time Symmetry
  ypp.write('%s/ypp.in'%folder)
  os.system('cd %s ; ypp_ph -F ypp.in'%folder )
  os.system('cd %s ; cd FixSymm; yambo '%folder )
  os.system('rm -r %s/SAVE'%folder)
  os.system('mv %s/FixSymm/SAVE %s/'%(folder,folder))
  os.system('rm -r %s/FixSymm'%folder)<commit_msg>Re-added recipe to collect all the files in folder<commit_after># Copyright (C) 2015 <NAME>
# All rights reserved.
#
# This file is part of yambopy
#
#
from yambopy import *
import os

def pack_files_in_folder(folder,save_folder=None):
    """
     Pack the output files in a folder to json files
    """
    if not save_folder: save_folder = folder
    #pack the files in .json files
    for dirpath,dirnames,filenames in os.walk(folder):
        #check if there are some output files in the folder
        if ([ f for f in filenames if 'o-' in f ]):
            y = YamboOut(dirpath,save_folder=save_folder)
            y.pack()

def breaking_symmetries(efield1,efield2=[0,0,0],folder='.',RmTimeRev=True):
# Breaks the symmetries for a given field.
# Second field used in circular polarized pump configuration
# RmTimeRev : Remove time symmetry is set True by default
  os.system('mkdir -p %s'%folder)
  os.system('cp -r database/SAVE %s'%folder)
  ypp = YamboIn('ypp_ph -n -V all',folder=folder,filename='ypp.in')
  ypp['Efield1'] = efield1 # Field in the X-direction
  ypp['Efield2'] = efield2 # Field in the X-direction
  if RmTimeRev:
    ypp.arguments.append('RmTimeRev')   # Remove Time Symmetry
  ypp.write('%s/ypp.in'%folder)
  os.system('cd %s ; ypp_ph -F ypp.in'%folder )
  os.system('cd %s ; cd FixSymm; yambo '%folder )
  os.system('rm -r %s/SAVE'%folder)
  os.system('mv %s/FixSymm/SAVE %s/'%(folder,folder))
  os.system('rm -r %s/FixSymm'%folder)
{'fraction_non_alphanumeric': 0.13721498371335505, 'fraction_numerical': 0.010586319218241042, 'mean_word_length': 3.9837728194726165, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6094412', 'n_tokens_mistral': 922, 'n_tokens_neox': 896, 'n_words': 250}