# Copyright (c) 2015, Max Fillinger <max@max-fillinger.net>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.

# The epub format specification is available at http://idpf.org/epub/201

'''Contains the EpubBuilder class to build epub2.0.1 files with the getebook
module.'''

import html
import re
import datetime
import getebook
import os.path
import re
import zipfile

__all__ = ['EpubBuilder', 'EpubTOC', 'Author']

def _normalize(name):
    '''Transform "Firstname [Middlenames] Lastname" into
    "Lastname, Firstname [Middlenames]".'''
    split = name.split()
    if len(split) == 1:
        return name
    return split[-1] + ', ' + ' '.join(name[0:-1])

def _make_starttag(tag, attrs):
    'Write a starttag.'
    out = '<' + tag
    for key in attrs:
        out += ' {}="{}"'.format(key, html.escape(attrs[key]))
    out += '>'
    return out

def _make_xml_elem(tag, text, attr = []):
    'Write a flat xml element.'
    out = '    <' + tag
    for (key, val) in attr:
        out += ' {}="{}"'.format(key, val)
    if text:
        out += '>{}</{}>\n'.format(text, tag)
    else:
        out += ' />\n'
    return out

class EpubTOC(getebook.TOC):
    'Table of contents.'
    _head = ((
      '<?xml version="1.0" encoding="UTF-8"?>\n'
      '<ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1" xml:lang="en-US">\n'
      '  \n'
      '    <meta name="dtb:uid" content="{}" />\n'
      '    <meta name="dtb:depth" content="{}" />\n'
      '    <meta name="dtb:totalPageCount" content="0" />\n'
      '    <meta name="dtb:maxPageNumber" content="0" />\n'
      '  \n'
      '  <docTitle>\n'
      '    <text>{}</text>\n'
      '  </docTitle>\n'
    ))
    _doc_author = ((
      '  <docAuthor>\n'
      '    <text>{}</text>\n'
      '  </docAuthor>\n'
    ))
    _navp = ((
      '{0}<navPoint id="nav{1}">\n'
      '{0}  <navLabel>\n'
      '{0}    <text>{2}</text>\n'
      '{0}  </navLabel>\n'
      '{0}  <content src="{3}" />\n'
    ))

    def _navp_xml(self, entry, indent_lvl):
        'Write xml for an entry and all its subentries.'
        xml = self._navp.format('  '*indent_lvl, str(entry.no), entry.text,
          entry.target)
        for sub in entry.entries:
            xml += self._navp_xml(sub, indent_lvl+1)
        xml += '  '*indent_lvl + '</navPoint>\n'
        return xml

    def write_xml(self, uid, title, authors):
        'Write the xml code for the table of contents.'
        xml = self._head.format(uid, self.max_depth, title)
        for aut in authors:
            xml += self._doc_author.format(aut)
        xml += '  <navMap>\n'
        for entry in self.entries:
            xml += self._navp_xml(entry, 2)
        xml += '  </navMap>\n</ncx>'
        return xml

class _Fileinfo:
    'Information about a component file of an epub.'
    def __init__(self, name, in_spine = True, guide_title = None,
                 guide_type = None):
        '''Initialize the object. If the file does not belong in the
        reading order, in_spine should be set to False. If it should
        appear in the guide, set guide_title and guide_type.'''
        self.name = name
        (self.ident, ext) = os.path.splitext(name)
        name_split = name.rsplit('.', 1)
        self.ident = name_split[0]
        self.in_spine = in_spine
        self.guide_title = guide_title
        self.guide_type = guide_type
        # Infer media-type from file extension
        ext = ext.lower()
        if ext in ('.htm', '.html', '.xhtml'):
            self.media_type = 'application/xhtml+xml'
        elif ext in ('.png', '.gif', '.jpeg'):
            self.media_type = 'image/' + ext
        elif ext == '.jpg':
            self.media_type = 'image/jpeg'
        elif ext == '.css':
            self.media_type = 'text/css'
        elif ext == '.ncx':
            self.media_type = 'application/x-dtbncx+xml'
        else:
            raise ValueError('Can\'t infer media-type from extension: %s' % ext)
    def manifest_entry(self):
        'Write the XML element for the manifest.'
        return _make_xml_elem('item', '',
          [
            ('href', self.name),
            ('id', self.ident),
            ('media-type', self.media_type)
          ])
    def spine_entry(self):
        '''Write the XML element for the spine.
        (Empty string if in_spine is False.)'''
        if self.in_spine:
            return _make_xml_elem('itemref', '', [('idref', self.ident)])
        else:
            return ''
    def guide_entry(self):
        '''Write the XML element for the guide.
        (Empty string if no guide title and type are given.)'''
        if self.guide_title and self.guide_type:
            return _make_xml_elem('reference', '',
              [
                ('title', self.guide_title),
                ('type', self.guide_type),
                ('href', self.name)
              ])
        else:
            return ''

class _EpubMeta:
    'Metadata entry for an epub file.'
    def __init__(self, tag, text, *args):
        '''The metadata entry is an XML element. *args is used for
        supplying the XML element's attributes as (key, value) pairs.'''
        self.tag = tag
        self.text = text
        self.attr = args
    def write_xml(self):
        'Write the XML element.'
        return _make_xml_elem(self.tag, self.text, self.attr)
    def __repr__(self):
        'Returns the text.'
        return self.text
    def __str__(self):
        'Returns the text.'
        return self.text

class _EpubDate(_EpubMeta):
    'Metadata element for the publication date.'
    _date_re = re.compile('^([0-9]{4})(-[0-9]{2}(-[0-9]{2})?)?$')
    def __init__(self, date):
        '''date must be a string of the form "YYYY[-MM[-DD]]". If it is
        not of this form, or if the date is invalid, ValueError is
        raised.'''
        m = self._date_re.match(date)
        if not m:
            raise ValueError('invalid date format')
        year = int(m.group(1))
        try:
            mon = int(m.group(2)[1:])
            if mon < 0 or mon > 12:
                raise ValueError('month must be in 1..12')
        except IndexError:
            pass
        try:
            day = int(m.group(3)[1:])
            datetime.date(year, mon, day) # raises ValueError if invalid
        except IndexError:
            pass
        self.tag = 'dc:date'
        self.text = date
        self.attr = ()

class _EpubLang(_EpubMeta):
    'Metadata element for the language of the book.'
    _lang_re = re.compile('^[a-z]{2}(-[A-Z]{2})?$')
    def __init__(self, lang):
        '''lang must be a lower-case two-letter language code,
        optionally followed by a "-" and a upper-case two-letter country
        code. (e.g., "en", "en-US", "en-UK", "de", "de-DE", "de-AT")'''
        if self._lang_re.match(lang):
            self.tag = 'dc:language'
            self.text = lang
            self.attr = ()
        else:
            raise ValueError('invalid language format')

class Author(_EpubMeta):
    '''To control the file-as and role attribute for the authors, pass
    an Author object to the EpubBuilder instead of a string. The file-as
    attribute is a form of the name used for sorting. The role attribute
    describes how the person was involved in the work.

    You ONLY need this if an author's name is not of the form
    "Given-name Family-name", or if you want to specify a role other
    than author. Otherwise, you can just pass a string.

    The value of role should be a MARC relator, e.g., "aut" for author
    or "edt" for editor. See http://www.loc.gov/marc/relators/ for a
    full list.'''
    def __init__(self, name, fileas = None, role = 'aut'):
        '''Initialize the object. If the argument "fileas" is not given,
        "Last-name, First-name" is used for the file-as attribute. If
        the argument "role" is not given, "aut" is used for the role
        attribute.'''
        if not fileas:
            fileas = _normalize(name)
        self.tag = 'dc:creator'
        self.text = name
        self.attr = (('opf:file-as', fileas), ('opf:role', role))

class _OPFfile:
    '''Class for writing the OPF (Open Packaging Format) file for an
    epub file. The OPF file contains the metadata, a manifest of all
    component files in the epub, a "spine" which specifies the reading
    order and a guide which points to important components of the book
    such as the title page.'''

    _opf = (
      '<?xml version="1.0" encoding="UTF-8"?>\n'
      '<package version="2.0" xmlns="http://www.idpf.org/2007/opf" unique_identifier="uid_id">\n'
      '  <metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/2007/opf">\n'
      '{}'
      '  </metadata>\n'
      '  <manifest>\n'
      '{}'
      '  </manifest>\n'
      '  <spine toc="toc">\n'
      '{}'
      '  </spine>\n'
      '  <guide>\n'
      '{}'
      '  </guide>\n'
      '</package>\n'
    )
    def __init__(self):
        'Initialize.'
        self.meta = []
        self.filelist = []
    def write_xml(self):
        'Write the XML code for the OPF file.'
        metadata = ''
        for elem in self.meta:
            metadata += elem.write_xml()
        manif = ''
        spine = ''
        guide = ''
        for finfo in self.filelist:
            manif += finfo.manifest_entry()
            spine += finfo.spine_entry()
            guide += finfo.guide_entry()
        return self._opf.format(metadata, manif, spine, guide)

