Parse description of the book.

    Args:
        details (obj): HTMLElement containing slice of the page with details.

    Returns:
        str/None: Details as string with currency or None if not found.
549519
def _parse_description(details):
    
    description = details.find("div", {"class": "detailPopis"})

    # description not found
    if not description:
        return None

    # remove links to ebook version
    ekniha = description[0].find("div", {"class": "ekniha"})
    if ekniha:
        ekniha[0].replaceWith(dhtmlparser.HTMLElement(""))

    # remove links to other books from same cathegory
    detail = description[0].find("p", {"class": "detailKat"})
    if detail:
        detail[0].replaceWith(dhtmlparser.HTMLElement(""))

    # remove all HTML elements
    description = dhtmlparser.removeTags(description[0]).strip()

    # description is blank
    if not description:
        return None

    return description
743108
def details_handler(args):
    

    repo = _open_repo(args)
    _, anchor = _get_anchor(repo, args['<anchor-id>'])

    print("""path: {file_path}
encoding: {encoding}

[before]
{before}
--------------

[topic]
{topic}
--------------

[after]
{after}
--------------

offset: {offset}
width: {width}""".format(
        file_path=anchor.file_path,
        encoding=anchor.encoding,
        before=anchor.context.before,
        topic=anchor.context.topic,
        after=anchor.context.after,
        offset=anchor.context.offset,
        width=anchor.context.width))

    return ExitCode.OK
340003
async def detail(self, **kwargs):
        '''
        
        '''
        try:
            pk = self.pk_type(kwargs.get('pk'))
            obj = await self._meta.object_class.find_one(self.db, {self.pk: pk})
            if obj:
                return await obj.serialize()
            raise NotFound('Object matching the given {} with value {} was not found'.format(self.pk, str(pk)))
        except InvalidId:
            raise NotFound('Invalid ID')
1293446
def serialize_detail(self, data):
        
        if data is None:
            return ''

        # Check for a ``Data``-like object. We should assume ``True`` (all
        # data gets prepared) unless it's explicitly marked as not.
        if not getattr(data, 'should_prepare', True):
            prepped_data = data.value
        else:
            prepped_data = self.prepare(data)

        return self.serializer.serialize(prepped_data)
1347234
def get_house_detail(self, html):
        
        if "I'm not a robot" in html:
            raise exc.CaptchaError(url)

        data = {"errors": dict()}
        soup = self.get_soup(html)

        # header part, bedroom, bathroom, sqft
        header = soup.find("header", class_="zsg-content-header addr")
        if header is None:
            raise exc.ParseError(url)

        try:
            h3 = header.find("h3")
            if h3 is None:
                raise exc.ParseError

            span_list = h3.find_all("span", class_="addr_bbs")
            if len(span_list) != 3:
                raise exc.ParseError

            text = span_list[0].text
            try:
                bedroom = float_filter(text)
                data["bedroom"] = bedroom
            except:
                data["errors"][
                    "bedroom"] = "can't parse bedroom from %r" % text

            text = span_list[1].text
            try:
                bathroom = float_filter(text)
                data["bathroom"] = bathroom
            except:
                data["errors"][
                    "bathroom"] = "can't parse bathroom from %r" % text

            text = span_list[2].text
            try:
                sqft = int_filter(text)
                data["sqft"] = sqft
            except:
                data["errors"]["sqft"] = "can't parse sqft from %r" % text
        except:
            pass

        # Facts, Features, Construction, Other (FFCO)
        div_list = soup.find_all(
            "div", class_=re.compile("fact-group-container zsg-content-component"))

        for div in div_list:
            h3 = div.find("h3")
            if h3.text == "Facts":
                try:
                    facts = list()
                    for li in div.find_all("li"):
                        facts.append(li.text.strip())
                    data["facts"] = facts
                except Exception as e:
                    data["errors"]["facts"] = str(e)

            if h3.text == "Features":
                features = list()
                try:
                    for li in div.find_all("li"):
                        if '"targetDiv"' not in li.text:
                            features.append(li.text.strip())
                    data["features"] = features
                except Exception as e:
                    data["errors"]["features"] = repr(e)

            if h3.text == "Appliances Included":
                appliances = list()
                try:
                    for li in div.find_all("li"):
                        appliances.append(li.text.strip())
                    data["appliances"] = appliances
                except Exception as e:
                    data["errors"]["appliances"] = repr(e)

            if h3.text == "Additional Features":
                additional_features = list()
                try:
                    for li in div.find_all("li"):
                        additional_features.append(li.text.strip())
                    data["additional_features"] = additional_features
                except Exception as e:
                    data["errors"]["additional_features"] = repr(e)

            if h3.text == "Construction":
                construction = list()
                try:
                    for li in div.find_all("li"):
                        construction.append(li.text.strip())
                    data["construction"] = construction
                except Exception as e:
                    data["errors"]["construction"] = repr(e)

            if h3.text == "Other":
                other = list()
                try:
                    for li in div.find_all("li"):
                        other.append(li.text.strip())
                    data["other"] = other
                except Exception as e:
                    data["errors"]["other"] = repr(e)

        if len(data["errors"]) == 0:
            del data["errors"]

        if data:
            return data
        else:
            return None
1027156
def descriptionHtml(self):
        
        if self.cls is None:
            return None
        elif hasattr(self.cls, 'descriptionHtml'):
            return self.cls.descriptionHtml()
        else:
            return ''
