<commit_before># """
# BioMed Central harvester of public projects for the SHARE Notification Service
# Note: At the moment, this harvester only harvests basic data on each article, and does
# not make a seperate request for additional metadata for each record.
#
# Example API query: http://www.biomedcentral.com/webapi/1.0/latest_articles.json
# """

"""
Stepic.org harvester of MOOC-online courses for SHARE Notification Service
Example API query: https://stepic.org:443/api/lessons/100
"""


from __future__ import unicode_literals

import json
import logging
from dateutil.parser import parse
import pycountry

from scrapi import requests
from scrapi.base import JSONHarvester
from scrapi.linter.document import RawDocument

logger = logging.getLogger(__name__)


def process_owner(owners_id):
    logger.info(owners_id)
    resp = requests.get("https://stepic.org:443/api/users/" + str(owners_id)).json()
    try:
        person = resp[u'users'][0]
    except KeyError:
        person = {u'first_name': 'None', u'last_name': 'None'}
    owner = {
            'name': " ".join([person[u'first_name'], person[u'last_name']]),
            'givenName': person[u'first_name'],
            'additionalName': '',
            'familyName': person[u'last_name'],
            'email': '',
            'sameAs': [],
    }
    return [owner]

<commit_msg>codestyle fix<commit_after># """
# BioMed Central harvester of public projects for the SHARE Notification Service
# Note: At the moment, this harvester only harvests basic data on each article, and does
# not make a seperate request for additional metadata for each record.
#
# Example API query: http://www.biomedcentral.com/webapi/1.0/latest_articles.json
# """

"""
Stepic.org harvester of MOOC-online courses for SHARE Notification Service
Example API query: https://stepic.org:443/api/lessons/100
"""


from __future__ import unicode_literals

import json
import logging
from dateutil.parser import parse
import pycountry

from scrapi import requests
from scrapi.base import JSONHarvester
from scrapi.linter.document import RawDocument

logger = logging.getLogger(__name__)


def process_owner(owners_id):
    logger.info(owners_id)
    resp = requests.get("https://stepic.org:443/api/users/" + str(owners_id)).json()
    try:
        person = resp[u'users'][0]
    except KeyError:
        person = {u'first_name': 'None', u'last_name': 'None'}
    owner = {
        'name': " ".join([person[u'first_name'], person[u'last_name']]),
        'givenName': person[u'first_name'],
        'additionalName': '',
        'familyName': person[u'last_name'],
        'email': '',
        'sameAs': [],
    }
    return [owner]


{'fraction_non_alphanumeric': 0.12266267763649963, 'fraction_numerical': 0.008975317875841436, 'mean_word_length': 3.7597864768683276, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, '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': '6510807', 'n_tokens_mistral': 835, 'n_tokens_neox': 793, 'n_words': 225}