<commit_before>#!/usr/bin/python3

import requests
import os

try:
    import ConfigParser
except ImportError:
    import configparser as ConfigParser

DEBUG = False
if DEBUG:
    import http.client
    http.client.HTTPConnection.debuglevel = 1

SHARETYPE_USER = 0
SHARETYPE_GROUP = 1
SHARETYPE_PUBLIC = 3

PERMISSION_READ = 1
PERMISSION_UPDATE = 2
PERMISSION_CREATE = 4
PERMISSION_DELETE = 8
PERMISSION_SHARE = 16

API_PATH = '/ocs/v1.php/apps/files_sharing/api/v1'
SHARE_PATH = '/public.php?service=files&t='
CONFIG_PATH = os.path.expanduser('~/.local/share/data/ownCloud')


def check_status(jsonfeed):
    if jsonfeed['ocs']['meta']['statuscode'] != 100:
        raise OCShareException(jsonfeed['ocs']['meta'])


def check_request(request):
    if request.status_code != 200:
        request.raise_for_status()
        raise requests.exceptions.HTTPError(
            '%s Client Error: %s' % (request.status_code, request.reason))


def full_path_to_cloud(fullPath):
    paths = []
    for f in os.listdir(CONFIG_PATH+'/folders'):
        config = ConfigParser.ConfigParser()
        config.read('%s/%s' % (CONFIG_PATH+'/folders', f))<commit_msg>Add config file path for OSX<commit_after>#!/usr/bin/python3

import requests
import os

try:
    import ConfigParser
except ImportError:
    import configparser as ConfigParser

DEBUG = False
if DEBUG:
    import http.client
    http.client.HTTPConnection.debuglevel = 1

SHARETYPE_USER = 0
SHARETYPE_GROUP = 1
SHARETYPE_PUBLIC = 3

PERMISSION_READ = 1
PERMISSION_UPDATE = 2
PERMISSION_CREATE = 4
PERMISSION_DELETE = 8
PERMISSION_SHARE = 16

API_PATH = '/ocs/v1.php/apps/files_sharing/api/v1'
SHARE_PATH = '/public.php?service=files&t='
from sys import platform as _platform
if _platform == "linux" or _platform == "linux2":
    CONFIG_PATH = os.path.expanduser('~/.local/share/data/ownCloud')
elif _platform == "darwin":
    CONFIG_PATH = os.path.expanduser('~/Library/Application Support/ownCloud')

def check_status(jsonfeed):
    if jsonfeed['ocs']['meta']['statuscode'] != 100:
        raise OCShareException(jsonfeed['ocs']['meta'])


def check_request(request):
    if request.status_code != 200:
        request.raise_for_status()
        raise requests.exceptions.HTTPError(
            '%s Client Error: %s' % (request.status_code, request.reason))


def full_path_to_cloud(fullPath):
    paths = []
    for f in os.listdir(CONFIG_PATH+'/folders'):
        config = ConfigParser.ConfigParser()
        config.read('%s/%s' % (CONFIG_PATH+'/folders', f))
{'fraction_non_alphanumeric': 0.12455232789494627, 'fraction_numerical': 0.015519299641862315, 'mean_word_length': 4.089068825910931, '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': '4462913', 'n_tokens_mistral': 873, 'n_tokens_neox': 832, 'n_words': 176}