def link_technosphere_by_activity_hash(db, external_db_name=None, fields=None):
    'Link technosphere exchanges using ``activity_hash`` function.\n\n    If ``external_db_name``, link against a different database; otherwise link internally.\n\n    If ``fields``, link using only certain fields.'
    TECHNOSPHERE_TYPES = {'technosphere', 'substitution', 'production'}
    if (external_db_name is not None):
        if (external_db_name not in databases):
            raise StrategyError("Can't find external database {}".format(external_db_name))
        other = (obj for obj in Database(external_db_name) if (obj.get('type', 'process') == 'process'))
        internal = False
    else:
        other = None
        internal = True
    return link_iterable_by_fields(db, other, internal=internal, kind=TECHNOSPHERE_TYPES, fields=fields)
Link technosphere exchanges using ``activity_hash`` function.

If ``external_db_name``, link against a different database; otherwise link internally.

If ``fields``, link using only certain fields.
def link_technosphere_by_activity_hash(db, external_db_name=None, fields=None):
    'Link technosphere exchanges using ``activity_hash`` function.\n\n    If ``external_db_name``, link against a different database; otherwise link internally.\n\n    If ``fields``, link using only certain fields.'
    TECHNOSPHERE_TYPES = {'technosphere', 'substitution', 'production'}
    if (external_db_name is not None):
        if (external_db_name not in databases):
            raise StrategyError("Can't find external database {}".format(external_db_name))
        other = (obj for obj in Database(external_db_name) if (obj.get('type', 'process') == 'process'))
        internal = False
    else:
        other = None
        internal = True
    return link_iterable_by_fields(db, other, internal=internal, kind=TECHNOSPHERE_TYPES, fields=fields)