class EpubBuilder:
    '''Builds an epub2.0.1 file. Some of the attributes of this class
    (title, uid, lang) are marked as "mandatory" because they represent
    metadata that is required by the epub specification. If these
    attributes are left unset, default values will be used.'''

    _style_css = (
      'h1, h2, h3, h4, h5, h6 {\n'
      '  text-align: center;\n'
      '}\n'
      'p {\n'
      '  text-align: justify;\n'
      '  margin-top: 0.125em;\n'
      '  margin-bottom: 0em;\n'
      '  text-indent: 1.0em;\n'
      '}\n'
      '.getebook-tp {\n'
      '  margin-top: 8em;\n'
      '}\n'
      '.getebook-tp-authors {\n'
      '  font-size: 2em;\n'
      '  text-align: center;\n'
      '  margin-bottom: 1em;\n'
      '}\n'
      '.getebook-tp-title {\n'
      '  font-weight: bold;\n'
      '  font-size: 3em;\n'
      '  text-align: center;\n'
      '}\n'
      '.getebook-tp-sub {\n'
      '  text-align: center;\n'
      '  font-weight: normal;\n'
      '  font-size: 0.8em;\n'
      '  margin-top: 1em;\n'
      '}\n'
      '.getebook-false-h {\n'
      '  font-weight: bold;\n'
      '  font-size: 1.5em;\n'
      '}\n'
      '.getebook-small-h {\n'
      '  font-style: normal;\n'
      '  font-weight: normal;\n'
      '  font-size: 0.8em;\n'
      '}\n'
    )

    _container_xml = (
      '<?xml version="1.0"?>\n'
      '<container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:container">\n'
      '  <rootfiles>\n'
      '    <rootfile full-path="package.opf" media-type="application/oebps-package+xml"/>\n'
      '  </rootfiles>\n'
      '</container>\n'
    )

    _html = (
      '<?xml version="1.0" encoding="utf-8"?>\n'
      '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\n'
      '\n'
      '  \n'
      '    <title>{}</title>\n'
      '    <meta http-equiv="content-type" content="application/xtml+xml; charset=utf-8" />\n'
      '    <link href="style.css" rel="stylesheet" type="text/css" />\n'
      '  \n'
      '  \n{}'
      '  \n'
      '\n'
    )

    _finalized = False

    def __init__(self, epub_file):
        '''Initialize the EpubBuilder instance. "epub_file" is the
        filename of the epub to be created.'''
        self.epub_f = zipfile.ZipFile(epub_file, 'w', zipfile.ZIP_DEFLATED)
        self.epub_f.writestr('mimetype', 'application/epub+zip')
        self.epub_f.writestr('META-INF/container.xml', self._container_xml)
        self.toc = EpubTOC()
        self.opf = _OPFfile()
        self.opf.filelist.append(_Fileinfo('toc.ncx', False))
        self.opf.filelist.append(_Fileinfo('style.css', False))
        self._authors = []
        self.opt_meta = {} # Optional metadata (other than authors)
        self.content = ''
        self.part_no = 0
        self.cont_filename = 'part%03d.html' % self.part_no

    def __enter__(self):
        'Return self for use in with ... as ... statement.'
        return self

    def __exit__(self, except_type, except_val, traceback):
        'Call finalize() and close the file.'
        try:
            self.finalize()
        finally:
            # Close again in case an exception happened in finalize()
            self.epub_f.close()
        return False

    @property
    def uid(self):
        '''Unique identifier of the ebook. (mandatory)

        If this property is left unset, a pseudo-random string will be
        generated which is long enough for collisions with existing
        ebooks to be extremely unlikely.'''
        try:
            return self._uid
        except AttributeError:
            import random
            from string import (ascii_letters, digits)
            alnum = ascii_letters + digits
            self.uid = ''.join([random.choice(alnum) for i in range(15)])
            return self._uid
    @uid.setter
    def uid(self, val):
        self._uid = _EpubMeta('dc:identifier', str(val), ('id', 'uid_id'))

    @property
    def title(self):
        '''Title of the ebook. (mandatory)

        If this property is left unset, it defaults to "Untitled".'''
        try:
            return self._title
        except AttributeError:
            self.title = 'Untitled'
            return self._title
    @title.setter
    def title(self, val):
        # If val is not a string, raise TypeError now rather than later.
        self._title = _EpubMeta('dc:title', '' + val)

    @property
    def lang(self):
        '''Language of the ebook. (mandatory)

        The language must be given as a lower-case two-letter code, optionally
        followed by a "-" and an upper-case two-letter country code.
        (e.g., "en", "en-US", "en-UK", "de", "de-DE", "de-AT")

        If this property is left unset, it defaults to "en".'''
        try:
            return self._lang
        except AttributeError:
            self.lang = 'en'
            return self._lang
    @lang.setter
    def lang(self, val):
        self._lang = _EpubLang(val)

    @property
    def author(self):
        '''Name of the author. (optional)

        If there are multiple authors, pass a list of strings.

        To control the file-as and role attribute, use author objects instead
        of strings; file-as is an alternate form of the name used for sorting.
        For a description of the role attribute, see the docstring of the
        author class.'''
        if len(self._authors) == 1:
            return self._authors[0]
        return tuple([aut for aut in self._authors])
    @author.setter
    def author(self, val):
        if isinstance(val, Author) or isinstance(val, str):
            authors = [val]
        else:
            authors = val
        for aut in authors:
            try:
                self._authors.append(Author('' + aut))
            except TypeError:
                # aut is not a string, so it should be an Author object
                self._authors.append(aut)
    @author.deleter
    def author(self):
        self._authors = []

    @property
    def date(self):
        '''Publication date. (optional)

        Must be given in "YYYY[-MM[-DD]]" format.'''
        try:
            return self.opt_meta['date']
        except KeyError:
            return None
    @date.setter
    def date(self, val):
        self.opt_meta['date'] = _EpubDate(val)
    @date.deleter
    def date(self):
        del self._date

    @property
    def rights(self):
        'Copyright/licensing information. (optional)'
        try:
            return self.opt_meta['rights']
        except KeyError:
            return None
    @rights.setter
    def rights(self, val):
        self.opt_meta['rights'] = _EpubMeta('dc:rights', '' + val)
    @rights.deleter
    def rights(self):
        del self._rights

    @property
    def publisher(self):
        'Publisher name. (optional)'
        try:
            return self.opt_meta['publisher']
        except KeyError:
            return None
    @publisher.setter
    def publisher(self, val):
        self.opt_meta['publisher'] = _EpubMeta('dc:publisher', '' + val)
    @publisher.deleter
    def publisher(self):
        del self._publisher

    @property
    def style_css(self):
        '''CSS stylesheet for the files that are generated by the EpubBuilder
        instance. Can be overwritten or extended, but not deleted.'''
        return self._style_css
    @style_css.setter
    def style_css(self, val):
        self._style_css = '' + val

    def titlepage(self, main_title = None, subtitle = None):
        '''Create a title page for the ebook. If no main_title is given,
        the title attribute of the EpubBuilder instance is used.'''
        tp = '
\n'
        if len(self._authors) >= 1:
            if len(self._authors) == 1:
                aut_str = str(self._authors[0])
            else:
                aut_str = ', '.join(str(self._authors[0:-1])) + ', and ' \
                                                       + str(self._authors[-1])
            tp += '
%s
\n' % aut_str
        if not main_title:
            main_title = str(self.title)
        tp += '
%s' % main_title
        if subtitle:
            tp += '
%s
' % subtitle
        tp += '
\n
\n'
        self.opf.filelist.insert(0, _Fileinfo('title.html',
          guide_title = 'Titlepage', guide_type = 'title-page'))
        self.epub_f.writestr('title.html', self._html.format(self.title, tp))

    def headingpage(self, heading, subtitle = None, toc_text = None):
        '''Create a page containing only a (large) heading, optionally
        with a smaller subtitle. If toc_text is not given, it defaults
        to the heading.'''
        self.new_part()
        tag = 'h%d' % min(6, self.toc.depth)
        self.content += '
'
        self.content += '<{} class="getebook-tp-title">{}'.format(tag, heading)
        if subtitle:
            self.content += '
%s
' % subtitle
        self.content += '</%s>\n' % tag
        if not toc_text:
            toc_text = heading
        self.toc.new_entry(toc_text, self.cont_filename)
        self.new_part()

    def insert_file(self, name, in_spine = False, guide_title = None,
      guide_type = None, arcname = None):
        '''Include an external file into the ebook. By default, it will
        be added to the archive under its basename; the argument
        "arcname" can be used to specify a different name.'''
        if not arcname:
            arcname = os.path.basename(name)
        self.opf.filelist.append(_Fileinfo(arcname, in_spine, guide_title,
                                 guide_type))
        self.epub_f.write(name, arcname)

    def add_file(self, arcname, str_or_bytes, in_spine = False,
      guide_title = None, guide_type = None):
        '''Add the string or bytes instance str_or_bytes to the archive
        under the name arcname.'''
        self.opf.filelist.append(_Fileinfo(arcname, in_spine, guide_title,
                                 guide_type))
        self.epub_f.writestr(arcname, str_or_bytes)

    def false_heading(self, elem):
        '''Handle a "false heading", i.e., text that appears in heading
        tags in the source even though it is not a chapter heading.'''
        elem.attrs['class'] = 'getebook-false-h'
        elem.tag = 'p'
        self.handle_elem(elem)

    def _heading(self, elem):
        '''Write a heading.'''
        # Handle paragraph heading if we have one waiting (see the
        # par_heading method). We don\'t use _handle_par_h here because
        # we merge it with the subsequent proper heading.
        try:
            par_h = self.par_h
            del self.par_h
        except AttributeError:
            toc_text = elem.text
        else:
            # There is a waiting paragraph heading, we merge it with the
            # new heading.
            toc_text = par_h.text + '. ' + elem.text
            par_h.tag = 'div'
            par_h.attrs['class'] = 'getebook-small-h'
            elem.children.insert(0, par_h)
        # Set the class attribute value.
        elem.attrs['class'] = 'getebook-chapter-h'
        self.toc.new_entry(toc_text, self.cont_filename)
        # Add heading to the epub.
        tag = 'h%d' % min(self.toc.depth, 6)
        self.content += _make_starttag(tag, elem.attrs)
        for elem in elem.children:
            self.handle_elem(elem)
        self.content += '</%s>\n' % tag

    def par_heading(self, elem):
        '''Handle a "paragraph heading", i.e., a chaper heading or part
        of a chapter heading inside paragraph tags. If it is immediately
        followed by a heading, they will be merged into one.'''
        self.par_h = elem

    def _handle_par_h(self):
        'Check if there is a waiting paragraph heading and handle it.'
        try:
            self._heading(self.par_h)
        except AttributeError:
            pass

    def handle_elem(self, elem):
        'Handle html element as supplied by getebook.EbookParser.'
        try:
            tag = elem.tag
        except AttributeError:
            # elem should be a string
            is_string = True
            tag = None
        else:
            is_string = False
        if tag in getebook._headings:
            self._heading(elem)
        else:
            # Handle waiting par_h if necessary (see par_heading)
            try:
                self._heading(self.par_h)
            except AttributeError:
                pass
            if is_string:
                self.content += elem
            elif tag == 'br':
                self.content += '
\n'
            elif tag == 'img':
                self.content += self._handle_image(elem.attrs) + '\n'
            elif tag == 'a' or tag == 'noscript':
                # Ignore tag, just write child elements
                for child in elem.children:
                    self.handle_elem(child)
            else:
                self.content += _make_starttag(tag, elem.attrs)
                for child in elem.children:
                    self.handle_elem(child)
                self.content += '</%s>' % tag
                if tag == 'p':
                    self.content += '\n'

    def _handle_image(self, attrs):
        'Returns the alt text of an image tag.'
        try:
            return attrs['alt']
        except KeyError:
            return ''

    def new_part(self):
        '''Begin a new part of the epub. Write the current html document
        to the archive and begin a new one.'''
        # Handle waiting par_h (see par_heading)
        try:
            self._heading(self.par_h)
        except AttributeError:
            pass
        if self.content:
            html = self._html.format(self.title, self.content)
            self.epub_f.writestr(self.cont_filename, html)
            self.part_no += 1
        self.content = ''
        self.cont_filename = 'part%03d.html' % self.part_no
        self.opf.filelist.append(_Fileinfo(self.cont_filename))

    def finalize(self):
        'Complete and close the epub file.'
        # Handle waiting par_h (see par_heading)
        if self._finalized:
            # Avoid finalizing twice. Otherwise, calling finalize inside
            # a with-block would lead to an exception when __exit__
            # calls finalize again.
            return
        try:
            self._heading(self.par_h)
        except AttributeError:
            pass
        if self.content:
            html = self._html.format(self.title, self.content)
            self.epub_f.writestr(self.cont_filename, html)
        self.opf.meta = [self.uid, self.lang, self.title] + self._authors
        self.opf.meta += self.opt_meta.values()
        self.epub_f.writestr('package.opf', self.opf.write_xml())
        self.epub_f.writestr('toc.ncx',
          self.toc.write_xml(self.uid, self.title, self._authors))
        self.epub_f.writestr('style.css', self._style_css)
        self.epub_f.close()
        self._finalized = True


import numpy as np
import pandas as pd
from pandas import Series, DataFrame
from scipy.spatial import distance
import matplotlib.pyplot as plt

from sklearn.cluster import DBSCAN
from sklearn import metrics
from sklearn.datasets.samples_generator import make_blobs
from sklearn.preprocessing import StandardScaler
from sklearn import decomposition  # PCA
from sklearn.metrics import confusion_matrix