280852
def address_detail(self):
        
        pattern = self.bothify(self.random_element(
            self.address_detail_formats))
        return self.generator.parse(pattern)
1000069
function getParamsDetails(spec_c) {
  var paras = getChildren(spec_c, 'para');
  var details = _.find(_.map(paras, function(para) {
    return getChild(para, 'parameterlist');
  }), function(obj) { return (obj != undefined); });
  return (details ? details.children : undefined);
}
564190
function _getReplyDetails (details, markup) {
	let $ = cheerio.load(markup);

	$('div.reply_options').find('b').each((i, element) => {
		let infoType = $(element).text().trim();

		// set contact name
		if (/contact\sname/i.test(infoType)) {
			$(element).next().find('li').each((i, li) => {
				details.contactName = $(li).text().trim();
			});

			return;
		}

		// set phone number and email
		if (/call/i.test(infoType)) {
			$(element).parent().find('li').each((i, li) => {
				let value = $(li).text().trim();

				// check for phone value (based on the emoji)
				if (/\u260E/.test(value)) {
					details.phoneNumber = value.substring(value.indexOf('('));
					return;
				}

				// check for email value (based on the @ symbol)
				if (/\@/.test(value)) {
					details.email = value;
				}
			});

			return;
		}
	});
}
944377
def _set_details(self, content):
        
        try:
            self.details = str(content)
        except UnicodeEncodeError:
            if sys.version_info < (3, 0):
                # If Py2 threw encode error, convert to unicode.
                self.details = unicode(content)
            else:
                # We should never hit this in Py3, if this happens, record
                # an encoded version of the content for users to handle.
                logging.error(
                    'Unable to decode "%s" in Py3, encoding in utf-8.',
                    content)
                self.details = content.encode('utf-8')
518961
def get_error_details(self):
        # type: () -> Optional[Dict[str, Any]]
        

        details = {}  # type: Dict[str, Any]

        if ERROR.details:
            details = {"xerror_details": ERROR.details}
            ERROR.details = None
            xserver_error = ctypes.create_string_buffer(1024)
            self.xlib.XGetErrorText(
                MSS.display,
                details.get("xerror_details", {}).get("error_code", 0),
                xserver_error,
                len(xserver_error),
            )
            xerror = xserver_error.value.decode("utf-8")
            if xerror != "0":
                details["xerror"] = xerror

        return details
539205
private static String getDescriptionWithoutHtml(DetectorFactory factory) {
        String detailHTML = factory.getDetailHTML();
        // cut beginning and the end of the html document
        detailHTML = trimHtml(detailHTML, "<BODY>", "</BODY>");
        // replace any amount of white space with newline between through one
        // space
        detailHTML = detailHTML.replaceAll("\\s*[\\n]+\\s*", " ");
        // remove all valid html tags
        detailHTML = detailHTML.replaceAll("<[a-zA-Z]+>", "");
        detailHTML = detailHTML.replaceAll("</[a-zA-Z]+>", "");
        // convert some of the entities which are used in current FB
        // messages.xml
        detailHTML = detailHTML.replaceAll("&nbsp;", "");
        detailHTML = detailHTML.replaceAll("&lt;", "<");
        detailHTML = detailHTML.replaceAll("&gt;", ">");
        detailHTML = detailHTML.replaceAll("&amp;", "&");
        return detailHTML.trim();
    }
244056
def _child(details):
	

	# If the details are a list
	if isinstance(details, list):

		# Create a list of options for the key
		return OptionsNode(details)

	# Else if we got a dictionary
	elif isinstance(details, dict):

		# If array is present
		if '__array__' in details:
			return ArrayNode(details)

		# Else if we have a hash
		elif '__hash__' in details:
			return HashNode(details)

		# Else if we have a type
		elif '__type__' in details:

			# If the type is a dictionary or list, this is a complex type
			if isinstance(details['__type__'], (dict,list)):
				return _child(details['__type__'])

			# Else it's just a Node
			else:
				return Node(details)

		# Else it's most likely a parent
		else:
			return Parent(details)

	# Else if we got a string
	elif isinstance(details, basestring):

		# Use the value as the type
		return Node(details)

	# Else raise an error
	else:
		raise TypeError('details')
445284
def _parse_description(self, description_text):
        """"""
        text = description_text
        text = text.strip()
        lines = text.split('\n')

        data = {}
        for line in lines:
            if ":" in line:
                idx = line.index(":")
                key = line[:idx]
                value = line[idx+1:].lstrip().rstrip()
                data[key] = value
            else:
                if isinstance(value, list) is False:
                    value = [value]
                value.append(line.lstrip().rstrip())
                data[key] = value
        return data
961515
def _error_detail(data, item):
    '''
    
    '''
    err = item['errorDetail']
    if 'code' in err:
        try:
            msg = ': '.join((
                item['errorDetail']['code'],
                item['errorDetail']['message']
            ))
        except TypeError:
            msg = '{0}: {1}'.format(
                item['errorDetail']['code'],
                item['errorDetail']['message'],
            )
    else:
        msg = item['errorDetail']['message']
    data.append(msg)
324090
async def get_details(self):
        
        data = await self._handler.details(system_id=self.system_id)
        return bson.decode_all(data)[0]
565330
def discover(self, details = False):
        ''
        if details and not (isinstance(details, str) and details.lower() == 'false'):
            return copy.deepcopy(self.discoverinfo)
        else:
            return dict((k,v.get('description', '')) for k,v in self.discoverinfo.items())