<commit_before># -*- coding: utf-8 -*-

from __future__ import absolute_import, division, print_function, unicode_literals

import re

import lxml.etree

from eutils.exceptions import *
import eutils.xmlfacades.base

genome_ac_re = re.compile('^(?:NC)_')
transcript_ac_re = re.compile('^(?:ENST|NG|NM)_')
protein_ac_re = re.compile('^(?:ENSP|NP)_')


class ExchangeSet(eutils.xmlfacades.base.Base):

    _root_tag = '{http://www.ncbi.nlm.nih.gov/SNP/docsum}ExchangeSet'

    def __iter__(self):
        return (Rs(n) for n in self._xml_root.iterfind('docsum:Rs', namespaces={'docsum': self._xml_root.nsmap[None]}))

    def __len__(self):
        return len(self._xml_root.findall('docsum:Rs', namespaces={'docsum': self._xml_root.nsmap[None]}))


class Rs(object):

    _root_tag = 'Rs'

    def __init__(self, rs_node):
        assert rs_node.tag == '{http://www.ncbi.nlm.nih.gov/SNP/docsum}Rs'
        self._n = rs_node

    #def __str__(self):
    #    return "Rs({self.id})".format(self=self)

    @property
    def rs_id(self):
        return 'rs' + self._n.get('rsId')

    @property
    def withdrawn(self):
        return 'notwithdrawn' not in self._n.get('snpType')

    @property
    def orient(self):
        return self._n.get('orient')

    @property
    def strand(self):
        return self._n.get('strand')<commit_msg>update dbSNP for the change to https<commit_after># -*- coding: utf-8 -*-

from __future__ import absolute_import, division, print_function, unicode_literals

import re

import lxml.etree

from eutils.exceptions import *
import eutils.xmlfacades.base

genome_ac_re = re.compile('^(?:NC)_')
transcript_ac_re = re.compile('^(?:ENST|NG|NM)_')
protein_ac_re = re.compile('^(?:ENSP|NP)_')


class ExchangeSet(eutils.xmlfacades.base.Base):

    _root_tag = '{https://www.ncbi.nlm.nih.gov/SNP/docsum}ExchangeSet'

    def __iter__(self):
        return (Rs(n) for n in self._xml_root.iterfind('docsum:Rs', namespaces={'docsum': self._xml_root.nsmap[None]}))

    def __len__(self):
        return len(self._xml_root.findall('docsum:Rs', namespaces={'docsum': self._xml_root.nsmap[None]}))


class Rs(object):

    _root_tag = 'Rs'

    def __init__(self, rs_node):
        assert rs_node.tag == '{https://www.ncbi.nlm.nih.gov/SNP/docsum}Rs'
        self._n = rs_node

    #def __str__(self):
    #    return "Rs({self.id})".format(self=self)

    @property
    def rs_id(self):
        return 'rs' + self._n.get('rsId')

    @property
    def withdrawn(self):
        return 'notwithdrawn' not in self._n.get('snpType')

    @property
    def orient(self):
        return self._n.get('orient')

    @property
    def strand(self):
        return self._n.get('strand')
{'fraction_non_alphanumeric': 0.1580705009276438, 'fraction_numerical': 0.0007421150278293135, 'mean_word_length': 3.54637436762226, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 4, 'xml': 14}, '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': '5364804', 'n_tokens_mistral': 1011, 'n_tokens_neox': 943, 'n_words': 175}