import json

import ml.Features as ft
from utils import Utils

class Identifier(object):

    def __init__(self):
        columns = ['mean_height', 'min_height', 'max_height', 'mean_width', 'min_width', 'max_width', 'time', 'girth','id']
        self.data = DataFrame(columns=columns)
        self.event = []
    @staticmethod
    def subscribe(ch, method, properties, body):
        """
        prints the body message. It's the default callback method
        :param ch: keep null
        :param method: keep null
        :param properties: keep null
        :param body: the message
        :return:
        """
        #first we get the JSON from body

        #we check if it's part of the walking event

        #if walking event is completed, we

if __name__ == '__main__':
    # we setup needed params
    MAX_HEIGHT = 203
    MAX_WIDTH = 142
    SPEED = 3
    SAMPLING_RATE = 8
    mq_host = '172.26.56.122'
    queue_name = 'door_data'
    # setting up MQTT subscriber
    Utils.sub(queue_name=queue_name,callback=subscribe,host=mq_host)


"""
********************************************************************
      Test file for implementation check of CR3BP library.
********************************************************************

Last update: 21/01/2022

Description
-----------
Contains a few sample orbit propagations to test the CR3BP library.

The orbits currently found in test file include:
    - L2 southern NRHO (9:2 NRHO of Lunar Gateway Station)
    - Distant Retrograde Orbit (DRO)
    - Butterfly Orbit
    - L2 Vertical Orbit
"""

# Testing CR3BP implementation

import matplotlib.pyplot as plt
import numpy as np
from astropy import units as u
from CR3BP import getChar_CR3BP, propagate, propagateSTM

from poliastro.bodies import Earth, Moon

# Earth-Moon system properties
k1 = Earth.k.to(u.km**3 / u.s**2).value
k2 = Moon.k.to(u.km**3 / u.s**2).value
r12 = 384747.99198  # Earth-Moon distance

# Compute CR3BP characterisitic values
mu, kstr, lstr, tstr, vstr, nstr = getChar_CR3BP(k1, k2, r12)

# -- Lunar Gateway Station Orbit - 9:2 NRHO

"""
The orbit is a Near-Rectilinear Halo Orbit (NRHO) around the L2 Lagragian
point of the Earth-Moon system. The orbit presented here is a southern
sub-family of the L2-NRHO. This orbit is 9:2 resonant orbit currenly set
as the candidate orbit for the Lunar Gateway Station (LOP-G). Its called
9:2 resonant since a spacecraft would complete 9 orbits in the NRHO for
every 2 lunar month (slightly different from lunar orbit period).

The exact orbital elements presented here are from the auther's simulations.
The orbit states were obtained starting form guess solutions given in various
references. A few are provided below:

Ref: White Paper: Gateway Destination Orbit Model: A Continuous 15 Year NRHO
    Reference Trajectory - NASA, 2019
Ref: Strategies for Low-Thrust Transfer Design Based on Direct Collocation
    Techniques - Park, Howell and Folta

The NRHO are subfamily of the Halo orbits. The 'Near-Rectilinear' term comes
from the very elongated state of the orbit considering a regular Halo. Halo
orbits occur in all three co-linear equilibrum points L1,L2 and L3. They occur
in a pair of variants (nothern and southern) due to symmetry of CR3BP.
"""

# 9:2 L2 souther NRHO orbit
r0 = np.array([[1.021881345465263, 0, -0.182000000000000]])
v0 = np.array([0, -0.102950816739606, 0])
tf = 1.509263667286943

# number of points to plot
Nplt = 300
tofs = np.linspace(0, tf, Nplt)

# propagate the base trajectory
rf, vf = propagate(mu, r0, v0, tofs, rtol=1e-11)

# ploting orbit
rf = np.array(rf)

fig = plt.figure()
ax = plt.axes(projection="3d")
ax.set_box_aspect(
    (np.ptp(rf[:, 0]), np.ptp(rf[:, 1]), np.ptp(rf[:, 2]))
)  # aspect ratio is 1:1:1 in data space
# ploting the moon
ax.plot3D(1 - mu, 0, 0, "ok")
ax.set_title("L2 Southern NRHO")
ax.set_xlabel("x-axis [nd]")
ax.set_ylabel("y-axis [nd]")
ax.set_zlabel("z-axis [nd]")

ax.plot3D(rf[:, 0], rf[:, 1], rf[:, 2], "b")
plt.show()

"""
All other orbits in this section are computed from guess solutions available
in Grebow's Master and PhD thesis. He lists a quite detailed set of methods
to compute most of the major periodic orbits I have presented here. All of
them use differntial correction methods which are not yet implemented in this
library.

Ref: GENERATING PERIODIC ORBITS IN THE CIRCULAR RESTRICTED THREEBODY PROBLEM
    WITH APPLICATIONS TO LUNAR SOUTH POLE COVERAGE
    - D.Grebow 2006 (Master thesis)
Ref: TRAJECTORY DESIGN IN THE EARTH-MOON SYSTEM
    AND LUNAR SOUTH POLE COVERAGE
    - D.Grebow 2010 (PhD desertation)
"""

# -- DRO orbit

# DRO orbit states

r0 = np.array([0.783390492345344, 0, 0])
v0 = np.array([0, 0.548464515316651, 0])
tf = 3.63052604667440

# number of points to plot
Nplt = 300
tofs = np.linspace(0, tf, Nplt)

# propagate the base trajectory
rf, vf = propagate(mu, r0, v0, tofs, rtol=1e-11)

# ploting orbit
rf = np.array(rf)

fig = plt.figure()
ax = plt.axes(projection="3d")
ax.set_box_aspect(
    (np.ptp(rf[:, 0]), np.ptp(rf[:, 1]), np.ptp(rf[:, 2]))
)  # aspect ratio is 1:1:1 in data space
# ploting the moon
ax.plot3D(1 - mu, 0, 0, "ok")
ax.set_title("Distant Restrograde orbit (DRO)")
ax.set_xlabel("x-axis [nd]")
ax.set_ylabel("y-axis [nd]")
ax.set_zlabel("z-axis [nd]")

ax.plot3D(rf[:, 0], rf[:, 1], rf[:, 2], "m")
plt.show()

# -- Butterfly orbit

# Butterfly orbit states

r0 = np.array([1.03599510774957, 0, 0.173944812752286])
v0 = np.array([0, -0.0798042160573269, 0])
tf = 2.78676904546834

# number of points to plot
Nplt = 300
tofs = np.linspace(0, tf, Nplt)

# propagate the base trajectory
rf, vf = propagate(mu, r0, v0, tofs, rtol=1e-11)

# ploting orbit
rf = np.array(rf)

fig = plt.figure()
ax = plt.axes(projection="3d")
ax.set_box_aspect(
    (np.ptp(rf[:, 0]), np.ptp(rf[:, 1]), np.ptp(rf[:, 2]))
)  # aspect ratio is 1:1:1 in data space
# ploting the moon
ax.plot3D(1 - mu, 0, 0, "ok")
ax.set_title("Butterfly orbit")
ax.set_xlabel("x-axis [nd]")
ax.set_ylabel("y-axis [nd]")
ax.set_zlabel("z-axis [nd]")

ax.plot3D(rf[:, 0], rf[:, 1], rf[:, 2], "r")
plt.show()

# -- Vertical orbit

# Vertical orbit states

r0 = np.array([0.504689989562366, 0, 0.836429774762193])
v0 = np.array([0, 0.552722840538063, 0])
tf = 6.18448756121754

# number of points to plot
Nplt = 300
tofs = np.linspace(0, tf, Nplt)

# propagate the base trajectory
rf, vf = propagate(mu, r0, v0, tofs, rtol=1e-11)

# ploting orbit
rf = np.array(rf)

fig = plt.figure()
ax = plt.axes(projection="3d")
ax.set_box_aspect(
    (np.ptp(rf[:, 0]), np.ptp(rf[:, 1]), np.ptp(rf[:, 2]))
)  # aspect ratio is 1:1:1 in data space
# ploting the moon
ax.plot3D(1 - mu, 0, 0, "ok")
ax.set_title("L2 Vertical orbit")
ax.set_xlabel("x-axis [nd]")
ax.set_ylabel("y-axis [nd]")
ax.set_zlabel("z-axis [nd]")

ax.plot3D(rf[:, 0], rf[:, 1], rf[:, 2], "g")
plt.show()

# -- Propage STM

# propagate base trajectory with state-transition-matrix
STM0 = np.eye(6)
rf, vf, STM = propagateSTM(mu, r0, v0, STM0, tofs, rtol=1e-11)

# STM is a matrix of partial derivatives which are used in Newton-Raphson
# methods for trajectory design


#!/usr/bin/env python
# -*- coding: utf-8 -*-

from runner.koan import *

class AboutIteration(Koan):

    def test_iterators_are_a_type(self):
        it = iter(range(1,6))

        total = 0

        for num in it:
            total += num

        self.assertEqual(15 , total)

    def test_iterating_with_next(self):
        stages = iter(['alpha','beta','gamma'])

        try:
            self.assertEqual('alpha', next(stages))
            next(stages)
            self.assertEqual('gamma', next(stages))
            next(stages)
        except StopIteration as ex:
            err_msg = 'Ran out of iterations'

        self.assertRegex(err_msg, 'Ran out')

    # ------------------------------------------------------------------

    def add_ten(self, item):
        return item + 10

    def test_map_transforms_elements_of_a_list(self):
        seq = [1, 2, 3]
        mapped_seq = list()

        mapping = map(self.add_ten, seq)

        self.assertNotEqual(list, mapping.__class__)
        self.assertEqual(map, mapping.__class__)
        # In Python 3 built in iterator funcs return iterable view objects
        # instead of lists

        for item in mapping:
            mapped_seq.append(item)

        self.assertEqual([11, 12, 13], mapped_seq)

        # Note, iterator methods actually return objects of iter type in
        # python 3. In python 2 map() would give you a list.

    def test_filter_selects_certain_items_from_a_list(self):
        def is_even(item):
            return (item % 2) == 0

        seq = [1, 2, 3, 4, 5, 6]
        even_numbers = list()

        for item in filter(is_even, seq):
            even_numbers.append(item)

        self.assertEqual([2,4,6], even_numbers)

    def test_just_return_first_item_found(self):
        def is_big_name(item):
            return len(item) > 4

        names = ["Jim", "Bill", "Clarence", "Doug", "Eli"]
        name = None

        iterator = filter(is_big_name, names)
        try:
            name = next(iterator)
        except StopIteration:
            msg = 'Ran out of big names'

        self.assertEqual("Clarence", name)

    # ------------------------------------------------------------------

    def add(self,accum,item):
        return accum + item

    def multiply(self,accum,item):
        return accum * item

    def test_reduce_will_blow_your_mind(self):
        import functools
        # As of Python 3 reduce() has been demoted from a builtin function
        # to the functools module.

        result = functools.reduce(self.add, [2, 3, 4])
        self.assertEqual(int, result.__class__)
        # Reduce() syntax is same as Python 2

        self.assertEqual(9, result)

        result2 = functools.reduce(self.multiply, [2, 3, 4], 1)
        self.assertEqual(24, result2)

        # Extra Credit:
        # Describe in your own words what reduce does.

    # ------------------------------------------------------------------

    def test_use_pass_for_iterations_with_no_body(self):
        for num in range(1,5):
            pass

        self.assertEqual(4, num)

    # ------------------------------------------------------------------

    def test_all_iteration_methods_work_on_any_sequence_not_just_lists(self):
        # Ranges are an iterable sequence
        result = map(self.add_ten, range(1,4))
        self.assertEqual([11, 12, 13], list(result))

        try:
            file = open("example_file.txt")

            try:
                def make_upcase(line):
                    return line.strip().upper()
                upcase_lines = map(make_upcase, file.readlines())
                self.assertEqual(["THIS", "IS", "A", "TEST"] , list(upcase_lines))
            finally:
                # Arg, this is ugly.
                # We will figure out how to fix this later.
                file.close()
        except IOError:
            # should never happen
            self.fail()


