<commit_before>import system
import os
from PyQt4 import QtGui

try:
    from ctypes import *
    importSuccess = True
    
    class WIN32MEMORYSTATUS(Structure):
        """ Structure that represents memoory information returned by Windows API"""
        _fields_ = [
            ('dwLength', c_ulong),
            ('dwMemoryLoad', c_ulong),
            ('dwTotalPhys', c_ulong),
            ('dwAvailPhys', c_ulong),
            ('dwTotalPageFile', c_ulong),
            ('dwAvailPageFile', c_ulong),
            ('dwTotalVirtual', c_ulong),
            ('dwAvailVirtual', c_ulong)
            ]

except ImportError:
    importSuccess = False
    

def parse_meminfo():
    """ 
    parse_meminfo() -> int
    Calls Windows 32 API GlobalMemoryStatus(Ex) to get memory information 
    It requires ctypes module
    
    """ 
    try:
        kernel32 = windll.kernel32

        result = WIN32MEMORYSTATUS()
        result.dwLength = sizeof(WIN32MEMORYSTATUS)
        kernel32.GlobalMemoryStatus(byref(result))
    except:
        return -1
    return result.dwTotalPhys

def guessTotalMemory():
    if importSuccess:
        return parse_meminfo()
    else:
        return -1

def temporaryDirectory():
    if os.environ.has_key('TMP'):
        return os.environ['TMP'] + '\\'
    elif os.environ.has_key('TEMP'):
        return os.environ['TEMP'] + '\\'
    else:
        return 'c:/'

def homeDirectory():
    # FIXME: get the right one
    if len(os.environ['HOMEPATH']) == 0:
	return '\\'
    else:
	return os.environ['HOMEDRIVE'] + os.environ['HOMEPATH']

def remoteCopyProgram():
    return "pscp -P"

def remoteShellProgram():
    return "plink -P"

def graphVizDotCommandLine():
    return '"' + system.visTrailsRootDirectory() + '\graphviz\dot" -Tplain -o'

def removeGraphvizTemporaries():
    pass

import shutil

def link_or_copy(fr, to):
    shutil.copyfile(fr, to)


def getClipboard():
   return QtGui.QClipboard.Clipboard
<commit_msg>Removed import system Changed graphVizDotCommandLine(): fixed dot path on Windows<commit_after>import os
from PyQt4 import QtGui

try:
    from ctypes import *
    importSuccess = True
    
    class WIN32MEMORYSTATUS(Structure):
        """ Structure that represents memoory information returned by Windows API"""
        _fields_ = [
            ('dwLength', c_ulong),
            ('dwMemoryLoad', c_ulong),
            ('dwTotalPhys', c_ulong),
            ('dwAvailPhys', c_ulong),
            ('dwTotalPageFile', c_ulong),
            ('dwAvailPageFile', c_ulong),
            ('dwTotalVirtual', c_ulong),
            ('dwAvailVirtual', c_ulong)
            ]

except ImportError:
    importSuccess = False
    

def parse_meminfo():
    """ 
    parse_meminfo() -> int
    Calls Windows 32 API GlobalMemoryStatus(Ex) to get memory information 
    It requires ctypes module
    
    """ 
    try:
        kernel32 = windll.kernel32

        result = WIN32MEMORYSTATUS()
        result.dwLength = sizeof(WIN32MEMORYSTATUS)
        kernel32.GlobalMemoryStatus(byref(result))
    except:
        return -1
    return result.dwTotalPhys

def guessTotalMemory():
    if importSuccess:
        return parse_meminfo()
    else:
        return -1

def temporaryDirectory():
    if os.environ.has_key('TMP'):
        return os.environ['TMP'] + '\\'
    elif os.environ.has_key('TEMP'):
        return os.environ['TEMP'] + '\\'
    else:
        return 'c:/'

def homeDirectory():
    # FIXME: get the right one
    if len(os.environ['HOMEPATH']) == 0:
	return '\\'
    else:
	return os.environ['HOMEDRIVE'] + os.environ['HOMEPATH']

def remoteCopyProgram():
    return "pscp -P"

def remoteShellProgram():
    return "plink -P"

def graphVizDotCommandLine():
    return 'dot -Tplain -o'

def removeGraphvizTemporaries():
    pass

import shutil

def link_or_copy(fr, to):
    shutil.copyfile(fr, to)


def getClipboard():
   return QtGui.QClipboard.Clipboard

{'fraction_non_alphanumeric': 0.11409567664364288, 'fraction_numerical': 0.00920951650038373, 'mean_word_length': 2.5970561177552898, 'pattern_counts': {'":': 0, '<': 3, '<?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': '501036', 'n_tokens_mistral': 1228, 'n_tokens_neox': 1233, 'n_words': 294}