<commit_before>import os, errno
import shutil
from os import listdir
from os.path import isfile, join

def mkdir_p(path):
  try:
    os.makedirs(path)
  except OSError as exc:
    if exc.errno == errno.EEXIST and os.path.isdir(path):
       pass
    else: raise

def touch(fname):
    try:
        os.utime(fname, None)
    except:
        open(fname, 'a').close()
        
def mov_files(inputfolder, outputfolder, ds, de):
	filenamelist = os.listdir(inputfolder)
	for filename in filenamelist:
	  folderdate = filename[ds:de]
	  filenamecheck = filename[0:3]
	  if (filenamecheck == "DCS" or filenamecheck == "78A"):
		mkdir_p(os.path.join(outputfolder, folderdate))
		shutil.move((os.path.join(inputfolder, filename)), os.path.join(outputfolder, folderdate, filename))
inputfolder = '/media/untitled/ftp/pi/files/files'
inputfolder2 = '/media/untitled/ftp/pi/files/files/ipcam'
outputfolder = '/media/untitled/ftp/pictures'

mov_files(inputfolder, outputfolder, 8, 16)
mov_files(inputfolder2, outputfolder, 24, 32)<commit_msg>Made arguments so input folders could be chosen by ind. users<commit_after>import os, errno
import shutil
import argparse
from os import listdir
from os.path import isfile, join

parser = argparse.ArgumentParser(description='')
parser.add_argument("inputfolders", nargs="+", help = 'Select the input folder(s) for the program. Add the input folders&#39; paths on top ')
args = parser.parse_args()

def mkdir_p(path):
  try:
    os.makedirs(path)
  except OSError as exc:
    if exc.errno == errno.EEXIST and os.path.isdir(path):
       pass
    else: raise

def touch(fname):
    try:
        os.utime(fname, None)
    except:
        open(fname, 'a').close()
        
def mov_files(inputfolder, outputfolder):
	filenamelist = os.listdir(inputfolder)
	for filename in filenamelist:
	  filenamecheck = filename[0:3]
	  if filenamecheck == "DCS":
		ds = 8
		de = 16
	  elif filenamecheck == "78A":
	    ds = 24
	    de = 32
	  folderdate = filename[ds:de]
	  if (filenamecheck == "DCS" or filenamecheck == "78A"):
		mkdir_p(os.path.join(outputfolder, folderdate))
		shutil.move((os.path.join(inputfolder, filename)), os.path.join(outputfolder, folderdate, filename))
#inputfolder = '/media/untitled/ftp/pi/files/files/ipcam'
inputfolders= args.inputfolders
outputfolder = '/ftp/files'


#mov_files(inputfolder, outputfolder, 8, 16)
for folder in inputfolders:
	mov_files(folder, outputfolder)
{'fraction_non_alphanumeric': 0.12324234904880066, 'fraction_numerical': 0.01282051282051282, 'mean_word_length': 4.168803418803419, 'pattern_counts': {'":': 2, '<': 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': '1409268', 'n_tokens_mistral': 875, 'n_tokens_neox': 817, 'n_words': 206}