from api_request import Api
from util import Util
from twocheckout import Twocheckout

class Sale(Twocheckout):
    def __init__(self, dict_):
        super(self.__class__, self).__init__(dict_)

    @classmethod
    def find(cls, params=None):
        if params is None:
            params = dict()
        response = cls(Api.call('sales/detail_sale', params))
        return response.sale

    @classmethod
    def list(cls, params=None):
        if params is None:
            params = dict()
        response = cls(Api.call('sales/list_sales', params))
        return response.sale_summary

    def refund(self, params=None):
        if params is None:
            params = dict()
        if hasattr(self, 'lineitem_id'):
            params['lineitem_id'] = self.lineitem_id
            url = 'sales/refund_lineitem'
        elif hasattr(self, 'invoice_id'):
            params['invoice_id'] = self.invoice_id
            url = 'sales/refund_invoice'
        else:
            params['sale_id'] = self.sale_id
            url = 'sales/refund_invoice'
        return Sale(Api.call(url, params))

    def stop(self, params=None):
        if params is None:
            params = dict()
        if hasattr(self, 'lineitem_id'):
            params['lineitem_id'] = self.lineitem_id
            return Api.call('sales/stop_lineitem_recurring', params)
        elif hasattr(self, 'sale_id'):
            active_lineitems = Util.active(self)
            if dict(active_lineitems):
                result = dict()
                i = 0
                for k, v in active_lineitems.items():
                    lineitem_id = v
                    params = {'lineitem_id': lineitem_id}
                    result[i] = Api.call('sales/stop_lineitem_recurring', params)
                    i += 1
                response = { "response_code": "OK",
                             "response_message": str(len(result)) + " lineitems stopped successfully"
                }
            else:
                response = {
                    "response_code": "NOTICE",
                    "response_message": "No active recurring lineitems"
                }
        else:
            response = { "response_code": "NOTICE",
                          "response_message": "This method can only be called on a sale or lineitem"
            }
        return Sale(response)

    def active(self):
        active_lineitems = Util.active(self)
        if dict(active_lineitems):
            result = dict()
            i = 0
            for k, v in active_lineitems.items():
                lineitem_id = v
                result[i] = lineitem_id
                i += 1
            response = { "response_code": "ACTIVE",
                         "response_message": str(len(result)) + " active recurring lineitems"
            }
        else:
            response = {
                "response_code": "NOTICE","response_message":
                "No active recurring lineitems"
            }
        return Sale(response)

    def comment(self, params=None):
        if params is None:
            params = dict()
        params['sale_id'] = self.sale_id
        return Sale(Api.call('sales/create_comment', params))

    def ship(self, params=None):
        if params is None:
            params = dict()
        params['sale_id'] = self.sale_id
        return Sale(Api.call('sales/mark_shipped', params))


import json
import os

from flask import request, g, render_template, make_response, jsonify, Response
from helpers.raw_endpoint import get_id, store_json_to_file
from helpers.groups import get_groups
from json_controller import JSONController
from main import app
from pymongo import MongoClient, errors

HERE = os.path.dirname(os.path.abspath(__file__))

# setup database connection
def connect_client():
    """Connects to Mongo client"""
    try:
        return MongoClient(app.config['DB_HOST'], int(app.config['DB_PORT']))
    except errors.ConnectionFailure as e:
        raise e

def get_db():
    """Connects to Mongo database"""
    if not hasattr(g, 'mongo_client'):
        g.mongo_client = connect_client()
        g.mongo_db = getattr(g.mongo_client, app.config['DB_NAME'])
        g.groups_collection = g.mongo_db[os.environ.get('DB_GROUPS_COLLECTION')]
    return g.mongo_db

@app.teardown_appcontext
def close_db(error):
    """Closes connection with Mongo client"""
    if hasattr(g, 'mongo_client'):
        g.mongo_client.close()

# Begin view routes
@app.route('/')
@app.route('/index/')
def index():
    """Landing page for SciNet"""
    return render_template("index.html")

@app.route('/faq/')
def faq():
    """FAQ page for SciNet"""
    return render_template("faq.html")

@app.route('/leaderboard/')
def leaderboard():
    """Leaderboard page for SciNet"""
    get_db()
    groups = get_groups(g.groups_collection)
    return render_template("leaderboard.html", groups=groups)

@app.route('/ping', methods=['POST'])
def ping_endpoint():
    """API endpoint determines potential article hash exists in db

    :return: status code 204 -- hash not present, continue submission
    :return: status code 201 -- hash already exists, drop submission
    """
    db = get_db()
    target_hash = request.form.get('hash')
    if db.raw.find({'hash': target_hash}).count():
        return Response(status=201)
    else:
        return Response(status=204)

@app.route('/articles')
def ArticleEndpoint():
    """Eventual landing page for searching/retrieving articles"""
    if request.method == 'GET':
        return render_template("articles.html")

@app.route('/raw', methods=['POST'])
def raw_endpoint():
    """API endpoint for submitting raw article data

    :return: status code 405 - invalid JSON or invalid request type
    :return: status code 400 - unsupported content-type or invalid publisher
    :return: status code 201 - successful submission
    """
    # Ensure post's content-type is supported
    if request.headers['content-type'] == 'application/json':
        # Ensure data is a valid JSON
        try:
            user_submission = json.loads(request.data)
        except ValueError:
            return Response(status=405)
        # generate UID for new entry
        uid = get_id()
        # store incoming JSON in raw storage
        file_path = os.path.join(
                        HERE,
                        'raw_payloads',
                        str(uid)
                    )
        store_json_to_file(user_submission, file_path)
        # hand submission to controller and return Resposne
        db = get_db()
        controller_response = JSONController(user_submission, db=db, _id=uid).submit()
        return controller_response

    # User submitted an unsupported content-type
    else:
        return Response(status=400)

#@TODO: Implicit or Explicit group additions? Issue #51 comments on the issues page
#@TODO: Add form validation
@app.route('/requestnewgroup/', methods=['POST'])
def request_new_group():
    # Grab submission form data and prepare email message
    data = request.json
    msg = "Someone has request that you add {group_name} to the leaderboard \
        groups. The groups website is {group_website} and the submitter can \
        be reached at {submitter_email}.".format(
                                            group_name=data['new_group_name'],
                                            group_website=data['new_group_website'],
                                            submitter_email=data['submitter_email'])
    return Response(status=200)
    '''
    try:
        email(
            subject="SciNet: A new group has been requested",
            fro="no-reply@scinet.osf.io",
            to='harry@scinet.osf.io',
            msg=msg)
        return Response(status=200)
    except:
        return Response(status=500)
    '''

# Error handlers
@app.errorhandler(404)
def not_found(error):
    return make_response(jsonify( { 'error': 'Page Not Found' } ), 404)

@app.errorhandler(405)
def method_not_allowed(error):
    return make_response(jsonify( { 'error': 'Method Not Allowed' } ), 405)


Analisis Konten Media Sosial Twitter Sarana Pendidikan di Indonesia Study Kasus Ruang Guru

Sekolah Tinggi Ilmu Administrasi Mataram

Twitter users in Indonesia are one of the biggest twitter users in the World. The use of Twitter in Indonesia, is often used in various activities, one of which is in the field of education. The @ruangguru account is a twitter account that is used to deliver content related to the Teacher's Room application. In Indonesia, Ruang Guru is the largest educational platform that can be enjoyed by the people of Indonesia, so the research objective is to analyze @ruangguru's Twitter content as a means of education in Indonesia, and what form of content or twet delivered by the @ruangguru account to users and other communities. This type of research uses descriptive qualitative research, with data collection methods used, namely with data capture containing content from the @ruangguru twitter account, and then analyzed using the Nvivo 12 application. The results of the research address the social media content Twitter @ruangguru containing information as an alternative learning in encouraging the provision of educational facilities in Indonesia. Ruang Guru received a good response from active twitter users who followed the @ruangguru account in providing or expanding access to quality education through technology that is not limited by time and place and can encourage quality education in Indonesia.


Strategi Pengelolaan Objek Wisata Mangrove Pandansari Sebagai Salah Satu Pendapatan Asli Daerah Kabupaten Brebes

Dwian Hartomi Akta Padma Eldo
Azra Fadila Prabowo

pengelolaan daerah governments stakeholders community

This paper aims to see how the local government of Brebes Regency manages the Mangrove Sari tourist sites by using the Planning, Organizing, Actuating, Controlling (POAC). The research method in this paper uses a descriptive qualitative approach. The author conducted interviews directly with stakeholders such as the Brebes local government and also the community that manages the Sari Mangrove tourism site. The aim is to see how the strategies carried out by local governments and also the practice in the field whether it is going according to plan or not. The results showed that the local government has not been maximized in optimizing Pandansari Tourism Objects as one of the original revenue of the Brebes Regency. In addition the local government in this case the Department of Tourism and Culture is still not effective in carrying out coordination and direction for future development with the management of the tourism object in this case the local community group. Therefore, some input that can be given is to improve coordination with the management of attractions and to draft long-term and short-term development plans for Pandansari Mangrove Tourism Objects.


Pola Komunikasi Pemerintahan Kabupaten Kulon Progo dalam Meningkatkan Pendapatan Asli Daerah Tahun 2014-2018

sarmito mito
Dyah Mutiarin
Achmad Nurmandi

research analyzed communication komunikasi indicators

This study aims to determine how the communication patterns carried out by the government of Kulon Progo to increase local revenue (PAD). This research uses descriptive qualitative method, how many indicators in this study were analyzed using Nvivo 12 Plus software. Data collection is done through observation, interview, and documentation. This research was conducted in Kulon Progo Regency, Provision of the Special Region of Yogyakarta, involving the Regent, TAPD, BAPPEDA, BKAD, and DPRD. The results of this study show a positive trend in increasing PAD kulon progo from the period 2014-2018. Good communication is carried out by the Kulon Progo government to increase PAD, by conducting internal and external communication. Internal communication between institutions that are leading sectors in the effort to increase PAD, and external communication with the community to form a joint commitment to the success of efforts to increase PAD, and with the private sector through a Memorandum of Understanding (MoU), this is done as a means and supporting infrastructure in efforts to increase PAD.


Studi Komparasi Survei Kepuasan Masyarakat (SKM) Terhadap Pelayanan Publik Tahun 2019 (Studi di Dinas Dukcapil Kota Mataram dan Dukcapil Kabupaten Lombok Barat)

rahmad hidayat hidayat
M. Taufik Rahcman
M. Rahmatul Burhan

indonesia services service public pelayanan

Public services that should have been better in every country, in every province and even in every region to the villages, but apparently our minds still see and lead to a complicated and complex public service process. This shows that the condition of public services in Indonesia is still far from the expectations of the community. As for the formulation of the problem in this study, namely: How do the comparisons / comparisons of the Community Satisfaction Survey (SKM) Against Public Services in 2019 (Study at the Mataram City Dukcapil and Dukcapil Services in West Lombok Regency)? and what are the inhibiting and supporting factors in public services conducted by the Mataram City Dukcapil Office and West Lombok Dukcapil District ?. This research is a type of survey research. Based on the results of the study note the comparison / comparison of the Community Satisfaction Survey (SKM) on Public Services in 2019 in the West Lombok Regency Dukcapil and Mataram City Dukcapil Services obtained the value of service quality with the category "B" which indicates the community satisfaction in the Population and Civil Registry Office of West Lombok Regency get the title "good". Whereas in the Department of Population and Civil Registry, the City of Mataram also received a good title but with a higher value. The inhibiting and supporting factors in public services conducted by the West Lombok Regency Dukcapil and the Mataram City Dukcapil Office are related to the variety of service time perceived to be quite long. In addition, even though the tariff has been free, it still gets a maximum score.


Prints from an Important Chicago Collection


We can assist with getting hired.


This is the most important thing and we have to be able to tell the truth. We can only aspire to better peace of mind and security by applying ourselves in something that we enjoy. It might seem like a neat trick to do some uninspiring task for a few hours each day but have you considered what you are missing out on? Have you thought about doing this for the rest of your life? What kind of life do you want? So whatever we have to do to get by is one thing, but when it comes to building your personal vision you need to think about you.


<@ } @> <@ if (typeof productSameNextDayDelMsg != "undefined" && productSameNextDayDelMsg != "" && productSameNextDayDelMsg=='orderblock.productNextDayDelMsg'){ @>


Afghanistan Albania Algeria American Samoa Andorra Angola Anguilla Antarctica Antigua and Barbuda Argentina Armenia Aruba Australia Austria Azerbaijan Bahamas Bahrain Bangladesh Barbados Belarus Belgium Belize Benin Bermuda Bhutan Bolivia Bosnia and Herzegovina Botswana Bouvet Island Brazil British Indian Ocean Territory Brunei Darussalam Bulgaria Burkina Faso Burundi Cambodia Cameroon Canada Cape Verde Cayman Islands Central African Republic Chad Chile China Christmas Island Cocos (Keeling) Islands Colombia Comoros Congo Congo, The Democratic Republic of the Cook Islands Costa Rica Cote d'Ivoire Croatia Cuba Cyprus Czech Republic Djibouti Dominica Dominican Republic Ecuador Egypt El Salvador Equatorial Guinea Eritrea Estonia Ethiopia Europe Falkland Islands (Malvinas) Fiji France French Guiana French Polynesia French Southern Territories Gabon Gambia Georgia Germany Ghana Gibraltar Greece Grenada Guadeloupe Guam Guatemala Guernsey Guinea Guinea-Bissau Guyana Haiti Heard Island and McDonald Islands Holy See (Vatican City State) Honduras Hong Kong Hungary Iceland India Indonesia Iran, Islamic Republic of Iraq Ireland Isle of Man Israel Italy Jamaica Japan Jersey Jordan Kazakhstan Kenya Kiribati Korea, Democratic People's Republic of Korea, Republic of Kuwait Kyrgyzstan Lao People's Democratic Republic Latvia Lebanon Lesotho Liberia Libyan Arab Jamahiriya Liechtenstein Lithuania Luxembourg Macao Macedonia Madagascar Malawi Malaysia Maldives Mali Malta Marshall Islands Martinique Mauritania Mauritius Mayotte Mexico Micronesia, Federated States of Moldova, Republic of Monaco Mongolia Montenegro Montserrat Morocco Mozambique Myanmar Namibia Nauru Nepal Netherlands Netherlands Antilles New Caledonia New Zealand Nicaragua Niger Nigeria Niue Norfolk Island Northern Mariana Islands Norway Oman Pakistan Palau Palestinian Territory Panama Papua New Guinea Paraguay Peru Philippines Pitcairn Poland Portugal Puerto Rico Qatar Reunion Romania Russian Federation Rwanda Saint Helena Saint Kitts and Nevis Saint Lucia Saint Pierre and Miquelon Saint Vincent and the Grenadines Samoa San Marino Sao Tome and Principe Saudi Arabia Senegal Serbia Seychelles Sierra Leone Singapore Slovakia Slovenia Solomon Islands Somalia South Africa South Georgia and the South Sandwich Islands Spain Sri Lanka Sudan Suriname Svalbard and Jan Mayen Swaziland Sweden Switzerland Syrian Arab Republic Taipei Tajikistan Tanzania, United Republic of Thailand Timor-Leste Togo Tokelau Tonga Trinidad and Tobago Tunisia Turkey Turks and Caicos Islands Tuvalu Uganda Ukraine United Arab Emirates United Kingdom United States Uruguay Uzbekistan Vanuatu Venezuela Vietnam Virgin Islands, British Virgin Islands, U.S. Wallis and Futuna Yemen Zambia Zimbabwe


Marianne Musgrove says:


PolyPro 4000D


They hung a sign up in our town
If you live it up, you wont live it down
So she left Monte Rio, son
Just like a bullet leaves a gun
With her charcoal eyes and Monroe hips
She went and took that California trip
Oh, the moon was gold, her hair like wind
Said, Dont look back, just come on, Jim
Oh, you got to hold on, hold on
You gotta hold on
Take my hand, Im standing right here
You gotta hold on
Well, he gave her a dimestore watch
And a ring made from a spoon
Everyones looking for someone to blame
When you share my bed, you share my name
Well, go ahead and call the cops
You dont meet nice girls in coffee shops
She said, Baby, I still love you
Sometimes theres nothin left to do
Oh, but you got to hold on, hold on
Babe, you gotta hold on
And take my hand, Im standing right here
You gotta hold on
Well, God bless your crooked little heart
St. Louis got the best of me
I miss your broken china voice
How I wish you were still here with me
Oh, you build it up, you wreck it down
Then you burn your mansion to the ground
Oh, theres nothing left to keep you here
But when youre falling behind in this big blue world
Oh, youve got to hold on, hold on
Babe, you gotta hold on
Take my hand, Im standing right here
You gotta hold on
Down by the Riverside motel
Its 10 below and falling
By a 99-cent store
She closed her eyes and started swaying
But its so hard to dance that way
When its cold and theres no music
Oh, your old hometowns so far away
But inside your head theres a record thats playing
A song called Hold On, hold on
Babe, you gotta hold on
Take my hand, Im standing right there
You gotta hold on
You gotta hold on, hold on
Babe, you gotta hold on
Take my hand, Im standing right there
You gotta hold on
You gotta hold on, hold on
Babe, you gotta hold on
And take my hand, Im standing right here
You gotta hold on
You gotta hold on, hold on
Babe, you gotta hold on
And take my hand, Im standing right here
You gotta hold on
You gotta hold on
You gotta hold on
You gotta hold on
You gotta hold on
You gotta hold on, baby
You gotta hold on, girl
You gotta hold on
You gotta hold on


Well I remember it as though it were a meal ago
Said Tommy the Cat as he reeled back to clear whatever foreign matter may have nestled its way into his mighty throat
Many a fat alley rat had met its demise while staring point blank down the cavernous barrel of this awesome prowling machine
Truly a wonder of nature this urban predator. Tommy the cat had many a story to tell, but it was a rare occasion such as this that he did
She came asliding on down the alleyway like butter drippin off a hot biscuit
The aroma, the mean scent, was enough to arouse suspicion in even the oldest of tigers that hung around the hot spot in those days
The sight was beyond belief. Many a head snapped for double even triple, takes as this vivacious feline made her her way into the delta of the alleyway where the most virile of the young tabbys were known to hang out. They hung out in droves
Such a multitude of masculinity could only be found in one place... and that was OMalleys Alley.
The air was thick with catcalls
But not even a muscle in her neck did twitch as she sauntered straight to behind the alleyway. She knew what she wanted. She was looking for that stud bull
She was looking for that He-cat. And that was me
Tommy the Cat is my name and I say unto thee:
Say baby do you wanna lay down with me?
Say baby do you wanna lay down by my side?
Ah baby do you wanna lay down with me?
Say baby
Say baby
Say baby do you wanna lay down with me?
Say baby do you wanna lay down by my side?
Ah baby do you wanna lay down with me?
Say baby, say baby
Say baby do you wanna lay down with me?
Say baby do you wanna lay down by my side?
Ah baby do you wanna lay down with me?
Say b-b-b-b-b-b-b-baby
Say baby do you wanna lay down with me?
Say baby do you wanna lay down by my side?
Ah baby do you wanna lay down with me?
Say baby!
Say baby!
Say baby do you wanna lay down with me?
Say baby do you wanna lay down by my side?
Ah baby do you wanna lay down with me?
Say baby!
Say baby!
Say baby do you wanna lay down with me?
Say baby do you wanna lay down by my side?
Ah baby do you wanna lay down with me?
Say baby!
Say baby!


Whats he building in there?
What the hell is he building in there?
He has subscriptions to those magazines
He never waves when he goes by
Hes hiding something from the rest of us
Hes all to himself, I think I know why
He took down the tire swing from the pepper tree
He has no children of his own, you see
He has no dog, he has no friends and his lawn is dying
And what about all those packages he sends?
Whats he building in there?
With that hook light on the stairs
Whats he building in there?
Ill tell you one thing: hes not building a playhouse for the children
Whats he building in there?
Now whats that sound from underneath the door?
Hes pounding nails into a hardwood floor
And I swear to God I heard someone moaning low
And I keep seeing the blue light of a TV show
He has a router and a table saw
And you wont believe what Mr. Sticha saw!
Theres poison underneath the sink, of course
But theres also enough formaldehyde to choke a horse
Whats he building in there?
What the hell is he building in there?
I heard he has an ex-wife
In some place called Mayors Income, Tennessee
And he used to have a consulting business in Indonesia
But whats he building in there?
He has no friends, but he gets a lot of mail
Ill bet he spent a little time in jail
I heard he was up on the roof last night signaling with a flashlight
And whats that tune hes always whistling?
Whats he building in there?
Whats he building in there?
We have a right to know!


Operator, number please, its been so many years
Will she remember my old voice while I fight the tears?
Hello, hello there, is this Martha? This is old Tom Frost
And I am calling long distance, dont worry about the cost
Cause its been forty years or more, now Martha please recall
Meet me out for coffee where well talk about it all
And those were the days of roses, of poetry and prose
And Martha all I had was you and all you had was me
There was no tomorrows, we packed away our sorrows
And we saved them for a rainy day
And I feel so much older now, youre much older too
Hows your husband? And hows your kids?
You know that I got married too
Lucky that you found someone to make you feel secure
Cause we were all so young and foolish, now we are mature
And those were the days of roses, of poetry and prose
And Martha, all I had was you and all you had was me
There was no tomorrows, we packed away our sorrows
And we saved them for a rainy day
And I was always so impulsive, I guess that I still am
And all that really mattered then was that I was a man
I guess that our being together was never meant to be
But Martha, Martha, I love you, cant you see?
And those were the days of roses, of poetry and prose
And Martha all I had was you and all you had was me
There was no tomorrows, we packed away our sorrows
And we saved them for a rainy day
And I remember quiet evenings, trembling close to you


Hey Charlie, Im pregnant and living on 9th Street
Right above a dirty bookstore off Euclid Avenue
And I stopped takin dope, and I quit drinkin whiskey
And my old man plays the trombone and works out at the track
He says that he loves me even though its not his baby
He says that hell raise him up like he would his own son
And he gave me a ring that was worn by his mother
And he takes me out dancin every Saturday night
And hey Charlie, I think about you every time I pass a fillin station
On account of all the grease you used to wear in your hair
And I still have that record of Little Anthony and the Imperials
But someone stole my record player--now, how do you like that?
Hey Charlie, I almost went crazy after Mario got busted
I went back to Omaha to live with my folks
But everyone I used to know was either dead or in prison
So I came back to Minneapolis, this time I think Im gonna stay
Hey Charlie, I think Im happy for the first time since my accident
I wish I had all the money we used to spend on dope
Id buy me a used car lot, and I wouldnt sell any of em
Id just drive a different car every day, dependin on how I feel
Hey Charlie, for chrissakes, if you want to know the truth of it
I dont have a husband, he dont play the trombone
I need to borrow money to pay this lawyer, and Charlie, hey
Ill be eligible for parole come Valentines day


Edna Milton in a drop-dead suit
Dutch Pink on a downtown train
Two-dollar pistol but the gun wont shoot
Im in the corner on the pouring rain
Sixteen men on a deadmans chest
And Ive been drinking from a broken cup
Two pairs of pants and a mohair vest
Im full of bourbon, I cant stand up
Hey little bird, fly away home
Your house is on fire, your children are alone
Hey little bird, fly away home
Your house is on fire, your children are alone
Schiffer broke a bottle on Morgans head
And Ive been stepping on the devils tail
Across the stripes of a full moons head
Through the bars of a Cuban jail
Bloody fingers on a purple knife
A flamingo drinking from a cocktail glass
Im on the lawn with someone elses wife
Admire the view from up on top of the mast
Hey little bird, fly away home
Your house is on fire, your children are alone
Hey little bird, fly away home
Your house is on fire, your children are alone
Hey little bird, fly away home
Your house is on fire, your children are alone
Hey little bird, fly away home
Your house is on fire, your children are alone
Yellow sheets on a Hong Kong bed
Stazybo horn and a Slingerland ride
To the carnival is what she said
A hundred dollars makes it dark inside
Edna Milton in a drop-dead suit
Dutch Pink on a downtown train
Two-dollar pistol but the gun wont shoot
Im in the corner on the pouring rain
Hey little bird, fly away home
Your house is on fire, your children are alone
Hey little bird, fly away home
Your house is on fire, your children are alone


Well, my time went so quickly
I went lickety-splitly out to my ol fifty-five
As I pulled away slowly, feeling so holy
God knows I was feeling alive
Now the suns coming up
Im riding with Lady Luck
Freeway cars and trucks
Stars beginning to fade
And I lead the parade
Just a-wishing Id stayed a little longer
Oh Lord, let me tell you that the feeling getting stronger
And its six in the morning
Gave me no warning, I had to be on my way
Well, theres trucks all a-passing me, and the lights all a-flashin
Im on my way home from your place
And now the suns coming up
Im riding with Lady Luck
Freeway cars and trucks
Stars beginning to fade
And I lead the parade
Just a-wishing Id stayed a little longer
Oh Lord, let me tell you the feeling getting stronger
And my time went so quickly
I went lickety-splitly out to my ol fifty-five
As I pulled away slowly, feeling so holy
God knows I was feeling alive
And now the suns coming up
Im riding with Lady Luck
Freeway cars and trucks
Freeway cars and trucks
Freeway cars and trucks


Outside another yellow moon
Punched a hole in the nighttime, yes
I climb through the window and down to the street
Im shining like a new dime
The downtown trains are full
With all those Brooklyn girls
They try so hard to break out of their little worlds
You wave your hand and they scatter like crows
They have nothing that will ever capture your heart
Theyre just thorns without the rose
Be careful of them in the dark
Oh if I was the one you chose to be your only one
Oh baby cant you hear me now?
Cant you hear me now?
Will I see you tonight
On a downtown train?
Every night its just the same
You leave me lonely, now
I know your window and I know its late
I know your stairs and your doorway
I walk down your street and past your gate
I stand by the light at the four-way
You watch em as they fall
Oh baby, they all have heart attacks
They stay at the carnival
But theyll never win you back
Will I see you tonight
On a downtown train?
Where every night, every night is just the same
Oh baby
Will I see you tonight
On a downtown train?
All of my dreams just fall like rain
Oh, baby, on a downtown train
Will I see you tonight
On a downtown train?
Where every night, every night is just the same
Oh baby
Will I see you tonight
On a downtown train?
All of my dreams just fall like rain
Oh, on a downtown train
Oh, on a downtown train
Oh, on a downtown train
Oh, on a downtown train
Downtown train


0 Switzerland world_cup_appearance 11_(first_in_1934)


0 Switzerland world_cup_Quarter-finals 7th_place


0 Switzerland has_player Yann_Sommer


0 Yann_Sommer caps 47


Abstract: Tachycardiomyopathy (TCM) is a largely reversible form of non-ischemic heart failure. The underlying mechanism are, however, still today poorly understood. Recent data indicate distinct changes in mitochondrial distribution in these patients, compared to other non-ischemic cardiomyopathies.This study investigated underlying mechanisms in mitochondrial dynamics in endomyocardial biopsy samples (EMB) from patients with TCM and compared them to patients with dilated cardiomyopathy (DCM), which show similar clinical features.


Abstract: Oxidative modifications of low-density lipoprotein (ox-LDL) play a key role in initial steps of atheroprogression possibly via specific scavenger receptors on inflammatory and endothelial cells. Amongst others, CD68 might play a crucial role in this leading to fatty streak formation.


Abstract: Hepatocellular carcinoma (HCC) represents the second most common cause of cancer-related deaths worldwide, not least due to its high chemoresistance. The long non-coding RNA nuclear paraspeckle assembly transcript 1 (NEAT1), localised in nuclear paraspeckles, has been shown to enhance chemoresistance in several cancer types. Since data on NEAT1 in HCC chemosensitivity are completely lacking and chemoresistance is linked to poor prognosis, we aimed to study NEAT1 expression in HCC chemoresistance and its link to HCC prognosis.


Abstract: Endothelial cells exposed to the Random Positioning Machine (RPM) reveal three different phenotypes. They grow as a two-dimensional monolayer and form three-dimensional (3D) structures such as spheroids and tubular constructs. As part of the ESA-SPHEROIDS project we want to understand how endothelial cells (ECs) react and adapt to long-term microgravity.


Abstract: Recently, we have demonstrated that episodic hypoxia occurs in kidneys of mice challenged repetitively with the immunosuppressant cyclosporine A (CsA), in analogy to humans on CsA treatment. However, the molecular consequences of episodic hypoxia remain poorly defined, as is its impact on cell survival. Here, we systematically study cell response to episodic, as compared to single course hypoxia.


Abstract: Adipocyte hypertrophy in obesity is associated with inflammation and adipose tissue fibrosis which both contribute to metabolic diseases. Mechanisms regulating lipid droplet expansion are poorly understood. Knock down of the scaffold protein beta 2 syntrophin (SNTB2) increases lipid droplet size of 3T3-L1 adipocytes and the physiological relevance of SNTB2 in adipose tissue morphology and metabolic health was analyzed herein.


Abstract: The two-pore-domain potassium channel TASK-1 regulates atrial action potential duration. Due to the atrium-specific expression of TASK-1 in the human heart and the functional upregulation of TASK-1 currents in atrial fibrillation (AF), TASK-1 represents a promising target for the treatment of AF. Therefore, detailed knowledge of the molecular determinants of TASK-1 inhibition may help to identify new drugs for the future therapy of AF. In the current study, the molecular determinants of TASK-1 inhibition by the potent and antiarrhythmic compound A293 (AVE1231) were studied in detail.


Abstract: Different approaches have been considered to improve heart reconstructive medicine and direct delivery of pluripotent stem cell-derived cardiomyocytes (PSC-CMs) appears to be highly promising in this context. However, low cell persistence post-transplantation remains a bottleneck hindering the approach. Here, we present a novel strategy to overcome the low engraftment of PSC-CMs during the early post-transplantation phase into the myocardium of both healthy and cryoinjured syngeneic mice.


with pale blue berries. in these peaceful shades--


when i peruse the conquered fame of heroes, and the victories of mighty generals, i do not envy the generals,


and so on. then a worthless gaud or two,


to hide the orb of truth--and every throne


tijd om te gaan slapen olly


Video monitoring and alarm verification technology


System and method for alarm signaling during alarm system destruction


Alarm system with two-way voice


Alarm signaling technology


Remote device control and energy monitoring by analyzing and applying rules


Drone detection systems


Monitoring system control technology using multiple sensors, cameras, lighting devices, and a thermostat


Alarm probability


Microsoft slaps down Intel #39;s Itanium chip THE CINDERELLA of Intel #39;s chips, the Itanium, has been told it can #39;t go to the Microsoft #39;s supercomputer ball. That #39;s according to a report on Infoworld, which claims that the software giant will only support


Kerry-Kerrey Confusion Trips Up Campaign (AP) AP - John Kerry, Bob Kerrey. It's easy to get confused.


Hey mate, we're moving offshore too! Australia's IT News reports the findings of a recent survey in which more than 20 percent of company execs said they were considering or recommending offshore outsourcing. Outsourcing Blog


Nepal blockade 'blow to tourism' Nepal tour operators say tourists cancelled millions of  dollars of bookings due to the rebel blockade of Kathmandu.


GAME DAY RECAP Sunday, August 22 Aramis Ramirez hit a three-run homer, Moises Alou also homered and the Chicago Cubs beat the Houston Astros 11-6 on Sunday in the testy conclusion of a three-game series between the NL Central rivals.


Unilever Cuts Profit Forecasts on Sluggish Sales (Update3) Unilever, the world #39;s largest maker of food and soap, cut its full-year earnings forecast after sales of ice cream and cold drinks slumped in Europe and demand for beauty and laundry products slowed.


Scotch Whisky eyes Asian and Eastern European markets (AFP) AFP - A favourite tipple among connoisseurs the world over, whisky is treated with almost religious reverence on the Hebridean island of Islay, home to seven of Scotland's single malt distilleries.


Ig Nobel awards honor weird science advances If a herring asks you to pull his finger, be very afraid. Thats one of the lessons derived from this years Ig Nobel awards ceremony, an event that honors offbeat scientific achievements.


Livewire: Fantasy Sports Leagues Thrive Online (Reuters) Reuters - Take 15 million armchair athletes,\add a steady stream of statistics and mix in a healthy dollop\of trash talk. Post it all on the Internet and you've got a  #36;3\billion industry built around imaginary sports teams.


Dream TV Screen, Now in Size Large The most desired electronic gift item for this holiday season is a plasma TV. You might, however, want to consider something that wasn't even in the running: L.C.D.


Ok, a few more... sorry I just had so much fun that day


Wrapped round my finger like a ring


sp|Q6GZX4|001R_FRG3G Putative transcription factor 001R OS=Frog virus 3 (isolate Goorha) OX=654924 GN=FV3-001R PE=4 SV=1


sp|Q6GZX3|002L_FRG3G Uncharacterized protein 002L OS=Frog virus 3 (isolate Goorha) OX=654924 GN=FV3-002L PE=4 SV=1


sp|Q197F8|002R_IIV3 Uncharacterized protein 002R OS=Invertebrate iridescent virus 3 OX=345201 GN=IIV3-002R PE=4 SV=1


sp|Q6GZX2|003R_FRG3G Uncharacterized protein 3R OS=Frog virus 3 (isolate Goorha) OX=654924 GN=FV3-003R PE=3 SV=1


sp|Q6GZX1|004R_FRG3G Uncharacterized protein 004R OS=Frog virus 3 (isolate Goorha) OX=654924 GN=FV3-004R PE=4 SV=1


sp|Q6GZX0|005R_FRG3G Uncharacterized protein 005R OS=Frog virus 3 (isolate Goorha) OX=654924 GN=FV3-005R PE=4 SV=1


sp|Q91G88|006L_IIV6 Putative KilA-N domain-containing protein 006L OS=Invertebrate iridescent virus 6 OX=176652 GN=IIV6-006L PE=3 SV=1


sp|Q6GZW9|006R_FRG3G Uncharacterized protein 006R OS=Frog virus 3 (isolate Goorha) OX=654924 GN=FV3-006R PE=4 SV=1


TITLE 9 Signs a Person Is Really Happy With Their Life SUB Genuine satisfaction is so much more than a smile on your face. CAPTION a woman is typing on a laptop computer


TITLE Learn to Affect Customer Behavior Using the Theory of Planned Behavior CAPTION a woman with long hair is looking at the camera


TITLE How to connect to MongoDB using a promise in Node.js CAPTION a person holding a pair of hands on a brick wall


TITLE How To Learn To Solve Data Science Problems Like a Pro and Become Employable SUB The most practical way to learn data science (Includes best-in-class references) CAPTION a person using a laptop on a desk


TITLE 9 Creative Ways to Separate Life and Work at Home CAPTION a girl sitting on a bed looking at the camera


Most residents evacuated by sinkhole could return in a week

The new public works commissioner in a suburban Detroit county is declaring all hands on deck to fix a broken sewer line that has created a major sinkhole and forced the evacuation of 22 homes.

The new public works commissioner in a suburban Detroit county is declaring "all hands on deck" to fix a broken sewer line that has created a major sinkhole and forced the evacuation of 22 homes.
Former U.S. Rep. Candice Miller used her first day in office Sunday to urge Macomb County residents to reduce water consumption while crews create a bypass to get around the bad pipe. The short-term fix could take a month.
During a news conference at the sinkhole site in Fraser, Miller said she doesn't have all the answers but promised "transparency."
The sinkhole was discovered Dec. 24, just weeks after Miller was elected to lead the county's public works department. Three homes likely are beyond repair, though residents in 19 homes could return in a week.


South Korea says woman tied to scandal arrested in Denmark

South Korean prosecutors said Monday the daughter of the confidante of disgraced President Park Geun-hye has been arrested in Denmark and authorities are working to get her returned home in connection with a huge corruption scandal.
Park was impeached last month by lawmakers amid public fury over prosecutors' allegations that the president conspired to allow her longtime friend, Choi Soon-sil, to extort companies and control the government.
Denmark police arrested Choi's daughter, Chung Yoo-ra, on the weekend on charges of staying their illegally.
South Korea had asked Interpol to search for Chung because she didn't return home to answer questions about the scandal.
South Korea's Yonhap news agency reports that Chung, a former member of the national equestrian team, allegedly took advantage of her mother's relationship with Park to get unwarranted favors from Seoul's Ewha Womans University.


Aurora police investigating fatal New Year's Eve drive-by shooting

A 26-year old Aurora man was fatally shot in a New Year's Eve drive-by shooting on the city's near southeast side, police officials said Sunday.
Police are seeking information on the death of Andrew Dockery of the 400 block of Jackson Street, Aurora.
Dockery was standing outside when shots were fired just before 7 p.m. Dec. 31 from an unknown vehicle that was traveling eastbound in the 400 block of Melrose Avenue, according to a news release.
Aurora police reported they do have information that the vehicle was being followed by a newer, gray Nissan Sentra or car of a similar model, and they are seeking information from the occupants of that vehicle.
Both vehicles apparently had more than one occupant, police said, but witnesses could not provide descriptions of suspects. Investigators have yet to determine if the gray car was involved in the shooting. According to police, investigators believe the people in the other vehicle probably have information on what occurred, and they would like to talk with them.
According to the release, police have no definite motive in the shooting. They said gang involvement has not been ruled out.
An autopsy is pending at the Kane County Coroner's Office.
Aurora police are seeking the public's assistance. Anyone with information is asked to call Aurora Police Investigations at (630) 256-5500 or Aurora Area Crime Stoppers at (630) 892-1000. Calls to Crime Stoppers that lead to an arrest qualify for a cash reward of up to $5,000. Tips can also be submitted through the Aurora Police Department's free app available from iTunes, the Android Market, or Amazon App Store.
Linda Girardi is a freelance reporter for The Beacon-News.


adding mafand to datasets

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_4868). All of your documentation changes will be reflected on that endpoint.

I'm addding the MAFAND dataset by Masakhane based on the paper/repository below:

Paper: https://aclanthology.org/2022.naacl-main.223/
Code: https://github.com/masakhane-io/lafand-mt

Please, help merge this

Everything works except for creating dummy data file


Complete tags of superglue dataset card

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_4867). All of your documentation changes will be reflected on that endpoint.

Related to #4479 .


amend docstring for dunder

display dunder method in docsting with underlines an not bold markdown.


Dataset Viewer issue for MoritzLaurer/multilingual_nli

dataset-viewer

Related to the dataset viewer on huggingface.co

### Link

_No response_

### Description

I've just uploaded a new dataset to the hub and the viewer does not work for some reason, see here: https://huggingface.co/datasets/MoritzLaurer/multilingual_nli

It displays the error:
```
Status code:   400
Exception:     Status400Error
Message:       The dataset does not exist.
```

Weirdly enough the dataviewer works for an earlier version of the same dataset. The only difference is that it is smaller, but I'm not aware of other changes I have made: https://huggingface.co/datasets/MoritzLaurer/multilingual_nli_test

Do you know why the dataviewer is not working?

### Owner

_No response_


Allow pathlib PoxisPath in Dataset.read_json

enhancement

New feature or request

**Is your feature request related to a problem? Please describe.**
```
from pathlib import Path
from datasets import Dataset
ds = Dataset.read_json(Path('data.json'))
```
causes an error
```
AttributeError: 'PosixPath' object has no attribute 'decode'
```

**Describe the solution you'd like**

It should be able to accept PosixPath and read the json from inside.


TFDS wiki_dialog dataset to Huggingface dataset

dataset request

Requesting to add a new dataset

@albertvillanova any help ? The linked dataset is in beam format which is similar to wikipedia dataset in huggingface that you  scripted..

Nvm, I was able to port it to huggingface datasets, will upload to the hub soon

## Adding a Dataset
- **Name:** *Wiki_dialog*
- **Description: https://github.com/google-research/dialog-inpainting#:~:text=JSON%20object%2C%20for-,example,-%3A
- **Paper: https://arxiv.org/abs/2205.09073
- **Data: https://github.com/google-research/dialog-inpainting
- **Motivation:** *Research and Development on biggest corpus of dialog data*

Instructions to add a new dataset can be found [here](https://github.com/huggingface/datasets/blob/main/ADD_NEW_DATASET.md).


Using disk for memory with the method `from_dict`

enhancement

New feature or request

**Is your feature request related to a problem? Please describe.**
I start with an empty dataset. In a loop, at each iteration, I create a new dataset with the method `from_dict` (based on some data I load) and I concatenate this new dataset with the one at the previous iteration. After some iterations, I have an OOM error.

**Describe the solution you'd like**
The method `from_dict` loads the data in RAM. It could be good to add an option to use the disk instead.

**Describe alternatives you've considered**
To solve the problem, I have to do an intermediate step where I save the new datasets at each iteration with `save_to_disk`. Once it's done, I open them all and concatenate them.


Add collection3 dataset


can't install using conda on Windows 10

bug

Something isn't working

## Describe the bug
I wanted to install using conda or Anaconda navigator. That didn't work, so I had to install using pip.

## Steps to reproduce the bug
conda install -c huggingface -c conda-forge datasets

## Expected results
Should have indicated successful installation.

## Actual results
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
... took forever, so I cancelled it with ctrl-c

## Environment info
- `datasets` version: 2.4.0  # after installing with pip
- Platform: Windows-10-10.0.19044-SP0
- Python version: 3.9.12
- PyArrow version: 9.0.0
- Pandas version: 1.4.2
- conda version: 4.13.0

conda info

     active environment : base
    active env location : G:\anaconda2022
            shell level : 1
       user config file : C:\Users\michael\.condarc
 populated config files : C:\Users\michael\.condarc
          conda version : 4.13.0
    conda-build version : 3.21.8
         python version : 3.9.12.final.0
       virtual packages : __cuda=11.1=0
                          __win=0=0
                          __archspec=1=x86_64
       base environment : G:\anaconda2022  (writable)
      conda av data dir : G:\anaconda2022\etc\conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/pytorch/win-64
                          https://conda.anaconda.org/pytorch/noarch
                          https://conda.anaconda.org/huggingface/win-64
                          https://conda.anaconda.org/huggingface/noarch
                          https://conda.anaconda.org/conda-forge/win-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://conda.anaconda.org/anaconda-fusion/win-64
                          https://conda.anaconda.org/anaconda-fusion/noarch
                          https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
          package cache : G:\anaconda2022\pkgs
                          C:\Users\michael\.conda\pkgs
                          C:\Users\michael\AppData\Local\conda\conda\pkgs
       envs directories : G:\anaconda2022\envs
                          C:\Users\michael\.conda\envs
                          C:\Users\michael\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/4.13.0 requests/2.27.1 CPython/3.9.12 Windows/10 Windows/10.0.19044
          administrator : False
             netrc file : None
           offline mode : False


Input: [COOKIE name] CART [COOKIE Description]

Output: The association with your shopping cart.

Customer Service / FAQ - SportsFan Outlet


Input: [COOKIE name] CATEGORY_INFO [COOKIE Description]

Output: Stores the category info on the page, that allows to display pages more quickly.

Customer Service / FAQ - SportsFan Outlet


Input: [COOKIE name] COMPARE [COOKIE Description]

Output: The items that you have in the Compare Products list.

Customer Service / FAQ - SportsFan Outlet


Input: [COOKIE name] CURRENCY [COOKIE Description]

Output: Your preferred currency

Customer Service / FAQ - SportsFan Outlet


Input: [COOKIE name] CUSTOMER [COOKIE Description]

Output: An encrypted version of your customer id with the store.

Customer Service / FAQ - SportsFan Outlet


Input: [COOKIE name] CUSTOMER_AUTH [COOKIE Description]

Output: An indicator if you are currently logged into the store.

Customer Service / FAQ - SportsFan Outlet


Input: [COOKIE name] CUSTOMER_INFO [COOKIE Description]

Output: An encrypted version of the customer group you belong to.

Customer Service / FAQ - SportsFan Outlet


Input: [COOKIE name] CUSTOMER_SEGMENT_IDS [COOKIE Description]

Output: Stores the Customer Segment ID

Customer Service / FAQ - SportsFan Outlet


Input: [COOKIE name] EXTERNAL_NO_CACHE [COOKIE Description]

Output: A flag, which indicates whether caching is disabled or not.

Customer Service / FAQ - SportsFan Outlet


Input: [COOKIE name] FRONTEND [COOKIE Description]

Output: You sesssion ID on the server.

Customer Service / FAQ - SportsFan Outlet


The manager fired the cleaner because


The manager told the hairdresser that

she expected something better.
he expected something better.


The mover missed the call from the assistant because


The farmer offered apples to the housekeeper, because

he might like them.
she might like them.


The nurse examined the farmer for injuries because


The laborer was surprised that the auditor appeared because

he said everything was fine.
she said everything was fine.


The carpenter made a desk for the clerk because


The developer argued with the designer because

she did not like the design.
he did not like the design.


The mechanic looked down on the cashier because

he had a bad breath.
she had a bad breath.


The manager asked the accountant for the books because

she felt the work was wrong.
he felt the work was wrong.


Question: how old is aran bell

- Breaking News: Ted Bell and Hollywood. I recently had the tremendous honor of interviewing bestselling author Ted Bell. Known for his popular Alex Hawke franchise, Bell is one of the true must-read thriller authors in the genre today.

Liberty Bell Bells were rung when the Declaration of Independence was read on July 8, 1776. While there is no record that the Liberty Bell was rung, most historians believe it was rung with the other bells. In the 1830's, the bell was used as a symbol by abolitionist societies, who called it the Liberty Bell.

American customer satisfaction index: Taco Bell restaurants in the U.S. 2000-2017 This statistic shows the American customer satisfaction index scores of Taco Bell restaurants in the United States from 2000 to 2015. Taco Bell's ACSI score was 72 in 2014. The limited-service restaurant industry was not measured in 2004.Taco Bell.n 2012, there were a total of 5,980 Taco Bell restaurants in operation. The majority (5,695) of those stores were located in the United States. The remaining 285 Taco Bell restaurants were located in the other 26 countries where Taco Bell operates.

- $45,000: The fee you must pay to Taco Bell to own a franchise. $1,200,000: The average start up and construction costs to build a new Taco Bell. Could be as high as $2.5 million. $175,000: How much it costs to acquire an already existing Taco Bell.

- Aran Bell, the gravity-defying 11-year old from Italy, was the winner of the Hope Award in the 2010 YAGP competition (the award for children who are too young to compete for the Grand Prix). A year later, he won the Junior Grand Prix. He has attended prestigious summer programs and festivals.

KFC Franchise How much does it cost to open a Taco Bell Franchise? The investment required to open a Taco Bell Franchise is between $585,300-$1,205,600. There is an initial franchise fee of $25,000 which grants you the license to run a business under the Taco Bell name.

What Are the Benefits of Eating Green Bell Peppers? While red bell peppers contain larger amounts of antioxidants, green bell peppers are a significant source as well. Green bell peppers also contain zeaxanthin, which keeps your eyes healthy and might reduce your risk of age-related eye disorders. Tips Eat raw green bell peppers with low-fat ranch dressing or hummus for a nutritious and tasty side dish or snack. Add chopped bell peppers to spaghetti sauce or your favorite lasagna recipe. Stir chopped green bell peppers into scrambled eggs or layer raw strips of the pepper onto a lean turkey or chicken sandwich.

Bloodborne Forbidden Woods progression bug caused by multiplayer summon A progression bug in Bloodborne is in the works, according to Sony and From Software. The issue occurs when players activate a multiplayer session in the Forbidden Woods using the Sinister Resonant Bell or Small Resonant Bell.

- My bell ringer board. 1  My bell ringer board. 2  Procedure. 3  As soon as the bell rings, my students are expected to be seated, with paper (or bell ringer notebook) and pen ready. If working on a project is the bell ringer, they go to their respective stations to work as instructed on the board.


Question: what is goop company

- The original waterless hand cleaner, Goop. Multi-purpose Hand Cleaner is non-toxic and biodegradable, and has been a fixture in house-holds for generations. LEARN MORE. Uses the power of all natural citrus cleaners that are non-toxic and biodegradable to remove the toughest of soils.

Company Overview of Ndola Lime Company Limited Ndola Lime Company Limited was formerly known as Northern Rhodesia Lime Company Limited. The company was founded in 1931 and is based in Ndola, Zambia. Ndola Lime... Ndola Lime Company Limited manufactures limestone products.

What is a 'Wholly Owned Subsidiary' A company whose common stock is 100% owned by another company, called the parent company. A company can become a wholly owned subsidiary through acquisition by the parent company or spin off from the parent company.

DBAs Versus Subsidiaries DBA Is Just a Name. When your company establishes a DBA, you're not creating a separate company. You're creating a name -- legally referred to as a fictitious name -- under which your company will do business. For example, say you own a fast-food restaurant company called Betty's Burgers.owever, a subsidiary offers multiple advantages. You can share ownership of a subsidiary with other companies or individuals, something that's not possible with a DBA, and it is easier to sell or to spin off into a totally independent company. A subsidiary also provides legal protection for the parent company.

50 Examples of Catchy and Creative Slogans Whether you are looking for company, business, product or a green environmental slogan, a slogan development company can create a tagline which fits your company perfectly. However make sure to do your homework first before ordering a package.t is important to tell the slogan company what tone you want your slogan to be (serious, funny, and lighthearted). You should also give a brief background about your company or project and what you want your slogan to convey.

Ska Investment Properties LLC Ska Investment Properties LLC is an entity registered at Texas with company number 0801619147. Company is incorporated on 29th June 2012. Company

United States of America Book a HotelInOutCheck RatesUnderstandGeography Climate History Government and politics Culture Holidays Units of measure Electricity For more informationGet inLaw and bureaucracy Planning and pre-arrival documentation Arriving in the United States By plane By car By bus By boat By train By footGet aroundBy plane By train By boat By car By bus By recreational vehicle (RV) By motorcycle By thumb 5-1-1SeeNatural scenery Historical attractions Monuments and architecture Museums and galleries ItinerariesDo BuyMoney Currency exchange and banking Credit and debit cards Gift cards Sales tax Places for shopping Major U.S. retail chains Costs Tipping Comics and cartoonsEatTypes of restaurants Types of service Types of food Etiquette SmokingSleep Stay SafePolice Texting and driving 911 Emergency services Border Patrol Natural disasters Gay and lesbian Illicit drugs Racism Islam Curfew Animals Prostitution Firearms Do I need to have a current EAN.UCC prefix to obtain a GLN? If a company does not have an assigned EAN.UCC company prefix, contact the UCC to obtain a membership application. If a company already has a current EAN.UCC company prefix, the company may go directly to GS1 to become a member. You will not need to

- How to draft a company constitution What is a company constitution? The constitution is a formal document, drawn up by those applying to register the company, that sets out the rules for running the company. If a constitution has been adopted, it must be filed with the Companies Office in order for the company to be registered and incorporated with that constitution. Before the COMPANIES ACT 1993, the constitution was known as the Articles of Association. (For more information on registering and incorporating a company, see related article How to form a company). Is a company required to have its own constitution? No, there is no requirement for a company to have a constitution. It is up to those forming the company to decide whether or not they will draw up a constitution for it. If there is no constitution then the company is governed by the COMPANIES ACT 1993.

Arden Theatre Company (Philadelphia) Arden Theatre Company (Philadelphia) For the theatre company located in Stockton-on-Tees, England, see Arden Theatre Company (Stockton-on-Tees).


aciclovir

valaciclovir

penciclovir

famciclovir

idoxuridine

trifluridine

ganciclovir

foscarnet

cidofovir

Antiviral drugs: current state of the art. The chemotherapy of virus infections has definitely come of age. There are now 15 antiviral agents that have been formally licensed for the treatment of human immunodeficiency virus infections (zidovudine, didanosine, zalcitabine, stavudine, lamivudine, abacavir, nevirapine, delavirdine, efavirenz, saquinavir, ritonavir, indinavir, nelfinavir, amprenavir, lopinavir) and several others, such as tenofovir disoproxil, emtricitabine, capravirine, emivirine, T-20 (pentafuside) and AMD3100 (bicyclam) are under clinical development. Lamivudine has been approved, and several other compounds (such as adefovir dipivoxil, emtricitabine and entecavir) are under clinical development, for the treatment of hepatitis B virus infections. Among the anti-herpesvirus agents , aciclovir , valaciclovir , penciclovir , famciclovir , idoxuridine , trifluridine and brivudin are used in the treatment of herpes simplex virus and varicella-zoster virus infections , and ganciclovir , foscarnet , cidofovir , fomivirsen and maribavir ( the latter in the developmental stage ) are used in the treatment of cytomegalovirus infections . Following amantadine and rimantadine, the neuraminidase inhibitors, zanamivir and oseltamivir, have now become available for the therapy and prophylaxis of influenza virus infections, and so is ribavirin for the treatment of respiratory syncytial virus infections and the combination of ribavirin with interferon-alpha for the treatment of hepatitis C virus infections.


D-cycloserine

lidocaine

Tetrahydroaminoacridine and D-cycloserine fail to alleviate the water maze spatial navigation defect induced by hippocampal inactivation.  The present study examined the efficacy of single and combined treatment with an anticholinesterase , tetrahydroaminoacridine ( i.p . ) , and a glycine-B site partial agonist , D-cycloserine ( i.p . ; a positive allosteric modulator of NMDA receptors ) , in alleviating the deficit in water maze spatial navigation induced by electrolytic lesion of the medial septum or lidocaine infusion into the dorsal hippocampi . In medial septum-lesioned rats, a combination of tetrahydroaminoacridine 3 mg kg(-1) and D-cycloserine 10 mg kg(-1) facilitated acquisition of the water maze test more effectively than either of the drugs alone. Single or combined treatment with tetrahydroaminoacridine 3 mg kg(-1) and D-cycloserine 10 mg kg(-1) had no effect on the water maze deficit induced by hippocampal lidocaine infusion. These results suggest that combined treatment with tetrahydroaminoacridine and D-cycloserine can effectively stimulate water maze spatial navigation, and that functioning of the hippocampus is a prerequisite for this effect.


vincristine

cyclophosphamide

actinomycin-D

[Rhabdomyosarcoma of the bladder: a case report]. A 15-year-old man with the chief complaint of general fatigue was referred to our hospital on November 11, 1993. Bilateral percutaneous nephrostomy was performed for postrenal anuria. X-ray examinations revealed a huge intrapelvic tumor, and it was histopathologically diagnosed as rhabdomyosarcoma by transrectal needle biopsy. He was initially treated with combination chemotherapy regimen of vincristine , actinomycin-D and cyclophosphamide ( VAC therapy ) . Pelvic exenteration was performed on December 15, 1993. Histopathological findings were alveolar rhabdomyosarcoma with degenerative change and partial necrosis. After the operation, he was given two course of VAC therapy. In May, 1994, brain metastasis occurred, so 4 courses of VAC therapy were administered. For a very short period, neurological symptoms improved, but he died of pneumonia on November 15, 1994.